From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- libraries/edje/src/examples/Makefile.am | 107 +++ libraries/edje/src/examples/Makefile.in | 827 +++++++++++++++++++++ libraries/edje/src/examples/animations.edc | 93 +++ libraries/edje/src/examples/basic.edc | 39 + libraries/edje/src/examples/box.edc | 142 ++++ libraries/edje/src/examples/bubble.png | Bin 0 -> 4737 bytes libraries/edje/src/examples/color-class.edc | 87 +++ libraries/edje/src/examples/drag.edc | 89 +++ libraries/edje/src/examples/edje-animations.c | 156 ++++ libraries/edje/src/examples/edje-basic.c | 226 ++++++ libraries/edje/src/examples/edje-box.c | 191 +++++ libraries/edje/src/examples/edje-box2.c | 204 +++++ libraries/edje/src/examples/edje-color-class.c | 257 +++++++ libraries/edje/src/examples/edje-drag.c | 157 ++++ libraries/edje/src/examples/edje-perspective.c | 201 +++++ .../edje/src/examples/edje-signals-messages.c | 230 ++++++ libraries/edje/src/examples/edje-swallow.c | 95 +++ libraries/edje/src/examples/edje-table.c | 165 ++++ libraries/edje/src/examples/edje-text.c | 92 +++ libraries/edje/src/examples/lua_script.edc | 405 ++++++++++ libraries/edje/src/examples/perspective.edc | 140 ++++ libraries/edje/src/examples/red.png | Bin 0 -> 225 bytes libraries/edje/src/examples/signals-messages.edc | 174 +++++ libraries/edje/src/examples/sigtest.c | 309 ++++++++ libraries/edje/src/examples/sigtest.edc | 303 ++++++++ libraries/edje/src/examples/swallow.edc | 21 + libraries/edje/src/examples/table.edc | 19 + libraries/edje/src/examples/test.png | Bin 0 -> 22869 bytes libraries/edje/src/examples/text.edc | 68 ++ 29 files changed, 4797 insertions(+) create mode 100644 libraries/edje/src/examples/Makefile.am create mode 100644 libraries/edje/src/examples/Makefile.in create mode 100644 libraries/edje/src/examples/animations.edc create mode 100644 libraries/edje/src/examples/basic.edc create mode 100644 libraries/edje/src/examples/box.edc create mode 100644 libraries/edje/src/examples/bubble.png create mode 100644 libraries/edje/src/examples/color-class.edc create mode 100644 libraries/edje/src/examples/drag.edc create mode 100644 libraries/edje/src/examples/edje-animations.c create mode 100644 libraries/edje/src/examples/edje-basic.c create mode 100644 libraries/edje/src/examples/edje-box.c create mode 100644 libraries/edje/src/examples/edje-box2.c create mode 100644 libraries/edje/src/examples/edje-color-class.c create mode 100644 libraries/edje/src/examples/edje-drag.c create mode 100644 libraries/edje/src/examples/edje-perspective.c create mode 100644 libraries/edje/src/examples/edje-signals-messages.c create mode 100644 libraries/edje/src/examples/edje-swallow.c create mode 100644 libraries/edje/src/examples/edje-table.c create mode 100644 libraries/edje/src/examples/edje-text.c create mode 100644 libraries/edje/src/examples/lua_script.edc create mode 100644 libraries/edje/src/examples/perspective.edc create mode 100644 libraries/edje/src/examples/red.png create mode 100644 libraries/edje/src/examples/signals-messages.edc create mode 100644 libraries/edje/src/examples/sigtest.c create mode 100644 libraries/edje/src/examples/sigtest.edc create mode 100644 libraries/edje/src/examples/swallow.edc create mode 100644 libraries/edje/src/examples/table.edc create mode 100644 libraries/edje/src/examples/test.png create mode 100644 libraries/edje/src/examples/text.edc (limited to 'libraries/edje/src/examples') diff --git a/libraries/edje/src/examples/Makefile.am b/libraries/edje/src/examples/Makefile.am new file mode 100644 index 0000000..20e2c81 --- /dev/null +++ b/libraries/edje/src/examples/Makefile.am @@ -0,0 +1,107 @@ +MAINTAINERCLEANFILES = Makefile.in + +pkglibdir = $(datadir)/$(PACKAGE)/examples +if ENABLE_MULTISENSE +MULTISENSE_EDC_FILE = multisense.edc +SND_DIR = -sd $(srcdir) +endif +#put here all EDCs one needs to the examples +EDCS = basic.edc \ + swallow.edc \ + text.edc \ + table.edc \ + box.edc \ + drag.edc \ + signals-messages.edc \ + color-class.edc \ + perspective.edc \ + animations.edc \ + lua_script.edc \ + sigtest.edc \ + $(MULTISENSE_EDC_FILE) + +filesdir = $(datadir)/$(PACKAGE)/examples +files_DATA = + +if BUILD_EXAMPLES + +AM_CPPFLAGS = \ +-I. \ +-I$(top_srcdir)/src/lib \ +-I$(top_srcdir)/src/lib/include \ +-DPACKAGE_BIN_DIR=\"$(bindir)\" \ +-DPACKAGE_LIB_DIR=\"$(libdir)\" \ +-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +-DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" + +pkglib_PROGRAMS = + +#the ones using ecore_evas follow +AM_CPPFLAGS += @EDJE_CFLAGS@ + +pkglib_PROGRAMS += \ + edje-basic \ + edje-swallow \ + edje-text \ + edje-table \ + edje-box \ + edje-box2 \ + edje-drag\ + edje-signals-messages \ + edje-color-class \ + edje-perspective \ + edje-animations \ + sigtest + +LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ + +.edc.edj: + $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) + +EDJS = $(EDCS:%.edc=%.edj) + +files_DATA += $(EDJS) + +endif # if BUILD_EXAMPLES + +if INSTALL_EXAMPLES + +#put here additional data when installing examples +files_DATA += \ + $(srcdir)/bubble.png \ + $(srcdir)/red.png \ + $(srcdir)/test.png \ + $(srcdir)/Vera.ttf + +files_DATA += \ + $(EDCS) \ + $(srcdir)/edje-basic.c \ + $(srcdir)/edje-swallow.c \ + $(srcdir)/edje-text.c \ + $(srcdir)/edje-table.c \ + $(srcdir)/edje-box.c \ + $(srcdir)/edje-box2.c \ + $(srcdir)/edje-drag.c \ + $(srcdir)/edje-signals-messages.c \ + $(srcdir)/edje-color-class.c \ + $(srcdir)/edje-perspective.c \ + $(srcdir)/edje-animations.c \ + $(srcdir)/sigtest.c +endif + +EXTRA_DIST = $(EDCS) \ + $(srcdir)/bubble.png \ + $(srcdir)/red.png \ + $(srcdir)/test.png \ + $(srcdir)/edje-basic.c \ + $(srcdir)/edje-swallow.c \ + $(srcdir)/edje-text.c \ + $(srcdir)/edje-table.c \ + $(srcdir)/edje-box.c \ + $(srcdir)/edje-box2.c \ + $(srcdir)/edje-drag.c \ + $(srcdir)/edje-signals-messages.c \ + $(srcdir)/edje-color-class.c \ + $(srcdir)/edje-perspective.c \ + $(srcdir)/edje-animations.c \ + $(srcdir)/sigtest.c diff --git a/libraries/edje/src/examples/Makefile.in b/libraries/edje/src/examples/Makefile.in new file mode 100644 index 0000000..bde628f --- /dev/null +++ b/libraries/edje/src/examples/Makefile.in @@ -0,0 +1,827 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@BUILD_EXAMPLES_TRUE@pkglib_PROGRAMS = edje-basic$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-swallow$(EXEEXT) edje-text$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-table$(EXEEXT) edje-box$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-box2$(EXEEXT) edje-drag$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-signals-messages$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-color-class$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-perspective$(EXEEXT) \ +@BUILD_EXAMPLES_TRUE@ edje-animations$(EXEEXT) sigtest$(EXEEXT) +@BUILD_EXAMPLES_TRUE@am__append_1 = $(EDJS) + +#put here additional data when installing examples +@INSTALL_EXAMPLES_TRUE@am__append_2 = $(srcdir)/bubble.png \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/red.png $(srcdir)/test.png \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/Vera.ttf $(EDCS) \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-basic.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-swallow.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-text.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-table.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-box2.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-drag.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-signals-messages.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-color-class.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-perspective.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/edje-animations.c \ +@INSTALL_EXAMPLES_TRUE@ $(srcdir)/sigtest.c +subdir = src/examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \ + $(top_srcdir)/m4/efl_binary.m4 \ + $(top_srcdir)/m4/efl_coverage.m4 \ + $(top_srcdir)/m4/efl_doxygen.m4 \ + $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)" +PROGRAMS = $(pkglib_PROGRAMS) +edje_animations_SOURCES = edje-animations.c +edje_animations_OBJECTS = edje-animations.$(OBJEXT) +edje_animations_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_animations_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +edje_basic_SOURCES = edje-basic.c +edje_basic_OBJECTS = edje-basic.$(OBJEXT) +edje_basic_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_basic_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_box_SOURCES = edje-box.c +edje_box_OBJECTS = edje-box.$(OBJEXT) +edje_box_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_box_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_box2_SOURCES = edje-box2.c +edje_box2_OBJECTS = edje-box2.$(OBJEXT) +edje_box2_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_box2_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_color_class_SOURCES = edje-color-class.c +edje_color_class_OBJECTS = edje-color-class.$(OBJEXT) +edje_color_class_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_color_class_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_drag_SOURCES = edje-drag.c +edje_drag_OBJECTS = edje-drag.$(OBJEXT) +edje_drag_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_drag_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_perspective_SOURCES = edje-perspective.c +edje_perspective_OBJECTS = edje-perspective.$(OBJEXT) +edje_perspective_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_perspective_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_signals_messages_SOURCES = edje-signals-messages.c +edje_signals_messages_OBJECTS = edje-signals-messages.$(OBJEXT) +edje_signals_messages_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_signals_messages_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_swallow_SOURCES = edje-swallow.c +edje_swallow_OBJECTS = edje-swallow.$(OBJEXT) +edje_swallow_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_swallow_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_table_SOURCES = edje-table.c +edje_table_OBJECTS = edje-table.$(OBJEXT) +edje_table_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_table_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +edje_text_SOURCES = edje-text.c +edje_text_OBJECTS = edje-text.$(OBJEXT) +edje_text_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@edje_text_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +sigtest_SOURCES = sigtest.c +sigtest_OBJECTS = sigtest.$(OBJEXT) +sigtest_LDADD = $(LDADD) +@BUILD_EXAMPLES_TRUE@sigtest_DEPENDENCIES = \ +@BUILD_EXAMPLES_TRUE@ $(top_builddir)/src/lib/libedje.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = edje-animations.c edje-basic.c edje-box.c edje-box2.c \ + edje-color-class.c edje-drag.c edje-perspective.c \ + edje-signals-messages.c edje-swallow.c edje-table.c \ + edje-text.c sigtest.c +DIST_SOURCES = edje-animations.c edje-basic.c edje-box.c edje-box2.c \ + edje-color-class.c edje-drag.c edje-perspective.c \ + edje-signals-messages.c edje-swallow.c edje-table.c \ + edje-text.c sigtest.c +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(files_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = $(datadir)/$(PACKAGE)/examples +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECORE_IMF_CFLAGS = @ECORE_IMF_CFLAGS@ +ECORE_IMF_LIBS = @ECORE_IMF_LIBS@ +EDJE_CC_CFLAGS = @EDJE_CC_CFLAGS@ +EDJE_CC_LIBS = @EDJE_CC_LIBS@ +EDJE_CC_PRG = @EDJE_CC_PRG@ +EDJE_CFLAGS = @EDJE_CFLAGS@ +EDJE_DECC_CFLAGS = @EDJE_DECC_CFLAGS@ +EDJE_DECC_LIBS = @EDJE_DECC_LIBS@ +EDJE_DECC_PRG = @EDJE_DECC_PRG@ +EDJE_EXTERNAL_INSPECTOR_CFLAGS = @EDJE_EXTERNAL_INSPECTOR_CFLAGS@ +EDJE_EXTERNAL_INSPECTOR_LIBS = @EDJE_EXTERNAL_INSPECTOR_LIBS@ +EDJE_EXTERNAL_INSPECTOR_PRG = @EDJE_EXTERNAL_INSPECTOR_PRG@ +EDJE_INSPECTOR_CFLAGS = @EDJE_INSPECTOR_CFLAGS@ +EDJE_INSPECTOR_LIBS = @EDJE_INSPECTOR_LIBS@ +EDJE_INSPECTOR_PRG = @EDJE_INSPECTOR_PRG@ +EDJE_LIBS = @EDJE_LIBS@ +EDJE_PLAYER_CFLAGS = @EDJE_PLAYER_CFLAGS@ +EDJE_PLAYER_LIBS = @EDJE_PLAYER_LIBS@ +EDJE_PLAYER_PRG = @EDJE_PLAYER_PRG@ +EDJE_RECC_PRG = @EDJE_RECC_PRG@ +EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ +EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ +EFL_EDJE_BUILD = @EFL_EDJE_BUILD@ +EGREP = @EGREP@ +EVIL_CFLAGS = @EVIL_CFLAGS@ +EVIL_LIBS = @EVIL_LIBS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FLAC_CFLAGS = @FLAC_CFLAGS@ +FLAC_LIBS = @FLAC_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LUA_CFLAGS = @LUA_CFLAGS@ +LUA_LIBS = @LUA_LIBS@ +MAKEINFO = @MAKEINFO@ +MINIMAL_CFLAGS = @MINIMAL_CFLAGS@ +MINIMAL_LIBS = @MINIMAL_LIBS@ +MKDIR_P = @MKDIR_P@ +MODULE_ARCH = @MODULE_ARCH@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +REMIX_CFLAGS = @REMIX_CFLAGS@ +REMIX_LIBS = @REMIX_LIBS@ +REMIX_PLUGIN_DIR = @REMIX_PLUGIN_DIR@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +VERSION = @VERSION@ +VMAJ = @VMAJ@ +VORBISENC_CFLAGS = @VORBISENC_CFLAGS@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +edje_cc = @edje_cc@ +efl_doxygen = @efl_doxygen@ +efl_have_doxygen = @efl_have_doxygen@ +exec_prefix = @exec_prefix@ +have_lcov = @have_lcov@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lt_enable_auto_import = @lt_enable_auto_import@ +lua_libs = @lua_libs@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfig_requires_private = @pkgconfig_requires_private@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +release_info = @release_info@ +requirement_edje = @requirement_edje@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +version_info = @version_info@ +vimdir = @vimdir@ +MAINTAINERCLEANFILES = Makefile.in +@ENABLE_MULTISENSE_TRUE@MULTISENSE_EDC_FILE = multisense.edc +@ENABLE_MULTISENSE_TRUE@SND_DIR = -sd $(srcdir) +#put here all EDCs one needs to the examples +EDCS = basic.edc \ + swallow.edc \ + text.edc \ + table.edc \ + box.edc \ + drag.edc \ + signals-messages.edc \ + color-class.edc \ + perspective.edc \ + animations.edc \ + lua_script.edc \ + sigtest.edc \ + $(MULTISENSE_EDC_FILE) + +filesdir = $(datadir)/$(PACKAGE)/examples +files_DATA = $(am__append_1) $(am__append_2) + +#the ones using ecore_evas follow +@BUILD_EXAMPLES_TRUE@AM_CPPFLAGS = -I. -I$(top_srcdir)/src/lib \ +@BUILD_EXAMPLES_TRUE@ -I$(top_srcdir)/src/lib/include \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@BUILD_EXAMPLES_TRUE@ -DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/examples\" \ +@BUILD_EXAMPLES_TRUE@ @EDJE_CFLAGS@ $(am__empty) +@BUILD_EXAMPLES_TRUE@LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_LIBS@ +@BUILD_EXAMPLES_TRUE@EDJS = $(EDCS:%.edc=%.edj) +EXTRA_DIST = $(EDCS) \ + $(srcdir)/bubble.png \ + $(srcdir)/red.png \ + $(srcdir)/test.png \ + $(srcdir)/edje-basic.c \ + $(srcdir)/edje-swallow.c \ + $(srcdir)/edje-text.c \ + $(srcdir)/edje-table.c \ + $(srcdir)/edje-box.c \ + $(srcdir)/edje-box2.c \ + $(srcdir)/edje-drag.c \ + $(srcdir)/edje-signals-messages.c \ + $(srcdir)/edje-color-class.c \ + $(srcdir)/edje-perspective.c \ + $(srcdir)/edje-animations.c \ + $(srcdir)/sigtest.c + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .edc .edj .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibPROGRAMS: $(pkglib_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkglibPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files + +clean-pkglibPROGRAMS: + @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +edje-animations$(EXEEXT): $(edje_animations_OBJECTS) $(edje_animations_DEPENDENCIES) + @rm -f edje-animations$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_animations_OBJECTS) $(edje_animations_LDADD) $(LIBS) +edje-basic$(EXEEXT): $(edje_basic_OBJECTS) $(edje_basic_DEPENDENCIES) + @rm -f edje-basic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_basic_OBJECTS) $(edje_basic_LDADD) $(LIBS) +edje-box$(EXEEXT): $(edje_box_OBJECTS) $(edje_box_DEPENDENCIES) + @rm -f edje-box$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_box_OBJECTS) $(edje_box_LDADD) $(LIBS) +edje-box2$(EXEEXT): $(edje_box2_OBJECTS) $(edje_box2_DEPENDENCIES) + @rm -f edje-box2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_box2_OBJECTS) $(edje_box2_LDADD) $(LIBS) +edje-color-class$(EXEEXT): $(edje_color_class_OBJECTS) $(edje_color_class_DEPENDENCIES) + @rm -f edje-color-class$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_color_class_OBJECTS) $(edje_color_class_LDADD) $(LIBS) +edje-drag$(EXEEXT): $(edje_drag_OBJECTS) $(edje_drag_DEPENDENCIES) + @rm -f edje-drag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_drag_OBJECTS) $(edje_drag_LDADD) $(LIBS) +edje-perspective$(EXEEXT): $(edje_perspective_OBJECTS) $(edje_perspective_DEPENDENCIES) + @rm -f edje-perspective$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_perspective_OBJECTS) $(edje_perspective_LDADD) $(LIBS) +edje-signals-messages$(EXEEXT): $(edje_signals_messages_OBJECTS) $(edje_signals_messages_DEPENDENCIES) + @rm -f edje-signals-messages$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_signals_messages_OBJECTS) $(edje_signals_messages_LDADD) $(LIBS) +edje-swallow$(EXEEXT): $(edje_swallow_OBJECTS) $(edje_swallow_DEPENDENCIES) + @rm -f edje-swallow$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_swallow_OBJECTS) $(edje_swallow_LDADD) $(LIBS) +edje-table$(EXEEXT): $(edje_table_OBJECTS) $(edje_table_DEPENDENCIES) + @rm -f edje-table$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_table_OBJECTS) $(edje_table_LDADD) $(LIBS) +edje-text$(EXEEXT): $(edje_text_OBJECTS) $(edje_text_DEPENDENCIES) + @rm -f edje-text$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(edje_text_OBJECTS) $(edje_text_LDADD) $(LIBS) +sigtest$(EXEEXT): $(sigtest_OBJECTS) $(sigtest_DEPENDENCIES) + @rm -f sigtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigtest_OBJECTS) $(sigtest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-animations.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-box.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-box2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-color-class.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-drag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-perspective.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-signals-messages.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-swallow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-table.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edje-text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigtest.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-filesDATA: $(files_DATA) + @$(NORMAL_INSTALL) + test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)" + @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \ + done + +uninstall-filesDATA: + @$(NORMAL_UNINSTALL) + @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(filesdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-filesDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-filesDATA \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkglibPROGRAMS \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-filesDATA \ + uninstall-pkglibPROGRAMS + + +@BUILD_EXAMPLES_TRUE@.edc.edj: +@BUILD_EXAMPLES_TRUE@ $(edje_cc) -v -id $(srcdir) $(SND_DIR) $< $(builddir)/$(@F) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libraries/edje/src/examples/animations.edc b/libraries/edje/src/examples/animations.edc new file mode 100644 index 0000000..f25296f --- /dev/null +++ b/libraries/edje/src/examples/animations.edc @@ -0,0 +1,93 @@ +collections { + group { + name: "animations_group"; + min: 100 80; + + parts { + part { + name: "part_one"; + type: RECT; + scale: 1; + description { + min: 50 50; + state: "default" 0.0; + color: 0 0 0 255; /* black */ + rel1.relative: 0.0 0.0; + rel2.relative: 0.33 1.0; + } + description { + state: "invert" 1.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.33; + } + } + + part { + name: "part_two"; + type: RECT; + scale: 1; + description { + min: 50 50; + state: "default" 0.0; + color: 255 255 0 255; /* yellow */ + rel1.relative: 0.33 0.0; + rel2.relative: 0.66 1.0; + } + description { + state: "invert" 1.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.66; + rel2.relative: 1.0 1.0; + } + } + + part { + name: "part_three"; + type: RECT; + description { + state: "default" 0.0; + color: 255 0 0 255; /* red */ + rel1.relative: 0.66 0.0; + rel2.relative: 1.0 1.0; + } + description { + state: "invert" 1.0; + inherit: "default" 0.0; + rel1.relative: 0.0 0.33; + rel2.relative: 1.0 0.66; + } + } + } + + program { + signal: "load"; + source: ""; + in: 2.0 0.0; + after: "animation,state1"; + } + program { + name: "animation,state1"; + signal: "animation,start"; + source: ""; + in: 1.0 0.0; + action: STATE_SET "invert" 1.0; + target: "part_one"; + target: "part_two"; + target: "part_three"; + transition: LINEAR 0.6; + after: "animation,state2"; + } + program { + name: "animation,state2"; + signal: "animation,start"; + source: ""; + in: 1.0 0.0; + action: STATE_SET "default" 0.0; + target: "part_one"; + target: "part_two"; + target: "part_three"; + transition: LINEAR 0.6; + after: "animation,state1"; + } +} diff --git a/libraries/edje/src/examples/basic.edc b/libraries/edje/src/examples/basic.edc new file mode 100644 index 0000000..a708b50 --- /dev/null +++ b/libraries/edje/src/examples/basic.edc @@ -0,0 +1,39 @@ +collections { + group { + name: "example_group"; + max: 500 500; + min: 50 50; + + data { + item: "example_data" "a string"; + } + + parts { + part { + name: "part_one"; + type: RECT; + scale: 1; + description { + min: 50 50; + max: 50 50; + state: "default" 0.0; + color: 0 0 255 255; /* blue */ + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + + part { + name: "part_two"; + type: RECT; + description { + state: "default" 0.0; + color: 0 255 0 255; /* green */ + rel1.relative: -1.0 -1.0; + rel2.relative: 0.0 0.0; + } + } + } + + } +} diff --git a/libraries/edje/src/examples/box.edc b/libraries/edje/src/examples/box.edc new file mode 100644 index 0000000..79d04a8 --- /dev/null +++ b/libraries/edje/src/examples/box.edc @@ -0,0 +1,142 @@ +collections { + + group { + name: "example/group"; + + parts { + part { + name: "bg"; + type: RECT; + + description { + state: "default" 0.0; + color: 128 128 128 255; + rel1.offset: 20 20; + rel2.offset: -21 -21; + } + } + + part { + name: "example/title"; + type: TEXT; + + description { + state: "default" 0.0; + color: 0 0 0 255; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + to: "bg"; + } + rel2 { + relative: 1.0 0.2; + offset: -1 -1; + to: "bg"; + } + text { + text: "Box Example"; + size: 16; + font: "sans"; + min: 1 1; + } + } + } + + part { + name: "example/box"; + type: BOX; + + description { + state: "default" 0.0; + + box { + layout: "horizontal_flow"; + padding: 2 2; + align: 0.5 0.5; + min: 1 1; + } + rel1 { + relative: 0.0 0.2; + offset: 0 0; + to: "bg"; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -61; + to: "bg"; + } + } + } // example/box + } + } + + group { + name: "example/group2"; + + parts { + part { + name: "bg"; + type: RECT; + + description { + state: "default" 0.0; + color: 128 128 128 255; + rel1.offset: 20 20; + rel2.offset: -21 -21; + } + } + + part { + name: "example/title"; + type: TEXT; + + description { + state: "default" 0.0; + color: 0 0 0 255; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + to: "bg"; + } + rel2 { + relative: 1.0 0.2; + offset: -1 -1; + to: "bg"; + } + text { + text: "Box Example 2"; + size: 16; + font: "sans"; + min: 1 1; + } + } + } + + part { + name: "example/box"; + type: BOX; + + description { + state: "default" 0.0; + + box { + layout: "custom_layout"; + padding: 2 2; + align: 0.5 0.5; + min: 1 1; + } + rel1 { + relative: 0.0 0.2; + offset: 0 0; + to: "bg"; + } + rel2 { + relative: 1.0 1.0; + offset: -1 -61; + to: "bg"; + } + } + } // example/box + } + } +} diff --git a/libraries/edje/src/examples/bubble.png b/libraries/edje/src/examples/bubble.png new file mode 100644 index 0000000..8fc50f9 Binary files /dev/null and b/libraries/edje/src/examples/bubble.png differ diff --git a/libraries/edje/src/examples/color-class.edc b/libraries/edje/src/examples/color-class.edc new file mode 100644 index 0000000..c025455 --- /dev/null +++ b/libraries/edje/src/examples/color-class.edc @@ -0,0 +1,87 @@ +color_classes { + color_class { + name: "red_class"; + color: 255 0 0 255; /* red */ + color2: 255 0 0 255; /* red */ + color3: 255 0 0 255; /* red */ + } + color_class { + name: "green_class"; + color: 0 255 0 255; /* green */ + color2: 0 255 0 255; /* green */ + color3: 0 255 0 255; /* green */ + } + color_class { + name: "blue_class"; + color: 0 0 255 255; /* blue */ + color2: 0 0 255 255; /* blue */ + color3: 0 0 255 255; /* blue */ + } +} + +collections { + group { + name: "example_color_class"; + max: 500 500; + min: 50 50; + + parts { + part { + name: "part_one"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 255 255 255 255; + color_class: "blue_class"; + rel1.relative: 0.0 0.0; + rel2.relative: 0.5 0.5; + } + } + + part { + name: "part_two"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 255; + color_class: "green_class"; + rel1.relative: 0.5 0.0; + rel2.relative: 1.0 0.5; + } + } + part { + name: "part_three"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 255; + color_class: "red_class"; + rel1.relative: 0.0 0.5; + rel2.relative: 1.0 1.0; + } + } + part { + name: "part_four"; + type: TEXT; + effect: OUTLINE_SHADOW; + description { + state: "default" 0.0; + min: 50 50; + color: 255 255 255 255; + color2: 255 255 255 255; + color3: 255 255 255 255; + color_class: "blue_class"; + rel1.relative: 0.0 0.5; + rel2.relative: 1.0 1.0; + text { + text_class: "example"; + font: "arial"; + size: 45; + min: 1 1; + } + } + } + } + } +} diff --git a/libraries/edje/src/examples/drag.edc b/libraries/edje/src/examples/drag.edc new file mode 100644 index 0000000..b9247ec --- /dev/null +++ b/libraries/edje/src/examples/drag.edc @@ -0,0 +1,89 @@ +collections { + group { + name: "example/group"; + + min: 160 160; + + parts { + part { + name: "bg"; + type: RECT; + + mouse_events: 0; + + description { + state: "default" 0.0; + } + } // bg + + part { + name: "title"; + type: TEXT; + mouse_events: 0; + + description { + state: "default" 0.0; + color: 0 0 0 255; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + to: "bg"; + } + rel2 { + relative: 1.0 0.2; + offset: -1 -1; + to: "bg"; + } + text { + text: "Drag Example"; + size: 16; + font: "sans"; + min: 1 1; + } + } + } + + part { + name: "drag_area"; + type: RECT; + + mouse_events: 0; + + description { + state: "default" 0.0; + color: 0 0 0 255; + rel1 { + relative: 0.5 0.3; + offset: -5 0; + } + + rel2 { + relative: 0.5 0.9; + offset: 4 0; + } + } + } // drag_area + + part { + name: "example/knob"; + type: RECT; + + mouse_events: 1; + + dragable { + confine: "drag_area"; + x: 0 0 0; + y: 1 1 0; + } + + description { + state: "default" 0.0; + + color: 255 0 0 200; + + } + } // example/knob + + } + } +} diff --git a/libraries/edje/src/examples/edje-animations.c b/libraries/edje/src/examples/edje-animations.c new file mode 100644 index 0000000..9363471 --- /dev/null +++ b/libraries/edje/src/examples/edje-animations.c @@ -0,0 +1,156 @@ +/** + * Simple Edje example illustrating animations functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc animations.edc && gcc -o edje-animations edje-animations.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH (400) +#define HEIGHT (300) + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/animations.edj"; +static Ecore_Evas *ee; +static Evas_Object *bg, *edje_obj; +static double frametime = 1.0/30.0; /* default value */ + +static void +_on_delete_cb(Ecore_Evas *ee) +{ + ecore_main_loop_quit(); +} + +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int w, h; + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + evas_object_resize(bg, w, h); + evas_object_resize(edje_obj, w, h); +} + +static void +_on_key_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + Evas_Event_Key_Down *ev = event_info; + double ft; + + if (!strcmp(ev->key, "plus")) + { + frametime *= 2.0; + fprintf(stdout, "Increasing frametime to: %f\n", frametime); + edje_frametime_set(frametime); + } + else if (!strcmp(ev->key, "minus")) + { + frametime /= 2.0; + fprintf(stdout, "Decreasing frametime to: %f\n", frametime); + edje_frametime_set(frametime); + } + else if (!strcmp(ev->key, "equal")) + { + ft = edje_frametime_get(); + fprintf(stdout, "Frametime: %f\n", ft); + if (edje_object_play_get(obj)) + fprintf(stdout, "Object is playing\n"); + else + fprintf(stdout, "Object was paused\n"); + if (edje_object_animation_get(obj)) + fprintf(stdout, "Animation is running\n"); + else + fprintf(stdout, "Animation was stopped\n"); + } + else if (!strcmp(ev->key, "s")) + { + edje_object_play_set(obj, EINA_FALSE); + fprintf(stdout, "Pausing the object\n"); + } + else if (!strcmp(ev->key, "p")) + { + edje_object_play_set(obj, EINA_TRUE); + fprintf(stdout, "Playing the object\n"); + } + else if (!strcmp(ev->key, "f")) + fprintf(stdout, "Freezing object. Count: %d\n", edje_object_freeze(obj)); + else if (!strcmp(ev->key, "t")) + fprintf(stdout, "Thawing object. Count: %d\n", edje_object_thaw(obj)); + else if (!strcmp(ev->key, "F")) + { + edje_freeze(); + fprintf(stdout, "Freezing all objects\n"); + } + else if (!strcmp(ev->key, "T")) + { + edje_thaw(); + fprintf(stdout, "Thawing all objects\n"); + } + else if (!strcmp(ev->key, "a")) + { + edje_object_animation_set(obj, EINA_TRUE); + fprintf(stdout, "Starting the animation in the Edje object\n"); + } + else if (!strcmp(ev->key, "A")) + { + edje_object_animation_set(obj, EINA_FALSE); + fprintf(stdout, "Stopping the animation in the Edje object\n"); + } +} + +int +main(int argc, char *argv[]) +{ + Evas *evas; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_delete_request_set(ee, _on_delete_cb); + ecore_evas_callback_resize_set(ee, _canvas_resize_cb); + ecore_evas_title_set(ee, "Edje Animations Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + + edje_obj = edje_object_add(evas); + + edje_object_file_set(edje_obj, edje_file_path, "animations_group"); + evas_object_move(edje_obj, 0, 0); + evas_object_resize(edje_obj, WIDTH, HEIGHT); + evas_object_show(edje_obj); + + evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_KEY_DOWN, + _on_key_down_cb, NULL); + evas_object_focus_set(edje_obj, EINA_TRUE); + + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-basic.c b/libraries/edje/src/examples/edje-basic.c new file mode 100644 index 0000000..2a7a862 --- /dev/null +++ b/libraries/edje/src/examples/edje-basic.c @@ -0,0 +1,226 @@ +/** + * Simple Edje example illustrating the very basic functions of the + * library + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * gcc -o edje-basic edje-basic.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include +#include + +#define WIDTH (300) +#define HEIGHT (300) + +static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/basic.edj"; + +static Ecore_Evas *ee; +static Evas_Object *edje_obj; + +static const char commands[] = \ + "commands are:\n" + "\ts - change Edje's global scaling factor\n" + "\tr - change center rectangle's scaling factor\n" + "\th - print help\n"; + +static void +_on_keydown(void *data __UNUSED__, + Evas *evas __UNUSED__, + Evas_Object *o __UNUSED__, + void *einfo) +{ + Evas_Event_Key_Down *ev = einfo; + + if (strcmp(ev->keyname, "h") == 0) /* print help */ + { + fprintf(stdout, commands); + return; + } + + if (strcmp(ev->keyname, "s") == 0) /* global scaling factor */ + { + double scale = edje_scale_get(); + + printf("got scale %f\n", scale); + + if (scale != 1.0) scale = 1.0; + else scale = 2.0; + + edje_scale_set(scale); + + fprintf(stdout, "Setting global scaling factor to %f.\n", scale); + + return; + } + + if (strcmp(ev->keyname, "r") == 0) /* individual scaling factor */ + { + double scale = edje_object_scale_get(edje_obj); + + printf("got scale %f\n", scale); + + if (!scale) scale = 1.0; + else if (scale == 1.0) scale = 2.0; + else scale = 0.0; + + edje_object_scale_set(edje_obj, scale); + + fprintf(stdout, "Setting center rectangle's scaling factor to %f.\n", + scale); + + return; + } +} + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +int +main(void) +{ + Evas_Object *border, *bg; + int x, y, w, h; + Evas *evas; + + if (!ecore_evas_init()) + return EXIT_FAILURE; + + if (!edje_init()) + return EXIT_FAILURE; + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + if (!ee) + goto error; + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_title_set(ee, "Edje Basics Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); + + evas_object_focus_set(bg, EINA_TRUE); + evas_object_event_callback_add( + bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); + + edje_obj = edje_object_add(evas); + + /* exercising Edje loading error, on purpose */ + if (!edje_object_file_set(edje_obj, edje_file_path, "unexistant_group")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + fprintf(stderr, "Could not load 'unexistant_group' from basic.edj:" + " %s\n", errmsg); + } + + if (!edje_object_file_set(edje_obj, edje_file_path, "example_group")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + fprintf(stderr, "Could not load 'example_group' from basic.edj: %s\n", + errmsg); + + evas_object_del(edje_obj); + goto error_edj; + } + + fprintf(stdout, "Loaded Edje object bound to group 'example_group' from" + " file basic.edj with success!\n"); + + evas_object_move(edje_obj, 20, 20); + evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); + evas_object_show(edje_obj); + + /* this is a border around the Edje object above, here just to + * emphasize its geometry */ + border = evas_object_image_filled_add(evas); + evas_object_image_file_set(border, border_img_path, NULL); + evas_object_image_border_set(border, 2, 2, 2, 2); + evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE); + + evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4); + evas_object_move(border, 20 - 2, 20 - 2); + evas_object_show(border); + + fprintf(stdout, "'example_data' data field in group 'example_group' has " + "the value: %s\n", edje_object_data_get(edje_obj, + "example_data")); + + fprintf(stdout, "Testing if 'part_one' part exists: %s\n", + edje_object_part_exists(edje_obj, "part_one") ? "yes!" : "no"); + + edje_object_part_geometry_get(edje_obj, "part_one", &x, &y, &w, &h); + fprintf(stdout, "The geometry of that part inside the Edje object's area " + "is: x = %d, y = %d, w = %d, h = %d\n", x, y, w, h); + + evas_object_color_get(edje_object_part_object_get(edje_obj, "part_one"), + &x, &y, &w, &h); + fprintf(stdout, "That part's color components are: r = %d, g = %d, b = %d," + " a = %d\n", x, y, w, h); + + edje_object_size_max_get(edje_obj, &w, &h); + fprintf(stdout, "The Edje object's max. size is: %d, %d\n", w, h); + + edje_object_size_min_get(edje_obj, &w, &h); + fprintf(stdout, "The Edje object's min. size is: %d, %d\n", w, h); + + edje_object_size_min_calc(edje_obj, &w, &h); + fprintf(stdout, "The Edje object's min. size reported by min. size" + " calculation is: w = %d, h = %d\n", w, h); + + edje_object_size_min_restricted_calc(edje_obj, &w, &h, 500, 500); + fprintf(stdout, "The Edje object's min. size reported by *restricted* " + "min. size calculation is: w = %d, h = %d\n", w, h); + + edje_object_parts_extends_calc(edje_obj, &x, &y, &w, &h); + fprintf(stdout, "The Edje object's \"extended\" geometry is: x = %d, " + "y = %d, w = %d, h = %d\n", x, y, w, h); + + fprintf(stdout, commands); + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; + +error: + fprintf(stderr, "You got to have at least one evas engine built" + " and linked up to ecore-evas for this example to run" + " properly.\n"); + ecore_evas_shutdown(); + return -1; + +error_edj: + fprintf(stderr, "Failed to load basic.edj!\n"); + + ecore_evas_shutdown(); + return -2; +} + diff --git a/libraries/edje/src/examples/edje-box.c b/libraries/edje/src/examples/edje-box.c new file mode 100644 index 0000000..7fffba3 --- /dev/null +++ b/libraries/edje/src/examples/edje-box.c @@ -0,0 +1,191 @@ +/** + * Simple Edje example illustrating box functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc box.edc && gcc -o edje-box edje-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH 300 +#define HEIGHT 300 + +#define RECTW 30 +#define RECTH 30 + +#define NRECTS 20 + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj"; + +struct _App { + Ecore_Evas *ee; + Evas_Object *edje; + Evas_Object *bg; +}; + +static void +_on_destroy(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* here just to keep our example's window size and background image's + * size in synchrony */ +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int w, h; + struct _App *app = ecore_evas_data_get(ee, "app"); + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + evas_object_resize(app->bg, w, h); + evas_object_resize(app->edje, w, h); +} + +static void +_rect_mouse_down(void *data, Evas *e, Evas_Object *o, void *event_info) +{ + struct _App *app = data; + Evas_Event_Mouse_Down *ev = event_info; + + if (ev->button == 1) + { + printf("Removing rect %p under the mouse pointer.\n", o); + edje_object_part_box_remove(app->edje, "example/box", o); + evas_object_del(o); + } + else if (ev->button == 3) + { + Evas_Object *rect; + Eina_Bool r; + + rect = evas_object_rectangle_add(e); + evas_object_color_set(rect, 0, 0, 255, 255); + evas_object_resize(rect, RECTW + 10, RECTH); + evas_object_show(rect); + + printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); + r = edje_object_part_box_insert_before(app->edje, "example/box", rect, o); + if (!r) + printf("An error ocurred when appending rect %p to the box.\n", rect); + + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); + } +} + +static void +_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) +{ + struct _App *app = data; + Evas_Event_Key_Down *ev = event_info; + Evas_Object *rect; + Eina_Bool r; + + + if (!strcmp(ev->keyname, "i")) + { + rect = evas_object_rectangle_add(e); + evas_object_color_set(rect, 0, 0, 128, 255); + evas_object_resize(rect, RECTW + 30, RECTH); + evas_object_show(rect); + + printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); + r = edje_object_part_box_insert_at(app->edje, "example/box", rect, 0); + if (!r) + printf("An error ocurred when appending rect %p to the box.\n", rect); + + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); + } + else if (!strcmp(ev->keyname, "a")) + { + rect = evas_object_rectangle_add(e); + evas_object_color_set(rect, 0, 128, 0, 255); + evas_object_resize(rect, RECTW, RECTH); + evas_object_show(rect); + + printf("Inserting rect %p before the rectangle under the mouse pointer.\n", rect); + r = edje_object_part_box_append(app->edje, "example/box", rect); + if (!r) + printf("An error ocurred when appending rect %p to the box.\n", rect); + + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, app); + } + else if (!strcmp(ev->keyname, "c")) + edje_object_part_box_remove_all(app->edje, "example/box", EINA_TRUE); +} + +int +main(void) +{ + Evas *evas; + struct _App app; + int i; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_destroy_set(app.ee, _on_destroy); + ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); + ecore_evas_title_set(app.ee, "Edje Box Example"); + ecore_evas_show(app.ee); + + ecore_evas_data_set(app.ee, "app", &app); + + evas = ecore_evas_get(app.ee); + + app.bg = evas_object_rectangle_add(evas); + evas_object_color_set(app.bg, 255, 255, 255, 255); + evas_object_resize(app.bg, WIDTH, HEIGHT); + evas_object_focus_set(app.bg, EINA_TRUE); + evas_object_show(app.bg); + + evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); + + app.edje = edje_object_add(evas); + + edje_object_file_set(app.edje, edje_file_path, "example/group"); + evas_object_move(app.edje, 0, 0); + evas_object_resize(app.edje, WIDTH, HEIGHT); + evas_object_show(app.edje); + + for (i = 0; i < NRECTS; i++) + { + Evas_Object *rect; + Eina_Bool r = EINA_FALSE; + int red = (i * 10) % 256; + rect = evas_object_rectangle_add(evas); + evas_object_color_set(rect, red, 0, 0, 255); + evas_object_resize(rect, RECTW, RECTH); + r = edje_object_part_box_append(app.edje, "example/box", rect); + if (!r) + printf("An error ocurred when appending rect #%d to the box.\n", i); + evas_object_show(rect); + + evas_object_event_callback_add( + rect, EVAS_CALLBACK_MOUSE_DOWN, _rect_mouse_down, &app); + } + + ecore_main_loop_begin(); + + ecore_evas_free(app.ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-box2.c b/libraries/edje/src/examples/edje-box2.c new file mode 100644 index 0000000..b3f4e40 --- /dev/null +++ b/libraries/edje/src/examples/edje-box2.c @@ -0,0 +1,204 @@ +/** + * Simple Edje example illustrating a custom box layout. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc box.edc && gcc -o edje-box2 edje-box2.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include +#include + +#include +#include +#include + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/box.edj"; + +struct _App { + Ecore_Evas *ee; + Evas *evas; + Evas_Object *bg; + Evas_Object *box; +}; + +static struct _App app; + +static void +custom_layout(Evas_Object *o, Evas_Object_Box_Data *p, void *data) +{ + int x, y, w, h; + int xx, yy, ww, hh; + int count; + Eina_List *l; + Evas_Object_Box_Option *opt; + + evas_object_geometry_get(o, &x, &y, &w, &h); + count = eina_list_count(p->children); + ww = w / (count?:1); + hh = h / (count?:1); + if (ww < 1) ww = 1; + if (hh < 1) hh = 1; + + xx = x; + yy = y; + EINA_LIST_FOREACH(p->children, l, opt) + { + evas_object_move(opt->obj, xx, yy); + xx += ww; + yy += hh; + } +} + +static Evas_Object * +new_greenie_block(Evas *e) +{ + Evas_Object *o; + + o = evas_object_rectangle_add(e); + evas_object_resize(o, 10, 10); + evas_object_color_set(o, 0, 255, 0, 255); + evas_object_show(o); + + return o; +} + +static void +on_keydown(void *data, Evas *evas, Evas_Object *o, void *einfo) +{ + struct _App *app = data; + Evas_Event_Key_Down *ev = einfo; + const Evas_Modifier *mods; + + mods = evas_key_modifier_get(evas); + if (evas_key_modifier_is_set(mods, "Shift")) + { + int pos; + Evas_Object *obj = NULL; + pos = atoi(ev->keyname); + obj = edje_object_part_box_remove_at(app->box, "example/box", pos); + if (obj) + evas_object_del(obj); + return; + } + if (evas_key_modifier_is_set(mods, "Control")) + { + Evas_Object *o; + int pos; + pos = atoi(ev->keyname); + o = new_greenie_block(app->evas); + if (!edje_object_part_box_insert_at(app->box, "example/box", o, pos)) + edje_object_part_box_append(app->box, "example/box", o); + return; + } + if (strcmp(ev->keyname, "Escape") == 0) + ecore_main_loop_quit(); +} + +static Evas_Object * +box_new(Evas *evas, const char *name, int x, int y, int w, int h) +{ + Evas_Object *o; + + o = edje_object_add(evas); + evas_object_move(o, x, y); + evas_object_resize(o, w, h); + if (!edje_object_file_set(o, edje_file_path, "example/group2")) + { + printf("error: could not load file object.\n"); + } + evas_object_show(o); + + evas_object_name_set(o, name); + + return o; +} + +static void +on_resize(Ecore_Evas *ee) +{ + int w, h; + + evas_output_viewport_get(app.evas, NULL, NULL, &w, &h); + evas_object_resize(app.bg, w, h); + evas_object_resize(app.box, w, h); +} + +static void +on_destroy(Ecore_Evas *ee) +{ + ecore_main_loop_quit(); +} + +int +main(int argc, char *argv[]) +{ + Ecore_Evas *ee; + int w, h, i; + Evas_Object *last; + Evas_Object *o; + + evas_init(); + ecore_init(); + ecore_evas_init(); + edje_init(); + + ee = ecore_evas_new(NULL, 0, 0, 640, 480, NULL); + ecore_evas_show(ee); + + app.ee = ee; + app.evas = ecore_evas_get(ee); + + ecore_evas_callback_resize_set(ee, on_resize); + ecore_evas_callback_destroy_set(ee, on_destroy); + + evas_output_viewport_get(app.evas, NULL, NULL, &w, &h); + + app.bg = evas_object_rectangle_add(app.evas); + evas_object_resize(app.bg, w, h); + evas_object_show(app.bg); + evas_object_focus_set(app.bg, 1); + evas_object_event_callback_add( + app.bg, EVAS_CALLBACK_KEY_DOWN, on_keydown, &app); + + edje_box_layout_register("custom_layout", custom_layout, NULL, NULL, NULL, NULL); + + app.box = box_new(app.evas, "box", 0, 0, w, h); + + for (i = 1; i <= 5; i++) + { + o = last = evas_object_rectangle_add(app.evas); + evas_object_size_hint_min_set(o, 50, 50); + evas_object_resize(o, 50, 50); + evas_object_color_set(o, 255, 0, 0, 128); + evas_object_show(o); + + if (!edje_object_part_box_append(app.box, "example/box", o)) + { + fprintf(stderr, "error appending child object!\n"); + return 1; + } + } + + ecore_main_loop_begin(); + + edje_shutdown(); + ecore_evas_shutdown(); + ecore_shutdown(); + evas_shutdown(); + + + return 0; +} diff --git a/libraries/edje/src/examples/edje-color-class.c b/libraries/edje/src/examples/edje-color-class.c new file mode 100644 index 0000000..9ac8653 --- /dev/null +++ b/libraries/edje/src/examples/edje-color-class.c @@ -0,0 +1,257 @@ +/** + * Simple Edje example illustrating color class functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc color-class.edc && gcc -o edje-table edje-color-class.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH (400) +#define HEIGHT (400) + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/color-class.edj"; + +typedef int color[4]; /* rgba */ + +static Ecore_Evas *ee, *ee2; +static Evas *evas, *evas2; +static Evas_Object *bg, *edje_obj, *bg2, *edje_obj2; +static const char *selected_class; + +static color colors_init_data[] = + {{255, 0, 0, 255}, /* red */ + {0, 255, 0, 255}, /* green */ + {0, 0, 255, 255}, /* blue */ + {0, 0, 0, 255}, /* black */ + {255, 255, 255, 255}, /* white */ + {128, 128, 128, 255}, /* gray */ + {255, 255, 0, 255}, /* yellow */ + {255, 0, 255, 255} /* pink */ + }; + +static char *color_names[] = + {"red", "green", "blue", "black", "white", + "gray", "yellow", "pink"}; + +static Eina_Bool +_get_color_from_name(const char *n, color *c) +{ + int i; + for (i = 0; i < 8; i++) + if (!strcmp(n, color_names[i])) + { + (*c)[0] = (colors_init_data[i])[0]; + (*c)[1] = (colors_init_data[i])[1]; + (*c)[2] = (colors_init_data[i])[2]; + (*c)[3] = (colors_init_data[i])[3]; + return EINA_TRUE; + } + + return EINA_FALSE; +} + +static void +_color_classes_print(void) +{ + Eina_List *classes; + char *class_name; + + fprintf(stdout, "Getting the color classes\n\n"); + classes = edje_color_class_list(); + EINA_LIST_FREE(classes, class_name) + { + int r1, r2, r3, g1, g2, g3, b1, b2, b3, + a1, a2, a3; + + fprintf(stdout, "\ncolor class: %s\n", class_name); + if (!edje_color_class_get(class_name, &r1, &g1, &b1, &a1, + &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3)) + fprintf(stderr, "Cannot get the color class\n"); + else + { + + fprintf(stdout,"Object color r: %d g: %d b: %d a: %d\n", + r1, g1, b1, a1); + fprintf(stdout,"Text outline color r: %d g: %d b: %d a: %d\n", + r2, g2, b2, a2); + fprintf(stdout,"Text shadow color r: %d g: %d b: %d a: %d\n", + r3, g3, b3, a3); + } + free(class_name); + } +} + +static void +_on_destroy(Ecore_Evas *ee) +{ + ecore_main_loop_quit(); +} + +static void +_on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev = event_info; + + if (ev->button == 1) + if (obj == edje_obj) + edje_color_class_del(selected_class); + else + edje_object_color_class_del(edje_obj2, selected_class); +} + +/* here just to keep our example's window size + * in synchrony. */ +static void +_canvas_resize_cb(Ecore_Evas *_ee) +{ + int w, h; + + ecore_evas_geometry_get(_ee, NULL, NULL, &w, &h); + + if (_ee == ee) + { + evas_object_resize(bg, w, h); + evas_object_resize(edje_obj, w, h); + } + else + { + evas_object_resize(bg2, w, h); + evas_object_resize(edje_obj2, w, h); + } +} + +static void +_color_class_callback_delete(void *data, Evas *evas, Evas_Object *obj, + const char *emission, void *source) +{ + if (!strcmp(data, "process")) + fprintf(stdout, "Color class: %s deleted on process level\n", emission); + else + fprintf(stdout, "Color class: %s deleted on object level\n", emission); +} + +static void +_create_windows(void) +{ + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + ee2 = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_destroy_set(ee, _on_destroy); + ecore_evas_callback_resize_set(ee, _canvas_resize_cb); + ecore_evas_title_set(ee, "Edje Color Class Example"); + ecore_evas_show(ee); + + ecore_evas_callback_destroy_set(ee2, _on_destroy); + ecore_evas_callback_resize_set(ee2, _canvas_resize_cb); + ecore_evas_title_set(ee2, "Edje Object Color Class Example"); + ecore_evas_show(ee2); + + evas = ecore_evas_get(ee); + evas2 = ecore_evas_get(ee2); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + + bg2 = evas_object_rectangle_add(evas2); + evas_object_color_set(bg2, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg2, 0, 0); /* at canvas' origin */ + evas_object_resize(bg2, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg2); + + edje_obj = edje_object_add(evas); + evas_object_event_callback_add(edje_obj, EVAS_CALLBACK_MOUSE_DOWN, + _on_mouse_down, NULL); + + edje_object_file_set(edje_obj, edje_file_path, "example_color_class"); + evas_object_move(edje_obj, 0, 0); /* at canvas' origin */ + evas_object_resize(edje_obj, WIDTH, HEIGHT); + edje_object_part_text_set(edje_obj, "part_four", "EDJE EXAMPLE"); + edje_object_signal_callback_add(edje_obj, "color_class,del", "*", + (Edje_Signal_Cb) _color_class_callback_delete, + "process"); + evas_object_show(edje_obj); + + edje_obj2 = edje_object_add(evas2); + evas_object_event_callback_add(edje_obj2, EVAS_CALLBACK_MOUSE_DOWN, + _on_mouse_down, NULL); + + edje_object_file_set(edje_obj2, edje_file_path, "example_color_class"); + evas_object_move(edje_obj2, 0, 0); /* at canvas' origin */ + evas_object_resize(edje_obj2, WIDTH, HEIGHT); + edje_object_part_text_set(edje_obj2, "part_four", "EDJE OBJECT EXAMPLE"); + edje_object_signal_callback_add(edje_obj2, "color_class,del", "*", + (Edje_Signal_Cb) _color_class_callback_delete, + "object"); + evas_object_show(edje_obj2); +} + +int +main(int argc, char *argv[]) +{ + color c1, c2, c3; + int i; + + if (argc != 5) + { + fprintf(stderr, "You have to use: %s color_class_name color1, color2," \ + "color3\n", argv[0]); + fprintf(stderr, "Available colors:\n"); + for (i = 0; i < 8; i++) + fprintf(stderr, "%s\n", color_names[i]); + + return 1; + } + + selected_class = argv[1]; + if (!(_get_color_from_name(argv[2], &c1) && + _get_color_from_name(argv[3], &c2) && + _get_color_from_name(argv[4], &c3))) + { + fprintf(stderr, "Color not available!\n"); + return 2; + } + + ecore_evas_init(); + edje_init(); + + _create_windows(); + + edje_color_class_set(argv[1], /* class name */ + c1[0], c1[1], c1[2], c1[3], /* Object color */ + c2[0], c2[1], c2[2], c2[3], /* Text outline */ + c3[0], c3[1], c3[2], c3[3]); /* Text shadow */ + + /* Setting an arbitrary value just to see the difference between */ + /* process level and object level */ + edje_object_color_class_set(edje_obj2, argv[1], /* class name */ + 128, 180, 77, 255, /* Object color */ + 200, 22, 86, 255, /* Text outline */ + 39, 90, 187, 255); /* Text shadow */ + + _color_classes_print(); + ecore_main_loop_begin(); + ecore_evas_free(ee); + ecore_evas_free(ee2); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-drag.c b/libraries/edje/src/examples/edje-drag.c new file mode 100644 index 0000000..78e2e72 --- /dev/null +++ b/libraries/edje/src/examples/edje-drag.c @@ -0,0 +1,157 @@ +/** + * Simple Edje example illustrating drag functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc drag.edc && gcc -o drag-box drag-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH 300 +#define HEIGHT 300 + +#define RECTW 30 +#define RECTH 30 + +#define NRECTS 20 + +static const char *PARTNAME = "example/knob"; + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/drag.edj"; + +struct _App { + Ecore_Evas *ee; + Evas_Object *edje; + Evas_Object *bg; +}; + +static void +_on_destroy(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* here just to keep our example's window size and background image's + * size in synchrony */ +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int w, h; + struct _App *app = ecore_evas_data_get(ee, "app"); + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + evas_object_resize(app->bg, w, h); + evas_object_resize(app->edje, w, h); +} + +static void +_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) +{ + struct _App *app = data; + Evas_Event_Key_Down *ev = event_info; + Evas_Object *rect; + Eina_Bool r; + + + if (!strcmp(ev->keyname, "Down")) + { + edje_object_part_drag_step(app->edje, PARTNAME, 0, 1.0); + } + else if (!strcmp(ev->keyname, "Up")) + { + edje_object_part_drag_step(app->edje, PARTNAME, 0, -1.0); + } + else if (!strcmp(ev->keyname, "m")) + { + edje_object_part_drag_value_set(app->edje, PARTNAME, 0.0, 0.5); + } + else if (!strcmp(ev->keyname, "Prior")) + { + edje_object_part_drag_page(app->edje, PARTNAME, 0.0, -1.0); + } + else if (!strcmp(ev->keyname, "Next")) + { + edje_object_part_drag_page(app->edje, PARTNAME, 0.0, 1.0); + } + else if (!strcmp(ev->keyname, "Escape")) + ecore_main_loop_quit(); + else + printf("unhandled key: %s\n", ev->keyname); +} + +static void +_knob_moved_cb(void *data, Evas_Object *o, const char *emission, const char *source) +{ + double val; + edje_object_part_drag_value_get(o, PARTNAME, NULL, &val); + printf("value changed to: %0.3f\n", val); +} + +int +main(void) +{ + Evas *evas; + struct _App app; + int i; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_destroy_set(app.ee, _on_destroy); + ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); + ecore_evas_title_set(app.ee, "Edje Box Example"); + ecore_evas_show(app.ee); + + ecore_evas_data_set(app.ee, "app", &app); + + evas = ecore_evas_get(app.ee); + + app.bg = evas_object_rectangle_add(evas); + evas_object_color_set(app.bg, 255, 255, 255, 255); + evas_object_resize(app.bg, WIDTH, HEIGHT); + evas_object_focus_set(app.bg, EINA_TRUE); + evas_object_show(app.bg); + + evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); + + app.edje = edje_object_add(evas); + + edje_object_file_set(app.edje, edje_file_path, "example/group"); + evas_object_move(app.edje, 0, 0); + evas_object_resize(app.edje, WIDTH, HEIGHT); + evas_object_show(app.edje); + + edje_object_part_drag_size_set(app.edje, PARTNAME, 1.0, 0.4); + + if (!edje_object_part_drag_step_set(app.edje, PARTNAME, 0.0, 0.1)) + printf("error when setting drag step size.\n"); + + if (!edje_object_part_drag_page_set(app.edje, PARTNAME, 0.0, 0.3)) + printf("error when setting drag page step size.\n"); + + edje_object_signal_callback_add(app.edje, "drag", PARTNAME, _knob_moved_cb, &app); + + ecore_main_loop_begin(); + + ecore_evas_free(app.ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-perspective.c b/libraries/edje/src/examples/edje-perspective.c new file mode 100644 index 0000000..5220b74 --- /dev/null +++ b/libraries/edje/src/examples/edje-perspective.c @@ -0,0 +1,201 @@ +/** + * Simple Edje example illustrating drag functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc drag.edc && gcc -o drag-box drag-box.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH 480 +#define HEIGHT 320 + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/perspective.edj"; + +struct _App { + Ecore_Evas *ee; + Evas_Object *edje; + Evas_Object *bg; + Edje_Perspective *ps; + Eina_Bool animating; + int x, y; // relative position of part in the screen + int focal; +}; + +static void +_on_destroy(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* here just to keep our example's window size and background image's + * size in synchrony */ +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int w, h; + struct _App *app = ecore_evas_data_get(ee, "app"); + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + evas_object_resize(app->bg, w, h); + evas_object_resize(app->edje, w, h); +} + +static void +_part_move(struct _App *app, int dx, int dy) +{ + char emission[64]; + + if (app->animating) + return; + + app->x += dx; + app->y += dy; + if (app->x > 1) + app->x = 1; + if (app->x < 0) + app->x = 0; + if (app->y > 1) + app->y = 1; + if (app->y < 0) + app->y = 0; + + snprintf(emission, sizeof(emission), "move,%d,%d", app->x, app->y); + edje_object_signal_emit(app->edje, emission, ""); + app->animating = EINA_TRUE; +} + + +static void +_bg_key_down(void *data, Evas *e, Evas_Object *o __UNUSED__, void *event_info) +{ + struct _App *app = data; + Evas_Event_Key_Down *ev = event_info; + + + // just moving the part and text + if (!strcmp(ev->keyname, "Down")) + { + _part_move(app, 0, 1); + } + else if (!strcmp(ev->keyname, "Up")) + { + _part_move(app, 0, -1); + } + else if (!strcmp(ev->keyname, "Left")) + { + _part_move(app, -1, 0); + } + else if (!strcmp(ev->keyname, "Right")) + { + _part_move(app, 1, 0); + } + else if (!strcmp(ev->keyname, "Prior")) + { + _part_move(app, -1, -1); + } + else if (!strcmp(ev->keyname, "Next")) + { + _part_move(app, 1, 1); + } + // adjusting the perspective focal point distance + else if (!strcmp(ev->keyname, "KP_Add")) + { + app->focal += 5; + edje_perspective_set(app->ps, 240, 160, 0, app->focal); + edje_object_calc_force(app->edje); + } + else if (!strcmp(ev->keyname, "KP_Subtract")) + { + app->focal -= 5; + if (app->focal < 5) + app->focal = 5; + + edje_perspective_set(app->ps, 240, 160, 0, app->focal); + edje_object_calc_force(app->edje); + } + // exiting + else if (!strcmp(ev->keyname, "Escape")) + ecore_main_loop_quit(); + else + printf("unhandled key: %s\n", ev->keyname); +} + +static void +_animation_end_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + struct _App *app = data; + + app->animating = EINA_FALSE; +} + +int +main(void) +{ + Evas *evas; + struct _App app; + int i; + + ecore_evas_init(); + edje_init(); + + edje_frametime_set(((double)1) / 60); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + app.animating = EINA_FALSE; + app.x = 0; + app.y = 0; + app.focal = 50; + app.ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_destroy_set(app.ee, _on_destroy); + ecore_evas_callback_resize_set(app.ee, _canvas_resize_cb); + ecore_evas_title_set(app.ee, "Edje Box Example"); + ecore_evas_show(app.ee); + + ecore_evas_data_set(app.ee, "app", &app); + + evas = ecore_evas_get(app.ee); + + app.bg = evas_object_rectangle_add(evas); + evas_object_color_set(app.bg, 255, 255, 255, 255); + evas_object_resize(app.bg, WIDTH, HEIGHT); + evas_object_focus_set(app.bg, EINA_TRUE); + evas_object_show(app.bg); + + evas_object_event_callback_add(app.bg, EVAS_CALLBACK_KEY_DOWN, _bg_key_down, &app); + + app.edje = edje_object_add(evas); + + edje_object_file_set(app.edje, edje_file_path, "example/group"); + evas_object_move(app.edje, 0, 0); + evas_object_resize(app.edje, WIDTH, HEIGHT); + evas_object_show(app.edje); + + edje_object_signal_callback_add(app.edje, "animation,end", "", _animation_end_cb, &app); + + app.ps = edje_perspective_new(evas); + edje_perspective_set(app.ps, 240, 160, 0, app.focal); + edje_perspective_global_set(app.ps, EINA_TRUE); + + ecore_main_loop_begin(); + + ecore_evas_free(app.ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-signals-messages.c b/libraries/edje/src/examples/edje-signals-messages.c new file mode 100644 index 0000000..2345738 --- /dev/null +++ b/libraries/edje/src/examples/edje-signals-messages.c @@ -0,0 +1,230 @@ +/** + * Simple Edje example illustrating the Edje signals and messages + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * gcc -o edje-signals-messages edje-signals-messages.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include +#include + +#define WIDTH (300) +#define HEIGHT (300) + +#define MSG_COLOR 1 +#define MSG_TEXT 2 + +static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; +static const char *edje_file_path = \ + PACKAGE_EXAMPLES_DIR "/signals-messages.edj"; + +static Ecore_Evas *ee; +static Evas_Object *edje_obj; +static Eina_Bool right_rect_show = EINA_TRUE; + +static const char *commands = \ + "commands are:\n" + "\tt - toggle right rectangle's visibility\n" + "\th - print help\n"; + +static void +_on_keydown(void *data __UNUSED__, + Evas *evas __UNUSED__, + Evas_Object *o __UNUSED__, + void *einfo) +{ + Evas_Event_Key_Down *ev = einfo; + + if (strcmp(ev->keyname, "h") == 0) /* print help */ + { + fprintf(stdout, commands); + return; + } + + if (strcmp(ev->keyname, "t") == 0) /* toggle right rectangle's visibility */ + { + char buf[1024]; + + right_rect_show = !right_rect_show; + snprintf(buf, sizeof(buf), "part_right,%s", + right_rect_show ? "show" : "hide"); + + printf("emitting %s\n", buf); + + edje_object_signal_emit(edje_obj, buf, ""); + + return; + } +} + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* print signals coming from theme */ +static void +_sig_print(const char *emission, + const char *source) +{ + fprintf(stdout, "Signal %s coming from part %s!\n", emission, source); +} + +static void +_mouse_wheel_cb(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + const char *emission, + const char *source) +{ + _sig_print(emission, source); +} + +/* mouse over signals */ +static void +_mouse_over_cb(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + const char *emission, + const char *source) +{ + int i; + + _sig_print(emission, source); + + Edje_Message_Int_Set *msg = malloc(sizeof(*msg) + 3 * sizeof(int)); + msg->count = 4; + for (i = 0; i < 4; i++) + msg->val[i] = rand() % 256; + + edje_object_message_send(edje_obj, EDJE_MESSAGE_INT_SET, MSG_COLOR, msg); + + free(msg); +} + +/* print out received message string */ +static void +_message_handle(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + Edje_Message_Type type, + int id, + void *msg) +{ + Edje_Message_String *m; + + if (type != EDJE_MESSAGE_STRING) return; + if (id != MSG_TEXT) return; + + m = msg; + + fprintf(stdout, "String message received: %s\n", m->str); +} + +int +main(void) +{ + Evas_Object *border, *bg; + Evas *evas; + + srand(time(NULL)); + + if (!ecore_evas_init()) + return EXIT_FAILURE; + + if (!edje_init()) + return EXIT_FAILURE; + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + if (!ee) + goto error; + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_title_set(ee, "Edje Basics Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); + + evas_object_focus_set(bg, EINA_TRUE); + evas_object_event_callback_add( + bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); + + edje_obj = edje_object_add(evas); + + if (!edje_object_file_set(edje_obj, edje_file_path, "example_group")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + fprintf(stderr, "Could not load 'example_group' from " + "signals-messages.edj: %s\n", errmsg); + + evas_object_del(edje_obj); + goto error_edj; + } + + edje_object_signal_callback_add(edje_obj, "mouse,wheel,*", "part_left", + _mouse_wheel_cb, NULL); + + edje_object_signal_callback_add(edje_obj, "mouse,over", "part_right", + _mouse_over_cb, NULL); + + edje_object_message_handler_set(edje_obj, _message_handle, NULL); + + evas_object_move(edje_obj, 20, 20); + evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); + evas_object_show(edje_obj); + + /* this is a border around the Edje object above, here just to + * emphasize its geometry */ + border = evas_object_image_filled_add(evas); + evas_object_image_file_set(border, border_img_path, NULL); + evas_object_image_border_set(border, 2, 2, 2, 2); + evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE); + + evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4); + evas_object_move(border, 20 - 2, 20 - 2); + evas_object_repeat_events_set(border, EINA_TRUE); + evas_object_show(border); + + fprintf(stdout, commands); + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; + +error: + fprintf(stderr, "You got to have at least one Evas engine built" + " and linked up to ecore-evas for this example to run" + " properly.\n"); + ecore_evas_shutdown(); + return -1; + +error_edj: + fprintf(stderr, "Failed to load signals-messages.edj!\n"); + + ecore_evas_shutdown(); + return -2; +} + diff --git a/libraries/edje/src/examples/edje-swallow.c b/libraries/edje/src/examples/edje-swallow.c new file mode 100644 index 0000000..a1d30e2 --- /dev/null +++ b/libraries/edje/src/examples/edje-swallow.c @@ -0,0 +1,95 @@ +/** + * Simple Edje example illustrating swallow functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc swallow.edc && gcc -o edje-swallow edje-swallow.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH (300) +#define HEIGHT (300) + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/swallow.edj"; + +static Ecore_Evas *ee; +static Evas_Object *bg; + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* here just to keep our example's window size and background image's + * size in synchrony */ +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int w, h; + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + evas_object_resize(bg, w, h); +} + +int +main(void) +{ + Evas_Object *edje_obj, *rect, *obj; + Evas *evas; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_callback_resize_set(ee, _canvas_resize_cb); + ecore_evas_title_set(ee, "Edje Swallow Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + + edje_obj = edje_object_add(evas); + + edje_object_file_set(edje_obj, edje_file_path, "example_group"); + evas_object_move(edje_obj, 20, 20); + evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); + evas_object_show(edje_obj); + + rect = evas_object_rectangle_add(evas); + evas_object_color_set(rect, 255, 0, 0, 255); + edje_object_part_swallow(edje_obj, "part_one", rect); + + obj = edje_object_part_swallow_get(edje_obj, "part_one"); + if(obj == rect) + printf("Swallowing worked!\n"); + + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-table.c b/libraries/edje/src/examples/edje-table.c new file mode 100644 index 0000000..3866d22 --- /dev/null +++ b/libraries/edje/src/examples/edje-table.c @@ -0,0 +1,165 @@ +/** + * Simple Edje example illustrating table functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc table.edc && gcc -o edje-table edje-table.c `pkg-config --libs --cflags evas ecore ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH (400) +#define HEIGHT (400) + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/table.edj"; + +static Ecore_Evas *ee; +static Evas *evas; +static Evas_Object *bg, *edje_obj, *rects[4]; + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +/* Try to get the number of columns and rows of the table + * and print them. */ +static void +_columns_rows_print(void) +{ + int cols, rows; + + if (edje_object_part_table_col_row_size_get(edje_obj, "table_part", &cols, + &rows)) + fprintf(stdout, "Number of columns: %d\nNumber of rows: %d\n", cols, rows); + else + fprintf(stderr, "Cannot get the number of columns and rows\n"); +} + +/* here just to keep our example's window size and table items + * size in synchrony. */ +static void +_canvas_resize_cb(Ecore_Evas *ee) +{ + int i, w, h; + + ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); + + evas_object_resize(bg, w, h); + evas_object_resize(edje_obj, w, h); + + for (i = 0; i < 4; i++) + evas_object_size_hint_min_set(rects[i], w/2, h/2); +} + +/* Mouse button 1 = remove the clicked item + * any other button = remove all items. */ +static void +_on_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev = event_info; + + if (ev->button != 1) + edje_object_part_table_clear(edje_obj, "table_part", EINA_TRUE); + else if (!edje_object_part_table_unpack(edje_obj, "table_part", obj)) + fprintf(stderr, "Cannot remove the selected rectangle\n"); + + evas_object_del(obj); + _columns_rows_print(); +} + +static void +_rects_create(void) +{ + int i; + + for (i = 0; i < 4; i++) + { + rects[i] = evas_object_rectangle_add(evas); + evas_object_size_hint_min_set(rects[i], 200, 200); + evas_object_size_hint_weight_set(rects[i], 1.0, 1.0); + evas_object_show(rects[i]); + evas_object_event_callback_add(rects[i], EVAS_CALLBACK_MOUSE_DOWN, + _on_mouse_down, NULL); + } +} + +int +main(void) +{ + int i; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_callback_resize_set(ee, _canvas_resize_cb); + ecore_evas_title_set(ee, "Edje Table Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + + edje_obj = edje_object_add(evas); + + edje_object_file_set(edje_obj, edje_file_path, "example_table"); + evas_object_move(edje_obj, 0, 0); /* at canvas' origin */ + evas_object_resize(edje_obj, WIDTH, HEIGHT); + evas_object_show(edje_obj); + + _rects_create(); + + /* Colouring the rectangles */ + evas_object_color_set(rects[0], 255, 0, 0, 255); + evas_object_color_set(rects[1], 0, 255, 0, 255); + evas_object_color_set(rects[2], 0, 0, 255, 255); + evas_object_color_set(rects[3], 128, 128, 128, 255); + + /* Packing the rectangles into the table */ + if (!edje_object_part_table_pack(edje_obj, "table_part", rects[0], + 0, 0, 1, 2)) + fprintf(stderr, "Cannot add the rectangle 1 to table\n"); + + if (!edje_object_part_table_pack(edje_obj, "table_part", rects[1], + 0, 1, 1, 1)) + fprintf(stderr, "Cannot add the rectangle 2 to table\n"); + + if (!edje_object_part_table_pack(edje_obj, "table_part", rects[2], + 1, 0, 1, 1)) + fprintf(stderr, "Cannot add the rectangle 3 to table\n"); + + if (!edje_object_part_table_pack(edje_obj, "table_part", rects[3], + 1, 1, 1, 1)) + fprintf(stderr, "Cannot add the rectangle 4 to table\n"); + + _columns_rows_print(); + + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/edje-text.c b/libraries/edje/src/examples/edje-text.c new file mode 100644 index 0000000..0916509 --- /dev/null +++ b/libraries/edje/src/examples/edje-text.c @@ -0,0 +1,92 @@ +/** + * Simple Edje example illustrating text functions. + * + * You'll need at least one Evas engine built for it (excluding the + * buffer one). See stdout/stderr for output. + * + * @verbatim + * edje_cc text.edc && gcc -o edje-text edje-text.c `pkg-config --libs --cflags ecore-evas edje` + * @endverbatim + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include + +#define WIDTH (300) +#define HEIGHT (300) + +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/text.edj"; + +static Ecore_Evas *ee; +static Evas_Object *bg; + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +static void +_cb(void *data, Evas_Object *obj, const char *part) +{ + printf("text: %s\n", edje_object_part_text_unescaped_get(obj, part)); +} + +int +main(void) +{ + Evas_Object *edje_obj, *rect, *obj; + Evas *evas; + + ecore_evas_init(); + edje_init(); + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_title_set(ee, "Edje text Example"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); + + edje_obj = edje_object_add(evas); + + edje_object_file_set(edje_obj, edje_file_path, "example_group"); + evas_object_move(edje_obj, 20, 20); + evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); + evas_object_show(edje_obj); + + edje_object_text_change_cb_set(edje_obj, _cb, NULL); + edje_object_part_text_set(edje_obj, "part_one", "one"); + edje_object_part_text_set(edje_obj, "part_two", "two"); + + edje_object_part_text_select_allow_set(edje_obj, "part_two", EINA_TRUE); + edje_object_part_text_select_all(edje_obj, "part_two"); + printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two")); + edje_object_part_text_select_none(edje_obj, "part_two"); + printf("selection: %s\n", edje_object_part_text_selection_get(edje_obj, "part_two")); + + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; +} diff --git a/libraries/edje/src/examples/lua_script.edc b/libraries/edje/src/examples/lua_script.edc new file mode 100644 index 0000000..24e8ebe --- /dev/null +++ b/libraries/edje/src/examples/lua_script.edc @@ -0,0 +1,405 @@ +color_classes { + color_class { name: "test_colour"; color: 255 255 255 255; } +} + +fonts { + font: "Vera.ttf" "default"; +} + +images { + image: "bubble.png" COMP; + image: "test.png" COMP; +} + +collections { + group { + name: "main"; + lua_script_only: 1; + lua_script { + --// stick object private/local vars here + local D; + local count = 0; + local fndata = 99; + local text_geom; + + --// Functions to print tables. + local print_table, print_table_start; + + function print_table_start(table, space, name) + print(space .. name .. ": "); + print(space .. "{"); + print_table(table, space .. " "); + print(space .. "}"); + end + + function print_table(table, space) + for k, v in pairs(table) do + if type(v) == "table" then + print_table_start(v, space, k); + elseif type(v) == "string" then + print(space .. k .. ': "' .. v .. '";') + else + print(space .. k .. ": " .. v .. ";") + end + end + end + + local function mycb3 (v) + print("lua::callback transition " .. D.val .. " v: " .. v); + d = {}; + d = edje.size(d); + print("lua::objsize= " .. d.w .. " , " .. d.h); + sz = {w=v * 80, h=v * 40}; + D.rect:geom(((d.w / 2) * math.sin(v * 2 * math.pi)) + ((d.w - sz.w) / 2), + ((d.h / 2) * math.cos(v * 2 * math.pi)) + ((d.h - sz.h) / 2), + sz.w, sz.h); + D.rect:color(255, 128, v * 255, 255); + d = D.rect:move(d); + print("lua::pos= " .. d.x .. " , " .. d.y); + + r = D.rect:above(); + if (r ~= nil) then + print("lua::rcol"); + r:color(20, v * 255, 60, 255); + else + print("lua::r none!!!!!!!!!!!!!!1"); + end + d = edje.size(); + D.clip:geom(10, 10, d.w - 20, d.h - 20); + c = D.clip:clipees(); + for i=1,table.getn(c),1 do + d = c[i]:geom(); + print("lua::" .. i .. " geom = " .. d.x .. "," .. d.y .. " " .. d.w .. "x" .. d.h); + end + return true; --// repeat the timer + end + + local function mycb2 () + print("lua::callback animator " .. count .. " seconds: " .. edje.seconds() .. " looptime: " .. edje.looptime()); + edje.color_class("test_colour", 255, (count * 10) % 255, 255, 255); + edje.text_class("test_text_class", "Sans:style=Bold", ((count * 3) % 100) + 8); + if (5 > (count % 10)) then + D.text:font("default", 32); + else + D.text:font("Sans:style=Bold", 32); + end + edje_geom = edje.geom(); + text_geom = D.text:geom(); + D.text:move((edje_geom.w - text_geom.w) / 2, (edje_geom.h - text_geom.h) / 8); + return true; --// repeat the timer + end + + local function mycb () + print("lua::callback timer " .. count .. " fndata = " .. fndata); + count = count + 1; --// keep count of calls - object data + fndata = fndata + 3; --// play with object vars to see if they persist + D.tim = edje.timer(0.25, mycb); --// inside cb add new timer + return false; --// cease repeating the timer + end + + --// init object here + D = {}; --// data is empty table to start + D.val = math.random(); --// start with some random value so + fndata = fndata + D.val; --// func data start point + print("lua::init ... " .. D.val); + edje.echo("lua::echo('hello world')"); + + --// actually add the timer to call mycb in 1.23 sec + D.tim = edje.timer(1.23, mycb); + D.tra = edje.transition(5.0, mycb3); + D.ani = edje.animator(mycb2); + edje_geom = edje.geom(); + + if (edje.spanky) then edje.spanky(); end + + local date = edje.date(); + print("lua:: date: " .. + date.year .. "|" .. + date.month .. "|" .. + date.day .. "|" .. + date.yearday .. "|" .. + date.weekday .. "|" .. + date.hour .. "|" .. + date.min .. "|" .. + date.sec + ); + + --// send some random edje message + edje.messagesend(7, "none" ); + edje.messagesend(7, "sig", "signal", "source"); + edje.messagesend(7, "str", "hello world"); + edje.messagesend(7, "int", 987); + edje.messagesend(7, "float", 987.321); + edje.messagesend(7, "strset", {"hello", "there", "world"}); + edje.messagesend(7, "intset", {1, 2, 3}); + edje.messagesend(7, "floatset", {1.1, 2.2, 3.3}); + edje.messagesend(7, "strint", "hello world", 7); + edje.messagesend(7, "strfloat", "hello world", 7.654); + edje.messagesend(7, "strintset","hello world", {1, 2, 3}); + + D.edje = edje.edje(); + D.edje:file("plain/edje/group"); + D.edje:show(); + + D.rect = edje.rect(); + D.rect:geom (5, 10, 50, 30); + D.rect:color (255, 128, 60, 255); + D.rect:show (); + + D.rect2 = edje.rect(); + D.rect2:geom (50, 50, 50, 50); + D.rect2:color (20, 30, 60, 120); + D.rect2:show (); + + D.clip = edje.rect(); + D.clip:geom (10, 10, 150, 150); + D.clip:color (200, 200, 50, 200); + D.clip:show (); + + D.rect2:clip(D.clip); + D.rect:clip(D.clip); + + D.text = edje.text(); + D.text:geom (50, 5, 150, 50); + D.text:color (255, 0, 0, 255); + D.text:font("Sans:style=Bold", 32); + D.text:text("Lua rocks!"); + text_geom = D.text:geom(); + print(D.text:text()); + D.text:show(); + + --// Fun with maps! + D.map = edje.map(4); --// 4 is the only supported map size at the moment. + --// These all do the same thing. + --// Note, lua likes to start at 1, C (and thus evas) at 0. I choose to agree with C. + D.map:coord(0, 50, 50, 0); + D.map:coord(1, 100, 50, 0); + D.map:coord(2, 100, 100, 0); + D.map:coord(3, 50, 100, 0); + D.map:populate(50, 50, 50, 50, 0); + D.map:populate(D.rect2, 0); + D.map:populate(D.rect2); + + --// print the results + D.coord = D.map:coord(0); + print("lua::map coords for point 0 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z); + D.coord = D.map:coord(1); + print("lua::map coords for point 1 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z); + D.coord = D.map:coord(2); + print("lua::map coords for point 2 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z); + D.coord = D.map:coord(3); + print("lua::map coords for point 3 x=" .. D.coord.x .. " y=" .. D.coord.y .. " z=" .. D.coord.z); + + D.map:smooth(false); + D.map:alpha(true); + + if (D.map:alpha()) then + print("lua::map is alpha"); + end + + if (D.map:smooth()) then + print("lua::map is smooooth"); + end + + if (D.map:clockwise()) then + print("lua::map is clockwise"); + end + + D.map:color(255, 255, 255, 255); // set all points to this colour. + D.map:color(1, 255, 0, 255, 255); // set just one point to this colour. + + D.map:lighting(75, 75, 10, 255, 255, 255, 0, 255, 0); // Ambient light and a 3D light source. + + --// Toss it around. + D.map:rotate(45.0, 75, 75); + D.map:zoom(1.5, 1.5, 75, 75); + D.map:rotate3d(10.0, 20.0, 30.0, 75, 75, 0); + D.map:perspective(200, 200, 0, 20); + + --// For image UV mapping. + D.map:uv(0, 0.0, 0.0); + D.map:uv(1, 50.0, 0.0); + D.map:uv(2, 50.0, 50.0); + D.map:uv(3, 0.0, 50.0); + + --// Actually apply the resulting transformations. + D.rect2:map(D.map); + D.rect2:map_enable(true); + if (D.rect2:map_enable()) then + print("lua::map enabled"); + end + + D.rect2:map_source(D.rect); --// Don't think this is actually implemented in evas. + +--// D.map:dup(); +--// D.map:size(); --// perhaps overide the # operator? For now it's only gonna return 4 anyway. + + --// example of deleting something + --// D.tim:del(); + + --// test the color_class stuff + colour = edje.color_class("test_colour"); + print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a); + colour = edje.color_class("test_colour", 32, 64, 255, 128); + print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a); + colour = edje.color_class("test_colour", { r=255, g=0, b=255, a=255 }); + print("lua::color_class= " .. colour.r .. "," .. colour.g .. "," .. colour.b .. "," .. colour.a); + text = edje.text_class("test_text_class", "Sans:style=Bold", 8); + print("lua::text_class= " .. text.font .. " size " .. text.size); + + --// Do something bad, just to see what happens. +--// edje.color_class(nil); + + --// shutdown func - generally empty or not there. everything garbage collected for you + function shutdown () + print("lua::shutdown ... " .. D.val); + end + + function show () + print("lua::show ... " .. D.val); + end + + function hide () + print("lua::hide ... " .. D.val); + end + + function move (x, y) + print("lua::move x=" .. x .. " x=" .. y); + D.edje:move(0, 0); + end + + function resize (w, h) + print("lua::resize w=" .. w .. " h=" .. h); + D.text:move((w - text_geom.w) / 2, (h - text_geom.h) / 8); + D.edje:resize(w, h); + end + + function message (id, type, ...) + print("lua::message id=" .. id .. " type=" .. type); + --// handle your message type here. check id + type then use the + --// vararg appropriately. they are the same as the params passed + --// to edje:messagesend() (if any are passed at all). Any array + --// arguments are passed as a single table. + + if ("none" == type) then + print("lua::message no args"); + elseif ("strset" == type) then + strs = ... ; + print_table_start(strs, "", "lua::message strings"); + elseif ("intset" == type) then + ints = ... ; + print_table_start(ints, "", "lua::message ints"); + elseif ("floatset" == type) then + floats = ... ; + print_table_start(floats, "", "lua::message floats"); + elseif ("strintset" == type) then + str, ints = ... ; + print("lua::message " .. str); + print_table_start(ints, "", "lua::message ints"); + elseif ("strfloatset" == type) then + str, floats = ... ; + print("lua::message " .. str); + print_table_start(floats, "", "lua::message floats"); + else + print("lua::message " .. ... ); + end + end + + function signal (sig, src) + print("lua::signal sig= " .. sig .. " src= " .. src); + end + } + } + + // The group name NEEDS a / in it, + // or the part below that tries to swallow it won't work. + // Leaving just the lua part visible. + group { + name: "bubbles/lua"; + lua_script_only: 1; + lua_script { + local bubbles = { }; + local bubbleCols = 8; + local bubbleRows = 6; + + for i = 1, bubbleRows do + row = { }; + for j = 1, bubbleCols do + image = edje.image(); + image:image("bubble.png"); + image:show(); + table.insert(row, image); + end + table.insert(bubbles, row); + end + + function resize (w, h) + for i = 1, bubbleRows do + for j = 1, bubbleCols do + w1 = w / bubbleCols; + h1 = h / bubbleRows; + bubbles[i][j]:geom((j - 1) * w1, (i - 1) * h1, w1, h1); + if ((1 == i) or (1 == j) or (bubbleRows == i) or (bubbleCols == j)) then + bubbles[i][j]:color(0, 255, 0, 200); + else + bubbles[i][j]:color(math.random(200) + 55, 0, math.random(255) + 55, 200); + end + end + end + end + } + } + + group { + name: "plain/edje/group"; + parts { + part { + name: "background"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 0 0 0 255; + } + } + + // A lua group embedded in an edje group. + part { + name: "bubbles_lua"; + type: GROUP; + source: "bubbles/lua"; + mouse_events: 0; + description { state: "default" 0.0; } + } + + part { + name: "background_image"; + type: IMAGE; + mouse_events: 0; + description { + state: "default" 0.0; + aspect_preference: HORIZONTAL; + color_class: "test_colour"; + image { normal: "test.png"; } + } + } + + part { + name: "some_text"; + type: TEXT; + mouse_events: 0; + description { + state: "default" 0; + text + { + text: "This is test text."; + text_class: "test_text_class"; + } + } + } + + } + } + +} + diff --git a/libraries/edje/src/examples/perspective.edc b/libraries/edje/src/examples/perspective.edc new file mode 100644 index 0000000..810ae18 --- /dev/null +++ b/libraries/edje/src/examples/perspective.edc @@ -0,0 +1,140 @@ +collections { + group { + name: "example/group"; + + min: 480 320; + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + + description { + state: "default" 0.0; + } + } // bg + + part { + name: "rectangle"; + type: RECT; + mouse_events: 0; + + description { + state: "default" 0.0; + color: 255 0 0 128; + + rel1 { + offset: -5 -5; + to: "title"; + } + rel2 { + offset: 4 4; + to: "title"; + } + + map { + on: 1; + perspective_on: 1; + rotation { + x: 45; + } + } + } + } // rectangle + + part { + name: "title"; + type: TEXT; + mouse_events: 0; + + description { + state: "default" 0.0; + color: 200 200 200 255; + + align: 0.0 0.5; + + rel1.relative: 0.1 0.1; + rel2.relative: 0.1 0.1; + + text { + text: "Perspective example"; + font: "Sans"; + size: 16; + min: 1 1; + } + + map { + on: 1; + perspective_on: 1; + rotation { + x: 45; + } + } + } + + description { + state: "right" 0.0; + inherit: "default" 0.0; + + rel1.relative: 0.5 0.1; + rel2.relative: 0.5 0.1; + } + description { + state: "bottom" 0.0; + inherit: "default" 0.0; + + rel1.relative: 0.1 0.9; + rel2.relative: 0.1 0.9; + } + description { + state: "bottomright" 0.0; + inherit: "default" 0.0; + + rel1.relative: 0.5 0.9; + rel2.relative: 0.5 0.9; + } + } // title + } + + programs { + program { + name: "move,right"; + signal: "move,1,0"; + action: STATE_SET "right" 0.0; + transition: SINUSOIDAL 1.0; + target: "title"; + after: "animation,end"; + } + program { + name: "move,bottom"; + signal: "move,0,1"; + action: STATE_SET "bottom" 0.0; + transition: SINUSOIDAL 1.0; + target: "title"; + after: "animation,end"; + } + program { + name: "move,bottomright"; + signal: "move,1,1"; + action: STATE_SET "bottomright" 0.0; + transition: SINUSOIDAL 1.0; + target: "title"; + after: "animation,end"; + } + program { + name: "move,default"; + signal: "move,0,0"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 1.0; + target: "title"; + after: "animation,end"; + } + + program { + name: "animation,end"; + action: SIGNAL_EMIT "animation,end" ""; + } + } + } +} diff --git a/libraries/edje/src/examples/red.png b/libraries/edje/src/examples/red.png new file mode 100644 index 0000000..dd03528 Binary files /dev/null and b/libraries/edje/src/examples/red.png differ diff --git a/libraries/edje/src/examples/signals-messages.edc b/libraries/edje/src/examples/signals-messages.edc new file mode 100644 index 0000000..45d9c58 --- /dev/null +++ b/libraries/edje/src/examples/signals-messages.edc @@ -0,0 +1,174 @@ +#define MSG_COLOR 1 +#define MSG_TEXT 2 + +collections { + group { + name: "example_group"; + + parts { + part { + name: "part_right"; + type: RECT; + clip_to: "part_right_clipper"; + description { + min: 50 50; + max: 50 50; + state: "default" 0.0; + color: 0 0 255 255; /* blue */ + rel1.relative: 1.0 0.5; + rel1.offset: -49 0; + rel2.relative: 1.0 0.5; + } + } + + part { + name: "part_left"; + type: RECT; + description { + color_class: "cc"; + min: 50 50; + max: 50 50; + state: "default" 0.0; + rel1.relative: 0.0 0.5; + rel2.relative: 0.0 0.5; + rel2.offset: 50 -1; + } + } + + part { + name: "text"; + type: TEXT; + description { + min: 150 50; + max: 150 50; + fixed: 1 1; + color: 0 0 0 255; + state: "default" 0.0; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + text { + font: "Sans"; + size: 20; + min: 1 1; + align: 0.5 0.5; + } + } + } + + part { + name: "part_right_clipper"; + type: RECT; + repeat_events: 1; + + description { + min: 50 50; + max: 50 50; + + state: "default" 0.0; + rel1.relative: 1.0 0.5; + rel1.offset: -49 0; + rel2.relative: 1.0 0.5; + } + + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + + script { + public global_str0; + public global_str1; + public global_str2; + public str_idx; + + public set_text_string() { + new tmp[1024]; + new idx; + idx = get_int(str_idx); + + if (idx == 0) + get_str(global_str0, tmp, 1024); + else if (idx == 1) + get_str(global_str1, tmp, 1024); + else if (idx == 2) + get_str(global_str2, tmp, 1024); + else return; + + set_text(PART:"text", tmp); + send_message(MSG_STRING, MSG_TEXT, tmp); + } + + public message(Msg_Type:type, id, ...) { + if ((type == MSG_INT_SET) && (id == MSG_COLOR)) { + new r, g, b, a; + + r = getarg(3); + g = getarg(4); + b = getarg(5); + a = getarg(6); + + set_color_class("cc", r, g, b, a); + } + } + } + + programs { + program { + name: "bootstrap"; + signal: "load"; + source: ""; + script { + set_str(global_str0, "String one"); + set_str(global_str1, "String two"); + set_str(global_str2, "String three"); + set_int(str_idx, 0); + set_text_string(); + } + } + + program { /* custom signal */ + name: "part_right,hovered"; + signal: "mouse,move"; + source: "part_right"; + action: SIGNAL_EMIT "mouse,over" "part_right"; + } + + program { /* hide right rectangle */ + name: "part_right,hide"; + signal: "part_right,hide"; + source: ""; + action: STATE_SET "hidden" 0.0; + target: "part_right_clipper"; + } + + program { + name: "part_right,show"; + signal: "part_right,show"; + source: ""; + action: STATE_SET "default" 0.0; + target: "part_right_clipper"; + } + + program { /* change text part's string value */ + name: "text,change"; + signal: "mouse,clicked,1"; + source: "part_left"; + script { + new idx; + idx = get_int(str_idx); + idx = idx + 1; + + if (idx > 2) + set_int(str_idx, 0); + else + set_int(str_idx, idx); + + set_text_string(); + } + } + } + } +} diff --git a/libraries/edje/src/examples/sigtest.c b/libraries/edje/src/examples/sigtest.c new file mode 100644 index 0000000..6e4d85f --- /dev/null +++ b/libraries/edje/src/examples/sigtest.c @@ -0,0 +1,309 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include +#include + +#define WIDTH (300) +#define HEIGHT (300) + +static const char *border_img_path = PACKAGE_EXAMPLES_DIR "/red.png"; +static const char *edje_file_path = PACKAGE_EXAMPLES_DIR "/sigtest.edj"; + +static Ecore_Evas *ee; +static Evas_Object *edje_obj; + +static const char commands[] = \ + "commands are:\n" + "\te - change te edje base\n" + "\tl - change to lua base\n" + "\tm - send message\n" + "\ts - send signal\n" + "\th - print help\n"; + +static void +_on_keydown(void *data __UNUSED__, + Evas *evas __UNUSED__, + Evas_Object *o __UNUSED__, + void *einfo) +{ + Evas_Event_Key_Down *ev = einfo; + + if (strcmp(ev->keyname, "h") == 0) + { + fprintf(stdout, commands); + return; + } + + if (strcmp(ev->keyname, "e") == 0) + { + if (!edje_object_file_set(edje_obj, edje_file_path, "plain/edje/group")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + + fprintf(stderr, "Could not load 'plain/edje/group' from sigtest.edj: %s\n", errmsg); + } + else + fprintf(stdout, "Loaded Edje object bound to group 'plain/edje/group' from" + " file sigtest.edj with success!\n"); + return; + } + + if (strcmp(ev->keyname, "l") == 0) + { + if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + + fprintf(stderr, "Could not load 'lua_base' from sigtest.edj: %s\n", errmsg); + } + else + fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from" + " file sigtest.edj with success!\n"); + return; + } + + if (strcmp(ev->keyname, "m") == 0) + { + Edje_Message_String *msg = malloc(sizeof(*msg)); + + fprintf(stdout, "\n"); + msg->str = strdup("C message text"); + edje_object_message_send(edje_obj, EDJE_MESSAGE_STRING, 2, msg); + free(msg); + fprintf(stdout, "C message sent\n"); + return; + } + + if (strcmp(ev->keyname, "s") == 0) + { + fprintf(stdout, "\n"); + edje_object_signal_emit(edje_obj, "C signal 1", "Csource"); + edje_object_signal_emit(edje_obj, "bubbles_lua:C signal 2", "Csource"); + fprintf(stdout, "C signal sent\n"); + return; + } +} + +static void +_on_message(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg) +{ + int i; + + fprintf(stdout, "C::message id=%d type=%d ", id, type); + switch (type) + { + case EDJE_MESSAGE_NONE : + { + fprintf(stdout, " NONE"); + break; + } + + case EDJE_MESSAGE_SIGNAL : + { + fprintf(stdout, " SIGNAL "); + break; + } + + case EDJE_MESSAGE_STRING : + { + Edje_Message_String *mmsg = msg; + + fprintf(stdout, " STRING %s", mmsg->str); + break; + } + + case EDJE_MESSAGE_INT : + { + Edje_Message_Int *mmsg = msg; + + fprintf(stdout, " INT %d", mmsg->val); + break; + } + + case EDJE_MESSAGE_FLOAT : + { + Edje_Message_Float *mmsg = msg; + + fprintf(stdout, " FLOAT %f", mmsg->val); + break; + } + + case EDJE_MESSAGE_STRING_SET : + { + Edje_Message_String_Set *mmsg = msg; + + fprintf(stdout, " STRING_SET -\n"); + for (i = 0; i < mmsg->count; i++) + fprintf(stdout, " %s\n", mmsg->str[i]); + break; + } + + case EDJE_MESSAGE_INT_SET : + { + Edje_Message_Int_Set *mmsg = msg; + + fprintf(stdout, " INT_SET -\n"); + for (i = 0; i < mmsg->count; i++) + fprintf(stdout, " %d\n", mmsg->val[i]); + break; + } + + case EDJE_MESSAGE_FLOAT_SET : + { + Edje_Message_Float_Set *mmsg = msg; + + fprintf(stdout, " FLOAT_SET -\n"); + for (i = 0; i < mmsg->count; i++) + fprintf(stdout, " %f\n", mmsg->val[i]); + break; + } + + case EDJE_MESSAGE_STRING_INT : + { + Edje_Message_String_Int *mmsg = msg; + + fprintf(stdout, " STRING_INT %s %d", mmsg->str, mmsg->val); + break; + } + + case EDJE_MESSAGE_STRING_FLOAT : + { + Edje_Message_String_Float *mmsg = msg; + + fprintf(stdout, " STRING_FLOAT %s %f", mmsg->str, mmsg->val); + break; + } + + case EDJE_MESSAGE_STRING_INT_SET : + { + Edje_Message_String_Int_Set *mmsg = msg; + + fprintf(stdout, " STRING_INT_SET %s -\n", mmsg->str); + for (i = 0; i < mmsg->count; i++) + fprintf(stdout, " %d\n", mmsg->val[i]); + break; + } + + case EDJE_MESSAGE_STRING_FLOAT_SET : + { + Edje_Message_String_Float_Set *mmsg = msg; + + fprintf(stdout, " STRING_FLOAT_SET %s -\n", mmsg->str); + for (i = 0; i < mmsg->count; i++) + fprintf(stdout, " %f\n", mmsg->val[i]); + break; + } + } + fprintf(stdout, "\n"); +} + +static void +_on_signal(void *data, Evas_Object *obj __UNUSED__, const char *emission, const char *source) +{ + fprintf(stdout, "C::signal sig=|%s| src=|%s|\n", emission, source); +} + +static void +_on_delete(Ecore_Evas *ee __UNUSED__) +{ + ecore_main_loop_quit(); +} + +int +main(void) +{ + Evas_Object *border, *bg; + Evas *evas; + + if (!ecore_evas_init()) + return EXIT_FAILURE; + + if (!edje_init()) + return EXIT_FAILURE; + + /* this will give you a window with an Evas canvas under the first + * engine available */ + ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); + if (!ee) + goto error; + + ecore_evas_callback_delete_request_set(ee, _on_delete); + ecore_evas_title_set(ee, "Signals and wessages tester"); + ecore_evas_show(ee); + + evas = ecore_evas_get(ee); + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */ + evas_object_move(bg, 0, 0); /* at canvas' origin */ + evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */ + evas_object_show(bg); + ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); + + evas_object_focus_set(bg, EINA_TRUE); + evas_object_event_callback_add( + bg, EVAS_CALLBACK_KEY_DOWN, _on_keydown, NULL); + + edje_obj = edje_object_add(evas); + + edje_object_message_handler_set(edje_obj, _on_message, NULL); + edje_object_signal_callback_add(edje_obj, "*", "*", _on_signal, NULL); + + if (!edje_object_file_set(edje_obj, edje_file_path, "lua_base")) + { + int err = edje_object_load_error_get(edje_obj); + const char *errmsg = edje_load_error_str(err); + fprintf(stderr, "Could not load 'lua_base' from sigtest.edj: %s\n", + errmsg); + + evas_object_del(edje_obj); + goto error_edj; + } + + fprintf(stdout, "Loaded Edje object bound to group 'lua_base' from" + " file sigtest.edj with success!\n"); + + evas_object_move(edje_obj, 20, 20); + evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); + evas_object_show(edje_obj); + + /* this is a border around the Edje object above, here just to + * emphasize its geometry */ + border = evas_object_image_filled_add(evas); + evas_object_image_file_set(border, border_img_path, NULL); + evas_object_image_border_set(border, 2, 2, 2, 2); + evas_object_image_border_center_fill_set(border, EVAS_BORDER_FILL_NONE); + + evas_object_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4); + evas_object_move(border, 20 - 2, 20 - 2); + evas_object_show(border); + + ecore_main_loop_begin(); + + ecore_evas_free(ee); + ecore_evas_shutdown(); + edje_shutdown(); + return 0; + +error: + fprintf(stderr, "You got to have at least one evas engine built" + " and linked up to ecore-evas for this example to run" + " properly.\n"); + ecore_evas_shutdown(); + return -1; + +error_edj: + fprintf(stderr, "Failed to load sigtest.edj!\n"); + + ecore_evas_shutdown(); + return -2; +} diff --git a/libraries/edje/src/examples/sigtest.edc b/libraries/edje/src/examples/sigtest.edc new file mode 100644 index 0000000..ef2a854 --- /dev/null +++ b/libraries/edje/src/examples/sigtest.edc @@ -0,0 +1,303 @@ +fonts { + font: "Vera.ttf" "default"; +} + +images { + image: "bubble.png" COMP; +} + +collections { + group { + name: "lua_base"; + lua_script_only: 1; + lua_script { + --// stick object private/local vars here + local D; + local text_geom; + + --// Functions to print tables. + local print_table, print_table_start; + + function print_table_start(table, space, name) + print(space .. name .. ": "); + print(space .. "{"); + print_table(table, space .. " "); + print(space .. "}"); + end + + function print_table(table, space) + for k, v in pairs(table) do + if type(v) == "table" then + print_table_start(v, space, k); + elseif type(v) == "string" then + print(space .. k .. ': "' .. v .. '";') + else + print(space .. k .. ": " .. v .. ";") + end + end + end + + + --// init object here + D = {}; --// data is empty table to start + edje_geom = edje.geom(); + + D.edje = edje.edje(); + D.edje:file("plain/edje/group"); + D.edje:move(0, 0); + D.edje:resize(edje_geom.w, edje_geom.h); + D.edje:show(); + + edje.text_class("test_text_class", "Sans:style=Bold", 10); + + --// send some random edje message + edje.messagesend(7, "none" ); + edje.messagesend(7, "sig", "lua message signal", "luaSource"); + edje.messagesend(7, "str", "hello world"); + edje.messagesend(7, "int", 987); + edje.messagesend(7, "float", 987.321); + edje.messagesend(7, "strset", {"hello", "there", "world"}); + edje.messagesend(7, "intset", {1, 2, 3}); + edje.messagesend(7, "floatset", {1.1, 2.2, 3.3}); + edje.messagesend(7, "strint", "hello world", 7); + edje.messagesend(7, "strfloat", "hello world", 7.654); + edje.messagesend(7, "strintset","hello world", {1, 2, 3}); + --// and a signal + edje.emit("lua signal", "luaSource"); + + + function move (x, y) + print("lua::move x=" .. x .. " x=" .. y); + D.edje:move(0, 0); + end + + function resize (w, h) + print("lua::resize w=" .. w .. " h=" .. h); + D.edje:resize(w, h); + end + + function message (id, type, ...) + print("lua::message id=" .. id .. " type=" .. type); + --// handle your message type here. check id + type then use the + --// vararg appropriately. they are the same as the params passed + --// to edje:messagesend() (if any are passed at all). Any array + --// arguments are passed as a single table. + + if ("none" == type) then + print("lua::message no args"); + elseif ("strset" == type) then + strs = ... ; + print_table_start(strs, "", "lua::message strings"); + elseif ("intset" == type) then + ints = ... ; + print_table_start(ints, "", "lua::message ints"); + elseif ("floatset" == type) then + floats = ... ; + print_table_start(floats, "", "lua::message floats"); + elseif ("strintset" == type) then + str, ints = ... ; + print("lua::message " .. str); + print_table_start(ints, "", "lua::message ints"); + elseif ("strfloatset" == type) then + str, floats = ... ; + print("lua::message " .. str); + print_table_start(floats, "", "lua::message floats"); + else + print("lua::message " .. ... ); + end + end + + function signal (sig, src) + print("lua::signal sig=|" .. sig .. "| src=" .. src .. "|"); + end + } + } + + // The group name NEEDS a / in it, + // or the part below that tries to swallow it won't work. + // Leaving just the lua part visible. + group { + name: "bubbles/lua"; + lua_script_only: 1; + lua_script { + local bubbles = { }; + local bubbleCols = 8; + local bubbleRows = 6; + + --// Functions to print tables. + local print_table, print_table_start; + + function print_table_start(table, space, name) + print(space .. name .. ": "); + print(space .. "{"); + print_table(table, space .. " "); + print(space .. "}"); + end + + function print_table(table, space) + for k, v in pairs(table) do + if type(v) == "table" then + print_table_start(v, space, k); + elseif type(v) == "string" then + print(space .. k .. ': "' .. v .. '";') + else + print(space .. k .. ": " .. v .. ";") + end + end + end + + + for i = 1, bubbleRows do + row = { }; + for j = 1, bubbleCols do + image = edje.image(); + image:image("bubble.png"); + image:show(); + table.insert(row, image); + end + table.insert(bubbles, row); + end + + function resize (w, h) + for i = 1, bubbleRows do + for j = 1, bubbleCols do + w1 = w / bubbleCols; + h1 = h / bubbleRows; + bubbles[i][j]:geom((j - 1) * w1, (i - 1) * h1, w1, h1); + if ((1 == i) or (1 == j) or (bubbleRows == i) or (bubbleCols == j)) then + bubbles[i][j]:color(0, 255, 0, 200); + else + bubbles[i][j]:color(math.random(200) + 55, 0, math.random(255) + 55, 200); + end + end + end + end + + function message (id, type, ...) + print("bubbles::message id=" .. id .. " type=" .. type); + --// handle your message type here. check id + type then use the + --// vararg appropriately. they are the same as the params passed + --// to edje:messagesend() (if any are passed at all). Any array + --// arguments are passed as a single table. + + if ("none" == type) then + print("bubbles::message no args"); + elseif ("strset" == type) then + strs = ... ; + print_table_start(strs, "", "bubbles::message strings"); + elseif ("intset" == type) then + ints = ... ; + print_table_start(ints, "", "bubbles::message ints"); + elseif ("floatset" == type) then + floats = ... ; + print_table_start(floats, "", "bubbles::message floats"); + elseif ("strintset" == type) then + str, ints = ... ; + print("bubbles::message " .. str); + print_table_start(ints, "", "bubbles::message ints"); + elseif ("strfloatset" == type) then + str, floats = ... ; + print("bubbles::message " .. str); + print_table_start(floats, "", "bubbles::message floats"); + else + print("bubbles::message " .. ... ); + end + end + + function signal (sig, src) + print("bubbles::signal sig=|" .. sig .. "| src=|" .. src .. "|"); + end + } + } + + group { + name: "plain/edje/group"; + parts { + part { + name: "background"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 0 0 0 255; + } + } + + // A lua group embedded in an edje group. + part { + name: "bubbles_lua"; + type: GROUP; + source: "bubbles/lua"; + mouse_events: 0; + description { state: "default" 0.0; visible: 1; } + } + + part { + name: "some_text"; + type: TEXT; + mouse_events: 0; + description { + state: "default" 0; + visible: 1; + text + { + text: "This is test text."; + text_class: "test_text_class"; + } + } + } + + program { name: "show_signals"; + signal: "*"; + source: "*"; + script + { + new buf[128]; + + snprintf(buf, 128, "edje::signal sig=%s sig=%s", sig, src); + set_text(PART:"some_text", buf); + } + } + + script { + public global_str0; + public global_str1; + public global_str2; + public str_idx; + + public set_text_string() { + new tmp[1024]; + new idx; + idx = get_int(str_idx); + + if (idx == 0) + get_str(global_str0, tmp, 1024); + else if (idx == 1) + get_str(global_str1, tmp, 1024); + else if (idx == 2) + get_str(global_str2, tmp, 1024); + else return; + + set_text(PART:"some_text", tmp); + send_message(MSG_STRING, 1, tmp); + } + + public message(Msg_Type:type, id, ...) { + if (type == MSG_STRING) { + new text[64]; + new buf[128]; + + getsarg(3, text, 64); + snprintf(buf, 128, "embryo::message |%s|", text); + set_text(PART:"some_text", buf); + } + } + + + } + + } + } + +} + diff --git a/libraries/edje/src/examples/swallow.edc b/libraries/edje/src/examples/swallow.edc new file mode 100644 index 0000000..a62a0b5 --- /dev/null +++ b/libraries/edje/src/examples/swallow.edc @@ -0,0 +1,21 @@ +collections { + group { + name: "example_group"; + max: 500 500; + min: 50 50; + + parts { + part { + name: "part_one"; + type: SWALLOW; + description { + min: 50 50; + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + } + + } +} diff --git a/libraries/edje/src/examples/table.edc b/libraries/edje/src/examples/table.edc new file mode 100644 index 0000000..5453705 --- /dev/null +++ b/libraries/edje/src/examples/table.edc @@ -0,0 +1,19 @@ +collections { + group { + name: "example_table"; + min: 50 50; + + parts { + part { + name: "table_part"; + type: TABLE; + description { + min: 50 50; + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + } + } +} diff --git a/libraries/edje/src/examples/test.png b/libraries/edje/src/examples/test.png new file mode 100644 index 0000000..fb620d7 Binary files /dev/null and b/libraries/edje/src/examples/test.png differ diff --git a/libraries/edje/src/examples/text.edc b/libraries/edje/src/examples/text.edc new file mode 100644 index 0000000..257a078 --- /dev/null +++ b/libraries/edje/src/examples/text.edc @@ -0,0 +1,68 @@ +collections { + group { + name: "sel_group"; + parts { + part { + name: "rect"; + type: RECT; + description { + state: "default" 0.0; + color: 0 255 0 255; /* green */ + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + } + } + group { + name: "example_group"; + max: 500 500; + min: 50 50; + + styles { + style { + name: "textblock_style"; + base: "font=Sans font_size=22 color=#600 wrap=word"; + tag: "br" "\n"; + tag: "hilight" "+ font_weight=Bold"; + tag: "b" "+ font_weight=Bold"; + tag: "tab" "\t"; + } + } + parts { + part { + name: "part_one"; + type: TEXT; + description { + min: 50 50; + state: "default" 0.0; + color: 0 0 255 255; /* blue */ + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.5; + text { + font: "arial"; + size: 22; + min: 1 1; + } + } + } + part { + name: "part_two"; + type: TEXTBLOCK; + select_mode: EXPLICIT; + source: "sel_group"; + entry_mode: PLAIN; + description { + min: 50 50; + state: "default" 0.0; + rel1.relative: 0.0 0.5; + rel2.relative: 1.0 1.0; + text { + style: "textblock_style"; + min: 1 1; + } + } + } + } + } +} -- cgit v1.1