1fc89c0fbSmrg/*
2fc89c0fbSmrg
3fc89c0fbSmrgCopyright 1993, 1998  The Open Group
4fc89c0fbSmrg
5fc89c0fbSmrgPermission to use, copy, modify, distribute, and sell this software and its
6fc89c0fbSmrgdocumentation for any purpose is hereby granted without fee, provided that
7fc89c0fbSmrgthe above copyright notice appear in all copies and that both that
8fc89c0fbSmrgcopyright notice and this permission notice appear in supporting
9fc89c0fbSmrgdocumentation.
10fc89c0fbSmrg
11fc89c0fbSmrgThe above copyright notice and this permission notice shall be included
12fc89c0fbSmrgin all copies or substantial portions of the Software.
13fc89c0fbSmrg
14fc89c0fbSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15fc89c0fbSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16fc89c0fbSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17fc89c0fbSmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18fc89c0fbSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19fc89c0fbSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20fc89c0fbSmrgOTHER DEALINGS IN THE SOFTWARE.
21fc89c0fbSmrg
22fc89c0fbSmrgExcept as contained in this notice, the name of The Open Group shall
23fc89c0fbSmrgnot be used in advertising or otherwise to promote the sale, use or
24fc89c0fbSmrgother dealings in this Software without prior written authorization
25fc89c0fbSmrgfrom The Open Group.
26fc89c0fbSmrg
27fc89c0fbSmrg*/
28fc89c0fbSmrg
29fc89c0fbSmrg/*
30fc89c0fbSmrg * Just_display.h: This file contains the definitions needed to use the
31fc89c0fbSmrg *                 functions in just_display.c.  It also declares the global
32fc89c0fbSmrg *                 variables dpy, screen, and program_name which are needed to
33fc89c0fbSmrg *                 use just_display.c.
34fc89c0fbSmrg *
35fc89c0fbSmrg * Written by Mark Lillibridge.   Last updated 7/1/87
36fc89c0fbSmrg *
37fc89c0fbSmrg * Send bugs, etc. to chariot@athena.mit.edu.
38fc89c0fbSmrg */
39fc89c0fbSmrg
40f4a95042Smrg#include <X11/Xfuncproto.h>
41f4a95042Smrg
42fc89c0fbSmrg    /* Simple helper macros */
43fc89c0fbSmrg#ifndef MAX
44fc89c0fbSmrg#define MAX(a,b) (((a)>(b))?(a):(b))
45fc89c0fbSmrg#endif /* MAX */
46fc89c0fbSmrg#ifndef MIN
47fc89c0fbSmrg#define MIN(a,b) (((a)<(b))?(a):(b))
48fc89c0fbSmrg#endif /* MIN */
49fc89c0fbSmrg
50fc89c0fbSmrg    /* Global variables used by routines in just_display.c */
51fc89c0fbSmrg
52576bbdfcSmrgextern const char *program_name;             /* Name of this program */
53fc89c0fbSmrgextern Display *dpy;                         /* The current display */
54fc89c0fbSmrgextern int screen;                           /* The current screen */
55fc89c0fbSmrg
56fc89c0fbSmrg#define INIT_NAME program_name=argv[0]        /* use this in main to setup
57fc89c0fbSmrg                                                 program_name */
58fc89c0fbSmrg
59fc89c0fbSmrg    /* Declarations for functions in just_display.c */
60fc89c0fbSmrg
61fc89c0fbSmrgchar *Get_Display_Name(int *, char **);
62fc89c0fbSmrgDisplay *Open_Display(const char *);
63fc89c0fbSmrgvoid Setup_Display_And_Screen(int *, char **);
64fc89c0fbSmrgvoid Close_Display(void);
65fc89c0fbSmrgXFontStruct *Open_Font(const char *);
66fc89c0fbSmrgWindow Select_Window_Args(int *, char **);
6781676fe2Smrgvoid usage(const char *errmsg) _X_NORETURN _X_COLD;
68fc89c0fbSmrg
69fc89c0fbSmrg#define X_USAGE "[host:display]"              /* X arguments handled by
70fc89c0fbSmrg						 Get_Display_Name */
71fc89c0fbSmrg
72fc89c0fbSmrg/*
73fc89c0fbSmrg * Other_stuff.h: Definitions of routines in other_stuff.
74fc89c0fbSmrg *
75fc89c0fbSmrg * Written by Mark Lillibridge.   Last updated 7/1/87
76fc89c0fbSmrg *
77fc89c0fbSmrg * Send bugs, etc. to chariot@athena.mit.edu.
78fc89c0fbSmrg */
79fc89c0fbSmrg
8091ec45ceSmrgWindow Select_Window(Display *, int descend);
81fc89c0fbSmrgWindow Window_With_Name(Display *, Window, const char *);
82f4a95042Smrg
83576bbdfcSmrgvoid Fatal_Error(const char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1,2);
84