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 /** 61 * Sets our main struct and passes it to the parent class. 62 */ 63 public this (AtkPlug* atkPlug, bool ownedRef = false) 64 { 65 this.atkPlug = atkPlug; 66 super(cast(AtkObject*)atkPlug, ownedRef); 67 } 68 69 // add the Component capabilities 70 mixin ComponentT!(AtkPlug); 71 72 73 /** */ 74 public static GType getType() 75 { 76 return atk_plug_get_type(); 77 } 78 79 /** */ 80 public this() 81 { 82 auto p = atk_plug_new(); 83 84 if(p is null) 85 { 86 throw new ConstructionException("null returned by new"); 87 } 88 89 this(cast(AtkPlug*) p, true); 90 } 91 92 /** 93 * Gets the unique ID of an #AtkPlug object, which can be used to 94 * embed inside of an #AtkSocket using atk_socket_embed(). 95 * 96 * Internally, this calls a class function that should be registered 97 * by the IPC layer (usually at-spi2-atk). The implementor of an 98 * #AtkPlug object should call this function (after atk-bridge is 99 * loaded) and pass the value to the process implementing the 100 * #AtkSocket, so it could embed the plug. 101 * 102 * Returns: the unique ID for the plug 103 * 104 * Since: 1.30 105 */ 106 public string getId() 107 { 108 auto retStr = atk_plug_get_id(atkPlug); 109 110 scope(exit) Str.freeString(retStr); 111 return Str.toString(retStr); 112 } 113 }