Enlightenment CVS committal Author : doursse Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/include Modified Files: evas_common.h evas_private.h Log Message: * move evas_mempool from main.c to it's own file in data/ as it's only used by evas_list * add a header files for evas_cache, evas_path and evas_module * remove trailing spaces in evas_list.c =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v retrieving revision 1.106 retrieving revision 1.107 diff -u -3 -r1.106 -r1.107 --- evas_common.h 9 Jul 2008 16:50:33 -0000 1.106 +++ evas_common.h 10 Jul 2008 16:38:54 -0000 1.107 @@ -166,11 +166,6 @@ typedef struct _Regionspan Regionspan; */ -typedef struct _Evas_Cache_Image Evas_Cache_Image; -typedef struct _Evas_Cache_Image_Func Evas_Cache_Image_Func; -typedef struct _Evas_Cache_Engine_Image Evas_Cache_Engine_Image; -typedef struct _Evas_Cache_Engine_Image_Func Evas_Cache_Engine_Image_Func; - typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len); typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst); typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len); @@ -182,6 +177,8 @@ int x, int y, int axx, int axy, int ayx, int ayy, void *geom_data); +#include "../cache/evas_cache.h" + /*****************************************************************************/ typedef enum _RGBA_Image_Flags @@ -725,99 +722,6 @@ }; /****/ -struct _Evas_Cache_Image_Func -{ - Image_Entry *(*alloc)(void); - void (*dealloc)(Image_Entry *im); - - /* The cache provide some helpers for surface manipulation. */ - int (*surface_alloc)(Image_Entry *im, int w, int h); - void (*surface_delete)(Image_Entry *im); - DATA32 *(*surface_pixels)(Image_Entry *im); - - /* The cache is doing the allocation and deallocation, you must just do the rest. */ - int (*constructor)(Image_Entry *im); - void (*destructor)(Image_Entry *im); - - void (*dirty_region)(Image_Entry *im, int x, int y, int w, int h); - /* Only called when references > 0. Need to provide a fresh copie of im. */ - /* The destination surface does have a surface, but no allocated pixel data. */ - int (*dirty)(Image_Entry *dst, const Image_Entry *src); - /* Only called when references == 1. We will call drop on `im'. */ - /* The destination surface does not have any surface. */ - int (*size_set)(Image_Entry *dst, const Image_Entry *src, int w, int h); - - /* The destination surface does not have any surface. */ - int (*copied_data)(Image_Entry *dst, int w, int h, DATA32 *image_data, int alpha, int cspace); - /* The destination surface does not have any surface. */ - int (*data)(Image_Entry *dst, int w, int h, DATA32 *image_data, int alpha, int cspace); - int (*color_space)(Image_Entry *dst, int cspace); - - /* This function need to update im->w and im->h. */ - int (*load)(Image_Entry *im); - int (*mem_size_get)(Image_Entry *im); - void (*debug)(const char *context, Image_Entry *im); -}; - -struct _Evas_Cache_Image -{ - Evas_Cache_Image_Func func; - - Evas_Object_List *dirty; - - Evas_Object_List *lru; - Evas_Object_List *lru_nodata; - Evas_Hash *inactiv; - Evas_Hash *activ; - void *data; - - int usage; - int limit; - int references; -}; - -struct _Evas_Cache_Engine_Image_Func -{ - /* Must return a char* allocated with evas_stringshare_add. */ - char* (*key)(Image_Entry *im, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); - - Engine_Image_Entry* (*alloc)(void); - void (*dealloc)(Engine_Image_Entry *eim); - - int (*constructor)(Engine_Image_Entry *eim, void* data); - void (*destructor)(Engine_Image_Entry *eim); - - void (*dirty_region)(Engine_Image_Entry *eim, int x, int y, int w, int h); - /* Only called when references > 0. Need to provide a fresh copie of im. */ - int (*dirty)(Engine_Image_Entry *dst, const Engine_Image_Entry *src); - /* Only called when references == 1. We will call drop on `im'. */ - int (*size_set)(Engine_Image_Entry *dst, const Engine_Image_Entry *src); - - int (*update_data)(Engine_Image_Entry* dst, void* data); - - void (*load)(Engine_Image_Entry *eim, const Image_Entry* im); - int (*mem_size_get)(Engine_Image_Entry *eim); - void (*debug)(const char* context, Engine_Image_Entry *eim); -}; - -struct _Evas_Cache_Engine_Image -{ - Evas_Cache_Engine_Image_Func func; - - Evas_Object_List* dirty; - - Evas_Hash* activ; - Evas_Hash* inactiv; - Evas_Object_List* lru; - - Evas_Cache_Image* parent; - Evas_Cache_Engine_Image* brother; - - int usage; - int limit; - - int references; -}; /*****************************************************************************/ #include "evas_macros.h" @@ -1260,52 +1164,6 @@ void evas_font_dir_cache_free(void); /****/ -EAPI Evas_Cache_Image* evas_cache_image_init(const Evas_Cache_Image_Func *cb); -EAPI void evas_cache_image_shutdown(Evas_Cache_Image *cache); -EAPI Image_Entry* evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); -EAPI void evas_cache_image_drop(Image_Entry *im); -EAPI void evas_cache_image_data_not_needed(Image_Entry *im); -EAPI int evas_cache_image_flush(Evas_Cache_Image *cache); -EAPI void evas_cache_private_set(Evas_Cache_Image *cache, const void *data); -EAPI void* evas_cache_private_get(Evas_Cache_Image *cache); -EAPI void* evas_cache_private_from_image_entry_get(Image_Entry *im); - -EAPI int evas_cache_image_usage_get(Evas_Cache_Image *cache); -EAPI int evas_cache_image_get(Evas_Cache_Image *cache); -EAPI void evas_cache_image_set(Evas_Cache_Image *cache, int size); - -EAPI Image_Entry* evas_cache_image_alone(Image_Entry *im); -EAPI Image_Entry* evas_cache_image_dirty(Image_Entry *im, int x, int y, int w, int h); -EAPI void evas_cache_image_load_data(Image_Entry *im); -EAPI void evas_cache_image_surface_alloc(Image_Entry *im, int w, int h); -EAPI DATA32* evas_cache_image_pixels(Image_Entry *im); -EAPI Image_Entry* evas_cache_image_copied_data(Evas_Cache_Image *cache, int w, int h, DATA32 *image_data, int alpha, int cspace); -EAPI Image_Entry* evas_cache_image_data(Evas_Cache_Image *cache, int w, int h, DATA32 *image_data, int alpha, int cspace); -EAPI void evas_cache_image_colorspace(Image_Entry *im, int cspace); -EAPI Image_Entry* evas_cache_image_empty(Evas_Cache_Image *cache); -EAPI Image_Entry* evas_cache_image_size_set(Image_Entry *im, int w, int h); - -EAPI Evas_Cache_Engine_Image* evas_cache_engine_image_init(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Image *parent); -EAPI void evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache); - -EAPI void evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache); -EAPI int evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache); -EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache); -EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit); - -EAPI Engine_Image_Entry* evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, const char *file, const char *key, - RGBA_Image_Loadopts *lo, void *engine_data, int *error); -EAPI void evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim); -EAPI Engine_Image_Entry* evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data); -EAPI void evas_cache_engine_image_drop(Engine_Image_Entry *eim); -EAPI Engine_Image_Entry* evas_cache_engine_image_alone(Engine_Image_Entry *eim, void *data); -EAPI Engine_Image_Entry* evas_cache_engine_image_dirty(Engine_Image_Entry *eim, int x, int y, int w, int h); -EAPI Engine_Image_Entry* evas_cache_engine_image_copied_data(Evas_Cache_Engine_Image *cache, int w, int h, DATA32 *image_data, int alpha, int cspace, void *engine_data); -EAPI Engine_Image_Entry* evas_cache_engine_image_data(Evas_Cache_Engine_Image *cache, int w, int h, DATA32 *image_data, int alpha, int cspace, void *engine_data); -EAPI void evas_cache_engine_image_colorspace(Engine_Image_Entry *eim, int cspace, void *engine_data); -EAPI Engine_Image_Entry* evas_cache_engine_image_size_set(Engine_Image_Entry *eim, int w, int h); - -EAPI void evas_cache_engine_image_load_data(Engine_Image_Entry *eim); /*****************************************************************************/ =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v retrieving revision 1.108 retrieving revision 1.109 diff -u -3 -r1.108 -r1.109 --- evas_private.h 7 Jul 2008 21:29:29 -0000 1.108 +++ evas_private.h 10 Jul 2008 16:38:54 -0000 1.109 @@ -7,74 +7,10 @@ #include "Evas.h" -/* the evas module api */ -/***********************/ -/* the module api version */ -#define EVAS_MODULE_API_VERSION 1 - -/* the module types */ -typedef enum _Evas_Module_Type -{ - EVAS_MODULE_TYPE_ENGINE, - EVAS_MODULE_TYPE_IMAGE_LOADER, - EVAS_MODULE_TYPE_IMAGE_SAVER, - EVAS_MODULE_TYPE_OBJECT -} Evas_Module_Type; - -/* the module api structure, all modules should define this struct */ -typedef struct _Evas_Module_Api Evas_Module_Api; -struct _Evas_Module_Api -{ - int version; - Evas_Module_Type type; - const char *name; - const char *author; -}; - -/* the module structure */ -typedef struct _Evas_Module Evas_Module; -struct _Evas_Module -{ - Evas_Module_Api *api; - void *handle; /* the dlopen handle */ - char *path; /* the path where this modules is */ - char *name; /* the name of the dir where this module is */ - struct - { - int (*open)(Evas_Module *); - void (*close)(Evas_Module *); - } func; - void *functions; /* this are the functions exported by the module */ - void *data; /* some internal data for the module i.e the id for engines */ - - Evas_Module_Type type; /* the type detected by the path */ - - int ref; /* how many refs */ - int last_used; /* the cycle count when it was last used */ - - unsigned char loaded : 1; -}; +#include "../file/evas_module.h" +#include "../file/evas_path.h" -/* the internals of the module api use this struct to reference a path with a module type - * instead of deduce the type from the path. - * */ -typedef struct _Evas_Module_Path Evas_Module_Path; -struct _Evas_Module_Path -{ - Evas_Module_Type type; - char *path; -}; - -typedef struct _Evas_Module_Engine Evas_Module_Engine; -struct _Evas_Module_Engine -{ - int id; -}; - -/* end of evas module api */ -/**************************/ - /* complain when peole pass in wrong object types etc. */ #define MAGIC_DEBUG @@ -728,14 +664,6 @@ int evas_object_clippers_was_visible(Evas_Object *obj); void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info); Evas_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y); -int evas_file_path_is_full_path(const char *path); -char *evas_file_path_join(const char *path, const char *end); -int evas_file_path_exists(const char *path); -int evas_file_path_is_file(const char *path); -int evas_file_path_is_dir(const char *path); -Evas_List *evas_file_path_list(char *path, const char *match, int match_case); -DATA64 evas_file_modified_time(const char *file); -char *evas_file_path_resolve(const char *file); int evas_mem_free(int mem_required); int evas_mem_degrade(int mem_required); void evas_debug_error(void); @@ -800,31 +728,6 @@ { RGBA_Font *font; }; - -typedef struct _Evas_Mempool Evas_Mempool; - -struct _Evas_Mempool -{ - int item_size; - int pool_size; - int usage; - void *first, *last; -}; - -void *evas_mempool_malloc(Evas_Mempool *pool, int size); -void evas_mempool_free(Evas_Mempool *pool, void *ptr); -void *evas_mempool_calloc(Evas_Mempool *pool, int size); - -void evas_module_paths_init(void); -void evas_module_init(void); -Evas_Module * evas_module_find_type(Evas_Module_Type type, const char *name); -int evas_module_load(Evas_Module *em); -void evas_module_unload(Evas_Module *em); -void evas_module_ref(Evas_Module *em); -void evas_module_unref(Evas_Module *em); -void evas_module_use(Evas_Module *em); -void evas_module_clean(void); -void evas_module_shutdown(void); int evas_async_events_init(void); int evas_async_events_shutdown(void); ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs