mail-notification

Fork of Jean-Yves Lefort's mail-notification, a tray icon to notify of new mail
git clone https://code.djc.id.au/git/mail-notification/

src/eggtrayicon.h (2647B) - raw

      1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
      2 /* eggtrayicon.h
      3  * Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
      4  *
      5  * Mail Notification
      6  * Copyright (C) 2003-2008 Jean-Yves Lefort <jylefort@brutele.be>
      7  *
      8  * This program is free software; you can redistribute it and/or modify
      9  * it under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation; either version 3 of the License, or
     11  * (at your option) any later version.
     12  *
     13  * This program is distributed in the hope that it will be useful,
     14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License along
     19  * with this program; if not, write to the Free Software Foundation, Inc.,
     20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     21  */
     22 
     23 #ifndef __EGG_TRAY_ICON_H__
     24 #define __EGG_TRAY_ICON_H__
     25 
     26 #include <gtk/gtkplug.h>
     27 #ifdef GDK_WINDOWING_X11
     28 #include <gdk/gdkx.h>
     29 #endif
     30 
     31 G_BEGIN_DECLS
     32 
     33 #define EGG_TYPE_TRAY_ICON		(egg_tray_icon_get_type ())
     34 #define EGG_TRAY_ICON(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_TRAY_ICON, EggTrayIcon))
     35 #define EGG_TRAY_ICON_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
     36 #define EGG_IS_TRAY_ICON(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_TRAY_ICON))
     37 #define EGG_IS_TRAY_ICON_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_TRAY_ICON))
     38 #define EGG_TRAY_ICON_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_TRAY_ICON, EggTrayIconClass))
     39 
     40 typedef struct _EggTrayIcon	  EggTrayIcon;
     41 typedef struct _EggTrayIconClass  EggTrayIconClass;
     42 
     43 struct _EggTrayIcon
     44 {
     45   GtkPlug parent_instance;
     46 
     47   guint stamp;
     48 
     49 #ifdef GDK_WINDOWING_X11
     50   Atom selection_atom;
     51   Atom manager_atom;
     52   Atom system_tray_opcode_atom;
     53   Atom orientation_atom;
     54   Window manager_window;
     55 #endif
     56   GtkOrientation orientation;
     57 };
     58 
     59 struct _EggTrayIconClass
     60 {
     61   GtkPlugClass parent_class;
     62 };
     63 
     64 GType        egg_tray_icon_get_type       (void);
     65 
     66 EggTrayIcon *egg_tray_icon_new_for_screen (GdkScreen   *screen,
     67 					   const gchar *name);
     68 
     69 EggTrayIcon *egg_tray_icon_new            (const gchar *name);
     70 
     71 guint        egg_tray_icon_send_message   (EggTrayIcon *icon,
     72 					   gint         timeout,
     73 					   const char  *message,
     74 					   gint         len);
     75 void         egg_tray_icon_cancel_message (EggTrayIcon *icon,
     76 					   guint        id);
     77 
     78 GtkOrientation egg_tray_icon_get_orientation (EggTrayIcon *icon);
     79 
     80 G_END_DECLS
     81 
     82 #endif /* __EGG_TRAY_ICON_H__ */