Changeset 2019 for libcaca/trunk/ruby/caca-event.c
- Timestamp:
- Nov 18, 2007, 10:13:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/ruby/caca-event.c
r2017 r2019 16 16 17 17 VALUE cEvent; 18 static VALUE cEventKey; 19 VALUE cEventKeyPress; 20 VALUE cEventKeyRelease; 21 static VALUE cEventMouse; 22 VALUE cEventMousePress; 23 VALUE cEventMouseRelease; 24 VALUE cEventMouseMotion; 25 VALUE cEventResize; 26 VALUE cEventQuit; 18 27 19 28 void Init_caca_event(VALUE mCaca) 20 29 { 21 30 cEvent = rb_define_class_under(mCaca, "Event", rb_cObject); 31 rb_define_const(cEvent, "TYPE", INT2FIX(CACA_EVENT_ANY)); 32 33 cEventKey = rb_define_class_under(cEvent, "Key", cEvent); 34 rb_define_const(cEventKey, "TYPE", 35 INT2FIX(CACA_EVENT_KEY_PRESS| 36 CACA_EVENT_KEY_RELEASE)); 37 38 cEventKeyPress = rb_define_class_under(cEventKey, "Press", cEventKey); 39 rb_define_const(cEventKeyPress, "TYPE", 40 INT2FIX(CACA_EVENT_KEY_PRESS)); 41 42 cEventKeyRelease = rb_define_class_under(cEventKey, "Release", cEventKey); 43 rb_define_const(cEventKeyRelease, "TYPE", 44 INT2FIX(CACA_EVENT_KEY_RELEASE)); 45 46 cEventMouse = rb_define_class_under(cEvent, "Mouse", cEvent); 47 rb_define_const(cEventMouse, "TYPE", 48 INT2FIX(CACA_EVENT_MOUSE_PRESS| 49 CACA_EVENT_MOUSE_RELEASE| 50 CACA_EVENT_MOUSE_MOTION)); 51 52 cEventMousePress = rb_define_class_under(cEventMouse, "Press", cEventMouse); 53 rb_define_const(cEventMousePress, "TYPE", 54 INT2FIX(CACA_EVENT_MOUSE_PRESS)); 55 56 cEventMouseRelease = rb_define_class_under(cEventMouse, "Release", cEventMouse); 57 rb_define_const(cEventMouseRelease, "TYPE", 58 INT2FIX(CACA_EVENT_MOUSE_RELEASE)); 59 60 cEventMouseMotion = rb_define_class_under(cEventMouse, "Motion", cEventMouse); 61 rb_define_const(cEventMouseMotion, "TYPE", 62 INT2FIX(CACA_EVENT_MOUSE_MOTION)); 63 64 cEventResize = rb_define_class_under(cEvent, "Resize", cEvent); 65 rb_define_const(cEventResize, "TYPE", 66 INT2FIX(CACA_EVENT_RESIZE)); 67 68 cEventQuit = rb_define_class_under(cEvent, "Quit", cEvent); 69 rb_define_const(cEventQuit, "TYPE", 70 INT2FIX(CACA_EVENT_QUIT)); 71 22 72 }
Note: See TracChangeset
for help on using the changeset viewer.