13e747e6dSmrg/*****************************************************************************/
23e747e6dSmrg/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
33e747e6dSmrg/**                          Salt Lake City, Utah                           **/
43e747e6dSmrg/**                                                                         **/
53e747e6dSmrg/**                           All Rights Reserved                           **/
63e747e6dSmrg/**                                                                         **/
73e747e6dSmrg/**    Permission to use, copy, modify, and distribute this software and    **/
83e747e6dSmrg/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
93e747e6dSmrg/**    granted, provided that the above copyright notice appear  in  all    **/
103e747e6dSmrg/**    copies and that both  that  copyright  notice  and  this  permis-    **/
113e747e6dSmrg/**    sion  notice appear in supporting  documentation,  and  that  the    **/
123e747e6dSmrg/**    names of Evans & Sutherland not be used in advertising               **/
133e747e6dSmrg/**    in publicity pertaining to distribution of the  software  without    **/
143e747e6dSmrg/**    specific, written prior permission.                                  **/
153e747e6dSmrg/**                                                                         **/
163e747e6dSmrg/**    EVANS & SUTHERLAND AND DISCLAIMS ALL WARRANTIES WITH REGARD          **/
173e747e6dSmrg/**    TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES  OF  MERCHANT-    **/
183e747e6dSmrg/**    ABILITY  AND  FITNESS,  IN  NO  EVENT SHALL EVANS & SUTHERLAND       **/
193e747e6dSmrg/**    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL  DAMAGES        **/
203e747e6dSmrg/**    OR  ANY DAMAGES WHATSOEVER  RESULTING FROM LOSS OF USE, DATA         **/
213e747e6dSmrg/**    OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER    **/
223e747e6dSmrg/**    TORTIOUS ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE    **/
233e747e6dSmrg/**    OR PERFORMANCE OF THIS SOFTWARE.                                     **/
243e747e6dSmrg/*****************************************************************************/
253e747e6dSmrg/*
263e747e6dSmrg
273e747e6dSmrgPortions Copyright 1989, 1998  The Open Group
283e747e6dSmrg
293e747e6dSmrgPermission to use, copy, modify, distribute, and sell this software and its
303e747e6dSmrgdocumentation for any purpose is hereby granted without fee, provided that
313e747e6dSmrgthe above copyright notice appear in all copies and that both that
323e747e6dSmrgcopyright notice and this permission notice appear in supporting
333e747e6dSmrgdocumentation.
343e747e6dSmrg
353e747e6dSmrgThe above copyright notice and this permission notice shall be included
363e747e6dSmrgin all copies or substantial portions of the Software.
373e747e6dSmrg
383e747e6dSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
393e747e6dSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
403e747e6dSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
413e747e6dSmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
423e747e6dSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
433e747e6dSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
443e747e6dSmrgOTHER DEALINGS IN THE SOFTWARE.
453e747e6dSmrg
463e747e6dSmrgExcept as contained in this notice, the name of The Open Group shall
473e747e6dSmrgnot be used in advertising or otherwise to promote the sale, use or
483e747e6dSmrgother dealings in this Software without prior written authorization
493e747e6dSmrgfrom The Open Group.
503e747e6dSmrg
513e747e6dSmrg*/
523e747e6dSmrg
533e747e6dSmrg/***********************************************************************
543e747e6dSmrg *
553e747e6dSmrg * twm include file
563e747e6dSmrg *
57f66df612Smrg * 28-Oct-87 Thomas E. LaStrange        File created
58f66df612Smrg * 10-Oct-90 David M. Sternlicht        Storing saved colors on root
593e747e6dSmrg ***********************************************************************/
603e747e6dSmrg
616d8e82c3Smrg#ifndef TWM_H
626d8e82c3Smrg#define TWM_H
63f66df612Smrg/* *INDENT-OFF* */
643e747e6dSmrg
65ffd25bcaSmrg#ifdef HAVE_CONFIG_H
66f66df612Smrg#include "config.h"
67ffd25bcaSmrg#endif
68ffd25bcaSmrg
693e747e6dSmrg#include <X11/Xlib.h>
703e747e6dSmrg#include <X11/Xutil.h>
713e747e6dSmrg#include <X11/cursorfont.h>
723e747e6dSmrg#include <X11/extensions/shape.h>
733e747e6dSmrg#include <X11/Xfuncs.h>
743e747e6dSmrg#include <X11/StringDefs.h>
753e747e6dSmrg#include <X11/Intrinsic.h>
763e747e6dSmrg
776d8e82c3Smrg#ifndef APP_NAME
786d8e82c3Smrg#define APP_NAME "twm"
79f66df612Smrg#endif
806d8e82c3Smrg
816d8e82c3Smrg#ifndef APP_CLASS
826d8e82c3Smrg#define APP_CLASS "twm"
836d8e82c3Smrg#endif
846d8e82c3Smrg
856d8e82c3Smrg#ifndef APP_VERSION
866d8e82c3Smrg#define APP_VERSION "unknown"
87f66df612Smrg#endif
88f66df612Smrg
896d8e82c3Smrg#ifndef DATADIR
906d8e82c3Smrg#define DATADIR "/usr/local/share"
916d8e82c3Smrg#endif
926d8e82c3Smrg
936d8e82c3Smrg#ifndef XVENDORNAME
946d8e82c3Smrg#define XVENDORNAME "The X.Org Foundation"
95f66df612Smrg#endif
96f66df612Smrg
973e747e6dSmrg#ifndef WithdrawnState
983e747e6dSmrg#define WithdrawnState 0
993e747e6dSmrg#endif
1003e747e6dSmrg
101f66df612Smrg#define PIXEL_ALREADY_TYPEDEFED /* for Xmu/Drawing.h */
1023e747e6dSmrg
103f66df612Smrg#define BW 2                    /* border width */
104f66df612Smrg#define BW2 4                   /* border width  * 2 */
1053e747e6dSmrg
1063e747e6dSmrg#ifndef TRUE
107f66df612Smrg#define TRUE    1
108f66df612Smrg#define FALSE   0
1093e747e6dSmrg#endif
1103e747e6dSmrg
1113e747e6dSmrg#define NULLSTR ((char *) NULL)
1123e747e6dSmrg
113f66df612Smrg#define MAX_BUTTONS     16      /* max mouse buttons supported */
1143e747e6dSmrg
115f66df612Smrg/* info strings defines */
1163e747e6dSmrg#define INFO_LINES 30
1173e747e6dSmrg#define INFO_SIZE 200
1183e747e6dSmrg
1193e747e6dSmrg/* contexts for button presses */
120f66df612Smrg#define C_NO_CONTEXT    -1
121f66df612Smrg#define C_WINDOW        0
122f66df612Smrg#define C_TITLE         1
123f66df612Smrg#define C_ICON          2
124f66df612Smrg#define C_ROOT          3
125f66df612Smrg#define C_FRAME         4
126f66df612Smrg#define C_ICONMGR       5
127f66df612Smrg#define C_NAME          6
1283e747e6dSmrg#define C_IDENTIFY      7
129f66df612Smrg#define NUM_CONTEXTS    8
1303e747e6dSmrg
131f66df612Smrg#define C_WINDOW_BIT    (1 << C_WINDOW)
132f66df612Smrg#define C_TITLE_BIT     (1 << C_TITLE)
133f66df612Smrg#define C_ICON_BIT      (1 << C_ICON)
134f66df612Smrg#define C_ROOT_BIT      (1 << C_ROOT)
135f66df612Smrg#define C_FRAME_BIT     (1 << C_FRAME)
136f66df612Smrg#define C_ICONMGR_BIT   (1 << C_ICONMGR)
137f66df612Smrg#define C_NAME_BIT      (1 << C_NAME)
1383e747e6dSmrg
139f66df612Smrg#define C_ALL_BITS      (C_WINDOW_BIT | C_TITLE_BIT | C_ICON_BIT |\
140f66df612Smrg                         C_ROOT_BIT | C_FRAME_BIT | C_ICONMGR_BIT)
1413e747e6dSmrg
1423e747e6dSmrg/* modifiers for button presses */
143f66df612Smrg#define MOD_SIZE        ((ShiftMask | ControlMask | Mod1Mask \
144f66df612Smrg                          | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask) + 1)
1453e747e6dSmrg
146f66df612Smrg#define TITLE_BAR_SPACE         1       /* 2 pixel space bordering chars */
147f66df612Smrg#define TITLE_BAR_FONT_HEIGHT   15      /* max of 15 pixel high chars */
1483e747e6dSmrg#define TITLE_BAR_HEIGHT        (TITLE_BAR_FONT_HEIGHT+(2*TITLE_BAR_SPACE))
1493e747e6dSmrg
1503e747e6dSmrg/* defines for zooming/unzooming */
1513e747e6dSmrg#define ZOOM_NONE 0
1523e747e6dSmrg
1533e747e6dSmrg#define FB(fix_fore, fix_back)\
1543e747e6dSmrg    Gcv.foreground = fix_fore;\
1553e747e6dSmrg    Gcv.background = fix_back;\
1563e747e6dSmrg    XChangeGC(dpy, Scr->NormalGC, GCForeground|GCBackground,&Gcv)
1573e747e6dSmrg
158f66df612Smrgtypedef struct MyFont {
159f66df612Smrg    const char *name;           /* name of the font */
160f66df612Smrg    XFontStruct *font;          /* font structure */
161f66df612Smrg    XFontSet fontset;           /* fontset structure */
162f66df612Smrg    int height;                 /* height of the font */
163f66df612Smrg    int y;                      /* Y coordinate to draw characters */
1643e747e6dSmrg    int ascent;
1653e747e6dSmrg    int descent;
1663e747e6dSmrg} MyFont;
1673e747e6dSmrg
168f66df612Smrgtypedef struct ColorPair {
1693e747e6dSmrg    Pixel fore, back;
1703e747e6dSmrg} ColorPair;
1713e747e6dSmrg
1723e747e6dSmrgtypedef struct _TitleButton {
173f66df612Smrg    struct _TitleButton *next;  /* next link in chain */
174f66df612Smrg    const char *name;           /* bitmap name in case of deferral */
175f66df612Smrg    Pixmap bitmap;              /* image to display in button */
176f66df612Smrg    int srcx, srcy;             /* from where to start copying */
177f66df612Smrg    unsigned int width, height; /* size of pixmap */
178f66df612Smrg    int dstx, dsty;             /* to where to start copying */
179f66df612Smrg    int func;                   /* function to execute */
180f66df612Smrg    const char *action;         /* optional action arg */
181f66df612Smrg    struct MenuRoot *menuroot;  /* menu to pop on F_MENU */
182f66df612Smrg    Bool rightside;             /* t: on right, f: on left */
1833e747e6dSmrg} TitleButton;
1843e747e6dSmrg
1853e747e6dSmrgtypedef struct _TBWindow {
186f66df612Smrg    Window window;              /* which window in this frame */
187f66df612Smrg    TitleButton *info;          /* description of this window */
1883e747e6dSmrg} TBWindow;
1893e747e6dSmrg
1903e747e6dSmrgtypedef struct _SqueezeInfo {
191f66df612Smrg    int justify;                /* left, center, right */
192f66df612Smrg    int num;                    /* signed pixel count or numerator */
193f66df612Smrg    int denom;                  /* 0 for pix count or denominator */
1943e747e6dSmrg} SqueezeInfo;
1953e747e6dSmrg
196f66df612Smrg#define J_LEFT                  1
197f66df612Smrg#define J_CENTER                2
198f66df612Smrg#define J_RIGHT                 3
1993e747e6dSmrg
2003e747e6dSmrg/* Colormap window entry for each window in WM_COLORMAP_WINDOWS
2013e747e6dSmrg * ICCCM property.
2023e747e6dSmrg */
203f66df612Smrgtypedef struct TwmColormap {
204f66df612Smrg    Colormap c;                 /* Colormap id */
205f66df612Smrg    int state;                  /* install(ability) state */
206f66df612Smrg    unsigned long install_req;  /* request number which installed it */
207f66df612Smrg    Window w;                   /* window causing load of color table */
2083e747e6dSmrg    int refcnt;
2093e747e6dSmrg} TwmColormap;
2103e747e6dSmrg
211f66df612Smrg#define CM_INSTALLABLE          1
212f66df612Smrg#define CM_INSTALLED            2
213f66df612Smrg#define CM_INSTALL              4
2143e747e6dSmrg
215f66df612Smrgtypedef struct ColormapWindow {
216f66df612Smrg    Window w;                   /* Window id */
217f66df612Smrg    TwmColormap *colormap;      /* Colormap for this window */
218f66df612Smrg    int visibility;             /* Visibility of this window */
2193e747e6dSmrg    int refcnt;
2203e747e6dSmrg} ColormapWindow;
2213e747e6dSmrg
222f66df612Smrgtypedef struct Colormaps {
223f66df612Smrg    ColormapWindow **cwins;     /* current list of colormap windows */
224f66df612Smrg    int number_cwins;           /* number of elements in current list */
225f66df612Smrg    char *scoreboard;           /* conflicts between installable colortables */
2263e747e6dSmrg} Colormaps;
2273e747e6dSmrg
228f66df612Smrg#define ColormapsScoreboardLength(cm) (size_t)((cm)->number_cwins * \
229f66df612Smrg                                               ((cm)->number_cwins - 1) / 2)
2303e747e6dSmrg
2313e747e6dSmrg/* for each window that is on the display, one of these structures
232ffd25bcaSmrg * is allocated and linked into a list
2333e747e6dSmrg */
234f66df612Smrgtypedef struct TwmWindow {
235f66df612Smrg    struct TwmWindow *next;     /* next twm window */
236f66df612Smrg    struct TwmWindow *prev;     /* previous twm window */
237f66df612Smrg    Window w;                   /* the child window */
238f66df612Smrg    int old_bw;                 /* border width before reparenting */
239f66df612Smrg    Window frame;               /* the frame window */
240f66df612Smrg    Window title_w;             /* the title bar window */
241f66df612Smrg    Window hilite_w;            /* the hilite window */
2423e747e6dSmrg    Pixmap gray;
243f66df612Smrg    Window icon_w;              /* the icon window */
244f66df612Smrg    Window icon_bm_w;           /* the icon bitmap window */
245f66df612Smrg    int frame_x;                /* x position of frame */
246f66df612Smrg    int frame_y;                /* y position of frame */
247f66df612Smrg    int frame_width;            /* width of frame */
248f66df612Smrg    int frame_height;           /* height of frame */
249f66df612Smrg    int frame_bw;               /* borderwidth of frame */
2503e747e6dSmrg    int title_x;
2513e747e6dSmrg    int title_y;
252f66df612Smrg    int icon_x;                 /* icon text x coordinate */
253f66df612Smrg    int icon_y;                 /* icon text y coordinate */
254f66df612Smrg    int icon_w_width;           /* width of the icon window */
255f66df612Smrg    int icon_w_height;          /* height of the icon window */
256f66df612Smrg    int icon_width;             /* width of the icon bitmap */
257f66df612Smrg    int icon_height;            /* height of the icon bitmap */
258f66df612Smrg    int title_height;           /* height of the title bar */
259f66df612Smrg    int title_width;            /* width of the title bar */
260f66df612Smrg    char *full_name;            /* full name of the window */
261f66df612Smrg    char *name;                 /* name of the window */
262f66df612Smrg    char *icon_name;            /* name of the icon */
263f66df612Smrg    int name_width;             /* width of name text */
264f66df612Smrg    int highlightx;             /* start of highlight window */
265f66df612Smrg    int rightx;                 /* start of right buttons */
266f66df612Smrg    XWindowAttributes attr;     /* the child window attributes */
267f66df612Smrg    XSizeHints hints;           /* normal hints */
268f66df612Smrg    XWMHints *wmhints;          /* WM hints */
269f66df612Smrg    Window group;               /* group ID */
2706d8e82c3Smrg    XClassHint xclass;
2713e747e6dSmrg    struct WList *list;
2723e747e6dSmrg    /***********************************************************************
2733e747e6dSmrg     * color definitions per window
2743e747e6dSmrg     **********************************************************************/
275f66df612Smrg    Pixel border;               /* border color */
276f66df612Smrg    Pixel icon_border;          /* border color */
2773e747e6dSmrg    ColorPair border_tile;
2783e747e6dSmrg    ColorPair title;
2793e747e6dSmrg    ColorPair iconc;
280f66df612Smrg    short iconified;            /* has the window ever been iconified? */
281f66df612Smrg    short icon;                 /* is the window an icon now ? */
282f66df612Smrg    short icon_on;              /* is the icon visible */
283f66df612Smrg    short mapped;               /* is the window mapped ? */
284f66df612Smrg    short auto_raise;           /* should we auto-raise this window ? */
285f66df612Smrg    short forced;               /* has had an icon forced upon it */
286f66df612Smrg    short icon_not_ours;        /* icon pixmap or window supplied to us */
287f66df612Smrg    short icon_moved;           /* user explicitly moved the icon */
288f66df612Smrg    short highlight;            /* should highlight this window */
289f66df612Smrg    short stackmode;            /* honor stackmode requests */
290f66df612Smrg    short iconify_by_unmapping; /* unmap window to iconify it */
291f66df612Smrg    short iconmgr;              /* this is an icon manager window */
292f66df612Smrg    short transient;            /* this is a transient window */
293f66df612Smrg    Window transientfor;        /* window contained in XA_XM_TRANSIENT_FOR */
294f66df612Smrg    short titlehighlight;       /* should I highlight the title bar */
295f66df612Smrg    struct IconMgr *iconmgrp;   /* pointer to it if this is an icon manager */
296f66df612Smrg    int save_frame_x;           /* x position of frame */
297f66df612Smrg    int save_frame_y;           /* y position of frame */
298f66df612Smrg    int save_frame_width;       /* width of frame */
299f66df612Smrg    int save_frame_height;      /* height of frame */
300f66df612Smrg    short zoomed;               /* is the window zoomed? */
301f66df612Smrg    short wShaped;              /* this window has a bounding shape */
302f66df612Smrg    unsigned long protocols;    /* which protocols this window handles */
303f66df612Smrg    Colormaps cmaps;            /* colormaps for this application */
3043e747e6dSmrg    TBWindow *titlebuttons;
305f66df612Smrg    SqueezeInfo *squeeze_info;  /* should the title be squeezed? */
3063e747e6dSmrg    struct {
307f66df612Smrg        struct TwmWindow *next, *prev;
308f66df612Smrg        Bool cursor_valid;
309f66df612Smrg        int curs_x, curs_y;
3103e747e6dSmrg    } ring;
3113e747e6dSmrg
312f66df612Smrg    Bool nameChanged;           /* did WM_NAME ever change? */
3133e747e6dSmrg
3143e747e6dSmrg    /* did the user ever change the width/height? {yes, no, or unknown} */
3153e747e6dSmrg
3163e747e6dSmrg    Bool widthEverChangedByUser;
3173e747e6dSmrg    Bool heightEverChangedByUser;
3183e747e6dSmrg
3193e747e6dSmrg} TwmWindow;
3203e747e6dSmrg
321f66df612Smrgtypedef struct TWMWinConfigEntry {
3223e747e6dSmrg    struct TWMWinConfigEntry *next;
3233e747e6dSmrg    int tag;
3243e747e6dSmrg    char *client_id;
3253e747e6dSmrg    char *window_role;
3266d8e82c3Smrg    XClassHint xclass;
3273e747e6dSmrg    char *wm_name;
3283e747e6dSmrg    int wm_command_count;
3293e747e6dSmrg    char **wm_command;
3303e747e6dSmrg    short x, y;
3313e747e6dSmrg    unsigned short width, height;
3323e747e6dSmrg    short icon_x, icon_y;
3333e747e6dSmrg    Bool iconified;
3343e747e6dSmrg    Bool icon_info_present;
3353e747e6dSmrg    Bool width_ever_changed_by_user;
3363e747e6dSmrg    Bool height_ever_changed_by_user;
3373e747e6dSmrg} TWMWinConfigEntry;
3383e747e6dSmrg
339f66df612Smrg#define DoesWmTakeFocus         (1L << 0)
340f66df612Smrg#define DoesWmSaveYourself      (1L << 1)
341f66df612Smrg#define DoesWmDeleteWindow      (1L << 2)
3423e747e6dSmrg
343f66df612Smrg#define TBPM_DOT ":dot"         /* name of titlebar pixmap for dot */
344f66df612Smrg#define TBPM_ICONIFY ":iconify" /* same image as dot */
345f66df612Smrg#define TBPM_RESIZE ":resize"   /* name of titlebar pixmap for resize button */
346f66df612Smrg#define TBPM_XLOGO ":xlogo"     /* name of titlebar pixmap for xlogo */
347f66df612Smrg#define TBPM_DELETE ":delete"   /* same image as xlogo */
348f66df612Smrg#define TBPM_MENU ":menu"       /* name of titlebar pixmap for menus */
349f66df612Smrg#define TBPM_QUESTION ":question"       /* name of unknown titlebar pixmap */
3503e747e6dSmrg
3513e747e6dSmrg#include <X11/Xosdefs.h>
3523e747e6dSmrg#include <stdlib.h>
353f66df612Smrgextern void CreateFonts(void);
354f66df612Smrgextern void RestoreWithdrawnLocation(TwmWindow *tmp);
355f66df612Smrgextern void Reborder(Time time);
356f66df612Smrgextern void
357f66df612SmrgDone(XtPointer, XtSignalId *) _X_NORETURN;
358f66df612Smrgextern void
359f66df612SmrgComputeCommonTitleOffsets(void);
360f66df612Smrgextern void
361f66df612SmrgComputeTitleLocation(TwmWindow *tmp);
362f66df612Smrgextern void
363f66df612SmrgComputeWindowTitleOffsets(TwmWindow *tmp_win, int width, Bool squeeze);
3643e747e6dSmrgextern char *ProgramName;
3653e747e6dSmrgextern Display *dpy;
366f66df612Smrgextern Window ResizeWindow;     /* the window we are resizing */
367f66df612Smrgextern int HasShape;            /* this server supports Shape extension */
368f66df612Smrgextern int HasSync;             /* this server supports SYNC extension */
369f66df612Smrg
370f66df612Smrg#ifdef HAVE_XRANDR
371f66df612Smrgextern int HasXrandr;           /* this server supports Xrandr extension */
372f66df612Smrg#endif
3733e747e6dSmrg
3743e747e6dSmrgextern int PreviousScreen;
3753e747e6dSmrg
3763e747e6dSmrgextern Cursor UpperLeftCursor;
3773e747e6dSmrgextern Cursor RightButt;
3783e747e6dSmrgextern Cursor MiddleButt;
3793e747e6dSmrgextern Cursor LeftButt;
3803e747e6dSmrg
3813e747e6dSmrgextern XClassHint NoClass;
3823e747e6dSmrg
3833e747e6dSmrgextern XContext TwmContext;
3843e747e6dSmrgextern XContext MenuContext;
3853e747e6dSmrgextern XContext IconManagerContext;
3863e747e6dSmrgextern XContext ScreenContext;
3873e747e6dSmrgextern XContext ColormapContext;
3883e747e6dSmrg
389c2535118Smrgextern const char *Home;
3903e747e6dSmrgextern int HomeLen;
3913e747e6dSmrgextern int ParseError;
3923e747e6dSmrg
3933e747e6dSmrgextern int HandlingEvents;
3943e747e6dSmrg
3953e747e6dSmrgextern XGCValues Gcv;
3963e747e6dSmrgextern int InfoLines;
3973e747e6dSmrgextern char Info[][INFO_SIZE];
3983e747e6dSmrgextern int Argc;
3993e747e6dSmrgextern char **Argv;
400f66df612Smrgextern void
401f66df612SmrgNewFontCursor(Cursor *cp, const char *str);
402f66df612Smrgextern void
403f66df612SmrgNewBitmapCursor(Cursor *cp, char *source, char *mask);
404f66df612Smrgextern Pixmap
405f66df612SmrgCreateMenuIcon(int height, unsigned int *widthp, unsigned int *heightp);
406f66df612Smrg
4076d8e82c3Smrgextern void twmError(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
4086d8e82c3Smrgextern void twmWarning(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2);
4096d8e82c3Smrgextern void twmVerbose(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2);
4106d8e82c3Smrgextern void twmMessage(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2);
4113e747e6dSmrg
4123e747e6dSmrgextern Bool ErrorOccurred;
4133e747e6dSmrgextern XErrorEvent LastErrorEvent;
4143e747e6dSmrg
4153e747e6dSmrg#define ResetError() (ErrorOccurred = False)
4163e747e6dSmrg
4173e747e6dSmrgextern Bool RestartPreviousState;
418f66df612Smrgextern Bool
419f66df612SmrgGetWMState(Window w, int *statep, Window *iwp);
4203e747e6dSmrg
4216d8e82c3Smrgextern void parseWarning(const char *, ...) _X_ATTRIBUTE_PRINTF(1,2);
4223e747e6dSmrg
4233e747e6dSmrgextern Atom TwmAtoms[];
4243e747e6dSmrg
425f66df612Smrgextern int message_level;
4263e747e6dSmrgextern Bool use_fontset;
4273e747e6dSmrg
4283e747e6dSmrgextern int ShapeEventBase;
4293e747e6dSmrgextern int ShapeErrorBase;
4303e747e6dSmrg
431f66df612Smrg#ifdef HAVE_XRANDR
432f66df612Smrgextern int XrandrEventBase;
433f66df612Smrgextern int XrandrErrorBase;
434f66df612Smrg#endif
435f66df612Smrg
436f66df612Smrg#define _XA_MIT_PRIORITY_COLORS         TwmAtoms[0]
437f66df612Smrg#define _XA_WM_CHANGE_STATE             TwmAtoms[1]
438f66df612Smrg#define _XA_WM_STATE                    TwmAtoms[2]
439f66df612Smrg#define _XA_WM_COLORMAP_WINDOWS         TwmAtoms[3]
440f66df612Smrg#define _XA_WM_PROTOCOLS                TwmAtoms[4]
441f66df612Smrg#define _XA_WM_TAKE_FOCUS               TwmAtoms[5]
442f66df612Smrg#define _XA_WM_SAVE_YOURSELF            TwmAtoms[6]
443f66df612Smrg#define _XA_WM_DELETE_WINDOW            TwmAtoms[7]
444f66df612Smrg#define _XA_SM_CLIENT_ID                TwmAtoms[8]
445f66df612Smrg#define _XA_WM_CLIENT_LEADER            TwmAtoms[9]
446f66df612Smrg#define _XA_WM_WINDOW_ROLE              TwmAtoms[10]
447f66df612Smrg
448f66df612Smrg/* *INDENT-ON* */
4496d8e82c3Smrg#endif /* TWM_H */
450