]> Pileus Git - ~andy/gtk/blob - gtk/gtkcelllayout.h
Merge branch 'master' into treeview-refactor
[~andy/gtk] / gtk / gtkcelllayout.h
1 /* gtkcelllayout.h
2  * Copyright (C) 2003  Kristian Rietveld  <kris@gtk.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtk.h> can be included directly."
22 #endif
23
24 #ifndef __GTK_CELL_LAYOUT_H__
25 #define __GTK_CELL_LAYOUT_H__
26
27 #include <gtk/gtkcellrenderer.h>
28 #include <gtk/gtkcellarea.h>
29 #include <gtk/gtktreeviewcolumn.h>
30 #include <gtk/gtkbuildable.h>
31 #include <gtk/gtkbuilder.h>
32
33 G_BEGIN_DECLS
34
35 #define GTK_TYPE_CELL_LAYOUT            (gtk_cell_layout_get_type ())
36 #define GTK_CELL_LAYOUT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayout))
37 #define GTK_IS_CELL_LAYOUT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_LAYOUT))
38 #define GTK_CELL_LAYOUT_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_LAYOUT, GtkCellLayoutIface))
39
40 typedef struct _GtkCellLayout           GtkCellLayout; /* dummy typedef */
41 typedef struct _GtkCellLayoutIface      GtkCellLayoutIface;
42
43 /* keep in sync with GtkTreeCellDataFunc */
44 /**
45  * GtkCellLayoutDataFunc:
46  * @cell_layout: a #GtkCellLayout
47  * @cell: the cell renderer whose value is to be set
48  * @tree_model: the model
49  * @iter: a #GtkTreeIter indicating the row to set the value for
50  * @data: user data passed to gtk_cell_layout_set_cell_data_func()
51  *
52  * A function which should set the value of @cell_layout's cell renderer(s)
53  * as appropriate. 
54  */
55 typedef void (* GtkCellLayoutDataFunc) (GtkCellLayout   *cell_layout,
56                                         GtkCellRenderer *cell,
57                                         GtkTreeModel    *tree_model,
58                                         GtkTreeIter     *iter,
59                                         gpointer         data);
60
61 struct _GtkCellLayoutIface
62 {
63   GTypeInterface g_iface;
64
65   /* Virtual Table */
66   void (* pack_start)         (GtkCellLayout         *cell_layout,
67                                GtkCellRenderer       *cell,
68                                gboolean               expand);
69   void (* pack_end)           (GtkCellLayout         *cell_layout,
70                                GtkCellRenderer       *cell,
71                                gboolean               expand);
72   void (* clear)              (GtkCellLayout         *cell_layout);
73   void (* add_attribute)      (GtkCellLayout         *cell_layout,
74                                GtkCellRenderer       *cell,
75                                const gchar           *attribute,
76                                gint                   column);
77   void (* set_cell_data_func) (GtkCellLayout         *cell_layout,
78                                GtkCellRenderer       *cell,
79                                GtkCellLayoutDataFunc  func,
80                                gpointer               func_data,
81                                GDestroyNotify         destroy);
82   void (* clear_attributes)   (GtkCellLayout         *cell_layout,
83                                GtkCellRenderer       *cell);
84   void (* reorder)            (GtkCellLayout         *cell_layout,
85                                GtkCellRenderer       *cell,
86                                gint                   position);
87   GList* (* get_cells)        (GtkCellLayout         *cell_layout);
88
89   GtkCellArea *(* get_area)   (GtkCellLayout         *cell_layout);
90 };
91
92 GType gtk_cell_layout_get_type           (void) G_GNUC_CONST;
93 void  gtk_cell_layout_pack_start         (GtkCellLayout         *cell_layout,
94                                           GtkCellRenderer       *cell,
95                                           gboolean               expand);
96 void  gtk_cell_layout_pack_end           (GtkCellLayout         *cell_layout,
97                                           GtkCellRenderer       *cell,
98                                           gboolean               expand);
99 GList *gtk_cell_layout_get_cells         (GtkCellLayout         *cell_layout);
100 void  gtk_cell_layout_clear              (GtkCellLayout         *cell_layout);
101 void  gtk_cell_layout_set_attributes     (GtkCellLayout         *cell_layout,
102                                           GtkCellRenderer       *cell,
103                                           ...) G_GNUC_NULL_TERMINATED;
104 void  gtk_cell_layout_add_attribute      (GtkCellLayout         *cell_layout,
105                                           GtkCellRenderer       *cell,
106                                           const gchar           *attribute,
107                                           gint                   column);
108 void  gtk_cell_layout_set_cell_data_func (GtkCellLayout         *cell_layout,
109                                           GtkCellRenderer       *cell,
110                                           GtkCellLayoutDataFunc  func,
111                                           gpointer               func_data,
112                                           GDestroyNotify         destroy);
113 void  gtk_cell_layout_clear_attributes   (GtkCellLayout         *cell_layout,
114                                           GtkCellRenderer       *cell);
115 void  gtk_cell_layout_reorder            (GtkCellLayout         *cell_layout,
116                                           GtkCellRenderer       *cell,
117                                           gint                   position);
118 GtkCellArea *gtk_cell_layout_get_area    (GtkCellLayout         *cell_layout);
119
120 gboolean _gtk_cell_layout_buildable_custom_tag_start (GtkBuildable  *buildable,
121                                                       GtkBuilder    *builder,
122                                                       GObject       *child,
123                                                       const gchar   *tagname,
124                                                       GMarkupParser *parser,
125                                                       gpointer      *data);
126 gboolean _gtk_cell_layout_buildable_custom_tag_end   (GtkBuildable  *buildable,
127                                                       GtkBuilder    *builder,
128                                                       GObject       *child,
129                                                       const gchar   *tagname,
130                                                       gpointer      *data);
131 void _gtk_cell_layout_buildable_add_child            (GtkBuildable  *buildable,
132                                                       GtkBuilder    *builder,
133                                                       GObject       *child,
134                                                       const gchar   *type);
135
136 G_END_DECLS
137
138 #endif /* __GTK_CELL_LAYOUT_H__ */