Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
Incorrect information in README.plugins Section 6
Browse files Browse the repository at this point in the history
The examples showing how to add menu entries are based on
older versions of some of the related functions.  This change
corrects those examples.

Bug: 11819
Change-Id: Iad9beb2e87d3d1efe5f9dfa93a0e7110b8d9f53a
Reviewed-on: https://code.wireshark.org/review/12308
Reviewed-by: Alexis La Goutte <[email protected]>
Reviewed-by: Anders Broman <[email protected]>
  • Loading branch information
credible58 authored and AndersBroman committed Dec 1, 2015
1 parent 7332001 commit 30c7736
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions doc/README.plugins
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ is encouraged to update their plugins as outlined below:
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 plugin_if.h interface and it's
This menu structure is built using the plugin_if.h interface and its
corresponding functions.

The menu items all call a callback provided by the plugin, which takes
Expand All @@ -337,7 +337,8 @@ 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)
menu_cb(ext_menubar_gui_type gui_type, gpointer gui_data,
gpointer user_data _U_)
{
... Do something ...
}
Expand All @@ -347,22 +348,18 @@ 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",
<your_proto_item>, "Some Menu Entry", TRUE );
ext_menubar_add_entry(ext_menu, "Test Entry 1",
"This is a tooltip", menu_cb, <user_data>);
ext_menubar_add_entry(ext_menu, "TestEntry2", "Test Entry 2",
ext_menubar_add_entry(ext_menu, "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",
os_menu = ext_menubar_add_submenu(ext_menu, "Sub Menu" );
ext_menubar_add_entry(os_menu, "Test Entry A",
NULL, menu_cb, <user_data>);
ext_menubar_add_entry(os_menu, "SubEntry2", "Test Entry B",
ext_menubar_add_entry(os_menu, "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.

This will not work with the GTK version on OS X; the GTK interface is
currently not supported on this plattform. The Qt interface on OS X
provides the menu.
Expand All @@ -385,6 +382,9 @@ The following methods exist so far:
WS_DLL_PUBLIC void plugin_if_save_preference
(const char * pref_module, const char * pref_key, const char * pref_value);

/* Jumps to the given frame number */
WS_DLL_PUBLIC void plugin_if_goto_frame(guint32 framenr);



----------------
Expand Down

0 comments on commit 30c7736

Please sign in to comment.