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 = GDBusActionGroup.html 27 * outPack = gio 28 * outFile = DBusActionGroup 29 * strct = GDBusActionGroup 30 * realStrct= 31 * ctorStrct= 32 * clss = DBusActionGroup 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ActionGroupIF 40 * - RemoteActionGroupIF 41 * prefixes: 42 * - g_dbus_action_group_ 43 * omit structs: 44 * omit prefixes: 45 * omit code: 46 * omit signals: 47 * imports: 48 * - glib.Str 49 * - gio.DBusConnection 50 * - gio.ActionGroupIF 51 * - gio.ActionGroupT 52 * - gio.RemoteActionGroupIF 53 * - gio.RemoteActionGroupT 54 * structWrap: 55 * - GDBusActionGroup* -> DBusActionGroup 56 * - GDBusConnection* -> DBusConnection 57 * module aliases: 58 * local aliases: 59 * overrides: 60 */ 61 62 module gio.DBusActionGroup; 63 64 public import gtkc.giotypes; 65 66 private import gtkc.gio; 67 private import glib.ConstructionException; 68 private import gobject.ObjectG; 69 70 71 private import glib.Str; 72 private import gio.DBusConnection; 73 private import gio.ActionGroupIF; 74 private import gio.ActionGroupT; 75 private import gio.RemoteActionGroupIF; 76 private import gio.RemoteActionGroupT; 77 78 79 80 private import gobject.ObjectG; 81 82 /** 83 * GDBusActionGroup is an implementation of the GActionGroup 84 * interface that can be used as a proxy for an action group 85 * that is exported over D-Bus with g_dbus_connection_export_action_group(). 86 */ 87 public class DBusActionGroup : ObjectG, ActionGroupIF, RemoteActionGroupIF 88 { 89 90 /** the main Gtk struct */ 91 protected GDBusActionGroup* gDBusActionGroup; 92 93 94 public GDBusActionGroup* getDBusActionGroupStruct() 95 { 96 return gDBusActionGroup; 97 } 98 99 100 /** the main Gtk struct as a void* */ 101 protected override void* getStruct() 102 { 103 return cast(void*)gDBusActionGroup; 104 } 105 106 /** 107 * Sets our main struct and passes it to the parent class 108 */ 109 public this (GDBusActionGroup* gDBusActionGroup) 110 { 111 super(cast(GObject*)gDBusActionGroup); 112 this.gDBusActionGroup = gDBusActionGroup; 113 } 114 115 protected override void setStruct(GObject* obj) 116 { 117 super.setStruct(obj); 118 gDBusActionGroup = cast(GDBusActionGroup*)obj; 119 } 120 121 // add the ActionGroup capabilities 122 mixin ActionGroupT!(GDBusActionGroup); 123 124 // add the RemoteActionGroup capabilities 125 mixin RemoteActionGroupT!(GDBusActionGroup); 126 127 /** 128 * See_Also: get(). 129 */ 130 this(DBusConnection connection, string busName, string objectPath) 131 { 132 auto p = g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath)); 133 134 if(p is null) 135 { 136 throw new ConstructionException("null returned by g_dbus_action_group_get"); 137 } 138 this(cast(GDBusActionGroup*) p); 139 } 140 141 /** 142 */ 143 144 /** 145 * Obtains a GDBusActionGroup for the action group which is exported at 146 * the given bus_name and object_path. 147 * The thread default main context is taken at the time of this call. 148 * All signals on the menu model (and any linked models) are reported 149 * with respect to this context. All calls on the returned menu model 150 * (and linked models) must also originate from this same context, with 151 * the thread default main context unchanged. 152 * This call is non-blocking. The returned action group may or may not 153 * already be filled in. The correct thing to do is connect the signals 154 * for the action group to monitor for changes and then to call 155 * g_action_group_list_actions() to get the initial list. 156 * Since 2.32 157 * Params: 158 * connection = A GDBusConnection 159 * busName = the bus name which exports the action group 160 * objectPath = the object path at which the action group is exported 161 * Returns: a GDBusActionGroup. [transfer full] 162 */ 163 public static DBusActionGroup get(DBusConnection connection, string busName, string objectPath) 164 { 165 // GDBusActionGroup * g_dbus_action_group_get (GDBusConnection *connection, const gchar *bus_name, const gchar *object_path); 166 auto p = g_dbus_action_group_get((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(busName), Str.toStringz(objectPath)); 167 168 if(p is null) 169 { 170 return null; 171 } 172 173 return ObjectG.getDObject!(DBusActionGroup)(cast(GDBusActionGroup*) p); 174 } 175 }