/usr/include/d/gtkd-3/glib/Hook.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 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | /*
* 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 glib.Hook;
private import glib.HookList;
private import glib.c.functions;
public import glib.c.types;
public import gtkc.glibtypes;
private import gtkd.Loader;
/**
* The #GHook struct represents a single hook function in a #GHookList.
*/
public final class Hook
{
/** the main Gtk struct */
protected GHook* gHook;
protected bool ownedRef;
/** Get the main Gtk struct */
public GHook* getHookStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gHook;
}
/** the main Gtk struct as a void* */
protected void* getStruct()
{
return cast(void*)gHook;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GHook* gHook, bool ownedRef = false)
{
this.gHook = gHook;
this.ownedRef = ownedRef;
}
~this ()
{
if ( Linker.isLoaded(LIBRARY_GLIB) && ownedRef )
g_free(gHook);
}
/**
* data which is passed to func when this hook is invoked
*/
public @property void* data()
{
return gHook.data;
}
/** Ditto */
public @property void data(void* value)
{
gHook.data = value;
}
/**
* pointer to the next hook in the list
*/
public @property Hook next()
{
return new Hook(gHook.next, false);
}
/** Ditto */
public @property void next(Hook value)
{
gHook.next = value.getHookStruct();
}
/**
* pointer to the previous hook in the list
*/
public @property Hook prev()
{
return new Hook(gHook.prev, false);
}
/** Ditto */
public @property void prev(Hook value)
{
gHook.prev = value.getHookStruct();
}
/**
* the reference count of this hook
*/
public @property uint refCount()
{
return gHook.refCount;
}
/** Ditto */
public @property void refCount(uint value)
{
gHook.refCount = value;
}
/**
* the id of this hook, which is unique within its list
*/
public @property gulong hookId()
{
return gHook.hookId;
}
/** Ditto */
public @property void hookId(gulong value)
{
gHook.hookId = value;
}
/**
* flags which are set for this hook. See #GHookFlagMask for
* predefined flags
*/
public @property uint flags()
{
return gHook.flags;
}
/** Ditto */
public @property void flags(uint value)
{
gHook.flags = value;
}
/**
* the function to call when this hook is invoked. The possible
* signatures for this function are #GHookFunc and #GHookCheckFunc
*/
public @property void* func()
{
return gHook.func;
}
/** Ditto */
public @property void func(void* value)
{
gHook.func = value;
}
/**
* the default @finalize_hook function of a #GHookList calls
* this member of the hook that is being finalized
*/
public @property GDestroyNotify destroy()
{
return gHook.destroy;
}
/** Ditto */
public @property void destroy(GDestroyNotify value)
{
gHook.destroy = value;
}
/**
* Compares the ids of two #GHook elements, returning a negative value
* if the second id is greater than the first.
*
* Params:
* sibling = a #GHook to compare with @new_hook
*
* Returns: a value <= 0 if the id of @sibling is >= the id of @new_hook
*/
public int compareIds(Hook sibling)
{
return g_hook_compare_ids(gHook, (sibling is null) ? null : sibling.getHookStruct());
}
/**
* Allocates space for a #GHook and initializes it.
*
* Params:
* hookList = a #GHookList
*
* Returns: a new #GHook
*/
public static Hook alloc(HookList hookList)
{
auto p = g_hook_alloc((hookList is null) ? null : hookList.getHookListStruct());
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Destroys a #GHook, given its ID.
*
* Params:
* hookList = a #GHookList
* hookId = a hook ID
*
* Returns: %TRUE if the #GHook was found in the #GHookList and destroyed
*/
public static bool destroy(HookList hookList, gulong hookId)
{
return g_hook_destroy((hookList is null) ? null : hookList.getHookListStruct(), hookId) != 0;
}
/**
* Removes one #GHook from a #GHookList, marking it
* inactive and calling g_hook_unref() on it.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to remove
*/
public static void destroyLink(HookList hookList, Hook hook)
{
g_hook_destroy_link((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct());
}
/**
* Finds a #GHook in a #GHookList using the given function to
* test for a match.
*
* Params:
* hookList = a #GHookList
* needValids = %TRUE if #GHook elements which have been destroyed
* should be skipped
* func = the function to call for each #GHook, which should return
* %TRUE when the #GHook has been found
* data = the data to pass to @func
*
* Returns: the found #GHook or %NULL if no matching #GHook is found
*/
public static Hook find(HookList hookList, bool needValids, GHookFindFunc func, void* data)
{
auto p = g_hook_find((hookList is null) ? null : hookList.getHookListStruct(), needValids, func, data);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Finds a #GHook in a #GHookList with the given data.
*
* Params:
* hookList = a #GHookList
* needValids = %TRUE if #GHook elements which have been destroyed
* should be skipped
* data = the data to find
*
* Returns: the #GHook with the given @data or %NULL if no matching
* #GHook is found
*/
public static Hook findData(HookList hookList, bool needValids, void* data)
{
auto p = g_hook_find_data((hookList is null) ? null : hookList.getHookListStruct(), needValids, data);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Finds a #GHook in a #GHookList with the given function.
*
* Params:
* hookList = a #GHookList
* needValids = %TRUE if #GHook elements which have been destroyed
* should be skipped
* func = the function to find
*
* Returns: the #GHook with the given @func or %NULL if no matching
* #GHook is found
*/
public static Hook findFunc(HookList hookList, bool needValids, void* func)
{
auto p = g_hook_find_func((hookList is null) ? null : hookList.getHookListStruct(), needValids, func);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Finds a #GHook in a #GHookList with the given function and data.
*
* Params:
* hookList = a #GHookList
* needValids = %TRUE if #GHook elements which have been destroyed
* should be skipped
* func = the function to find
* data = the data to find
*
* Returns: the #GHook with the given @func and @data or %NULL if
* no matching #GHook is found
*/
public static Hook findFuncData(HookList hookList, bool needValids, void* func, void* data)
{
auto p = g_hook_find_func_data((hookList is null) ? null : hookList.getHookListStruct(), needValids, func, data);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Returns the first #GHook in a #GHookList which has not been destroyed.
* The reference count for the #GHook is incremented, so you must call
* g_hook_unref() to restore it when no longer needed. (Or call
* g_hook_next_valid() if you are stepping through the #GHookList.)
*
* Params:
* hookList = a #GHookList
* mayBeInCall = %TRUE if hooks which are currently running
* (e.g. in another thread) are considered valid. If set to %FALSE,
* these are skipped
*
* Returns: the first valid #GHook, or %NULL if none are valid
*/
public static Hook firstValid(HookList hookList, bool mayBeInCall)
{
auto p = g_hook_first_valid((hookList is null) ? null : hookList.getHookListStruct(), mayBeInCall);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Calls the #GHookList @finalize_hook function if it exists,
* and frees the memory allocated for the #GHook.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to free
*/
public static void free(HookList hookList, Hook hook)
{
g_hook_free((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct());
}
/**
* Returns the #GHook with the given id, or %NULL if it is not found.
*
* Params:
* hookList = a #GHookList
* hookId = a hook id
*
* Returns: the #GHook with the given id, or %NULL if it is not found
*/
public static Hook get(HookList hookList, gulong hookId)
{
auto p = g_hook_get((hookList is null) ? null : hookList.getHookListStruct(), hookId);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Inserts a #GHook into a #GHookList, before a given #GHook.
*
* Params:
* hookList = a #GHookList
* sibling = the #GHook to insert the new #GHook before
* hook = the #GHook to insert
*/
public static void insertBefore(HookList hookList, Hook sibling, Hook hook)
{
g_hook_insert_before((hookList is null) ? null : hookList.getHookListStruct(), (sibling is null) ? null : sibling.getHookStruct(), (hook is null) ? null : hook.getHookStruct());
}
/**
* Inserts a #GHook into a #GHookList, sorted by the given function.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to insert
* func = the comparison function used to sort the #GHook elements
*/
public static void insertSorted(HookList hookList, Hook hook, GHookCompareFunc func)
{
g_hook_insert_sorted((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct(), func);
}
/**
* Returns the next #GHook in a #GHookList which has not been destroyed.
* The reference count for the #GHook is incremented, so you must call
* g_hook_unref() to restore it when no longer needed. (Or continue to call
* g_hook_next_valid() until %NULL is returned.)
*
* Params:
* hookList = a #GHookList
* hook = the current #GHook
* mayBeInCall = %TRUE if hooks which are currently running
* (e.g. in another thread) are considered valid. If set to %FALSE,
* these are skipped
*
* Returns: the next valid #GHook, or %NULL if none are valid
*/
public static Hook nextValid(HookList hookList, Hook hook, bool mayBeInCall)
{
auto p = g_hook_next_valid((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct(), mayBeInCall);
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Prepends a #GHook on the start of a #GHookList.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to add to the start of @hook_list
*/
public static void prepend(HookList hookList, Hook hook)
{
g_hook_prepend((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct());
}
/**
* Increments the reference count for a #GHook.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to increment the reference count of
*
* Returns: the @hook that was passed in (since 2.6)
*/
public static Hook doref(HookList hookList, Hook hook)
{
auto p = g_hook_ref((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct());
if(p is null)
{
return null;
}
return new Hook(cast(GHook*) p);
}
/**
* Decrements the reference count of a #GHook.
* If the reference count falls to 0, the #GHook is removed
* from the #GHookList and g_hook_free() is called to free it.
*
* Params:
* hookList = a #GHookList
* hook = the #GHook to unref
*/
public static void unref(HookList hookList, Hook hook)
{
g_hook_unref((hookList is null) ? null : hookList.getHookListStruct(), (hook is null) ? null : hook.getHookStruct());
}
}
|