コード例 #1
0
static VALUE
rg_get_signal(VALUE self, VALUE rb_n_or_name)
{
    GIInterfaceInfo *info;
    GISignalInfo *signal_info;

    info = SELF(self);
    if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
        gint n;
        n = NUM2INT(rb_n_or_name);
        signal_info = g_interface_info_get_signal(info, n);
    } else {
#ifdef HAVE_G_INTERFACE_INFO_FIND_SIGNAL
        const char *name;
        name = RVAL2CSTR(rb_n_or_name);
        signal_info = g_interface_info_find_signal(info, name);
#else
        rb_raise(rb_eArgError,
                 "g_interface_info_find_signal() is defined "
                 "since GObjectIntrospection 1.34");
#endif
    }

    return GI_BASE_INFO2RVAL_WITH_UNREF(signal_info);
}
コード例 #2
0
static VALUE
rg_iface_struct(VALUE self)
{
    GIInterfaceInfo *info;

    info = SELF(self);
    return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_iface_struct(info));
}
コード例 #3
0
static VALUE
rg_type(VALUE self)
{
    GIFieldInfo *info;

    info = SELF(self);
    return GI_BASE_INFO2RVAL_WITH_UNREF(g_field_info_get_type(info));
}
コード例 #4
0
static VALUE
rg_get_property(VALUE self, VALUE rb_n)
{
    GIInterfaceInfo *info;
    gint n;

    info = SELF(self);
    n = NUM2INT(rb_n);
    return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_property(info, n));
}
コード例 #5
0
/* This method returns a particular metadata entry in the given namespace. The
 *  namespace must have already been loaded before calling this function. See
 *  GObjectIntrospection::Repository#get_n_infos() to find the maximum number
 *  of entries.
 * 
 * @param [String] namespace The namespace to fetch the metadata entry from.
 * @param [Fixnum] index The index of the entry.
 * 
 * @return [GObjectIntrospection::BaseInfo] The metadata entry.
 */
static VALUE
rg_get_info(VALUE self, VALUE rb_namespace, VALUE rb_n)
{
    GIRepository *repository;
    const gchar *namespace_;
    gint n;
    GIBaseInfo *info;

    repository = SELF(self);
    namespace_ = RVAL2CSTR(rb_namespace);
    n = NUM2INT(rb_n);
    info = g_irepository_get_info(repository, namespace_, n);
    return GI_BASE_INFO2RVAL_WITH_UNREF(info);
}
コード例 #6
0
static VALUE
rg_get_method(VALUE self, VALUE rb_n_or_name)
{
    GIInterfaceInfo *info;
    GIFunctionInfo *function_info;

    info = SELF(self);
    if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
        gint n;
        n = NUM2INT(rb_n_or_name);
        function_info = g_interface_info_get_method(info, n);
    } else {
        const char *name;
        name = RVAL2CSTR(rb_n_or_name);
        function_info = g_interface_info_find_method(info, name);
    }

    return GI_BASE_INFO2RVAL_WITH_UNREF(function_info);
}
コード例 #7
0
static VALUE
rg_get_vfunc(VALUE self, VALUE rb_n_or_name)
{
    GIInterfaceInfo *info;
    GIVFuncInfo *vfunc_info;

    info = SELF(self);
    if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) {
        gint n;
        n = NUM2INT(rb_n_or_name);
        vfunc_info = g_interface_info_get_vfunc(info, n);
    } else {
        const gchar *name;
        name = RVAL2CSTR(rb_n_or_name);
        vfunc_info = g_interface_info_find_vfunc(info, name);
    }

    return GI_BASE_INFO2RVAL_WITH_UNREF(vfunc_info);
}