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 atk.Plug; 26 27 private import atk.ComponentIF; 28 private import atk.ComponentT; 29 private import atk.ObjectAtk; 30 private import glib.ConstructionException; 31 private import glib.Str; 32 private import gobject.ObjectG; 33 private import gtkc.atk; 34 public import gtkc.atktypes; 35 36 37 /** 38 * See #AtkSocket 39 */ 40 public class Plug : ObjectAtk, ComponentIF 41 { 42 /** the main Gtk struct */ 43 protected AtkPlug* atkPlug; 44 45 /** Get the main Gtk struct */ 46 public AtkPlug* getPlugStruct(bool transferOwnership = false) 47 { 48 if (transferOwnership) 49 ownedRef = false; 50 return atkPlug; 51 } 52 53 /** the main Gtk struct as a void* */ 54 protected override void* getStruct() 55 { 56 return cast(void*)atkPlug; 57 } 58 59 protected override void setStruct(GObject* obj) 60 { 61 atkPlug = cast(AtkPlug*)obj; 62 super.setStruct(obj); 63 } 64 65 /** 66 * Sets our main struct and passes it to the parent class. 67 */ 68 public this (AtkPlug* atkPlug, bool ownedRef = false) 69 { 70 this.atkPlug = atkPlug; 71 super(cast(AtkObject*)atkPlug, ownedRef); 72 } 73 74 // add the Component capabilities 75 mixin ComponentT!(AtkPlug); 76 77 78 /** */ 79 public static GType getType() 80 { 81 return atk_plug_get_type(); 82 } 83 84 /** */ 85 public this() 86 { 87 auto p = atk_plug_new(); 88 89 if(p is null) 90 { 91 throw new ConstructionException("null returned by new"); 92 } 93 94 this(cast(AtkPlug*) p, true); 95 } 96 97 /** 98 * Gets the unique ID of an #AtkPlug object, which can be used to 99 * embed inside of an #AtkSocket using atk_socket_embed(). 100 * 101 * Internally, this calls a class function that should be registered 102 * by the IPC layer (usually at-spi2-atk). The implementor of an 103 * #AtkPlug object should call this function (after atk-bridge is 104 * loaded) and pass the value to the process implementing the 105 * #AtkSocket, so it could embed the plug. 106 * 107 * Returns: the unique ID for the plug 108 * 109 * Since: 1.30 110 */ 111 public string getId() 112 { 113 auto retStr = atk_plug_get_id(atkPlug); 114 115 scope(exit) Str.freeString(retStr); 116 return Str.toString(retStr); 117 } 118 }