Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
dev:howto:panel_plugins [2008/02/17 14:30] – created - moved from howto/panel_plugins stephan | dev:howto:panel_plugins [2021/01/19 14:05] – [Header File] ochosi | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Xfce Panel Plugins How To ====== | ====== Xfce Panel Plugins How To ====== | ||
- | {{wiki: | + | <note tip>You can get the sample plugin |
===== Introduction ===== | ===== Introduction ===== | ||
Line 7: | Line 6: | ||
Starting from version 4.4 the Xfce Panel support two types of plugins: internal and external. | Starting from version 4.4 the Xfce Panel support two types of plugins: internal and external. | ||
The internal plugins are loadable modules, using the | The internal plugins are loadable modules, using the | ||
- | [[http:// | + | [[https:// |
interface. External plugins are separate programs that are embedded into the panel using the | interface. External plugins are separate programs that are embedded into the panel using the | ||
- | [[http:// | + | [[https:// |
- | [[http:// | + | [[https:// |
In order to handle these plugins the plugin system was entirely rewritten, along with the rest | In order to handle these plugins the plugin system was entirely rewritten, along with the rest | ||
of the panel framework. This file describes the way plugin writers should interact with this system. | of the panel framework. This file describes the way plugin writers should interact with this system. | ||
- | The API documentation is installed with the panel and also available from | + | The [[: |
http:// | http:// | ||
+ | |||
Line 35: | Line 35: | ||
X-XFCE-Module=< | X-XFCE-Module=< | ||
X-XFCE-Module-Path=< | X-XFCE-Module-Path=< | ||
+ | |||
+ | For instance, | ||
+ | |||
+ | X-XFCE-Module=quicklauncher | ||
+ | X-XFCE-Module-Path=/ | ||
If the module should have no more than 1 instance running at the same time, you add this line: | If the module should have no more than 1 instance running at the same time, you add this line: | ||
Line 40: | Line 45: | ||
X-XFCE-Unique=true | X-XFCE-Unique=true | ||
+ | If the plugin is compatible with GTK+ 3, you need to add this line: | ||
+ | |||
+ | X-XFCE-API=2.0 | ||
===== Library ===== | ===== Library ===== | ||
Line 46: | Line 54: | ||
line like this: | line like this: | ||
- | XDT_CHECK_PACKAGE ([LIBXFCE4PANEL], | + | XDT_CHECK_PACKAGE ([LIBXFCE4PANEL], |
The above assumes that you are using the xfce4-dev-tools package, which you really should, | The above assumes that you are using the xfce4-dev-tools package, which you really should, | ||
Line 56: | Line 64: | ||
required headers ('' | required headers ('' | ||
- | #include < | + | #include < |
===== Plugin Registration ===== | ===== Plugin Registration ===== | ||
- | To register a plugin with the plugin system there are two macros | + | 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, | ||
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(construct); | XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(construct); | ||
Line 267: | Line 277: | ||
For creating a release you need to run '' | For creating a release you need to run '' | ||
+ | |||
+ | To help development, | ||
+ | |||
+ | * Create a symbolic link from your plugin binary to the panel' | ||
+ | * Copy ''/ | ||
+ | * Edit the latter to point at ' | ||
+ | * If you're porting a plugin to GTK+ 3, make sure to add '' | ||
+ | |||
+ | An example: | ||
+ | |||
+ | < | ||
+ | $cat / | ||
+ | [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 | ||
+ | </ | ||
+ | |||
+ | Now the ' | ||
===== Debugging ===== | ===== Debugging ===== | ||
- | One can use Valgrind to debug external plugins, using the technique described [[panel_plugin_debug|here]]. | + | One can use GDB and Valgrind to debug external plugins, using the technique described [[https:// |