3 static Display
*display
;
5 static Pixmap draw_area_pixmap
, font_pixmap
, display_text_pixmap
;
6 static Window icon_window
;
8 static void dockapp_copyarea(Pixmap src
, Pixmap dist
, int x_src
, int y_src
, int w
,
9 int h
, int x_dist
, int y_dist
);
10 static int offset_w
, offset_h
;
11 void init_variables(Display
*g_display
, GC g_gc
, Window g_icon_window
, int g_offset_w
, int g_offset_h
, Pixmap
**background
) {
14 icon_window
= g_icon_window
;
15 offset_h
= g_offset_h
;
16 offset_w
= g_offset_w
;
18 XpmCreatePixmapFromData(display
, icon_window
, display_text_xpm
, &display_text_pixmap
, NULL
, NULL
);
19 XpmCreatePixmapFromData(display
, icon_window
, font_xpm
, &font_pixmap
, NULL
, NULL
);
21 *background
= &display_text_pixmap
;
24 void restore_background() {
25 XpmCreatePixmapFromData(display
, icon_window
, display_text_xpm
, &display_text_pixmap
, NULL
, NULL
);
28 void flush_background() {
29 XCopyArea(display
, display_text_pixmap
, icon_window
, gc
, 0, 0, 64, 64, offset_w
, offset_h
);
34 void dockapp_copyarea(Pixmap src
, Pixmap dist
, int x_src
, int y_src
, int w
,
35 int h
, int x_dist
, int y_dist
) {
36 XCopyArea(display
, src
, dist
, gc
, x_src
, y_src
, w
, h
, x_dist
, y_dist
);
37 //XCopyArea(display, src, text_window, gc, x_src, y_src, w, h, x_dist, y_dist);
40 void draw_text(char *text
, int dx
, int dy
, Bool digit
) {
41 int ax
, ay
= 1, bx
, len
, i
;
42 char tmptext
[255] = "";
47 for (i = 0; i < len; i++) {
48 digit = (!isalpha(text[i])) ? True : False;
55 strcat(tmptext
, text
);
57 strcat(tmptext
, text
);
71 strcpy(tmptext
, text
);
74 for (i
= 0; i
< len
; i
++) {
75 if (isalpha(tmptext
[i
])) {
76 ax
= ((tolower(tmptext
[i
]) - 97) * 6) + 1;
79 ax
= ((tmptext
[i
] - 33) * 6) + 1;
83 if (tmptext
[i
] == 0x20)
86 dockapp_copyarea(font_pixmap
, display_text_pixmap
, ax
, ay
, 6, 8, dx
, dy
);