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 private import gdk.Screen;
65 
66 
67 private import gtk.Widget;
68 
69 /**
70  * The GtkInvisible widget is used internally in GTK+, and is probably not
71  * very useful for application developers.
72  *
73  * It is used for reliable pointer grabs and selection handling in the code
74  * for drag-and-drop.
75  */
76 public class Invisible : Widget
77 {
78 	
79 	/** the main Gtk struct */
80 	protected GtkInvisible* gtkInvisible;
81 	
82 	
83 	/** Get the main Gtk struct */
84 	public GtkInvisible* getInvisibleStruct()
85 	{
86 		return gtkInvisible;
87 	}
88 	
89 	
90 	/** the main Gtk struct as a void* */
91 	protected override void* getStruct()
92 	{
93 		return cast(void*)gtkInvisible;
94 	}
95 	
96 	/**
97 	 * Sets our main struct and passes it to the parent class
98 	 */
99 	public this (GtkInvisible* gtkInvisible)
100 	{
101 		super(cast(GtkWidget*)gtkInvisible);
102 		this.gtkInvisible = gtkInvisible;
103 	}
104 	
105 	protected override void setStruct(GObject* obj)
106 	{
107 		super.setStruct(obj);
108 		gtkInvisible = cast(GtkInvisible*)obj;
109 	}
110 	
111 	/**
112 	 */
113 	
114 	/**
115 	 * Creates a new GtkInvisible.
116 	 * Throws: ConstructionException GTK+ fails to create the object.
117 	 */
118 	public this ()
119 	{
120 		// GtkWidget * gtk_invisible_new (void);
121 		auto p = gtk_invisible_new();
122 		if(p is null)
123 		{
124 			throw new ConstructionException("null returned by gtk_invisible_new()");
125 		}
126 		this(cast(GtkInvisible*) p);
127 	}
128 	
129 	/**
130 	 * Creates a new GtkInvisible object for a specified screen
131 	 * Since 2.2
132 	 * Params:
133 	 * screen = a GdkScreen which identifies on which
134 	 * the new GtkInvisible will be created.
135 	 * Throws: ConstructionException GTK+ fails to create the object.
136 	 */
137 	public this (Screen screen)
138 	{
139 		// GtkWidget * gtk_invisible_new_for_screen (GdkScreen *screen);
140 		auto p = gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct());
141 		if(p is null)
142 		{
143 			throw new ConstructionException("null returned by gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct())");
144 		}
145 		this(cast(GtkInvisible*) p);
146 	}
147 	
148 	/**
149 	 * Sets the GdkScreen where the GtkInvisible object will be displayed.
150 	 * Since 2.2
151 	 * Params:
152 	 * screen = a GdkScreen.
153 	 */
154 	public void setScreen(Screen screen)
155 	{
156 		// void gtk_invisible_set_screen (GtkInvisible *invisible,  GdkScreen *screen);
157 		gtk_invisible_set_screen(gtkInvisible, (screen is null) ? null : screen.getScreenStruct());
158 	}
159 	
160 	/**
161 	 * Returns the GdkScreen object associated with invisible
162 	 * Since 2.2
163 	 * Returns: the associated GdkScreen. [transfer none]
164 	 */
165 	public override Screen getScreen()
166 	{
167 		// GdkScreen * gtk_invisible_get_screen (GtkInvisible *invisible);
168 		auto p = gtk_invisible_get_screen(gtkInvisible);
169 		
170 		if(p is null)
171 		{
172 			return null;
173 		}
174 		
175 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
176 	}
177 }