summaryrefslogtreecommitdiff
path: root/epan/plugin_if.c
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2015-08-09 14:36:53 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-09-08 11:03:35 +0000
commit6f1c9fd4320804958a8731afc45a1cc6f9ee3b16 (patch)
tree88733bb1ae91072d9c6dac9404074e5afa59cd55 /epan/plugin_if.c
parent28128ca41c299ea859fd59583a12cd767b1af33f (diff)
downloadwireshark-6f1c9fd4320804958a8731afc45a1cc6f9ee3b16.tar.gz
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 <rknall@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Diffstat (limited to 'epan/plugin_if.c')
-rw-r--r--epan/plugin_if.c24
1 files changed, 24 insertions, 0 deletions
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;