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 * Creates a new #AtkPlug instance. 81 * 82 * Returns: the newly created #AtkPlug 83 * 84 * Since: 1.30 85 * 86 * Throws: ConstructionException GTK+ fails to create the object. 87 */ 88 public this() 89 { 90 auto __p = atk_plug_new(); 91 92 if(__p is null) 93 { 94 throw new ConstructionException("null returned by new"); 95 } 96 97 this(cast(AtkPlug*) __p, true); 98 } 99 100 /** 101 * Gets the unique ID of an #AtkPlug object, which can be used to 102 * embed inside of an #AtkSocket using atk_socket_embed(). 103 * 104 * Internally, this calls a class function that should be registered 105 * by the IPC layer (usually at-spi2-atk). The implementor of an 106 * #AtkPlug object should call this function (after atk-bridge is 107 * loaded) and pass the value to the process implementing the 108 * #AtkSocket, so it could embed the plug. 109 * 110 * Returns: the unique ID for the plug 111 * 112 * Since: 1.30 113 */ 114 public string getId() 115 { 116 auto retStr = atk_plug_get_id(atkPlug); 117 118 scope(exit) Str.freeString(retStr); 119 return Str.toString(retStr); 120 } 121 }