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.Invisible;
26 
27 private import gdk.Screen;
28 private import glib.ConstructionException;
29 private import gobject.ObjectG;
30 private import gtk.Widget;
31 private import gtkc.gtk;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * The #GtkInvisible widget is used internally in GTK+, and is probably not
37  * very useful for application developers.
38  * 
39  * It is used for reliable pointer grabs and selection handling in the code
40  * for drag-and-drop.
41  */
42 public class Invisible : Widget
43 {
44 	/** the main Gtk struct */
45 	protected GtkInvisible* gtkInvisible;
46 
47 	/** Get the main Gtk struct */
48 	public GtkInvisible* getInvisibleStruct()
49 	{
50 		return gtkInvisible;
51 	}
52 
53 	/** the main Gtk struct as a void* */
54 	protected override void* getStruct()
55 	{
56 		return cast(void*)gtkInvisible;
57 	}
58 
59 	protected override void setStruct(GObject* obj)
60 	{
61 		gtkInvisible = cast(GtkInvisible*)obj;
62 		super.setStruct(obj);
63 	}
64 
65 	/**
66 	 * Sets our main struct and passes it to the parent class.
67 	 */
68 	public this (GtkInvisible* gtkInvisible, bool ownedRef = false)
69 	{
70 		this.gtkInvisible = gtkInvisible;
71 		super(cast(GtkWidget*)gtkInvisible, ownedRef);
72 	}
73 
74 	/**
75 	 */
76 
77 	public static GType getType()
78 	{
79 		return gtk_invisible_get_type();
80 	}
81 
82 	/**
83 	 * Creates a new #GtkInvisible.
84 	 *
85 	 * Return: a new #GtkInvisible.
86 	 *
87 	 * Throws: ConstructionException GTK+ fails to create the object.
88 	 */
89 	public this()
90 	{
91 		auto p = gtk_invisible_new();
92 		
93 		if(p is null)
94 		{
95 			throw new ConstructionException("null returned by new");
96 		}
97 		
98 		this(cast(GtkInvisible*) p);
99 	}
100 
101 	/**
102 	 * Creates a new #GtkInvisible object for a specified screen
103 	 *
104 	 * Params:
105 	 *     screen = a #GdkScreen which identifies on which
106 	 *         the new #GtkInvisible will be created.
107 	 *
108 	 * Return: a newly created #GtkInvisible object
109 	 *
110 	 * Since: 2.2
111 	 *
112 	 * Throws: ConstructionException GTK+ fails to create the object.
113 	 */
114 	public this(Screen screen)
115 	{
116 		auto p = gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct());
117 		
118 		if(p is null)
119 		{
120 			throw new ConstructionException("null returned by new_for_screen");
121 		}
122 		
123 		this(cast(GtkInvisible*) p);
124 	}
125 
126 	/**
127 	 * Returns the #GdkScreen object associated with @invisible
128 	 *
129 	 * Return: the associated #GdkScreen.
130 	 *
131 	 * Since: 2.2
132 	 */
133 	public override Screen getScreen()
134 	{
135 		auto p = gtk_invisible_get_screen(gtkInvisible);
136 		
137 		if(p is null)
138 		{
139 			return null;
140 		}
141 		
142 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
143 	}
144 
145 	/**
146 	 * Sets the #GdkScreen where the #GtkInvisible object will be displayed.
147 	 *
148 	 * Params:
149 	 *     screen = a #GdkScreen.
150 	 *
151 	 * Since: 2.2
152 	 */
153 	public void setScreen(Screen screen)
154 	{
155 		gtk_invisible_set_screen(gtkInvisible, (screen is null) ? null : screen.getScreenStruct());
156 	}
157 }