wmclockmon: rename `DFLAGS` `debug_CFLAGS`
[dockapps.git] / cputnik / src / docklib.h
blobed92a20f8aeeec230c9b7f479ca38f6e1d5832a6
2 /*
3 * DOCKLIB - a simple dockapp library
5 * Copyright (C) 2000-2005 some people...
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <stdbool.h>
25 #include <ctype.h>
26 #include <stdarg.h>
27 #include <string.h>
28 #include <unistd.h>
29 #include <limits.h>
30 #include <time.h>
32 #include <sys/stat.h>
33 #include <sys/wait.h>
34 #include <sys/stat.h>
35 #include <sys/types.h>
37 #include <X11/Xlib.h>
38 #include <X11/xpm.h>
39 #include <X11/extensions/shape.h>
41 extern Display *display;
43 /* prefs file mode */
44 #define P_READ 1
45 #define P_WRITE 2
47 #define MAX_LINE_LEN 512
48 #define MAX_VALUE_LEN 256
50 #define MAX_STRING_LEN 32
52 /* mouse buttons */
53 #define LMB 1
54 #define MMB 2
55 #define RMB 3
57 #define MAX_MOUSE_REGION 8
59 #define FONT_SMALL 1
60 #define FONT_NORMAL 2
61 #define FONT_LARGE 3
63 /*-------------------------------------------------------------------------------*/
65 typedef struct {
66 int enable;
67 int top;
68 int bottom;
69 int left;
70 int right;
71 } MOUSE_REGION;
74 typedef struct {
75 Pixmap pixmap;
76 Pixmap mask;
77 XpmAttributes attributes;
78 } XpmIcon;
80 #define NUM_COLORS 10
82 enum {
83 F_NOT_AVAILABLE = 0,
84 F_REGULAR,
85 F_DIRECTORY,
86 F_CHAR_DEVICE,
87 F_BLOCK_DEVICE,
88 F_LINK,
89 F_FIFO,
90 F_SOCK
93 /*-------------------------------------------------------------------------------*/
95 void dcl_open_x_window (int argc, char *argv[], char **, char *, int, int);
96 void dcl_redraw_window (void);
97 void dcl_redraw_window_xy (int x, int y);
98 void dcl_copy_xpm_area (int x, int y, int sx, int sy, int dx, int dy);
99 void dcl_copy_font_xpm_area (int x, int y, int sx, int sy, int dx, int dy);
100 void dcl_copy_led_xpm_area (int x, int y, int sx, int sy, int dx, int dy);
101 void dcl_copy_xbm_area (int x, int y, int sx, int sy, int dx, int dy);
102 void dcl_set_mask_xy (int x, int y);
103 void dcl_get_xpm (XpmIcon *wmgen, char **pixmap_bytes);
104 Pixel dcl_get_color (char *name);
105 int dcl_draw_char (int x, int y, char z, int font_type);
106 int dcl_draw_led (int x, int y, int color);
107 int dcl_draw_string (int x, int y, char *string, int font_type, int length);
108 void dcl_add_mouse_region (int index, int left, int top, int right, int bottom);
109 int dcl_check_mouse_region (int x, int y);
110 char* dcl_getfilename_config (char *config_dir, char *config_filename);
111 void* dcl_prefs_openfile (char *filename, int openmode);
112 void dcl_prefs_closefile (void);
113 void dcl_prefs_put_int (char *tagname, int value);
114 void dcl_prefs_put_float (char *tagname, float value);
115 void dcl_prefs_put_string (char *tagname, char *value);
116 void dcl_prefs_put_lf (void);
117 void dcl_prefs_put_comment (char *comment);
118 int dcl_prefs_get_int (char *tagname);
119 float dcl_prefs_get_float (char *tagname);
120 char* dcl_prefs_get_string (char *tagname);
121 char* dcl_strcpy (char *dest, const char *src, int maxlength);
122 char* dcl_strcat (char *dest, const char *src, int maxlength);
123 void dcl_execute_command (char *command, int flag);
124 int dcl_check_file (char *filename);
125 void dcl_draw_point (int x, int y, Pixel color);
126 void dcl_draw_line (int x0, int y0, int x1, int y1, Pixel color);
130 * Created: Sat 26 Mar 2005 05:46:11 PM CET
131 * Last Modified: Sat 26 Mar 2005 10:53:50 PM CET