#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#define EINA_UNUSED
#endif
#include <Ecore.h>
#define WIDTH (300)
#define HEIGHT (300)
static Ecore_Evas *ee;
static const char commands[] = \
"commands are:\n"
"\tm - impose a minumum size to the window\n"
"\tx - impose a maximum size to the window\n"
"\tb - impose a base size to the window\n"
"\ts - impose a step size (different than 1 px) to the window\n"
"\tg - get the screen geometry\n"
"\th - print help\n";
static void
_canvas_resize_cb(Ecore_Evas *ee_)
{
int w, h;
char buf[1024];
snprintf(buf, sizeof(buf), "%d x %d", w, h);
}
static void
{
}
static void
void *einfo)
{
if (strcmp(ev->
key,
"h") == 0)
{
printf(commands);
return;
}
if (strcmp(ev->
key,
"m") == 0)
{
min_set = !min_set;
if (min_set)
{
printf("Imposing a minimum size of %d x %d\n",
WIDTH / 2, HEIGHT / 2);
}
else
{
printf("Taking off minimum size restriction from the"
" window\n");
}
return;
}
if (strcmp(ev->
key,
"x") == 0)
{
max_set = !max_set;
if (max_set)
{
printf("Imposing a maximum size of %d x %d\n",
WIDTH * 2, HEIGHT * 2);
}
else
{
printf("Taking off maximum size restriction from the"
" window\n");
}
return;
}
if (strcmp(ev->
key,
"b") == 0)
{
base_set = !base_set;
if (base_set)
{
printf("Imposing a base size of %d x %d\n",
WIDTH * 2, HEIGHT * 2);
}
else
{
printf("Taking off base size restriction from the"
" window\n");
}
return;
}
if (strcmp(ev->
key,
"s") == 0)
{
step_set = !step_set;
if (step_set)
{
printf("Imposing a step size of %d x %d\n", 40, 40);
}
else
{
printf("Taking off step size restriction from the"
" window\n");
}
return;
}
if (strcmp(ev->
key,
"g") == 0)
{
int x, y, w, h;
printf("screen geometry: %d,%d, %dx%d\n", x, y, w, h);
return;
}
}
int
main(void)
{
return EXIT_FAILURE;
if (!ee) goto error;
_canvas_resize_cb(ee);
printf(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");
return -1;
}