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, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "gtkcelllayout.h"
23 gtk_cell_layout_get_type (void)
25 static GType cell_layout_type = 0;
27 if (! cell_layout_type)
29 static const GTypeInfo cell_layout_info =
31 sizeof (GtkCellLayoutIface),
43 g_type_register_static (G_TYPE_INTERFACE, "GtkCellLayout",
44 &cell_layout_info, 0);
46 g_type_interface_add_prerequisite (cell_layout_type, G_TYPE_OBJECT);
49 return cell_layout_type;
54 gtk_cell_layout_pack_start (GtkCellLayout *cell_layout,
55 GtkCellRenderer *cell,
58 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
59 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
61 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->pack_start) (cell_layout,
67 gtk_cell_layout_pack_end (GtkCellLayout *cell_layout,
68 GtkCellRenderer *cell,
71 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
72 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
74 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->pack_end) (cell_layout,
80 gtk_cell_layout_clear (GtkCellLayout *cell_layout)
82 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
84 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->clear) (cell_layout);
88 gtk_cell_layout_set_attributesv (GtkCellLayout *cell_layout,
89 GtkCellRenderer *cell,
94 GtkCellLayoutIface *iface;
96 attribute = va_arg (args, gchar *);
98 iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout);
100 (* iface->clear_attributes) (cell_layout, cell);
102 while (attribute != NULL)
104 column = va_arg (args, gint);
105 (* iface->add_attribute) (cell_layout, cell, attribute, column);
106 attribute = va_arg (args, gchar *);
111 gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout,
112 GtkCellRenderer *cell,
117 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
118 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
120 va_start (args, cell);
121 gtk_cell_layout_set_attributesv (cell_layout, cell, args);
126 gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout,
127 GtkCellRenderer *cell,
128 const gchar *attribute,
131 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
132 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
133 g_return_if_fail (attribute != NULL);
134 g_return_if_fail (column >= 0);
136 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->add_attribute) (cell_layout,
143 gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout,
144 GtkCellRenderer *cell,
145 GtkCellLayoutDataFunc func,
147 GDestroyNotify destroy)
149 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
150 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
152 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->set_cell_data_func) (cell_layout,
160 gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout,
161 GtkCellRenderer *cell)
163 g_return_if_fail (GTK_IS_CELL_LAYOUT (cell_layout));
164 g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
166 (* GTK_CELL_LAYOUT_GET_IFACE (cell_layout)->clear_attributes) (cell_layout,