1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = GtkCellLayout.html 27 * outPack = gtk 28 * outFile = CellLayoutIF 29 * strct = GtkCellLayout 30 * realStrct= 31 * ctorStrct= 32 * clss = CellLayoutT 33 * interf = CellLayoutIF 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_cell_layout_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ListG 48 * - gtk.CellArea 49 * - gtk.CellRenderer 50 * structWrap: 51 * - GList* -> ListG 52 * - GtkCellArea* -> CellArea 53 * - GtkCellRenderer* -> CellRenderer 54 * module aliases: 55 * local aliases: 56 * overrides: 57 */ 58 59 module gtk.CellLayoutIF; 60 61 public import gtkc.gtktypes; 62 63 private import gtkc.gtk; 64 private import glib.ConstructionException; 65 private import gobject.ObjectG; 66 67 68 private import glib.Str; 69 private import glib.ListG; 70 private import gtk.CellArea; 71 private import gtk.CellRenderer; 72 73 74 75 76 /** 77 * GtkCellLayout is an interface to be implemented by all objects which 78 * want to provide a GtkTreeViewColumn-like API for packing cells, setting 79 * attributes and data funcs. 80 * 81 * One of the notable features provided by implementations of GtkCellLayout 82 * are attributes. Attributes let you set the properties 83 * in flexible ways. They can just be set to constant values like regular 84 * properties. But they can also be mapped to a column of the underlying 85 * tree model with gtk_cell_layout_set_attributes(), which means that the value 86 * of the attribute can change from cell to cell as they are rendered by the 87 * cell renderer. Finally, it is possible to specify a function with 88 * gtk_cell_layout_set_cell_data_func() that is called to determine the value 89 * of the attribute for each cell that is rendered. 90 * 91 * GtkCellLayouts as GtkBuildable 92 * 93 * Implementations of GtkCellLayout which also implement the GtkBuildable 94 * interface (GtkCellView, GtkIconView, GtkComboBox, 95 * GtkEntryCompletion, GtkTreeViewColumn) accept GtkCellRenderer objects 96 * as <child> elements in UI definitions. They support a custom 97 * <attributes> element for their children, which can contain 98 * multiple <attribute> elements. Each <attribute> element has 99 * a name attribute which specifies a property of the cell renderer; the 100 * content of the element is the attribute value. 101 * 102 * $(DDOC_COMMENT example) 103 * 104 * Furthermore for implementations of GtkCellLayout that use a GtkCellArea 105 * to lay out cells (all GtkCellLayouts in GTK+ use a GtkCellArea) 106 * cell properties can also be defined 107 * in the format by specifying the custom <cell-packing> attribute which 108 * can contain multiple <property> elements defined in the normal way. 109 * 110 * $(DDOC_COMMENT example) 111 * 112 * Subclassing GtkCellLayout implementations 113 * 114 * When subclassing a widget that implements GtkCellLayout like 115 * GtkIconView or GtkComboBox, there are some considerations related 116 * to the fact that these widgets internally use a GtkCellArea. 117 * The cell area is exposed as a construct-only property by these 118 * widgets. This means that it is possible to e.g. do 119 * 120 * $(DDOC_COMMENT example) 121 * 122 * to use a custom cell area with a combo box. But construct properties 123 * are only initialized after instance init() 124 * functions have run, which means that using functions which rely on 125 * the existence of the cell area in your subclass' init() function will 126 * cause the default cell area to be instantiated. In this case, a provided 127 * construct property value will be ignored (with a warning, to alert 128 * you to the problem). 129 * 130 * $(DDOC_COMMENT example) 131 * 132 * If supporting alternative cell areas with your derived widget is 133 * not important, then this does not have to concern you. If you want 134 * to support alternative cell areas, you can do so by moving the 135 * problematic calls out of init() and into a constructor() 136 * for your class. 137 */ 138 public interface CellLayoutIF 139 { 140 141 142 public GtkCellLayout* getCellLayoutTStruct(); 143 144 /** the main Gtk struct as a void* */ 145 protected void* getStruct(); 146 147 148 /** 149 */ 150 151 /** 152 * Packs the cell into the beginning of cell_layout. If expand is FALSE, 153 * then the cell is allocated no more space than it needs. Any unused space 154 * is divided evenly between cells for which expand is TRUE. 155 * Note that reusing the same cell renderer is not supported. 156 * Since 2.4 157 * Params: 158 * cell = a GtkCellRenderer 159 * expand = TRUE if cell is to be given extra space allocated to cell_layout 160 */ 161 public void packStart(CellRenderer cell, int expand); 162 163 /** 164 * Adds the cell to the end of cell_layout. If expand is FALSE, then the 165 * cell is allocated no more space than it needs. Any unused space is 166 * divided evenly between cells for which expand is TRUE. 167 * Note that reusing the same cell renderer is not supported. 168 * Since 2.4 169 * Params: 170 * cell = a GtkCellRenderer 171 * expand = TRUE if cell is to be given extra space allocated to cell_layout 172 */ 173 public void packEnd(CellRenderer cell, int expand); 174 175 /** 176 * Returns the underlying GtkCellArea which might be cell_layout 177 * if called on a GtkCellArea or might be NULL if no GtkCellArea 178 * is used by cell_layout. 179 * Returns: the cell area used by cell_layout. [transfer none] Since 3.0 180 */ 181 public CellArea getArea(); 182 183 /** 184 * Returns the cell renderers which have been added to cell_layout. 185 * Since 2.12 186 * Returns: a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed. [element-type GtkCellRenderer][transfer container] 187 */ 188 public ListG getCells(); 189 190 /** 191 * Re-inserts cell at position. 192 * Note that cell has already to be packed into cell_layout 193 * for this to function properly. 194 * Since 2.4 195 * Params: 196 * cell = a GtkCellRenderer to reorder 197 * position = new position to insert cell at 198 */ 199 public void reorder(CellRenderer cell, int position); 200 201 /** 202 * Unsets all the mappings on all renderers on cell_layout and 203 * removes all renderers from cell_layout. 204 * Since 2.4 205 */ 206 public void clear(); 207 208 /** 209 * Adds an attribute mapping to the list in cell_layout. 210 * The column is the column of the model to get a value from, and the 211 * attribute is the parameter on cell to be set from the value. So for 212 * example if column 2 of the model contains strings, you could have the 213 * "text" attribute of a GtkCellRendererText get its values from column 2. 214 * Since 2.4 215 * Params: 216 * cell = a GtkCellRenderer 217 * attribute = an attribute on the renderer 218 * column = the column position on the model to get the attribute from 219 */ 220 public void addAttribute(CellRenderer cell, string attribute, int column); 221 222 /** 223 * Sets the GtkCellLayoutDataFunc to use for cell_layout. 224 * This function is used instead of the standard attributes mapping 225 * for setting the column value, and should set the value of cell_layout's 226 * cell renderer(s) as appropriate. 227 * func may be NULL to remove a previously set function. 228 * Since 2.4 229 * Params: 230 * cell = a GtkCellRenderer 231 * func = the GtkCellLayoutDataFunc to use, or NULL. [allow-none] 232 * funcData = user data for func 233 * destroy = destroy notify for func_data 234 */ 235 public void setCellDataFunc(CellRenderer cell, GtkCellLayoutDataFunc func, void* funcData, GDestroyNotify destroy); 236 237 /** 238 * Clears all existing attributes previously set with 239 * gtk_cell_layout_set_attributes(). 240 * Since 2.4 241 * Params: 242 * cell = a GtkCellRenderer to clear the attribute mapping on 243 */ 244 public void clearAttributes(CellRenderer cell); 245 }