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, 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_BOX_CONTEXT_H__
29 #define __GTK_CELL_AREA_BOX_CONTEXT_H__
31 #include <gtk/gtkcellareacontext.h>
32 #include <gtk/gtkcellareabox.h>
33 #include <gtk/gtkcellrenderer.h>
34 #include <gtk/gtksizerequest.h>
38 #define GTK_TYPE_CELL_AREA_BOX_CONTEXT (_gtk_cell_area_box_context_get_type ())
39 #define GTK_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContext))
40 #define GTK_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
41 #define GTK_IS_CELL_AREA_BOX_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
42 #define GTK_IS_CELL_AREA_BOX_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_BOX_CONTEXT))
43 #define GTK_CELL_AREA_BOX_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_BOX_CONTEXT, GtkCellAreaBoxContextClass))
45 typedef struct _GtkCellAreaBoxContext GtkCellAreaBoxContext;
46 typedef struct _GtkCellAreaBoxContextClass GtkCellAreaBoxContextClass;
47 typedef struct _GtkCellAreaBoxContextPrivate GtkCellAreaBoxContextPrivate;
49 struct _GtkCellAreaBoxContext
51 GtkCellAreaContext parent_instance;
53 GtkCellAreaBoxContextPrivate *priv;
56 struct _GtkCellAreaBoxContextClass
58 GtkCellAreaContextClass parent_class;
62 GType _gtk_cell_area_box_context_get_type (void) G_GNUC_CONST;
65 /* Create a duplicate of the context */
66 GtkCellAreaBoxContext *_gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
67 GtkCellAreaBoxContext *box_context);
69 /* Initialize group array dimensions */
70 void _gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
72 gboolean *expand_groups,
73 gboolean *align_groups);
75 /* Update cell-group sizes */
76 void _gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
81 void _gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
87 void _gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
92 void _gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
98 /* Fetch cell-group sizes */
99 void _gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
102 gint *natural_width);
104 void _gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
107 gint *minimum_height,
108 gint *natural_height);
110 void _gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
112 gint *minimum_height,
113 gint *natural_height);
115 void _gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
119 gint *natural_width);
121 GtkRequestedSize *_gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
123 GtkRequestedSize *_gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context,
126 /* Private context/area interaction */
128 gint group_idx; /* Groups containing only invisible cells are not allocated */
129 gint position; /* Relative group allocation position in the orientation of the box */
130 gint size; /* Full allocated size of the cells in this group spacing inclusive */
131 } GtkCellAreaBoxAllocation;
133 GtkCellAreaBoxAllocation *
134 _gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *context,
139 #endif /* __GTK_CELL_AREA_BOX_CONTEXT_H__ */