Lines Matching refs:handle

170 static void  __DEMOWin_add_node              (DEMOWinInfo *handle);
171 static void __DEMOWin_delete_node (DEMOWinInfo *handle);
278 DEMOWinInfo *handle; in DEMOWinCreateWindow() local
284 handle = (DEMOWinInfo *)__DEMOWin_alloc(sizeof(DEMOWinInfo)); in DEMOWinCreateWindow()
285 ASSERTMSG(handle, "DEMOWIN: FAILED TO ALLOCATE WINDOW!\n"); in DEMOWinCreateWindow()
287 handle->x1 = x1; in DEMOWinCreateWindow()
288 handle->y1 = y1; in DEMOWinCreateWindow()
289 handle->x2 = x2; in DEMOWinCreateWindow()
290 handle->y2 = y2; in DEMOWinCreateWindow()
292 handle->pixel_width = (u16)(x2 - x1 + 1); in DEMOWinCreateWindow()
293 handle->pixel_height = (u16)(y2 - y1 + 1); in DEMOWinCreateWindow()
295 handle->caption = caption; in DEMOWinCreateWindow()
297handle->char_width = (u16)(((handle->pixel_width)/FONT_CHAR_WIDTH)-1); // Save a column for p… in DEMOWinCreateWindow()
298handle->char_height = (u16)(((handle->pixel_height)/FONT_CHAR_HEIGHT)-2); // Save first line for… in DEMOWinCreateWindow()
300handle->x_cal = (u16)((handle->pixel_width - (handle->char_width * FONT_CHAR_WIDTH) + 1) / … in DEMOWinCreateWindow()
301handle->y_cal = (u16)(((handle->pixel_height - FONT_CHAR_HEIGHT) - (handle->char_height * FO… in DEMOWinCreateWindow()
309 OSReport("x1: %4d\n", handle->x1); in DEMOWinCreateWindow()
310 OSReport("y1: %4d\n", handle->y1); in DEMOWinCreateWindow()
311 OSReport("x2: %4d\n", handle->x2); in DEMOWinCreateWindow()
312 OSReport("y2: %4d\n", handle->y2); in DEMOWinCreateWindow()
313 OSReport("pixel_width : %4d\n", handle->pixel_width); in DEMOWinCreateWindow()
314 OSReport("pixel_height: %4d\n", handle->pixel_height); in DEMOWinCreateWindow()
315 OSReport("char_width : %4d\n", handle->char_width); in DEMOWinCreateWindow()
316 OSReport("char_height : %4d\n", handle->char_height); in DEMOWinCreateWindow()
317 OSReport("x_cal : %4d\n", handle->x_cal); in DEMOWinCreateWindow()
318 OSReport("y_cal : %4d\n", handle->y_cal); in DEMOWinCreateWindow()
322 handle->num_scroll_lines = scroll; in DEMOWinCreateWindow()
324 handle->total_lines = (u16)(handle->char_height + handle->num_scroll_lines); in DEMOWinCreateWindow()
326 handle->curr_output_line = 0; in DEMOWinCreateWindow()
327 handle->curr_output_col = 0; in DEMOWinCreateWindow()
328 handle->curr_view_line = 0; in DEMOWinCreateWindow()
331 handle->refresh = func; in DEMOWinCreateWindow()
334 handle->flags = 0; in DEMOWinCreateWindow()
337 handle->priority = DEMOWIN_PRIORITY_FORE; in DEMOWinCreateWindow()
340handle->buffer = (u8 *)__DEMOWin_alloc(sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinCreateWindow()
341 ASSERTMSG(handle->buffer, "DEMOWinCreateWindow(): Unable to allocation buffer!\n"); in DEMOWinCreateWindow()
343 … memset((void *)(handle->buffer), 0x20, sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinCreateWindow()
346 DEMOWinSetWindowColor(handle, DEMOWIN_COLOR_RESET, 0, 0, 0, 0); in DEMOWinCreateWindow()
349 handle->cursor_line = -1; in DEMOWinCreateWindow()
352 handle->parent = NULL; in DEMOWinCreateWindow()
356 __DEMOWin_add_node(handle); in DEMOWinCreateWindow()
358 return(handle); in DEMOWinCreateWindow()
375 void DEMOWinDestroyWindow(DEMOWinInfo *handle) in DEMOWinDestroyWindow() argument
379 ASSERTMSG(handle, "DEMOWinDestroyWindow(): NULL handle!\n"); in DEMOWinDestroyWindow()
384 __DEMOWin_delete_node(handle); in DEMOWinDestroyWindow()
392 __DEMOWin_free(handle->buffer); in DEMOWinDestroyWindow()
394 __DEMOWin_free(handle); in DEMOWinDestroyWindow()
410 void DEMOWinOpenWindow(DEMOWinInfo *handle) in DEMOWinOpenWindow() argument
413 ASSERTMSG(handle, "DEMOWinOpenWindow(): NULL handle!\n"); in DEMOWinOpenWindow()
414 handle->flags |= DEMOWIN_FLAG_VISIBLE; in DEMOWinOpenWindow()
427 void DEMOWinCloseWindow(DEMOWinInfo *handle) in DEMOWinCloseWindow() argument
429 ASSERTMSG(handle, "DEMOWinCloseWindow(): NULL handle!\n"); in DEMOWinCloseWindow()
430 handle->flags &= ~DEMOWIN_FLAG_VISIBLE; in DEMOWinCloseWindow()
444 void DEMOWinSetWindowColor(DEMOWinInfo *handle, u32 item, u8 r, u8 g, u8 b, u8 a) in DEMOWinSetWindowColor() argument
447 ASSERTMSG(handle, "DEMOWinSetWinColor(): NULL window handle\n"); in DEMOWinSetWindowColor()
452 handle->cap.r = r; in DEMOWinSetWindowColor()
453 handle->cap.g = g; in DEMOWinSetWindowColor()
454 handle->cap.b = b; in DEMOWinSetWindowColor()
455 handle->cap.a = a; in DEMOWinSetWindowColor()
459 handle->border.r = r; in DEMOWinSetWindowColor()
460 handle->border.g = g; in DEMOWinSetWindowColor()
461 handle->border.b = b; in DEMOWinSetWindowColor()
462 handle->border.a = a; in DEMOWinSetWindowColor()
466 handle->bkgnd.r = r; in DEMOWinSetWindowColor()
467 handle->bkgnd.g = g; in DEMOWinSetWindowColor()
468 handle->bkgnd.b = b; in DEMOWinSetWindowColor()
469 handle->bkgnd.a = a; in DEMOWinSetWindowColor()
473 handle->bkgnd.r = __DEF_BKGND_R; in DEMOWinSetWindowColor()
474 handle->bkgnd.g = __DEF_BKGND_G; in DEMOWinSetWindowColor()
475 handle->bkgnd.b = __DEF_BKGND_B; in DEMOWinSetWindowColor()
476 handle->bkgnd.a = __DEF_BKGND_A; in DEMOWinSetWindowColor()
478 handle->cap.r = __DEF_CAP_R; in DEMOWinSetWindowColor()
479 handle->cap.g = __DEF_CAP_G; in DEMOWinSetWindowColor()
480 handle->cap.b = __DEF_CAP_B; in DEMOWinSetWindowColor()
481 handle->cap.a = __DEF_CAP_A; in DEMOWinSetWindowColor()
483 handle->border.r = __DEF_BORDER_R; in DEMOWinSetWindowColor()
484 handle->border.g = __DEF_BORDER_G; in DEMOWinSetWindowColor()
485 handle->border.b = __DEF_BORDER_B; in DEMOWinSetWindowColor()
486 handle->border.a = __DEF_BORDER_A; in DEMOWinSetWindowColor()
507 void DEMOWinLogPrintf(DEMOWinInfo *handle, char *fmt, ...) in DEMOWinLogPrintf() argument
534handle->curr_output_line = (u16)((handle->curr_output_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
535handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
536 handle->curr_output_col = 0; in DEMOWinLogPrintf()
539 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
540 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinLogPrintf()
545 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
546 handle->buffer[index] = (u8)buffer[i]; in DEMOWinLogPrintf()
547 handle->curr_output_col++; in DEMOWinLogPrintf()
550 if (handle->curr_output_col >= handle->char_width) in DEMOWinLogPrintf()
552 handle->curr_output_col = 0; in DEMOWinLogPrintf()
553handle->curr_output_line = (u16)((handle->curr_output_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
554handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
557 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
558 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinLogPrintf()
577 void DEMOWinPrintfXY(DEMOWinInfo *handle, u16 col, u16 row, char *fmt, ...) in DEMOWinPrintfXY() argument
591 if ((row >= handle->char_height) || (col >= handle->char_width)) in DEMOWinPrintfXY()
604 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinPrintfXY()
607 buffer_row = (u16)((buffer_row + row) % handle->total_lines); in DEMOWinPrintfXY()
609 string[handle->char_width - col] = 0; in DEMOWinPrintfXY()
611 index = (u16)(buffer_row * handle->char_width + col); in DEMOWinPrintfXY()
615 handle->buffer[index+i] = (u8)string[i]; in DEMOWinPrintfXY()
633 void DEMOWinScrollWindow(DEMOWinInfo *handle, u32 dir) in DEMOWinScrollWindow() argument
642 ASSERTMSG(handle, "DEMOWinScrollWindow(): NULL handle!\n"); in DEMOWinScrollWindow()
643 ASSERTMSG(handle->num_scroll_lines, "DEMOWinScrollWindow(): No scrollback buffer!\n"); in DEMOWinScrollWindow()
651 … n = (u16)(((handle->curr_view_line + handle->total_lines) - 1) % handle->total_lines); in DEMOWinScrollWindow()
653 … v_start = (u16)(((n + handle->total_lines) - handle->char_height+1) % handle->total_lines); in DEMOWinScrollWindow()
655 if (v_start != handle->curr_output_line) in DEMOWinScrollWindow()
657 handle->curr_view_line = n; in DEMOWinScrollWindow()
664 if (handle->curr_view_line != handle->curr_output_line) in DEMOWinScrollWindow()
666handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinScrollWindow()
673 handle->curr_view_line = handle->curr_output_line; in DEMOWinScrollWindow()
697 void DEMOWinBringToFront(DEMOWinInfo *handle) in DEMOWinBringToFront() argument
702 ASSERTMSG(handle, "DEMOWinBringToFront(): NULL handle!\n"); in DEMOWinBringToFront()
704 if (DEMOWIN_PRIORITY_FORE == handle->priority) in DEMOWinBringToFront()
718 handle->priority = DEMOWIN_PRIORITY_FORE; in DEMOWinBringToFront()
734 void DEMOWinSendToBack(DEMOWinInfo *handle) in DEMOWinSendToBack() argument
737 ASSERTMSG(handle, "DEMOWinSendToBack(): NULL handle!\n"); in DEMOWinSendToBack()
738 handle->priority = DEMOWIN_PRIORITY_BACK; in DEMOWinSendToBack()
753 void DEMOWinClearRow(DEMOWinInfo *handle, u16 row) in DEMOWinClearRow() argument
761 ASSERTMSG(handle, "DEMOWinClearRow(): NULL handle!\n"); in DEMOWinClearRow()
765 if (row >= handle->char_height) in DEMOWinClearRow()
773 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinClearRow()
776 buffer_row = (u16)((buffer_row + row) % handle->total_lines); in DEMOWinClearRow()
778 index = (u16)(buffer_row * handle->char_width); in DEMOWinClearRow()
780 for (i=0; i<handle->char_width; i++) in DEMOWinClearRow()
782 handle->buffer[index+i] = 0x20; in DEMOWinClearRow()
802 void DEMOWinClearWindow(DEMOWinInfo *handle) in DEMOWinClearWindow() argument
810 ASSERTMSG(handle, "DEMOWinClearWindow(): NULL handle!\n"); in DEMOWinClearWindow()
816 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinClearWindow()
818 for (i=0; i<handle->char_height; i++) in DEMOWinClearWindow()
820 index = (u16)(buffer_row * handle->char_width); in DEMOWinClearWindow()
821 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinClearWindow()
822 buffer_row = (u16)((buffer_row + 1) % handle->total_lines); in DEMOWinClearWindow()
840 void DEMOWinClearBuffer(DEMOWinInfo *handle) in DEMOWinClearBuffer() argument
844 ASSERTMSG(handle, "DEMOWinClearBuffer(): NULL handle!\n"); in DEMOWinClearBuffer()
848 memset(handle->buffer, 0x20, sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinClearBuffer()
1121 static void __DEMOWin_add_node(DEMOWinInfo *handle) in __DEMOWin_add_node() argument
1124 ASSERTMSG(handle, "__add_node(): you're adding a NULL node!\n"); in __DEMOWin_add_node()
1129 __first_node = __last_node = __curr_node = handle; in __DEMOWin_add_node()
1131 handle->next = NULL; in __DEMOWin_add_node()
1132 handle->prev = NULL; in __DEMOWin_add_node()
1139 __last_node->next = handle; in __DEMOWin_add_node()
1140 handle->next = NULL; in __DEMOWin_add_node()
1141 handle->prev = __last_node; in __DEMOWin_add_node()
1142 __last_node = handle; in __DEMOWin_add_node()
1145 handle->flags |= DEMOWIN_FLAG_ATTACHED; in __DEMOWin_add_node()
1160 static void __DEMOWin_delete_node(DEMOWinInfo *handle) in __DEMOWin_delete_node() argument
1163 ASSERTMSG(handle, "__delete_node(): you're deleting a NULL node!\n"); in __DEMOWin_delete_node()
1167 if (__first_node == handle) in __DEMOWin_delete_node()
1170 if (handle->next) in __DEMOWin_delete_node()
1172 __first_node = (handle->next); in __DEMOWin_delete_node()
1173 (handle->next)->prev = NULL; in __DEMOWin_delete_node()
1182 else if (__last_node == handle) in __DEMOWin_delete_node()
1185 if (handle->prev) in __DEMOWin_delete_node()
1188 __last_node = (handle->prev); in __DEMOWin_delete_node()
1189 (handle->prev)->next = NULL; in __DEMOWin_delete_node()
1201 (handle->prev)->next = (handle->next); in __DEMOWin_delete_node()
1202 (handle->next)->prev = (handle->prev); in __DEMOWin_delete_node()
1206 handle->flags = (handle->flags & (~DEMOWIN_FLAG_ATTACHED)); in __DEMOWin_delete_node()
1311 menu->handle = DEMOWinCreateWindow((s16)x, in DEMOWinCreateMenuWindow()
1321 (menu->handle)->parent = menu; in DEMOWinCreateMenuWindow()
1350 if (menu->handle) in DEMOWinDestroyMenuWindow()
1352 DEMOWinCloseWindow(menu->handle); in DEMOWinDestroyMenuWindow()
1353 DEMOWinDestroyWindow(menu->handle); in DEMOWinDestroyMenuWindow()
1355 menu->handle = NULL; in DEMOWinDestroyMenuWindow()
1375 DEMOWinInfo *handle; // Pointer to window associated with this menu in DEMOWinMenuChild() local
1384 handle = menu->handle; in DEMOWinMenuChild()
1385 pad = &(menu->handle)->pad; in DEMOWinMenuChild()
1389 DEMOWinOpenWindow(handle); in DEMOWinMenuChild()
1390 DEMOWinBringToFront(handle); in DEMOWinMenuChild()
1477 if ((menu->items[menu->curr_pos].link)->handle) in DEMOWinMenuChild()
1480 … ((menu->items[menu->curr_pos].link)->handle)->x1 = (u16)(handle->x1 + 20); in DEMOWinMenuChild()
1481 … ((menu->items[menu->curr_pos].link)->handle)->y1 = (u16)(handle->y1 + 20); in DEMOWinMenuChild()
1494 …MOWinCreateMenuWindow(menu->items[menu->curr_pos].link, (u16)(handle->x1+20), (u16)(handle->y1+20)… in DEMOWinMenuChild()
1519 if ((menu->items[menu->curr_pos].link)->handle) in DEMOWinMenuChild()
1522 … ((menu->items[menu->curr_pos].link)->handle)->x1 = (u16)(handle->x1 + 20); in DEMOWinMenuChild()
1523 … ((menu->items[menu->curr_pos].link)->handle)->y1 = (u16)(handle->y1 + 20); in DEMOWinMenuChild()
1536 …MOWinCreateMenuWindow(menu->items[menu->curr_pos].link, (u16)(handle->x1+20), (u16)(handle->y1+20)… in DEMOWinMenuChild()
1598 handle->cursor_line = (s16)(menu->display_pos - menu->curr_pos); in DEMOWinMenuChild()
1602 handle->cursor_line = (s16)(menu->curr_pos - menu->display_pos); in DEMOWinMenuChild()
1614 DEMOWinCloseWindow(handle); in DEMOWinMenuChild()
1970 list->handle = DEMOWinCreateWindow((s16)x, in DEMOWinCreateListWindow()
1980 (list->handle)->parent = (void *)(list); in DEMOWinCreateListWindow()
2007 if (list->handle) in DEMOWinDestroyListWindow()
2009 DEMOWinCloseWindow(list->handle); in DEMOWinDestroyListWindow()
2010 DEMOWinDestroyWindow(list->handle); in DEMOWinDestroyListWindow()
2012 list->handle = NULL; in DEMOWinDestroyListWindow()