forked from enlightenment/efl
and here are the stubs of a cairo engine
SVN revision: 11248
This commit is contained in:
parent
163df38dea
commit
1131ec1e34
|
@ -402,6 +402,53 @@ else
|
|||
AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, false)
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#######################################
|
||||
## Check if we should build the gl_x11 engine
|
||||
have_evas_cairo_x11="no";
|
||||
ENGINE_CAIRO_X11_PRG="";
|
||||
## Automatic check...
|
||||
PKG_CHECK_MODULES(CAIRO, cairo >= 0.1.23,
|
||||
[ have_evas_cairo_x11="yes" ],
|
||||
[ have_evas_cairo_x11="no" ]
|
||||
)
|
||||
## Manual override
|
||||
AC_MSG_CHECKING(whether cairo x11 backend is to be built)
|
||||
AC_ARG_ENABLE(gl-x11, [ --enable-cairo-x11 enable the Cairo X11 display engine], [
|
||||
if [ test "$enableval" = "yes" ]; then
|
||||
AC_MSG_RESULT(yes)
|
||||
have_evas_cairo_x11="yes"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
have_evas_cairo_x11="no"
|
||||
fi
|
||||
], [
|
||||
AC_MSG_RESULT($have_evas_cairo_x11)
|
||||
]
|
||||
)
|
||||
if test "x$have_evas_cairo_x11" = "xyes"; then
|
||||
AC_CHECK_HEADER(X11/X.h,
|
||||
[
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_X11, true)
|
||||
AC_DEFINE(BUILD_ENGINE_CAIRO_X11, 1, [Cairo X11 Rendering Backend])
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_COMMON, true)
|
||||
AC_DEFINE(BUILD_ENGINE_CAIRO_COMMON, 1, [Generic Cairo Rendering Support])
|
||||
x_dir="/usr/X11R6";
|
||||
x_cflags="-I"$x_dir"/include"
|
||||
x_libs="-L"$x_dir"/lib -lX11 -lXext"
|
||||
ENGINE_CAIRO_X11_PRG="evas_cairo_x11_test"
|
||||
], [
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_X11, false)
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_COMMON, false)
|
||||
AC_MSG_RESULT(disabling Cairo X11 engine)
|
||||
]
|
||||
)
|
||||
else
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_X11, false)
|
||||
AM_CONDITIONAL(BUILD_ENGINE_CAIRO_COMMON, false)
|
||||
fi
|
||||
|
||||
#####################################################################
|
||||
## Image loaders
|
||||
|
||||
|
@ -1441,6 +1488,7 @@ AC_SUBST(ENGINE_FB_PRG)
|
|||
AC_SUBST(ENGINE_BUFFER_PRG)
|
||||
AC_SUBST(ENGINE_SOFTWARE_QTOPIA_PRG)
|
||||
AC_SUBST(ENGINE_GL_X11_PRG)
|
||||
AC_SUBST(ENGINE_CAIRO_X11_PRG)
|
||||
|
||||
AC_SUBST(altivec_cflags)
|
||||
|
||||
|
@ -1468,6 +1516,8 @@ src/lib/engines/software_qtopia/Makefile
|
|||
src/lib/engines/directfb/Makefile
|
||||
src/lib/engines/gl_common/Makefile
|
||||
src/lib/engines/gl_x11/Makefile
|
||||
src/lib/engines/cairo_common/Makefile
|
||||
src/lib/engines/cairo_x11/Makefile
|
||||
src/lib/include/Makefile
|
||||
proj/Makefile
|
||||
proj/win32_gdi/Makefile
|
||||
|
@ -1498,6 +1548,7 @@ echo " Software Qtopia.........: $have_evas_qtopia"
|
|||
echo " Software Memory Buffer..: $have_evas_buffer"
|
||||
echo " DirectFB................: $have_evas_directfb"
|
||||
echo " OpenGL X11..............: $have_evas_gl_x11"
|
||||
echo " Cairo X11..............: $have_evas_cairo_x11"
|
||||
# FIXME: opengl engine needs to be fixed and tested lots for all drivers
|
||||
# FIXME: xrender engine to be written
|
||||
echo
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
INCLUDES = \
|
||||
-I. -I$(top_srcdir)/src/lib -I$(top_srcdir) \
|
||||
@DIRECTFB_CFLAGS@ @qt_cflags@ @gl_cflags@
|
||||
@DIRECTFB_CFLAGS@ @qt_cflags@ @gl_cflags@ @CAIRO_CFLAGS@
|
||||
|
||||
bin_PROGRAMS = \
|
||||
@ENGINE_SOFTWARE_X11_PRG@ \
|
||||
|
@ -10,7 +10,8 @@ bin_PROGRAMS = \
|
|||
@ENGINE_FB_PRG@ \
|
||||
@ENGINE_BUFFER_PRG@ \
|
||||
@ENGINE_SOFTWARE_QTOPIA_PRG@ \
|
||||
@ENGINE_GL_X11_PRG@
|
||||
@ENGINE_GL_X11_PRG@ \
|
||||
@ENGINE_CAIRO_X11_PRG@
|
||||
|
||||
EXTRA_PROGRAMS = \
|
||||
evas_software_x11_test \
|
||||
|
@ -21,7 +22,8 @@ evas_directfb_window \
|
|||
evas_fb_test \
|
||||
evas_buffer_test \
|
||||
evas_software_qtopia_test \
|
||||
evas_gl_x11_test
|
||||
evas_gl_x11_test \
|
||||
evas_cairo_x11_test
|
||||
|
||||
SUBDIRS = evas_software_win32
|
||||
|
||||
|
@ -86,4 +88,10 @@ evas_gl_x11_test_LDFLAGS = $(LDFLAGS)
|
|||
evas_gl_x11_test_CFLAGS = $(CFLAGS) @x_cflags@ @gl_cflags@
|
||||
evas_gl_x11_test_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la
|
||||
|
||||
evas_cairo_x11_test_SOURCES = evas_test_main.h evas_test_main.c evas_cairo_x11_main.c
|
||||
evas_cairo_x11_test_LDADD = $(top_builddir)/src/lib/libevas.la -lm @x_libs@ @CAIRO_LIBS@
|
||||
evas_cairo_x11_test_LDFLAGS = $(LDFLAGS)
|
||||
evas_cairo_x11_test_CFLAGS = $(CFLAGS) @x_cflags@ @CAIRO_CFLAGS@
|
||||
evas_cairo_x11_test_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la
|
||||
|
||||
EXTRA_DIST = evas_software_qtopia_main.h evas_software_qtopia_main.cpp moc_evas_software_qtopia_main.cpp
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
#include "evas_test_main.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "Evas.h"
|
||||
#include "Evas_Engine_Cairo_X11.h"
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int pause_me = 0;
|
||||
Display *disp;
|
||||
Window win;
|
||||
XSetWindowAttributes attr;
|
||||
XClassHint chint;
|
||||
XSizeHints szhints;
|
||||
|
||||
disp = XOpenDisplay(NULL);
|
||||
if (!disp)
|
||||
{
|
||||
printf("Error: cannot open display.\n");
|
||||
exit(-1);
|
||||
}
|
||||
/* test evas_free.... :) */
|
||||
evas = evas_new();
|
||||
evas_output_method_set(evas, evas_render_method_lookup("cairo_x11"));
|
||||
evas_output_size_set(evas, win_w, win_h);
|
||||
evas_output_viewport_set(evas, 0, 0, win_w, win_h);
|
||||
{
|
||||
Evas_Engine_Info_Cairo_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Cairo_X11 *) evas_engine_info_get(evas);
|
||||
|
||||
/* the following is specific to the engine */
|
||||
attr.backing_store = NotUseful;
|
||||
attr.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||
attr.border_pixel = 0;
|
||||
attr.background_pixmap = None;
|
||||
attr.event_mask =
|
||||
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
|
||||
StructureNotifyMask;
|
||||
attr.bit_gravity = ForgetGravity;
|
||||
|
||||
win = XCreateWindow(disp, DefaultRootWindow(disp), 0, 0, win_w, win_h, 0,
|
||||
DefaultDepth(disp, DefaultScreen(disp)),
|
||||
InputOutput,
|
||||
DefaultVisual(disp, DefaultScreen(disp)),
|
||||
CWBackingStore | CWColormap |
|
||||
CWBackPixmap | CWBorderPixel |
|
||||
CWBitGravity | CWEventMask, &attr);
|
||||
|
||||
einfo->info.display = disp;
|
||||
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
|
||||
einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||
einfo->info.drawable = win;
|
||||
einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
|
||||
|
||||
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
|
||||
}
|
||||
|
||||
XStoreName(disp, win, "Evas Cairo X11 Test");
|
||||
chint.res_name = "Evas_Cairo_X11_Test";
|
||||
chint.res_class = "Main";
|
||||
XSetClassHint(disp, win, &chint);
|
||||
#if 0
|
||||
szhints.flags = PMinSize | PMaxSize | PSize | USSize;
|
||||
szhints.min_width = szhints.max_width = win_w;
|
||||
szhints.min_height = szhints.max_height = win_h;
|
||||
XSetWMNormalHints(disp, win, &szhints);
|
||||
#endif
|
||||
XMapWindow(disp, win);
|
||||
XSync(disp, False);
|
||||
|
||||
setup();
|
||||
|
||||
orig_start_time = start_time = get_time();
|
||||
for (;;)
|
||||
{
|
||||
XEvent ev;
|
||||
|
||||
while (XCheckMaskEvent(disp,
|
||||
ExposureMask |
|
||||
StructureNotifyMask |
|
||||
KeyPressMask |
|
||||
KeyReleaseMask |
|
||||
ButtonPressMask |
|
||||
ButtonReleaseMask | PointerMotionMask, &ev))
|
||||
{
|
||||
switch (ev.type)
|
||||
{
|
||||
case ButtonPress:
|
||||
if (ev.xbutton.button == 3)
|
||||
exit(0);
|
||||
if (!pause_me)
|
||||
pause_me = 1;
|
||||
else if (pause_me == 1)
|
||||
pause_me = 2;
|
||||
else
|
||||
pause_me = 1;
|
||||
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||
evas_event_feed_mouse_down(evas, ev.xbutton.button);
|
||||
break;
|
||||
case ButtonRelease:
|
||||
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y);
|
||||
evas_event_feed_mouse_up(evas, ev.xbutton.button);
|
||||
break;
|
||||
case MotionNotify:
|
||||
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y);
|
||||
break;
|
||||
case Expose:
|
||||
evas_damage_rectangle_add(evas,
|
||||
ev.xexpose.x,
|
||||
ev.xexpose.y,
|
||||
ev.xexpose.width,
|
||||
ev.xexpose.height);
|
||||
break;
|
||||
case ConfigureNotify:
|
||||
evas_output_size_set(evas,
|
||||
ev.xconfigure.width,
|
||||
ev.xconfigure.height);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!(pause_me == 1))
|
||||
{
|
||||
loop();
|
||||
evas_render(evas);
|
||||
XFlush(disp);
|
||||
}
|
||||
if (pause_me == 2)
|
||||
usleep(100000);
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef _EVAS_ENGINE_CAIRO_X11_H
|
||||
#define _EVAS_ENGINE_CAIRO_X11_H
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
typedef struct _Evas_Engine_Info_Cairo_X11 Evas_Engine_Info_Cairo_X11;
|
||||
|
||||
struct _Evas_Engine_Info_Cairo_X11
|
||||
{
|
||||
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
|
||||
/* at you and make nasty noises */
|
||||
Evas_Engine_Info magic;
|
||||
|
||||
/* engine specific data & parameters it needs to set up */
|
||||
struct {
|
||||
Display *display;
|
||||
Drawable drawable;
|
||||
Visual *visual;
|
||||
Colormap colormap;
|
||||
int depth;
|
||||
} info;
|
||||
/* engine specific function calls to query stuff about the destination */
|
||||
/* engine (what visual & colormap & depth to use, performance info etc. */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -22,7 +22,8 @@ Evas_Engine_FB.h \
|
|||
Evas_Engine_Buffer.h \
|
||||
Evas_Engine_Software_Win32_GDI.h \
|
||||
Evas_Engine_Software_Qtopia.h \
|
||||
Evas_Engine_GL_X11.h
|
||||
Evas_Engine_GL_X11.h \
|
||||
Evas_Engine_Cairo_X11.h
|
||||
|
||||
if BUILD_ENGINE_SOFTWARE_X11
|
||||
ENGINE_SOFTWARE_X11 = engines/software_x11/libevas_engine_software_x11.la
|
||||
|
@ -72,7 +73,7 @@ ENGINE_GL_COMMON =
|
|||
ENGINE_GL_COMMON_INC =
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_GL_COMMON
|
||||
if BUILD_ENGINE_GL_X11
|
||||
ENGINE_GL_X11 = engines/gl_x11/libevas_engine_gl_x11.la
|
||||
ENGINE_GL_X11_INC = Evas_Engine_GL_X11.h
|
||||
else
|
||||
|
@ -80,6 +81,22 @@ ENGINE_GL_X11 =
|
|||
ENGINE_GL_X11_INC =
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_CAIRO_COMMON
|
||||
ENGINE_CAIRO_COMMON = engines/cairo_common/libevas_engine_cairo_common.la
|
||||
ENGINE_CAIRO_COMMON_INC =
|
||||
else
|
||||
ENGINE_CAIRO_COMMON =
|
||||
ENGINE_CAIRO_COMMON_INC =
|
||||
endif
|
||||
|
||||
if BUILD_ENGINE_CAIRO_X11
|
||||
ENGINE_CAIRO_X11 = engines/cairo_x11/libevas_engine_cairo_x11.la
|
||||
ENGINE_CAIRO_X11_INC = Evas_Engine_Cairo_X11.h
|
||||
else
|
||||
ENGINE_CAIRO_X11 =
|
||||
ENGINE_CAIRO_X11_INC =
|
||||
endif
|
||||
|
||||
include_HEADERS = \
|
||||
Evas.h \
|
||||
$(ENGINE_SOFTWARE_X11_INC) \
|
||||
|
@ -88,7 +105,9 @@ $(ENGINE_FB_INC) \
|
|||
$(ENGINE_BUFFER_INC) \
|
||||
$(ENGINE_SOFTWARE_QTOPIA_INC) \
|
||||
$(ENGINE_GL_COMMON_INC) \
|
||||
$(ENGINE_GL_X11_INC)
|
||||
$(ENGINE_GL_X11_INC) \
|
||||
$(ENGINE_CAIRO_COMMON_INC) \
|
||||
$(ENGINE_CAIRO_X11_INC)
|
||||
|
||||
libevas_la_SOURCES = \
|
||||
main.c
|
||||
|
@ -108,7 +127,9 @@ libevas_la_LIBADD = $(LDFLAGS) \
|
|||
$(ENGINE_BUFFER) \
|
||||
$(ENGINE_SOFTWARE_QTOPIA) \
|
||||
$(ENGINE_GL_COMMON) \
|
||||
$(ENGINE_GL_X11)
|
||||
$(ENGINE_GL_X11) \
|
||||
$(ENGINE_CAIRO_COMMON) \
|
||||
$(ENGINE_CAIRO_X11)
|
||||
|
||||
|
||||
libevas_la_DEPENDENCIES = \
|
||||
|
@ -124,6 +145,8 @@ libevas_la_DEPENDENCIES = \
|
|||
$(ENGINE_BUFFER) \
|
||||
$(ENGINE_SOFTWARE_QTOPIA) \
|
||||
$(ENGINE_GL_COMMON) \
|
||||
$(ENGINE_GL_X11)
|
||||
$(ENGINE_GL_X11) \
|
||||
$(ENGINE_CAIRO_COMMON) \
|
||||
$(ENGINE_CAIRO_X11)
|
||||
|
||||
libevas_la_LDFLAGS = -version-info 1:0:0
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifdef BUILD_ENGINE_GL_X11
|
||||
#include "evas_engine_api_gl_x11.h"
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_CAIRO_X11
|
||||
#include "evas_engine_api_cairo_x11.h"
|
||||
#endif
|
||||
|
||||
#include "Evas.h"
|
||||
|
||||
|
@ -224,6 +227,11 @@ evas_output_method_set(Evas *e, int render_method)
|
|||
e->engine.func = &evas_engine_gl_x11_func;
|
||||
else
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_CAIRO_X11
|
||||
if (e->output.render_method == RENDER_METHOD_CAIRO_X11)
|
||||
e->engine.func = &evas_engine_cairo_x11_func;
|
||||
else
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_DIRECTFB
|
||||
if (e->output.render_method == RENDER_METHOD_DIRECTFB)
|
||||
e->engine.func = &evas_engine_directfb_func;
|
||||
|
@ -662,6 +670,9 @@ evas_render_method_lookup(const char *name)
|
|||
#ifdef BUILD_ENGINE_GL_X11
|
||||
if (!strcmp(name, "gl_x11")) return RENDER_METHOD_GL_X11;
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_CAIRO_X11
|
||||
if (!strcmp(name, "cairo_x11")) return RENDER_METHOD_CAIRO_X11;
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_DIRECTFB
|
||||
if (!strcmp(name, "directfb")) return RENDER_METHOD_DIRECTFB;
|
||||
#endif
|
||||
|
@ -726,6 +737,9 @@ evas_render_method_list(void)
|
|||
#ifdef BUILD_ENGINE_GL_X11
|
||||
methods = evas_list_append(methods, strdup("gl_x11"));
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_CAIRO_X11
|
||||
methods = evas_list_append(methods, strdup("cairo_x11"));
|
||||
#endif
|
||||
#ifdef BUILD_ENGINE_DIRECTFB
|
||||
methods = evas_list_append(methods, strdup("directfb"));
|
||||
#endif
|
||||
|
|
|
@ -9,4 +9,6 @@ software_win32_gdi \
|
|||
software_qtopia \
|
||||
directfb \
|
||||
gl_common \
|
||||
gl_x11
|
||||
gl_x11 \
|
||||
cairo_common \
|
||||
cairo_x11
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
## 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@ @CAIRO_CFLAGS@ \
|
||||
-I. \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/lib/include
|
||||
|
||||
if BUILD_ENGINE_CAIRO_COMMON
|
||||
|
||||
noinst_LTLIBRARIES = libevas_engine_cairo_common.la
|
||||
libevas_engine_cairo_common_la_SOURCES = \
|
||||
evas_cairo_private.h \
|
||||
evas_cairo_main.c
|
||||
|
||||
libevas_engine_cairo_common_la_LIBADD = \
|
||||
@CAIRO_LIBS@ $(LDFLAGS)
|
||||
|
||||
libevas_engine_cairo_common_la_DEPENDENCIES = \
|
||||
$(top_builddir)/config.h
|
||||
|
||||
endif
|
|
@ -35,4 +35,13 @@ $(top_builddir)/config.h
|
|||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
evas_gl_image.c
|
||||
evas_gl_private.h \
|
||||
evas_gl_context.c \
|
||||
evas_gl_font.c \
|
||||
evas_gl_gradient.c \
|
||||
evas_gl_image.c \
|
||||
evas_gl_line.c \
|
||||
evas_gl_misc.c \
|
||||
evas_gl_polygon.c \
|
||||
evas_gl_rectangle.c \
|
||||
evas_gl_texture.c
|
||||
|
|
|
@ -558,6 +558,9 @@ evas_engine_software_x11_rectangle_draw(void *data, void *context, void *surface
|
|||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
#ifdef IMGONLY
|
||||
return;
|
||||
#endif
|
||||
evas_common_rectangle_draw(surface, context, x, y, w, h);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
|
@ -568,6 +571,9 @@ evas_engine_software_x11_line_draw(void *data, void *context, void *surface, int
|
|||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
#ifdef IMGONLY
|
||||
return;
|
||||
#endif
|
||||
evas_common_line_draw(surface, context, x1, y1, x2, y2);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
|
@ -598,6 +604,9 @@ evas_engine_software_x11_polygon_draw(void *data, void *context, void *surface,
|
|||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
#ifdef IMGONLY
|
||||
return;
|
||||
#endif
|
||||
evas_common_polygon_draw(surface, context, polygon);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
|
@ -632,6 +641,9 @@ evas_engine_software_x11_gradient_draw(void *data, void *context, void *surface,
|
|||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
#ifdef IMGONLY
|
||||
return;
|
||||
#endif
|
||||
evas_common_gradient_draw(surface, context, x, y, w, h, gradient, angle);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
|
@ -1031,6 +1043,9 @@ evas_engine_software_x11_font_draw(void *data, void *context, void *surface, voi
|
|||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
#ifdef IMGONLY
|
||||
return;
|
||||
#endif
|
||||
if ((w == ow) && (h == oh))
|
||||
evas_common_font_draw(surface, context, font, x, y, text);
|
||||
else
|
||||
|
|
|
@ -8,7 +8,9 @@ evas_engine_api_fb.h \
|
|||
evas_engine_api_buffer.h \
|
||||
evas_engine_api_software_qtopia.h \
|
||||
evas_engine_api_gl_x11.h \
|
||||
evas_engine_api_cairo_x11.h \
|
||||
evas_gl_common.h \
|
||||
evas_cairo_common.h \
|
||||
evas_mmx.h \
|
||||
evas_options.h \
|
||||
evas_private.h
|
||||
|
|
|
@ -0,0 +1,129 @@
|
|||
#ifndef EVAS_CAIRO_COMMON_H
|
||||
#define EVAS_CAIRO_COMMON_H
|
||||
|
||||
#include "evas_common.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
typedef struct _Evas_Cairo_Context Evas_Cairo_Context;
|
||||
typedef struct _Evas_Cairo_Image Evas_Cairo_Image;
|
||||
typedef struct _Evas_Cairo_Polygon Evas_Cairo_Polygon;
|
||||
typedef struct _Evas_Cairo_Polygon_Point Evas_Cairo_Polygon_Point;
|
||||
typedef struct _Evas_Cairo_Gradient Evas_Cairo_Gradient;
|
||||
|
||||
struct _Evas_Cairo_Context
|
||||
{
|
||||
unsigned char r, g, b, a;
|
||||
|
||||
struct {
|
||||
char size : 1;
|
||||
char dither : 1;
|
||||
char blend : 1;
|
||||
char color : 1;
|
||||
char texture : 1;
|
||||
char clip : 1;
|
||||
char buf : 1;
|
||||
char other : 1;
|
||||
} change;
|
||||
|
||||
struct {
|
||||
char active : 1;
|
||||
int x, y, w, h;
|
||||
} clip;
|
||||
|
||||
struct {
|
||||
int checked : 1;
|
||||
int sgis_generate_mipmap : 1;
|
||||
int nv_texture_rectangle : 1;
|
||||
} ext;
|
||||
|
||||
int references;
|
||||
|
||||
Evas_List *images;
|
||||
};
|
||||
|
||||
struct _Evas_Cairo_Image
|
||||
{
|
||||
Evas_Cairo_Context *cc;
|
||||
RGBA_Image *im;
|
||||
cairo_surface_t *surf;
|
||||
DATA32 *mulpix;
|
||||
int references;
|
||||
char dirty : 1;
|
||||
char cached : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Cairo_Polygon
|
||||
{
|
||||
Evas_List *points;
|
||||
};
|
||||
|
||||
struct _Evas_Cairo_Polygon_Point
|
||||
{
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct _Evas_Cairo_Gradient
|
||||
{
|
||||
RGBA_Gradient *grad;
|
||||
};
|
||||
|
||||
/*
|
||||
Evas_GL_Context *evas_gl_common_context_new(void);
|
||||
void evas_gl_common_context_free(Evas_GL_Context *gc);
|
||||
void evas_gl_common_context_use(Evas_GL_Context *gc);
|
||||
void evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h);
|
||||
void evas_gl_common_context_color_set(Evas_GL_Context *gc, int r, int g, int b, int a);
|
||||
void evas_gl_common_context_blend_set(Evas_GL_Context *gc, int blend);
|
||||
void evas_gl_common_context_dither_set(Evas_GL_Context *gc, int dither);
|
||||
void evas_gl_common_context_texture_set(Evas_GL_Context *gc, Evas_GL_Texture *tex, int smooth, int w, int h);
|
||||
void evas_gl_common_context_font_texture_set(Evas_GL_Context *gc, Evas_GL_Font_Texture *ft);
|
||||
void evas_gl_common_context_clip_set(Evas_GL_Context *gc, int on, int x, int y, int w, int h);
|
||||
void evas_gl_common_context_read_buf_set(Evas_GL_Context *gc, GLenum buf);
|
||||
void evas_gl_common_context_write_buf_set(Evas_GL_Context *gc, GLenum buf);
|
||||
|
||||
Evas_GL_Texture *evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im, int smooth);
|
||||
void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
|
||||
void evas_gl_common_texture_free(Evas_GL_Texture *tex);
|
||||
void evas_gl_common_texture_mipmaps_build(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
|
||||
|
||||
Evas_GL_Image *evas_gl_common_image_load(Evas_GL_Context *gc, char *file, char *key);
|
||||
Evas_GL_Image *evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, int *data);
|
||||
Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, int w, int h, int *data);
|
||||
Evas_GL_Image *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h);
|
||||
void evas_gl_common_image_free(Evas_GL_Image *im);
|
||||
void evas_gl_common_image_dirty(Evas_GL_Image *im);
|
||||
|
||||
Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
|
||||
Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
|
||||
|
||||
Evas_GL_Gradient *evas_gl_common_gradient_color_add(Evas_GL_Gradient *gr, int r, int g, int b, int a, int distance);
|
||||
Evas_GL_Gradient *evas_gl_common_gradient_colors_clear(Evas_GL_Gradient *gr);
|
||||
|
||||
void evas_gl_common_swap_rect(Evas_GL_Context *gc, int x, int y, int w, int h);
|
||||
|
||||
void evas_gl_common_rect_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||
void evas_gl_common_image_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
|
||||
void evas_gl_common_line_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
|
||||
void evas_gl_common_poly_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Polygon *poly);
|
||||
void evas_gl_common_gradient_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Gradient *gr, int x, int y, int w, int h, double angle);
|
||||
|
||||
Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg);
|
||||
void evas_gl_font_texture_free(Evas_GL_Font_Texture *ft);
|
||||
void evas_gl_font_texture_draw(Evas_GL_Context *gc, void *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef EVAS_ENGINE_CAIRO_X11_H
|
||||
#define EVAS_ENGINE_CAIRO_X11_H
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
extern Evas_Func evas_engine_cairo_x11_func;
|
||||
|
||||
#endif
|
|
@ -14,6 +14,7 @@
|
|||
#define RENDER_METHOD_SOFTWARE_WIN32_GDI 0x00000005
|
||||
#define RENDER_METHOD_SOFTWARE_QTOPIA 0x00000006
|
||||
#define RENDER_METHOD_GL_X11 0x00000007
|
||||
#define RENDER_METHOD_CAIRO_X11 0x00000008
|
||||
|
||||
#define RENDER_METHOD_INVALID 0x00000000
|
||||
|
||||
|
|
Loading…
Reference in New Issue