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