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  * Conversion parameters:
26  * inFile  = glib-Trash-Stacks.html
27  * outPack = glib
28  * outFile = TrashStack
29  * strct   = GTrashStack
30  * realStrct=
31  * ctorStrct=
32  * clss    = TrashStack
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_trash_stack_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * structWrap:
47  * module aliases:
48  * local aliases:
49  * overrides:
50  */
51 
52 module glib.TrashStack;
53 
54 public  import gtkc.glibtypes;
55 
56 private import gtkc.glib;
57 private import glib.ConstructionException;
58 
59 
60 
61 
62 
63 
64 /**
65  * A GTrashStack is an efficient way to keep a stack of unused allocated
66  * memory chunks. Each memory chunk is required to be large enough to hold
67  * a gpointer. This allows the stack to be maintained without any space
68  * overhead, since the stack pointers can be stored inside the memory chunks.
69  *
70  * There is no function to create a GTrashStack. A NULL GTrashStack*
71  * is a perfectly valid empty stack.
72  */
73 public class TrashStack
74 {
75 	
76 	/** the main Gtk struct */
77 	protected GTrashStack* gTrashStack;
78 	
79 	
80 	public GTrashStack* getTrashStackStruct()
81 	{
82 		return gTrashStack;
83 	}
84 	
85 	
86 	/** the main Gtk struct as a void* */
87 	protected void* getStruct()
88 	{
89 		return cast(void*)gTrashStack;
90 	}
91 	
92 	/**
93 	 * Sets our main struct and passes it to the parent class
94 	 */
95 	public this (GTrashStack* gTrashStack)
96 	{
97 		this.gTrashStack = gTrashStack;
98 	}
99 	
100 	/**
101 	 */
102 	
103 	/**
104 	 * Pushes a piece of memory onto a GTrashStack.
105 	 * Params:
106 	 * stackP = a GTrashStack
107 	 * dataP = the piece of memory to push on the stack
108 	 */
109 	public static void push(GTrashStack** stackP, void* dataP)
110 	{
111 		// void g_trash_stack_push (GTrashStack **stack_p,  gpointer data_p);
112 		g_trash_stack_push(stackP, dataP);
113 	}
114 	
115 	/**
116 	 * Pops a piece of memory off a GTrashStack.
117 	 * Params:
118 	 * stackP = a GTrashStack
119 	 * Returns: the element at the top of the stack
120 	 */
121 	public static void* pop(GTrashStack** stackP)
122 	{
123 		// gpointer g_trash_stack_pop (GTrashStack **stack_p);
124 		return g_trash_stack_pop(stackP);
125 	}
126 	
127 	/**
128 	 * Returns the element at the top of a GTrashStack
129 	 * which may be NULL.
130 	 * Params:
131 	 * stackP = a GTrashStack
132 	 * Returns: the element at the top of the stack
133 	 */
134 	public static void* peek(GTrashStack** stackP)
135 	{
136 		// gpointer g_trash_stack_peek (GTrashStack **stack_p);
137 		return g_trash_stack_peek(stackP);
138 	}
139 	
140 	/**
141 	 * Returns the height of a GTrashStack.
142 	 * Note that execution of this function is of O(N) complexity
143 	 * where N denotes the number of items on the stack.
144 	 * Params:
145 	 * stackP = a GTrashStack
146 	 * Returns: the height of the stack
147 	 */
148 	public static uint height(GTrashStack** stackP)
149 	{
150 		// guint g_trash_stack_height (GTrashStack **stack_p);
151 		return g_trash_stack_height(stackP);
152 	}
153 }