]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconhelperprivate.h
stylecontext: Do invalidation on first resize container
[~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, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef __GTK_ICON_HELPER_H__
21 #define __GTK_ICON_HELPER_H__
22
23 #include <glib-object.h>
24
25 #include <gtk/gtk.h>
26
27 G_BEGIN_DECLS
28
29 #define GTK_TYPE_ICON_HELPER _gtk_icon_helper_get_type()
30
31 #define GTK_ICON_HELPER(obj) \
32   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
33    GTK_TYPE_ICON_HELPER, GtkIconHelper))
34
35 #define GTK_ICON_HELPER_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST ((klass), \
37    GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
38
39 #define GTK_IS_ICON_HELPER(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
41    GTK_TYPE_ICON_HELPER))
42
43 #define GTK_IS_ICON_HELPER_CLASS(klass) \
44   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
45    GTK_TYPE_ICON_HELPER))
46
47 #define GTK_ICON_HELPER_GET_CLASS(obj) \
48   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
49    GTK_TYPE_ICON_HELPER, GtkIconHelperClass))
50
51 typedef struct _GtkIconHelper GtkIconHelper;
52 typedef struct _GtkIconHelperClass GtkIconHelperClass;
53 typedef struct _GtkIconHelperPrivate GtkIconHelperPrivate;
54
55 struct _GtkIconHelper
56 {
57   GObject parent;
58
59   GtkIconHelperPrivate *priv;
60 };
61
62 struct _GtkIconHelperClass
63 {
64   GObjectClass parent_class;
65 };
66
67 GType _gtk_icon_helper_get_type (void) G_GNUC_CONST;
68
69 GtkIconHelper *_gtk_icon_helper_new (void);
70
71 void _gtk_icon_helper_clear (GtkIconHelper *self);
72 void _gtk_icon_helper_invalidate (GtkIconHelper *self);
73
74 gboolean _gtk_icon_helper_get_is_empty (GtkIconHelper *self);
75
76 void _gtk_icon_helper_set_gicon (GtkIconHelper *self,
77                                  GIcon *gicon,
78                                  GtkIconSize icon_size);
79 void _gtk_icon_helper_set_pixbuf (GtkIconHelper *self,
80                                   GdkPixbuf *pixbuf);
81 void _gtk_icon_helper_set_animation (GtkIconHelper *self,
82                                      GdkPixbufAnimation *animation);
83 void _gtk_icon_helper_set_icon_set (GtkIconHelper *self,
84                                     GtkIconSet *icon_set,
85                                     GtkIconSize icon_size);
86
87 void _gtk_icon_helper_set_icon_name (GtkIconHelper *self,
88                                      const gchar *icon_name,
89                                      GtkIconSize icon_size);
90 void _gtk_icon_helper_set_stock_id (GtkIconHelper *self,
91                                     const gchar *stock_id,
92                                     GtkIconSize icon_size);
93
94 void _gtk_icon_helper_set_icon_size (GtkIconHelper *self,
95                                      GtkIconSize icon_size);
96 void _gtk_icon_helper_set_pixel_size (GtkIconHelper *self,
97                                       gint pixel_size);
98 void _gtk_icon_helper_set_use_fallback (GtkIconHelper *self,
99                                         gboolean use_fallback);
100
101 GtkImageType _gtk_icon_helper_get_storage_type (GtkIconHelper *self);
102 GtkIconSize _gtk_icon_helper_get_icon_size (GtkIconHelper *self);
103 gint _gtk_icon_helper_get_pixel_size (GtkIconHelper *self);
104 gboolean _gtk_icon_helper_get_use_fallback (GtkIconHelper *self);
105
106 GdkPixbuf *_gtk_icon_helper_peek_pixbuf (GtkIconHelper *self);
107 GIcon *_gtk_icon_helper_peek_gicon (GtkIconHelper *self);
108 GtkIconSet *_gtk_icon_helper_peek_icon_set (GtkIconHelper *self);
109 GdkPixbufAnimation *_gtk_icon_helper_peek_animation (GtkIconHelper *self);
110
111 const gchar *_gtk_icon_helper_get_stock_id (GtkIconHelper *self);
112 const gchar *_gtk_icon_helper_get_icon_name (GtkIconHelper *self);
113
114 GdkPixbuf *_gtk_icon_helper_ensure_pixbuf (GtkIconHelper *self,
115                                            GtkStyleContext *context);
116 void _gtk_icon_helper_get_size (GtkIconHelper *self,
117                                 GtkStyleContext *context,
118                                 gint *width_out,
119                                 gint *height_out);
120
121 void _gtk_icon_helper_draw (GtkIconHelper *self,
122                             GtkStyleContext *context,
123                             cairo_t *cr,
124                             gdouble x,
125                             gdouble y);
126
127 gboolean _gtk_icon_helper_get_force_scale_pixbuf (GtkIconHelper *self);
128 void     _gtk_icon_helper_set_force_scale_pixbuf (GtkIconHelper *self,
129                                                   gboolean       force_scale);
130
131
132 G_END_DECLS
133
134 #endif /* __GTK_ICON_HELPER_H__ */