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 * Conversion parameters: 26 * inFile = GtkWindowGroup.html 27 * outPack = gtk 28 * outFile = WindowGroup 29 * strct = GtkWindowGroup 30 * realStrct= 31 * ctorStrct= 32 * clss = WindowGroup 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_window_group_ 41 * - gtk_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.ListG 48 * - gtk.Window 49 * - gtk.Widget 50 * structWrap: 51 * - GList* -> ListG 52 * - GtkWidget* -> Widget 53 * - GtkWindow* -> Window 54 * module aliases: 55 * local aliases: 56 * overrides: 57 */ 58 59 module gtk.WindowGroup; 60 61 public import gtkc.gtktypes; 62 63 private import gtkc.gtk; 64 private import glib.ConstructionException; 65 private import gobject.ObjectG; 66 67 68 private import glib.ListG; 69 private import gtk.Window; 70 private import gtk.Widget; 71 72 73 74 private import gobject.ObjectG; 75 76 /** 77 * Description 78 */ 79 public class WindowGroup : ObjectG 80 { 81 82 /** the main Gtk struct */ 83 protected GtkWindowGroup* gtkWindowGroup; 84 85 86 public GtkWindowGroup* getWindowGroupStruct() 87 { 88 return gtkWindowGroup; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected override void* getStruct() 94 { 95 return cast(void*)gtkWindowGroup; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GtkWindowGroup* gtkWindowGroup) 102 { 103 super(cast(GObject*)gtkWindowGroup); 104 this.gtkWindowGroup = gtkWindowGroup; 105 } 106 107 protected override void setStruct(GObject* obj) 108 { 109 super.setStruct(obj); 110 gtkWindowGroup = cast(GtkWindowGroup*)obj; 111 } 112 113 /** 114 */ 115 116 /** 117 * Creates a new GtkWindowGroup object. Grabs added with 118 * gtk_grab_add() only affect windows within the same GtkWindowGroup. 119 * Throws: ConstructionException GTK+ fails to create the object. 120 */ 121 public this () 122 { 123 // GtkWindowGroup * gtk_window_group_new (void); 124 auto p = gtk_window_group_new(); 125 if(p is null) 126 { 127 throw new ConstructionException("null returned by gtk_window_group_new()"); 128 } 129 this(cast(GtkWindowGroup*) p); 130 } 131 132 /** 133 * Adds a window to a GtkWindowGroup. 134 * Params: 135 * window = the GtkWindow to add 136 */ 137 public void addWindow(Window window) 138 { 139 // void gtk_window_group_add_window (GtkWindowGroup *window_group, GtkWindow *window); 140 gtk_window_group_add_window(gtkWindowGroup, (window is null) ? null : window.getWindowStruct()); 141 } 142 143 /** 144 * Removes a window from a GtkWindowGroup. 145 * Params: 146 * window = the GtkWindow to remove 147 */ 148 public void removeWindow(Window window) 149 { 150 // void gtk_window_group_remove_window (GtkWindowGroup *window_group, GtkWindow *window); 151 gtk_window_group_remove_window(gtkWindowGroup, (window is null) ? null : window.getWindowStruct()); 152 } 153 154 /** 155 * Returns a list of the GtkWindows that belong to window_group. 156 * Since 2.14 157 * Returns: A newly-allocated list of windows inside the group. [element-type GtkWidget][transfer container] 158 */ 159 public ListG listWindows() 160 { 161 // GList * gtk_window_group_list_windows (GtkWindowGroup *window_group); 162 auto p = gtk_window_group_list_windows(gtkWindowGroup); 163 164 if(p is null) 165 { 166 return null; 167 } 168 169 return ObjectG.getDObject!(ListG)(cast(GList*) p); 170 } 171 172 /** 173 */ 174 public Widget getCurrentGrab() 175 { 176 // GtkWidget * gtk_window_group_get_current_grab (GtkWindowGroup *window_group); 177 auto p = gtk_window_group_get_current_grab(gtkWindowGroup); 178 179 if(p is null) 180 { 181 return null; 182 } 183 184 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 185 } 186 }