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.TestLogBuffer;
26 
27 private import glib.ConstructionException;
28 private import glib.TestLogMsg;
29 private import gtkc.glib;
30 public  import gtkc.glibtypes;
31 
32 
33 /** */
34 public class TestLogBuffer
35 {
36 	/** the main Gtk struct */
37 	protected GTestLogBuffer* gTestLogBuffer;
38 	protected bool ownedRef;
39 
40 	/** Get the main Gtk struct */
41 	public GTestLogBuffer* getTestLogBufferStruct()
42 	{
43 		return gTestLogBuffer;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected void* getStruct()
48 	{
49 		return cast(void*)gTestLogBuffer;
50 	}
51 
52 	/**
53 	 * Sets our main struct and passes it to the parent class.
54 	 */
55 	public this (GTestLogBuffer* gTestLogBuffer, bool ownedRef = false)
56 	{
57 		this.gTestLogBuffer = gTestLogBuffer;
58 		this.ownedRef = ownedRef;
59 	}
60 
61 
62 	/**
63 	 * Internal function for gtester to free test log messages, no ABI guarantees provided.
64 	 */
65 	public void free()
66 	{
67 		g_test_log_buffer_free(gTestLogBuffer);
68 	}
69 
70 	/**
71 	 * Internal function for gtester to retrieve test log messages, no ABI guarantees provided.
72 	 */
73 	public TestLogMsg pop()
74 	{
75 		auto p = g_test_log_buffer_pop(gTestLogBuffer);
76 		
77 		if(p is null)
78 		{
79 			return null;
80 		}
81 		
82 		return new TestLogMsg(cast(GTestLogMsg*) p);
83 	}
84 
85 	/**
86 	 * Internal function for gtester to decode test log messages, no ABI guarantees provided.
87 	 */
88 	public void push(uint nBytes, ubyte* bytes)
89 	{
90 		g_test_log_buffer_push(gTestLogBuffer, nBytes, bytes);
91 	}
92 
93 	/**
94 	 * Internal function for gtester to decode test log messages, no ABI guarantees provided.
95 	 *
96 	 * Throws: ConstructionException GTK+ fails to create the object.
97 	 */
98 	public this()
99 	{
100 		auto p = g_test_log_buffer_new();
101 		
102 		if(p is null)
103 		{
104 			throw new ConstructionException("null returned by new");
105 		}
106 		
107 		this(cast(GTestLogBuffer*) p);
108 	}
109 }