Initialization

Name

Initialization -- 

Synopsis



struct      AppletWidget;
void        applet_factory_new              (const char *goad_id,
                                             AppletFactoryQuerier qfunc,
                                             AppletFactoryActivator afunc);
GtkWidget*  applet_widget_new               (const char *goad_id);
void        applet_widget_construct         (AppletWidget *applet,
                                             const char *goad_id);
gboolean    applet_widget_init              (const char *app_id,
                                             const char *app_version,
                                             int argc,
                                             char **argv,
                                             struct poptOption *options,
                                             unsigned int flags,
                                             poptContext *return_ctx);
void        applet_widget_abort_load        (AppletWidget *applet);
void        applet_widget_remove            (AppletWidget *applet);
CORBA_Object applet_widget_corba_activate   (GtkWidget *applet,
                                             PortableServer_POA poa,
                                             const char *goad_id,
                                             const char **params,
                                             gpointer *impl_ptr,
                                             CORBA_Environment *ev);
void        applet_widget_corba_deactivate  (PortableServer_POA poa,
                                             const char *goad_id,
                                             gpointer impl_ptr,
                                             CORBA_Environment *ev);
void        applet_widget_add               (AppletWidget *applet,
                                             GtkWidget *widget);
void        applet_widget_add_full          (AppletWidget *applet,
                                             GtkWidget *widget,
                                             gboolean bind_events);
void        applet_widget_bind_events       (AppletWidget *applet,
                                             GtkWidget *widget);
void        applet_widget_gtk_main          (void);
void        applet_widget_gtk_main_quit     (void);

Description

Details

struct AppletWidget

struct AppletWidget {
	char			*privcfgpath;
	char			*globcfgpath;
	
	/* you should really use the accessors for these anyway */
	PanelOrientType		orient;			
	int			size;			
	
};


applet_factory_new ()

void        applet_factory_new              (const char *goad_id,
                                             AppletFactoryQuerier qfunc,
                                             AppletFactoryActivator afunc);

create a new applet factory.

goad_id : GOAD ID of the factory to be registered.
qfunc : AppletFactoryQuerier to determine whether an applet with a specified GOAD ID can be created.
afunc : AppletFactoryActivator to activate a specified GOAD ID.


applet_widget_new ()

GtkWidget*  applet_widget_new               (const char *goad_id);

Make a new applet and register us with the panel, if you decide to cancel the load before calling applet_widget_add, you should call applet_widget_abort_load. This widget is a simple container but you should always use only applet_widget_add to add a child and you should only use it once.

goad_id : The goad_id of the applet we are starting
Returns : A pointer to a new widget of type AppletWidget, or NULL if something went wrong.


applet_widget_construct ()

void        applet_widget_construct         (AppletWidget *applet,
                                             const char *goad_id);

For bindings and subclassing only

applet : AppletWidget to work on
goad_id : goad_id of the applet to construct


applet_widget_init ()

gboolean    applet_widget_init              (const char *app_id,
                                             const char *app_version,
                                             int argc,
                                             char **argv,
                                             struct poptOption *options,
                                             unsigned int flags,
                                             poptContext *return_ctx);

Initialize the applet library, gnome and corba.

app_id : applet id
app_version : applet version
argc : the argc passed to main
argv : the argv passed to main
options : extra popt options to use
flags : extra popt flags
return_ctx : return popt context
Returns : A boolean, TRUE if we succeed, FALSE if an error occured


applet_widget_abort_load ()

void        applet_widget_abort_load        (AppletWidget *applet);

abort the applet loading, once applet has been created, this is a way to tell the panel to forget about us if we decide we want to quit before we add the actual applet to the applet-widget.

applet : AppletWidget to work on.


applet_widget_remove ()

void        applet_widget_remove            (AppletWidget *applet);

remove the plug from the panel, this will destroy the applet.

applet : AppletWidget to work on.


applet_widget_corba_activate ()

CORBA_Object applet_widget_corba_activate   (GtkWidget *applet,
                                             PortableServer_POA poa,
                                             const char *goad_id,
                                             const char **params,
                                             gpointer *impl_ptr,
                                             CORBA_Environment *ev);

Duplicates the applet's CORBA object. This should be called when a shared library applet is activated.

applet : widget to embed.
poa : the POA to use.
goad_id : the GOAD ID string for the applet.
params : params passed when the applet is activated.
impl_ptr : 
ev : CORBA environment to use for errors.
Returns : the duplication CORBA object to use.


applet_widget_corba_deactivate ()

void        applet_widget_corba_deactivate  (PortableServer_POA poa,
                                             const char *goad_id,
                                             gpointer impl_ptr,
                                             CORBA_Environment *ev);

poa : the POA to use.
goad_id : the GOAD ID of the applet.
impl_ptr : 
ev : CORBA environment to use for errors.


applet_widget_add ()

void        applet_widget_add               (AppletWidget *applet,
                                             GtkWidget *widget);

Add a child (widget) to the applet. This finishes the handshaking with the panel started in applet_widget_new. You should never call this function twice for the same applet and you should always use this function rather then gtk_container_add. If you have already created an applet widget with applet_widget_new, but need to cancel the loading of the applet, use applet_widget_abort_load.

applet : the AppletWidget to work with
widget : the child to add


applet_widget_add_full ()

void        applet_widget_add_full          (AppletWidget *applet,
                                             GtkWidget *widget,
                                             gboolean bind_events);

Add a child (widget) to the applet. This finishes the handshaking with the panel started in applet_widget_new. You should never call this function twice for the same applet and you should always use this function rather then gtk_container_add. If you have already created an applet widget with applet_widget_new, but need to cancel the loading of the applet, use applet_widget_abort_load. This function is only for special applets and you should use applet_widget_bind_events on some internal widget if bind_events was FALSE. Normally you'll just want to use applet_widget_add.

applet : the AppletWidget to work with
widget : the child to add
bind_events : bind 2nd and 3rd button events over the applet if TRUE


applet_widget_bind_events ()

void        applet_widget_bind_events       (AppletWidget *applet,
                                             GtkWidget *widget);

Binds the 2nd and 3rd button clicks over this widget. Normally this is done during applet_widget_add, but if you need to bind events over a widget which you added later, use this function.

applet : the AppletWidget to work with
widget : the widget over which to bind events


applet_widget_gtk_main ()

void        applet_widget_gtk_main          (void);

Run the main loop, just like gtk_main


applet_widget_gtk_main_quit ()

void        applet_widget_gtk_main_quit     (void);

Quit the main loop, just like gtk_main_quit