Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

glut_winmisc.c

Go to the documentation of this file.
00001 
00002 /* Copyright (c) Mark J. Kilgard, 1994.  */
00003 
00004 /* This program is freely distributable without licensing fees
00005    and is provided without guarantee or warrantee expressed or
00006    implied. This program is -not- in the public domain. */
00007 
00008 #include <stdlib.h>
00009 #include <stdio.h>
00010 #include <string.h>
00011 #include <assert.h>
00012 #include <X11/Xlib.h>
00013 #include <X11/Xutil.h>
00014 #include <X11/Xatom.h>  /* for XA_STRING atom */
00015 
00016 #include <GL/glut.h>
00017 #include "glutint.h"
00018 
00019 void
00020 glutSetWindowTitle(char *title)
00021 {
00022   XTextProperty textprop;
00023 
00024   assert(!__glutCurrentWindow->parent);
00025   textprop.value = (unsigned char *) title;
00026   textprop.encoding = XA_STRING;
00027   textprop.format = 8;
00028   textprop.nitems = strlen(title);
00029   XSetWMName(__glutDisplay,
00030     __glutCurrentWindow->win, &textprop);
00031   XFlush(__glutDisplay);
00032 }
00033 
00034 void
00035 glutSetIconTitle(char *title)
00036 {
00037   XTextProperty textprop;
00038 
00039   assert(!__glutCurrentWindow->parent);
00040   textprop.value = (unsigned char *) title;
00041   textprop.encoding = XA_STRING;
00042   textprop.format = 8;
00043   textprop.nitems = strlen(title);
00044   XSetWMIconName(__glutDisplay,
00045     __glutCurrentWindow->win, &textprop);
00046   XFlush(__glutDisplay);
00047 }
00048 
00049 void
00050 glutPositionWindow(int x, int y)
00051 {
00052   __glutCurrentWindow->desiredX = x;
00053   __glutCurrentWindow->desiredY = y;
00054   __glutCurrentWindow->desiredConfMask |= CWX | CWY;
00055   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
00056 }
00057 
00058 void
00059 glutReshapeWindow(int w, int h)
00060 {
00061   if(w <= 0 || h <= 0) 
00062     __glutWarning("glutReshapeWindow: non-positive width or height not allowed");
00063 
00064   __glutCurrentWindow->desiredWidth = w;
00065   __glutCurrentWindow->desiredHeight = h;
00066   __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight;
00067   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
00068 }
00069 
00070 void
00071 glutPopWindow(void)
00072 {
00073   __glutCurrentWindow->desiredStack = Above;
00074   __glutCurrentWindow->desiredConfMask |= CWStackMode;
00075   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
00076 }
00077 
00078 void
00079 glutPushWindow(void)
00080 {
00081   __glutCurrentWindow->desiredStack = Below;
00082   __glutCurrentWindow->desiredConfMask |= CWStackMode;
00083   __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
00084 }
00085 
00086 void
00087 glutIconifyWindow(void)
00088 {
00089   assert(!__glutCurrentWindow->parent);
00090   __glutCurrentWindow->desiredMapState = IconicState;
00091   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
00092 }
00093 
00094 void
00095 glutShowWindow(void)
00096 {
00097   __glutCurrentWindow->desiredMapState = NormalState;
00098   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
00099 }
00100 
00101 void
00102 glutHideWindow(void)
00103 {
00104   __glutCurrentWindow->desiredMapState = WithdrawnState;
00105   __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
00106 }
00107 
 

Powered by Plone

This site conforms to the following standards: