~ubuntu-branches/ubuntu/dapper/gdesklets/dapper

« back to all changes in this revision

Viewing changes to debian/patches/02_trayicon-transparency.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sivan Greenberg
  • Date: 2006-05-09 22:35:12 UTC
  • Revision ID: james.westby@ubuntu.com-20060509223512-p3s1otzgl9x6641v
Tags: 0.35.3-1ubuntu3
* debian/patches/02_trayicon_transparency.path:
  - Made tray icon look nice when panel is using transparent backround.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -Nur gdesklets-0.35.3/utils/eggtrayicon.c gdesklets-0.35.3.new/utils/eggtrayicon.c
 
2
--- gdesklets-0.35.3/utils/eggtrayicon.c        2006-05-09 22:23:56.000000000 +0300
 
3
+++ gdesklets-0.35.3.new/utils/eggtrayicon.c    2006-05-09 22:29:55.000000000 +0300
 
4
@@ -18,11 +18,28 @@
 
5
  * Boston, MA 02111-1307, USA.
 
6
  */
 
7
 
 
8
+#include <config.h>
 
9
+#include <string.h>
 
10
+#include <libintl.h>
 
11
+
 
12
 #include "eggtrayicon.h"
 
13
 
 
14
+#include <gdk/gdkx.h>
 
15
 #include <X11/Xatom.h>
 
16
 
 
17
+#ifndef EGG_COMPILATION
 
18
+#ifndef _
 
19
+#define _(x) dgettext (GETTEXT_PACKAGE, x)
 
20
+#define N_(x) x
 
21
+#endif
 
22
+#else
 
23
+#define _(x) x
 
24
+#define N_(x) x
 
25
+#endif
 
26
+
 
27
 #define SYSTEM_TRAY_REQUEST_DOCK    0
 
28
+#define SYSTEM_TRAY_BEGIN_MESSAGE   1
 
29
+#define SYSTEM_TRAY_CANCEL_MESSAGE  2
 
30
 
 
31
 #define SYSTEM_TRAY_ORIENTATION_HORZ 0
 
32
 #define SYSTEM_TRAY_ORIENTATION_VERT 1
 
33
@@ -31,25 +48,56 @@
 
34
   PROP_0,
 
35
   PROP_ORIENTATION
 
36
 };
 
37
+         
 
38
+static GtkPlugClass *parent_class = NULL;
 
39
 
 
40
-G_DEFINE_TYPE (EggTrayIcon, egg_tray_icon, GTK_TYPE_PLUG);
 
41
+static void egg_tray_icon_init (EggTrayIcon *icon);
 
42
+static void egg_tray_icon_class_init (EggTrayIconClass *klass);
 
43
 
 
44
 static void egg_tray_icon_get_property (GObject    *object,
 
45
-                                        guint       prop_id,
 
46
-                                        GValue     *value,
 
47
-                                        GParamSpec *pspec);
 
48
+                                       guint       prop_id,
 
49
+                                       GValue     *value,
 
50
+                                       GParamSpec *pspec);
 
51
 
 
52
 static void egg_tray_icon_realize   (GtkWidget *widget);
 
53
 static void egg_tray_icon_unrealize (GtkWidget *widget);
 
54
 
 
55
 static void egg_tray_icon_update_manager_window (EggTrayIcon *icon);
 
56
 
 
57
+static void egg_tray_icon_add (GtkContainer *container, GtkWidget    *widget);
 
58
+
 
59
+GType
 
60
+egg_tray_icon_get_type (void)
 
61
+{
 
62
+  static GType our_type = 0;
 
63
+
 
64
+  if (our_type == 0)
 
65
+    {
 
66
+      static const GTypeInfo our_info =
 
67
+      {
 
68
+       sizeof (EggTrayIconClass),
 
69
+       (GBaseInitFunc) NULL,
 
70
+       (GBaseFinalizeFunc) NULL,
 
71
+       (GClassInitFunc) egg_tray_icon_class_init,
 
72
+       NULL, /* class_finalize */
 
73
+       NULL, /* class_data */
 
74
+       sizeof (EggTrayIcon),
 
75
+       0,    /* n_preallocs */
 
76
+       (GInstanceInitFunc) egg_tray_icon_init
 
77
+      };
 
78
+
 
79
+      our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
 
80
+    }
 
81
+
 
82
+  return our_type;
 
83
+}
 
84
+
 
85
 static void
 
86
 egg_tray_icon_init (EggTrayIcon *icon)
 
87
 {
 
88
   icon->stamp = 1;
 
89
   icon->orientation = GTK_ORIENTATION_HORIZONTAL;
 
90
-
 
91
+  
 
92
   gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK);
 
93
 }
 
94
 
 
95
@@ -58,28 +106,32 @@
 
96
 {
 
97
   GObjectClass *gobject_class = (GObjectClass *)klass;
 
98
   GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
 
99
+  GtkContainerClass *container_class = (GtkContainerClass *)klass;
 
100
+
 
101
+  parent_class = g_type_class_peek_parent (klass);
 
102
 
 
103
   gobject_class->get_property = egg_tray_icon_get_property;
 
104
 
 
105
   widget_class->realize   = egg_tray_icon_realize;
 
106
   widget_class->unrealize = egg_tray_icon_unrealize;
 
107
 
 
108
-  g_object_class_install_property (gobject_class,
 
109
-                                   PROP_ORIENTATION,
 
110
-                                   g_param_spec_enum ("orientation",
 
111
-                                                      "Orientation",
 
112
-                                                      "The orientation of the tray.",
 
113
-                                                      GTK_TYPE_ORIENTATION,
 
114
-                                                      GTK_ORIENTATION_HORIZONTAL,
 
115
-                                                      G_PARAM_READABLE));
 
116
+  container_class->add = egg_tray_icon_add;
 
117
 
 
118
+  g_object_class_install_property (gobject_class,
 
119
+                                  PROP_ORIENTATION,
 
120
+                                  g_param_spec_enum ("orientation",
 
121
+                                                     _("Orientation"),
 
122
+                                                     _("The orientation of the tray."),
 
123
+                                                     GTK_TYPE_ORIENTATION,
 
124
+                                                     GTK_ORIENTATION_HORIZONTAL,
 
125
+                                                     G_PARAM_READABLE));
 
126
 }
 
127
 
 
128
 static void
 
129
 egg_tray_icon_get_property (GObject    *object,
 
130
-                            guint       prop_id,
 
131
-                            GValue     *value,
 
132
-                            GParamSpec *pspec)
 
133
+                           guint       prop_id,
 
134
+                           GValue     *value,
 
135
+                           GParamSpec *pspec)
 
136
 {
 
137
   EggTrayIcon *icon = EGG_TRAY_ICON (object);
 
138
 
 
139
@@ -101,26 +153,26 @@
 
140
   Atom type;
 
141
   int format;
 
142
   union {
 
143
-        gulong *prop;
 
144
-        guchar *prop_ch;
 
145
+       gulong *prop;
 
146
+       guchar *prop_ch;
 
147
   } prop = { NULL };
 
148
   gulong nitems;
 
149
   gulong bytes_after;
 
150
   int error, result;
 
151
 
 
152
   g_assert (icon->manager_window != None);
 
153
-
 
154
+  
 
155
   xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
 
156
 
 
157
   gdk_error_trap_push ();
 
158
   type = None;
 
159
   result = XGetWindowProperty (xdisplay,
 
160
-                               icon->manager_window,
 
161
-                               icon->orientation_atom,
 
162
-                               0, G_MAXLONG, FALSE,
 
163
-                               XA_CARDINAL,
 
164
-                               &type, &format, &nitems,
 
165
-                               &bytes_after, &(prop.prop_ch));
 
166
+                              icon->manager_window,
 
167
+                              icon->orientation_atom,
 
168
+                              0, G_MAXLONG, FALSE,
 
169
+                              XA_CARDINAL,
 
170
+                              &type, &format, &nitems,
 
171
+                              &bytes_after, &(prop.prop_ch));
 
172
   error = gdk_error_trap_pop ();
 
173
 
 
174
   if (error || result != Success)
 
175
@@ -131,15 +183,15 @@
 
176
       GtkOrientation orientation;
 
177
 
 
178
       orientation = (prop.prop [0] == SYSTEM_TRAY_ORIENTATION_HORZ) ?
 
179
-                                        GTK_ORIENTATION_HORIZONTAL :
 
180
-                                        GTK_ORIENTATION_VERTICAL;
 
181
+                                       GTK_ORIENTATION_HORIZONTAL :
 
182
+                                       GTK_ORIENTATION_VERTICAL;
 
183
 
 
184
       if (icon->orientation != orientation)
 
185
-        {
 
186
-          icon->orientation = orientation;
 
187
+       {
 
188
+         icon->orientation = orientation;
 
189
 
 
190
-          g_object_notify (G_OBJECT (icon), "orientation");
 
191
-        }
 
192
+         g_object_notify (G_OBJECT (icon), "orientation");
 
193
+       }
 
194
     }
 
195
 
 
196
   if (prop.prop)
 
197
@@ -161,16 +213,16 @@
 
198
   else if (xev->xany.window == icon->manager_window)
 
199
     {
 
200
       if (xev->xany.type == PropertyNotify &&
 
201
-          xev->xproperty.atom == icon->orientation_atom)
 
202
-        {
 
203
-          egg_tray_icon_get_orientation_property (icon);
 
204
-        }
 
205
+         xev->xproperty.atom == icon->orientation_atom)
 
206
+       {
 
207
+         egg_tray_icon_get_orientation_property (icon);
 
208
+       }
 
209
       if (xev->xany.type == DestroyNotify)
 
210
-        {
 
211
-          egg_tray_icon_update_manager_window (icon);
 
212
-        }
 
213
+       {
 
214
+         egg_tray_icon_update_manager_window (icon);
 
215
+       }
 
216
     }
 
217
-
 
218
+  
 
219
   return GDK_FILTER_CONTINUE;
 
220
 }
 
221
 
 
222
@@ -194,21 +246,21 @@
 
223
 
 
224
   gdk_window_remove_filter (root_window, egg_tray_icon_manager_filter, icon);
 
225
 
 
226
-  if (GTK_WIDGET_CLASS (egg_tray_icon_parent_class)->unrealize)
 
227
-    (* GTK_WIDGET_CLASS (egg_tray_icon_parent_class)->unrealize) (widget);
 
228
+  if (GTK_WIDGET_CLASS (parent_class)->unrealize)
 
229
+    (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
 
230
 }
 
231
 
 
232
 static void
 
233
 egg_tray_icon_send_manager_message (EggTrayIcon *icon,
 
234
-                                    long         message,
 
235
-                                    Window       window,
 
236
-                                    long         data1,
 
237
-                                    long         data2,
 
238
-                                    long         data3)
 
239
+                                   long         message,
 
240
+                                   Window       window,
 
241
+                                   long         data1,
 
242
+                                   long         data2,
 
243
+                                   long         data3)
 
244
 {
 
245
   XClientMessageEvent ev;
 
246
   Display *display;
 
247
-
 
248
+  
 
249
   ev.type = ClientMessage;
 
250
   ev.window = window;
 
251
   ev.message_type = icon->system_tray_opcode_atom;
 
252
@@ -220,10 +272,10 @@
 
253
   ev.data.l[4] = data3;
 
254
 
 
255
   display = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
 
256
-
 
257
+  
 
258
   gdk_error_trap_push ();
 
259
   XSendEvent (display,
 
260
-              icon->manager_window, False, NoEventMask, (XEvent *)&ev);
 
261
+             icon->manager_window, False, NoEventMask, (XEvent *)&ev);
 
262
   XSync (display, False);
 
263
   gdk_error_trap_pop ();
 
264
 }
 
265
@@ -232,48 +284,48 @@
 
266
 egg_tray_icon_send_dock_request (EggTrayIcon *icon)
 
267
 {
 
268
   egg_tray_icon_send_manager_message (icon,
 
269
-                                      SYSTEM_TRAY_REQUEST_DOCK,
 
270
-                                      icon->manager_window,
 
271
-                                      gtk_plug_get_id (GTK_PLUG (icon)),
 
272
-                                      0, 0);
 
273
+                                     SYSTEM_TRAY_REQUEST_DOCK,
 
274
+                                     icon->manager_window,
 
275
+                                     gtk_plug_get_id (GTK_PLUG (icon)),
 
276
+                                     0, 0);
 
277
 }
 
278
 
 
279
 static void
 
280
 egg_tray_icon_update_manager_window (EggTrayIcon *icon)
 
281
 {
 
282
   Display *xdisplay;
 
283
-
 
284
+  
 
285
   xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
 
286
-
 
287
+  
 
288
   if (icon->manager_window != None)
 
289
     {
 
290
       GdkWindow *gdkwin;
 
291
 
 
292
       gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
 
293
-                                              icon->manager_window);
 
294
-
 
295
+                                             icon->manager_window);
 
296
+      
 
297
       gdk_window_remove_filter (gdkwin, egg_tray_icon_manager_filter, icon);
 
298
     }
 
299
-
 
300
+  
 
301
   XGrabServer (xdisplay);
 
302
-
 
303
+  
 
304
   icon->manager_window = XGetSelectionOwner (xdisplay,
 
305
-                                             icon->selection_atom);
 
306
+                                            icon->selection_atom);
 
307
 
 
308
   if (icon->manager_window != None)
 
309
     XSelectInput (xdisplay,
 
310
-                  icon->manager_window, StructureNotifyMask|PropertyChangeMask);
 
311
+                 icon->manager_window, StructureNotifyMask|PropertyChangeMask);
 
312
 
 
313
   XUngrabServer (xdisplay);
 
314
   XFlush (xdisplay);
 
315
-
 
316
+  
 
317
   if (icon->manager_window != None)
 
318
     {
 
319
       GdkWindow *gdkwin;
 
320
 
 
321
       gdkwin = gdk_window_lookup_for_display (gtk_widget_get_display (GTK_WIDGET (icon)),
 
322
-                                              icon->manager_window);
 
323
-
 
324
+                                             icon->manager_window);
 
325
+      
 
326
       gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
 
327
 
 
328
       /* Send a request that we'd like to dock */
 
329
@@ -283,6 +335,36 @@
 
330
     }
 
331
 }
 
332
 
 
333
+static gboolean
 
334
+transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
 
335
+{
 
336
+  gdk_window_clear_area (widget->window, event->area.x, event->area.y,
 
337
+                        event->area.width, event->area.height);
 
338
+  return FALSE;
 
339
+}
 
340
+
 
341
+static void
 
342
+make_transparent_again (GtkWidget *widget, GtkStyle *previous_style,
 
343
+                       gpointer user_data)
 
344
+{
 
345
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 
346
+}
 
347
+
 
348
+static void
 
349
+make_transparent (GtkWidget *widget, gpointer user_data)
 
350
+{
 
351
+  if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget))
 
352
+    return;
 
353
+
 
354
+  gtk_widget_set_app_paintable (widget, TRUE);
 
355
+  gtk_widget_set_double_buffered (widget, FALSE);
 
356
+  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
 
357
+  g_signal_connect (widget, "expose_event",
 
358
+                   G_CALLBACK (transparent_expose_event), NULL);
 
359
+  g_signal_connect_after (widget, "style_set",
 
360
+                         G_CALLBACK (make_transparent_again), NULL);
 
361
+}      
 
362
+
 
363
 static void
 
364
 egg_tray_icon_realize (GtkWidget *widget)
 
365
 {
 
366
@@ -293,8 +375,10 @@
 
367
   char buffer[256];
 
368
   GdkWindow *root_window;
 
369
 
 
370
-  if (GTK_WIDGET_CLASS (egg_tray_icon_parent_class)->realize)
 
371
-    GTK_WIDGET_CLASS (egg_tray_icon_parent_class)->realize (widget);
 
372
+  if (GTK_WIDGET_CLASS (parent_class)->realize)
 
373
+    GTK_WIDGET_CLASS (parent_class)->realize (widget);
 
374
+
 
375
+  make_transparent (widget, NULL);
 
376
 
 
377
   screen = gtk_widget_get_screen (widget);
 
378
   display = gdk_screen_get_display (screen);
 
379
@@ -302,28 +386,56 @@
 
380
 
 
381
   /* Now see if there's a manager window around */
 
382
   g_snprintf (buffer, sizeof (buffer),
 
383
-              "_NET_SYSTEM_TRAY_S%d",
 
384
-              gdk_screen_get_number (screen));
 
385
+             "_NET_SYSTEM_TRAY_S%d",
 
386
+             gdk_screen_get_number (screen));
 
387
 
 
388
   icon->selection_atom = XInternAtom (xdisplay, buffer, False);
 
389
-
 
390
+  
 
391
   icon->manager_atom = XInternAtom (xdisplay, "MANAGER", False);
 
392
-
 
393
+  
 
394
   icon->system_tray_opcode_atom = XInternAtom (xdisplay,
 
395
-                                               "_NET_SYSTEM_TRAY_OPCODE",
 
396
-                                               False);
 
397
+                                                  "_NET_SYSTEM_TRAY_OPCODE",
 
398
+                                                  False);
 
399
 
 
400
   icon->orientation_atom = XInternAtom (xdisplay,
 
401
-                                        "_NET_SYSTEM_TRAY_ORIENTATION",
 
402
-                                        False);
 
403
+                                       "_NET_SYSTEM_TRAY_ORIENTATION",
 
404
+                                       False);
 
405
 
 
406
   egg_tray_icon_update_manager_window (icon);
 
407
 
 
408
   root_window = gdk_screen_get_root_window (screen);
 
409
-
 
410
+  
 
411
   /* Add a root window filter so that we get changes on MANAGER */
 
412
   gdk_window_add_filter (root_window,
 
413
-                         egg_tray_icon_manager_filter, icon);
 
414
+                        egg_tray_icon_manager_filter, icon);
 
415
+}
 
416
+
 
417
+static void
 
418
+egg_tray_icon_add (GtkContainer *container, GtkWidget *widget)
 
419
+{
 
420
+  g_signal_connect (widget, "realize",
 
421
+                   G_CALLBACK (make_transparent), NULL);
 
422
+  GTK_CONTAINER_CLASS (parent_class)->add (container, widget);
 
423
+}
 
424
+
 
425
+EggTrayIcon *
 
426
+egg_tray_icon_new_for_xscreen (Screen *xscreen, const char *name)
 
427
+{
 
428
+  GdkDisplay *display;
 
429
+  GdkScreen *screen;
 
430
+
 
431
+  display = gdk_x11_lookup_xdisplay (DisplayOfScreen (xscreen));
 
432
+  screen = gdk_display_get_screen (display, XScreenNumberOfScreen (xscreen));
 
433
+
 
434
+  return egg_tray_icon_new_for_screen (screen, name);
 
435
+}
 
436
+
 
437
+EggTrayIcon *
 
438
+egg_tray_icon_new_for_screen (GdkScreen *screen, const char *name)
 
439
+{
 
440
+  g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
 
441
+
 
442
+  return g_object_new (EGG_TYPE_TRAY_ICON, "screen", screen, "title", name, NULL);
 
443
 }
 
444
 
 
445
 EggTrayIcon*
 
446
@@ -332,6 +444,78 @@
 
447
   return g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL);
 
448
 }
 
449
 
 
450
+guint
 
451
+egg_tray_icon_send_message (EggTrayIcon *icon,
 
452
+                           gint         timeout,
 
453
+                           const gchar *message,
 
454
+                           gint         len)
 
455
+{
 
456
+  guint stamp;
 
457
+  
 
458
+  g_return_val_if_fail (EGG_IS_TRAY_ICON (icon), 0);
 
459
+  g_return_val_if_fail (timeout >= 0, 0);
 
460
+  g_return_val_if_fail (message != NULL, 0);
 
461
+                    
 
462
+  if (icon->manager_window == None)
 
463
+    return 0;
 
464
+
 
465
+  if (len < 0)
 
466
+    len = strlen (message);
 
467
+
 
468
+  stamp = icon->stamp++;
 
469
+  
 
470
+  /* Get ready to send the message */
 
471
+  egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_BEGIN_MESSAGE,
 
472
+                                     (Window)gtk_plug_get_id (GTK_PLUG (icon)),
 
473
+                                     timeout, len, stamp);
 
474
+
 
475
+  /* Now to send the actual message */
 
476
+  gdk_error_trap_push ();
 
477
+  while (len > 0)
 
478
+    {
 
479
+      XClientMessageEvent ev;
 
480
+      Display *xdisplay;
 
481
+
 
482
+      xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (GTK_WIDGET (icon)));
 
483
+      
 
484
+      ev.type = ClientMessage;
 
485
+      ev.window = (Window)gtk_plug_get_id (GTK_PLUG (icon));
 
486
+      ev.format = 8;
 
487
+      ev.message_type = XInternAtom (xdisplay,
 
488
+                                    "_NET_SYSTEM_TRAY_MESSAGE_DATA", False);
 
489
+      if (len > 20)
 
490
+       {
 
491
+         memcpy (&ev.data, message, 20);
 
492
+         len -= 20;
 
493
+         message += 20;
 
494
+       }
 
495
+      else
 
496
+       {
 
497
+         memcpy (&ev.data, message, len);
 
498
+         len = 0;
 
499
+       }
 
500
+
 
501
+      XSendEvent (xdisplay,
 
502
+                 icon->manager_window, False, StructureNotifyMask, (XEvent *)&ev);
 
503
+      XSync (xdisplay, False);
 
504
+    }
 
505
+  gdk_error_trap_pop ();
 
506
+
 
507
+  return stamp;
 
508
+}
 
509
+
 
510
+void
 
511
+egg_tray_icon_cancel_message (EggTrayIcon *icon,
 
512
+                             guint        id)
 
513
+{
 
514
+  g_return_if_fail (EGG_IS_TRAY_ICON (icon));
 
515
+  g_return_if_fail (id > 0);
 
516
+  
 
517
+  egg_tray_icon_send_manager_message (icon, SYSTEM_TRAY_CANCEL_MESSAGE,
 
518
+                                     (Window)gtk_plug_get_id (GTK_PLUG (icon)),
 
519
+                                     id, 0, 0);
 
520
+}
 
521
+
 
522
 GtkOrientation
 
523
 egg_tray_icon_get_orientation (EggTrayIcon *icon)
 
524
 {
 
525
@@ -339,4 +523,3 @@
 
526
 
 
527
   return icon->orientation;
 
528
 }
 
529
-
 
530
diff -Nur gdesklets-0.35.3/utils/eggtrayicon.h gdesklets-0.35.3.new/utils/eggtrayicon.h
 
531
--- gdesklets-0.35.3/utils/eggtrayicon.h        2006-05-09 22:23:56.000000000 +0300
 
532
+++ gdesklets-0.35.3.new/utils/eggtrayicon.h    2006-05-09 22:29:35.000000000 +0300
 
533
@@ -26,14 +26,14 @@
 
534
 
 
535
 G_BEGIN_DECLS
 
536
 
 
537
-#define EGG_TYPE_TRAY_ICON              (egg_tray_icon_get_type ())
 
538
-#define EGG_TRAY_ICON(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TRAY_ICON, EggTrayIcon))
 
539
-#define EGG_TRAY_ICON_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
 
540
-#define EGG_IS_TRAY_ICON(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TRAY_ICON))
 
541
-#define EGG_IS_TRAY_ICON_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
 
542
-#define EGG_TRAY_ICON_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
 
543
-
 
544
-typedef struct _EggTrayIcon       EggTrayIcon;
 
545
+#define EGG_TYPE_TRAY_ICON             (egg_tray_icon_get_type ())
 
546
+#define EGG_TRAY_ICON(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TRAY_ICON, EggTrayIcon))
 
547
+#define EGG_TRAY_ICON_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
 
548
+#define EGG_IS_TRAY_ICON(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TRAY_ICON))
 
549
+#define EGG_IS_TRAY_ICON_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
 
550
+#define EGG_TRAY_ICON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
 
551
+       
 
552
+typedef struct _EggTrayIcon      EggTrayIcon;
 
553
 typedef struct _EggTrayIconClass  EggTrayIconClass;
 
554
 
 
555
 struct _EggTrayIcon
 
556
@@ -41,7 +41,7 @@
 
557
   GtkPlug parent_instance;
 
558
 
 
559
   guint stamp;
 
560
-
 
561
+  
 
562
   Atom selection_atom;
 
563
   Atom manager_atom;
 
564
   Atom system_tray_opcode_atom;
 
565
@@ -58,10 +58,20 @@
 
566
 
 
567
 GType        egg_tray_icon_get_type       (void);
 
568
 
 
569
+EggTrayIcon *egg_tray_icon_new_for_screen (GdkScreen   *screen,
 
570
+                                          const gchar *name);
 
571
+
 
572
 EggTrayIcon *egg_tray_icon_new            (const gchar *name);
 
573
 
 
574
-GtkOrientation egg_tray_icon_get_orientation (EggTrayIcon *icon);
 
575
+guint        egg_tray_icon_send_message   (EggTrayIcon *icon,
 
576
+                                          gint         timeout,
 
577
+                                          const char  *message,
 
578
+                                          gint         len);
 
579
+void         egg_tray_icon_cancel_message (EggTrayIcon *icon,
 
580
+                                          guint        id);
 
581
 
 
582
+GtkOrientation egg_tray_icon_get_orientation (EggTrayIcon *icon);
 
583
+                                           
 
584
 G_END_DECLS
 
585
 
 
586
 #endif /* __EGG_TRAY_ICON_H__ */