"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/xitk/xine-toolkit/combo.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).

combo.c  (xine-ui-0.99.13.tar.bz2):combo.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 224 skipping to change at line 224
wp->iw[_W_button]->type |= WIDGET_KEEP_FOCUS; wp->iw[_W_button]->type |= WIDGET_KEEP_FOCUS;
xitk_window_flags (wp->xwin, XITK_WINF_FIXED_POS, XITK_WINF_FIXED_POS); xitk_window_flags (wp->xwin, XITK_WINF_FIXED_POS, XITK_WINF_FIXED_POS);
xitk_window_set_transient_for_win (wp->xwin, wp->parent_wlist->xwin); xitk_window_set_transient_for_win (wp->xwin, wp->parent_wlist->xwin);
wp->widget_list = xitk_window_widget_list(wp->xwin); wp->widget_list = xitk_window_widget_list(wp->xwin);
{ {
xitk_browser_widget_t browser; xitk_browser_widget_t browser;
/* Browser */ /* Browser */
XITK_WIDGET_INIT (&browser); browser.nw.wl = wp->widget_list;
browser.nw.skin_element_name = NULL;
browser.nw.userdata = wp;
browser.arrow_up.skin_element_name = NULL; browser.arrow_up.skin_element_name = NULL;
browser.slider.skin_element_name = NULL; browser.slider.skin_element_name = NULL;
browser.arrow_dn.skin_element_name = NULL; browser.arrow_dn.skin_element_name = NULL;
browser.arrow_left.skin_element_name = NULL; browser.arrow_left.skin_element_name = NULL;
browser.slider_h.skin_element_name = NULL; browser.slider_h.skin_element_name = NULL;
browser.arrow_right.skin_element_name = NULL; browser.arrow_right.skin_element_name = NULL;
browser.browser.skin_element_name = NULL; browser.browser.skin_element_name = NULL;
browser.browser.num_entries = wp->num_entries; browser.browser.num_entries = wp->num_entries;
browser.browser.entries = (const char * const *)wp->entries; browser.browser.entries = (const char * const *)wp->entries;
browser.dbl_click_callback = NULL; browser.dbl_click_callback = NULL;
browser.browser.max_displayed_entries = 5; browser.browser.max_displayed_entries = 5;
browser.callback = _combo_select; browser.callback = _combo_select;
browser.userdata = (void *)wp; wp->iw[_W_browser] = xitk_noskin_browser_create (&browser,
wp->iw[_W_browser] = xitk_noskin_browser_create (wp->widget_list, &browser,
1, 1, itemw, itemh, -slidw, DEFAULT_FONT_10); 1, 1, itemw, itemh, -slidw, DEFAULT_FONT_10);
xitk_dlist_add_tail (&wp->widget_list->list, &wp->iw[_W_browser]->node); xitk_dlist_add_tail (&wp->widget_list->list, &wp->iw[_W_browser]->node);
wp->iw[_W_browser]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO; wp->iw[_W_browser]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO;
} }
xitk_browser_update_list (wp->iw[_W_browser], xitk_browser_update_list (wp->iw[_W_browser],
(const char * const *)wp->entries, NULL, wp->num_entries, 0); (const char * const *)wp->entries, NULL, wp->num_entries, 0);
wp->sel2 = wp->selected; wp->sel2 = wp->selected;
xitk_browser_set_select (wp->iw[_W_browser], wp->selected); xitk_browser_set_select (wp->iw[_W_browser], wp->selected);
xitk_widgets_state (wp->iw + _W_browser, 1, XITK_WIDGET_STATE_ENABLE | XITK_WI DGET_STATE_VISIBLE, ~0u); xitk_widgets_state (wp->iw + _W_browser, 1, XITK_WIDGET_STATE_ENABLE | XITK_WI DGET_STATE_VISIBLE, ~0u);
skipping to change at line 544 skipping to change at line 545
if (wp->xwin) if (wp->xwin)
xitk_browser_update_list (wp->iw[_W_browser], xitk_browser_update_list (wp->iw[_W_browser],
(const char* const*)wp->entries, NULL, wp->num_entries, 0); (const char* const*)wp->entries, NULL, wp->num_entries, 0);
} }
} }
/* /*
* *
*/ */
static xitk_widget_t *_combo_create (xitk_widget_list_t *wl, xitk_combo_widget_t *c, static xitk_widget_t *_combo_create (const xitk_combo_widget_t *c,
const char *skin_element_name, _combo_private_t *wp, int visible, int enable) { const char *skin_element_name, _combo_private_t *wp, int visible, int enable) {
const char * const *entries = c->entries; const char * const *entries = c->entries;
ABORT_IF_NULL(wl);
wp->xwin = NULL; wp->xwin = NULL;
if (skin_element_name) { if (skin_element_name) {
strlcpy (wp->skin_element_name, strlcpy (wp->skin_element_name,
skin_element_name && skin_element_name[0] ? skin_element_name : "-", skin_element_name && skin_element_name[0] ? skin_element_name : "-",
sizeof (wp->skin_element_name)); sizeof (wp->skin_element_name));
} else { } else {
wp->skin_element_name[0] = 0; wp->skin_element_name[0] = 0;
} }
wp->iw[_W_combo] = &wp->w; wp->iw[_W_combo] = &wp->w;
wp->parent_wlist = wl; wp->parent_wlist = wp->w.wl;
wp->parent_wkey = c->parent_wkey; wp->parent_wkey = c->parent_wkey;
wp->callback = c->callback; wp->callback = c->callback;
wp->userdata = c->userdata; wp->userdata = c->nw.userdata;
wp->num_entries = 0x7fffffff; wp->num_entries = 0x7fffffff;
wp->entries = _combo_copy_string_list (c->entries, &wp->num_entries) ; wp->entries = _combo_copy_string_list (c->entries, &wp->num_entries) ;
wp->selected = -1; wp->selected = -1;
if (wp->num_entries) { if (wp->num_entries) {
xitk_label_change_label (wp->iw[_W_label], entries[0]); xitk_label_change_label (wp->iw[_W_label], entries[0]);
wp->selected = 0; wp->selected = 0;
} }
wp->w.state &= ~(XITK_WIDGET_STATE_ENABLE | XITK_WIDGET_STATE_VISIBLE); wp->w.state &= ~(XITK_WIDGET_STATE_ENABLE | XITK_WIDGET_STATE_VISIBLE);
skipping to change at line 590 skipping to change at line 589
xitk_widget_set_focus_redirect (wp->iw[_W_label], wp->iw[_W_button]); xitk_widget_set_focus_redirect (wp->iw[_W_label], wp->iw[_W_button]);
xitk_widget_set_focus_redirect (&wp->w, wp->iw[_W_button]); xitk_widget_set_focus_redirect (&wp->w, wp->iw[_W_button]);
return &wp->w; return &wp->w;
} }
/* /*
* *
*/ */
xitk_widget_t *xitk_combo_create (xitk_widget_list_t *wl, xitk_widget_t *xitk_combo_create (const xitk_combo_widget_t *c, xitk_skin_config
xitk_skin_config_t *skonfig, xitk_combo_widget_t *c) { _t *skonfig) {
_combo_private_t *wp; _combo_private_t *wp;
xitk_button_widget_t b; xitk_button_widget_t b;
xitk_label_widget_t lbl; xitk_label_widget_t lbl;
XITK_CHECK_CONSTITENCY(c); _xitk_new_widget_check (&c->nw);
XITK_WIDGET_INIT (&b);
XITK_WIDGET_INIT(&lbl);
wp = (_combo_private_t *)xitk_widget_new (wl, sizeof (*wp)); wp = (_combo_private_t *)xitk_widget_new (c->nw.wl, sizeof (*wp));
if (!wp) if (!wp)
return NULL; return NULL;
/* Create label and button (skinable) */ /* Create label and button (skinable) */
lbl.label = ""; _xitk_new_widget_init (&lbl.nw, wp);
lbl.skin_element_name = c->skin_element_name; lbl.nw.skin_element_name = c->nw.skin_element_name;
lbl.callback = NULL; lbl.label = "";
lbl.userdata = NULL; lbl.callback = NULL;
if ((wp->iw[_W_label] = xitk_label_create (wl, skonfig, &lbl))) { if ((wp->iw[_W_label] = xitk_label_create (&lbl, skonfig))) {
xitk_widget_set_parent (wp->iw[_W_label], &wp->w); xitk_widget_set_parent (wp->iw[_W_label], &wp->w);
wp->iw[_W_label]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO; wp->iw[_W_label]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO;
xitk_dlist_add_tail (&wl->list, &wp->iw[_W_label]->node); xitk_dlist_add_tail (&wp->w.wl->list, &wp->iw[_W_label]->node);
} }
b.skin_element_name = c->skin_element_name; _xitk_new_widget_init (&b.nw, wp);
b.callback = NULL; b.nw.skin_element_name = c->nw.skin_element_name;
b.state_callback = _combo_rollunroll; b.callback = NULL;
b.userdata = (void *)wp; b.state_callback = _combo_rollunroll;
if ((wp->iw[_W_button] = xitk_button_create (wl, skonfig, &b))) { if ((wp->iw[_W_button] = xitk_button_create (&b, skonfig))) {
xitk_widget_set_parent (wp->iw[_W_button], &wp->w); xitk_widget_set_parent (wp->iw[_W_button], &wp->w);
wp->iw[_W_button]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO; wp->iw[_W_button]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO;
xitk_dlist_add_tail (&wl->list, &wp->iw[_W_button]->node); xitk_dlist_add_tail (&wp->w.wl->list, &wp->iw[_W_button]->node);
} }
{ {
int x, y; int x, y;
xitk_get_widget_pos(wp->iw[_W_label], &x, &y); xitk_get_widget_pos(wp->iw[_W_label], &x, &y);
wp->w.x = x; wp->w.x = x;
wp->w.y = y; wp->w.y = y;
x += xitk_get_widget_width(wp->iw[_W_label]); x += xitk_get_widget_width(wp->iw[_W_label]);
(void) xitk_set_widget_pos(wp->iw[_W_button], x, y); (void) xitk_set_widget_pos(wp->iw[_W_button], x, y);
} }
{ {
const xitk_skin_element_info_t *info = xitk_skin_get_info (skonfig, c->skin_ const xitk_skin_element_info_t *info = xitk_skin_get_info (skonfig, c->nw.sk
element_name); in_element_name);
return _combo_create (wl, c, c->skin_element_name ? c->skin_element_name : " return _combo_create (c, c->nw.skin_element_name ? c->nw.skin_element_name :
", wp, "", wp,
info ? (info->visibility ? 1 : -1) : 0, info ? info->enability : 0); info ? (info->visibility ? 1 : -1) : 0, info ? info->enability : 0);
} }
} }
/* /*
* **************************************************************************** ** * **************************************************************************** **
*/ */
xitk_widget_t *xitk_noskin_combo_create (xitk_widget_list_t *wl, xitk_widget_t *xitk_noskin_combo_create (const xitk_combo_widget_t *c, int x, in
xitk_combo_widget_t *c, int x, int y, int width) { t y, int width) {
_combo_private_t *wp; _combo_private_t *wp;
xitk_button_widget_t b; xitk_button_widget_t b;
xitk_label_widget_t lbl; xitk_label_widget_t lbl;
ABORT_IF_NULL(wl); _xitk_new_widget_check (&c->nw);
XITK_CHECK_CONSTITENCY(c); wp = (_combo_private_t *)xitk_widget_new (c->nw.wl, sizeof (*wp));
wp = (_combo_private_t *)xitk_widget_new (wl, sizeof (*wp));
if (!wp) if (!wp)
return NULL; return NULL;
XITK_WIDGET_INIT (&b);
XITK_WIDGET_INIT(&lbl);
/* Create label and button (skinable) */ /* Create label and button (skinable) */
{ {
xitk_font_t *fs; xitk_font_t *fs;
int height; int height;
fs = xitk_font_load_font (wl->xitk, DEFAULT_FONT_10); fs = xitk_font_load_font (wp->w.wl->xitk, DEFAULT_FONT_10);
height = xitk_font_get_string_height(fs, " ") + 6; height = xitk_font_get_string_height(fs, " ") + 6;
xitk_font_unload_font(fs); xitk_font_unload_font(fs);
lbl.skin_element_name = "XITK_NOSKIN_INNER"; _xitk_new_widget_init (&lbl.nw, wp);
lbl.label = ""; lbl.nw.skin_element_name = "XITK_NOSKIN_INNER";
lbl.callback = NULL; lbl.label = "";
lbl.userdata = NULL; lbl.callback = NULL;
if ((wp->iw[_W_label] = xitk_noskin_label_create (wl, &lbl, if ((wp->iw[_W_label] = xitk_noskin_label_create (&lbl,
x, y, (width - height), height, DEFAULT_FONT_10))) { x, y, (width - height), height, DEFAULT_FONT_10))) {
xitk_widget_set_parent (wp->iw[_W_label], &wp->w); xitk_widget_set_parent (wp->iw[_W_label], &wp->w);
wp->iw[_W_label]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO; wp->iw[_W_label]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO;
xitk_dlist_add_tail (&wl->list, &wp->iw[_W_label]->node); xitk_dlist_add_tail (&wp->w.wl->list, &wp->iw[_W_label]->node);
} }
b.skin_element_name = "XITK_NOSKIN_DOWN"; _xitk_new_widget_init (&b.nw, wp);
b.callback = NULL; b.nw.skin_element_name = "XITK_NOSKIN_DOWN";
b.state_callback = _combo_rollunroll; b.callback = NULL;
b.userdata = (void *)wp; b.state_callback = _combo_rollunroll;
if ((wp->iw[_W_button] = xitk_noskin_button_create (wl, &b, if ((wp->iw[_W_button] = xitk_noskin_button_create (&b, x + (width - height)
x + (width - height), y, height, height))) { , y, height, height))) {
xitk_widget_set_parent (wp->iw[_W_button], &wp->w); xitk_widget_set_parent (wp->iw[_W_button], &wp->w);
wp->iw[_W_button]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO; wp->iw[_W_button]->type |= WIDGET_GROUP_MEMBER | WIDGET_GROUP_COMBO;
xitk_dlist_add_tail (&wl->list, &wp->iw[_W_button]->node); xitk_dlist_add_tail (&wp->w.wl->list, &wp->iw[_W_button]->node);
} }
wp->w.x = x; wp->w.x = x;
wp->w.y = y; wp->w.y = y;
wp->w.width = width; wp->w.width = width;
wp->w.height = height; wp->w.height = height;
} }
return _combo_create (wl, c, NULL, wp, 0, 0); return _combo_create (c, NULL, wp, 0, 0);
} }
 End of changes. 26 change blocks. 
56 lines changed or deleted 47 lines changed or added

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