Registro

For this example we will assume there is an object called GTK_TYPE_MYTYPE. The ATK implementation will be called MYATKIMP_TYPE_MYTYPE. A factory will be needed which will be called MYATKIMP_TYPE_MYTYPE_FACTORY.

To register an ATK implementation of a GTK object, these steps must be followed in the module's gtk_module_init() function:

  1. Acceso al registro predeterminado:

    default_registry = atk_get_default_registry();
    
  2. Registrar el objeto ATK en la función gtk_module_init() de este módulo haciendo esta llamada a la función:

    atk_registry_set_factory_type (default_registry, GTK_TYPE_MYTYPE, MYATKIMP_TYPE_MYTYPE_FACTORY); 
    

This will register the AtkObject implementation of GTK_TYPE_MYTYPE to MYATKIMP_TYPE_MYTYPE_FACTORY. This factory will be implemented so that it knows how to build objects of type MYATKIMP_TYPE_MYTYPE.