gtkstatusicon.h 7.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/* gtkstatusicon.h:
 *
 * Copyright (C) 2003 Sun Microsystems, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Authors:
 *      Mark McLoughlin <mark@skynet.ie>
 */

24
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25 26 27
#error "Only <gtk/gtk.h> can be included directly."
#endif

28 29 30 31
#ifndef __GTK_STATUS_ICON_H__
#define __GTK_STATUS_ICON_H__

#include <gtk/gtkimage.h>
32
#include <gtk/gtkmenu.h>
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

G_BEGIN_DECLS

#define GTK_TYPE_STATUS_ICON         (gtk_status_icon_get_type ())
#define GTK_STATUS_ICON(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_STATUS_ICON, GtkStatusIcon))
#define GTK_STATUS_ICON_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_STATUS_ICON, GtkStatusIconClass))
#define GTK_IS_STATUS_ICON(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_STATUS_ICON))
#define GTK_IS_STATUS_ICON_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_STATUS_ICON))
#define GTK_STATUS_ICON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_STATUS_ICON, GtkStatusIconClass))

typedef struct _GtkStatusIcon	     GtkStatusIcon;
typedef struct _GtkStatusIconClass   GtkStatusIconClass;
typedef struct _GtkStatusIconPrivate GtkStatusIconPrivate;

struct _GtkStatusIcon
{
  GObject               parent_instance;

51
  GtkStatusIconPrivate *priv;
52 53 54 55 56 57
};

struct _GtkStatusIconClass
{
  GObjectClass parent_class;

58 59 60 61 62 63 64 65 66 67 68 69
  void     (* activate)             (GtkStatusIcon  *status_icon);
  void     (* popup_menu)           (GtkStatusIcon  *status_icon,
                                     guint           button,
                                     guint32         activate_time);
  gboolean (* size_changed)         (GtkStatusIcon  *status_icon,
                                     gint            size);
  gboolean (* button_press_event)   (GtkStatusIcon  *status_icon,
                                     GdkEventButton *event);
  gboolean (* button_release_event) (GtkStatusIcon  *status_icon,
                                     GdkEventButton *event);
  gboolean (* scroll_event)         (GtkStatusIcon  *status_icon,
                                     GdkEventScroll *event);
70 71 72 73 74
  gboolean (* query_tooltip)        (GtkStatusIcon  *status_icon,
                                     gint            x,
                                     gint            y,
                                     gboolean        keyboard_mode,
                                     GtkTooltip     *tooltip);
75 76 77

  void (*__gtk_reserved1);
  void (*__gtk_reserved2);
78 79
  void (*__gtk_reserved3);
  void (*__gtk_reserved4);
80 81 82 83 84 85 86 87 88
};

GType                 gtk_status_icon_get_type           (void) G_GNUC_CONST;

GtkStatusIcon        *gtk_status_icon_new                (void);
GtkStatusIcon        *gtk_status_icon_new_from_pixbuf    (GdkPixbuf          *pixbuf);
GtkStatusIcon        *gtk_status_icon_new_from_file      (const gchar        *filename);
GtkStatusIcon        *gtk_status_icon_new_from_stock     (const gchar        *stock_id);
GtkStatusIcon        *gtk_status_icon_new_from_icon_name (const gchar        *icon_name);
89
GtkStatusIcon        *gtk_status_icon_new_from_gicon     (GIcon              *icon);
90 91 92 93 94 95 96 97 98

void                  gtk_status_icon_set_from_pixbuf    (GtkStatusIcon      *status_icon,
							  GdkPixbuf          *pixbuf);
void                  gtk_status_icon_set_from_file      (GtkStatusIcon      *status_icon,
							  const gchar        *filename);
void                  gtk_status_icon_set_from_stock     (GtkStatusIcon      *status_icon,
							  const gchar        *stock_id);
void                  gtk_status_icon_set_from_icon_name (GtkStatusIcon      *status_icon,
							  const gchar        *icon_name);
99 100
void                  gtk_status_icon_set_from_gicon     (GtkStatusIcon      *status_icon,
                                                          GIcon              *icon);
101 102 103 104

GtkImageType          gtk_status_icon_get_storage_type   (GtkStatusIcon      *status_icon);

GdkPixbuf            *gtk_status_icon_get_pixbuf         (GtkStatusIcon      *status_icon);
105 106
const gchar *         gtk_status_icon_get_stock          (GtkStatusIcon      *status_icon);
const gchar *         gtk_status_icon_get_icon_name      (GtkStatusIcon      *status_icon);
Matthias Clasen's avatar
Matthias Clasen committed
107
GIcon                *gtk_status_icon_get_gicon          (GtkStatusIcon      *status_icon);
108 109 110

gint                  gtk_status_icon_get_size           (GtkStatusIcon      *status_icon);

111 112 113 114
void                  gtk_status_icon_set_screen         (GtkStatusIcon      *status_icon,
                                                          GdkScreen          *screen);
GdkScreen            *gtk_status_icon_get_screen         (GtkStatusIcon      *status_icon);

115 116 117
void                  gtk_status_icon_set_has_tooltip    (GtkStatusIcon      *status_icon,
                                                          gboolean            has_tooltip);
void                  gtk_status_icon_set_tooltip_text   (GtkStatusIcon      *status_icon,
118
                                                          const gchar        *text);
119
void                  gtk_status_icon_set_tooltip_markup (GtkStatusIcon      *status_icon,
120
                                                          const gchar        *markup);
121 122
void                  gtk_status_icon_set_title          (GtkStatusIcon      *status_icon,
                                                          const gchar        *title);
123
const gchar *         gtk_status_icon_get_title          (GtkStatusIcon      *status_icon);
124 125
void                  gtk_status_icon_set_name           (GtkStatusIcon      *status_icon,
                                                          const gchar        *name);
126 127 128 129 130 131
void                  gtk_status_icon_set_visible        (GtkStatusIcon      *status_icon,
							  gboolean            visible);
gboolean              gtk_status_icon_get_visible        (GtkStatusIcon      *status_icon);

gboolean              gtk_status_icon_is_embedded        (GtkStatusIcon      *status_icon);

132 133 134 135 136
void                  gtk_status_icon_position_menu      (GtkMenu            *menu,
							  gint               *x,
							  gint               *y,
							  gboolean           *push_in,
							  gpointer            user_data);
Matthias Clasen's avatar
Matthias Clasen committed
137 138 139 140
gboolean              gtk_status_icon_get_geometry       (GtkStatusIcon      *status_icon,
							  GdkScreen         **screen,
							  GdkRectangle       *area,
							  GtkOrientation     *orientation);
141 142 143
gboolean              gtk_status_icon_get_has_tooltip    (GtkStatusIcon      *status_icon);
gchar                *gtk_status_icon_get_tooltip_text   (GtkStatusIcon      *status_icon);
gchar                *gtk_status_icon_get_tooltip_markup (GtkStatusIcon      *status_icon);
144

145 146
guint32               gtk_status_icon_get_x11_window_id  (GtkStatusIcon      *status_icon);

147 148 149
G_END_DECLS

#endif /* __GTK_STATUS_ICON_H__ */