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 = GtkAccessible.html 27 * outPack = gtk 28 * outFile = Accessible 29 * strct = GtkAccessible 30 * realStrct= 31 * ctorStrct= 32 * clss = Accessible 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_accessible_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.Widget 47 * structWrap: 48 * - GtkWidget* -> Widget 49 * module aliases: 50 * local aliases: 51 * overrides: 52 */ 53 54 module gtk.Accessible; 55 56 public import gtkc.gtktypes; 57 58 private import gtkc.gtk; 59 private import glib.ConstructionException; 60 private import gobject.ObjectG; 61 62 private import gtk.Widget; 63 64 65 private import atk.ObjectAtk; 66 67 /** 68 * The GtkAccessible class is the base class for accessible 69 * implementations for GtkWidget subclasses. It is a thin 70 * wrapper around AtkObject, which adds facilities for associating 71 * a widget with its accessible object. 72 * 73 * An accessible implementation for a third-party widget should 74 * derive from GtkAccessible and implement the suitable interfaces 75 * from ATK, such as AtkText or AtkSelection. To establish 76 * the connection between the widget class and its corresponding 77 * acccessible implementation, override the get_accessible vfunc 78 * in GtkWidgetClass. 79 */ 80 public class Accessible : ObjectAtk 81 { 82 83 /** the main Gtk struct */ 84 protected GtkAccessible* gtkAccessible; 85 86 87 /** Get the main Gtk struct */ 88 public GtkAccessible* getAccessibleStruct() 89 { 90 return gtkAccessible; 91 } 92 93 94 /** the main Gtk struct as a void* */ 95 protected override void* getStruct() 96 { 97 return cast(void*)gtkAccessible; 98 } 99 100 /** 101 * Sets our main struct and passes it to the parent class 102 */ 103 public this (GtkAccessible* gtkAccessible) 104 { 105 super(cast(AtkObject*)gtkAccessible); 106 this.gtkAccessible = gtkAccessible; 107 } 108 109 protected override void setStruct(GObject* obj) 110 { 111 super.setStruct(obj); 112 gtkAccessible = cast(GtkAccessible*)obj; 113 } 114 115 /** 116 */ 117 118 /** 119 * Warning 120 * gtk_accessible_connect_widget_destroyed has been deprecated since version 3.4 and should not be used in newly-written code. Use gtk_accessible_set_widget() and its vfuncs. 121 * This function specifies the callback function to be called 122 * when the widget corresponding to a GtkAccessible is destroyed. 123 */ 124 public void connectWidgetDestroyed() 125 { 126 // void gtk_accessible_connect_widget_destroyed (GtkAccessible *accessible); 127 gtk_accessible_connect_widget_destroyed(gtkAccessible); 128 } 129 130 /** 131 * Gets the GtkWidget corresponding to the GtkAccessible. 132 * The returned widget does not have a reference added, so 133 * you do not need to unref it. 134 * Since 2.22 135 * Returns: pointer to the GtkWidget corresponding to the GtkAccessible, or NULL. [transfer none] 136 */ 137 public Widget getWidget() 138 { 139 // GtkWidget * gtk_accessible_get_widget (GtkAccessible *accessible); 140 auto p = gtk_accessible_get_widget(gtkAccessible); 141 142 if(p is null) 143 { 144 return null; 145 } 146 147 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 148 } 149 150 /** 151 * Sets the GtkWidget corresponding to the GtkAccessible. 152 * Note 153 * accessible will not hold a reference to widget. 154 * It is the caller's responsibility to ensure that when widget 155 * is destroyed, the widget is unset by calling this function 156 * again with widget set to NULL. 157 * Since 2.22 158 * Params: 159 * widget = a GtkWidget or NULL to unset. [allow-none] 160 */ 161 public void setWidget(Widget widget) 162 { 163 // void gtk_accessible_set_widget (GtkAccessible *accessible, GtkWidget *widget); 164 gtk_accessible_set_widget(gtkAccessible, (widget is null) ? null : widget.getWidgetStruct()); 165 } 166 }