site: end of line message, adesklets is not dead.
[adesklets.git] / src / xwindow.h
blob9f23bc3e65f309edede7407621d72c027a271c89
1 /*--- xwindow.h ----------------------------------------------------------------
2 Copyright (C) 2004, 2005, 2006 Sylvain Fourmanoit <syfou@users.sourceforge.net>
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to
6 deal in the Software without restriction, including without limitation the
7 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies of the Software and its documentation and acknowledgment shall be
13 given in the documentation and software packages that this Software was
14 used.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 ------------------------------------------------------------------------------*/
23 /* Regroup in one place all graphics-related includes,
24 and miscellaneous X routines.
27 /*----------------------------------------------------------------------------*/
28 #ifndef HAVE_XWINDOW_H
29 #define HAVE_XWINDOW_H
31 #ifndef HAVE_CONFIG_H
32 #error Autogenerated config.h should be used.
33 #endif
35 /*----------------------------------------------------------------------------*/
36 #include "config.h" /* Autoconf */
38 #ifndef X_DISPLAY_MISSING
39 #include <X11/Xlib.h> /* XLib */
40 #include <X11/Xutil.h>
41 #include <X11/Xos.h>
42 #include <X11/Xatom.h>
43 #include <X11/cursorfont.h>
44 #else /* Fake types definitions */
45 typedef int Display;
46 typedef int Window;
47 typedef int Visual;
48 typedef int Colormap;
49 typedef int Drawable;
50 typedef int Pixmap;
51 #endif
53 #ifdef HAVE_FONTCONFIG_FONTCONFIG_H
54 #include <fontconfig/fontconfig.h> /* Fontconfig */
55 #endif
57 #ifdef HAVE_STDIO_H /* fprintf() */
58 #include <stdio.h>
59 #endif
61 #include <Imlib2.h> /* Enlightment Image Library 2 */
63 #include "error.h" /* Error handling */
64 #include "cfgfile.h" /* For window characteristics */
66 /*----------------------------------------------------------------------------*/
67 /* Base event mask for main window */
68 #ifndef X_DISPLAY_MISSING
69 #define BASE_EVENT_MASK StructureNotifyMask | ExposureMask | ButtonPressMask
70 #else
71 #define BASE_EVENT_MASK 0
72 #endif
74 /*----------------------------------------------------------------------------*/
75 /* Defines for xwindow_context_save and xwindow_context_restore
77 #define IMLIB_DISPLAY (1<<0)
78 #define IMLIB_VISUAL (1<<1)
79 #define IMLIB_COLORMAP (1<<2)
80 #define IMLIB_DRAWABLE (1<<3)
81 #define IMLIB_MASK (1<<4)
82 #define IMLIB_DITHER_MASK (1<<5)
83 #define IMLIB_ANTI_ALIAS (1<<6)
84 #define IMLIB_DITHER (1<<7)
85 #define IMLIB_BLEND (1<<8)
86 #define IMLIB_COLOR_MODIFIER (1<<9)
87 #define IMLIB_OPERATION (1<<10)
88 #define IMLIB_FONT (1<<11)
89 #define IMLIB_DIRECTION (1<<12)
90 #define IMLIB_ANGLE (1<<13)
91 #define IMLIB_COLOR (1<<14)
92 #define IMLIB_IMAGE (1<<15)
93 #define IMLIB_COLOR_RANGE (1<<16)
94 #define IMLIB_FILTER (1<<17)
96 /*----------------------------------------------------------------------------*/
97 #ifndef X_DISPLAY_MISSING
98 extern XSetWindowAttributes XDefaultWindowAttributes;
99 #endif
101 /*----------------------------------------------------------------------------*/
102 void xwindow_locate_truetype_fonts(void);
104 #ifndef X_DISPLAY_MISSING
105 int xwindow_non_fatal_error_handler(Display *, XErrorEvent *);
106 void xwindow_error_reset(void);
107 int xwindow_error_check(void);
108 int xwindow_window_size(Display *, Window, uint *, uint *);
109 int xwindow_window_moved_or_resized(int, int, int, int);
110 int xwindow_updated_background(Display *, Window, Atom);
111 Imlib_Image xwindow_grab_background(Display *, int, Window);
112 void xwindow_update_window(Window, Imlib_Updates *,
113 Imlib_Image, Imlib_Image, int);
114 int xwindow_move_window(Display *, Window, Window, cfgfile_item*);
115 int xwindow_resize_window(Display *, Window, cfgfile_item*,
116 int, int, int);
117 Window xwindow_get_root_window(Display *, int);
118 #endif
119 void xwindow_context_save(long);
120 void xwindow_context_restore(void);
122 /*----------------------------------------------------------------------------*/
123 #endif