alternative to assert
[gtkD.git] / gtkD / src / gtk / CellLayoutT.d
blob5159907bdd41b130f28077fbf84a8d15baba4745
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkCellLayout.html
26 * outPack = gtk
27 * outFile = CellLayoutT
28 * strct = GtkCellLayout
29 * realStrct=
30 * ctorStrct=
31 * clss = CellLayoutT
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * - TStruct
37 * extend =
38 * implements:
39 * prefixes:
40 * - gtk_cell_layout_
41 * - gtk_
42 * omit structs:
43 * omit prefixes:
44 * omit code:
45 * imports:
46 * - glib.Str
47 * - gtk.CellRenderer
48 * - glib.Str
49 * structWrap:
50 * - GtkCellRenderer* -> CellRenderer
51 * module aliases:
52 * local aliases:
55 module gtk.CellLayoutT;
57 version(noAssert)
59 version(Tango)
61 import tango.io.Stdout; // use the tango loging?
65 private import gtkc.gtktypes;
67 private import gtkc.gtk;
70 private import glib.Str;
71 private import gtk.CellRenderer;
72 private import glib.Str;
77 /**
78 * Description
79 * GtkCellLayout is an interface to be implemented by all objects which
80 * want to provide a GtkTreeViewColumn-like API for packing cells, setting
81 * attributes and data funcs.
82 * One of the notable features provided by implementations of GtkCellLayout
83 * are attributes. Attributes let you set the properties
84 * in flexible ways. They can just be set to constant values like regular
85 * properties. But they can also be mapped to a column of the underlying
86 * tree model with gtk_cell_layout_set_attributes(), which means that the value
87 * of the attribute can change from cell to cell as they are rendered by the
88 * cell renderer. Finally, it is possible to specify a function with
89 * gtk_cell_layout_set_cell_data_func() that is called to determine the value
90 * of the attribute for each cell that is rendered.
92 public template CellLayoutT(TStruct)
95 /** the main Gtk struct */
96 protected GtkCellLayout* gtkCellLayout;
99 public GtkCellLayout* getCellLayoutTStruct()
101 return cast(GtkCellLayout*)getStruct();
112 * Packs the cell into the beginning of cell_layout. If expand is FALSE,
113 * then the cell is allocated no more space than it needs. Any unused space
114 * is divided evenly between cells for which expand is TRUE.
115 * Note that reusing the same cell renderer is not supported.
116 * cell_layout:
117 * A GtkCellLayout.
118 * cell:
119 * A GtkCellRenderer.
120 * expand:
121 * TRUE if cell is to be given extra space allocated to cell_layout.
122 * Since 2.4
124 public void packStart(CellRenderer cell, int expand)
126 // void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
127 gtk_cell_layout_pack_start(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), expand);
131 * Adds the cell to the end of cell_layout. If expand is FALSE, then the
132 * cell is allocated no more space than it needs. Any unused space is
133 * divided evenly between cells for which expand is TRUE.
134 * Note that reusing the same cell renderer is not supported.
135 * cell_layout:
136 * A GtkCellLayout.
137 * cell:
138 * A GtkCellRenderer.
139 * expand:
140 * TRUE if cell is to be given extra space allocated to cell_layout.
141 * Since 2.4
143 public void packEnd(CellRenderer cell, int expand)
145 // void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
146 gtk_cell_layout_pack_end(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), expand);
150 * Returns the cell renderers which have been added to cell_layout.
151 * cell_layout:
152 * a GtkCellLayout
153 * Returns:
154 * a list of cell renderers. The list, but not the
155 * renderers has been newly allocated and should be freed with
156 * g_list_free() when no longer needed.
157 * Since 2.12
159 public GList* getCells()
161 // GList* gtk_cell_layout_get_cells (GtkCellLayout *cell_layout);
162 return gtk_cell_layout_get_cells(getCellLayoutTStruct());
166 * Re-inserts cell at position. Note that cell has already to be packed
167 * into cell_layout for this to function properly.
168 * cell_layout:
169 * A GtkCellLayout.
170 * cell:
171 * A GtkCellRenderer to reorder.
172 * position:
173 * New position to insert cell at.
174 * Since 2.4
176 public void reorder(CellRenderer cell, int position)
178 // void gtk_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position);
179 gtk_cell_layout_reorder(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), position);
183 * Unsets all the mappings on all renderers on cell_layout and
184 * removes all renderers from cell_layout.
185 * cell_layout:
186 * A GtkCellLayout.
187 * Since 2.4
189 public void clear()
191 // void gtk_cell_layout_clear (GtkCellLayout *cell_layout);
192 gtk_cell_layout_clear(getCellLayoutTStruct());
196 * Sets the attributes in list as the attributes of cell_layout. The
197 * attributes should be in attribute/column order, as in
198 * gtk_cell_layout_add_attribute(). All existing attributes are removed, and
199 * replaced with the new attributes.
200 * cell_layout:
201 * A GtkCellLayout.
202 * cell:
203 * A GtkCellRenderer.
204 * ...:
205 * A NULL-terminated list of attributes.
206 * Since 2.4
208 public void setAttributes(CellRenderer cell, ... )
210 // void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell, ...);
211 gtk_cell_layout_set_attributes(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct());
215 * Adds an attribute mapping to the list in cell_layout. The column is the
216 * column of the model to get a value from, and the attribute is the
217 * parameter on cell to be set from the value. So for example if column 2
218 * of the model contains strings, you could have the "text" attribute of a
219 * GtkCellRendererText get its values from column 2.
220 * cell_layout:
221 * A GtkCellLayout.
222 * cell:
223 * A GtkCellRenderer.
224 * attribute:
225 * An attribute on the renderer.
226 * column:
227 * The column position on the model to get the attribute from.
228 * Since 2.4
230 public void addAttribute(CellRenderer cell, char[] attribute, int column)
232 // void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout, GtkCellRenderer *cell, const gchar *attribute, gint column);
233 gtk_cell_layout_add_attribute(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), Str.toStringz(attribute), column);
237 * Sets the GtkCellLayoutDataFunc to use for cell_layout. This function
238 * is used instead of the standard attributes mapping for setting the
239 * column value, and should set the value of cell_layout's cell renderer(s)
240 * as appropriate. func may be NULL to remove and older one.
241 * cell_layout:
242 * A GtkCellLayout.
243 * cell:
244 * A GtkCellRenderer.
245 * func:
246 * The GtkCellLayoutDataFunc to use.
247 * func_data:
248 * The user data for func.
249 * destroy:
250 * The destroy notification for func_data.
251 * Since 2.4
253 public void setCellDataFunc(CellRenderer cell, GtkCellLayoutDataFunc func, void* funcData, GDestroyNotify destroy)
255 // void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkCellLayoutDataFunc func, gpointer func_data, GDestroyNotify destroy);
256 gtk_cell_layout_set_cell_data_func(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), func, funcData, destroy);
260 * Clears all existing attributes previously set with
261 * gtk_cell_layout_set_attributes().
262 * cell_layout:
263 * A GtkCellLayout.
264 * cell:
265 * A GtkCellRenderer to clear the attribute mapping on.
266 * Since 2.4
268 public void clearAttributes(CellRenderer cell)
270 // void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell);
271 gtk_cell_layout_clear_attributes(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct());