[gnome-robots] cleanup cursors initialization
- From: Andrey Kutejko <akutejko src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-robots] cleanup cursors initialization
- Date: Tue, 6 Oct 2020 19:31:40 +0000 (UTC)
commit 8bbf934795e7b22fc317bf9ea7b9c56723ddb0c3
Author: Andrey Kutejko <andy128k gmail com>
Date: Tue Aug 25 19:09:23 2020 +0200
cleanup cursors initialization
src/cursors.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/src/cursors.c b/src/cursors.c
index e3ecf92..5eccead 100644
--- a/src/cursors.c
+++ b/src/cursors.c
@@ -38,26 +38,24 @@
#include "cursor-up-right.h"
typedef struct {
- int is_xpm;
- const guint8 *data;
- gsize data_len;
+ const char **data;
int hsx;
int hsy;
GdkCursor *cursor;
} cursor_props;
-#define CURSOR_ENTRY(is_xpm, d,hx,hy) { is_xpm, cursor_##d, sizeof (cursor_##d), hx, hy, NULL }
+#define CURSOR_ENTRY(d,hx,hy) { cursor_##d, hx, hy, NULL }
cursor_props cursor_list[] = {
- CURSOR_ENTRY (1, up_left, 3, 3),
- CURSOR_ENTRY (1, up, 10, 3),
- CURSOR_ENTRY (1, up_right, 17, 3),
- CURSOR_ENTRY (1, left, 3, 10),
- CURSOR_ENTRY (1, hold, 10, 10),
- CURSOR_ENTRY (1, right, 17, 10),
- CURSOR_ENTRY (1, down_left, 3, 17),
- CURSOR_ENTRY (1, down, 10, 17),
- CURSOR_ENTRY (1, down_right, 17, 17)
+ CURSOR_ENTRY (up_left, 3, 3),
+ CURSOR_ENTRY (up, 10, 3),
+ CURSOR_ENTRY (up_right, 17, 3),
+ CURSOR_ENTRY (left, 3, 10),
+ CURSOR_ENTRY (hold, 10, 10),
+ CURSOR_ENTRY (right, 17, 10),
+ CURSOR_ENTRY (down_left, 3, 17),
+ CURSOR_ENTRY (down, 10, 17),
+ CURSOR_ENTRY (down_right, 17, 17)
};
GdkCursor *default_cursor;
@@ -74,13 +72,7 @@ make_cursors (void)
c = cursor_list;
for (i = 0; i < G_N_ELEMENTS (cursor_list); ++i) {
- if (c->is_xpm) {
- pixbuf = gdk_pixbuf_new_from_xpm_data ((const char**) c->data);
- } else {
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- pixbuf = gdk_pixbuf_new_from_inline (c->data_len, c->data, FALSE, NULL);
-G_GNUC_END_IGNORE_DEPRECATIONS
- }
+ pixbuf = gdk_pixbuf_new_from_xpm_data (c->data);
c->cursor = gdk_cursor_new_from_pixbuf (gdk_display_get_default (),
pixbuf,
c->hsx, c->hsy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]