aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-03-30 16:10:01 +0200
committerAnders Broman <a.broman58@gmail.com>2015-04-14 04:00:39 +0000
commiteeed4d1121f122aa5579153872193b9a91d8ad52 (patch)
tree671f1f43ba913c80270ee0cc54c7a536009c0cd9 /doc
parent035d7412892574fcdf6953110cc4e6384602062f (diff)
UI: Implementing menus for plugins
Plugins may utilize the tap interface to provide special tools or analysis options, not otherwise available in Wireshark, or perhaps not allowed to be distributed freely. Up until now, those tools either had to start automatically, or could not be started at all, or had to be started separately. It should be possible, that those tools may be started using a menu entry directly from Wireshark. This interface tries to achieve exactly that. This interface uses a clean interface, which can be implemented in any plugin or dissector. Documentation for this has been added to README.plugins. Separators are only supported for now in the Qt interface, but URLs can now be added as a simple item, and the UI will use the same methods used for other URL calls to open them. Change-Id: I170107dafb66f6badaa864d05a9091e5cbbf52c2 Reviewed-on: https://code.wireshark.org/review/7865 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/README.plugins47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/README.plugins b/doc/README.plugins
index 91a9ac7755..eca52da251 100644
--- a/doc/README.plugins
+++ b/doc/README.plugins
@@ -320,6 +320,53 @@ is encouraged to update their plugins as outlined below:
o Change the Makefile.am and Makefile.nmake files to match those of
the DOCSIS plugin.
+
+6 How to implement a plugin related menu
+
+A plugin (as well as built-in dissectors) may implement a menu within
+Wireshark to be used to trigger options, start tools, open Websites, ...
+
+This menu structure is built using the ext_menubar.h interface and it's
+corresponding functions.
+
+The menu items all call a callback provided by the plugin, which takes
+a pointer to the menuitem entry ad data. This pointer may be used to
+provide userdata to each entry. The pointer must utilize WS_DLL_PUBLIC_DEF
+and has the following structure:
+
+ WS_DLL_PUBLIC_DEF void
+ menu_cb(gpointer user_data)
+ {
+ ... Do something ...
+ }
+
+The menu entries themselves are generated with the following code structure:
+
+ ext_menu_t * ext_menu, *os_menu = NULL;
+
+ ext_menu = ext_menubar_register_menu (
+ <your_proto_item>, "TestMenu", "Some Menu Entry", TRUE );
+ ext_menubar_add_entry(ext_menu, "TestEntry1", "Test Entry 1",
+ "This is a tooltip", menu_cb, <user_data>);
+ ext_menubar_add_entry(ext_menu, "TestEntry2", "Test Entry 2",
+ NULL, menu_cb, <user_data>);
+
+ os_menu = ext_menubar_add_submenu(ext_menu, "TestSubMenu", "Sub Menu" );
+ ext_menubar_add_entry(os_menu, "SubEntry1", "Test Entry A",
+ NULL, menu_cb, <user_data>);
+ ext_menubar_add_entry(os_menu, "SubEntry2", "Test Entry B",
+ NULL, menu_cb, <user_data>);
+
+The second parameter to ext_menubar_register_menu and ext_menubar_add_entry is
+an internal definition for the menu, utilized by the GTK interface. It must not
+contain any characters besides A-Z, a-z and 0-9.
+
+Using the Gtk Version and a Mac OSX operating system, this will not work, and
+the Gtk interface is currently not supported on this plattform. The Qt interface
+on Mac provides the menu.
+
+For a more detailed information, please refer to ext_menubar.h
+
----------------
Ed Warnicke <hagbard@physics.rutgers.edu>