From: <ada...@us...> - 2003-04-24 17:17:33
|
Update of /cvsroot/contiki/contiki/ctk In directory sc8-pr-cvs1:/tmp/cvs-serv29091/ctk Modified Files: ctk.c Log Message: First stab at modular screen saver support Index: ctk.c =================================================================== RCS file: /cvsroot/contiki/contiki/ctk/ctk.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ctk.c 18 Apr 2003 00:18:38 -0000 1.15 --- ctk.c 24 Apr 2003 17:17:26 -0000 1.16 *************** *** 103,106 **** --- 103,113 ---- ctk_signal_pointer_button; + #if CTK_CONF_SCREENSAVER + ek_signal_t ctk_signal_screensaver_start, + ctk_signal_screensaver_stop, + ctk_signal_screensaver_uninstall; + #endif /* CTK_CONF_SCREENSAVER */ + + #if CTK_CONF_MOUSE_SUPPORT unsigned short mouse_x, mouse_y, mouse_button; *************** *** 182,186 **** ctk_signal_pointer_move = dispatcher_sigalloc(); ctk_signal_pointer_button = dispatcher_sigalloc(); ! dispatcher_listen(ctk_signal_timer); dispatcher_timer(ctk_signal_timer, NULL, CLK_TCK); --- 189,200 ---- ctk_signal_pointer_move = dispatcher_sigalloc(); ctk_signal_pointer_button = dispatcher_sigalloc(); ! ! ! #if CTK_CONF_SCREENSAVER ! ctk_signal_screensaver_start = dispatcher_sigalloc(); ! ctk_signal_screensaver_stop = dispatcher_sigalloc(); ! ctk_signal_screensaver_uninstall = dispatcher_sigalloc(); ! #endif /* CTK_CONF_SCREENSAVER */ ! dispatcher_listen(ctk_signal_timer); dispatcher_timer(ctk_signal_timer, NULL, CLK_TCK); *************** *** 396,400 **** for(widget = desktop_window.active; widget != NULL; widget = widget->next) { ! ctk_draw_widget(widget, 0, clipy1, clipy2); } --- 410,414 ---- for(widget = desktop_window.active; widget != NULL; widget = widget->next) { ! ctk_draw_widget(widget, CTK_FOCUS_WINDOW, clipy1, clipy2); } *************** *** 585,592 **** if(window == dialog) { ctk_draw_widget(widget, CTK_FOCUS_DIALOG, 0, height); ! } else if(window == windows) { ! ctk_draw_widget(widget, CTK_FOCUS_WINDOW, 0, height); ! } else if(window == &desktop_window) { ! ctk_draw_widget(widget, 0, 0, height); } } --- 599,605 ---- if(window == dialog) { ctk_draw_widget(widget, CTK_FOCUS_DIALOG, 0, height); ! } else if(window == windows || ! window == &desktop_window) { ! ctk_draw_widget(widget, CTK_FOCUS_WINDOW, 0, height); } } *************** *** 607,613 **** window->active = widget; widget->window = window; ! if(window->focused == NULL) { window->focused = widget; ! } } } --- 620,626 ---- window->active = widget; widget->window = window; ! /* if(window->focused == NULL) { window->focused = widget; ! }*/ } } *************** *** 724,728 **** } ! menus.open->active = 0; /* ctk_redraw();*/ } --- 737,746 ---- } ! menus.open->active = 0; ! ! /* if(menus.open->nitems > maxnitems) { ! maxnitems = menus.open->nitems; ! }*/ ! /* ctk_redraw();*/ } *************** *** 1022,1029 **** --- 1040,1050 ---- + #if CTK_CONF_SCREENSAVER if(mode == CTK_MODE_SCREENSAVER) { + #if 0 #ifdef CTK_SCREENSAVER_RUN CTK_SCREENSAVER_RUN(); #endif /* CTK_SCREENSAVER_RUN */ + #endif /* 0 */ if(ctk_arch_keyavail() #if CTK_CONF_MOUSE_SUPPORT *************** *** 1031,1039 **** #endif /* CTK_CONF_MOUSE_SUPPORT */ ) { mode = CTK_MODE_NORMAL; ! ctk_draw_init(); ! ctk_redraw(); } ! } else if(mode == CTK_MODE_NORMAL) { #if CTK_CONF_MOUSE_SUPPORT /* If there is any change in the mouse conditions, find out in --- 1052,1063 ---- #endif /* CTK_CONF_MOUSE_SUPPORT */ ) { + dispatcher_emit(ctk_signal_screensaver_stop, NULL, DISPATCHER_BROADCAST); mode = CTK_MODE_NORMAL; ! /* ctk_draw_init(); ! ctk_redraw();*/ } ! } else ! #endif /* CTK_CONF_SCREENSAVER */ ! if(mode == CTK_MODE_NORMAL) { #if CTK_CONF_MOUSE_SUPPORT /* If there is any change in the mouse conditions, find out in *************** *** 1421,1428 **** --- 1445,1456 ---- ++screensaver_timer; if(screensaver_timer == SCREENSAVER_TIMEOUT) { + #if CTK_CONF_SCREENSAVER + dispatcher_emit(ctk_signal_screensaver_start, NULL, + DISPATCHER_BROADCAST); #ifdef CTK_SCREENSAVER_INIT CTK_SCREENSAVER_INIT(); #endif /* CTK_SCREENSAVER_INIT */ mode = CTK_MODE_SCREENSAVER; + #endif /* CTK_CONF_SCREENSAVER */ screensaver_timer = 0; } |