]> Pileus Git - ~andy/gtk/blob - gtk/gtkcellareaboxcontextprivate.h
7e0f2ae7c1011bad1c4a6878815089f2b0742801
[~andy/gtk] / gtk / gtkcellareaboxcontextprivate.h
1 /* gtkcellareaboxcontext.h
2  *
3  * Copyright (C) 2010 Openismus GmbH
4  *
5  * Authors:
6  *      Tristan Van Berkom <tristanvb@openismus.com>
7  *
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.
12  *
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.
17  *
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.
22  */
23
24 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25 #error "Only <gtk/gtk.h> can be included directly."
26 #endif
27
28 #ifndef __GTK_CELL_AREA_BOX_CONTEXT_H__
29 #define __GTK_CELL_AREA_BOX_CONTEXT_H__
30
31 #include <gtk/gtkcellareacontext.h>
32 #include <gtk/gtkcellareabox.h>
33 #include <gtk/gtkcellrenderer.h>
34 #include <gtk/gtksizerequest.h>
35
36 G_BEGIN_DECLS
37
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))
44
45 typedef struct _GtkCellAreaBoxContext              GtkCellAreaBoxContext;
46 typedef struct _GtkCellAreaBoxContextClass         GtkCellAreaBoxContextClass;
47 typedef struct _GtkCellAreaBoxContextPrivate       GtkCellAreaBoxContextPrivate;
48
49 struct _GtkCellAreaBoxContext
50 {
51   GtkCellAreaContext parent_instance;
52
53   GtkCellAreaBoxContextPrivate *priv;
54 };
55
56 struct _GtkCellAreaBoxContextClass
57 {
58   GtkCellAreaContextClass parent_class;
59
60 };
61
62 GType   _gtk_cell_area_box_context_get_type                     (void) G_GNUC_CONST;
63
64
65 /* Create a duplicate of the context */
66 GtkCellAreaBoxContext *_gtk_cell_area_box_context_copy          (GtkCellAreaBox        *box,
67                                                                 GtkCellAreaBoxContext *box_context);
68
69 /* Initialize group array dimensions */
70 void    _gtk_cell_area_box_init_groups                         (GtkCellAreaBoxContext *box_context,
71                                                                 guint                  n_groups,
72                                                                 gboolean              *expand_groups,
73                                                                 gboolean              *align_groups);
74
75 /* Update cell-group sizes */
76 void    _gtk_cell_area_box_context_push_group_width             (GtkCellAreaBoxContext *box_context,
77                                                                 gint                   group_idx,
78                                                                 gint                   minimum_width,
79                                                                 gint                   natural_width);
80
81 void    _gtk_cell_area_box_context_push_group_height_for_width  (GtkCellAreaBoxContext *box_context,
82                                                                 gint                   group_idx,
83                                                                 gint                   for_width,
84                                                                 gint                   minimum_height,
85                                                                 gint                   natural_height);
86
87 void    _gtk_cell_area_box_context_push_group_height            (GtkCellAreaBoxContext *box_context,
88                                                                 gint                   group_idx,
89                                                                 gint                   minimum_height,
90                                                                 gint                   natural_height);
91
92 void    _gtk_cell_area_box_context_push_group_width_for_height  (GtkCellAreaBoxContext *box_context,
93                                                                 gint                   group_idx,
94                                                                 gint                   for_height,
95                                                                 gint                   minimum_width,
96                                                                 gint                   natural_width);
97
98 /* Fetch cell-group sizes */
99 void    _gtk_cell_area_box_context_get_group_width              (GtkCellAreaBoxContext *box_context,
100                                                                 gint                   group_idx,
101                                                                 gint                  *minimum_width,
102                                                                 gint                  *natural_width);
103
104 void    _gtk_cell_area_box_context_get_group_height_for_width   (GtkCellAreaBoxContext *box_context,
105                                                                 gint                   group_idx,
106                                                                 gint                   for_width,
107                                                                 gint                  *minimum_height,
108                                                                 gint                  *natural_height);
109
110 void    _gtk_cell_area_box_context_get_group_height             (GtkCellAreaBoxContext *box_context,
111                                                                 gint                   group_idx,
112                                                                 gint                  *minimum_height,
113                                                                 gint                  *natural_height);
114
115 void    _gtk_cell_area_box_context_get_group_width_for_height   (GtkCellAreaBoxContext *box_context,
116                                                                 gint                   group_idx,
117                                                                 gint                   for_height,
118                                                                 gint                  *minimum_width,
119                                                                 gint                  *natural_width);
120
121 GtkRequestedSize *_gtk_cell_area_box_context_get_widths         (GtkCellAreaBoxContext *box_context,
122                                                                 gint                  *n_widths);
123 GtkRequestedSize *_gtk_cell_area_box_context_get_heights        (GtkCellAreaBoxContext *box_context,
124                                                                 gint                  *n_heights);
125
126 /* Private context/area interaction */
127 typedef struct {
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;
132
133 GtkCellAreaBoxAllocation *
134 _gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *context,
135                                                   gint                  *n_allocs);
136
137 G_END_DECLS
138
139 #endif /* __GTK_CELL_AREA_BOX_CONTEXT_H__ */