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