wmclockmon: rename `DFLAGS` `debug_CFLAGS`
[dockapps.git] / wmbatteries / src / dockapp.h
blobebb1e154e2686f9a765124e72d0ec75dcd2c7d25
1 /*
2 * Copyright (c) 1999 Alfredo K. Kojima
3 * Copyright (c) 2001, 2002 Seiichi SATO <ssato@sh.rim.or.jp>
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 deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * This code is based on libdockapp-0.4.0
23 * modified by Seiichi SATO <ssato@sh.rim.or.jp>
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
30 #include <X11/Xlib.h>
31 #include <X11/xpm.h>
32 #include <X11/extensions/shape.h>
34 #include <stdio.h>
36 #if STDC_HEADERS
37 # include <stdlib.h>
38 # include <stddef.h>
39 #else
40 # if HAVE_STDLIB_H
41 # include <stdlib.h>
42 # endif
43 #endif
45 #if HAVE_STRING_H
46 # if !STDC_HEADERS && HAVE_MEMORY_H
47 # include <memory.h>
48 # endif
49 # include <string.h>
50 #endif
51 #if HAVE_STRINGS_H
52 # include <strings.h>
53 #endif
55 #if HAVE_SELECT
56 # include <sys/select.h>
57 #endif
59 #if TIME_WITH_SYS_TIME
60 # include <sys/time.h>
61 # include <time.h>
62 #else
63 # if HAVE_SYS_TIME_H
64 # include <sys/time.h>
65 # else
66 # include <time.h>
67 # endif
68 #endif
70 #if HAVE_UNISTD_H
71 # include <unistd.h>
72 #else
73 /* We are in trouble. */
74 #endif
76 extern Display *display;
77 extern Bool dockapp_iswindowed;
78 extern Bool dockapp_isbrokenwm;
81 void dockapp_open_window(char *display_specified, char *appname,
82 unsigned w, unsigned h, int argc, char **argv);
83 void dockapp_set_eventmask(long mask);
84 void dockapp_set_background(Pixmap pixmap);
85 void dockapp_show(void);
86 Bool dockapp_xpm2pixmap(char **data, Pixmap * pixmap, Pixmap * mask,
87 XpmColorSymbol * colorSymbol,
88 unsigned int nsymbols);
89 Pixmap dockapp_XCreatePixmap(int w, int h);
90 void dockapp_setshape(Pixmap mask, int x_ofs, int y_ofs);
91 void dockapp_copyarea(Pixmap src, Pixmap dist, int x_src, int y_src,
92 int w, int h, int x_dist, int y_dist);
93 void dockapp_copy2window(Pixmap src);
94 Bool dockapp_nextevent_or_timeout(XEvent * event, unsigned long miliseconds);
95 unsigned long dockapp_getcolor(char *color);
96 unsigned long dockapp_blendedcolor(char *color, int r, int g, int b, float fac);