From 971e84482b26f229d62c64735283cedba0a4592f Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Tue, 29 Jan 2008 22:18:25 -0800
Subject: [PATCH 01/24] Add no-op parsing support for OpenGL fallback function
 names

---
 extra/opengl/gl/gl.factor              | 465 ++++++++++++-------------
 extra/opengl/gl/unix/unix.factor       |   9 +-
 extra/opengl/gl/windows/windows.factor |   1 +
 3 files changed, 238 insertions(+), 237 deletions(-)

diff --git a/extra/opengl/gl/gl.factor b/extra/opengl/gl/gl.factor
index 071fbc45e7..13a6232125 100644
--- a/extra/opengl/gl/gl.factor
+++ b/extra/opengl/gl/gl.factor
@@ -1123,12 +1123,8 @@ FUNCTION: void glPopName ( ) ;
 ! OpenGL extension functions
 
 
-
-
-
 ! OpenGL 1.2
 
-
 : GL_SMOOTH_POINT_SIZE_RANGE HEX: 0B12 ; inline
 : GL_SMOOTH_POINT_SIZE_GRANULARITY HEX: 0B13 ; inline
 : GL_SMOOTH_LINE_WIDTH_RANGE HEX: 0B22 ; inline
@@ -1171,10 +1167,10 @@ FUNCTION: void glPopName ( ) ;
 : GL_ALIASED_POINT_SIZE_RANGE HEX: 846D ; inline
 : GL_ALIASED_LINE_WIDTH_RANGE HEX: 846E ; inline
 
-GL-FUNCTION: void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) ;
-GL-FUNCTION: void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid* indices ) ;
-GL-FUNCTION: void glTexImage3D ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid* pixels ) ;
-GL-FUNCTION: void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* pixels ) ;
+GL-FUNCTION: void glCopyTexSubImage3D { glCopyTexSubImage3DEXT } ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) ;
+GL-FUNCTION: void glDrawRangeElements { glDrawRangeElementsEXT } ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid* indices ) ;
+GL-FUNCTION: void glTexImage3D { glTexImage3DEXT } ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid* pixels ) ;
+GL-FUNCTION: void glTexSubImage3D { glTexSubImage3DEXT } ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* pixels ) ;
 
 
 ! OpenGL 1.3
@@ -1277,52 +1273,52 @@ GL-FUNCTION: void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, G
 : GL_DOT3_RGBA HEX: 86AF ; inline
 : GL_MULTISAMPLE_BIT HEX: 20000000 ; inline
 
-GL-FUNCTION: void glActiveTexture ( GLenum texture ) ;
-GL-FUNCTION: void glClientActiveTexture ( GLenum texture ) ;
-GL-FUNCTION: void glCompressedTexImage1D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glCompressedTexSubImage1D ( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid* data ) ;
-GL-FUNCTION: void glGetCompressedTexImage ( GLenum target, GLint lod, GLvoid* img ) ;
-GL-FUNCTION: void glLoadTransposeMatrixd ( GLdouble m[16] ) ;
-GL-FUNCTION: void glLoadTransposeMatrixf ( GLfloat m[16] ) ;
-GL-FUNCTION: void glMultTransposeMatrixd ( GLdouble m[16] ) ;
-GL-FUNCTION: void glMultTransposeMatrixf ( GLfloat m[16] ) ;
-GL-FUNCTION: void glMultiTexCoord1d ( GLenum target, GLdouble s ) ;
-GL-FUNCTION: void glMultiTexCoord1dv ( GLenum target, GLdouble* v ) ;
-GL-FUNCTION: void glMultiTexCoord1f ( GLenum target, GLfloat s ) ;
-GL-FUNCTION: void glMultiTexCoord1fv ( GLenum target, GLfloat* v ) ;
-GL-FUNCTION: void glMultiTexCoord1i ( GLenum target, GLint s ) ;
-GL-FUNCTION: void glMultiTexCoord1iv ( GLenum target, GLint* v ) ;
-GL-FUNCTION: void glMultiTexCoord1s ( GLenum target, GLshort s ) ;
-GL-FUNCTION: void glMultiTexCoord1sv ( GLenum target, GLshort* v ) ;
-GL-FUNCTION: void glMultiTexCoord2d ( GLenum target, GLdouble s, GLdouble t ) ;
-GL-FUNCTION: void glMultiTexCoord2dv ( GLenum target, GLdouble* v ) ;
-GL-FUNCTION: void glMultiTexCoord2f ( GLenum target, GLfloat s, GLfloat t ) ;
-GL-FUNCTION: void glMultiTexCoord2fv ( GLenum target, GLfloat* v ) ;
-GL-FUNCTION: void glMultiTexCoord2i ( GLenum target, GLint s, GLint t ) ;
-GL-FUNCTION: void glMultiTexCoord2iv ( GLenum target, GLint* v ) ;
-GL-FUNCTION: void glMultiTexCoord2s ( GLenum target, GLshort s, GLshort t ) ;
-GL-FUNCTION: void glMultiTexCoord2sv ( GLenum target, GLshort* v ) ;
-GL-FUNCTION: void glMultiTexCoord3d ( GLenum target, GLdouble s, GLdouble t, GLdouble r ) ;
-GL-FUNCTION: void glMultiTexCoord3dv ( GLenum target, GLdouble* v ) ;
-GL-FUNCTION: void glMultiTexCoord3f ( GLenum target, GLfloat s, GLfloat t, GLfloat r ) ;
-GL-FUNCTION: void glMultiTexCoord3fv ( GLenum target, GLfloat* v ) ;
-GL-FUNCTION: void glMultiTexCoord3i ( GLenum target, GLint s, GLint t, GLint r ) ;
-GL-FUNCTION: void glMultiTexCoord3iv ( GLenum target, GLint* v ) ;
-GL-FUNCTION: void glMultiTexCoord3s ( GLenum target, GLshort s, GLshort t, GLshort r ) ;
-GL-FUNCTION: void glMultiTexCoord3sv ( GLenum target, GLshort* v ) ;
-GL-FUNCTION: void glMultiTexCoord4d ( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ) ;
-GL-FUNCTION: void glMultiTexCoord4dv ( GLenum target, GLdouble* v ) ;
-GL-FUNCTION: void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) ;
-GL-FUNCTION: void glMultiTexCoord4fv ( GLenum target, GLfloat* v ) ;
-GL-FUNCTION: void glMultiTexCoord4i ( GLenum target, GLint s, GLint t, GLint r, GLint q ) ;
-GL-FUNCTION: void glMultiTexCoord4iv ( GLenum target, GLint* v ) ;
-GL-FUNCTION: void glMultiTexCoord4s ( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ) ;
-GL-FUNCTION: void glMultiTexCoord4sv ( GLenum target, GLshort* v ) ;
-GL-FUNCTION: void glSampleCoverage ( GLclampf value, GLboolean invert ) ;
+GL-FUNCTION: void glActiveTexture { glActiveTextureARB }( GLenum texture ) ;
+GL-FUNCTION: void glClientActiveTexture { glClientActiveTextureARB } ( GLenum texture ) ;
+GL-FUNCTION: void glCompressedTexImage1D { glCompressedTexImage1DARB } ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glCompressedTexImage2D { glCompressedTexImage2DARB } ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glCompressedTexImage3D { glCompressedTexImage2DARB } ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glCompressedTexSubImage1D { glCompressedTexSubImage1DARB } ( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glCompressedTexSubImage2D { glCompressedTexSubImage2DARB } ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glCompressedTexSubImage3D { glCompressedTexSubImage3DARB } ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid* data ) ;
+GL-FUNCTION: void glGetCompressedTexImage { glGetCompressedTexImageARB } ( GLenum target, GLint lod, GLvoid* img ) ;
+GL-FUNCTION: void glLoadTransposeMatrixd { glLoadTransposeMatrixdARB } ( GLdouble m[16] ) ;
+GL-FUNCTION: void glLoadTransposeMatrixf { glLoadTransposeMatrixfARB } ( GLfloat m[16] ) ;
+GL-FUNCTION: void glMultTransposeMatrixd { glMultTransposeMatrixdARB } ( GLdouble m[16] ) ;
+GL-FUNCTION: void glMultTransposeMatrixf { glMultTransposeMatrixfARB } ( GLfloat m[16] ) ;
+GL-FUNCTION: void glMultiTexCoord1d { glMultiTexCoord1dARB } ( GLenum target, GLdouble s ) ;
+GL-FUNCTION: void glMultiTexCoord1dv { glMultiTexCoord1dvARB } ( GLenum target, GLdouble* v ) ;
+GL-FUNCTION: void glMultiTexCoord1f { glMultiTexCoord1fARB } ( GLenum target, GLfloat s ) ;
+GL-FUNCTION: void glMultiTexCoord1fv { glMultiTexCoord1fvARB } ( GLenum target, GLfloat* v ) ;
+GL-FUNCTION: void glMultiTexCoord1i { glMultiTexCoord1iARB } ( GLenum target, GLint s ) ;
+GL-FUNCTION: void glMultiTexCoord1iv { glMultiTexCoord1ivARB } ( GLenum target, GLint* v ) ;
+GL-FUNCTION: void glMultiTexCoord1s { glMultiTexCoord1sARB } ( GLenum target, GLshort s ) ;
+GL-FUNCTION: void glMultiTexCoord1sv { glMultiTexCoord1svARB } ( GLenum target, GLshort* v ) ;
+GL-FUNCTION: void glMultiTexCoord2d { glMultiTexCoord2dARB } ( GLenum target, GLdouble s, GLdouble t ) ;
+GL-FUNCTION: void glMultiTexCoord2dv { glMultiTexCoord2dvARB } ( GLenum target, GLdouble* v ) ;
+GL-FUNCTION: void glMultiTexCoord2f { glMultiTexCoord2fARB } ( GLenum target, GLfloat s, GLfloat t ) ;
+GL-FUNCTION: void glMultiTexCoord2fv { glMultiTexCoord2fvARB } ( GLenum target, GLfloat* v ) ;
+GL-FUNCTION: void glMultiTexCoord2i { glMultiTexCoord2iARB } ( GLenum target, GLint s, GLint t ) ;
+GL-FUNCTION: void glMultiTexCoord2iv { glMultiTexCoord2ivARB } ( GLenum target, GLint* v ) ;
+GL-FUNCTION: void glMultiTexCoord2s { glMultiTexCoord2sARB } ( GLenum target, GLshort s, GLshort t ) ;
+GL-FUNCTION: void glMultiTexCoord2sv { glMultiTexCoord2svARB } ( GLenum target, GLshort* v ) ;
+GL-FUNCTION: void glMultiTexCoord3d { glMultiTexCoord3dARB } ( GLenum target, GLdouble s, GLdouble t, GLdouble r ) ;
+GL-FUNCTION: void glMultiTexCoord3dv { glMultiTexCoord3dvARB } ( GLenum target, GLdouble* v ) ;
+GL-FUNCTION: void glMultiTexCoord3f { glMultiTexCoord3fARB } ( GLenum target, GLfloat s, GLfloat t, GLfloat r ) ;
+GL-FUNCTION: void glMultiTexCoord3fv { glMultiTexCoord3fvARB } ( GLenum target, GLfloat* v ) ;
+GL-FUNCTION: void glMultiTexCoord3i { glMultiTexCoord3iARB } ( GLenum target, GLint s, GLint t, GLint r ) ;
+GL-FUNCTION: void glMultiTexCoord3iv { glMultiTexCoord3ivARB } ( GLenum target, GLint* v ) ;
+GL-FUNCTION: void glMultiTexCoord3s { glMultiTexCoord3sARB } ( GLenum target, GLshort s, GLshort t, GLshort r ) ;
+GL-FUNCTION: void glMultiTexCoord3sv { glMultiTexCoord3svARB } ( GLenum target, GLshort* v ) ;
+GL-FUNCTION: void glMultiTexCoord4d { glMultiTexCoord4dARB } ( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ) ;
+GL-FUNCTION: void glMultiTexCoord4dv { glMultiTexCoord4dvARB } ( GLenum target, GLdouble* v ) ;
+GL-FUNCTION: void glMultiTexCoord4f { glMultiTexCoord4fARB } ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) ;
+GL-FUNCTION: void glMultiTexCoord4fv { glMultiTexCoord4fvARB } ( GLenum target, GLfloat* v ) ;
+GL-FUNCTION: void glMultiTexCoord4i { glMultiTexCoord4iARB } ( GLenum target, GLint s, GLint t, GLint r, GLint q ) ;
+GL-FUNCTION: void glMultiTexCoord4iv { glMultiTexCoord4ivARB } ( GLenum target, GLint* v ) ;
+GL-FUNCTION: void glMultiTexCoord4s { glMultiTexCoord4sARB } ( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ) ;
+GL-FUNCTION: void glMultiTexCoord4sv { glMultiTexCoord4svARB } ( GLenum target, GLshort* v ) ;
+GL-FUNCTION: void glSampleCoverage { glSampleCoverageARB } ( GLclampf value, GLboolean invert ) ;
 
 
 ! OpenGL 1.4
@@ -1368,52 +1364,51 @@ GL-FUNCTION: void glSampleCoverage ( GLclampf value, GLboolean invert ) ;
 : GL_TEXTURE_COMPARE_FUNC HEX: 884D ; inline
 : GL_COMPARE_R_TO_TEXTURE HEX: 884E ; inline
 
-GL-FUNCTION: void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ;
-GL-FUNCTION: void glBlendEquation ( GLenum mode ) ;
-GL-FUNCTION: void glBlendFuncSeparate ( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ) ;
-GL-FUNCTION: void glFogCoordPointer ( GLenum type, GLsizei stride, GLvoid* pointer ) ;
-GL-FUNCTION: void glFogCoordd ( GLdouble coord ) ;
-GL-FUNCTION: void glFogCoorddv ( GLdouble* coord ) ;
-GL-FUNCTION: void glFogCoordf ( GLfloat coord ) ;
-GL-FUNCTION: void glFogCoordfv ( GLfloat* coord ) ;
-GL-FUNCTION: void glMultiDrawArrays ( GLenum mode, GLint* first, GLsizei* count, GLsizei primcount ) ;
-GL-FUNCTION: void glMultiDrawElements ( GLenum mode, GLsizei* count, GLenum type, GLvoid** indices, GLsizei primcount ) ;
-GL-FUNCTION: void glPointParameterf ( GLenum pname, GLfloat param ) ;
-GL-FUNCTION: void glPointParameterfv ( GLenum pname, GLfloat* params ) ;
-GL-FUNCTION: void glSecondaryColor3b ( GLbyte red, GLbyte green, GLbyte blue ) ;
-GL-FUNCTION: void glSecondaryColor3bv ( GLbyte* v ) ;
-GL-FUNCTION: void glSecondaryColor3d ( GLdouble red, GLdouble green, GLdouble blue ) ;
-GL-FUNCTION: void glSecondaryColor3dv ( GLdouble* v ) ;
-GL-FUNCTION: void glSecondaryColor3f ( GLfloat red, GLfloat green, GLfloat blue ) ;
-GL-FUNCTION: void glSecondaryColor3fv ( GLfloat* v ) ;
-GL-FUNCTION: void glSecondaryColor3i ( GLint red, GLint green, GLint blue ) ;
-GL-FUNCTION: void glSecondaryColor3iv ( GLint* v ) ;
-GL-FUNCTION: void glSecondaryColor3s ( GLshort red, GLshort green, GLshort blue ) ;
-GL-FUNCTION: void glSecondaryColor3sv ( GLshort* v ) ;
-GL-FUNCTION: void glSecondaryColor3ub ( GLubyte red, GLubyte green, GLubyte blue ) ;
-GL-FUNCTION: void glSecondaryColor3ubv ( GLubyte* v ) ;
-GL-FUNCTION: void glSecondaryColor3ui ( GLuint red, GLuint green, GLuint blue ) ;
-GL-FUNCTION: void glSecondaryColor3uiv ( GLuint* v ) ;
-GL-FUNCTION: void glSecondaryColor3us ( GLushort red, GLushort green, GLushort blue ) ;
-GL-FUNCTION: void glSecondaryColor3usv ( GLushort* v ) ;
-GL-FUNCTION: void glSecondaryColorPointer ( GLint size, GLenum type, GLsizei stride, GLvoid* pointer ) ;
-GL-FUNCTION: void glWindowPos2d ( GLdouble x, GLdouble y ) ;
-GL-FUNCTION: void glWindowPos2dv ( GLdouble* p ) ;
-GL-FUNCTION: void glWindowPos2f ( GLfloat x, GLfloat y ) ;
-GL-FUNCTION: void glWindowPos2fv ( GLfloat* p ) ;
-GL-FUNCTION: void glWindowPos2i ( GLint x, GLint y ) ;
-GL-FUNCTION: void glWindowPos2iv ( GLint* p ) ;
-GL-FUNCTION: void glWindowPos2s ( GLshort x, GLshort y ) ;
-GL-FUNCTION: void glWindowPos2sv ( GLshort* p ) ;
-GL-FUNCTION: void glWindowPos3d ( GLdouble x, GLdouble y, GLdouble z ) ;
-GL-FUNCTION: void glWindowPos3dv ( GLdouble* p ) ;
-GL-FUNCTION: void glWindowPos3f ( GLfloat x, GLfloat y, GLfloat z ) ;
-GL-FUNCTION: void glWindowPos3fv ( GLfloat* p ) ;
-GL-FUNCTION: void glWindowPos3i ( GLint x, GLint y, GLint z ) ;
-GL-FUNCTION: void glWindowPos3iv ( GLint* p ) ;
-GL-FUNCTION: void glWindowPos3s ( GLshort x, GLshort y, GLshort z ) ;
-GL-FUNCTION: void glWindowPos3sv ( GLshort* p ) ;
-
+GL-FUNCTION: void glBlendColor { glBlendColorEXT } ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ;
+GL-FUNCTION: void glBlendEquation { glBlendEquationEXT }( GLenum mode ) ;
+GL-FUNCTION: void glBlendFuncSeparate { glBlendFuncSeparateEXT } ( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ) ;
+GL-FUNCTION: void glFogCoordPointer { glFogCoordPointerEXT } ( GLenum type, GLsizei stride, GLvoid* pointer ) ;
+GL-FUNCTION: void glFogCoordd { glFogCoorddEXT } ( GLdouble coord ) ;
+GL-FUNCTION: void glFogCoorddv { glFogCoorddvEXT } ( GLdouble* coord ) ;
+GL-FUNCTION: void glFogCoordf { glFogCoordfEXT } ( GLfloat coord ) ;
+GL-FUNCTION: void glFogCoordfv { glFogCoordfvEXT } ( GLfloat* coord ) ;
+GL-FUNCTION: void glMultiDrawArrays { glMultiDrawArraysEXT } ( GLenum mode, GLint* first, GLsizei* count, GLsizei primcount ) ;
+GL-FUNCTION: void glMultiDrawElements { glMultiDrawElementsEXT } ( GLenum mode, GLsizei* count, GLenum type, GLvoid** indices, GLsizei primcount ) ;
+GL-FUNCTION: void glPointParameterf { glPointParameterfARB } ( GLenum pname, GLfloat param ) ;
+GL-FUNCTION: void glPointParameterfv { glPointParameterfvARB } ( GLenum pname, GLfloat* params ) ;
+GL-FUNCTION: void glSecondaryColor3b { glSecondaryColor3bEXT } ( GLbyte red, GLbyte green, GLbyte blue ) ;
+GL-FUNCTION: void glSecondaryColor3bv { glSecondaryColor3bvEXT } ( GLbyte* v ) ;
+GL-FUNCTION: void glSecondaryColor3d { glSecondaryColor3dEXT } ( GLdouble red, GLdouble green, GLdouble blue ) ;
+GL-FUNCTION: void glSecondaryColor3dv { glSecondaryColor3dvEXT } ( GLdouble* v ) ;
+GL-FUNCTION: void glSecondaryColor3f { glSecondaryColor3fEXT } ( GLfloat red, GLfloat green, GLfloat blue ) ;
+GL-FUNCTION: void glSecondaryColor3fv { glSecondaryColor3fvEXT } ( GLfloat* v ) ;
+GL-FUNCTION: void glSecondaryColor3i { glSecondaryColor3iEXT } ( GLint red, GLint green, GLint blue ) ;
+GL-FUNCTION: void glSecondaryColor3iv { glSecondaryColor3ivEXT } ( GLint* v ) ;
+GL-FUNCTION: void glSecondaryColor3s { glSecondaryColor3sEXT } ( GLshort red, GLshort green, GLshort blue ) ;
+GL-FUNCTION: void glSecondaryColor3sv { glSecondaryColor3svEXT } ( GLshort* v ) ;
+GL-FUNCTION: void glSecondaryColor3ub { glSecondaryColor3ubEXT } ( GLubyte red, GLubyte green, GLubyte blue ) ;
+GL-FUNCTION: void glSecondaryColor3ubv { glSecondaryColor3ubvEXT } ( GLubyte* v ) ;
+GL-FUNCTION: void glSecondaryColor3ui { glSecondaryColor3uiEXT } ( GLuint red, GLuint green, GLuint blue ) ;
+GL-FUNCTION: void glSecondaryColor3uiv { glSecondaryColor3uivEXT } ( GLuint* v ) ;
+GL-FUNCTION: void glSecondaryColor3us { glSecondaryColor3usEXT } ( GLushort red, GLushort green, GLushort blue ) ;
+GL-FUNCTION: void glSecondaryColor3usv { glSecondaryColor3usvEXT } ( GLushort* v ) ;
+GL-FUNCTION: void glSecondaryColorPointer { glSecondaryColorPointerEXT } ( GLint size, GLenum type, GLsizei stride, GLvoid* pointer ) ;
+GL-FUNCTION: void glWindowPos2d { glWindowPos2dARB } ( GLdouble x, GLdouble y ) ;
+GL-FUNCTION: void glWindowPos2dv { glWindowPos2dvARB } ( GLdouble* p ) ;
+GL-FUNCTION: void glWindowPos2f { glWindowPos2fARB } ( GLfloat x, GLfloat y ) ;
+GL-FUNCTION: void glWindowPos2fv { glWindowPos2fvARB } ( GLfloat* p ) ;
+GL-FUNCTION: void glWindowPos2i { glWindowPos2iARB } ( GLint x, GLint y ) ;
+GL-FUNCTION: void glWindowPos2iv { glWindowPos2ivARB } ( GLint* p ) ;
+GL-FUNCTION: void glWindowPos2s { glWindowPos2sARB } ( GLshort x, GLshort y ) ;
+GL-FUNCTION: void glWindowPos2sv { glWindowPos2svARB } ( GLshort* p ) ;
+GL-FUNCTION: void glWindowPos3d { glWindowPos3dARB } ( GLdouble x, GLdouble y, GLdouble z ) ;
+GL-FUNCTION: void glWindowPos3dv { glWindowPos3dvARB } ( GLdouble* p ) ;
+GL-FUNCTION: void glWindowPos3f { glWindowPos3fARB } ( GLfloat x, GLfloat y, GLfloat z ) ;
+GL-FUNCTION: void glWindowPos3fv { glWindowPos3fvARB } ( GLfloat* p ) ;
+GL-FUNCTION: void glWindowPos3i { glWindowPos3iARB } ( GLint x, GLint y, GLint z ) ;
+GL-FUNCTION: void glWindowPos3iv { glWindowPos3ivARB } ( GLint* p ) ;
+GL-FUNCTION: void glWindowPos3s { glWindowPos3sARB } ( GLshort x, GLshort y, GLshort z ) ;
+GL-FUNCTION: void glWindowPos3sv { glWindowPos3svARB } ( GLshort* p ) ;
 
 ! OpenGL 1.5
 
@@ -1471,25 +1466,25 @@ GL-FUNCTION: void glWindowPos3sv ( GLshort* p ) ;
 TYPEDEF: ptrdiff_t GLsizeiptr
 TYPEDEF: ptrdiff_t GLintptr
 
-GL-FUNCTION: void glBeginQuery ( GLenum target, GLuint id ) ;
-GL-FUNCTION: void glBindBuffer ( GLenum target, GLuint buffer ) ;
-GL-FUNCTION: void glBufferData ( GLenum target, GLsizeiptr size, GLvoid* data, GLenum usage ) ;
-GL-FUNCTION: void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ;
-GL-FUNCTION: void glDeleteBuffers ( GLsizei n, GLuint* buffers ) ;
-GL-FUNCTION: void glDeleteQueries ( GLsizei n, GLuint* ids ) ;
-GL-FUNCTION: void glEndQuery ( GLenum target ) ;
-GL-FUNCTION: void glGenBuffers ( GLsizei n, GLuint* buffers ) ;
-GL-FUNCTION: void glGenQueries ( GLsizei n, GLuint* ids ) ;
-GL-FUNCTION: void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint* params ) ;
-GL-FUNCTION: void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) ;
-GL-FUNCTION: void glGetBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ;
-GL-FUNCTION: void glGetQueryObjectiv ( GLuint id, GLenum pname, GLint* params ) ;
-GL-FUNCTION: void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint* params ) ;
-GL-FUNCTION: void glGetQueryiv ( GLenum target, GLenum pname, GLint* params ) ;
-GL-FUNCTION: GLboolean glIsBuffer ( GLuint buffer ) ;
-GL-FUNCTION: GLboolean glIsQuery ( GLuint id ) ;
-GL-FUNCTION: GLvoid* glMapBuffer ( GLenum target, GLenum access ) ;
-GL-FUNCTION: GLboolean glUnmapBuffer ( GLenum target ) ;
+GL-FUNCTION: void glBeginQuery { glBeginQueryARB }( GLenum target, GLuint id ) ;
+GL-FUNCTION: void glBindBuffer { glBindBufferARB } ( GLenum target, GLuint buffer ) ;
+GL-FUNCTION: void glBufferData { glBufferDataARB } ( GLenum target, GLsizeiptr size, GLvoid* data, GLenum usage ) ;
+GL-FUNCTION: void glBufferSubData { glBufferSubDataARB } ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ;
+GL-FUNCTION: void glDeleteBuffers { glDeleteBuffersARB } ( GLsizei n, GLuint* buffers ) ;
+GL-FUNCTION: void glDeleteQueries { glDeleteQueriesARB } ( GLsizei n, GLuint* ids ) ;
+GL-FUNCTION: void glEndQuery { glEndQueryARB } ( GLenum target ) ;
+GL-FUNCTION: void glGenBuffers { glGenBuffersARB } ( GLsizei n, GLuint* buffers ) ;
+GL-FUNCTION: void glGenQueries { glGenQueriesARB } ( GLsizei n, GLuint* ids ) ;
+GL-FUNCTION: void glGetBufferParameteriv { glGetBufferParameterivARB } ( GLenum target, GLenum pname, GLint* params ) ;
+GL-FUNCTION: void glGetBufferPointerv { glGetBufferPointervARB } ( GLenum target, GLenum pname, GLvoid** params ) ;
+GL-FUNCTION: void glGetBufferSubData { glGetBufferSubDataARB } ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ;
+GL-FUNCTION: void glGetQueryObjectiv { glGetQueryObjectivARB } ( GLuint id, GLenum pname, GLint* params ) ;
+GL-FUNCTION: void glGetQueryObjectuiv { glGetQueryObjectuivARB } ( GLuint id, GLenum pname, GLuint* params ) ;
+GL-FUNCTION: void glGetQueryiv { glGetQueryivARB } ( GLenum target, GLenum pname, GLint* params ) ;
+GL-FUNCTION: GLboolean glIsBuffer { glIsBufferARB } ( GLuint buffer ) ;
+GL-FUNCTION: GLboolean glIsQuery { glIsQueryARB } ( GLuint id ) ;
+GL-FUNCTION: GLvoid* glMapBuffer { glMapBufferARB } ( GLenum target, GLenum access ) ;
+GL-FUNCTION: GLboolean glUnmapBuffer { glUnmapBufferARB } ( GLenum target ) ;
 
 
 ! OpenGL 2.0
@@ -1583,99 +1578,99 @@ GL-FUNCTION: GLboolean glUnmapBuffer ( GLenum target ) ;
 
 TYPEDEF: char GLchar
 
-GL-FUNCTION: void glAttachShader ( GLuint program, GLuint shader ) ;
-GL-FUNCTION: void glBindAttribLocation ( GLuint program, GLuint index, GLchar* name ) ;
-GL-FUNCTION: void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) ;
-GL-FUNCTION: void glCompileShader ( GLuint shader ) ;
-GL-FUNCTION: GLuint glCreateProgram (  ) ;
-GL-FUNCTION: GLuint glCreateShader ( GLenum type ) ;
-GL-FUNCTION: void glDeleteProgram ( GLuint program ) ;
-GL-FUNCTION: void glDeleteShader ( GLuint shader ) ;
-GL-FUNCTION: void glDetachShader ( GLuint program, GLuint shader ) ;
-GL-FUNCTION: void glDisableVertexAttribArray ( GLuint index ) ;
-GL-FUNCTION: void glDrawBuffers ( GLsizei n, GLenum* bufs ) ;
-GL-FUNCTION: void glEnableVertexAttribArray ( GLuint index ) ;
-GL-FUNCTION: void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ;
-GL-FUNCTION: void glGetActiveUniform ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ;
-GL-FUNCTION: void glGetAttachedShaders ( GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders ) ;
-GL-FUNCTION: GLint glGetAttribLocation ( GLuint program, GLchar* name ) ;
-GL-FUNCTION: void glGetProgramInfoLog ( GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ;
-GL-FUNCTION: void glGetProgramiv ( GLuint program, GLenum pname, GLint* param ) ;
-GL-FUNCTION: void glGetShaderInfoLog ( GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ;
-GL-FUNCTION: void glGetShaderSource ( GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source ) ;
-GL-FUNCTION: void glGetShaderiv ( GLuint shader, GLenum pname, GLint* param ) ;
-GL-FUNCTION: GLint glGetUniformLocation ( GLint programObj, GLchar* name ) ;
-GL-FUNCTION: void glGetUniformfv ( GLuint program, GLint location, GLfloat* params ) ;
-GL-FUNCTION: void glGetUniformiv ( GLuint program, GLint location, GLint* params ) ;
-GL-FUNCTION: void glGetVertexAttribPointerv ( GLuint index, GLenum pname, GLvoid** pointer ) ;
-GL-FUNCTION: void glGetVertexAttribdv ( GLuint index, GLenum pname, GLdouble* params ) ;
-GL-FUNCTION: void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat* params ) ;
-GL-FUNCTION: void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint* params ) ;
-GL-FUNCTION: GLboolean glIsProgram ( GLuint program ) ;
-GL-FUNCTION: GLboolean glIsShader ( GLuint shader ) ;
-GL-FUNCTION: void glLinkProgram ( GLuint program ) ;
-GL-FUNCTION: void glShaderSource ( GLuint shader, GLsizei count, GLchar** strings, GLint* lengths ) ;
-GL-FUNCTION: void glStencilFuncSeparate ( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) ;
-GL-FUNCTION: void glStencilMaskSeparate ( GLenum face, GLuint mask ) ;
-GL-FUNCTION: void glStencilOpSeparate ( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass ) ;
-GL-FUNCTION: void glUniform1f ( GLint location, GLfloat v0 ) ;
-GL-FUNCTION: void glUniform1fv ( GLint location, GLsizei count, GLfloat* value ) ;
-GL-FUNCTION: void glUniform1i ( GLint location, GLint v0 ) ;
-GL-FUNCTION: void glUniform1iv ( GLint location, GLsizei count, GLint* value ) ;
-GL-FUNCTION: void glUniform2f ( GLint location, GLfloat v0, GLfloat v1 ) ;
-GL-FUNCTION: void glUniform2fv ( GLint location, GLsizei count, GLfloat* value ) ;
-GL-FUNCTION: void glUniform2i ( GLint location, GLint v0, GLint v1 ) ;
-GL-FUNCTION: void glUniform2iv ( GLint location, GLsizei count, GLint* value ) ;
-GL-FUNCTION: void glUniform3f ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2 ) ;
-GL-FUNCTION: void glUniform3fv ( GLint location, GLsizei count, GLfloat* value ) ;
-GL-FUNCTION: void glUniform3i ( GLint location, GLint v0, GLint v1, GLint v2 ) ;
-GL-FUNCTION: void glUniform3iv ( GLint location, GLsizei count, GLint* value ) ;
-GL-FUNCTION: void glUniform4f ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) ;
-GL-FUNCTION: void glUniform4fv ( GLint location, GLsizei count, GLfloat* value ) ;
-GL-FUNCTION: void glUniform4i ( GLint location, GLint v0, GLint v1, GLint v2, GLint v3 ) ;
-GL-FUNCTION: void glUniform4iv ( GLint location, GLsizei count, GLint* value ) ;
-GL-FUNCTION: void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUseProgram ( GLuint program ) ;
-GL-FUNCTION: void glValidateProgram ( GLuint program ) ;
-GL-FUNCTION: void glVertexAttrib1d ( GLuint index, GLdouble x ) ;
-GL-FUNCTION: void glVertexAttrib1dv ( GLuint index, GLdouble* v ) ;
-GL-FUNCTION: void glVertexAttrib1f ( GLuint index, GLfloat x ) ;
-GL-FUNCTION: void glVertexAttrib1fv ( GLuint index, GLfloat* v ) ;
-GL-FUNCTION: void glVertexAttrib1s ( GLuint index, GLshort x ) ;
-GL-FUNCTION: void glVertexAttrib1sv ( GLuint index, GLshort* v ) ;
-GL-FUNCTION: void glVertexAttrib2d ( GLuint index, GLdouble x, GLdouble y ) ;
-GL-FUNCTION: void glVertexAttrib2dv ( GLuint index, GLdouble* v ) ;
-GL-FUNCTION: void glVertexAttrib2f ( GLuint index, GLfloat x, GLfloat y ) ;
-GL-FUNCTION: void glVertexAttrib2fv ( GLuint index, GLfloat* v ) ;
-GL-FUNCTION: void glVertexAttrib2s ( GLuint index, GLshort x, GLshort y ) ;
-GL-FUNCTION: void glVertexAttrib2sv ( GLuint index, GLshort* v ) ;
-GL-FUNCTION: void glVertexAttrib3d ( GLuint index, GLdouble x, GLdouble y, GLdouble z ) ;
-GL-FUNCTION: void glVertexAttrib3dv ( GLuint index, GLdouble* v ) ;
-GL-FUNCTION: void glVertexAttrib3f ( GLuint index, GLfloat x, GLfloat y, GLfloat z ) ;
-GL-FUNCTION: void glVertexAttrib3fv ( GLuint index, GLfloat* v ) ;
-GL-FUNCTION: void glVertexAttrib3s ( GLuint index, GLshort x, GLshort y, GLshort z ) ;
-GL-FUNCTION: void glVertexAttrib3sv ( GLuint index, GLshort* v ) ;
-GL-FUNCTION: void glVertexAttrib4Nbv ( GLuint index, GLbyte* v ) ;
-GL-FUNCTION: void glVertexAttrib4Niv ( GLuint index, GLint* v ) ;
-GL-FUNCTION: void glVertexAttrib4Nsv ( GLuint index, GLshort* v ) ;
-GL-FUNCTION: void glVertexAttrib4Nub ( GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w ) ;
-GL-FUNCTION: void glVertexAttrib4Nubv ( GLuint index, GLubyte* v ) ;
-GL-FUNCTION: void glVertexAttrib4Nuiv ( GLuint index, GLuint* v ) ;
-GL-FUNCTION: void glVertexAttrib4Nusv ( GLuint index, GLushort* v ) ;
-GL-FUNCTION: void glVertexAttrib4bv ( GLuint index, GLbyte* v ) ;
-GL-FUNCTION: void glVertexAttrib4d ( GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w ) ;
-GL-FUNCTION: void glVertexAttrib4dv ( GLuint index, GLdouble* v ) ;
-GL-FUNCTION: void glVertexAttrib4f ( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) ;
-GL-FUNCTION: void glVertexAttrib4fv ( GLuint index, GLfloat* v ) ;
-GL-FUNCTION: void glVertexAttrib4iv ( GLuint index, GLint* v ) ;
-GL-FUNCTION: void glVertexAttrib4s ( GLuint index, GLshort x, GLshort y, GLshort z, GLshort w ) ;
-GL-FUNCTION: void glVertexAttrib4sv ( GLuint index, GLshort* v ) ;
-GL-FUNCTION: void glVertexAttrib4ubv ( GLuint index, GLubyte* v ) ;
-GL-FUNCTION: void glVertexAttrib4uiv ( GLuint index, GLuint* v ) ;
-GL-FUNCTION: void glVertexAttrib4usv ( GLuint index, GLushort* v ) ;
-GL-FUNCTION: void glVertexAttribPointer ( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid* pointer ) ;
+GL-FUNCTION: void glAttachShader { glAttachObjectARB } ( GLuint program, GLuint shader ) ;
+GL-FUNCTION: void glBindAttribLocation { glBindAttribLocationARB } ( GLuint program, GLuint index, GLchar* name ) ;
+GL-FUNCTION: void glBlendEquationSeparate { glBlendEquationSeparateEXT } ( GLenum modeRGB, GLenum modeAlpha ) ;
+GL-FUNCTION: void glCompileShader { glCompileShaderARB } ( GLuint shader ) ;
+GL-FUNCTION: GLuint glCreateProgram { glCreateProgramObjectARB } (  ) ;
+GL-FUNCTION: GLuint glCreateShader { glCreateShaderObjectARB } ( GLenum type ) ;
+GL-FUNCTION: void glDeleteProgram { glDeleteObjectARB } ( GLuint program ) ;
+GL-FUNCTION: void glDeleteShader { glDeleteObjectARB } ( GLuint shader ) ;
+GL-FUNCTION: void glDetachShader { glDetachObjectARB } ( GLuint program, GLuint shader ) ;
+GL-FUNCTION: void glDisableVertexAttribArray { glDisableVertexAttribArrayARB } ( GLuint index ) ;
+GL-FUNCTION: void glDrawBuffers { glDrawBuffersARB glDrawBuffersATI } ( GLsizei n, GLenum* bufs ) ;
+GL-FUNCTION: void glEnableVertexAttribArray { glEnableVertexAttribArrayARB } ( GLuint index ) ;
+GL-FUNCTION: void glGetActiveAttrib { glGetActiveAttribARB } ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ;
+GL-FUNCTION: void glGetActiveUniform { glGetActiveUniformARB } ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ;
+GL-FUNCTION: void glGetAttachedShaders { glGetAttachedObjectsARB } ( GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders ) ;
+GL-FUNCTION: GLint glGetAttribLocation { glGetAttribLocationARB } ( GLuint program, GLchar* name ) ;
+GL-FUNCTION: void glGetProgramInfoLog { glGetInfoLogARB } ( GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ;
+GL-FUNCTION: void glGetProgramiv { glGetObjectParameterivARB } ( GLuint program, GLenum pname, GLint* param ) ;
+GL-FUNCTION: void glGetShaderInfoLog { glGetInfoLogARB } ( GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ;
+GL-FUNCTION: void glGetShaderSource { glGetShaderSourceARB } ( GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source ) ;
+GL-FUNCTION: void glGetShaderiv { glGetObjectParameterivARB } ( GLuint shader, GLenum pname, GLint* param ) ;
+GL-FUNCTION: GLint glGetUniformLocation { glGetUniformLocationARB } ( GLint programObj, GLchar* name ) ;
+GL-FUNCTION: void glGetUniformfv { glGetUniformfvARB } ( GLuint program, GLint location, GLfloat* params ) ;
+GL-FUNCTION: void glGetUniformiv { glGetUniformivARB } ( GLuint program, GLint location, GLint* params ) ;
+GL-FUNCTION: void glGetVertexAttribPointerv { glGetVertexAttribPointervARB } ( GLuint index, GLenum pname, GLvoid** pointer ) ;
+GL-FUNCTION: void glGetVertexAttribdv { glGetVertexAttribdvARB } ( GLuint index, GLenum pname, GLdouble* params ) ;
+GL-FUNCTION: void glGetVertexAttribfv { glGetVertexAttribfvARB } ( GLuint index, GLenum pname, GLfloat* params ) ;
+GL-FUNCTION: void glGetVertexAttribiv { glGetVertexAttribivARB } ( GLuint index, GLenum pname, GLint* params ) ;
+GL-FUNCTION: GLboolean glIsProgram { glIsProgramARB } ( GLuint program ) ;
+GL-FUNCTION: GLboolean glIsShader { glIsShaderARB }( GLuint shader ) ;
+GL-FUNCTION: void glLinkProgram { glLinkProgramARB } ( GLuint program ) ;
+GL-FUNCTION: void glShaderSource { glShaderSourceARB } ( GLuint shader, GLsizei count, GLchar** strings, GLint* lengths ) ;
+GL-FUNCTION: void glStencilFuncSeparate { glStencilFuncSeparateATI } ( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) ;
+GL-FUNCTION: void glStencilMaskSeparate { } ( GLenum face, GLuint mask ) ;
+GL-FUNCTION: void glStencilOpSeparate { glStencilOpSeparateATI } ( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass ) ;
+GL-FUNCTION: void glUniform1f { glUniform1fARB } ( GLint location, GLfloat v0 ) ;
+GL-FUNCTION: void glUniform1fv { glUniform1fvARB } ( GLint location, GLsizei count, GLfloat* value ) ;
+GL-FUNCTION: void glUniform1i { glUniform1iARB } ( GLint location, GLint v0 ) ;
+GL-FUNCTION: void glUniform1iv { glUniform1ivARB } ( GLint location, GLsizei count, GLint* value ) ;
+GL-FUNCTION: void glUniform2f { glUniform2fARB } ( GLint location, GLfloat v0, GLfloat v1 ) ;
+GL-FUNCTION: void glUniform2fv { glUniform2fvARB } ( GLint location, GLsizei count, GLfloat* value ) ;
+GL-FUNCTION: void glUniform2i { glUniform2iARB } ( GLint location, GLint v0, GLint v1 ) ;
+GL-FUNCTION: void glUniform2iv { glUniform2ivARB } ( GLint location, GLsizei count, GLint* value ) ;
+GL-FUNCTION: void glUniform3f { glUniform3fARB } ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2 ) ;
+GL-FUNCTION: void glUniform3fv { glUniform3fvARB } ( GLint location, GLsizei count, GLfloat* value ) ;
+GL-FUNCTION: void glUniform3i { glUniform3iARB } ( GLint location, GLint v0, GLint v1, GLint v2 ) ;
+GL-FUNCTION: void glUniform3iv { glUniform3ivARB } ( GLint location, GLsizei count, GLint* value ) ;
+GL-FUNCTION: void glUniform4f { glUniform4fARB } ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) ;
+GL-FUNCTION: void glUniform4fv { glUniform4fvARB } ( GLint location, GLsizei count, GLfloat* value ) ;
+GL-FUNCTION: void glUniform4i { glUniform4iARB } ( GLint location, GLint v0, GLint v1, GLint v2, GLint v3 ) ;
+GL-FUNCTION: void glUniform4iv { glUniform4ivARB } ( GLint location, GLsizei count, GLint* value ) ;
+GL-FUNCTION: void glUniformMatrix2fv { glUniformMatrix2fvARB } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix3fv { glUniformMatrix3fvARB } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix4fv { glUniformMatrix4fvARB } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUseProgram { glUseProgramObjectARB } ( GLuint program ) ;
+GL-FUNCTION: void glValidateProgram { glValidateProgramARB } ( GLuint program ) ;
+GL-FUNCTION: void glVertexAttrib1d { glVertexAttrib1dARB } ( GLuint index, GLdouble x ) ;
+GL-FUNCTION: void glVertexAttrib1dv { glVertexAttrib1dvARB } ( GLuint index, GLdouble* v ) ;
+GL-FUNCTION: void glVertexAttrib1f { glVertexAttrib1fARB } ( GLuint index, GLfloat x ) ;
+GL-FUNCTION: void glVertexAttrib1fv { glVertexAttrib1fvARB } ( GLuint index, GLfloat* v ) ;
+GL-FUNCTION: void glVertexAttrib1s { glVertexAttrib1sARB } ( GLuint index, GLshort x ) ;
+GL-FUNCTION: void glVertexAttrib1sv { glVertexAttrib1svARB } ( GLuint index, GLshort* v ) ;
+GL-FUNCTION: void glVertexAttrib2d { glVertexAttrib2dARB } ( GLuint index, GLdouble x, GLdouble y ) ;
+GL-FUNCTION: void glVertexAttrib2dv { glVertexAttrib2dvARB } ( GLuint index, GLdouble* v ) ;
+GL-FUNCTION: void glVertexAttrib2f { glVertexAttrib2fARB } ( GLuint index, GLfloat x, GLfloat y ) ;
+GL-FUNCTION: void glVertexAttrib2fv { glVertexAttrib2fvARB } ( GLuint index, GLfloat* v ) ;
+GL-FUNCTION: void glVertexAttrib2s { glVertexAttrib2sARB } ( GLuint index, GLshort x, GLshort y ) ;
+GL-FUNCTION: void glVertexAttrib2sv { glVertexAttrib2svARB } ( GLuint index, GLshort* v ) ;
+GL-FUNCTION: void glVertexAttrib3d { glVertexAttrib3dARB } ( GLuint index, GLdouble x, GLdouble y, GLdouble z ) ;
+GL-FUNCTION: void glVertexAttrib3dv { glVertexAttrib3dvARB } ( GLuint index, GLdouble* v ) ;
+GL-FUNCTION: void glVertexAttrib3f { glVertexAttrib3fARB } ( GLuint index, GLfloat x, GLfloat y, GLfloat z ) ;
+GL-FUNCTION: void glVertexAttrib3fv { glVertexAttrib3fvARB } ( GLuint index, GLfloat* v ) ;
+GL-FUNCTION: void glVertexAttrib3s { glVertexAttrib3sARB } ( GLuint index, GLshort x, GLshort y, GLshort z ) ;
+GL-FUNCTION: void glVertexAttrib3sv { glVertexAttrib3svARB } ( GLuint index, GLshort* v ) ;
+GL-FUNCTION: void glVertexAttrib4Nbv { glVertexAttrib4NbvARB } ( GLuint index, GLbyte* v ) ;
+GL-FUNCTION: void glVertexAttrib4Niv { glVertexAttrib4NivARB } ( GLuint index, GLint* v ) ;
+GL-FUNCTION: void glVertexAttrib4Nsv { glVertexAttrib4NsvARB } ( GLuint index, GLshort* v ) ;
+GL-FUNCTION: void glVertexAttrib4Nub { glVertexAttrib4NubARB } ( GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w ) ;
+GL-FUNCTION: void glVertexAttrib4Nubv { glVertexAttrib4NubvARB } ( GLuint index, GLubyte* v ) ;
+GL-FUNCTION: void glVertexAttrib4Nuiv { glVertexAttrib4NuivARB } ( GLuint index, GLuint* v ) ;
+GL-FUNCTION: void glVertexAttrib4Nusv { glVertexAttrib4NusvARB } ( GLuint index, GLushort* v ) ;
+GL-FUNCTION: void glVertexAttrib4bv { glVertexAttrib4bvARB } ( GLuint index, GLbyte* v ) ;
+GL-FUNCTION: void glVertexAttrib4d { glVertexAttrib4dARB } ( GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w ) ;
+GL-FUNCTION: void glVertexAttrib4dv { glVertexAttrib4dvARB } ( GLuint index, GLdouble* v ) ;
+GL-FUNCTION: void glVertexAttrib4f { glVertexAttrib4fARB } ( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) ;
+GL-FUNCTION: void glVertexAttrib4fv { glVertexAttrib4fvARB } ( GLuint index, GLfloat* v ) ;
+GL-FUNCTION: void glVertexAttrib4iv { glVertexAttrib4ivARB } ( GLuint index, GLint* v ) ;
+GL-FUNCTION: void glVertexAttrib4s { glVertexAttrib4sARB } ( GLuint index, GLshort x, GLshort y, GLshort z, GLshort w ) ;
+GL-FUNCTION: void glVertexAttrib4sv { glVertexAttrib4svARB } ( GLuint index, GLshort* v ) ;
+GL-FUNCTION: void glVertexAttrib4ubv { glVertexAttrib4ubvARB } ( GLuint index, GLubyte* v ) ;
+GL-FUNCTION: void glVertexAttrib4uiv { glVertexAttrib4uivARB } ( GLuint index, GLuint* v ) ;
+GL-FUNCTION: void glVertexAttrib4usv { glVertexAttrib4usvARB } ( GLuint index, GLushort* v ) ;
+GL-FUNCTION: void glVertexAttribPointer { glVertexAttribPointerARB } ( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid* pointer ) ;
 
 
 ! OpenGL 2.1
@@ -1699,12 +1694,12 @@ GL-FUNCTION: void glVertexAttribPointer ( GLuint index, GLint size, GLenum type,
 : GL_COMPRESSED_SLUMINANCE HEX: 8C4A ; inline
 : GL_COMPRESSED_SLUMINANCE_ALPHA HEX: 8C4B ; inline
 
-GL-FUNCTION: void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
-GL-FUNCTION: void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix2x3fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix2x4fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix3x2fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix3x4fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix4x2fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
+GL-FUNCTION: void glUniformMatrix4x3fv { } ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ;
 
 
 ! GL_EXT_framebuffer_object
@@ -1762,23 +1757,23 @@ GL-FUNCTION: void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolea
 : GL_RENDERBUFFER_DEPTH_SIZE_EXT HEX: 8D54 ; inline
 : GL_RENDERBUFFER_STENCIL_SIZE_EXT HEX: 8D55 ; inline
 
-GL-FUNCTION: void glBindFramebufferEXT ( GLenum target, GLuint framebuffer ) ;
-GL-FUNCTION: void glBindRenderbufferEXT ( GLenum target, GLuint renderbuffer ) ;
-GL-FUNCTION: GLenum glCheckFramebufferStatusEXT ( GLenum target ) ;
-GL-FUNCTION: void glDeleteFramebuffersEXT ( GLsizei n, GLuint* framebuffers ) ;
-GL-FUNCTION: void glDeleteRenderbuffersEXT ( GLsizei n, GLuint* renderbuffers ) ;
-GL-FUNCTION: void glFramebufferRenderbufferEXT ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) ;
-GL-FUNCTION: void glFramebufferTexture1DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ;
-GL-FUNCTION: void glFramebufferTexture2DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ;
-GL-FUNCTION: void glFramebufferTexture3DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset ) ;
-GL-FUNCTION: void glGenFramebuffersEXT ( GLsizei n, GLuint* framebuffers ) ;
-GL-FUNCTION: void glGenRenderbuffersEXT ( GLsizei n, GLuint* renderbuffers ) ;
-GL-FUNCTION: void glGenerateMipmapEXT ( GLenum target ) ;
-GL-FUNCTION: void glGetFramebufferAttachmentParameterivEXT ( GLenum target, GLenum attachment, GLenum pname, GLint* params ) ;
-GL-FUNCTION: void glGetRenderbufferParameterivEXT ( GLenum target, GLenum pname, GLint* params ) ;
-GL-FUNCTION: GLboolean glIsFramebufferEXT ( GLuint framebuffer ) ;
-GL-FUNCTION: GLboolean glIsRenderbufferEXT ( GLuint renderbuffer ) ;
-GL-FUNCTION: void glRenderbufferStorageEXT ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) ;
+GL-FUNCTION: void glBindFramebufferEXT { } ( GLenum target, GLuint framebuffer ) ;
+GL-FUNCTION: void glBindRenderbufferEXT { } ( GLenum target, GLuint renderbuffer ) ;
+GL-FUNCTION: GLenum glCheckFramebufferStatusEXT { } ( GLenum target ) ;
+GL-FUNCTION: void glDeleteFramebuffersEXT { } ( GLsizei n, GLuint* framebuffers ) ;
+GL-FUNCTION: void glDeleteRenderbuffersEXT { } ( GLsizei n, GLuint* renderbuffers ) ;
+GL-FUNCTION: void glFramebufferRenderbufferEXT { } ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) ;
+GL-FUNCTION: void glFramebufferTexture1DEXT { } ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ;
+GL-FUNCTION: void glFramebufferTexture2DEXT { } ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ;
+GL-FUNCTION: void glFramebufferTexture3DEXT { } ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset ) ;
+GL-FUNCTION: void glGenFramebuffersEXT { } ( GLsizei n, GLuint* framebuffers ) ;
+GL-FUNCTION: void glGenRenderbuffersEXT { } ( GLsizei n, GLuint* renderbuffers ) ;
+GL-FUNCTION: void glGenerateMipmapEXT { } ( GLenum target ) ;
+GL-FUNCTION: void glGetFramebufferAttachmentParameterivEXT { } ( GLenum target, GLenum attachment, GLenum pname, GLint* params ) ;
+GL-FUNCTION: void glGetRenderbufferParameterivEXT { } ( GLenum target, GLenum pname, GLint* params ) ;
+GL-FUNCTION: GLboolean glIsFramebufferEXT { } ( GLuint framebuffer ) ;
+GL-FUNCTION: GLboolean glIsRenderbufferEXT { } ( GLuint renderbuffer ) ;
+GL-FUNCTION: void glRenderbufferStorageEXT { } ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) ;
 
 
 ! GL_ARB_texture_float
diff --git a/extra/opengl/gl/unix/unix.factor b/extra/opengl/gl/unix/unix.factor
index 16cd38f92f..2ee4558a5e 100644
--- a/extra/opengl/gl/unix/unix.factor
+++ b/extra/opengl/gl/unix/unix.factor
@@ -1,5 +1,10 @@
-USING: alien.syntax kernel syntax words ;
+USING: alien.syntax alien.syntax.private kernel
+       namespaces parser sequences syntax words ;
 
 IN: opengl.gl.unix
 
-: GL-FUNCTION: POSTPONE: FUNCTION: ; parsing
+: GL-FUNCTION:
+    scan "c-library" get scan
+    scan drop "}" parse-tokens drop
+    ";" parse-tokens [ "()" subseq? not ] subset
+    define-function ; parsing
diff --git a/extra/opengl/gl/windows/windows.factor b/extra/opengl/gl/windows/windows.factor
index 186f17206c..fc0bca00bb 100755
--- a/extra/opengl/gl/windows/windows.factor
+++ b/extra/opengl/gl/windows/windows.factor
@@ -29,6 +29,7 @@ PRIVATE>
     scan
     scan
     dup gl-function-number [ gl-function-pointer ] 2curry swap
+    scan drop "}" parse-tokens drop
     ";" parse-tokens [ "()" subseq? not ] subset
     define-indirect
     ; parsing

From 0c1b63c5f2f06880cc6ddfad1ecc4f1487e7bb28 Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Mon, 4 Feb 2008 17:42:35 -0800
Subject: [PATCH 02/24] Fix typo in the float-vector docs

---
 core/float-vectors/float-vectors-docs.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/float-vectors/float-vectors-docs.factor b/core/float-vectors/float-vectors-docs.factor
index f0901fd46f..ef0645a0af 100755
--- a/core/float-vectors/float-vectors-docs.factor
+++ b/core/float-vectors/float-vectors-docs.factor
@@ -12,7 +12,7 @@ $nl
 { $subsection >float-vector }
 { $subsection <float-vector> }
 "If you don't care about initial capacity, a more elegant way to create a new float vector is to write:"
-{ $code "BV{ } clone" } ;
+{ $code "FV{ } clone" } ;
 
 ABOUT: "float-vectors"
 

From a4a3ea3fa47defbf5de013dc9e27bced28f54c5c Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Thu, 7 Feb 2008 22:24:51 -0800
Subject: [PATCH 03/24] Fix typos in opengl fallback function lists

---
 extra/opengl/gl/gl.factor | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/extra/opengl/gl/gl.factor b/extra/opengl/gl/gl.factor
index f2de019348..5b3dade851 100644
--- a/extra/opengl/gl/gl.factor
+++ b/extra/opengl/gl/gl.factor
@@ -1365,7 +1365,7 @@ GL-FUNCTION: void glSampleCoverage { glSampleCoverageARB } ( GLclampf value, GLb
 : GL_COMPARE_R_TO_TEXTURE HEX: 884E ; inline
 
 GL-FUNCTION: void glBlendColor { glBlendColorEXT } ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ;
-GL-FUNCTION: void glBlendEquation { glBlendEquationEXT }( GLenum mode ) ;
+GL-FUNCTION: void glBlendEquation { glBlendEquationEXT } ( GLenum mode ) ;
 GL-FUNCTION: void glBlendFuncSeparate { glBlendFuncSeparateEXT } ( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ) ;
 GL-FUNCTION: void glFogCoordPointer { glFogCoordPointerEXT } ( GLenum type, GLsizei stride, GLvoid* pointer ) ;
 GL-FUNCTION: void glFogCoordd { glFogCoorddEXT } ( GLdouble coord ) ;
@@ -1466,7 +1466,7 @@ GL-FUNCTION: void glWindowPos3sv { glWindowPos3svARB } ( GLshort* p ) ;
 TYPEDEF: ptrdiff_t GLsizeiptr
 TYPEDEF: ptrdiff_t GLintptr
 
-GL-FUNCTION: void glBeginQuery { glBeginQueryARB }( GLenum target, GLuint id ) ;
+GL-FUNCTION: void glBeginQuery { glBeginQueryARB } ( GLenum target, GLuint id ) ;
 GL-FUNCTION: void glBindBuffer { glBindBufferARB } ( GLenum target, GLuint buffer ) ;
 GL-FUNCTION: void glBufferData { glBufferDataARB } ( GLenum target, GLsizeiptr size, GLvoid* data, GLenum usage ) ;
 GL-FUNCTION: void glBufferSubData { glBufferSubDataARB } ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ;

From c906d26b131882a8d6826216c320b8b834681da0 Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Thu, 7 Feb 2008 22:43:05 -0800
Subject: [PATCH 04/24] Do dynamic lookup of OpenGL 1.2+ functions on all
 platforms. Use fallback extension names when the official name is not
 available, e.g., if glUseProgram is missing try glUseProgramObjectARB instead

---
 extra/hash2/hash2-docs.factor                |  2 +-
 extra/opengl/gl/extensions/extensions.factor | 46 ++++++++++++++++++++
 extra/opengl/gl/gl.factor                    | 12 +++--
 extra/opengl/gl/macosx/macosx.factor         |  6 +++
 extra/opengl/gl/unix/unix.factor             | 12 ++---
 extra/opengl/gl/windows/windows.factor       | 37 ++--------------
 extra/sequences/lib/lib.factor               | 13 +++++-
 extra/x11/glx/glx.factor                     |  2 +-
 8 files changed, 79 insertions(+), 51 deletions(-)
 create mode 100644 extra/opengl/gl/extensions/extensions.factor
 create mode 100644 extra/opengl/gl/macosx/macosx.factor

diff --git a/extra/hash2/hash2-docs.factor b/extra/hash2/hash2-docs.factor
index 5bcbb7cc11..b3e1a53cea 100644
--- a/extra/hash2/hash2-docs.factor
+++ b/extra/hash2/hash2-docs.factor
@@ -1,7 +1,7 @@
 USING: help.syntax help.markup ;
 IN: hash2
 
-ARTICLE: { "hash2" "intro" }
+ARTICLE: { "hash2" "intro" } "hash2 Vocabulary"
 "The hash2 vocabulary specifies a simple minimal datastructure for hash tables with two integers as keys. These hash tables are fixed size and do not conform to the associative mapping protocol. Words used in creating and manipulating these hash tables include:"
 { $subsection <hash2> }
 { $subsection hash2 }
diff --git a/extra/opengl/gl/extensions/extensions.factor b/extra/opengl/gl/extensions/extensions.factor
new file mode 100644
index 0000000000..e05e3a1af5
--- /dev/null
+++ b/extra/opengl/gl/extensions/extensions.factor
@@ -0,0 +1,46 @@
+USING: alien alien.syntax combinators kernel parser sequences
+system words namespaces hashtables init math arrays assocs 
+sequences.lib continuations ;
+<< {
+    { [ windows? ] [ "opengl.gl.windows" ] }
+    { [ macosx? ]  [ "opengl.gl.macosx" ] }
+    { [ unix? ] [ "opengl.gl.unix" ] }
+    { [ t ] [ "Unknown OpenGL platform" throw ] }
+} cond use+ >>
+IN: opengl.gl.extensions
+
+SYMBOL: +gl-function-number-counter+
+SYMBOL: +gl-function-pointers+
+
+: reset-gl-function-number-counter ( -- )
+    0 +gl-function-number-counter+ set-global ;
+: reset-gl-function-pointers ( -- )
+    100 <hashtable> +gl-function-pointers+ set-global ;
+    
+[ reset-gl-function-pointers ] "opengl.gl init hook" add-init-hook
+reset-gl-function-pointers
+reset-gl-function-number-counter
+
+: gl-function-number ( -- n )
+    +gl-function-number-counter+ get-global
+    dup 1+ +gl-function-number-counter+ set-global ;
+
+: gl-function-pointer ( names n -- funptr )
+    gl-function-context 2array dup +gl-function-pointers+ get-global at
+    [ 2nip ] [
+        >r [ gl-function-address ] attempt-each 
+        dup [ "OpenGL function not available" throw ] unless
+        dup r>
+        +gl-function-pointers+ get-global set-at
+    ] if* ;
+
+: GL-FUNCTION:
+    gl-function-calling-convention
+    scan
+    scan dup
+    scan drop "}" parse-tokens swap add*
+    gl-function-number
+    [ gl-function-pointer ] 2curry swap
+    ";" parse-tokens [ "()" subseq? not ] subset
+    define-indirect
+    ; parsing
diff --git a/extra/opengl/gl/gl.factor b/extra/opengl/gl/gl.factor
index 5b3dade851..59b2422d73 100644
--- a/extra/opengl/gl/gl.factor
+++ b/extra/opengl/gl/gl.factor
@@ -3,8 +3,8 @@
 
 ! This file is based on the gl.h that comes with xorg-x11 6.8.2
 
-USING: alien alien.syntax kernel parser sequences system words ;
-<< windows? "opengl.gl.windows" "opengl.gl.unix" ? use+ >>
+USING: alien alien.syntax combinators kernel parser sequences
+system words opengl.gl.extensions ;
 
 IN: opengl.gl
 
@@ -1119,9 +1119,7 @@ FUNCTION: void glLoadName ( GLuint name ) ;
 FUNCTION: void glPushName ( GLuint name ) ;
 FUNCTION: void glPopName ( ) ;
 
-
-! OpenGL extension functions
-
+<< reset-gl-function-number-counter >>
 
 ! OpenGL 1.2
 
@@ -1273,7 +1271,7 @@ GL-FUNCTION: void glTexSubImage3D { glTexSubImage3DEXT } ( GLenum target, GLint
 : GL_DOT3_RGBA HEX: 86AF ; inline
 : GL_MULTISAMPLE_BIT HEX: 20000000 ; inline
 
-GL-FUNCTION: void glActiveTexture { glActiveTextureARB }( GLenum texture ) ;
+GL-FUNCTION: void glActiveTexture { glActiveTextureARB } ( GLenum texture ) ;
 GL-FUNCTION: void glClientActiveTexture { glClientActiveTextureARB } ( GLenum texture ) ;
 GL-FUNCTION: void glCompressedTexImage1D { glCompressedTexImage1DARB } ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid* data ) ;
 GL-FUNCTION: void glCompressedTexImage2D { glCompressedTexImage2DARB } ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid* data ) ;
@@ -1607,7 +1605,7 @@ GL-FUNCTION: void glGetVertexAttribdv { glGetVertexAttribdvARB } ( GLuint index,
 GL-FUNCTION: void glGetVertexAttribfv { glGetVertexAttribfvARB } ( GLuint index, GLenum pname, GLfloat* params ) ;
 GL-FUNCTION: void glGetVertexAttribiv { glGetVertexAttribivARB } ( GLuint index, GLenum pname, GLint* params ) ;
 GL-FUNCTION: GLboolean glIsProgram { glIsProgramARB } ( GLuint program ) ;
-GL-FUNCTION: GLboolean glIsShader { glIsShaderARB }( GLuint shader ) ;
+GL-FUNCTION: GLboolean glIsShader { glIsShaderARB } ( GLuint shader ) ;
 GL-FUNCTION: void glLinkProgram { glLinkProgramARB } ( GLuint program ) ;
 GL-FUNCTION: void glShaderSource { glShaderSourceARB } ( GLuint shader, GLsizei count, GLchar** strings, GLint* lengths ) ;
 GL-FUNCTION: void glStencilFuncSeparate { glStencilFuncSeparateATI } ( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) ;
diff --git a/extra/opengl/gl/macosx/macosx.factor b/extra/opengl/gl/macosx/macosx.factor
new file mode 100644
index 0000000000..3d4cb6ae93
--- /dev/null
+++ b/extra/opengl/gl/macosx/macosx.factor
@@ -0,0 +1,6 @@
+USING: kernel alien ;
+IN: opengl.gl.macosx
+
+: gl-function-context ( -- context ) 0 ; inline
+: gl-function-address ( name -- address ) "gl" load-library dlsym ; inline
+: gl-function-calling-convention ( -- str ) "cdecl" ; inline
diff --git a/extra/opengl/gl/unix/unix.factor b/extra/opengl/gl/unix/unix.factor
index 2ee4558a5e..d36e4a2906 100644
--- a/extra/opengl/gl/unix/unix.factor
+++ b/extra/opengl/gl/unix/unix.factor
@@ -1,10 +1,6 @@
-USING: alien.syntax alien.syntax.private kernel
-       namespaces parser sequences syntax words ;
-
+USING: kernel x11.glx ;
 IN: opengl.gl.unix
 
-: GL-FUNCTION:
-    scan "c-library" get scan
-    scan drop "}" parse-tokens drop
-    ";" parse-tokens [ "()" subseq? not ] subset
-    define-function ; parsing
+: gl-function-context ( -- context ) glXGetCurrentContext ; inline
+: gl-function-address ( name -- address ) glXGetProcAddress ; inline
+: gl-function-calling-convention ( -- str ) "cdecl" ; inline
diff --git a/extra/opengl/gl/windows/windows.factor b/extra/opengl/gl/windows/windows.factor
index fc0bca00bb..cc59167539 100755
--- a/extra/opengl/gl/windows/windows.factor
+++ b/extra/opengl/gl/windows/windows.factor
@@ -1,35 +1,6 @@
-USING: alien alien.syntax arrays assocs hashtables init kernel
-       libc math namespaces parser sequences syntax system vectors
-       windows.opengl32 ;
-
+USING: kernel windows.opengl32 ;
 IN: opengl.gl.windows
 
-<PRIVATE
-
-SYMBOL: gl-function-number-counter
-SYMBOL: gl-function-pointers
-
-0 gl-function-number-counter set
-[ 100 <hashtable> gl-function-pointers set ] "opengl.gl.windows init hook" add-init-hook
-
-: gl-function-number ( -- n )
-    gl-function-number-counter get
-    dup 1+ gl-function-number-counter set ;
-
-: gl-function-pointer ( name n -- funptr )
-    wglGetCurrentContext 2array dup gl-function-pointers get at
-    [ -rot 2drop ]
-    [ >r wglGetProcAddress dup r> gl-function-pointers get set-at ]
-    if* ;
-
-PRIVATE>
-
-: GL-FUNCTION:
-    "stdcall"
-    scan
-    scan
-    dup gl-function-number [ gl-function-pointer ] 2curry swap
-    scan drop "}" parse-tokens drop
-    ";" parse-tokens [ "()" subseq? not ] subset
-    define-indirect
-    ; parsing
+: gl-function-context ( -- context ) wglGetCurrentContext alien-address ; inline
+: gl-function-address ( name -- address ) wglGetProcAddress ; inline
+: gl-function-calling-convention ( -- str ) "stdcall" ; inline
diff --git a/extra/sequences/lib/lib.factor b/extra/sequences/lib/lib.factor
index d89c5eec89..b761bf957f 100755
--- a/extra/sequences/lib/lib.factor
+++ b/extra/sequences/lib/lib.factor
@@ -1,6 +1,6 @@
 USING: combinators.lib kernel sequences math namespaces assocs 
 random sequences.private shuffle math.functions mirrors
-arrays math.parser sorting strings ascii ;
+arrays math.parser math.private sorting strings ascii ;
 IN: sequences.lib
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -153,3 +153,14 @@ PRIVATE>
   [ = [ ] [ drop f ] if ] curry
   2map
   [ ] subset ;
+
+<PRIVATE
+: (attempt-each-integer) ( i n quot -- result )
+    [
+        iterate-step roll
+        [ 3nip ] [ iterate-next (attempt-each-integer) ] if*
+    ] [ 3drop f ] if-iterate? ; inline
+PRIVATE>
+
+: attempt-each ( seq quot -- result )
+    (each) iterate-prep (attempt-each-integer) ; inline
\ No newline at end of file
diff --git a/extra/x11/glx/glx.factor b/extra/x11/glx/glx.factor
index 2b1d05e2e4..becf6fad28 100644
--- a/extra/x11/glx/glx.factor
+++ b/extra/x11/glx/glx.factor
@@ -42,7 +42,7 @@ FUNCTION: GLXContext glXCreateContext ( Display* dpy, XVisualInfo* vis, GLXConte
 FUNCTION: GLXPixmap glXCreateGLXPixmap ( Display* dpy, XVisualInfo* vis, Pixmap pixmap ) ;
 FUNCTION: void glXDestroyContext ( Display* dpy, GLXContext ctx ) ;
 FUNCTION: void glXDestroyGLXPixmap ( Display* dpy, GLXPixmap pix ) ;
-FUNCTION: int glXGetConfig ( Display* dpy, XVisualInfo* vis, int attrib, int* value) ;
+FUNCTION: int glXGetConfig ( Display* dpy, XVisualInfo* vis, int attrib, int* value ) ;
 FUNCTION: GLXContext glXGetCurrentContext ( ) ;
 FUNCTION: GLXDrawable glXGetCurrentDrawable ( ) ;
 FUNCTION: bool glXIsDirect ( Display* dpy, GLXContext ctx ) ;

From aa7f8399487a1078670dcc577af94c6ef0545993 Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Fri, 8 Feb 2008 17:32:02 -0800
Subject: [PATCH 05/24] Have glXGetProcAddress fall back to
 glXGetProcAddressARB if not present

---
 extra/x11/glx/glx.factor | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/extra/x11/glx/glx.factor b/extra/x11/glx/glx.factor
index becf6fad28..9107c2d394 100644
--- a/extra/x11/glx/glx.factor
+++ b/extra/x11/glx/glx.factor
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 !
 ! based on glx.h from xfree86, and some of glxtokens.h
-USING: alien alien.c-types alien.syntax x11.xlib
-namespaces kernel sequences ;
+USING: alien alien.c-types alien.syntax alien.syntax.private x11.xlib
+namespaces kernel sequences parser words ;
 IN: x11.glx
 
 LIBRARY: glx
@@ -78,6 +78,15 @@ FUNCTION: void glXSelectEvent ( Display* dpy, GLXDrawable draw, ulong event_mask
 FUNCTION: void glXGetSelectedEvent ( Display* dpy, GLXDrawable draw, ulong* event_mask ) ;
 
 ! GLX 1.4 and later
+! Fall back to the extension function glXGetProcAddressARB if necessary
+<< "glx" load-library "glXGetProcAddress" dlsym
+    [ "void*" "glx" "glXGetProcAddress" { "char*" "procname" } define-function ]
+    [
+        "void*" "glx" "glXGetProcAddressARB" { "char*" "procname" } define-function
+        "glXGetProcAddress" create-in [ glXGetProcAddressARB ] define make-inline
+    ]
+    if >>
+    
 FUNCTION: void* glXGetProcAddress ( char* procname ) ;
 
 ! GLX Events

From eefa95ad25fa90e643dda6e42b156516a5039d97 Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Fri, 8 Feb 2008 18:00:29 -0800
Subject: [PATCH 06/24] Remove useless alien-address call from
 opengl.gl.windows

---
 extra/opengl/gl/windows/windows.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra/opengl/gl/windows/windows.factor b/extra/opengl/gl/windows/windows.factor
index cc59167539..8f48f60d3c 100755
--- a/extra/opengl/gl/windows/windows.factor
+++ b/extra/opengl/gl/windows/windows.factor
@@ -1,6 +1,6 @@
 USING: kernel windows.opengl32 ;
 IN: opengl.gl.windows
 
-: gl-function-context ( -- context ) wglGetCurrentContext alien-address ; inline
+: gl-function-context ( -- context ) wglGetCurrentContext ; inline
 : gl-function-address ( name -- address ) wglGetProcAddress ; inline
 : gl-function-calling-convention ( -- str ) "stdcall" ; inline

From 890c5702da91f4994b9547a9662922f553fe95ec Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Fri, 8 Feb 2008 18:18:44 -0800
Subject: [PATCH 07/24] On second thought, no point in being clever with
 glXGetProcAddress. Just always use glXGetProcAddressARB, which should always
 be available on any GLX implementation with any extension support

---
 extra/opengl/gl/unix/unix.factor |  2 +-
 extra/x11/glx/glx.factor         | 12 +++---------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/extra/opengl/gl/unix/unix.factor b/extra/opengl/gl/unix/unix.factor
index d36e4a2906..3352b18350 100644
--- a/extra/opengl/gl/unix/unix.factor
+++ b/extra/opengl/gl/unix/unix.factor
@@ -2,5 +2,5 @@ USING: kernel x11.glx ;
 IN: opengl.gl.unix
 
 : gl-function-context ( -- context ) glXGetCurrentContext ; inline
-: gl-function-address ( name -- address ) glXGetProcAddress ; inline
+: gl-function-address ( name -- address ) glXGetProcAddressARB ; inline
 : gl-function-calling-convention ( -- str ) "cdecl" ; inline
diff --git a/extra/x11/glx/glx.factor b/extra/x11/glx/glx.factor
index 9107c2d394..a8608235f2 100644
--- a/extra/x11/glx/glx.factor
+++ b/extra/x11/glx/glx.factor
@@ -78,17 +78,11 @@ FUNCTION: void glXSelectEvent ( Display* dpy, GLXDrawable draw, ulong event_mask
 FUNCTION: void glXGetSelectedEvent ( Display* dpy, GLXDrawable draw, ulong* event_mask ) ;
 
 ! GLX 1.4 and later
-! Fall back to the extension function glXGetProcAddressARB if necessary
-<< "glx" load-library "glXGetProcAddress" dlsym
-    [ "void*" "glx" "glXGetProcAddress" { "char*" "procname" } define-function ]
-    [
-        "void*" "glx" "glXGetProcAddressARB" { "char*" "procname" } define-function
-        "glXGetProcAddress" create-in [ glXGetProcAddressARB ] define make-inline
-    ]
-    if >>
-    
 FUNCTION: void* glXGetProcAddress ( char* procname ) ;
 
+! GLX_ARB_get_proc_address extension
+FUNCTION: void* glXGetProcAddressARB ( char* procname ) ;
+
 ! GLX Events
 ! (also skipped for now. only has GLXPbufferClobberEvent, the rest is handled by xlib methinks
 

From 3b6e6a1e1395497b4264be2c194c3f0f100fa155 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Mon, 11 Feb 2008 17:19:27 -0600
Subject: [PATCH 08/24] add query>hash* to html.parser.analyzer

---
 extra/html/parser/analyzer/analyzer.factor | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/extra/html/parser/analyzer/analyzer.factor b/extra/html/parser/analyzer/analyzer.factor
index dcfbd1e197..fca15d9b07 100755
--- a/extra/html/parser/analyzer/analyzer.factor
+++ b/extra/html/parser/analyzer/analyzer.factor
@@ -1,5 +1,6 @@
 USING: assocs html.parser kernel math sequences strings ascii
-arrays shuffle unicode.case namespaces ;
+arrays shuffle unicode.case namespaces splitting
+http.server.responders ;
 IN: html.parser.analyzer
 
 : remove-blank-text ( vector -- vector' )
@@ -81,5 +82,14 @@ IN: html.parser.analyzer
 : href-contains? ( str tag -- ? )
     tag-attributes "href" swap at* [ subseq? ] [ 2drop f ] if ;
 
+: query>hash* ( str -- hash )
+    "?" split1 nip query>hash ;
+
 ! clear "http://fark.com" http-get parse-html find-links [ "go.pl" swap start ] subset [ "=" split peek ] map
 
+! clear "http://www.sailwx.info/shiptrack/cruiseships.phtml" http-get parse-html remove-blank-text
+! "a" over find-opening-tags-by-name
+! [ nip "shipposition.phtml?call=GBTT" swap href-contains? ] assoc-subset
+! first first 8 + over nth
+! tag-attributes "href" swap at query>hash*
+! "lat" over at "lon" rot at

From 0b9d1c5141cd666e74f8328b0e9c4e311b13bc62 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Mon, 11 Feb 2008 18:11:29 -0600
Subject: [PATCH 09/24] add total collector to taxes

---
 extra/taxes/taxes.factor | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/extra/taxes/taxes.factor b/extra/taxes/taxes.factor
index 0f51d7ab6a..2c5501c357 100644
--- a/extra/taxes/taxes.factor
+++ b/extra/taxes/taxes.factor
@@ -105,11 +105,6 @@ M: federal withholding ( salary w4 tax-table -- x )
 M: federal net ( salary w4 collector -- x )
     >r dupd r> withholding - ;
 
-M: collector net ( salary w4 collector -- x )
-    >r dupd r>
-    [ withholding ] 3keep
-    drop <federal> withholding + - ;
-
 
 ! Minnesota
 : minnesota-single ( -- triples )
@@ -138,3 +133,15 @@ M: minnesota adjust-allowances ( salary w4 collector -- newsalary )
 
 M: minnesota withholding ( salary w4 collector -- x )
     [ adjust-allowances ] 2keep marriage-table tax ;
+
+TUPLE: total ;
+INSTANCE: total collector
+
+! Totals
+M: total net ( salary w4 collector -- x )
+    >r dupd r>
+    [ withholding ] 3keep
+    drop <federal> withholding + - ;
+
+M: total withholding ( salary w4 collector -- x )
+    >r >r dup r> r> net - ;

From ecb28dc0292c3096c0f8b9d6c48b73bfc9670b12 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 18:13:49 -0600
Subject: [PATCH 10/24] builder: Switching to single report model

---
 extra/builder/builder.factor   | 146 +++++++++++++++++++++++++++++----
 extra/builder/test/test.factor |  48 +++++++++--
 2 files changed, 172 insertions(+), 22 deletions(-)

diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor
index bb83fcf3f8..1783a36928 100644
--- a/extra/builder/builder.factor
+++ b/extra/builder/builder.factor
@@ -133,36 +133,154 @@ VAR: stamp
   
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-SYMBOL: build-status
+! SYMBOL: build-status
 
-: build ( -- )
+! : build ( -- )
+
+!   enter-build-dir
+  
+!   git-clone "git clone error" run-or-notify
+
+!   "factor" cd
+
+!   record-git-id
+
+!   make-clean "make clean error" run-or-notify
+
+!   make-vm "vm compile error" "../compile-log" run-or-send-file
+
+!   retrieve-boot-image
+
+!   bootstrap "bootstrap error" "../boot-log" run-or-send-file
+
+!   builder-test "builder.test fatal error" run-or-notify
+  
+!   "../load-everything-log" exists?
+!   [ "load-everything" "../load-everything-log" email-file ]
+!   when
+
+!   "../failing-tests" exists?
+!   [ "failing tests" "../failing-tests" email-file ]
+!   when ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+SYMBOL: report
+
+: (build) ( -- )
 
   enter-build-dir
-  
-  git-clone "git clone error" run-or-notify
+
+  "report" <file-writer> report set
+
+  report get [ "Build machine:   " write host-name write nl ] with-stream*
+
+  report get [ "Build directory: " write cwd write nl ] with-stream*
+
+  [ git-clone try-process ]
+  [
+    report get
+     [ "Builder fatal error: git clone failed" write nl ]
+    with-stream*
+    throw
+  ]
+  recover
 
   "factor" cd
 
   record-git-id
 
-  make-clean "make clean error" run-or-notify
+  make-clean run-process drop
 
-  make-vm "vm compile error" "../compile-log" run-or-send-file
+  [ make-vm try-process ]
+  [
+    report get
+    [
+      "Builder fatal error: vm compile error" write nl
+      "../compile-log" <file-reader> contents write
+    ]
+    with-stream*
+    throw
+  ]
+  recover
 
-  retrieve-boot-image
+  [ my-arch download-image ]
+  [
+    report get
+      [ "Builder fatal error: image download" write nl ]
+    with-stream*
+    throw
+  ]
+  recover
 
-  bootstrap "bootstrap error" "../boot-log" run-or-send-file
+  [ bootstrap try-process ]
+  [
+    report get
+      [
+        "Bootstrap error" write nl
+        "../boot-log" <file-reader> contents write
+      ]
+    with-stream*
+    throw
+  ]
+  recover
 
-  builder-test "builder.test fatal error" run-or-notify
-  
-  "../load-everything-log" exists?
-  [ "load-everything" "../load-everything-log" email-file ]
+  [ builder-test try-process ]
+  [
+    report get
+      [
+        "Builder test error" write nl
+        "../load-everything-log" exists?
+          [ "../load-everything-log" <file-reader> contents write nl ]
+        when
+        "../test-all-log" exists?
+          [ "../test-all-log" <file-reader> contents write nl ]
+        when
+      ]
+    with-stream*
+    throw
+  ]
+  recover
+
+  report get
+    [
+      "Bootstrap time: " write
+      "../bootstrap-time" <file-reader> contents write nl
+    ]
+  with-stream*
+
+  "../load-everything-vocabs" exists?
+    [
+      report get
+        [
+          "Did not pass load-everything: " write nl
+          "../load-everything-vocabs" <file-reader> contents write nl
+        ]
+      with-stream*
+    ]
   when
 
-  "../failing-tests" exists?
-  [ "failing tests" "../failing-tests" email-file ]
+  "../test-all-vocabs" exists?
+    [
+      report get
+        [
+          "Did not pass test-all: " write nl
+          "../test-all-vocabs" <file-reader> contents write nl
+        ]
+      with-stream*
+    ]
   when ;
 
+: send-report ( -- )
+  report get dispose
+  "report" "../report" email-file ;
+
+: build ( -- )
+  [ (build) ]
+    [ drop ]
+  recover
+  send-report ;
+
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 : minutes>ms ( min -- ms ) 60 * 1000 * ;
diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index b77199c7c5..159fe02ad6 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -7,22 +7,54 @@ USING: kernel sequences assocs builder continuations vocabs vocabs.loader
 
 IN: builder.test
 
+: record-bootstrap-time ( -- )
+  "../bootstrap-time" <file-writer>
+    [ bootstrap-time get . ]
+  with-stream ;
+
 : try-everything* ( -- vocabs ) try-everything [ first vocab-link-name ] map ;
 
+! : do-load ( -- )
+!   [ try-everything* ] "../load-everything-time" log-runtime
+!   dup empty?
+!     [ drop ]
+!     [ "../load-everything-log" log-object ]
+!   if ;
+
 : do-load ( -- )
-  [ try-everything* ] "../load-everything-time" log-runtime
+  [
+    "../load-everything-log" <file-writer>
+      [ try-everything* ]
+    with-stream
+  ] "../load-everything-time" log-runtime
   dup empty?
     [ drop ]
-    [ "../load-everything-log" log-object ]
-  if ;
+    [ "../load-everything-vocabs" log-object ]
+  if
+  "../load-everything-log" delete-file ;
+
+! : do-tests ( -- )
+!   run-all-tests keys
+!   dup empty?
+!   [ drop ]
+!   [ "../failing-tests" log-object ]
+!   if ;
 
 : do-tests ( -- )
-  run-all-tests keys
+  [
+    "../test-all-log" <file-writer>
+      [ run-all-tests keys ]
+    with-stream
+  ] "../test-all-time" log-runtime
   dup empty?
-  [ drop ]
-  [ "../failing-tests" log-object ]
-  if ;
+    [ drop ]
+    [ "../test-all-vocabs" log-object ]
+  if
+  "../test-all-log" delete-file ;
 
-: do-all ( -- ) do-load do-tests ;
+: do-all ( -- )
+  record-bootstrap-time
+  do-load
+  do-tests ;
 
 MAIN: do-all
\ No newline at end of file

From ad0b2cb08c22ecad37ada3e4135321e93f91bc66 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 18:34:02 -0600
Subject: [PATCH 11/24] builder.test: fix using

---
 extra/builder/test/test.factor | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index 159fe02ad6..dfe64b38d9 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -3,7 +3,8 @@ USING: kernel sequences assocs builder continuations vocabs vocabs.loader
        io
        io.files
        tools.browser
-       tools.test ;
+       tools.test
+       bootstrap.stage2 ;
 
 IN: builder.test
 

From fb13521418511c939609901d8a9dd9e0b8ecb260 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 18:35:27 -0600
Subject: [PATCH 12/24] builder.test: more using fixes

---
 extra/builder/test/test.factor | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index dfe64b38d9..6f87213096 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -1,7 +1,9 @@
 
-USING: kernel sequences assocs builder continuations vocabs vocabs.loader
+USING: kernel namespaces sequences assocs builder continuations
+       vocabs vocabs.loader
        io
        io.files
+       prettyprint
        tools.browser
        tools.test
        bootstrap.stage2 ;

From 3a4ae00e775c41f52405cf014c9b10b6e4c4a9cd Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Mon, 11 Feb 2008 18:35:34 -0600
Subject: [PATCH 13/24] fix a bug

---
 extra/taxes/taxes.factor | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/extra/taxes/taxes.factor b/extra/taxes/taxes.factor
index 2c5501c357..d557feabfa 100644
--- a/extra/taxes/taxes.factor
+++ b/extra/taxes/taxes.factor
@@ -41,7 +41,6 @@ TUPLE: fica-base-unknown ;
 MIXIN: collector
 GENERIC: adjust-allowances ( salary w4 collector -- newsalary )
 GENERIC: withholding ( salary w4 collector -- x )
-GENERIC: net ( salary w4 collector -- x )
 
 TUPLE: tax-table single married ;
 
@@ -102,9 +101,6 @@ M: federal withholding ( salary w4 tax-table -- x )
     [ fica-tax ] 2keep
     medicare-tax + + ;
 
-M: federal net ( salary w4 collector -- x )
-    >r dupd r> withholding - ;
-
 
 ! Minnesota
 : minnesota-single ( -- triples )
@@ -134,14 +130,9 @@ M: minnesota adjust-allowances ( salary w4 collector -- newsalary )
 M: minnesota withholding ( salary w4 collector -- x )
     [ adjust-allowances ] 2keep marriage-table tax ;
 
-TUPLE: total ;
-INSTANCE: total collector
-
-! Totals
-M: total net ( salary w4 collector -- x )
-    >r dupd r>
+: employer-withhold ( salary w4 collector -- x )
     [ withholding ] 3keep
-    drop <federal> withholding + - ;
+    dup federal? [ 3drop ] [ drop <federal> withholding + ] if ;
 
-M: total withholding ( salary w4 collector -- x )
-    >r >r dup r> r> net - ;
+: net ( salary w4 collector -- x )
+    >r dupd r> employer-withhold - ;

From 9efaa4db6ab73d78f129c71ed95c468970213ede Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Mon, 11 Feb 2008 17:45:03 -0800
Subject: [PATCH 14/24] Add back the TextMate commands with Windows-friendly
 names

---
 misc/Factor.tmbundle/Commands/Eval Selection  |  0
 .../Commands/Eval Selection.tmCommand         | 27 +++++++++++++++++++
 misc/Factor.tmbundle/Commands/Run Selection   |  0
 .../Commands/Run Selection.tmCommand          | 27 +++++++++++++++++++
 4 files changed, 54 insertions(+)
 delete mode 100644 misc/Factor.tmbundle/Commands/Eval Selection
 create mode 100644 misc/Factor.tmbundle/Commands/Eval Selection.tmCommand
 delete mode 100644 misc/Factor.tmbundle/Commands/Run Selection
 create mode 100644 misc/Factor.tmbundle/Commands/Run Selection.tmCommand

diff --git a/misc/Factor.tmbundle/Commands/Eval Selection b/misc/Factor.tmbundle/Commands/Eval Selection
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/misc/Factor.tmbundle/Commands/Eval Selection.tmCommand b/misc/Factor.tmbundle/Commands/Eval Selection.tmCommand
new file mode 100644
index 0000000000..d5b6dc6aa3
--- /dev/null
+++ b/misc/Factor.tmbundle/Commands/Eval Selection.tmCommand	
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>beforeRunningCommand</key>
+	<string>nop</string>
+	<key>command</key>
+	<string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+puts factor_eval(STDIN.read)</string>
+	<key>fallbackInput</key>
+	<string>line</string>
+	<key>input</key>
+	<string>selection</string>
+	<key>keyEquivalent</key>
+	<string>^E</string>
+	<key>name</key>
+	<string>Eval Selection</string>
+	<key>output</key>
+	<string>replaceSelectedText</string>
+	<key>scope</key>
+	<string>source.factor</string>
+	<key>uuid</key>
+	<string>8E01DDAF-959B-4237-ADB9-C133A4ACCE90</string>
+</dict>
+</plist>
diff --git a/misc/Factor.tmbundle/Commands/Run Selection b/misc/Factor.tmbundle/Commands/Run Selection
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/misc/Factor.tmbundle/Commands/Run Selection.tmCommand b/misc/Factor.tmbundle/Commands/Run Selection.tmCommand
new file mode 100644
index 0000000000..f08bf006b9
--- /dev/null
+++ b/misc/Factor.tmbundle/Commands/Run Selection.tmCommand	
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>beforeRunningCommand</key>
+	<string>nop</string>
+	<key>command</key>
+	<string>#!/usr/bin/env ruby
+
+require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
+factor_run(STDIN.read)</string>
+	<key>fallbackInput</key>
+	<string>line</string>
+	<key>input</key>
+	<string>selection</string>
+	<key>keyEquivalent</key>
+	<string>^~e</string>
+	<key>name</key>
+	<string>Run Selection</string>
+	<key>output</key>
+	<string>discard</string>
+	<key>scope</key>
+	<string>source.factor</string>
+	<key>uuid</key>
+	<string>15A984BD-BC65-43E8-878A-267788C8DA70</string>
+</dict>
+</plist>

From b321d5a33da0afe37944e65ce71bcc92b015d11c Mon Sep 17 00:00:00 2001
From: Joe Groff <arcata@gmail.com>
Date: Mon, 11 Feb 2008 17:47:29 -0800
Subject: [PATCH 15/24] Add missing sequences.lib USE to bunny demo

---
 extra/bunny/model/model.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra/bunny/model/model.factor b/extra/bunny/model/model.factor
index b238bd8b99..1e14449ae1 100644
--- a/extra/bunny/model/model.factor
+++ b/extra/bunny/model/model.factor
@@ -3,7 +3,7 @@ math.vectors math.matrices math.parser io io.files kernel opengl
 opengl.gl opengl.glu opengl.capabilities shuffle http.client
 vectors splitting
 tools.time system combinators combinators.lib combinators.cleave
-float-arrays continuations namespaces ;
+float-arrays continuations namespaces sequences.lib ;
 IN: bunny.model
 
 : numbers ( str -- seq )

From 11ff8c65492c0bc66aa91bb7950482788da32578 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 21:17:42 -0600
Subject: [PATCH 16/24] builder: builder.server still references build-status

---
 extra/builder/builder.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor
index 1783a36928..fa76f8ec3c 100644
--- a/extra/builder/builder.factor
+++ b/extra/builder/builder.factor
@@ -133,7 +133,7 @@ VAR: stamp
   
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-! SYMBOL: build-status
+SYMBOL: build-status
 
 ! : build ( -- )
 

From 8a25e9432c68a3b025232152191cc42fa933a491 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 21:32:41 -0600
Subject: [PATCH 17/24] builder.test: recover from errors in do-load and
 do-tests

---
 extra/builder/test/test.factor | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index 6f87213096..21734bf18c 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -57,7 +57,7 @@ IN: builder.test
 
 : do-all ( -- )
   record-bootstrap-time
-  do-load
-  do-tests ;
+  [ do-load ]  [ drop ] recover
+  [ do-tests ] [ drop ] recover ;
 
 MAIN: do-all
\ No newline at end of file

From cb76e4775cf4e595e12290a7ed549da7f7ec4ee3 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 22:22:49 -0600
Subject: [PATCH 18/24] builder.test: tweaks

---
 extra/builder/test/test.factor | 52 +++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index 21734bf18c..e401b689c4 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -15,26 +15,26 @@ IN: builder.test
     [ bootstrap-time get . ]
   with-stream ;
 
-: try-everything* ( -- vocabs ) try-everything [ first vocab-link-name ] map ;
+! : try-everything* ( -- vocabs ) try-everything [ first vocab-link-name ] map ;
 
 ! : do-load ( -- )
-!   [ try-everything* ] "../load-everything-time" log-runtime
+!   [
+!     "../load-everything-log" <file-writer>
+!       [ try-everything keys ]
+!     with-stream
+!   ] "../load-everything-time" log-runtime
 !   dup empty?
 !     [ drop ]
-!     [ "../load-everything-log" log-object ]
-!   if ;
+!     [ "../load-everything-vocabs" log-object ]
+!   if
+!   "../load-everything-log" delete-file ;
 
 : do-load ( -- )
-  [
-    "../load-everything-log" <file-writer>
-      [ try-everything* ]
-    with-stream
-  ] "../load-everything-time" log-runtime
+  [ try-everything keys ] "../load-everything-time" log-runtime
   dup empty?
     [ drop ]
     [ "../load-everything-vocabs" log-object ]
-  if
-  "../load-everything-log" delete-file ;
+  if ;
 
 ! : do-tests ( -- )
 !   run-all-tests keys
@@ -43,21 +43,33 @@ IN: builder.test
 !   [ "../failing-tests" log-object ]
 !   if ;
 
+! : do-tests ( -- )
+!   [
+!     "../test-all-log" <file-writer>
+!       [ run-all-tests keys ]
+!     with-stream
+!   ] "../test-all-time" log-runtime
+!   dup empty?
+!     [ drop ]
+!     [ "../test-all-vocabs" log-object ]
+!   if
+!   "../test-all-log" delete-file ;
+
 : do-tests ( -- )
-  [
-    "../test-all-log" <file-writer>
-      [ run-all-tests keys ]
-    with-stream
-  ] "../test-all-time" log-runtime
+  [ run-all-tests keys ] "../test-all-time" log-runtime
   dup empty?
     [ drop ]
     [ "../test-all-vocabs" log-object ]
-  if
-  "../test-all-log" delete-file ;
+  if ;
+
+! : do-all ( -- )
+!   record-bootstrap-time
+!   [ do-load ]  [ drop ] recover
+!   [ do-tests ] [ drop ] recover ;
 
 : do-all ( -- )
   record-bootstrap-time
-  [ do-load ]  [ drop ] recover
-  [ do-tests ] [ drop ] recover ;
+  do-load
+  do-tests ;
 
 MAIN: do-all
\ No newline at end of file

From 620a2ab7201ba8790c3507c0b700f8655b02d55f Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 22:36:53 -0600
Subject: [PATCH 19/24] builder: more tweaks

---
 extra/builder/builder.factor   | 10 +--------
 extra/builder/test/test.factor | 38 ----------------------------------
 2 files changed, 1 insertion(+), 47 deletions(-)

diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor
index fa76f8ec3c..9c4c833182 100644
--- a/extra/builder/builder.factor
+++ b/extra/builder/builder.factor
@@ -228,15 +228,7 @@ SYMBOL: report
   [ builder-test try-process ]
   [
     report get
-      [
-        "Builder test error" write nl
-        "../load-everything-log" exists?
-          [ "../load-everything-log" <file-reader> contents write nl ]
-        when
-        "../test-all-log" exists?
-          [ "../test-all-log" <file-reader> contents write nl ]
-        when
-      ]
+      [ "Builder test error" write nl ]
     with-stream*
     throw
   ]
diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor
index e401b689c4..0a5750a030 100644
--- a/extra/builder/test/test.factor
+++ b/extra/builder/test/test.factor
@@ -15,20 +15,6 @@ IN: builder.test
     [ bootstrap-time get . ]
   with-stream ;
 
-! : try-everything* ( -- vocabs ) try-everything [ first vocab-link-name ] map ;
-
-! : do-load ( -- )
-!   [
-!     "../load-everything-log" <file-writer>
-!       [ try-everything keys ]
-!     with-stream
-!   ] "../load-everything-time" log-runtime
-!   dup empty?
-!     [ drop ]
-!     [ "../load-everything-vocabs" log-object ]
-!   if
-!   "../load-everything-log" delete-file ;
-
 : do-load ( -- )
   [ try-everything keys ] "../load-everything-time" log-runtime
   dup empty?
@@ -36,25 +22,6 @@ IN: builder.test
     [ "../load-everything-vocabs" log-object ]
   if ;
 
-! : do-tests ( -- )
-!   run-all-tests keys
-!   dup empty?
-!   [ drop ]
-!   [ "../failing-tests" log-object ]
-!   if ;
-
-! : do-tests ( -- )
-!   [
-!     "../test-all-log" <file-writer>
-!       [ run-all-tests keys ]
-!     with-stream
-!   ] "../test-all-time" log-runtime
-!   dup empty?
-!     [ drop ]
-!     [ "../test-all-vocabs" log-object ]
-!   if
-!   "../test-all-log" delete-file ;
-
 : do-tests ( -- )
   [ run-all-tests keys ] "../test-all-time" log-runtime
   dup empty?
@@ -62,11 +29,6 @@ IN: builder.test
     [ "../test-all-vocabs" log-object ]
   if ;
 
-! : do-all ( -- )
-!   record-bootstrap-time
-!   [ do-load ]  [ drop ] recover
-!   [ do-tests ] [ drop ] recover ;
-
 : do-all ( -- )
   record-bootstrap-time
   do-load

From 4f113394ec99aa373df3bf505e988d1a72971e2d Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Mon, 11 Feb 2008 23:42:21 -0600
Subject: [PATCH 20/24] builder: refactored

---
 extra/builder/builder.factor | 104 +++++++++++++----------------------
 1 file changed, 39 insertions(+), 65 deletions(-)

diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor
index 9c4c833182..299175308f 100644
--- a/extra/builder/builder.factor
+++ b/extra/builder/builder.factor
@@ -167,24 +167,40 @@ SYMBOL: build-status
 
 SYMBOL: report
 
+: >>>report ( quot -- ) report get swap with-stream* ;
+
+: file>>>report ( file -- ) [ <file-reader> contents write ] curry >>>report ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+: run-or-report ( desc quot -- )
+  [ [ try-process     ] curry ]
+  [ [ >>>report throw ] curry ]
+  bi*
+  recover ;
+
+: run-or-report-file ( desc quot file -- )
+  [ [ try-process ] curry ]
+  [ [ >>>report ] curry ]
+  [ [ file>>>report throw ] curry ]
+  tri*
+  compose
+  recover ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 : (build) ( -- )
 
   enter-build-dir
 
   "report" <file-writer> report set
 
-  report get [ "Build machine:   " write host-name write nl ] with-stream*
-
-  report get [ "Build directory: " write cwd write nl ] with-stream*
-
-  [ git-clone try-process ]
   [
-    report get
-     [ "Builder fatal error: git clone failed" write nl ]
-    with-stream*
-    throw
-  ]
-  recover
+    "Build machine:   " write host-name write nl
+    "Build directory: " write cwd write nl
+  ] >>>report
+
+  git-clone [ "Builder fatal error: git clone failed" write nl ] run-or-report
 
   "factor" cd
 
@@ -192,74 +208,32 @@ SYMBOL: report
 
   make-clean run-process drop
 
-  [ make-vm try-process ]
-  [
-    report get
-    [
-      "Builder fatal error: vm compile error" write nl
-      "../compile-log" <file-reader> contents write
-    ]
-    with-stream*
-    throw
-  ]
-  recover
+  make-vm
+    [ "Builder fatal error: vm compile error" write nl ]
+    "../compile-log"
+  run-or-report-file
 
   [ my-arch download-image ]
-  [
-    report get
-      [ "Builder fatal error: image download" write nl ]
-    with-stream*
-    throw
-  ]
+    [ [ "Builder fatal error: image download" write nl ] >>>report throw ]
   recover
 
-  [ bootstrap try-process ]
-  [
-    report get
-      [
-        "Bootstrap error" write nl
-        "../boot-log" <file-reader> contents write
-      ]
-    with-stream*
-    throw
-  ]
-  recover
+  bootstrap [ "Bootstrap error" write nl ] "../boot-log" run-or-report-file
 
-  [ builder-test try-process ]
-  [
-    report get
-      [ "Builder test error" write nl ]
-    with-stream*
-    throw
-  ]
-  recover
+  builder-test [ "Builder test error" write nl ] run-or-report
 
-  report get
-    [
-      "Bootstrap time: " write
-      "../bootstrap-time" <file-reader> contents write nl
-    ]
-  with-stream*
+  [ "Bootstrap time: " write ] >>>report   "../bootstrap-time" file>>>report
 
   "../load-everything-vocabs" exists?
     [
-      report get
-        [
-          "Did not pass load-everything: " write nl
-          "../load-everything-vocabs" <file-reader> contents write nl
-        ]
-      with-stream*
+      [ "Did not pass load-everything: " write nl ] >>>report
+      "../load-everything-vocabs" file>>>report
     ]
   when
 
   "../test-all-vocabs" exists?
     [
-      report get
-        [
-          "Did not pass test-all: " write nl
-          "../test-all-vocabs" <file-reader> contents write nl
-        ]
-      with-stream*
+      [ "Did not pass test-all: " write nl ] >>>report
+      "../test-all-vocabs" file>>>report
     ]
   when ;
 

From 27fb2270f0e9ad376304274f1625598cbbe1d008 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Date: Tue, 12 Feb 2008 00:15:20 -0600
Subject: [PATCH 21/24] builder: tweaks

---
 extra/builder/builder.factor | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor
index 299175308f..3e7efcc404 100644
--- a/extra/builder/builder.factor
+++ b/extra/builder/builder.factor
@@ -1,5 +1,5 @@
 
-USING: kernel io io.files io.launcher io.sockets hashtables math threads
+USING: kernel parser io io.files io.launcher io.sockets hashtables math threads
        system continuations namespaces sequences splitting math.parser
        prettyprint tools.time calendar bake vars http.client
        combinators bootstrap.image bootstrap.image.download
@@ -189,6 +189,13 @@ SYMBOL: report
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
+: ms>minutes ( ms -- minutes ) 1000.0 / 60 / ;
+
+: bootstrap-minutes ( -- )
+  "../bootstrap-time" <file-reader> contents eval ms>minutes unparse ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 : (build) ( -- )
 
   enter-build-dir
@@ -221,7 +228,8 @@ SYMBOL: report
 
   builder-test [ "Builder test error" write nl ] run-or-report
 
-  [ "Bootstrap time: " write ] >>>report   "../bootstrap-time" file>>>report
+  [ "Bootstrap time: " write bootstrap-minutes write " minutes" write nl ]
+  >>>report
 
   "../load-everything-vocabs" exists?
     [

From af11e1673b4057b9b9b81900ba9ab9a1d0fd058b Mon Sep 17 00:00:00 2001
From: Matthew Willis <matthew.willis@mac.com>
Date: Mon, 11 Feb 2008 22:52:02 -0800
Subject: [PATCH 22/24] Implemented the set-fullscreen* hook for the x11
 backend. I doubt that fullscreen* can be implemented for x11, so it might
 need to be removed or always return f.

---
 extra/ui/x11/x11.factor              | 13 +++++++++++++
 extra/x11/constants/constants.factor |  5 +++++
 2 files changed, 18 insertions(+)

diff --git a/extra/ui/x11/x11.factor b/extra/ui/x11/x11.factor
index 62944500ef..6a0560cb28 100755
--- a/extra/ui/x11/x11.factor
+++ b/extra/ui/x11/x11.factor
@@ -217,6 +217,19 @@ M: x-clipboard paste-clipboard
 M: x11-ui-backend set-title ( string world -- )
     world-handle x11-handle-window swap dpy get -rot
     3dup set-title-old set-title-new ;
+    
+M: x11-ui-backend set-fullscreen* ( ? world -- )
+    world-handle x11-handle-window "XClientMessageEvent" <c-object>
+    tuck set-XClientMessageEvent-window
+    swap _NET_WM_STATE_ADD _NET_WM_STATE_REMOVE ?
+    over set-XClientMessageEvent-data0
+    ClientMessage over set-XClientMessageEvent-type
+    dpy get over set-XClientMessageEvent-display
+    "_NET_WM_STATE" x-atom over set-XClientMessageEvent-message_type
+    32 over set-XClientMessageEvent-format
+    "_NET_WM_STATE_FULLSCREEN" x-atom over set-XClientMessageEvent-data1
+    >r dpy get root get 0 SubstructureNotifyMask r> XSendEvent drop ;
+
 
 M: x11-ui-backend (open-window) ( world -- )
     dup gadget-window
diff --git a/extra/x11/constants/constants.factor b/extra/x11/constants/constants.factor
index 367f40cebd..5781fdc806 100644
--- a/extra/x11/constants/constants.factor
+++ b/extra/x11/constants/constants.factor
@@ -402,3 +402,8 @@ TYPEDEF: uchar KeyCode
 : LSBFirst              0 ;
 : MSBFirst              1 ;
 
+! *****************************************************************
+! * EXTENDED WINDOW MANAGER HINTS
+! *****************************************************************
+
+C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ;
\ No newline at end of file

From 0210823dfcdaa0874097ccdfe41d2510051e0a03 Mon Sep 17 00:00:00 2001
From: Matthew Willis <matthew.willis@mac.com>
Date: Mon, 11 Feb 2008 23:01:49 -0800
Subject: [PATCH 23/24] forgot to add alien.c-types to USING:

---
 extra/ui/x11/x11.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extra/ui/x11/x11.factor b/extra/ui/x11/x11.factor
index 6a0560cb28..e4794452c7 100755
--- a/extra/ui/x11/x11.factor
+++ b/extra/ui/x11/x11.factor
@@ -1,6 +1,6 @@
 ! Copyright (C) 2005, 2007 Eduardo Cavazos and Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien arrays ui ui.gadgets ui.gestures ui.backend
+USING: alien alien.c-types arrays ui ui.gadgets ui.gestures ui.backend
 ui.clipboards ui.gadgets.worlds assocs kernel math namespaces
 opengl sequences strings x11.xlib x11.events x11.xim x11.glx
 x11.clipboard x11.constants x11.windows io.utf8 combinators

From 1a23b975f2029790c6ecc3c3b959266b3de88bc5 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@factorcode.org>
Date: Tue, 12 Feb 2008 02:19:18 -0600
Subject: [PATCH 24/24] Cleaning up monitors; add simple-monitor abstraction

---
 extra/io/monitors/monitors.factor            | 35 +++++++++++++++++++-
 extra/io/unix/linux/linux.factor             | 30 +++--------------
 extra/io/windows/nt/monitors/monitors.factor |  2 +-
 3 files changed, 40 insertions(+), 27 deletions(-)

diff --git a/extra/io/monitors/monitors.factor b/extra/io/monitors/monitors.factor
index d652f34f1e..1f3b36fadb 100755
--- a/extra/io/monitors/monitors.factor
+++ b/extra/io/monitors/monitors.factor
@@ -17,7 +17,7 @@ TUPLE: monitor queue closed? ;
         set-monitor-queue
     } monitor construct ;
 
-HOOK: fill-queue io-backend ( monitor -- )
+GENERIC: fill-queue ( monitor -- )
 
 : changed-file ( changed path -- )
     namespace [ append ] change-at ;
@@ -25,6 +25,39 @@ HOOK: fill-queue io-backend ( monitor -- )
 : dequeue-change ( assoc -- path changes )
     delete-any prune natural-sort >array ;
 
+M: monitor dispose
+    dup check-monitor
+    t over set-monitor-closed?
+    delegate dispose ;
+
+! Simple monitor; used on Linux and Mac OS X. On Windows,
+! monitors are full-fledged ports.
+TUPLE: simple-monitor handle callback ;
+
+: <simple-monitor> ( handle -- simple-monitor )
+    f (monitor) {
+        set-simple-monitor-wd
+        set-delegate
+    } simple-monitor construct ;
+
+: construct-simple-monitor ( handle class -- simple-monitor )
+    >r <simple-monitor> r> construct-delegate ; inline
+
+: notify-callback ( simple-monitor -- )
+    dup linux-monitor-callback
+    f rot set-linux-monitor-callback
+    [ schedule-thread ] when* ;
+
+M: simple-monitor fill-queue ( monitor -- )
+    dup simple-monitor-callback [
+        "Cannot wait for changes on the same file from multiple threads" throw
+    ] when
+    [ swap set-simple-monitor-callback stop ] callcc0
+    check-monitor ;
+
+M: simple-monitor dispose ( monitor -- )
+    dup delegate dispose notify-callback ;
+
 PRIVATE>
 
 HOOK: <monitor> io-backend ( path recursive? -- monitor )
diff --git a/extra/io/unix/linux/linux.factor b/extra/io/unix/linux/linux.factor
index b3bd2eee4e..25c53478d6 100755
--- a/extra/io/unix/linux/linux.factor
+++ b/extra/io/unix/linux/linux.factor
@@ -11,14 +11,10 @@ TUPLE: linux-io ;
 
 INSTANCE: linux-io unix-io
 
-TUPLE: linux-monitor path wd callback ;
+TUPLE: linux-monitor ;
 
-: <linux-monitor> ( path wd -- monitor )
-    f (monitor) {
-        set-linux-monitor-path
-        set-linux-monitor-wd
-        set-delegate
-    } linux-monitor construct ;
+: <linux-monitor> ( wd -- monitor )
+    linux-monitor construct-simple-monitor ;
 
 TUPLE: inotify watches ;
 
@@ -42,8 +38,7 @@ TUPLE: inotify watches ;
     ] when ;
 
 : add-watch ( path mask -- monitor )
-    dupd (add-watch)
-    dup check-existing
+    (add-watch) dup check-existing
     [ <linux-monitor> dup ] keep watches set-at ;
 
 : remove-watch ( monitor -- )
@@ -53,23 +48,8 @@ TUPLE: inotify watches ;
 M: linux-io <monitor> ( path recursive? -- monitor )
     drop IN_CHANGE_EVENTS add-watch ;
 
-: notify-callback ( monitor -- )
-    dup linux-monitor-callback
-    f rot set-linux-monitor-callback
-    [ schedule-thread ] when* ;
-
-M: linux-io fill-queue ( monitor -- )
-    dup linux-monitor-callback [
-        "Cannot wait for changes on the same file from multiple threads" throw
-    ] when
-    [ swap set-linux-monitor-callback stop ] callcc0
-    check-monitor ;
-
 M: linux-monitor dispose ( monitor -- )
-    dup check-monitor
-    t over set-monitor-closed?
-    dup notify-callback
-    remove-watch ;
+    dup delegate dispose remove-watch ;
 
 : ?flag ( n mask symbol -- n )
     pick rot bitand 0 > [ , ] [ drop ] if ;
diff --git a/extra/io/windows/nt/monitors/monitors.factor b/extra/io/windows/nt/monitors/monitors.factor
index a7a1e2f485..eff3c250dc 100755
--- a/extra/io/windows/nt/monitors/monitors.factor
+++ b/extra/io/windows/nt/monitors/monitors.factor
@@ -78,7 +78,7 @@ M: windows-nt-io <monitor> ( path recursive? -- monitor )
     dup FILE_NOTIFY_INFORMATION-NextEntryOffset dup zero?
     [ 2drop ] [ swap <displaced-alien> (changed-files) ] if ;
 
-M: windows-nt-io fill-queue ( monitor -- )
+M: win32-monitor fill-queue ( monitor -- )
     dup buffer-ptr over read-changes
     [ zero? [ drop ] [ (changed-files) ] if ] H{ } make-assoc
     swap set-monitor-queue ;