X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Ftoolbar.c;h=72f4a1573bf87e4bc985d3126f51d5b941aee920;hb=2eef04b5f3234a4e303bd6162eb20d055b7d44cf;hp=8a39ae74fb67ee97c2b3a4164404318c14c4ec78;hpb=42fcbb715d16ba7c2c0a37aab5add4bd64d96079;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c index 8a39ae74..72f4a157 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c @@ -19,44 +19,50 @@ #include #include - -inline LttvToolbars *lttv_toolbars_new() { - return g_array_new(FALSE, FALSE, sizeof(lttv_toolbar_closure)); +LttvToolbars *lttv_toolbars_new() { + return g_array_new(FALSE, FALSE, sizeof(LttvToolbarClosure)); } /* MD: delete elements of the array also, but don't free pointed addresses * (functions). */ -inline void lttv_toolbars_destroy(LttvToolbars *h) { +void lttv_toolbars_destroy(LttvToolbars *h) { g_debug("lttv_toolbars_destroy"); g_array_free(h, TRUE); } -inline void lttv_toolbars_add(LttvToolbars *h, lttvwindow_viewer_constructor f, char* tooltip, char ** pixmap) +LttvToolbarClosure lttv_toolbars_add(LttvToolbars *h, + lttvwindow_viewer_constructor f, + char* tooltip, char ** pixmap, GtkWidget *widget) { - lttv_toolbar_closure c; - - /* if h is null, do nothing, or popup a warning message */ - if(h == NULL)return; + LttvToolbarClosure c; c.con = f; c.tooltip = tooltip; c.pixmap = pixmap; - g_array_append_val(h,c); + c.widget = widget; + if(h != NULL) g_array_append_val(h,c); + + return c; } -gboolean lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f) +GtkWidget *lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f) { - lttv_toolbar_closure * tmp; - gint i; + LttvToolbarClosure * tmp; + guint i; + GtkWidget *widget; + for(i=0;ilen;i++){ - tmp = & g_array_index(h, lttv_toolbar_closure, i); - if(tmp->con == f)break; + tmp = & g_array_index(h, LttvToolbarClosure, 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; } unsigned lttv_toolbars_number(LttvToolbars *h)