/*
- * $Id: rb_ecore_x.c 89 2004-08-22 15:12:39Z tilman $
+ * $Id: rb_ecore_x.c 90 2004-08-22 16:23:19Z tilman $
*
* Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
rb_define_attr (c, "event_window", 1, 0);
rb_define_attr (c, "time", 1, 0);
- rb_iv_set (self, "@keyname", rb_str_new2 (e->keyname));
- rb_iv_set (self, "@keysymbol", rb_str_new2 (e->keysymbol));
- rb_iv_set (self, "@key_compose", rb_str_new2 (e->key_compose));
+ rb_iv_set (self, "@keyname",
+ e->keyname ? rb_str_new2 (e->keyname) : Qnil);
+ rb_iv_set (self, "@keysymbol",
+ e->keysymbol ? rb_str_new2 (e->keysymbol) : Qnil);
+ rb_iv_set (self, "@key_compose",
+ e->key_compose ? rb_str_new2 (e->key_compose) : Qnil);
rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
rb_iv_set (self, "@event_window",
DEF_CONST (c, ECORE_X_EVENT_MODE_, UNGRAB);
/* event details */
- c = rb_define_class_under (mX, "EventDetails", rb_cObject);
+ c = rb_define_class_under (mX, "EventDetail", rb_cObject);
rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
DEF_CONST (c, ECORE_X_EVENT_DETAIL_, ANCESTOR);
DEF_CONST (c, ECORE_X_EVENT_DETAIL_, VIRTUAL);
DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER_ROOT);
DEF_CONST (c, ECORE_X_EVENT_DETAIL_, DETAIL_NONE);
+ /* key modifiers */
+ c = rb_define_class_under (mX, "Modifier", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_MODIFIER_, SHIFT);
+ DEF_CONST (c, ECORE_X_MODIFIER_, CTRL);
+ DEF_CONST (c, ECORE_X_MODIFIER_, ALT);
+ DEF_CONST (c, ECORE_X_MODIFIER_, WIN);
+
/* events */
ADD_EVENT (mX, ECORE_X_EVENT_, KEY_DOWN, "KeyDown", c);
rb_define_private_method (c, "initialize",