# PySoy GLX Declarations # # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ cdef extern from "GL/glx.h" : ctypedef enum: # # Tokens for glXChooseVisual and glXGetConfig GLX_USE_GL GLX_BUFFER_SIZE GLX_LEVEL GLX_RGBA GLX_DOUBLEBUFFER GLX_STEREO GLX_AUX_BUFFERS GLX_RED_SIZE GLX_GREEN_SIZE GLX_BLUE_SIZE GLX_ALPHA_SIZE GLX_DEPTH_SIZE GLX_STENCIL_SIZE GLX_ACCUM_RED_SIZE GLX_ACCUM_GREEN_SIZE GLX_ACCUM_BLUE_SIZE GLX_ACCUM_ALPHA_SIZE # # Error codes returned by glXGetConfig GLX_BAD_SCREEN GLX_BAD_ATTRIBUTE GLX_NO_EXTENSION GLX_BAD_VISUAL GLX_BAD_CONTEXT GLX_BAD_VALUE GLX_BAD_ENUM # # GLX 1.1 and later GLX_VENDOR GLX_VERSION GLX_EXTENSIONS # # GLX 1.3 and later GLX_CONFIG_CAVEAT GLX_DONT_CARE GLX_X_VISUAL_TYPE GLX_TRANSPARENT_TYPE GLX_TRANSPARENT_INDEX_VALUE GLX_TRANSPARENT_RED_VALUE GLX_TRANSPARENT_GREEN_VALUE GLX_TRANSPARENT_BLUE_VALUE GLX_TRANSPARENT_ALPHA_VALUE GLX_WINDOW_BIT GLX_PIXMAP_BIT GLX_PBUFFER_BIT GLX_AUX_BUFFERS_BIT GLX_FRONT_LEFT_BUFFER_BIT GLX_FRONT_RIGHT_BUFFER_BIT GLX_BACK_LEFT_BUFFER_BIT GLX_BACK_RIGHT_BUFFER_BIT GLX_DEPTH_BUFFER_BIT GLX_STENCIL_BUFFER_BIT GLX_ACCUM_BUFFER_BIT GLX_NONE GLX_SLOW_CONFIG GLX_TRUE_COLOR GLX_DIRECT_COLOR GLX_PSEUDO_COLOR GLX_STATIC_COLOR GLX_GRAY_SCALE GLX_STATIC_GRAY GLX_TRANSPARENT_RGB GLX_TRANSPARENT_INDEX GLX_VISUAL_ID GLX_SCREEN GLX_NON_CONFORMANT_CONFIG GLX_DRAWABLE_TYPE GLX_RENDER_TYPE GLX_X_RENDERABLE GLX_FBCONFIG_ID GLX_RGBA_TYPE GLX_COLOR_INDEX_TYPE GLX_MAX_PBUFFER_WIDTH GLX_MAX_PBUFFER_HEIGHT GLX_MAX_PBUFFER_PIXELS GLX_PRESERVED_CONTENTS GLX_LARGEST_PBUFFER GLX_WIDTH GLX_HEIGHT GLX_EVENT_MASK GLX_DAMAGED GLX_SAVED GLX_WINDOW GLX_PBUFFER GLX_PBUFFER_HEIGHT GLX_PBUFFER_WIDTH GLX_RGBA_BIT GLX_COLOR_INDEX_BIT GLX_PBUFFER_CLOBBER_MASK # # GLX 1.4 and later GLX_SAMPLE_BUFFERS GLX_SAMPLES # # Xlib Misc True False GXcopy GCFunction # # Xlib Window Classes InputOutput InputOnly # # Xlib Window Attributes CWBackPixmap CWBackPixel CWBorderPixmap CWBorderPixel CWBitGravity CWWinGravity CWBackingStore CWBackingPlanes CWBackingPixel CWOverrideRedirect CWSaveUnder CWEventMask CWDontPropagate CWColormap CWCursor # # Xlib ImageFormat XYBitmap XYPixmap ZPixmap # # Xlib CreateColormap AllocNone AllocAll # # Xlib "RESERVED RESOURCE AND CONSTANT DEFINITION" None ParentRelative CopyFromParent PointerWindow InputFocus PointerRoot AnyPropertyType AnyKey AnyButton AllTemporary CurrentTime NoSymbol # # Xlib Event Input Masks NoEventMask KeyPressMask KeyReleaseMask ButtonPressMask ButtonReleaseMask EnterWindowMask LeaveWindowMask PointerMotionMask PointerMotionHintMask Button1MotionMask Button2MotionMask Button3MotionMask Button4MotionMask Button5MotionMask ButtonMotionMask KeymapStateMask ExposureMask VisibilityChangeMask StructureNotifyMask ResizeRedirectMask SubstructureNotifyMask SubstructureRedirectMask FocusChangeMask PropertyChangeMask ColormapChangeMask OwnerGrabButtonMask # # Event names KeyPress KeyRelease ButtonPress ButtonRelease MotionNotify EnterNotify LeaveNotify FocusIn FocusOut KeymapNotify Expose GraphicsExpose NoExpose VisibilityNotify CreateNotify DestroyNotify UnmapNotify MapNotify MapRequest ReparentNotify ConfigureNotify ConfigureRequest GravityNotify ResizeRequest CirculateNotify CirculateRequest PropertyNotify SelectionClear SelectionRequest SelectionNotify ColormapNotify ClientMessage MappingNotify LASTEvent # # Key masks ShiftMask LockMask ControlMask Mod1Mask Mod2Mask Mod3Mask Mod4Mask Mod5Mask # # Modifier names ShiftMapIndex LockMapIndex ControlMapIndex Mod1MapIndex Mod2MapIndex Mod3MapIndex Mod4MapIndex Mod5MapIndex # # Button masks Button1Mask Button2Mask Button3Mask Button4Mask Button5Mask AnyModifier # # Button names Button1 Button2 Button3 Button4 Button5 # # Notify modes NotifyNormal NotifyGrab NotifyUngrab NotifyWhileGrabbed # # Notify hint NotifyHint # # Notify details NotifyAncestor NotifyVirtual NotifyInferior NotifyNonlinear NotifyNonlinearVirtual NotifyPointer NotifyPointerRoot NotifyDetailNone # # Visibility notify VisibilityUnobscured VisibilityPartiallyObscured VisibilityFullyObscured # # Circulation request PlaceOnTop PlaceOnBottom # # Used in SetInputFocus, GetInputFocus RevertToNone RevertToPointerRoot RevertToParent # # Error Names Success BadRequest BadValue BadWindow BadPixmap BadAtom BadCursor BadFont BadMatch BadDrawable BadAccess BadAlloc BadColor BadGC BadIDChoice BadName BadLength BadImplementation FirstExtensionError LastExtensionError ctypedef char* XPointer ctypedef int Bool ctypedef int Status ctypedef unsigned long XID ctypedef XID Window ctypedef XID Drawable ctypedef XID Pixmap ctypedef XID Cursor ctypedef XID Colormap ctypedef XID GContext ctypedef XID KeySym ctypedef unsigned char KeyCode ctypedef unsigned long Atom ctypedef unsigned long VisualID ctypedef unsigned long Time ctypedef void* GLXContext ctypedef XID GLXPixmap ctypedef XID GLXDrawable ctypedef void* GLXFBConfig ctypedef XID GLXFBConfigID ctypedef XID GLXContextID ctypedef XID GLXWindow ctypedef XID GLXPbuffer ctypedef struct XGCValues : int function unsigned long plane_mask unsigned long foreground unsigned long background int line_width int line_style int cap_style int join_style int fill_style int fill_rule int arc_mode Pixmap tile Pixmap stipple int ts_x_origin int ts_y_origin int subwindow_mode Bool graphics_exposures int clip_x_origin int clip_y_origin Pixmap clip_mask int dash_offset char dashes ctypedef void* GC ctypedef void Display ctypedef void Visual ctypedef struct Depth : int depth int nvisuals Visual *visuals ctypedef struct aspect : int x int y ctypedef struct XSizeHints : long flags int x int y int width int height int min_width int min_height int max_width int max_height int width_inc int height_inc aspect min_aspect aspect max_aspect int base_width int base_height int win_gravity ctypedef struct Screen : void *ext_data Display *display Window root int width int height int mwidth int mheight int ndepths Depth *depths int root_depth Visual *root_visual GC default_gc Colormap cmap unsigned long white_pixel unsigned long black_pixel int max_maps int min_maps int backing_store Bool save_unders long root_input_mask ctypedef struct XVisualInfo : Visual *visual VisualID visualid int screen int depth int _class "class" unsigned long red_mask unsigned long green_mask unsigned long blue_mask int colormap_size int bits_per_rgb ctypedef struct XSetWindowAttributes : Pixmap background_pixmap unsigned long background_pixel Pixmap border_pixmap unsigned long border_pixel int bit_gravity int win_gravity int backing_store unsigned long backing_planes unsigned long backing_pixel int save_under long event_mask long do_not_propagate_mask int override_redirect Colormap colormap Cursor cursor ctypedef struct XImage : int width, height int xoffset int format char *data int byte_order int bitmap_unit int bitmap_bit_order int bitmap_pad int depth int bytes_per_line int bits_per_pixel unsigned long red_mask unsigned long green_mask unsigned long blue_mask XPointer obdata ctypedef struct XWindowChanges : int x, y int width, height int border_width Window sibling int stack_mode ctypedef struct XColor : unsigned long pixel unsigned short red, green, blue char flags char pad # XSegment # XPoint # XRectangle # XArc ctypedef struct XKeyboardControl : int key_click_percent int bell_percent int bell_pitch int bell_duration int led int led_mode int key int auto_repeat_mode ctypedef struct XKeyboardState : int key_click_percent int bell_percent unsigned int bell_pitch, bell_duration unsigned long led_mask int global_auto_repeat char auto_repeats[32] ctypedef struct XTimeCoord : Time time short x, y # XModifierKeymap ######################################################################### # Event Definition Structs ctypedef struct XKeyEvent : int type unsigned long serial Bool send_event Display *display Window window Window root Window subwindow Time time int x int y int x_root int y_root unsigned int state unsigned int keycode Bool same_screen ctypedef struct XButtonEvent : int type unsigned long serial Bool send_event Display *display Window window Window root Window subwindow Time time int x int y int x_root int y_root unsigned int state unsigned int button Bool same_screen ctypedef struct XMotionEvent : int type unsigned long serial Bool send_event Display *display Window window Window root Window subwindow Time time int x int y int x_root int y_root unsigned int state char is_hint Bool same_screen ctypedef struct XExposeEvent : int type unsigned long serial Bool send_event Display *display Window window int x int y int width int height int count ctypedef struct XCreateWindowEvent : int type unsigned long serial Bool send_event Display *display Window parent Window window int x int y int width int height Bool override_redirect ctypedef struct XConfigureEvent : int type unsigned long serial Bool send_event Display *display Window event Window window int x int y int width int height int border_width Window above Bool override_redirect ctypedef union MessageData : char b[20] short s[10] long l[5] ctypedef struct XClientMessageEvent : int type unsigned long serial Bool send_event Display *display Window window Atom message_type int format MessageData data ctypedef struct XAnyEvent : int type unsigned long serial Bool send_event Display *display Window window ctypedef union XEvent : int type XAnyEvent xany XKeyEvent xkey XButtonEvent xbutton XMotionEvent xmotion XExposeEvent xexpose XCreateWindowEvent xcreatewindow XConfigureEvent xconfigure XClientMessageEvent xclient cdef char *DisplayString ( Display* ) cdef int DefaultScreen ( Display* ) cdef int ScreenCount ( Display* ) cdef Screen *ScreenOfDisplay ( Display*, int ) cdef Display *DisplayOfScreen ( Screen* ) cdef Window RootWindowOfScreen ( Screen* ) cdef Colormap DefaultColormapOfScreen( Screen* ) cdef int DefaultDepthOfScreen ( Screen* ) cdef GC DefaultGCOfScreen ( Screen* ) cdef Visual *DefaultVisualOfScreen ( Screen* ) cdef int WidthOfScreen ( Screen* ) cdef int HeightOfScreen ( Screen* ) cdef int WidthMMOfScreen ( Screen* ) cdef int HeightMMOfScreen ( Screen* ) cdef int PlanesOfScreen ( Screen* ) cdef int glXQueryVersion ( Display*, int *maj, int *min ) cdef XVisualInfo *glXChooseVisual ( Display*, int, int* ) cdef GLXContext glXCreateContext ( Display*, XVisualInfo*, GLXContext, Bool ) cdef void glXDestroyContext ( Display*, GLXContext ) cdef Bool glXMakeCurrent ( Display*, Window, GLXContext ) cdef void glXSwapBuffers ( Display*, Window ) cdef GLXPixmap glXCreateGLXPixmap ( Display*, XVisualInfo*, Pixmap ) cdef void glXDestroyGLXPixmap ( Display*, GLXPixmap ) cdef GLXContext glXGetCurrentContext ( ) # ############################ from Xlib.h ############################# # XLoadQueryFont # XQueryFont # XGetMotionEvents # XDeleteModifiermapEntry # XGetModifierMapping # XInsertModifiermapEntry # XNewModifiermap cdef XImage* XCreateImage ( Display*, Visual*, unsigned int, int, int, char*, unsigned int, unsigned int, int, int ) # XInitImage # XGetImage # XGetSubImage cdef Display *XOpenDisplay ( char* ) # XrmInitialize # XFetchBytes # XFetchBuffer # XGetAtomName # XGetAtomNames cdef char* XGetDefault ( Display*, char*, char* ) cdef char* XDisplayName ( char* ) # XKeysymToString # XSynchronize # XSetAfterFunction # XInternAtom # XInternAtoms # XCopyColormapAndFree cdef Colormap XCreateColormap ( Display*, Window, Visual*, int ) # XCreatePixmapCursor # XCreateGlyphCursor # XCreateFontCursor # XLoadFont cdef GC XCreateGC ( Display*, Drawable, unsigned long, XGCValues* ) cdef GContext XGContextFromGC ( GC ) cdef void XFlushGC ( Display*, GC ) cdef Pixmap XCreatePixmap ( Display*, Window, unsigned int, unsigned int, unsigned int ) cdef Pixmap XCreateBitmapFromData ( Display*, Window, char*, unsigned int, unsigned int ) cdef Pixmap XCreatePixmapFromBitmapData( Display*, Window, char*, unsigned int, unsigned int, unsigned long, unsigned long, unsigned int) # XCreateSimpleWindow # XGetSelectionOwner cdef Window XCreateWindow ( Display*, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, Visual*, unsigned long, XSetWindowAttributes* ) # XListInstalledColormaps # XListFonts # XListFontsWithInfo # XGetFontPath cdef char** XListExtensions ( Display*, int* ) # XListProperties # XListHosts # XKeycodeToKeysym cdef KeySym XLookupKeysym ( XKeyEvent*, int ) # XGetKeyboardMapping # XStringToKeysym # XMaxRequestSize # XExtendedMaxRequestSize # XResourceManagerString # XScreenResourceString # XDisplayMotionBufferSize # XVisualIDFromVisual # XInitThreads # XLockDisplay # XUnlockDisplay # XInitExtension # XAddExtension # XFindOnExtensionList # XEHeadOfExtensionList # XRootWindow # XDefaultRootWindow # XRootWindowOfScreen # XDefaultVisual # XDefaultVisualOfScreen cdef GC XDefaultGC ( Display*, int ) cdef GC XDefaultGCOfScreen ( Screen* ) # XBlackPixel # XWhitePixel # XAllPlanes # XBlackPixelOfScreen # XWhitePixelOfScreen # XNextRequest # XLastKnownRequestProcessed cdef char* XServerVendor ( Display* ) cdef char* XDisplayString ( Display* ) # XDefaultColormap # XDefaultColormapOfScreen # XDisplayOfScreen # XScreenOfDisplay # XDefaultScreenOfDisplay # XEventMaskOfScreen # XScreenNumberOfScreen # XErrorHandler # XSetErrorHandler # XIOErrorHandler # XSetIOErrorHandler # XListPixmapFormats cdef int* XListDepths ( Display*, int, int* ) # XReconfigureWMWindow # XGetWMProtocols cdef int XSetWMProtocols ( Display*, Window, Atom*, int ) cdef Status XIconifyWindow ( Display*, Window, int ) cdef Status XWithdrawWindow ( Display*, Window, int ) # XGetCommand # XGetWMColormapWindows # XSetWMColormapWindows # XFreeStringList # XSetTransientForHint cdef int XActivateScreenSaver ( Display* ) # XAddHost # XAddHosts # XAddToExtensionList # XAddToSaveSet # XAllocColor # XAllocColorCells # XAllocColorPlanes # XAllocNamedColor # XAllowEvents cdef int XAutoRepeatOff ( Display* ) cdef int XAutoRepeatOn ( Display* ) cdef int XBell ( Display*, int ) # XBitmapBitOrder # XBitmapPad # XBitmapUnit # XCellsOfScreen # XChangeActivePointerGrab # XChangeGC # XChangeKeyboardControl # XChangeKeyboardMapping # XChangePointerControl # XChangeProperty # XChangeSaveSet cdef Window XChangeWindowAttributes( Display*, Window, unsigned long, XSetWindowAttributes* ) # XCheckIfEvent # XCheckMaskEvent # XCheckTypedEvent # XCheckTypedWindowEvent # XCheckWindowEvent # XCirculateSubwindows # XCirculateSubwindowsDown # XCirculateSubwindowsUp # XClearArea # XClearWindow cdef int XCloseDisplay ( Display* ) # XConfigureWindow # XConnectionNumber # XConvertSelection cdef int XCopyArea ( Display*, Drawable, Drawable, GC, int, int, unsigned int, unsigned int, int, int ) # XCopyGC # XCopyPlane # XDefaultDepth # XDefaultDepthOfScreen cdef int XDefaultScreen ( Display* ) # XDefineCursor # XDeleteProperty cdef int XDestroyWindow ( Display*, Window ) # XDestroySubwindows # XDoesBackingStore # XDoesSaveUnders # XDisableAccessControl # XDisplayCells # XDisplayHeight # XDisplayHeightMM # XDisplayKeycodes # XDisplayPlanes # XDisplayWidth # XDisplayWidthMM # XDrawArc # XDrawArcs # XDrawImageString # XDrawImageString16 # XDrawLine # XDrawLines # XDrawPoint # XDrawPoints # XDrawRectangle # XDrawRectangles # XDrawSegments # XDrawString # XDrawString16 # XDrawText # XDrawText16 # XEnableAccessControl # XEventsQueued # XFetchName # XFillArc # XFillArcs # XFillPolygon # XFillRectangle # XFillRectangles cdef int XFlush ( Display* ) # XForceScreenSaver # XFree # XFreeColormap # XFreeColors # XFreeCursor # XFreeExtensionList # XFreeFont # XFreeFontInfo # XFreeFontNames # XFreeFontPath cdef int XFreeGC ( Display*, GC ) # XFreeModifiermap cdef int XFreePixmap ( Display*, Pixmap ) # XGeometry # XGetErrorDatabaseText # XGetErrorText # XGetFontProperty # XGetGCValues cdef int XGetGeometry ( Display*, Window, Window*, int*, int*, unsigned int*, unsigned int*, unsigned int*, unsigned int* ) cdef Status XGetIconName ( Display*, Window, char** ) cdef int XGetInputFocus ( Display*, Window*, int* ) cdef int XGetKeyboardControl ( Display*, XKeyboardState* ) cdef int XGetPointerControl ( Display*, int*, int*, int* ) cdef int XGetPointerMapping ( Display*, unsigned char*, int ) cdef int XGetScreenSaver ( Display*, int*, int*, int*, int* ) cdef Status XGetTransientForHint ( Display*, Window, Window* ) # XGetWindowProperty # XGetWindowAttributes # XGrabButton # XGrabKey # XGrabKeyboard # XGrabPointer cdef int XGrabServer ( Display* ) # XHeightMMOfScreen # XHeightOfScreen # XIfEvent cdef int XImageByteOrder ( Display* ) # XInstallColormap # XKeysymToKeycode # XKillClient # XLookupColor # XLowerWindow cdef int XMapRaised ( Display*, Window ) # XMapSubwindows cdef int XMapWindow ( Display*, Window ) # XMaskEvent # XMaxCmapsOfScreen # XMinCmapsOfScreen cdef int XMoveResizeWindow ( Display*, Window, int, int, unsigned int, unsigned int ) cdef int XMoveWindow ( Display*, Window, int, int ) cdef int XNextEvent ( Display*, XEvent* ) cdef int XNoOp ( Display* ) # XParseColor # XParseGeometry cdef int XPeekEvent ( Display*, XEvent* ) # XPeekIfEvent cdef int XPending ( Display* ) # XPlanesOfScreen # XProtocolRevision # XProtocolVersion cdef int XPutBackEvent ( Display*, XEvent* ) cdef int XPutImage ( Display*, Drawable, GC, XImage*, int, int, int, int, unsigned int, unsigned int ) cdef int XQLength ( Display* ) # XQueryBestCursor # XQueryBestSize # XQueryBestStipple # XQueryBestTile # XQueryColor # XQueryColors # XQueryExtension # XQueryKeymap # XQueryPointer # XQueryTextExtents # XQueryTextExtents16 cdef int XQueryTree ( Display*, Window, Window*, Window*, Window**, unsigned int* ) cdef int XRaiseWindow ( Display*, Window ) # XReadBitmapFile # XReadBitmapFileData # XRebindKeysym cdef int XRecolorCursor ( Display*, Cursor, XColor*, XColor* ) # XRefreshKeyboardMapping # XRemoveFromSaveSet # XRemoveHost # XRemoveHosts # XReparentWindow cdef int XResetScreenSaver ( Display* ) cdef int XResizeWindow ( Display*, Window, int, int ) # # ... # cdef int XSetInputFocus ( Display*, Window, int, Time ) cdef int XSync ( Display*, Bool ) # cdef int XSetStandardProperties ( Display*, Window, char*, char*, Pixmap, char**, int, XSizeHints* ) cdef int XUnmapWindow ( Display*, Window ) cdef Atom XInternAtom ( Display*, char*, Bool ) cdef extern from "X11/extensions/xf86vmode.h" : ctypedef int INT32 ctypedef struct XF86VidModeModeInfo : unsigned int dotclock unsigned short hdisplay unsigned short hsyncstart unsigned short hsyncend unsigned short htotal unsigned short hskew unsigned short vdisplay unsigned short vsyncstart unsigned short vsyncend unsigned short vtotal unsigned int flags int privsize INT32 *private cdef Bool XF86VidModeGetAllModeLines ( Display*, int, int*, XF86VidModeModeInfo*** ) cdef Bool XF86VidModeSwitchToMode ( Display*, int, XF86VidModeModeInfo* ) cdef Bool XF86VidModeSetViewPort ( Display*, int, int, int )