chiark / gitweb /
New option: movres.ignore_transience.
[e16] / eesh / E.h
1 /*
2  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
3  * Copyright (C) 2004-2008 Kim Woelders
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to
7  * deal in the Software without restriction, including without limitation the
8  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9  * sell copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies of the Software, its documentation and marketing & publicity
14  * materials, and acknowledgment shall be given in the documentation, materials
15  * and software packages that this Software was used.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 #include "config.h"
25
26 #include <X11/Xlib.h>
27 #include <X11/Xutil.h>
28 #include <X11/Xproto.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <unistd.h>
32 #include <stdarg.h>
33 #include <string.h>
34 #include <fcntl.h>
35
36 #if HAVE_STRDUP
37 #define USE_LIBC_STRDUP  1      /* Use libc strdup if present */
38 #endif
39
40 typedef struct {
41    Window              win;
42    char               *msg;
43 } Client;
44
45 void                CommsInit(void);
46 Window              CommsSetup(Window win);
47 Window              CommsFindCommsWindow(void);
48 void                CommsSend(Client * c, const char *s);
49 char               *CommsGet(Client * c, XEvent * ev);
50 Client             *ClientCreate(Window win);
51 void                ClientDestroy(Client * c);
52
53 void                Alert(const char *fmt, ...);
54
55 #define Ecalloc     calloc
56 #define Emalloc     malloc
57 #define Erealloc    realloc
58 #if HAVE_FREE_NULL_BUG
59 #define Efree(p)    if (p) free(p)
60 #else
61 #define Efree       free
62 #endif
63
64 #define EMALLOC(type, num) (type*)Emalloc((num)*sizeof(type))
65 #define EREALLOC(type, ptr, num) (type*)Erealloc(ptr, (num)*sizeof(type))
66
67 #if USE_LIBC_STRDUP
68 #define Estrdup(s) ((s) ? strdup(s) : NULL)
69 #else
70 char               *Estrdup(const char *s);
71 #endif
72
73 extern Display     *disp;