From 6f1c9fd4320804958a8731afc45a1cc6f9ee3b16 Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Sun, 9 Aug 2015 14:36:53 +0200 Subject: PluginIF: Parent menu and goto frame The developer may provide a given menu as parent menu for the sub menu. If the menu does not exist, the main menu will be used. Has been implemented for Qt as well as GTK. Change-Id: I3f26684862fd0b08f59eeb4d6f4a24ce7dc3d428 Reviewed-on: https://code.wireshark.org/review/9939 Reviewed-by: Roland Knall Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Reviewed-by: Anders Broman Tested-by: Petri Dish Buildbot --- epan/plugin_if.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'epan/plugin_if.c') diff --git a/epan/plugin_if.c b/epan/plugin_if.c index b5e5bf5ee9..11f9d85a5e 100644 --- a/epan/plugin_if.c +++ b/epan/plugin_if.c @@ -66,6 +66,8 @@ extern ext_menu_t * ext_menubar_register_menu(int proto_id, const gchar * menula entry->proto = proto_id; entry->is_plugin = is_plugin; + entry->parent_menu = 0; + /* Create a name for this submenu */ entry->name = name; entry->label = g_strdup(menulabel); @@ -80,6 +82,17 @@ extern ext_menu_t * ext_menubar_register_menu(int proto_id, const gchar * menula return entry; } +extern ext_menu_t * ext_menubar_set_parentmenu(ext_menu_t * menu, const gchar * parentmenu) +{ + g_assert(menu != NULL && menu->parent == NULL); + + g_assert(parentmenu != 0); + + menu->parent_menu = g_strdup(parentmenu); + + return menu; +} + extern ext_menu_t * ext_menubar_add_submenu(ext_menu_t * parent, const gchar *menulabel) { ext_menubar_t * entry = NULL; @@ -212,6 +225,17 @@ extern void plugin_if_apply_filter(const char * filter_string, gboolean force) plugin_if_call_gui_cb(actionType, dataSet); } +extern void plugin_if_goto_frame(guint32 framenr) +{ + GHashTable * dataSet = NULL; + + dataSet = g_hash_table_new(g_str_hash, g_str_equal); + + g_hash_table_insert( dataSet, g_strdup("frame_nr"), GUINT_TO_POINTER(framenr) ); + + plugin_if_call_gui_cb(PLUGIN_IF_GOTO_FRAME, dataSet); +} + extern void plugin_if_save_preference(const char * pref_module, const char * pref_key, const char * pref_value) { GHashTable * dataSet = NULL; -- cgit v1.2.1