Ejemplo n.º 1
0
static VALUE
rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
{
    VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
    GdkPixbuf* buf;

    rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height, 
                 &dest, &dest_x, &dest_y);

    buf = gdk_pixbuf_get_from_drawable(GDK_PIXBUF(RVAL2GOBJ(dest)),
                                       GDK_DRAWABLE(RVAL2GOBJ(src)),
                                       GDK_COLORMAP(RVAL2GOBJ(cmap)),
                                       NUM2INT(src_x), NUM2INT(src_y),
                                       NIL_P(dest_x) ? 0 : NUM2INT(dest_x),
                                       NIL_P(dest_y) ? 0 : NUM2INT(dest_y),
                                       NUM2INT(width), NUM2INT(height));
    if (NIL_P(dest)) {
        if (buf) {
            return GOBJ2RVALU(buf);
        } else {
            return Qnil;
        }
    } else {
        return dest;
    }
}
Ejemplo n.º 2
0
static VALUE
rbclt_model_get_iter_at_row (VALUE self, VALUE row)
{
    ClutterModel *model = CLUTTER_MODEL (RVAL2GOBJ (self));

    return GOBJ2RVALU (clutter_model_get_iter_at_row (model, NUM2UINT (row)));
}
Ejemplo n.º 3
0
static VALUE
rg_create_pango_layout(int argc, VALUE *argv, VALUE self)
{
    VALUE text;
    rb_scan_args(argc, argv, "01", &text);
    return GOBJ2RVALU(gtk_widget_create_pango_layout(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text)));
}
Ejemplo n.º 4
0
static VALUE
rbclt_model_iter_dup (VALUE self)
{
    ClutterModelIter *iter = CLUTTER_MODEL_ITER (RVAL2GOBJ (self));

    return GOBJ2RVALU (clutter_model_iter_copy (iter));
}
Ejemplo n.º 5
0
static VALUE
rbclt_model_get_last_iter (VALUE self)
{
    ClutterModel *model = CLUTTER_MODEL (RVAL2GOBJ (self));

    return GOBJ2RVALU (clutter_model_get_last_iter (model));
}
Ejemplo n.º 6
0
static VALUE
rbclt_model_iter_prev (VALUE self)
{
    ClutterModelIter *iter = CLUTTER_MODEL_ITER (RVAL2GOBJ (self));
    ClutterModelIter *iter_copy = clutter_model_iter_copy (iter);

    return rbclt_model_iter_prev_bang (GOBJ2RVALU (iter_copy));
}
Ejemplo n.º 7
0
static VALUE
rg_render_icon(int argc, VALUE *argv, VALUE self)
{
    VALUE stock_id, size, detail;
    rb_scan_args(argc, argv, "21", &stock_id, &size, &detail);
    return GOBJ2RVALU(gtk_widget_render_icon(_SELF(self), rb_id2name(SYM2ID(stock_id)),
                                             RVAL2GENUM(size, GTK_TYPE_ICON_SIZE),
                                             RVAL2CSTR_ACCEPT_NIL(detail)));
}
Ejemplo n.º 8
0
static VALUE
po_run_page_setup_dialog(int argc, VALUE *argv, VALUE self)
{
    VALUE parent, page_setup, settings;
    rb_scan_args(argc, argv, "03", &parent, &page_setup, &settings);

    if (rb_block_given_p()) {
        volatile VALUE func = rb_block_proc();
        G_CHILD_SET(gPrintOperation, rb_intern("setup_done_cb"), func);
        gtk_print_run_page_setup_dialog_async(RVAL2GOBJ(parent),
                                              RVAL2GOBJ(page_setup),
                                              RVAL2GOBJ(settings),
                                              page_setup_done_cb,
                                              (gpointer)func);
        return Qnil;
    } else {
        return GOBJ2RVALU(gtk_print_run_page_setup_dialog(RVAL2GOBJ(parent),
                                                          RVAL2GOBJ(page_setup),
                                                          RVAL2GOBJ(settings)));
    }
}
Ejemplo n.º 9
0
static VALUE
rg_dup(VALUE self)
{
    return GOBJ2RVALU(gtk_print_settings_copy(_SELF(self)));
}
Ejemplo n.º 10
0
static VALUE
rg_create_pango_context(VALUE self)
{
    return GOBJ2RVALU(gtk_widget_create_pango_context(_SELF(self)));
}
Ejemplo n.º 11
0
static VALUE
rg_create_pango_layout(VALUE self)
{
    return GOBJ2RVALU(gtk_print_context_create_pango_layout(_SELF(self)));
}
Ejemplo n.º 12
0
static VALUE
rg_dup(VALUE self)
{
    return GOBJ2RVALU(gtk_page_setup_copy(_SELF(self)));
}