]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconhelperprivate.h
icon-helper: add GtkIconHelper private object
[~andy/gtk] / gtk / gtkiconhelperprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011 Red Hat, Inc.
3  *
4  * Authors: Cosimo Cecchi <cosimoc@gnome.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GTK_ICON_HELPER_H__
23 #define __GTK_ICON_HELPER_H__
24
25 #include <glib-object.h>
26
27 #include <gtk/gtk.h>
28
29 G_BEGIN_DECLS
30
31 #define GTK_TYPE_ICON_HELPER _gtk_icon_helper_get_type()
32
33 #define GTK_ICON_HELPER(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
35    GTK_TYPE_ICON_HELPER, GtkIconHelper))
36
37 #define GTK_ICON_HELPER_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST ((klass), \
39    GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
40
41 #define GTK_IS_ICON_HELPER(obj) \
42   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
43    GTK_TYPE_ICON_HELPER))
44
45 #define GTK_IS_ICON_HELPER_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
47    GTK_TYPE_ICON_HELPER))
48
49 #define GTK_ICON_HELPER_GET_CLASS(obj) \
50   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
51    GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
52
53 typedef struct _GtkIconHelper GtkIconHelper;
54 typedef struct _GtkIconHelperClass GtkIconHelperClass;
55 typedef struct _GtkIconHelperPrivate GtkIconHelperPrivate;
56
57 struct _GtkIconHelper
58 {
59   GObject parent;
60
61   GtkIconHelperPrivate *priv;
62 };
63
64 struct _GtkIconHelperClass
65 {
66   GObjectClass parent_class;
67 };
68
69 GType _gtk_icon_helper_get_type (void) G_GNUC_CONST;
70
71 GtkIconHelper *_gtk_icon_helper_new (void);
72
73 void _gtk_icon_helper_clear (GtkIconHelper *self);
74 void _gtk_icon_helper_invalidate (GtkIconHelper *self);
75
76 gboolean _gtk_icon_helper_get_is_empty (GtkIconHelper *self);
77
78 void _gtk_icon_helper_set_gicon (GtkIconHelper *self,
79                                  GIcon *gicon,
80                                  GtkIconSize icon_size);
81 void _gtk_icon_helper_set_pixbuf (GtkIconHelper *self,
82                                   GdkPixbuf *pixbuf);
83 void _gtk_icon_helper_set_animation (GtkIconHelper *self,
84                                      GdkPixbufAnimation *animation);
85 void _gtk_icon_helper_set_icon_set (GtkIconHelper *self,
86                                     GtkIconSet *icon_set,
87                                     GtkIconSize icon_size);
88
89 void _gtk_icon_helper_set_icon_name (GtkIconHelper *self,
90                                      const gchar *icon_name,
91                                      GtkIconSize icon_size);
92 void _gtk_icon_helper_set_stock_id (GtkIconHelper *self,
93                                     const gchar *stock_id,
94                                     GtkIconSize icon_size);
95
96 void _gtk_icon_helper_set_icon_size (GtkIconHelper *self,
97                                      GtkIconSize icon_size);
98 void _gtk_icon_helper_set_pixel_size (GtkIconHelper *self,
99                                       gint pixel_size);
100 void _gtk_icon_helper_set_use_fallback (GtkIconHelper *self,
101                                         gboolean use_fallback);
102
103 GtkImageType _gtk_icon_helper_get_storage_type (GtkIconHelper *self);
104 GtkIconSize _gtk_icon_helper_get_icon_size (GtkIconHelper *self);
105 gint _gtk_icon_helper_get_pixel_size (GtkIconHelper *self);
106 gboolean _gtk_icon_helper_get_use_fallback (GtkIconHelper *self);
107
108 GdkPixbuf *_gtk_icon_helper_peek_pixbuf (GtkIconHelper *self);
109 GIcon *_gtk_icon_helper_peek_gicon (GtkIconHelper *self);
110 GtkIconSet *_gtk_icon_helper_peek_icon_set (GtkIconHelper *self);
111 GdkPixbufAnimation *_gtk_icon_helper_peek_animation (GtkIconHelper *self);
112
113 const gchar *_gtk_icon_helper_get_stock_id (GtkIconHelper *self);
114 const gchar *_gtk_icon_helper_get_icon_name (GtkIconHelper *self);
115
116 GdkPixbuf *_gtk_icon_helper_ensure_pixbuf (GtkIconHelper *self,
117                                            GtkStyleContext *context);
118 void _gtk_icon_helper_get_size (GtkIconHelper *self,
119                                 GtkStyleContext *context,
120                                 gint *width_out,
121                                 gint *height_out);
122
123 void _gtk_icon_helper_draw (GtkIconHelper *self,
124                             GtkStyleContext *context,
125                             cairo_t *cr,
126                             gdouble x,
127                             gdouble y);
128
129 G_END_DECLS
130
131 #endif /* __GTK_ICON_HELPER_H__ */