Commit 5270a74e authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

changed the way applets are destroyed a bit. cannot test anything as the

Tue Feb 24 00:05:55 1998  George Lebl  <jirka@5z.com>

        * gnome-panel.idl, applet-lib.cc (others): changed the way
          applets are destroyed a bit. cannot test anything as
          the pixmaps seem to be very broken ....
parent fa2db78c
Tue Feb 24 00:05:55 1998 George Lebl <jirka@5z.com>
* gnome-panel.idl, applet-lib.cc (others): changed the way
applets are destroyed a bit. cannot test anything as
the pixmaps seem to be very broken ....
1998-02-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
* mailcheck/mailcheck.c (create_mail_widgets): Make it use gdk_imlib.
......
Tue Feb 24 00:05:55 1998 George Lebl <jirka@5z.com>
* gnome-panel.idl, applet-lib.cc (others): changed the way
applets are destroyed a bit. cannot test anything as
the pixmaps seem to be very broken ....
1998-02-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
* mailcheck/mailcheck.c (create_mail_widgets): Make it use gdk_imlib.
......
......@@ -27,6 +27,8 @@
typedef void (*ClockUpdateFunc) (GtkWidget *clock, time_t current_time);
GtkWidget *aw;
int applet_id=-1; /*this is our id we use to comunicate with the panel*/
......@@ -168,32 +170,39 @@ create_clock_widget (GtkWidget *window)
/*these are commands sent over corba:*/
void
change_orient(int id, int orient)
change_orient(int orient)
{
PanelOrientType o = (PanelOrientType)orient;
puts("CHANGE_ORIENT");
}
void
session_save(int id, int panel, int pos)
session_save(int panel, int pos)
{
/*FIXME: save the position*/
puts("SESSION_SAVE");
}
void
do_shutdown(int id)
static void
applet_die(gpointer data)
{
puts("DO_SHUTDOWN");
exit(0);
}
void
shutdown_applet()
{
puts("SHUTDOWN_APPLET");
/*kill our window*/
gtk_widget_unref(aw);
gtk_timeout_add(100,applet_die,NULL);
}
int
main(int argc, char **argv)
{
GtkWidget *clock;
GtkWidget *aw;
char *result;
gnome_init("clock_applet", &argc, &argv);
......
......@@ -231,7 +231,6 @@ init_user_panels(void)
/*FIXME: this should be made cleaner I guess*/
if(!root_menu) init_main_menu(panel);
panel_menu = create_panel_root_menu(PANEL_WIDGET(panel));
gtk_signal_connect(GTK_OBJECT(panel),
"button_press_event",
......
......@@ -84,25 +84,25 @@ panel_corba_gtk_main (int *argc, char ***argv, char *service_name)
}
void
send_applet_session_save (const char *ior, int id, int panel, int pos)
send_applet_session_save (const char *ior, int panel, int pos)
{
/* Use the ior that was sent to us to get an Applet CORBA object */
CORBA::Object_var obj = orb_ptr->string_to_object (ior);
GNOME::Applet_var applet = GNOME::Applet::_narrow (obj);
/* Now, use corba to invoke the routine in the panel */
applet->session_save(id,panel,pos);
applet->session_save(panel,pos);
}
void
send_applet_do_shutdown (const char *ior, int id)
send_applet_shutdown_applet (const char *ior)
{
/* Use the ior that was sent to us to get an Applet CORBA object */
CORBA::Object_var obj = orb_ptr->string_to_object (ior);
GNOME::Applet_var applet = GNOME::Applet::_narrow (obj);
/* Now, use corba to invoke the routine in the panel */
applet->do_shutdown(id);
applet->shutdown_applet();
}
void
......@@ -113,5 +113,5 @@ send_applet_change_orient (const char *ior, int id, int orient)
GNOME::Applet_var applet = GNOME::Applet::_narrow (obj);
/* Now, use corba to invoke the routine in the panel */
applet->change_orient(id,orient);
applet->change_orient(orient);
}
......@@ -3,7 +3,7 @@ BEGIN_GNOME_DECLS
void corba_gtk_main (int *argc, char ***argv, char *service_name, void *corba_object);
void panel_corba_gtk_main (int *argc, char ***argv, char *service_name);
void send_applet_session_save (const char *ior, int id, int panel, int pos);
void send_applet_do_shutdown (const char *ior, int id);
void send_applet_change_orient (const char *ior, int id, int orient);
void send_applet_session_save (const char *ior, int panel, int pos);
void send_applet_shutdown_applet (const char *ior);
void send_applet_change_orient (const char *ior, int orient);
END_GNOME_DECLS
......@@ -135,7 +135,7 @@ save_applet_configuration(gpointer data, gpointer user_data)
if(info->type==APPLET_EXTERN) {
/*have the applet do it's own session saving*/
send_applet_session_save(info->id,((*num)++)-1,panel,pos);
send_applet_session_save(info->id,panel,pos);
fullpath = g_copy_strings(path,"path",NULL);
gnome_config_set_string(fullpath, info->params);
g_free(fullpath);
......@@ -287,12 +287,12 @@ panel_session_save (GnomeClient *client,
if(is_shutdown) {
GList *list;
int i;
AppletInfo *info;
for(i=0,list=applets;list!=NULL;list = g_list_next(list),i++) {
AppletInfo *info = list->data;
info = list->data;
if(info->type == APPLET_EXTERN) {
send_applet_do_shutdown(info->id,i);
send_applet_shutdown_applet(info->id);
} else {
gtk_widget_unref(info->widget);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment