Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/xrender_x11
Modified Files:
Makefile.am evas_engine.c
Added Files:
Evas_Engine_XRender_X11.h
Log Message:
software engines all now totally inherit from software_generic and
xrender_x11 now partially inherits.
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/modules/engines/xrender_x11/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 17 Jan 2006 03:47:39 -0000 1.3
+++ Makefile.am 2 Mar 2006 09:16:46 -0000 1.4
@@ -1,23 +1,15 @@
-## 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
-INCLUDES = -I. \
- -I$(top_srcdir)/src/lib \
- -I$(top_srcdir)/src/lib/include \
- -I$(top_srcdir)/src/modules/engines \
- @FREETYPE_CFLAGS@ @x_cflags@
+INCLUDES = -I. -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/include
-I$(top_srcdir)/src/modules/engines @FREETYPE_CFLAGS@ @x_cflags@
if BUILD_ENGINE_XRENDER_X11
-pkgdir =
$(libdir)/evas/modules/engines/xrender_x11/$(MODULE_ARCH)
-
-pkg_LTLIBRARIES = module.la
+pkgdir = $(libdir)/evas/modules/engines/xrender_x11/$(MODULE_ARCH)
-module_la_SOURCES = \
+pkg_LTLIBRARIES = module.la
+module_la_SOURCES = \
evas_engine.h \
evas_engine.c \
evas_engine_ximage.c \
@@ -26,12 +18,11 @@
evas_engine_font.c \
evas_engine_gradient.c
-module_la_LIBADD = @x_libs@ $(top_builddir)/src/lib/libevas.la
-module_la_LDFLAGS = -module -avoid-version \
- -L$(top_builddir)/src/lib
-L$(top_builddir)/src/lib/.libs
+module_la_LIBADD = @x_libs@ $(top_builddir)/src/lib/libevas.la
+module_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/lib
-L$(top_builddir)/src/lib/.libs
+module_la_DEPENDENCIES = $(top_builddir)/config.h
-module_la_DEPENDENCIES = \
-$(top_builddir)/config.h
+include_HEADERS = Evas_Engine_XRender_X11.h
endif
@@ -42,4 +33,5 @@
evas_engine_xrender.c \
evas_engine_image.c \
evas_engine_font.c \
-evas_engine_gradient.c
+evas_engine_gradient.c \
+Evas_Engine_Buffer.h
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_engine.c 28 Feb 2006 04:07:49 -0000 1.2
+++ evas_engine.c 2 Mar 2006 09:16:46 -0000 1.3
@@ -3,6 +3,40 @@
#include "evas_engine.h"
#include "Evas_Engine_XRender_X11.h"
+/* function tables - filled in later (func and parent func) */
+static Evas_Func func, pfunc;
+
+/* engine struct data */
+typedef struct _Render_Engine Render_Engine;
+typedef struct _Render_Engine_Update Render_Engine_Update;
+
+struct _Render_Engine_Update
+{
+ int x, y, w, h;
+ Xrender_Surface *surface;
+};
+
+struct _Render_Engine
+{
+ Display *disp;
+ Visual *vis;
+ Drawable win;
+ Pixmap mask;
+ unsigned char destination_alpha : 1;
+
+ Ximage_Info *xinf;
+ Xrender_Surface *output;
+ Xrender_Surface *mask_output;
+
+ Tilebuf *tb;
+ Tilebuf_Rect *rects;
+ Evas_Object_List *cur_rect;
+ int end : 1;
+
+ Evas_List *updates;
+};
+
+/* prototypes we will use here */
static void *eng_info(Evas *e);
static void eng_info_free(Evas *e, void *info);
static void eng_setup(Evas *e, void *info);
@@ -15,27 +49,8 @@
static void *eng_output_redraws_next_update_get(void *data, int *x, int *y,
int *w, int *h, int *cx, int *cy, int *cw, int *ch);
static void eng_output_redraws_next_update_push(void *data, void *surface, int
x, int y, int w, int h);
static void eng_output_flush(void *data);
-static void *eng_context_new(void *data);
-static void eng_context_free(void *data, void *context);
-static void eng_context_clip_set(void *data, void *context, int x, int y, int
w, int h);
-static void eng_context_clip_clip(void *data, void *context, int x, int y, int
w, int h);
-static void eng_context_clip_unset(void *data, void *context);
-static int eng_context_clip_get(void *data, void *context, int *x, int *y, int
*w, int *h);
-static void eng_context_color_set(void *data, void *context, int r, int g, int
b, int a);
-static int eng_context_color_get(void *data, void *context, int *r, int *g,
int *b, int *a);
-static void eng_context_multiplier_set(void *data, void *context, int r, int
g, int b, int a);
-static void eng_context_multiplier_unset(void *data, void *context);
-static int eng_context_multiplier_get(void *data, void *context, int *r, int
*g, int *b, int *a);
-static void eng_context_cutout_add(void *data, void *context, int x, int y,
int w, int h);
-static void eng_context_cutout_clear(void *data, void *context);
-static void eng_context_anti_alias_set(void *data, void *context, unsigned
char aa);
-static unsigned char eng_context_anti_alias_get(void *data, void *context);
-static void eng_context_color_interpolation_set(void *data, void *context, int
color_space);
-static int eng_context_color_interpolation_get(void *data, void *context);
static void eng_rectangle_draw(void *data, void *context, void *surface, int
x, int y, int w, int h);
static void eng_line_draw(void *data, void *context, void *surface, int x1,
int y1, int x2, int y2);
-static void *eng_polygon_point_add(void *data, void *context, void *polygon,
int x, int y);
-static void *eng_polygon_points_clear(void *data, void *context, void
*polygon);
static void eng_polygon_draw(void *data, void *context, void *surface, void
*polygon);
static void *eng_gradient_color_add(void *data, void *context, void *gradient,
int r, int g, int b, int a, int distance);
static void *eng_gradient_colors_clear(void *data, void *context, void
*gradient);
@@ -64,154 +79,11 @@
static void eng_image_cache_flush(void *data);
static void eng_image_cache_set(void *data, int bytes);
static int eng_image_cache_get(void *data);
-static void *eng_font_load(void *data, char *name, int size);
-static void *eng_font_memory_load(void *data, char *name, int size, const void
*fdata, int fdata_size);
-static void *eng_font_add(void *data, void *font, char *name, int size);
-static void *eng_font_memory_add(void *data, void *font, char *name, int size,
const void *fdata, int fdata_size);
-static void eng_font_free(void *data, void *font);
-static int eng_font_ascent_get(void *data, void *font);
-static int eng_font_descent_get(void *data, void *font);
-static int eng_font_max_ascent_get(void *data, void *font);
-static int eng_font_max_descent_get(void *data, void *font);
-static void eng_font_string_size_get(void *data, void *font, char *text, int
*w, int *h);
-static int eng_font_inset_get(void *data, void *font, char *text);
-static int eng_font_h_advance_get(void *data, void *font, char *text);
-static int eng_font_v_advance_get(void *data, void *font, char *text);
-static int eng_font_char_coords_get(void *data, void *font, char *text, int
pos, int *cx, int *cy, int *cw, int *ch);
-static int eng_font_char_at_coords_get(void *data, void *font, char *text, int
x, int y, int *cx, int *cy, int *cw, int *ch);
static void eng_font_draw(void *data, void *context, void *surface, void
*font, int x, int y, int w, int h, int ow, int oh, char *text);
-static void eng_font_cache_flush(void *data);
-static void eng_font_cache_set(void *data, int bytes);
-static int eng_font_cache_get(void *data);
-static void eng_font_hinting_set(void *data, void *font, int hinting);
-static int eng_font_hinting_can_hint(void *data, int hinting);
-
-typedef struct _Render_Engine Render_Engine;
-typedef struct _Render_Engine_Update Render_Engine_Update;
-
-struct _Render_Engine_Update
-{
- int x, y, w, h;
- Xrender_Surface *surface;
-};
-
-struct _Render_Engine
-{
- Display *disp;
- Visual *vis;
- Drawable win;
- Pixmap mask;
- unsigned char destination_alpha : 1;
-
- Ximage_Info *xinf;
- Xrender_Surface *output;
- Xrender_Surface *mask_output;
-
- Tilebuf *tb;
- Tilebuf_Rect *rects;
- Evas_Object_List *cur_rect;
- int end : 1;
-
- Evas_List *updates;
-};
-
-static Evas_Func eng_func =
-{
- eng_info,
- eng_info_free,
- eng_setup,
- eng_output_free,
- eng_output_resize,
- eng_output_tile_size_set,
- eng_output_redraws_rect_add,
- eng_output_redraws_rect_del,
- eng_output_redraws_clear,
- eng_output_redraws_next_update_get,
- eng_output_redraws_next_update_push,
- eng_output_flush,
- /* draw context virtual methods */
- eng_context_new,
- eng_context_free,
- eng_context_clip_set,
- eng_context_clip_clip,
- eng_context_clip_unset,
- eng_context_clip_get,
- eng_context_color_set,
- eng_context_color_get,
- eng_context_multiplier_set,
- eng_context_multiplier_unset,
- eng_context_multiplier_get,
- eng_context_cutout_add,
- eng_context_cutout_clear,
- eng_context_anti_alias_set,
- eng_context_anti_alias_get,
- eng_context_color_interpolation_set,
- eng_context_color_interpolation_get,
- /* rectangle draw funcs */
- eng_rectangle_draw,
- /* line draw funcs */
- eng_line_draw,
- /* polygon draw funcs */
- eng_polygon_point_add,
- eng_polygon_points_clear,
- eng_polygon_draw,
- /* gradient draw funcs */
- eng_gradient_color_add,
- eng_gradient_colors_clear,
- eng_gradient_free,
- eng_gradient_fill_set,
- eng_gradient_type_set,
- eng_gradient_type_params_set,
- eng_gradient_geometry_init,
- eng_gradient_alpha_get,
- eng_gradient_map,
- eng_gradient_draw,
- /* image draw funcs */
- eng_image_load,
- eng_image_new_from_data,
- eng_image_new_from_copied_data,
- eng_image_free,
- eng_image_size_get,
- eng_image_size_set,
- eng_image_dirty_region,
- eng_image_data_get,
- eng_image_data_put,
- eng_image_alpha_set,
- eng_image_alpha_get,
- eng_image_draw,
- eng_image_comment_get,
- eng_image_format_get,
- /* image cache funcs */
- eng_image_cache_flush,
- eng_image_cache_set,
- eng_image_cache_get,
- /* font draw functions */
- eng_font_load,
- eng_font_memory_load,
- eng_font_add,
- eng_font_memory_add,
- eng_font_free,
- eng_font_ascent_get,
- eng_font_descent_get,
- eng_font_max_ascent_get,
- eng_font_max_descent_get,
- eng_font_string_size_get,
- eng_font_inset_get,
- eng_font_h_advance_get,
- eng_font_v_advance_get,
- eng_font_char_coords_get,
- eng_font_char_at_coords_get,
- eng_font_draw,
- /* font cache functions */
- eng_font_cache_flush,
- eng_font_cache_set,
- eng_font_cache_get,
-
- eng_font_hinting_set,
- eng_font_hinting_can_hint
-};
+/* internal engine routines */
+/* engine api this module provides */
static void *
eng_info(Evas *e)
{
@@ -469,181 +341,9 @@
_xr_image_info_pool_flush(re->xinf, 0, 0);
}
-static void *
-eng_context_new(void *data)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_draw_context_new();
-}
-
-static void
-eng_context_free(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_free(context);
-}
-
-static void
-eng_context_clip_set(void *data, void *context, int x, int y, int w, int h)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_set_clip(context, x, y, w, h);
-}
-
-static void
-eng_context_clip_clip(void *data, void *context, int x, int y, int w, int h)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_clip_clip(context, x, y, w, h);
-}
-
-static void
-eng_context_clip_unset(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_unset_clip(context);
-}
-
-static int
-eng_context_clip_get(void *data, void *context, int *x, int *y, int *w, int *h)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- *x = ((RGBA_Draw_Context *)context)->clip.x;
- *y = ((RGBA_Draw_Context *)context)->clip.y;
- *w = ((RGBA_Draw_Context *)context)->clip.w;
- *h = ((RGBA_Draw_Context *)context)->clip.h;
- return ((RGBA_Draw_Context *)context)->clip.use;
-}
-
-static void
-eng_context_color_set(void *data, void *context, int r, int g, int b, int a)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_set_color(context, r, g, b, a);
-}
-
-static int
-eng_context_color_get(void *data, void *context, int *r, int *g, int *b, int
*a)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- *r = (int)(R_VAL(&((RGBA_Draw_Context *)context)->col.col));
- *g = (int)(G_VAL(&((RGBA_Draw_Context *)context)->col.col));
- *b = (int)(B_VAL(&((RGBA_Draw_Context *)context)->col.col));
- *a = (int)(A_VAL(&((RGBA_Draw_Context *)context)->col.col));
- return 1;
-}
-
-static void
-eng_context_multiplier_set(void *data, void *context, int r, int g, int b, int
a)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_set_multiplier(context, r, g, b, a);
-}
-
-static void
-eng_context_multiplier_unset(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_unset_multiplier(context);
-}
-
-static int
-eng_context_multiplier_get(void *data, void *context, int *r, int *g, int *b,
int *a)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- *r = (int)(R_VAL(&((RGBA_Draw_Context *)context)->mul.col));
- *g = (int)(G_VAL(&((RGBA_Draw_Context *)context)->mul.col));
- *b = (int)(B_VAL(&((RGBA_Draw_Context *)context)->mul.col));
- *a = (int)(A_VAL(&((RGBA_Draw_Context *)context)->mul.col));
- return ((RGBA_Draw_Context *)context)->mul.use;
-}
-
-static void
-eng_context_cutout_add(void *data, void *context, int x, int y, int w, int h)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_add_cutout(context, x, y, w, h);
-}
-
-static void
-eng_context_cutout_clear(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_clear_cutouts(context);
-}
-
-static void
-eng_context_anti_alias_set(void *data, void *context, unsigned char aa)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_set_anti_alias(context, aa);
-}
-
-static unsigned char
-eng_context_anti_alias_get(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return ((RGBA_Draw_Context *)context)->anti_alias;
-}
-
-static void
-eng_context_color_interpolation_set(void *data, void *context, int color_space)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_draw_context_set_color_interpolation(context, color_space);
-}
-
-static int
-eng_context_color_interpolation_get(void *data, void *context)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return ((RGBA_Draw_Context *)context)->interpolation.color_space;
-}
-
-
-
-
-
static void
eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int
w, int h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xr_render_surface_rectangle_draw((Xrender_Surface *)surface,
(RGBA_Draw_Context *)context,
x, y, w, h);
@@ -652,36 +352,12 @@
static void
eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int
x2, int y2)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xr_render_surface_line_draw((Xrender_Surface *)surface, (RGBA_Draw_Context
*)context, x1, y1, x2, y2);
}
-static void *
-eng_polygon_point_add(void *data, void *context, void *polygon, int x, int y)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_polygon_point_add(polygon, x, y);
-}
-
-static void *
-eng_polygon_points_clear(void *data, void *context, void *polygon)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_polygon_points_clear(polygon);
-}
-
static void
eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_poly_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context,
(RGBA_Polygon_Point *)polygon);
}
@@ -697,81 +373,54 @@
static void *
eng_gradient_colors_clear(void *data, void *context, void *gradient)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
return _xre_gradient_colors_clear((XR_Gradient *)gradient);
}
static void
eng_gradient_free(void *data, void *gradient)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_free((XR_Gradient *)gradient);
}
static void
eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_fill_set((XR_Gradient *)gradient, x, y, w, h);
}
static void
eng_gradient_type_set(void *data, void *gradient, char *name)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_type_set((XR_Gradient *)gradient, name);
}
static void
eng_gradient_type_params_set(void *data, void *gradient, char *params)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_type_params_set((XR_Gradient *)gradient, params);
}
static void *
eng_gradient_geometry_init(void *data, void *gradient, int spread)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
return _xre_gradient_geometry_init((XR_Gradient *)gradient, spread);
}
static int
eng_gradient_alpha_get(void *data, void *gradient, int spread)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
return _xre_gradient_alpha_get((XR_Gradient *)gradient, spread);
}
static void
eng_gradient_map(void *data, void *context, void *gradient, int spread)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_map((RGBA_Draw_Context *)context, (XR_Gradient *)gradient,
spread);
}
static void
eng_gradient_draw(void *data, void *context, void *surface, void *gradient,
int x, int y, int w, int h, double angle, int spread)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
_xre_gradient_draw((Xrender_Surface *)surface,
(RGBA_Draw_Context *)context,
(XR_Gradient *)gradient, x, y, w, h, angle, spread);
@@ -814,9 +463,6 @@
static void
eng_image_free(void *data, void *image)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return;
_xre_image_free((XR_Image *)image);
}
@@ -824,9 +470,6 @@
static void
eng_image_size_get(void *data, void *image, int *w, int *h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return;
if (w) *w = ((XR_Image *)image)->w;
if (h) *h = ((XR_Image *)image)->h;
@@ -835,9 +478,6 @@
static void *
eng_image_size_set(void *data, void *image, int w, int h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return image;
if ((w <= 0) || (h <= 0))
{
@@ -867,9 +507,6 @@
static void *
eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return image;
_xre_image_dirty((XR_Image *)image);
_xre_image_region_dirty((XR_Image *)image, x, y, w, h);
@@ -879,9 +516,6 @@
static void *
eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return image;
if (to_write)
{
@@ -909,9 +543,6 @@
static void *
eng_image_data_put(void *data, void *image, DATA32 *image_data)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return image;
if (_xre_image_data_get((XR_Image *)image) != image_data)
{
@@ -948,9 +579,6 @@
static void *
eng_image_alpha_set(void *data, void *image, int has_alpha)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return image;
if (((((XR_Image *)image)->alpha) && (has_alpha)) ||
((!((XR_Image *)image)->alpha) && (!has_alpha)))
@@ -978,9 +606,6 @@
static int
eng_image_alpha_get(void *data, void *image)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return 0;
return _xre_image_alpha_get((XR_Image *)image);
}
@@ -988,9 +613,6 @@
static void
eng_image_draw(void *data, void *context, void *surface, void *image, int
src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int
dst_h, int smooth)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if ((!image) || (!surface)) return;
_xre_image_surface_gen((XR_Image *)image);
if (((XR_Image *)image)->surface)
@@ -1005,9 +627,6 @@
static char *
eng_image_comment_get(void *data, void *image, char *key)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return NULL;
return ((XR_Image *)image)->comment;
}
@@ -1015,9 +634,6 @@
static char *
eng_image_format_get(void *data, void *image)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
if (!image) return NULL;
return ((XR_Image *)image)->format;
}
@@ -1025,13 +641,9 @@
static void
eng_image_cache_flush(void *data)
{
- Render_Engine *re;
int tmp_size;
-
- re = (Render_Engine *)data;
- tmp_size = evas_common_image_get_cache();
- evas_common_image_set_cache(0);
- evas_common_image_set_cache(tmp_size);
+
+ pfunc.image_cache_flush(data);
_xre_image_cache_set(0);
_xre_image_cache_set(tmp_size);
}
@@ -1039,159 +651,14 @@
static void
eng_image_cache_set(void *data, int bytes)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_image_set_cache(bytes);
+ pfunc.image_cache_set(data, bytes);
_xre_image_cache_set(bytes);
}
static int
eng_image_cache_get(void *data)
{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_image_get_cache();
-}
-
-static void *
-eng_font_load(void *data, char *name, int size)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_load(name, size);
-}
-
-static void *
-eng_font_memory_load(void *data, char *name, int size, const void *fdata, int
fdata_size)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_memory_load(name, size, fdata, fdata_size);
-}
-
-static void *
-eng_font_add(void *data, void *font, char *name, int size)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_add(font, name, size);
-}
-
-static void *
-eng_font_memory_add(void *data, void *font, char *name, int size, const void
*fdata, int fdata_size)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_memory_add(font, name, size, fdata, fdata_size);
-}
-
-static void
-eng_font_free(void *data, void *font)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_font_free(font);
-}
-
-static int
-eng_font_ascent_get(void *data, void *font)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_ascent_get(font);
-}
-
-static int
-eng_font_descent_get(void *data, void *font)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_descent_get(font);
-}
-
-static int
-eng_font_max_ascent_get(void *data, void *font)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_max_ascent_get(font);
-}
-
-static int
-eng_font_max_descent_get(void *data, void *font)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_max_descent_get(font);
-}
-
-static void
-eng_font_string_size_get(void *data, void *font, char *text, int *w, int *h)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_font_query_size(font, text, w, h);
-}
-
-static int
-eng_font_inset_get(void *data, void *font, char *text)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_query_inset(font, text);
-}
-
-static int
-eng_font_h_advance_get(void *data, void *font, char *text)
-{
- Render_Engine *re;
- int h, v;
-
- re = (Render_Engine *)data;
- evas_common_font_query_advance(font, text, &h, &v);
- return h;
-}
-
-static int
-eng_font_v_advance_get(void *data, void *font, char *text)
-{
- Render_Engine *re;
- int h, v;
-
- re = (Render_Engine *)data;
- evas_common_font_query_advance(font, text, &h, &v);
- return v;
-}
-
-static int
-eng_font_char_coords_get(void *data, void *font, char *text, int pos, int *cx,
int *cy, int *cw, int *ch)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_query_char_coords(font, text, pos, cx, cy, cw, ch);
-}
-
-static int
-eng_font_char_at_coords_get(void *data, void *font, char *text, int x, int y,
int *cx, int *cy, int *cw, int *ch)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_query_text_at_pos(font, text, x, y, cx, cy, cw, ch);
+ return pfunc.image_cache_get(data);
}
static void
@@ -1228,61 +695,68 @@
}
}
-static void
-eng_font_cache_flush(void *data)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_font_flush();
-}
-
-static void
-eng_font_cache_set(void *data, int bytes)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_font_cache_set(bytes);
-}
-
-static int
-eng_font_cache_get(void *data)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_font_cache_get();
-}
-
-static void
-eng_font_hinting_set(void *data, void *font, int hinting)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- evas_common_font_hinting_set(font, hinting);
-}
-
-static int
-eng_font_hinting_can_hint(void *data, int hinting)
-{
- Render_Engine *re;
-
- re = (Render_Engine *)data;
- return evas_common_hinting_available(hinting);
-}
-
-int module_open(Evas_Module *em)
+/* module advertising code */
+int
+module_open(Evas_Module *em)
{
if (!em) return 0;
- em->functions = (void *)(&eng_func);
+ /* get whatever engine module we inherit from */
+ if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
+ /* store it for later use */
+ func = pfunc;
+ /* now to override methods */
+#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
+ ORD(info);
+ ORD(info_free);
+ ORD(setup);
+ ORD(output_free);
+ ORD(output_resize);
+ ORD(output_tile_size_set);
+ ORD(output_redraws_rect_add);
+ ORD(output_redraws_rect_del);
+ ORD(output_redraws_clear);
+ ORD(output_redraws_next_update_get);
+ ORD(output_redraws_next_update_push);
+ ORD(output_flush);
+ ORD(rectangle_draw);
+ ORD(line_draw);
+ ORD(polygon_draw);
+ ORD(gradient_color_add);
+ ORD(gradient_colors_clear);
+ ORD(gradient_free);
+ ORD(gradient_fill_set);
+ ORD(gradient_type_set);
+ ORD(gradient_type_params_set);
+ ORD(gradient_geometry_init);
+ ORD(gradient_alpha_get);
+ ORD(gradient_map);
+ ORD(gradient_draw);
+ ORD(image_load);
+ ORD(image_new_from_data);
+ ORD(image_new_from_copied_data);
+ ORD(image_free);
+ ORD(image_size_get);
+ ORD(image_size_set);
+ ORD(image_dirty_region);
+ ORD(image_data_get);
+ ORD(image_data_put);
+ ORD(image_alpha_set);
+ ORD(image_alpha_get);
+ ORD(image_draw);
+ ORD(image_comment_get);
+ ORD(image_format_get);
+ ORD(image_cache_flush);
+ ORD(image_cache_set);
+ ORD(image_cache_get);
+ ORD(font_draw);
+ /* now advertise out own api */
+ em->functions = (void *)(&func);
return 1;
}
-void module_close(void)
+void
+module_close(void)
{
-
}
Evas_Module_Api evas_modapi =
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs