#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include <Evas.h>
#define WIDTH (512)
#define HEIGHT (384)
#define DEPTH (100)
#define FLOOR_Y (HEIGHT - 80)
#define SH_THRESHOLD (250)
#define SH_OFFSET_X (- 16)
#define OFFSET_X (90)
#define PADDING_X_1 (16)
#define PADDING_X_2 (12)
#define PADDING_X_3 (22)
#define E_THRESHOLD (WIDTH + 560)
#define LAYER_SHADOW (10)
#define LAYER_LETTER (20)
#define CENTER(total, item) (((total) - (item)) / 2)
#define LIMIT(val, op, ref) (((val) op (ref)) ? (val) : (ref));
#define PROP_GET(pos, min, max) (((min) + ((max) - (min)) * (pos)) / (max))
static void
_update_box_cb(
void *data __UNUSED__,
EPhysics_Body *body,
void *event_info)
{
int x, y, w, h, floor_distance, alpha = 0;
floor_distance = FLOOR_Y - h;
if (y > SH_THRESHOLD)
{
int sh_w, sh_h;
double pos_x;
alpha = 255 * (y - SH_THRESHOLD) / (floor_distance - SH_THRESHOLD);
pos_x = (double) x / (WIDTH - w);
alpha = alpha * PROP_GET(pos_x, 100, 255);
FLOOR_Y - sh_h + 2);
}
alpha = (y <= 0) ? 0 : y * 255 / floor_distance;
alpha = alpha * (x - OFFSET_X + 80) / (WIDTH - OFFSET_X);
}
static void
_update_circle_cb(
void *data __UNUSED__,
EPhysics_Body *body,
void *event_info)
{
int x, y, w, h, sh_w, sh_h, alpha = 0;
const Evas_Map *map;
alpha = x * 255 / (WIDTH - w);
FLOOR_Y - sh_h + 2);
alpha = 127 + alpha / 2;
if (x > E_THRESHOLD)
}
static void
{
int w, h, sh_w, sh_h;
char buf[1024];
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_shadow-%s.png", letter);
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_letter-%s.png", letter);
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_light-%s.png", letter);
}
static void
{
}
{
_letter_body_setup_common(body, image);
return body;
}
{
_letter_body_setup_common(body, image);
return body;
}
EAPI_MAIN int
elm_main(int argc __UNUSED__, char **argv __UNUSED__)
{
unsigned int i = 0;
int x, w, h, sh_w;
struct letter_desc {
const char *letter;
int padding;
} falling_letters[] = {
{"P", PADDING_X_1},
{"H", PADDING_X_1},
{"Y", PADDING_X_3},
{"S1", PADDING_X_2},
{"I", PADDING_X_2},
{"C", PADDING_X_3},
{"S2", 0}
};
return - 1;
30);
x = OFFSET_X;
{
_letter_add(evas, falling_letters[i].letter, &image, &light, &shadow);
x += falling_letters[i].padding + w;
letter_body = _letter_body_box_add(world, image);
}
_letter_add(evas, "E", &image, &light, &shadow);
letter_body = _letter_body_circle_add(world, image);
return 0;
}