Module: Gtk::IconSize

Defined in:
ext/gtk2/rbgtkiconsize.c

Class Method Summary collapse

Class Method Details

.from_name(name) ⇒ Object



55
56
57
58
59
# File 'ext/gtk2/rbgtkiconsize.c', line 55

static VALUE
icon_size_from_name(VALUE self, VALUE name)
{
    return INT2FIX(gtk_icon_size_from_name(RVAL2CSTR(name)));
}

.get_name(size) ⇒ Object



61
62
63
64
65
# File 'ext/gtk2/rbgtkiconsize.c', line 61

static VALUE
icon_size_get_name(VALUE self, VALUE size)
{
    return CSTR2RVAL(gtk_icon_size_get_name(RVAL2GENUM(size, GTK_TYPE_ICON_SIZE)));
}

.lookup(size) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'ext/gtk2/rbgtkiconsize.c', line 13

static VALUE
icon_size_lookup(VALUE self, VALUE size)
{
    gint width, height;

    if(gtk_icon_size_lookup(RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), &width, &height))
        return rb_ary_new3(2, INT2FIX(width), INT2FIX(height));
    else
        return Qnil;
}

.lookup_for_settings(settings, size) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'ext/gtk2/rbgtkiconsize.c', line 25

static VALUE
icon_size_lookup_for_settings(VALUE self, VALUE settings, VALUE size)
{
    gint width, height;

    if(gtk_icon_size_lookup_for_settings(GTK_SETTINGS(RVAL2GOBJ(settings)),
                                         RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), 
                                         &width, &height))
        return rb_ary_new3(2, INT2FIX(width), INT2FIX(height));
    else
        return Qnil;
}

.register(name, width, height) ⇒ Object



39
40
41
42
43
44
45
46
# File 'ext/gtk2/rbgtkiconsize.c', line 39

static VALUE
icon_size_register(VALUE self, VALUE name, VALUE width, VALUE height)
{
    /* XXXX FIXME This should be GENUM2RVAL */
    return INT2FIX(gtk_icon_size_register(RVAL2CSTR(name),
                                          NUM2INT(width),
                                          NUM2INT(height)));
}

.register_alias(alias, target) ⇒ Object



48
49
50
51
52
53
# File 'ext/gtk2/rbgtkiconsize.c', line 48

static VALUE
icon_size_register_alias(VALUE self, VALUE alias, VALUE target)
{
    gtk_icon_size_register_alias(RVAL2CSTR(alias), RVAL2GENUM(target, GTK_TYPE_ICON_SIZE));
    return Qnil;
}