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
Next revisionBoth sides next revision
dev:howto:panel_plugins [2018/07/25 01:24] – [Library] Update example version of libxfce4panel andreldmdev:howto:panel_plugins [2019/02/17 10:31] – use XFCE_PANEL_PLUGIN_REGISTER instead of older macros lorb
Line 67: Line 67:
 ===== Plugin Registration ===== ===== Plugin Registration =====
  
-To register a plugin with the plugin system there are two macros available that should be used,  +To register a plugin with the plugin system there is one macro available that should be used, instead of using the library functions directly
-instead of using the library functions directly; one for internal plugins and one for external plugins.+  XFCE_PANEL_PLUGIN_REGISTER(construct); 
 +   
 +Older versions use the following two deprecated macros, one for internal plugins and one for external plugins.
  
   XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(construct);   XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(construct);
Line 279: Line 281:
   * Create a symbolic link from your plugin binary to the panel's prefix installation, e.g. ''ln -s /home/johndoe/where/your/src/is/panel-plugin/.libs/libyourplugin.so /usr/lib/xfce4/panel-plugins/libyourplugin-git.so''   * Create a symbolic link from your plugin binary to the panel's prefix installation, e.g. ''ln -s /home/johndoe/where/your/src/is/panel-plugin/.libs/libyourplugin.so /usr/lib/xfce4/panel-plugins/libyourplugin-git.so''
   * Copy ''/usr/share/xfce4/panel/plugins/yourplugin.desktop'' to ''/usr/share/xfce4/panel/plugins/yourplugin-git.desktop''   * Copy ''/usr/share/xfce4/panel/plugins/yourplugin.desktop'' to ''/usr/share/xfce4/panel/plugins/yourplugin-git.desktop''
-  * Edit the latter to point at 'yourplugin-git' instead of 'yourplugin'modify the ''Name'' entry to distinguish your instance and ''X-XFCE-Module'' to match the symbolic link, i.e. ''libyourplugin-git''.+  * Edit the latter to point at 'yourplugin-git' instead of 'yourplugin'modify the ''Name'' entry to distinguish your instance and ''X-XFCE-Module'' to match the symbolic link, i.e. ''yourplugin-git''.
   * If you're porting a plugin to GTK+ 3, make sure to add ''X-XFCE-API=2.0'' to the desktop-git file.   * If you're porting a plugin to GTK+ 3, make sure to add ''X-XFCE-API=2.0'' to the desktop-git file.
 +
 +An example:
 +
 +<code>
 +$cat /usr/share/xfce4/panel/plugins/diskperf-git.desktop
 +[Xfce Panel]
 +Type=X-XFCE-PanelPlugin
 +Encoding=UTF-8
 +Name=Disk Performance Monitor (git)
 +Comment=Show disk performance
 +Icon=drive-harddisk
 +X-XFCE-Internal=FALSE
 +X-XFCE-Module=diskperf-git
 +X-XFCE-API=2.0
 +</code>
  
 Now the 'git' version of the panel plugin should be available in the 'add plugin' panel dialog. Whenever you make changes and compile the plugin, all you need to do is to add the plugin to panel again or simply refresh the panel ''xfce4-panel -r''. Now the 'git' version of the panel plugin should be available in the 'add plugin' panel dialog. Whenever you make changes and compile the plugin, all you need to do is to add the plugin to panel again or simply refresh the panel ''xfce4-panel -r''.