Esempio n. 1
0
/**
 * atk_registry_set_factory_type:
 * @registry: the #AtkRegistry in which to register the type association
 * @type: an #AtkObject type 
 * @factory_type: an #AtkObjectFactory type to associate with @type.  Must
 * implement AtkObject appropriate for @type.
 *
 * Associate an #AtkObjectFactory subclass with a #GType. Note:
 * The associated @factory_type will thereafter be responsible for
 * the creation of new #AtkObject implementations for instances
 * appropriate for @type.
 **/
void
atk_registry_set_factory_type (AtkRegistry *registry,
                               GType type,
                               GType factory_type)
{
  GType old_type;
  gpointer value;
  AtkObjectFactory *old_factory;

  g_return_if_fail (ATK_IS_REGISTRY (registry));

  value = g_hash_table_lookup (registry->factory_type_registry, 
                                  (gpointer) type);
  old_type = (GType) value;
  if (old_type && old_type != factory_type)
    {
      g_hash_table_remove (registry->factory_type_registry, 
                           (gpointer) type);
      /*
       * If the old factory was created, notify it that it has
       * been replaced, then free it.
       */
      old_factory = g_hash_table_lookup (registry->factory_singleton_cache, 
                                         (gpointer) old_type);
      if (old_factory)
        {
          atk_object_factory_invalidate (old_factory);
          g_type_free_instance ((GTypeInstance *) old_factory);
        }
    }
  g_hash_table_insert (registry->factory_type_registry, 
                       (gpointer) type, 
                       (gpointer) factory_type);
}
Esempio n. 2
0
JNIEXPORT void JNICALL
Java_org_gnome_atk_AtkObjectFactory_atk_1object_1factory_1invalidate
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	AtkObjectFactory* self;

	// convert parameter self
	self = (AtkObjectFactory*) _self;

	// call function
	atk_object_factory_invalidate(self);

	// cleanup parameter self
}