]> Pileus Git - ~andy/gtk/blob - gtk/gtknumerableicon.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtknumerableicon.h
1 /*
2  * gtknumerableicon.h: an emblemed icon with number emblems
3  *
4  * Copyright (C) 2010 Red Hat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * 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  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authors: Cosimo Cecchi <cosimoc@redhat.com>
20  */
21
22 #ifndef __GTK_NUMERABLE_ICON_H__
23 #define __GTK_NUMERABLE_ICON_H__
24
25 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
26 #error "Only <gtk/gtk.h> can be included directly."
27 #endif
28
29 #include <gio/gio.h>
30 #include <gtk/gtkstylecontext.h>
31
32 G_BEGIN_DECLS
33
34 #define GTK_TYPE_NUMERABLE_ICON                  (gtk_numerable_icon_get_type ())
35 #define GTK_NUMERABLE_ICON(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIcon))
36 #define GTK_NUMERABLE_ICON_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIconClass))
37 #define GTK_IS_NUMERABLE_ICON(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NUMERABLE_ICON))
38 #define GTK_IS_NUMERABLE_ICON_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NUMERABLE_ICON))
39 #define GTK_NUMERABLE_ICON_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NUMERABLE_ICON, GtkNumerableIconClass))
40
41 typedef struct _GtkNumerableIcon        GtkNumerableIcon;
42 typedef struct _GtkNumerableIconClass   GtkNumerableIconClass;
43 typedef struct _GtkNumerableIconPrivate GtkNumerableIconPrivate;
44
45 struct _GtkNumerableIcon {
46   GEmblemedIcon parent;
47
48   /*< private >*/
49   GtkNumerableIconPrivate *priv;
50 };
51
52 struct _GtkNumerableIconClass {
53   GEmblemedIconClass parent_class;
54
55   /* padding for future class expansion */
56   gpointer padding[16];
57 };
58
59 GType             gtk_numerable_icon_get_type                 (void) G_GNUC_CONST;
60
61 GIcon *           gtk_numerable_icon_new                      (GIcon            *base_icon);
62 GIcon *           gtk_numerable_icon_new_with_style_context   (GIcon            *base_icon,
63                                                                GtkStyleContext  *context);
64
65 GtkStyleContext * gtk_numerable_icon_get_style_context        (GtkNumerableIcon *self);
66 void              gtk_numerable_icon_set_style_context        (GtkNumerableIcon *self,
67                                                                GtkStyleContext  *style);
68
69 gint              gtk_numerable_icon_get_count                (GtkNumerableIcon *self);
70 void              gtk_numerable_icon_set_count                (GtkNumerableIcon *self,
71                                                                gint count);
72
73 const gchar *     gtk_numerable_icon_get_label                (GtkNumerableIcon *self);
74 void              gtk_numerable_icon_set_label                (GtkNumerableIcon *self,
75                                                                const gchar      *label);
76
77 void              gtk_numerable_icon_set_background_gicon     (GtkNumerableIcon *self,
78                                                                GIcon            *icon);
79 GIcon *           gtk_numerable_icon_get_background_gicon     (GtkNumerableIcon *self);
80
81 void              gtk_numerable_icon_set_background_icon_name (GtkNumerableIcon *self,
82                                                                const gchar      *icon_name);
83 const gchar *     gtk_numerable_icon_get_background_icon_name (GtkNumerableIcon *self);
84
85 G_END_DECLS
86
87 #endif /* __GTK_NUMERABLE_ICON_H__ */