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