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 = gtkglext-gtkglinit.html 27 * outPack = glgtk 28 * outFile = GLtInit 29 * strct = 30 * realStrct= 31 * ctorStrct= 32 * clss = GLtInit 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_gl_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * structWrap: 48 * module aliases: 49 * local aliases: 50 * overrides: 51 */ 52 53 module glgtk.GLtInit; 54 55 public import gtkglc.glgtktypes; 56 57 private import gtkglc.glgtk; 58 private import glib.ConstructionException; 59 private import gobject.ObjectG; 60 61 private import glib.Str; 62 63 64 65 /** 66 */ 67 public class GLtInit 68 { 69 70 /** 71 */ 72 73 /** 74 * Call this function before using any other GtkGLExt functions in your 75 * applications. It will initialize everything needed to operate the library 76 * and parses some standard command line options. argc and 77 * argv are adjusted accordingly so your own code will 78 * never see those standard arguments. 79 * Note 80 * This function will terminate your program if it was unable to initialize 81 * the library for some reason. If you want your program to fall back to a 82 * textual interface you want to call gtk_gl_init_check() instead. 83 * Params: 84 * argv = Address of the argv parameter of 85 * main(). Any parameters understood by 86 * gtk_gl_init() are stripped before return. 87 */ 88 public static void init(ref string[] argv) 89 { 90 // void gtk_gl_init (int *argc, char ***argv); 91 char** outargv = Str.toStringzArray(argv); 92 int argc = cast(int) argv.length; 93 94 gtk_gl_init(&argc, &outargv); 95 96 argv = null; 97 foreach ( cstr; outargv[0 .. argc] ) 98 { 99 argv ~= Str.toString(cstr); 100 } 101 } 102 103 /** 104 * This function does the same work as gtk_gl_init() with only 105 * a single change: It does not terminate the program if the library can't be 106 * initialized. Instead it returns FALSE on failure. 107 * This way the application can fall back to some other means of communication 108 * with the user - for example a curses or command line interface. 109 * Params: 110 * argv = Address of the argv parameter of 111 * main(). Any parameters understood by 112 * gtk_gl_init() are stripped before return. 113 * Returns: TRUE if the GUI has been successfully initialized, FALSE otherwise. 114 */ 115 public static int initCheck(ref string[] argv) 116 { 117 // gboolean gtk_gl_init_check (int *argc, char ***argv); 118 char** outargv = Str.toStringzArray(argv); 119 int argc = cast(int) argv.length; 120 121 auto p = gtk_gl_init_check(&argc, &outargv); 122 123 argv = null; 124 foreach ( cstr; outargv[0 .. argc] ) 125 { 126 argv ~= Str.toString(cstr); 127 } 128 return p; 129 } 130 }