XfcePanelPlugin

XfcePanelPlugin — Interface for panel plugins

Functions

const gchar * xfce_panel_plugin_get_name ()
const gchar * xfce_panel_plugin_get_display_name ()
const gchar * xfce_panel_plugin_get_comment ()
gint xfce_panel_plugin_get_unique_id ()
const gchar * xfce_panel_plugin_get_property_base ()
const gchar * const * xfce_panel_plugin_get_arguments ()
gint xfce_panel_plugin_get_size ()
gboolean xfce_panel_plugin_get_expand ()
void xfce_panel_plugin_set_expand ()
GtkOrientation xfce_panel_plugin_get_orientation ()
XfceScreenPosition xfce_panel_plugin_get_screen_position ()
gboolean xfce_panel_plugin_get_locked ()
void xfce_panel_plugin_take_window ()
void xfce_panel_plugin_add_action_widget ()
void xfce_panel_plugin_menu_insert_item ()
void xfce_panel_plugin_menu_show_configure ()
void xfce_panel_plugin_menu_show_about ()
void xfce_panel_plugin_menu_destroy ()
void xfce_panel_plugin_remove ()
void xfce_panel_plugin_block_menu ()
void xfce_panel_plugin_unblock_menu ()
void xfce_panel_plugin_register_menu ()
GtkArrowType xfce_panel_plugin_arrow_type ()
void xfce_panel_plugin_position_widget ()
void xfce_panel_plugin_position_menu ()
void xfce_panel_plugin_popup_menu ()
void xfce_panel_plugin_popup_window ()
void xfce_panel_plugin_focus_widget ()
void xfce_panel_plugin_block_autohide ()
gchar * xfce_panel_plugin_lookup_rc_file ()
gchar * xfce_panel_plugin_save_location ()
#define xfce_panel_plugin_xfconf_channel_new()
gint xfce_panel_plugin_get_icon_size ()
XfcePanelPluginMode xfce_panel_plugin_get_mode ()
guint xfce_panel_plugin_get_nrows ()
gboolean xfce_panel_plugin_get_shrink ()
gboolean xfce_panel_plugin_get_small ()
void xfce_panel_plugin_set_shrink ()
void xfce_panel_plugin_set_small ()

Properties

GStrv arguments Read / Write / Construct Only
char * comment Read / Write / Construct Only
gboolean dark-mode Read / Write
char * display-name Read / Write / Construct Only
gboolean expand Read / Write
int icon-size Read
XfcePanelPluginMode mode Read
char * name Read / Write / Construct Only
guint nrows Read
GtkOrientation orientation Read
XfceScreenPosition screen-position Read
gboolean shrink Read / Write
int size Read
gboolean small Read / Write
int unique-id Read / Write / Construct Only

Signals

void about Run Last
void configure-plugin Run Last
void free-data Run Last
void mode-changed Run Last
void nrows-changed Run Last
void orientation-changed Run Last
gboolean remote-event Run Last
void removed Run Last
void save Run Last
void screen-position-changed Run Last
gboolean size-changed Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkEventBox
                        ╰── XfcePanelPlugin

Implemented Interfaces

XfcePanelPlugin implements AtkImplementorIface, GtkBuildable and XfcePanelPluginProvider.

Includes

#include <libxfce4panel/libxfce4panel.h>

Description

The interface plugin developers used to interact with the plugin and the panel.

Functions

xfce_panel_plugin_get_name ()

const gchar *
xfce_panel_plugin_get_name (XfcePanelPlugin *plugin);

The internal name of the panel plugin.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the name of the panel plugin.


xfce_panel_plugin_get_display_name ()

const gchar *
xfce_panel_plugin_get_display_name (XfcePanelPlugin *plugin);

This returns the translated name of the plugin set in the .desktop file of the plugin.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the (translated) display name of the plugin.


xfce_panel_plugin_get_comment ()

const gchar *
xfce_panel_plugin_get_comment (XfcePanelPlugin *plugin);

This returns the translated comment of the plugin set in the .desktop file of the plugin.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the (translated) comment of the plugin.

Since: 4.8


xfce_panel_plugin_get_unique_id ()

gint
xfce_panel_plugin_get_unique_id (XfcePanelPlugin *plugin);

The internal unique id of the plugin. Each plugin in the panel has a unique number that is for example used for the config file name or property base in the xfconf channel.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the unique id of the plugin.

Since 4.8


xfce_panel_plugin_get_property_base ()

const gchar *
xfce_panel_plugin_get_property_base (XfcePanelPlugin *plugin);

The property base for this plugin in the xfce4-panel XfconfChannel, this name is something like /plugins/plugin-1.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the property base for the xfconf channel userd by a plugin.

See also: xfconf_channel_new_with_property_base. XFCE_PANEL_PLUGIN_CHANNEL_NAME and xfce_panel_get_channel_name


xfce_panel_plugin_get_arguments ()

const gchar * const  *
xfce_panel_plugin_get_arguments (XfcePanelPlugin *plugin);

Argument vector passed to the plugin when it was added. Most of the time the return value will be NULL, but if could for example contain a list of filenames when the user added the plugin with

xfce4-panel --add=launcher *.desktop

see the code of the launcher plugin how to use this.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the argument vector. The vector is owned by the plugin and should not be freed.

Since: 4.8


xfce_panel_plugin_get_size ()

gint
xfce_panel_plugin_get_size (XfcePanelPlugin *plugin);

The size of the panel in which the plugin is embedded.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the current size of the panel.


xfce_panel_plugin_get_expand ()

gboolean
xfce_panel_plugin_get_expand (XfcePanelPlugin *plugin);

Whether the plugin is expanded or not. This set by the plugin using xfce_panel_plugin_set_expand().

Parameters

plugin

an XfcePanelPlugin.

 

Returns

TRUE when the plugin should expand, FALSE otherwise.


xfce_panel_plugin_set_expand ()

void
xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin,
                              gboolean expand);

Whether the plugin should expand of not

Parameters

plugin

an XfcePanelPlugin.

 

expand

whether to expand the plugin.

 

xfce_panel_plugin_get_orientation ()

GtkOrientation
xfce_panel_plugin_get_orientation (XfcePanelPlugin *plugin);

The orientation of the panel in which the plugin is embedded.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the current GtkOrientation of the panel.


xfce_panel_plugin_get_screen_position ()

XfceScreenPosition
xfce_panel_plugin_get_screen_position (XfcePanelPlugin *plugin);

The screen position of the panel in which the plugin is embedded.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the current XfceScreenPosition of the panel.


xfce_panel_plugin_get_locked ()

gboolean
xfce_panel_plugin_get_locked (XfcePanelPlugin *plugin);

Whether the plugin is locked (not allowing customization). This is emitted through the panel based on the Xfconf locking of the panel window the plugin is embedded on.

It is however possible to send a fake signal to the plugin to override this propery, so you should only use this for interface elements and (if you use Xfconf) check the locking yourself before you write any values or query the kiosk mode using the api in libxfce4util.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

TRUE if the user is not allowed to modify the plugin, FALSE is customization is allowed.

Since: 4.8


xfce_panel_plugin_take_window ()

void
xfce_panel_plugin_take_window (XfcePanelPlugin *plugin,
                               GtkWindow *window);

Connect a dialog to a plugin. When the plugin is closed, it will destroy the window .

Parameters

plugin

an XfcePanelPlugin.

 

window

a GtkWindow.

 

Since: 4.8


xfce_panel_plugin_add_action_widget ()

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.

Parameters

plugin

an XfcePanelPlugin.

 

widget

a GtkWidget that receives mouse events.

 

xfce_panel_plugin_menu_insert_item ()

void
xfce_panel_plugin_menu_insert_item (XfcePanelPlugin *plugin,
                                    GtkMenuItem *item);

Insert a custom menu item to the plugin's right click menu. This item is packed below the first item in the menu, which displays the plugin's name.

Parameters

plugin

an XfcePanelPlugin.

 

item

a GtkMenuItem.

 

xfce_panel_plugin_menu_show_configure ()

void
xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin);

Show the "Properties" item in the menu. Clicking on the menu item will emit the "configure-plugin" signal.

Parameters

plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_menu_show_about ()

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.

Parameters

plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_menu_destroy ()

void
xfce_panel_plugin_menu_destroy (XfcePanelPlugin *plugin);

Remove all custom menu items added through xfce_panel_plugin_menu_insert_item from the menu.

Parameters

plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_remove ()

void
xfce_panel_plugin_remove (XfcePanelPlugin *plugin);

Remove this plugin from the panel and remove all its configuration.

Plugins should not use this function to implement their own menu item or button to remove theirselfs from the panel, but only in case the there are problems with the plugin in the panel. Always try to inform the user why this occured.

Parameters

plugin

an XfcePanelPlugin.

 

Since: 4.8


xfce_panel_plugin_block_menu ()

void
xfce_panel_plugin_block_menu (XfcePanelPlugin *plugin);

Block configuring the plugin. This will make the "Properties" menu item insensitive.

Parameters

plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_unblock_menu ()

void
xfce_panel_plugin_unblock_menu (XfcePanelPlugin *plugin);

Unblock configuring the plugin. This will make the "Properties" menu item sensitive.

Parameters

plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_register_menu ()

void
xfce_panel_plugin_register_menu (XfcePanelPlugin *plugin,
                                 GtkMenu *menu);

Register a menu that is about to popup. 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_menu_popup_at_widget()).

If you want to open the menu aligned to the side of the panel (and the plugin), you should use xfce_panel_plugin_popup_menu(). This function will take care of calling xfce_panel_plugin_register_menu() as well.

See also: xfce_panel_plugin_popup_menu() and xfce_panel_plugin_block_autohide().

Parameters

plugin

an XfcePanelPlugin.

 

menu

a GtkMenu that will be opened

 

xfce_panel_plugin_arrow_type ()

GtkArrowType
xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin);

Determine the GtkArrowType for a widget that opens a menu.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the GtkArrowType to use.


xfce_panel_plugin_position_widget ()

void
xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
                                   GtkWidget *menu_widget,
                                   GtkWidget *attach_widget,
                                   gint *x,
                                   gint *y);

Computes the x and y coordinates to position the menu_widget relative to attach_widget . If attach_widget is NULL, the computed position will be relative to plugin .

Note that if the panel is hidden (autohide), you should delay calling this function until the panel is shown, so that it returns the correct coordinates.

This function is intended for custom menu widgets and should rarely be used since 4.19.0. For a regular GtkMenu you should use xfce_panel_plugin_popup_menu() instead, and for a GtkWindow xfce_panel_plugin_popup_window(), which take care of positioning for you, among other things.

See also: xfce_panel_plugin_popup_menu() and xfce_panel_plugin_popup_window().

Parameters

plugin

an XfcePanelPlugin.

 

menu_widget

a GtkWidget that will be used as popup menu.

 

attach_widget

a GtkWidget relative to which the menu should be positioned.

[allow-none]

x

return location for the x coordinate.

[out]

y

return location for the y coordinate.

[out]

xfce_panel_plugin_position_menu ()

void
xfce_panel_plugin_position_menu (GtkMenu *menu,
                                 gint *x,
                                 gint *y,
                                 gboolean *push_in,
                                 gpointer panel_plugin);

xfce_panel_plugin_position_menu has been deprecated since version 4.17.2 and should not be used in newly-written code.

Use xfce_panel_plugin_popup_menu() instead.

Function to be used as GtkMenuPositionFunc in a call to gtk_menu_popup(). As data argument it needs an XfcePanelPlugin.

The menu is normally positioned relative to panel_plugin . If you want the menu to be positioned relative to another widget, you can use gtk_menu_attach_to_widget() to explicitly set a 'parent' widget.

As a convenience, xfce_panel_plugin_position_menu() calls xfce_panel_plugin_register_menu() for the menu.

Example 2. 

void myplugin_popup_menu (XfcePanelPlugin *plugin, GtkMenu *menu, GdkEventButton *ev) { gtk_menu_popup (menu, NULL, NULL, xfce_panel_plugin_position_menu, plugin, ev->button, ev->time ); }

For a custom widget that will be used as a popup menu, use xfce_panel_plugin_position_widget() instead.

See also: gtk_menu_popup().

Parameters

menu

a GtkMenu.

 

x

return location for the x coordinate.

[out]

y

return location for the y coordinate.

[out]

push_in

keep inside the screen (see GtkMenuPositionFunc)

 

panel_plugin

an XfcePanelPlugin.

 

xfce_panel_plugin_popup_menu ()

void
xfce_panel_plugin_popup_menu (XfcePanelPlugin *plugin,
                              GtkMenu *menu,
                              GtkWidget *widget,
                              const GdkEvent *trigger_event);

Pops up menu at widget if widget is non-NULL and if appropriate given the panel position, otherwise pops up menu at pointer.

As a convenience, xfce_panel_plugin_popup_menu() calls xfce_panel_plugin_register_menu() for the menu .

For a custom widget that will be used as a popup menu, use xfce_panel_plugin_popup_window() instead if this widget is a GtkWindow, or xfce_panel_plugin_position_widget().

See also: gtk_menu_popup_at_widget() and gtk_menu_popup_at_pointer().

Parameters

plugin

an XfcePanelPlugin.

 

menu

a GtkMenu.

 

widget

the GtkWidget to align menu with or NULL to pop up menu at pointer.

[allow-none]

trigger_event

the GdkEvent that initiated this request or NULL if it's the current event.

[allow-none]

Since: 4.17.2


xfce_panel_plugin_popup_window ()

void
xfce_panel_plugin_popup_window (XfcePanelPlugin *plugin,
                                GtkWindow *window,
                                GtkWidget *widget);

Pops up window at widget if widget is non-NULL, otherwise pops up window at plugin . The user should not have to set any property of window : this function takes care of setting the necessary properties to make window appear as a menu widget.

This function tries to produce for a GtkWindow a behavior similar to that produced by xfce_panel_plugin_popup_menu() for a GtkMenu. In particular, clicking outside the window or pressing Esc should hide it, and the function takes care to lock panel autohide when the window is shown.

However, it may be that, especially on Wayland and depending on the compositor used, hiding the window works more or less well. Also, window positioning at widget only works on Wayland if the compositor supports the layer-shell protocol, on which many of the panel features also depend.

See also: xfce_panel_plugin_popup_menu() and xfce_panel_plugin_position_widget().

Parameters

plugin

an XfcePanelPlugin.

 

window

a GtkWindow.

 

widget

the GtkWidget to align window with or NULL to use plugin as widget .

[allow-none]

Since: 4.19.0


xfce_panel_plugin_focus_widget ()

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.

Parameters

plugin

an XfcePanelPlugin.

 

widget

a GtkWidget inside the plugins that should be focussed.

 

xfce_panel_plugin_block_autohide ()

void
xfce_panel_plugin_block_autohide (XfcePanelPlugin *plugin,
                                  gboolean blocked);

Whether this plugin blocks the autohide functionality of the panel. Use this when you 'popup' something that is visually attached to the plugin at it will look weird for a user if the panel will hide while he/she is working in the popup.

Be sure to use this function as lock/unlock pairs, as a counter is incremented/decremented under the hood. For menus, you can use xfce_panel_plugin_register_menu() which will take care of this.

Parameters

plugin

an XfcePanelPlugin.

 

blocked

new blocking state of this plugin.

 

xfce_panel_plugin_lookup_rc_file ()

gchar *
xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin);

Looks for the plugin resource file. This should be used to get the plugin read location of the config file. You should only use the returned path to read information from, since it might point to a not-writable file (in kiosk mode for example).

See also: xfce_panel_plugin_save_location() and xfce_resource_lookup()

Parameters

plugin

an XfcePanelPlugin.

 

Returns

The path to a config file or NULL if no file was found. The returned string must be freed using g_free().

[transfer full]


xfce_panel_plugin_save_location ()

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 if you want to read from the config file, but use xfce_panel_plugin_lookup_rc_file() instead.

See also: xfce_panel_plugin_lookup_rc_file() and xfce_resource_save_location()

Parameters

plugin

an XfcePanelPlugin.

 

create

whether to create missing directories.

 

Returns

The path to a config file or NULL if no file was found. The returned string must be freed u sing g_free().

[transfer full]


xfce_panel_plugin_xfconf_channel_new()

#define             xfce_panel_plugin_xfconf_channel_new(plugin)

Convienient function for opening an XfconfChannel for a plugin. The channel's property base will be propery returned from xfce_panel_plugin_get_property_base().

See also: xfce_panel_plugin_get_property_base, XFCE_PANEL_PLUGIN_CHANNEL_NAME and xfce_panel_get_channel_name

Parameters

plugin

An XfcePanelPlugin.

 

Since: 4.8


xfce_panel_plugin_get_icon_size ()

gint
xfce_panel_plugin_get_icon_size (XfcePanelPlugin *plugin);

Returns either the icon size defined in the panel's settings or a preferred icon size.

Parameters

plugin

an XfcePanelPlugin,

 

Since: 4.14


xfce_panel_plugin_get_mode ()

XfcePanelPluginMode
xfce_panel_plugin_get_mode (XfcePanelPlugin *plugin);

The mode of the panel in which the plugin is embedded.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the current XfcePanelPluginMode of the panel.

Since: 4.10


xfce_panel_plugin_get_nrows ()

guint
xfce_panel_plugin_get_nrows (XfcePanelPlugin *plugin);

The number of rows of the panel in which the plugin is embedded.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

the current number of rows of the panel.

Since: 4.10


xfce_panel_plugin_get_shrink ()

gboolean
xfce_panel_plugin_get_shrink (XfcePanelPlugin *plugin);

Whether the plugin can shrink if the size on the panel is limited. This is effective with plugins that do not have expand set, but can accept a smaller size when needed.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

TRUE when the plugin can shrink, FALSE otherwise.

Since: 4.10


xfce_panel_plugin_get_small ()

gboolean
xfce_panel_plugin_get_small (XfcePanelPlugin *plugin);

Whether the plugin is small enough to fit in a single row of a multi-row panel. E.g. if it is a button-like applet.

Parameters

plugin

an XfcePanelPlugin.

 

Returns

TRUE when the plugin is small, FALSE otherwise.

Since: 4.10


xfce_panel_plugin_set_shrink ()

void
xfce_panel_plugin_set_shrink (XfcePanelPlugin *plugin,
                              gboolean shrink);

Whether the plugin can shrink if the size on the panel is limited. This does not work if the plugin is expanded.

Parameters

plugin

an XfcePanelPlugin.

 

shrink

whether the plugin can shrink.

 

xfce_panel_plugin_set_small ()

void
xfce_panel_plugin_set_small (XfcePanelPlugin *plugin,
                             gboolean small);

Whether the plugin is small enough to fit in a single row of a multi-row panel. E.g. if it is a button-like applet.

Parameters

plugin

an XfcePanelPlugin.

 

small

whether the plugin is a small button-like applet.

 

Types and Values

struct XfcePanelPlugin

struct XfcePanelPlugin;

This struct contain private data only and should be accessed by the functions below.


struct XfcePanelPluginClass

struct XfcePanelPluginClass {
  /* for object oriented plugins only */
  void     (*construct)               (XfcePanelPlugin    *plugin);

  /* signals */
  void     (*screen_position_changed) (XfcePanelPlugin    *plugin,
                                       XfceScreenPosition  position);
  gboolean (*size_changed)            (XfcePanelPlugin    *plugin,
                                       gint                size);
  void     (*orientation_changed)     (XfcePanelPlugin    *plugin,
                                       GtkOrientation      orientation);
  void     (*free_data)               (XfcePanelPlugin    *plugin);
  void     (*save)                    (XfcePanelPlugin    *plugin);
  void     (*about)                   (XfcePanelPlugin    *plugin);
  void     (*configure_plugin)        (XfcePanelPlugin    *plugin);
  void     (*removed)                 (XfcePanelPlugin    *plugin);
  gboolean (*remote_event)            (XfcePanelPlugin    *plugin,
                                       const gchar        *name,
                                       const GValue       *value);

  /* new in 4.10 */
  void     (*mode_changed)            (XfcePanelPlugin    *plugin,
                                       XfcePanelPluginMode mode);
  void     (*nrows_changed)           (XfcePanelPlugin    *plugin,
                                       guint               rows);
};

Class of an XfcePanelPlugin. The interface can be used to create GObject based plugin.

Members

construct ()

This function is for object orientated plugins and triggered after the init function of the object. When this function is triggered, the plugin information like name, display name, comment and unique id are available. This is also the place where you would call functions like xfce_panel_plugin_menu_show_configure(). You can see this as the replacement of XfcePanelPluginFunc for object based plugins. Since 4.8.

 

screen_position_changed ()

See “screen-position-changed” for more information.

 

size_changed ()

See “size-changed” for more information.

 

orientation_changed ()

See “orientation-changed” for more information.

 

free_data ()

See “free-data” for more information.

 

save ()

See “save” for more information.

 

about ()

See “about” for more information.

 

configure_plugin ()

See “configure-plugin” for more information.

 

removed ()

See “removed” for more information.

 

remote_event ()

See “remote-event” for more information.

 

mode_changed ()

See “mode-changed” for more information.

 

nrows_changed ()

See “nrows-changed” for more information.

 

Property Details

The “arguments” property

  “arguments”                GStrv

The arguments the plugin was started with. If the plugin was not started with any arguments this value is NULL. Plugin writer can use it to read the arguments array, but xfce_panel_plugin_get_arguments() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write / Construct Only


The “comment” property

  “comment”                  char *

The translated description of the XfcePanelPlugin. This property is set during plugin construction and can't be set twice. Plugin writer can use it to read the plugin description, but xfce_panel_plugin_get_comment() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write / Construct Only

Default value: NULL

Since: 4.8


The “dark-mode” property

  “dark-mode”                gboolean

Whether the XfcePanelPlugin shall request the Gtk dark theme variant (based on the panel setting).

Owner: XfcePanelPlugin

Flags: Read / Write

Default value: FALSE

Since: 4.14


The “display-name” property

  “display-name”             char *

The translated display name of the XfcePanelPlugin. This property is set during plugin construction and can't be set twice. Plugin writer can use it to read the plugin display name, but xfce_panel_plugin_get_display_name() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write / Construct Only

Default value: NULL


The “expand” property

  “expand”                   gboolean

Whether the XfcePanelPlugin expands on the panel. Plugin writers can use it to read or set this property, but xfce_panel_plugin_set_expand() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write

Default value: FALSE


The “icon-size” property

  “icon-size”                int

The icon-size in pixels of the XfcePanelPlugin. Plugin writers can use it to read the plugin's icon size, but xfce_panel_plugin_get_icon_size() is recommended.

Owner: XfcePanelPlugin

Flags: Read

Allowed values: [0,1536]

Default value: 0

Since: 4.14


The “mode” property

  “mode”                     XfcePanelPluginMode

Display mode of the plugin.

Owner: XfcePanelPlugin

Flags: Read

Default value: XFCE_PANEL_PLUGIN_MODE_HORIZONTAL

Since: 4.10


The “name” property

  “name”                     char *

The internal, unstranslated, name of the XfcePanelPlugin. Plugin writer can use it to read the plugin name, but xfce_panel_plugin_get_name() is recommended since that returns a const string.

Owner: XfcePanelPlugin

Flags: Read / Write / Construct Only

Default value: NULL


The “nrows” property

  “nrows”                    guint

Number of rows the plugin is embedded on.

Owner: XfcePanelPlugin

Flags: Read

Allowed values: [1,6]

Default value: 1

Since: 4.10


The “orientation” property

  “orientation”              GtkOrientation

The GtkOrientation of the XfcePanelPlugin. Plugin writer can use it to read the plugin orientation, but xfce_panel_plugin_get_orientation() is recommended.

Owner: XfcePanelPlugin

Flags: Read

Default value: GTK_ORIENTATION_HORIZONTAL


The “screen-position” property

  “screen-position”          XfceScreenPosition

The XfceScreenPosition of the XfcePanelPlugin. Plugin writer can use it to read the plugin's screen position, but xfce_panel_plugin_get_screen_position() is recommended.

Owner: XfcePanelPlugin

Flags: Read

Default value: XFCE_SCREEN_POSITION_NONE


The “shrink” property

  “shrink”                   gboolean

Whether the XfcePanelPlugin can shrink when there is no space left on the panel. Plugin writers can use it to read or set this property, but xfce_panel_plugin_set_shrink() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write

Default value: FALSE

Since: 4.10


The “size” property

  “size”                     int

The size in pixels of the XfcePanelPlugin. Plugin writer can use it to read the plugin size, but xfce_panel_plugin_get_size() is recommended.

Owner: XfcePanelPlugin

Flags: Read

Allowed values: [0,768]

Default value: 0


The “small” property

  “small”                    gboolean

Whether the XfcePanelPlugin is small enough to fit a single row of a multi-row panel. Plugin writers can use it to read or set this property, but xfce_panel_plugin_set_small() is recommended.

Owner: XfcePanelPlugin

Flags: Read / Write

Default value: FALSE

Since: 4.10


The “unique-id” property

  “unique-id”                int

Unique plugin ID.

Owner: XfcePanelPlugin

Flags: Read / Write / Construct Only

Allowed values: >= -1

Default value: -1

Signal Details

The “about” signal

void
user_function (XfcePanelPlugin *plugin,
               gpointer         user_data)

This signal is emmitted when the About entry in the right-click menu is clicked. Plugin writers can use it to show information about the plugin and display credits of the developers, translators and other contributors.

See also: xfce_panel_plugin_menu_show_about().

Parameters

plugin

an XfcePanelPlugin.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “configure-plugin” signal

void
user_function (XfcePanelPlugin *plugin,
               gpointer         user_data)

This signal is emmitted when the Properties entry in the right-click menu is clicked. Plugin writers can use this signal to open a plugin settings dialog. It is their responsibility to block/unblock panel autohide when the dialog is shown/hidden.

See also: xfce_panel_plugin_menu_show_configure() and xfce_titled_dialog_new().

Parameters

plugin

an XfcePanelPlugin.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “free-data” signal

void
user_function (XfcePanelPlugin *plugin,
               gpointer         user_data)

This signal is emmitted when the plugin is closing. Plugin writers should use this signal to free any allocated resources.

Parameters

plugin

an XfcePanelPlugin.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “mode-changed” signal

void
user_function (XfcePanelPlugin    *plugin,
               XfcePanelPluginMode mode,
               gpointer            user_data)

This signal is emmitted whenever the mode of the panel the plugin is on changes.

Parameters

plugin

an XfcePanelPlugin.

 

mode

new XfcePanelPluginMode of the panel.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 4.10


The “nrows-changed” signal

void
user_function (XfcePanelPlugin *plugin,
               guint            rows,
               gpointer         user_data)

This signal is emmitted whenever the nrows of the panel the plugin is on changes.

Parameters

plugin

an XfcePanelPlugin.

 

rows

new number of rows of the panel

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 4.10


The “orientation-changed” signal

void
user_function (XfcePanelPlugin *plugin,
               GtkOrientation   orientation,
               gpointer         user_data)

This signal is emmitted whenever the orientation of the panel the plugin is on changes. Plugins writers can for example use this signal to change the order of widgets in the plugin.

Parameters

plugin

an XfcePanelPlugin.

 

orientation

new GtkOrientation of the panel.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “remote-event” signal

gboolean
user_function (XfcePanelPlugin *plugin,
               char            *name,
               GValue          *value,
               gpointer         user_data)

This signal is emmitted by the user by running xfce4-panel --plugin-event=plugin-name:name:type:value. It can be used for remote communication, like for example to popup a menu.

Parameters

plugin

an XfcePanelPlugin.

 

name

name of the signal.

 

value

value of the signal.

 

user_data

user data set when the signal handler was connected.

 

Returns

TRUE to stop signal emission to other plugins, FALSE to send the signal also to other plugins with the same name.

Flags: Run Last


The “removed” signal

void
user_function (XfcePanelPlugin *plugin,
               gpointer         user_data)

This signal is emmitted when the plugin is permanently removed from the panel configuration by the user. Developers can use this signal to cleanup custom setting locations that for example store passwords.

The free-data signal is emitted after this signal!

Note that if you use the xfconf channel and base property provided by xfce_panel_plugin_get_property_base() or the rc file location returned by xfce_panel_plugin_save_location(), the panel will take care of removing those settings.

Parameters

plugin

an XfcePanelPlugin.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 4.8


The “save” signal

void
user_function (XfcePanelPlugin *plugin,
               gpointer         user_data)

This signal is emitted when the plugin should save it's configuration. The signal is always emmitted before the plugin closes (before the "free-data" signal) and also once in 10 minutes or so.

See also: xfce_panel_plugin_save_location().

Parameters

plugin

an XfcePanelPlugin.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “screen-position-changed” signal

void
user_function (XfcePanelPlugin   *plugin,
               XfceScreenPosition position,
               gpointer           user_data)

This signal is emmitted whenever the screen position of the panel the plugin is on changes. Plugins writers can for example use this signal to change the arrow direction of buttons.

Parameters

plugin

an XfcePanelPlugin.

 

position

the new XfceScreenPosition of the panel.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “size-changed” signal

gboolean
user_function (XfcePanelPlugin *plugin,
               int              size,
               gpointer         user_data)

This signal is emmitted whenever the size of the panel the plugin is on changes. Plugins writers can for example use this signal to update their icon size.

If the function returns FALSE or is not used, the panel will force a square size to the plugin. If you want non-square plugins and you don't need this signal you can use something like this:

g_signal_connect (plugin, "size-changed", G_CALLBACK (gtk_true), NULL);

Parameters

plugin

an XfcePanelPlugin.

 

size

the new size of the panel.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last