#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)
{
fprintf(stdout, "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;
fprintf(stdout, "Changing clipper's opacity: %d%%\n",
(int)((alpha / 255.0) * 100));
return;
}
if (strcmp(ev->
key,
"r") == 0)
{
int alpha, r, g, b;
fprintf(stdout, "Changing clipper's color to");
if (g > 0)
{
fprintf(stdout, "red\n");
g = b = 0;
}
else
{
fprintf(stdout, "white\n");
g = b = 255;
}
return;
}
if (strcmp(ev->
key,
"c") == 0)
{
fprintf(stdout, "Toggling clipping ");
if (evas_object_clip_get(d.img) == d.clipper)
{
evas_object_clip_unset(d.img);
fprintf(stdout, "off\n");
}
else
{
evas_object_clip_set(d.img, d.clipper);
fprintf(stdout, "on\n");
}
return;
}
if (strcmp(ev->
key,
"v") == 0)
{
fprintf(stdout, "Clipper is now ");
{
fprintf(stdout, "hidden\n");
}
else
{
fprintf(stdout, "visible\n");
}
return;
}
}
int
main(void)
{
int err;
return EXIT_FAILURE;
if (!d.ee)
d.img = evas_object_image_filled_add(d.canvas);
evas_object_image_file_set(d.img, img_path, NULL);
err = evas_object_image_load_error_get(d.img);
if (err != EVAS_LOAD_ERROR_NONE)
{
goto panic;
}
else
{
fprintf(stdout, "Image object added, type is: %s\n",
}
d.clipper_border = evas_object_image_filled_add(d.canvas);
evas_object_image_file_set(d.clipper_border, border_img_path, NULL);
err = evas_object_image_load_error_get(d.clipper_border);
if (err != EVAS_LOAD_ERROR_NONE)
{
goto panic;
}
else
{
evas_object_image_border_set(d.clipper_border, 3, 3, 3, 3);
evas_object_image_border_center_fill_set(
d.clipper_border, EVAS_BORDER_FILL_NONE);
d.clipper_border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);
}
evas_object_clip_set(d.img, d.clipper);
return 0;
fprintf(stderr, "you got to have at least one evas engine built and linked"
" up to ecore-evas for this example to run properly.\n");
panic:
return -1;
}