1 /*
2  * Copyright (C) 2004-2019 the xine project
3  *
4  * This file is part of xine, a unix video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  *
20  */
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 
25 #include <X11/Xlib.h>
26 #include <X11/cursorfont.h>
27 
28 #include "_xitk.h"
29 
30 #define MAX_CURSORS  xitk_cursor_num_glyphs
31 
32 #define X_CURSOR     0
33 #define XITK_CURSOR  1
34 
35 static struct cursors_s {
36   xitk_cursors_t  xitk_shape;
37   unsigned int    x_shape;
38   unsigned int    embedded;
39   Cursor          cursor;
40   Pixmap          p;
41   Pixmap          mask;
42 } cursors[] = {
43   { xitk_cursor_invisible,              0,                      XITK_CURSOR,   None,  None,  None  },
44   { xitk_cursor_X_cursor,               XC_X_cursor,            X_CURSOR,      None,  None,  None  },
45   { xitk_cursor_arrow,                  XC_arrow,               X_CURSOR,      None,  None,  None  },
46   { xitk_cursor_based_arrow_down,       XC_based_arrow_down,    X_CURSOR,      None,  None,  None  },
47   { xitk_cursor_based_arrow_up,         XC_based_arrow_up,      X_CURSOR,      None,  None,  None  },
48   { xitk_cursor_boat,                   XC_boat,                X_CURSOR,      None,  None,  None  },
49   { xitk_cursor_bogosity,               XC_bogosity,            X_CURSOR,      None,  None,  None  },
50   { xitk_cursor_bottom_left_corner,     XC_bottom_left_corner,  XITK_CURSOR,   None,  None,  None  },
51   { xitk_cursor_bottom_right_corner,    XC_bottom_right_corner, XITK_CURSOR,   None,  None,  None  },
52   { xitk_cursor_bottom_side,            XC_bottom_side,         XITK_CURSOR,   None,  None,  None  },
53   { xitk_cursor_bottom_tee,             XC_bottom_tee,          X_CURSOR,      None,  None,  None  },
54   { xitk_cursor_box_spiral,             XC_box_spiral,          X_CURSOR,      None,  None,  None  },
55   { xitk_cursor_center_ptr,             XC_center_ptr,          XITK_CURSOR,   None,  None,  None  },
56   { xitk_cursor_circle,                 XC_circle,              XITK_CURSOR,   None,  None,  None  },
57   { xitk_cursor_clock,                  XC_clock,               X_CURSOR,      None,  None,  None  },
58   { xitk_cursor_coffee_mug,             XC_coffee_mug,          X_CURSOR,      None,  None,  None  },
59   { xitk_cursor_cross,                  XC_cross,               XITK_CURSOR,   None,  None,  None  },
60   { xitk_cursor_cross_reverse,          XC_cross_reverse,       X_CURSOR,      None,  None,  None  },
61   { xitk_cursor_crosshair,              XC_crosshair,           X_CURSOR,      None,  None,  None  },
62   { xitk_cursor_diamond_cross,          XC_diamond_cross,       X_CURSOR,      None,  None,  None  },
63   { xitk_cursor_dot,                    XC_dot,                 X_CURSOR,      None,  None,  None  },
64   { xitk_cursor_dotbox,                 XC_dotbox,              XITK_CURSOR,   None,  None,  None  },
65   { xitk_cursor_double_arrow,           XC_double_arrow,        XITK_CURSOR,   None,  None,  None  },
66   { xitk_cursor_draft_large,            XC_draft_large,         X_CURSOR,      None,  None,  None  },
67   { xitk_cursor_draft_small,            XC_draft_small,         X_CURSOR,      None,  None,  None  },
68   { xitk_cursor_draped_box,             XC_draped_box,          XITK_CURSOR,   None,  None,  None  },
69   { xitk_cursor_exchange,               XC_exchange,            X_CURSOR,      None,  None,  None  },
70   { xitk_cursor_fleur,                  XC_fleur,               XITK_CURSOR,   None,  None,  None  },
71   { xitk_cursor_gobbler,                XC_gobbler,             X_CURSOR,      None,  None,  None  },
72   { xitk_cursor_gumby,                  XC_gumby,               X_CURSOR,      None,  None,  None  },
73   { xitk_cursor_hand1,                  XC_hand1,               X_CURSOR,      None,  None,  None  },
74   { xitk_cursor_hand2,                  XC_hand2,               XITK_CURSOR,   None,  None,  None  },
75   { xitk_cursor_heart,                  XC_heart,               X_CURSOR,      None,  None,  None  },
76   { xitk_cursor_icon,                   XC_icon,                X_CURSOR,      None,  None,  None  },
77   { xitk_cursor_iron_cross,             XC_iron_cross,          X_CURSOR,      None,  None,  None  },
78   { xitk_cursor_left_ptr,               XC_left_ptr,            XITK_CURSOR,   None,  None,  None  },
79   { xitk_cursor_left_side,              XC_left_side,           XITK_CURSOR,   None,  None,  None  },
80   { xitk_cursor_left_tee,               XC_left_tee,            X_CURSOR,      None,  None,  None  },
81   { xitk_cursor_leftbutton,             XC_leftbutton,          X_CURSOR,      None,  None,  None  },
82   { xitk_cursor_ll_angle,               XC_ll_angle,            X_CURSOR,      None,  None,  None  },
83   { xitk_cursor_lr_angle,               XC_lr_angle,            X_CURSOR,      None,  None,  None  },
84   { xitk_cursor_man,                    XC_man,                 X_CURSOR,      None,  None,  None  },
85   { xitk_cursor_middlebutton,           XC_middlebutton,        X_CURSOR,      None,  None,  None  },
86   { xitk_cursor_mouse,                  XC_mouse,               X_CURSOR,      None,  None,  None  },
87   { xitk_cursor_pencil,                 XC_pencil,              XITK_CURSOR,   None,  None,  None  },
88   { xitk_cursor_pirate,                 XC_pirate,              X_CURSOR,      None,  None,  None  },
89   { xitk_cursor_plus,                   XC_plus,                X_CURSOR,      None,  None,  None  },
90   { xitk_cursor_question_arrow,         XC_question_arrow,      XITK_CURSOR,   None,  None,  None  },
91   { xitk_cursor_right_ptr,              XC_right_ptr,           XITK_CURSOR,   None,  None,  None  },
92   { xitk_cursor_right_side,             XC_right_side,          XITK_CURSOR,   None,  None,  None  },
93   { xitk_cursor_right_tee,              XC_right_tee,           X_CURSOR,      None,  None,  None  },
94   { xitk_cursor_rightbutton,            XC_rightbutton,         X_CURSOR,      None,  None,  None  },
95   { xitk_cursor_rtl_logo,               XC_rtl_logo,            X_CURSOR,      None,  None,  None  },
96   { xitk_cursor_sailboat,               XC_sailboat,            X_CURSOR,      None,  None,  None  },
97   { xitk_cursor_sb_down_arrow,          XC_sb_down_arrow,       XITK_CURSOR,   None,  None,  None  },
98   { xitk_cursor_sb_h_double_arrow,      XC_sb_h_double_arrow,   XITK_CURSOR,   None,  None,  None  },
99   { xitk_cursor_sb_left_arrow,          XC_sb_left_arrow,       XITK_CURSOR,   None,  None,  None  },
100   { xitk_cursor_sb_right_arrow,         XC_sb_right_arrow,      XITK_CURSOR,   None,  None,  None  },
101   { xitk_cursor_sb_up_arrow,            XC_sb_up_arrow,         XITK_CURSOR,   None,  None,  None  },
102   { xitk_cursor_sb_v_double_arrow,      XC_sb_v_double_arrow,   XITK_CURSOR,   None,  None,  None  },
103   { xitk_cursor_shuttle,                XC_shuttle,             X_CURSOR,      None,  None,  None  },
104   { xitk_cursor_sizing,                 XC_sizing,              X_CURSOR,      None,  None,  None  },
105   { xitk_cursor_spider,                 XC_spider,              X_CURSOR,      None,  None,  None  },
106   { xitk_cursor_spraycan,               XC_spraycan,            X_CURSOR,      None,  None,  None  },
107   { xitk_cursor_star,                   XC_star,                X_CURSOR,      None,  None,  None  },
108   { xitk_cursor_target,                 XC_target,              X_CURSOR,      None,  None,  None  },
109   { xitk_cursor_tcross,                 XC_tcross,              X_CURSOR,      None,  None,  None  },
110   { xitk_cursor_top_left_arrow,         XC_top_left_arrow,      X_CURSOR,      None,  None,  None  },
111   { xitk_cursor_top_left_corner,        XC_top_left_corner,     XITK_CURSOR,   None,  None,  None  },
112   { xitk_cursor_top_right_corner,       XC_top_right_corner,    XITK_CURSOR,   None,  None,  None  },
113   { xitk_cursor_top_side,               XC_top_side,            XITK_CURSOR,   None,  None,  None  },
114   { xitk_cursor_top_tee,                XC_top_tee,             X_CURSOR,      None,  None,  None  },
115   { xitk_cursor_trek,                   XC_trek,                X_CURSOR,      None,  None,  None  },
116   { xitk_cursor_ul_angle,               XC_ul_angle,            X_CURSOR,      None,  None,  None  },
117   { xitk_cursor_umbrella,               XC_umbrella,            X_CURSOR,      None,  None,  None  },
118   { xitk_cursor_ur_angle,               XC_ur_angle,            X_CURSOR,      None,  None,  None  },
119   { xitk_cursor_watch,                  XC_watch,               X_CURSOR,      None,  None,  None  },
120   { xitk_cursor_xterm,                  XC_xterm,               XITK_CURSOR,   None,  None,  None  },
121   { xitk_cursor_num_glyphs,             XC_num_glyphs,          X_CURSOR,      None,  None,  None  }
122 };
123 
124 static const unsigned char no_data[] = {
125   0,0,0,0, 0,0,0,0
126 };
127 
128 static const unsigned char bottom_left_corner_mask_bits[] = {
129    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
130    0x00, 0xf0, 0x0f, 0x00, 0xf0, 0x0f, 0x00, 0xe0, 0x0f, 0x00, 0xc0, 0x0f,
131    0x00, 0xe0, 0x0f, 0x00, 0xf0, 0x0f, 0x00, 0xf8, 0x0e, 0x60, 0x7c, 0x0c,
132    0xe0, 0x3e, 0x00, 0xe0, 0x1f, 0x00, 0xe0, 0x0f, 0x00, 0xe0, 0x07, 0x00,
133    0xe0, 0x0f, 0x00, 0xe0, 0x1f, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00,
134    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
135 static const unsigned char bottom_left_corner_bits[] = {
136    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
137    0x00, 0xf0, 0x0f, 0x00, 0x10, 0x08, 0x00, 0x20, 0x08, 0x00, 0x40, 0x08,
138    0x00, 0x20, 0x08, 0x00, 0x10, 0x09, 0x00, 0x88, 0x0a, 0x60, 0x44, 0x0c,
139    0xa0, 0x22, 0x00, 0x20, 0x11, 0x00, 0x20, 0x08, 0x00, 0x20, 0x04, 0x00,
140    0x20, 0x08, 0x00, 0x20, 0x10, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00,
141    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
142 
143 static const unsigned char bottom_right_corner_mask_bits[] = {
144    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145    0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0xf0, 0x0f, 0x00, 0xf0, 0x07, 0x00,
146    0xf0, 0x03, 0x00, 0xf0, 0x07, 0x00, 0xf0, 0x0f, 0x00, 0x70, 0x1f, 0x00,
147    0x30, 0x3e, 0x06, 0x00, 0x7c, 0x07, 0x00, 0xf8, 0x07, 0x00, 0xf0, 0x07,
148    0x00, 0xe0, 0x07, 0x00, 0xf0, 0x07, 0x00, 0xf8, 0x07, 0x00, 0xf8, 0x07,
149    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
150 static const unsigned char bottom_right_corner_bits[] = {
151    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
152    0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x10, 0x08, 0x00, 0x10, 0x04, 0x00,
153    0x10, 0x02, 0x00, 0x10, 0x04, 0x00, 0x90, 0x08, 0x00, 0x50, 0x11, 0x00,
154    0x30, 0x22, 0x06, 0x00, 0x44, 0x05, 0x00, 0x88, 0x04, 0x00, 0x10, 0x04,
155    0x00, 0x20, 0x04, 0x00, 0x10, 0x04, 0x00, 0x08, 0x04, 0x00, 0xf8, 0x07,
156    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
157 
158 static const unsigned char bottom_side_mask_bits[] = {
159    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
160    0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
161    0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x3c, 0x00, 0x00,
162    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
163    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
164    0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0xff, 0x00, 0x00,
165    0x00, 0x7e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
166    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
167    0x00, 0x00, 0x00, 0x00 };
168 static const unsigned char bottom_side_bits[] = {
169    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
170    0x00, 0x24, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
171    0x80, 0x00, 0x01, 0x00, 0x80, 0xe7, 0x01, 0x00, 0x00, 0x24, 0x00, 0x00,
172    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
173    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
174    0x80, 0xe7, 0x01, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00,
175    0x00, 0x42, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
176    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177    0x00, 0x00, 0x00, 0x00 };
178 
179 static const unsigned char center_ptr_mask_bits[] = {
180    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
181    0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
182    0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x3c, 0x00, 0x00,
183    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
184    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
185    0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
186    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
187    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
188    0x00, 0x00, 0x00, 0x00 };
189 static const unsigned char center_ptr_bits[] = {
190    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
191    0x00, 0x24, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
192    0x80, 0x00, 0x01, 0x00, 0x80, 0xe7, 0x01, 0x00, 0x00, 0x24, 0x00, 0x00,
193    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
194    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
195    0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
196    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
197    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198    0x00, 0x00, 0x00, 0x00 };
199 
200 static const unsigned char circle_mask_bits[] = {
201    0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
202    0x1c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
203    0xfc, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00,
204    0xfc, 0x07, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00,
205    0xfc, 0x01, 0x00, 0x00, 0xdc, 0x03, 0x00, 0x00, 0xcc, 0x03, 0x1e, 0x00,
206    0x84, 0x87, 0x7f, 0x00, 0x80, 0xc7, 0xe1, 0x00, 0x00, 0xcf, 0xc3, 0x00,
207    0x00, 0x6f, 0x87, 0x01, 0x00, 0x6e, 0x8e, 0x01, 0x00, 0x60, 0x9c, 0x01,
208    0x00, 0x60, 0xb8, 0x01, 0x00, 0xc0, 0xf0, 0x00, 0x00, 0xc0, 0xe1, 0x00,
209    0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
210    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
212 static const unsigned char circle_bits[] = {
213    0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
214    0x14, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00,
215    0x84, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00,
216    0x04, 0x04, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0x04, 0x1f, 0x00, 0x00,
217    0x24, 0x01, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00,
218    0x84, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
219    0x00, 0x09, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
221    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
222    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
223    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
224 
225 static const unsigned char cross_mask_bits[] = {
226    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
227    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
228    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
229    0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01,
230    0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
231    0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80,
232    0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0xc0, 0xff, 0xff, 0x07,
233    0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,
234    0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01,
235    0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
236    0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
237    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
238    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
239    0x00, 0x00, 0x00, 0x00 };
240 static const unsigned char cross_bits[] = {
241    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
242    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
243    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
244    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
245    0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
246    0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
247    0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07,
248    0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
249    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
250    0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
251    0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
252    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
253    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
254    0x00, 0x00, 0x00, 0x00 };
255 
256 static const unsigned char dotbox_mask_bits[] = {
257    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xb6, 0x1d,
258    0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10,
259    0x04, 0x3c, 0x10, 0x00, 0x7f, 0x00, 0x04, 0xff, 0x10, 0x84, 0xff, 0x10,
260    0x80, 0xff, 0x00, 0x84, 0xff, 0x10, 0x04, 0xff, 0x10, 0x00, 0x7f, 0x00,
261    0x04, 0x1c, 0x10, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10,
262    0x04, 0x00, 0x10, 0xdc, 0xb6, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
263 static const unsigned char dotbox_bits[] = {
264    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xb6, 0x1d,
265    0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10,
266    0x04, 0x00, 0x10, 0x00, 0x60, 0x00, 0x04, 0xe0, 0x10, 0x04, 0xf8, 0x10,
267    0x80, 0xfe, 0x00, 0x84, 0xff, 0x10, 0x04, 0xbf, 0x10, 0x00, 0x6f, 0x00,
268    0x04, 0x1c, 0x10, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x10,
269    0x04, 0x00, 0x10, 0xdc, 0xb6, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
270 
271 static const unsigned char double_arrow_mask_bits[] = {
272    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x3c, 0x00,
273    0x00, 0x7e, 0x00, 0x00, 0xff, 0x00, 0x80, 0xff, 0x01, 0x80, 0xff, 0x01,
274    0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00,
275    0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x80, 0xff, 0x01,
276    0x80, 0xff, 0x01, 0x00, 0xff, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x3c, 0x00,
277    0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
278 static const unsigned char double_arrow_bits[] = {
279    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x24, 0x00,
280    0x00, 0x42, 0x00, 0x00, 0x81, 0x00, 0x80, 0x00, 0x01, 0x80, 0xe7, 0x01,
281    0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00,
282    0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x80, 0xe7, 0x01,
283    0x80, 0x00, 0x01, 0x00, 0x81, 0x00, 0x00, 0x42, 0x00, 0x00, 0x24, 0x00,
284    0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
285 
286 static const unsigned char draped_box_mask_bits[] = {
287    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288    0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00,
289    0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00,
290    0xfc, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x8c, 0x18,
291    0x00, 0x00, 0x00, 0x8c, 0x18, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00,
292    0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0xf0,
293    0x07, 0x00, 0x00, 0xc0, 0xf0, 0x87, 0x01, 0x00, 0xc0, 0xe0, 0xe7, 0x00,
294    0x00, 0xc0, 0xc1, 0xf3, 0x01, 0x00, 0xe0, 0x07, 0xf8, 0x01, 0x00, 0xf0,
295    0x3f, 0x7e, 0x00, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x60, 0xf8, 0x1f,
296    0x03, 0x00, 0xe0, 0x7f, 0xfe, 0x03, 0x00, 0xe0, 0x0f, 0xf0, 0x01, 0x00,
297    0xe0, 0x01, 0xc0, 0x01, 0x00, 0xc0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
298    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
299    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
300    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
301    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
302 static const unsigned char draped_box_bits[] = {
303    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
304    0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00,
305    0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00,
306    0xfc, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x88, 0x08,
307    0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00,
308    0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
309    0x00, 0x00, 0x00, 0x80, 0x00, 0x84, 0x00, 0x00, 0xc0, 0x20, 0x26, 0x00,
310    0x00, 0xc0, 0x41, 0x63, 0x01, 0x00, 0xa0, 0x03, 0x18, 0x01, 0x00, 0xe0,
311    0x0e, 0x4c, 0x00, 0x00, 0x00, 0x98, 0x03, 0x00, 0x00, 0x60, 0xe0, 0x1c,
312    0x02, 0x00, 0xc0, 0x5f, 0xd8, 0x03, 0x00, 0xc0, 0x06, 0x00, 0x01, 0x00,
313    0x40, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
314    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
315    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
316    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
317    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
318 
319 static const unsigned char fleur_mask_bits[] = {
320    0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
321    0x00, 0x7e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00,
322    0x80, 0xff, 0x01, 0x00, 0x60, 0x3c, 0x06, 0x00, 0x70, 0x3c, 0x0e, 0x00,
323    0x78, 0x3c, 0x1e, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0xfe, 0xff, 0x7f, 0x00,
324    0xfe, 0xff, 0x7f, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x78, 0x3c, 0x1e, 0x00,
325    0x70, 0x3c, 0x0e, 0x00, 0x60, 0x3c, 0x06, 0x00, 0x80, 0xff, 0x01, 0x00,
326    0x80, 0xff, 0x01, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
327    0x00, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
328    0x00, 0x00, 0x00, 0x00 };
329 static const unsigned char fleur_bits[] = {
330    0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
331    0x00, 0x42, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x80, 0x00, 0x01, 0x00,
332    0x80, 0xe7, 0x01, 0x00, 0x60, 0x24, 0x06, 0x00, 0x50, 0x24, 0x0a, 0x00,
333    0x48, 0x24, 0x12, 0x00, 0xc4, 0xe7, 0x23, 0x00, 0x02, 0x00, 0x40, 0x00,
334    0x02, 0x00, 0x40, 0x00, 0xc4, 0xe7, 0x23, 0x00, 0x48, 0x24, 0x12, 0x00,
335    0x50, 0x24, 0x0a, 0x00, 0x60, 0x24, 0x06, 0x00, 0x80, 0xe7, 0x01, 0x00,
336    0x80, 0x00, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
337    0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
338    0x00, 0x00, 0x00, 0x00 };
339 
340 static const unsigned char hand2_mask_bits[] = {
341    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
343    0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00,
344    0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00,
345    0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfe, 0x7f, 0x00,
346    0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
347    0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00,
348    0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00,
349    0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xfc, 0x3f, 0x00,
350    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
351    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
352 static const unsigned char hand2_bits[] = {
353    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
354    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
355    0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00,
356    0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00,
357    0x00, 0x48, 0x0e, 0x00, 0x00, 0x48, 0x32, 0x00, 0x00, 0x4e, 0x52, 0x00,
358    0x00, 0x4b, 0x92, 0x00, 0x00, 0x09, 0x90, 0x00, 0x00, 0x09, 0x80, 0x00,
359    0x00, 0x09, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00,
360    0x00, 0x01, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0xc0, 0x00,
361    0x00, 0x04, 0x40, 0x00, 0x00, 0x04, 0x60, 0x00, 0x00, 0xfc, 0x3f, 0x00,
362    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
363    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
364 
365 static const unsigned char left_ptr_mask_bits[] = {
366    0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0e, 0x00, 0x00,
367    0x1e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xfe, 0x00, 0x00,
368    0xfe, 0x01, 0x00, 0xfe, 0x03, 0x00, 0xfe, 0x07, 0x00, 0xfe, 0x0f, 0x00,
369    0xfe, 0x00, 0x00, 0xee, 0x01, 0x00, 0xe6, 0x01, 0x00, 0xc2, 0x03, 0x00,
370    0xc0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x80, 0x07, 0x00, 0x00, 0x07, 0x00,
371    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
372 static const unsigned char left_ptr_bits[] = {
373    0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0a, 0x00, 0x00,
374    0x12, 0x00, 0x00, 0x22, 0x00, 0x00, 0x42, 0x00, 0x00, 0x82, 0x00, 0x00,
375    0x02, 0x01, 0x00, 0x02, 0x02, 0x00, 0x02, 0x04, 0x00, 0x82, 0x0f, 0x00,
376    0x92, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x26, 0x01, 0x00, 0x42, 0x02, 0x00,
377    0x40, 0x02, 0x00, 0x80, 0x04, 0x00, 0x80, 0x04, 0x00, 0x00, 0x07, 0x00,
378    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
379 
380 static const unsigned char left_side_mask_bits[] = {
381    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
382    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
383    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0xc0, 0x01, 0x07, 0x00,
384    0xe0, 0x01, 0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf8, 0xff, 0x3f, 0x00,
385    0xf8, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0x01, 0x0f, 0x00,
386    0xc0, 0x01, 0x07, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
387    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
388    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
389    0x00, 0x00, 0x00, 0x00 };
390 static const unsigned char left_side_bits[] = {
391    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
392    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
393    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x40, 0x01, 0x05, 0x00,
394    0x20, 0x01, 0x09, 0x00, 0x10, 0xff, 0x11, 0x00, 0x08, 0x00, 0x20, 0x00,
395    0x08, 0x00, 0x20, 0x00, 0x10, 0xff, 0x11, 0x00, 0x20, 0x01, 0x09, 0x00,
396    0x40, 0x01, 0x05, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
397    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
398    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
399    0x00, 0x00, 0x00, 0x00 };
400 
401 static const unsigned char pencil_mask_bits[] = {
402    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
403    0x18, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
404    0xf0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00,
405    0x80, 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
406    0x00, 0x7c, 0x00, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0xf0, 0x0d, 0x00,
407    0x00, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x80, 0x7f, 0x00,
408    0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfc, 0x00,
409    0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x60, 0x00,
410    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
411    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
412    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
413 static const unsigned char pencil_bits[] = {
414    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
415    0x18, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00,
416    0x70, 0x01, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0xc0, 0x04, 0x00, 0x00,
417    0x80, 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00,
418    0x00, 0x4c, 0x00, 0x00, 0x00, 0xb8, 0x04, 0x00, 0x00, 0x70, 0x0d, 0x00,
419    0x00, 0xe0, 0x1e, 0x00, 0x00, 0xc0, 0x35, 0x00, 0x00, 0x80, 0x6b, 0x00,
420    0x00, 0x00, 0xd7, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0xdc, 0x00,
421    0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x60, 0x00,
422    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
423    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
424    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
425 
426 static const unsigned char question_arrow_mask_bits[] = {
427    0x00, 0x00, 0x00, 0x02, 0xf8, 0x03, 0x06, 0x9c, 0x07, 0x0e, 0x0e, 0x0f,
428    0x1e, 0x0e, 0x0f, 0x3e, 0x0e, 0x0f, 0x7e, 0x0e, 0x07, 0xfe, 0x80, 0x03,
429    0xfe, 0xc1, 0x01, 0xfe, 0xe3, 0x00, 0xfe, 0xe7, 0x00, 0xfe, 0xef, 0x00,
430    0xfe, 0x00, 0x00, 0xee, 0xe1, 0x00, 0xe6, 0xf1, 0x01, 0xc2, 0xe3, 0x00,
431    0xc0, 0x03, 0x00, 0x80, 0x07, 0x00, 0x80, 0x07, 0x00, 0x00, 0x07, 0x00,
432    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
433 static const unsigned char question_arrow_bits[] = {
434    0x00, 0x00, 0x00, 0x02, 0xf8, 0x03, 0x06, 0x9c, 0x07, 0x0a, 0x0e, 0x0f,
435    0x12, 0x0e, 0x0f, 0x22, 0x0e, 0x0f, 0x42, 0x0e, 0x07, 0x82, 0x80, 0x03,
436    0x02, 0xc1, 0x01, 0x02, 0xe2, 0x00, 0x02, 0xe4, 0x00, 0x82, 0xef, 0x00,
437    0x92, 0x00, 0x00, 0x2a, 0xe1, 0x00, 0x26, 0xf1, 0x01, 0x42, 0xe2, 0x00,
438    0x40, 0x02, 0x00, 0x80, 0x04, 0x00, 0x80, 0x04, 0x00, 0x00, 0x07, 0x00,
439    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
440 
441 static const unsigned char right_ptr_mask_bits[] = {
442    0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x38, 0x00,
443    0x00, 0x3c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x3f, 0x00, 0x80, 0x3f, 0x00,
444    0xc0, 0x3f, 0x00, 0xe0, 0x3f, 0x00, 0xf0, 0x3f, 0x00, 0xf8, 0x3f, 0x00,
445    0x80, 0x3f, 0x00, 0xc0, 0x3b, 0x00, 0xc0, 0x33, 0x00, 0xe0, 0x21, 0x00,
446    0xe0, 0x01, 0x00, 0xf0, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x70, 0x00, 0x00,
447    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
448 static const unsigned char right_ptr_bits[] = {
449    0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x28, 0x00,
450    0x00, 0x24, 0x00, 0x00, 0x22, 0x00, 0x00, 0x21, 0x00, 0x80, 0x20, 0x00,
451    0x40, 0x20, 0x00, 0x20, 0x20, 0x00, 0x10, 0x20, 0x00, 0xf8, 0x20, 0x00,
452    0x80, 0x24, 0x00, 0x40, 0x2a, 0x00, 0x40, 0x32, 0x00, 0x20, 0x21, 0x00,
453    0x20, 0x01, 0x00, 0x90, 0x00, 0x00, 0x90, 0x00, 0x00, 0x70, 0x00, 0x00,
454    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
455 
456 static const unsigned char right_side_mask_bits[] = {
457    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
458    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
459    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0xc0, 0x01, 0x07, 0x00,
460    0xe0, 0x01, 0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf8, 0xff, 0x3f, 0x00,
461    0xf8, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0x01, 0x0f, 0x00,
462    0xc0, 0x01, 0x07, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
463    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
464    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
465    0x00, 0x00, 0x00, 0x00 };
466 static const unsigned char right_side_bits[] = {
467    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
468    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
469    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x40, 0x01, 0x05, 0x00,
470    0x20, 0x01, 0x09, 0x00, 0x10, 0xff, 0x11, 0x00, 0x08, 0x00, 0x20, 0x00,
471    0x08, 0x00, 0x20, 0x00, 0x10, 0xff, 0x11, 0x00, 0x20, 0x01, 0x09, 0x00,
472    0x40, 0x01, 0x05, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
473    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
474    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
475    0x00, 0x00, 0x00, 0x00 };
476 
477 static const unsigned char sb_down_arrow_mask_bits[] = {
478    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
479    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
480    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
481    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
482    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
483    0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0xff, 0x00, 0x00,
484    0x00, 0x7e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
485    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
486    0x00, 0x00, 0x00, 0x00 };
487 static const unsigned char sb_down_arrow_bits[] = {
488    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
489    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
490    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
491    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
492    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
493    0x80, 0xe7, 0x01, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x81, 0x00, 0x00,
494    0x00, 0x42, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
495    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
496    0x00, 0x00, 0x00, 0x00 };
497 
498 static const unsigned char sb_h_double_arrow_mask_bits[] = {
499    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
500    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
501    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0xc0, 0x01, 0x07, 0x00,
502    0xe0, 0x01, 0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xf8, 0xff, 0x3f, 0x00,
503    0xf8, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0x01, 0x0f, 0x00,
504    0xc0, 0x01, 0x07, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
505    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
506    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
507    0x00, 0x00, 0x00, 0x00 };
508 static const unsigned char sb_h_double_arrow_bits[] = {
509    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
510    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
511    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x03, 0x00, 0x40, 0x01, 0x05, 0x00,
512    0x20, 0x01, 0x09, 0x00, 0x10, 0xff, 0x11, 0x00, 0x08, 0x00, 0x20, 0x00,
513    0x08, 0x00, 0x20, 0x00, 0x10, 0xff, 0x11, 0x00, 0x20, 0x01, 0x09, 0x00,
514    0x40, 0x01, 0x05, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
515    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
516    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
517    0x00, 0x00, 0x00, 0x00 };
518 
519 static const unsigned char sb_left_arrow_mask_bits[] = {
520    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
521    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
522    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
523    0xe0, 0x01, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf8, 0xff, 0x0f, 0x00,
524    0xf8, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xe0, 0x01, 0x00, 0x00,
525    0xc0, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
526    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
527    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
528    0x00, 0x00, 0x00, 0x00 };
529 static const unsigned char sb_left_arrow_bits[] = {
530    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
531    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
532    0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00,
533    0x20, 0x01, 0x00, 0x00, 0x10, 0xff, 0x0f, 0x00, 0x08, 0x00, 0x08, 0x00,
534    0x08, 0x00, 0x08, 0x00, 0x10, 0xff, 0x0f, 0x00, 0x20, 0x01, 0x00, 0x00,
535    0x40, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
536    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
537    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
538    0x00, 0x00, 0x00, 0x00 };
539 
540 static const unsigned char sb_right_arrow_mask_bits[] = {
541    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
542    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
543    0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
544    0xfe, 0xff, 0x01, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03, 0x00,
545    0xfe, 0xff, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00,
546    0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
547    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
548    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
549    0x00, 0x00, 0x00, 0x00 };
550 static const unsigned char sb_right_arrow_bits[] = {
551    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
552    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
553    0x00, 0x30, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00,
554    0xfe, 0x1f, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00,
555    0xfe, 0x1f, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00,
556    0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
557    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
558    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
559    0x00, 0x00, 0x00, 0x00 };
560 
561 static const unsigned char sb_up_arrow_mask_bits[] = {
562    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
563    0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
564    0x80, 0xff, 0x01, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x3c, 0x00, 0x00,
565    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
566    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
567    0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
568    0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
569    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
570    0x00, 0x00, 0x00, 0x00 };
571 static const unsigned char sb_up_arrow_bits[] = {
572    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
573    0x00, 0x24, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00,
574    0x80, 0x00, 0x01, 0x00, 0x80, 0xe7, 0x01, 0x00, 0x00, 0x24, 0x00, 0x00,
575    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
576    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
577    0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
578    0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
579    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
580    0x00, 0x00, 0x00, 0x00 };
581 
582 static const unsigned char sb_v_double_arrow_mask_bits[] = {
583    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
584    0xc0, 0x0f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
585    0xf0, 0x3f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
586    0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
587    0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
588    0xf0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00,
589    0x80, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
590    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
591    0x00, 0x00, 0x00, 0x00 };
592 static const unsigned char sb_v_double_arrow_bits[] = {
593    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
594    0x40, 0x08, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00,
595    0xf0, 0x3c, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
596    0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
597    0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xf0, 0x3c, 0x00, 0x00,
598    0x10, 0x20, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00,
599    0x80, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
600    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
601    0x00, 0x00, 0x00, 0x00 };
602 
603 static const unsigned char top_left_corner_mask_bits[] = {
604    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00,
605    0xfc, 0x03, 0x00, 0xfc, 0x01, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0x01, 0x00,
606    0xfc, 0x03, 0x00, 0xdc, 0x07, 0x00, 0x8c, 0x8f, 0x01, 0x00, 0xdf, 0x01,
607    0x00, 0xfe, 0x01, 0x00, 0xfc, 0x01, 0x00, 0xf8, 0x01, 0x00, 0xfc, 0x01,
608    0x00, 0xfe, 0x01, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
609    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
610 static const unsigned char top_left_corner_bits[] = {
611    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00,
612    0x04, 0x02, 0x00, 0x04, 0x01, 0x00, 0x84, 0x00, 0x00, 0x04, 0x01, 0x00,
613    0x24, 0x02, 0x00, 0x54, 0x04, 0x00, 0x8c, 0x88, 0x01, 0x00, 0x51, 0x01,
614    0x00, 0x22, 0x01, 0x00, 0x04, 0x01, 0x00, 0x08, 0x01, 0x00, 0x04, 0x01,
615    0x00, 0x02, 0x01, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
616    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
617 
618 static const unsigned char top_right_corner_mask_bits[] = {
619    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0xfe, 0x01,
620    0x00, 0xfc, 0x01, 0x00, 0xf8, 0x01, 0x00, 0xfc, 0x01, 0x00, 0xfe, 0x01,
621    0x00, 0xdf, 0x01, 0x8c, 0x8f, 0x01, 0xdc, 0x07, 0x00, 0xfc, 0x03, 0x00,
622    0xfc, 0x01, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xfc, 0x03, 0x00,
623    0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
624    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
625 static const unsigned char top_right_corner_bits[] = {
626    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x02, 0x01,
627    0x00, 0x04, 0x01, 0x00, 0x08, 0x01, 0x00, 0x04, 0x01, 0x00, 0x22, 0x01,
628    0x00, 0x51, 0x01, 0x8c, 0x88, 0x01, 0x54, 0x04, 0x00, 0x24, 0x02, 0x00,
629    0x04, 0x01, 0x00, 0x84, 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00,
630    0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
631    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
632 
633 static const unsigned char top_side_mask_bits[] = {
634    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
635    0xc0, 0x0f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
636    0xf0, 0x3f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
637    0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00,
638    0x80, 0x07, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00,
639    0xf0, 0x3f, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00,
640    0x80, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
641    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
642    0x00, 0x00, 0x00, 0x00 };
643 static const unsigned char top_side_bits[] = {
644    0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
645    0x40, 0x08, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00,
646    0xf0, 0x3c, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
647    0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00,
648    0x80, 0x04, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xf0, 0x3c, 0x00, 0x00,
649    0x10, 0x20, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00,
650    0x80, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
651    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
652    0x00, 0x00, 0x00, 0x00 };
653 
654 static const unsigned char xterm_mask_bits[] = {
655    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
656    0x00, 0x7f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
657    0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
658    0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
659    0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
660    0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
661    0x00, 0x3f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
662    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
663    0x00, 0x00, 0x00, 0x00 };
664 static const unsigned char xterm_bits[] = {
665    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
666    0x00, 0x7f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
667    0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
668    0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
669    0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
670    0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
671    0x00, 0x08, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
672    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
673    0x00, 0x00, 0x00, 0x00 };
674 
675 
_cursors_create_cursor(Display * display,struct cursors_s * cursor)676 static void _cursors_create_cursor(Display *display, struct cursors_s *cursor) {
677   XColor  bg, fg;
678 
679   bg.red   = 255 << 8;
680   bg.green = 255 << 8;
681   bg.blue  = 255 << 8;
682   fg.red   = 0;
683   fg.green = 0;
684   fg.blue  = 0;
685 
686   XLOCK (xitk_x_lock_display, display);
687   switch(cursor->xitk_shape) {
688 
689   case xitk_cursor_invisible:
690     {
691       XColor black = xitk_get_black_pixel_color();
692 
693       cursor->p      = XCreateBitmapFromData(display, DefaultRootWindow(display), (const char*)no_data, 8, 8);
694       cursor->cursor = XCreatePixmapCursor(display, cursor->p, cursor->p, &black, &black, 0, 0);
695     }
696     break;
697 
698   case xitk_cursor_hand2:
699     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)hand2_bits, 32, 32);
700     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)hand2_mask_bits, 32, 32);
701     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
702     break;
703 
704   case xitk_cursor_bottom_left_corner:
705     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_left_corner_bits, 24, 24);
706     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_left_corner_mask_bits, 24, 24);
707     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
708     break;
709 
710   case xitk_cursor_bottom_right_corner:
711     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_right_corner_bits, 24, 24);
712     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_right_corner_mask_bits, 24, 24);
713     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
714     break;
715 
716   case xitk_cursor_bottom_side:
717     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_side_bits, 25, 25);
718     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)bottom_side_mask_bits, 25, 25);
719     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
720     break;
721 
722   case xitk_cursor_center_ptr:
723     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)center_ptr_bits, 25, 25);
724     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)center_ptr_mask_bits, 25, 25);
725     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
726     break;
727 
728   case xitk_cursor_circle:
729     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)circle_bits, 32, 32);
730     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)circle_mask_bits, 32, 32);
731     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
732     break;
733 
734   case xitk_cursor_cross:
735     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)cross_bits, 34, 32);
736     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)cross_mask_bits, 34, 32);
737     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
738     break;
739 
740   case xitk_cursor_dotbox:
741     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)dotbox_bits, 24, 24);
742     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)dotbox_mask_bits, 24, 24);
743     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
744     break;
745 
746   case xitk_cursor_double_arrow:
747     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)double_arrow_bits, 24, 24);
748     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)double_arrow_mask_bits, 24, 24);
749     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
750     break;
751 
752   case xitk_cursor_draped_box:
753     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)draped_box_bits, 38, 36);
754     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)draped_box_mask_bits, 38, 36);
755     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
756     break;
757 
758   case xitk_cursor_fleur:
759     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)fleur_bits, 25, 25);
760     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)fleur_mask_bits, 25, 25);
761     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
762     break;
763 
764   case xitk_cursor_sb_h_double_arrow:
765     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_h_double_arrow_bits, 25, 25);
766     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_h_double_arrow_mask_bits, 25, 25);
767     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
768     break;
769 
770   case xitk_cursor_sb_left_arrow:
771     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_left_arrow_bits, 25, 25);
772     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_left_arrow_mask_bits, 25, 25);
773     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
774     break;
775 
776   case xitk_cursor_sb_right_arrow:
777     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_right_arrow_bits, 25, 25);
778     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_right_arrow_mask_bits, 25, 25);
779     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
780     break;
781 
782   case xitk_cursor_sb_up_arrow:
783     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_up_arrow_bits, 25, 25);
784     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_up_arrow_mask_bits, 25, 25);
785     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
786     break;
787 
788   case xitk_cursor_sb_down_arrow:
789     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_down_arrow_bits, 25, 25);
790     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_down_arrow_mask_bits, 25, 25);
791     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
792     break;
793 
794   case xitk_cursor_sb_v_double_arrow:
795     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_v_double_arrow_bits, 25, 25);
796     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)sb_v_double_arrow_mask_bits, 25, 25);
797     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
798     break;
799 
800   case xitk_cursor_top_left_corner:
801     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_left_corner_bits, 24, 24);
802     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_left_corner_mask_bits, 24, 24);
803     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
804     break;
805 
806   case xitk_cursor_top_right_corner:
807     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_right_corner_bits, 24, 24);
808     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_right_corner_mask_bits, 24, 24);
809     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
810     break;
811 
812   case xitk_cursor_top_side:
813     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_side_bits, 25, 25);
814     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)top_side_mask_bits, 25, 25);
815     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
816     break;
817 
818   case xitk_cursor_xterm:
819     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)xterm_bits, 26, 25);
820     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)xterm_mask_bits, 26, 25);
821     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
822     break;
823 
824   case xitk_cursor_question_arrow:
825     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)question_arrow_bits, 24, 24);
826     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)question_arrow_mask_bits, 24, 24);
827     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
828     break;
829 
830   case xitk_cursor_left_ptr:
831     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)left_ptr_bits, 24, 24);
832     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)left_ptr_mask_bits, 24, 24);
833     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
834     break;
835 
836   case xitk_cursor_right_ptr:
837     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)right_ptr_bits, 24, 24);
838     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)right_ptr_mask_bits, 24, 24);
839     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
840     break;
841 
842   case xitk_cursor_right_side:
843     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)right_side_bits, 25, 25);
844     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)right_side_mask_bits, 25, 25);
845     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
846     break;
847 
848   case xitk_cursor_left_side:
849     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)left_side_bits, 25, 25);
850     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)left_side_mask_bits, 25, 25);
851     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
852     break;
853 
854   case xitk_cursor_pencil:
855     cursor->p       = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)pencil_bits, 32, 32);
856     cursor->mask    = XCreateBitmapFromData(display, DefaultRootWindow(display), (char *)pencil_mask_bits, 32, 32);
857     cursor->cursor  = XCreatePixmapCursor(display, cursor->p, cursor->mask, &fg, &bg, 0, 0);
858     break;
859 
860   default:
861     XITK_WARNING("cursor unhandled: %d. Fallback to X one.\n", cursor->xitk_shape);
862     cursors->cursor = XCreateFontCursor(display, cursor->x_shape);
863     break;
864   }
865   XUNLOCK (xitk_x_unlock_display, display);
866 }
867 
xitk_cursors_init(Display * display)868 void xitk_cursors_init(Display *display) {
869   int   i;
870   int   xitk_cursors = xitk_get_cursors_feature();
871 
872   /* Transparent cursor isn't a valid X cursor */
873   _cursors_create_cursor(display, &cursors[0]);
874 
875   for(i = 1; i < MAX_CURSORS; i++) {
876 
877     if(xitk_cursors) {
878       if(cursors[i].embedded == X_CURSOR) {
879         XLOCK (xitk_x_lock_display, display);
880 	cursors[i].cursor = XCreateFontCursor(display, cursors[i].x_shape);
881         XUNLOCK (xitk_x_unlock_display, display);
882       }
883       else
884 	_cursors_create_cursor(display, &cursors[i]);
885     }
886     else {
887       XLOCK (xitk_x_lock_display, display);
888       cursors[i].cursor = XCreateFontCursor(display, cursors[i].x_shape);
889       XUNLOCK (xitk_x_unlock_display, display);
890     }
891   }
892 }
893 
xitk_cursors_deinit(Display * display)894 void xitk_cursors_deinit(Display *display) {
895   int i;
896 
897   XLOCK (xitk_x_lock_display, display);
898   for(i = 0; i < MAX_CURSORS; i++) {
899     XFreeCursor(display, cursors[i].cursor);
900 
901     if(cursors[i].embedded == XITK_CURSOR) {
902       if(cursors[i].p != None)
903 	XFreePixmap(display, cursors[i].p);
904       if(cursors[i].mask != None)
905 	XFreePixmap(display, cursors[i].mask);
906     }
907 
908   }
909   XUNLOCK (xitk_x_unlock_display, display);
910 }
911 
912 /* Public */
xitk_cursors_define_window_cursor(Display * display,Window window,xitk_cursors_t cursor)913 void xitk_cursors_define_window_cursor(Display *display, Window window, xitk_cursors_t cursor) {
914   if(window != None) {
915     XLOCK (xitk_x_lock_display, display);
916     XDefineCursor(display, window, cursors[cursor].cursor);
917     XSync(display, False);
918     XUNLOCK (xitk_x_unlock_display, display);
919   }
920 }
921 
xitk_cursors_restore_window_cursor(Display * display,Window window)922 void xitk_cursors_restore_window_cursor(Display *display, Window window) {
923   if(window != None) {
924     XLOCK (xitk_x_lock_display, display);
925     XUndefineCursor(display, window);
926     XSync(display, False);
927     XUNLOCK (xitk_x_unlock_display, display);
928   }
929 }
930