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 glgdk.GLdInit;
26 
27 private import glib.Str;
28 private import gtkglc.glgdk;
29 public  import gtkglc.glgdktypes;
30 
31 
32 public struct GLdInit
33 {
34 	/**
35 	 */
36 
37 	/**
38 	 * Call this function before using any other GdkGLExt functions in your
39 	 * applications.  It will initialize everything needed to operate the
40 	 * library and parses some standard command line options. @argc and
41 	 * @argv are adjusted accordingly so your own code will never see those
42 	 * standard arguments.
43 	 *
44 	 * <note><para>This function will terminate your program if it was
45 	 * unable to initialize the library for some reason. If you want your
46 	 * program to fall back to a textual interface you want to call
47 	 * gdk_gl_init_check() instead.</para></note>
48 	 *
49 	 * Params:
50 	 *     argc = Address of the <parameter>argc</parameter> parameter of your main() function. Changed if any arguments were handled.
51 	 *     argv = Address of the <parameter>argv</parameter> parameter of main(). Any parameters understood by gdk_gl_init() are stripped before return.
52 	 */
53 	public static void init(ref string[] argv)
54 	{
55 		int argc = cast(int)argv.length;
56 		char** outargv = Str.toStringzArray(argv);
57 		
58 		gdk_gl_init(&argc, &outargv);
59 		
60 		argv = Str.toStringArray(outargv, argc);
61 	}
62 
63 	/**
64 	 * This function does the same work as gdk_gl_init() with only
65 	 * a single change: It does not terminate the program if the library can't be
66 	 * initialized. Instead it returns %FALSE on failure.
67 	 *
68 	 * This way the application can fall back to some other means of communication
69 	 * with the user - for example a curses or command line interface.
70 	 *
71 	 * Params:
72 	 *     argc = Address of the <parameter>argc</parameter> parameter of your <function>main()</function> function. Changed if any arguments were handled.
73 	 *     argv = Address of the <parameter>argv</parameter> parameter of <function>main()</function>. Any parameters understood by gdk_gl_init() are stripped before return.
74 	 *
75 	 * Return: %TRUE if the GUI has been successfully initialized, %FALSE otherwise.
76 	 */
77 	public static bool initCheck(ref string[] argv)
78 	{
79 		int argc = cast(int)argv.length;
80 		char** outargv = Str.toStringzArray(argv);
81 		
82 		auto p = gdk_gl_init_check(&argc, &outargv) != 0;
83 		
84 		argv = Str.toStringArray(outargv, argc);
85 		
86 		return p;
87 	}
88 }