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

session save is now passed a cfg path to allow elaborate session saving

Wed Mar 11 18:15:41 1998  George Lebl  <jirka@5z.com>

        * gnome-panel.idl, mico-glue.(cc,h), panel.c: session save is
          now passed a cfg path to allow elaborate session saving

        * gnome-panel.idl, applet-lib.(cc,h), clock.c: callback
          framework revised.

        * panel.c: removed some old stuff
parent 4aa17fae
Wed Mar 11 18:15:41 1998 George Lebl <jirka@5z.com>
* gnome-panel.idl, mico-glue.(cc,h), panel.c: session save is
now passed a cfg path to allow elaborate session saving
* gnome-panel.idl, applet-lib.(cc,h), clock.c: callback
framework revised.
* panel.c: removed some old stuff
Wed Mar 11 12:33:56 1998 Tom Tromey <tromey@cygnus.com>
* Makefile.am (CXXFLAGS): New macro.
......
Wed Mar 11 18:15:41 1998 George Lebl <jirka@5z.com>
* gnome-panel.idl, mico-glue.(cc,h), panel.c: session save is
now passed a cfg path to allow elaborate session saving
* gnome-panel.idl, applet-lib.(cc,h), clock.c: callback
framework revised.
* panel.c: removed some old stuff
Wed Mar 11 12:33:56 1998 Tom Tromey <tromey@cygnus.com>
* Makefile.am (CXXFLAGS): New macro.
......
......@@ -28,7 +28,7 @@ static CORBA::BOA_ptr boa_ptr;
/*every applet must implement these*/
BEGIN_GNOME_DECLS
void change_orient(int id, int orient);
void session_save(int id, int panel, int pos);
void session_save(int id, const char *cfgpath);
void shutdown_applet(int id);
END_GNOME_DECLS
......@@ -40,9 +40,8 @@ public:
::change_orient(id,orient);
}
void session_save (CORBA::Short id,
CORBA::Short panel,
CORBA::Short pos) {
::session_save(id,panel,pos);
const char *cfgpath) {
::session_save(id,cfgpath);
}
void shutdown_applet (CORBA::Short id) {
::shutdown_applet(id);
......@@ -50,7 +49,7 @@ public:
void do_callback (CORBA::Short id,
const char *callback_name)
{
::do_callback(id, callback_name);
/*FIXME: run the proper function that the applet registered*/
}
};
......@@ -85,6 +84,16 @@ gnome_panel_applet_init_corba (void)
return 1;
}
void
gnome_panel_applet_register_callback(int id,
char *name,
char *menutext,
GFunc func,
gpointer data)
{
/*FIXME: do callbacks*/
}
static void
move_applet_callback(GtkWidget *widget, gpointer data)
{
......
......@@ -7,11 +7,13 @@ char *gnome_panel_applet_request_id (GtkWidget *widget, char *path, int *id,
char **cfgpath);
char *gnome_panel_prepare_and_transfer (GtkWidget *widget, int id);
int gnome_panel_applet_init_corba (void);
void gnome_panel_applet_register_callback (int id,
char *name,
char *menutext,
GFunc func,
gpointer data);
void applet_corba_gtk_main (char *str);
/* This is defined by the applet, not the library */
void do_callback (short id,
const char *callback_name);
END_GNOME_DECLS
#endif
......@@ -50,13 +50,6 @@ free_data(GtkWidget *widget, gpointer data)
g_free(data);
}
void
do_callback(short id,
const char *callback_name)
{
printf("Not doing callback %s\n", callback_name);
}
static int
clock_timeout_callback (gpointer data)
{
......@@ -185,7 +178,7 @@ change_orient(int id, int orient)
}
void
session_save(int id, int panel, int pos)
session_save(int id, const char *cfgpath)
{
/*FIXME: save the position*/
puts("SESSION_SAVE");
......
......@@ -20,7 +20,7 @@ module GNOME {
interface Applet {
void change_orient (in short id, in short orient);
void do_callback (in short id, in string callback_name);
void session_save (in short id, in short panel, in short pos);
void session_save (in short id, in string cfgpath);
void shutdown_applet (in short id);
};
};
......
......@@ -64,10 +64,12 @@ public:
void applet_add_callback (CORBA::Short id,
const char *callback_name,
const char *menuitem_text) {
::applet_add_callback(id, (char *)callback_name, (char *)menuitem_text);
::applet_add_callback(id,
(char *)callback_name,
(char *)menuitem_text);
}
void quit(void) {
::panel_quit();
void quit(void) {
::panel_quit();
}
};
......@@ -99,14 +101,14 @@ panel_corba_gtk_main (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 id, const char *cfgpath)
{
/* 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(id,cfgpath);
}
void
......
......@@ -7,7 +7,7 @@ BEGIN_GNOME_DECLS
void panel_corba_gtk_main (char *service_name);
void send_applet_session_save (const char *ior, int id, int panel, int pos);
void send_applet_session_save (const char *ior, int id, const char *cfgpath);
void send_applet_shutdown_applet (const char *ior, int id);
void send_applet_change_orient (const char *ior, int id, int orient);
void send_applet_do_callback (const char *ior, int id, char *callback_name);
......
......@@ -136,11 +136,12 @@ save_applet_configuration(gpointer data, gpointer user_data)
gnome_config_set_int(fullpath, panel);
g_free(fullpath);
/*have the applet do it's own session saving*/
send_applet_session_save(info->id,(*num)-2,panel,pos);
fullpath = g_copy_strings(path,"parameters",NULL);
gnome_config_set_string(fullpath, info->params);
g_free(fullpath);
/*have the applet do it's own session saving*/
send_applet_session_save(info->id,(*num)-2,path);
} else {
fullpath = g_copy_strings(path,"id",NULL);
gnome_config_set_string(fullpath, info->id);
......@@ -352,12 +353,6 @@ panel_quit(void)
}
}
/*FIXME: how will we handle adding of applets????*/
static void
create_applet(char *id, char *params, int pos, int panel)
{
}
static PanelWidget *
find_applet_panel(GtkWidget *applet)
{
......@@ -419,8 +414,7 @@ remove_applet_callback(GtkWidget *widget, gpointer data)
g_free(info);
}
/*tell applet to do properties*/
/*replace with corba applet callbacks*/
static void
applet_properties_callback(GtkWidget *widget, gpointer data)
{
......@@ -516,14 +510,6 @@ panel_log_out_callback(GtkWidget *widget, gpointer data)
panel_quit();
}
static void
add_main_menu(GtkWidget *widget, gpointer data)
{
PanelWidget *panel = data;
/*FIXME: 1) doesn't work at all, 2)should add to current panel*/
/* create_applet("Menu",".",PANEL_UNKNOWN_APPLET_POSITION,1); */
}
int
applet_get_panel(int id)
{
......
......@@ -20,7 +20,7 @@ module GNOME {
interface Applet {
void change_orient (in short id, in short orient);
void do_callback (in short id, in string callback_name);
void session_save (in short id, in short panel, in short pos);
void session_save (in short id, in string cfgpath);
void shutdown_applet (in short id);
};
};
......
......@@ -20,7 +20,7 @@ module GNOME {
interface Applet {
void change_orient (in short id, in short orient);
void do_callback (in short id, in string callback_name);
void session_save (in short id, in short panel, in short pos);
void session_save (in short id, in string cfgpath);
void shutdown_applet (in short id);
};
};
......
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