alternative to assert
[gtkD.git] / src / gtk / CellLayoutT.d
blobcf74ab22805b5b86baf6c27b52193d2e3c0ba8cf
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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 * local aliases:
54 module gtk.CellLayoutT;
56 private import gtk.gtktypes;
58 private import lib.gtk;
60 private import glib.Str;
61 private import gtk.CellRenderer;
62 private import glib.Str;
64 /**
65 * Description
66 * GtkCellLayout is an interface to be implemented by all objects which
67 * want to provide a GtkTreeViewColumn-like API for packing cells, setting
68 * attributes and data funcs.
69 * One of the notable features provided by implementations of GtkCellLayout
70 * are attributes. Attributes let you set the properties
71 * in flexible ways. They can just be set to constant values like regular
72 * properties. But they can also be mapped to a column of the underlying
73 * tree model with gtk_cell_layout_set_attributes(), which means that the value
74 * of the attribute can change from cell to cell as they are rendered by the
75 * cell renderer. Finally, it is possible to specify a function with
76 * gtk_cell_layout_set_cell_data_func() that is called to determine the value
77 * of the attribute for each cell that is rendered.
79 public template CellLayoutT(TStruct)
82 /** the main Gtk struct */
83 protected GtkCellLayout* gtkCellLayout;
86 public GtkCellLayout* getCellLayoutTStruct()
88 return cast(GtkCellLayout*)getStruct();
92 /**
98 /**
99 * Packs the cell into the beginning of cell_layout. If expand is FALSE,
100 * then the cell is allocated no more space than it needs. Any unused space
101 * is divided evenly between cells for which expand is TRUE.
102 * Note that reusing the same cell renderer is not supported.
103 * cell_layout:
104 * A GtkCellLayout.
105 * cell:
106 * A GtkCellRenderer.
107 * expand:
108 * TRUE if cell is to be given extra space allocated to cell_layout.
109 * Since 2.4
111 public void packStart(CellRenderer cell, int expand)
113 // void gtk_cell_layout_pack_start (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
114 gtk_cell_layout_pack_start(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), expand);
118 * Adds the cell to the end of cell_layout. If expand is FALSE, then the
119 * cell is allocated no more space than it needs. Any unused space is
120 * divided evenly between cells for which expand is TRUE.
121 * Note that reusing the same cell renderer is not supported.
122 * cell_layout:
123 * A GtkCellLayout.
124 * cell:
125 * A GtkCellRenderer.
126 * expand:
127 * TRUE if cell is to be given extra space allocated to cell_layout.
128 * Since 2.4
130 public void packEnd(CellRenderer cell, int expand)
132 // void gtk_cell_layout_pack_end (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gboolean expand);
133 gtk_cell_layout_pack_end(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), expand);
137 * Re-inserts cell at position. Note that cell has already to be packed
138 * into cell_layout for this to function properly.
139 * cell_layout:
140 * A GtkCellLayout.
141 * cell:
142 * A GtkCellRenderer to reorder.
143 * position:
144 * New position to insert cell at.
145 * Since 2.4
147 public void reorder(CellRenderer cell, int position)
149 // void gtk_cell_layout_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position);
150 gtk_cell_layout_reorder(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), position);
154 * Unsets all the mappings on all renderers on cell_layout and
155 * removes all renderers from cell_layout.
156 * cell_layout:
157 * A GtkCellLayout.
158 * Since 2.4
160 public void clear()
162 // void gtk_cell_layout_clear (GtkCellLayout *cell_layout);
163 gtk_cell_layout_clear(getCellLayoutTStruct());
167 * Sets the attributes in list as the attributes of cell_layout. The
168 * attributes should be in attribute/column order, as in
169 * gtk_cell_layout_add_attribute(). All existing attributes are removed, and
170 * replaced with the new attributes.
171 * cell_layout:
172 * A GtkCellLayout.
173 * cell:
174 * A GtkCellRenderer.
175 * ...:
176 * A NULL-terminated list of attributes.
177 * Since 2.4
179 public void setAttributes(CellRenderer cell, ... )
181 // void gtk_cell_layout_set_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell, ...);
182 gtk_cell_layout_set_attributes(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct());
186 * Adds an attribute mapping to the list in cell_layout. The column is the
187 * column of the model to get a value from, and the attribute is the
188 * parameter on cell to be set from the value. So for example if column 2
189 * of the model contains strings, you could have the "text" attribute of a
190 * GtkCellRendererText get its values from column 2.
191 * cell_layout:
192 * A GtkCellLayout.
193 * cell:
194 * A GtkCellRenderer.
195 * attribute:
196 * An attribute on the renderer.
197 * column:
198 * The column position on the model to get the attribute from.
199 * Since 2.4
201 public void addAttribute(CellRenderer cell, char[] attribute, int column)
203 // void gtk_cell_layout_add_attribute (GtkCellLayout *cell_layout, GtkCellRenderer *cell, const gchar *attribute, gint column);
204 gtk_cell_layout_add_attribute(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), Str.toStringz(attribute), column);
208 * Sets the GtkCellLayoutDataFunc to use for cell_layout. This function
209 * is used instead of the standard attributes mapping for setting the
210 * column value, and should set the value of cell_layout's cell renderer(s)
211 * as appropriate. func may be NULL to remove and older one.
212 * cell_layout:
213 * A GtkCellLayout.
214 * cell:
215 * A GtkCellRenderer.
216 * func:
217 * The GtkCellLayoutDataFunc to use.
218 * func_data:
219 * The user data for func.
220 * destroy:
221 * The destroy notification for func_data.
222 * Since 2.4
224 public void setCellDataFunc(CellRenderer cell, GtkCellLayoutDataFunc func, void* funcData, GDestroyNotify destroy)
226 // void gtk_cell_layout_set_cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkCellLayoutDataFunc func, gpointer func_data, GDestroyNotify destroy);
227 gtk_cell_layout_set_cell_data_func(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct(), func, funcData, destroy);
231 * Clears all existing attributes previously set with
232 * gtk_cell_layout_set_attributes().
233 * cell_layout:
234 * A GtkCellLayout.
235 * cell:
236 * A GtkCellRenderer to clear the attribute mapping on.
237 * Since 2.4
239 public void clearAttributes(CellRenderer cell)
241 // void gtk_cell_layout_clear_attributes (GtkCellLayout *cell_layout, GtkCellRenderer *cell);
242 gtk_cell_layout_clear_attributes(getCellLayoutTStruct(), (cell is null) ? null : cell.getCellRendererStruct());