]> Pileus Git - ~andy/gtk/blob - gtk/gtkbuildable.h
bff876d0cb8690ea67d384b82f7aa61440b3d0fc
[~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 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
23 #endif
24
25 #ifndef __GTK_BUILDABLE_H__
26 #define __GTK_BUILDABLE_H__
27
28 #include <gtk/gtkbuilder.h>
29 #include <gtk/gtktypeutils.h>
30
31 G_BEGIN_DECLS
32
33 #define GTK_TYPE_BUILDABLE            (gtk_buildable_get_type ())
34 #define GTK_BUILDABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUILDABLE, GtkBuildable))
35 #define GTK_BUILDABLE_CLASS(obj)      (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_BUILDABLE, GtkBuildableIface))
36 #define GTK_IS_BUILDABLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUILDABLE))
37 #define GTK_BUILDABLE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_BUILDABLE, GtkBuildableIface))
38
39
40 typedef struct _GtkBuildable      GtkBuildable; /* Dummy typedef */
41 typedef struct _GtkBuildableIface GtkBuildableIface;
42
43 struct _GtkBuildableIface
44 {
45   GTypeInterface g_iface;
46
47   /* virtual table */
48   void          (* set_name)               (GtkBuildable  *buildable,
49                                             const gchar   *name);
50   const gchar * (* get_name)               (GtkBuildable  *buildable);
51   void          (* add_child)              (GtkBuildable  *buildable,
52                                             GtkBuilder    *builder,
53                                             GObject       *child,
54                                             const gchar   *type);
55   void          (* set_buildable_property) (GtkBuildable  *buildable,
56                                             GtkBuilder    *builder,
57                                             const gchar   *name,
58                                             const GValue  *value);
59   GObject *     (* construct_child)        (GtkBuildable  *buildable,
60                                             GtkBuilder    *builder,
61                                             const gchar   *name);
62   gboolean      (* custom_tag_start)       (GtkBuildable  *buildable,
63                                             GtkBuilder    *builder,
64                                             GObject       *child,
65                                             const gchar   *tagname,
66                                             GMarkupParser *parser,
67                                             gpointer      *data);
68   void          (* custom_tag_end)         (GtkBuildable  *buildable,
69                                             GtkBuilder    *builder,
70                                             GObject       *child,
71                                             const gchar   *tagname,
72                                             gpointer      *data);
73   void          (* custom_finished)        (GtkBuildable  *buildable,
74                                             GtkBuilder    *builder,
75                                             GObject       *child,
76                                             const gchar   *tagname,
77                                             gpointer       data);
78   void          (* parser_finished)        (GtkBuildable  *buildable,
79                                             GtkBuilder    *builder);
80
81   GObject *     (* get_internal_child)     (GtkBuildable  *buildable,
82                                             GtkBuilder    *builder,
83                                             const gchar   *childname);
84 };
85
86
87 GType     gtk_buildable_get_type               (void) G_GNUC_CONST;
88
89 void      gtk_buildable_set_name               (GtkBuildable        *buildable,
90                                                 const gchar         *name);
91 const gchar * gtk_buildable_get_name           (GtkBuildable        *buildable);
92 void      gtk_buildable_add_child              (GtkBuildable        *buildable,
93                                                 GtkBuilder          *builder,
94                                                 GObject             *child,
95                                                 const gchar         *type);
96 void      gtk_buildable_set_buildable_property (GtkBuildable        *buildable,
97                                                 GtkBuilder          *builder,
98                                                 const gchar         *name,
99                                                 const GValue        *value);
100 GObject * gtk_buildable_construct_child        (GtkBuildable        *buildable,
101                                                 GtkBuilder          *builder,
102                                                 const gchar         *name);
103 gboolean  gtk_buildable_custom_tag_start       (GtkBuildable        *buildable,
104                                                 GtkBuilder          *builder,
105                                                 GObject             *child,
106                                                 const gchar         *tagname,
107                                                 GMarkupParser       *parser,
108                                                 gpointer            *data);
109 void      gtk_buildable_custom_tag_end         (GtkBuildable        *buildable,
110                                                 GtkBuilder          *builder,
111                                                 GObject             *child,
112                                                 const gchar         *tagname,
113                                                 gpointer            *data);
114 void      gtk_buildable_custom_finished        (GtkBuildable        *buildable,
115                                                 GtkBuilder          *builder,
116                                                 GObject             *child,
117                                                 const gchar         *tagname,
118                                                 gpointer             data);
119 void      gtk_buildable_parser_finished        (GtkBuildable        *buildable,
120                                                 GtkBuilder          *builder);
121 GObject * gtk_buildable_get_internal_child     (GtkBuildable        *buildable,
122                                                 GtkBuilder          *builder,
123                                                 const gchar         *childname);
124
125 G_END_DECLS
126
127 #endif /* __GTK_BUILDABLE_H__ */