本文整理汇总了C++中RVAL2BOXED函数的典型用法代码示例。如果您正苦于以下问题:C++ RVAL2BOXED函数的具体用法?C++ RVAL2BOXED怎么用?C++ RVAL2BOXED使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RVAL2BOXED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rg_modify_cursor
static VALUE
rg_modify_cursor(VALUE self, VALUE primary, VALUE seconday)
{
gtk_widget_modify_cursor(_SELF(self),
RVAL2BOXED(primary, GDK_TYPE_COLOR),
RVAL2BOXED(seconday, GDK_TYPE_COLOR));
return self;
}
示例2: rg_draw_glyphs_transformed
static VALUE
rg_draw_glyphs_transformed(VALUE self, VALUE gc, VALUE matrix, VALUE font, VALUE x, VALUE y, VALUE glyphs)
{
gdk_draw_glyphs_transformed(_SELF(self), GDK_GC(RVAL2GOBJ(gc)),
NIL_P(matrix) ? (PangoMatrix*)NULL : (PangoMatrix*)(RVAL2BOXED(matrix, PANGO_TYPE_MATRIX)),
PANGO_FONT(RVAL2GOBJ(font)),
NUM2INT(x), NUM2INT(y),
(PangoGlyphString*)(RVAL2BOXED(glyphs, PANGO_TYPE_GLYPH_STRING)));
return self;
}
示例3: rg_set_color
static VALUE
rg_set_color(VALUE self, VALUE part, VALUE color)
{
#ifdef HAVE_PANGO_RENDER_PART_GET_TYPE
pango_renderer_set_color(_SELF(self), RVAL2GENUM(part, PANGO_TYPE_RENDER_PART),
(PangoColor*)(NIL_P(color) ? NULL : RVAL2BOXED(color, PANGO_TYPE_COLOR)));
#else
pango_renderer_set_color(_SELF(self), NUM2INT(part),
(PangoColor*)(NIL_P(color) ? NULL : RVAL2BOXED(color, PANGO_TYPE_COLOR)));
#endif
return self;
}
示例4: gdkwin_begin_paint
static VALUE
gdkwin_begin_paint(VALUE self, VALUE area)
{
if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_RECTANGLE))){
gdk_window_begin_paint_rect(_SELF(self),
(GdkRectangle*)RVAL2BOXED(area, GDK_TYPE_RECTANGLE));
} else {
gdk_window_begin_paint_region(_SELF(self),
(GdkRegion*)RVAL2BOXED(area, GDK_TYPE_REGION));
}
return self;
}
示例5: gdkwin_invalidate
static VALUE
gdkwin_invalidate(VALUE self, VALUE area, VALUE invalidate_children)
{
if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_REGION))){
gdk_window_invalidate_region(_SELF(self),
RVAL2BOXED(area, GDK_TYPE_REGION),
RVAL2CBOOL(invalidate_children));
} else {
gdk_window_invalidate_rect(_SELF(self),
RVAL2BOXED(area, GDK_TYPE_RECTANGLE),
RVAL2CBOOL(invalidate_children));
}
return self;
}
示例6: rg_set_matrix
static VALUE
rg_set_matrix(VALUE self, VALUE matrix)
{
pango_renderer_set_matrix(_SELF(self),
(PangoMatrix*)(NIL_P(matrix) ? NULL : RVAL2BOXED(matrix, PANGO_TYPE_MATRIX)));
return self;
}
示例7: rg_modify_font
static VALUE
rg_modify_font(VALUE self, VALUE font_desc)
{
gtk_widget_modify_font(_SELF(self),
(PangoFontDescription*)RVAL2BOXED(font_desc, PANGO_TYPE_FONT_DESCRIPTION));
return self;
}
示例8: rg_set_attributes
static VALUE
rg_set_attributes(VALUE self, VALUE attrs)
{
pango_layout_set_attributes(_SELF(self),
(PangoAttrList*)(RVAL2BOXED(attrs, PANGO_TYPE_ATTR_LIST)));
return self;
}
示例9: rg_invalidate
static VALUE
rg_invalidate(VALUE self)
{
GClosure* closure = RVAL2BOXED(self, G_TYPE_CLOSURE);
g_closure_invalidate(closure);
return self;
}
示例10: rb_cogl_color
static VALUE
rb_cogl_color (int argc, VALUE *argv, VALUE self)
{
/* Accept either a single ClutterColor argument or up to four
components */
if (argc == 1
&& RTEST (rb_obj_is_kind_of (argv[0], GTYPE2CLASS (CLUTTER_TYPE_COLOR))))
{
const ClutterColor *color
= (const ClutterColor *) RVAL2BOXED (argv[0], CLUTTER_TYPE_COLOR);
cogl_color (color);
}
else
{
VALUE r, g, b, a;
ClutterColor color;
rb_scan_args (argc, argv, "04", &r, &g, &b, &a);
color.red = NIL_P (r) ? 0 : rbclt_num_to_guint8 (r);
color.green = NIL_P (g) ? 0 : rbclt_num_to_guint8 (g);
color.blue = NIL_P (b) ? 0 : rbclt_num_to_guint8 (b);
color.alpha = NIL_P (a) ? 255 : rbclt_num_to_guint8 (a);
cogl_color (&color);
}
return Qnil;
}
示例11: rg_add
static VALUE
rg_add(VALUE self, VALUE id, VALUE icon_set)
{
gtk_icon_factory_add(_SELF(self), RVAL2CSTR(id),
(GtkIconSet*)RVAL2BOXED(icon_set, GTK_TYPE_ICON_SET));
return self;
}
示例12: rg_set_clip_region
static VALUE
rg_set_clip_region(VALUE self, VALUE region)
{
gdk_gc_set_clip_region(_SELF(self),
(GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION));
return self;
}
示例13: rg_set_clip_rectangle
static VALUE
rg_set_clip_rectangle(VALUE self, VALUE rectangle)
{
gdk_gc_set_clip_rectangle(_SELF(self),
(GdkRectangle*)RVAL2BOXED(rectangle, GDK_TYPE_RECTANGLE));
return self;
}
示例14: rg_set_cursor
static VALUE
rg_set_cursor(VALUE self, VALUE cursor)
{
gdk_window_set_cursor(_SELF(self),
RVAL2BOXED(cursor, GDK_TYPE_CURSOR));
return self;
}
示例15: rbclt_stage_set_fog
static VALUE
rbclt_stage_set_fog (int argc, VALUE *argv, VALUE self)
{
ClutterStage *stage = CLUTTER_STAGE (RVAL2GOBJ (self));
if (argc == 1)
{
ClutterFog *fog = (ClutterFog *) RVAL2BOXED (argv[0], CLUTTER_TYPE_FOG);
clutter_stage_set_fogx (stage, fog);
}
else
{
VALUE density, z_near, z_far;
ClutterFog *fog = (ClutterFog*) g_malloc(sizeof(ClutterFog));
rb_scan_args (argc, argv, "03", &density, &z_near, &z_far);
fog->z_near = NUM2FLOAT (z_near);
fog->z_far = NUM2FLOAT (z_far);
clutter_stage_set_fog (stage, fog);
/* FIXME: g_free(fog); # argh, once again can't do this. another leak...? */
}
return self;
}