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