Panel Plugin Register Macros

Panel Plugin Register Macros — Register panel plugins that are compiled as modules.

Functions

Includes

#include <libxfce4panel/libxfce4panel.h>

Description

Macros to register panel plugins that are compiled as modules. Internal or external is defined by the boolean key X-XFCE-Internal in the plugin's .desktop file.

Functions

XfcePanelPluginCheck ()

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.

Parameters

screen

the GdkScreen the panel is running on

 

Returns

TRUE if the plugin can be started, FALSE otherwise.


XfcePanelPluginFunc ()

void
(*XfcePanelPluginFunc) (XfcePanelPlugin *plugin);

Callback function to create the plugin contents. It should be given as the argument to the registration macros.

Parameters

plugin

an XfcePanelPlugin

 

XfcePanelPluginPreInit ()

gboolean
(*XfcePanelPluginPreInit) (gint argc,
                           gchar **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().

Parameters

argc

number of arguments to the plugin

 

argv

argument array

 

Returns

TRUE on success, FALSE otherwise.

Since: 4.6


XFCE_PANEL_PLUGIN_REGISTER()

#define             XFCE_PANEL_PLUGIN_REGISTER(construct_func)

Register a panel plugin using a construct function. This is the simplest way to register a panel plugin. The construct_func is called everytime a plugin is created.

Parameters

construct_func

name of the function that points to an XfcePanelPluginFunc function.

 

Since: 4.8


XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK()

#define             XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK(construct_func, check_func)

Register a panel plugin using a construct function. The check_func will be called before the plugin is created. If this function returns FALSE, the plugin won't be added to the panel. For proper feedback, you are responsible for showing a dialog why the plugin is not added to the panel.

Parameters

construct_func

name of the function that points to an XfcePanelPluginFunc function.

 

check_func

name of the function that points to an XfcePanelPluginCheck function.

 

Since: 4.8


XFCE_PANEL_PLUGIN_REGISTER_FULL()

#define             XFCE_PANEL_PLUGIN_REGISTER_FULL(construct_func, preinit_func, check_func)

Same as calling XFCE_PANEL_DEFINE_PREINIT_FUNC and XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK. See those macros for more information.

Parameters

construct_func

name of the function that points to an XfcePanelPluginFunc function.

 

preinit_func

name of the function that points to an XfcePanelPluginPreInit function.

 

check_func

name of the function that points to an XfcePanelPluginCheck function.

 

Since: 4.8