2 * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <Ecore_X_Cursor.h>
25 #include "../ecore/rb_ecore.h"
26 #include "rb_ecore_x.h"
27 #include "rb_cursor.h"
31 static void c_free (RbCursor *c)
33 if (c->real && c->need_free)
34 ecore_x_cursor_free (c->real);
39 static VALUE c_alloc (VALUE klass)
41 RbCursor *cursor = NULL;
43 return Data_Make_Struct (klass, RbCursor, NULL, c_free, cursor);
46 static VALUE c_new_from_shape (VALUE klass, VALUE shape)
49 RbCursor *cursor = NULL;
51 self = rb_class_new_instance (1, &shape, klass);
53 Data_Get_Struct (self, RbCursor, cursor);
55 cursor->real = ecore_x_cursor_shape_get (FIX2INT (shape));
56 cursor->need_free = false;
61 void Init_Cursor (void)
63 cCursor = rb_define_class_under (mX, "Cursor", rb_cObject);
65 rb_define_alloc_func (cCursor, c_alloc);
66 rb_define_singleton_method (cCursor, "new_from_shape",
70 DEF_CONST (cCursor, ECORE_X_CURSOR_, X);
71 DEF_CONST (cCursor, ECORE_X_CURSOR_, ARROW);
72 DEF_CONST (cCursor, ECORE_X_CURSOR_, BASED_ARROW_DOWN);
73 DEF_CONST (cCursor, ECORE_X_CURSOR_, UP);
74 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOAT);
75 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOTTOM_LEFT_CORNER);
76 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOTTOM_RIGHT_CORNER);
77 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOTTOM_SIDE);
78 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOTTOM_TEE);
79 DEF_CONST (cCursor, ECORE_X_CURSOR_, BOX_SPIRAL);
80 DEF_CONST (cCursor, ECORE_X_CURSOR_, CENTER_PTR);
81 DEF_CONST (cCursor, ECORE_X_CURSOR_, CIRCLE);
82 DEF_CONST (cCursor, ECORE_X_CURSOR_, CLOCK);
83 DEF_CONST (cCursor, ECORE_X_CURSOR_, COFFEE_MUG);
84 DEF_CONST (cCursor, ECORE_X_CURSOR_, CROSS);
85 DEF_CONST (cCursor, ECORE_X_CURSOR_, CROSS_REVERSE);
86 DEF_CONST (cCursor, ECORE_X_CURSOR_, CROSSHAIR);
87 DEF_CONST (cCursor, ECORE_X_CURSOR_, DIAMOND_CROSS);
88 DEF_CONST (cCursor, ECORE_X_CURSOR_, DOT);
89 DEF_CONST (cCursor, ECORE_X_CURSOR_, DOT_BOX_MASK);
90 DEF_CONST (cCursor, ECORE_X_CURSOR_, DOUBLE_ARROW);
91 DEF_CONST (cCursor, ECORE_X_CURSOR_, DRAFT_LARGE);
92 DEF_CONST (cCursor, ECORE_X_CURSOR_, DRAFT_SMALL);
93 DEF_CONST (cCursor, ECORE_X_CURSOR_, DRAPED_BOX);
94 DEF_CONST (cCursor, ECORE_X_CURSOR_, EXCHANGE);
95 DEF_CONST (cCursor, ECORE_X_CURSOR_, FLEUR);
96 DEF_CONST (cCursor, ECORE_X_CURSOR_, GOBBLER);
97 DEF_CONST (cCursor, ECORE_X_CURSOR_, GUMBY);
98 DEF_CONST (cCursor, ECORE_X_CURSOR_, HAND1);
99 DEF_CONST (cCursor, ECORE_X_CURSOR_, HAND2);
100 DEF_CONST (cCursor, ECORE_X_CURSOR_, HEART);
101 DEF_CONST (cCursor, ECORE_X_CURSOR_, ICON);
102 DEF_CONST (cCursor, ECORE_X_CURSOR_, IRON_CROSS);
103 DEF_CONST (cCursor, ECORE_X_CURSOR_, LEFT_PTR);
104 DEF_CONST (cCursor, ECORE_X_CURSOR_, LEFT_SIDE);
105 DEF_CONST (cCursor, ECORE_X_CURSOR_, LEFT_TEE);
106 DEF_CONST (cCursor, ECORE_X_CURSOR_, LEFTBUTTON);
107 DEF_CONST (cCursor, ECORE_X_CURSOR_, LL_ANGLE);
108 DEF_CONST (cCursor, ECORE_X_CURSOR_, LR_ANGLE);
109 DEF_CONST (cCursor, ECORE_X_CURSOR_, MAN);
110 DEF_CONST (cCursor, ECORE_X_CURSOR_, MIDDLEBUTTON);
111 DEF_CONST (cCursor, ECORE_X_CURSOR_, MOUSE);
112 DEF_CONST (cCursor, ECORE_X_CURSOR_, PENCIL);
113 DEF_CONST (cCursor, ECORE_X_CURSOR_, PIRATE);
114 DEF_CONST (cCursor, ECORE_X_CURSOR_, PLUS);
115 DEF_CONST (cCursor, ECORE_X_CURSOR_, QUESTION_ARROW);
116 DEF_CONST (cCursor, ECORE_X_CURSOR_, RIGHT_PTR);
117 DEF_CONST (cCursor, ECORE_X_CURSOR_, RIGHT_SIDE);
118 DEF_CONST (cCursor, ECORE_X_CURSOR_, RIGHT_TEE);
119 DEF_CONST (cCursor, ECORE_X_CURSOR_, RIGHTBUTTON);
120 DEF_CONST (cCursor, ECORE_X_CURSOR_, RTL_LOGO);
121 DEF_CONST (cCursor, ECORE_X_CURSOR_, SAILBOAT);
122 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_DOWN_ARROW);
123 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_H_DOUBLE_ARROW);
124 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_LEFT_ARROW);
125 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_RIGHT_ARROW);
126 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_UP_ARROW);
127 DEF_CONST (cCursor, ECORE_X_CURSOR_, SB_V_DOUBLE_ARROW);
128 DEF_CONST (cCursor, ECORE_X_CURSOR_, SHUTTLE);
129 DEF_CONST (cCursor, ECORE_X_CURSOR_, SIZING);
130 DEF_CONST (cCursor, ECORE_X_CURSOR_, SPIDER);
131 DEF_CONST (cCursor, ECORE_X_CURSOR_, SPRAYCAN);
132 DEF_CONST (cCursor, ECORE_X_CURSOR_, STAR);
133 DEF_CONST (cCursor, ECORE_X_CURSOR_, TARGET);
134 DEF_CONST (cCursor, ECORE_X_CURSOR_, TCROSS);
135 DEF_CONST (cCursor, ECORE_X_CURSOR_, TOP_LEFT_ARROW);
136 DEF_CONST (cCursor, ECORE_X_CURSOR_, TOP_LEFT_CORNER);
137 DEF_CONST (cCursor, ECORE_X_CURSOR_, TOP_RIGHT_CORNER);
138 DEF_CONST (cCursor, ECORE_X_CURSOR_, TOP_SIDE);
139 DEF_CONST (cCursor, ECORE_X_CURSOR_, TOP_TEE);
140 DEF_CONST (cCursor, ECORE_X_CURSOR_, TREK);
141 DEF_CONST (cCursor, ECORE_X_CURSOR_, UL_ANGLE);
142 DEF_CONST (cCursor, ECORE_X_CURSOR_, UMBRELLA);
143 DEF_CONST (cCursor, ECORE_X_CURSOR_, UR_ANGLE);
144 DEF_CONST (cCursor, ECORE_X_CURSOR_, WATCH);
145 DEF_CONST (cCursor, ECORE_X_CURSOR_, XTERM);