add expedite to cvs! finally! :) it's in decent shape.

SVN revision: 29466
This commit is contained in:
Carsten Haitzler 2007-04-11 11:58:32 +00:00
commit 502d62417d
90 changed files with 5606 additions and 0 deletions

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
The Rasterman (Carsten Haitzler) <raster@rasterman.com>

28
COPYING Normal file
View File

@ -0,0 +1,28 @@
Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies of the Software and its Copyright notices. In addition publicly
documented acknowledgment must be given that this software has been used if no
source code of this software is made available publicly. This includes
acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
documents or any documentation provided with any product containing this
software. This License does not apply to any software that links to the
libraries provided by this software (statically or dynamically), but only to
the software provided.
Please see the COPYING.PLAIN for a plain-english explanation of this notice
and it's intent.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

33
COPYING-PLAIN Normal file
View File

@ -0,0 +1,33 @@
Plain English Copyright Notice
This file is not intended to be the actual License. The reason this file
exists is that we here are programmers and engineers. We aren't lawyers. We
provide licenses that we THINK say the right things, but we have our own
intentions at heart. This is a plain-english explanation of what those
intentions are, and if you follow them you will be within the "spirit" of
the license.
The intent is for us to enjoy writing software that is useful to us (the
AUTHORS) and allow others to use it freely and also benefit from the work we
put into making it. We don't want to restrict others using it. They should
not *HAVE* to make the source code of the applications they write that
simply link to these libraries (be that statically or dynamically), or for
them to be limited as to what license they choose to use (be it open, closed
or anything else). But we would like to know you are using these libraries.
We simply would like to know that it has been useful to someone. This is why
we ask for acknowledgement of some sort.
You can do what you want with the source of this software - it doesn't
matter. We still have it here for ourselves and it is open and free to use
and download and play with. It can't be taken away. We don't really mind what
you do with the source to your software. We would simply like to know that
you are using it - especially if it makes it to a commerical product. If you
simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and
then make sure you include a paragraph or page in the manual for the product
with the copyright notice and state that you used this software, we will be
very happy. If you want to contribute back modifications and fixes you may have
made we will welcome those too with open arms (generally). If you want help
with changes needed, ports needed or features to be added, arrangements can
be easily made with some dialogue.
Carsten Haitzler <raster@rasterman.com>

0
ChangeLog Normal file
View File

14
INSTALL Normal file
View File

@ -0,0 +1,14 @@
COMPILING and INSTALLING:
If you got a official release tar archive do:
./configure
( otherwise if you got this from enlightenment cvs do: ./autogen.sh )
Then to compile:
make
To install (run this as root, or the user who handles installs):
make install
NOTE: You MUST make install Expedite for it to run properly.

8
Makefile.am Normal file
View File

@ -0,0 +1,8 @@
SUBDIRS = src data
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in acconfig.h
EXTRA_DIST = README AUTHORS COPYING COPYING-PLAIN expedite.spec

0
NEWS Normal file
View File

3
README Normal file
View File

@ -0,0 +1,3 @@
Eexpedite 0.6.0
This is meant to be a detailed and comprehensive benchmark suite for Evas.

16
autogen.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
touch README
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

80
configure.in Normal file
View File

@ -0,0 +1,80 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(expedite, 0.6.0)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
PACKAGE_BIN_DIR="${ac_default_prefix}/bin"
else
PACKAGE_BIN_DIR="${prefix}/bin"
fi
else
PACKAGE_BIN_DIR="${bindir}"
fi
AC_SUBST(PACKAGE_BIN_DIR)
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
PACKAGE_LIB_DIR="${ac_default_prefix}/lib"
else
PACKAGE_LIB_DIR="${prefix}/lib"
fi
else
PACKAGE_LIB_DIR="${libdir}"
fi
AC_SUBST(PACKAGE_LIB_DIR)
if test "x${prefix}" = "xNONE"; then
PACKAGE_DATA_DIR="${ac_default_prefix}/share/${PACKAGE}"
else
PACKAGE_DATA_DIR="${prefix}/share/${PACKAGE}"
fi
AC_SUBST(PACKAGE_DATA_DIR)
PKG_CHECK_MODULES([EVAS], evas)
PCFLAGS=$CFLAGS
CFLAGS="$EVAS_CFLAGS $CFLAGS"
AC_CHECK_HEADER(Evas_Engine_GL_X11.h,
[ AC_DEFINE(HAVE_EVAS_GL, 1, [Evas GL Engine Support]) ],
[ dummy=no ],
[ #include <Evas.h> ]
)
AC_CHECK_HEADER(Evas_Engine_Software_X11.h,
[ AC_DEFINE(HAVE_SOFTWARE_X11, 1, [Evas Software X11 Engine Support]) ],
[ dummy=no ],
[ #include <Evas.h> ]
)
AC_CHECK_HEADER(Evas_Engine_XRender_X11.h,
[ AC_DEFINE(HAVE_XRENDER_X11, 1, [Evas XRender X11 Engine Support]) ],
[ dummy=no ],
[ #include <Evas.h> ]
)
CFLAGS=$PCFLAGS
AC_PATH_XTRA
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
AC_SUBST(x_cflags)
AC_SUBST(x_libs)
AC_OUTPUT([
Makefile
src/Makefile
src/bin/Makefile
data/Makefile
])

BIN
data/Kochi.ttf Normal file

Binary file not shown.

45
data/Makefile.am Normal file
View File

@ -0,0 +1,45 @@
MAINTAINERCLEANFILES = Makefile.in
filesdir = $(datadir)/expedite/data
files_DATA = \
Kochi.ttf \
Vera.ttf \
VeraBI.ttf \
VeraBd.ttf \
VeraIt.ttf \
VeraMoBI.ttf \
VeraMoBd.ttf \
VeraMoIt.ttf \
VeraMono.ttf \
VeraSe.ttf \
VeraSeBd.ttf \
fonts.alias \
fonts.dir \
bg.png \
logo.png \
e.png \
image.png \
bar.png \
frame.png \
pan.png \
tp.png \
tp.yuv \
icon_sel.png \
icon_sel2.png \
text_sel.png \
exit.png \
watch.png \
bug.png \
bulb.png \
camera.png \
colorbox.png \
error.png \
flower.png \
house.png \
mushroom.png \
pulse.png \
typewriter.png \
warning.png \
im1.png \
im2.png
EXTRA_DIST = $(files_DATA)

BIN
data/Vera.ttf Normal file

Binary file not shown.

BIN
data/VeraBI.ttf Normal file

Binary file not shown.

BIN
data/VeraBd.ttf Normal file

Binary file not shown.

BIN
data/VeraIt.ttf Normal file

Binary file not shown.

BIN
data/VeraMoBI.ttf Normal file

Binary file not shown.

BIN
data/VeraMoBd.ttf Normal file

Binary file not shown.

BIN
data/VeraMoIt.ttf Normal file

Binary file not shown.

BIN
data/VeraMono.ttf Normal file

Binary file not shown.

BIN
data/VeraSe.ttf Normal file

Binary file not shown.

BIN
data/VeraSeBd.ttf Normal file

Binary file not shown.

BIN
data/bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
data/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
data/bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

BIN
data/bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
data/bulb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
data/camera.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
data/colorbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
data/e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
data/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
data/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
data/flower.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
data/frame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

BIN
data/house.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
data/icon_sel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
data/icon_sel2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
data/im1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 KiB

BIN
data/im2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

BIN
data/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
data/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
data/mushroom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
data/pan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
data/pulse.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
data/text_sel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
data/tp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
data/typewriter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
data/warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
data/watch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

21
expedite.oe Normal file
View File

@ -0,0 +1,21 @@
DESCRIPTION = "Expedite Evas benchmark/test suite"
HOMEPAGE = "http://www.enlightenment.org"
MAINTAINER = "Carsten Haitzler (Rasterman) <raster@rasterman.com>"
SECTION = "e/test"
PRIORITY = "optional"
DEPENDS = "evas"
PV = "0.6.0"
PR = "1"
do_prepsources () {
make clean distclean || true
}
addtask prepsources after do_fetch before do_unpack
SRC_URI = "file://./"
S = "${WORKDIR}/expedite"
inherit autotools pkgconfig binconfig
EXTRA_OECONF = ""
FILES_${PN} = "${bindir}/* ${datadir}"

60
expedite.spec Normal file
View File

@ -0,0 +1,60 @@
# Note that this is NOT a relocatable package
%define ver 0.6.0
%define rel 1
%define prefix /usr
Summary: expedite
Name: expedite
Version: %ver
Release: %rel
Copyright: BSD
Group: System Environment/Desktops
Source: ftp://ftp.enlightenment.org/pub/enlightenment/expedite-%{ver}.tar.gz
BuildRoot: /var/tmp/expedite-root
Packager: The Rasterman <raster@rasterman.com>
URL: http://www.enlightenment.org/
BuildRequires: evas-devel
Requires: evas
%description
Expedite Evas benchmark/test suite
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q
%build
./configure --prefix=%prefix
if [ "$SMP" != "" ]; then
(make "MAKE=make -k -j $SMP"; exit 0)
make
else
make
fi
###########################################################################
%install
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%post
%postun
%files
%defattr(-,root,root)
%attr(755,root,root) %{prefix}/bin/*
%attr(755,root,root) %{prefix}/share/expedite
%doc AUTHORS
%doc COPYING
%doc COPYING-PLAIN
%doc README
%changelog
* Sat Jun 23 2001 The Rasterman <raster@rasterman.com>
- Created spec file

2
src/Makefile.am Normal file
View File

@ -0,0 +1,2 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = bin

45
src/bin/Makefile.am Normal file
View File

@ -0,0 +1,45 @@
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(includedir) \
-I$(top_srcdir) \
-I$(top_srcdir)/src/bin \
@EVAS_CFLAGS@ @x_cflags@ \
-DPACKAGE_BIN_DIR=\"@PACKAGE_BIN_DIR@\" \
-DPACKAGE_LIB_DIR=\"@PACKAGE_LIB_DIR@\" \
-DPACKAGE_DATA_DIR=\"@PACKAGE_DATA_DIR@\"
bin_PROGRAMS = expedite
expedite_SOURCES = \
main.c main.h \
engine_software_x11.c engine_software_x11.h \
engine_gl_x11.c engine_gl_x11.h \
engine_xrender_x11.c engine_xrender_x11.h \
ui.c ui.h \
about.c about.h \
tests.h \
image_blend_unscaled.c \
image_blend_solid_unscaled.c \
image_blend_nearest_scaled.c \
image_blend_nearest_solid_scaled.c \
image_blend_smooth_scaled.c \
image_blend_smooth_solid_scaled.c \
image_blend_border.c \
image_blend_solid_border.c \
image_blend_border_recolor.c \
image_quality_scale.c \
image_data_argb.c \
image_data_argb_alpha.c \
image_data_ycbcr601pl.c \
image_crossfade.c \
text_basic.c \
text_styles.c \
text_styles_different_strings.c \
text_change.c \
textblock_basic.c \
textblock_intl.c \
rect_blend.c \
rect_solid.c \
rect_blend_few.c \
rect_solid_few.c
expedite_LDFLAGS = @EVAS_LIBS@ @x_libs@ -lm

78
src/bin/about.c Normal file
View File

@ -0,0 +1,78 @@
#include "main.h"
static Evas_Object *o_text = NULL;
static void
_setup(void)
{
Evas_Object *o;
Evas_Textblock_Style *st;
o = evas_object_textblock_add(evas);
evas_object_move(o, 10, 40);
evas_object_resize(o, win_w - 20, win_h - 50);
evas_object_show(o);
st = evas_textblock_style_new();
evas_textblock_style_set
(st,
"DEFAULT='font=Vera font_size=8 align=left color=#000 wrap=word'"
"center='+ font=Vera font_size=10 align=center'"
"/center='- \n \n'"
"p='+ font=Vera font_size=10 align=left'"
"/p='- \n \n'"
);
evas_object_textblock_style_set(o, st);
evas_textblock_style_free(st);
evas_object_textblock_clear(o);
evas_object_textblock_text_markup_set
(o,
"<center>"
"Enlightenment used to be a window manager project, but "
"since has changed a lot to become a miniature desktop and mobile "
"device environment all of its own. It is now made up of many "
"components (libraries and applications) that have specific uses. "
"It is very large, and so requires more testing and demonstration."
"</center>"
"<center>"
"Expedite is a full test suite for Evas, which is one of the "
"core components of the Enlightenment Foundation Libraries. Evas "
"handles the realtime display canvas used by EFL applications to "
"render to many targets, including framebuffer, X11, OpenGL, memory, "
"DirectFB and other targets to boot. It handles high level graphic "
"layout descriptions that applications set up, dealing with the hard "
"work of doing the drawing for them."
"</center>"
);
o_text = o;
ui_fps(0.0);
}
static void
_cleanup(void)
{
evas_object_del(o_text);
o_text = NULL;
}
static void
_loop(void)
{
}
static void
_key(char *key)
{
if ((!strcmp(key, "Escape")) || (!strcmp(key, "q")) || (!strcmp(key, "Q")))
{
_cleanup();
ui_menu();
}
}
void
about_start(void)
{
ui_func_set(_key, _loop);
_setup();
}

6
src/bin/about.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef ABOUT_H
#define ABOUT_H
void about_start(void);
#endif

206
src/bin/engine_gl_x11.c Normal file
View File

@ -0,0 +1,206 @@
#include "main.h"
#ifndef HAVE_EVAS_GL
int
engine_gl_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No GL X11 Engine built\n");
return 0;
}
void
engine_gl_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_GL_X11.h>
static Display *disp = NULL;
static Window win = 0;
int
engine_gl_x11_args(int argc, char **argv)
{
XSetWindowAttributes attr;
XClassHint chint;
XSizeHints szhints;
Evas_Engine_Info_GL_X11 *einfo;
int i;
int ok = 0;
for (i = 1; i < argc; i++)
{
if ((!strcmp(argv[i], "-e")) && (i < (argc - 1)))
{
i++;
if (!strcmp(argv[i], "gl")) ok = 1;
}
}
if (!ok) return 0;
disp = XOpenDisplay(NULL);
if (!disp) return 0;
evas_output_method_set(evas, evas_render_method_lookup("gl_x11"));
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the Software X11 Engine\n");
return 0;
}
einfo->info.display = disp;
einfo->info.visual = einfo->func.best_visual_get(disp, DefaultScreen(disp));
einfo->info.colormap = einfo->func.best_colormap_get(disp, DefaultScreen(disp));
einfo->info.depth = einfo->func.best_depth_get(disp, DefaultScreen(disp));
attr.backing_store = NotUseful;
attr.colormap = einfo->info.colormap;
attr.border_pixel = 0;
attr.background_pixmap = None;
attr.event_mask =
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
KeyPressMask | KeyReleaseMask;
attr.bit_gravity = ForgetGravity;
win = XCreateWindow(disp, DefaultRootWindow(disp),
0, 0, win_w, win_h, 0,
einfo->info.depth, InputOutput,
einfo->info.visual,
CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";
chint.res_class = "Expedite";
XSetClassHint(disp, win, &chint);
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);
XMapWindow(disp, win);
XSync(disp, False);
return 1;
}
void
engine_gl_x11_loop(void)
{
XEvent ev;
KeySym ks;
char *kstr;
again:
if (!XCheckMaskEvent(disp,
ExposureMask |
StructureNotifyMask |
KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
EnterWindowMask |
LeaveWindowMask, &ev))
return;
switch (ev.type)
{
case ButtonPress:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case ButtonRelease:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case MotionNotify:
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
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;
case EnterNotify:
evas_event_feed_mouse_in(evas, 0, NULL);
break;
case LeaveNotify:
evas_event_feed_mouse_out(evas, 0, NULL);
break;
case KeyPress:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_on(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_on(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_on(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_on(evas, "Super");
if (!strcmp(kstr, "Caps_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (!strcmp(kstr, "Num_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (!strcmp(kstr, "Scroll_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
case KeyRelease:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_off(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_off(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_off(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_off(evas, "Super");
evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
default:
break;
}
goto again;
}
#endif

7
src/bin/engine_gl_x11.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef ENGINE_GL_X11_H
#define ENGINE_GL_X11_H
int engine_gl_x11_args(int argc, char **argv);
void engine_gl_x11_loop(void);
#endif

View File

@ -0,0 +1,208 @@
#include "main.h"
#ifndef HAVE_SOFTWARE_X11
int
engine_software_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No Software X11 Engine built\n");
return 0;
}
void
engine_software_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_Software_X11.h>
static Display *disp = NULL;
static Window win = 0;
int
engine_software_x11_args(int argc, char **argv)
{
XSetWindowAttributes attr;
XClassHint chint;
XSizeHints szhints;
Evas_Engine_Info_Software_X11 *einfo;
int i;
int ok = 0;
for (i = 1; i < argc; i++)
{
if ((!strcmp(argv[i], "-e")) && (i < (argc - 1)))
{
i++;
if (!strcmp(argv[i], "x11")) ok = 1;
}
}
if (!ok) return 0;
disp = XOpenDisplay(NULL);
if (!disp) return 0;
evas_output_method_set(evas, evas_render_method_lookup("software_x11"));
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the Software X11 Engine\n");
return 0;
}
einfo->info.display = disp;
einfo->info.visual = einfo->func.best_visual_get(disp, DefaultScreen(disp));
einfo->info.colormap = einfo->func.best_colormap_get(disp, DefaultScreen(disp));
einfo->info.depth = einfo->func.best_depth_get(disp, DefaultScreen(disp));
einfo->info.rotation = 0;
einfo->info.debug = 0;
attr.backing_store = NotUseful;
attr.colormap = einfo->info.colormap;
attr.border_pixel = 0;
attr.background_pixmap = None;
attr.event_mask =
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
KeyPressMask | KeyReleaseMask;
attr.bit_gravity = ForgetGravity;
win = XCreateWindow(disp, DefaultRootWindow(disp),
0, 0, win_w, win_h, 0,
einfo->info.depth, InputOutput,
einfo->info.visual,
CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";
chint.res_class = "Expedite";
XSetClassHint(disp, win, &chint);
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);
XMapWindow(disp, win);
XSync(disp, False);
return 1;
}
void
engine_software_x11_loop(void)
{
XEvent ev;
KeySym ks;
char *kstr;
again:
if (!XCheckMaskEvent(disp,
ExposureMask |
StructureNotifyMask |
KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
EnterWindowMask |
LeaveWindowMask, &ev))
return;
switch (ev.type)
{
case ButtonPress:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case ButtonRelease:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case MotionNotify:
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
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;
case EnterNotify:
evas_event_feed_mouse_in(evas, 0, NULL);
break;
case LeaveNotify:
evas_event_feed_mouse_out(evas, 0, NULL);
break;
case KeyPress:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_on(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_on(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_on(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_on(evas, "Super");
if (!strcmp(kstr, "Caps_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (!strcmp(kstr, "Num_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (!strcmp(kstr, "Scroll_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
case KeyRelease:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_off(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_off(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_off(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_off(evas, "Super");
evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
default:
break;
}
goto again;
}
#endif

View File

@ -0,0 +1,7 @@
#ifndef ENGINE_SOFTWARE_X11_H
#define ENGINE_SOFTWARE_X11_H
int engine_software_x11_args(int argc, char **argv);
void engine_software_x11_loop(void);
#endif

View File

@ -0,0 +1,203 @@
#include "main.h"
#ifndef HAVE_XRENDER_X11
int
engine_xrender_x11_args(int argc, char **argv)
{
fprintf(stderr, "ERROR: No XRender X11 Engine built\n");
return 0;
}
void
engine_xrender_x11_loop(void)
{
}
#else
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <Evas_Engine_XRender_X11.h>
static Display *disp = NULL;
static Window win = 0;
int
engine_xrender_x11_args(int argc, char **argv)
{
XSetWindowAttributes attr;
XClassHint chint;
XSizeHints szhints;
Evas_Engine_Info_XRender_X11 *einfo;
int i;
int ok = 0;
for (i = 1; i < argc; i++)
{
if ((!strcmp(argv[i], "-e")) && (i < (argc - 1)))
{
i++;
if (!strcmp(argv[i], "xr")) ok = 1;
}
}
if (!ok) return 0;
disp = XOpenDisplay(NULL);
if (!disp) return 0;
evas_output_method_set(evas, evas_render_method_lookup("xrender_x11"));
einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(evas);
if (!einfo)
{
printf("Evas does not support the XRender X11 Engine\n");
return 0;
}
einfo->info.display = disp;
einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
attr.backing_store = NotUseful;
attr.border_pixel = 0;
attr.background_pixmap = None;
attr.event_mask =
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
StructureNotifyMask | EnterWindowMask | LeaveWindowMask |
KeyPressMask | KeyReleaseMask;
attr.bit_gravity = ForgetGravity;
win = XCreateWindow(disp, DefaultRootWindow(disp),
0, 0, win_w, win_h, 0,
0, InputOutput,
einfo->info.visual,
CWBackingStore |
CWBackPixmap | CWBorderPixel |
CWBitGravity | CWEventMask,
&attr);
einfo->info.drawable = win;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
XStoreName(disp, win, "Expedite - Evas Test Suite");
chint.res_name = "expedite";
chint.res_class = "Expedite";
XSetClassHint(disp, win, &chint);
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);
XMapWindow(disp, win);
XSync(disp, False);
return 1;
}
void
engine_xrender_x11_loop(void)
{
XEvent ev;
KeySym ks;
char *kstr;
again:
if (!XCheckMaskEvent(disp,
ExposureMask |
StructureNotifyMask |
KeyPressMask |
KeyReleaseMask |
ButtonPressMask |
ButtonReleaseMask |
PointerMotionMask |
EnterWindowMask |
LeaveWindowMask, &ev))
return;
switch (ev.type)
{
case ButtonPress:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case ButtonRelease:
evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL);
evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL);
break;
case MotionNotify:
evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL);
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;
case EnterNotify:
evas_event_feed_mouse_in(evas, 0, NULL);
break;
case LeaveNotify:
evas_event_feed_mouse_out(evas, 0, NULL);
break;
case KeyPress:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_on(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_on(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_on(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_on(evas, "Super");
if (!strcmp(kstr, "Caps_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock"))
evas_key_lock_off(evas, "Caps_Lock");
else
evas_key_lock_on(evas, "Caps_Lock");
}
if (!strcmp(kstr, "Num_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock"))
evas_key_lock_off(evas, "Num_Lock");
else
evas_key_lock_on(evas, "Num_Lock");
}
if (!strcmp(kstr, "Scroll_Lock"))
{
if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock"))
evas_key_lock_off(evas, "Scroll_Lock");
else
evas_key_lock_on(evas, "Scroll_Lock");
}
if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
case KeyRelease:
ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0);
kstr = XKeysymToString(ks);
if (kstr)
{
if ((!strcmp(kstr, "Shift_L")) ||
(!strcmp(kstr, "Shift_R")))
evas_key_modifier_off(evas, "Shift");
if ((!strcmp(kstr, "Control_L")) ||
(!strcmp(kstr, "Control_R")))
evas_key_modifier_off(evas, "Control");
if ((!strcmp(kstr, "Alt_L")) ||
(!strcmp(kstr, "Alt_R")))
evas_key_modifier_off(evas, "Alt");
if ((!strcmp(kstr, "Super_L")) ||
(!strcmp(kstr, "Super_R")))
evas_key_modifier_off(evas, "Super");
evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL);
}
break;
default:
break;
}
goto again;
}
#endif

View File

@ -0,0 +1,7 @@
#ifndef ENGINE_XRENDER_X11_H
#define ENGINE_XRENDER_X11_H
int engine_xrender_x11_args(int argc, char **argv);
void engine_xrender_x11_loop(void);
#endif

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_border_start
#define NAME "Image Blend Border"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/bar.png", NULL);
evas_object_image_border_set(o, 8, 8, 8, 8);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,105 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_border_recolor_start
#define NAME "Image Blend Border Recolor"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/pan.png", NULL);
evas_object_color_set(o, 64, 64, 64, 255);
evas_object_image_border_set(o, 3, 3, 3, 3);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_nearest_scaled_start
#define NAME "Image Blend Nearest Scaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_smooth_scale_set(o, 0);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_nearest_solid_scaled_start
#define NAME "Image Blend Nearest Solid Scaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_smooth_scale_set(o, 0);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_smooth_scaled_start
#define NAME "Image Blend Smooth Scaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_smooth_scale_set(o, 1);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_smooth_solid_scaled_start
#define NAME "Image Blend Smooth Solid Scaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_smooth_scale_set(o, 1);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_solid_border_start
#define NAME "Image Blend Solid Border"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/frame.png", NULL);
evas_object_image_border_set(o, 8, 8, 8, 8);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW))) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW))) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,101 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_solid_unscaled_start
#define NAME "Image Blend Solid Unscaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < OBNUM; i++)
{
w = 120;
h = 160;
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
evas_object_move(o_images[i], x, y);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,101 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_blend_unscaled_start
#define NAME "Image Blend Unscaled"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < OBNUM; i++)
{
w = 120;
h = 160;
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
evas_object_move(o_images[i], x, y);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

101
src/bin/image_crossfade.c Normal file
View File

@ -0,0 +1,101 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_crossfade_start
#define NAME "Image Crossfade"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[2];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
o = evas_object_image_add(evas);
o_images[0] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/im1.png", NULL);
evas_object_image_fill_set(o, 0, 0, 720, 420);
evas_object_resize(o, 720, 420);
evas_object_show(o);
o = evas_object_image_add(evas);
o_images[1] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/im2.png", NULL);
evas_object_image_fill_set(o, 0, 0, 720, 420);
evas_object_resize(o, 720, 420);
evas_object_show(o);
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < 2; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int a;
a = f & 0x1f;
a = ((a << 3) | (a >> 2)) & 0xff;
evas_object_color_set(o_images[1], a, a, a, a);
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

118
src/bin/image_data_argb.c Normal file
View File

@ -0,0 +1,118 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_data_argb_start
#define NAME "Image Data ARGB"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[1];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < 1; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_size_set(o, 640, 480);
evas_object_image_alpha_set(o, 0);
evas_object_image_fill_set(o, 0, 0, 640, 480);
evas_object_resize(o, 640, 480);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < 1; i++)
{
unsigned int *data, *p;
int ff;
w = 640;
h = 480;
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
data = evas_object_image_data_get(o_images[i], 1);
p = data;
ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24));
for (y = 0; y < 480; y++)
{
for (x = 0; x < 640; x++)
{
*p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000;
p++;
}
}
evas_object_image_data_set(o_images[i], data);
evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,129 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_data_argb_alpha_start
#define NAME "Image Data ARGB Alpha"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[1];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < 1; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_size_set(o, 640, 480);
evas_object_image_alpha_set(o, 1);
evas_object_image_fill_set(o, 0, 0, 640, 480);
evas_object_resize(o, 640, 480);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < 1; i++)
{
unsigned int *data, *p;
int ff, a, r, g, b;
w = 640;
h = 480;
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
data = evas_object_image_data_get(o_images[i], 1);
p = data;
ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24));
for (y = 0; y < 480; y++)
{
for (x = 0; x < 640; x++)
{
r = (x * y / 7) + f;
g = (x / 2);
b = (y / 2);
a = (x + y);
r &= 0xff;
g &= 0xff;
b &= 0xff;
a &= 0xff;
r = (a * r) / 255;
g = (a * g) / 255;
b = (a * b) / 255;
*p = (a << 24) | (r << 16) | (g << 8) | b;
p++;
}
}
evas_object_image_data_set(o_images[i], data);
evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,140 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_data_ycbcr601pl_start
#define NAME "Image Data YCbCr 601 Pointer List"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[1];
static unsigned char *yp = NULL, *up = NULL, *vp = NULL;
/* setup */
static void _setup(void)
{
int i, y;
FILE *f;
unsigned char **data, **lp, *p;
Evas_Object *o;
for (i = 0; i < 1; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL);
evas_object_image_size_set(o, 640, 480);
evas_object_image_alpha_set(o, 0);
evas_object_image_fill_set(o, 0, 0, 640, 480);
evas_object_resize(o, 640, 480);
evas_object_show(o);
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
f = fopen(PACKAGE_DATA_DIR"/data/tp.yuv", "rb");
if (f)
{
fread(yp, 640 * 480, 1, f);
fread(up, 320 * 240, 1, f);
fread(vp, 320 * 240, 1, f);
fclose(f);
}
data = evas_object_image_data_get(o_images[i], 1);
lp = data;
for (y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
evas_object_image_data_set(o_images[i], data);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
free(yp);
free(up);
free(vp);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < 1; i++)
{
w = 640;
h = 480;
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,104 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME image_quality_scale_start
#define NAME "Image Quality Scale"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[1];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < 1; i++)
{
o = evas_object_image_add(evas);
o_images[i] = o;
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/tp.png", NULL);
evas_object_image_fill_set(o, 0, 0, 640, 480);
evas_object_resize(o, 640, 480);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < 1; i++)
{
w = 640;
h = 480;
w *= (f / 100.0) * 4.0;
h *= (f / 100.0) * 4.0;
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
evas_object_image_fill_set(o_images[i], 0, 0, w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

1147
src/bin/main.c Normal file

File diff suppressed because it is too large Load Diff

49
src/bin/main.h Normal file
View File

@ -0,0 +1,49 @@
#ifndef MAIN_H
#define MAIN_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/time.h>
#include <time.h>
#include <Evas.h>
#include "config.h"
#include "engine_software_x11.h"
#include "engine_gl_x11.h"
#include "engine_xrender_x11.h"
#include "ui.h"
#include "about.h"
#define OBNUM 128
extern Evas *evas;
extern int win_w, win_h;
void srnd(void);
unsigned int rnd(void);
double get_time(void);
void engine_loop(void);
int engine_abort(void);
#define KEY_STD \
if ((!strcmp(key, "Escape")) || (!strcmp(key, "q")) || (!strcmp(key, "Q")) || (!strcmp(key, "Return"))) \
{ \
_cleanup(); \
ui_menu(); \
}
#define FPS_STD(x) \
if ((f >= 32) && (!done)) \
{ \
double fps; \
fps = (double)f / t; \
ui_fps(fps); \
printf("%4.2f , %s\n", fps, x); \
done = 1; \
}
#define SLOW 5.0
#endif

109
src/bin/rect_blend.c Normal file
View File

@ -0,0 +1,109 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME rect_blend_start
#define NAME "Rect Blend"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
srnd();
for (i = 0; i < OBNUM; i++)
{
int r, g, b, a;
o = evas_object_rectangle_add(evas);
o_images[i] = o;
a = rnd()&0xff;
r = ((rnd()&0xff) * a) / 255;
g = ((rnd()&0xff) * a) / 255;
b = ((rnd()&0xff) * a) / 255;
evas_object_color_set(o, r, g, b, a);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

112
src/bin/rect_blend_few.c Normal file
View File

@ -0,0 +1,112 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME rect_blend_few_start
#define NAME "Rect Blend Few"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
#undef OBNUM
#define OBNUM 3
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
srnd();
for (i = 0; i < OBNUM; i++)
{
int r, g, b, a;
o = evas_object_rectangle_add(evas);
o_images[i] = o;
a = rnd()&0xff;
r = ((rnd()&0xff) * a) / 255;
g = ((rnd()&0xff) * a) / 255;
b = ((rnd()&0xff) * a) / 255;
evas_object_color_set(o, r, g, b, a);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

109
src/bin/rect_solid.c Normal file
View File

@ -0,0 +1,109 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME rect_solid_start
#define NAME "Rect Solid"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
srnd();
for (i = 0; i < OBNUM; i++)
{
int r, g, b, a;
o = evas_object_rectangle_add(evas);
o_images[i] = o;
a = 0xff;
r = ((rnd()&0xff) * a) / 255;
g = ((rnd()&0xff) * a) / 255;
b = ((rnd()&0xff) * a) / 255;
evas_object_color_set(o, r, g, b, a);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

112
src/bin/rect_solid_few.c Normal file
View File

@ -0,0 +1,112 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME rect_solid_few_start
#define NAME "Rect Solid Few"
#define ICON "flower.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
#undef OBNUM
#define OBNUM 3
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
srnd();
for (i = 0; i < OBNUM; i++)
{
int r, g, b, a;
o = evas_object_rectangle_add(evas);
o_images[i] = o;
a = 0xff;
r = ((rnd()&0xff) * a) / 255;
g = ((rnd()&0xff) * a) / 255;
b = ((rnd()&0xff) * a) / 255;
evas_object_color_set(o, r, g, b, a);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h, w0, h0;
for (i = 0; i < OBNUM; i++)
{
w0 = 80;
h0 = 80;
w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2);
evas_object_move(o_images[i], x, y);
evas_object_resize(o_images[i], w, h);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

24
src/bin/tests.h Normal file
View File

@ -0,0 +1,24 @@
#include "image_blend_unscaled.c"
#include "image_blend_solid_unscaled.c"
#include "image_blend_nearest_scaled.c"
#include "image_blend_nearest_solid_scaled.c"
#include "image_blend_smooth_scaled.c"
#include "image_blend_smooth_solid_scaled.c"
#include "image_blend_border.c"
#include "image_blend_solid_border.c"
#include "image_blend_border_recolor.c"
#include "image_quality_scale.c"
#include "image_data_argb.c"
#include "image_data_argb_alpha.c"
#include "image_data_ycbcr601pl.c"
#include "image_crossfade.c"
#include "text_basic.c"
#include "text_styles.c"
#include "text_styles_different_strings.c"
#include "text_change.c"
#include "textblock_basic.c"
#include "textblock_intl.c"
#include "rect_blend.c"
#include "rect_solid.c"
#include "rect_blend_few.c"
#include "rect_solid_few.c"

102
src/bin/text_basic.c Normal file
View File

@ -0,0 +1,102 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME text_basic_start
#define NAME "Text Basic"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_texts[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_text_add(evas);
o_texts[i] = o;
evas_object_text_font_set(o, "Vera-Bold", 20);
evas_object_text_text_set(o, "This is a test string");
evas_object_color_set(o, 0, 0, 0, 255);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < OBNUM; i++)
{
evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
evas_object_move(o_texts[i], x, y);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

126
src/bin/text_change.c Normal file
View File

@ -0,0 +1,126 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME text_change_start
#define NAME "Text Change"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_texts[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
Evas_Coord x, y, w, h;
char buf[1024];
const char *strs[] = {
"Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
};
srnd();
for (i = 0; i < OBNUM; i++)
{
o = evas_object_text_add(evas);
o_texts[i] = o;
evas_object_text_font_set(o, "Vera-Bold", 20);
snprintf(buf, sizeof(buf), "%s %s %s %s.",
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]);
evas_object_text_text_set(o, buf);
evas_object_color_set(o, 0, 0, 0, 255);
evas_object_geometry_get(o, NULL, NULL, &w, &h);
x = (win_w / 2) - (w / 2);
x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
evas_object_move(o, x, y);
evas_object_show(o);
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
char buf[1024];
const char *strs[] = {
"Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
};
for (i = 0; i < OBNUM; i++)
{
snprintf(buf, sizeof(buf), "%s %s %s %s.",
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]);
evas_object_text_text_set(o_texts[i], buf);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

111
src/bin/text_styles.c Normal file
View File

@ -0,0 +1,111 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME text_styles_start
#define NAME "Text Styles"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_texts[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
Evas_Text_Style_Type st;
st = EVAS_TEXT_STYLE_SHADOW;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_text_add(evas);
o_texts[i] = o;
evas_object_text_font_set(o, "Vera-Bold", 20);
evas_object_text_text_set(o, "This is a test string");
evas_object_text_style_set(o, st);
evas_object_color_set(o, 255, 255, 255, 255);
evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
evas_object_text_glow_color_set(o, 100, 80, 40, 100);
evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
evas_object_text_outline_color_set(o, 0, 0, 0, 255);
evas_object_show(o);
st++;
if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < OBNUM; i++)
{
evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
evas_object_move(o_texts[i], x, y);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

View File

@ -0,0 +1,123 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME text_styles_different_strings_start
#define NAME "Text Styles Different Strings"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_texts[OBNUM];
/* setup */
static void _setup(void)
{
int i;
Evas_Object *o;
Evas_Text_Style_Type st;
char buf[1024];
const char *strs[] = {
"Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
};
srnd();
st = EVAS_TEXT_STYLE_SHADOW;
for (i = 0; i < OBNUM; i++)
{
o = evas_object_text_add(evas);
o_texts[i] = o;
evas_object_text_font_set(o, "Vera-Bold", 20);
snprintf(buf, sizeof(buf), "%s %s %s %s.",
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]);
evas_object_text_text_set(o, buf);
evas_object_text_style_set(o, st);
evas_object_color_set(o, 255, 255, 255, 255);
evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
evas_object_text_glow_color_set(o, 100, 80, 40, 100);
evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
evas_object_text_outline_color_set(o, 0, 0, 0, 255);
evas_object_show(o);
st++;
if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
}
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
int i;
for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
}
/* loop - do things */
static void _loop(double t, int f)
{
int i;
Evas_Coord x, y, w, h;
for (i = 0; i < OBNUM; i++)
{
evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
evas_object_move(o_texts[i], x, y);
}
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

185
src/bin/textblock_basic.c Normal file
View File

@ -0,0 +1,185 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME textblock_basic_start
#define NAME "Textblock Basic"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_text;
/* setup */
static void _setup(void)
{
Evas_Object *o;
Evas_Textblock_Style *st;
o = evas_object_textblock_add(evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
(st,
"DEFAULT='font=Vera,Kochi font_size=8 align=left color=#000000 wrap=word'"
"center='+ font=Vera,Kochi font_size=10 align=center'"
"/center='- \n'"
"right='+ font=Vera,Kochi font_size=10 align=right'"
"/right='- \n'"
"blockquote='+ left_margin=+24 right_margin=+24 font=Vera,Kochi font_size=10 align=left'"
"h1='+ font_size=20'"
"red='+ color=#ff0000'"
"p='+ font=Vera,Kochi font_size=10 align=left'"
"/p='- \n'"
"br='\n'"
"tab='\t'"
);
evas_object_textblock_style_set(o, st);
evas_textblock_style_free(st);
evas_object_textblock_clear(o);
evas_object_textblock_text_markup_set
(o,
"<center><h1>Title</h1></center><br>"
"<p><tab>A pragraph here <red>red text</red> and stuff.</p>"
"<p>And escaping &lt; and &gt; as well as &amp; as <h1>normal.</h1></p>"
"<p>If you want a newline use &lt;br&gt;<br>woo a new line!</p>"
"<right>Right "
"<style=outline color=#fff outline_color=#000>aligned</> "
"<style=shadow shadow_color=#fff8>text</> "
"<style=soft_shadow shadow_color=#0002>should</> "
"<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >go here</> "
"<style=far_shadow shadow_color=#0005>as it is</> "
"<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>within</> "
"<style=outline_soft_shadow color=#fff outline_color=#8228 shadow_color=#0002>right tags</> "
"<style=far_soft_shadow color=#fff shadow_color=#0002>to make it align to the</> "
"<underline=on underline_color=#00f>right hand</> "
"<backing=on backing_color=#fff8>side </><backing_color=#ff08>of</><backing_color=#0f08> </>"
"<strikethrough=on strikethrough_color=#f0f8>the textblock</>.</right>"
"<p>And "
"<underline=double underline_color=#f00 underline2_color=#00f>now we need</> "
"to test some <color=#f00 font_size=8>C</><color=#0f0 font_size=10>O</>"
"<color=#00f font_size=12>L</><color=#fff font_size=14>O</>"
"<color=#ff0 font_size=16>R</><color=#0ff font_size=18> Bla Rai</>"
"<color=#f0f font_size=20> Stuff</>.</p>"
"<blockquote>"
"(日本語 カタカナ ひらがな) "
"<style=outline color=#fff outline_color=#000>Round about the cauldron go;</> "
"In the poison'd entrails throw. "
"<style=shadow shadow_color=#fff8>Toad, that under cold stone</> "
"Days and nights has thirty-one "
"<style=soft_shadow shadow_color=#0002>Swelter'd venom sleeping got,</> "
"<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >Boil thou first i' the charmed pot.</> "
"Double, double toil and trouble; "
"Fire burn, and cauldron bubble. "
"<style=far_shadow shadow_color=#0005>Fillet of a fenny snake,</> "
"In the cauldron boil and bake; "
"<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>Eye of newt and toe of frog,</> "
"<underline=on underline_color=#00f>Wool of bat and tongue of dog,</> "
"<backing=on backing_color=#fff8>Adder's fork and blind-worm's sting,</> "
"<underline=double underline_color=#f00 underline2_color=#00f>Lizard's leg and owlet's wing,</> "
"<color=#808 font_size=20>For a charm of powerful trouble, "
"Like a hell-broth boil and bubble. "
"Double, double toil and trouble;</> "
"Fire burn and cauldron bubble. "
"Scale of dragon, tooth of wolf, "
"Witches' mummy, maw and gulf "
"Of the ravin'd salt-sea shark, "
"Root of hemlock digg'd i' the dark, "
"Liver of blaspheming Jew, "
"Gall of goat, and slips of yew "
"Silver'd in the moon's eclipse, "
"Nose of Turk and Tartar's lips, "
"Finger of birth-strangled babe "
"Ditch-deliver'd by a drab, "
"Make the gruel thick and slab: "
"Add thereto a tiger's chaudron, "
"For the ingredients of our cauldron. "
"Double, double toil and trouble; "
"Fire burn and cauldron bubble. "
"Cool it with a baboon's blood, "
"Then the charm is firm and good. "
"Heizölrückstoßabdämpfung fløde pingüino kilómetros cœur déçu l'âme "
"plutôt naïve Louÿs rêva crapaüter Íosa Úrmhac Óighe pór Éava Ádhaim"
"</blockquote>"
);
evas_object_show(o);
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
evas_object_del(o_text);
}
/* loop - do things */
static void _loop(double t, int f)
{
Evas_Coord x, y, w, h, w0, h0;
int i = 0;
w0 = 160;
h0 = 120;
w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2);
h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2);
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2);
evas_object_move(o_text, x, y);
evas_object_resize(o_text, w, 5000);
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

156
src/bin/textblock_intl.c Normal file
View File

@ -0,0 +1,156 @@
#undef FNAME
#undef NAME
#undef ICON
/* metadata */
#define FNAME textblock_intl_start
#define NAME "Textblock Intl"
#define ICON "mushroom.png"
#ifndef PROTO
# ifndef UI
# include "main.h"
/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_text;
/* setup */
static void _setup(void)
{
Evas_Object *o;
Evas_Textblock_Style *st;
o = evas_object_textblock_add(evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
(st,
"DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'"
"br='\n'"
);
evas_object_textblock_style_set(o, st);
evas_textblock_style_free(st);
evas_object_textblock_clear(o);
evas_object_textblock_text_markup_set
(o,
"This is a test of International test rendering in Evas<br>"
"<br>"
"Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'<br>"
"German: 'Heizölrückstoßabdämpfung'<br>"
"Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'<br>"
"French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'<br>"
"Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'<br>"
"Hungarian: 'Árvíztűrő tükörfúrógép'<br>"
"Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'<br>"
"Japanese (hiragana): 'いろはにほへとちりぬるを'<br>"
"Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'<br>"
"Hebrew: '? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה'<br>"
"Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'<br>"
"Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'<br>"
"IPA: 'ˈjunɪˌkoːd'<br>"
"American Dictionary: 'Ūnĭcōde̽'<br>"
"Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'<br>"
"Arabic: 'يونِكود'<br>"
"Armenian: 'Յունիկօդ'<br>"
"Bengali: 'য়ূনিকোড'<br>"
"Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'<br>"
"Canadian Syllabics: 'ᔫᗂᑰᑦ'<br>"
"Cherokee: 'ᏳᏂᎪᏛ'<br>"
"Chinese: '萬國碼'<br>"
"Ethiopic: 'ዩኒኮድ'<br>"
"Georgian: 'უნიკოდი'<br>"
"Greek: 'Γιούνικοντ'<br>"
"Gujarati: 'યૂનિકોડ'<br>"
"Gurmukhi: 'ਯੂਨਿਕੋਡ'<br>"
"Hindi: 'यूनिकोड'<br>"
"Kannada: 'ಯೂನಿಕೋಡ್'<br>"
"Khmer: 'យូនីគោដ'<br>"
"Korean: '유니코드'<br>"
"Malayalam: 'യൂനികോഡ്'<br>"
"Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'<br>"
"Oriya: 'ୟୂନିକୋଡ'<br>"
"Persian: 'یونی‌کُد'<br>"
"Sinhala: 'යණනිකෞද්'<br>"
"Syriac: 'ܝܘܢܝܩܘܕ'<br>"
"Tamil:'யூனிகோட்'<br>"
"Telugu: 'యూనికోడ్'<br>"
"Thai: 'ยูนืโคด'<br>"
"Tibetan: 'ཨུ་ནི་ཀོཌྲ།'<br>"
"Yiddish: 'יוניקאָד'<br>"
);
evas_object_show(o);
done = 0;
}
/* cleanup */
static void _cleanup(void)
{
evas_object_del(o_text);
}
/* loop - do things */
static void _loop(double t, int f)
{
Evas_Coord x, y, w, h, w0, h0;
int i = 0;
evas_object_textblock_size_native_get(o_text, &w0, &h0);
w = w0;
h = h0;
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (31.1 * SLOW)) * (w0 / (2 * 2));
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (19.6 * SLOW)) * (h0 / (2 * 2));
evas_object_move(o_text, x, y);
evas_object_resize(o_text, w, h);
FPS_STD(NAME);
}
/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
KEY_STD;
}
/* template stuff - ignore */
# endif
#endif
#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif
#ifdef PROTO
void FNAME(void);
#endif
#ifndef PROTO
# ifndef UI
void FNAME(void)
{
ui_func_set(_key, _loop);
_setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON

529
src/bin/ui.c Normal file
View File

@ -0,0 +1,529 @@
#include "main.h"
#define PROTO
#include "tests.h"
#undef PROTO
static double start = 0.0;
static double t_start = 0.0;
static double t_loop = 0.0;
static int f_start = 0;
static int f_loop = 0;
typedef struct _Menu_Item Menu_Item;
struct _Menu_Item
{
Evas_Object *o_icon;
char *icon;
char *text;
void (*func) (void);
};
static Evas_Object *o_bg = NULL;
static Evas_Object *o_wallpaper = NULL;
static Evas_Object *o_title = NULL;
static Evas_Object *o_byline = NULL;
static Evas_Object *o_menu_logo = NULL;
static Evas_Object *o_menu_icon = NULL;
static Evas_Object *o_menu_icon_sel = NULL;
static Evas_Object *o_menu_icon_sel2 = NULL;
static Evas_Object *o_menu_text_sel = NULL;
static Evas_Object *o_menu_title = NULL;
static Evas_Object *o_menu_title2 = NULL;
static Evas_List *menu = NULL;
static int menu_sel = 0;
static int menu_active = 0;
static double menu_anim = 0.0;
static double menu_anim_sel = 0.0;
static double p_fps = 0.0;
static void (*key_func) (char *key) = NULL;
static void (*loop_func) (double t, int f) = NULL;
static void
_ui_exit(void)
{
engine_abort();
}
static void
_ui_all(void)
{
Evas_List *l;
double fps = 0.0;
int t_count = 0;
for (l = menu; l; l = l->next)
{
Menu_Item *mi;
mi = l->data;
if ((mi->func == about_start) ||
(mi->func == _ui_exit) ||
(mi->func == _ui_all))
continue;
if (mi->func) mi->func();
while (p_fps == 0.0)
{
ui_loop();
engine_loop();
evas_render(evas);
}
t_count++;
fps += p_fps;
key_func("Escape");
}
if (t_count > 0) printf("%4.2f , EVAS SPEED\n", fps / t_count);
}
static void
_ui_select(void)
{
Evas_List *l;
int i;
void (*func) (void) = NULL;
evas_object_hide(o_menu_logo);
evas_object_hide(o_menu_title);
evas_object_hide(o_menu_title2);
evas_object_hide(o_menu_icon);
evas_object_hide(o_menu_icon_sel);
evas_object_hide(o_menu_icon_sel2);
evas_object_hide(o_menu_text_sel);
for (i = 0, l = menu; l; l = l->next, i++)
{
Menu_Item *mi;
mi = l->data;
evas_object_hide(mi->o_icon);
if (i == menu_sel)
func = mi->func;
}
menu_active = 0;
if (func) func();
}
static void
_ui_key(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Key_Down *ev;
ev = event_info;
if (key_func)
{
key_func(ev->keyname);
return;
}
if ((!strcmp(ev->keyname, "Escape")) ||
(!strcmp(ev->keyname, "q")) ||
(!strcmp(ev->keyname, "Q")))
{
engine_abort();
}
if (menu_active)
{
if (!strcmp(ev->keyname, "Left")) menu_sel++;
if (!strcmp(ev->keyname, "Right")) menu_sel--;
if (menu_sel < 0) menu_sel = 0;
else if (menu_sel >= evas_list_count(menu)) menu_sel = evas_list_count(menu) - 1;
menu_anim_sel = menu_sel;
if (!strcmp(ev->keyname, "Return")) _ui_select();
}
}
static Evas_Coord down_x, down_y;
static down = 0;
static dowm_menu_sel = 0;
static void
_ui_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Down *ev;
ev = event_info;
if (ev->button != 1) return;
if (menu_active)
{
down_x = ev->canvas.x;
down_y = ev->canvas.y;
down++;
dowm_menu_sel = menu_sel;
}
else
{
}
}
static void
_ui_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Up *ev;
ev = event_info;
if (ev->button != 1) return;
if (menu_active)
{
Evas_Coord dx, dy;
dx = ev->canvas.x - down_x;
dy = ev->canvas.y - down_y;
if ((((dx * dx) + (dy * dy)) < (20 * 20)) &&
(menu_sel == dowm_menu_sel))
_ui_select();
down--;
}
else
{
evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL);
}
}
static void
_ui_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Move *ev;
ev = event_info;
if (!down) return;
if (menu_active)
{
menu_sel = dowm_menu_sel + ((ev->cur.canvas.x - down_x) / 25);
/* scroll */
if (menu_sel < 0) menu_sel = 0;
else if (menu_sel >= evas_list_count(menu)) menu_sel = evas_list_count(menu) - 1;
menu_anim_sel = menu_sel;
}
else
{
}
}
static void
_ui_menu_item_add(char *icon, char *text, void (*func) (void))
{
Menu_Item *mi;
char buf[4096];
mi = malloc(sizeof(Menu_Item));
strcpy(buf, PACKAGE_DATA_DIR"/data/");
strcat(buf, icon);
mi->o_icon = evas_object_image_add(evas);
evas_object_image_file_set(mi->o_icon, buf, NULL);
evas_object_resize(mi->o_icon, 32, 32);
evas_object_image_fill_set(mi->o_icon, 0, 0, 32, 32);
mi->icon = strdup(icon);
mi->text = strdup(text);
mi->func = func;
menu = evas_list_append(menu, mi);
evas_object_raise(o_menu_icon_sel2);
}
static void
_ui_setup(void)
{
Evas_Object *o;
Evas_Coord x, y, w, h;
o = evas_object_rectangle_add(evas);
evas_object_move(o, 0, 0);
evas_object_resize(o, win_w, win_h);
evas_object_color_set(o, 0, 0, 0, 0);
evas_object_layer_set(o, 1000);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _ui_key, NULL);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ui_mouse_down, NULL);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ui_mouse_up, NULL);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ui_mouse_move, NULL);
evas_object_focus_set(o, 1);
evas_object_show(o);
o_bg = o;
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/bg.png", NULL);
evas_object_image_fill_set(o, 0, 0, win_w, win_h);
evas_object_resize(o, win_w, win_h);
evas_object_layer_set(o, -99);
evas_object_show(o);
o_wallpaper = o;
o = evas_object_text_add(evas);
evas_object_text_font_set(o, "Vera-Bold", 10);
evas_object_text_text_set(o, "EXPEDITE");
evas_object_layer_set(o, 100);
evas_object_color_set(o, 0, 0, 0, 100);
evas_object_pass_events_set(o, 1);
evas_object_geometry_get(o, NULL, NULL, &w, &h);
x = (win_w - w) / 2;
y = 0;
evas_object_move(o, x, y);
evas_object_show(o);
o_title = o;
o = evas_object_text_add(evas);
evas_object_text_font_set(o, "Vera", 9);
evas_object_text_text_set(o, "LEFT/RIGHT - select, ENTER - select, ESCAPE - exit.");
evas_object_layer_set(o, 100);
evas_object_color_set(o, 0, 0, 0, 60);
evas_object_pass_events_set(o, 1);
evas_object_geometry_get(o, NULL, NULL, &w, NULL);
x = (win_w - w) / 2;
y = h + 2;
evas_object_move(o, x, y);
evas_object_show(o);
o_byline = o;
o = evas_object_image_add(evas);
evas_object_move(o, (win_w - 120) / 2, ((win_h - 160) / 2));
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
evas_object_image_fill_set(o, 0, 0, 120, 160);
evas_object_resize(o, 120, 160);
evas_object_layer_set(o, -98);
evas_object_color_set(o, 255, 255, 255, 255);
evas_object_show(o);
o_menu_logo = o;
o = evas_object_image_add(evas);
evas_object_move(o, win_w - 128, - 128);
evas_object_image_fill_set(o, 0, 0, 256, 256);
evas_object_resize(o, 256, 256);
evas_object_show(o);
o_menu_icon = o;
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/icon_sel.png", NULL);
evas_object_resize(o, 56, 56);
evas_object_image_fill_set(o, 0, 0, 56, 56);
o_menu_icon_sel = o;
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/text_sel.png", NULL);
evas_object_resize(o, 96, 32);
evas_object_image_fill_set(o, 0, 0, 96, 32);
evas_object_image_border_set(o, 8, 8, 8, 8);
o_menu_text_sel = o;
o = evas_object_image_add(evas);
evas_object_move(o, 0, 0);
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/icon_sel2.png", NULL);
evas_object_resize(o, 56, 41);
evas_object_image_fill_set(o, 0, 0, 56, 41);
o_menu_icon_sel2 = o;
o = evas_object_text_add(evas);
evas_object_text_font_set(o, "Vera-Bold", 10);
evas_object_text_text_set(o, "");
evas_object_color_set(o, 100, 100, 100, 100);
evas_object_pass_events_set(o, 1);
evas_object_geometry_get(o, NULL, NULL, &w, &h);
x = ((win_w - w) / 2) + 1;
y = ((win_h - h) / 2) + 1;
evas_object_move(o, x, y);
o_menu_title2 = o;
o = evas_object_text_add(evas);
evas_object_text_font_set(o, "Vera-Bold", 10);
evas_object_text_text_set(o, "");
evas_object_color_set(o, 0, 0, 0, 100);
evas_object_pass_events_set(o, 1);
evas_object_geometry_get(o, NULL, NULL, &w, &h);
x = (win_w - w) / 2;
y = (win_h - h) / 2;
evas_object_move(o, x, y);
o_menu_title = o;
_ui_menu_item_add("e.png", "About Enlightenment", about_start);
_ui_menu_item_add("e.png", "All Tests", _ui_all);
#define UI
#include "tests.h"
#undef UI
_ui_menu_item_add("exit.png", "Exit", _ui_exit);
menu_active = 1;
}
void
ui_args(int argc, char **argv)
{
int i;
for (i = 1; i < argc; i++)
{
if ((!strcmp(argv[i], "-e")) && (i < (argc - 1)))
{
i++;
}
}
_ui_setup();
start = get_time();
}
void
ui_loop(void)
{
static int first = 1;
static double pt = 0.0;
double t, t2;
if (loop_func)
{
t = get_time();
f_loop++;
f_start++;
if ((t - t_loop) >= 1.0)
{
// ui_fps((double)f_loop / (t - t_loop));
t_loop = t;
f_loop = 0;
}
loop_func(t - t_start, f_start);
return;
}
t2 = get_time();
if (first)
{
t = 0.1;
pt = t2;
}
else
{
t = t2 - pt;
pt = t2;
}
first = 0;
/* menu layout */
if (menu_active)
{
Evas_List *l;
int i;
static double tr = 0.0;
double tt;
tt = t;
tt += tr;
while (tt > 0.001)
{
menu_anim = (menu_anim * 0.995) + (menu_anim_sel * 0.005);
tt -= 0.001;
}
tr = tt;
for (i = 0, l = menu; l; l = l->next, i++)
{
Menu_Item *mi;
Evas_Coord x, y, w, h, tw, th;
Evas_Coord len;
double a;
Evas_Object *o;
char buf[4096];
mi = l->data;
o = mi->o_icon;
evas_object_geometry_get(o_menu_logo, NULL, NULL, &w, &h);
len = ((w * 3) + 10) / 4;
evas_object_geometry_get(o, NULL, NULL, &w, &h);
x = (win_w / 2)
+ (sin((menu_anim - (double)i) * 0.33) * len)
- (w / 2);
y = (win_h / 2)
+ (cos((menu_anim - (double)i) * 0.33) * len)
- (h / 2);
evas_object_move(o, x, y);
a = menu_anim - (double)i;
if (a < 0) a = -a;
a = 255 - (30 * a);
evas_object_color_set(o, a, a, a, a);
evas_object_show(o);
if (i == menu_sel)
{
a = menu_anim - (double)i;
if (a < 0) a = -a;
a = 255 - (255 * a);
o = o_menu_icon_sel;
evas_object_move(o, x - ((56 - w) / 2), y - ((56 - h) / 2));
evas_object_color_set(o, a, a, a, a);
o = o_menu_icon_sel2;
evas_object_move(o, (win_w - 56) / 2, (win_h / 2) + len - 4);
o = o_menu_title;
evas_object_color_set(o, 0, 0, 0, a);
evas_object_text_text_set(o, mi->text);
evas_object_geometry_get(o, NULL, NULL, &tw, &th);
x = (win_w - tw) / 2;
y = (win_h / 2) + len + 40;
evas_object_move(o, x, y);
o = o_menu_title2;
evas_object_color_set(o, a / 2, a / 2, a / 2, a / 2);
evas_object_text_text_set(o, mi->text);
evas_object_move(o, x + 1, y + 1);
o = o_menu_text_sel;
w = tw + 24;
h = 28;
x = x - 12;
y = y + ((th - h) / 2);
evas_object_move(o, x, y);
evas_object_resize(o, w, h);
evas_object_image_fill_set(o, 0, 0, w, h);
evas_object_color_set(o, a, a, a, a);
o = o_menu_icon;
strcpy(buf, PACKAGE_DATA_DIR"/data/");
strcat(buf, mi->icon);
evas_object_image_file_set(o, buf, NULL);
evas_object_color_set(o, a / 2, a / 2, a / 2, a / 2);
}
}
evas_object_show(o_menu_logo);
evas_object_show(o_menu_title);
evas_object_show(o_menu_title2);
evas_object_show(o_menu_icon);
evas_object_show(o_menu_icon_sel);
evas_object_show(o_menu_icon_sel2);
evas_object_show(o_menu_text_sel);
}
else
{
}
}
void
ui_menu(void)
{
evas_object_text_text_set(o_byline, "LEFT/RIGHT - select, ENTER - select, ESCAPE - exit.");
menu_active = 1;
key_func = NULL;
loop_func = NULL;
}
void
ui_func_set(void (*kfunc) (char *key), void (*lfunc) (double t, int f))
{
key_func = kfunc;
loop_func = lfunc;
t_loop = t_start = get_time();
f_loop = f_start = 0;
ui_fps(0.0);
}
void
ui_fps(double fps)
{
char buf[256];
snprintf(buf, sizeof(buf), "ESCAPE - exit, FPS: %4.3f", fps);
evas_object_text_text_set(o_byline, buf);
p_fps = fps;
}

10
src/bin/ui.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef UI_H
#define UI_H
void ui_args(int argc, char **argv);
void ui_loop(void);
void ui_menu(void);
void ui_func_set(void (*kfunc) (char *key), void (*lfunc) (double t, int f));
void ui_fps(double fps);
#endif