![]() |
![]() |
![]() |
Panel Applet Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <panel-applet.h> gboolean (*PanelAppletFactoryCallback) (PanelApplet *applet
,const gchar *iid
,gpointer user_data
); #define PANEL_APPLET_OUT_PROCESS_FACTORY (id, type, callback, data) #define PANEL_APPLET_IN_PROCESS_FACTORY (id, type, callback, data) int panel_applet_factory_main (const gchar *factory_id
,GType applet_type
,PanelAppletFactoryCallback callback
,gpointer data
);
This API is used to create an applet factory. You need to call one and only one of these functions to get applets working in your binary.
gboolean (*PanelAppletFactoryCallback) (PanelApplet *applet
,const gchar *iid
,gpointer user_data
);
The type used for callbacks after. The callback will usually check that iid
is a valid applet type identifier for the applet factory, and will then fill
applet
with widgets, connect to signals, etc.
|
a newly-created PanelApplet. |
|
identifier of the requested applet type. |
|
user data. |
Returns : |
TRUE if iid is a valid applet type identifier for the applet
factory and if the creation of applet was successfully completed, FALSE
otherwise. |
#define PANEL_APPLET_OUT_PROCESS_FACTORY(id, type, callback, data)
Convenience macro providing a main()
function for an out-of-process applet.
Internally, it will call panel_applet_factory_main()
to create the
factory_id
applet factory.
Applet instances created by the applet factory will use applet_type
as
GType. Unless you subclass PanelApplet, you should use PANEL_TYPE_APPLET
as applet_type
.
On creation of the applet instances, callback
is called to setup the
applet. If callback
returns FALSE
, the creation of the applet instance is
cancelled.
It can only be used once, and is incompatible with the use of
PANEL_APPLET_IN_PROCESS_FACTORY
and panel_applet_factory_main()
.
|
identifier of an applet factory. |
|
GType of the applet this factory creates. |
|
callback to be called when a new applet is created. [scope call] |
|
callback data. [closure] |
#define PANEL_APPLET_IN_PROCESS_FACTORY(id, type, callback, data)
Convenience macro providing the symbol needed to automatically register the
factory_id
applet factory for an in-process applet.
Applet instances created by the applet factory will use applet_type
as
GType. Unless you subclass PanelApplet, you should use PANEL_TYPE_APPLET
as applet_type
.
On creation of the applet instances, callback
is called to setup the
applet. If callback
returns FALSE
, the creation of the applet instance is
cancelled.
It can only be used once, and is incompatible with the use of
PANEL_APPLET_OUT_PROCESS_FACTORY
and panel_applet_factory_main()
.
|
identifier of an applet factory. |
|
GType of the applet this factory creates. |
|
callback to be called when a new applet is created. [scope call] |
|
callback data. [closure] |
int panel_applet_factory_main (const gchar *factory_id
,GType applet_type
,PanelAppletFactoryCallback callback
,gpointer data
);
Creates the applet factory for factory_id
, so that the factory can create
instances of the applet types it is associated with.
Applet instances created by the applet factory will use applet_type
as
GType. Unless you subclass PanelApplet, you should use PANEL_TYPE_APPLET
as applet_type
.
On creation of the applet instances, callback
is called to setup the
applet. If callback
returns FALSE
, the creation of the applet instance is
cancelled.
If using C, it is recommended to use PANEL_APPLET_OUT_PROCESS_FACTORY
instead as it will create a main()
function for you.
It can only be used once, and is incompatible with the use of
PANEL_APPLET_IN_PROCESS_FACTORY
and PANEL_APPLET_OUT_PROCESS_FACTORY
.
|
identifier of an applet factory. |
|
GType of the applet this factory creates. |
|
callback to be called when a new applet is created. [scope call] |
|
callback data. [closure] |
Returns : |
0 on success, 1 if there is an error. |