Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
panel_plugins_howto [2006/12/19 18:59] nickpanel_plugins_howto [2007/08/06 18:07] – documentation link 85.25.140.211
Line 1: Line 1:
 ====== Xfce Panel Plugins How To ====== ====== Xfce Panel Plugins How To ======
 {{wiki:package.png  }} [[http://foo-projects.org/~nick/packages/xfce4-sample-plugin.tar.bz2|Download]] the external sample plugin. You can also [[http://svn.xfce.org/svn/goodies/xfce4-sample-plugin/trunk/|checkout]] the goodies svn. {{wiki:package.png  }} [[http://foo-projects.org/~nick/packages/xfce4-sample-plugin.tar.bz2|Download]] the external sample plugin. You can also [[http://svn.xfce.org/svn/goodies/xfce4-sample-plugin/trunk/|checkout]] the goodies svn.
 +
  
 ===== Introduction ===== ===== Introduction =====
Line 15: Line 16:
  
 The API documentation is installed with the panel and also available from  The API documentation is installed with the panel and also available from 
-http://www.xfce.org/documentation/api-4.4/+http://www.xfce.org/documentation/api/ 
  
 ===== .desktop file ===== ===== .desktop file =====
Line 211: Line 213:
   void xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin,    void xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin, 
                                      gboolean         expand);                                      gboolean         expand);
 +
 +
 +
 +
 +
  
 ===== Menu ===== ===== Menu =====
Line 219: Line 226:
 xfce_panel_plugin_add_action_widget() function. A plugin can also add additional, xfce_panel_plugin_add_action_widget() function. A plugin can also add additional,
 custom menu items. custom menu items.
 +
 +**IMPORTANT:** If your custom menu item allows changes to the plugin, make sure it
 +is safe when running in [[http://www.xfce.org/documentation/api/libxfce4util/libxfce4util-Xfce-Kiosk-functions.html|Kiosk]] mode!
  
   void   void
   xfce_panel_plugin_add_action_widget (XfcePanelPlugin *plugin,    xfce_panel_plugin_add_action_widget (XfcePanelPlugin *plugin, 
-                                       GtkWidget    *widget);+                                       GtkWidget       *widget);
  
   void   void
Line 228: Line 238:
                                       GtkMenuItem     *item);                                       GtkMenuItem     *item);
  
-If you're plugin has a configuration dialog you need to make that menu item+If your plugin has a configuration dialog you need to make that menu item
 visible and connect to the "configure-plugin" signal. The same for an about visible and connect to the "configure-plugin" signal. The same for an about
 dialog and the "about" signal. dialog and the "about" signal.
Line 235: Line 245:
  
   void xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin);   void xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin);
 +
  
  
Line 248: Line 259:
   xfce_panel_plugin_save_location (XfcePanelPlugin *plugin,   xfce_panel_plugin_save_location (XfcePanelPlugin *plugin,
                                    gboolean         create);                                    gboolean         create);
 +
 +
 +
 +===== Testing and Releasing the plugin =====
 +When you test your new plugin, use the ''-Wall -Werror'' CFLAGS (and a recent version of GCC) to detect code problems. Also make sure the plugins is linked (''plugin_name_LDADD'' in Makefile.am) to all the needed libraries, so there will be no problems when building with ''LDFLAGS="-Wl,--as-needed"''.
 +
 +For creating a release you need to run ''./autogen.sh && make distcheck''. Fix all warnings and errors in make distcheck before distributing the package.
  
 ===== Debugging ===== ===== Debugging =====
 One can use Valgrind to debug external plugins, using the technique described [[panel_plugin_debug|here]]. One can use Valgrind to debug external plugins, using the technique described [[panel_plugin_debug|here]].