1/* gtkstatusicon.h:
2 *
3 * Copyright (C) 2003 Sun Microsystems, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
19 *
20 * Authors:
21 * Mark McLoughlin <[email protected]>
22 */
23
24#ifndef __GTK_STATUS_ICON_H__
25#define __GTK_STATUS_ICON_H__
26
27#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28#error "Only <gtk/gtk.h> can be included directly."
29#endif
30
31#include <gtk/gtkimage.h>
32#include <gtk/gtkmenu.h>
33
34G_BEGIN_DECLS
35
36#define GTK_TYPE_STATUS_ICON (gtk_status_icon_get_type ())
37#define GTK_STATUS_ICON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STATUS_ICON, GtkStatusIcon))
38#define GTK_STATUS_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_STATUS_ICON, GtkStatusIconClass))
39#define GTK_IS_STATUS_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STATUS_ICON))
40#define GTK_IS_STATUS_ICON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_STATUS_ICON))
41#define GTK_STATUS_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STATUS_ICON, GtkStatusIconClass))
42
43typedef struct _GtkStatusIcon GtkStatusIcon;
44typedef struct _GtkStatusIconClass GtkStatusIconClass;
45typedef struct _GtkStatusIconPrivate GtkStatusIconPrivate;
46
47struct _GtkStatusIcon
48{
49 GObject parent_instance;
50
51 GtkStatusIconPrivate *GSEAL (priv);
52};
53
54struct _GtkStatusIconClass
55{
56 GObjectClass parent_class;
57
58 void (* activate) (GtkStatusIcon *status_icon);
59 void (* popup_menu) (GtkStatusIcon *status_icon,
60 guint button,
61 guint32 activate_time);
62 gboolean (* size_changed) (GtkStatusIcon *status_icon,
63 gint size);
64 gboolean (* button_press_event) (GtkStatusIcon *status_icon,
65 GdkEventButton *event);
66 gboolean (* button_release_event) (GtkStatusIcon *status_icon,
67 GdkEventButton *event);
68 gboolean (* scroll_event) (GtkStatusIcon *status_icon,
69 GdkEventScroll *event);
70 gboolean (* query_tooltip) (GtkStatusIcon *status_icon,
71 gint x,
72 gint y,
73 gboolean keyboard_mode,
74 GtkTooltip *tooltip);
75
76 void *__gtk_reserved1;
77 void *__gtk_reserved2;
78};
79
80GType gtk_status_icon_get_type (void) G_GNUC_CONST;
81
82GtkStatusIcon *gtk_status_icon_new (void);
83GtkStatusIcon *gtk_status_icon_new_from_pixbuf (GdkPixbuf *pixbuf);
84GtkStatusIcon *gtk_status_icon_new_from_file (const gchar *filename);
85GtkStatusIcon *gtk_status_icon_new_from_stock (const gchar *stock_id);
86GtkStatusIcon *gtk_status_icon_new_from_icon_name (const gchar *icon_name);
87GtkStatusIcon *gtk_status_icon_new_from_gicon (GIcon *icon);
88
89void gtk_status_icon_set_from_pixbuf (GtkStatusIcon *status_icon,
90 GdkPixbuf *pixbuf);
91void gtk_status_icon_set_from_file (GtkStatusIcon *status_icon,
92 const gchar *filename);
93void gtk_status_icon_set_from_stock (GtkStatusIcon *status_icon,
94 const gchar *stock_id);
95void gtk_status_icon_set_from_icon_name (GtkStatusIcon *status_icon,
96 const gchar *icon_name);
97void gtk_status_icon_set_from_gicon (GtkStatusIcon *status_icon,
98 GIcon *icon);
99
100GtkImageType gtk_status_icon_get_storage_type (GtkStatusIcon *status_icon);
101
102GdkPixbuf *gtk_status_icon_get_pixbuf (GtkStatusIcon *status_icon);
103const gchar * gtk_status_icon_get_stock (GtkStatusIcon *status_icon);
104const gchar * gtk_status_icon_get_icon_name (GtkStatusIcon *status_icon);
105GIcon *gtk_status_icon_get_gicon (GtkStatusIcon *status_icon);
106
107gint gtk_status_icon_get_size (GtkStatusIcon *status_icon);
108
109void gtk_status_icon_set_screen (GtkStatusIcon *status_icon,
110 GdkScreen *screen);
111GdkScreen *gtk_status_icon_get_screen (GtkStatusIcon *status_icon);
112
113#ifndef GTK_DISABLE_DEPRECATED
114void gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon,
115 const gchar *tooltip_text);
116#endif
117void gtk_status_icon_set_has_tooltip (GtkStatusIcon *status_icon,
118 gboolean has_tooltip);
119void gtk_status_icon_set_tooltip_text (GtkStatusIcon *status_icon,
120 const gchar *text);
121void gtk_status_icon_set_tooltip_markup (GtkStatusIcon *status_icon,
122 const gchar *markup);
123void gtk_status_icon_set_title (GtkStatusIcon *status_icon,
124 const gchar *title);
125const gchar * gtk_status_icon_get_title (GtkStatusIcon *status_icon);
126void gtk_status_icon_set_name (GtkStatusIcon *status_icon,
127 const gchar *name);
128void gtk_status_icon_set_visible (GtkStatusIcon *status_icon,
129 gboolean visible);
130gboolean gtk_status_icon_get_visible (GtkStatusIcon *status_icon);
131
132#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
133void gtk_status_icon_set_blinking (GtkStatusIcon *status_icon,
134 gboolean blinking);
135gboolean gtk_status_icon_get_blinking (GtkStatusIcon *status_icon);
136#endif
137
138gboolean gtk_status_icon_is_embedded (GtkStatusIcon *status_icon);
139
140void gtk_status_icon_position_menu (GtkMenu *menu,
141 gint *x,
142 gint *y,
143 gboolean *push_in,
144 gpointer user_data);
145gboolean gtk_status_icon_get_geometry (GtkStatusIcon *status_icon,
146 GdkScreen **screen,
147 GdkRectangle *area,
148 GtkOrientation *orientation);
149gboolean gtk_status_icon_get_has_tooltip (GtkStatusIcon *status_icon);
150gchar *gtk_status_icon_get_tooltip_text (GtkStatusIcon *status_icon);
151gchar *gtk_status_icon_get_tooltip_markup (GtkStatusIcon *status_icon);
152
153guint32 gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon);
154
155G_END_DECLS
156
157#endif /* __GTK_STATUS_ICON_H__ */
158