/usr/include/d/gtkd-3/gio/DBusNames.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 | /*
* 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.DBusNames;
private import gio.DBusConnection;
private import gio.c.functions;
public import gio.c.types;
private import glib.Str;
private import gobject.Closure;
public import gtkc.giotypes;
/** */
public struct DBusNames
{
/**
* Starts acquiring @name on the bus specified by @bus_type and calls
* @name_acquired_handler and @name_lost_handler when the name is
* acquired respectively lost. Callbacks will be invoked in the
* [thread-default main context][g-main-context-push-thread-default]
* of the thread you are calling this function from.
*
* You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
* callbacks will be invoked after calling this function - there are three
* possible cases:
*
* - @name_lost_handler with a %NULL connection (if a connection to the bus
* can't be made).
*
* - @bus_acquired_handler then @name_lost_handler (if the name can't be
* obtained)
*
* - @bus_acquired_handler then @name_acquired_handler (if the name was
* obtained).
*
* When you are done owning the name, just call g_bus_unown_name()
* with the owner id this function returns.
*
* If the name is acquired or lost (for example another application
* could acquire the name if you allow replacement or the application
* currently owning the name exits), the handlers are also invoked.
* If the #GDBusConnection that is used for attempting to own the name
* closes, then @name_lost_handler is invoked since it is no longer
* possible for other processes to access the process.
*
* You cannot use g_bus_own_name() several times for the same name (unless
* interleaved with calls to g_bus_unown_name()) - only the first call
* will work.
*
* Another guarantee is that invocations of @name_acquired_handler
* and @name_lost_handler are guaranteed to alternate; that
* is, if @name_acquired_handler is invoked then you are
* guaranteed that the next time one of the handlers is invoked, it
* will be @name_lost_handler. The reverse is also true.
*
* If you plan on exporting objects (using e.g.
* g_dbus_connection_register_object()), note that it is generally too late
* to export the objects in @name_acquired_handler. Instead, you can do this
* in @bus_acquired_handler since you are guaranteed that this will run
* before @name is requested from the bus.
*
* This behavior makes it very simple to write applications that wants
* to [own names][gdbus-owning-names] and export objects.
* Simply register objects to be exported in @bus_acquired_handler and
* unregister the objects (if any) in @name_lost_handler.
*
* Params:
* busType = the type of bus to own a name on
* name = the well-known name to own
* flags = a set of flags from the #GBusNameOwnerFlags enumeration
* busAcquiredHandler = handler to invoke when connected to the bus of type @bus_type or %NULL
* nameAcquiredHandler = handler to invoke when @name is acquired or %NULL
* nameLostHandler = handler to invoke when @name is lost or %NULL
* userData = user data to pass to handlers
* userDataFreeFunc = function for freeing @user_data or %NULL
*
* Returns: an identifier (never 0) that an be used with
* g_bus_unown_name() to stop owning the name.
*
* Since: 2.26
*/
public static uint ownName(GBusType busType, string name, GBusNameOwnerFlags flags, GBusAcquiredCallback busAcquiredHandler, GBusNameAcquiredCallback nameAcquiredHandler, GBusNameLostCallback nameLostHandler, void* userData, GDestroyNotify userDataFreeFunc)
{
return g_bus_own_name(busType, Str.toStringz(name), flags, busAcquiredHandler, nameAcquiredHandler, nameLostHandler, userData, userDataFreeFunc);
}
/**
* Like g_bus_own_name() but takes a #GDBusConnection instead of a
* #GBusType.
*
* Params:
* connection = a #GDBusConnection
* name = the well-known name to own
* flags = a set of flags from the #GBusNameOwnerFlags enumeration
* nameAcquiredHandler = handler to invoke when @name is acquired or %NULL
* nameLostHandler = handler to invoke when @name is lost or %NULL
* userData = user data to pass to handlers
* userDataFreeFunc = function for freeing @user_data or %NULL
*
* Returns: an identifier (never 0) that an be used with
* g_bus_unown_name() to stop owning the name
*
* Since: 2.26
*/
public static uint ownNameOnConnection(DBusConnection connection, string name, GBusNameOwnerFlags flags, GBusNameAcquiredCallback nameAcquiredHandler, GBusNameLostCallback nameLostHandler, void* userData, GDestroyNotify userDataFreeFunc)
{
return g_bus_own_name_on_connection((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(name), flags, nameAcquiredHandler, nameLostHandler, userData, userDataFreeFunc);
}
/**
* Version of g_bus_own_name_on_connection() using closures instead of
* callbacks for easier binding in other languages.
*
* Params:
* connection = a #GDBusConnection
* name = the well-known name to own
* flags = a set of flags from the #GBusNameOwnerFlags enumeration
* nameAcquiredClosure = #GClosure to invoke when @name is
* acquired or %NULL
* nameLostClosure = #GClosure to invoke when @name is lost
* or %NULL
*
* Returns: an identifier (never 0) that an be used with
* g_bus_unown_name() to stop owning the name.
*
* Since: 2.26
*/
public static uint ownNameOnConnectionWithClosures(DBusConnection connection, string name, GBusNameOwnerFlags flags, Closure nameAcquiredClosure, Closure nameLostClosure)
{
return g_bus_own_name_on_connection_with_closures((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(name), flags, (nameAcquiredClosure is null) ? null : nameAcquiredClosure.getClosureStruct(), (nameLostClosure is null) ? null : nameLostClosure.getClosureStruct());
}
/**
* Version of g_bus_own_name() using closures instead of callbacks for
* easier binding in other languages.
*
* Params:
* busType = the type of bus to own a name on
* name = the well-known name to own
* flags = a set of flags from the #GBusNameOwnerFlags enumeration
* busAcquiredClosure = #GClosure to invoke when connected to
* the bus of type @bus_type or %NULL
* nameAcquiredClosure = #GClosure to invoke when @name is
* acquired or %NULL
* nameLostClosure = #GClosure to invoke when @name is lost or
* %NULL
*
* Returns: an identifier (never 0) that an be used with
* g_bus_unown_name() to stop owning the name.
*
* Since: 2.26
*/
public static uint ownNameWithClosures(GBusType busType, string name, GBusNameOwnerFlags flags, Closure busAcquiredClosure, Closure nameAcquiredClosure, Closure nameLostClosure)
{
return g_bus_own_name_with_closures(busType, Str.toStringz(name), flags, (busAcquiredClosure is null) ? null : busAcquiredClosure.getClosureStruct(), (nameAcquiredClosure is null) ? null : nameAcquiredClosure.getClosureStruct(), (nameLostClosure is null) ? null : nameLostClosure.getClosureStruct());
}
/**
* Stops owning a name.
*
* Params:
* ownerId = an identifier obtained from g_bus_own_name()
*
* Since: 2.26
*/
public static void unownName(uint ownerId)
{
g_bus_unown_name(ownerId);
}
/**
* Stops watching a name.
*
* Params:
* watcherId = An identifier obtained from g_bus_watch_name()
*
* Since: 2.26
*/
public static void unwatchName(uint watcherId)
{
g_bus_unwatch_name(watcherId);
}
/**
* Starts watching @name on the bus specified by @bus_type and calls
* @name_appeared_handler and @name_vanished_handler when the name is
* known to have a owner respectively known to lose its
* owner. Callbacks will be invoked in the
* [thread-default main context][g-main-context-push-thread-default]
* of the thread you are calling this function from.
*
* You are guaranteed that one of the handlers will be invoked after
* calling this function. When you are done watching the name, just
* call g_bus_unwatch_name() with the watcher id this function
* returns.
*
* If the name vanishes or appears (for example the application owning
* the name could restart), the handlers are also invoked. If the
* #GDBusConnection that is used for watching the name disconnects, then
* @name_vanished_handler is invoked since it is no longer
* possible to access the name.
*
* Another guarantee is that invocations of @name_appeared_handler
* and @name_vanished_handler are guaranteed to alternate; that
* is, if @name_appeared_handler is invoked then you are
* guaranteed that the next time one of the handlers is invoked, it
* will be @name_vanished_handler. The reverse is also true.
*
* This behavior makes it very simple to write applications that want
* to take action when a certain [name exists][gdbus-watching-names].
* Basically, the application should create object proxies in
* @name_appeared_handler and destroy them again (if any) in
* @name_vanished_handler.
*
* Params:
* busType = The type of bus to watch a name on.
* name = The name (well-known or unique) to watch.
* flags = Flags from the #GBusNameWatcherFlags enumeration.
* nameAppearedHandler = Handler to invoke when @name is known to exist or %NULL.
* nameVanishedHandler = Handler to invoke when @name is known to not exist or %NULL.
* userData = User data to pass to handlers.
* userDataFreeFunc = Function for freeing @user_data or %NULL.
*
* Returns: An identifier (never 0) that an be used with
* g_bus_unwatch_name() to stop watching the name.
*
* Since: 2.26
*/
public static uint watchName(GBusType busType, string name, GBusNameWatcherFlags flags, GBusNameAppearedCallback nameAppearedHandler, GBusNameVanishedCallback nameVanishedHandler, void* userData, GDestroyNotify userDataFreeFunc)
{
return g_bus_watch_name(busType, Str.toStringz(name), flags, nameAppearedHandler, nameVanishedHandler, userData, userDataFreeFunc);
}
/**
* Like g_bus_watch_name() but takes a #GDBusConnection instead of a
* #GBusType.
*
* Params:
* connection = A #GDBusConnection.
* name = The name (well-known or unique) to watch.
* flags = Flags from the #GBusNameWatcherFlags enumeration.
* nameAppearedHandler = Handler to invoke when @name is known to exist or %NULL.
* nameVanishedHandler = Handler to invoke when @name is known to not exist or %NULL.
* userData = User data to pass to handlers.
* userDataFreeFunc = Function for freeing @user_data or %NULL.
*
* Returns: An identifier (never 0) that an be used with
* g_bus_unwatch_name() to stop watching the name.
*
* Since: 2.26
*/
public static uint watchNameOnConnection(DBusConnection connection, string name, GBusNameWatcherFlags flags, GBusNameAppearedCallback nameAppearedHandler, GBusNameVanishedCallback nameVanishedHandler, void* userData, GDestroyNotify userDataFreeFunc)
{
return g_bus_watch_name_on_connection((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(name), flags, nameAppearedHandler, nameVanishedHandler, userData, userDataFreeFunc);
}
/**
* Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
* easier binding in other languages.
*
* Params:
* connection = A #GDBusConnection.
* name = The name (well-known or unique) to watch.
* flags = Flags from the #GBusNameWatcherFlags enumeration.
* nameAppearedClosure = #GClosure to invoke when @name is known
* to exist or %NULL.
* nameVanishedClosure = #GClosure to invoke when @name is known
* to not exist or %NULL.
*
* Returns: An identifier (never 0) that an be used with
* g_bus_unwatch_name() to stop watching the name.
*
* Since: 2.26
*/
public static uint watchNameOnConnectionWithClosures(DBusConnection connection, string name, GBusNameWatcherFlags flags, Closure nameAppearedClosure, Closure nameVanishedClosure)
{
return g_bus_watch_name_on_connection_with_closures((connection is null) ? null : connection.getDBusConnectionStruct(), Str.toStringz(name), flags, (nameAppearedClosure is null) ? null : nameAppearedClosure.getClosureStruct(), (nameVanishedClosure is null) ? null : nameVanishedClosure.getClosureStruct());
}
/**
* Version of g_bus_watch_name() using closures instead of callbacks for
* easier binding in other languages.
*
* Params:
* busType = The type of bus to watch a name on.
* name = The name (well-known or unique) to watch.
* flags = Flags from the #GBusNameWatcherFlags enumeration.
* nameAppearedClosure = #GClosure to invoke when @name is known
* to exist or %NULL.
* nameVanishedClosure = #GClosure to invoke when @name is known
* to not exist or %NULL.
*
* Returns: An identifier (never 0) that an be used with
* g_bus_unwatch_name() to stop watching the name.
*
* Since: 2.26
*/
public static uint watchNameWithClosures(GBusType busType, string name, GBusNameWatcherFlags flags, Closure nameAppearedClosure, Closure nameVanishedClosure)
{
return g_bus_watch_name_with_closures(busType, Str.toStringz(name), flags, (nameAppearedClosure is null) ? null : nameAppearedClosure.getClosureStruct(), (nameVanishedClosure is null) ? null : nameVanishedClosure.getClosureStruct());
}
}
|