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