Esempio n. 1
0
  static void
  ft_metaclass_init( FT_MetaClass  meta,
                     FT_Library    library )
  {
    FT_ClassRec*  clazz = meta->clazz;

    /* the meta-class is its OWN class !! */
    clazz->object.clazz     = (FT_Class) clazz;
    clazz->object.ref_count = 1;
    clazz->magic            = FT_MAGIC_CLASS;
    clazz->library          = library;
    clazz->memory           = library->memory;
    clazz->type             = &ft_metaclass_type;
    clazz->info             = NULL;

    clazz->obj_size         = sizeof( FT_ClassRec );
    clazz->obj_init         = NULL;
    clazz->obj_done         = NULL;

    ft_hash_init( &meta->type_to_class,
                  (FT_Hash_CompareFunc) ft_class_hnode_compare,
                  library->memory );
  }
Esempio n. 2
0
  ft_metaclass_init( FT_MetaClass  meta,
                     FT_Library    library )
  {
    FT_ClassRec*  clazz = (FT_ClassRec*) &meta->clazz;

    /* the meta-class is its OWN class !! */
    clazz->object.clazz     = (FT_Class) clazz;
    clazz->object.ref_count = 1;
    clazz->magic            = FT_MAGIC_CLASS;
    clazz->library          = library;
    clazz->memory           = library->memory;
    clazz->type             = &ft_meta_class_type;
    clazz->info             = NULL;

    clazz->class_done       = (FT_Object_DoneFunc) ft_metaclass_done;

    clazz->obj_size         = sizeof( FT_ClassRec );
    clazz->obj_init         = NULL;
    clazz->obj_done         = NULL;

    return ft_hash_init( &meta->type_to_class,
                        (FT_Hash_EqualFunc) ft_class_hnode_equal,
                        library->memory );
  }