1 /* gtkcellareacontext.h
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_CONTEXT_H__
29 #define __GTK_CELL_AREA_CONTEXT_H__
31 #include <gtk/gtkcellarea.h>
35 #define GTK_TYPE_CELL_AREA_CONTEXT (gtk_cell_area_context_get_type ())
36 #define GTK_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContext))
37 #define GTK_CELL_AREA_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContextClass))
38 #define GTK_IS_CELL_AREA_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_CONTEXT))
39 #define GTK_IS_CELL_AREA_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_CONTEXT))
40 #define GTK_CELL_AREA_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_CONTEXT, GtkCellAreaContextClass))
42 typedef struct _GtkCellAreaContextPrivate GtkCellAreaContextPrivate;
43 typedef struct _GtkCellAreaContextClass GtkCellAreaContextClass;
45 struct _GtkCellAreaContext
48 GObject parent_instance;
50 GtkCellAreaContextPrivate *priv;
54 * GtkCellAreaContextClass:
55 * @allocate: This tells the context that an allocation width or height
56 * (or both) have been decided for a group of rows. The context should
57 * store any allocations for internally aligned cells at this point so
58 * that they dont need to be recalculated at gtk_cell_area_render() time.
59 * @reset: Clear any previously stored information about requested and
60 * allocated sizes for the context.
61 * @get_preferred_height_for_width: Returns the aligned height for the given
62 * width that context must store while collecting sizes for it's rows.
63 * @get_preferred_width_for_height: Returns the aligned width for the given
64 * height that context must store while collecting sizes for it's rows.
66 struct _GtkCellAreaContextClass
69 GObjectClass parent_class;
72 void (* allocate) (GtkCellAreaContext *context,
75 void (* reset) (GtkCellAreaContext *context);
76 void (* get_preferred_height_for_width) (GtkCellAreaContext *context,
79 gint *natural_height);
80 void (* get_preferred_width_for_height) (GtkCellAreaContext *context,
86 /* Padding for future expansion */
87 void (*_gtk_reserved1) (void);
88 void (*_gtk_reserved2) (void);
89 void (*_gtk_reserved3) (void);
90 void (*_gtk_reserved4) (void);
91 void (*_gtk_reserved5) (void);
92 void (*_gtk_reserved6) (void);
95 GType gtk_cell_area_context_get_type (void) G_GNUC_CONST;
98 GtkCellArea *gtk_cell_area_context_get_area (GtkCellAreaContext *context);
99 void gtk_cell_area_context_allocate (GtkCellAreaContext *context,
102 void gtk_cell_area_context_reset (GtkCellAreaContext *context);
104 /* Apis for GtkCellArea clients to consult cached values
105 * for a series of GtkTreeModel rows
107 void gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context,
109 gint *natural_width);
110 void gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context,
111 gint *minimum_height,
112 gint *natural_height);
113 void gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context,
115 gint *minimum_height,
116 gint *natural_height);
117 void gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context,
120 gint *natural_width);
121 void gtk_cell_area_context_get_allocation (GtkCellAreaContext *context,
125 /* Apis for GtkCellArea implementations to update cached values
126 * for multiple GtkTreeModel rows
128 void gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context,
131 void gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context,
133 gint natural_height);
137 #endif /* __GTK_CELL_AREA_CONTEXT_H__ */