"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/xitk/xine-toolkit/labelbutton.c" between
xine-ui-0.99.13.tar.bz2 and xine-ui-0.99.14.tar.bz2

About: xine is a free video player which plays mpeg-2 and mpeg-1 video, DVDs (unlocked/unencrypted only), video CDs, SVCDs, and AVI files (using Win32 codecs) with synchronized audio and video, and optionally fullscreen using the Xv extensions in Xfree86 4.x (user interface).

labelbutton.c  (xine-ui-0.99.13.tar.bz2):labelbutton.c  (xine-ui-0.99.14.tar.bz2)
/* /*
* Copyright (C) 2000-2021 the xine project * Copyright (C) 2000-2022 the xine project
* *
* This file is part of xine, a unix video player. * This file is part of xine, a unix video player.
* *
* xine is free software; you can redistribute it and/or modify * xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* xine is distributed in the hope that it will be useful, * xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 257 skipping to change at line 257
static int _labelbutton_input (_lbutton_private_t *wp, const widget_event_t *eve nt) { static int _labelbutton_input (_lbutton_private_t *wp, const widget_event_t *eve nt) {
int fire; int fire;
if (!(wp->w.state & XITK_WIDGET_STATE_FOCUS)) if (!(wp->w.state & XITK_WIDGET_STATE_FOCUS))
return 0; return 0;
if (event->type == WIDGET_EVENT_KEY) { if (event->type == WIDGET_EVENT_KEY) {
static const char k[] = { static const char k[] = {
XITK_CTRL_KEY_PREFIX, XITK_KEY_RIGHT, XITK_CTRL_KEY_PREFIX, XITK_KEY_RIGHT,
XITK_CTRL_KEY_PREFIX, XITK_KEY_RETURN, XITK_CTRL_KEY_PREFIX, XITK_KEY_RETURN,
XITK_CTRL_KEY_PREFIX, XITK_KEY_NUMPAD_ENTER,
XITK_CTRL_KEY_PREFIX, XITK_KEY_ISO_ENTER,
' ', 0 ' ', 0
}; };
int i, n = sizeof (k) / sizeof (k[0]); int i, n = sizeof (k) / sizeof (k[0]);
if (event->modifier & ~(MODIFIER_SHIFT | MODIFIER_NUML)) if (event->modifier & ~(MODIFIER_SHIFT | MODIFIER_NUML))
return 0; return 0;
if (!event->string) if (!event->string)
return 0; return 0;
for (i = (wp->w.type & WIDGET_GROUP_MENU) ? 0 : 2; i < n; i += 2) { for (i = (wp->w.type & WIDGET_GROUP_MENU) ? 0 : 2; i < n; i += 2) {
skipping to change at line 532 skipping to change at line 530
if (wp && ((wp->w.type & WIDGET_TYPE_MASK) == WIDGET_TYPE_LABELBUTTON)) if (wp && ((wp->w.type & WIDGET_TYPE_MASK) == WIDGET_TYPE_LABELBUTTON))
return wp->userdata; return wp->userdata;
return NULL; return NULL;
} }
/* /*
* Create the labeled button. * Create the labeled button.
* NOTE: menu calls this with b->skin_element_name == NULL, info->pixmap_name == NULL, * NOTE: menu calls this with b->skin_element_name == NULL, info->pixmap_name == NULL,
* and info->pixmap_img to be used but not to be freed like a regular skin. * and info->pixmap_img to be used but not to be freed like a regular skin.
*/ */
xitk_widget_t *xitk_info_labelbutton_create (xitk_widget_list_t *wl, xitk_widget_t *xitk_info_labelbutton_create (const xitk_labelbutton_widget_t *b,
const xitk_labelbutton_widget_t *b, const xitk_skin_element_info_t *info) { const xitk_skin_element_info_t *info) {
_lbutton_private_t *wp; _lbutton_private_t *wp;
ABORT_IF_NULL(wl); _xitk_new_widget_check (&b->nw);
wp = (_lbutton_private_t *)xitk_widget_new (wl, sizeof (*wp)); wp = (_lbutton_private_t *)xitk_widget_new (b->nw.wl, sizeof (*wp));
if (!wp) if (!wp)
return NULL; return NULL;
wp->num_gfx = 3; wp->num_gfx = 3;
wp->bType = b->button_type; wp->bType = b->button_type;
wp->callback = b->callback; wp->callback = b->callback;
wp->state_callback = b->state_callback; wp->state_callback = b->state_callback;
wp->userdata = b->userdata; wp->userdata = b->nw.userdata;
xitk_short_string_init (&wp->label); xitk_short_string_init (&wp->label);
xitk_short_string_set (&wp->label, b->label); xitk_short_string_set (&wp->label, b->label);
xitk_short_string_init (&wp->shortcut_label); xitk_short_string_init (&wp->shortcut_label);
xitk_short_string_init (&wp->shortcut_font); xitk_short_string_init (&wp->shortcut_font);
xitk_short_string_init (&wp->font); xitk_short_string_init (&wp->font);
xitk_short_string_set (&wp->font, info->label_fontname); xitk_short_string_set (&wp->font, info->label_fontname);
wp->shortcut_pos = -1; wp->shortcut_pos = -1;
wp->label_visible = info->label_printable; wp->label_visible = info->label_printable;
wp->label_static = info->label_staticity; wp->label_static = info->label_staticity;
wp->skin = info->pixmap_img; wp->skin = info->pixmap_img;
if (((wp->skin.width <= 0) || (wp->skin.height <= 0)) && wp->skin.image) { if (((wp->skin.width <= 0) || (wp->skin.height <= 0)) && wp->skin.image) {
wp->skin.width = wp->skin.image->width; wp->skin.width = wp->skin.image->width;
wp->skin.height = wp->skin.image->height; wp->skin.height = wp->skin.image->height;
} }
xitk_shared_image (wl, "xitk_lbutton_temp", wp->skin.width / 3, wp->skin.heigh t, &wp->temp_image.image); xitk_shared_image (wp->w.wl, "xitk_lbutton_temp", wp->skin.width / 3, wp->skin .height, &wp->temp_image.image);
wp->temp_image.x = 0; wp->temp_image.x = 0;
wp->temp_image.y = 0; wp->temp_image.y = 0;
wp->temp_image.width = wp->skin.width / 3; wp->temp_image.width = wp->skin.width / 3;
wp->temp_image.height = wp->skin.height; wp->temp_image.height = wp->skin.height;
strlcpy (wp->skin_element_name, strlcpy (wp->skin_element_name,
b->skin_element_name && b->skin_element_name[0] ? b->skin_element_name : "-" , b->nw.skin_element_name && b->nw.skin_element_name[0] ? b->nw.skin_element_n ame : "-",
sizeof (wp->skin_element_name)); sizeof (wp->skin_element_name));
wp->color[XITK_IMG_STATE_NORMAL] = info->label_color; wp->color[XITK_IMG_STATE_NORMAL] = info->label_color;
wp->color[XITK_IMG_STATE_FOCUS] = info->label_color_focus; wp->color[XITK_IMG_STATE_FOCUS] = info->label_color_focus;
wp->color[XITK_IMG_STATE_SELECTED] = info->label_color_click; wp->color[XITK_IMG_STATE_SELECTED] = info->label_color_click;
wp->label_offset = 0; wp->label_offset = 0;
wp->align = info->label_alignment; wp->align = info->label_alignment;
wp->label_dy = (info->label_y > 0) && (info->label_y < wp->skin.heigh t) wp->label_dy = (info->label_y > 0) && (info->label_y < wp->skin.heigh t)
? info->label_y - (wp->skin.height >> 1) : 0; ? info->label_y - (wp->skin.height >> 1) : 0;
skipping to change at line 603 skipping to change at line 600
wp->w.type = WIDGET_TYPE_LABELBUTTON | WIDGET_FOCUSABLE | WIDGET_TA BABLE wp->w.type = WIDGET_TYPE_LABELBUTTON | WIDGET_FOCUSABLE | WIDGET_TA BABLE
| WIDGET_CLICKABLE | WIDGET_KEYABLE | WIDGET_PARTIAL_PAI NTABLE; | WIDGET_CLICKABLE | WIDGET_KEYABLE | WIDGET_PARTIAL_PAI NTABLE;
wp->w.event = labelbutton_event; wp->w.event = labelbutton_event;
return &wp->w; return &wp->w;
} }
/* /*
* *
*/ */
xitk_widget_t *xitk_labelbutton_create (xitk_widget_list_t *wl, xitk_widget_t *xitk_labelbutton_create (const xitk_labelbutton_widget_t *b, xitk
xitk_skin_config_t *skonfig, const xitk_labelbutton_widget_t *b) { _skin_config_t *skonfig) {
const xitk_skin_element_info_t *pinfo; const xitk_skin_element_info_t *pinfo;
xitk_skin_element_info_t info; xitk_skin_element_info_t info;
XITK_CHECK_CONSTITENCY (b); _xitk_new_widget_check (&b->nw);
pinfo = xitk_skin_get_info (skonfig, b->skin_element_name);
pinfo = xitk_skin_get_info (skonfig, b->nw.skin_element_name);
if (pinfo) { if (pinfo) {
if (!pinfo->visibility) { if (!pinfo->visibility) {
info = *pinfo; info = *pinfo;
info.visibility = 1; info.visibility = 1;
pinfo = &info; pinfo = &info;
} }
} else { } else {
memset (&info, 0, sizeof (info)); memset (&info, 0, sizeof (info));
info.label_alignment = b->align; info.label_alignment = b->align;
info.visibility = -1; info.visibility = -1;
pinfo = &info; pinfo = &info;
} }
return xitk_info_labelbutton_create (wl, b, pinfo); return xitk_info_labelbutton_create (b, pinfo);
} }
/* /*
* *
*/ */
xitk_widget_t *xitk_noskin_labelbutton_create (xitk_widget_list_t *wl, xitk_widget_t *xitk_noskin_labelbutton_create (const xitk_labelbutton_widget_t *
const xitk_labelbutton_widget_t *b, int x, int y, int width, int height, b,
int x, int y, int width, int height,
uint32_t ncolor, uint32_t fcolor, uint32_t ccolor, const char *fname) { uint32_t ncolor, uint32_t fcolor, uint32_t ccolor, const char *fname) {
_lbutton_private_t *wp; _lbutton_private_t *wp;
ABORT_IF_NULL (wl); _xitk_new_widget_check (&b->nw);
XITK_CHECK_CONSTITENCY (b);
wp = (_lbutton_private_t *)xitk_widget_new (wl, sizeof (*wp)); wp = (_lbutton_private_t *)xitk_widget_new (b->nw.wl, sizeof (*wp));
if (!wp) if (!wp)
return NULL; return NULL;
wp->bType = b->button_type; wp->bType = b->button_type;
wp->callback = b->callback; wp->callback = b->callback;
wp->state_callback = b->state_callback; wp->state_callback = b->state_callback;
wp->userdata = b->userdata; wp->userdata = b->nw.userdata;
xitk_short_string_init (&wp->label); xitk_short_string_init (&wp->label);
xitk_short_string_set (&wp->label, b->label); xitk_short_string_set (&wp->label, b->label);
xitk_short_string_init (&wp->shortcut_label); xitk_short_string_init (&wp->shortcut_label);
xitk_short_string_init (&wp->shortcut_font); xitk_short_string_init (&wp->shortcut_font);
xitk_short_string_init (&wp->font); xitk_short_string_init (&wp->font);
xitk_short_string_set (&wp->font, fname); xitk_short_string_set (&wp->font, fname);
wp->shortcut_pos = -1; wp->shortcut_pos = -1;
wp->label_visible = 1; wp->label_visible = 1;
wp->label_static = 0; wp->label_static = 0;
wp->num_gfx = 4; wp->num_gfx = 4;
if (b->button_type == TAB_BUTTON) { if (b->button_type == TAB_BUTTON) {
if (xitk_shared_image (wl, "xitk_tabbutton", width * 4, height, &wp->skin.im age) == 1) { if (xitk_shared_image (wp->w.wl, "xitk_tabbutton", width * 4, height, &wp->s kin.image) == 1) {
wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS; wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS;
xitk_image_draw_tab (wp->skin.image); xitk_image_draw_tab (wp->skin.image);
} }
} else if (b->skin_element_name && !strcmp (b->skin_element_name, "XITK_NOSKIN } else if (b->nw.skin_element_name && !strcmp (b->nw.skin_element_name, "XITK_
_FLAT")) { NOSKIN_FLAT")) {
if (xitk_shared_image (wl, "xitk_labelbutton_f", width * 4, height, &wp->ski if (xitk_shared_image (wp->w.wl, "xitk_labelbutton_f", width * 4, height, &w
n.image) == 1) { p->skin.image) == 1) {
wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS; wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS;
xitk_image_draw_flat_three_state (wp->skin.image); xitk_image_draw_flat_three_state (wp->skin.image);
} }
} else { } else {
if (xitk_shared_image (wl, "xitk_labelbutton_b", width * 4, height, &wp->ski n.image) == 1) { if (xitk_shared_image (wp->w.wl, "xitk_labelbutton_b", width * 4, height, &w p->skin.image) == 1) {
wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS; wp->skin.image->last_state = XITK_IMG_STATE_SEL_FOCUS;
xitk_image_draw_bevel_three_state (wp->skin.image); xitk_image_draw_bevel_three_state (wp->skin.image);
} }
} }
wp->skin.x = 0; wp->skin.x = 0;
wp->skin.y = 0; wp->skin.y = 0;
wp->skin.width = 0; wp->skin.width = 0;
wp->skin.height = 0; wp->skin.height = 0;
if (wp->skin.image) { if (wp->skin.image) {
wp->skin.width = wp->skin.image->width; wp->skin.width = wp->skin.image->width;
wp->skin.height = wp->skin.image->height; wp->skin.height = wp->skin.image->height;
} }
xitk_shared_image (wl, "xitk_lbutton_temp", wp->skin.width / 4, wp->skin.heigh t, &wp->temp_image.image); xitk_shared_image (wp->w.wl, "xitk_lbutton_temp", wp->skin.width / 4, wp->skin .height, &wp->temp_image.image);
wp->temp_image.x = 0; wp->temp_image.x = 0;
wp->temp_image.y = 0; wp->temp_image.y = 0;
wp->temp_image.width = wp->skin.width / 4; wp->temp_image.width = wp->skin.width / 4;
wp->temp_image.height = wp->skin.height; wp->temp_image.height = wp->skin.height;
wp->skin_element_name[0] = 0; wp->skin_element_name[0] = 0;
wp->color[XITK_IMG_STATE_NORMAL] = ncolor; wp->color[XITK_IMG_STATE_NORMAL] = ncolor;
wp->color[XITK_IMG_STATE_FOCUS] = fcolor; wp->color[XITK_IMG_STATE_FOCUS] = fcolor;
wp->color[XITK_IMG_STATE_SELECTED] = ccolor; wp->color[XITK_IMG_STATE_SELECTED] = ccolor;
 End of changes. 19 change blocks. 
28 lines changed or deleted 27 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)