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