wmclockmon: update change-log
[dockapps.git] / wmcpuload / libdockapp / dockapp.h
blob5501f07023a2b1dc4436269fe1de906c7e615e75
1 /*
2 * Copyright (c) 1999 Alfredo K. Kojima
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 deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * 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 or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 * This code is based on libdockapp-0.4.0
22 * modified by Seiichi SATO <ssato@sh.rim.or.jp>
25 #ifndef __DOCKAPP_H
26 #define __DOCKAPP_H
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif
33 #include <X11/Xlib.h>
34 #include <X11/xpm.h>
35 #include <X11/extensions/shape.h>
37 #include <stdio.h>
39 #if STDC_HEADERS
40 # include <stdlib.h>
41 # include <stddef.h>
42 #else
43 # if HAVE_STDLIB_H
44 # include <stdlib.h>
45 # endif
46 #endif
48 #if HAVE_STRING_H
49 # if !STDC_HEADERS && HAVE_MEMORY_H
50 # include <memory.h>
51 # endif
52 # include <string.h>
53 #endif
54 #if HAVE_STRINGS_H
55 # include <strings.h>
56 #endif
58 #if HAVE_SELECT
59 # include <sys/select.h>
60 #endif
62 #if TIME_WITH_SYS_TIME
63 # include <sys/time.h>
64 # include <time.h>
65 #else
66 # if HAVE_SYS_TIME_H
67 # include <sys/time.h>
68 # else
69 # include <time.h>
70 # endif
71 #endif
73 #if HAVE_UNISTD_H
74 # include <unistd.h>
75 #else
76 /* We are in trouble. */
77 #endif
79 typedef enum _dockapp_status {
80 DOCKABLE_ICON, /* normal dockapp mode */
81 WINDOWED, /* windowed mode */
82 WINDOWED_WITH_PANEL /* windowed mode with background panel */
83 } dockapp_status;
85 extern Display *display;
86 extern Bool dockapp_isbrokenwm;
87 extern dockapp_status dockapp_stat;
89 void dockapp_open_window(char *display_specified, char *appname,
90 unsigned w, unsigned h, int argc, char **argv);
91 void dockapp_set_eventmask(long mask);
92 void dockapp_set_background(Pixmap pixmap);
93 void dockapp_show(void);
94 Bool dockapp_xpm2pixmap(char **data, Pixmap * pixmap, Pixmap * mask,
95 XpmColorSymbol * colorSymbol,
96 unsigned int nsymbols);
97 Pixmap dockapp_XCreatePixmap(int w, int h);
98 void dockapp_setshape(Pixmap mask, int x_ofs, int y_ofs);
99 void dockapp_copyarea(Pixmap src, Pixmap dist, int x_src, int y_src,
100 int w, int h, int x_dist, int y_dist);
101 void dockapp_copy2window(Pixmap src, int x_src, int y_src, int w, int h,
102 int x_dist, int y_dist);
103 Bool dockapp_nextevent_or_timeout(XEvent * event, unsigned long miliseconds);
106 unsigned long dockapp_getcolor_pixel(char *color_name);
108 unsigned long dockapp_blendedcolor(char *color_name,
109 int r,
110 int g,
111 int b,
112 float fac
116 #endif