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