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>
35 #include <X11/extensions/shape.h>
49 # if !STDC_HEADERS && HAVE_MEMORY_H
59 # include <sys/select.h>
62 #if TIME_WITH_SYS_TIME
63 # include <sys/time.h>
67 # include <sys/time.h>
76 /* We are in trouble. */
79 typedef enum _dockapp_status
{
80 DOCKABLE_ICON
, /* normal dockapp mode */
81 WINDOWED
, /* windowed mode */
82 WINDOWED_WITH_PANEL
/* windowed mode with background panel */
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
,