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 
63 private import gtk.Widget;
64 
65 
66 
67 private import atk.ObjectAtk;
68 
69 /**
70  * The GtkAccessible class is the base class for accessible
71  * implementations for GtkWidget subclasses. It is a thin
72  * wrapper around AtkObject, which adds facilities for associating
73  * a widget with its accessible object.
74  *
75  * An accessible implementation for a third-party widget should
76  * derive from GtkAccessible and implement the suitable interfaces
77  * from ATK, such as AtkText or AtkSelection. To establish
78  * the connection between the widget class and its corresponding
79  * acccessible implementation, override the get_accessible vfunc
80  * in GtkWidgetClass.
81  */
82 public class Accessible : ObjectAtk
83 {
84 	
85 	/** the main Gtk struct */
86 	protected GtkAccessible* gtkAccessible;
87 	
88 	
89 	public GtkAccessible* getAccessibleStruct()
90 	{
91 		return gtkAccessible;
92 	}
93 	
94 	
95 	/** the main Gtk struct as a void* */
96 	protected override void* getStruct()
97 	{
98 		return cast(void*)gtkAccessible;
99 	}
100 	
101 	/**
102 	 * Sets our main struct and passes it to the parent class
103 	 */
104 	public this (GtkAccessible* gtkAccessible)
105 	{
106 		super(cast(AtkObject*)gtkAccessible);
107 		this.gtkAccessible = gtkAccessible;
108 	}
109 	
110 	protected override void setStruct(GObject* obj)
111 	{
112 		super.setStruct(obj);
113 		gtkAccessible = cast(GtkAccessible*)obj;
114 	}
115 	
116 	/**
117 	 */
118 	
119 	/**
120 	 * Warning
121 	 * 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.
122 	 * This function specifies the callback function to be called
123 	 * when the widget corresponding to a GtkAccessible is destroyed.
124 	 */
125 	public void connectWidgetDestroyed()
126 	{
127 		// void gtk_accessible_connect_widget_destroyed  (GtkAccessible *accessible);
128 		gtk_accessible_connect_widget_destroyed(gtkAccessible);
129 	}
130 	
131 	/**
132 	 * Gets the GtkWidget corresponding to the GtkAccessible.
133 	 * The returned widget does not have a reference added, so
134 	 * you do not need to unref it.
135 	 * Since 2.22
136 	 * Returns: pointer to the GtkWidget corresponding to the GtkAccessible, or NULL. [transfer none]
137 	 */
138 	public Widget getWidget()
139 	{
140 		// GtkWidget * gtk_accessible_get_widget (GtkAccessible *accessible);
141 		auto p = gtk_accessible_get_widget(gtkAccessible);
142 		
143 		if(p is null)
144 		{
145 			return null;
146 		}
147 		
148 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
149 	}
150 	
151 	/**
152 	 * Sets the GtkWidget corresponding to the GtkAccessible.
153 	 * Note
154 	 * accessible will not hold a reference to widget.
155 	 * It is the caller's responsibility to ensure that when widget
156 	 * is destroyed, the widget is unset by calling this function
157 	 * again with widget set to NULL.
158 	 * Since 2.22
159 	 * Params:
160 	 * widget = a GtkWidget or NULL to unset. [allow-none]
161 	 */
162 	public void setWidget(Widget widget)
163 	{
164 		// void gtk_accessible_set_widget (GtkAccessible *accessible,  GtkWidget *widget);
165 		gtk_accessible_set_widget(gtkAccessible, (widget is null) ? null : widget.getWidgetStruct());
166 	}
167 }