2 * Copyright (C) 2003 Kristian Rietveld <kris@gtk.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
19 #error "Only <gtk/gtk.h> can be included directly."
22 #ifndef __GTK_CELL_LAYOUT_H__
23 #define __GTK_CELL_LAYOUT_H__
25 #include <gtk/gtkcellrenderer.h>
26 #include <gtk/gtkcellarea.h>
27 #include <gtk/gtkbuildable.h>
28 #include <gtk/gtkbuilder.h>
32 #define GTK_TYPE_CELL_LAYOUT (gtk_cell_layout_get_type ())
33 #define GTK_CELL_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayout))
34 #define GTK_IS_CELL_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_LAYOUT))
35 #define GTK_CELL_LAYOUT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayoutIface))
37 typedef struct _GtkCellLayout GtkCellLayout; /* dummy typedef */
38 typedef struct _GtkCellLayoutIface GtkCellLayoutIface;
40 /* keep in sync with GtkTreeCellDataFunc */
42 * GtkCellLayoutDataFunc:
43 * @cell_layout: a #GtkCellLayout
44 * @cell: the cell renderer whose value is to be set
45 * @tree_model: the model
46 * @iter: a #GtkTreeIter indicating the row to set the value for
47 * @data: user data passed to gtk_cell_layout_set_cell_data_func()
49 * A function which should set the value of @cell_layout's cell renderer(s)
52 typedef void (* GtkCellLayoutDataFunc) (GtkCellLayout *cell_layout,
53 GtkCellRenderer *cell,
54 GtkTreeModel *tree_model,
58 struct _GtkCellLayoutIface
60 GTypeInterface g_iface;
63 void (* pack_start) (GtkCellLayout *cell_layout,
64 GtkCellRenderer *cell,
66 void (* pack_end) (GtkCellLayout *cell_layout,
67 GtkCellRenderer *cell,
69 void (* clear) (GtkCellLayout *cell_layout);
70 void (* add_attribute) (GtkCellLayout *cell_layout,
71 GtkCellRenderer *cell,
72 const gchar *attribute,
74 void (* set_cell_data_func) (GtkCellLayout *cell_layout,
75 GtkCellRenderer *cell,
76 GtkCellLayoutDataFunc func,
78 GDestroyNotify destroy);
79 void (* clear_attributes) (GtkCellLayout *cell_layout,
80 GtkCellRenderer *cell);
81 void (* reorder) (GtkCellLayout *cell_layout,
82 GtkCellRenderer *cell,
84 GList* (* get_cells) (GtkCellLayout *cell_layout);
86 GtkCellArea *(* get_area) (GtkCellLayout *cell_layout);
89 GType gtk_cell_layout_get_type (void) G_GNUC_CONST;
90 void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout,
91 GtkCellRenderer *cell,
93 void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout,
94 GtkCellRenderer *cell,
96 GList *gtk_cell_layout_get_cells (GtkCellLayout *cell_layout);
97 void gtk_cell_layout_clear (GtkCellLayout *cell_layout);
98 void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout,
99 GtkCellRenderer *cell,
100 ...) G_GNUC_NULL_TERMINATED;
101 void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout,
102 GtkCellRenderer *cell,
103 const gchar *attribute,
105 void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
106 GtkCellRenderer *cell,
107 GtkCellLayoutDataFunc func,
109 GDestroyNotify destroy);
110 void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
111 GtkCellRenderer *cell);
112 void gtk_cell_layout_reorder (GtkCellLayout *cell_layout,
113 GtkCellRenderer *cell,
115 GtkCellArea *gtk_cell_layout_get_area (GtkCellLayout *cell_layout);
117 gboolean _gtk_cell_layout_buildable_custom_tag_start (GtkBuildable *buildable,
120 const gchar *tagname,
121 GMarkupParser *parser,
123 gboolean _gtk_cell_layout_buildable_custom_tag_end (GtkBuildable *buildable,
126 const gchar *tagname,
128 void _gtk_cell_layout_buildable_add_child (GtkBuildable *buildable,
135 #endif /* __GTK_CELL_LAYOUT_H__ */