示例#1
0
GtkTargetEntry *
rbgtk_get_target_entry(VALUE targets)
{
    long n;

    return RVAL2GTKTARGETENTRIES(targets, &n);
}
示例#2
0
static VALUE
rg_add_table(VALUE self, VALUE rbtargets)
{
    GtkTargetList *list = _SELF(self);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);

    gtk_target_list_add_table(list, targets, n);

    g_free(targets);

    return self;
}
示例#3
0
static VALUE
rg_initialize(VALUE self, VALUE rbtargets)
{
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);
    GtkTargetList *list = gtk_target_list_new(targets, n);

    g_free(targets);

    G_INITIALIZE(self, list);

    return Qnil;
}
示例#4
0
static VALUE
rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions)
{
    GtkIconView *icon_view = _SELF(self);
    GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);

    gtk_icon_view_enable_model_drag_dest(icon_view, targets, n, actions);

    g_free(targets);

    return self;
}
示例#5
0
static VALUE
gtkdrag_selection_add_targets(VALUE self, VALUE rbwidget, VALUE rbselection, VALUE rbtargets)
{
    GtkWidget *widget = RVAL2WIDGET(rbwidget);
    GdkAtom selection = RVAL2ATOM(rbselection);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);

    gtk_selection_add_targets(widget, selection, targets, n);

    g_free(targets);

    return self;
}
示例#6
0
static VALUE
rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions)
{
    GtkIconView *icon_view = _SELF(self);
    GdkModifierType start_button_mask = RVAL2GFLAGS(rbstart_button_mask, GDK_TYPE_MODIFIER_TYPE);
    GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);

    gtk_icon_view_enable_model_drag_source(icon_view, start_button_mask, targets, n, actions);

    g_free(targets);

    return self;
}
示例#7
0
static VALUE
rg_m_source_set(VALUE self, VALUE rbwidget, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions)
{
    GtkWidget *widget = RVAL2WIDGET(rbwidget);
    GdkModifierType start_button_mask = RVAL2GFLAGS(rbstart_button_mask, GDK_TYPE_MODIFIER_TYPE);
    GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n);

    gtk_drag_source_set(widget, start_button_mask, targets, n, actions);

    g_free(targets);

    return self;
}
示例#8
0
static VALUE
clipboard_set_body(VALUE value)
{
    struct clipboard_set_args *args = (struct clipboard_set_args *)value;
    GtkClipboard *clipboard = _SELF(args->self);
    long n;
    GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(args->targets, &n);
    gboolean result = gtk_clipboard_set_with_data(clipboard,
                                                  targets,
                                                  n,
                                                  (GtkClipboardGetFunc)clipboard_get_func,
                                                  (GtkClipboardClearFunc)NULL,
                                                  (gpointer)args->func);

    g_free(targets);

    return CBOOL2RVAL(result);
}