diff options
author | Brian Paul <[email protected]> | 1999-08-19 13:57:42 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-08-19 13:57:42 +0000 |
commit | a4dcdcf0ffae4c6cf52354fbd63c95d7d7815fd9 (patch) | |
tree | f4c57aa74226a59913cb650b87f7083eee5e34b6 /src/glut/glx/glut_winmisc.c | |
parent | 2d550f6ff1afa3189874c99cfe4125362ee76797 (diff) |
initial check-in (post crash)
Diffstat (limited to 'src/glut/glx/glut_winmisc.c')
-rw-r--r-- | src/glut/glx/glut_winmisc.c | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/src/glut/glx/glut_winmisc.c b/src/glut/glx/glut_winmisc.c new file mode 100644 index 00000000000..5a9d199a56e --- /dev/null +++ b/src/glut/glx/glut_winmisc.c @@ -0,0 +1,120 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> + +#if !defined(_WIN32) +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xatom.h> /* for XA_STRING atom */ +#endif + +#include "glutint.h" + +/* CENTRY */ +void APIENTRY +glutSetWindowTitle(const char *title) +{ + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +} + +void APIENTRY +glutSetIconTitle(const char *title) +{ + XTextProperty textprop; + + assert(!__glutCurrentWindow->parent); + IGNORE_IN_GAME_MODE(); + textprop.value = (unsigned char *) title; + textprop.encoding = XA_STRING; + textprop.format = 8; + textprop.nitems = strlen(title); + XSetWMIconName(__glutDisplay, + __glutCurrentWindow->win, &textprop); + XFlush(__glutDisplay); +} + +void APIENTRY +glutPositionWindow(int x, int y) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredX = x; + __glutCurrentWindow->desiredY = y; + __glutCurrentWindow->desiredConfMask |= CWX | CWY; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void APIENTRY +glutReshapeWindow(int w, int h) +{ + IGNORE_IN_GAME_MODE(); + if (w <= 0 || h <= 0) + __glutWarning("glutReshapeWindow: non-positive width or height not allowed"); + + __glutCurrentWindow->desiredWidth = w; + __glutCurrentWindow->desiredHeight = h; + __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void APIENTRY +glutPopWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Above; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void APIENTRY +glutPushWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredStack = Below; + __glutCurrentWindow->desiredConfMask |= CWStackMode; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); +} + +void APIENTRY +glutIconifyWindow(void) +{ + IGNORE_IN_GAME_MODE(); + assert(!__glutCurrentWindow->parent); + __glutCurrentWindow->desiredMapState = IconicState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void APIENTRY +glutShowWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = NormalState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +void APIENTRY +glutHideWindow(void) +{ + IGNORE_IN_GAME_MODE(); + __glutCurrentWindow->desiredMapState = WithdrawnState; + __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); +} + +/* ENDCENTRY */ |