1 /* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */
2 
3 #ifndef ___UI_DISPLAY_H__
4 #define ___UI_DISPLAY_H__
5 
6 #include "../ui_display.h"
7 
8 #ifdef __FreeBSD__
9 /* CLKED, NLKED, SLKED and ALKED are defined in sys/kbio.h */
10 #else
11 #define CLKED 1
12 #define NLKED 2
13 #define SLKED 4
14 #define ALKED 8
15 #endif
16 
17 #define KeyPress 2      /* Private in fb/ */
18 #define ButtonPress 4   /* Private in fb/ */
19 #define ButtonRelease 5 /* Private in fb/ */
20 #define MotionNotify 6  /* Private in fb/ */
21 
22 #define IM_WINDOW_IS_ACTIVATED(disp) ((disp)->num_roots > 1 && (disp)->roots[1]->is_mapped)
23 
24 #ifdef USE_GRF
25 #define TP_COLOR 12
26 #endif
27 
28 /* common functions for ui_window.c */
29 
30 #define ui_display_get_pixel(disp, x, y) ui_display_get_pixel2(x, y)
31 
32 u_long ui_display_get_pixel2(int x, int y);
33 
34 #define ui_display_put_image(disp, x, y, image, size, need_fb_pixel) \
35         ui_display_put_image2(x, y, image, size, need_fb_pixel)
36 
37 void ui_display_put_image2(int x, int y, u_char *image, size_t size, int need_fb_pixel);
38 
39 #define ui_display_copy_lines(disp, src_x, src_y, dst_x, dst_y, width, height) \
40         ui_display_copy_lines2(src_x, src_y, dst_x, dst_y, width, height)
41 
42 void ui_display_copy_lines2(int src_x, int src_y, int dst_x, int dst_y, u_int width, u_int height);
43 
44 /* common functions for ui_window.c (pseudo color) */
45 
46 void ui_display_fill_with(int x, int y, u_int width, u_int height, u_int8_t pixel);
47 
48 int ui_cmap_get_closest_color(u_long *closest, int red, int green, int blue);
49 
50 int ui_cmap_get_pixel_rgb(u_int8_t *red, u_int8_t *green, u_int8_t *blue, u_long pixel);
51 
52 /* platform specific functions for ui_window.c */
53 
54 #ifdef WALL_PICTURE_SIXEL_REPLACES_SYSTEM_PALETTE
55 void ui_display_enable_to_change_cmap(int flag);
56 
57 int ui_display_is_changeable_cmap(void);
58 
59 void ui_display_set_cmap(u_int32_t *cmap, u_int cmap_size);
60 #endif
61 
62 #ifdef USE_GRF
63 int x68k_tvram_is_enabled(void);
64 
65 int x68k_tvram_set_wall_picture(u_short *image, u_int width, u_int height);
66 #endif
67 
68 #endif
69