From: <ada...@us...> - 2003-06-30 20:47:21
|
Update of /cvsroot/contiki/contiki/ctk In directory sc8-pr-cvs1:/tmp/cvs-serv4646 Modified Files: ctk.h Log Message: Added ctk_desktop structures. Added a height field (h) to all ctk_widget structures. Index: ctk.h =================================================================== RCS file: /cvsroot/contiki/contiki/ctk/ctk.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ctk.h 28 Apr 2003 23:21:42 -0000 1.10 --- ctk.h 30 Jun 2003 20:45:50 -0000 1.11 *************** *** 57,61 **** #define CTK_SEPARATOR(x, y, w) \ ! NULL, NULL, x, y, CTK_WIDGET_SEPARATOR, w struct ctk_separator { struct ctk_widget *next; --- 57,61 ---- #define CTK_SEPARATOR(x, y, w) \ ! NULL, NULL, x, y, CTK_WIDGET_SEPARATOR, w, 1 struct ctk_separator { struct ctk_widget *next; *************** *** 63,71 **** unsigned char x, y; unsigned char type; ! unsigned char w; }; #define CTK_BUTTON(x, y, w, text) \ ! NULL, NULL, x, y, CTK_WIDGET_BUTTON, w, text struct ctk_button { struct ctk_widget *next; --- 63,71 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; }; #define CTK_BUTTON(x, y, w, text) \ ! NULL, NULL, x, y, CTK_WIDGET_BUTTON, w, 1, text struct ctk_button { struct ctk_widget *next; *************** *** 73,82 **** unsigned char x, y; unsigned char type; ! unsigned char w; char *text; }; #define CTK_LABEL(x, y, w, h, text) \ ! NULL, NULL, x, y, CTK_WIDGET_LABEL, w, text, h struct ctk_label { struct ctk_widget *next; --- 73,82 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; char *text; }; #define CTK_LABEL(x, y, w, h, text) \ ! NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, text, struct ctk_label { struct ctk_widget *next; *************** *** 84,94 **** unsigned char x, y; unsigned char type; ! unsigned char w; char *text; - unsigned char h; }; #define CTK_HYPERLINK(x, y, w, text, url) \ ! NULL, NULL, x, y, CTK_WIDGET_HYPERLINK, w, text, url struct ctk_hyperlink { struct ctk_widget *next; --- 84,93 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; char *text; }; #define CTK_HYPERLINK(x, y, w, text, url) \ ! NULL, NULL, x, y, CTK_WIDGET_HYPERLINK, w, 1, text, url struct ctk_hyperlink { struct ctk_widget *next; *************** *** 96,100 **** unsigned char x, y; unsigned char type; ! unsigned char w; char *text; char *url; --- 95,99 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; char *text; char *url; *************** *** 107,111 **** #define CTK_TEXTENTRY(x, y, w, h, text, len) \ ! NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, text, h, len, \ CTK_TEXTENTRY_NORMAL, 0, 0 struct ctk_textentry { --- 106,110 ---- #define CTK_TEXTENTRY(x, y, w, h, text, len) \ ! NULL, NULL, x, y, CTK_WIDGET_TEXTENTRY, w, h, text, len, \ CTK_TEXTENTRY_NORMAL, 0, 0 struct ctk_textentry { *************** *** 114,120 **** unsigned char x, y; unsigned char type; ! unsigned char w; char *text; - unsigned char h; unsigned char len; unsigned char state; --- 113,118 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; char *text; unsigned char len; unsigned char state; *************** *** 124,128 **** #define CTK_ICON(title, bitmap, textmap) \ ! NULL, NULL, 0, 0, CTK_WIDGET_ICON, 2, title, 4, 0, bitmap, textmap struct ctk_icon { struct ctk_widget *next; --- 122,126 ---- #define CTK_ICON(title, bitmap, textmap) \ ! NULL, NULL, 0, 0, CTK_WIDGET_ICON, 2, 4, title, 0, bitmap, textmap struct ctk_icon { struct ctk_widget *next; *************** *** 130,136 **** unsigned char x, y; unsigned char type; ! unsigned char w; char *title; - unsigned char h; ek_id_t owner; unsigned char *bitmap; --- 128,133 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; char *title; ek_id_t owner; unsigned char *bitmap; *************** *** 139,143 **** #define CTK_BITMAP(x, y, w, h, bitmap) \ ! NULL, NULL, x, y, CTK_WIDGET_BITMAP, w, bitmap, h struct ctk_bitmap { struct ctk_widget *next; --- 136,140 ---- #define CTK_BITMAP(x, y, w, h, bitmap) \ ! NULL, NULL, x, y, CTK_WIDGET_BITMAP, w, h, bitmap, struct ctk_bitmap { struct ctk_widget *next; *************** *** 145,154 **** unsigned char x, y; unsigned char type; ! unsigned char w; unsigned char *bitmap; - unsigned char h; }; struct ctk_widget_button { --- 142,166 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; unsigned char *bitmap; }; + #define CTK_TEXTMAP_NORMAL 0 + #define CTK_TEXTMAP_ACTIVE 1 + + #define CTK_TEXTMAP(x, y, w, h, textmap, flags) \ + NULL, NULL, x, y, CTK_WIDGET_LABEL, w, h, text, flags, CTK_TEXTMAP_NORMAL + struct ctk_textmap { + struct ctk_widget *next; + struct ctk_window *window; + unsigned char x, y; + unsigned char type; + unsigned char w, h; + char *textmap; + unsigned char flags; + unsigned char state; + }; + struct ctk_widget_button { *************** *** 158,162 **** struct ctk_widget_label { char *text; - unsigned char h; }; --- 170,173 ---- *************** *** 168,172 **** struct ctk_widget_textentry { char *text; - unsigned char h; unsigned char len; unsigned char state; --- 179,182 ---- *************** *** 176,180 **** struct ctk_widget_icon { char *title; - unsigned char h; ek_id_t owner; unsigned char *bitmap; --- 186,189 ---- *************** *** 184,188 **** struct ctk_widget_bitmap { unsigned char *bitmap; - unsigned char h; }; --- 193,196 ---- *************** *** 192,196 **** unsigned char x, y; unsigned char type; ! unsigned char w; union { struct ctk_widget_label label; --- 200,204 ---- unsigned char x, y; unsigned char type; ! unsigned char w, h; union { struct ctk_widget_label label; *************** *** 203,211 **** }; /* Definition of the CTK window structure. */ struct ctk_window { struct ctk_window *next, *prev; ek_id_t owner; ! char *title; unsigned char titlelen; --- 211,223 ---- }; + struct ctk_desktop; + /* Definition of the CTK window structure. */ struct ctk_window { struct ctk_window *next, *prev; + struct ctk_desktop *desktop; + ek_id_t owner; ! char *title; unsigned char titlelen; *************** *** 257,260 **** --- 269,317 ---- }; + /* Definition of the CTK desktop structure. */ + struct ctk_desktop { + char *name; + + struct ctk_window desktop_window; + struct ctk_window *windows; + struct ctk_window *dialog; + + #if CTK_CONF_MENUS + struct ctk_menus menus; + struct ctk_menu *lastmenu; + struct ctk_menu desktopmenu; + #endif /* CTK_CONF_MENUS */ + + unsigned char height, width; + + #define CTK_REDRAW_NONE 0 + #define CTK_REDRAW_ALL 1 + #define CTK_REDRAW_WINDOWS 2 + #define CTK_REDRAW_WIDGETS 4 + #define CTK_REDRAW_MENUS 8 + #define CTK_REDRAW_PART 16 + + #ifndef CTK_CONF_MAX_REDRAWWIDGETS + #define CTK_CONF_MAX_REDRAWWIDGETS 8 + #endif /* CTK_CONF_MAX_REDRAWWIDGETS */ + #ifndef CTK_CONF_MAX_REDRAWWINDOWS + #define CTK_CONF_MAX_REDRAWWINDOWS 8 + #endif /* CTK_CONF_MAX_REDRAWWINDOWS */ + + + + unsigned char redraw; + + struct ctk_widget *redraw_widgets[CTK_CONF_MAX_REDRAWWIDGETS]; + unsigned char redraw_widgetptr; + + struct ctk_window *redraw_windows[CTK_CONF_MAX_REDRAWWINDOWS]; + unsigned char redraw_windowptr; + + + unsigned char redraw_y1, redraw_y2; + }; + + /* Global CTK modes. */ #define CTK_MODE_NORMAL 0 *************** *** 337,340 **** --- 394,398 ---- (widg)->y = (ypos); \ (widg)->w = (width); \ + (widg)->h = 1; \ (widg)->text = (buttontext) *************** *** 382,391 **** (widg)->y = (ypos); \ (widg)->w = (width); \ (widg)->text = (linktext); \ (widg)->url = (linkurl) /* Desktop interface. */ ! unsigned char ctk_desktop_width(struct ctk_window *w); ! unsigned char ctk_desktop_height(struct ctk_window *w); /* Signals. */ --- 440,451 ---- (widg)->y = (ypos); \ (widg)->w = (width); \ + (widg)->h = 1; \ (widg)->text = (linktext); \ (widg)->url = (linkurl) /* Desktop interface. */ ! void ctk_desktop_redraw(struct ctk_desktop *d); ! unsigned char ctk_desktop_width(struct ctk_desktop *d); ! unsigned char ctk_desktop_height(struct ctk_desktop *d); /* Signals. */ |