diff --git a/legacy/edje/src/examples/Makefile.am b/legacy/edje/src/examples/Makefile.am index e3893cd03d..5c90fded10 100644 --- a/legacy/edje/src/examples/Makefile.am +++ b/legacy/edje/src/examples/Makefile.am @@ -8,8 +8,10 @@ EDJE_CC_FLAGS = $(EDJE_CC_FLAGS_$(V)) -id $(srcdir) -fd $(srcdir) examplesdir = $(datadir)/$(PACKAGE)/examples if ENABLE_MULTISENSE +MULTISENSE_BIN_FILE = edje-multisense +MULTISENSE_C_FILE = edje-multisense.c MULTISENSE_EDC_FILE = multisense.edc -SND_DIR = -sd $(srcdir) +SND_DIR = -sd $(srcdir) endif #put here all EDCs one needs to the examples @@ -41,6 +43,7 @@ files_DATA = \ red.png \ test.png \ Vera.ttf \ + duck.wav \ edje-basic.c \ edje-swallow.c \ edje-text.c \ @@ -52,7 +55,8 @@ files_DATA = \ edje-color-class.c \ edje-perspective.c \ edje-animations.c \ - sigtest.c + sigtest.c \ + $(MULTISENSE_C_FILE) EXTRA_DIST = $(files_DATA) @@ -81,7 +85,8 @@ examples_PROGRAMS = \ edje-swallow \ edje-table \ edje-text \ - sigtest + sigtest \ + $(MULTISENSE_BIN_FILE) LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ diff --git a/legacy/edje/src/examples/duck.wav b/legacy/edje/src/examples/duck.wav new file mode 100644 index 0000000000..04a62dce97 Binary files /dev/null and b/legacy/edje/src/examples/duck.wav differ diff --git a/legacy/edje/src/examples/edje-multisense.c b/legacy/edje/src/examples/edje-multisense.c new file mode 100644 index 0000000000..c66c5681b7 --- /dev/null +++ b/legacy/edje/src/examples/edje-multisense.c @@ -0,0 +1,80 @@ +/** + * Simple example illustrating the very basic functions of multisense + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one) and multisense support ine edje. See stdout/stderr for output. + * + * @verbatim + * gcc -o edje-multisense edje-multisense.c `pkg-config --libs --cflags eina evas ecore ecore-evas edje` + * @endverbatim + */ + +#include +#include +#include +#include +#include + +#define WIDTH 300 +#define HEIGHT 300 + +static Evas_Object *create_my_group(Evas *canvas) +{ + Evas_Object *edje; + + edje = edje_object_add(canvas); + if (!edje) + { + EINA_LOG_CRIT("could not create edje object!"); + return NULL; + } + + if (!edje_object_file_set(edje, "multisense.edj", "example_group")) + { + int err = edje_object_load_error_get(edje); + const char *errmsg = edje_load_error_str(err); + EINA_LOG_ERR("could not load 'example_group' from multisense.edj: %s", + errmsg); + + evas_object_del(edje); + return NULL; + } + + evas_object_move(edje, 0, 0); + evas_object_resize(edje, WIDTH, HEIGHT); + evas_object_show(edje); + return edje; +} + +int main(int argc, char *argv[]) +{ + Ecore_Evas *window; + Evas *canvas; + Evas_Object *edje; + + ecore_evas_init(); + edje_init(); + + window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + if (!window) + { + EINA_LOG_CRIT("could not create window."); + return -1; + } + canvas = ecore_evas_get(window); + + edje = create_my_group(canvas); + if (!edje) + return -2; + + ecore_evas_show(window); + ecore_main_loop_begin(); + + evas_object_del(edje); + ecore_evas_free(window); + + edje_shutdown(); + ecore_evas_shutdown(); + + return 0; +} diff --git a/legacy/edje/src/examples/multisense.edc b/legacy/edje/src/examples/multisense.edc index 5a3cf79690..3cbaf677eb 100644 --- a/legacy/edje/src/examples/multisense.edc +++ b/legacy/edje/src/examples/multisense.edc @@ -1,43 +1,8 @@ -#if 0 collections { sounds { sample { name: "sound_name1" RAW; - source: "8806__jovica__basic-sine-wave-g-1.wav"; -// source: "sample.wav"; -// source: "sample-flac10k.wav"; -// source: "sample-flac10k-mono.wav"; - } -// sample { -// name: "sound_name2" COMP; -// source: "sample.wav"; -// } -/* - sample { - name: "sound_name3" LOSSY 0.5; - source: "sample.wav"; - } - sample { - name: "sound_name4" AS_IS; - source: "sample.wav"; - } - */ - sample { -// name: "sound_name5" AS_IS; -// name: "sound_name5" COMP; - name: "sound_name5" RAW; -// source: "sample-ogg.wav"; - source: "sample-ogg-mono.wav"; -// source: "sample-ogg10k.wav"; -// source: "sample-flac10k.wav"; -// source: "sample-flac10k-mono.wav"; - } - sample { - name: "sound_name6" AS_IS; -// name: "sound_name6" LOSSY 45.0; - source: "sample-flac44k-mono.wav"; -// source: "sample-flac.wav"; -// source: "sample.ogg"; + source: "duck.wav"; } tone: "tone-name" 2600; } @@ -95,7 +60,7 @@ collections { name: "tone_text"; type: TEXT; mouse_events: 1; - repeat_events : 1; + repeat_events: 1; description { state: "default" 0.0; rel1.to: "tone_bg"; @@ -114,18 +79,6 @@ collections { source: "sample_bg"; action: PLAY_SAMPLE "sound_name1" 1.0; } - program { - name: "click_sample2"; - signal: "mouse,down,2"; - source: "sample_bg"; - action: PLAY_SAMPLE "sound_name5" 1.0; - } - program { - name: "click_sample3"; - signal: "mouse,down,3"; - source: "sample_bg"; - action: PLAY_SAMPLE "sound_name6" 1.0; - } program { name: "click_tone"; signal: "mouse,down,1"; @@ -136,4 +89,3 @@ collections { } } } -#endif