![]() |
![]() |
![]() |
Libxfce4panel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Properties | Signals |
#include <libxfce4panel/libxfce4panel.h> XfcePanelPlugin; void (*XfcePanelPluginFunc) (XfcePanelPlugin *plugin); gboolean (*XfcePanelPluginCheck) (GdkScreen *screen); gboolean (*XfcePanelPluginPreInit) (int argc, char **argv); gchar * xfce_panel_plugin_get_name (XfcePanelPlugin *plugin); gchar * xfce_panel_plugin_get_id (XfcePanelPlugin *plugin); gchar * xfce_panel_plugin_get_display_name (XfcePanelPlugin *plugin); gint xfce_panel_plugin_get_size (XfcePanelPlugin *plugin); XfceScreenPosition xfce_panel_plugin_get_screen_position (XfcePanelPlugin *plugin); void xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin, gboolean expand); gboolean xfce_panel_plugin_get_expand (XfcePanelPlugin *plugin); GtkOrientation xfce_panel_plugin_get_orientation (XfcePanelPlugin *plugin); void xfce_panel_plugin_add_action_widget (XfcePanelPlugin *plugin, GtkWidget *widget); void xfce_panel_plugin_menu_insert_item (XfcePanelPlugin *plugin, GtkMenuItem *item); void xfce_panel_plugin_menu_show_about (XfcePanelPlugin *plugin); void xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin); void xfce_panel_plugin_block_menu (XfcePanelPlugin *plugin); void xfce_panel_plugin_unblock_menu (XfcePanelPlugin *plugin); void xfce_panel_plugin_register_menu (XfcePanelPlugin *plugin, GtkMenu *menu); gchar * xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin); gchar * xfce_panel_plugin_save_location (XfcePanelPlugin *plugin, gboolean create); void xfce_panel_plugin_focus_widget (XfcePanelPlugin *plugin, GtkWidget *widget); void xfce_panel_plugin_set_panel_hidden (XfcePanelPlugin *plugin, gboolean hidden);
XfcePanelPlugin is implemented by XfceExternalPanelPlugin and XfceInternalPanelPlugin.
"display-name" gchar* : Read "expand" gboolean : Read / Write "id" gchar* : Read "name" gchar* : Read "screen-position" XfceScreenPosition : Read "size" gint : Read
"about" : Run Last / No Recursion / No Hooks "configure-plugin" : Run Last / No Recursion / No Hooks "free-data" : Run Last / No Recursion / No Hooks "orientation-changed" : Run Last / No Recursion / No Hooks "save" : Run Last / No Recursion / No Hooks "screen-position-changed" : Run Last / No Recursion / No Hooks "size-changed" : Run Last / No Recursion / No Hooks
The interface implemented by both internal and external plugins. Plugin writers may use the functions described below to interact with the plugin widget.
typedef struct _XfcePanelPlugin XfcePanelPlugin;
The XfcePanelPlugin is a purely virtual object to describe an instance of a widget implementing the panel plugin interface.
void (*XfcePanelPluginFunc) (XfcePanelPlugin *plugin);
Callback function to create the plugin contents. It should be given as the argument to the registration macros.
See also: XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL()
and
XFCE_PANEL_PLUGIN_REGISTER_INTERNAL()
|
The XfcePanelPlugin |
gboolean (*XfcePanelPluginCheck) (GdkScreen *screen);
Callback function that is run before creating a plugin. It should return
FALSE
if the plugin is not available for whatever reason. The function
can be given as argument to one of the registration macros.
|
the GdkScreen the panel is running on |
Returns : |
TRUE if the plugin can be started, FALSE otherwise.
See also: XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_WITH_CHECK() ,
XFCE_PANEL_PLUGIN_REGISTER_INTERNAL_WITH_CHECK() and
XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL()
|
gboolean (*XfcePanelPluginPreInit) (int argc, char **argv);
Callback function that is run in an external plugin before gtk_init()
. It
should return FALSE
if the plugin is not available for whatever reason.
The function can be given as argument to one of the registration macros.
The main purpose of this callback is to allow multithreaded plugins to call
g_thread_init()
.
|
number of arguments to the plugin |
|
argument array |
Returns : |
TRUE on success, FALSE otherwise.
See also: XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL_FULL()
|
Since 4.5
gchar * xfce_panel_plugin_get_name (XfcePanelPlugin *plugin);
The plugin name identifies a plugin type and therefore must be unique.
|
a XfcePanelPlugin |
Returns : |
the plugin name. |
gchar * xfce_panel_plugin_get_id (XfcePanelPlugin *plugin);
The plugin id is a unique identifier string that is given to every instance
of a panel plugin. The returned string must be free using g_free()
.
|
a XfcePanelPlugin |
Returns : |
the plugin id. |
gchar * xfce_panel_plugin_get_display_name (XfcePanelPlugin *plugin);
The display name is the (translated) plugin name that can be used in a user interface, e.g. a dialog or a menu.
|
a XfcePanelPlugin |
Returns : |
the display name of plugin .
|
gint xfce_panel_plugin_get_size (XfcePanelPlugin *plugin);
The size of the panel that the plugin is part of.
|
a XfcePanelPlugin |
Returns : |
the current panel size. |
XfceScreenPosition xfce_panel_plugin_get_screen_position (XfcePanelPlugin *plugin);
The XfceScreenPosition of the panel that the plugin is part of.
|
a XfcePanelPlugin |
Returns : |
the current XfceScreenPosition of the panel. |
void xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin, gboolean expand);
Sets whether to expand the plugin when the width of the panel increases.
|
a XfcePanelPlugin |
|
whether to expand the plugin |
gboolean xfce_panel_plugin_get_expand (XfcePanelPlugin *plugin);
Return if this plugin will expand when the panel width increases.
|
a XfcePanelPlugin |
Returns : |
TRUE when it will expand.
|
GtkOrientation xfce_panel_plugin_get_orientation (XfcePanelPlugin *plugin);
Return the GtkOrientation of the panel that the plugin is part of.
|
a XfcePanelPlugin |
Returns : |
the current GtkOrientation of the panel. |
void xfce_panel_plugin_add_action_widget (XfcePanelPlugin *plugin, GtkWidget *widget);
Attach the plugin menu to this widget. Plugin writers should call this for every widget that can receive mouse events. If you forget to call this the plugin will not have a right-click menu and the user won't be able to remove it.
|
a XfcePanelPlugin |
|
a GtkWidget that receives mouse events |
void xfce_panel_plugin_menu_insert_item (XfcePanelPlugin *plugin, GtkMenuItem *item);
Insert custom menu item.
|
a XfcePanelPlugin |
|
the menu item to add |
void xfce_panel_plugin_menu_show_about (XfcePanelPlugin *plugin);
Show the 'About' item in the menu. Clicking on the menu item will emit the "about" signal.
|
a XfcePanelPlugin |
void xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin);
Show the 'Configure' item in the menu. Clicking on the menu item will emit the "configure-plugin" signal.
|
a XfcePanelPlugin |
void xfce_panel_plugin_block_menu (XfcePanelPlugin *plugin);
Temporarily block the menu from being shown. This can be used by plugin writers when the configuration dialog is active.
See also: xfce_panel_plugin_unblock_menu()
|
a XfcePanelPlugin |
void xfce_panel_plugin_unblock_menu (XfcePanelPlugin *plugin);
Don't block the menu from being shown.
See also: xfce_panel_plugin_block_menu()
|
a XfcePanelPlugin |
void xfce_panel_plugin_register_menu (XfcePanelPlugin *plugin, GtkMenu *menu);
Register an open menu. This will make sure the panel will properly handle
its autohide behaviour. You have to call this function every time the menu
is opened (e.g. using gtk_popup_menu()
).
If you want to open the menu aligned to the side of the panel (and the
plugin), you should use xfce_panel_plugin_position_menu()
as
GtkMenuPositionFunc. This callback function will take care of calling
xfce_panel_plugin_register_menu()
as well.
See also: xfce_panel_plugin_position_menu()
.
|
a XfcePanelPlugin |
|
a GtkMenu that will be opened |
gchar * xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin);
Looks up unique filename associated with plugin
in standard configuration
locations. Only use this function when you want the read location of the
configuration file, since the path might point to a not writable file (for
example the default- or kiosk-configuration).
See also: xfce_panel_plugin_save_location()
and #xfce_resource_lookup()
|
a XfcePanelPlugin |
Returns : |
path to configuration file or NULL if none was found. The
returned string must be freed using g_free() .
|
gchar * xfce_panel_plugin_save_location (XfcePanelPlugin *plugin, gboolean create);
Returns the path that can be used to store configuration information. Don't use this function when you want to read the configuration file, then use xfce_panel_plugin_lookup_rc_file.
See also xfce_panel_plugin_lookup_rc_file()
and #xfce_resource_save_location()
.
|
a XfcePanelPlugin |
|
whether the file should be created |
Returns : |
path to configuration file or NULL is the file could not be
created. The returned string must be freed using g_free() .
|
void xfce_panel_plugin_focus_widget (XfcePanelPlugin *plugin, GtkWidget *widget);
Grab the focus on widget
. Asks the panel to allow focus on its items and
set the focus to the requested widget.
|
a XfcePanelPlugin |
|
widget to focus |
void xfce_panel_plugin_set_panel_hidden (XfcePanelPlugin *plugin, gboolean hidden);
Ask the panel to hide or unhide. This only has effect when autohide is enabled.
|
a XfcePanelPlugin |
|
FALSE to unhide, TRUE to hide the panel
|
"display-name"
property"display-name" gchar* : Read
Translated plugin name. This is the name that can be presented to the user, e.g. in dialogs or menus.
Default value: NULL
"expand"
property"expand" gboolean : Read / Write
Whether to expand the plugin when the panel width increases.
Default value: FALSE
"id"
property"id" gchar* : Read
Unique identifier string created for every XfcePanelPlugin instance.
Default value: NULL
"name"
property"name" gchar* : Read
Untranslated plugin name. This identifies the plugin type and therefore has to be unique.
Default value: NULL
"screen-position"
property"screen-position" XfceScreenPosition : Read
The current XfceScreenPosition of the panel.
Default value: XFCE_SCREEN_POSITION_S
"about"
signalvoid user_function (XfcePanelPlugin *plugin, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the 'About' menu item is clicked. Plugin writers should connect to this signal to show information about their plugin (and its authors).
See also: xfce_panel_plugin_menu_show_about()
|
a XfcePanelPlugin widget |
|
user data set when the signal handler was connected. |
"configure-plugin"
signalvoid user_function (XfcePanelPlugin *plugin, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the 'Configure' menu item is clicked. Plugin writers should connect to this signal to show a settings dialog.
See also: xfce_panel_plugin_menu_show_configure()
|
a XfcePanelPlugin widget |
|
user data set when the signal handler was connected. |
"free-data"
signalvoid user_function (XfcePanelPlugin *plugin, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the panel is closing. Plugin writers should connect to this signal to free any allocated resources.
See also: "save"
|
a XfcePanelPlugin widget |
|
user data set when the signal handler was connected. |
"orientation-changed"
signalvoid user_function (XfcePanelPlugin *plugin, GtkOrientation orientation, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the panel orientation changes.
|
a XfcePanelPlugin widget |
|
new GtkOrientation of the panel |
|
user data set when the signal handler was connected. |
"save"
signalvoid user_function (XfcePanelPlugin *plugin, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted before the panel is closing. May be called more than once while the panel is running. Plugin writers should connect to this signal to save the plugins configuration.
See also: xfce_panel_plugin_get_rc_file()
|
a XfcePanelPlugin widget |
|
user data set when the signal handler was connected. |
"screen-position-changed"
signalvoid user_function (XfcePanelPlugin *plugin, XfceScreenPosition position, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the screen position changes. Most plugins will be more interested in the "orientation-changed" signal.
|
a XfcePanelPlugin widget |
|
new XfceScreenPosition of the panel |
|
user data set when the signal handler was connected. |
"size-changed"
signalgboolean user_function (XfcePanelPlugin *plugin, gint size, gpointer user_data) : Run Last / No Recursion / No Hooks
Emitted when the panel size changes.
|
a XfcePanelPlugin widget |
|
new panel size |
|
user data set when the signal handler was connected. |
Returns : |
TRUE when handled, FALSE otherwise.
|