Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

glut_win.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include "glutint.h"

Include dependency graph for glut_win.c:

Go to the source code of this file.

Functions

static void cleanWindowWorkList (GLUTwindow *window)
static void cleanStaleWindowList (GLUTwindow *window)
GLUTwindow__glutGetWindow (Window win)
int APIENTRY glutGetWindow (void)
void __glutSetWindow (GLUTwindow *window)
void APIENTRY glutSetWindow (int win)
static int getUnusedWindowSlot (void)
static XVisualInfo * getVisualInfoCI (unsigned int mode)
static XVisualInfo * getVisualInfoRGB (unsigned int mode)
XVisualInfo * __glutGetVisualInfo (unsigned int mode)
XVisualInfo * __glutDetermineVisual (unsigned int displayMode, Bool *treatAsSingle, XVisualInfo *(getVisualInfo)(unsigned int))
void __glutDefaultDisplay (void)
void __glutDefaultReshape (int width, int height)
XVisualInfo * __glutDetermineWindowVisual (Bool *treatAsSingle, Bool *visAlloced, void **fbc)
GLUTwindow__glutCreateWindow (GLUTwindow *parent, int x, int y, int width, int height, int gameMode)
int APIENTRY glutCreateWindow (const char *title)
int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height)
void __glutDestroyWindow (GLUTwindow *window, GLUTwindow *initialWindow)
void APIENTRY glutDestroyWindow (int win)
void __glutChangeWindowEventMask (long eventMask, Bool add)
void APIENTRY glutDisplayFunc (GLUTdisplayCB displayFunc)
void APIENTRY glutMouseFunc (GLUTmouseCB mouseFunc)
void APIENTRY glutMotionFunc (GLUTmotionCB motionFunc)
void APIENTRY glutPassiveMotionFunc (GLUTpassiveCB passiveMotionFunc)
void APIENTRY glutEntryFunc (GLUTentryCB entryFunc)
void APIENTRY glutWindowStatusFunc (GLUTwindowStatusCB windowStatusFunc)
static void visibilityHelper (int status)
void APIENTRY glutVisibilityFunc (GLUTvisibilityCB visibilityFunc)
void APIENTRY glutReshapeFunc (GLUTreshapeCB reshapeFunc)
void APIENTRY glutMoveFunc (GLUTmoveCB moveFunc)

Variables

GLUTwindow__glutCurrentWindow = NULL
GLUTwindow ** __glutWindowList = NULL
int __glutWindowListSize = 0
GLUTstale__glutStaleWindowList = NULL
GLUTwindow__glutMenuWindow = NULL
void(* __glutFreeOverlayFunc )(GLUToverlay *)
XVisualInfo *(* __glutDetermineVisualFromString )(char *string, Bool *treatAsSingle, Criterion *requiredCriteria, int nRequired, int requiredMask, void **fbc) = NULL
static Criterion requiredWindowCriteria []
static int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion)
static int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT)
static GLUTwindow__glutWindowCache = NULL


Function Documentation

void __glutChangeWindowEventMask long  eventMask,
Bool  add
 

Definition at line 855 of file glut_win.c.

References __glutPutOnWorkList(), _GLUTwindow::eventMask, and GLUT_EVENT_MASK_WORK.

Referenced by glutEntryFunc(), glutMotionFunc(), glutMouseFunc(), glutPassiveMotionFunc(), and glutWindowStatusFunc().

GLUTwindow* __glutCreateWindow GLUTwindow parent,
int  x,
int  y,
int  width,
int  height,
int  gameMode
 

Definition at line 457 of file glut_win.c.

References __glutDefaultDisplay(), __glutDefaultReshape(), __glutDetermineMesaSwapHackSupport(), __glutDetermineWindowVisual(), __glutDisplay, __glutFatalError(), __glutForceDirect, __glutGameModeWindow, __glutOpenXConnection(), __glutRoot, __glutSetupColormap(), __glutSetWindow(), __glutTryDirect, __glutWindowWorkList, _GLUTwindow::buttonBox, _GLUTwindow::buttonUses, _GLUTwindow::children, _GLUTwindow::cmap, _GLUTwindow::colormap, _GLUTwindow::ctx, _GLUTwindow::cursor, _GLUTwindow::desiredConfMask, _GLUTwindow::desiredMapState, _GLUTwindow::dials, _GLUTwindow::display, _GLUTwindow::entry, _GLUTwindow::entryState, _GLUTwindow::eventMask, _GLUTwindow::forceReshape, getUnusedWindowSlot(), GL_FRONT, glDrawBuffer(), glReadBuffer(), GLUT_DONT_PROPAGATE_FILTER_MASK, GLUT_HACK_STOP_PROPAGATE_MASK, GLUT_MAP_WORK, GLUT_MAX_MENUS, GLX_RGBA_TYPE_SGIX, glXCreateContext(), glXCreateContextWithConfigSGIX, glXIsDirect(), _GLUTwindow::height, _GLUTwindow::ignoreKeyRepeat, _GLUTwindow::isDirect, _GLUTwindow::keyboard, _GLUTwindow::keyboardUp, _GLUTwindow::menu, _GLUTwindow::motion, _GLUTwindow::mouse, _GLUTwindow::move, _GLUTwindow::num, _GLUTwindow::overlay, _GLUTwindow::parent, _GLUTwindow::passive, _GLUTwindow::prevWorkWin, _GLUTwindow::renderCtx, _GLUTwindow::renderWin, _GLUTwindow::reshape, _GLUTwindow::shownState, _GLUTwindow::siblings, _GLUTwindow::spaceButton, _GLUTwindow::spaceMotion, _GLUTwindow::spaceRotate, _GLUTwindow::special, _GLUTwindow::specialUp, _GLUTwindow::tabletButton, _GLUTwindow::tabletMotion, _GLUTwindow::tabletPos, _GLUTwindow::treatAsSingle, _GLUTwindow::vis, _GLUTwindow::visAlloced, _GLUTwindow::visibility, _GLUTwindow::visState, _GLUTwindow::wacomButton, _GLUTwindow::wacomMotion, _GLUTwindow::width, _GLUTwindow::win, _GLUTwindow::windowStatus, _GLUTwindow::workMask, _GLUTwindow::x, and _GLUTwindow::y.

Referenced by glutCreateSubWindow(), and glutCreateWindow().

void __glutDefaultDisplay void   ) 
 

Definition at line 398 of file glut_win.c.

References __glutFatalError(), __glutWarning(), and _GLUTwindow::num.

Referenced by __glutCreateWindow().

void __glutDefaultReshape int  width,
int  height
 

Definition at line 408 of file glut_win.c.

References glViewport(), MAKE_CURRENT_LAYER, MAKE_CURRENT_OVERLAY, MAKE_CURRENT_WINDOW, and _GLUTwindow::overlay.

Referenced by __glutCreateWindow(), and glutReshapeFunc().

void __glutDestroyWindow GLUTwindow window,
GLUTwindow initialWindow
 

Definition at line 762 of file glut_win.c.

References __glutCloseDownGameMode(), __glutDestroyWindow(), __glutDisplay, __glutFreeColormap(), __glutFreeOverlayFunc, __glutGameModeWindow, _GLUTwindow::children, cleanStaleWindowList(), cleanWindowWorkList(), _GLUTwindow::colormap, _GLUTwindow::ctx, glXDestroyContext(), _GLUTwindow::num, _GLUTwindow::overlay, _GLUTwindow::parent, _GLUTwindow::siblings, UNMAKE_CURRENT, _GLUTwindow::vis, _GLUTwindow::visAlloced, and _GLUTwindow::win.

Referenced by __glutDestroyWindow(), and glutDestroyWindow().

XVisualInfo* __glutDetermineVisual unsigned int  displayMode,
Bool *  treatAsSingle,
XVisualInfo *  (getVisualInfo)(unsigned int)
 

Definition at line 357 of file glut_win.c.

References __glutDisplayString, GLUT_WIND_IS_MULTISAMPLE, and GLUT_WIND_IS_SINGLE.

Referenced by __glutDetermineWindowVisual(), and determineOverlayVisual().

XVisualInfo* __glutDetermineWindowVisual Bool *  treatAsSingle,
Bool *  visAlloced,
void **  fbc
 

Definition at line 428 of file glut_win.c.

References __glutDetermineVisual(), __glutDetermineVisualFromString, __glutDisplayMode, __glutDisplayString, __glutGetVisualInfo(), numRequiredWindowCriteria, and requiredWindowCriteriaMask.

Referenced by __glutCreateWindow().

XVisualInfo* __glutGetVisualInfo unsigned int  mode  ) 
 

Definition at line 344 of file glut_win.c.

References getVisualInfoCI(), getVisualInfoRGB(), GLUT_WIND_IS_LUMINANCE, and GLUT_WIND_IS_RGB.

Referenced by __glutDetermineWindowVisual().

GLUTwindow* __glutGetWindow Window  win  ) 
 

Definition at line 87 of file glut_win.c.

References __glutWindowListSize, _GLUTstale::next, _GLUTwindow::overlay, _GLUTwindow::win, _GLUToverlay::win, _GLUTstale::win, and _GLUTstale::window.

Referenced by __glutProcessDeviceEvents(), and processEventsAndTimeouts().

void __glutSetWindow GLUTwindow window  ) 
 

Definition at line 141 of file glut_win.c.

References __glutDebug, __glutPutOnWorkList(), GLUT_DEBUG_WORK, GLUT_FINISH_WORK, _GLUTwindow::isDirect, and MAKE_CURRENT_LAYER.

Referenced by __glutCreateWindow(), __glutProcessDeviceEvents(), glutSetWindow(), glutUseLayer(), markWindowHidden(), processEventsAndTimeouts(), and processWindowWorkList().

static void cleanStaleWindowList GLUTwindow window  )  [static]
 

Definition at line 62 of file glut_win.c.

References _GLUTstale::next, and _GLUTstale::window.

Referenced by __glutDestroyWindow().

static void cleanWindowWorkList GLUTwindow window  )  [static]
 

Definition at line 40 of file glut_win.c.

References __glutWindowWorkList, and _GLUTwindow::prevWorkWin.

Referenced by __glutDestroyWindow().

static int getUnusedWindowSlot void   )  [static]
 

Definition at line 195 of file glut_win.c.

References __glutFatalError(), and __glutWindowListSize.

Referenced by __glutCreateWindow().

static XVisualInfo* getVisualInfoCI unsigned int  mode  )  [static]
 

Definition at line 225 of file glut_win.c.

References __glutDisplay, __glutDisplayString, __glutScreen, GLUT_WIND_HAS_DEPTH, GLUT_WIND_HAS_STENCIL, GLUT_WIND_IS_DOUBLE, GLUT_WIND_IS_STEREO, GLX_BUFFER_SIZE, GLX_DEPTH_SIZE, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, GLX_STEREO, glXChooseVisual(), and int().

Referenced by __glutGetVisualInfo().

static XVisualInfo* getVisualInfoRGB unsigned int  mode  )  [static]
 

Definition at line 276 of file glut_win.c.

References __glutDisplay, __glutDisplayString, __glutIsSupportedByGLX(), __glutScreen, GLUT_WIND_HAS_ACCUM, GLUT_WIND_HAS_ALPHA, GLUT_WIND_HAS_DEPTH, GLUT_WIND_HAS_STENCIL, GLUT_WIND_IS_DOUBLE, GLUT_WIND_IS_MULTISAMPLE, GLUT_WIND_IS_STEREO, GLX_ACCUM_ALPHA_SIZE, GLX_ACCUM_BLUE_SIZE, GLX_ACCUM_GREEN_SIZE, GLX_ACCUM_RED_SIZE, GLX_ALPHA_SIZE, GLX_BLUE_SIZE, GLX_DEPTH_SIZE, GLX_DOUBLEBUFFER, GLX_GREEN_SIZE, GLX_RED_SIZE, GLX_RGBA, GLX_SAMPLES_SGIS, GLX_STENCIL_SIZE, GLX_STEREO, glXChooseVisual(), and int().

Referenced by __glutGetVisualInfo().

int APIENTRY glutCreateSubWindow int  win,
int  x,
int  y,
int  width,
int  height
 

Definition at line 741 of file glut_win.c.

References __glutCreateWindow(), __glutPutOnWorkList(), __glutToplevelOf(), _GLUTwindow::cmap, GLUT_COLORMAP_WORK, and _GLUTwindow::num.

int APIENTRY glutCreateWindow const char *  title  ) 
 

Definition at line 695 of file glut_win.c.

References __glutArgc, __glutArgv, __glutCreateWindow(), __glutDisplay, __glutFatalError(), __glutGameModeWindow, __glutIconic, __glutInitHeight, __glutInitWidth, __glutSizeHints, __glutWMDeleteWindow, _GLUTwindow::desiredMapState, _GLUTwindow::num, and _GLUTwindow::win.

Referenced by GLUT_WINSYS::setup().

void APIENTRY glutDestroyWindow int  win  ) 
 

Definition at line 833 of file glut_win.c.

References __glutDestroyWindow(), __glutFatalUsage(), __glutMappedMenu, __glutPutOnWorkList(), __glutToplevelOf(), GLUT_COLORMAP_WORK, and _GLUTwindow::parent.

void APIENTRY glutDisplayFunc GLUTdisplayCB  displayFunc  ) 
 

Definition at line 876 of file glut_win.c.

References __glutFatalError(), and _GLUTwindow::display.

Referenced by GLUT_WINSYS::setup().

void APIENTRY glutEntryFunc GLUTentryCB  entryFunc  ) 
 

Definition at line 953 of file glut_win.c.

References __glutChangeWindowEventMask(), _GLUTwindow::entry, _GLUTwindow::entryState, and _GLUTwindow::passive.

int APIENTRY glutGetWindow void   ) 
 

Definition at line 130 of file glut_win.c.

References _GLUTwindow::num.

Referenced by GLUT_MANAGER::do_display(), GLUT_MANAGER::do_idle(), GLUT_WINSYS::get_cursor(), GLUT_KBD::kbd(), GLUT_MOUSE::mouse(), GLUT_WINSYS::needs_context(), GLUT_WINSYS::position(), GLUT_WINSYS::position_manually(), GLUT_WINSYS::reshape_cb(), GLUT_WINSYS::set_cursor(), GLUT_WINSYS::set_focus(), GLUIMoveMenu::show(), GLUT_WINSYS::size_manually(), GLUT_WINSYS::unblock(), GLUT_WINSYS::visibility_cb(), and GLUT_WINSYS::window().

void APIENTRY glutMotionFunc GLUTmotionCB  motionFunc  ) 
 

Definition at line 907 of file glut_win.c.

References __glutChangeWindowEventMask(), _GLUTwindow::buttonUses, and _GLUTwindow::motion.

Referenced by GLUT_MOUSE::GLUT_MOUSE().

void APIENTRY glutMouseFunc GLUTmouseCB  mouseFunc  ) 
 

Definition at line 885 of file glut_win.c.

References __glutChangeWindowEventMask(), _GLUTwindow::buttonUses, and _GLUTwindow::mouse.

Referenced by GLUT_MOUSE::GLUT_MOUSE().

void APIENTRY glutMoveFunc GLUTmoveCB  moveFunc  ) 
 

Definition at line 1005 of file glut_win.c.

References _GLUTwindow::move.

void APIENTRY glutPassiveMotionFunc GLUTpassiveCB  passiveMotionFunc  ) 
 

Definition at line 938 of file glut_win.c.

References __glutChangeWindowEventMask(), _GLUTwindow::entry, and _GLUTwindow::passive.

Referenced by GLUT_MOUSE::GLUT_MOUSE().

void APIENTRY glutReshapeFunc GLUTreshapeCB  reshapeFunc  ) 
 

Definition at line 995 of file glut_win.c.

References __glutDefaultReshape(), and _GLUTwindow::reshape.

Referenced by GLUT_WINSYS::setup().

void APIENTRY glutSetWindow int  win  ) 
 

Definition at line 177 of file glut_win.c.

References __glutSetWindow(), __glutWarning(), and __glutWindowListSize.

Referenced by GLUIMoveMenu::create_menu(), GLUT_MANAGER::do_display(), GLUT_MANAGER::do_idle(), GLUT_WINSYS::get_cursor(), GLUT_WINSYS::position(), GLUT_WINSYS::position_manually(), GLUT_WINSYS::set_context(), GLUT_WINSYS::set_cursor(), GLUT_WINSYS::set_focus(), GLUIMoveMenu::show(), GLUT_WINSYS::size_manually(), and GLUT_WINSYS::unblock().

void APIENTRY glutVisibilityFunc GLUTvisibilityCB  visibilityFunc  ) 
 

Definition at line 985 of file glut_win.c.

References glutWindowStatusFunc(), _GLUTwindow::visibility, and visibilityHelper().

Referenced by GLUT_WINSYS::setup().

void APIENTRY glutWindowStatusFunc GLUTwindowStatusCB  windowStatusFunc  ) 
 

Definition at line 964 of file glut_win.c.

References __glutChangeWindowEventMask(), _GLUTwindow::visState, and _GLUTwindow::windowStatus.

Referenced by glutVisibilityFunc().

static void visibilityHelper int  status  )  [static]
 

Definition at line 976 of file glut_win.c.

References _GLUTwindow::visibility.

Referenced by glutVisibilityFunc().


Variable Documentation

GLUTwindow* __glutCurrentWindow = NULL
 

Definition at line 19 of file glut_win.c.

Referenced by glutDeviceGet(), glutEstablishOverlay(), glutHideOverlay(), glutLayerGet(), glutOverlayDisplayFunc(), glutPostOverlayRedisplay(), glutPostRedisplay(), glutRemoveOverlay(), glutShowOverlay(), glutTabletButtonFunc(), glutTabletMotionFunc(), glutUseLayer(), glutWacomButtonFunc(), and glutWacomMotionFunc().

XVisualInfo*(* __glutDetermineVisualFromString)(char *string, Bool *treatAsSingle, Criterion *requiredCriteria, int nRequired, int requiredMask, void **fbc) = NULL
 

Definition at line 28 of file glut_win.c.

Referenced by __glutDetermineWindowVisual(), and determineOverlayVisual().

void(* __glutFreeOverlayFunc)(GLUToverlay *)
 

Definition at line 27 of file glut_win.c.

Referenced by __glutDestroyWindow(), and glutEstablishOverlay().

GLUTwindow* __glutMenuWindow = NULL
 

Definition at line 25 of file glut_win.c.

GLUTstale* __glutStaleWindowList = NULL
 

Definition at line 23 of file glut_win.c.

Referenced by addStaleWindow(), and purgeStaleWindow().

GLUTwindow* __glutWindowCache = NULL [static]
 

Definition at line 84 of file glut_win.c.

GLUTwindow** __glutWindowList = NULL
 

Definition at line 20 of file glut_win.c.

Referenced by glutPostWindowOverlayRedisplay(), glutPostWindowRedisplay(), processEventsAndTimeouts(), and processWindowWorkList().

int __glutWindowListSize = 0
 

Definition at line 21 of file glut_win.c.

Referenced by __glutGetWindow(), getUnusedWindowSlot(), glutMainLoop(), and glutSetWindow().

int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion) [static]
 

Definition at line 36 of file glut_win.c.

Referenced by __glutDetermineWindowVisual().

Criterion requiredWindowCriteria[] [static]
 

Initial value:

{
  {LEVEL, EQ, 0},
  {TRANSPARENT, EQ, 0}
}

Definition at line 31 of file glut_win.c.

int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT) [static]
 

Definition at line 37 of file glut_win.c.

Referenced by __glutDetermineWindowVisual().


Generated on Mon Sep 18 11:41:21 2006 for jot by  doxygen 1.4.4