/usr/include/d/gtkd-3/gio/DBusObjectManagerT.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gio.DBusObjectManagerT;
public import gio.DBusInterfaceIF;
public import gio.DBusObjectIF;
public import gio.c.functions;
public import gio.c.types;
public import glib.ListG;
public import glib.Str;
public import gobject.ObjectG;
public import gobject.Signals;
public import gtkc.giotypes;
public import std.algorithm;
/**
* The #GDBusObjectManager type is the base type for service- and
* client-side implementations of the standardized
* [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager)
* interface.
*
* See #GDBusObjectManagerClient for the client-side implementation
* and #GDBusObjectManagerServer for the service-side implementation.
*/
public template DBusObjectManagerT(TStruct)
{
/** Get the main Gtk struct */
public GDBusObjectManager* getDBusObjectManagerStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return cast(GDBusObjectManager*)getStruct();
}
/**
* Gets the interface proxy for @interface_name at @object_path, if
* any.
*
* Params:
* objectPath = Object path to lookup.
* interfaceName = D-Bus interface name to lookup.
*
* Returns: A #GDBusInterface instance or %NULL. Free
* with g_object_unref().
*
* Since: 2.30
*/
public DBusInterfaceIF getInterface(string objectPath, string interfaceName)
{
auto p = g_dbus_object_manager_get_interface(getDBusObjectManagerStruct(), Str.toStringz(objectPath), Str.toStringz(interfaceName));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusInterfaceIF)(cast(GDBusInterface*) p, true);
}
/**
* Gets the #GDBusObjectProxy at @object_path, if any.
*
* Params:
* objectPath = Object path to lookup.
*
* Returns: A #GDBusObject or %NULL. Free with
* g_object_unref().
*
* Since: 2.30
*/
public DBusObjectIF getObject(string objectPath)
{
auto p = g_dbus_object_manager_get_object(getDBusObjectManagerStruct(), Str.toStringz(objectPath));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusObjectIF)(cast(GDBusObject*) p, true);
}
/**
* Gets the object path that @manager is for.
*
* Returns: A string owned by @manager. Do not free.
*
* Since: 2.30
*/
public string getObjectPath()
{
return Str.toString(g_dbus_object_manager_get_object_path(getDBusObjectManagerStruct()));
}
/**
* Gets all #GDBusObject objects known to @manager.
*
* Returns: A list of
* #GDBusObject objects. The returned list should be freed with
* g_list_free() after each element has been freed with
* g_object_unref().
*
* Since: 2.30
*/
public ListG getObjects()
{
auto p = g_dbus_object_manager_get_objects(getDBusObjectManagerStruct());
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p, true);
}
protected class OnInterfaceAddedDelegateWrapper
{
void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg;
gulong handlerId;
this(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg)
{
this.dlg = dlg;
onInterfaceAddedListeners ~= this;
}
void remove(OnInterfaceAddedDelegateWrapper source)
{
foreach(index, wrapper; onInterfaceAddedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onInterfaceAddedListeners[index] = null;
onInterfaceAddedListeners = std.algorithm.remove(onInterfaceAddedListeners, index);
break;
}
}
}
}
OnInterfaceAddedDelegateWrapper[] onInterfaceAddedListeners;
/**
* Emitted when @interface is added to @object.
*
* This signal exists purely as a convenience to avoid having to
* connect signals to all objects managed by @manager.
*
* Params:
* object = The #GDBusObject on which an interface was added.
* iface = The #GDBusInterface that was added.
*
* Since: 2.30
*/
gulong addOnInterfaceAdded(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnInterfaceAddedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"interface-added",
cast(GCallback)&callBackInterfaceAdded,
cast(void*)wrapper,
cast(GClosureNotify)&callBackInterfaceAddedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackInterfaceAdded(GDBusObjectManager* dbusobjectmanagerStruct, GDBusObject* object, GDBusInterface* iface, OnInterfaceAddedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(DBusObjectIF)(object), ObjectG.getDObject!(DBusInterfaceIF)(iface), wrapper.outer);
}
extern(C) static void callBackInterfaceAddedDestroy(OnInterfaceAddedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnInterfaceRemovedDelegateWrapper
{
void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg;
gulong handlerId;
this(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg)
{
this.dlg = dlg;
onInterfaceRemovedListeners ~= this;
}
void remove(OnInterfaceRemovedDelegateWrapper source)
{
foreach(index, wrapper; onInterfaceRemovedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onInterfaceRemovedListeners[index] = null;
onInterfaceRemovedListeners = std.algorithm.remove(onInterfaceRemovedListeners, index);
break;
}
}
}
}
OnInterfaceRemovedDelegateWrapper[] onInterfaceRemovedListeners;
/**
* Emitted when @interface has been removed from @object.
*
* This signal exists purely as a convenience to avoid having to
* connect signals to all objects managed by @manager.
*
* Params:
* object = The #GDBusObject on which an interface was removed.
* iface = The #GDBusInterface that was removed.
*
* Since: 2.30
*/
gulong addOnInterfaceRemoved(void delegate(DBusObjectIF, DBusInterfaceIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnInterfaceRemovedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"interface-removed",
cast(GCallback)&callBackInterfaceRemoved,
cast(void*)wrapper,
cast(GClosureNotify)&callBackInterfaceRemovedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackInterfaceRemoved(GDBusObjectManager* dbusobjectmanagerStruct, GDBusObject* object, GDBusInterface* iface, OnInterfaceRemovedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(DBusObjectIF)(object), ObjectG.getDObject!(DBusInterfaceIF)(iface), wrapper.outer);
}
extern(C) static void callBackInterfaceRemovedDestroy(OnInterfaceRemovedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnObjectAddedDelegateWrapper
{
void delegate(DBusObjectIF, DBusObjectManagerIF) dlg;
gulong handlerId;
this(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg)
{
this.dlg = dlg;
onObjectAddedListeners ~= this;
}
void remove(OnObjectAddedDelegateWrapper source)
{
foreach(index, wrapper; onObjectAddedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onObjectAddedListeners[index] = null;
onObjectAddedListeners = std.algorithm.remove(onObjectAddedListeners, index);
break;
}
}
}
}
OnObjectAddedDelegateWrapper[] onObjectAddedListeners;
/**
* Emitted when @object is added to @manager.
*
* Params:
* object = The #GDBusObject that was added.
*
* Since: 2.30
*/
gulong addOnObjectAdded(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnObjectAddedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"object-added",
cast(GCallback)&callBackObjectAdded,
cast(void*)wrapper,
cast(GClosureNotify)&callBackObjectAddedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackObjectAdded(GDBusObjectManager* dbusobjectmanagerStruct, GDBusObject* object, OnObjectAddedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(DBusObjectIF)(object), wrapper.outer);
}
extern(C) static void callBackObjectAddedDestroy(OnObjectAddedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnObjectRemovedDelegateWrapper
{
void delegate(DBusObjectIF, DBusObjectManagerIF) dlg;
gulong handlerId;
this(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg)
{
this.dlg = dlg;
onObjectRemovedListeners ~= this;
}
void remove(OnObjectRemovedDelegateWrapper source)
{
foreach(index, wrapper; onObjectRemovedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onObjectRemovedListeners[index] = null;
onObjectRemovedListeners = std.algorithm.remove(onObjectRemovedListeners, index);
break;
}
}
}
}
OnObjectRemovedDelegateWrapper[] onObjectRemovedListeners;
/**
* Emitted when @object is removed from @manager.
*
* Params:
* object = The #GDBusObject that was removed.
*
* Since: 2.30
*/
gulong addOnObjectRemoved(void delegate(DBusObjectIF, DBusObjectManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnObjectRemovedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"object-removed",
cast(GCallback)&callBackObjectRemoved,
cast(void*)wrapper,
cast(GClosureNotify)&callBackObjectRemovedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackObjectRemoved(GDBusObjectManager* dbusobjectmanagerStruct, GDBusObject* object, OnObjectRemovedDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(DBusObjectIF)(object), wrapper.outer);
}
extern(C) static void callBackObjectRemovedDestroy(OnObjectRemovedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
}
|