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