2003-06-02 16:49:56 -07:00
|
|
|
#include "edje.h"
|
|
|
|
|
2003-07-07 00:55:18 -07:00
|
|
|
typedef struct _Demo_Edje Demo_Edje;
|
|
|
|
|
|
|
|
struct _Demo_Edje
|
|
|
|
{
|
|
|
|
Evas_Object *edje;
|
|
|
|
Evas_Object *left;
|
|
|
|
Evas_Object *right;
|
|
|
|
Evas_Object *top;
|
|
|
|
Evas_Object *bottom;
|
|
|
|
Evas_Object *title;
|
|
|
|
Evas_Object *title_clip;
|
|
|
|
Evas_Object *image;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord minw, minh;
|
2003-07-07 00:55:18 -07:00
|
|
|
int hdir;
|
|
|
|
int vdir;
|
2003-08-03 00:00:03 -07:00
|
|
|
char down_top : 1;
|
|
|
|
char down_bottom : 1;
|
2003-07-07 00:55:18 -07:00
|
|
|
};
|
|
|
|
|
2003-07-27 06:16:51 -07:00
|
|
|
typedef struct _Collection Collection;
|
|
|
|
|
|
|
|
struct _Collection
|
|
|
|
{
|
2003-08-03 00:00:03 -07:00
|
|
|
char header : 1;
|
|
|
|
char clicked : 1;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord maxw;
|
2003-07-27 06:16:51 -07:00
|
|
|
char *file;
|
|
|
|
char *part;
|
|
|
|
Evas_Object *text;
|
|
|
|
Evas_Object *bg;
|
2003-08-03 00:00:03 -07:00
|
|
|
Evas_List *entries;
|
2003-07-27 06:16:51 -07:00
|
|
|
};
|
|
|
|
|
2003-08-03 00:00:03 -07:00
|
|
|
static int main_start(int argc, char **argv);
|
|
|
|
static void main_stop(void);
|
|
|
|
static void main_resize(Ecore_Evas *ee);
|
|
|
|
static int main_signal_exit(void *data, int ev_type, void *ev);
|
|
|
|
static void main_delete_request(Ecore_Evas *ee);
|
|
|
|
static void main_pre_rend(Ecore_Evas *ee);
|
|
|
|
static void main_post_rend(Ecore_Evas *ee);
|
|
|
|
|
|
|
|
void bg_setup(void);
|
2003-10-17 20:34:54 -07:00
|
|
|
void bg_resize(Evas_Coord w, Evas_Coord h);
|
2003-08-03 00:00:03 -07:00
|
|
|
static void bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info);
|
|
|
|
|
|
|
|
void test_list_move(Collection *co_head);
|
|
|
|
void test_list(char *file);
|
2003-08-08 20:32:21 -07:00
|
|
|
|
|
|
|
void test_resize(Demo_Edje *de);
|
2003-08-03 00:00:03 -07:00
|
|
|
void test_setup(char *file, char *name);
|
|
|
|
|
2003-07-07 00:55:18 -07:00
|
|
|
static Evas_List *edjes = NULL;
|
|
|
|
static Evas_Object *o_bg = NULL;
|
|
|
|
static Evas_Object *o_shadow = NULL;
|
2003-07-27 06:16:51 -07:00
|
|
|
|
2003-06-17 01:15:06 -07:00
|
|
|
double start_time = 0.0;
|
|
|
|
Ecore_Evas *ecore_evas = NULL;
|
|
|
|
Evas *evas = NULL;
|
2003-09-09 00:22:54 -07:00
|
|
|
int startw = 240;
|
|
|
|
int starth = 320;
|
2003-06-17 01:15:06 -07:00
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
static int
|
|
|
|
main_start(int argc, char **argv)
|
|
|
|
{
|
2003-09-09 00:22:54 -07:00
|
|
|
int mode = 0;
|
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
start_time = ecore_time_get();
|
|
|
|
if (!ecore_init()) return -1;
|
|
|
|
ecore_app_args_set(argc, (const char **)argv);
|
|
|
|
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, NULL);
|
|
|
|
if (!ecore_evas_init()) return -1;
|
2003-07-10 06:34:04 -07:00
|
|
|
#ifndef EDJE_FB_ONLY
|
2003-09-06 22:16:08 -07:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
2003-09-09 00:22:54 -07:00
|
|
|
if (((!strcmp(argv[i], "-g")) ||
|
|
|
|
(!strcmp(argv[i], "-geometry")) ||
|
|
|
|
(!strcmp(argv[i], "--geometry"))) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
int n, w, h;
|
|
|
|
char buf[16], buf2[16];
|
|
|
|
|
|
|
|
n = sscanf(argv[i +1], "%10[^x]x%10s", buf, buf2);
|
|
|
|
if (n == 2)
|
|
|
|
{
|
|
|
|
w = atoi(buf);
|
|
|
|
h = atoi(buf2);
|
|
|
|
startw = w;
|
|
|
|
starth = h;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-gl"))
|
2003-09-06 22:16:08 -07:00
|
|
|
{
|
2003-09-09 00:22:54 -07:00
|
|
|
mode = 1;
|
2003-09-06 22:16:08 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-09-09 00:22:54 -07:00
|
|
|
if (mode == 0)
|
|
|
|
ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, startw, starth);
|
|
|
|
else if (mode == 1)
|
|
|
|
ecore_evas = ecore_evas_gl_x11_new(NULL, 0, 0, 0, startw, starth);
|
2003-07-10 06:34:04 -07:00
|
|
|
#else
|
2003-09-09 00:22:54 -07:00
|
|
|
ecore_evas = ecore_evas_fb_new(NULL, 270, startw, starth);
|
2003-07-10 16:19:55 -07:00
|
|
|
#endif
|
2003-06-02 16:49:56 -07:00
|
|
|
if (!ecore_evas) return -1;
|
|
|
|
ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
|
|
|
|
ecore_evas_callback_resize_set(ecore_evas, main_resize);
|
2003-07-15 22:15:15 -07:00
|
|
|
ecore_evas_callback_pre_render_set(ecore_evas, main_pre_rend);
|
|
|
|
ecore_evas_callback_post_render_set(ecore_evas, main_post_rend);
|
2003-06-02 19:30:25 -07:00
|
|
|
ecore_evas_title_set(ecore_evas, "Edje Test Program");
|
|
|
|
ecore_evas_name_class_set(ecore_evas, "edje", "main");
|
2003-06-02 16:49:56 -07:00
|
|
|
ecore_evas_show(ecore_evas);
|
|
|
|
evas = ecore_evas_get(ecore_evas);
|
2003-07-14 19:21:58 -07:00
|
|
|
evas_image_cache_set(evas, 16 * 1024 * 1024);
|
2003-07-07 00:55:18 -07:00
|
|
|
evas_font_cache_set(evas, 1 * 1024 * 1024);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_font_path_append(evas, DAT"data/test/fonts");
|
2003-07-28 12:48:18 -07:00
|
|
|
evas_font_path_append(evas, "fonts");
|
2003-06-02 16:49:56 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
main_stop(void)
|
|
|
|
{
|
2004-01-14 09:19:16 -08:00
|
|
|
edje_shutdown();
|
2003-06-02 16:49:56 -07:00
|
|
|
ecore_evas_shutdown();
|
|
|
|
ecore_shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
main_resize(Ecore_Evas *ee)
|
|
|
|
{
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord w, h;
|
2003-06-02 16:49:56 -07:00
|
|
|
|
|
|
|
evas_output_viewport_get(evas, NULL, NULL, &w, &h);
|
2003-06-17 01:15:06 -07:00
|
|
|
bg_resize(w, h);
|
2003-06-02 16:49:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
main_signal_exit(void *data, int ev_type, void *ev)
|
|
|
|
{
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
main_delete_request(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
}
|
|
|
|
|
2003-07-15 22:15:15 -07:00
|
|
|
static void
|
|
|
|
main_pre_rend(Ecore_Evas *ee)
|
|
|
|
{
|
2003-08-03 00:00:03 -07:00
|
|
|
edje_thaw();
|
2003-07-15 22:15:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
main_post_rend(Ecore_Evas *ee)
|
|
|
|
{
|
2003-08-03 00:00:03 -07:00
|
|
|
edje_freeze();
|
2003-07-15 22:15:15 -07:00
|
|
|
}
|
|
|
|
|
2003-06-17 01:15:06 -07:00
|
|
|
void
|
|
|
|
bg_setup(void)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
|
2003-06-21 22:16:12 -07:00
|
|
|
o = evas_object_image_add(evas);
|
2003-06-17 01:15:06 -07:00
|
|
|
evas_object_move(o, 0, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_resize(o, startw, starth);
|
2003-06-17 01:15:06 -07:00
|
|
|
evas_object_layer_set(o, -999);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 255);
|
|
|
|
evas_object_image_file_set(o, DAT"data/test/images/bg.png", NULL);
|
|
|
|
evas_object_image_fill_set(o, 0, 0, 128, 128);
|
2003-06-22 00:58:54 -07:00
|
|
|
evas_object_pass_events_set(o, 1);
|
2003-06-17 01:15:06 -07:00
|
|
|
evas_object_show(o);
|
2003-07-07 00:55:18 -07:00
|
|
|
evas_object_focus_set(o, 1);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, bg_key_down, NULL);
|
2003-06-17 01:15:06 -07:00
|
|
|
o_bg = o;
|
2003-06-21 22:16:12 -07:00
|
|
|
|
|
|
|
o = evas_object_image_add(evas);
|
|
|
|
evas_object_move(o, 0, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_resize(o, startw, starth);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_layer_set(o, -999);
|
|
|
|
evas_object_color_set(o, 255, 255, 255, 255);
|
|
|
|
evas_object_image_file_set(o, DAT"data/test/images/shadow.png", NULL);
|
2003-07-10 16:19:55 -07:00
|
|
|
evas_object_image_smooth_scale_set(o, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_image_fill_set(o, 0, 0, startw, starth);
|
2003-06-22 00:58:54 -07:00
|
|
|
evas_object_pass_events_set(o, 1);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
o_shadow = o;
|
2003-06-17 01:15:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2003-10-17 20:34:54 -07:00
|
|
|
bg_resize(Evas_Coord w, Evas_Coord h)
|
2003-06-17 01:15:06 -07:00
|
|
|
{
|
|
|
|
evas_object_resize(o_bg, w, h);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_resize(o_shadow, w, h);
|
|
|
|
evas_object_image_fill_set(o_shadow, 0, 0, w, h);
|
2003-06-17 01:15:06 -07:00
|
|
|
}
|
|
|
|
|
2003-07-07 00:55:18 -07:00
|
|
|
static void
|
|
|
|
bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
|
2003-06-20 21:54:15 -07:00
|
|
|
{
|
2003-07-07 00:55:18 -07:00
|
|
|
Evas_Event_Key_Down *ev;
|
|
|
|
|
|
|
|
ev = (Evas_Event_Key_Down *)event_info;
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = edjes; l; l = l->next)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
|
|
|
|
de = l->data;
|
2003-07-14 19:21:58 -07:00
|
|
|
if (!strcmp(ev->keyname, "Return"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_play_set(de->edje, 1);
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Escape"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_play_set(de->edje, 0);
|
|
|
|
else if (!strcmp(ev->keyname, "a"))
|
|
|
|
edje_object_animation_set(de->edje, 1);
|
|
|
|
else if (!strcmp(ev->keyname, "s"))
|
|
|
|
edje_object_animation_set(de->edje, 0);
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Left"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_part_text_set(de->edje, "text", "String 1");
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Up"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_part_text_set(de->edje, "text", "Buttox");
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "Right"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_part_text_set(de->edje, "text", "You pressed \"U\". Nice one stenchie!");
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "F1"))
|
2003-11-03 22:15:19 -08:00
|
|
|
{
|
|
|
|
edje_object_color_class_set(de->edje, "bg",
|
|
|
|
255, 255, 255, 255,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
|
|
|
edje_color_class_set("fg",
|
|
|
|
0, 0, 0, 255,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
|
|
|
edje_text_class_set("plainjane", "Vera", 10);
|
|
|
|
}
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "F2"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_color_class_set(de->edje, "bg",
|
|
|
|
255, 200, 120, 255,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "F3"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_color_class_set(de->edje, "bg",
|
|
|
|
120, 200, 255, 200,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
2003-07-14 19:21:58 -07:00
|
|
|
else if (!strcmp(ev->keyname, "F4"))
|
2003-07-12 23:19:09 -07:00
|
|
|
edje_object_color_class_set(de->edje, "bg",
|
|
|
|
255, 200, 50, 100,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
2003-07-07 00:55:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-20 21:54:15 -07:00
|
|
|
|
|
|
|
static void cb (void *data, Evas_Object *o, const char *sig, const char *src);
|
|
|
|
|
|
|
|
static void
|
|
|
|
top_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
de->down_top = 1;
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_raise(de->image);
|
|
|
|
evas_object_raise(de->top);
|
|
|
|
evas_object_raise(de->bottom);
|
|
|
|
evas_object_raise(de->left);
|
|
|
|
evas_object_raise(de->right);
|
|
|
|
evas_object_raise(de->title_clip);
|
|
|
|
evas_object_raise(de->title);
|
|
|
|
evas_object_raise(de->edje);
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
top_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
de->down_top = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
top_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
Evas_Event_Mouse_Move *ev;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
ev = event_info;
|
|
|
|
if (de->down_top)
|
|
|
|
{
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord x, y;
|
2003-06-20 21:54:15 -07:00
|
|
|
|
|
|
|
evas_object_geometry_get(de->left, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->left,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
evas_object_geometry_get(de->right, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->right,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
evas_object_geometry_get(de->top, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->top,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
evas_object_geometry_get(de->bottom, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->bottom,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_geometry_get(de->title_clip, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->title_clip,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
evas_object_geometry_get(de->title, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->title,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
evas_object_geometry_get(de->image, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->image,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
2003-06-20 21:54:15 -07:00
|
|
|
evas_object_geometry_get(de->edje, &x, &y, NULL, NULL);
|
|
|
|
evas_object_move(de->edje,
|
|
|
|
x + ev->cur.canvas.x - ev->prev.canvas.x,
|
|
|
|
y + ev->cur.canvas.y - ev->prev.canvas.y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
bottom_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2003-06-20 21:54:15 -07:00
|
|
|
int hdir, vdir;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
ev = event_info;
|
|
|
|
de->down_bottom = 1;
|
|
|
|
evas_object_geometry_get(de->edje, &x, &y, &w, &h);
|
|
|
|
hdir = 1;
|
|
|
|
vdir = 1;
|
|
|
|
x -= 10;
|
|
|
|
y -= 20;
|
|
|
|
w += 20;
|
|
|
|
h += 30;
|
|
|
|
if ((ev->canvas.x - x) < (w / 2)) hdir = 0;
|
|
|
|
if ((ev->canvas.y - y) < (h / 2)) vdir = 0;
|
|
|
|
de->hdir = hdir;
|
|
|
|
de->vdir = vdir;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
bottom_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
de->down_bottom = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
bottom_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Demo_Edje *de;
|
|
|
|
Evas_Event_Mouse_Move *ev;
|
|
|
|
|
|
|
|
de = data;
|
|
|
|
ev = event_info;
|
|
|
|
if (de->down_bottom)
|
|
|
|
{
|
2004-01-20 09:53:18 -08:00
|
|
|
Evas_Coord x, y, w, h;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord minw, minh;
|
2003-06-20 21:54:15 -07:00
|
|
|
int hdir, vdir;
|
|
|
|
|
|
|
|
evas_object_geometry_get(de->edje, &x, &y, &w, &h);
|
|
|
|
hdir = de->hdir;
|
|
|
|
vdir = de->vdir;
|
|
|
|
x -= 10;
|
|
|
|
y -= 20;
|
|
|
|
w += 20;
|
|
|
|
h += 30;
|
2003-07-20 05:37:49 -07:00
|
|
|
minw = 20 + de->minw;
|
|
|
|
minh = 30 + de->minh;
|
2003-06-20 21:54:15 -07:00
|
|
|
if (hdir > 0)
|
|
|
|
{
|
|
|
|
w += ev->cur.canvas.x - ev->prev.canvas.x;
|
2003-07-15 01:26:06 -07:00
|
|
|
if (w < minw) w = minw;
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
w -= ev->cur.canvas.x - ev->prev.canvas.x;
|
|
|
|
x += ev->cur.canvas.x - ev->prev.canvas.x;
|
2003-07-15 01:26:06 -07:00
|
|
|
if (w < minw)
|
2003-06-20 21:54:15 -07:00
|
|
|
{
|
2003-07-15 01:26:06 -07:00
|
|
|
x += w - minw;
|
|
|
|
w = minw;
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (vdir > 0)
|
|
|
|
{
|
|
|
|
h += ev->cur.canvas.y - ev->prev.canvas.y;
|
2003-07-15 01:26:06 -07:00
|
|
|
if (h < minh) h = minh;
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
h -= ev->cur.canvas.y - ev->prev.canvas.y;
|
|
|
|
y += ev->cur.canvas.y - ev->prev.canvas.y;
|
2003-07-15 01:26:06 -07:00
|
|
|
if (h < minh)
|
2003-06-20 21:54:15 -07:00
|
|
|
{
|
2003-07-15 01:26:06 -07:00
|
|
|
y += h - minh;
|
|
|
|
h = minh;
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
evas_object_move(de->edje, x + 10, y + 20);
|
|
|
|
evas_object_resize(de->edje, w - 20, h - 30);
|
2003-08-08 20:32:21 -07:00
|
|
|
test_resize(de);
|
2003-06-20 21:54:15 -07:00
|
|
|
}
|
|
|
|
}
|
2003-06-17 01:15:06 -07:00
|
|
|
|
2003-08-03 00:00:03 -07:00
|
|
|
static void
|
|
|
|
list_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Collection *co;
|
|
|
|
|
|
|
|
co = data;
|
|
|
|
evas_object_image_file_set(co->bg, DAT"data/test/images/item_selected.png", NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
list_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Collection *co;
|
|
|
|
|
|
|
|
co = data;
|
|
|
|
evas_object_image_file_set(co->bg, DAT"data/test/images/item_normal.png", NULL);
|
|
|
|
test_setup(co->file, co->part);
|
|
|
|
evas_object_color_set(co->bg, 255, 255, 255, 128);
|
|
|
|
evas_object_color_set(co->text, 0, 0, 0, 128);
|
|
|
|
evas_object_pass_events_set(co->bg, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
list_head_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Collection *co;
|
|
|
|
|
|
|
|
co = data;
|
|
|
|
co->clicked = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
list_head_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Collection *co;
|
|
|
|
|
|
|
|
co = data;
|
|
|
|
co->clicked = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
list_head_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Collection *co;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord x, y;
|
2003-08-03 00:00:03 -07:00
|
|
|
Evas_Event_Mouse_Move *ev;
|
|
|
|
|
|
|
|
co = data;
|
|
|
|
if (!co->clicked) return;
|
|
|
|
ev = event_info;
|
|
|
|
evas_object_geometry_get(co->bg, &x, &y, NULL, NULL);
|
|
|
|
x += ev->cur.canvas.x - ev->prev.canvas.x;
|
|
|
|
y += ev->cur.canvas.y - ev->prev.canvas.y;
|
|
|
|
evas_object_move(co->bg, x, y);
|
|
|
|
test_list_move(co);
|
|
|
|
}
|
|
|
|
|
2003-06-20 19:51:01 -07:00
|
|
|
static void
|
|
|
|
cb (void *data, Evas_Object *o, const char *sig, const char *src)
|
|
|
|
{
|
2003-08-31 19:53:08 -07:00
|
|
|
printf("CALLBACK for %p %p \"%s\" \"%s\"\n", data, o, sig, src);
|
2003-08-15 06:35:25 -07:00
|
|
|
if (!strcmp(sig, "drag"))
|
|
|
|
{
|
2003-12-25 15:57:18 -08:00
|
|
|
double x, y;
|
2003-08-15 06:35:25 -07:00
|
|
|
|
|
|
|
edje_object_part_drag_value_get(o, src, &x, &y);
|
|
|
|
printf("Drag %3.3f %3.3f\n", x, y);
|
|
|
|
}
|
2003-06-20 19:51:01 -07:00
|
|
|
}
|
|
|
|
|
2003-08-03 00:00:03 -07:00
|
|
|
void
|
|
|
|
test_list_move(Collection *co_head)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord x, y;
|
2003-08-03 00:00:03 -07:00
|
|
|
|
|
|
|
evas_object_geometry_get(co_head->bg, &x, &y, NULL, NULL);
|
|
|
|
for (l = co_head->entries; l; l = l->next)
|
|
|
|
{
|
|
|
|
Collection *co;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord w, h;
|
2003-08-03 00:00:03 -07:00
|
|
|
|
|
|
|
co = l->data;
|
|
|
|
evas_object_geometry_get(co->text, NULL, NULL, &w, &h);
|
|
|
|
evas_object_resize(co->bg, co_head->maxw + 20, h + 10 + 10);
|
|
|
|
evas_object_image_fill_set(co->bg, 0, 0, co_head->maxw + 20, h + 10 + 10);
|
|
|
|
evas_object_move(co->bg, x, y);
|
|
|
|
evas_object_move(co->text, x + 10, y + ((h + 10 + 10 - h) / 2));
|
|
|
|
evas_object_show(co->bg);
|
|
|
|
evas_object_show(co->text);
|
|
|
|
y += h + 10 + 10 - 4 - 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-27 06:16:51 -07:00
|
|
|
void
|
|
|
|
test_list(char *file)
|
|
|
|
{
|
|
|
|
Evas_List *entries;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord maxw = 128;
|
2003-08-03 00:00:03 -07:00
|
|
|
Collection *co_head;
|
|
|
|
Evas_List *collections = NULL;
|
2003-07-27 06:16:51 -07:00
|
|
|
|
|
|
|
entries = edje_file_collection_list(file);
|
2003-08-05 07:33:35 -07:00
|
|
|
// printf("%s\n", edje_file_data_get(file, "My Data");
|
|
|
|
// printf("%s\n", edje_file_data_get(file, "The Key");
|
2003-08-03 00:00:03 -07:00
|
|
|
{
|
|
|
|
Collection *co;
|
|
|
|
Evas_Object *o;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord w, h;
|
2003-08-03 00:00:03 -07:00
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
co = calloc(1, sizeof(Collection));
|
|
|
|
collections = evas_list_append(collections, co);
|
|
|
|
co->file = strdup(file);
|
|
|
|
co->part = NULL;
|
|
|
|
co->header = 1;
|
|
|
|
|
|
|
|
o = evas_object_image_add(evas);
|
|
|
|
evas_object_layer_set(o, 10);
|
|
|
|
evas_object_image_border_set(o, 10, 10, 10, 10);
|
|
|
|
evas_object_image_file_set(o, DAT"data/test/images/item_title.png", NULL);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, list_head_down_cb, co);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, list_head_up_cb, co);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, list_head_move_cb, co);
|
|
|
|
co->bg = o;
|
|
|
|
|
|
|
|
o = evas_object_text_add(evas);
|
|
|
|
evas_object_layer_set(o, 10);
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 255);
|
|
|
|
snprintf(buf, sizeof(buf), "Collections: %s", file);
|
|
|
|
evas_object_text_text_set(o, buf);
|
|
|
|
evas_object_text_font_set(o, "Vera", 6);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
|
|
|
evas_object_geometry_get(o, NULL, NULL, &w, &h);
|
|
|
|
if (w > maxw) maxw = w;
|
|
|
|
co->text = o;
|
|
|
|
co_head = co;
|
|
|
|
}
|
2003-07-27 06:16:51 -07:00
|
|
|
if (entries)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
for (l = entries; l; l = l->next)
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
Collection *co;
|
|
|
|
Evas_Object *o;
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord w, h;
|
2003-07-27 06:16:51 -07:00
|
|
|
|
|
|
|
name = l->data;
|
|
|
|
co = calloc(1, sizeof(Collection));
|
|
|
|
collections = evas_list_append(collections, co);
|
|
|
|
co->file = strdup(file);
|
|
|
|
co->part = strdup(name);
|
|
|
|
|
|
|
|
o = evas_object_image_add(evas);
|
|
|
|
evas_object_layer_set(o, 10);
|
2003-08-03 00:00:03 -07:00
|
|
|
evas_object_image_border_set(o, 10, 10, 10, 10);
|
|
|
|
evas_object_image_file_set(o, DAT"data/test/images/item_normal.png", NULL);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, list_down_cb, co);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, list_up_cb, co);
|
2003-07-27 06:16:51 -07:00
|
|
|
co->bg = o;
|
|
|
|
|
|
|
|
o = evas_object_text_add(evas);
|
|
|
|
evas_object_layer_set(o, 10);
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 255);
|
2003-09-09 00:22:54 -07:00
|
|
|
printf("%s\n", co->part);
|
2003-07-27 06:16:51 -07:00
|
|
|
evas_object_text_text_set(o, co->part);
|
|
|
|
evas_object_text_font_set(o, "Vera", 6);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
2003-08-03 00:00:03 -07:00
|
|
|
evas_object_geometry_get(o, NULL, NULL, &w, &h);
|
|
|
|
if (w > maxw) maxw = w;
|
2003-07-27 06:16:51 -07:00
|
|
|
co->text = o;
|
|
|
|
}
|
|
|
|
edje_file_collection_list_free(entries);
|
2003-08-03 00:00:03 -07:00
|
|
|
co_head->maxw = maxw;
|
|
|
|
co_head->entries = collections;
|
|
|
|
test_list_move(co_head);
|
2003-07-27 06:16:51 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-08-08 20:32:21 -07:00
|
|
|
void
|
|
|
|
test_resize(Demo_Edje *de)
|
|
|
|
{
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord x, y, w, h, tw, th;
|
|
|
|
Evas_Coord minw, minh;
|
2003-08-08 20:32:21 -07:00
|
|
|
|
|
|
|
evas_object_geometry_get(de->edje, &x, &y, &w, &h);
|
|
|
|
x -= 10;
|
|
|
|
y -= 20;
|
|
|
|
w += 20;
|
|
|
|
h += 30;
|
|
|
|
minw = 20 + de->minw;
|
|
|
|
minh = 30 + de->minh;
|
|
|
|
evas_object_move(de->left, x, y + 20);
|
|
|
|
evas_object_resize(de->left, 10, h - 30);
|
|
|
|
evas_object_move(de->right, x + w - 10, y + 20);
|
|
|
|
evas_object_resize(de->right, 10, h - 30);
|
|
|
|
evas_object_move(de->top, x, y);
|
|
|
|
evas_object_resize(de->top, w, 20);
|
|
|
|
evas_object_move(de->bottom, x, y + (h - 10));
|
|
|
|
evas_object_resize(de->bottom, w, 10);
|
|
|
|
evas_object_move(de->title_clip, x + 20, y);
|
|
|
|
evas_object_resize(de->title_clip, w - 40, 20);
|
|
|
|
evas_object_geometry_get(de->title, NULL, NULL, &tw, &th);
|
|
|
|
evas_object_move(de->title, x + ((w - tw) / 2), y + 4 + ((16 - th) / 2));
|
|
|
|
evas_object_move(de->image, x, y);
|
|
|
|
evas_object_resize(de->image, w, h);
|
|
|
|
evas_object_image_fill_set(de->image, 0, 0, w, h);
|
|
|
|
evas_object_move(de->edje, x + 10, y + 20);
|
|
|
|
evas_object_resize(de->edje, w - 20, h - 30);
|
|
|
|
}
|
|
|
|
|
2003-06-17 01:15:06 -07:00
|
|
|
void
|
|
|
|
test_setup(char *file, char *name)
|
|
|
|
{
|
|
|
|
Evas_Object *o;
|
2003-06-20 21:54:15 -07:00
|
|
|
Demo_Edje *de;
|
2003-06-21 22:16:12 -07:00
|
|
|
char buf[1024];
|
2003-10-17 20:34:54 -07:00
|
|
|
Evas_Coord tw, th, w, h;
|
|
|
|
Evas_Coord xx, yy, ww, hh;
|
2003-09-09 00:22:54 -07:00
|
|
|
|
|
|
|
xx = 10;
|
|
|
|
yy = 10;
|
|
|
|
ww = startw - 40;
|
|
|
|
hh = starth - 50;
|
2003-06-20 21:54:15 -07:00
|
|
|
|
|
|
|
de = calloc(1, sizeof(Demo_Edje));
|
|
|
|
edjes = evas_list_append(edjes, de);
|
|
|
|
|
2003-06-21 22:16:12 -07:00
|
|
|
o = evas_object_image_add(evas);
|
|
|
|
evas_object_image_file_set(o, DAT"data/test/images/border.png", NULL);
|
2003-07-10 16:19:55 -07:00
|
|
|
evas_object_image_smooth_scale_set(o, 0);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 255);
|
|
|
|
evas_object_image_border_set(o, 26, 26, 26, 26);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_image_fill_set(o, 0, 0, ww, hh);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_pass_events_set(o, 1);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx, yy);
|
|
|
|
evas_object_resize(o, ww, hh);
|
2003-06-21 22:16:12 -07:00
|
|
|
de->image = o;
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2003-06-20 21:54:15 -07:00
|
|
|
o = evas_object_rectangle_add(evas);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx, yy);
|
|
|
|
evas_object_resize(o, ww, 20);
|
2003-06-20 21:54:15 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, top_down_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, top_up_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, top_move_cb, de);
|
|
|
|
de->top = o;
|
|
|
|
|
|
|
|
o = evas_object_rectangle_add(evas);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx, yy + hh - 10);
|
|
|
|
evas_object_resize(o, ww, 10);
|
2003-06-20 21:54:15 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, bottom_down_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, bottom_up_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, bottom_move_cb, de);
|
|
|
|
de->bottom = o;
|
|
|
|
|
|
|
|
o = evas_object_rectangle_add(evas);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx, yy + 20);
|
|
|
|
evas_object_resize(o, 10, hh - 20 - 10);
|
2003-06-20 21:54:15 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, bottom_down_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, bottom_up_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, bottom_move_cb, de);
|
|
|
|
de->left = o;
|
|
|
|
|
|
|
|
o = evas_object_rectangle_add(evas);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_color_set(o, 255, 255, 255, 0);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx + ww - 10, yy + 20);
|
|
|
|
evas_object_resize(o, 10, hh - 20 - 10);
|
2003-06-20 21:54:15 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, bottom_down_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, bottom_up_cb, de);
|
|
|
|
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, bottom_move_cb, de);
|
|
|
|
de->right = o;
|
2003-06-21 22:16:12 -07:00
|
|
|
|
|
|
|
o = evas_object_rectangle_add(evas);
|
|
|
|
evas_object_color_set(o, 255, 255, 255, 255);
|
|
|
|
evas_object_pass_events_set(o, 1);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx + 20, yy);
|
|
|
|
evas_object_resize(o, ww - 20 - 20, 20);
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
de->title_clip = o;
|
|
|
|
|
|
|
|
o = evas_object_text_add(evas);
|
|
|
|
evas_object_color_set(o, 0, 0, 0, 255);
|
|
|
|
snprintf(buf, sizeof(buf), "%s - %s", file, name);
|
|
|
|
evas_object_text_text_set(o, buf);
|
|
|
|
evas_object_text_font_set(o, "Vera", 6);
|
|
|
|
evas_object_geometry_get(o, NULL, NULL, &tw, &th);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx + ((ww - tw) / 2), yy + 4 + ((16 - th) / 2));
|
2003-06-21 22:16:12 -07:00
|
|
|
evas_object_pass_events_set(o, 1);
|
|
|
|
evas_object_clip_set(o, de->title_clip);
|
|
|
|
evas_object_show(o);
|
|
|
|
de->title = o;
|
2003-06-17 01:15:06 -07:00
|
|
|
|
2003-07-08 03:08:15 -07:00
|
|
|
o = edje_object_add(evas);
|
|
|
|
edje_object_file_set(o, file, name);
|
2003-08-05 07:33:35 -07:00
|
|
|
// edje_object_signal_callback_add(o, "do_it", "the_source", cb, NULL);
|
|
|
|
// edje_object_signal_callback_add(o, "mouse,*", "logo", cb, NULL);
|
2003-08-31 19:53:08 -07:00
|
|
|
edje_object_signal_callback_add(o, "*", "*", cb, NULL);
|
|
|
|
edje_object_part_drag_size_set(o, "dragable", 0.01, 0.5);
|
2003-08-15 06:35:25 -07:00
|
|
|
// edje_object_part_drag_value_set(o, "dragable", 0.5, 0.5);
|
2003-08-31 19:53:08 -07:00
|
|
|
edje_object_part_drag_step_set(o, "dragable", 0.1, 0.1);
|
|
|
|
edje_object_part_drag_page_set(o, "dragable", 0.2, 0.2);
|
2003-09-09 00:22:54 -07:00
|
|
|
evas_object_move(o, xx + 10, yy + 20);
|
2003-06-17 01:15:06 -07:00
|
|
|
evas_object_show(o);
|
2003-07-15 01:26:06 -07:00
|
|
|
edje_object_size_min_get(o, &(de->minw), &(de->minh));
|
2003-09-09 00:22:54 -07:00
|
|
|
w = ww;
|
|
|
|
h = hh;
|
|
|
|
if (ww < de->minw) w = de->minw;
|
|
|
|
if (hh < de->minh) h = de->minh;
|
2003-08-05 06:38:44 -07:00
|
|
|
evas_object_resize(o, w, h);
|
2003-06-20 21:54:15 -07:00
|
|
|
de->edje = o;
|
2003-08-05 07:33:35 -07:00
|
|
|
|
2003-08-08 20:32:21 -07:00
|
|
|
test_resize(de);
|
2003-08-05 07:33:35 -07:00
|
|
|
// printf("%s\n", edje_object_data_get(o, "My Data"));
|
|
|
|
// printf("%s\n", edje_object_data_get(o, "The Key"));
|
2003-07-12 23:19:09 -07:00
|
|
|
|
|
|
|
/* test swallowing */
|
|
|
|
/*
|
|
|
|
o = edje_object_add(evas);
|
|
|
|
edje_object_file_set(o, file, name);
|
|
|
|
edje_object_part_swallow(de->edje, "swallow", o);
|
|
|
|
evas_object_show(o);
|
|
|
|
*/
|
2003-06-17 01:15:06 -07:00
|
|
|
}
|
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
2003-06-20 03:44:36 -07:00
|
|
|
{
|
2003-06-21 22:16:12 -07:00
|
|
|
int i;
|
2003-06-20 03:44:36 -07:00
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
if (main_start(argc, argv) < 1) return -1;
|
2003-06-17 01:15:06 -07:00
|
|
|
|
|
|
|
edje_init();
|
2003-06-19 07:43:49 -07:00
|
|
|
edje_frametime_set(1.0 / 60.0); /* 60 fps */
|
2003-06-17 01:15:06 -07:00
|
|
|
|
|
|
|
bg_setup();
|
|
|
|
|
2003-06-20 03:44:36 -07:00
|
|
|
if (argc < 2)
|
|
|
|
{
|
2003-06-21 22:16:12 -07:00
|
|
|
printf("Usage:\n");
|
2003-09-09 00:22:54 -07:00
|
|
|
printf(" %s file_to_show.eet [-gl] [-g WxH] [collection_to_show] ...\n", argv[0]);
|
2003-06-21 22:16:12 -07:00
|
|
|
printf("\n");
|
|
|
|
printf("Example:\n");
|
2003-07-27 06:16:51 -07:00
|
|
|
printf(" %s data/e_logo.eet\n", argv[0]);
|
2003-06-21 22:16:12 -07:00
|
|
|
printf(" %s data/e_logo.eet test\n", argv[0]);
|
|
|
|
printf(" %s data/e_logo.eet test ~/test.eet my_thing ...\n", argv[0]);
|
2003-06-20 03:44:36 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
2003-07-27 06:16:51 -07:00
|
|
|
for (i = 1; i < argc; i++)
|
2003-06-21 22:16:12 -07:00
|
|
|
{
|
|
|
|
char *file;
|
2003-07-27 06:16:51 -07:00
|
|
|
int done;
|
2003-06-21 22:16:12 -07:00
|
|
|
|
2003-07-27 06:16:51 -07:00
|
|
|
done = 0;
|
2003-06-21 22:16:12 -07:00
|
|
|
file = argv[i];
|
2003-09-09 00:22:54 -07:00
|
|
|
if (((!strcmp(file, "-g")) ||
|
|
|
|
(!strcmp(file, "-geometry")) ||
|
|
|
|
(!strcmp(file, "--geometry"))) && (i < (argc - 1)))
|
|
|
|
i++;
|
2003-09-06 22:16:08 -07:00
|
|
|
if (file[0] == '-') continue;
|
2003-09-09 00:22:54 -07:00
|
|
|
if (!done) test_list(file);
|
2003-06-21 22:16:12 -07:00
|
|
|
}
|
2003-06-02 16:49:56 -07:00
|
|
|
|
|
|
|
ecore_main_loop_begin();
|
|
|
|
|
|
|
|
main_stop();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|