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;
50 * @renderer: the cell renderer to operate on
51 * @data: user-supplied data
53 * The type of the callback functions used for iterating over
54 * the cell renderers of a #GtkCellArea, see gtk_cell_area_forall().
56 typedef void (*GtkCellCallback) (GtkCellRenderer *renderer,
62 GInitiallyUnowned parent_instance;
64 GtkCellAreaPrivate *priv;
67 struct _GtkCellAreaClass
69 GInitiallyUnownedClass parent_class;
71 /* vtable - not signals */
74 void (* add) (GtkCellArea *area,
75 GtkCellRenderer *renderer);
76 void (* remove) (GtkCellArea *area,
77 GtkCellRenderer *renderer);
78 void (* forall) (GtkCellArea *area,
79 GtkCellCallback callback,
80 gpointer callback_data);
81 gint (* event) (GtkCellArea *area,
84 const GdkRectangle *cell_area);
85 void (* render) (GtkCellArea *area,
88 const GdkRectangle *cell_area);
91 GtkSizeRequestMode (* get_request_mode) (GtkCellArea *area);
92 void (* get_preferred_width) (GtkCellArea *area,
96 void (* get_preferred_height_for_width) (GtkCellArea *area,
100 gint *natural_height);
101 void (* get_preferred_height) (GtkCellArea *area,
105 void (* get_preferred_width_for_height) (GtkCellArea *area,
109 gint *natural_width);
112 /* Padding for future expansion */
113 void (*_gtk_reserved1) (void);
114 void (*_gtk_reserved2) (void);
115 void (*_gtk_reserved3) (void);
116 void (*_gtk_reserved4) (void);
117 void (*_gtk_reserved5) (void);
118 void (*_gtk_reserved6) (void);
119 void (*_gtk_reserved7) (void);
120 void (*_gtk_reserved8) (void);
123 GType gtk_cell_area_get_type (void) G_GNUC_CONST;
126 void gtk_cell_area_add (GtkCellArea *area,
127 GtkCellRenderer *renderer);
128 void gtk_cell_area_remove (GtkCellArea *area,
129 GtkCellRenderer *renderer);
130 void gtk_cell_area_forall (GtkCellArea *area,
131 GtkCellCallback callback,
132 gpointer callback_data);
133 gint gtk_cell_area_event (GtkCellArea *area,
136 const GdkRectangle *cell_area);
137 void gtk_cell_area_render (GtkCellArea *area,
140 const GdkRectangle *cell_area);
143 GtkSizeRequestMode gtk_cell_area_get_request_mode (GtkCellArea *area);
144 void gtk_cell_area_get_preferred_width (GtkCellArea *area,
148 void gtk_cell_area_get_preferred_height_for_width (GtkCellArea *area,
151 gint *minimum_height,
152 gint *natural_height);
153 void gtk_cell_area_get_preferred_height (GtkCellArea *area,
157 void gtk_cell_area_get_preferred_width_for_height (GtkCellArea *area,
161 gint *natural_width);
164 /* Following apis are not class virtual methods */
165 void gtk_cell_area_apply_attributes (GtkCellArea *area,
166 GtkTreeModel *tree_model,
168 void gtk_cell_area_attribute_connect (GtkCellArea *area,
169 GtkCellRenderer *renderer,
170 const gchar *attribute,
172 void gtk_cell_area_attribute_disconnect (GtkCellArea *area,
173 GtkCellRenderer *renderer,
174 const gchar *attribute);
179 #endif /* __GTK_CELL_AREA_H__ */