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 module glib.HookList; 26 27 private import gtkc.glib; 28 public import gtkc.glibtypes; 29 30 31 /** 32 * The #GHookList struct represents a list of hook functions. 33 */ 34 public class HookList 35 { 36 /** the main Gtk struct */ 37 protected GHookList* gHookList; 38 protected bool ownedRef; 39 40 /** Get the main Gtk struct */ 41 public GHookList* getHookListStruct() 42 { 43 return gHookList; 44 } 45 46 /** the main Gtk struct as a void* */ 47 protected void* getStruct() 48 { 49 return cast(void*)gHookList; 50 } 51 52 /** 53 * Sets our main struct and passes it to the parent class. 54 */ 55 public this (GHookList* gHookList, bool ownedRef = false) 56 { 57 this.gHookList = gHookList; 58 this.ownedRef = ownedRef; 59 } 60 61 62 /** 63 * Removes all the #GHook elements from a #GHookList. 64 */ 65 public void clear() 66 { 67 g_hook_list_clear(gHookList); 68 } 69 70 /** 71 * Initializes a #GHookList. 72 * This must be called before the #GHookList is used. 73 * 74 * Params: 75 * hookSize = the size of each element in the #GHookList, 76 * typically `sizeof (GHook)`. 77 */ 78 public void init(uint hookSize) 79 { 80 g_hook_list_init(gHookList, hookSize); 81 } 82 83 /** 84 * Calls all of the #GHook functions in a #GHookList. 85 * 86 * Params: 87 * mayRecurse = %TRUE if functions which are already running 88 * (e.g. in another thread) can be called. If set to %FALSE, 89 * these are skipped 90 */ 91 public void invoke(bool mayRecurse) 92 { 93 g_hook_list_invoke(gHookList, mayRecurse); 94 } 95 96 /** 97 * Calls all of the #GHook functions in a #GHookList. 98 * Any function which returns %FALSE is removed from the #GHookList. 99 * 100 * Params: 101 * mayRecurse = %TRUE if functions which are already running 102 * (e.g. in another thread) can be called. If set to %FALSE, 103 * these are skipped 104 */ 105 public void invokeCheck(bool mayRecurse) 106 { 107 g_hook_list_invoke_check(gHookList, mayRecurse); 108 } 109 110 /** 111 * Calls a function on each valid #GHook. 112 * 113 * Params: 114 * mayRecurse = %TRUE if hooks which are currently running 115 * (e.g. in another thread) are considered valid. If set to %FALSE, 116 * these are skipped 117 * marshaller = the function to call for each #GHook 118 * marshalData = data to pass to @marshaller 119 */ 120 public void marshal(bool mayRecurse, GHookMarshaller marshaller, void* marshalData) 121 { 122 g_hook_list_marshal(gHookList, mayRecurse, marshaller, marshalData); 123 } 124 125 /** 126 * Calls a function on each valid #GHook and destroys it if the 127 * function returns %FALSE. 128 * 129 * Params: 130 * mayRecurse = %TRUE if hooks which are currently running 131 * (e.g. in another thread) are considered valid. If set to %FALSE, 132 * these are skipped 133 * marshaller = the function to call for each #GHook 134 * marshalData = data to pass to @marshaller 135 */ 136 public void marshalCheck(bool mayRecurse, GHookCheckMarshaller marshaller, void* marshalData) 137 { 138 g_hook_list_marshal_check(gHookList, mayRecurse, marshaller, marshalData); 139 } 140 }