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  * A GTrashStack is an efficient way to keep a stack of unused allocated
64  * memory chunks. Each memory chunk is required to be large enough to hold
65  * a gpointer. This allows the stack to be maintained without any space
66  * overhead, since the stack pointers can be stored inside the memory chunks.
67  *
68  * There is no function to create a GTrashStack. A NULL GTrashStack*
69  * is a perfectly valid empty stack.
70  */
71 public class TrashStack
72 {
73 	
74 	/** the main Gtk struct */
75 	protected GTrashStack* gTrashStack;
76 	
77 	
78 	/** Get the main Gtk struct */
79 	public GTrashStack* getTrashStackStruct()
80 	{
81 		return gTrashStack;
82 	}
83 	
84 	
85 	/** the main Gtk struct as a void* */
86 	protected void* getStruct()
87 	{
88 		return cast(void*)gTrashStack;
89 	}
90 	
91 	/**
92 	 * Sets our main struct and passes it to the parent class
93 	 */
94 	public this (GTrashStack* gTrashStack)
95 	{
96 		this.gTrashStack = gTrashStack;
97 	}
98 	
99 	/**
100 	 */
101 	
102 	/**
103 	 * Pushes a piece of memory onto a GTrashStack.
104 	 * Params:
105 	 * stackP = a GTrashStack
106 	 * dataP = the piece of memory to push on the stack
107 	 */
108 	public static void push(GTrashStack** stackP, void* dataP)
109 	{
110 		// void g_trash_stack_push (GTrashStack **stack_p,  gpointer data_p);
111 		g_trash_stack_push(stackP, dataP);
112 	}
113 	
114 	/**
115 	 * Pops a piece of memory off a GTrashStack.
116 	 * Params:
117 	 * stackP = a GTrashStack
118 	 * Returns: the element at the top of the stack
119 	 */
120 	public static void* pop(GTrashStack** stackP)
121 	{
122 		// gpointer g_trash_stack_pop (GTrashStack **stack_p);
123 		return g_trash_stack_pop(stackP);
124 	}
125 	
126 	/**
127 	 * Returns the element at the top of a GTrashStack
128 	 * which may be NULL.
129 	 * Params:
130 	 * stackP = a GTrashStack
131 	 * Returns: the element at the top of the stack
132 	 */
133 	public static void* peek(GTrashStack** stackP)
134 	{
135 		// gpointer g_trash_stack_peek (GTrashStack **stack_p);
136 		return g_trash_stack_peek(stackP);
137 	}
138 	
139 	/**
140 	 * Returns the height of a GTrashStack.
141 	 * Note that execution of this function is of O(N) complexity
142 	 * where N denotes the number of items on the stack.
143 	 * Params:
144 	 * stackP = a GTrashStack
145 	 * Returns: the height of the stack
146 	 */
147 	public static uint height(GTrashStack** stackP)
148 	{
149 		// guint g_trash_stack_height (GTrashStack **stack_p);
150 		return g_trash_stack_height(stackP);
151 	}
152 }