]> Pileus Git - ~andy/gtk/blob - gtk/gtkcellareaiter.h
Added GtkCellAreaIter class
[~andy/gtk] / gtk / gtkcellareaiter.h
1 /* gtkcellareaiter.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_ITER_H__
29 #define __GTK_CELL_AREA_ITER_H__
30
31 #include <glib-object.h>
32
33 G_BEGIN_DECLS
34
35 #define GTK_TYPE_CELL_AREA_ITER           (gtk_cell_area_iter_get_type ())
36 #define GTK_CELL_AREA_ITER(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_AREA_ITER, GtkCellAreaIter))
37 #define GTK_CELL_AREA_ITER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_AREA_ITER, GtkCellAreaIterClass))
38 #define GTK_IS_CELL_AREA_ITER(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_AREA_ITER))
39 #define GTK_IS_CELL_AREA_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_AREA_ITER))
40 #define GTK_CELL_AREA_ITER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_AREA_ITER, GtkCellAreaIterClass))
41
42 typedef struct _GtkCellAreaIter              GtkCellAreaIter;
43 typedef struct _GtkCellAreaIterPrivate       GtkCellAreaIterPrivate;
44 typedef struct _GtkCellAreaIterClass         GtkCellAreaIterClass;
45
46 struct _GtkCellAreaIter
47 {
48   GObject parent_instance;
49
50   GtkCellAreaIterPrivate *priv;
51 };
52
53 struct _GtkCellAreaIterClass
54 {
55   GObjectClass parent_class;
56
57   /* Subclasses can use this to flush their alignments */
58   void    (* flush_preferred_width)              (GtkCellAreaIter *iter);
59   void    (* flush_preferred_height_for_width)   (GtkCellAreaIter *iter,
60                                                   gint             width);
61   void    (* flush_preferred_height)             (GtkCellAreaIter *iter);
62   void    (* flush_preferred_width_for_height)   (GtkCellAreaIter *iter,
63                                                   gint             height);
64
65   /* Padding for future expansion */
66   void (*_gtk_reserved1) (void);
67   void (*_gtk_reserved2) (void);
68   void (*_gtk_reserved3) (void);
69   void (*_gtk_reserved4) (void);
70 };
71
72 GType   gtk_cell_area_iter_get_type                           (void) G_GNUC_CONST;
73
74 /* Apis for GtkCellArea clients to consult cached values for multiple GtkTreeModel rows */
75 void    gtk_cell_area_iter_get_preferred_width                (GtkCellAreaIter *iter,
76                                                                gint            *minimum_width,
77                                                                gint            *natural_width);
78 void    gtk_cell_area_iter_get_preferred_height_for_width     (GtkCellAreaIter *iter,
79                                                                gint             for_width,
80                                                                gint            *minimum_height,
81                                                                gint            *natural_height);
82 void    gtk_cell_area_iter_get_preferred_height               (GtkCellAreaIter *iter,
83                                                                gint            *minimum_height,
84                                                                gint            *natural_height);
85 void    gtk_cell_area_iter_get_preferred_width_for_height     (GtkCellAreaIter *iter,
86                                                                gint             for_height,
87                                                                gint            *minimum_width,
88                                                                gint            *natural_width);
89
90 /* Apis for GtkCellArea implementations to update cached values for multiple GtkTreeModel rows */
91 void    gtk_cell_area_iter_push_preferred_width               (GtkCellAreaIter *iter,
92                                                                gint             minimum_width,
93                                                                gint             natural_width);
94 void    gtk_cell_area_iter_push_preferred_height_for_width    (GtkCellAreaIter *iter,
95                                                                gint             for_width,
96                                                                gint             minimum_height,
97                                                                gint             natural_height);
98 void    gtk_cell_area_iter_push_preferred_height              (GtkCellAreaIter *iter,
99                                                                gint             minimum_height,
100                                                                gint             natural_height);
101 void    gtk_cell_area_iter_push_preferred_width_for_height    (GtkCellAreaIter *iter,
102                                                                gint             for_height,
103                                                                gint             minimum_width,
104                                                                gint             natural_width);
105
106 /* Apis for GtkCellArea clients to flush the cache */
107 void    gtk_cell_area_iter_flush                              (GtkCellAreaIter *iter);
108 void    gtk_cell_area_iter_flush_preferred_width              (GtkCellAreaIter *iter);
109 void    gtk_cell_area_iter_flush_preferred_height_for_width   (GtkCellAreaIter *iter,
110                                                                gint             for_width);
111 void    gtk_cell_area_iter_flush_preferred_height             (GtkCellAreaIter *iter);
112 void    gtk_cell_area_iter_flush_preferred_width_for_height   (GtkCellAreaIter *iter,
113                                                                gint             for_height);
114
115 G_END_DECLS
116
117 #endif /* __GTK_CELL_AREA_ITER_H__ */