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
27 * outFile = CellLayoutT
28 * strct = GtkCellLayout
50 * - GtkCellRenderer* -> CellRenderer
55 module gtk
.CellLayoutT
;
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
;
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.
121 * TRUE if cell is to be given extra space allocated to cell_layout.
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.
140 * TRUE if cell is to be given extra space allocated to cell_layout.
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.
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.
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.
171 * A GtkCellRenderer to reorder.
173 * New position to insert cell at.
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.
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.
205 * A NULL-terminated list of attributes.
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.
225 * An attribute on the renderer.
227 * The column position on the model to get the attribute from.
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.
246 * The GtkCellLayoutDataFunc to use.
248 * The user data for func.
250 * The destroy notification for func_data.
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().
265 * A GtkCellRenderer to clear the attribute mapping on.
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());