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 = GtkCellAreaContext.html 27 * outPack = gtk 28 * outFile = CellAreaContext 29 * strct = GtkCellAreaContext 30 * realStrct= 31 * ctorStrct= 32 * clss = CellAreaContext 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_cell_renderer_accel_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.CellArea 47 * structWrap: 48 * - GtkCellArea* -> CellArea 49 * module aliases: 50 * local aliases: 51 * overrides: 52 */ 53 54 module gtk.CellAreaContext; 55 56 public import gtkc.gtktypes; 57 58 private import gtkc.gtk; 59 private import glib.ConstructionException; 60 private import gobject.ObjectG; 61 62 63 private import gtk.CellArea; 64 65 66 67 private import gobject.ObjectG; 68 69 /** 70 * The GtkCellAreaContext object is created by a given GtkCellArea 71 * implementation via its GtkCellAreaClass.create_context() virtual 72 * method and is used to store cell sizes and alignments for a series of 73 * GtkTreeModel rows that are requested and rendered in the same context. 74 * 75 * GtkCellLayout widgets can create any number of contexts in which to 76 * request and render groups of data rows. However, it's important that the 77 * same context which was used to request sizes for a given GtkTreeModel 78 * row also be used for the same row when calling other GtkCellArea APIs 79 * such as gtk_cell_area_render() and gtk_cell_area_event(). 80 */ 81 public class CellAreaContext : ObjectG 82 { 83 84 /** the main Gtk struct */ 85 protected GtkCellAreaContext* gtkCellAreaContext; 86 87 88 public GtkCellAreaContext* getCellAreaContextStruct() 89 { 90 return gtkCellAreaContext; 91 } 92 93 94 /** the main Gtk struct as a void* */ 95 protected override void* getStruct() 96 { 97 return cast(void*)gtkCellAreaContext; 98 } 99 100 /** 101 * Sets our main struct and passes it to the parent class 102 */ 103 public this (GtkCellAreaContext* gtkCellAreaContext) 104 { 105 super(cast(GObject*)gtkCellAreaContext); 106 this.gtkCellAreaContext = gtkCellAreaContext; 107 } 108 109 protected override void setStruct(GObject* obj) 110 { 111 super.setStruct(obj); 112 gtkCellAreaContext = cast(GtkCellAreaContext*)obj; 113 } 114 115 /** 116 */ 117 118 /** 119 * Fetches the GtkCellArea this context was created by. 120 * This is generally unneeded by layouting widgets; however, 121 * it is important for the context implementation itself to 122 * fetch information about the area it is being used for. 123 * For instance at GtkCellAreaContextClass.allocate() time 124 * it's important to know details about any cell spacing 125 * that the GtkCellArea is configured with in order to 126 * compute a proper allocation. 127 * Returns: the GtkCellArea this context was created by. [transfer none] Since 3.0 128 */ 129 public CellArea gtkCellAreaContextGetArea() 130 { 131 // GtkCellArea * gtk_cell_area_context_get_area (GtkCellAreaContext *context); 132 auto p = gtk_cell_area_context_get_area(gtkCellAreaContext); 133 134 if(p is null) 135 { 136 return null; 137 } 138 139 return ObjectG.getDObject!(CellArea)(cast(GtkCellArea*) p); 140 } 141 142 /** 143 * Allocates a width and/or a height for all rows which are to be 144 * rendered with context. 145 * Usually allocation is performed only horizontally or sometimes 146 * vertically since a group of rows are usually rendered side by 147 * side vertically or horizontally and share either the same width 148 * or the same height. Sometimes they are allocated in both horizontal 149 * and vertical orientations producing a homogeneous effect of the 150 * rows. This is generally the case for GtkTreeView when 151 * "fixed-height-mode" is enabled. 152 * Since 3.0 153 * Params: 154 * width = the allocated width for all GtkTreeModel rows rendered 155 * with context, or -1. 156 * height = the allocated height for all GtkTreeModel rows rendered 157 * with context, or -1. 158 */ 159 public void gtkCellAreaContextAllocate(int width, int height) 160 { 161 // void gtk_cell_area_context_allocate (GtkCellAreaContext *context, gint width, gint height); 162 gtk_cell_area_context_allocate(gtkCellAreaContext, width, height); 163 } 164 165 /** 166 * Resets any previously cached request and allocation 167 * data. 168 * When underlying GtkTreeModel data changes its 169 * important to reset the context if the content 170 * size is allowed to shrink. If the content size 171 * is only allowed to grow (this is usually an option 172 * for views rendering large data stores as a measure 173 * of optimization), then only the row that changed 174 * or was inserted needs to be (re)requested with 175 * gtk_cell_area_get_preferred_width(). 176 * When the new overall size of the context requires 177 * that the allocated size changes (or whenever this 178 * allocation changes at all), the variable row 179 * sizes need to be re-requested for every row. 180 * For instance, if the rows are displayed all with 181 * the same width from top to bottom then a change 182 * in the allocated width necessitates a recalculation 183 * of all the displayed row heights using 184 * gtk_cell_area_get_preferred_height_for_width(). 185 * Since 3.0 186 */ 187 public void gtkCellAreaContextReset() 188 { 189 // void gtk_cell_area_context_reset (GtkCellAreaContext *context); 190 gtk_cell_area_context_reset(gtkCellAreaContext); 191 } 192 193 /** 194 * Gets the accumulative preferred width for all rows which have been 195 * requested with this context. 196 * After gtk_cell_area_context_reset() is called and/or before ever 197 * requesting the size of a GtkCellArea, the returned values are 0. 198 * Params: 199 * minimumWidth = location to store the minimum width, 200 * or NULL. [out][allow-none] 201 * naturalWidth = location to store the natural width, 202 * or NULL. [out][allow-none] 203 * Since 3.0 204 */ 205 public void gtkCellAreaContextGetPreferredWidth(out int minimumWidth, out int naturalWidth) 206 { 207 // void gtk_cell_area_context_get_preferred_width (GtkCellAreaContext *context, gint *minimum_width, gint *natural_width); 208 gtk_cell_area_context_get_preferred_width(gtkCellAreaContext, &minimumWidth, &naturalWidth); 209 } 210 211 /** 212 * Gets the accumulative preferred height for all rows which have been 213 * requested with this context. 214 * After gtk_cell_area_context_reset() is called and/or before ever 215 * requesting the size of a GtkCellArea, the returned values are 0. 216 * Params: 217 * minimumHeight = location to store the minimum height, 218 * or NULL. [out][allow-none] 219 * naturalHeight = location to store the natural height, 220 * or NULL. [out][allow-none] 221 * Since 3.0 222 */ 223 public void gtkCellAreaContextGetPreferredHeight(out int minimumHeight, out int naturalHeight) 224 { 225 // void gtk_cell_area_context_get_preferred_height (GtkCellAreaContext *context, gint *minimum_height, gint *natural_height); 226 gtk_cell_area_context_get_preferred_height(gtkCellAreaContext, &minimumHeight, &naturalHeight); 227 } 228 229 /** 230 * Gets the accumulative preferred height for width for all rows 231 * which have been requested for the same said width with this context. 232 * After gtk_cell_area_context_reset() is called and/or before ever 233 * requesting the size of a GtkCellArea, the returned values are -1. 234 * Params: 235 * width = a proposed width for allocation 236 * minimumHeight = location to store the minimum height, 237 * or NULL. [out][allow-none] 238 * naturalHeight = location to store the natural height, 239 * or NULL. [out][allow-none] 240 * Since 3.0 241 */ 242 public void gtkCellAreaContextGetPreferredHeightForWidth(int width, out int minimumHeight, out int naturalHeight) 243 { 244 // void gtk_cell_area_context_get_preferred_height_for_width (GtkCellAreaContext *context, gint width, gint *minimum_height, gint *natural_height); 245 gtk_cell_area_context_get_preferred_height_for_width(gtkCellAreaContext, width, &minimumHeight, &naturalHeight); 246 } 247 248 /** 249 * Gets the accumulative preferred width for height for all rows which 250 * have been requested for the same said height with this context. 251 * After gtk_cell_area_context_reset() is called and/or before ever 252 * requesting the size of a GtkCellArea, the returned values are -1. 253 * Params: 254 * height = a proposed height for allocation 255 * minimumWidth = location to store the minimum width, 256 * or NULL. [out][allow-none] 257 * naturalWidth = location to store the natural width, 258 * or NULL. [out][allow-none] 259 * Since 3.0 260 */ 261 public void gtkCellAreaContextGetPreferredWidthForHeight(int height, out int minimumWidth, out int naturalWidth) 262 { 263 // void gtk_cell_area_context_get_preferred_width_for_height (GtkCellAreaContext *context, gint height, gint *minimum_width, gint *natural_width); 264 gtk_cell_area_context_get_preferred_width_for_height(gtkCellAreaContext, height, &minimumWidth, &naturalWidth); 265 } 266 267 /** 268 * Fetches the current allocation size for context. 269 * If the context was not allocated in width or height, or if the 270 * context was recently reset with gtk_cell_area_context_reset(), 271 * the returned value will be -1. 272 * Params: 273 * width = location to store the allocated width, or NULL. [out][allow-none] 274 * height = location to store the allocated height, or NULL. [out][allow-none] 275 * Since 3.0 276 */ 277 public void gtkCellAreaContextGetAllocation(out int width, out int height) 278 { 279 // void gtk_cell_area_context_get_allocation (GtkCellAreaContext *context, gint *width, gint *height); 280 gtk_cell_area_context_get_allocation(gtkCellAreaContext, &width, &height); 281 } 282 283 /** 284 * Causes the minimum and/or natural width to grow if the new 285 * proposed sizes exceed the current minimum and natural width. 286 * This is used by GtkCellAreaContext implementations during 287 * the request process over a series of GtkTreeModel rows to 288 * progressively push the requested width over a series of 289 * gtk_cell_area_get_preferred_width() requests. 290 * Params: 291 * minimumWidth = the proposed new minimum width for context 292 * naturalWidth = the proposed new natural width for context 293 * Since 3.0 294 */ 295 public void gtkCellAreaContextPushPreferredWidth(int minimumWidth, int naturalWidth) 296 { 297 // void gtk_cell_area_context_push_preferred_width (GtkCellAreaContext *context, gint minimum_width, gint natural_width); 298 gtk_cell_area_context_push_preferred_width(gtkCellAreaContext, minimumWidth, naturalWidth); 299 } 300 301 /** 302 * Causes the minimum and/or natural height to grow if the new 303 * proposed sizes exceed the current minimum and natural height. 304 * This is used by GtkCellAreaContext implementations during 305 * the request process over a series of GtkTreeModel rows to 306 * progressively push the requested height over a series of 307 * gtk_cell_area_get_preferred_height() requests. 308 * Params: 309 * minimumHeight = the proposed new minimum height for context 310 * naturalHeight = the proposed new natural height for context 311 * Since 3.0 312 */ 313 public void gtkCellAreaContextPushPreferredHeight(int minimumHeight, int naturalHeight) 314 { 315 // void gtk_cell_area_context_push_preferred_height (GtkCellAreaContext *context, gint minimum_height, gint natural_height); 316 gtk_cell_area_context_push_preferred_height(gtkCellAreaContext, minimumHeight, naturalHeight); 317 } 318 }