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 	/**
63 	 * Sets our main struct and passes it to the parent class.
64 	 */
65 	public this (GtkInvisible* gtkInvisible, bool ownedRef = false)
66 	{
67 		this.gtkInvisible = gtkInvisible;
68 		super(cast(GtkWidget*)gtkInvisible, ownedRef);
69 	}
70 
71 
72 	/** */
73 	public static GType getType()
74 	{
75 		return gtk_invisible_get_type();
76 	}
77 
78 	/**
79 	 * Creates a new #GtkInvisible.
80 	 *
81 	 * Returns: a new #GtkInvisible.
82 	 *
83 	 * Throws: ConstructionException GTK+ fails to create the object.
84 	 */
85 	public this()
86 	{
87 		auto p = gtk_invisible_new();
88 
89 		if(p is null)
90 		{
91 			throw new ConstructionException("null returned by new");
92 		}
93 
94 		this(cast(GtkInvisible*) p);
95 	}
96 
97 	/**
98 	 * Creates a new #GtkInvisible object for a specified screen
99 	 *
100 	 * Params:
101 	 *     screen = a #GdkScreen which identifies on which
102 	 *         the new #GtkInvisible will be created.
103 	 *
104 	 * Returns: a newly created #GtkInvisible object
105 	 *
106 	 * Since: 2.2
107 	 *
108 	 * Throws: ConstructionException GTK+ fails to create the object.
109 	 */
110 	public this(Screen screen)
111 	{
112 		auto p = gtk_invisible_new_for_screen((screen is null) ? null : screen.getScreenStruct());
113 
114 		if(p is null)
115 		{
116 			throw new ConstructionException("null returned by new_for_screen");
117 		}
118 
119 		this(cast(GtkInvisible*) p);
120 	}
121 
122 	/**
123 	 * Returns the #GdkScreen object associated with @invisible
124 	 *
125 	 * Returns: the associated #GdkScreen.
126 	 *
127 	 * Since: 2.2
128 	 */
129 	public override Screen getScreen()
130 	{
131 		auto p = gtk_invisible_get_screen(gtkInvisible);
132 
133 		if(p is null)
134 		{
135 			return null;
136 		}
137 
138 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
139 	}
140 
141 	/**
142 	 * Sets the #GdkScreen where the #GtkInvisible object will be displayed.
143 	 *
144 	 * Params:
145 	 *     screen = a #GdkScreen.
146 	 *
147 	 * Since: 2.2
148 	 */
149 	public void setScreen(Screen screen)
150 	{
151 		gtk_invisible_set_screen(gtkInvisible, (screen is null) ? null : screen.getScreenStruct());
152 	}
153 }