OSDN Git Service

configure: allow C{,XX}FLAGS override
[android-x86/external-mesa.git] / src / glut / glx / glut_winmisc.c
1
2 /* Copyright (c) Mark J. Kilgard, 1994.  */
3
4 /* This program is freely distributable without licensing fees
5    and is provided without guarantee or warrantee expressed or
6    implied. This program is -not- in the public domain. */
7
8 #ifdef __VMS
9 #include <GL/vms_x_fix.h>
10 #endif
11
12 #include <stdlib.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include <assert.h>
16
17 #if !defined(_WIN32)
18 #include <X11/Xlib.h>
19 #include <X11/Xutil.h>
20 #include <X11/Xatom.h>  /* for XA_STRING atom */
21 #endif
22
23 #include "glutint.h"
24
25 /* CENTRY */
26 void GLUTAPIENTRY 
27 glutSetWindowTitle(const char *title)
28 {
29   XTextProperty textprop;
30
31   assert(!__glutCurrentWindow->parent);
32   IGNORE_IN_GAME_MODE();
33   textprop.value = (unsigned char *) title;
34   textprop.encoding = XA_STRING;
35   textprop.format = 8;
36   textprop.nitems = strlen(title);
37   XSetWMName(__glutDisplay,
38     __glutCurrentWindow->win, &textprop);
39   XFlush(__glutDisplay);
40 }
41
42 void GLUTAPIENTRY 
43 glutSetIconTitle(const char *title)
44 {
45   XTextProperty textprop;
46
47   assert(!__glutCurrentWindow->parent);
48   IGNORE_IN_GAME_MODE();
49   textprop.value = (unsigned char *) title;
50   textprop.encoding = XA_STRING;
51   textprop.format = 8;
52   textprop.nitems = strlen(title);
53   XSetWMIconName(__glutDisplay,
54     __glutCurrentWindow->win, &textprop);
55   XFlush(__glutDisplay);
56 }
57
58 void GLUTAPIENTRY 
59 glutPositionWindow(int x, int y)
60 {
61   IGNORE_IN_GAME_MODE();
62   __glutCurrentWindow->desiredX = x;
63   __glutCurrentWindow->desiredY = y;
64   __glutCurrentWindow->desiredConfMask |= CWX | CWY;
65   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
66 }
67
68 void GLUTAPIENTRY 
69 glutReshapeWindow(int w, int h)
70 {
71   IGNORE_IN_GAME_MODE();
72   if (w <= 0 || h <= 0)
73     __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
74
75   __glutCurrentWindow->desiredWidth = w;
76   __glutCurrentWindow->desiredHeight = h;
77   __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
78   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
79 }
80
81 void GLUTAPIENTRY 
82 glutPopWindow(void)
83 {
84   IGNORE_IN_GAME_MODE();
85   __glutCurrentWindow->desiredStack = Above;
86   __glutCurrentWindow->desiredConfMask |= CWStackMode;
87   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
88 }
89
90 void GLUTAPIENTRY 
91 glutPushWindow(void)
92 {
93   IGNORE_IN_GAME_MODE();
94   __glutCurrentWindow->desiredStack = Below;
95   __glutCurrentWindow->desiredConfMask |= CWStackMode;
96   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
97 }
98
99 void GLUTAPIENTRY 
100 glutIconifyWindow(void)
101 {
102   IGNORE_IN_GAME_MODE();
103   assert(!__glutCurrentWindow->parent);
104   __glutCurrentWindow->desiredMapState = IconicState;
105   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
106 }
107
108 void GLUTAPIENTRY 
109 glutShowWindow(void)
110 {
111   IGNORE_IN_GAME_MODE();
112   __glutCurrentWindow->desiredMapState = NormalState;
113   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
114 }
115
116 void GLUTAPIENTRY 
117 glutHideWindow(void)
118 {
119   IGNORE_IN_GAME_MODE();
120   __glutCurrentWindow->desiredMapState = WithdrawnState;
121   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
122 }
123
124 /* ENDCENTRY */