當前位置: 首頁>>代碼示例>>C++>>正文


C++ GENUM2RVAL函數代碼示例

本文整理匯總了C++中GENUM2RVAL函數的典型用法代碼示例。如果您正苦於以下問題:C++ GENUM2RVAL函數的具體用法?C++ GENUM2RVAL怎麽用?C++ GENUM2RVAL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GENUM2RVAL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: rg_line_attributes

static VALUE
rg_line_attributes(VALUE self)
{
    GdkGCValues val;
    gdk_gc_get_values(_SELF(self), &val);

    return rb_ary_new3(4, INT2NUM(val.line_width),
                       GENUM2RVAL(val.line_style, GDK_TYPE_LINE_STYLE),
                       GENUM2RVAL(val.cap_style, GDK_TYPE_CAP_STYLE),
                       GENUM2RVAL(val.join_style, GDK_TYPE_JOIN_STYLE));
}
開發者ID:tec,項目名稱:ruby-gnome2,代碼行數:11,代碼來源:rbgdkgc.c

示例2: rbclt_box_layout_get_alignment

static VALUE
rbclt_box_layout_get_alignment (VALUE self, VALUE actor)
{
    ClutterBoxLayout *layout = CLUTTER_BOX_LAYOUT (RVAL2GOBJ (self));
    ClutterActor *g_actor = CLUTTER_ACTOR (RVAL2GOBJ (actor));

    ClutterBoxAlignment x_align, y_align;
    VALUE answer = rb_hash_new ();

    clutter_box_layout_get_alignment (layout, g_actor, &x_align, &y_align);
    rb_hash_aset (answer, rb_intern ("x"), GENUM2RVAL (x_align, CLUTTER_TYPE_BOX_ALIGNMENT));
    rb_hash_aset (answer, rb_intern ("y"), GENUM2RVAL (y_align, CLUTTER_TYPE_BOX_ALIGNMENT));
    return answer;
}
開發者ID:orospakr,項目名稱:rbclutter,代碼行數:14,代碼來源:rbcltboxlayout.c

示例3: rg_find_window

static VALUE
rg_find_window(int argc, VALUE *argv, VALUE self)
{
    VALUE drag_window, x_root, y_root;
    GdkWindow *dest_window;
    GdkDragProtocol prot;

    if (argc == 3) {
        rb_scan_args(argc, argv, "30", &drag_window, &x_root, &y_root);
        gdk_drag_find_window(_SELF(self),
                             GDK_WINDOW(RVAL2GOBJ(drag_window)), 
                             NUM2INT(x_root), NUM2INT(y_root),
                             &dest_window, &prot);
    } else {
        VALUE screen;
        rb_scan_args(argc, argv, "40", &drag_window, &screen, &x_root, &y_root);
        gdk_drag_find_window_for_screen(_SELF(self),
                                        GDK_WINDOW(RVAL2GOBJ(drag_window)), 
                                        GDK_SCREEN(RVAL2GOBJ(screen)),
                                        NUM2INT(x_root), NUM2INT(y_root),
                                        &dest_window, &prot);
    }

    return rb_ary_new3(2, GOBJ2RVAL(dest_window), 
                       GENUM2RVAL(prot, GDK_TYPE_DRAG_PROTOCOL));
}
開發者ID:Vasfed,項目名稱:ruby-gnome2,代碼行數:26,代碼來源:rbgdkdragcontext.c

示例4: rbclt_flow_layout_get_orientation

static VALUE
rbclt_flow_layout_get_orientation (VALUE self)
{
  ClutterFlowLayout *flow_layout = CLUTTER_FLOW_LAYOUT (RVAL2GOBJ (self));
  
  return GENUM2RVAL (clutter_flow_layout_get_orientation (flow_layout), CLUTTER_TYPE_FLOW_ORIENTATION);
}
開發者ID:orospakr,項目名稱:rbclutter,代碼行數:7,代碼來源:rbcltflowlayout.c

示例5: rg_entry_type

/* Method: entry_type
 * Returns: the type of the entry (see Gst::IndexEntry::Types).
 */
static VALUE
rg_entry_type (VALUE self)
{
    GstIndexEntry *entry = RGST_INDEX_ENTRY (self);

    return GENUM2RVAL (entry->type, GST_TYPE_INDEX_ENTRY_TYPE);
}
開發者ID:Mazwak,項目名稱:ruby-gnome2,代碼行數:10,代碼來源:rbgstindexentry.c

示例6: gdk_s_keyboard_grab

static VALUE
gdk_s_keyboard_grab(VALUE self, VALUE win, VALUE owner_events, VALUE time)
{
    return GENUM2RVAL(gdk_keyboard_grab(GDK_WINDOW(RVAL2GOBJ(win)),
                                        RVAL2CBOOL(owner_events), NUM2INT(time)),
                      GDK_TYPE_GRAB_STATUS);
}
開發者ID:geoffyoungs,項目名稱:ruby-gnome2,代碼行數:7,代碼來源:rbgdk.c

示例7: rpango_find_base_dir

static VALUE
rpango_find_base_dir(VALUE self, VALUE text)
{
    StringValue(text);
    return GENUM2RVAL(pango_find_base_dir(RSTRING_PTR(text), RSTRING_LEN(text)), 
                      PANGO_TYPE_DIRECTION);
}
開發者ID:geoffyoungs,項目名稱:ruby-gnome2,代碼行數:7,代碼來源:rbpangomain.c

示例8: term_get_cursor_shape

static VALUE
term_get_cursor_shape(VALUE self)
{
    VteTerminalCursorShape shape;

    shape = vte_terminal_get_cursor_shape(RVAL2TERM(self));
    return GENUM2RVAL(shape, VTE_TYPE_TERMINAL_CURSOR_SHAPE);
}
開發者ID:benolee,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbvte-terminal.c

示例9: term_get_cursor_blink_mode

static VALUE
term_get_cursor_blink_mode(VALUE self)
{
    VteTerminalCursorBlinkMode mode;

    mode = vte_terminal_get_cursor_blink_mode(RVAL2TERM(self));
    return GENUM2RVAL(mode, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE);
}
開發者ID:benolee,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbvte-terminal.c

示例10: rg_subwindow_mode

static VALUE
rg_subwindow_mode(VALUE self)
{
    GdkGCValues val;
    gdk_gc_get_values(_SELF(self), &val);

    return GENUM2RVAL(val.subwindow_mode, GDK_TYPE_SUBWINDOW_MODE);
}
開發者ID:tec,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbgdkgc.c

示例11: rg_fill

static VALUE
rg_fill(VALUE self)
{
    GdkGCValues val;
    gdk_gc_get_values(_SELF(self), &val);

    return GENUM2RVAL(val.fill, GDK_TYPE_FILL);
}
開發者ID:tec,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbgdkgc.c

示例12: rg_function

static VALUE
rg_function(VALUE self)
{
    GdkGCValues val;
    gdk_gc_get_values(_SELF(self), &val);

    return GENUM2RVAL(val.function, GDK_TYPE_FUNCTION);
}
開發者ID:tec,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbgdkgc.c

示例13: rg_rect_in

static VALUE
rg_rect_in(VALUE self, VALUE rect)
{
    return GENUM2RVAL(gdk_region_rect_in(
                          _SELF(self),
                          (GdkRectangle*)RVAL2BOXED(rect, GDK_TYPE_RECTANGLE)),
                      GDK_TYPE_OVERLAP_TYPE);
}
開發者ID:msakai,項目名稱:ruby-gnome2,代碼行數:8,代碼來源:rbgdkregion.c

示例14: iview_drag_dest_item

static VALUE
iview_drag_dest_item(VALUE self)
{
    GtkTreePath* path;
    GtkIconViewDropPosition pos;
    gtk_icon_view_get_drag_dest_item(_SELF(self), &path, &pos);
    return rb_assoc_new(GTKTREEPATH2RVAL(path),
                        GENUM2RVAL(pos, GTK_TYPE_ICON_VIEW_DROP_POSITION));
}
開發者ID:benolee,項目名稱:ruby-gnome2,代碼行數:9,代碼來源:rbgtkiconview.c

示例15: rg_drag_dest_row

static VALUE
rg_drag_dest_row(VALUE self)
{
    GtkTreePath* path = NULL;
    GtkTreeViewDropPosition pos;
    gtk_tree_view_get_drag_dest_row(_SELF(self), &path, &pos);
    return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, 
                       GENUM2RVAL(pos, GTK_TYPE_TREE_VIEW_DROP_POSITION));
}
開發者ID:Vasfed,項目名稱:ruby-gnome2,代碼行數:9,代碼來源:rbgtktreeview.c


注:本文中的GENUM2RVAL函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。