From: Daniel Caujolle-B. <f1...@us...> - 2002-04-18 23:37:03
|
Update of /cvsroot/xine/xine-ui/src/xitk/xine-toolkit In directory usw-pr-cvs1:/tmp/cvs-serv24035/xine-toolkit Modified Files: _xitk.h dnd.c labelbutton.c labelbutton.h skin.c skin.h xitk.h Log Message: Ability for skins to have static labelled buttons. Index: _xitk.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/_xitk.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- _xitk.h 15 Apr 2002 19:30:49 -0000 1.33 +++ _xitk.h 18 Apr 2002 23:36:59 -0000 1.34 @@ -491,9 +491,10 @@ int xitk_skin_get_label_length(xitk_skin_config_t *, const char *); int xitk_skin_get_label_animation(xitk_skin_config_t *, const char *); char *xitk_skin_get_label_fontname(xitk_skin_config_t *, const char *); -int xitk_skin_get_label_printable(xitk_skin_config_t *skonfig, const char *str); -int xitk_skin_get_label_alignment(xitk_skin_config_t *skonfig, const char *str); -char *xitk_skin_get_label_skinfont_filename(xitk_skin_config_t *skonfig, const char *str); +int xitk_skin_get_label_printable(xitk_skin_config_t *, const char *); +int xitk_skin_get_label_staticity(xitk_skin_config_t *, const char *); +int xitk_skin_get_label_alignment(xitk_skin_config_t *, const char *); +char *xitk_skin_get_label_skinfont_filename(xitk_skin_config_t *, const char *); char *xitk_skin_get_skin_filename(xitk_skin_config_t *, const char *); char *xitk_skin_get_slider_skin_filename(xitk_skin_config_t *, const char *); int xitk_skin_get_slider_type(xitk_skin_config_t *, const char *); Index: dnd.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/dnd.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- dnd.c 18 Apr 2002 21:36:57 -0000 1.13 +++ dnd.c 18 Apr 2002 23:36:59 -0000 1.14 @@ -39,7 +39,7 @@ #define XDND_VERSION 3 -#undef DEBUG_DND +#define DEBUG_DND /* * PRIVATES Index: labelbutton.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/labelbutton.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- labelbutton.c 18 Apr 2002 21:14:36 -0000 1.29 +++ labelbutton.c 18 Apr 2002 23:36:59 -0000 1.30 @@ -129,8 +129,10 @@ /* Some colors configurations */ switch(state) { case CLICK: - xoff = -4; - yoff = 1; + if(private_data->label_static == 0) { + xoff = -4; + yoff = 1; + } if(!strcasecmp(private_data->clickcolor, "Default")) { DefaultColor = 255; } @@ -416,9 +418,11 @@ private_data->skin_element_name)); XITK_FREE(private_data->fontname); private_data->fontname = strdup(xitk_skin_get_label_fontname(skonfig, - private_data->skin_element_name)); + private_data->skin_element_name)); private_data->label_visible = xitk_skin_get_label_printable(skonfig, private_data->skin_element_name); + private_data->label_static = xitk_skin_get_label_staticity(skonfig, private_data->skin_element_name); + private_data->align = xitk_skin_get_label_alignment(skonfig, private_data->skin_element_name); lb->x = xitk_skin_get_coord_x(skonfig, private_data->skin_element_name); @@ -513,7 +517,8 @@ int x, int y, char *skin_element_name, xitk_image_t *skin, char *ncolor, char *fcolor, char *ccolor, - char *fontname, int label_visible, + char *fontname, + int label_visible, int label_static, int visible, int enable) { xitk_widget_t *mywidget; lbutton_private_data_t *private_data; @@ -537,6 +542,7 @@ private_data->userdata = b->userdata; private_data->label = strdup((b->label)?b->label:""); private_data->label_visible = label_visible; + private_data->label_static = label_static; private_data->skin = skin; private_data->normcolor = strdup(ncolor); @@ -590,6 +596,7 @@ (xitk_skin_get_label_color_click(skonfig, b->skin_element_name)), (xitk_skin_get_label_fontname(skonfig, b->skin_element_name)), (xitk_skin_get_label_printable(skonfig, b->skin_element_name)), + (xitk_skin_get_label_staticity(skonfig, b->skin_element_name)), ((xitk_skin_get_visibility(skonfig, b->skin_element_name)) ? 1 : -1), (xitk_skin_get_enability(skonfig, b->skin_element_name))); } @@ -608,5 +615,5 @@ i = xitk_image_create_image(b->imlibdata, width * 3, height); draw_bevel_three_state(b->imlibdata, i); - return _xitk_labelbutton_create(NULL, b, x, y, NULL, i, ncolor, fcolor, ccolor, fname, 1, 1, 1); + return _xitk_labelbutton_create(NULL, b, x, y, NULL, i, ncolor, fcolor, ccolor, fname, 1, 0, 1, 1); } Index: labelbutton.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/labelbutton.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- labelbutton.h 21 Mar 2002 00:22:53 -0000 1.10 +++ labelbutton.h 18 Apr 2002 23:37:00 -0000 1.11 @@ -52,6 +52,7 @@ int align; int label_visible; + int label_static; char *label; char *normcolor; Index: skin.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/skin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- skin.c 18 Apr 2002 21:14:36 -0000 1.12 +++ skin.c 18 Apr 2002 23:37:00 -0000 1.13 @@ -414,6 +414,10 @@ skonfig->celement->pixmap_font = (char *) xitk_xmalloc(strlen(skonfig->path) + strlen(p) + 2); sprintf(skonfig->celement->pixmap_font, "%s/%s", skonfig->path, p); } + else if(!strncasecmp(skonfig->ln, "static", 6)) { + skin_set_pos_to_value(&p); + skonfig->celement->staticity = skin_get_bool_value(p); + } else if(!strncasecmp(skonfig->ln, "align", 5)) { skin_set_pos_to_value(&p); skonfig->celement->align = skin_get_align_value(p); @@ -594,6 +598,7 @@ printf(" animation = %d\n", s->animation); printf(" print = %d\n", s->print); + printf(" static = %d\n", s->staticity); printf(" length = %d\n", s->length); printf(" color = '%s'\n", s->color); printf(" color focus = '%s'\n", s->color_focus); @@ -614,6 +619,7 @@ printf(" pixmap = '%s'\n", s->pixmap); printf(" animation = %d\n", s->animation); printf(" print = %d\n", s->print); + printf(" static = %d\n", s->staticity); printf(" length = %d\n", s->length); printf(" color = '%s'\n", s->color); printf(" color focus = '%s'\n", s->color_focus); @@ -951,6 +957,20 @@ return s->print; return 1; +} + +/* + * + */ +int xitk_skin_get_label_staticity(xitk_skin_config_t *skonfig, const char *str) { + xitk_skin_element_t *s; + + assert(skonfig); + + if((s = skin_lookup_section(skonfig, str)) != NULL) + return s->staticity; + + return 0; } /* Index: skin.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/skin.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- skin.h 18 Apr 2002 21:14:36 -0000 1.11 +++ skin.h 18 Apr 2002 23:37:00 -0000 1.12 @@ -44,6 +44,7 @@ int radius; /* label */ + int staticity; int print; int align; int animation; Index: xitk.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/xitk.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- xitk.h 15 Apr 2002 14:02:20 -0000 1.52 +++ xitk.h 18 Apr 2002 23:37:00 -0000 1.53 @@ -1356,7 +1356,12 @@ /* * */ -int xitk_skin_get_label_printable(xitk_skin_config_t *skonfig, const char *str); +int xitk_skin_get_label_printable(xitk_skin_config_t *, const char *); + +/* + * + */ +int xitk_skin_get_label_staticity(xitk_skin_config_t *, const char *); /* * @@ -1366,17 +1371,17 @@ /* * */ -char *xitk_skin_get_slider_skin_filename(xitk_skin_config_t *skonfig, const char *str); +char *xitk_skin_get_slider_skin_filename(xitk_skin_config_t *, const char *); /* * */ -int xitk_skin_get_slider_type(xitk_skin_config_t *skonfig, const char *str); +int xitk_skin_get_slider_type(xitk_skin_config_t *, const char *); /* * */ -int xitk_skin_get_slider_radius(xitk_skin_config_t *skonfig, const char *str); +int xitk_skin_get_slider_radius(xitk_skin_config_t *, const char *); /* * |