Elementary: new tests for edje-external of some widgets, buttons and slider done so far, more to come.

All the interaction in this tests are 'pure edje', no c code involved at all.

NOTE: 2 little external bugs are hilighted in the tests, didn't found the time to look for fixes :(

SVN revision: 76322
This commit is contained in:
Davide Andreoli 2012-09-07 20:16:30 +00:00
parent 3ec80df062
commit fd3beecb0f
5 changed files with 518 additions and 3 deletions

View File

@ -9,10 +9,11 @@ EDJE_FLAGS = $(EDJE_FLAGS_$(V)) -id $(top_srcdir)/data/objects -fd $(top_srcdir)
filesdir = $(datadir)/elementary/objects
files_DATA = test.edj multip.edj cursors.edj font_preview.edj postit_ent.edj multibuttonentry.edj
files_DATA = test.edj test_external.edj multip.edj cursors.edj font_preview.edj postit_ent.edj multibuttonentry.edj
EXTRA_DIST = \
test.edc \
test_external.edc \
multip.edc \
cursors.edc \
font_preview.edc \
@ -29,6 +30,11 @@ test.edj: Makefile $(EXTRA_DIST)
$(top_srcdir)/data/objects/test.edc \
$(top_builddir)/data/objects/test.edj
test_external.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/objects/test_external.edc \
$(top_builddir)/data/objects/test_external.edj
multip.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/objects/multip.edc \

View File

@ -0,0 +1,451 @@
#define COMMON_EXTERNAL_UNDER \
part { name: "clip"; \
type: RECT; \
description { state: "default" 0.0; \
} \
} \
part { name: "under"; \
mouse_events: 0; \
clip_to: "clip"; \
description { state: "default" 0.0; \
align: 0.5 0.0; \
aspect: 2.6255 2.6255; \
image.normal: "sky.jpg"; \
} \
}
#define COMMON_EXTERNAL_OVER \
part { name: "over"; \
mouse_events: 0; \
clip_to: "clip"; \
description { state: "default" 0.0; \
fill { \
smooth: 0; \
origin { \
relative: 0.0 0.0; \
offset: 0 0; \
} \
size { \
relative: 1.84722 1.0; \
offset: 0 0; \
} \
} \
image.normal: "clo.png"; \
} \
description { state: "drift" 0.0; \
inherit: "default" 0.0; \
fill { \
origin { \
relative: 1.84722 0.0; \
offset: 0 0; \
} \
size { \
relative: 1.84722 1.0; \
offset: 0 0; \
} \
} \
} \
}
#define COMMON_EXTERNAL_PROGRAM \
program { name: "anim1"; \
signal: "load"; \
source: ""; \
action: STATE_SET "drift" 0.0; \
transition: LINEAR 10.0; \
target: "over"; \
after: "anim2"; \
} \
program { name: "anim2"; \
action: STATE_SET "default" 0.0; \
target: "over"; \
after: "anim1"; \
}
images {
image: "sky.jpg" COMP;
image: "clo.png" LOSSY 60;
}
collections {
group { name: "external/button";
parts {
COMMON_EXTERNAL_UNDER
part { name: "ext_label1";
type: EXTERNAL;
source: "elm/label";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
params {
string: "label" "<b>Label and Buttons are edje externals</>\
<br>Click buttons to perform edje animations.<br><b>BUG</>: disabled style.";
}
}
}
part { name: "ext_button1";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
rel1.offset: 0 60;
params {
string: "label" "icon + label";
string: "icon" "home";
}
}
}
part { name: "ext_button2";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
rel1.offset: 0 120;
params {
string: "label" "only label";
}
}
}
part { name: "ext_button3";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 50 50;
align: 0.5 0.0;
rel1.offset: 0 180;
params {
string: "icon" "home";
}
}
description { state: "left" 0.0;
inherit: "default" 0.0;
align: 0.2 0.0;
}
description { state: "right" 0.0;
inherit: "default" 0.0;
align: 0.8 0.0;
}
}
part { name: "ext_button4";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
rel1.offset: 0 240;
params {
string: "label" "anchor style";
string: "style" "anchor";
}
}
}
part { name: "ext_button5";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
rel1.offset: 0 300;
params {
string: "label" "disabled";
string: "icon" "home";
bool: "disabled" 1;
}
}
}
COMMON_EXTERNAL_OVER
}
programs {
COMMON_EXTERNAL_PROGRAM
program { name: "btn1_click";
signal: "clicked";
source: "ext_button1";
action: STATE_SET "left" 0.0;
transition: SINUSOIDAL 0.6 CURRENT;
target: "ext_button3";
}
program { name: "btn2_click";
signal: "clicked";
source: "ext_button2";
action: STATE_SET "right" 0.0;
transition: SINUSOIDAL 0.6 CURRENT;
target: "ext_button3";
}
program { name: "btn4_click";
signal: "clicked";
source: "ext_button4";
action: STATE_SET "default" 0.0;
transition: SINUSOIDAL 0.6 CURRENT;
target: "ext_button3";
}
}
}
group { name: "external/slider";
parts {
COMMON_EXTERNAL_UNDER
part { name: "ext_label1";
type: EXTERNAL;
source: "elm/label";
clip_to: "clip";
description { state: "default" 0.0;
max: 200 50;
align: 0.5 0.0;
params {
string: "label" "<b>All the Widgets and the Interaction are pure edje</>\
<br>The first one is linked with the 3 verticals.<br><b>BUG</>: vertical+disabled.";
}
}
}
part { name: "ext_slider1";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 300 50;
align: 0.5 0.0;
rel1.offset: 0 60;
params {
string: "label" "Horizontal";
string: "icon" "home";
string: "unit format" "%.1f units";
string: "indicator format" "%.0f";
double: "min" -100.0;
double: "max" 100.0;
}
}
}
part { name: "ext_slider2";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 300 50;
align: 0.5 0.0;
rel1.offset: 0 90;
params {
string: "label" "Disabled";
string: "icon" "home";
bool: "disabled" 1;
double: "value" 0.5;
}
}
}
part { name: "ext_slider3";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 300 50;
align: 0.5 0.0;
rel1.offset: 0 120;
params {
string: "label" "Inverted";
bool: "inverted" 1;
}
}
}
part { name: "ext_slider4";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 50 300;
align: 0.0 0.0;
rel1.offset: 20 160;
params {
string: "label" "Horizontal";
string: "icon" "home";
bool: "horizontal" 0;
string: "unit format" "%.0f u";
string: "indicator format" "%.3f";
double: "min" -100.0;
double: "max" 100.0;
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 140 160;
}
}
part { name: "ext_slider5";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 50 300;
align: 0.0 0.0;
rel1.offset: 80 160;
params {
string: "label" "Inverted";
string: "icon" "home";
bool: "horizontal" 0;
bool: "inverted" 1;
string: "unit format" "%.0f u";
string: "indicator format" "%.3f";
double: "min" -100.0;
double: "max" 100.0;
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 200 160;
}
}
part { name: "ext_slider6";
type: EXTERNAL;
source: "elm/slider";
clip_to: "clip";
description { state: "default" 0.0;
max: 50 300;
align: 0.0 0.0;
rel1.offset: 140 160;
params {
string: "label" "Disabled";
string: "icon" "home";
double: "min" -70.0;
double: "max" 70.0;
bool: "disabled" 1;
bool: "horizontal" 0;
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 260 160;
}
}
part { name: "ext_button1";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 80 40;
align: 0.0 0.0;
rel1.offset: 200 230;
params {
string: "label" "reset all";
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 30 230;
}
}
part { name: "ext_button2";
type: EXTERNAL;
source: "elm/button";
clip_to: "clip";
description { state: "default" 0.0;
max: 80 40;
align: 0.0 0.0;
rel1.offset: 200 270;
params {
string: "label" "animate";
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 30 270;
}
}
part { name: "ext_check1";
type: EXTERNAL;
source: "elm/check";
clip_to: "clip";
description { state: "default" 0.0;
max: 80 40;
align: 0.0 0.0;
rel1.offset: 200 310;
params {
string: "label" "disable first";
}
}
description { state: "anim" 0.0;
inherit: "default" 0.0;
rel1.offset: 30 310;
}
}
COMMON_EXTERNAL_OVER
}
programs {
COMMON_EXTERNAL_PROGRAM
program { name: "link";
signal: "changed";
source: "ext_slider1";
action: PARAM_COPY "ext_slider1" "value" "ext_slider4" "value";
after: "link2";
}
program { name: "link2";
action: PARAM_COPY "ext_slider1" "value" "ext_slider5" "value";
after: "link3";
}
program { name: "link3";
action: PARAM_COPY "ext_slider1" "value" "ext_slider6" "value";
}
program { name: "reset";
signal: "clicked";
source: "ext_button1";
action: PARAM_SET "ext_slider1" "value" 0.0;
after: "reset2";
}
program { name: "reset2";
action: PARAM_SET "ext_slider2" "value" 0.0;
after: "reset3";
}
program { name: "reset3";
action: PARAM_SET "ext_slider3" "value" 0.0;
after: "reset4";
}
program { name: "reset4";
action: PARAM_SET "ext_slider4" "value" 0.0;
after: "reset5";
}
program { name: "reset5";
action: PARAM_SET "ext_slider5" "value" 0.0;
after: "reset6";
}
program { name: "reset6";
action: PARAM_SET "ext_slider6" "value" 0.0;
}
program { name: "disable_first";
signal: "changed";
source: "ext_check1";
action: PARAM_COPY "ext_check1" "state" "ext_slider1" "disabled";
}
program { name: "animate";
signal: "clicked";
source: "ext_button2";
filter: "ext_slider4" "default" 0.0;
action: STATE_SET "anim" 0.0;
transition: SPRING 1.5 0.0 5.0;
target: "ext_slider4";
target: "ext_slider5";
target: "ext_slider6";
target: "ext_button1";
target: "ext_button2";
target: "ext_check1";
}
program { name: "animate_reverse";
signal: "clicked";
source: "ext_button2";
filter: "ext_slider4" "anim" 0.0;
action: STATE_SET "default" 0.0;
transition: BOUNCE 1.5 0.0 5.0;
target: "ext_slider4";
target: "ext_slider5";
target: "ext_slider6";
target: "ext_button1";
target: "ext_button2";
target: "ext_check1";
}
}
}
}

View File

@ -58,6 +58,7 @@ test_diskselector.c \
test_entry.c \
test_entry_anchor.c \
test_entry_anchor2.c \
test_external.c \
test_fileselector_button.c \
test_fileselector.c \
test_fileselector_entry.c \

View File

@ -184,6 +184,8 @@ void test_datetime(void *data, Evas_Object *obj, void *event_info);
void test_popup(void *data, Evas_Object *obj, void *event_info);
void test_dayselector(void *data, Evas_Object *obj, void *event_info);
void test_image(void *data, Evas_Object *obj, void *event_info);
void test_external_button(void *data, Evas_Object *obj, void *event_info);
void test_external_slider(void *data, Evas_Object *obj, void *event_info);
#ifdef HAVE_EMOTION
void test_video(void *data, Evas_Object *obj, void *event_info);
#endif
@ -527,6 +529,10 @@ add_tests:
ADD_TEST(NULL, "Effects", "Flip Page", test_flip_page);
ADD_TEST(NULL, "Effects", "Animation", test_anim);
//------------------------------//
ADD_TEST(NULL, "Edje External", "ExtButton", test_external_button);
ADD_TEST(NULL, "Edje External", "ExtSlider", test_external_slider);
//------------------------------//
ADD_TEST(NULL, "Toolbars", "Toolbar", test_toolbar);
ADD_TEST(NULL, "Toolbars", "Toolbar 2", test_toolbar2);
@ -697,10 +703,9 @@ add_tests:
if (autorun)
{
size_t alen = strlen(autorun);
EINA_LIST_FOREACH(tests, l, t)
{
if ((t->name) && (t->cb) && (!strncasecmp(t->name, autorun, alen)))
if ((t->name) && (t->cb) && (!strcasecmp(t->name, autorun)))
{
t->cb(NULL, NULL, NULL);
break;

View File

@ -0,0 +1,52 @@
#include "test.h"
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
void
test_external_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *win, *ly;
char buf[PATH_MAX];
win = elm_win_util_standard_add("ext_button", "Edje External Button");
elm_win_autodel_set(win, EINA_TRUE);
ly = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test_external.edj", elm_app_data_dir_get());
elm_layout_file_set(ly, buf, "external/button");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, ly);
evas_object_show(ly);
evas_object_resize(win, 320, 400);
evas_object_show(win);
}
void
test_external_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *win, *ly;
char buf[PATH_MAX];
win = elm_win_util_standard_add("ext_slider", "Edje External Slider");
elm_win_autodel_set(win, EINA_TRUE);
ly = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test_external.edj", elm_app_data_dir_get());
elm_layout_file_set(ly, buf, "external/slider");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, ly);
evas_object_show(ly);
evas_object_resize(win, 320, 400);
evas_object_show(win);
}
#endif