#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 *commands = \
"commands are:\n"
"\ta - toggle animation timer\n"
"\tc - cycle between focus and key grabs for key input\n"
"\td - delete canvas callbacks\n"
"\tf - freeze input for 3 seconds\n"
"\tp - toggle precise point collision detection on image\n"
"\tControl + o - add an obscured rectangle\n"
"\th - print help\n";
struct test_data
{
Ecore_Evas *ee;
};
static struct test_data d = {0};
static void
_canvas_resize_cb(Ecore_Evas *ee)
{
int w, h;
}
static void
void *event_info)
{
printf("An object got focused: %s\n",
printf("Let's recheck it: %s\n",
"OK!" : "Oops, something is bad.");
}
static void
{
printf("Canvas is about to flush its rendering pipeline!\n");
}
{
int w, h, cw, ch;
if (w < cw)
else
}
{
printf("Canvas was frozen %d times, now thawing.\n",
}
static void
{
printf("Enlightenment logo has had the mouse in.\n");
}
static void
{
printf("Enlightenment logo has had the mouse out.\n");
}
static void
void *einfo)
{
const Evas_Modifier *mods;
printf(
"We've got key input: %s\n", ev->
key);
printf("It actually came from %s\n",
d.focus ? "focus" : "key grab");
if (strcmp(ev->
key,
"h") == 0)
{
puts(commands);
return;
}
if (strcmp(ev->
key,
"a") == 0)
{
if (d.resize_timer != NULL)
{
printf("Stopping animation timer\n");
d.resize_timer = NULL;
}
else
{
printf("Re-issuing animation timer\n");
}
return;
}
if (strcmp(ev->
key,
"c") == 0)
{
printf("Switching to %s for key input\n",
d.focus ? "key grabs" : "focus");
if (d.focus)
{
printf("Focused object is now %s\n",
"still valid! Something went wrong." : "none.");
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
if (!ret)
{
printf("Something went wrong with key grabs.\n");
goto c_end;
}
}
else
{
}
c_end:
d.focus = !d.focus;
return;
}
if (strcmp(ev->
key,
"d") == 0)
{
printf("Deleting canvas event callbacks\n");
_render_flush_cb, NULL);
_object_focus_in_cb, NULL);
return;
}
if (strcmp(ev->
key,
"f") == 0)
{
printf("Freezing input for 3 seconds\n");
return;
}
if (strcmp(ev->
key,
"p") == 0)
{
printf("Toggling precise point collision detection %s on Enlightenment logo\n",
precise ? "off" : "on");
return;
}
(strcmp(ev->
key,
"o") == 0))
{
printf("Toggling obscured rectangle on canvas\n");
if (!d.obscured)
{
int w, h;
}
else
{
int w, h;
{
printf("Rectangle (%d, %d, %d, %d) on canvas got a"
" rendering update.\n", rect->
x, rect->
y,
}
}
d.obscured = !d.obscured;
}
}
int
main(void)
{
int err;
return EXIT_FAILURE;
if (!d.ee)
goto error;
_render_flush_cb, NULL);
{
fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
goto panic;
}
_object_focus_in_cb, NULL);
{
fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
goto panic;
}
{
fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
goto panic;
}
{
fprintf(stderr, "ERROR: Image loading failed! Aborting.\n");
goto panic;
}
else
{
}
puts(commands);
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;
}