3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
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
52 int ret
= xcursor_update ();
57 xcursor_getpos (&cur_x
, &cur_y
);
59 zde_cursor
->x
= cur_x
;
60 zde_cursor
->y
= cur_y
;
64 zde_cursor
->state
= 0;
66 case XCURSOR_STATE_RBUTTON
:
67 zde_cursor
->state
= XCURSOR_STATE_RBUTTON
;
69 case XCURSOR_STATE_LBUTTON
:
70 zde_cursor
->state
= XCURSOR_STATE_LBUTTON
;
72 case XCURSOR_STATE_BBUTTON
:
73 zde_cursor
->state
= XCURSOR_STATE_BBUTTON
;
80 for (i
= 0; i
< 15*15; i
++) {
86 if (cursor_bitmap
[i
] != 0xff)
87 xpixel (zde_cursor
->x
+k
, zde_cursor
->y
+j
, cursor_bitmap
[i
]*256);
92 if (zde_cursor
->state
!= XCURSOR_STATE_LBUTTON
)
93 zde_cursor
->flags
&= ~CURSOR_FLAG_LBCLICK
;
94 if (zde_cursor
->state
!= XCURSOR_STATE_RBUTTON
)
95 zde_cursor
->flags
&= ~CURSOR_FLAG_RBCLICK
;
102 zde_cursor
= (zde_cursor_t
*) malloc (sizeof (zde_cursor_t
));
109 zde_cursor
->state
= 0;
110 zde_cursor
->flags
= 0;
112 xcursor_settype (XCURSOR_MOUSE_AUTO
);
114 int ret
= xcursor_init ();