]> Pileus Git - ~andy/gtk/blob - gtk/gtkbuildable.h
Rename buildable methods to not clash with widget methods. (#448928,
[~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/gmarkup.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 typedef struct _GtkBuildable      GtkBuildable; /* Dummy typedef */
37 typedef struct _GtkBuildableIface GtkBuildableIface;
38
39 struct _GtkBuildableIface
40 {
41   GTypeInterface g_iface;
42
43   /* virtual table */
44   void          (* set_name)               (GtkBuildable  *buildable,
45                                             const gchar   *name);
46   const gchar * (* get_name)               (GtkBuildable  *buildable);
47   void          (* add_child)              (GtkBuildable  *buildable,
48                                             GtkBuilder    *builder,
49                                             GObject       *child,
50                                             const gchar   *type);
51   void          (* set_buildable_property) (GtkBuildable  *buildable,
52                                             GtkBuilder    *builder,
53                                             const gchar   *name,
54                                             const GValue  *value);
55   GObject *     (* construct_child)        (GtkBuildable  *buildable,
56                                             GtkBuilder    *builder,
57                                             const gchar   *name);
58   gboolean      (* custom_tag_start)       (GtkBuildable  *buildable,
59                                             GtkBuilder    *builder,
60                                             GObject       *child,
61                                             const gchar   *tagname,
62                                             GMarkupParser *parser,
63                                             gpointer      *data);
64   void          (* custom_tag_end)         (GtkBuildable  *buildable,
65                                             GtkBuilder    *builder,
66                                             GObject       *child,
67                                             const gchar   *tagname,
68                                             gpointer      *data);
69   void          (* custom_finished)        (GtkBuildable  *buildable,
70                                             GtkBuilder    *builder,
71                                             GObject       *child,
72                                             const gchar   *tagname,
73                                             gpointer       data);
74   void          (* parser_finished)        (GtkBuildable  *buildable,
75                                             GtkBuilder    *builder);
76
77   GObject *     (* get_internal_child)     (GtkBuildable  *buildable,
78                                             GtkBuilder    *builder,
79                                             const gchar   *childname);
80 };
81
82
83 GType     gtk_buildable_get_type               (void) G_GNUC_CONST;
84
85 void      gtk_buildable_set_name               (GtkBuildable        *buildable,
86                                                 const gchar         *name);
87 const gchar * gtk_buildable_get_name           (GtkBuildable        *buildable);
88 void      gtk_buildable_add_child              (GtkBuildable        *buildable,
89                                                 GtkBuilder          *builder,
90                                                 GObject             *child,
91                                                 const gchar         *type);
92 void      gtk_buildable_set_buildable_property (GtkBuildable        *buildable,
93                                                 GtkBuilder          *builder,
94                                                 const gchar         *name,
95                                                 const GValue        *value);
96 GObject * gtk_buildable_construct_child        (GtkBuildable        *buildable,
97                                                 GtkBuilder          *builder,
98                                                 const gchar         *name);
99 gboolean  gtk_buildable_custom_tag_start       (GtkBuildable        *buildable,
100                                                 GtkBuilder          *builder,
101                                                 GObject             *child,
102                                                 const gchar         *tagname,
103                                                 GMarkupParser       *parser,
104                                                 gpointer            *data);
105 void      gtk_buildable_custom_tag_end         (GtkBuildable        *buildable,
106                                                 GtkBuilder          *builder,
107                                                 GObject             *child,
108                                                 const gchar         *tagname,
109                                                 gpointer            *data);
110 void      gtk_buildable_custom_finished        (GtkBuildable        *buildable,
111                                                 GtkBuilder          *builder,
112                                                 GObject             *child,
113                                                 const gchar         *tagname,
114                                                 gpointer             data);
115 void      gtk_buildable_parser_finished        (GtkBuildable        *buildable,
116                                                 GtkBuilder          *builder);
117 GObject * gtk_buildable_get_internal_child     (GtkBuildable        *buildable,
118                                                 GtkBuilder          *builder,
119                                                 const gchar         *childname);
120
121 G_END_DECLS
122
123 #endif /* __GTK_BUILDABLE_H__ */