3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <libx/base.h>
24 #include <libx/object.h>
25 #include <libx/image.h>
26 #include <libx/cursor.h>
27 #include <libx/text.h>
31 const unsigned char cursor_bitmap
[] = {
32 0x3f,0x3f,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
33 0x3f,0x3f,0x3f,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
34 0xff,0x3f,0x3f,0x3f,0x3f,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
35 0xff,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
36 0xff,0xff,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,
37 0xff,0xff,0xff,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0xff,0xff,0xff,0xff,
38 0xff,0xff,0xff,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,
39 0xff,0xff,0xff,0xff,0x3f,0x3f,0x3f,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,
40 0xff,0xff,0xff,0xff,0x3f,0x3f,0x3f,0xff,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,
41 0xff,0xff,0xff,0xff,0xff,0x3f,0xff,0xff,0xff,0x3f,0x00,0xff,0xff,0xff,0xff,
42 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xff,0xff,0xff,
43 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xff,0xff,
44 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,0xff,
45 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x00,
46 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f
54 int ret
= xcursor_update ();
56 xcursor_getpos (cur_x
, cur_y
);
58 zde_cursor
->x
= *cur_x
;
59 zde_cursor
->y
= *cur_y
;
63 zde_cursor
->state
= 0;
65 case XCURSOR_STATE_RBUTTON
:
66 zde_cursor
->state
= XCURSOR_STATE_RBUTTON
;
68 case XCURSOR_STATE_LBUTTON
:
69 zde_cursor
->state
= XCURSOR_STATE_LBUTTON
;
71 case XCURSOR_STATE_BBUTTON
:
72 zde_cursor
->state
= XCURSOR_STATE_BBUTTON
;
79 for (i
= 0; i
< 15*15; i
++) {
85 if (cursor_bitmap
[i
] != 0xff)
86 xpixel (zde_cursor
->x
+k
, zde_cursor
->y
+j
, cursor_bitmap
[i
]*256);
91 /*xpixel (zde_cursor->x, zde_cursor->y, ~0);
92 xpixel (zde_cursor->x, zde_cursor->y+1, ~0);
93 xpixel (zde_cursor->x+1, zde_cursor->y+1, ~0);
94 xpixel (zde_cursor->x+1, zde_cursor->y, ~0);*/
101 cur_x
= (int *) malloc (sizeof (int));
106 cur_y
= (int *) malloc (sizeof (int));
111 zde_cursor
= (zde_cursor_t
*) malloc (sizeof (zde_cursor_t
));
118 zde_cursor
->state
= 0;
123 xcursor_settype (XCURSOR_MOUSE_KB
);
125 int ret
= xcursor_init ();