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