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  = GtkInvisible.html
27  * outPack = gtk
28  * outFile = Invisible
29  * strct   = GtkInvisible
30  * realStrct=
31  * ctorStrct=
32  * clss    = Invisible
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_invisible_
41  * 	- gtk_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- gdk.Screen
48  * structWrap:
49  * 	- GdkScreen* -> Screen
50  * module aliases:
51  * local aliases:
52  * overrides:
53  * 	- getScreen
54  */
55 
56 module gtk.Invisible;
57 
58 public  import gtkc.gtktypes;
59 
60 private import gtkc.gtk;
61 private import glib.ConstructionException;
62 private import gobject.ObjectG;
63 
64 
65 private import gdk.Screen;
66 
67 
68 
69 private import gtk.Widget;
70 
71 /**
72  * Description
73  * The GtkInvisible widget is used internally in GTK+, and is probably not
74  * very useful for application developers.
75  * It is used for reliable pointer grabs and selection handling in the code
76  * for drag-and-drop.
77  */
78 public class Invisible : Widget
79 {
80 	
81 	/** the main Gtk struct */
82 	protected GtkInvisible* gtkInvisible;
83 	
84 	
85 	public GtkInvisible* getInvisibleStruct()
86 	{
87 		return gtkInvisible;
88 	}
89 	
90 	
91 	/** the main Gtk struct as a void* */
92 	protected override void* getStruct()
93 	{
94 		return cast(void*)gtkInvisible;
95 	}
96 	
97 	/**
98 	 * Sets our main struct and passes it to the parent class
99 	 */
100 	public this (GtkInvisible* gtkInvisible)
101 	{
102 		super(cast(GtkWidget*)gtkInvisible);
103 		this.gtkInvisible = gtkInvisible;
104 	}
105 	
106 	protected override void setStruct(GObject* obj)
107 	{
108 		super.setStruct(obj);
109 		gtkInvisible = cast(GtkInvisible*)obj;
110 	}
111 	
112 	/**
113 	 */
114 	
115 	/**
116 	 * Creates a new GtkInvisible.
117 	 * Throws: ConstructionException GTK+ fails to create the object.
118 	 */
119 	public this ()
120 	{
121 		// GtkWidget * gtk_invisible_new (void);
122 		auto p = gtk_invisible_new();
123 		if(p is null)
124 		{
125 			throw new ConstructionException("null returned by gtk_invisible_new()");
126 		}
127 		this(cast(GtkInvisible*) p);
128 	}
129 	
130 	/**
131 	 * Creates a new GtkInvisible object for a specified screen
132 	 * Since 2.2
133 	 * Params:
134 	 * screen = a GdkScreen which identifies on which
135 	 * the new GtkInvisible will be created.
136 	 * Throws: ConstructionException GTK+ fails to create the object.
137 	 */
138 	public this (Screen screen)
139 	{
140 		// GtkWidget * gtk_invisible_new_for_screen (GdkScreen *screen);
141 		auto p = gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct());
142 		if(p is null)
143 		{
144 			throw new ConstructionException("null returned by gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct())");
145 		}
146 		this(cast(GtkInvisible*) p);
147 	}
148 	
149 	/**
150 	 * Sets the GdkScreen where the GtkInvisible object will be displayed.
151 	 * Since 2.2
152 	 * Params:
153 	 * screen = a GdkScreen.
154 	 */
155 	public void setScreen(Screen screen)
156 	{
157 		// void gtk_invisible_set_screen (GtkInvisible *invisible,  GdkScreen *screen);
158 		gtk_invisible_set_screen(gtkInvisible, (screen is null) ? null : screen.getScreenStruct());
159 	}
160 	
161 	/**
162 	 * Returns the GdkScreen object associated with invisible
163 	 * Since 2.2
164 	 * Returns: the associated GdkScreen. [transfer none]
165 	 */
166 	public override Screen getScreen()
167 	{
168 		// GdkScreen * gtk_invisible_get_screen (GtkInvisible *invisible);
169 		auto p = gtk_invisible_get_screen(gtkInvisible);
170 		
171 		if(p is null)
172 		{
173 			return null;
174 		}
175 		
176 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
177 	}
178 }