Lines Matching refs:handle

173 static void  __DEMOWin_add_node              (DEMOWinInfo *handle);
174 static void __DEMOWin_delete_node (DEMOWinInfo *handle);
281 DEMOWinInfo *handle; in DEMOWinCreateWindow() local
287 handle = (DEMOWinInfo *)__DEMOWin_alloc(sizeof(DEMOWinInfo)); in DEMOWinCreateWindow()
288 ASSERTMSG(handle, "DEMOWIN: FAILED TO ALLOCATE WINDOW!\n"); in DEMOWinCreateWindow()
290 handle->x1 = x1; in DEMOWinCreateWindow()
291 handle->y1 = y1; in DEMOWinCreateWindow()
292 handle->x2 = x2; in DEMOWinCreateWindow()
293 handle->y2 = y2; in DEMOWinCreateWindow()
295 handle->pixel_width = (u16)(x2 - x1 + 1); in DEMOWinCreateWindow()
296 handle->pixel_height = (u16)(y2 - y1 + 1); in DEMOWinCreateWindow()
298 handle->caption = caption; in DEMOWinCreateWindow()
300handle->char_width = (u16)(((handle->pixel_width)/FONT_CHAR_WIDTH)-1); // Save a column for p… in DEMOWinCreateWindow()
301handle->char_height = (u16)(((handle->pixel_height)/FONT_CHAR_HEIGHT)-2); // Save first line for… in DEMOWinCreateWindow()
303handle->x_cal = (u16)((handle->pixel_width - (handle->char_width * FONT_CHAR_WIDTH) + 1) / … in DEMOWinCreateWindow()
304handle->y_cal = (u16)(((handle->pixel_height - FONT_CHAR_HEIGHT) - (handle->char_height * FO… in DEMOWinCreateWindow()
312 OSReport("x1: %4d\n", handle->x1); in DEMOWinCreateWindow()
313 OSReport("y1: %4d\n", handle->y1); in DEMOWinCreateWindow()
314 OSReport("x2: %4d\n", handle->x2); in DEMOWinCreateWindow()
315 OSReport("y2: %4d\n", handle->y2); in DEMOWinCreateWindow()
316 OSReport("pixel_width : %4d\n", handle->pixel_width); in DEMOWinCreateWindow()
317 OSReport("pixel_height: %4d\n", handle->pixel_height); in DEMOWinCreateWindow()
318 OSReport("char_width : %4d\n", handle->char_width); in DEMOWinCreateWindow()
319 OSReport("char_height : %4d\n", handle->char_height); in DEMOWinCreateWindow()
320 OSReport("x_cal : %4d\n", handle->x_cal); in DEMOWinCreateWindow()
321 OSReport("y_cal : %4d\n", handle->y_cal); in DEMOWinCreateWindow()
325 handle->num_scroll_lines = scroll; in DEMOWinCreateWindow()
327 handle->total_lines = (u16)(handle->char_height + handle->num_scroll_lines); in DEMOWinCreateWindow()
329 handle->curr_output_line = 0; in DEMOWinCreateWindow()
330 handle->curr_output_col = 0; in DEMOWinCreateWindow()
331 handle->curr_view_line = 0; in DEMOWinCreateWindow()
334 handle->refresh = func; in DEMOWinCreateWindow()
337 handle->flags = 0; in DEMOWinCreateWindow()
340 handle->priority = DEMOWIN_PRIORITY_FORE; in DEMOWinCreateWindow()
343handle->buffer = (u8 *)__DEMOWin_alloc(sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinCreateWindow()
344 ASSERTMSG(handle->buffer, "DEMOWinCreateWindow(): Unable to allocation buffer!\n"); in DEMOWinCreateWindow()
346 … memset((void *)(handle->buffer), 0x20, sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinCreateWindow()
349 DEMOWinSetWindowColor(handle, DEMOWIN_COLOR_RESET, 0, 0, 0, 0); in DEMOWinCreateWindow()
352 handle->cursor_line = -1; in DEMOWinCreateWindow()
355 handle->parent = NULL; in DEMOWinCreateWindow()
359 __DEMOWin_add_node(handle); in DEMOWinCreateWindow()
361 return(handle); in DEMOWinCreateWindow()
378 void DEMOWinDestroyWindow(DEMOWinInfo *handle) in DEMOWinDestroyWindow() argument
382 ASSERTMSG(handle, "DEMOWinDestroyWindow(): NULL handle!\n"); in DEMOWinDestroyWindow()
387 __DEMOWin_delete_node(handle); in DEMOWinDestroyWindow()
395 __DEMOWin_free(handle->buffer); in DEMOWinDestroyWindow()
397 __DEMOWin_free(handle); in DEMOWinDestroyWindow()
413 void DEMOWinOpenWindow(DEMOWinInfo *handle) in DEMOWinOpenWindow() argument
416 ASSERTMSG(handle, "DEMOWinOpenWindow(): NULL handle!\n"); in DEMOWinOpenWindow()
417 handle->flags |= DEMOWIN_FLAG_VISIBLE; in DEMOWinOpenWindow()
430 void DEMOWinCloseWindow(DEMOWinInfo *handle) in DEMOWinCloseWindow() argument
432 ASSERTMSG(handle, "DEMOWinCloseWindow(): NULL handle!\n"); in DEMOWinCloseWindow()
433 handle->flags &= ~DEMOWIN_FLAG_VISIBLE; in DEMOWinCloseWindow()
447 void DEMOWinSetWindowColor(DEMOWinInfo *handle, u32 item, u8 r, u8 g, u8 b, u8 a) in DEMOWinSetWindowColor() argument
450 ASSERTMSG(handle, "DEMOWinSetWinColor(): NULL window handle\n"); in DEMOWinSetWindowColor()
455 handle->cap.r = r; in DEMOWinSetWindowColor()
456 handle->cap.g = g; in DEMOWinSetWindowColor()
457 handle->cap.b = b; in DEMOWinSetWindowColor()
458 handle->cap.a = a; in DEMOWinSetWindowColor()
462 handle->border.r = r; in DEMOWinSetWindowColor()
463 handle->border.g = g; in DEMOWinSetWindowColor()
464 handle->border.b = b; in DEMOWinSetWindowColor()
465 handle->border.a = a; in DEMOWinSetWindowColor()
469 handle->bkgnd.r = r; in DEMOWinSetWindowColor()
470 handle->bkgnd.g = g; in DEMOWinSetWindowColor()
471 handle->bkgnd.b = b; in DEMOWinSetWindowColor()
472 handle->bkgnd.a = a; in DEMOWinSetWindowColor()
476 handle->bkgnd.r = __DEF_BKGND_R; in DEMOWinSetWindowColor()
477 handle->bkgnd.g = __DEF_BKGND_G; in DEMOWinSetWindowColor()
478 handle->bkgnd.b = __DEF_BKGND_B; in DEMOWinSetWindowColor()
479 handle->bkgnd.a = __DEF_BKGND_A; in DEMOWinSetWindowColor()
481 handle->cap.r = __DEF_CAP_R; in DEMOWinSetWindowColor()
482 handle->cap.g = __DEF_CAP_G; in DEMOWinSetWindowColor()
483 handle->cap.b = __DEF_CAP_B; in DEMOWinSetWindowColor()
484 handle->cap.a = __DEF_CAP_A; in DEMOWinSetWindowColor()
486 handle->border.r = __DEF_BORDER_R; in DEMOWinSetWindowColor()
487 handle->border.g = __DEF_BORDER_G; in DEMOWinSetWindowColor()
488 handle->border.b = __DEF_BORDER_B; in DEMOWinSetWindowColor()
489 handle->border.a = __DEF_BORDER_A; in DEMOWinSetWindowColor()
510 void DEMOWinLogPrintf(DEMOWinInfo *handle, char *fmt, ...) in DEMOWinLogPrintf() argument
537handle->curr_output_line = (u16)((handle->curr_output_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
538handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
539 handle->curr_output_col = 0; in DEMOWinLogPrintf()
542 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
543 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinLogPrintf()
548 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
549 handle->buffer[index] = (u8)buffer[i]; in DEMOWinLogPrintf()
550 handle->curr_output_col++; in DEMOWinLogPrintf()
553 if (handle->curr_output_col >= handle->char_width) in DEMOWinLogPrintf()
555 handle->curr_output_col = 0; in DEMOWinLogPrintf()
556handle->curr_output_line = (u16)((handle->curr_output_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
557handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinLogPrintf()
560 … index = (u16)(handle->curr_output_line * handle->char_width + handle->curr_output_col); in DEMOWinLogPrintf()
561 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinLogPrintf()
580 void DEMOWinPrintfXY(DEMOWinInfo *handle, u16 col, u16 row, char *fmt, ...) in DEMOWinPrintfXY() argument
594 if ((row >= handle->char_height) || (col >= handle->char_width)) in DEMOWinPrintfXY()
607 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinPrintfXY()
610 buffer_row = (u16)((buffer_row + row) % handle->total_lines); in DEMOWinPrintfXY()
612 string[handle->char_width - col] = 0; in DEMOWinPrintfXY()
614 index = (u16)(buffer_row * handle->char_width + col); in DEMOWinPrintfXY()
618 handle->buffer[index+i] = (u8)string[i]; in DEMOWinPrintfXY()
636 void DEMOWinScrollWindow(DEMOWinInfo *handle, u32 dir) in DEMOWinScrollWindow() argument
645 ASSERTMSG(handle, "DEMOWinScrollWindow(): NULL handle!\n"); in DEMOWinScrollWindow()
646 ASSERTMSG(handle->num_scroll_lines, "DEMOWinScrollWindow(): No scrollback buffer!\n"); in DEMOWinScrollWindow()
654 … n = (u16)(((handle->curr_view_line + handle->total_lines) - 1) % handle->total_lines); in DEMOWinScrollWindow()
656 … v_start = (u16)(((n + handle->total_lines) - handle->char_height+1) % handle->total_lines); in DEMOWinScrollWindow()
658 if (v_start != handle->curr_output_line) in DEMOWinScrollWindow()
660 handle->curr_view_line = n; in DEMOWinScrollWindow()
667 if (handle->curr_view_line != handle->curr_output_line) in DEMOWinScrollWindow()
669handle->curr_view_line = (u16)((handle->curr_view_line + 1) % handle->total_lines); in DEMOWinScrollWindow()
676 handle->curr_view_line = handle->curr_output_line; in DEMOWinScrollWindow()
700 void DEMOWinBringToFront(DEMOWinInfo *handle) in DEMOWinBringToFront() argument
705 ASSERTMSG(handle, "DEMOWinBringToFront(): NULL handle!\n"); in DEMOWinBringToFront()
707 if (DEMOWIN_PRIORITY_FORE == handle->priority) in DEMOWinBringToFront()
721 handle->priority = DEMOWIN_PRIORITY_FORE; in DEMOWinBringToFront()
737 void DEMOWinSendToBack(DEMOWinInfo *handle) in DEMOWinSendToBack() argument
740 ASSERTMSG(handle, "DEMOWinSendToBack(): NULL handle!\n"); in DEMOWinSendToBack()
741 handle->priority = DEMOWIN_PRIORITY_BACK; in DEMOWinSendToBack()
756 void DEMOWinClearRow(DEMOWinInfo *handle, u16 row) in DEMOWinClearRow() argument
764 ASSERTMSG(handle, "DEMOWinClearRow(): NULL handle!\n"); in DEMOWinClearRow()
768 if (row >= handle->char_height) in DEMOWinClearRow()
776 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinClearRow()
779 buffer_row = (u16)((buffer_row + row) % handle->total_lines); in DEMOWinClearRow()
781 index = (u16)(buffer_row * handle->char_width); in DEMOWinClearRow()
783 for (i=0; i<handle->char_width; i++) in DEMOWinClearRow()
785 handle->buffer[index+i] = 0x20; in DEMOWinClearRow()
805 void DEMOWinClearWindow(DEMOWinInfo *handle) in DEMOWinClearWindow() argument
813 ASSERTMSG(handle, "DEMOWinClearWindow(): NULL handle!\n"); in DEMOWinClearWindow()
819 …buffer_row = (u16)( ((handle->curr_view_line + handle->total_lines) - (handle->char_height-1)) % in DEMOWinClearWindow()
821 for (i=0; i<handle->char_height; i++) in DEMOWinClearWindow()
823 index = (u16)(buffer_row * handle->char_width); in DEMOWinClearWindow()
824 memset((void *)(&handle->buffer[index]), 0x20, sizeof(u8) * handle->char_width); in DEMOWinClearWindow()
825 buffer_row = (u16)((buffer_row + 1) % handle->total_lines); in DEMOWinClearWindow()
843 void DEMOWinClearBuffer(DEMOWinInfo *handle) in DEMOWinClearBuffer() argument
847 ASSERTMSG(handle, "DEMOWinClearBuffer(): NULL handle!\n"); in DEMOWinClearBuffer()
851 memset(handle->buffer, 0x20, sizeof(u8) * handle->total_lines * handle->char_width); in DEMOWinClearBuffer()
1124 static void __DEMOWin_add_node(DEMOWinInfo *handle) in __DEMOWin_add_node() argument
1127 ASSERTMSG(handle, "__add_node(): you're adding a NULL node!\n"); in __DEMOWin_add_node()
1132 __first_node = __last_node = __curr_node = handle; in __DEMOWin_add_node()
1134 handle->next = NULL; in __DEMOWin_add_node()
1135 handle->prev = NULL; in __DEMOWin_add_node()
1142 __last_node->next = handle; in __DEMOWin_add_node()
1143 handle->next = NULL; in __DEMOWin_add_node()
1144 handle->prev = __last_node; in __DEMOWin_add_node()
1145 __last_node = handle; in __DEMOWin_add_node()
1148 handle->flags |= DEMOWIN_FLAG_ATTACHED; in __DEMOWin_add_node()
1163 static void __DEMOWin_delete_node(DEMOWinInfo *handle) in __DEMOWin_delete_node() argument
1166 ASSERTMSG(handle, "__delete_node(): you're deleting a NULL node!\n"); in __DEMOWin_delete_node()
1170 if (__first_node == handle) in __DEMOWin_delete_node()
1173 if (handle->next) in __DEMOWin_delete_node()
1175 __first_node = (handle->next); in __DEMOWin_delete_node()
1176 (handle->next)->prev = NULL; in __DEMOWin_delete_node()
1185 else if (__last_node == handle) in __DEMOWin_delete_node()
1188 if (handle->prev) in __DEMOWin_delete_node()
1191 __last_node = (handle->prev); in __DEMOWin_delete_node()
1192 (handle->prev)->next = NULL; in __DEMOWin_delete_node()
1204 (handle->prev)->next = (handle->next); in __DEMOWin_delete_node()
1205 (handle->next)->prev = (handle->prev); in __DEMOWin_delete_node()
1209 handle->flags = (handle->flags & (~DEMOWIN_FLAG_ATTACHED)); in __DEMOWin_delete_node()
1314 menu->handle = DEMOWinCreateWindow((s16)x, in DEMOWinCreateMenuWindow()
1324 (menu->handle)->parent = menu; in DEMOWinCreateMenuWindow()
1353 if (menu->handle) in DEMOWinDestroyMenuWindow()
1355 DEMOWinCloseWindow(menu->handle); in DEMOWinDestroyMenuWindow()
1356 DEMOWinDestroyWindow(menu->handle); in DEMOWinDestroyMenuWindow()
1358 menu->handle = NULL; in DEMOWinDestroyMenuWindow()
1378 DEMOWinInfo *handle; // Pointer to window associated with this menu in DEMOWinMenuChild() local
1387 handle = menu->handle; in DEMOWinMenuChild()
1388 pad = &(menu->handle)->pad; in DEMOWinMenuChild()
1392 DEMOWinOpenWindow(handle); in DEMOWinMenuChild()
1393 DEMOWinBringToFront(handle); in DEMOWinMenuChild()
1480 if ((menu->items[menu->curr_pos].link)->handle) in DEMOWinMenuChild()
1483 … ((menu->items[menu->curr_pos].link)->handle)->x1 = (u16)(handle->x1 + 20); in DEMOWinMenuChild()
1484 … ((menu->items[menu->curr_pos].link)->handle)->y1 = (u16)(handle->y1 + 20); in DEMOWinMenuChild()
1497 …MOWinCreateMenuWindow(menu->items[menu->curr_pos].link, (u16)(handle->x1+20), (u16)(handle->y1+20)… in DEMOWinMenuChild()
1522 if ((menu->items[menu->curr_pos].link)->handle) in DEMOWinMenuChild()
1525 … ((menu->items[menu->curr_pos].link)->handle)->x1 = (u16)(handle->x1 + 20); in DEMOWinMenuChild()
1526 … ((menu->items[menu->curr_pos].link)->handle)->y1 = (u16)(handle->y1 + 20); in DEMOWinMenuChild()
1539 …MOWinCreateMenuWindow(menu->items[menu->curr_pos].link, (u16)(handle->x1+20), (u16)(handle->y1+20)… in DEMOWinMenuChild()
1601 handle->cursor_line = (s16)(menu->display_pos - menu->curr_pos); in DEMOWinMenuChild()
1605 handle->cursor_line = (s16)(menu->curr_pos - menu->display_pos); in DEMOWinMenuChild()
1617 DEMOWinCloseWindow(handle); in DEMOWinMenuChild()
1973 list->handle = DEMOWinCreateWindow((s16)x, in DEMOWinCreateListWindow()
1983 (list->handle)->parent = (void *)(list); in DEMOWinCreateListWindow()
2010 if (list->handle) in DEMOWinDestroyListWindow()
2012 DEMOWinCloseWindow(list->handle); in DEMOWinDestroyListWindow()
2013 DEMOWinDestroyWindow(list->handle); in DEMOWinDestroyListWindow()
2015 list->handle = NULL; in DEMOWinDestroyListWindow()