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 = GDBusObjectProxy.html 27 * outPack = gio 28 * outFile = DBusObjectProxy 29 * strct = GDBusObjectProxy 30 * realStrct= 31 * ctorStrct= 32 * clss = DBusObjectProxy 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - DBusObjectIF 40 * prefixes: 41 * - g_dbus_object_proxy_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gio.DBusConnection 49 * - gio.DBusObjectT 50 * - gio.DBusObjectIF 51 * structWrap: 52 * - GDBusConnection* -> DBusConnection 53 * module aliases: 54 * local aliases: 55 * overrides: 56 */ 57 58 module gio.DBusObjectProxy; 59 60 public import gtkc.giotypes; 61 62 private import gtkc.gio; 63 private import glib.ConstructionException; 64 private import gobject.ObjectG; 65 66 67 private import glib.Str; 68 private import gio.DBusConnection; 69 private import gio.DBusObjectT; 70 private import gio.DBusObjectIF; 71 72 73 74 private import gobject.ObjectG; 75 76 /** 77 * A GDBusObjectProxy is an object used to represent a remote object 78 * with one or more D-Bus interfaces. Normally, you don't instantiate 79 * a GDBusObjectProxy yourself - typically GDBusObjectManagerClient 80 * is used to obtain it. 81 */ 82 public class DBusObjectProxy : ObjectG, DBusObjectIF 83 { 84 85 /** the main Gtk struct */ 86 protected GDBusObjectProxy* gDBusObjectProxy; 87 88 89 public GDBusObjectProxy* getDBusObjectProxyStruct() 90 { 91 return gDBusObjectProxy; 92 } 93 94 95 /** the main Gtk struct as a void* */ 96 protected override void* getStruct() 97 { 98 return cast(void*)gDBusObjectProxy; 99 } 100 101 /** 102 * Sets our main struct and passes it to the parent class 103 */ 104 public this (GDBusObjectProxy* gDBusObjectProxy) 105 { 106 super(cast(GObject*)gDBusObjectProxy); 107 this.gDBusObjectProxy = gDBusObjectProxy; 108 } 109 110 protected override void setStruct(GObject* obj) 111 { 112 super.setStruct(obj); 113 gDBusObjectProxy = cast(GDBusObjectProxy*)obj; 114 } 115 116 // add the DBusObject capabilities 117 mixin DBusObjectT!(GDBusObjectProxy); 118 119 /** 120 */ 121 122 /** 123 * Creates a new GDBusObjectProxy for the given connection and 124 * object path. 125 * Since 2.30 126 * Params: 127 * connection = a GDBusConnection 128 * objectPath = the object path 129 * Throws: ConstructionException GTK+ fails to create the object. 130 */ 131 public this (DBusConnection connection, string objectPath) 132 { 133 // GDBusObjectProxy * g_dbus_object_proxy_new (GDBusConnection *connection, const gchar *object_path); 134 auto p = g_dbus_object_proxy_new((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(objectPath)); 135 if(p is null) 136 { 137 throw new ConstructionException("null returned by g_dbus_object_proxy_new((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(objectPath))"); 138 } 139 this(cast(GDBusObjectProxy*) p); 140 } 141 142 /** 143 * Gets the connection that proxy is for. 144 * Since 2.30 145 * Returns: A GDBusConnection. Do not free, the object is owned by proxy. [transfer none] 146 */ 147 public DBusConnection getConnection() 148 { 149 // GDBusConnection * g_dbus_object_proxy_get_connection (GDBusObjectProxy *proxy); 150 auto p = g_dbus_object_proxy_get_connection(gDBusObjectProxy); 151 152 if(p is null) 153 { 154 return null; 155 } 156 157 return ObjectG.getDObject!(DBusConnection)(cast(GDBusConnection*) p); 158 } 159 }