X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Fmenu.c;h=90a782b5ba76dcf1ba8898fc46f2ca94ab0a8f7e;hb=6550d71135aed5d81a76d7d5625757570bcf0819;hp=32c35c2c766b401d102cae5a9ab681a203acdc9a;hpb=754351700b3d5fb6112e72dd4722a546abc219f1;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/menu.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/menu.c index 32c35c2c..90a782b5 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/menu.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/menu.c @@ -20,43 +20,53 @@ #include -inline LttvMenus *lttv_menus_new() { - return g_array_new(FALSE, FALSE, sizeof(lttv_menu_closure)); +LttvMenus *lttv_menus_new() { + return g_array_new(FALSE, FALSE, sizeof(LttvMenuClosure)); } /* MD: delete elements of the array also, but don't free pointed addresses * (functions). */ -inline void lttv_menus_destroy(LttvMenus *h) { +void lttv_menus_destroy(LttvMenus *h) { g_debug("lttv_menus_destroy()"); g_array_free(h, TRUE); } -inline void lttv_menus_add(LttvMenus *h, lttv_constructor f, char* menuPath, char* menuText) +LttvMenuClosure lttv_menus_add(LttvMenus *h, + lttvwindow_viewer_constructor f, + char* menu_path, char* menu_text, GtkWidget *widget) { - lttv_menu_closure c; + LttvMenuClosure c; /* if h is null, do nothing, or popup a warning message */ if(h == NULL)return; c.con = f; - c.menuPath = menuPath; - c.menuText = menuText; + c.menu_path = menu_path; + c.menu_text = menu_text; + c.widget = widget; g_array_append_val(h,c); + + return c; } -gboolean lttv_menus_remove(LttvMenus *h, lttv_constructor f) +GtkWidget *lttv_menus_remove(LttvMenus *h, lttvwindow_viewer_constructor f) { - lttv_menu_closure * tmp; + LttvMenuClosure * tmp; gint i; + GtkWidget *widget; + for(i=0;ilen;i++){ - tmp = & g_array_index(h, lttv_menu_closure, i); - if(tmp->con == f)break; + tmp = & g_array_index(h, LttvMenuClosure, i); + if(tmp->con == f) { + widget = tmp->widget; + break; + } } if(ilen){ g_array_remove_index(h, i); - return TRUE; - }else return FALSE; + return widget; + }else return NULL; }