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 module gtk.CellAreaClass; 26 27 private import glib.Str; 28 private import gobject.ObjectG; 29 private import gobject.ParamSpec; 30 private import gtk.c.functions; 31 public import gtk.c.types; 32 public import gtkc.gtktypes; 33 34 35 /** */ 36 public class CellAreaClass 37 { 38 /** the main Gtk struct */ 39 protected GtkCellAreaClass* gtkCellAreaClass; 40 protected bool ownedRef; 41 42 /** Get the main Gtk struct */ 43 public GtkCellAreaClass* getCellAreaClassStruct(bool transferOwnership = false) 44 { 45 if (transferOwnership) 46 ownedRef = false; 47 return gtkCellAreaClass; 48 } 49 50 /** the main Gtk struct as a void* */ 51 protected void* getStruct() 52 { 53 return cast(void*)gtkCellAreaClass; 54 } 55 56 /** 57 * Sets our main struct and passes it to the parent class. 58 */ 59 public this (GtkCellAreaClass* gtkCellAreaClass, bool ownedRef = false) 60 { 61 this.gtkCellAreaClass = gtkCellAreaClass; 62 this.ownedRef = ownedRef; 63 } 64 65 66 /** 67 * Finds a cell property of a cell area class by name. 68 * 69 * Params: 70 * propertyName = the name of the child property to find 71 * 72 * Returns: the #GParamSpec of the child property 73 * or %NULL if @aclass has no child property with that name. 74 * 75 * Since: 3.0 76 */ 77 public ParamSpec findCellProperty(string propertyName) 78 { 79 auto p = gtk_cell_area_class_find_cell_property(gtkCellAreaClass, Str.toStringz(propertyName)); 80 81 if(p is null) 82 { 83 return null; 84 } 85 86 return ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p); 87 } 88 89 /** 90 * Installs a cell property on a cell area class. 91 * 92 * Params: 93 * propertyId = the id for the property 94 * pspec = the #GParamSpec for the property 95 * 96 * Since: 3.0 97 */ 98 public void installCellProperty(uint propertyId, ParamSpec pspec) 99 { 100 gtk_cell_area_class_install_cell_property(gtkCellAreaClass, propertyId, (pspec is null) ? null : pspec.getParamSpecStruct()); 101 } 102 103 /** 104 * Returns all cell properties of a cell area class. 105 * 106 * Returns: a newly 107 * allocated %NULL-terminated array of #GParamSpec*. The array 108 * must be freed with g_free(). 109 * 110 * Since: 3.0 111 */ 112 public ParamSpec[] listCellProperties() 113 { 114 uint nProperties; 115 116 auto p = gtk_cell_area_class_list_cell_properties(gtkCellAreaClass, &nProperties); 117 118 if(p is null) 119 { 120 return null; 121 } 122 123 ParamSpec[] arr = new ParamSpec[nProperties]; 124 for(int i = 0; i < nProperties; i++) 125 { 126 arr[i] = ObjectG.getDObject!(ParamSpec)(cast(GParamSpec*) p[i]); 127 } 128 129 return arr; 130 } 131 }