AppletWidget

Name

AppletWidget -- Construction and Initialization of the AppletWidget

Synopsis


#include <applet-widget.h>


struct      AppletWidget;
struct      AppletWidgetClass;
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);
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_gtk_main          (void);
void        applet_widget_gtk_main_quit     (void);

Object Hierarchy


  GtkObject
   +----GtkWidget
         +----GtkContainer
               +----GtkBin
                     +----GtkWindow
                           +----GtkPlug
                                 +----AppletWidget

Signal Prototypes


"change-orient"
            void        user_function      (AppletWidget *appletwidget,
                                            GtkEnum arg1,
                                            gpointer user_data);
"change-pixel-size"
            void        user_function      (AppletWidget *appletwidget,
                                            gint arg1,
                                            gpointer user_data);
"save-session"
            gboolean    user_function      (AppletWidget *appletwidget,
                                            GtkString arg1,
                                            GtkString arg2,
                                            gpointer user_data);
"back-change"
            void        user_function      (AppletWidget *appletwidget,
                                            GtkEnum arg1,
                                            gpointer arg2,
                                            gpointer arg3,
                                            gpointer user_data);
"do-draw"   void        user_function      (AppletWidget *appletwidget,
                                            gpointer user_data);
"tooltip-state"
            void        user_function      (AppletWidget *appletwidget,
                                            gint arg1,
                                            gpointer user_data);
"change-position"
            void        user_function      (AppletWidget *appletwidget,
                                            gint arg1,
                                            gint arg2,
                                            gpointer user_data);

Description

Details

struct AppletWidget

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


struct AppletWidgetClass

struct AppletWidgetClass;


applet_factory_new ()

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

create a new applet factory. It is used for applets that can run many applets from one process.

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. Don't call this if your app has an applet, but your process is not simply an applet process. This will 1) disconnect the session manager and 2) setup stuff to call gtk_main_quit when the last applet you create exists. And that's all really.

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_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_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

Signals

The "change-orient" signal

void        user_function                  (AppletWidget *appletwidget,
                                            GtkEnum arg1,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
user_data :user data set when the signal handler was connected.


The "change-pixel-size" signal

void        user_function                  (AppletWidget *appletwidget,
                                            gint arg1,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
user_data :user data set when the signal handler was connected.


The "save-session" signal

gboolean    user_function                  (AppletWidget *appletwidget,
                                            GtkString arg1,
                                            GtkString arg2,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
arg2 : 
user_data :user data set when the signal handler was connected.
Returns : 


The "back-change" signal

void        user_function                  (AppletWidget *appletwidget,
                                            GtkEnum arg1,
                                            gpointer arg2,
                                            gpointer arg3,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
arg2 : 
arg3 : 
user_data :user data set when the signal handler was connected.


The "do-draw" signal

void        user_function                  (AppletWidget *appletwidget,
                                            gpointer user_data);

appletwidget :the object which received the signal.
user_data :user data set when the signal handler was connected.


The "tooltip-state" signal

void        user_function                  (AppletWidget *appletwidget,
                                            gint arg1,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
user_data :user data set when the signal handler was connected.


The "change-position" signal

void        user_function                  (AppletWidget *appletwidget,
                                            gint arg1,
                                            gint arg2,
                                            gpointer user_data);

appletwidget :the object which received the signal.
arg1 : 
arg2 : 
user_data :user data set when the signal handler was connected.