summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Reutskiy <v.reutskiy@samsung.com>2014-07-25 17:41:57 +0300
committerVyacheslav Reutskiy <v.reutskiy@samsung.com>2014-07-25 17:41:57 +0300
commita7a9c01a557599268db0e001fb64cf7500f9e261 (patch)
tree986aa558c291983dae343cdf0c1564f88e29e2ee
parenta50a532af50872562512461c161e96167f0d8071 (diff)
parent5e0cb7cef16bf153324541cd323c1cf4ccabed60 (diff)
Merge branch 'develop'0.1.4
-rw-r--r--Makefile.am43
-rw-r--r--Makefile_Eolian_Helper.am2
-rw-r--r--NEWS12
-rw-r--r--configure.ac214
-rw-r--r--data/Makefile.am4
-rw-r--r--data/themes/Makefile.am21
-rw-r--r--data/themes/macro.edc7
-rw-r--r--data/themes/widgets/images/ruler_relative.pngbin0 -> 209 bytes
-rw-r--r--data/themes/widgets/images/section-dark-bg.pngbin0 -> 176 bytes
-rw-r--r--data/themes/widgets/images/tabs-vertical-item-bg.pngbin0 -> 262 bytes
-rw-r--r--data/themes/widgets/images/tabs-vertical-item-current-bg.pngbin0 -> 242 bytes
-rw-r--r--data/themes/widgets/ruler.edc239
-rw-r--r--data/themes/widgets/tabs.edc180
-rw-r--r--ewe.pc.in14
-rw-r--r--examples/combobox_example.c12
-rw-r--r--examples/entry_example.c4
-rw-r--r--examples/ruler_example.c40
-rw-r--r--examples/statusbar_example.c4
-rw-r--r--examples/tabs_example.c22
-rw-r--r--examples/win_example.c81
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bin/Makefile.am2
-rw-r--r--src/lib/Makefile.am102
-rw-r--r--src/lib/ewe_combobox.c401
-rw-r--r--src/lib/ewe_main.h1
-rw-r--r--src/lib/ewe_ruler.c373
-rw-r--r--src/lib/ewe_ruler.eo137
-rw-r--r--src/lib/ewe_ruler_common.h22
-rw-r--r--src/lib/ewe_ruler_legacy.h151
-rw-r--r--src/lib/ewe_tabs.c72
-rw-r--r--src/lib/ewe_tabs.eo22
-rw-r--r--src/lib/ewe_tabs_legacy.h22
-rw-r--r--src/lib/ewe_widget_combobox.h6
-rw-r--r--src/lib/ewe_widget_ruler.h6
-rw-r--r--src/lib/ewe_widget_tabs.h3
-rw-r--r--src/lib/ewe_win.c35
-rw-r--r--src/lib/ewe_win.eo4
-rw-r--r--src/lib/ewe_win.h3
-rw-r--r--src/lib/ewe_win_common.h71
-rw-r--r--src/lib/ewe_win_legacy.h3
-rw-r--r--tests/Makefile.am35
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_horizontal_get.c (renamed from tests/test_ewe_ruler/ewe_ruler_orient_get.c)36
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_horizontal_set.c148
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_absolute_get.c118
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_absolute_set.c125
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_add.c111
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_del.c107
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_relative_get.c118
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_relative_set.c125
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_style_get.c107
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_style_set.c114
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_visible_get.c107
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_marker_visible_set.c114
-rw-r--r--tests/test_ewe_ruler/ewe_ruler_orient_set.c226
-rw-r--r--tests/test_ewe_ruler/test_ewe_ruler.c32
-rw-r--r--tests/test_ewe_ruler/test_ewe_ruler.h32
-rw-r--r--tests/test_ewe_tabs/ewe_tabs_orient_horizontal_get.c106
-rw-r--r--tests/test_ewe_tabs/ewe_tabs_orient_horizontal_set.c118
-rw-r--r--tests/test_ewe_tabs/test_ewe_tabs.c4
-rw-r--r--tests/test_ewe_tabs/test_ewe_tabs.h6
60 files changed, 3427 insertions, 799 deletions
</
diff --git a/Makefile.am b/Makefile.am
index 6ae5af4..01e6836 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,23 @@
1
2ACLOCAL_AMFLAGS = -I m4
3
4MAINTAINERCLEANFILES = \
5Makefile.in \
6compile \
7config.guess \
8config.rpath \
9config.sub \
10depcomp \
11install-sh \
12ltmain.sh \
13missing \
14$(DIST_ARCHIVES) \
15m4/libtool.m4 \
16m4/lt~obsolete.m4 \
17m4/ltoptions.m4 \
18m4/ltsugar.m4 \
19m4/ltversion.m4
20
1SUBDIRS = src data tests doc 21SUBDIRS = src data tests doc
2 22
3if HAVE_DOXYGEN 23if HAVE_DOXYGEN
@@ -20,5 +40,28 @@ COPYING \
20autogen.sh \ 40autogen.sh \
21ewe.pc.in 41ewe.pc.in
22 42
43sed_process = \
44$(SED) \
45-e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
46-e 's,@VMAJ\@,$(VMAJ),g' \
47-e 's,@prefix\@,$(prefix),g' \
48-e 's,@exec_prefix\@,$(exec_prefix),g' \
49-e 's,@libdir\@,$(libdir),g' \
50-e 's,@includedir\@,$(includedir),g' \
51-e 's,@pkgincludedir\@,$(pkgincludedir),g' \
52-e 's,@elmthemedir\@,$(elmthemedir),g' \
53-e 's,@requirement_ewe\@,$(requirement_ewe),g' \
54< $< > $@ || rm $@
55
56pc_verbose = $(pc_verbose_@AM_V@)
57pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
58pc_verbose_0 = @echo " PC " $@;
59
60ewe.pc: $(top_srcdir)/ewe.pc.in Makefile
61 $(AM_V_at)rm -f $@
62 $(pc_verbose)$(sed_process)
63
23pkgconfigdir = $(libdir)/pkgconfig 64pkgconfigdir = $(libdir)/pkgconfig
24pkgconfig_DATA = ewe.pc 65pkgconfig_DATA = ewe.pc
66
67CLEANFILES = ewe.pc
diff --git a/Makefile_Eolian_Helper.am b/Makefile_Eolian_Helper.am
index fed2e66..fe21174 100644
--- a/Makefile_Eolian_Helper.am
+++ b/Makefile_Eolian_Helper.am
@@ -21,4 +21,4 @@ SUFFIXES = .eo .eo.c .eo.h .eo.legacy.h
21%.eo.legacy.h: %.eo ${_EOLIAN_GEN_DEP} 21%.eo.legacy.h: %.eo ${_EOLIAN_GEN_DEP}
22 $(AM_V_EOL)$(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gh -o $@ $< 22 $(AM_V_EOL)$(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gh -o $@ $<
23 23
24CLEANFILES += $(BUILT_SOURCES) 24CLEANFILES = $(BUILT_SOURCES)
diff --git a/NEWS b/NEWS
index c88eb54..2f400c4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,17 @@
1========= 1=========
2Ewe 0.1.3 2Ewe 0.1.4
3========= 3=========
4 4
5Changes since 0.1.3
6-------------------
7
8Feature:
9 * Add a new widget Win.
10
11Fixes:
12 * improve autotols;
13 * Combobox: move combobox drop down menu from ecore_x window to ewe_win.
14
5Changes since 0.1.2 15Changes since 0.1.2
6------------------- 16-------------------
7 17
diff --git a/configure.ac b/configure.ac
index a127874..764bca1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,50 +1,10 @@
1EWE_VERSION([0], [1], [3]) 1EWE_VERSION([0], [1], [4])
2
2AC_INIT([ewe], [ewe_version], [enlightenment-devel@lists.sourceforge.net]) 3AC_INIT([ewe], [ewe_version], [enlightenment-devel@lists.sourceforge.net])
3AC_PREREQ([2.60]) 4AC_PREREQ([2.60])
4AC_CONFIG_SRCDIR([configure.ac]) 5AC_CONFIG_SRCDIR([configure.ac])
5AC_CONFIG_AUX_DIR(config)
6AC_CONFIG_MACRO_DIR([m4]) 6AC_CONFIG_MACRO_DIR([m4])
7AC_PROG_CC
8AM_PROG_CC_C_O
9AC_PROG_RANLIB
10AM_SILENT_RULES([yes])
11AM_INIT_AUTOMAKE([1.13 dist-bzip2 subdir-objects color-tests foreign])
12
13m4_define([package], "Elementary\ Widgets\ Extension")
14m4_define([efl_version], [1.10.1])
15m4_define([elm_version], [1.10.1])
16
17requirement_ewe=""
18
19# TODO: move me to m4 file that setups module/so related variables
20case "$host_os" in
21 cegcc*)
22 AC_MSG_ERROR([ceGCC compiler is not supported anymore. Exiting...])
23 ;;
24 mingw32ce*)
25 MODULE_ARCH="v"
26 MODULE_EXT=".dll"
27 ;;
28 mingw*)
29 have_win32="yes"
30 have_windows="yes"
31 MODULE_ARCH="v-v_maj.v_min"
32 MODULE_EXT=".dll"
33 ;;
34 cygwin*)
35 MODULE_ARCH="v-v_maj.v_min"
36 MODULE_EXT=".dll"
37 ;;
38 *)
39 MODULE_ARCH="v-v_maj.v_min.v_mic"
40 MODULE_EXT=".so"
41 ;;
42esac
43
44AC_SUBST(P_NAME,"package")
45AC_SUBST(P_VERSION,"ewe_version")
46 7
47EWE_INIT
48AC_CONFIG_HEADERS([ewe_config.h]) 8AC_CONFIG_HEADERS([ewe_config.h])
49AH_TOP([ 9AH_TOP([
50#ifndef EWE_CONFIG_H 10#ifndef EWE_CONFIG_H
@@ -54,49 +14,88 @@ AH_BOTTOM([
54#endif /* EWE_CONFIG_H */ 14#endif /* EWE_CONFIG_H */
55]) 15])
56 16
17AM_INIT_AUTOMAKE([1.13 dist-bzip2 dist-xz subdir-objects color-tests])
18AM_SILENT_RULES([yes])
19
20
21### Additional options to configure
22
23AC_ARG_ENABLE([debug],
24 [AS_HELP_STRING([--enable-debug], [enable Ewe debug support. @<:@default=disabled@:>@])],
25 [want_ewe_debug=$enableval],
26 [want_ewe_debug="no"])
27
28if test "x$want_ewe_debug" = "xyes"; then
29 AC_DEFINE([HAVE_EWE_DEBUG], [1], [Set to 1 if debug is requested.])
30fi
31
32EFL_ENABLE_BIN([ewe-test])
33
34
35### Default options with respect to host and global variables
36
37EWE_INIT
38
39m4_define([efl_version], [1.10.1])
40m4_define([elm_version], [1.10.1])
41
42
43### Checks for programs
44
57LT_INIT([win32-dll disable-static pic-only]) 45LT_INIT([win32-dll disable-static pic-only])
58 46
47m4_ifdef([AM_GNU_GETTEXT_VERSION], [
48AM_GNU_GETTEXT_VERSION([0.17])
49])
50
51AC_PROG_CC
52
53AC_PROG_RANLIB
54
59PKG_PROG_PKG_CONFIG 55PKG_PROG_PKG_CONFIG
60 56
61PKG_CHECK_MODULES([EFL], 57AC_CHECK_PROGS([DOXYGEN], [doxygen])
62 [ 58AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
63 eina > efl_version 59
64 eet > efl_version 60EWE_WITH_BIN([edje], [edje_cc], [edje_cc])
65 evas > efl_version 61
66 ecore > efl_version 62EWE_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
67 ecore-input > efl_version 63
68 edje > efl_version 64DEPS_EOLIAN_FLAGS=`${PKG_CONFIG} --variable=eolian_flags eo evas edje ecore elementary`
69 eo > efl_version 65AC_SUBST([DEPS_EOLIAN_FLAGS])
70 ecore-imf > efl_version 66
71 ecore-con > efl_version 67# Force the helper to try external eolian-gen
72 eio > efl_version 68AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
73 eldbus > efl_version 69
74 efreet > efl_version 70
75 efreet-mime > efl_version 71### Checks for libraries
76 ],
77 [have_efl="${GREEN}yes${RESET}"],
78 [have_efl="${RED}no${RESET} (version < efl_version)"]
79)
80 72
81requirement_ewe="\ 73requirement_ewe="\
82 eina > efl_version \ 74eina > efl_version \
83 eet > efl_version \ 75eet > efl_version \
84 evas > efl_version \ 76evas > efl_version \
85 ecore > efl_version \ 77ecore > efl_version \
86 ecore-input > efl_version \ 78ecore-input > efl_version \
87 edje > efl_version \ 79edje > efl_version \
88 eo > efl_version \ 80eo > efl_version \
89 ecore-imf > efl_version \ 81ecore-imf > efl_version \
90 ecore-con > efl_version \ 82ecore-con > efl_version \
91 eio > efl_version \ 83eio > efl_version \
92 eldbus > efl_version \ 84eldbus > efl_version \
93 efreet > efl_version \ 85efreet > efl_version \
94 efreet-mime > efl_version \ 86efreet-mime > efl_version \
95 " 87"
96 88
97PKG_CHECK_MODULES([ELEMENTARY], [elementary > elm_version], 89AC_SUBST([requirement_ewe])
98 [have_elm="${GREEN}yes${RESET}"], 90
99 [have_elm="${RED}no${RESET} (version < elm_version)"]) 91PKG_CHECK_MODULES([EFL], [${requirement_ewe}])
92
93PKG_CHECK_MODULES([ELEMENTARY], [elementary > elm_version])
94
95requirement_ewe="elementary > elm_version ${requirement_ewe}"
96
97elmthemedir=`${PKG_CONFIG} --variable=themes elementary`
98AC_SUBST([elmthemedir])
100 99
101PKG_CHECK_MODULES([CHECK], [check], 100PKG_CHECK_MODULES([CHECK], [check],
102 [have_check="${GREEN}yes${RESET}"], 101 [have_check="${GREEN}yes${RESET}"],
@@ -105,50 +104,31 @@ AM_CONDITIONAL([CHECK_FOUND], [test "x$have_check" = "x${GREEN}yes${RESET}"])
105AC_SUBST([CHECK_FOUND]) 104AC_SUBST([CHECK_FOUND])
106AM_COND_IF([CHECK_FOUND], 105AM_COND_IF([CHECK_FOUND],
107 [run_test="make check"], 106 [run_test="make check"],
108 [run_test="to run tests you should install check: sudo apt-get install check"]) 107 [run_test="to compile tests you should install the check unit testing library"])
109 108
110#Usage: EWE_WITH_BIN(package, binary, default_value). See ewe_binary.m4
111EWE_WITH_BIN([edje], [edje_cc], [edje_cc])
112 109
113EFL_ENABLE_BIN([ewe-test]) 110### Checks for header files
114dnl custom flags
115dnl --enable-debug
116EWE_DEBUG_DEF="#undef"
117want_ewe_debug="no"
118AC_ARG_ENABLE([debug],
119 [AC_HELP_STRING([--enable-debug], [enable Ewe debug support. @<:@default=disabled@:>@])],
120 [want_ewe_debug=$enableval], [])
121 111
122if test "x$want_ewe_debug" = "xyes"; then
123 AC_DEFINE(HAVE_EWE_DEBUG, 1, [Ewe debug.])
124 EWE_DEBUG_DEF="#define"
125fi
126AC_SUBST(EWE_DEBUG_DEF)
127 112
128EWE_DEFINE=" -DEWE_THEME=\\\"${datadir}/ewe/themes/default.edj\\\" " 113### Checks for types
129AC_SUBST([EWE_DEFINE])
130 114
131DEPS_EOLIAN_FLAGS=`pkg-config --variable=eolian_flags eo evas edje ecore elementary`
132AC_SUBST(DEPS_EOLIAN_FLAGS)
133 115
134# Force the helper to try external eolian-gen 116### Checks for structures
135AM_CONDITIONAL(HAVE_EOLIAN_GEN, [true])
136 117
137EWE_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
138 118
139dnl locale, gettext 119### Checks for compiler characteristics
140m4_ifdef([AM_GNU_GETTEXT_VERSION], [ 120
141AM_GNU_GETTEXT_VERSION([0.17]) 121AC_PROG_CC_C_O
142]) 122
123
124### Checks for linker characteristics
143 125
144AC_CHECK_PROGS([DOXYGEN], [doxygen])
145AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
146 126
147AC_SUBST(requirement_ewe) 127### Checks for library functions
128
148 129
149AC_CONFIG_FILES([ 130AC_CONFIG_FILES([
150Makefile 131Makefile
151ewe.pc
152data/Makefile 132data/Makefile
153data/themes/Makefile 133data/themes/Makefile
154doc/Makefile 134doc/Makefile
@@ -167,24 +147,22 @@ echo ""
167echo "" 147echo ""
168echo "" 148echo ""
169echo "------------------------------------------------------------------------" 149echo "------------------------------------------------------------------------"
170echo "${P_NAME} ${P_VERSION}" 150echo "Elementary Widgets Extension ${PACKAGE_VERSION}"
171echo "------------------------------------------------------------------------" 151echo "------------------------------------------------------------------------"
172echo "" 152echo ""
173echo "Configuration Options Summary:" 153echo "Configuration Options Summary:"
174echo " efl............: ${have_efl}" 154echo
175echo " elementary.....: ${have_elm}" 155echo " edje-cc path...: ${edje_cc}"
176echo ""
177echo "edje-cc path...: ${edje_cc}"
178echo 156echo
179echo "Testing:" 157echo "Testing:"
180echo " check..........: ${have_check}" 158echo " check..........: ${have_check}"
181echo " run tests......: ${run_test}" 159echo " run tests......: ${run_test}"
182echo " tests report...: make report" 160echo " tests report...: make report"
183echo "" 161echo
184echo "Debug output.....: ${want_ewe_debug}" 162echo "Debug output.....: ${want_ewe_debug}"
185echo "" 163echo
186echo "Installation.....: make install (as root if needed, with 'su' or 'sudo')" 164echo "Installation.....: make install (as root if needed, with 'su' or 'sudo')"
187echo " CFLAGS.........: ${CFLAGS}" 165echo " CFLAGS.........: ${CFLAGS}"
188echo " LDFLAGS........: ${LDFLAGS}" 166echo " LDFLAGS........: ${LDFLAGS}"
189echo " prefix.........: ${prefix}" 167echo " prefix.........: ${prefix}"
190echo "" 168echo
diff --git a/data/Makefile.am b/data/Makefile.am
index 54ee895..fc7abae 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,4 +1,4 @@
1AUTOMAKE_OPTIONS = 1.4 foreign 1
2MAINTAINERCLEANFILES = Makefile.in 2MAINTAINERCLEANFILES = Makefile.in
3 3
4SUBDIRS = themes \ No newline at end of file 4SUBDIRS = themes
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
index fe56365..63481c4 100644
--- a/data/themes/Makefile.am
+++ b/data/themes/Makefile.am
@@ -1,4 +1,4 @@
1AUTOMAKE_OPTIONS = 1.4 foreign 1
2MAINTAINERCLEANFILES = Makefile.in 2MAINTAINERCLEANFILES = Makefile.in
3 3
4AM_V_EDJ = $(am__v_EDJ) 4AM_V_EDJ = $(am__v_EDJ)
@@ -17,5 +17,20 @@ default.edj: Makefile
17 $(top_srcdir)/data/themes/default.edc \ 17 $(top_srcdir)/data/themes/default.edc \
18 $(top_builddir)/data/themes/default.edj 18 $(top_builddir)/data/themes/default.edj
19 19
20clean-local: 20EXTRA_DIST = \
21 rm -f *.edj 21default.edc \
22macro.edc \
23text_styles.edc \
24fonts/PTS55F.ttf \
25fonts/PTS56F.ttf \
26fonts/PTS75F.ttf \
27fonts/PTS76F.ttf \
28widgets/combobox.edc \
29widgets/entry.edc \
30widgets/images \
31widgets/ruler.edc \
32widgets/scroller.edc \
33widgets/statusbar.edc \
34widgets/tabs.edc
35
36CLEANFILES = *.edj
diff --git a/data/themes/macro.edc b/data/themes/macro.edc
index d1b9e2b..fa89931 100644
--- a/data/themes/macro.edc
+++ b/data/themes/macro.edc
@@ -28,8 +28,11 @@ fonts {
28#define TABS_DISABLER_COLOR 64 64 64 200 28#define TABS_DISABLER_COLOR 64 64 64 200
29 29
30#define RULER_BACKGROUND_COLOR 48 48 48 255 30#define RULER_BACKGROUND_COLOR 48 48 48 255
31#define RULER_DASHES_COLOR 146 146 148 255 31#define RULER_DASHES_COLOR 146 146 146 255
32#define RULER_MARKS_COLOR 96 96 96 255 32#define RULER_MARKS_TEXT_COLOR 96 96 96 255
33#define RULER_DASHES_COLOR_GREEN 0 255 0 255
34#define RULER_MARKS_COLOR_GREEN 0 255 0 255
35#define RULER_REL_MARKS_TEXT_COLOR 193 210 224 255
33 36
34#define STATUSBAR_BACKGROUND_COLOR 59 61 62 255; 37#define STATUSBAR_BACKGROUND_COLOR 59 61 62 255;
35#define STATUSBAR_TEXT_COLOR 182 182 182 255; 38#define STATUSBAR_TEXT_COLOR 182 182 182 255;
diff --git a/data/themes/widgets/images/ruler_relative.png b/data/themes/widgets/images/ruler_relative.png
new file mode 100644
index 0000000..3314695
--- /dev/null
+++ b/data/themes/widgets/images/ruler_relative.png
Binary files differ
diff --git a/data/themes/widgets/images/section-dark-bg.png b/data/themes/widgets/images/section-dark-bg.png
new file mode 100644
index 0000000..f75d1ba
--- /dev/null
+++ b/data/themes/widgets/images/section-dark-bg.png
Binary files differ
diff --git a/data/themes/widgets/images/tabs-vertical-item-bg.png b/data/themes/widgets/images/tabs-vertical-item-bg.png
new file mode 100644
index 0000000..06ca586
--- /dev/null
+++ b/data/themes/widgets/images/tabs-vertical-item-bg.png
Binary files differ
diff --git a/data/themes/widgets/images/tabs-vertical-item-current-bg.png b/data/themes/widgets/images/tabs-vertical-item-current-bg.png
new file mode 100644
index 0000000..3669799
--- /dev/null
+++ b/data/themes/widgets/images/tabs-vertical-item-current-bg.png
Binary files differ
diff --git a/data/themes/widgets/ruler.edc b/data/themes/widgets/ruler.edc
index 2a47218..0b36dbf 100644
--- a/data/themes/widgets/ruler.edc
+++ b/data/themes/widgets/ruler.edc
@@ -1,47 +1,123 @@
1#define ITEM(i, sz) \ 1//===================== default bg =========================//
2part { name: "dash"#i; \
3 type: RECT; \
4 clip_to: "cliper"; \
5 description { state: "default" 0.0; \
6 color: RULER_DASHES_COLOR; \
7 align: 0.0 1.0; \
8 min: 1 sz; \
9 max: 1 sz; \
10 rel1.relative: 0.i 1.0; \
11 } \
12 }
13 2
14group { name: "ewe/ruler/horizontal_background/default"; 3group { name: "ewe/ruler/horizontal_background/default";
15 images.image: "ruler_hor_pointer.png" COMP; 4 alias: "ewe/ruler/vertical_background/default";
16 parts { 5 parts {
17 part { name: "background"; 6 part { name: "background";
18 type: RECT; 7 type: RECT;
19 description { state: "default" 0.0; 8 description { state: "default" 0.0;
20 color: RULER_BACKGROUND_COLOR; 9 color: RULER_BACKGROUND_COLOR;
21 rel2.offset: 0 0;
22 } 10 }
23 } 11 }
24 part { name: "pointer"; 12 }
25 type: IMAGE; 13}
26 scale: 1; 14
27 mouse_events: 1; 15
28 dragable { 16//===================== default marker =========================//
29 x: 1 1 0; 17
30 y: 0 1 0; 18group { name: "ewe/ruler/marker/horizontal/default";
31 confine: "background"; 19 parts {
20 part { name: "mark";
21 type: RECT;
22 description { state: "default" 0.0;
23 align: 0.0 1.0;
24 color: 255 0 0 255;
25 rel1.relative: -0.5 0.0;
26 rel2.relative: 0.5 1.0;
27 min: 2 8;
28 max: 2 8;
29 }
30 }
31 part { name: "mark2";
32 type: RECT;
33 description { state: "default" 0.0;
34 align: 0.0 1.0;
35 color: 255 0 0 255;
36 min: 8 2;
37 max: 8 2;
38 }
39 }
40 }
41}
42
43group { name: "ewe/ruler/marker/vertical/default";
44 parts {
45 part { name: "mark";
46 type: RECT;
47 description { state: "default" 0.0;
48 align: 1.0 0.0;
49 color: 255 0 0 255;
50 rel1.relative: 0.0 -0.5;
51 rel2.relative: 1.0 0.5;
52 min: 8 2;
53 max: 8 2;
32 } 54 }
55 }
56 part { name: "mark2";
57 type: RECT;
58 description { state: "default" 0.0;
59 align: 1.0 0.0;
60 color: 255 0 0 255;
61 min: 2 8;
62 max: 2 8;
63 }
64 }
65 }
66}
67
68
69//===================== pointer marker =========================//
70
71group { name: "ewe/ruler/marker/horizontal/pointer";
72 images.image: "ruler_hor_pointer.png" COMP;
73 parts {
74 part { name: "mark";
75 type: IMAGE;
33 description { state: "default" 0.0; 76 description { state: "default" 0.0;
34 image.normal: "ruler_hor_pointer.png"; 77 image.normal: "ruler_hor_pointer.png";
35 aspect_preference: SOURCE; 78 align: 0.5 1.0;
79 rel1.relative: -0.5 0.0;
80 rel2.relative: 0.5 1.0;
36 min: 10 15; 81 min: 10 15;
37 max: 10 15; 82 max: 10 15;
38 rel1.to: "background";
39 rel2.to: "background";
40 } 83 }
41 } 84 }
42 } 85 }
43} 86}
44 87
88group { name: "ewe/ruler/marker/vertical/pointer";
89 images.image: "ruler_ver_pointer.png" COMP;
90 parts {
91 part { name: "mark";
92 type: IMAGE;
93 description { state: "default" 0.0;
94 image.normal: "ruler_ver_pointer.png";
95 align: 1.0 0.5;
96 rel1.relative: 0.0 -0.5;
97 rel2.relative: 1.0 0.5;
98 min: 15 10;
99 max: 15 10;
100 }
101 }
102 }
103}
104
105
106//===================== default scale =========================//
107
108#define ITEM(i, sz) \
109part { name: "dash"#i; \
110 type: RECT; \
111 clip_to: "cliper"; \
112 description { state: "default" 0.0; \
113 color: RULER_DASHES_COLOR; \
114 align: 0.0 1.0; \
115 min: 1 sz; \
116 max: 1 sz; \
117 rel1.relative: 0.i 1.0; \
118 } \
119 }
120
45group { name: "ewe/ruler/horizontal/dashes/default"; 121group { name: "ewe/ruler/horizontal/dashes/default";
46 parts { 122 parts {
47 part { name: "cliper"; 123 part { name: "cliper";
@@ -55,7 +131,7 @@ group { name: "ewe/ruler/horizontal/dashes/default";
55 description { state: "default" 0.0; 131 description { state: "default" 0.0;
56 fixed: 0 1; 132 fixed: 0 1;
57 align: 0.0 1.0; 133 align: 0.0 1.0;
58 color: RULER_MARKS_COLOR; 134 color: RULER_MARKS_TEXT_COLOR;
59 rel1 { 135 rel1 {
60 to: "dash0"; 136 to: "dash0";
61 offset: -1 0; 137 offset: -1 0;
@@ -79,7 +155,7 @@ group { name: "ewe/ruler/horizontal/dashes/default";
79 description { state: "default" 0.0; 155 description { state: "default" 0.0;
80 fixed: 0 1; 156 fixed: 0 1;
81 align: 0.0 1.0; 157 align: 0.0 1.0;
82 color:RULER_MARKS_COLOR; 158 color:RULER_MARKS_TEXT_COLOR;
83 rel1 { 159 rel1 {
84 to: "dash5"; 160 to: "dash5";
85 offset: -1 0; 161 offset: -1 0;
@@ -124,24 +200,6 @@ part { name: "dash"#i; \
124 } \ 200 } \
125 } 201 }
126 202
127group { name: "ewe/ruler/vertical_background/default";
128 images.image: "ruler_ver_pointer.png" COMP;
129 inherit: "ewe/ruler/horizontal_background/default";
130 parts {
131 part { name: "pointer";
132 dragable {
133 x: 0 1 0;
134 y: 1 1 0;
135 }
136 description { state: "default" 0.0;
137 image.normal: "ruler_ver_pointer.png";
138 min: 15 10;
139 max: 15 10;
140 }
141 }
142 }
143}
144
145group { name: "ewe/ruler/vertical/dashes/default"; 203group { name: "ewe/ruler/vertical/dashes/default";
146 inherit: "ewe/ruler/horizontal/dashes/default"; 204 inherit: "ewe/ruler/horizontal/dashes/default";
147 parts { 205 parts {
@@ -189,9 +247,7 @@ group { name: "ewe/ruler/vertical/dashes/default";
189#undef ITEM_VER 247#undef ITEM_VER
190 248
191 249
192#define RULER_DASHES_COLOR_GREEN 0 255 0 255 250//===================== green scale =========================//
193#define RULER_MARKS_COLOR_GREEN 0 255 0 255
194
195 251
196#define ITEM(i, sz) \ 252#define ITEM(i, sz) \
197part { name: "dash"#i; \ 253part { name: "dash"#i; \
@@ -317,3 +373,90 @@ group { name: "ewe/ruler/vertical/dashes/green";
317 } 373 }
318} 374}
319#undef ITEM_VER 375#undef ITEM_VER
376
377
378//===================== relative scale =========================//
379
380group { name: "ewe/ruler/horizontal/dashes/relative";
381 images.image: "ruler_relative.png" COMP;
382 parts {
383 part { name: "mark_bg";
384 type: IMAGE;
385 description { state: "default" 0.0;
386 image {
387 normal: "ruler_relative.png";
388 border: 3 3 3 3;
389 }
390 rel1 {
391 to: "ewe.text";
392 offset: -3 0;
393 }
394 rel2 {
395 to: "ewe.text";
396 offset: 1 0;
397 }
398 }
399 }
400 part { name: "dash";
401 type: RECT;
402 description { state: "default" 0.0;
403 color: 58 110 155 255;
404 align: 0.0 1.0;
405 min: 1 12;
406 max: 1 12;
407 }
408 }
409 part { name: "ewe.text";
410 type: TEXT;
411 scale: 1;
412 description { state: "default" 0.0;
413 align: 0.5 0.0;
414 color: RULER_REL_MARKS_TEXT_COLOR;
415 text {
416 font: FN;
417 size: 9;
418 min: 1 1;
419 max: 1 1;
420 ellipsis: -1;
421 }
422 rel1 {
423 offset: 0 2;
424 to_x: "dash";
425 relative: -0.5 0.0;
426 }
427 rel2 {
428 to_x: "dash";
429 relative: 0.5 0.0;
430 }
431 }
432 }
433 }
434}
435
436group { name: "ewe/ruler/vertical/dashes/relative";
437 inherit: "ewe/ruler/horizontal/dashes/relative";
438 parts {
439 part { name: "dash";
440 description { state: "default" 0.0;
441 align: 1.0 0.0;
442 min: 5 1;
443 max: 5 1;
444 }
445 }
446 part { name: "ewe.text";
447 description { state: "default" 0.0;
448 align: 1.0 0.5;
449 rel1 {
450 to_x: "";
451 to_y: "dash";
452 relative: 0.0 -0.5;
453 offset: 0 -1;
454 }
455 rel2 {
456 to: "dash";
457 relative: 0.0 0.5;
458 }
459 }
460 }
461 }
462}
diff --git a/data/themes/widgets/tabs.edc b/data/themes/widgets/tabs.edc
index 748591f..44426b2 100644
--- a/data/themes/widgets/tabs.edc
+++ b/data/themes/widgets/tabs.edc
@@ -1,4 +1,4 @@
1group { name: "ewe/tabs/default"; 1group { name: "ewe/tabs/horizontal/default";
2 parts { 2 parts {
3 part { name: "bg"; 3 part { name: "bg";
4 type: RECT; 4 type: RECT;
@@ -46,7 +46,44 @@ group { name: "ewe/tabs/default";
46 } 46 }
47} 47}
48 48
49group {name: "ewe/tabs/item/head/default"; 49group { name: "ewe/tabs/vertical/default";
50 parts {
51 part { name: "bg";
52 type: RECT;
53 description { state: "default" 0.0;
54 color: TABS_BG_COLOR;
55 }
56 }
57 part { name: "tabs_area";
58 type: SWALLOW;
59 clip_to: "tabs_area_clip";
60 description { state: "default" 0.0;
61 align: 0.0 0.0;
62 min: 140 29;
63 max: 140 29;
64 rel1.offset: 0 -2;
65 }
66 }
67 part { name: "tabs_area_clip";
68 type: RECT;
69 description { state: "default" 0.0;
70 rel1.to: "tabs_area";
71 rel2.to: "tabs_area";
72 }
73 }
74 part { name: "content_area";
75 type: SWALLOW;
76 description { state: "default" 0.0;
77 rel1 {
78 to_x: "tabs_area";
79 relative: 1.0 0.0;
80 }
81 }
82 }
83 }
84}
85
86group {name: "ewe/tabs/item/head/horizontal/default";
50 images { 87 images {
51 image: "tab-head-active-bg.png" COMP; 88 image: "tab-head-active-bg.png" COMP;
52 image: "tab-head-bg.png" COMP; 89 image: "tab-head-bg.png" COMP;
@@ -218,8 +255,8 @@ group {name: "ewe/tabs/item/head/default";
218 } 255 }
219} 256}
220 257
221group {name: "ewe/tabs/item/head/blue"; 258group {name: "ewe/tabs/item/head/horizontal/blue";
222 inherit: "ewe/tabs/item/head/default"; 259 inherit: "ewe/tabs/item/head/horizontal/default";
223 parts { 260 parts {
224 part { name: "bg"; 261 part { name: "bg";
225 description { state: "default" 0.0; 262 description { state: "default" 0.0;
@@ -232,8 +269,8 @@ group {name: "ewe/tabs/item/head/blue";
232 } 269 }
233} 270}
234 271
235group {name: "ewe/tabs/item/head/green"; 272group {name: "ewe/tabs/item/head/horizontal/green";
236 inherit: "ewe/tabs/item/head/default"; 273 inherit: "ewe/tabs/item/head/horizontal/default";
237 parts { 274 parts {
238 part { name: "bg"; 275 part { name: "bg";
239 description { state: "default" 0.0; 276 description { state: "default" 0.0;
@@ -246,8 +283,8 @@ group {name: "ewe/tabs/item/head/green";
246 } 283 }
247} 284}
248 285
249group {name: "ewe/tabs/item/head/red"; 286group {name: "ewe/tabs/item/head/horizontal/red";
250 inherit: "ewe/tabs/item/head/default"; 287 inherit: "ewe/tabs/item/head/horizontal/default";
251 parts { 288 parts {
252 part { name: "bg"; 289 part { name: "bg";
253 description { state: "default" 0.0; 290 description { state: "default" 0.0;
@@ -260,7 +297,85 @@ group {name: "ewe/tabs/item/head/red";
260 } 297 }
261} 298}
262 299
263group {name: "ewe/tabs/item/content/default"; 300group {name: "ewe/tabs/item/head/vertical/default";
301 inherit: "ewe/tabs/item/head/horizontal/default";
302 images {
303 image: "tabs-vertical-item-current-bg.png" COMP;
304 image: "tabs-vertical-item-bg.png" COMP;
305 }
306 parts {
307 part { name: "bg";
308 description { state: "default" 0.0;
309 min: 140 29;
310 max: 140 29;
311 image {
312 normal: "tabs-vertical-item-bg.png";
313 border: 6 0 29 0;
314 }
315 rel1.offset: 2 2;
316 rel2.offset: -2 -2;
317 }
318 description { state: "active" 0.0;
319 inherit: "default" 0.0;
320 image.normal: "tabs-vertical-item-current-bg.png";
321 rel2.offset: 2 -2;
322 }
323 }
324 part { name: "ewe.text";
325 description { state: "default" 0.0;
326 color: TABS_TITLE_COLOR;
327 fixed: 1 1;
328 text {
329 min: 0 0;
330 ellipsis: 0.0;
331 }
332 }
333 }
334 }
335}
336
337group {name: "ewe/tabs/item/head/vertical/blue";
338 inherit: "ewe/tabs/item/head/vertical/default";
339 parts {
340 part { name: "bg";
341 description { state: "default" 0.0;
342 color: 50 50 255 255;
343 }
344 description { state: "active" 0.0;
345 color: 50 50 255 255;
346 }
347 }
348 }
349}
350
351group {name: "ewe/tabs/item/head/vertical/green";
352 inherit: "ewe/tabs/item/head/vertical/default";
353 parts {
354 part { name: "bg";
355 description { state: "default" 0.0;
356 color: 50 255 50 255;
357 }
358 description { state: "active" 0.0;
359 color: 50 255 50 255;
360 }
361 }
362 }
363}
364group {name: "ewe/tabs/item/head/vertical/red";
365 inherit: "ewe/tabs/item/head/vertical/default";
366 parts {
367 part { name: "bg";
368 description { state: "default" 0.0;
369 color: 255 50 50 255;
370 }
371 description { state: "active" 0.0;
372 color: 255 50 50 255;
373 }
374 }
375 }
376}
377
378group {name: "ewe/tabs/item/content/horizontal/default";
264 images { 379 images {
265 image: "tab-content-bg.png" COMP; 380 image: "tab-content-bg.png" COMP;
266 } 381 }
@@ -278,7 +393,7 @@ group {name: "ewe/tabs/item/content/default";
278 part { name: "ewe.content"; 393 part { name: "ewe.content";
279 type: SWALLOW; 394 type: SWALLOW;
280 description { state: "default" 0.0; 395 description { state: "default" 0.0;
281 rel1.offset: 2 2; 396 rel1.offset: 0 2;
282 rel2.offset: -3 -3; 397 rel2.offset: -3 -3;
283 } 398 }
284 } 399 }
@@ -312,8 +427,8 @@ group {name: "ewe/tabs/item/content/default";
312 } 427 }
313} 428}
314 429
315group {name: "ewe/tabs/item/content/blue"; 430group {name: "ewe/tabs/item/content/horizontal/blue";
316 inherit: "ewe/tabs/item/content/default"; 431 inherit: "ewe/tabs/item/content/horizontal/default";
317 parts { 432 parts {
318 part { name: "bg"; 433 part { name: "bg";
319 description { state: "default" 0.0; 434 description { state: "default" 0.0;
@@ -323,8 +438,8 @@ group {name: "ewe/tabs/item/content/blue";
323 } 438 }
324} 439}
325 440
326group {name: "ewe/tabs/item/content/green"; 441group {name: "ewe/tabs/item/content/horizontal/green";
327 inherit: "ewe/tabs/item/content/default"; 442 inherit: "ewe/tabs/item/content/horizontal/default";
328 parts { 443 parts {
329 part { name: "bg"; 444 part { name: "bg";
330 description { state: "default" 0.0; 445 description { state: "default" 0.0;
@@ -334,8 +449,8 @@ group {name: "ewe/tabs/item/content/green";
334 } 449 }
335} 450}
336 451
337group {name: "ewe/tabs/item/content/red"; 452group {name: "ewe/tabs/item/content/horizontal/red";
338 inherit: "ewe/tabs/item/content/default"; 453 inherit: "ewe/tabs/item/content/horizontal/default";
339 parts { 454 parts {
340 part { name: "bg"; 455 part { name: "bg";
341 description { state: "default" 0.0; 456 description { state: "default" 0.0;
@@ -344,3 +459,36 @@ group {name: "ewe/tabs/item/content/red";
344 } 459 }
345 } 460 }
346} 461}
462
463group {name: "ewe/tabs/item/content/vertical/default";
464 inherit: "ewe/tabs/item/content/horizontal/default";
465 images {
466 image: "section-dark-bg.png" COMP;
467 }
468 parts {
469 part { name: "bg";
470 type: IMAGE;
471 description { state: "default" 0.0;
472 image {
473 normal: "section-dark-bg.png";
474 border: 10 10 10 11;
475 }
476 rel1.offset: -1 0;
477 fill.smooth: 0;
478 }
479 }
480 }
481}
482
483group {name: "ewe/tabs/item/content/vertical/blue";
484 inherit: "ewe/tabs/item/content/vertical/default";
485}
486
487group {name: "ewe/tabs/item/content/vertical/green";
488 inherit: "ewe/tabs/item/content/vertical/default";
489}
490
491group {name: "ewe/tabs/item/content/vertical/red";
492 inherit: "ewe/tabs/item/content/vertical/default";
493}
494
diff --git a/ewe.pc.in b/ewe.pc.in
index ecc41a7..430b345 100644
--- a/ewe.pc.in
+++ b/ewe.pc.in
@@ -2,12 +2,12 @@ prefix=@prefix@
2exec_prefix=@exec_prefix@ 2exec_prefix=@exec_prefix@
3libdir=@libdir@ 3libdir=@libdir@
4includedir=@includedir@ 4includedir=@includedir@
5pkgdatadir=@datadir@/elementary 5pkgincludedir=@pkgincludedir@-@VMAJ@
6themes=${pkgdatadir}/themes 6themes=@elmthemedir@
7 7
8Name: elementary 8Name: ewe
9Description: Elementary widgets extension, desktop widget library 9Description: Elementary widgets extension, desktop widget library
10@pkgconfig_requires_private@: @requirement_ewe@ 10Requires.private: @requirement_ewe@
11Version: @VERSION@ 11Version: @PACKAGE_VERSION@
12Libs: -L${libdir} -lelementary -lewe @ELEMENTARY_LIBS@ 12Libs: -L${libdir} -lewe
13Cflags: -I${includedir}/ewe @ELEMENTARY_CFLAGS@ 13Cflags: -I${pkgincludedir}
diff --git a/examples/combobox_example.c b/examples/combobox_example.c
index f0a4276..60eafcf 100644
--- a/examples/combobox_example.c
+++ b/examples/combobox_example.c
@@ -1,14 +1,14 @@
1//Compile with: 1//Compile with:
2//gcc -g -o combobox_example combobox_example.c `pkg-config --cflags --libs elementary ewe` 2//gcc -g -o combobox_example combobox_example.c `pkg-config --cflags --libs elementary ewe`
3 3
4#include "ewe.h" 4#include "Ewe.h"
5 5
6static void _sel(void *data EINA_UNUSED, 6static void _sel(void *data EINA_UNUSED,
7 Evas_Object *obj EINA_UNUSED, 7 Evas_Object *obj EINA_UNUSED,
8 void *ei) 8 void *ei)
9{ 9{
10 Ewe_Combobox_Item *item = ei; 10 Ewe_Combobox_Item *item = ei;
11 fprintf(stdout, "\nitem = %s with index %d", item->title, item->index); 11 fprintf(stdout, "item = %s with index %d\n", item->title, item->index);
12} 12}
13 13
14static void _fcb(void *data, 14static void _fcb(void *data,
@@ -33,7 +33,6 @@ EAPI_MAIN int
33elm_main(int argc, char **argv) 33elm_main(int argc, char **argv)
34{ 34{
35 Evas_Object *win, *cb; 35 Evas_Object *win, *cb;
36
37 ewe_init(0, 0); 36 ewe_init(0, 0);
38 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 37 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
39 38
@@ -48,9 +47,16 @@ elm_main(int argc, char **argv)
48 Ewe_Combobox_Item *item = ewe_combobox_item_add(cb, "Scorpion"); 47 Ewe_Combobox_Item *item = ewe_combobox_item_add(cb, "Scorpion");
49 item = ewe_combobox_item_add(cb, "Raiden"); 48 item = ewe_combobox_item_add(cb, "Raiden");
50 ewe_combobox_item_add(cb, "Johnny Cage"); 49 ewe_combobox_item_add(cb, "Johnny Cage");
50 ewe_combobox_item_add(cb, "La-La-La-La");
51 ewe_combobox_select_item_set(cb, 0); 51 ewe_combobox_select_item_set(cb, 0);
52 evas_object_smart_callback_add(cb, "selected", _sel, NULL); 52 evas_object_smart_callback_add(cb, "selected", _sel, NULL);
53 53
54 printf("Raiden's index before item deleting is %d\n", item->index);
55 ewe_combobox_item_del(cb, it);
56 printf("Raiden's index after item deleting is %d\n", item->index);
57
58 // ewe_combobox_items_list_free(cb ,EINA_TRUE);
59
54 evas_object_resize(cb, 220, 70); 60 evas_object_resize(cb, 220, 70);
55 evas_object_move(cb, 100, 100); 61 evas_object_move(cb, 100, 100);
56 evas_object_show(cb); 62 evas_object_show(cb);
diff --git a/examples/entry_example.c b/examples/entry_example.c
index 1349ecb..03cfe83 100644
--- a/examples/entry_example.c
+++ b/examples/entry_example.c
@@ -1,6 +1,6 @@
1// gcc entry_example.c -o entry `pkg-config --cflags --libs ewe` 1// gcc entry_example.c -o entry `pkg-config --cflags --libs elementary ewe`
2 2
3#include "ewe.h" 3#include "Ewe.h"
4 4
5static Elm_Entry_Filter_Accept_Set accept_name = { 5static Elm_Entry_Filter_Accept_Set accept_name = {
6 .accepted = NULL, 6 .accepted = NULL,
diff --git a/examples/ruler_example.c b/examples/ruler_example.c
index 7a8f3c6..4e0d2e1 100644
--- a/examples/ruler_example.c
+++ b/examples/ruler_example.c
@@ -1,17 +1,31 @@
1/* 1/*
2 * Compile with: 2 * Compile with:
3 * gcc -o ruler_example ruler_example.c -g `pkg-config --cflags --libs ewe` 3 * gcc -o ruler_example ruler_example.c -g `pkg-config --cflags --libs elementary ewe`
4 */ 4 */
5#include <ewe.h> 5#include <Ewe.h>
6 6
7Evas_Object *ruler; 7Evas_Object *ruler;
8Ewe_Ruler_Scale *scale;
9Ewe_Ruler_Marker *marker, *marker2;
8 10
9static void 11static void
12_ruler_visible_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
13{
14 Eina_Bool val;
15 val = elm_check_state_get(obj);
16 if (val)
17 evas_object_show(ruler);
18 else
19 evas_object_hide(ruler);
20}
21static void
10_step_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 22_step_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
11{ 23{
12 int val; 24 int val;
13 val = elm_spinner_value_get(obj); 25 val = elm_spinner_value_get(obj);
14 ewe_ruler_step_set(ruler, data, val); 26 ewe_ruler_step_set(ruler, data, val);
27 printf("to def: %f, to green: %f\n", ewe_ruler_marker_relative_get(ruler, marker, NULL), ewe_ruler_marker_relative_get(ruler, marker, scale));
28 printf("abs %d\n", ewe_ruler_marker_absolute_get(ruler, marker));
15} 29}
16 30
17static void 31static void
@@ -20,6 +34,8 @@ _val_step_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
20 int val; 34 int val;
21 val = elm_spinner_value_get(obj); 35 val = elm_spinner_value_get(obj);
22 ewe_ruler_value_step_set(ruler, data, val); 36 ewe_ruler_value_step_set(ruler, data, val);
37 printf("to def: %f, to green: %f\n", ewe_ruler_marker_relative_get(ruler, marker, NULL), ewe_ruler_marker_relative_get(ruler, marker, scale));
38 printf("abs %d\n", ewe_ruler_marker_absolute_get(ruler, marker));
23} 39}
24 40
25static void 41static void
@@ -28,6 +44,8 @@ _offset_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
28 int val; 44 int val;
29 val = elm_spinner_value_get(obj); 45 val = elm_spinner_value_get(obj);
30 ewe_ruler_zero_offset_set(ruler, data, val); 46 ewe_ruler_zero_offset_set(ruler, data, val);
47 printf("to def: %f, to green: %f\n", ewe_ruler_marker_relative_get(ruler, marker, NULL), ewe_ruler_marker_relative_get(ruler, marker, scale));
48 printf("abs %d\n", ewe_ruler_marker_absolute_get(ruler, marker));
31} 49}
32 50
33static void 51static void
@@ -48,14 +66,11 @@ _middle_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
48 66
49 67
50static void 68static void
51_orient_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 69_horizontal_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
52{ 70{
53 Eina_Bool val; 71 Eina_Bool val;
54 val = elm_check_state_get(obj); 72 val = elm_check_state_get(obj);
55 if (val) 73 ewe_ruler_horizontal_set(ruler, val);
56 ewe_ruler_orient_set(ruler, EWE_RULER_ORIENT_HORIZONTAL);
57 else
58 ewe_ruler_orient_set(ruler, EWE_RULER_ORIENT_VERTICAL);
59} 74}
60 75
61static void 76static void
@@ -104,7 +119,6 @@ elm_main(int argc, char **argv)
104 unsigned int step = 100; 119 unsigned int step = 100;
105 ewe_init(argc, argv); 120 ewe_init(argc, argv);
106 Evas_Object *win, *ruler_win, *sp, *check, *ent; 121 Evas_Object *win, *ruler_win, *sp, *check, *ent;
107 Ewe_Ruler_Scale *scale;
108 122
109 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 123 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
110 124
@@ -115,6 +129,11 @@ elm_main(int argc, char **argv)
115 evas_object_size_hint_weight_set(ruler, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 129 evas_object_size_hint_weight_set(ruler, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
116 elm_win_resize_object_add(ruler_win, ruler); 130 elm_win_resize_object_add(ruler_win, ruler);
117 scale = ewe_ruler_scale_add(ruler, "green"); 131 scale = ewe_ruler_scale_add(ruler, "green");
132 marker = ewe_ruler_marker_add(ruler, NULL);
133 ewe_ruler_marker_relative_set(ruler, marker, scale, 150);
134 ewe_ruler_marker_style_set(ruler, marker, "pointer");
135 marker2 = ewe_ruler_marker_add(ruler, NULL);
136 ewe_ruler_marker_absolute_set(ruler, marker2, 155);
118 evas_object_show(ruler); 137 evas_object_show(ruler);
119 138
120 win = elm_win_util_standard_add("layout", "Settings"); 139 win = elm_win_util_standard_add("layout", "Settings");
@@ -122,7 +141,10 @@ elm_main(int argc, char **argv)
122 141
123 int pos = 10; 142 int pos = 10;
124 143
125 CHECK("Ruler is horizontal", EINA_TRUE, 10, pos, 200, 25, _orient_cb, NULL); 144 CHECK("Ruler is visible", EINA_TRUE, 10, pos, 200, 25, _ruler_visible_cb, NULL);
145 pos += 35;
146
147 CHECK("Ruler is horizontal", EINA_TRUE, 10, pos, 200, 25, _horizontal_cb, NULL);
126 pos += 35; 148 pos += 35;
127 149
128 CHECK("Default scale visibile", EINA_TRUE, 10, pos, 200, 25, _visible_cb, NULL); 150 CHECK("Default scale visibile", EINA_TRUE, 10, pos, 200, 25, _visible_cb, NULL);
diff --git a/examples/statusbar_example.c b/examples/statusbar_example.c
index 0928558..b0288b5 100644
--- a/examples/statusbar_example.c
+++ b/examples/statusbar_example.c
@@ -1,6 +1,6 @@
1// edje_cc statusbar.edc && gcc statusbar_example.c -o statusbar `pkg-config --cflags --libs ewe` 1// edje_cc statusbar.edc && gcc statusbar_example.c -o statusbar `pkg-config --cflags --libs elementary ewe`
2 2
3#include "ewe.h" 3#include "Ewe.h"
4 4
5 5
6static Evas_Object *label = NULL; 6static Evas_Object *label = NULL;
diff --git a/examples/tabs_example.c b/examples/tabs_example.c
index 9b9ef36..cdf7c66 100644
--- a/examples/tabs_example.c
+++ b/examples/tabs_example.c
@@ -1,7 +1,9 @@
1// gcc tabs_example.c -o tabs_example `pkg-config --cflags --libs ewe` 1// gcc tabs_example.c -o tabs_example `pkg-config --cflags --libs elementary ewe`
2
3#include <Ewe.h>
2 4
3#include <ewe.h>
4Evas_Object *tabs; 5Evas_Object *tabs;
6
5static void 7static void
6_on_click(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 8_on_click(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
7{ 9{
@@ -10,6 +12,15 @@ _on_click(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
10} 12}
11 13
12static void 14static void
15_on_change(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
16{
17 if (ewe_tabs_orient_horizontal_get(tabs))
18 ewe_tabs_orient_horizontal_set(tabs, EINA_FALSE);
19 else
20 ewe_tabs_orient_horizontal_set(tabs, EINA_TRUE);
21}
22
23static void
13_on_activate(void *data EINA_UNUSED, Evas_Object *obj, void *event_info) 24_on_activate(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
14{ 25{
15 Ewe_Tabs_Item *it = (Ewe_Tabs_Item *) event_info; 26 Ewe_Tabs_Item *it = (Ewe_Tabs_Item *) event_info;
@@ -37,7 +48,7 @@ elm_main(int argc, char **argv)
37 evas_object_smart_callback_add(tabs, "ewe,tabs,item,activated", _on_activate, NULL); 48 evas_object_smart_callback_add(tabs, "ewe,tabs,item,activated", _on_activate, NULL);
38 evas_object_smart_callback_add(tabs, "ewe,tabs,item,deactivated", _on_deactivate, NULL); 49 evas_object_smart_callback_add(tabs, "ewe,tabs,item,deactivated", _on_deactivate, NULL);
39 50
40 Evas_Object *btn, *icon; 51 Evas_Object *btn, *btn_change, *icon;
41 52
42 Evas_Object *lbl = elm_label_add(win); 53 Evas_Object *lbl = elm_label_add(win);
43 elm_object_text_set(lbl, "TEXT 1"); 54 elm_object_text_set(lbl, "TEXT 1");
@@ -59,6 +70,11 @@ elm_main(int argc, char **argv)
59 it = ewe_tabs_item_prepend(tabs, it, "test_tabs2 with long text", "green"); 70 it = ewe_tabs_item_prepend(tabs, it, "test_tabs2 with long text", "green");
60 ewe_tabs_item_title_set(tabs, it, "tabs item 2 with resetted title"); 71 ewe_tabs_item_title_set(tabs, it, "tabs item 2 with resetted title");
61 ewe_tabs_item_content_set(tabs, it, lbl2); 72 ewe_tabs_item_content_set(tabs, it, lbl2);
73 btn_change = elm_button_add(tabs);
74 ewe_tabs_item_content_set(tabs, it_cannot_del, btn_change);
75 evas_object_size_hint_max_set(btn_change, 300, 200);
76 elm_object_text_set(btn_change, "Orient change!");
77 evas_object_smart_callback_add(btn_change, "clicked", _on_change, it_cannot_del);
62 78
63 Evas_Object *content = ewe_tabs_item_content_unset(tabs, it); 79 Evas_Object *content = ewe_tabs_item_content_unset(tabs, it);
64 80
diff --git a/examples/win_example.c b/examples/win_example.c
new file mode 100644
index 0000000..e7d0be0
--- /dev/null
+++ b/examples/win_example.c
@@ -0,0 +1,81 @@
1/*
2 * Compile with:
3 * gcc -o win_example win_example.c -g `pkg-config --cflags --libs ewe`
4 */
5
6#include <ewe.h>
7
8static void
9_win_focused_cb(void *data, Evas_Object *obj, void *event)
10{
11 const char *name = data;
12 printf("Window focused: %s\n", name);
13}
14
15static void
16_btn_rotation_cb(void *data, Evas_Object *obj, void *event)
17{
18 int angle = elm_win_rotation_get(data);
19 angle = (angle + 90) % 360;
20 elm_win_rotation_set(data, angle);
21}
22
23static void
24_btn_quit_cb(void *data, Evas_Object *obj, void *event)
25{
26 elm_exit();
27}
28
29EAPI_MAIN int
30elm_main(int argc, char *argv[])
31{
32 Evas_Object *win, *win2, *box, *btn, *o;
33 char buf[256];
34
35 elm_app_info_set(elm_main, "elementary", "images/logo.png");
36
37 win = elm_win_util_standard_add("window", "Ewe_Win_Example");
38 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
39
40 win2 = ewe_win_add(NULL, "sub-win-example", EWE_WIN_DIALOG_BASIC);
41 elm_win_autodel_set(win2, EINA_TRUE);
42 elm_win_title_set(win2, "Managed window");
43 evas_object_show(win2);
44
45 evas_object_smart_callback_add(win2, "focus,in", _win_focused_cb, "mainwin");
46
47 box = elm_box_add(win);
48 elm_box_horizontal_set(box, EINA_TRUE);
49 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 elm_win_resize_object_add(win, box);
51 evas_object_show(box);
52
53 btn = elm_button_add(win);
54 elm_object_text_set(btn, "rotation");
55 elm_box_pack_end(box, btn);
56 evas_object_show(btn);
57 evas_object_smart_callback_add(btn, "clicked", _btn_rotation_cb, win2);
58
59 btn = elm_button_add(win);
60 elm_object_text_set(btn, "quit");
61 elm_box_pack_end(box, btn);
62 evas_object_show(btn);
63 evas_object_smart_callback_add(btn, "clicked", _btn_quit_cb, win2);
64
65 o = elm_icon_add(win2);
66 sprintf(buf, "%s/images/logo.png", elm_app_data_dir_get());
67 elm_image_file_set(o, buf, NULL);
68 elm_image_resizable_set(o, EINA_FALSE, EINA_FALSE);
69 elm_image_no_scale_set(o, EINA_TRUE);
70 elm_win_resize_object_add(win2, o);
71 evas_object_show(o);
72
73 evas_object_resize(win, 400, 400);
74 evas_object_show(win);
75
76 elm_run();
77 elm_shutdown();
78
79 return 0;
80}
81ELM_MAIN()
diff --git a/src/Makefile.am b/src/Makefile.am
index 62f6d80..40211bf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
1AUTOMAKE_OPTIONS = 1.4 foreign 1
2MAINTAINERCLEANFILES = Makefile.in 2MAINTAINERCLEANFILES = Makefile.in
3 3
4SUBDIRS = lib bin 4SUBDIRS = lib bin
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index fd54f71..fa5082f 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -1,4 +1,4 @@
1AUTOMAKE_OPTIONS = 1.4 foreign 1
2MAINTAINERCLEANFILES = Makefile.in 2MAINTAINERCLEANFILES = Makefile.in
3 3
4AM_CPPFLAGS = \ 4AM_CPPFLAGS = \
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index b3d6f7c..cfa3380 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -1,7 +1,5 @@
1AUTOMAKE_OPTIONS = 1.4 foreign
2MAINTAINERCLEANFILES = Makefile.in
3 1
4CLEANFILES= 2MAINTAINERCLEANFILES = Makefile.in
5 3
6EOLIAN_FLAGS = @DEPS_EOLIAN_FLAGS@ \ 4EOLIAN_FLAGS = @DEPS_EOLIAN_FLAGS@ \
7 -I$(top_srcdir)/src/lib 5 -I$(top_srcdir)/src/lib
@@ -18,52 +16,52 @@ AM_CPPFLAGS = \
18-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ 16-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
19-DLOCALE_DIR=\"@LOCALE_DIR@\" \ 17-DLOCALE_DIR=\"@LOCALE_DIR@\" \
20-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 18-DPACKAGE_LIB_DIR=\"$(libdir)\" \
19-DEWE_THEME=\"${pkgdatadir}/themes/default.edj\" \
21-DEFL_EO_API_SUPPORT \ 20-DEFL_EO_API_SUPPORT \
22-DEFL_BETA_API_SUPPORT \ 21-DEFL_BETA_API_SUPPORT \
23-DELM_INTERNAL_API_ARGESFSDFEFC \ 22-DELM_INTERNAL_API_ARGESFSDFEFC \
24@EWE_DEFINE@ \
25@ELEMENTARY_CFLAGS@ 23@ELEMENTARY_CFLAGS@
26 24
27lib_LTLIBRARIES = libewe.la 25lib_LTLIBRARIES = libewe.la
28 26
29includes_HEADERS = \ 27includes_HEADERS = \
30Ewe.h 28Ewe.h
31includesdir = $(includedir)/ewe 29includesdir = $(pkgincludedir)-@VMAJ@
32 30
33includesub_HEADERS = \ 31includesub_HEADERS = \
34 logger/logger.h \ 32logger/logger.h \
35 ewe_main.h \ 33ewe_main.h \
36 ewe_tabs.h \ 34ewe_tabs.h \
37 ewe_tabs_legacy.h \ 35ewe_tabs_legacy.h \
38 ewe_tabs_eo.h \ 36ewe_tabs_eo.h \
39 ewe_tabs_common.h\ 37ewe_tabs_common.h\
40 ewe_widget_tabs.h \ 38ewe_widget_tabs.h \
41 ewe_statusbar.h \ 39ewe_statusbar.h \
42 ewe_statusbar_eo.h \ 40ewe_statusbar_eo.h \
43 ewe_statusbar_legacy.h \ 41ewe_statusbar_legacy.h \
44 ewe_statusbar_common.h \ 42ewe_statusbar_common.h \
45 ewe_widget_statusbar.h \ 43ewe_widget_statusbar.h \
46 ewe_combobox.h \ 44ewe_combobox.h \
47 ewe_combobox_eo.h \ 45ewe_combobox_eo.h \
48 ewe_combobox_legacy.h \ 46ewe_combobox_legacy.h \
49 ewe_combobox_common.h \ 47ewe_combobox_common.h \
50 ewe_widget_combobox.h \ 48ewe_widget_combobox.h \
51 ewe_entry.h \ 49ewe_entry.h \
52 ewe_entry_legacy.h \ 50ewe_entry_legacy.h \
53 ewe_entry_common.h\ 51ewe_entry_common.h\
54 ewe_entry_eo.h \ 52ewe_entry_eo.h \
55 ewe_widget_entry.h \ 53ewe_widget_entry.h \
56 ewe_ruler.h \ 54ewe_ruler.h \
57 ewe_ruler_legacy.h \ 55ewe_ruler_legacy.h \
58 ewe_ruler_eo.h \ 56ewe_ruler_eo.h \
59 ewe_ruler_common.h \ 57ewe_ruler_common.h \
60 ewe_widget_ruler.h \ 58ewe_widget_ruler.h \
61 ewe_win.h \ 59ewe_win.h \
62 ewe_win.eo.h \ 60ewe_win.eo.h \
63 ewe_win_legacy.h \ 61ewe_win_legacy.h \
64 ewe_win_common.h 62ewe_win_common.h
65 63
66includesubdir = $(includedir)/ewe 64includesubdir = $(pkgincludedir)-@VMAJ@
67 65
68libewe_la_LDFLAGS = @EWE_LTLIBRARY_FLAGS@ 66libewe_la_LDFLAGS = @EWE_LTLIBRARY_FLAGS@
69libewe_la_SOURCES = \ 67libewe_la_SOURCES = \
@@ -73,18 +71,22 @@ ewe_tabs.c \
73ewe_statusbar.c \ 71ewe_statusbar.c \
74ewe_combobox.c \ 72ewe_combobox.c \
75ewe_entry.c \ 73ewe_entry.c \
76ewe_ruler.c 74ewe_ruler.c \
75ewe_win.c \
76ewe_private.h
77 77
78BUILT_SOURCES = \ 78BUILT_SOURCES = \
79 ewe_tabs.eo.c \ 79ewe_tabs.eo.c \
80 ewe_tabs.eo.h \ 80ewe_tabs.eo.h \
81 ewe_statusbar.eo.c \ 81ewe_statusbar.eo.c \
82 ewe_statusbar.eo.h \ 82ewe_statusbar.eo.h \
83 ewe_combobox.eo.c \ 83ewe_combobox.eo.c \
84 ewe_combobox.eo.h \ 84ewe_combobox.eo.h \
85 ewe_entry.eo.c \ 85ewe_entry.eo.c \
86 ewe_entry.eo.h \ 86ewe_entry.eo.h \
87 ewe_ruler.eo.c \ 87ewe_ruler.eo.c \
88 ewe_ruler.eo.h \ 88ewe_ruler.eo.h \
89 ewe_win.eo.h \ 89ewe_win.eo.h \
90 ewe_win.eo.c 90ewe_win.eo.c
91
92EXTRA_DIST = $(BUILT_SOURCES)
diff --git a/src/lib/ewe_combobox.c b/src/lib/ewe_combobox.c
index 0947943..efba027 100644
--- a/src/lib/ewe_combobox.c
+++ b/src/lib/ewe_combobox.c
@@ -1,4 +1,5 @@
1#include "ewe_private.h" 1#include "ewe_private.h"
2#include "ewe_win.h"
2#include "ewe_widget_combobox.h" 3#include "ewe_widget_combobox.h"
3#include <elm_interface_scrollable.h> 4#include <elm_interface_scrollable.h>
4 5
@@ -11,115 +12,130 @@ EAPI Eo_Op EWE_OBJ_COMBOBOX_BASE_ID = EO_NOOP;
11#define MIN_ITEMS 5 12#define MIN_ITEMS 5
12#include <Ecore_X.h> 13#include <Ecore_X.h>
13 14
15static void _focus_out_cb(void *, Evas_Object *, void *);
16
14static const Evas_Smart_Cb_Description _smart_callbacks[] = { 17static const Evas_Smart_Cb_Description _smart_callbacks[] = {
15 {NULL, NULL} 18 {NULL, NULL}
16}; 19};
17 20
21/*----------------------internal helpers functions----------------------------*/
22
18static void 23static void
19_focusout(void *data, 24_item_data_free(Ewe_Combobox_Item *item)
20 Evas *evas EINA_UNUSED,
21 Evas_Object *obj EINA_UNUSED,
22 void *einfo EINA_UNUSED)
23{ 25{
24 Eina_List *l; 26 if (!item) return;
25 EWE_COMBOBOX_DATA_GET(data, sd); 27 eina_stringshare_del(item->title);
26 EWE_SAFE_FREE(sd->bg, evas_object_del); 28 eina_stringshare_del(item->style);
27 EWE_SAFE_FREE(sd->expander, evas_object_del); 29 free(item);
28 EWE_SAFE_FREE(sd->items_box, evas_object_del); 30}
29 Ewe_Combobox_Item *item; 31
30 EINA_LIST_FOREACH(sd->items, l, item) 32static void
33_win_del(void *data)
34{
35 Ewe_Combobox_Smart_Data *sd = (Ewe_Combobox_Smart_Data *) data;
36 if (sd->win)
31 { 37 {
32 evas_object_del(item->content); 38 evas_object_smart_callback_del(sd->win, "unfocused", _focus_out_cb);
39 evas_object_del(sd->win);
40 sd->win = NULL;
33 } 41 }
34 sd->expanded = EINA_FALSE;
35 edje_object_signal_emit(sd->combobox, "ewe,state,default", "ewe");
36 edje_object_signal_emit(sd->combobox, "btn,show", "ewe");
37 evas_object_smart_callback_call(sd->obj, "collapsed", NULL);
38} 42}
39 43
40static void 44static void
41_unfocused (Ecore_Evas *ee) 45_focus_out_cb(void *data,
46 Evas_Object *obj EINA_UNUSED,
47 void *einfo EINA_UNUSED)
42{ 48{
43 ecore_evas_free(ee); 49 Ewe_Combobox_Smart_Data *sd = (Ewe_Combobox_Smart_Data *) data;
50 if (!sd->win) return;
51
52 sd->expanded = EINA_FALSE;
53 edje_object_signal_emit(sd->combobox, "ewe,state,default", "ewe");
54 edje_object_signal_emit(sd->combobox, "btn,show", "ewe");
55 evas_object_smart_callback_call(sd->obj, "collapsed", NULL);
56 ecore_job_add(_win_del, sd);
44} 57}
45 58
46static void 59static void
47_selected(void *data, 60_selected_cb(void *data,
48 Evas_Object *obj EINA_UNUSED, 61 Evas_Object *obj EINA_UNUSED,
49 const char *emission EINA_UNUSED, 62 const char *emission EINA_UNUSED,
50 const char *source EINA_UNUSED) 63 const char *source EINA_UNUSED)
51{ 64{
52 Ewe_Combobox_Item *item = (Ewe_Combobox_Item *)data; 65 Ewe_Combobox_Item *item = (Ewe_Combobox_Item *)data;
53 EWE_COMBOBOX_DATA_GET(item->owner, sd); 66 EWE_COMBOBOX_DATA_GET(item->owner, sd);
67
54 edje_object_part_text_set(sd->combobox, "ewe.text", item->title); 68 edje_object_part_text_set(sd->combobox, "ewe.text", item->title);
55 sd->selected = item; 69 sd->selected = item;
56 evas_object_smart_callback_call(sd->obj, "selected", item); 70 evas_object_smart_callback_call(sd->obj, "selected", item);
57 _unfocused(sd->ecev); 71 _focus_out_cb(sd, NULL, NULL);
72}
73
74static Evas_Object *
75_exp_window_create(Evas **evas, Ewe_Combobox_Smart_Data *sd)
76{
77 Evas_Object *win;
78
79 win = ewe_win_add(sd->top_win, "expand_window", EWE_WIN_DROPDOWN_MENU);
80 elm_win_autodel_set(win, EINA_FALSE);
81 elm_win_borderless_set(win, EINA_TRUE);
82 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
83 elm_win_activate(win);
84 elm_win_shaped_set(win, EINA_TRUE);
85 sd->win = win;
86 evas_object_smart_callback_add(sd->win, "unfocused", _focus_out_cb, sd);
87 evas_object_show(win);
88 *evas = evas_object_evas_get(win);
89
90 sd->bg = edje_object_add(*evas);
91 edje_object_file_set(sd->bg, EWE_THEME, "ewe/combobox/expander/default");
92 evas_object_show(sd->bg);
93
94 sd->scroller = elm_scroller_add(win);
95 elm_object_style_set(sd->scroller, "ewe/default");
96 edje_object_part_swallow(sd->bg, "swallow.part", sd->scroller);
97 evas_object_size_hint_weight_set(sd->scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
98 elm_scroller_policy_set(sd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
99 evas_object_focus_set(sd->scroller, EINA_TRUE);
100 evas_object_show(sd->scroller);
101
102 sd->items_box = evas_object_box_add(*evas);
103 elm_object_content_set(sd->scroller, sd->items_box);
104 evas_object_box_align_set(sd->items_box, 0.0, 0.0);
105 evas_object_box_layout_set(sd->items_box, evas_object_box_layout_vertical, NULL, NULL);
106 evas_object_show(sd->items_box);
107 return win;
58} 108}
59 109
60static void 110static void
61_expand(Evas_Object *obj) 111_expand(Evas_Object *obj)
62{ 112{
63 int xw, yw, sw, sh, list_count; 113 int xw, yw, sh, list_count;
64 Eina_List *l; 114 Eina_List *l;
65 Evas_Coord x, y, w, h, hh, minh; 115 Evas_Coord x, y, w, h, hh, minh;
66 Evas_Object *win; 116 Evas_Object *win, *cwin;
67 Ecore_Evas *ee; 117 Evas *evas = NULL;
68 Ecore_X_Window exw;
69 Evas *evas;
70 Ecore_X_Screen *exs; 118 Ecore_X_Screen *exs;
71 Ewe_Combobox_Item *item; 119 Ewe_Combobox_Item *item;
72 int item_show_down = 0, item_show_up = 0, bg_minw = 0, bg_minh = 0; 120 int item_show_down = 0, item_show_up = 0, bg_minw = 0, bg_minh = 0;
73 121
74 EWE_COMBOBOX_DATA_GET(obj, sd); 122 EWE_COMBOBOX_DATA_GET(obj, sd);
75 sd->expanded = EINA_TRUE; 123 sd->expanded = EINA_TRUE;
124 list_count = eina_list_count(sd->items);
125 evas_object_geometry_get(sd->combobox, &x, &y, &w, &h);
76 edje_object_signal_emit(sd->combobox, "ewe,state,expanded", "ewe"); 126 edje_object_signal_emit(sd->combobox, "ewe,state,expanded", "ewe");
77 edje_object_signal_emit(sd->combobox, "btn,hide", "ewe"); 127 edje_object_signal_emit(sd->combobox, "btn,hide", "ewe");
128
78 exs = ecore_x_default_screen_get(); 129 exs = ecore_x_default_screen_get();
79 ecore_x_screen_size_get(exs, &sw, &sh); 130 ecore_x_screen_size_get(exs, NULL, &sh);
80 131
81 list_count = eina_list_count(sd->items); 132 win = elm_object_top_widget_get(sd->obj);
82 evas_object_geometry_get(sd->combobox, &x, &y, &w, &h);
83 win = elm_object_top_widget_get(obj);
84 elm_win_screen_position_get(win, &xw, &yw); 133 elm_win_screen_position_get(win, &xw, &yw);
85 ee = ecore_evas_new(NULL, 0, 0, w, 0, NULL); 134
86 exw = (Ecore_X_Window) ecore_evas_window_get(ee);
87 ecore_x_netwm_window_type_set(exw, ECORE_X_WINDOW_TYPE_DOCK);
88 /*
89 * ECORE_X_WINDOW_TYPE_DOCK is used because, DROPDOWN_ and POPUP_MENU
90 * still have icon raise at window list. Icon hide with combination of
91 * POPUP_MENU and ecore_evas_override (TRUE), but geometry goes wrong.
92 * Combination of overrride and alpha_set (TRUE) loose focus, because window
93 * is ignored by window manager.
94 */
95 ecore_evas_activate(ee);
96 sd->ecev = ee;
97 x += xw; 135 x += xw;
98 y += h + yw; 136 y += h + yw;
99 ecore_evas_show(ee);
100 evas = ecore_evas_get(ee);
101
102 sd->bg = edje_object_add(evas);
103 edje_object_file_set(sd->bg, EWE_THEME, "ewe/combobox/expander/default");
104 evas_object_show(sd->bg);
105
106 sd->expander = elm_scroller_add(evas);
107 elm_object_style_set(sd->expander, "ewe/default");
108 edje_object_part_swallow(sd->bg, "swallow.part", sd->expander);
109 evas_object_size_hint_weight_set(sd->expander, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
110 elm_scroller_policy_set(sd->expander, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
111 evas_object_focus_set(sd->expander, EINA_TRUE);
112 evas_object_show(sd->expander);
113
114 sd->items_box = evas_object_box_add(evas);
115 elm_object_content_set(sd->expander, sd->items_box);
116 evas_object_box_align_set(sd->items_box, 0.0, 0.0);
117 evas_object_box_layout_set(sd->items_box, evas_object_box_layout_vertical,
118 NULL, NULL);
119 evas_object_show(sd->items_box);
120 137
121 evas_object_event_callback_add(sd->expander, EVAS_CALLBACK_FOCUS_OUT, _focusout, obj); 138 cwin = _exp_window_create(&evas, sd);
122 ecore_evas_callback_focus_out_set(ee, _unfocused);
123 edje_object_size_min_calc(sd->bg, &bg_minw, &bg_minh); 139 edje_object_size_min_calc(sd->bg, &bg_minw, &bg_minh);
124 140
125 if (list_count == 0) hh = NON_ITEM_PADDING; 141 if (list_count == 0) hh = NON_ITEM_PADDING;
@@ -137,7 +153,7 @@ _expand(Evas_Object *obj)
137 edje_object_part_text_set(item->content, "ewe.text", item->title); 153 edje_object_part_text_set(item->content, "ewe.text", item->title);
138 evas_object_show(item->content); 154 evas_object_show(item->content);
139 evas_object_box_append(sd->items_box, item->content); 155 evas_object_box_append(sd->items_box, item->content);
140 edje_object_signal_callback_add(item->content, "select", "ewe", _selected, item); 156 edje_object_signal_callback_add(item->content, "select", "ewe", _selected_cb, item);
141 } 157 }
142 item_show_down = floor((sh - y - bg_minh) / minh); 158 item_show_down = floor((sh - y - bg_minh) / minh);
143 item_show_up = floor((y - h - bg_minh) / minh); 159 item_show_up = floor((y - h - bg_minh) / minh);
@@ -145,20 +161,20 @@ _expand(Evas_Object *obj)
145 161
146 if (hh > sh - y) 162 if (hh > sh - y)
147 { 163 {
148 if (item_show_down >= MIN_ITEMS) hh = (item_show_down * minh) + (bg_minh / 2); 164 if (item_show_down >= MIN_ITEMS)
149 else if (hh < y) y = y - h - (list_count * minh) - bg_minh; 165 hh = (item_show_down * minh) + (bg_minh / 2);
166 else if (hh < y)
167 y = y - h - (list_count * minh) - bg_minh;
150 else 168 else
151 { 169 {
152 hh = (item_show_up * minh) + (bg_minh / 2); 170 hh = (item_show_up * minh) + (bg_minh / 2);
153 y = y - h - hh; 171 y = y - h - hh;
154 } 172 }
155 } 173 }
156 } 174 }
157 evas_object_smart_callback_call(sd->obj, "expanded", NULL); 175 evas_object_smart_callback_call(sd->obj, "expanded", evas);
158 ecore_evas_move(ee, x, y);
159 ecore_evas_resize(ee, w, hh);
160 evas_object_resize(sd->bg, w, hh); 176 evas_object_resize(sd->bg, w, hh);
161 ecore_evas_shaped_set(ee, EINA_TRUE); 177 evas_object_geometry_set(cwin, x, y, w, hh);
162} 178}
163 179
164static void 180static void
@@ -167,88 +183,17 @@ _on_clicked(void *data,
167 const char *emission EINA_UNUSED, 183 const char *emission EINA_UNUSED,
168 const char *source EINA_UNUSED) 184 const char *source EINA_UNUSED)
169{ 185{
170 _expand(data); 186 Evas_Object *object = (Evas_Object *) data;
171} 187 EWE_COMBOBOX_DATA_GET(object, sd);
172 188 if (!eina_list_count(sd->items))
173EOLIAN static void 189 {
174_ewe_combobox_evas_object_smart_add(Eo *obj, Ewe_Combobox_Smart_Data *sd) 190 printf("Combobox is empty\n");
175{ 191 return;
176 Evas *evas; 192 }
177 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 193 _expand(object);
178 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
179 elm_widget_sub_object_parent_add(obj);
180 elm_widget_can_focus_set(obj, EINA_TRUE);
181 _elm_access_object_register(obj, wd->resize_obj);
182 evas = evas_object_evas_get(obj);
183
184 sd->expanded = EINA_FALSE;
185 sd->combobox = edje_object_add(evas);
186 evas_object_smart_member_add(sd->combobox, obj);
187 edje_object_file_set(sd->combobox, EWE_THEME, "ewe/combobox/base/default");
188 edje_object_signal_callback_add(sd->combobox, "clicked", "ewe", _on_clicked, obj);
189 sd->items = NULL;
190}
191
192EAPI Evas_Object *
193ewe_combobox_add(Evas_Object *parent)
194{
195 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
196 Evas_Object *obj = eo_add(MY_CLASS, parent);
197 eo_unref(obj);
198 return obj;
199}
200
201static void
202_ewe_combobox_eo_base_constructor(Eo *obj, Ewe_Combobox_Smart_Data *sd)
203{
204 sd->obj = obj;
205 eo_do_super(obj, MY_CLASS, eo_constructor());
206 eo_do(obj,
207 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
208 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks));
209}
210
211EOLIAN static void
212_ewe_combobox_class_constructor(Eo_Class *klass)
213{
214 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
215}
216
217static void
218_ewe_combobox_evas_object_smart_show(Eo *obj EINA_UNUSED,
219 Ewe_Combobox_Smart_Data *sd)
220{
221 evas_object_show(sd->combobox);
222}
223
224static void
225_ewe_combobox_evas_object_smart_hide(Eo *obj EINA_UNUSED,
226 Ewe_Combobox_Smart_Data *sd)
227{
228 evas_object_hide(sd->combobox);
229} 194}
230 195
231static void 196/*----------------------internal realisation API------------------------------*/
232_ewe_combobox_evas_object_smart_resize(Eo *obj,
233 Ewe_Combobox_Smart_Data *sd,
234 Evas_Coord w,
235 Evas_Coord h EINA_UNUSED)
236{
237 int height = 0;
238 edje_object_size_max_get(sd->combobox, NULL, &height);
239 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, height));
240 evas_object_resize(sd->combobox, w, height);
241}
242
243static void
244_ewe_combobox_evas_object_smart_move(Eo *obj,
245 Ewe_Combobox_Smart_Data *sd,
246 Evas_Coord x,
247 Evas_Coord y)
248{
249 evas_object_move(sd->combobox, x, y);
250 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
251}
252 197
253EOLIAN static Eina_Bool 198EOLIAN static Eina_Bool
254_ewe_combobox_expanded_get(Eo *obj EINA_UNUSED, 199_ewe_combobox_expanded_get(Eo *obj EINA_UNUSED,
@@ -284,52 +229,39 @@ _ewe_combobox_item_add(Eo *obj,
284 return ret; 229 return ret;
285} 230}
286 231
287static void
288_item_data_free(Ewe_Combobox_Item *item)
289{
290 if (!item) return;
291 eina_stringshare_del(item->title);
292 free(item);
293}
294 232
295EOLIAN static Eina_Bool 233EOLIAN static Eina_Bool
296_ewe_combobox_item_del(Eo *obj, 234_ewe_combobox_item_del(Eo *obj,
297 Ewe_Combobox_Smart_Data *sd, 235 Ewe_Combobox_Smart_Data *sd,
298 Ewe_Combobox_Item *item) 236 Ewe_Combobox_Item *item)
299{ 237{
300 if ((!item) || (item->owner != obj)) return EINA_FALSE; 238 if ((!item) || (item->owner != obj)) return EINA_FALSE;
301 Eina_List *l; 239 Eina_List *l;
302 int indx = 0, selindex = 0; 240 int selindex;
303 Ewe_Combobox_Item *it, *selected; 241 Ewe_Combobox_Item *data;
242
304 if (sd->selected) 243 if (sd->selected)
305 { 244 {
306 selected = ewe_combobox_select_item_get(obj); 245 if (item->index == sd->selected->index)
307 selindex = selected->index - 1;
308 if (item->index <= selected->index)
309 { 246 {
310 if (selindex < 0) 247 selindex = item->index - 1;
311 ewe_combobox_select_item_set(obj, selected->index + 1); 248 if (selindex >= 0)
312 else if (item->index == selected->index)
313 ewe_combobox_select_item_set(obj, selindex); 249 ewe_combobox_select_item_set(obj, selindex);
250 else
251 ewe_combobox_select_item_set(obj, selindex + 2);
314 } 252 }
315 } 253 }
316 sd->items = eina_list_remove(sd->items, item); 254 sd->items = eina_list_remove(sd->items, item);
317 _item_data_free(item); 255 _item_data_free(item);
318 EINA_LIST_FOREACH(sd->items, l, it) it->index = indx++; 256
257 l = eina_list_nth_list(sd->items, item->index + 1);
258 for (data = eina_list_data_get(l); l ;
259 l = eina_list_next(l), data = eina_list_data_get(l))
260 data->index--;
261
319 return EINA_TRUE; 262 return EINA_TRUE;
320} 263}
321 264
322static void
323_ewe_combobox_evas_object_smart_del(Eo *obj EINA_UNUSED,
324 Ewe_Combobox_Smart_Data *sd)
325{
326 Ewe_Combobox_Item *it;
327 EINA_LIST_FREE(sd->items, it)
328 {
329 _item_data_free(it);
330 }
331 evas_object_del(sd->combobox);
332}
333 265
334EOLIAN const Eina_List * 266EOLIAN const Eina_List *
335_ewe_combobox_items_list_get(Eo *obj EINA_UNUSED, 267_ewe_combobox_items_list_get(Eo *obj EINA_UNUSED,
@@ -366,7 +298,9 @@ _ewe_combobox_item_title_set(Eo *obj EINA_UNUSED,
366 item = eina_list_nth(sd->items, index); 298 item = eina_list_nth(sd->items, index);
367 eina_stringshare_del(item->title); 299 eina_stringshare_del(item->title);
368 item->title = eina_stringshare_add(title); 300 item->title = eina_stringshare_add(title);
369 if (item == sd->selected) edje_object_part_text_set(sd->combobox, "ewe.text", item->title); 301 if (item == sd->selected)
302 edje_object_part_text_set(sd->combobox, "ewe.text", item->title);
303
370 return EINA_TRUE; 304 return EINA_TRUE;
371} 305}
372 306
@@ -435,6 +369,105 @@ _ewe_combobox_item_style_set(Eo *obj EINA_UNUSED,
435 return EINA_TRUE; 369 return EINA_TRUE;
436} 370}
437 371
372/*------------------------Smart functions ----------------------------*/
373
374EOLIAN static void
375_ewe_combobox_evas_object_smart_add(Eo *obj, Ewe_Combobox_Smart_Data *sd)
376{
377 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
378
379 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
380 elm_widget_sub_object_parent_add(obj);
381
382 elm_widget_can_focus_set(obj, EINA_TRUE);
383 sd->obj = obj;
384 sd->expanded = EINA_FALSE;
385
386 sd->top_win = elm_object_top_widget_get(obj);
387 sd->combobox = edje_object_add(evas_object_evas_get(obj));
388 evas_object_smart_member_add(sd->combobox, obj);
389 edje_object_file_set(sd->combobox, EWE_THEME, "ewe/combobox/base/default");
390 edje_object_signal_callback_add(sd->combobox, "clicked", "ewe", _on_clicked, obj);
391 sd->items = NULL;
392}
393
394EOLIAN static void
395_ewe_combobox_evas_object_smart_del(Eo *obj EINA_UNUSED,
396 Ewe_Combobox_Smart_Data *sd)
397{
398 Ewe_Combobox_Item *it;
399 EINA_LIST_FREE(sd->items, it)
400 _item_data_free(it);
401 evas_object_del(sd->win);
402 evas_object_smart_member_del(sd->combobox);
403 evas_object_del(sd->combobox);
404}
405
406EOLIAN static void
407_ewe_combobox_evas_object_smart_show(Eo *obj EINA_UNUSED,
408 Ewe_Combobox_Smart_Data *sd)
409{
410 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
411 evas_object_show(sd->combobox);
412}
413
414EOLIAN static void
415_ewe_combobox_evas_object_smart_hide(Eo *obj EINA_UNUSED,
416 Ewe_Combobox_Smart_Data *sd)
417{
418 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
419 evas_object_hide(sd->combobox);
420}
421
422EAPI Evas_Object *
423ewe_combobox_add(Evas_Object *parent)
424{
425 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
426 Evas_Object *obj = eo_add(MY_CLASS, parent);
427 eo_unref(obj);
428 return obj;
429}
430
431EOLIAN static void
432_ewe_combobox_evas_object_smart_move(Eo *obj,
433 Ewe_Combobox_Smart_Data *sd,
434 Evas_Coord x,
435 Evas_Coord y)
436{
437 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
438 evas_object_move(sd->combobox, x, y);
439}
440
441EOLIAN static void
442_ewe_combobox_evas_object_smart_resize(Eo *obj,
443 Ewe_Combobox_Smart_Data *sd,
444 Evas_Coord w,
445 Evas_Coord h EINA_UNUSED)
446{
447 int height = 0;
448 edje_object_size_max_get(sd->combobox, NULL, &height);
449 eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, height));
450 evas_object_resize(sd->combobox, w, height);
451}
452
453/* -----------------------------EO operations-------------------------------- */
454
455static void
456_ewe_combobox_eo_base_constructor(Eo *obj, Ewe_Combobox_Smart_Data *sd)
457{
458 sd->obj = obj;
459 eo_do_super(obj, MY_CLASS, eo_constructor());
460 eo_do(obj,
461 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
462 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks));
463}
464
465EOLIAN static void
466_ewe_combobox_class_constructor(Eo_Class *klass)
467{
468 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
469}
470
438#include "ewe_combobox.eo.c" 471#include "ewe_combobox.eo.c"
439#undef NON_ITEM_PADDING 472#undef NON_ITEM_PADDING
440#undef MIN_ITEMS 473#undef MIN_ITEMS
diff --git a/src/lib/ewe_main.h b/src/lib/ewe_main.h
index afa1f89..15fdb98 100644
--- a/src/lib/ewe_main.h
+++ b/src/lib/ewe_main.h
@@ -25,6 +25,7 @@
25#include "ewe_ruler.h" 25#include "ewe_ruler.h"
26#include "ewe_entry.h" 26#include "ewe_entry.h"
27#include "ewe_tabs.h" 27#include "ewe_tabs.h"
28#include "ewe_win.h"
28 29
29/** 30/**
30 * Initialize Elementary Widget Extensions library 31 * Initialize Elementary Widget Extensions library
diff --git a/src/lib/ewe_ruler.c b/src/lib/ewe_ruler.c
index 2382d66..154160a 100644
--- a/src/lib/ewe_ruler.c
+++ b/src/lib/ewe_ruler.c
@@ -33,6 +33,8 @@ EAPI Eo_Op EWE_OBJ_RULER_BASE_ID = EO_NOOP;
33#define DEFAULT_STYLE "default" 33#define DEFAULT_STYLE "default"
34#define DASHES "ewe/ruler/horizontal/dashes" 34#define DASHES "ewe/ruler/horizontal/dashes"
35#define DASHES_VER "ewe/ruler/vertical/dashes" 35#define DASHES_VER "ewe/ruler/vertical/dashes"
36#define MARKER "ewe/ruler/marker/horizontal"
37#define MARKER_VER "ewe/ruler/marker/vertical"
36 38
37static const Evas_Smart_Cb_Description _smart_callbacks[] = { 39static const Evas_Smart_Cb_Description _smart_callbacks[] = {
38 {NULL, NULL} 40 {NULL, NULL}
@@ -84,6 +86,8 @@ _add_dashes(Ewe_Ruler_Smart_Data *sd)
84 86
85 EINA_LIST_FOREACH(sd->scales, l, scale) 87 EINA_LIST_FOREACH(sd->scales, l, scale)
86 { 88 {
89 above = eina_list_data_get(eina_list_last(scale->dashes));
90
87 if (!scale->visible) continue; 91 if (!scale->visible) continue;
88 int dashes_count = eina_list_count(scale->dashes); 92 int dashes_count = eina_list_count(scale->dashes);
89 int new_dashes_count; 93 int new_dashes_count;
@@ -94,8 +98,7 @@ _add_dashes(Ewe_Ruler_Smart_Data *sd)
94 _delete_extra_dashes(scale, dashes_count); 98 _delete_extra_dashes(scale, dashes_count);
95 continue; 99 continue;
96 } 100 }
97 if (dashes_count) above = eina_list_data_get(scale->dashes); 101 if (sd->horizontal)
98 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL)
99 new_dashes_count = (((sd->geometry.width / scale->mark_step) + 3) - dashes_count); 102 new_dashes_count = (((sd->geometry.width / scale->mark_step) + 3) - dashes_count);
100 else 103 else
101 new_dashes_count = (((sd->geometry.height / scale->mark_step) + 3) - dashes_count); 104 new_dashes_count = (((sd->geometry.height / scale->mark_step) + 3) - dashes_count);
@@ -134,7 +137,7 @@ _place_dashes(Ewe_Ruler_Smart_Data *sd)
134 int i = 0; 137 int i = 0;
135 int x, y, offset; 138 int x, y, offset;
136 139
137 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL) 140 if (sd->horizontal)
138 { 141 {
139 offset = ((sd->geometry.x + (scale->zero_pos % scale->mark_step)) - scale->mark_step); 142 offset = ((sd->geometry.x + (scale->zero_pos % scale->mark_step)) - scale->mark_step);
140 EINA_LIST_FOREACH(scale->dashes, l, item) 143 EINA_LIST_FOREACH(scale->dashes, l, item)
@@ -188,56 +191,98 @@ _set_labels(Ewe_Ruler_Smart_Data *sd)
188 } 191 }
189 sd->text_changed = EINA_FALSE; 192 sd->text_changed = EINA_FALSE;
190} 193}
194
195static void
196_place_markers(Ewe_Ruler_Smart_Data *sd)
197{
198 Ewe_Ruler_Marker *marker;
199 Eina_List *l;
200 Ewe_Ruler_Scale *scale;
201
202 EINA_LIST_FOREACH(sd->markers, l, marker)
203 {
204 if (!marker->visible) continue;
205
206 if (marker->relative)
207 {
208 scale = (marker->scale) ? marker->scale : eina_list_data_get(sd->scales);
209 if (!scale->visible) continue;
210 marker->abs_position = (scale->mark_value_step) ? ((marker->rel_position / scale->mark_value_step) * scale->mark_step + scale->zero_pos) : scale->zero_pos;
211 }
212
213 if (sd->horizontal)
214 {
215 /*size of marker(pointer) is set to 1 to make posible centring from style*/
216 evas_object_resize(marker->obj, 1, sd->geometry.height);
217 evas_object_move(marker->obj,
218 sd->geometry.x + marker->abs_position,
219 sd->geometry.y);
220 }
221 else
222 {
223 /*size of marker(pointer) is set to 1 to make posible centring from style*/
224 evas_object_resize(marker->obj, sd->geometry.width, 1);
225 evas_object_move(marker->obj,
226 sd->geometry.x,
227 marker->abs_position + sd->geometry.y);
228 }
229
230 evas_object_raise(marker->obj);
231 evas_object_clip_set(marker->obj, sd->clip); /* FIXME: [funny magic] idk why this line has no effect when creating marker object */
232 }
233}
191/*----------------------internal realisation API------------------------------*/ 234/*----------------------internal realisation API------------------------------*/
192 235
193EOLIAN static Eina_Bool 236EOLIAN static Eina_Bool
194_ewe_ruler_orient_set(Eo *obj, 237_ewe_ruler_horizontal_set(Eo *obj,
195 Ewe_Ruler_Smart_Data *sd, 238 Ewe_Ruler_Smart_Data *sd,
196 Ewe_Ruler_Orient orient) 239 Eina_Bool horizontal)
197{ 240{
198 if ((!obj) || (orient < EWE_RULER_ORIENT_HORIZONTAL) || 241 if (sd->horizontal == horizontal)
199 (orient > EWE_RULER_ORIENT_VERTICAL))
200 return EINA_FALSE; 242 return EINA_FALSE;
201 sd->orient = orient; 243 sd->horizontal = horizontal;
202 sd->size_changed = EINA_TRUE; 244 sd->size_changed = EINA_TRUE;
203 245
204 Ewe_Ruler_Scale *scale; 246 Ewe_Ruler_Scale *scale;
205 Eina_List *ls; 247 Ewe_Ruler_Marker *marker;
248 Eina_List *ls, *lm;
206 int count; 249 int count;
250 const char *dashes, *markers;
207 251
208 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL) 252 if (sd->horizontal)
209 { 253 {
210 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/horizontal_background/default"); 254 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/horizontal_background/default");
211 EINA_LIST_FOREACH(sd->scales, ls, scale) 255 dashes = DASHES;
212 { 256 markers = MARKER;
213 eina_stringshare_del(scale->full_style);
214 scale->full_style = eina_stringshare_printf("%s/%s", DASHES, scale->style);
215 count = eina_list_count(scale->dashes);
216 _delete_extra_dashes(scale, count);
217 }
218 } 257 }
219 else 258 else
220 { 259 {
221 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/vertical_background/default"); 260 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/vertical_background/default");
222 EINA_LIST_FOREACH(sd->scales, ls, scale) 261 dashes = DASHES_VER;
223 { 262 markers = MARKER_VER;
224 eina_stringshare_del(scale->full_style); 263 }
225 scale->full_style = eina_stringshare_printf("%s/%s", DASHES_VER, scale->style); 264 EINA_LIST_FOREACH(sd->scales, ls, scale)
226 count = eina_list_count(scale->dashes); 265 {
227 _delete_extra_dashes(scale, count); 266 eina_stringshare_del(scale->full_style);
228 } 267 scale->full_style = eina_stringshare_printf("%s/%s", dashes, scale->style);
268 count = eina_list_count(scale->dashes);
269 _delete_extra_dashes(scale, count);
270 }
271 EINA_LIST_FOREACH(sd->markers, lm, marker)
272 {
273 eina_stringshare_del(marker->full_style);
274 marker->full_style = eina_stringshare_printf("%s/%s", markers, marker->style);
275 edje_object_file_set(marker->obj, EWE_THEME, marker->full_style);
229 } 276 }
230 277
231 evas_object_smart_changed(obj); 278 evas_object_smart_changed(obj);
232 return EINA_TRUE; 279 return EINA_TRUE;
233} 280}
234 281
235EOLIAN static Ewe_Ruler_Orient 282EOLIAN static Eina_Bool
236_ewe_ruler_orient_get(Eo *obj, Ewe_Ruler_Smart_Data *sd) 283_ewe_ruler_horizontal_get(Eo *obj EINA_UNUSED, Ewe_Ruler_Smart_Data *sd)
237{ 284{
238 if (!obj) 285 return sd->horizontal;
239 return EWE_RULER_ORIENT_WRONG;
240 return sd->orient;
241} 286}
242 287
243EOLIAN static Eina_Bool 288EOLIAN static Eina_Bool
@@ -356,7 +401,7 @@ _ewe_ruler_style_set(Eo *obj,
356 eina_stringshare_del(scale->style); 401 eina_stringshare_del(scale->style);
357 eina_stringshare_del(scale->full_style); 402 eina_stringshare_del(scale->full_style);
358 scale->style = eina_stringshare_add(style); 403 scale->style = eina_stringshare_add(style);
359 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL) 404 if (sd->horizontal)
360 scale->full_style = eina_stringshare_printf("%s/%s", DASHES, style); 405 scale->full_style = eina_stringshare_printf("%s/%s", DASHES, style);
361 else 406 else
362 scale->full_style = eina_stringshare_printf("%s/%s", DASHES_VER, style); 407 scale->full_style = eina_stringshare_printf("%s/%s", DASHES_VER, style);
@@ -394,8 +439,9 @@ _ewe_ruler_scale_add(Eo *obj EINA_UNUSED,
394 ret->visible = EINA_TRUE; 439 ret->visible = EINA_TRUE;
395 ret->mark_step = DEFAULT_STEP; 440 ret->mark_step = DEFAULT_STEP;
396 ret->mark_value_step = DEFAULT_STEP; 441 ret->mark_value_step = DEFAULT_STEP;
442 ret->markers = NULL;
397 ret->style = eina_stringshare_add(style); 443 ret->style = eina_stringshare_add(style);
398 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL) 444 if (sd->horizontal)
399 ret->full_style = eina_stringshare_printf("%s/%s", DASHES, style); 445 ret->full_style = eina_stringshare_printf("%s/%s", DASHES, style);
400 else 446 else
401 ret->full_style = eina_stringshare_printf("%s/%s", DASHES_VER, style); 447 ret->full_style = eina_stringshare_printf("%s/%s", DASHES_VER, style);
@@ -445,12 +491,22 @@ _ewe_ruler_scale_visible_set(Eo *obj EINA_UNUSED,
445 scale->visible = visible; 491 scale->visible = visible;
446 Eina_List *l; 492 Eina_List *l;
447 Evas_Object *data; 493 Evas_Object *data;
494 Ewe_Ruler_Marker *marker;
448 if (!visible) 495 if (!visible)
449 EINA_LIST_FOREACH(scale->dashes, l, data) 496 {
450 evas_object_hide(data); 497 EINA_LIST_FOREACH(scale->dashes, l, data)
498 evas_object_hide(data);
499 EINA_LIST_FOREACH(scale->markers, l, marker)
500 evas_object_hide(marker->obj);
501 }
451 else if (sd->ruler_visible) 502 else if (sd->ruler_visible)
452 EINA_LIST_FOREACH(scale->dashes, l, data) 503 {
453 evas_object_show(data); 504 EINA_LIST_FOREACH(scale->dashes, l, data)
505 evas_object_show(data);
506 EINA_LIST_FOREACH(scale->markers, l, marker)
507 if (marker->visible)
508 evas_object_show(marker->obj);
509 }
454 sd->size_changed = EINA_TRUE; 510 sd->size_changed = EINA_TRUE;
455 evas_object_smart_changed(obj); 511 evas_object_smart_changed(obj);
456 return EINA_TRUE; 512 return EINA_TRUE;
@@ -490,6 +546,204 @@ _ewe_ruler_scale_middle_mark_set(Eo *obj EINA_UNUSED,
490 return EINA_TRUE; 546 return EINA_TRUE;
491} 547}
492 548
549EOLIAN static Ewe_Ruler_Marker *
550_ewe_ruler_marker_add(Eo *obj,
551 Ewe_Ruler_Smart_Data *sd,
552 const char *style)
553{
554 Ewe_Ruler_Marker *ret = malloc(sizeof(Ewe_Ruler_Marker));
555 if (!ret) return NULL;
556 if (!style) style = DEFAULT_STYLE;
557
558 sd->markers = eina_list_append(sd->markers, ret);
559
560 ret->style = eina_stringshare_add(style);
561 if (sd->horizontal)
562 ret->full_style = eina_stringshare_printf("%s/%s", MARKER, style);
563 else
564 ret->full_style = eina_stringshare_printf("%s/%s", MARKER_VER, style);
565
566 ret->obj = edje_object_add(obj);
567 evas_object_clip_set(ret->obj, sd->clip);
568 edje_object_file_set(ret->obj, EWE_THEME, ret->full_style);
569 evas_object_smart_member_add(ret->obj, obj);
570
571 ret->scale = NULL;
572 ret->rel_position = 0;
573 ret->abs_position = 0;
574 ret->visible = EINA_TRUE;
575 ret->relative = EINA_FALSE;
576
577 return ret;
578}
579
580EOLIAN static Eina_Bool
581_ewe_ruler_marker_del(Eo *obj EINA_UNUSED,
582 Ewe_Ruler_Smart_Data *sd,
583 Ewe_Ruler_Marker *marker)
584{
585 if (!marker) return EINA_FALSE;
586 eina_stringshare_del(marker->style);
587 eina_stringshare_del(marker->full_style);
588
589 if (marker->relative)
590 marker->scale->markers = eina_list_remove(marker->scale->markers, marker);
591
592 sd->markers = eina_list_remove(sd->markers, marker);
593
594 evas_object_smart_member_del(marker->obj);
595 evas_object_del(marker->obj);
596 free(marker);
597 return EINA_TRUE;
598}
599
600EOLIAN static Eina_Bool
601_ewe_ruler_marker_relative_set(Eo *obj,
602 Ewe_Ruler_Smart_Data *sd,
603 Ewe_Ruler_Marker *marker,
604 Ewe_Ruler_Scale *scale,
605 double pos)
606{
607 if (!marker) return EINA_FALSE;
608 if (!scale) scale = eina_list_data_get(sd->scales);
609 if (!scale) return EINA_FALSE;
610
611 if (marker->relative)
612 {
613 if (marker->scale != scale)
614 {
615 marker->scale->markers = eina_list_remove(marker->scale->markers, marker);
616 scale->markers = eina_list_append(scale->markers, marker);
617 marker->scale = scale;
618 if (!scale->visible)
619 evas_object_hide(marker->obj);
620 else if (marker->visible && sd->ruler_visible)
621 evas_object_show(marker->obj);
622 }
623 }
624 else
625 {
626 marker->relative = EINA_TRUE;
627 scale->markers = eina_list_append(scale->markers, marker);
628 marker->scale = scale;
629 }
630 marker->rel_position = pos;
631
632 sd->text_changed = EINA_TRUE;
633 evas_object_smart_changed(obj);
634 return EINA_TRUE;
635}
636
637EOLIAN static double
638_ewe_ruler_marker_relative_get(Eo *obj EINA_UNUSED,
639 Ewe_Ruler_Smart_Data *sd,
640 Ewe_Ruler_Marker *marker,
641 Ewe_Ruler_Scale *scale)
642{
643 if (!marker) return EINA_FALSE;
644 if (!scale) scale = eina_list_data_get(sd->scales);
645 if (!scale) return 0;
646 if (marker->relative)
647 marker->abs_position = (marker->scale->mark_value_step) ? ((marker->rel_position / marker->scale->mark_value_step) * marker->scale->mark_step + marker->scale->zero_pos) : marker->scale->zero_pos;
648
649 if (marker->scale == scale)
650 return marker->rel_position;
651 else
652 return scale->mark_value_step * (marker->abs_position - scale->zero_pos) / scale->mark_step;
653}
654
655EOLIAN static Eina_Bool
656_ewe_ruler_marker_absolute_set(Eo *obj,
657 Ewe_Ruler_Smart_Data *sd,
658 Ewe_Ruler_Marker *marker,
659 int pos)
660{
661 if (!marker) return EINA_FALSE;
662
663 if (marker->relative)
664 {
665 marker->scale->markers = eina_list_remove(marker->scale->markers, marker);
666 marker->scale = NULL;
667 marker->relative = EINA_FALSE;
668 if (marker->visible && sd->ruler_visible)
669 evas_object_show(marker->obj);
670 }
671 marker->abs_position = pos;
672
673 sd->text_changed = EINA_TRUE;
674 evas_object_smart_changed(obj);
675 return EINA_TRUE;
676}
677
678EOLIAN static int
679_ewe_ruler_marker_absolute_get(Eo *obj EINA_UNUSED,
680 Ewe_Ruler_Smart_Data *sd EINA_UNUSED,
681 Ewe_Ruler_Marker *marker)
682{
683 if (!marker) return EINA_FALSE;
684 if (marker->relative)
685 marker->abs_position = (marker->scale->mark_value_step) ? ((marker->rel_position / marker->scale->mark_value_step) * marker->scale->mark_step + marker->scale->zero_pos) : marker->scale->zero_pos;
686
687 return marker->abs_position;
688}
689
690EOLIAN static Eina_Bool
691_ewe_ruler_marker_visible_get(Eo *obj EINA_UNUSED,
692 Ewe_Ruler_Smart_Data *sd EINA_UNUSED,
693 Ewe_Ruler_Marker *marker)
694{
695 if (!marker) return EINA_FALSE;
696 return marker->visible;
697}
698
699EOLIAN static Eina_Bool
700_ewe_ruler_marker_visible_set(Eo *obj EINA_UNUSED,
701 Ewe_Ruler_Smart_Data *sd,
702 Ewe_Ruler_Marker *marker,
703 Eina_Bool visible)
704{
705 if (!marker) return EINA_FALSE;
706 if (marker->visible == visible) return EINA_TRUE;
707 marker->visible = visible;
708 if (!visible)
709 evas_object_hide(marker->obj);
710 else if (sd->ruler_visible)
711 evas_object_show(marker->obj);
712 sd->text_changed = EINA_TRUE;
713 evas_object_smart_changed(obj);
714 return EINA_TRUE;
715}
716
717EOLIAN static Eina_Bool
718_ewe_ruler_marker_style_set(Eo *obj,
719 Ewe_Ruler_Smart_Data *sd,
720 Ewe_Ruler_Marker *marker,
721 const char *style)
722{
723 if (!marker) return EINA_FALSE;
724 eina_stringshare_del(marker->style);
725 eina_stringshare_del(marker->full_style);
726 marker->style = eina_stringshare_add(style);
727 if (sd->horizontal)
728 marker->full_style = eina_stringshare_printf("%s/%s", MARKER, style);
729 else
730 marker->full_style = eina_stringshare_printf("%s/%s", MARKER_VER, style);
731 edje_object_file_set(marker->obj, EWE_THEME, marker->full_style);
732
733 sd->text_changed = EINA_TRUE;
734 evas_object_smart_changed(obj);
735 return EINA_TRUE;
736}
737
738EOLIAN static const char *
739_ewe_ruler_marker_style_get(Eo *obj EINA_UNUSED,
740 Ewe_Ruler_Smart_Data *sd EINA_UNUSED,
741 Ewe_Ruler_Marker *marker)
742{
743 if (!marker) return NULL;
744 return marker->style;
745}
746
493/*------------------------Smart functions ----------------------------*/ 747/*------------------------Smart functions ----------------------------*/
494 748
495EOLIAN static void 749EOLIAN static void
@@ -502,15 +756,15 @@ _ewe_ruler_evas_object_smart_add(Eo *obj, Ewe_Ruler_Smart_Data *sd)
502 sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); 756 sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
503 evas_object_smart_member_add(sd->clip, obj); 757 evas_object_smart_member_add(sd->clip, obj);
504 sd->bg = edje_object_add(evas_object_evas_get(obj)); 758 sd->bg = edje_object_add(evas_object_evas_get(obj));
759 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/horizontal_background/default");
505 evas_object_smart_member_add(sd->bg, obj); 760 evas_object_smart_member_add(sd->bg, obj);
506 761
507 sd->orient = EWE_RULER_ORIENT_HORIZONTAL; 762 sd->horizontal = EINA_TRUE;
508 sd->geometry.width = 0; 763 sd->geometry.width = 0;
509 sd->geometry.height = 0; 764 sd->geometry.height = 0;
510 sd->geometry.x = 0; 765 sd->geometry.x = 0;
511 sd->geometry.y = 0; 766 sd->geometry.y = 0;
512 sd->ruler_visible = EINA_FALSE; 767 sd->ruler_visible = EINA_FALSE;
513 sd->pointer_visible = EINA_TRUE;
514 sd->size_changed = EINA_TRUE; 768 sd->size_changed = EINA_TRUE;
515 sd->text_changed = EINA_TRUE; 769 sd->text_changed = EINA_TRUE;
516 sd->position_changed = EINA_TRUE; 770 sd->position_changed = EINA_TRUE;
@@ -518,13 +772,17 @@ _ewe_ruler_evas_object_smart_add(Eo *obj, Ewe_Ruler_Smart_Data *sd)
518} 772}
519 773
520EOLIAN static void 774EOLIAN static void
521_ewe_ruler_evas_object_smart_del(Eo *obj EINA_UNUSED, 775_ewe_ruler_evas_object_smart_del(Eo *obj,
522 Ewe_Ruler_Smart_Data *sd) 776 Ewe_Ruler_Smart_Data *sd)
523{ 777{
524 Ewe_Ruler_Scale *scale; 778 Ewe_Ruler_Scale *scale;
525 Eina_List *ls; 779 Ewe_Ruler_Marker *marker;
780 Eina_List *l;
526 781
527 EINA_LIST_FOREACH(sd->scales, ls, scale) 782 EINA_LIST_FOREACH(sd->markers, l, marker)
783 ewe_ruler_marker_del(obj, marker);
784
785 EINA_LIST_FOREACH(sd->scales, l, scale)
528 ewe_ruler_scale_del(obj, scale); 786 ewe_ruler_scale_del(obj, scale);
529 787
530 evas_object_smart_member_del(sd->clip); 788 evas_object_smart_member_del(sd->clip);
@@ -535,11 +793,11 @@ _ewe_ruler_evas_object_smart_del(Eo *obj EINA_UNUSED,
535} 793}
536 794
537EOLIAN static void 795EOLIAN static void
538_ewe_ruler_evas_object_smart_show(Eo* obj, Ewe_Ruler_Smart_Data *sd) 796_ewe_ruler_evas_object_smart_show(Eo* obj EINA_UNUSED, Ewe_Ruler_Smart_Data *sd)
539{ 797{
540 if (sd->ruler_visible) return; 798 if (sd->ruler_visible) return;
541 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
542 Ewe_Ruler_Scale *scale; 799 Ewe_Ruler_Scale *scale;
800 Ewe_Ruler_Marker *marker;
543 Eina_List *ls, *l; 801 Eina_List *ls, *l;
544 Evas_Object *data; 802 Evas_Object *data;
545 803
@@ -547,10 +805,22 @@ _ewe_ruler_evas_object_smart_show(Eo* obj, Ewe_Ruler_Smart_Data *sd)
547 evas_object_show(sd->clip); 805 evas_object_show(sd->clip);
548 806
549 sd->ruler_visible = EINA_TRUE; 807 sd->ruler_visible = EINA_TRUE;
808
809 EINA_LIST_FOREACH(sd->markers, l, marker)
810 if (marker->visible)
811 evas_object_show(marker->obj);
812
550 EINA_LIST_FOREACH(sd->scales, ls, scale) 813 EINA_LIST_FOREACH(sd->scales, ls, scale)
551 if ((scale) && (scale->visible)) 814 if (scale->visible)
552 EINA_LIST_FOREACH(scale->dashes, l, data) 815 {
553 evas_object_show(data); 816 EINA_LIST_FOREACH(scale->dashes, l, data)
817 evas_object_show(data);
818 }
819 else
820 {
821 EINA_LIST_FOREACH(scale->markers, l, marker)
822 evas_object_hide(marker->obj);
823 }
554} 824}
555 825
556EOLIAN static void 826EOLIAN static void
@@ -559,12 +829,16 @@ _ewe_ruler_evas_object_smart_hide(Eo* obj, Ewe_Ruler_Smart_Data *sd)
559 if (!sd->ruler_visible) return; 829 if (!sd->ruler_visible) return;
560 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); 830 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
561 Ewe_Ruler_Scale *scale; 831 Ewe_Ruler_Scale *scale;
832 Ewe_Ruler_Marker *marker;
562 Eina_List *ls, *l; 833 Eina_List *ls, *l;
563 Evas_Object *data; 834 Evas_Object *data;
564 835
565 evas_object_hide(sd->bg); 836 evas_object_hide(sd->bg);
566 evas_object_hide(sd->clip); 837 evas_object_hide(sd->clip);
567 838
839 EINA_LIST_FOREACH(sd->markers, l, marker)
840 evas_object_hide(marker->obj);
841
568 sd->ruler_visible = EINA_FALSE; 842 sd->ruler_visible = EINA_FALSE;
569 EINA_LIST_FOREACH(sd->scales, ls, scale) 843 EINA_LIST_FOREACH(sd->scales, ls, scale)
570 EINA_LIST_FOREACH(scale->dashes, l, data) 844 EINA_LIST_FOREACH(scale->dashes, l, data)
@@ -617,7 +891,10 @@ _ewe_ruler_evas_object_smart_calculate(Eo *obj EINA_UNUSED,
617 if (sd->position_changed) 891 if (sd->position_changed)
618 _place_dashes(sd); 892 _place_dashes(sd);
619 if (sd->text_changed) 893 if (sd->text_changed)
620 _set_labels(sd); 894 {
895 _set_labels(sd);
896 _place_markers(sd);
897 }
621} 898}
622 899
623EOLIAN static Eina_Bool 900EOLIAN static Eina_Bool
@@ -631,7 +908,7 @@ _ewe_ruler_elm_widget_theme_apply(Eo *obj, Ewe_Ruler_Smart_Data *sd)
631 Ewe_Ruler_Scale *scale; 908 Ewe_Ruler_Scale *scale;
632 Eina_List *ls; 909 Eina_List *ls;
633 910
634 if (sd->orient == EWE_RULER_ORIENT_HORIZONTAL) 911 if (sd->horizontal)
635 { 912 {
636 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/horizontal_background/default"); 913 edje_object_file_set(sd->bg, EWE_THEME, "ewe/ruler/horizontal_background/default");
637 EINA_LIST_FOREACH(sd->scales, ls, scale) 914 EINA_LIST_FOREACH(sd->scales, ls, scale)
diff --git a/src/lib/ewe_ruler.eo b/src/lib/ewe_ruler.eo
index ee767da..3eed335 100644
--- a/src/lib/ewe_ruler.eo
+++ b/src/lib/ewe_ruler.eo
@@ -3,13 +3,13 @@ class Ewe_Ruler (Elm_Widget)
3 eo_prefix: ewe_obj_ruler; 3 eo_prefix: ewe_obj_ruler;
4 data: Ewe_Ruler_Smart_Data; 4 data: Ewe_Ruler_Smart_Data;
5 properties { 5 properties {
6 orient { 6 horizontal {
7 get { 7 get {
8 /*@ 8 /*@
9 Get the ruler orientation. 9 Get the ruler orientation.
10 10
11 @param obj The ruler object 11 @param obj The ruler object
12 @return EWE_RULER_ORIENT_HORIZONTAL or EWE_RULER_ORIENT_VERTICAL, NULL otherwise 12 @return EINA_TRUE if ruler is horizontal or EINA_FALSE otherwise
13 @ingroup ruler*/ 13 @ingroup ruler*/
14 } 14 }
15 set { 15 set {
@@ -22,7 +22,7 @@ class Ewe_Ruler (Elm_Widget)
22 return Eina_Bool; 22 return Eina_Bool;
23 } 23 }
24 values { 24 values {
25 Ewe_Ruler_Orient orient; 25 Eina_Bool horizontal;
26 } 26 }
27 } 27 }
28 step { 28 step {
@@ -205,6 +205,111 @@ class Ewe_Ruler (Elm_Widget)
205 Eina_Bool middle_mark; 205 Eina_Bool middle_mark;
206 } 206 }
207 } 207 }
208 marker_relative {
209 get {
210 /*@
211 Get marker position relative to given scale
212
213 @param obj The ruler object
214 @param marker Marker
215 @param scale Scale
216 @return relative position
217 @ingroup ruler*/
218 }
219 set {
220 /*@
221 Set marker to folow specified value on given scale
222 @return EINA_TRUE if position was set or EINA_FALSE on failure.
223
224 @ingroup ruler*/
225 return Eina_Bool;
226 }
227 keys {
228 Ewe_Ruler_Marker *marker;
229 Ewe_Ruler_Scale *scale;
230 }
231 values {
232 double rel_position;
233 }
234 }
235 marker_absolute {
236 get {
237 /*@
238 Get marker position
239
240 @param obj The ruler object
241 @param marker Marker
242 @return marker position
243 @ingroup ruler*/
244 }
245 set {
246 /*@
247 Set marker absolute posiiton
248 @return EINA_TRUE if position was set or EINA_FALSE on failure.
249
250 @ingroup ruler*/
251 return Eina_Bool;
252 }
253 keys {
254 Ewe_Ruler_Marker *marker;
255 }
256 values {
257 int position;
258 }
259 }
260 marker_visible {
261 get {
262 /*@
263 Get visibility of given marker
264
265 @param obj The ruler object
266 @param marker Marker
267 @return visibility of arker
268 @ingroup ruler*/
269 }
270 set {
271 /*@
272 Change the marker's visibility
273 @param obj The ruler object
274 @param marker Marker
275 @param visible New visibility state of given marker
276 @return EINA_TRUE if visibility was set or EINA_FALSE on failure.
277
278 @ingroup ruler*/
279 return Eina_Bool;
280 }
281 keys {
282 Ewe_Ruler_Marker *marker;
283 }
284 values {
285 Eina_Bool visible;
286 }
287 }
288 marker_style {
289 get {
290 /*@
291 Get style of given marker.
292
293 @param obj The ruler object
294 @return style
295 @ingroup ruler*/
296 }
297 set {
298 /*@
299 Set style for given marker
300
301 @return EINA_TRUE if style was setted or EINA_FALSE on failure.
302
303 @ingroup ruler*/
304 return Eina_Bool;
305 }
306 keys {
307 Ewe_Ruler_Marker *marker;
308 }
309 values {
310 const(char) *style;
311 }
312 }
208 } 313 }
209 methods { 314 methods {
210 scale_add { 315 scale_add {
@@ -233,6 +338,32 @@ class Ewe_Ruler (Elm_Widget)
233 Ewe_Ruler_Scale *scale; 338 Ewe_Ruler_Scale *scale;
234 } 339 }
235 } 340 }
341 marker_add {
342 /*@
343 Add new marker to ruler.
344 @param obj The ruler object
345 @param style Style of new marker. NULL - default.
346 @return Marker object or NULL on failure.
347
348 @ingroup ruler*/
349 return Ewe_Ruler_Marker *;
350 params {
351 const(char) *style;
352 }
353 }
354 marker_del {
355 /*@
356 Delete given marker from ruler.
357 @param obj The ruler object
358 @param marker Marker to be deleted
359 @return EINA_TRUE on success, EIAN_FALSE on failure.
360
361 @ingroup ruler*/
362 return Eina_Bool;
363 params {
364 Ewe_Ruler_Marker *marker;
365 }
366 }
236 } 367 }
237 implements { 368 implements {
238 class.constructor; 369 class.constructor;
diff --git a/src/lib/ewe_ruler_common.h b/src/lib/ewe_ruler_common.h
index 87fe1b0..67f3f0e 100644
--- a/src/lib/ewe_ruler_common.h
+++ b/src/lib/ewe_ruler_common.h
@@ -16,18 +16,11 @@
16 * along with this program; If not, see www.gnu.org/licenses/lgpl.html. 16 * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
17 */ 17 */
18 18
19
20typedef enum
21{
22 EWE_RULER_ORIENT_WRONG, /*returned from get func if some error occured*/
23 EWE_RULER_ORIENT_HORIZONTAL, /**< Ruler (dis)appears in horizontal mode */
24 EWE_RULER_ORIENT_VERTICAL, /**< Ruler (dis)appears in vertical mode */
25} Ewe_Ruler_Orient;
26
27typedef struct _Ewe_Ruler_Scale Ewe_Ruler_Scale; 19typedef struct _Ewe_Ruler_Scale Ewe_Ruler_Scale;
28struct _Ewe_Ruler_Scale 20struct _Ewe_Ruler_Scale
29{ 21{
30 Eina_List *dashes; 22 Eina_List *dashes;
23 Eina_List *markers;
31 Eina_Stringshare *format; 24 Eina_Stringshare *format;
32 Eina_Stringshare *style; 25 Eina_Stringshare *style;
33 Eina_Stringshare *full_style; 26 Eina_Stringshare *full_style;
@@ -37,3 +30,16 @@ struct _Ewe_Ruler_Scale
37 Eina_Bool visible : 1; 30 Eina_Bool visible : 1;
38 Eina_Bool show_middle_mark : 1; 31 Eina_Bool show_middle_mark : 1;
39}; 32};
33
34typedef struct _Ewe_Ruler_Marker Ewe_Ruler_Marker;
35struct _Ewe_Ruler_Marker
36{
37 Evas_Object *obj;
38 Ewe_Ruler_Scale *scale;
39 Eina_Stringshare *style;
40 Eina_Stringshare *full_style;
41 double rel_position;
42 int abs_position;
43 Eina_Bool visible : 1;
44 Eina_Bool relative : 1;
45};
diff --git a/src/lib/ewe_ruler_legacy.h b/src/lib/ewe_ruler_legacy.h
index 689d9f8..f24e78a 100644
--- a/src/lib/ewe_ruler_legacy.h
+++ b/src/lib/ewe_ruler_legacy.h
@@ -34,29 +34,27 @@ ewe_ruler_add(Evas_Object *parent);
34 * Change the ruler orientation to horizontal or vertical. 34 * Change the ruler orientation to horizontal or vertical.
35 * 35 *
36 * @param obj Ruler object. 36 * @param obj Ruler object.
37 * @param orient The Ruler orientation. Can be one of the following: 37 * @param horizontal The Ruler orientation.
38 * @li EWE_RULER_ORIENTO_HORIZONTAL
39 * @li EWE_RULER_ORIENTO_VERTICAL
40 * 38 *
41 * @return EINA_TRUE if Ewe_Ruler_Orient was set or EINA_FALSE on failure. 39 * @return EINA_TRUE if orientation was set or EINA_FALSE on failure.
42 * @ingroup Ruler 40 * @ingroup Ruler
43 */ 41 */
44EAPI Eina_Bool 42EAPI Eina_Bool
45ewe_ruler_orient_set(Evas_Object *obj, Ewe_Ruler_Orient orient); 43ewe_ruler_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
46 44
47/** 45/**
48 * Get value of current ruler object orientation 46 * Get value of current ruler object orientation
49 * 47 *
50 * @param obj Ruler object. 48 * @param obj Ruler object.
51 * 49 *
52 * @return EWE_RULER_ORIENT_HORIZONTAL or EWE_RULER_ORIENT_VERTICAL. 50 * @return EINA_TRUE if ruler orientation is horizontal, EINA_FALSE otherwise
53 * 51 *
54 * or VERTICAL. 52 * or VERTICAL.
55 * 53 *
56 * @ingroup Ruler 54 * @ingroup Ruler
57 */ 55 */
58EAPI Ewe_Ruler_Orient 56EAPI Eina_Bool
59ewe_ruler_orient_get(const Eo *obj); 57ewe_ruler_horizontal_get(const Eo *obj);
60 58
61/** 59/**
62 * Set step between marks in given scale of the ruler. Min step is 10. 60 * Set step between marks in given scale of the ruler. Min step is 10.
@@ -221,6 +219,32 @@ EAPI Eina_Bool
221ewe_ruler_scale_del(Eo *obj, Ewe_Ruler_Scale *scale); 219ewe_ruler_scale_del(Eo *obj, Ewe_Ruler_Scale *scale);
222 220
223/** 221/**
222 * Add new marker to the ruler
223 *
224 * @param obj Ruler object.
225 * @param style Style for new marker. NULL for default style
226 *
227 * @return pointer to new Ewe_Ruler_Marker
228 *
229 * @ingroup Ruler
230 */
231EAPI Ewe_Ruler_Marker *
232ewe_ruler_marker_add(Eo *obj, const char *style);
233
234/**
235 * Delete given marker from the ruler
236 *
237 * @param obj Ruler object.
238 * @param marker Marker
239 *
240 * @return EINA_TRUE on success, EINA_FALSE otherwise
241 *
242 * @ingroup Ruler
243 */
244EAPI Eina_Bool
245ewe_ruler_marker_del(Eo *obj, Ewe_Ruler_Marker *marker);
246
247/**
224 * Get visiblility state of given scale 248 * Get visiblility state of given scale
225 * 249 *
226 * @param obj Ruler object. 250 * @param obj Ruler object.
@@ -273,4 +297,115 @@ ewe_ruler_scale_middle_mark_get(const Eo *obj, Ewe_Ruler_Scale *scale);
273 */ 297 */
274EAPI Eina_Bool 298EAPI Eina_Bool
275ewe_ruler_scale_middle_mark_set(Eo *obj, Ewe_Ruler_Scale *scale, Eina_Bool middle_mark); 299ewe_ruler_scale_middle_mark_set(Eo *obj, Ewe_Ruler_Scale *scale, Eina_Bool middle_mark);
300
301/**
302 * Set marker to folow specified value on given scale.
303 *
304 * @param obj Ruler object.
305 * @param marker Marker.
306 * @param scale Scale. NULL for default scale
307 * @param position New relative position.
308 *
309 * @return EINA_TRUE if position was set or EINA_FALSE on failure.
310 *
311 * @ingroup Ruler
312 */
313EAPI Eina_Bool
314ewe_ruler_marker_relative_set(Evas_Object *obj, Ewe_Ruler_Marker *marker, Ewe_Ruler_Scale *scale, double position);
315
316/**
317 * Get marker position relative to given scale
318 *
319 * @param obj Ruler object.
320 * @param marker Marker.
321 * @param scale Scale. NULL for default scale
322 *
323 * @return relative position of marker
324 *
325 * @ingroup Ruler
326 */
327EAPI double
328ewe_ruler_marker_relative_get(const Eo *obj, Ewe_Ruler_Marker *marker, Ewe_Ruler_Scale *scale);
329
330/**
331 * Set marker position.
332 *
333 * @param obj Ruler object.
334 * @param marker Marker.
335 * @param position New position.
336 *
337 * @return EINA_TRUE if position was set or EINA_FALSE on failure.
338 *
339 * @ingroup Ruler
340 */
341EAPI Eina_Bool
342ewe_ruler_marker_absolute_set(Evas_Object *obj, Ewe_Ruler_Marker *marker, int position);
343
344/**
345 * Get marker position
346 *
347 * @param obj Ruler object.
348 * @param marker Marker.
349 *
350 * @return position of marker
351 *
352 * @ingroup Ruler
353 */
354EAPI int
355ewe_ruler_marker_absolute_get(const Eo *obj, Ewe_Ruler_Marker *marker);
356
357/**
358 * Get visiblility state of given marker
359 *
360 * @param obj Ruler object.
361 * @param marker Marker. NULL for default marker
362 *
363 * @return EINA_TRUE on success, EINA_FALSE otherwise
364 *
365 * @ingroup Ruler
366 */
367EAPI Eina_Bool
368ewe_ruler_marker_visible_get(const Eo *obj, Ewe_Ruler_Marker *marker);
369
370/**
371 * Set visiblility state of given marker
372 *
373 * @param obj Ruler object.
374 * @param marker Marker. NULL for default marker
375 * @param visible New visibility state for marker
376 *
377 * @return EINA_TRUE on success, EINA_FALSE otherwise
378 *
379 * @ingroup Ruler
380 */
381EAPI Eina_Bool
382ewe_ruler_marker_visible_set(Eo *obj, Ewe_Ruler_Marker *marker, Eina_Bool visible);
383
384/**
385 * Set style for given marker.
386 *
387 * @param obj Ruler object.
388 * @param marker Marker.
389 * @param style New style.
390 *
391 * @return EINA_TRUE if style was setted or EINA_FALSE on failure.
392 *
393 * @ingroup Ruler
394 */
395EAPI Eina_Bool
396ewe_ruler_marker_style_set(Evas_Object *obj, Ewe_Ruler_Marker *marker, const char *style);
397
398/**
399 * Get style of given marker
400 *
401 * @param obj Ruler object.
402 * @param marker Marker.
403 *
404 * @return style string.
405 *
406 * @ingroup Ruler
407 */
408EAPI const char *
409ewe_ruler_marker_style_get(const Eo *obj, Ewe_Ruler_Marker *marker);
410
276#endif /* EWE_RULER_LEGACY */ 411#endif /* EWE_RULER_LEGACY */
diff --git a/src/lib/ewe_tabs.c b/src/lib/ewe_tabs.c
index 3f8d0b1..9b508f0 100644
--- a/src/lib/ewe_tabs.c
+++ b/src/lib/ewe_tabs.c
@@ -47,11 +47,11 @@ _ewe_tabs_evas_object_smart_add(Eo *obj,
47 _elm_access_object_register(obj, wd->resize_obj); 47 _elm_access_object_register(obj, wd->resize_obj);
48 sd->layout = elm_layout_add(obj); 48 sd->layout = elm_layout_add(obj);
49 evas_object_smart_member_add(sd->layout, obj); 49 evas_object_smart_member_add(sd->layout, obj);
50 elm_layout_file_set(sd->layout, EWE_THEME, "ewe/tabs/default"); 50 elm_layout_file_set(sd->layout, EWE_THEME, "ewe/tabs/horizontal/default");
51 sd->items_box = elm_box_add(obj); 51 sd->items_box = elm_box_add(obj);
52 evas_object_smart_member_add(sd->items_box, obj); 52 evas_object_smart_member_add(sd->items_box, obj);
53 elm_layout_content_set(sd->layout, "tabs_area", sd->items_box); 53 elm_layout_content_set(sd->layout, "tabs_area", sd->items_box);
54 elm_box_horizontal_set(sd->items_box, EINA_TRUE); 54 elm_box_horizontal_set(sd->items_box, sd->horizontal);
55 elm_box_align_set(sd->items_box, 0.0, 0.5); 55 elm_box_align_set(sd->items_box, 0.0, 0.5);
56 sd->items = NULL; 56 sd->items = NULL;
57 57
@@ -78,6 +78,7 @@ EOLIAN static void
78_ewe_tabs_eo_base_constructor(Eo *obj, Ewe_Tabs_Smart_Data *sd) 78_ewe_tabs_eo_base_constructor(Eo *obj, Ewe_Tabs_Smart_Data *sd)
79{ 79{
80 sd->obj = obj; 80 sd->obj = obj;
81 sd->horizontal = EINA_TRUE;
81 eo_do_super(obj, MY_CLASS, eo_constructor()); 82 eo_do_super(obj, MY_CLASS, eo_constructor());
82 eo_do(obj, 83 eo_do(obj,
83 evas_obj_type_set(MY_CLASS_NAME_LEGACY), 84 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
@@ -115,7 +116,10 @@ _item_add_internal(Evas_Object *obj,
115 ret->style = style; 116 ret->style = style;
116 ret->head = elm_layout_add(obj); /* TODO: find out howto replace this elm_layout with edje_object*/ 117 ret->head = elm_layout_add(obj); /* TODO: find out howto replace this elm_layout with edje_object*/
117 evas_object_smart_member_add(ret->head, obj); 118 evas_object_smart_member_add(ret->head, obj);
118 eina_strbuf_append_printf(buf, "ewe/tabs/item/head/%s", style); 119 if (sd->horizontal)
120 eina_strbuf_append_printf(buf, "ewe/tabs/item/head/horizontal/%s", style);
121 else
122 eina_strbuf_append_printf(buf, "ewe/tabs/item/head/vertical/%s", style);
119 elm_layout_file_set(ret->head, EWE_THEME, eina_strbuf_string_get(buf)); 123 elm_layout_file_set(ret->head, EWE_THEME, eina_strbuf_string_get(buf));
120 124
121 if (!title) title = ""; 125 if (!title) title = "";
@@ -124,7 +128,10 @@ _item_add_internal(Evas_Object *obj,
124 128
125 eina_strbuf_reset(buf); 129 eina_strbuf_reset(buf);
126 ret->content = elm_layout_add(obj); 130 ret->content = elm_layout_add(obj);
127 eina_strbuf_append_printf(buf, "ewe/tabs/item/content/%s", style); 131 if (sd->horizontal)
132 eina_strbuf_append_printf(buf, "ewe/tabs/item/content/horizontal/%s", style);
133 else
134 eina_strbuf_append_printf(buf, "ewe/tabs/item/content/vertical/%s", style);
128 elm_layout_file_set(ret->content, EWE_THEME, eina_strbuf_string_get(buf)); 135 elm_layout_file_set(ret->content, EWE_THEME, eina_strbuf_string_get(buf));
129 eina_strbuf_free(buf); 136 eina_strbuf_free(buf);
130 137
@@ -268,6 +275,7 @@ _ewe_tabs_active_item_set(Eo *obj,
268 sd->active_item = item; 275 sd->active_item = item;
269 evas_object_smart_callback_call(obj, SIG_ITEM_ACTIVATED, (void *)sd->active_item); 276 evas_object_smart_callback_call(obj, SIG_ITEM_ACTIVATED, (void *)sd->active_item);
270 evas_object_show(sd->active_item->content); 277 evas_object_show(sd->active_item->content);
278 evas_object_raise(sd->items_box);
271 return EINA_TRUE; 279 return EINA_TRUE;
272} 280}
273 281
@@ -400,6 +408,62 @@ _ewe_tabs_item_disabled_get(Eo *obj,
400 return item->disabled; 408 return item->disabled;
401} 409}
402 410
411EOLIAN static Eina_Bool
412_ewe_tabs_orient_horizontal_set(Eo *obj,
413 Ewe_Tabs_Smart_Data *sd,
414 Eina_Bool horizontal)
415{
416 Ewe_Tabs_Item *it;
417 Eina_List *l;
418 Evas_Object *icon, *button, *content;
419 if (sd->horizontal == horizontal)
420 return EINA_FALSE;
421 sd->horizontal = horizontal;
422 elm_box_horizontal_set(sd->items_box, sd->horizontal);
423 if (sd->horizontal)
424 elm_layout_file_set(sd->layout, EWE_THEME, "ewe/tabs/horizontal/default");
425 else
426 elm_layout_file_set(sd->layout, EWE_THEME, "ewe/tabs/vertical/default");
427
428 EINA_LIST_FOREACH(sd->items, l, it)
429 {
430 icon = ewe_tabs_item_icon_unset(obj, it);
431 button = ewe_tabs_item_button_unset(obj, it);
432 content = ewe_tabs_item_content_unset(obj, it);
433 Eina_Strbuf *buf = eina_strbuf_new();
434 if (sd->horizontal)
435 eina_strbuf_append_printf(buf, "ewe/tabs/item/head/horizontal/%s", it->style);
436 else
437 eina_strbuf_append_printf(buf, "ewe/tabs/item/head/vertical/%s", it->style);
438 elm_layout_file_set(it->head, EWE_THEME, eina_strbuf_string_get(buf));
439 eina_strbuf_reset(buf);
440 if (sd->horizontal)
441 eina_strbuf_append_printf(buf, "ewe/tabs/item/content/horizontal/%s", it->style);
442 else
443 eina_strbuf_append_printf(buf, "ewe/tabs/item/content/vertical/%s", it->style);
444 elm_layout_file_set(it->content, EWE_THEME, eina_strbuf_string_get(buf));
445 eina_strbuf_free(buf);
446 if (ewe_tabs_item_disabled_get(obj, it))
447 ewe_tabs_item_disabled_set(obj, it, EINA_TRUE);
448 if (it == ewe_tabs_active_item_get(obj))
449 {
450 sd->active_item = NULL;
451 ewe_tabs_active_item_set(obj, it);
452 }
453 ewe_tabs_item_icon_set(obj, it, icon);
454 ewe_tabs_item_button_set(obj, it, button);
455 ewe_tabs_item_content_set(obj, it, content);
456 }
457 return EINA_TRUE;
458}
459
460EOLIAN static Eina_Bool
461_ewe_tabs_orient_horizontal_get(Eo *obj EINA_UNUSED,
462 Ewe_Tabs_Smart_Data *sd)
463{
464 return sd->horizontal;
465}
466
403EOLIAN static void 467EOLIAN static void
404_ewe_tabs_evas_object_smart_resize(Eo *obj, 468_ewe_tabs_evas_object_smart_resize(Eo *obj,
405 Ewe_Tabs_Smart_Data *sd, 469 Ewe_Tabs_Smart_Data *sd,
diff --git a/src/lib/ewe_tabs.eo b/src/lib/ewe_tabs.eo
index 7980a04..b6dbac2 100644
--- a/src/lib/ewe_tabs.eo
+++ b/src/lib/ewe_tabs.eo
@@ -91,6 +91,28 @@ class Ewe_Tabs (Elm_Widget)
91 Eina_Bool disabled; 91 Eina_Bool disabled;
92 } 92 }
93 } 93 }
94 orient_horizontal {
95 set {
96 /*@
97 Set horizontal or vertical orient for tabs.
98
99 @return EINA_TRUE on success, EINA_FALSE otherwise
100
101 @ingroup tabs*/
102 return Eina_Bool;
103 }
104 get {
105 /*@
106 Get tabs orient.
107
108 @return EINA_TRUE if tabs are horizontal, EINA_FALSE otherwise
109
110 @ingroup tabs*/
111 }
112 values {
113 Eina_Bool orient;
114 }
115 }
94 } 116 }
95 methods { 117 methods {
96 item_append { 118 item_append {
diff --git a/src/lib/ewe_tabs_legacy.h b/src/lib/ewe_tabs_legacy.h
index 95f8352..3666727 100644
--- a/src/lib/ewe_tabs_legacy.h
+++ b/src/lib/ewe_tabs_legacy.h
@@ -254,3 +254,25 @@ ewe_tabs_item_disabled_set(Evas_Object *obj,
254EAPI Eina_Bool 254EAPI Eina_Bool
255ewe_tabs_item_disabled_get(const Evas_Object *obj, 255ewe_tabs_item_disabled_get(const Evas_Object *obj,
256 Ewe_Tabs_Item *item); 256 Ewe_Tabs_Item *item);
257
258/**
259 * Set horizontal or vertical orient for tabs.
260 *
261 * @param horizontal EINA_TRUE to set horizontal orientation, EINA_FALSE to set vertical orientation for tabs
262 * @return EINA_TRUE on success, EINA_FALSE otherwise
263 *
264 * @ingroup tabs
265 */
266EAPI Eina_Bool
267ewe_tabs_orient_horizontal_set(Evas_Object *obj,
268 Eina_Bool horizontal);
269
270/**
271 * Gets tabs orientation.
272 *
273 * @return EINA_TRUE if tabs is horizontal, EINA_FALSE if tabs is vertical
274 *
275 * @ingroup tabs
276 */
277EAPI Eina_Bool
278ewe_tabs_orient_horizontal_get(const Evas_Object *obj);
diff --git a/src/lib/ewe_widget_combobox.h b/src/lib/ewe_widget_combobox.h
index a6fec7e..0f5a038 100644
--- a/src/lib/ewe_widget_combobox.h
+++ b/src/lib/ewe_widget_combobox.h
@@ -28,12 +28,12 @@ typedef struct _Ewe_Combobox_Smart_Data Ewe_Combobox_Smart_Data;
28struct _Ewe_Combobox_Smart_Data 28struct _Ewe_Combobox_Smart_Data
29{ 29{
30 Eo *obj; 30 Eo *obj;
31 Evas_Object *combobox, *expander, *bg; 31 Evas_Object *combobox, *scroller, *bg;
32 Evas_Object *items_box; 32 Evas_Object *items_box;
33 Ecore_Evas *ecev; 33 Evas_Object *win, *top_win;
34 Eina_List *items; 34 Eina_List *items;
35 Eina_Bool expanded : 1;
36 Ewe_Combobox_Item *selected; 35 Ewe_Combobox_Item *selected;
36 Eina_Bool expanded : 1;
37}; 37};
38 38
39#define EWE_COMBOBOX_DATA_GET(o, sd) \ 39#define EWE_COMBOBOX_DATA_GET(o, sd) \
diff --git a/src/lib/ewe_widget_ruler.h b/src/lib/ewe_widget_ruler.h
index df70913..67668d3 100644
--- a/src/lib/ewe_widget_ruler.h
+++ b/src/lib/ewe_widget_ruler.h
@@ -9,10 +9,8 @@ struct _Ewe_Ruler_Smart_Data
9 Eo *obj; 9 Eo *obj;
10 Evas_Object *clip; 10 Evas_Object *clip;
11 Evas_Object *bg; 11 Evas_Object *bg;
12 Ewe_Ruler_Orient orient;
13 Eina_List *scales; 12 Eina_List *scales;
14 Eina_Bool ruler_visible; 13 Eina_List *markers;
15 Eina_Bool pointer_visible;
16 struct { 14 struct {
17 unsigned int width; 15 unsigned int width;
18 unsigned int height; 16 unsigned int height;
@@ -22,6 +20,8 @@ struct _Ewe_Ruler_Smart_Data
22 Eina_Bool size_changed : 1; 20 Eina_Bool size_changed : 1;
23 Eina_Bool position_changed : 1; 21 Eina_Bool position_changed : 1;
24 Eina_Bool text_changed : 1; 22 Eina_Bool text_changed : 1;
23 Eina_Bool horizontal : 1;
24 Eina_Bool ruler_visible : 1;
25}; 25};
26 26
27#define EWE_RULER_DATA_GET(o, sd) \ 27#define EWE_RULER_DATA_GET(o, sd) \
diff --git a/src/lib/ewe_widget_tabs.h b/src/lib/ewe_widget_tabs.h
index 9dbc0d4..9aef729 100644
--- a/src/lib/ewe_widget_tabs.h
+++ b/src/lib/ewe_widget_tabs.h
@@ -28,7 +28,8 @@ struct _Ewe_Tabs_Smart_Data
28 Evas_Object *layout; 28 Evas_Object *layout;
29 Evas_Object *items_box; 29 Evas_Object *items_box;
30 Eina_List *items; 30 Eina_List *items;
31 Ewe_Tabs_Item *active_item; 31 Ewe_Tabs_Item *active_item;
32 Eina_Bool horizontal;
32}; 33};
33 34
34#define EWE_TABS_DATA_GET(o, sd) \ 35#define EWE_TABS_DATA_GET(o, sd) \
diff --git a/src/lib/ewe_win.c b/src/lib/ewe_win.c
index d8e50a5..47009f6 100644
--- a/src/lib/ewe_win.c
+++ b/src/lib/ewe_win.c
@@ -1,4 +1,5 @@
1/* Elementary Widgets Extension 1/**
2 * Elementary Widgets Extension
2 * Copyright (C) 2014 Samsung Electronics. 3 * Copyright (C) 2014 Samsung Electronics.
3 * 4 *
4 * This file is part of Elementary Widgets Extension. 5 * This file is part of Elementary Widgets Extension.
@@ -16,3 +17,35 @@
16 * along with this program; If not, see www.gnu.org/licenses/lgpl.html. 17 * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
17 */ 18 */
18 19
20#include "ewe_private.h"
21#include "Ewe.h"
22
23EAPI Evas_Object *
24ewe_win_add(Evas_Object *parent, const char *name, Ewe_Win_Type type)
25{
26 return elm_win_add(parent, name, type);
27}
28
29EAPI void
30ewe_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
31{
32 elm_win_floating_mode_set(obj, floating);
33}
34
35EAPI Eina_Bool
36ewe_win_floating_mode_get(const Evas_Object *obj)
37{
38 return elm_win_floating_mode_get(obj);
39}
40
41EAPI void
42ewe_win_render(Evas_Object *obj)
43{
44 elm_win_render(obj);
45}
46
47typedef struct _Ewe_Win_Data Ewe_Win_Data;
48struct _Ewe_Win_Data {
49};
50
51#include "ewe_win.eo.c"
diff --git a/src/lib/ewe_win.eo b/src/lib/ewe_win.eo
index 30c8bfe..f015ada 100644
--- a/src/lib/ewe_win.eo
+++ b/src/lib/ewe_win.eo
@@ -1,4 +1,8 @@
1class Ewe_Win (Elm_Win) 1class Ewe_Win (Elm_Win)
2{ 2{
3 eo_prefix: ewe_obj_win;
4 legacy_prefix: ewe_win;
5 data: Ewe_Win_Data;
3} 6}
4 7
8
diff --git a/src/lib/ewe_win.h b/src/lib/ewe_win.h
index f6f18e4..9efb76d 100644
--- a/src/lib/ewe_win.h
+++ b/src/lib/ewe_win.h
@@ -1,4 +1,5 @@
1/* Elementary Widgets Extension 1/**
2 * Elementary Widgets Extension
2 * Copyright (C) 2014 Samsung Electronics. 3 * Copyright (C) 2014 Samsung Electronics.
3 * 4 *
4 * This file is part of Elementary Widgets Extension. 5 * This file is part of Elementary Widgets Extension.
diff --git a/src/lib/ewe_win_common.h b/src/lib/ewe_win_common.h
index d8e50a5..a8ee555 100644
--- a/src/lib/ewe_win_common.h
+++ b/src/lib/ewe_win_common.h
@@ -1,4 +1,5 @@
1/* Elementary Widgets Extension 1/**
2 * Elementary Widgets Extension
2 * Copyright (C) 2014 Samsung Electronics. 3 * Copyright (C) 2014 Samsung Electronics.
3 * 4 *
4 * This file is part of Elementary Widgets Extension. 5 * This file is part of Elementary Widgets Extension.
@@ -16,3 +17,71 @@
16 * along with this program; If not, see www.gnu.org/licenses/lgpl.html. 17 * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
17 */ 18 */
18 19
20/**
21 * Defines the types of window that can be created
22 *
23 * These are hints set on the window so that a running Window Manager knows
24 * how the window should be handled and/or what kind of decorations it
25 * should have.
26 *
27 * Currently, only the X11 backed engines use them.
28 */
29
30typedef enum
31{
32 EWE_WIN_UNKNOWN = -1,
33 EWE_WIN_BASIC, /**< A normal window. Indicates a normal, top-level
34 window. Almost every window will be created with this
35 type. */
36 EWE_WIN_DIALOG_BASIC, /**< Used for simple dialog windows/ */
37 EWE_WIN_DESKTOP, /**< For special desktop windows, like a background
38 window holding desktop icons. */
39 EWE_WIN_DOCK, /**< The window is used as a dock or panel. Usually would
40 be kept on top of any other window by the Window
41 Manager. */
42 EWE_WIN_TOOLBAR, /**< The window is used to hold a floating toolbar, or
43 similar. */
44 EWE_WIN_MENU, /**< Similar to #ELM_WIN_TOOLBAR. */
45 EWE_WIN_UTILITY, /**< A persistent utility window, like a toolbox or
46 palette. */
47 EWE_WIN_SPLASH, /**< Splash window for a starting up application. */
48 EWE_WIN_DROPDOWN_MENU, /**< The window is a dropdown menu, as when an
49 entry in a menubar is clicked. Typically used
50 with elm_win_override_set(). This hint exists
51 for completion only, as the EFL way of
52 implementing a menu would not normally use a
53 separate window for its contents. */
54 EWE_WIN_POPUP_MENU, /**< Like #ELM_WIN_DROPDOWN_MENU, but for the menu
55 triggered by right-clicking an object. */
56 EWE_WIN_TOOLTIP, /**< The window is a tooltip. A short piece of
57 explanatory text that typically appear after the
58 mouse cursor hovers over an object for a while.
59 Typically used with elm_win_override_set() and also
60 not very commonly used in the EFL. */
61 EWE_WIN_NOTIFICATION, /**< A notification window, like a warning about
62 battery life or a new E-Mail received. */
63 EWE_WIN_COMBO, /**< A window holding the contents of a combo box. Not
64 usually used in the EFL. */
65 EWE_WIN_DND, /**< Used to indicate the window is a representation of an
66 object being dragged across different windows, or even
67 applications. Typically used with
68 elm_win_override_set(). */
69 EWE_WIN_INLINED_IMAGE, /**< The window is rendered onto an image
70 buffer. No actual window is created for this
71 type, instead the window and all of its
72 contents will be rendered to an image buffer.
73 This allows to have children window inside a
74 parent one just like any other object would
75 be, and do other things like applying @c
76 Evas_Map effects to it. This is the only type
77 of window that requires the @c parent
78 parameter of elm_win_add() to be a valid @c
79 Evas_Object. */
80 EWE_WIN_SOCKET_IMAGE, /**< The window is rendered onto an image buffer
81 and can be shown other process's plug image object.
82 No actual window is created for this type,
83 instead the window and all of its contents will be
84 rendered to an image buffer and can be shown
85 other process's plug image object*/
86} Ewe_Win_Type;
87
diff --git a/src/lib/ewe_win_legacy.h b/src/lib/ewe_win_legacy.h
index d1a25ae..09071e9 100644
--- a/src/lib/ewe_win_legacy.h
+++ b/src/lib/ewe_win_legacy.h
@@ -1,4 +1,5 @@
1/* Elementary Widgets Extension 1/**
2 * Elementary Widgets Extension
2 * Copyright (C) 2014 Samsung Electronics. 3 * Copyright (C) 2014 Samsung Electronics.
3 * 4 *
4 * This file is part of Elementary Widgets Extension. 5 * This file is part of Elementary Widgets Extension.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e49a2da..42f8612 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,5 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3ACLOCAL_AMFLAGS = -I m4
4
5TESTS = ewe_init_test \ 3TESTS = ewe_init_test \
6 ewe_tabs_test \ 4 ewe_tabs_test \
7 ewe_combobox_test \ 5 ewe_combobox_test \
@@ -22,13 +20,17 @@ LD = ${top_builddir}/src/lib/libewe.la \
22@ELEMENTARY_LIBS@ 20@ELEMENTARY_LIBS@
23 21
24ewe_init_test_SOURCES = \ 22ewe_init_test_SOURCES = \
23utc_common.h \
25test_ewe_init/test_ewe_init.c \ 24test_ewe_init/test_ewe_init.c \
25test_ewe_init/test_ewe_init.h \
26test_ewe_init/ewe_init.c 26test_ewe_init/ewe_init.c
27ewe_init_test_CFLAGS = ${FLAGS} 27ewe_init_test_CFLAGS = ${FLAGS}
28ewe_init_test_LDADD = ${LD} 28ewe_init_test_LDADD = ${LD}
29 29
30ewe_entry_test_SOURCES = \ 30ewe_entry_test_SOURCES = \
31utc_common.h \
31test_ewe_entry/test_ewe_entry.c \ 32test_ewe_entry/test_ewe_entry.c \
33test_ewe_entry/test_ewe_entry.h \
32test_ewe_entry/ewe_entry_add.c \ 34test_ewe_entry/ewe_entry_add.c \
33test_ewe_entry/ewe_entry_regex_check.c \ 35test_ewe_entry/ewe_entry_regex_check.c \
34test_ewe_entry/ewe_entry_regex_set.c \ 36test_ewe_entry/ewe_entry_regex_set.c \
@@ -40,7 +42,9 @@ ewe_entry_test_CFLAGS = ${FLAGS}
40ewe_entry_test_LDADD = ${LD} 42ewe_entry_test_LDADD = ${LD}
41 43
42ewe_ruler_test_SOURCES = \ 44ewe_ruler_test_SOURCES = \
45utc_common.h \
43test_ewe_ruler/test_ewe_ruler.c \ 46test_ewe_ruler/test_ewe_ruler.c \
47test_ewe_ruler/test_ewe_ruler.h \
44test_ewe_ruler/ewe_ruler_add.c \ 48test_ewe_ruler/ewe_ruler_add.c \
45test_ewe_ruler/ewe_ruler_scale_add.c \ 49test_ewe_ruler/ewe_ruler_scale_add.c \
46test_ewe_ruler/ewe_ruler_scale_del.c \ 50test_ewe_ruler/ewe_ruler_scale_del.c \
@@ -48,8 +52,8 @@ test_ewe_ruler/ewe_ruler_scale_visible_get.c \
48test_ewe_ruler/ewe_ruler_scale_visible_set.c \ 52test_ewe_ruler/ewe_ruler_scale_visible_set.c \
49test_ewe_ruler/ewe_ruler_scale_middle_mark_get.c \ 53test_ewe_ruler/ewe_ruler_scale_middle_mark_get.c \
50test_ewe_ruler/ewe_ruler_scale_middle_mark_set.c \ 54test_ewe_ruler/ewe_ruler_scale_middle_mark_set.c \
51test_ewe_ruler/ewe_ruler_orient_get.c \ 55test_ewe_ruler/ewe_ruler_horizontal_get.c \
52test_ewe_ruler/ewe_ruler_orient_set.c \ 56test_ewe_ruler/ewe_ruler_horizontal_set.c \
53test_ewe_ruler/ewe_ruler_step_set.c \ 57test_ewe_ruler/ewe_ruler_step_set.c \
54test_ewe_ruler/ewe_ruler_step_get.c \ 58test_ewe_ruler/ewe_ruler_step_get.c \
55test_ewe_ruler/ewe_ruler_value_step_set.c \ 59test_ewe_ruler/ewe_ruler_value_step_set.c \
@@ -59,13 +63,25 @@ test_ewe_ruler/ewe_ruler_zero_offset_get.c \
59test_ewe_ruler/ewe_ruler_format_get.c \ 63test_ewe_ruler/ewe_ruler_format_get.c \
60test_ewe_ruler/ewe_ruler_format_set.c \ 64test_ewe_ruler/ewe_ruler_format_set.c \
61test_ewe_ruler/ewe_ruler_style_get.c \ 65test_ewe_ruler/ewe_ruler_style_get.c \
62test_ewe_ruler/ewe_ruler_style_set.c 66test_ewe_ruler/ewe_ruler_style_set.c \
67test_ewe_ruler/ewe_ruler_marker_style_get.c \
68test_ewe_ruler/ewe_ruler_marker_style_set.c \
69test_ewe_ruler/ewe_ruler_marker_absolute_get.c \
70test_ewe_ruler/ewe_ruler_marker_absolute_set.c \
71test_ewe_ruler/ewe_ruler_marker_relative_get.c \
72test_ewe_ruler/ewe_ruler_marker_relative_set.c \
73test_ewe_ruler/ewe_ruler_marker_visible_get.c \
74test_ewe_ruler/ewe_ruler_marker_visible_set.c \
75test_ewe_ruler/ewe_ruler_marker_add.c \
76test_ewe_ruler/ewe_ruler_marker_del.c
63 77
64ewe_ruler_test_CFLAGS = ${FLAGS} 78ewe_ruler_test_CFLAGS = ${FLAGS}
65ewe_ruler_test_LDADD = ${LD} 79ewe_ruler_test_LDADD = ${LD}
66 80
67ewe_combobox_test_SOURCES = \ 81ewe_combobox_test_SOURCES = \
82utc_common.h \
68test_ewe_combobox/test_ewe_combobox.c \ 83test_ewe_combobox/test_ewe_combobox.c \
84test_ewe_combobox/test_ewe_combobox.h \
69test_ewe_combobox/ewe_combobox_add.c \ 85test_ewe_combobox/ewe_combobox_add.c \
70test_ewe_combobox/ewe_combobox_item_add.c \ 86test_ewe_combobox/ewe_combobox_item_add.c \
71test_ewe_combobox/ewe_combobox_item_del.c \ 87test_ewe_combobox/ewe_combobox_item_del.c \
@@ -78,7 +94,9 @@ ewe_combobox_test_CFLAGS = ${FLAGS}
78ewe_combobox_test_LDADD = ${LD} 94ewe_combobox_test_LDADD = ${LD}
79 95
80ewe_tabs_test_SOURCES = \ 96ewe_tabs_test_SOURCES = \
97utc_common.h \
81test_ewe_tabs/test_ewe_tabs.c \ 98test_ewe_tabs/test_ewe_tabs.c \
99test_ewe_tabs/test_ewe_tabs.h \
82test_ewe_tabs/ewe_tabs_item_append.c \ 100test_ewe_tabs/ewe_tabs_item_append.c \
83test_ewe_tabs/ewe_tabs_item_prepend.c \ 101test_ewe_tabs/ewe_tabs_item_prepend.c \
84test_ewe_tabs/ewe_tabs_items_list_get.c \ 102test_ewe_tabs/ewe_tabs_items_list_get.c \
@@ -96,12 +114,16 @@ test_ewe_tabs/ewe_tabs_item_title_set.c \
96test_ewe_tabs/ewe_tabs_item_title_get.c \ 114test_ewe_tabs/ewe_tabs_item_title_get.c \
97test_ewe_tabs/ewe_tabs_item_del.c \ 115test_ewe_tabs/ewe_tabs_item_del.c \
98test_ewe_tabs/ewe_tabs_item_disabled_set.c \ 116test_ewe_tabs/ewe_tabs_item_disabled_set.c \
99test_ewe_tabs/ewe_tabs_item_disabled_get.c 117test_ewe_tabs/ewe_tabs_item_disabled_get.c \
118test_ewe_tabs/ewe_tabs_orient_horizontal_set.c \
119test_ewe_tabs/ewe_tabs_orient_horizontal_get.c
100ewe_tabs_test_CFLAGS = ${FLAGS} 120ewe_tabs_test_CFLAGS = ${FLAGS}
101ewe_tabs_test_LDADD = ${LD} 121ewe_tabs_test_LDADD = ${LD}
102 122
103ewe_statusbar_test_SOURCES = \ 123ewe_statusbar_test_SOURCES = \
124utc_common.h \
104test_ewe_statusbar/test_ewe_statusbar.c \ 125test_ewe_statusbar/test_ewe_statusbar.c \
126test_ewe_statusbar/test_ewe_statusbar.h \
105test_ewe_statusbar/ewe_statusbar_add.c \ 127test_ewe_statusbar/ewe_statusbar_add.c \
106test_ewe_statusbar/ewe_statusbar_clear.c \ 128test_ewe_statusbar/ewe_statusbar_clear.c \
107test_ewe_statusbar/ewe_statusbar_item_append.c \ 129test_ewe_statusbar/ewe_statusbar_item_append.c \
@@ -127,3 +149,4 @@ test_ewe_statusbar/ewe_statusbar_items_swap.c
127ewe_statusbar_test_CFLAGS = ${FLAGS} 149ewe_statusbar_test_CFLAGS = ${FLAGS}
128ewe_statusbar_test_LDADD = ${LD} 150ewe_statusbar_test_LDADD = ${LD}
129 151
152EXTRA_DIST = tests_report_generator.py
diff --git a/tests/test_ewe_ruler/ewe_ruler_orient_get.c b/tests/test_ewe_ruler/ewe_ruler_horizontal_get.c
index 6dc3dca..42349cd 100644
--- a/tests/test_ewe_ruler/ewe_ruler_orient_get.c
+++ b/tests/test_ewe_ruler/ewe_ruler_horizontal_get.c
@@ -20,7 +20,7 @@
20/** 20/**
21 * @addtogroup ewe_ruler_test 21 * @addtogroup ewe_ruler_test
22 * @{ 22 * @{
23 * @addtogroup ewe_ruler_orient_get 23 * @addtogroup ewe_ruler_horizontal_get
24 * @{ 24 * @{
25 * ewe_ruler 25 * ewe_ruler
26 * <TABLE> 26 * <TABLE>
@@ -28,11 +28,11 @@
28 */ 28 */
29 29
30/** 30/**
31 * @addtogroup ewe_ruler_orient_get 31 * @addtogroup ewe_ruler_horizontal_get
32 * @{ 32 * @{
33 * <tr> 33 * <tr>
34 * <td>ewe_ruler_orient_get</td> 34 * <td>ewe_ruler_horizontal_get</td>
35 * <td>ewe_ruler_orient_get_test_p</td> 35 * <td>ewe_ruler_horizontal_get_test_p</td>
36 * <td> 36 * <td>
37 * @precondition 37 * @precondition
38 * @step 1 init ewe 38 * @step 1 init ewe
@@ -40,23 +40,23 @@
40 * @step 3 ewe_ruler added 40 * @step 3 ewe_ruler added
41 * 41 *
42 * @procedure 42 * @procedure
43 * @step 1 call ewe_ruler_orient_get 43 * @step 1 call ewe_ruler_horizontal_get
44 * @step 2 check returned value 44 * @step 2 check returned value
45 * </td> 45 * </td>
46 * <td>Evas_Object *ruler, Ewe_Ruler_Orient orient</td> 46 * <td>Evas_Object *ruler, Eina_Bool horizontal</td>
47 * <td>EWE_RULER_ORIENT_HORIZONTAL returned</td> 47 * <td>EINA_TRUE returned</td>
48 * <td>_REAL_RESULT_</td> 48 * <td>_REAL_RESULT_</td>
49 * <td>_PASSED_</td> 49 * <td>_PASSED_</td>
50 * </tr> 50 * </tr>
51 * @} 51 * @}
52 */ 52 */
53EWE_TEST(ewe_ruler_orient_get_test_p) 53EWE_TEST(ewe_ruler_horizontal_get_test_p)
54{ 54{
55 ewe_init(0, 0); 55 ewe_init(0, 0);
56 Evas_Object *win = elm_win_util_standard_add("test", "test"); 56 Evas_Object *win = elm_win_util_standard_add("test", "test");
57 Evas_Object *ruler = ewe_ruler_add(win); 57 Evas_Object *ruler = ewe_ruler_add(win);
58 58
59 ck_assert_msg(ewe_ruler_orient_get(ruler) == EWE_RULER_ORIENT_HORIZONTAL, "Cannot get default orientation of the ruler"); 59 ck_assert_msg(ewe_ruler_horizontal_get(ruler) == EINA_TRUE, "Cannot get default orientation of the ruler");
60 60
61 evas_object_del(win); 61 evas_object_del(win);
62 ewe_shutdown(); 62 ewe_shutdown();
@@ -64,39 +64,39 @@ EWE_TEST(ewe_ruler_orient_get_test_p)
64END_TEST 64END_TEST
65 65
66/** 66/**
67 * @addtogroup ewe_ruler_orient_get 67 * @addtogroup ewe_ruler_horizontal_get
68 * @{ 68 * @{
69 * <tr> 69 * <tr>
70 * <td>ewe_ruler_orient_get</td> 70 * <td>ewe_ruler_horizontal_get</td>
71 * <td>ewe_ruler_orient_get_test_n</td> 71 * <td>ewe_ruler_horizontal_get_test_n</td>
72 * <td> 72 * <td>
73 * @precondition 73 * @precondition
74 * @step 1 init ewe 74 * @step 1 init ewe
75 * @step 2 don't create ruler object 75 * @step 2 don't create ruler object
76 * 76 *
77 * @procedure 77 * @procedure
78 * @step 1 call ewe_ruler_orient_get 78 * @step 1 call ewe_ruler_horizontal_get
79 * @step 2 check returned value 79 * @step 2 check returned value
80 * </td> 80 * </td>
81 * <td>NULL, Ewe_Ruler_Orient orient</td> 81 * <td>NULL</td>
82 * <td>EWE_RULER_ORIENT_WRONG returned</td> 82 * <td>EINA_FALSE returned</td>
83 * <td>_REAL_RESULT_</td> 83 * <td>_REAL_RESULT_</td>
84 * <td>_PASSED_</td> 84 * <td>_PASSED_</td>
85 * </tr> 85 * </tr>
86 * @} 86 * @}
87 */ 87 */
88EWE_TEST(ewe_ruler_orient_get_test_n) 88EWE_TEST(ewe_ruler_horizontal_get_test_n)
89{ 89{
90 ewe_init(0, 0); 90 ewe_init(0, 0);
91 91
92 ck_assert_msg(ewe_ruler_orient_get(NULL) == EWE_RULER_ORIENT_WRONG, "Getted orientation of the NULL ruler object"); 92 ck_assert_msg(ewe_ruler_horizontal_get(NULL) == EINA_FALSE, "Getted orientation of the NULL ruler object");
93 93
94 ewe_shutdown(); 94 ewe_shutdown();
95} 95}
96END_TEST 96END_TEST
97 97
98/** 98/**
99 * @addtogroup ewe_ruler_orient_get 99 * @addtogroup ewe_ruler_horizontal_get
100 * @{ 100 * @{
101 * </TABLE> 101 * </TABLE>
102 * @} 102 * @}
diff --git a/tests/test_ewe_ruler/ewe_ruler_horizontal_set.c b/tests/test_ewe_ruler/ewe_ruler_horizontal_set.c
new file mode 100644
index 0000000..79187ef
--- /dev/null
+++ b/tests/test_ewe_ruler/ewe_ruler_horizontal_set.c
@@ -0,0 +1,148 @@
1/* Elementary Widgets Extension
2 * Copyright (C) 2014 Samsung Electronics.
3 *
4 * This file is part of Elementary Widgets Extension.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; If not, see www.gnu.org/licenses/gpl-2.0.html.
18 */
19#include "test_ewe_ruler.h"
20
21/**
22 * @addtogroup ewe_ruler_test
23 * @{
24 * @addtogroup ewe_ruler_horizontal_set
25 * @{
26 * ewe_ruler
27 * <TABLE>
28 * @}
29 */
30
31/**
32 * @addtogroup ewe_ruler_horizontal_set
33 * @{
34 * <tr>
35 * <td>ewe_ruler_horizontal_set</td>
36 * <td>ewe_ruler_horizontal_set_test_p1</td>
37 * <td>
38 * @precondition
39 * @step 1 init ewe
40 * @step 2 parent window create
41 * @step 3 ewe_ruler added
42 *
43 * @procedure
44 * @step 1 call ewe_ruler_horizontal_set
45 * @step 2 check returned value
46 * </td>
47 * <td>(Evas_Object *) ruler, EINA_TRUE</td>
48 * <td>EINA_FALSE</td>
49 * <td>_REAL_RESULT_</td>
50 * <td>_PASSED_</td>
51 * </tr>
52 * @}
53 */
54EWE_TEST(ewe_ruler_horizontal_set_test_p1)
55{