From 81ba0d842300e045285197cae91220ae4135c329 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 31 Aug 2010 11:58:51 +0000 Subject: [PATCH] imaging api--. as promised. SVN revision: 51779 --- legacy/evas/configure.ac | 1 - legacy/evas/src/lib/Evas.h | 96 ++----- legacy/evas/src/lib/Makefile.am | 6 +- legacy/evas/src/lib/imaging/.cvsignore | 6 - legacy/evas/src/lib/imaging/Makefile.am | 18 -- legacy/evas/src/lib/imaging/evas_imaging.c | 304 --------------------- 6 files changed, 24 insertions(+), 407 deletions(-) delete mode 100644 legacy/evas/src/lib/imaging/.cvsignore delete mode 100644 legacy/evas/src/lib/imaging/Makefile.am delete mode 100644 legacy/evas/src/lib/imaging/evas_imaging.c diff --git a/legacy/evas/configure.ac b/legacy/evas/configure.ac index 9160f60827..44898adbd7 100644 --- a/legacy/evas/configure.ac +++ b/legacy/evas/configure.ac @@ -1476,7 +1476,6 @@ src/bin/Makefile src/lib/Makefile src/lib/canvas/Makefile src/lib/file/Makefile -src/lib/imaging/Makefile src/lib/cache/Makefile src/lib/cserve/Makefile src/lib/engines/Makefile diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index 2daba5fb71..ed6b11510c 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h @@ -2159,84 +2159,32 @@ struct _Evas_Smart_Cb_Description EAPI int evas_string_char_prev_get (const char *str, int pos, int *decoded) EINA_ARG_NONNULL(1); EAPI int evas_string_char_len_get (const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; -/* FIXME: kill off!! evas_imaging before 1.0.0 !!!! */ - -/** - * @defgroup Evas_Imaging Imaging and Commong GFX - * - * Evas imaging api - exports some of the comon gfx engine routines - * this is not complete and should be considered experimental. use at your - * own risk - */ - - typedef struct _Evas_Imaging_Image Evas_Imaging_Image; - typedef struct _Evas_Imaging_Font Evas_Imaging_Font; - - /** - * Error identifier or EVAS_LOAD_ERROR_NONE. see evas_load_error_str(). - * @ingroup Evas_Imaging - */ - EAPI extern int evas_imaging_image_load_error; - - EAPI Evas_Imaging_Image *evas_imaging_image_load (const char *file, const char *key) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_MALLOC; - EAPI void evas_imaging_image_free (Evas_Imaging_Image *im) EINA_ARG_NONNULL(1); - EAPI void evas_imaging_image_size_get (const Evas_Imaging_Image *im, int *w, int *h) EINA_ARG_NONNULL(1); - EAPI Eina_Bool evas_imaging_image_alpha_get (const Evas_Imaging_Image *im) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI void evas_imaging_image_cache_set (int bytes); - EAPI int evas_imaging_image_cache_get (void) EINA_WARN_UNUSED_RESULT; - - EAPI void evas_imaging_font_hinting_set (Evas_Font_Hinting_Flags hinting); - EAPI Evas_Font_Hinting_Flags evas_imaging_font_hinting_get (void) EINA_WARN_UNUSED_RESULT; - EAPI Eina_Bool evas_imaging_font_hinting_can_hint (Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT; - - EAPI Evas_Imaging_Font *evas_imaging_font_load (const char *file, const char *key, int size) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; - EAPI void evas_imaging_font_free (Evas_Imaging_Font *fn) EINA_ARG_NONNULL(1); - EAPI int evas_imaging_font_ascent_get (const Evas_Imaging_Font *fn) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI int evas_imaging_font_descent_get (const Evas_Imaging_Font *fn) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI int evas_imaging_font_max_ascent_get (const Evas_Imaging_Font *fn) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI int evas_imaging_font_max_descent_get (const Evas_Imaging_Font *fn) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI int evas_imaging_font_line_advance_get (const Evas_Imaging_Font *fn) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI void evas_imaging_font_string_advance_get (const Evas_Imaging_Font *fn, const char *str, int *x, int *y) EINA_ARG_NONNULL(1, 2); - EAPI void evas_imaging_font_string_size_query (const Evas_Imaging_Font *fn, const char *str, int *w, int *h) EINA_ARG_NONNULL(1, 2); - EAPI int evas_imaging_font_string_inset_get (const Evas_Imaging_Font *fn, const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - EAPI int evas_imaging_font_string_char_coords_get (const Evas_Imaging_Font *fn, const char *str, int pos, int *cx, int *cy, int *cw, int *ch) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - EAPI int evas_imaging_font_string_char_at_coords_get (const Evas_Imaging_Font *fn, const char *str, int x, int y, int *cx, int *cy, int *cw, int *ch) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - - EAPI void evas_imaging_font_cache_set (int bytes); - EAPI int evas_imaging_font_cache_get (void) EINA_WARN_UNUSED_RESULT; - - - - - /** * TO BE DOCUMENTED: * @todo document key modifiers. */ - EAPI const Evas_Modifier *evas_key_modifier_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - EAPI const Evas_Lock *evas_key_lock_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; - - EAPI Eina_Bool evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - - EAPI Eina_Bool evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - - EAPI void evas_key_modifier_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_modifier_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_lock_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_lock_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - - EAPI void evas_key_modifier_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_modifier_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_lock_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - EAPI void evas_key_lock_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); - - EAPI Evas_Modifier_Mask evas_key_modifier_mask_get (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; - - EAPI Eina_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); - EAPI void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2); - - - + EAPI const Evas_Modifier *evas_key_modifier_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; + EAPI const Evas_Lock *evas_key_lock_get (const Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; + + EAPI Eina_Bool evas_key_modifier_is_set (const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; + + EAPI Eina_Bool evas_key_lock_is_set (const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; + + EAPI void evas_key_modifier_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_modifier_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_lock_add (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_lock_del (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + + EAPI void evas_key_modifier_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_modifier_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_lock_on (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + EAPI void evas_key_lock_off (Evas *e, const char *keyname) EINA_ARG_NONNULL(1, 2); + + EAPI Evas_Modifier_Mask evas_key_modifier_mask_get (const Evas *e, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2) EINA_PURE; + + EAPI Eina_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Eina_Bool exclusive) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); + EAPI void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers) EINA_ARG_NONNULL(1, 2); + #ifdef __cplusplus } #endif diff --git a/legacy/evas/src/lib/Makefile.am b/legacy/evas/src/lib/Makefile.am index 94b081268e..289f486659 100644 --- a/legacy/evas/src/lib/Makefile.am +++ b/legacy/evas/src/lib/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = canvas cache cserve file engines imaging include +SUBDIRS = canvas cache cserve file engines include EVAS_STATIC_MODULE = EVAS_STATIC_LIBADD = @@ -200,7 +200,6 @@ libevas_la_LIBADD = \ canvas/libevas_canvas.la \ file/libevas_file.la \ cache/libevas_cache.la \ -imaging/libevas_imaging.la \ $(libevas_cserve_la) \ engines/common/libevas_engine_common.la \ @FREETYPE_LIBS@ \ @@ -217,7 +216,6 @@ libevas_la_DEPENDENCIES = \ canvas/libevas_canvas.la \ file/libevas_file.la \ cache/libevas_cache.la \ -imaging/libevas_imaging.la \ $(libevas_cserve_la) \ engines/common/libevas_engine_common.la \ $(EVAS_STATIC_MODULE) @@ -238,4 +236,4 @@ endif libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ -DIST_SUBDIRS = canvas cache cserve file engines imaging include +DIST_SUBDIRS = canvas cache cserve file engines include diff --git a/legacy/evas/src/lib/imaging/.cvsignore b/legacy/evas/src/lib/imaging/.cvsignore deleted file mode 100644 index 7b51b3ced4..0000000000 --- a/legacy/evas/src/lib/imaging/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -evas_imaging.lo -libevas_imaging.la diff --git a/legacy/evas/src/lib/imaging/Makefile.am b/legacy/evas/src/lib/imaging/Makefile.am deleted file mode 100644 index e6efc958c4..0000000000 --- a/legacy/evas/src/lib/imaging/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = -I. \ - -I$(top_srcdir)/src/lib \ - -I$(top_srcdir)/src/lib/include \ - -DPACKAGE_BIN_DIR=\"$(bindir)\" \ - -DPACKAGE_LIB_DIR=\"$(libdir)\" \ - -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ - @FREETYPE_CFLAGS@ \ - @EET_CFLAGS@ \ - @EINA_CFLAGS@ - -noinst_LTLIBRARIES = libevas_imaging.la -libevas_imaging_la_SOURCES = \ -evas_imaging.c - -libevas_imaging_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/legacy/evas/src/lib/imaging/evas_imaging.c b/legacy/evas/src/lib/imaging/evas_imaging.c deleted file mode 100644 index 23aa788fcd..0000000000 --- a/legacy/evas/src/lib/imaging/evas_imaging.c +++ /dev/null @@ -1,304 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" /* so that EAPI in Eet.h is correctly defined */ -#endif - -#ifdef BUILD_FONT_LOADER_EET -#include -#endif - -#include "evas_common.h" -#include "evas_private.h" - -/** - * @addtogroup Evas_Imaging - * @{ - */ - -EAPI int evas_imaging_image_load_error = EVAS_LOAD_ERROR_NONE; - -EAPI Evas_Imaging_Image * -evas_imaging_image_load(const char *file, const char *key) -{ - Evas_Imaging_Image *im; - RGBA_Image *image; - - evas_imaging_image_load_error = EVAS_LOAD_ERROR_NONE; - - if (!file) file = ""; - if (!key) key = ""; - evas_common_cpu_init(); - evas_common_image_init(); - image = evas_common_load_image_from_file - (file, key, NULL, &evas_imaging_image_load_error); - if (!image) return NULL; - im = calloc(1, sizeof(Evas_Imaging_Image)); - if (!im) - { - evas_imaging_image_load_error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - evas_cache_image_drop(&image->cache_entry); - return NULL; - } - im->image = image; - return im; -} - -EAPI void -evas_imaging_image_free(Evas_Imaging_Image *im) -{ - if (!im) return; - evas_cache_image_drop(&im->image->cache_entry); - free(im); -} - -EAPI void -evas_imaging_image_size_get(const Evas_Imaging_Image *im, int *w, int *h) -{ - if (!im) return; - if (w) *w = im->image->cache_entry.w; - if (h) *h = im->image->cache_entry.h; -} - -EAPI Eina_Bool -evas_imaging_image_alpha_get(const Evas_Imaging_Image *im) -{ - if (!im) return EINA_FALSE; - if (im->image->cache_entry.flags.alpha) return EINA_TRUE; - return EINA_FALSE; -} - -EAPI void -evas_imaging_image_cache_set(int bytes) -{ - evas_common_image_set_cache(bytes); -} - -EAPI int -evas_imaging_image_cache_get(void) -{ - return evas_common_image_get_cache(); -} - -static Evas_Font_Hinting_Flags _evas_hinting = EVAS_FONT_HINTING_BYTECODE; - -EAPI void -evas_imaging_font_hinting_set(Evas_Font_Hinting_Flags hinting) -{ - _evas_hinting = hinting; -} - -EAPI Evas_Font_Hinting_Flags -evas_imaging_font_hinting_get(void) -{ - return _evas_hinting; -} - -EAPI Eina_Bool -evas_imaging_font_hinting_can_hint(Evas_Font_Hinting_Flags hinting) -{ - return evas_common_hinting_available(hinting); -} - -EAPI Evas_Imaging_Font * -evas_imaging_font_load(const char *file, const char *key, int size) -{ - Evas_Imaging_Font *fn; - RGBA_Font *font = NULL; - - evas_common_cpu_init(); - evas_common_font_init(); - if (!file) file = ""; - if ((key) && (key[0] == 0)) key = NULL; -#ifdef BUILD_FONT_LOADER_EET - if (key) - { - char *tmp; - - tmp = evas_file_path_join(file, key); - if (tmp) - { - font = evas_common_font_hinting_load(tmp, size, _evas_hinting); - if (!font) - { - Eet_File *ef; - - ef = eet_open((char *)file, EET_FILE_MODE_READ); - if (ef) - { - void *fdata; - int fsize = 0; - - fdata = eet_read(ef, (char *)key, &fsize); - if ((fdata) && (fsize > 0)) - { - font = evas_common_font_memory_hinting_load(tmp, size, fdata, fsize, _evas_hinting); - free(fdata); - } - eet_close(ef); - } - } - free(tmp); - } - } - else -#endif - { - font = evas_common_font_hinting_load((char *)file, size, _evas_hinting); - } - if (!font) return NULL; - fn = calloc(1, sizeof(Evas_Imaging_Font)); - if (!fn) return NULL; - fn->font = font; - return fn; -} - -EAPI void -evas_imaging_font_free(Evas_Imaging_Font *fn) -{ - if (!fn) return; - evas_common_font_free(fn->font); - free(fn); -} - -EAPI int -evas_imaging_font_ascent_get(const Evas_Imaging_Font *fn) -{ - if (!fn) return 0; - return evas_common_font_ascent_get(fn->font); -} - -EAPI int -evas_imaging_font_descent_get(const Evas_Imaging_Font *fn) -{ - if (!fn) return 0; - return evas_common_font_descent_get(fn->font); -} - -EAPI int -evas_imaging_font_max_ascent_get(const Evas_Imaging_Font *fn) -{ - if (!fn) return 0; - return evas_common_font_max_ascent_get(fn->font); -} - -EAPI int -evas_imaging_font_max_descent_get(const Evas_Imaging_Font *fn) -{ - if (!fn) return 0; - return evas_common_font_max_descent_get(fn->font); -} - -EAPI int -evas_imaging_font_line_advance_get(const Evas_Imaging_Font *fn) -{ - if (!fn) return 0; - return evas_common_font_get_line_advance(fn->font); -} - -EAPI void -evas_imaging_font_string_advance_get(const Evas_Imaging_Font *fn, const char *str, int *x, int *y) -{ - Evas_BiDi_Props bidi_props; - Evas_BiDi_Paragraph_Props bidi_par_props; - bidi_props.props = &bidi_par_props; - Eina_Unicode *ustr; - if (!fn) return; - ustr = evas_common_encoding_utf8_to_unicode(str, NULL); -#ifdef BIDI_SUPPORT - evas_bidi_update_props(ustr, &bidi_par_props); -#endif - evas_common_font_query_advance(fn->font, ustr, &bidi_props, x, y); -#ifdef BIDI_SUPPORT - evas_bidi_props_clean(&bidi_props); -#endif - if (ustr) free(ustr); -} - -EAPI void -evas_imaging_font_string_size_query(const Evas_Imaging_Font *fn, const char *str, int *w, int *h) -{ - Evas_BiDi_Props intl_props; - Evas_BiDi_Paragraph_Props bidi_paragraph_props; - intl_props.props = &bidi_paragraph_props; - Eina_Unicode *ustr; - if (!fn) return; - ustr = evas_common_encoding_utf8_to_unicode(str, NULL); -#ifdef BIDI_SUPPORT - evas_bidi_update_props(ustr, &bidi_paragraph_props); -#endif - evas_common_font_query_size(fn->font, ustr, &intl_props, w, h); -#ifdef BIDI_SUPPORT - evas_bidi_props_clean(&intl_props); -#endif - if (ustr) free(ustr); -} - -EAPI int -evas_imaging_font_string_inset_get(const Evas_Imaging_Font *fn, const char *str) -{ - Eina_Unicode *ustr; - int ret; - - if (!fn) return 0; - ustr = evas_common_encoding_utf8_to_unicode(str, NULL); - ret = evas_common_font_query_inset(fn->font, ustr); - if (ustr) free(ustr); - return ret; -} - -EAPI int -evas_imaging_font_string_char_coords_get(const Evas_Imaging_Font *fn, const char *str, int pos, int *cx, int *cy, int *cw, int *ch) -{ - int ret; - Evas_BiDi_Props intl_props; - Evas_BiDi_Paragraph_Props bidi_paragraph_props; - intl_props.props = &bidi_paragraph_props; - Eina_Unicode *ustr; - if (!fn) return 0; - ustr = evas_common_encoding_utf8_to_unicode(str, NULL); -#ifdef BIDI_SUPPORT - evas_bidi_update_props(ustr, &bidi_paragraph_props); -#endif - ret = evas_common_font_query_char_coords(fn->font, ustr, &intl_props, pos, cx, cy, cw, ch); -#ifdef BIDI_SUPPORT - evas_bidi_props_clean(&intl_props); -#endif - if (ustr) free(ustr); - return ret; -} - -EAPI int -evas_imaging_font_string_char_at_coords_get(const Evas_Imaging_Font *fn, const char *str, int x, int y, int *cx, int *cy, int *cw, int *ch) -{ - int ret; - Evas_BiDi_Props intl_props; - Evas_BiDi_Paragraph_Props bidi_paragraph_props; - intl_props.props = &bidi_paragraph_props; - Eina_Unicode *ustr; - if (!fn) return -1; - ustr = evas_common_encoding_utf8_to_unicode(str, NULL); -#ifdef BIDI_SUPPORT - evas_bidi_update_props(ustr, &bidi_paragraph_props); -#endif - ret = evas_common_font_query_char_at_coords(fn->font, ustr, &intl_props, x, y, cx, cy, cw, ch); -#ifdef BIDI_SUPPORT - evas_bidi_props_clean(&intl_props); -#endif - if (ustr) free(ustr); - return ret; -} - -EAPI void -evas_imaging_font_cache_set(int bytes) -{ - evas_common_font_cache_set(bytes); -} - -EAPI int -evas_imaging_font_cache_get(void) -{ - return evas_common_font_cache_get(); -} - -/** - * @} - */