Пример #1
0
void
rbgio_async_ready_callback(G_GNUC_UNUSED GObject *source,
                           GAsyncResult *result,
                           gpointer data)
{
        struct async_ready_callback_data real = { result, data };

        G_PROTECT_CALLBACK(rbgio_async_ready_callback_call, &real);
}
Пример #2
0
static void
complete_func(GtkPrintJob *job, gpointer data, GError *error)
{
    struct callback_arg arg;

    arg.callback = (VALUE)data;
    arg.job = GOBJ2RVAL(job);
    arg.error = error;
    G_PROTECT_CALLBACK(invoke_callback, &arg);
}
Пример #3
0
static gboolean
ioscheduler_job_callback(GIOSchedulerJob *job,
                         GCancellable *cancellable,
                         gpointer data)
{
        struct ioscheduler_job_callback_data real = { job, cancellable, data };

        return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_job_callback_call,
                                             &real));
}
Пример #4
0
static void
search_position_func(GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer func)
{
    struct callback_arg arg;

    arg.callback = (VALUE)func;
    arg.tree_view = GOBJ2RVAL(tree_view);
    arg.search_dialog = GOBJ2RVAL(search_dialog);
    G_PROTECT_CALLBACK(invoke_callback, &arg);
}
Пример #5
0
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));
}
Пример #6
0
static gboolean
filter_func(const GtkRecentFilterInfo *info, gpointer func)
{
    VALUE result;
    struct callback_arg arg;

    arg.callback = (VALUE)func;
    arg.info = BOXED2RVAL((gpointer)info, GTK_TYPE_RECENT_FILTER_INFO);

    result = G_PROTECT_CALLBACK(invoke_callback, &arg);
    return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result);
}
Пример #7
0
static void
page_setup_done_cb(GtkPageSetup *page_setup, gpointer data)
{
    VALUE callback = (VALUE)data;
    struct callback_arg arg;

    G_CHILD_UNSET(gPrintOperation, rb_intern("setup_done_cb"));

    arg.callback = callback;
    arg.page_setup = GOBJ2RVAL(page_setup);

    G_PROTECT_CALLBACK(invoke_callback, &arg);
}
Пример #8
0
static gboolean
each_printer(GtkPrinter *printer, gpointer data)
{
    VALUE result;
    VALUE argv[1];
    struct callback_arg arg;

    argv[0] = GOBJ2RVAL(printer);

    arg.callback = (VALUE)data;
    arg.argc = 1;
    arg.argv = argv;

    result = G_PROTECT_CALLBACK(invoke_callback, &arg);
    return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result);
}
Пример #9
0
static void
rclosure_marshal(GClosure*       closure,
                 GValue*         return_value,
                 guint           n_param_values,
                 const GValue*   param_values,
                 gpointer        invocation_hint,
                 gpointer        marshal_data)
{
    struct marshal_arg arg;

    if (!rclosure_initialized) {
        g_closure_invalidate(closure);
        return;
    }

    arg.closure         = closure;
    arg.return_value    = return_value;
    arg.n_param_values  = n_param_values;
    arg.param_values    = param_values;
    arg.invocation_hint = invocation_hint;
    arg.marshal_data    = marshal_data;

    G_PROTECT_CALLBACK(rclosure_marshal_do, &arg);
}
Пример #10
0
static gboolean
ioscheduler_source_callback(gpointer data)
{
        return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call,
                                             data));
}
Пример #11
0
static void
gtk_m_function2(gpointer proc)
{
    G_PROTECT_CALLBACK(gtk_m_function2_body, proc);
}
Пример #12
0
static gboolean
gtk_m_function(gpointer data)
{ 
    return RVAL2CBOOL(G_PROTECT_CALLBACK(gtk_m_function_body, data));
}