aliasing was broken
[mesa.git] / src / glut / os2 / glut_winmisc.cpp
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
9 #include <stdlib.h>
10 #include <stdio.h>
11 #include <string.h>
12 #include <assert.h>
13
14
15 #include "glutint.h"
16
17 /* CENTRY */
18 void GLUTAPIENTRY
19 glutSetWindowTitle(const char *title)
20 {
21 #if defined(__OS2PM__)
22 __glutSetWindowText(__glutCurrentWindow->win, (char *)title);
23
24 #else
25 XTextProperty textprop;
26
27 assert(!__glutCurrentWindow->parent);
28 IGNORE_IN_GAME_MODE();
29 textprop.value = (unsigned char *) title;
30 textprop.encoding = XA_STRING;
31 textprop.format = 8;
32 textprop.nitems = strlen(title);
33 XSetWMName(__glutDisplay,
34 __glutCurrentWindow->win, &textprop);
35 XFlush(__glutDisplay);
36 #endif
37 }
38
39 void GLUTAPIENTRY
40 glutSetIconTitle(const char *title)
41 {
42 #if defined(__OS2PM__)
43 //todo ?
44 #else
45
46 XTextProperty textprop;
47
48 assert(!__glutCurrentWindow->parent);
49 IGNORE_IN_GAME_MODE();
50 textprop.value = (unsigned char *) title;
51 textprop.encoding = XA_STRING;
52 textprop.format = 8;
53 textprop.nitems = strlen(title);
54 XSetWMIconName(__glutDisplay,
55 __glutCurrentWindow->win, &textprop);
56 XFlush(__glutDisplay);
57 #endif
58 }
59
60 void GLUTAPIENTRY
61 glutPositionWindow(int x, int y)
62 {
63 IGNORE_IN_GAME_MODE();
64 __glutCurrentWindow->desiredX = x;
65 __glutCurrentWindow->desiredY = y;
66 __glutCurrentWindow->desiredConfMask |= CWX | CWY;
67 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
68 }
69
70 void GLUTAPIENTRY
71 glutReshapeWindow(int w, int h)
72 {
73 IGNORE_IN_GAME_MODE();
74 if (w <= 0 || h <= 0)
75 __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
76
77 __glutCurrentWindow->desiredWidth = w;
78 __glutCurrentWindow->desiredHeight = h;
79 __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
80 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
81 }
82
83 void GLUTAPIENTRY
84 glutPopWindow(void)
85 {
86 IGNORE_IN_GAME_MODE();
87 __glutCurrentWindow->desiredStack = Above;
88 __glutCurrentWindow->desiredConfMask |= CWStackMode;
89 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
90 }
91
92 void GLUTAPIENTRY
93 glutPushWindow(void)
94 {
95 IGNORE_IN_GAME_MODE();
96 __glutCurrentWindow->desiredStack = Below;
97 __glutCurrentWindow->desiredConfMask |= CWStackMode;
98 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
99 }
100
101 void GLUTAPIENTRY
102 glutIconifyWindow(void)
103 {
104 IGNORE_IN_GAME_MODE();
105 assert(!__glutCurrentWindow->parent);
106 __glutCurrentWindow->desiredMapState = IconicState;
107 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
108 }
109
110 void GLUTAPIENTRY
111 glutShowWindow(void)
112 {
113 IGNORE_IN_GAME_MODE();
114 __glutCurrentWindow->desiredMapState = NormalState;
115 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
116 }
117
118 void GLUTAPIENTRY
119 glutHideWindow(void)
120 {
121 IGNORE_IN_GAME_MODE();
122 __glutCurrentWindow->desiredMapState = WithdrawnState;
123 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
124 }
125
126 /* ENDCENTRY */
127 \1a