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