]> Pileus Git - ~andy/gtk/blob - gtk/gtkbuildable.h
Added <attributes> / <attribute> custom tags to parse pango attributes
[~andy/gtk] / gtk / gtkbuildable.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2006-2007 Async Open Source,
3  *                         Johan Dahlin <jdahlin@async.com.br>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library 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  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library 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
21 #ifndef __GTK_BUILDABLE_H__
22 #define __GTK_BUILDABLE_H__
23
24 #include <glib.h>
25 #include <gtk/gtkbuilder.h>
26 #include <gtk/gtktypeutils.h>
27
28 G_BEGIN_DECLS
29
30 #define GTK_TYPE_BUILDABLE            (gtk_buildable_get_type ())
31 #define GTK_BUILDABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUILDABLE, GtkBuildable))
32 #define GTK_BUILDABLE_CLASS(obj)      (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_BUILDABLE, GtkBuildableIface))
33 #define GTK_IS_BUILDABLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUILDABLE))
34 #define GTK_BUILDABLE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_BUILDABLE, GtkBuildableIface))
35
36
37 typedef struct _GtkBuildable      GtkBuildable; /* Dummy typedef */
38 typedef struct _GtkBuildableIface GtkBuildableIface;
39
40 struct _GtkBuildableIface
41 {
42   GTypeInterface g_iface;
43
44   /* virtual table */
45   void          (* set_name)               (GtkBuildable  *buildable,
46                                             const gchar   *name);
47   const gchar * (* get_name)               (GtkBuildable  *buildable);
48   void          (* add_child)              (GtkBuildable  *buildable,
49                                             GtkBuilder    *builder,
50                                             GObject       *child,
51                                             const gchar   *type);
52   void          (* set_buildable_property) (GtkBuildable  *buildable,
53                                             GtkBuilder    *builder,
54                                             const gchar   *name,
55                                             const GValue  *value);
56   GObject *     (* construct_child)        (GtkBuildable  *buildable,
57                                             GtkBuilder    *builder,
58                                             const gchar   *name);
59   gboolean      (* custom_tag_start)       (GtkBuildable  *buildable,
60                                             GtkBuilder    *builder,
61                                             GObject       *child,
62                                             const gchar   *tagname,
63                                             GMarkupParser *parser,
64                                             gpointer      *data);
65   void          (* custom_tag_end)         (GtkBuildable  *buildable,
66                                             GtkBuilder    *builder,
67                                             GObject       *child,
68                                             const gchar   *tagname,
69                                             gpointer      *data);
70   void          (* custom_finished)        (GtkBuildable  *buildable,
71                                             GtkBuilder    *builder,
72                                             GObject       *child,
73                                             const gchar   *tagname,
74                                             gpointer       data);
75   void          (* parser_finished)        (GtkBuildable  *buildable,
76                                             GtkBuilder    *builder);
77
78   GObject *     (* get_internal_child)     (GtkBuildable  *buildable,
79                                             GtkBuilder    *builder,
80                                             const gchar   *childname);
81 };
82
83
84 GType     gtk_buildable_get_type               (void) G_GNUC_CONST;
85
86 void      gtk_buildable_set_name               (GtkBuildable        *buildable,
87                                                 const gchar         *name);
88 const gchar * gtk_buildable_get_name           (GtkBuildable        *buildable);
89 void      gtk_buildable_add_child              (GtkBuildable        *buildable,
90                                                 GtkBuilder          *builder,
91                                                 GObject             *child,
92                                                 const gchar         *type);
93 void      gtk_buildable_set_buildable_property (GtkBuildable        *buildable,
94                                                 GtkBuilder          *builder,
95                                                 const gchar         *name,
96                                                 const GValue        *value);
97 GObject * gtk_buildable_construct_child        (GtkBuildable        *buildable,
98                                                 GtkBuilder          *builder,
99                                                 const gchar         *name);
100 gboolean  gtk_buildable_custom_tag_start       (GtkBuildable        *buildable,
101                                                 GtkBuilder          *builder,
102                                                 GObject             *child,
103                                                 const gchar         *tagname,
104                                                 GMarkupParser       *parser,
105                                                 gpointer            *data);
106 void      gtk_buildable_custom_tag_end         (GtkBuildable        *buildable,
107                                                 GtkBuilder          *builder,
108                                                 GObject             *child,
109                                                 const gchar         *tagname,
110                                                 gpointer            *data);
111 void      gtk_buildable_custom_finished        (GtkBuildable        *buildable,
112                                                 GtkBuilder          *builder,
113                                                 GObject             *child,
114                                                 const gchar         *tagname,
115                                                 gpointer             data);
116 void      gtk_buildable_parser_finished        (GtkBuildable        *buildable,
117                                                 GtkBuilder          *builder);
118 GObject * gtk_buildable_get_internal_child     (GtkBuildable        *buildable,
119                                                 GtkBuilder          *builder,
120                                                 const gchar         *childname);
121
122 G_END_DECLS
123
124 #endif /* __GTK_BUILDABLE_H__ */