3 * Copyright (C) 2010 Openismus GmbH
6 * Tristan Van Berkom <tristanvb@openismus.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25 #error "Only <gtk/gtk.h> can be included directly."
28 #ifndef __GTK_CELL_AREA_H__
29 #define __GTK_CELL_AREA_H__
31 #include <gtk/gtkcellrenderer.h>
32 #include <gtk/gtkwidget.h>
33 #include <gtk/gtktreemodel.h>
37 #define GTK_TYPE_CELL_AREA (gtk_cell_area_get_type ())
38 #define GTK_CELL_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA, GtkCellArea))
39 #define GTK_CELL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA, GtkCellAreaClass))
40 #define GTK_IS_CELL_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA))
41 #define GTK_IS_CELL_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA))
42 #define GTK_CELL_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA, GtkCellAreaClass))
44 typedef struct _GtkCellArea GtkCellArea;
45 typedef struct _GtkCellAreaClass GtkCellAreaClass;
46 typedef struct _GtkCellAreaPrivate GtkCellAreaPrivate;
51 * @renderer: the cell renderer to operate on
52 * @data: user-supplied data
54 * The type of the callback functions used for iterating over
55 * the cell renderers of a #GtkCellArea, see gtk_cell_area_forall().
57 typedef void (*GtkCellCallback) (GtkCellRenderer *renderer,
62 * GtkCellAttributeCallback:
63 * @renderer: the #GtkCellRenderer that has an attribute
64 * @attribute: the property attributed to @id
65 * @id: the identifier of this attributed value
66 * @data: user-supplied data
68 * The type of the callback functions used for iterating over the
69 * attributes of the cell renderers in a #GtkCellArea,
70 * see gtk_cell_area_attribute_forall().
72 typedef void (*GtkCellAttributeCallback) (GtkCellRenderer *renderer,
73 const gchar *attribute,
80 GInitiallyUnowned parent_instance;
82 GtkCellAreaPrivate *priv;
85 struct _GtkCellAreaClass
87 GInitiallyUnownedClass parent_class;
89 /* vtable - not signals */
92 void (* add) (GtkCellArea *area,
93 GtkCellRenderer *renderer);
94 void (* remove) (GtkCellArea *area,
95 GtkCellRenderer *renderer);
96 void (* forall) (GtkCellArea *area,
97 GtkCellCallback callback,
98 gpointer callback_data);
99 gint (* event) (GtkCellArea *area,
102 const GdkRectangle *cell_area);
103 void (* render) (GtkCellArea *area,
106 const GdkRectangle *cell_area);
109 void (* attribute_connect) (GtkCellArea *area,
110 GtkCellRenderer *renderer,
111 const gchar *attribute,
113 void (* attribute_disconnect) (GtkCellArea *area,
114 GtkCellRenderer *renderer,
115 const gchar *attribute,
117 void (* attribute_forall) (GtkCellArea *area,
118 GtkCellRenderer *renderer,
119 GtkCellAttributeCallback callback,
123 GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area);
124 void (* get_preferred_width) (GtkCellArea *area,
128 void (* get_preferred_height_for_width) (GtkCellArea *area,
131 gint *minimum_height,
132 gint *natural_height);
133 void (* get_preferred_height) (GtkCellArea *area,
137 void (* get_preferred_width_for_height) (GtkCellArea *area,
141 gint *natural_width);
144 /* Padding for future expansion */
145 void (*_gtk_reserved1) (void);
146 void (*_gtk_reserved2) (void);
147 void (*_gtk_reserved3) (void);
148 void (*_gtk_reserved4) (void);
149 void (*_gtk_reserved5) (void);
150 void (*_gtk_reserved6) (void);
151 void (*_gtk_reserved7) (void);
152 void (*_gtk_reserved8) (void);
155 GType gtk_cell_area_get_type (void) G_GNUC_CONST;
158 void gtk_cell_area_add (GtkCellArea *area,
159 GtkCellRenderer *renderer);
160 void gtk_cell_area_remove (GtkCellArea *area,
161 GtkCellRenderer *renderer);
162 void gtk_cell_area_forall (GtkCellArea *area,
163 GtkCellCallback callback,
164 gpointer callback_data);
165 gint gtk_cell_area_event (GtkCellArea *area,
168 const GdkRectangle *cell_area);
169 void gtk_cell_area_render (GtkCellArea *area,
172 const GdkRectangle *cell_area);
175 void gtk_cell_area_attribute_connect (GtkCellArea *area,
176 GtkCellRenderer *renderer,
177 const gchar *attribute,
179 void gtk_cell_area_attribute_disconnect (GtkCellArea *area,
180 GtkCellRenderer *renderer,
181 const gchar *attribute,
183 void gtk_cell_area_attribute_forall (GtkCellArea *area,
184 GtkCellRenderer *renderer,
185 GtkCellAttributeCallback callback,
189 GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area);
190 void gtk_cell_area_get_preferred_width (GtkCellArea *area,
194 void gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
197 gint *minimum_height,
198 gint *natural_height);
199 void gtk_cell_area_get_preferred_height (GtkCellArea *area,
203 void gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
207 gint *natural_width);
210 /* Following apis are not class virtual methods */
211 void gtk_cell_area_apply_attributes (GtkCellArea *area,
212 GtkTreeModel *tree_model,
218 #endif /* __GTK_CELL_AREA_H__ */