• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ BOXED2RVAL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中BOXED2RVAL函数的典型用法代码示例。如果您正苦于以下问题:C++ BOXED2RVAL函数的具体用法?C++ BOXED2RVAL怎么用?C++ BOXED2RVAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了BOXED2RVAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rg_get_cursor_pos

static VALUE
rg_get_cursor_pos(VALUE self, VALUE index)
{
    PangoRectangle strong_pos, weak_pos;
    pango_layout_get_cursor_pos(_SELF(self), NUM2INT(index), &strong_pos, &weak_pos);
    return rb_ary_new3(2, BOXED2RVAL(&strong_pos, PANGO_TYPE_RECTANGLE),
                       BOXED2RVAL(&weak_pos, PANGO_TYPE_RECTANGLE));
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:8,代码来源:rbpangolayout.c


示例2: layout_iter_get_layout_extents

static VALUE
layout_iter_get_layout_extents(VALUE self)
{
    PangoRectangle ink_rect, logical_rect;

    pango_layout_iter_get_layout_extents(_SELF(self), &ink_rect, &logical_rect);

    return rb_assoc_new(BOXED2RVAL(&ink_rect, PANGO_TYPE_RECTANGLE),
                        BOXED2RVAL(&logical_rect, PANGO_TYPE_RECTANGLE));
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:10,代码来源:rbpangolayoutiter.c


示例3: sort_func

static gint
sort_func(GtkRecentInfo *a, GtkRecentInfo *b, gpointer func)
{
    struct callback_arg arg;

    arg.callback = (VALUE)func;
    arg.a = BOXED2RVAL(a, GTK_TYPE_RECENT_INFO);
    arg.b = BOXED2RVAL(b, GTK_TYPE_RECENT_INFO);
    return NUM2INT(G_PROTECT_CALLBACK(invoke_callback, &arg));
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:10,代码来源:rbgtkrecentchooser.c


示例4: rg_pixel_extents

static VALUE
rg_pixel_extents(VALUE self)
{
    PangoRectangle rink = {0, 0, 0, 0};
    PangoRectangle rlog = {0, 0, 0, 0};

    pango_layout_get_pixel_extents(_SELF(self), &rink, &rlog);
    return rb_assoc_new(BOXED2RVAL(&rink, PANGO_TYPE_RECTANGLE),
                        BOXED2RVAL(&rlog, PANGO_TYPE_RECTANGLE));
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:10,代码来源:rbpangolayout.c


示例5: rg_regex

static VALUE
rg_regex(VALUE self)
{
    GRegex *regex;
    regex = g_match_info_get_regex(_SELF(self));
    return BOXED2RVAL(regex, G_TYPE_REGEX);
}
开发者ID:adamhooper,项目名称:ruby-gnome2,代码行数:7,代码来源:rbglib_matchinfo.c


示例6: rg_wait_for_targets

static VALUE
rg_wait_for_targets(VALUE self)
{
    gint i;
    VALUE ary = Qnil;
    GdkAtom* targets;
    gint n_targets = 0;
    gboolean ret = gtk_clipboard_wait_for_targets(_SELF(self), &targets, &n_targets);

    if (ret){
        ary = rb_ary_new();
        for (i = 0; i < n_targets; i++){
            if ((GdkAtom)targets == (GdkAtom)GDK_NONE){
                rb_ary_push(ary, rb_eval_string("Gdk::Atom::NONE"));
            }
            else
                rb_ary_push(ary, BOXED2RVAL(targets, GDK_TYPE_ATOM));
            targets++;
        } 
        /* How can I this ?
        g_free(&o_targets);
        */
    }
    return ary;
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:25,代码来源:rbgtkclipboard.c


示例7: tvc_cell_get_size

static VALUE
tvc_cell_get_size(VALUE self)
{
    GdkRectangle cell_area;
    gint x_offset, y_offset, width, height;
    VALUE cell;

    /* Is this collect implement for cell_area ? */
    cell_area.x = -1;
    cell_area.y = -1;
    cell_area.width = -1;
    cell_area.height = -1;

    gtk_tree_view_column_cell_get_size(_SELF(self), &cell_area,
                                       &x_offset, &y_offset, 
                                       &width, &height);
    if (cell_area.x == -1 || cell_area.y == -1 || 
        cell_area.width == -1 || cell_area.height == -1){
        cell = Qnil;
    } else {
        cell = BOXED2RVAL(&cell_area, GDK_TYPE_RECTANGLE);
    }
    return rb_ary_new3(5, cell,
                       x_offset ? INT2NUM(x_offset) : Qnil,
                       y_offset ? INT2NUM(y_offset) : Qnil,
                       width ? INT2NUM(width) : Qnil,
                       height ? INT2NUM(height) : Qnil);
}
开发者ID:benolee,项目名称:ruby-gnome2,代码行数:28,代码来源:rbgtktreeviewcolumn.c


示例8: io_func

static gboolean
io_func(GIOChannel *source, GIOCondition condition, gpointer func)
{
    return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, 
                            BOXED2RVAL(source, G_TYPE_IO_CHANNEL), 
                            INT2NUM(condition)));
}
开发者ID:htrb,项目名称:ruby-gnome2,代码行数:7,代码来源:rbglib_iochannel.c


示例9: rg_union

static VALUE
rg_union(VALUE self, VALUE other)
{
    GdkRectangle dest;
    gdk_rectangle_union(_SELF(self), _SELF(other), &dest);
    return BOXED2RVAL(&dest, GDK_TYPE_RECTANGLE);
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgdkrectangle.c


示例10: rg_s_open

static VALUE
rg_s_open(gint argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
{
    VALUE arg1, arg2;
    VALUE rio;
    GIOChannel* io = NULL;

    rb_scan_args(argc, argv, "11", &arg1, &arg2);

    if (TYPE(arg1) == T_FIXNUM){
#ifdef G_OS_UNIX
        io = g_io_channel_unix_new(NUM2INT(arg1));
#elif defined(G_OS_WIN32)
        io = g_io_channel_win32_new_fd(NUM2INT(arg1));
#else
        rb_raise(rb_eRuntimeError,
                 "GLib::IOChannel.new(fd) is supported on "
                 "UNIX and Windows environment only");
#endif
    } else {
        GError* err = NULL;
        io = g_io_channel_new_file(RVAL2CSTR(arg1), 
                                   NIL_P(arg2) ? "r" : RVAL2CSTR(arg2), &err);

        if (err != NULL) RAISE_GERROR(err);
    }

    rio = BOXED2RVAL(io, G_TYPE_IO_CHANNEL);

    if (rb_block_given_p()) {
        return rb_ensure(rb_yield, rio, ioc_close, rio);
    }
    return rio;
}
开发者ID:htrb,项目名称:ruby-gnome2,代码行数:34,代码来源:rbglib_iochannel.c


示例11: rg_colors

static VALUE
rg_colors(VALUE self)
{
    GdkColormap *cmap;
    GdkColor *colors;
    GdkVisual *visual;
    VALUE ary;
    int i;

    cmap = _SELF(self);
    colors = cmap->colors;

    visual = gdk_colormap_get_visual(cmap);

    if (visual->type == GDK_VISUAL_GRAYSCALE ||
            visual->type == GDK_VISUAL_PSEUDO_COLOR) {
        ary = rb_ary_new2(cmap->size);
        for (i = 0; i < cmap->size; i++) {
            rb_ary_push(ary, BOXED2RVAL(colors, GDK_TYPE_COLOR));
            colors++;
        }
        return ary;
    } else {
        return Qnil;
    }
}
开发者ID:aurelj,项目名称:ruby-gnome2,代码行数:26,代码来源:rbgdkcolormap.c


示例12: rg_region_intersect

static VALUE
rg_region_intersect(VALUE self, VALUE region)
{
    return BOXED2RVAL(gtk_widget_region_intersect(_SELF(self),
                                                  (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION)),
                      GDK_TYPE_REGION);
}
开发者ID:adamhooper,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgtkwidget.c


示例13: textview_get_iter_location

static VALUE
textview_get_iter_location(VALUE self, VALUE iter)
{
    GdkRectangle rect;
    gtk_text_view_get_iter_location(_SELF(self), RVAL2ITR(iter), &rect);
    return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE);
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgtktextview.c


示例14: rg_clipbox

static VALUE
rg_clipbox(VALUE self)
{
    GdkRectangle rect;
    gdk_region_get_clipbox(_SELF(self), &rect);
    return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE);
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgdkregion.c


示例15: textview_get_visible_rect

static VALUE
textview_get_visible_rect(VALUE self)
{
    GdkRectangle rect;
    gtk_text_view_get_visible_rect(_SELF(self), &rect);
    return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE);
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgtktextview.c


示例16: gdkwin_get_frame_extents

static VALUE
gdkwin_get_frame_extents(VALUE self)
{
    GdkRectangle rect;
    gdk_window_get_frame_extents(_SELF(self), &rect);
    return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE);
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgdkwindow.c


示例17: rg_intersect

static VALUE
rg_intersect(VALUE self, VALUE other)
{
    GdkRectangle dest;
    gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest);
    return ret ? BOXED2RVAL(&dest, GDK_TYPE_RECTANGLE) : Qnil;
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:7,代码来源:rbgdkrectangle.c


示例18: rg_index_to_pos

static VALUE
rg_index_to_pos(VALUE self, VALUE index)
{
    PangoRectangle pos;
    pango_layout_index_to_pos(_SELF(self), NUM2INT(index), &pos);
    return BOXED2RVAL(&pos, PANGO_TYPE_RECTANGLE);
}
开发者ID:msakai,项目名称:ruby-gnome2,代码行数:7,代码来源:rbpangolayout.c


示例19: rpango_break

static VALUE
rpango_break(VALUE self, VALUE text, VALUE analysis)
{
    gint i, len;
    glong attrs_len;
    PangoLogAttr *attrs;
    const gchar *gtext;
    VALUE ret;

    gtext = StringValuePtr(text);
    len = RSTRING_LEN(text);
    attrs_len = g_utf8_strlen(gtext, (gssize)len) + 1l;
    attrs = g_new0(PangoLogAttr, attrs_len);

    pango_break(gtext, len,
                NIL_P(analysis) ? NULL : RVAL2BOXED(analysis, PANGO_TYPE_ANALYSIS),
                attrs, attrs_len);

    ret = rb_ary_new();
    for (i = 0; i < attrs_len; i++){
        rb_ary_push(ret, BOXED2RVAL(&attrs[i], PANGO_TYPE_LOG_ATTR));
    }
    g_free(attrs);
    return ret;
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:25,代码来源:rbpangomain.c


示例20: rpango_get_log_attrs

static VALUE
rpango_get_log_attrs(VALUE self, VALUE text, VALUE level, VALUE language)
{
    gint i, len;
    glong attrs_len;
    PangoLogAttr *attrs;
    const gchar *gtext;
    VALUE ret;

    gtext = StringValuePtr(text);
    len = RSTRING_LEN(text);
    attrs_len = g_utf8_strlen(gtext, (gssize)len) + 1l;
    attrs = g_new0(PangoLogAttr, attrs_len);

    pango_get_log_attrs(gtext, len, NUM2INT(level),
                        RVAL2BOXED(language, PANGO_TYPE_LANGUAGE),
                        attrs, attrs_len);

    ret = rb_ary_new();
    for (i = 0; i < attrs_len; i++){
        rb_ary_push(ret, BOXED2RVAL(&attrs[i], PANGO_TYPE_LOG_ATTR));
    }
    g_free(attrs);
    return ret;
}
开发者ID:geoffyoungs,项目名称:ruby-gnome2,代码行数:25,代码来源:rbpangomain.c



注:本文中的BOXED2RVAL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BPF_STMT函数代码示例发布时间:2022-05-30
下一篇:
C++ BOTAN_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap