Like the AUTORADIOBUTTON, the parent of a RADIOBUTTON style button
[wine] / dlls / opengl32 / make_opengl_spec
1 #!/usr/bin/perl -w
2
3 #
4 # First, the basics and the wgl functions
5 #
6 print "
7 name opengl32
8 type win32
9
10 @  stdcall wglCreateContext(long) wglCreateContext
11 @  stdcall wglCreateLayerContext(long long) wglCreateLayerContext
12 @  stdcall wglCopyContext(long long long) wglCopyContext
13 @  stdcall wglDeleteContext(long) wglDeleteContext
14 @  stdcall wglDescribeLayerPlane(long long long long ptr) wglDescribeLayerPlane
15 @  stdcall wglGetCurrentContext() wglGetCurrentContext
16 @  stdcall wglGetCurrentDC() wglGetCurrentDC
17 @  stdcall wglGetLayerPaletteEntries(long long long long ptr) wglGetLayerPaletteEntries
18 @  stdcall wglGetProcAddress(str) wglGetProcAddress
19 @  stdcall wglMakeCurrent(long long) wglMakeCurrent
20 @  stdcall wglRealizeLayerPalette(long long long) wglRealizeLayerPalette
21 @  stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries
22 @  stdcall wglShareLists(long long) wglShareLists
23 @  stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
24 @  stdcall wglUseFontBitmaps(long long long long) wglUseFontBitmaps
25 @  stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines
26 @  stub    glGetLevelParameterfv
27 @  stub    glGetLevelParameteriv
28 @  stub    wglUseFontBitmapsA
29 @  stub    wglUseFontOutlinesA
30 @  forward wglChoosePixelFormat GDI32.ChoosePixelFormat
31 @  forward wglDescribePixelFormat GDI32.DescribePixelFormat
32 @  forward wglGetPixelFormat GDI32.GetPixelFormat
33 @  forward wglSetPixelFormat GDI32.SetPixelFormat
34 @  forward wglSwapBuffers GDI32.SwapBuffers
35 ";
36
37 #
38 # Now, the functions from the include file
39 #
40 open(INC, "/usr/X11R6/include/GL/gl.h") || die "Could not open GL/gl.h";
41
42 while ($line = <INC>) {
43     if ($line =~ /GLAPI.*GLAPIENTRY/) {
44         # Start of a function declaration
45         ($name, $args) = ($line =~ /GLAPIENTRY *(.*)\((.*)/);
46         
47         # Remove all extensions except the multitexture one (see OpenGL ABI)
48         if (($name !~ /(MESA|PGI|ARB|EXT)/) ||
49             ($name =~ /MultiTexCoord/) ||
50             ($name =~ /ActiveTextureARB/)) {
51             print "@  stdcall $name(";
52
53             # Now, get the parameters
54             while (1) {
55                 @args = split /,/, $args;
56
57                 foreach (@args) {
58                     if ($_ =~ /\)/) {
59                         ($_) = ($_ =~ /(.*)\)/);
60                     }
61
62                     if ($_ =~ /\*/) {
63                         print "ptr ";
64                     } elsif ($_ =~ /[a-zA-Z]/) {
65                         ($type) = ($_ =~ /^ *(.*) +.*/);
66                         if ($type =~ /double/) {
67                             print "double ";
68                         } elsif ($type !~ /void/) {
69                             print "long ";
70                         }
71                     }
72                 }
73
74                 if ($args !~ /\)/) {
75                     $args = <INC>;
76                 } else {
77                     last;
78                 }
79             }
80             
81             print ") wine_$name\n";
82         }
83     }
84 }
85
86 close(INC);