Gjsify LogoGjsify Logo

GIBaseInfo is the common base struct of all other Info structs accessible through the #GIRepository API.

All info structures can be cast to a #GIBaseInfo, for instance:

   GIFunctionInfo *function_info = ...;
GIBaseInfo *info = (GIBaseInfo *) function_info;

Most #GIRepository APIs returning a #GIBaseInfo is actually creating a new struct; in other words, g_base_info_unref() has to be called when done accessing the data.

#GIBaseInfo structuress are normally accessed by calling either g_irepository_find_by_name(), g_irepository_find_by_gtype() or g_irepository_get_info().

GIBaseInfo *button_info =
g_irepository_find_by_name (NULL, "Gtk", "Button");

// ... use button_info ...

g_base_info_unref (button_info);

Hierarchy

|[ GIBaseInfo +---- GIArgInfo +---- GICallableInfo +---- GIConstantInfo +---- GIFieldInfo +---- GIPropertyInfo +---- GIRegisteredTypeInfo +---- GITypeInfo


@record

Hierarchy

  • BaseInfo

Index

Constructors

Properties

name: string

Methods

  • Compare two #GIBaseInfo.

    Using pointer comparison is not practical since many functions return different instances of #GIBaseInfo that refers to the same part of the TypeLib; use this function instead to do #GIBaseInfo comparisons.

    Parameters

    Returns boolean

  • get_attribute(name: string): string
  • Obtain the container of the info. The container is the parent GIBaseInfo. For instance, the parent of a #GIFunctionInfo is an #GIObjectInfo or #GIInterfaceInfo.

    Returns BaseInfo

  • get_name(): string
  • Obtain the name of the info. What the name represents depends on the #GIInfoType of the info. For instance for #GIFunctionInfo it is the name of the function.

    Returns string

  • get_namespace(): string
  • is_deprecated(): boolean
  • Iterate over all attributes associated with this node. The iterator structure is typically stack allocated, and must have its first member initialized to %NULL. Attributes are arbitrary namespaced key–value pairs which can be attached to almost any item. They are intended for use by software higher in the toolchain than bindings, and are distinct from normal GIR annotations.

    Both the name and value should be treated as constants and must not be freed.

    void
    print_attributes (GIBaseInfo *info)
    {
    GIAttributeIter iter = { 0, };
    char *name;
    char *value;
    while (g_base_info_iterate_attributes (info, &iter, &name, &value))
    {
    g_print ("attribute name: %s value: %s", name, value);
    }
    }

    Parameters

    • iterator: AttributeIter

      a #GIAttributeIter structure, must be initialized; see below

    Returns [boolean, AttributeIter, string, string]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method