source: trunk/src/opengl/glut/glut_winmisc.c

Last change on this file was 3000, checked in by jeroen, 25 years ago

* empty log message *

File size: 3.0 KB
Line 
1/* $Id: glut_winmisc.c,v 1.4 2000-03-04 19:33:43 jeroen Exp $ */
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#include <stdlib.h>
9#include <stdio.h>
10#include <string.h>
11#include <assert.h>
12
13#if !defined(_WIN32) && !defined(__WIN32OS2__)
14#include <X11/Xlib.h>
15#include <X11/Xutil.h>
16#include <X11/Xatom.h> /* for XA_STRING atom */
17#endif
18
19#include "glutint.h"
20
21/* CENTRY */
22void GLAPIENTRY
23glutSetWindowTitle(const char *title)
24{
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,
35 &textprop);
36 XFlush(__glutDisplay);
37}
38
39void GLAPIENTRY
40glutSetIconTitle(const char *title)
41{
42 XTextProperty textprop;
43
44 assert(!__glutCurrentWindow->parent);
45 IGNORE_IN_GAME_MODE();
46 textprop.value = (unsigned char *) title;
47 textprop.encoding = XA_STRING;
48 textprop.format = 8;
49 textprop.nitems = strlen(title);
50 XSetWMIconName(__glutDisplay,
51 __glutCurrentWindow->win, &textprop);
52 XFlush(__glutDisplay);
53}
54
55void GLAPIENTRY
56glutPositionWindow(int x, int y)
57{
58 IGNORE_IN_GAME_MODE();
59 __glutCurrentWindow->desiredX = x;
60 __glutCurrentWindow->desiredY = y;
61 __glutCurrentWindow->desiredConfMask |= CWX | CWY;
62 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
63}
64
65void GLAPIENTRY
66glutReshapeWindow(int w, int h)
67{
68 IGNORE_IN_GAME_MODE();
69 if (w <= 0 || h <= 0)
70 __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
71
72 __glutCurrentWindow->desiredWidth = w;
73 __glutCurrentWindow->desiredHeight = h;
74 __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
75 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
76}
77
78void GLAPIENTRY
79glutPopWindow(void)
80{
81 IGNORE_IN_GAME_MODE();
82 __glutCurrentWindow->desiredStack = Above;
83 __glutCurrentWindow->desiredConfMask |= CWStackMode;
84 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
85}
86
87void GLAPIENTRY
88glutPushWindow(void)
89{
90 IGNORE_IN_GAME_MODE();
91 __glutCurrentWindow->desiredStack = Below;
92 __glutCurrentWindow->desiredConfMask |= CWStackMode;
93 __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
94}
95
96void GLAPIENTRY
97glutIconifyWindow(void)
98{
99 IGNORE_IN_GAME_MODE();
100 assert(!__glutCurrentWindow->parent);
101 __glutCurrentWindow->desiredMapState = IconicState;
102 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
103}
104
105void GLAPIENTRY
106glutShowWindow(void)
107{
108 IGNORE_IN_GAME_MODE();
109 __glutCurrentWindow->desiredMapState = NormalState;
110 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
111}
112
113void GLAPIENTRY
114glutHideWindow(void)
115{
116 IGNORE_IN_GAME_MODE();
117 __glutCurrentWindow->desiredMapState = WithdrawnState;
118 __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
119}
120
121/* ENDCENTRY */
Note: See TracBrowser for help on using the repository browser.