1 /* gtkcellareaboxcontext.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, see <http://www.gnu.org/licenses/>.
22 #ifndef __GTK_CELL_AREA_BOX_CONTEXT_H__
23 #define __GTK_CELL_AREA_BOX_CONTEXT_H__
25 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
26 #error "Only <gtk/gtk.h> can be included directly."
29 #include <gtk/gtkcellareacontext.h>
30 #include <gtk/gtkcellareabox.h>
31 #include <gtk/gtkcellrenderer.h>
32 #include <gtk/gtksizerequest.h>
36 #define GTK_TYPE_CELL_AREA_BOX_CONTEXT (_gtk_cell_area_box_context_get_type ())
37 #define GTK_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContext))
38 #define GTK_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
39 #define GTK_IS_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
40 #define GTK_IS_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
41 #define GTK_CELL_AREA_BOX_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
43 typedef struct _GtkCellAreaBoxContext GtkCellAreaBoxContext;
44 typedef struct _GtkCellAreaBoxContextClass GtkCellAreaBoxContextClass;
45 typedef struct _GtkCellAreaBoxContextPrivate GtkCellAreaBoxContextPrivate;
47 struct _GtkCellAreaBoxContext
49 GtkCellAreaContext parent_instance;
51 GtkCellAreaBoxContextPrivate *priv;
54 struct _GtkCellAreaBoxContextClass
56 GtkCellAreaContextClass parent_class;
60 GType _gtk_cell_area_box_context_get_type (void) G_GNUC_CONST;
63 /* Create a duplicate of the context */
64 GtkCellAreaBoxContext *_gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
65 GtkCellAreaBoxContext *box_context);
67 /* Initialize group array dimensions */
68 void _gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
70 gboolean *expand_groups,
71 gboolean *align_groups);
73 /* Update cell-group sizes */
74 void _gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
79 void _gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
85 void _gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
90 void _gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
96 /* Fetch cell-group sizes */
97 void _gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
100 gint *natural_width);
102 void _gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
105 gint *minimum_height,
106 gint *natural_height);
108 void _gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
110 gint *minimum_height,
111 gint *natural_height);
113 void _gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
117 gint *natural_width);
119 GtkRequestedSize *_gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
121 GtkRequestedSize *_gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context,
124 /* Private context/area interaction */
126 gint group_idx; /* Groups containing only invisible cells are not allocated */
127 gint position; /* Relative group allocation position in the orientation of the box */
128 gint size; /* Full allocated size of the cells in this group spacing inclusive */
129 } GtkCellAreaBoxAllocation;
131 GtkCellAreaBoxAllocation *
132 _gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *context,
137 #endif /* __GTK_CELL_AREA_BOX_CONTEXT_H__ */