Module: Gdk::Keyval

Defined in:
ext/gtk2/rbgdkkeyval.c

Class Method Summary collapse

Class Method Details

.convert_case(symbol) ⇒ Object



43
44
45
46
47
48
49
# File 'ext/gtk2/rbgdkkeyval.c', line 43

static VALUE
keyval_convert_case(VALUE self, VALUE symbol)
{
    guint upper, lower;
    gdk_keyval_convert_case(NUM2UINT(symbol), &lower, &upper);
    return rb_ary_new3(2, UINT2NUM(lower), UINT2NUM(upper));
}

.from_name(keyval_name) ⇒ Object



25
26
27
28
29
# File 'ext/gtk2/rbgdkkeyval.c', line 25

static VALUE
keyval_from_name(VALUE self, VALUE keyval_name)
{
    return UINT2NUM(gdk_keyval_from_name(RVAL2CSTR(keyval_name)));
}

.from_unicode(wc) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
# File 'ext/gtk2/rbgdkkeyval.c', line 69

static VALUE
unicode_to_keyval(VALUE self, VALUE wc)
{
    VALUE unicode;
    if (TYPE(wc) == T_STRING) {
        unicode = NUM2UINT(rb_funcall(wc, rb_intern("[]"), 1, INT2FIX(0)));
    } else {
        unicode = NUM2UINT(wc);
    }
    return UINT2NUM(gdk_unicode_to_keyval(unicode));
}

.lower?(keyval) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
41
# File 'ext/gtk2/rbgdkkeyval.c', line 37

static VALUE
keyval_is_lower(VALUE self, VALUE keyval)
{
    return CBOOL2RVAL(gdk_keyval_is_lower(NUM2UINT(keyval)));
}

.to_lower(keyval) ⇒ Object



57
58
59
60
61
# File 'ext/gtk2/rbgdkkeyval.c', line 57

static VALUE
keyval_to_lower(VALUE self, VALUE keyval)
{
    return INT2NUM(gdk_keyval_to_lower(NUM2UINT(keyval)));
}

.to_name(keyval) ⇒ Object



18
19
20
21
22
23
# File 'ext/gtk2/rbgdkkeyval.c', line 18

static VALUE
keyval_to_name(VALUE self, VALUE keyval)
{
    gchar* name = gdk_keyval_name(NUM2UINT(keyval));
    return name ? CSTR2RVAL(name) : Qnil;
}

.to_unicode(keyval) ⇒ Object



63
64
65
66
67
# File 'ext/gtk2/rbgdkkeyval.c', line 63

static VALUE
keyval_to_unicode(VALUE self, VALUE keyval)
{
    return UINT2NUM(gdk_keyval_to_unicode(NUM2UINT(keyval)));
}

.to_upper(keyval) ⇒ Object



51
52
53
54
55
# File 'ext/gtk2/rbgdkkeyval.c', line 51

static VALUE
keyval_to_upper(VALUE self, VALUE keyval)
{
    return INT2NUM(gdk_keyval_to_upper(NUM2UINT(keyval)));
}

.upper?(keyval) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
35
# File 'ext/gtk2/rbgdkkeyval.c', line 31

static VALUE
keyval_is_upper(VALUE self, VALUE keyval)
{
    return CBOOL2RVAL(gdk_keyval_is_upper(NUM2UINT(keyval)));
}