[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1bf3afba23: Add more cursor bitmaps on Haiku
From: |
Po Lu |
Subject: |
master 1bf3afba23: Add more cursor bitmaps on Haiku |
Date: |
Fri, 13 May 2022 01:36:28 -0400 (EDT) |
branch: master
commit 1bf3afba23799615aecefa7cbfd63fa548187bc1
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Add more cursor bitmaps on Haiku
* src/haikufns.c (cursor_bitmaps, cursor_bitmaps_for_id):
Register crosshair and xterm cursors.
* src/haikugui.h (cross_ptr_bits, cross_ptrmask_bits)
(ibeam_ptr_bits, ibeam_ptrmask_bits): New cursor bitmaps.
---
src/haikufns.c | 88 +++++++++++++++++++++++++++++-----------------------------
src/haikugui.h | 49 ++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 44 deletions(-)
diff --git a/src/haikufns.c b/src/haikufns.c
index e6bf60e1d9..b628518c26 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -1836,56 +1836,56 @@ struct user_cursor_info custom_cursors[] =
struct user_cursor_bitmap_info cursor_bitmaps[] =
{
- { NULL, NULL, 0, 0, 0, 0 }, /* text_cursor
*/
- { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 }, /* nontext_cursor */
- { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 }, /* modeline_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /* hand_cursor
*/
- { NULL, NULL, 0, 0, 0, 0 }, /*
hourglass_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
horizontal_drag_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
vertical_drag_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
left_edge_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
top_left_corner_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
top_edge_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
top_right_corner_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
right_edge_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_right_corner_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_edge_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_left_corner_cursor */
- { NULL, NULL, 0, 0, 0, 0 }, /* no_cursor */
+ { ibeam_ptr_bits, ibeam_ptrmask_bits, 15, 15, 7, 7 }, /* text_cursor
*/
+ { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 }, /*
nontext_cursor */
+ { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 }, /*
modeline_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
hand_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
hourglass_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
horizontal_drag_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
vertical_drag_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
left_edge_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
top_left_corner_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
top_edge_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
top_right_corner_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
right_edge_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_right_corner_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_edge_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
bottom_left_corner_cursor */
+ { NULL, NULL, 0, 0, 0, 0 }, /*
no_cursor */
};
/* Array of cursor bitmaps for each system cursor ID. This is used to
color in user-specified cursors. */
struct user_cursor_bitmap_info cursor_bitmaps_for_id[28] =
{
- { NULL, NULL, 0, 0, 0, 0 },
- { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
- { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { left_ptr_bits, left_ptrmsk_bits, 16, 16, 3, 1 },
+ { ibeam_ptr_bits, ibeam_ptrmask_bits, 15, 15, 7, 7 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { cross_ptr_bits, cross_ptrmask_bits, 30, 30, 15, 15 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
+ { NULL, NULL, 0, 0, 0, 0 },
};
static void *
diff --git a/src/haikugui.h b/src/haikugui.h
index a6cf3a4e6c..f197e718c0 100644
--- a/src/haikugui.h
+++ b/src/haikugui.h
@@ -95,4 +95,53 @@ typedef haiku Drawable;
typedef haiku Window;
typedef int Display;
+/* Cursor bitmaps. These are only used to create colored cursors when
+ the user specifies a mouse color. */
+
+MAYBE_UNUSED static unsigned char cross_ptr_bits[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+ 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+ 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+
+MAYBE_UNUSED static unsigned char cross_ptrmask_bits[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01,
+ 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0,
+ 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
+ 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
+ 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xfc, 0x07, 0xf0, 0x1f, 0xfe, 0x0f, 0xf8, 0x3f, 0xfc, 0x07,
+ 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
+ 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01,
+ 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0,
+ 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+
+MAYBE_UNUSED static unsigned char ibeam_ptr_bits[] =
+ {
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
+ 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
+ 0xc0, 0x01, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00
+ };
+
+MAYBE_UNUSED static unsigned char ibeam_ptrmask_bits[] =
+ {
+ 0x00, 0x00, 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0,
+ 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03,
+ 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0x00, 0x00
+ };
+
#endif /* _HAIKU_GUI_H_ */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 1bf3afba23: Add more cursor bitmaps on Haiku,
Po Lu <=