summaryrefslogtreecommitdiff
path: root/batmon/batmon.c
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>1998-03-21 09:03:04 +0000
committerGeorge Lebl <jirka@src.gnome.org>1998-03-21 09:03:04 +0000
commitcd2fd7248808e0d8e879e60c0b3183cff1652a52 (patch)
tree50a2ba7213fa00650bad8cfb3f15adce53287c2a /batmon/batmon.c
parent5fed5af9b8318bddcf3edb1f3c43dd149282f7bc (diff)
now compiles
Sat Mar 21 00:57:08 1998 George Lebl <jirka@5z.com> * batmon/batmon.c: now compiles * batmon/batmon_applet.desktop: now installed * mailcheck/mailcheck_applet.desktop: now correctly says Mailcheck not Clock
Diffstat (limited to 'batmon/batmon.c')
-rw-r--r--batmon/batmon.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/batmon/batmon.c b/batmon/batmon.c
index 2104d3721..ef7c888dd 100644
--- a/batmon/batmon.c
+++ b/batmon/batmon.c
@@ -352,31 +352,38 @@ destroy_module(void)
gtk_widget_destroy(window);
}
-static void
-create_instance (PanelWidget *panel, char *params, int pos)
-{
- PanelCommand cmd;
- GtkWidget *batmon;
-
- if (batmon_timeout != -1)
- return; /* Only one instance allowed --- XXX: maybe should put up a dialog box */
- batmon = create_batmon_widget (GTK_WIDGET(panel));
+/*these are commands sent over corba: */
+void
+change_orient(int id, int orient)
+{
+ PanelOrientType o = (PanelOrientType) orient;
+}
- batmon_timeout = gtk_timeout_add(TIMEOUT,
- (GtkFunction) batmon_timeout_callback,
- batmon);
+void
+session_save(int id, const char *cfgpath, const char *globcfgpath)
+{
+ /*save the session here */
+}
- cmd.cmd = PANEL_CMD_REGISTER_TOY;
- cmd.params.register_toy.applet = batmon;
- cmd.params.register_toy.id = APPLET_ID;
- cmd.params.register_toy.pos = pos;
- cmd.params.register_toy.flags = 0;
+static gint
+quit_applet(gpointer data)
+{
+ exit(0);
+}
- (*panel_cmd_func) (&cmd);
+void
+shutdown_applet(int id)
+{
+ /*kill our plug using destroy to avoid warnings we need to
+ kill the plug but we also need to return from this call */
+ if (plug)
+ gtk_widget_destroy(plug);
+ gtk_idle_add(quit_applet, NULL);
}
+
int
main(int argc, char **argv)
{
@@ -411,9 +418,10 @@ main(int argc, char **argv)
g_free(cfgpath);
plug = gtk_plug_new(winid);
+ gtk_widget_realize(plug);
- batmon = create_batmon_widget (GTK_WIDGET(panel));
+ batmon = create_batmon_widget (plug);
batmon_timeout = gtk_timeout_add(TIMEOUT,
(GtkFunction) batmon_timeout_callback,