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