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 62 private import glib.Str; 63 64 65 66 67 /** 68 */ 69 public class GLtInit 70 { 71 72 /** 73 */ 74 75 /** 76 * Call this function before using any other GtkGLExt functions in your 77 * applications. It will initialize everything needed to operate the library 78 * and parses some standard command line options. argc and 79 * argv are adjusted accordingly so your own code will 80 * never see those standard arguments. 81 * Note 82 * This function will terminate your program if it was unable to initialize 83 * the library for some reason. If you want your program to fall back to a 84 * textual interface you want to call gtk_gl_init_check() instead. 85 * Params: 86 * argv = Address of the argv parameter of 87 * main(). Any parameters understood by 88 * gtk_gl_init() are stripped before return. 89 */ 90 public static void init(ref string[] argv) 91 { 92 // void gtk_gl_init (int *argc, char ***argv); 93 char** outargv = Str.toStringzArray(argv); 94 int argc = cast(int) argv.length; 95 96 gtk_gl_init(&argc, &outargv); 97 98 argv = null; 99 foreach ( cstr; outargv[0 .. argc] ) 100 { 101 argv ~= Str.toString(cstr); 102 } 103 } 104 105 /** 106 * This function does the same work as gtk_gl_init() with only 107 * a single change: It does not terminate the program if the library can't be 108 * initialized. Instead it returns FALSE on failure. 109 * This way the application can fall back to some other means of communication 110 * with the user - for example a curses or command line interface. 111 * Params: 112 * argv = Address of the argv parameter of 113 * main(). Any parameters understood by 114 * gtk_gl_init() are stripped before return. 115 * Returns: TRUE if the GUI has been successfully initialized, FALSE otherwise. 116 */ 117 public static int initCheck(ref string[] argv) 118 { 119 // gboolean gtk_gl_init_check (int *argc, char ***argv); 120 char** outargv = Str.toStringzArray(argv); 121 int argc = cast(int) argv.length; 122 123 auto p = gtk_gl_init_check(&argc, &outargv); 124 125 argv = null; 126 foreach ( cstr; outargv[0 .. argc] ) 127 { 128 argv ~= Str.toString(cstr); 129 } 130 return p; 131 } 132 }