home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / twm / part03 / twm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-12  |  5.7 KB  |  172 lines

  1. /*****************************************************************************/
  2. /**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
  3. /**                          Salt Lake City, Utah                           **/
  4. /**                                                                         **/
  5. /**                           All Rights Reserved                           **/
  6. /**                                                                         **/
  7. /**    Permission to use, copy, modify, and distribute this software and    **/
  8. /**    its documentation  for  any  purpose  and  without  fee is hereby    **/
  9. /**    granted, provided that the above copyright notice appear  in  all    **/
  10. /**    copies and that both  that  copyright  notice  and  this  permis-    **/
  11. /**    sion  notice appear in supporting  documentation,  and  that  the    **/
  12. /**    name  of Evans & Sutherland  not be used in advertising or publi-    **/
  13. /**    city pertaining to distribution  of the software without  specif-    **/
  14. /**    ic, written prior permission.                                        **/
  15. /**                                                                         **/
  16. /**    EVANS  & SUTHERLAND  DISCLAIMS  ALL  WARRANTIES  WITH  REGARD  TO    **/
  17. /**    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI-    **/
  18. /**    TY AND FITNESS, IN NO EVENT SHALL EVANS &  SUTHERLAND  BE  LIABLE    **/
  19. /**    FOR  ANY  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY  DAM-    **/
  20. /**    AGES  WHATSOEVER RESULTING FROM  LOSS OF USE,  DATA  OR  PROFITS,    **/
  21. /**    WHETHER   IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS    **/
  22. /**    ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE  OR PER-    **/
  23. /**    FORMANCE OF THIS SOFTWARE.                                           **/
  24. /*****************************************************************************/
  25.  
  26. /***********************************************************************
  27.  *
  28.  * $Header: twm.h,v 1.14 88/04/15 07:09:40 tlastran Exp $
  29.  *
  30.  * twm include file
  31.  *
  32.  * 28-Oct-87 Thomas E. LaStrange    File created
  33.  *
  34.  ***********************************************************************/
  35.  
  36. #ifndef _TWM_
  37. #define _TWM_
  38.  
  39. #include <X11/Xlib.h>
  40. #include <X11/Xutil.h>
  41. #include <X11/cursorfont.h>
  42.  
  43. #ifndef TRUE
  44. #define TRUE    1
  45. #define FALSE    0
  46. #endif
  47.  
  48. #define BW 2            /* border width */
  49.  
  50. #define MAX_BUTTONS    5    /* max mouse buttons supported */
  51.  
  52. #define TITLE_BAR_SPACE         1    /* 2 pixel space bordering chars */
  53. #define TITLE_BAR_FONT_HEIGHT   15    /* max of 15 pixel high chars */
  54. #define TITLE_BAR_HEIGHT        (TITLE_BAR_FONT_HEIGHT+(2*TITLE_BAR_SPACE))
  55.  
  56. /* for each window that is on the display, one of these structures
  57.  * is allocated and linked into a list 
  58.  */
  59. typedef struct TwmWindow
  60. {
  61.     struct TwmWindow *next;    /* next twm window */
  62.     struct TwmWindow *prev;    /* previous twm window */
  63.     Window w;            /* the child window */
  64.     Window frame;        /* the frame window */
  65.     Window title_w;        /* the title bar window */
  66.     Window iconify_w;        /* the iconify button */
  67.     Window resize_w;        /* the resize button */
  68.     Window focus_w;        /* the focus window */
  69.     Window hilite_w;        /* the hilite window */
  70.     Window icon_w;        /* the icon window */
  71.     int frame_x;        /* x position of frame */
  72.     int frame_y;        /* y position of frame */
  73.     int icon_x;            /* icon text x coordinate */
  74.     int icon_y;            /* icon text y coordiante */
  75.     int title_height;        /* height of the title bar */
  76.     char *full_name;        /* full name of the window */
  77.     char *name;            /* name of the window */
  78.     char *icon_name;        /* name of the icon */
  79.     int name_width;        /* width of name text */
  80.     XWindowAttributes attr;    /* the child window attributes */
  81.     XSizeHints hints;        /* normal hints */
  82.     XWMHints *wmhints;        /* WM hints */
  83.     short xterm;        /* boolean indicating xterm */
  84.     short iconified;        /* has the window ever been iconified? */
  85.     short icon;            /* is the window an icon now ? */
  86.     short mapped;        /* is the window mapped ? */
  87.     short auto_raise;        /* should we auto-raise this window ? */
  88. } TwmWindow;
  89.  
  90. extern TwmWindow TwmRoot;
  91.  
  92. extern Display *dpy;
  93.  
  94. extern Window Root;
  95. extern Window VersionWindow;
  96. extern Window SizeWindow;
  97. extern Window ResizeWindow;
  98.  
  99. extern XFontStruct *TitleBarFont;
  100. extern XFontStruct *MenuFont;
  101. extern XFontStruct *IconFont;
  102. extern XFontStruct *SizeFont;
  103. extern XFontStruct *VersionFont;
  104.  
  105. extern char *TitleBarFontName;
  106. extern char *MenuFontName;
  107. extern char *IconFontName;
  108. extern char *SizeFontName;
  109. extern char *VersionFontName;
  110.  
  111. extern int TitleBarFontHeight;
  112. extern int MenuFontHeight;
  113. extern int IconFontHeight;
  114. extern int SizeFontHeight;
  115. extern int VersionFontHeight;
  116.  
  117. extern Cursor ArrowCursor;
  118. extern Cursor ButtonCursor;
  119. extern Cursor MoveCursor;
  120. extern Cursor ClockCursor;
  121. extern Cursor RightArrowCursor;
  122.  
  123. extern GC TitleNormalGC;
  124. extern GC MenuNormalGC;
  125. extern GC MenuReverseGC;
  126. extern GC MenuXorGC;
  127. extern GC IconNormalGC;
  128. extern GC VersionNormalGC;
  129. extern GC SizeNormalGC;
  130. extern GC DrawGC;
  131.  
  132. extern XContext TwmContext;
  133. extern XContext MenuContext;
  134.  
  135. extern int BorderWidth;
  136. extern unsigned long Foreground;
  137. extern unsigned long Background;
  138.  
  139. extern char Version[100];
  140. extern Pixmap UnknownPm;
  141. extern int UnknownWidth;
  142. extern int UnknownHeight;
  143. extern int FirstTime;
  144. extern int ReverseVideo;
  145. extern int FocusRoot;
  146. extern TwmWindow *Focus;
  147. extern int WarpCursor;
  148. extern int ParseError;
  149.  
  150. extern int TitleButton[MAX_BUTTONS + 1];
  151.  
  152. extern int TitleBarY;
  153. extern int TitleBarX;
  154. extern int MenuY;
  155.  
  156. extern Window JunkRoot;
  157. extern Window JunkChild;
  158. extern int JunkX;
  159. extern int JunkY;
  160. extern int JunkWidth;
  161. extern int JunkHeight;
  162. extern int JunkDepth;
  163. extern int JunkBW;
  164. extern int JunkMask;
  165.  
  166.  
  167. extern void Done();
  168. extern void Error();
  169. extern void Other();
  170.  
  171. #endif _TWM_
  172.