#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#define PACKAGE_EXAMPLES_DIR "."
#endif
#include <Ecore.h>
#include <stdio.h>
#include <errno.h>
#include "evas-common.h"
#define WIDTH (320)
#define HEIGHT (240)
static const char *img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/enlightenment.png";
static const char *border_img_path = PACKAGE_EXAMPLES_DIR EVAS_IMAGE_FOLDER "/red.png";
struct test_data
{
Ecore_Evas *ee;
Evas_Object *img, *bg, *clipper, *clipper_border, *text;
};
static struct test_data d = {0};
static void
_canvas_resize_cb(Ecore_Evas *ee)
{
int w, h;
}
static void
void *einfo)
{
if (strcmp(ev->
key,
"h") == 0)
{
printf("commands are:\n"
"\to - change clipper's opacity\n"
"\tr - toggle clipper's color between red and white\n"
"\tc - toggle clipper's clipping function\n"
"\tv - toggle clipper's visibility\n");
return;
}
if (strcmp(ev->
key,
"o") == 0)
{
int alpha, r, g, b;
alpha -= 20;
if (alpha < 0)
alpha = 255;
printf("Changing clipper's opacity: %d%%\n",
(int)((alpha / 255.0) * 100));
return;
}
if (strcmp(ev->
key,
"r") == 0)
{
int alpha, r, g, b;
printf("Changing clipper's color to");
if (g > 0)
{
printf("red\n");
g = b = 0;
}
else
{
printf("white\n");
g = b = 255;
}
return;
}
if (strcmp(ev->
key,
"c") == 0)
{
printf("Toggling clipping ");
{
printf("off\n");
}
else
{
printf("on\n");
}
return;
}
if (strcmp(ev->
key,
"v") == 0)
{
printf("Clipper is now ");
{
printf("hidden\n");
}
else
{
printf("visible\n");
}
return;
}
}
int
main(void)
{
int err;
return EXIT_FAILURE;
if (!d.ee)
goto error;
{
goto panic;
}
else
{
printf("Image object added, type is: %s\n",
}
{
goto panic;
}
else
{
d.clipper_border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);
}
return 0;
error:
fprintf(stderr, "error: Requires at least one Evas engine built and linked"
" to ecore-evas for this example to run properly.\n");
panic:
return -1;
}