SOME of the changes needed to support evoak... needs new eet...
SVN revision: 9829
This commit is contained in:
parent
fbbfbfaa84
commit
fb5af0d025
|
@ -1394,6 +1394,7 @@ src/lib/Makefile
|
|||
src/lib/canvas/Makefile
|
||||
src/lib/data/Makefile
|
||||
src/lib/file/Makefile
|
||||
src/lib/imaging/Makefile
|
||||
src/lib/engines/Makefile
|
||||
src/lib/engines/common/Makefile
|
||||
src/lib/engines/software_x11/Makefile
|
||||
|
|
|
@ -527,7 +527,28 @@ extern "C" {
|
|||
void *evas_object_intercept_stack_below_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Object *below));
|
||||
void evas_object_intercept_layer_set_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, int l), const void *data);
|
||||
void *evas_object_intercept_layer_set_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, int l));
|
||||
|
||||
/* 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 */
|
||||
|
||||
#ifndef EVAS_COMMON_H
|
||||
#ifndef EVAS_PRIVATE_H
|
||||
|
||||
typedef struct _Evas_Imaging_Image Evas_Imaging_Image;
|
||||
typedef struct _Evas_Imaging_Font Evas_Imaging_Font;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Evas_Imaging_Image *evas_imaging_image_load (const char *file, const char *key);
|
||||
void evas_imaging_image_free (Evas_Imaging_Image *im);
|
||||
void evas_imaging_image_size_get (Evas_Imaging_Image *im, int *w, int *h);
|
||||
Evas_Bool evas_imaging_image_alpha_get (Evas_Imaging_Image *im);
|
||||
void evas_imaging_image_cache_set (int bytes);
|
||||
int evas_imaging_image_cache_get (void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = canvas data file engines include
|
||||
SUBDIRS = canvas data file engines imaging include
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
|
||||
|
@ -97,6 +97,7 @@ libevas_la_LIBADD = $(LDFLAGS) \
|
|||
canvas/libevas_canvas.la \
|
||||
data/libevas_data.la \
|
||||
file/libevas_file.la \
|
||||
imaging/libevas_imaging.la \
|
||||
engines/common/libevas_engine_common.la \
|
||||
@freetype_libs@ \
|
||||
@png_libs@ @jpeg_libs@ @eet_libs@ @edb_libs@ \
|
||||
|
@ -114,6 +115,7 @@ libevas_la_DEPENDENCIES = \
|
|||
canvas/libevas_canvas.la \
|
||||
data/libevas_data.la \
|
||||
file/libevas_file.la \
|
||||
imaging/libevas_imaging.la \
|
||||
engines/common/libevas_engine_common.la \
|
||||
$(ENGINE_SOFTWARE_X11) \
|
||||
$(ENGINE_DIRECTFB) \
|
||||
|
|
|
@ -602,6 +602,36 @@ static int load_image_file_data_eet(RGBA_Image *im, const char *file, const char
|
|||
static int
|
||||
load_image_file_data_eet(RGBA_Image *im, const char *file, const char *key)
|
||||
{
|
||||
int w, h, alpha, compression, quality, lossy;
|
||||
Eet_File *ef;
|
||||
int ok;
|
||||
|
||||
if ((!file) || (!key)) return -1;
|
||||
ef = eet_open((char *)file, EET_FILE_MODE_READ);
|
||||
if (!ef) return -1;
|
||||
ok = eet_data_image_header_read(ef, (char *)key,
|
||||
&w, &h, &alpha, &compression, &quality, &lossy);
|
||||
if (!ok)
|
||||
{
|
||||
eet_close(ef);
|
||||
return -1;
|
||||
}
|
||||
if ((w > 8192) || (h > 8192))
|
||||
{
|
||||
eet_close(ef);
|
||||
return -1;
|
||||
}
|
||||
if (alpha) im->flags |= RGBA_IMAGE_HAS_ALPHA;
|
||||
if (!im->image)
|
||||
im->image = evas_common_image_surface_new();
|
||||
if (!im->image)
|
||||
{
|
||||
eet_close(ef);
|
||||
return -1;
|
||||
}
|
||||
im->image->w = w;
|
||||
im->image->h = h;
|
||||
eet_close(ef);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
|
||||
# A list of all the files in the current directory which can be regenerated
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
LDFLAGS =
|
||||
INCLUDES = @freetype_cflags@ \
|
||||
-I. \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/lib/include
|
||||
|
||||
noinst_LTLIBRARIES = libevas_imaging.la
|
||||
libevas_imaging_la_SOURCES = \
|
||||
evas_imaging.c
|
||||
|
||||
libevas_imaging_la_LIBADD = $(LDFLAGS)
|
||||
libevas_imaging_la_DEPENDENCIES = $(top_builddir)/config.h
|
|
@ -0,0 +1,63 @@
|
|||
#include "config.h"
|
||||
#include "evas_options.h"
|
||||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
Evas_Imaging_Image *
|
||||
evas_imaging_image_load(const char *file, const char *key)
|
||||
{
|
||||
Evas_Imaging_Image *im;
|
||||
RGBA_Image *image;
|
||||
|
||||
if (!file) file = "";
|
||||
if (!key) key = "";
|
||||
evas_common_cpu_init();
|
||||
evas_common_image_init();
|
||||
image = evas_common_load_image_from_file(file, key);
|
||||
if (!image) return NULL;
|
||||
im = calloc(1, sizeof(Evas_Imaging_Image));
|
||||
if (!im)
|
||||
{
|
||||
evas_common_image_free(image);
|
||||
return NULL;
|
||||
}
|
||||
im->image = image;
|
||||
return im;
|
||||
}
|
||||
|
||||
void
|
||||
evas_imaging_image_free(Evas_Imaging_Image *im)
|
||||
{
|
||||
if (!im) return;
|
||||
evas_common_image_unref(im->image);
|
||||
free(im);
|
||||
}
|
||||
|
||||
void
|
||||
evas_imaging_image_size_get(Evas_Imaging_Image *im, int *w, int *h)
|
||||
{
|
||||
if (!im) return;
|
||||
if (w) *w = im->image->image->w;
|
||||
if (h) *h = im->image->image->h;
|
||||
}
|
||||
|
||||
Evas_Bool
|
||||
evas_imaging_image_alpha_get(Evas_Imaging_Image *im)
|
||||
{
|
||||
if (!im) return 0;
|
||||
if (im->image->flags & RGBA_IMAGE_HAS_ALPHA) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
evas_imaging_image_cache_set(int bytes)
|
||||
{
|
||||
evas_common_image_set_cache(bytes);
|
||||
}
|
||||
|
||||
int
|
||||
evas_imaging_image_cache_get(void)
|
||||
{
|
||||
return evas_common_image_get_cache();
|
||||
}
|
||||
|
|
@ -620,6 +620,19 @@ void evas_object_grabs_cleanup(Evas_Object *obj);
|
|||
void evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
|
||||
|
||||
extern int _evas_alloc_error;
|
||||
|
||||
typedef struct _Evas_Imaging_Image Evas_Imaging_Image;
|
||||
typedef struct _Evas_Imaging_Font Evas_Imaging_Font;
|
||||
|
||||
struct _Evas_Imaging_Image
|
||||
{
|
||||
RGBA_Image *image;
|
||||
};
|
||||
|
||||
struct _Evas_Imaging_font
|
||||
{
|
||||
RGBA_Font *font;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue