diff options
52 files changed, 3444 insertions, 0 deletions
@@ -0,0 +1,178 @@ +Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..07cf364 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,6 @@ +MAINTAINERCLEANFILES = Makefile.in Makefile +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = data src +xmldir = /usr/share/packages +xml_DATA = org.tizen.elm-demo-tizen-mobile.xml +imagedir = /usr/share/icons/default/small diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..306d3ce --- /dev/null +++ b/autogen.sh @@ -0,0 +1,15 @@ +#This script is for compiling on PC +# how to run on PC +# =================== +# #cd workdir/bin +# #./elm-demo-tizen-tv <edje file path> +# e.g. ./elm-demo-tizen-tv /home/ami/work/efl-theme-tizen-tv.edj +# This script will be removed later after completion of work. +# +# +#Use gbs for foxp build +mkdir -p ${PWD}/workdir +export PROJECT_HOME=${PWD}/workdir +libtoolize +autoreconf -ivf +./configure --prefix ${PROJECT_HOME} LDFLAGS=-L${PROJECT_HOME}/lib diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..4c2a349 --- /dev/null +++ b/configure.ac @@ -0,0 +1,42 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.68]) +AC_INIT([elm-demo-tizen-mobile], [0.1], [amitesh.sh@samsung.com]) +AC_CONFIG_SRCDIR([src/main.c]) +AC_CONFIG_HEADERS([config.h]) + +AC_CONFIG_AUX_DIR([.]) +AM_INIT_AUTOMAKE([foreign]) +# Checks for programs. +AC_PROG_CC +AC_CONFIG_MACRO_DIR([m4]) +# Checks for libraries. +CapiCheck = 0 +DESKTOP=0 +AC_CHECK_LIB([capi-appfw-application],[app_efl_exit],[CapiCheck=1],[CapiCheck=0]) +# Checks for header files. +# Checks for typedefs, structures, and compiler characteristics. +AC_LIBTOOL_DLOPEN +LT_INIT +AC_PROG_LIBTOOL +# Checks for library functions. +PKG_CHECK_MODULES([ELEMENTARY],[elementary]) +PKG_CHECK_MODULES([EFLEXTENSION],[efl-extension]) + +if test $CapiCheck == 1 +then + PKG_CHECK_MODULES([CAPIFW],[capi-appfw-application]) +else + DESKTOP=1 +fi +AC_SUBST([DESKTOP]) +AC_DEFINE_UNQUOTED([DESKTOP],[${DESKTOP}],["Desktop build is enabled"]) + +AC_CONFIG_FILES([Makefile + data/Makefile + data/edc/Makefile + data/images/Makefile + src/Makefile + ]) +AC_OUTPUT diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..e992271 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = images edc diff --git a/data/coding_convention.txt b/data/coding_convention.txt new file mode 100644 index 0000000..8e21781 --- /dev/null +++ b/data/coding_convention.txt @@ -0,0 +1,77 @@ +- if statement +if (a == NULL) +{ + +} + +- for statement +for (i = 0; i < 10; ++i) +{ +} + +- function local variables and return statement +int fun() +{ + int ret = 0; + int k = 0; + Evas_Object *win = NULL; + //Add one new line after the function local variable declaration. + .... + .... //your code + .... + //Add one new line before the return statement. + return ret; +} + +- gap between two function definitions. +int func1() +{ +} +//add a new line between two function definitions. +int func2() +{ +} + +- spacing after , +elm_object_content_set(sc, box); + +- indentation +4 spaces + +- function declaration +static void _on_click(void *data, Evas_Object *obj, void *event) + +- null check +if (abc == NULL) +if (abc != NULL) + +- variable declaration +declare variable when it's needed. + +- string compare +if (strcmp(a, "hello")) +if (!strcmp(a, "bye")) + +- plugin code position +Put get_plugin() right after header file include. +Put unload_plugin() at the end of file. +#include "xxxx.h" + +static elm_plugin *_ep; +elm_plugin *get_plugin() +{ + _ep = allocate_plugin("Button", "0.1"); + + return _ep; +} + +{sample code here} + +void unload_plugin() +{ + deallocate_plugin(_ep); +} + +- function and variable names +use lowercases. +split words by _ diff --git a/data/edc/Makefile.am b/data/edc/Makefile.am new file mode 100644 index 0000000..c1a85b2 --- /dev/null +++ b/data/edc/Makefile.am @@ -0,0 +1,14 @@ +EDJE_FLAGS = \ +-id $(top_srcdir)/data/images/ \ +-fd $(top_srcdir)/data/fonts/ +TARGET = layout.edj button.edj +all: $(TARGET) +$(TARGET): + edje_cc layout.edc $(EDJE_FLAGS) + edje_cc button.edc $(EDJE_FLAGS) +install: + mkdir -p $(DESTDIR)$(prefix)/data/edc + $(INSTALL) $(TARGET) $(DESTDIR)$(prefix)/data/edc +clean: + rm -rf *.edj + diff --git a/data/edc/button.edc b/data/edc/button.edc new file mode 100644 index 0000000..31eb6b4 --- /dev/null +++ b/data/edc/button.edc @@ -0,0 +1,319 @@ +collections { +group { name: "elm/button/base/simple_button"; + data.item: "focus_highlight" "on"; + + parts { + part { name: "click_rect"; + type: RECT; + description { state: "default" 0.0; + color: 255 255 255 0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + align: 0.5 0.5; + } + } + } + programs { + program { name: "button_click"; + signal: "mouse,down,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,press" ""; + } + program { name: "focus_on"; + signal: "elm,action,focus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,press" ""; + } + program { name: "button_unclick"; + signal: "mouse,up,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + } + program { name: "focus_out"; + signal: "elm,action,unfocus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + } + program { name: "button_unclick3"; + signal: "mouse,clicked,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } +} + +group { name: "elm/button/base/menu_button"; + data.item: "focus_highlight" "on"; + inherit: "elm/button/base/simple_button"; + images { + image: "glow_line.png" COMP; + image: "glow_line2.png" COMP; + } + parts { + + part { name: "elm.padding.left"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.0; + min: 50 10; + max: 50 10; + fixed: 1 0; + } + } + part { name: "elm.padding.center"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 0.7 0.0; + min: 10 10; + max: 10 10; + fixed: 1 0; + } + } + part { name: "elm.padding.right"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + align: 1.0 0.0; + min: 40 10; + max: 40 10; + fixed: 1 0; + } + } + part{ name: "line"; + description { state: "default" 0.0; + rel1 { relative: 0.0 0.9; offset: 0 -10; } + rel2 { relative: 1.0 1.0; offset: 0 -10; } + align: 0.5 1; + image.normal: "glow_line2.png"; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + rel1 { relative: 0.0 0.85; offset: 0 -5; } + rel2 { relative: 1.0 1.0; offset: 0 -5; } + image.normal: "glow_line.png"; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + align: 0.0 0.5; + rel1.offset: 0 6; + rel2.relative: 0.2 1.0; + rel2.offset: 0 6; + } + } + part { name: "elm.text"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to_x: "elm.padding.left"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.padding.center"; + rel2.relative: 0.0 1.0; + color: 224 224 224 255; + color2: 235 248 248 200; + color3: 100 100 100 200; + text { + size: 30; + font: "VAGRounded_BT"; + min: 1 1; + align: 0.0 0.5; + text_class: "button"; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + text.min: 1 1; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color3: 0 83 166 200; + text.size: 35; + } + } + part { name: "end"; + type: TEXT; + effect : SOFT_SHADOW; + description { state: "default" 0.0; + rel1.to_x: "elm.padding.center"; + rel1.relative: 1.0 0.0; + rel2.to_x: "elm.padding.right"; + rel2.relative: 0.0 1.0; + color: 255 255 255 255; + color2: 0 83 166 200; + color3: 100 100 100 200; + min:80 80; + text { + size: 30; + font: "VAGRounded_BT"; + text: ""; + align: 0.5 0.5; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + text.min: 1 1; + } + } + } + programs { + program { name: "button_click"; + signal: "mouse,down,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "focus_on"; + signal: "elm,action,focus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "line"; + target: "elm.text"; + transition: SIN 0.2; + } + program { name: "button_unclick"; + signal: "mouse,up,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { name: "focus_out"; + signal: "elm,action,unfocus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { name: "button_unclick_anim"; + action: STATE_SET "default" 0.0; + target: "line"; + target: "elm.text"; + } + program { name: "button_unclick3"; + signal: "mouse,clicked,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible") || !strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + script { + new st[31]; + new Float:vl; + set_state(PART:"elm.swallow.content", "visible", 0.0); + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible") || !strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + } + } + } +} + +group { name: "elm/button/base/arrow_button"; + inherit: "elm/button/base/simple_button"; + + data.item: "focus_highlight" "on"; + + parts { + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.relative: 0.1 0.1; + rel2.relative: 0.9 0.9; + } + description { state: "clicked" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + } + programs { + program { name: "button_click"; + signal: "mouse,down,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "focus_on"; + signal: "elm,action,focus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "button_click_anim"; + } + program { name: "button_click_anim"; + action: STATE_SET "clicked" 0.0; + target: "elm.swallow.content"; + transition: SIN 0.3; + after: "after_button_click_anim"; + } + program { name: "after_button_click_anim"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + transition: SIN 0.3; + after: "button_click_anim"; + } + program { name: "button_unclick"; + signal: "mouse,up,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { name: "focus_out"; + signal: "elm,action,unfocus"; + source: "elm"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "button_unclick_anim"; + } + program { name: "button_unclick_anim"; + action: ACTION_STOP; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "button_unclick3"; + signal: "mouse,clicked,1"; + source: "click_rect"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } +} diff --git a/data/edc/layout.edc b/data/edc/layout.edc new file mode 100755 index 0000000..d966589 --- /dev/null +++ b/data/edc/layout.edc @@ -0,0 +1,221 @@ +#define COLOR 2 61 132 255 + +collections { + group { name: "elm_demo/main"; + parts { + part { name: "bg"; type: RECT; + scale: 1; + description { state: "default" 0.0; + color: 100 100 100 100; + } + } + part { name: "widget.style.text.pad"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel2.relative: 0.0 0.0; + align: 0.0 0.0; + min: 50 30; + } + } + part { name: "widget.style.text"; type: TEXT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to: "widget.style.text.pad"; + } + rel2 { + relative: 1.0 1.0; + to: "widget.style.text.pad"; + } + align: 0.0 0.0; + text { + size: 30; + font: "SVD_Medium"; + min: 1 1; + text: "Widget Style"; + } + color: COLOR; + } + } + part { name: "widget.style.pad"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + to: "widget.style.text"; + } + rel2 { + relative: 1.0 1.0; + to: "widget.style.text"; + } + align: 0.0 0.0; + min: 30 0; + } + } + part { name: "widget.style"; type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + to: "widget.style.pad"; + } + rel2 { + relative: 1.0 1.0; + to: "widget.style.pad"; + } + align: 0.0 0.5; + min: 360 50; + } + } + part { name: "item.style.text.pad"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 0.0 1.0; + to_y: "widget.style"; + } + rel2 { + relative: 0.0 1.0; + to_y: "widget.style"; + } + align: 0.0 0.0; + min: 50 30; + } + } + part { name: "item.style.text"; type: TEXT; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to: "item.style.text.pad"; + } + rel2 { + relative: 1.0 1.0; + to: "item.style.text.pad"; + } + align: 0.0 0.0; + text { + size: 30; + font: "SVD_Medium"; + min: 1 1; + text: "Item Style"; + } + color: COLOR; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "item.style.pad"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + to: "item.style.text"; + } + rel2 { + relative: 1.0 1.0; + to_x: "widget.style.pad"; + to_y: "item.style.text"; + } + align: 0.0 0.5; + min: 30 0; + } + } + part { name: "item.style"; type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + rel1 { + relative: 1.0 0.0; + to: "item.style.pad"; + } + rel2 { + relative: 1.0 1.0; + to: "item.style.pad"; + } + align: 0.0 0.5; + min: 360 50; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "option"; type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + to_y: "widget.style"; + } + rel2 { + relative: 1.0 1.0; + to_y: "widget.style"; + } + align: 0.5 0.0; + min: 0 120; + fixed: 1 1; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.to_y: "item.style"; + rel2.to_y: "item.style"; + } + } + part { name: "widget.pad"; type: SPACER; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + to_y: "widget.style"; + } + rel2 { + relative: 1.0 1.0; + to_y: "widget.style"; + } + align: 0.5 0.0; + min: 0 30; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + rel1.to_y: "item.style"; + rel2.to_y: "item.style"; + } + } + part { name: "widget"; type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 0.0 1.0; + to_y: "widget.pad"; + //to_y: "option"; + } + } + } + } + programs { + program { name: "item.style.show"; + signal: "item,style,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "item.style.text"; + target: "item.style"; + target: "option"; + target: "widget.pad"; + } + } + } +} diff --git a/data/fonts/VAGRounded_BT.ttf b/data/fonts/VAGRounded_BT.ttf Binary files differnew file mode 100644 index 0000000..29d6531 --- /dev/null +++ b/data/fonts/VAGRounded_BT.ttf diff --git a/data/images/Makefile.am b/data/images/Makefile.am new file mode 100644 index 0000000..f6b6d2a --- /dev/null +++ b/data/images/Makefile.am @@ -0,0 +1,3 @@ +imagedir = $(prefix)/data/images/ +image_DATA = background.png ico_arrow_down.png ico_arrow_up.png ico_dropdown_menu_check.png\ + ico_dropdown_menu_open_arrow.png ico_lock_nor.png sky.jpg diff --git a/data/images/background.png b/data/images/background.png Binary files differnew file mode 100644 index 0000000..989e97d --- /dev/null +++ b/data/images/background.png diff --git a/data/images/glow_line.png b/data/images/glow_line.png Binary files differnew file mode 100644 index 0000000..f9974d8 --- /dev/null +++ b/data/images/glow_line.png diff --git a/data/images/glow_line2.png b/data/images/glow_line2.png Binary files differnew file mode 100644 index 0000000..2c48efd --- /dev/null +++ b/data/images/glow_line2.png diff --git a/data/images/ico_arrow_down.png b/data/images/ico_arrow_down.png Binary files differnew file mode 100644 index 0000000..f170229 --- /dev/null +++ b/data/images/ico_arrow_down.png diff --git a/data/images/ico_arrow_up.png b/data/images/ico_arrow_up.png Binary files differnew file mode 100644 index 0000000..1970c85 --- /dev/null +++ b/data/images/ico_arrow_up.png diff --git a/data/images/ico_dropdown_menu_check.png b/data/images/ico_dropdown_menu_check.png Binary files differnew file mode 100644 index 0000000..9e7d114 --- /dev/null +++ b/data/images/ico_dropdown_menu_check.png diff --git a/data/images/ico_dropdown_menu_open_arrow.png b/data/images/ico_dropdown_menu_open_arrow.png Binary files differnew file mode 100644 index 0000000..7395e32 --- /dev/null +++ b/data/images/ico_dropdown_menu_open_arrow.png diff --git a/data/images/ico_lock_nor.png b/data/images/ico_lock_nor.png Binary files differnew file mode 100644 index 0000000..7de539d --- /dev/null +++ b/data/images/ico_lock_nor.png diff --git a/data/images/ico_search.png b/data/images/ico_search.png Binary files differnew file mode 100644 index 0000000..b770442 --- /dev/null +++ b/data/images/ico_search.png diff --git a/data/images/sky.jpg b/data/images/sky.jpg Binary files differnew file mode 100644 index 0000000..cbad02a --- /dev/null +++ b/data/images/sky.jpg diff --git a/data/images/title_1.png b/data/images/title_1.png Binary files differnew file mode 100644 index 0000000..0d6a2ce --- /dev/null +++ b/data/images/title_1.png diff --git a/org.tizen.elm-demo-tizen-mobile.xml b/org.tizen.elm-demo-tizen-mobile.xml new file mode 100755 index 0000000..eb9bbec --- /dev/null +++ b/org.tizen.elm-demo-tizen-mobile.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.elm-demo-tizen-mobile" version="0.1" install-location="internal-only"> + <label>ElmTv</label> + <description>Tizen Tv Theme Demo Code</description> + <ui-application appid="org.tizen.elm-demo-tizen-mobile" exec="/usr/apps/org.tizen.elm-demo-tizen-mobile/bin/elm_demo_tizen_mobile" nodisplay="false" multiple="false" type="capp" taskmanage="true"> + <label>ElmTv</label> + <label xml:lang="en-us">ElmTv</label> + </ui-application> +</manifest> diff --git a/packaging/org.tizen.elm-demo-tizen-mobile.spec b/packaging/org.tizen.elm-demo-tizen-mobile.spec new file mode 100644 index 0000000..4b402f2 --- /dev/null +++ b/packaging/org.tizen.elm-demo-tizen-mobile.spec @@ -0,0 +1,45 @@ +%define PREFIX /usr/apps/org.tizen.elm-demo-tizen-mobile +Name: org.tizen.elm-demo-tizen-mobile +Version: 0.1 +Release: 1 +Summary: Tizen TV theme demo +Source: %{name}-%{version}.tar.gz +License: Apache License, Version 2.0 +Group: tizen/Application +BuildRequires: automake +BuildRequires: libtool +BuildRequires: pkgconfig(elementary) +BuildRequires: edje-bin +BuildRequires: embryo +BuildRequires: embryo-bin +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(efl-extension) + +%description +Tizen TV theme demo + +%prep +%setup -q + +%build +libtoolize +autoreconf -ivf +./configure --prefix=/usr/apps/org.tizen.elm-demo-tizen-mobile +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +%make_install + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files -n org.tizen.elm-demo-tizen-mobile +%defattr(-,root,root,-) +/usr/apps/org.tizen.elm-demo-tizen-mobile/bin/elm_demo_tizen_mobile +/usr/apps/org.tizen.elm-demo-tizen-mobile/data/ +/usr/apps/org.tizen.elm-demo-tizen-mobile/data/images/* +/usr/apps/org.tizen.elm-demo-tizen-mobile/data/edc/layout.edj +/usr/apps/org.tizen.elm-demo-tizen-mobile/data/edc/button.edj +/usr/share/packages/org.tizen.elm-demo-tizen-mobile.xml diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..bc58dbe --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,32 @@ +MAINTAINERCLEANFILES = Makefile.in Makefile + +bin_PROGRAMS = elm_demo_tizen_mobile +elm_demo_tizen_mobile_SOURCES = main.c main.h util.c util.h\ + bg.c \ + button.c \ + checkbox.c \ + colorselector.c \ + ctxpopup.c \ + datetime.c \ + entry.c \ + gengrid.c \ + genlist.c \ + index.c \ + label.c \ + hoversel.c \ + layout.c \ + multibuttonentry.c \ + panel.c \ + popup.c \ + progressbar.c \ + radio.c \ + scroller.c \ + slider.c \ + spinner.c \ + toolbar.c \ + tooltip.c +elm_demo_tizen_mobile_CFLAGS = $(ELEMENTARY_CFLAGS) $(CAPIFW_CFLAGS) $(EFLEXTENSION_CFLAGS) -ggdb \ + -DDATA_DIR='"${prefix}/data/edc/"' \ + -DEDJE_PATH='"/usr/share/elementary/themes"' \ + -DIMAGE_DIR='"${prefix}/data/images/"' -I../lib -I../ +elm_demo_tizen_mobile_LDADD = $(ELEMENTARY_LIBS) $(CAPIFW_LIBS) $(EFLEXTENSION_LIBS) -lutil -ldl diff --git a/src/bg.c b/src/bg.c new file mode 100644 index 0000000..8fb0f8e --- /dev/null +++ b/src/bg.c @@ -0,0 +1,20 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *bg_cb(void *data) +{ + Evas_Object *wbox, *bg; + appdata *ad = data; + + wbox = ad->widget_box; + + bg = elm_bg_add(wbox); + elm_bg_color_set(bg, 66, 162, 206); + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(bg); + elm_box_pack_end(wbox, bg); + + return bg; +} diff --git a/src/button.c b/src/button.c new file mode 100644 index 0000000..f767441 --- /dev/null +++ b/src/button.c @@ -0,0 +1,48 @@ +#include "main.h" +#include "util.h" + + +char *_btn_styles[] = +{ + "default", + "transparent", + "bottom", + "circle", + "contacts", + "icon_reorder", + "icon_expand_add", + "icon_expand_delete", + NULL +}; + +static void +_btn_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *btn = data; + const char *txt = elm_object_item_text_get(event_info); + + elm_object_style_set(btn, txt); +} + +void button_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->style_hov, "selected", _btn_selected); +} + +Evas_Object *button_cb(void *data) +{ + Evas_Object *wbox, *btn; + appdata *ad = data; + + wbox = ad->widget_box; + + btn = elm_button_add(wbox); + elm_object_text_set(btn, "Button"); + evas_object_show(btn); + elm_box_pack_end(wbox, btn); + + evas_object_smart_callback_add(ad->style_hov, "selected", _btn_selected, btn); + + return btn; +} diff --git a/src/checkbox.c b/src/checkbox.c new file mode 100644 index 0000000..7d9174d --- /dev/null +++ b/src/checkbox.c @@ -0,0 +1,85 @@ +#include "main.h" +#include "util.h" + + +char *_ck_styles[] = +{ + "default", + "favorite", + "onoff", + NULL +}; + + +static void +_ck_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *ck = data; + const char *txt = elm_object_item_text_get(event_info); + + elm_object_style_set(ck, txt); +} + +static void +_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *check = data; + Eina_Bool state = elm_check_state_get(obj); + + if (state) elm_object_text_set(check, "Text"); + else elm_object_text_set(check, ""); +} + +static void +_changed_cb2(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *check = data; + Eina_Bool state = elm_check_state_get(obj); + + if (state) { + Evas_Object *ic = elm_icon_add(check); + char buf[100]; + snprintf(buf, sizeof(buf), "%s%s", IMAGE_DIR, "ico_lock_nor.png"); + elm_image_file_set(ic, buf, NULL); + + elm_object_part_content_set(check, "icon", ic); + } + else elm_object_part_content_set(check, "icon", NULL); +} + +void checkbox_del_cb(void *data) +{ +} + +Evas_Object *checkbox_cb(void *data) +{ + Evas_Object *wbox, *obox, *check, *ck; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + check = elm_check_add(wbox); + evas_object_show(check); + elm_box_pack_end(wbox, check); + + // option box + ck = elm_check_add(obox); + evas_object_show(ck); + elm_object_text_set(ck, " Set Text"); + elm_box_pack_end(obox, ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _changed_cb, check); + + ck = elm_check_add(obox); + evas_object_show(ck); + elm_object_text_set(ck, " Set Icon"); + elm_box_pack_end(obox, ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _changed_cb2, check); + + evas_object_smart_callback_add(ad->style_hov, "selected", _ck_selected, check); + + return check; +} diff --git a/src/colorselector.c b/src/colorselector.c new file mode 100644 index 0000000..e9a187b --- /dev/null +++ b/src/colorselector.c @@ -0,0 +1,21 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *colorselector_cb(void *data) +{ + Evas_Object *wbox, *colorselector; + appdata *ad = data; + + wbox = ad->widget_box; + + colorselector = elm_colorselector_add(wbox); + elm_colorselector_mode_set(colorselector, ELM_COLORSELECTOR_PALETTE); + evas_object_size_hint_align_set(colorselector, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(colorselector, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + evas_object_show(colorselector); + elm_box_pack_end(wbox, colorselector); + + return colorselector; +} diff --git a/src/ctxpopup.c b/src/ctxpopup.c new file mode 100644 index 0000000..ee34625 --- /dev/null +++ b/src/ctxpopup.c @@ -0,0 +1,120 @@ +#include "main.h" +#include "util.h" + + +static int dir = 0; + +static void +_ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info) +{ + printf("ctxpopup item selected: %s\n", elm_object_item_text_get(event_info)); +} + +Elm_Object_Item *item_new(Evas_Object *ctxpopup, const char * label, const char *icon) +{ + Evas_Object *ic = elm_icon_add(ctxpopup); + elm_icon_standard_set(ic, icon); + elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE); + + return elm_ctxpopup_item_append(ctxpopup, label, ic, _ctxpopup_item_cb, NULL); +} + +static void +_ctxpopup_back_key_cb(void *data, Evas_Object *obj, void *event) +{ + evas_object_del(obj); +} + +static void +_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *win = data; + Evas_Object *ctxpopup; + Evas_Coord x,y; + + ctxpopup = elm_ctxpopup_add(win); + + elm_object_style_set(ctxpopup, "1text.1icon"); + elm_object_signal_emit(ctxpopup, "elm,action,focus", "elm"); + item_new(ctxpopup, "Text List1", "home"); + item_new(ctxpopup, "Text List2", "file"); + item_new(ctxpopup, "Text List3", "delete"); + + switch (dir) { + case 0: + elm_ctxpopup_direction_priority_set(ctxpopup, + ELM_CTXPOPUP_DIRECTION_UP, 0, 0, 0); + break; + case 1: + elm_ctxpopup_direction_priority_set(ctxpopup, + ELM_CTXPOPUP_DIRECTION_DOWN, 0, 0, 0); + break; + case 2: + elm_ctxpopup_direction_priority_set(ctxpopup, + ELM_CTXPOPUP_DIRECTION_LEFT, 0, 0, 0); + break; + case 3: + elm_ctxpopup_direction_priority_set(ctxpopup, + ELM_CTXPOPUP_DIRECTION_RIGHT, 0, 0, 0); + break; + } + + evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); + eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, _ctxpopup_back_key_cb, NULL); +} + +static void +_selected(void *data, Evas_Object *obj, void *event_info) +{ + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); + + if (strcmp(txt, "Up") == 0) dir = 0; + else if (strcmp(txt, "Down") == 0) dir = 1; + else if (strcmp(txt, "Left") == 0) dir = 2; + else if (strcmp(txt, "Right") == 0) dir = 3; + else dir = 0; +} + +void ctxpopup_del_cb(void *data) +{ + //If you need to do anyting when + //ctxpopup is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *ctxpopup_cb(void *data) +{ + Evas_Object *wbox, *obox, *btn, *table, *hov; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + btn = elm_button_add(wbox); + elm_object_text_set(btn, "Click here to show ctxpopup"); + evas_object_show(btn); + elm_box_pack_end(wbox, btn); + evas_object_smart_callback_add(btn, "clicked", _btn_clicked, (void *)ad->win); + + // option box + hov = elm_hoversel_add(obox); + elm_hoversel_hover_parent_set(hov, ad->win); + elm_object_text_set(hov, "Up"); + evas_object_show(hov); + elm_hoversel_item_add(hov, "Up", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "Down", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "Left", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "Right", NULL, ELM_ICON_NONE, NULL, NULL); + evas_object_smart_callback_add(hov, "selected", _selected, NULL); + table = widget_min_set(hov, obox, ELM_SCALE_SIZE(200), ELM_SCALE_SIZE(50)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + evas_object_show(table); + elm_box_pack_end(obox, table); + evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + return btn; +} diff --git a/src/datetime.c b/src/datetime.c new file mode 100644 index 0000000..f4d1e39 --- /dev/null +++ b/src/datetime.c @@ -0,0 +1,43 @@ +#include "main.h" +#include "util.h" + + +static void _focus_in_cb(void *data, Evas_Object *obj, void *event_info) +{ + fprintf(stderr, "[datetime] - focus in\n"); + elm_win_focus_highlight_style_set(data, "datetime"); +} + +static void _focus_out_cb(void *data, Evas_Object *obj, void *event_info) +{ + fprintf(stderr, "[datetime] - focus out\n"); + elm_win_focus_highlight_style_set(data, "default"); +} + +void datetime_del_cb(void *data) +{ + //If you need to do anyting when + //datetime is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *datetime_cb(void *data) +{ + Evas_Object *wbox, *datetime; + appdata *ad = data; + + wbox = ad->widget_box; + + // widget box + datetime = elm_datetime_add(wbox); + evas_object_show(datetime); + elm_box_pack_end(wbox, datetime); + + elm_datetime_field_visible_set(datetime, ELM_DATETIME_HOUR, EINA_FALSE); + elm_datetime_field_visible_set(datetime, ELM_DATETIME_MINUTE, EINA_FALSE); + + evas_object_smart_callback_add(datetime, "focused", _focus_in_cb, ad->win); + evas_object_smart_callback_add(datetime, "unfocused", _focus_out_cb, ad->win); + + return datetime; +} diff --git a/src/entry.c b/src/entry.c new file mode 100644 index 0000000..600fb4f --- /dev/null +++ b/src/entry.c @@ -0,0 +1,269 @@ +#include "main.h" +#include "util.h" + + +static Evas_Object *entry, *table, *check, *icon = NULL; +static Eina_Bool ck1; +static Eina_Bool is_pin_style; + +char *_en_styles[] = +{ + "default", + "vcenter_align", + "editfield", + NULL +}; + +static void _preedit_cb(void *data, Evas_Object *obj, void *event_info) +{ + int x; + Ecore_IMF_Context *imf_context = data; + char im_data[30] = "entrylimit=20&entrycharlen=0"; + + x = eina_unicode_utf8_get_len(elm_object_text_get(obj)); + sprintf(im_data, "entrylimit=20&entrycharlen=%d",x); + ecore_imf_context_input_panel_imdata_set(imf_context, im_data, eina_unicode_utf8_get_len(im_data)+1); +} + +static void _preedit_pin_cb(void *data, Evas_Object *obj, void *event_info) +{ + int x; + Ecore_IMF_Context *imf_context = data; + char im_data[30] = "entrylimit=1&entrycharlen=0"; + + x = eina_unicode_utf8_get_len(elm_object_text_get(obj)); + sprintf(im_data, "entrylimit=1&entrycharlen=%d",x); + ecore_imf_context_input_panel_imdata_set(imf_context, im_data, eina_unicode_utf8_get_len(im_data)+1); +} + +static void +pin_style() +{ + Evas_Object *en, *rect; + static Elm_Entry_Filter_Limit_Size limit_filter_data; + Ecore_IMF_Context *imf_context; + + elm_table_clear(table, EINA_TRUE); + elm_table_padding_set(table, 50, 0); + elm_table_homogeneous_set(table, EINA_TRUE); + + rect = evas_object_rectangle_add(evas_object_evas_get(table)); + evas_object_size_hint_min_set(rect, 240, 0); + evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(table, rect, 0, 0, 4, 1); + + en = elm_entry_add(table); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(en, "input.field.pin"); + elm_object_text_set(en, ""); + elm_entry_password_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_table_pack(table, en, 0, 0, 1, 1); + evas_object_show(en); + + imf_context = elm_entry_imf_context_get(en); + limit_filter_data.max_char_count = 1; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(en, "preedit,changed", _preedit_pin_cb, imf_context); + evas_object_smart_callback_add(en, "changed", _preedit_pin_cb, imf_context); + + en = elm_entry_add(table); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(en, "input.field.pin"); + elm_object_text_set(en, ""); + elm_entry_password_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_table_pack(table, en, 1, 0, 1, 1); + evas_object_show(en); + + imf_context = elm_entry_imf_context_get(en); + limit_filter_data.max_char_count = 1; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(en, "preedit,changed", _preedit_pin_cb, imf_context); + evas_object_smart_callback_add(en, "changed", _preedit_pin_cb, imf_context); + + en = elm_entry_add(table); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(en, "input.field.pin"); + elm_object_text_set(en, ""); + elm_entry_password_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_table_pack(table, en, 2, 0, 1, 1); + evas_object_show(en); + + imf_context = elm_entry_imf_context_get(en); + limit_filter_data.max_char_count = 1; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(en, "preedit,changed", _preedit_pin_cb, imf_context); + evas_object_smart_callback_add(en, "changed", _preedit_pin_cb, imf_context); + + en = elm_entry_add(table); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(en, "input.field.pin"); + elm_object_text_set(en, ""); + elm_entry_password_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_table_pack(table, en, 3, 0, 1, 1); + evas_object_show(en); + + imf_context = elm_entry_imf_context_get(en); + limit_filter_data.max_char_count = 1; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(en, "preedit,changed", _preedit_pin_cb, imf_context); + evas_object_smart_callback_add(en, "changed", _preedit_pin_cb, imf_context); +} + +static void +_en_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *en, *rect; + const char *txt = elm_object_item_text_get(event_info); + + if (!strcmp(txt, elm_object_text_get(obj))) return; + + // 1. pin style -> normal style + if (is_pin_style) + { + elm_table_clear(table, EINA_TRUE); + is_pin_style = EINA_FALSE; + + entry = en = elm_entry_add(table); + elm_object_text_set(en, "Input Field"); + elm_entry_scrollable_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_table_pack(table, en, 0, 0, 1, 1); + evas_object_show(en); + + rect = evas_object_rectangle_add(evas_object_evas_get(table)); + evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_min_set(rect, 400, 0); + elm_table_pack(table, rect, 0, 0, 1, 1); + + elm_object_style_set(en, txt); + elm_object_disabled_set(check, EINA_FALSE); + } + // 2. normal style -> pin style + else if (!is_pin_style && !strcmp(txt, "input.field.pin")) + { + elm_table_clear(table, EINA_TRUE); + if (icon) + { + evas_object_del(icon); + icon = NULL; + } + pin_style(); + is_pin_style = EINA_TRUE; + elm_object_disabled_set(check, EINA_TRUE); + } + // 3. normal style -> normal style + else + { + elm_object_style_set(entry, txt); + } + + // icon set + if (!strcmp(txt, "input.field.icon") || !strcmp(txt, "input.field.small.icon")) + { + if (!icon) + { + icon = elm_icon_add(entry); + elm_image_file_set(icon, IMAGE_DIR"ico_lock_nor.png", NULL); + evas_object_color_set(icon, 0, 0, 0, 255); + } + elm_object_part_content_set(entry, "icon", icon); + } + else + { + if (icon) + { + evas_object_del(icon); + icon = NULL; + } + } +} + +static void _ck_changed(void *data, Evas_Object *obj, void *event_info) +{ + int val = (int) data; + static Elm_Entry_Filter_Limit_Size limit_filter_data; + Ecore_IMF_Context *imf_context; + + if (val == 1) + { + if (ck1) + { + imf_context = elm_entry_imf_context_get(entry); + + limit_filter_data.max_char_count = 20; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(entry, "preedit,changed", _preedit_cb, imf_context); + evas_object_smart_callback_add(entry, "changed", _preedit_cb, imf_context); + } + else + { + imf_context = elm_entry_imf_context_get(entry); + elm_entry_markup_filter_remove(entry, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_del_full(entry, "preedit,changed", _preedit_cb, imf_context); + evas_object_smart_callback_del_full(entry, "changed", _preedit_cb, imf_context); + } + } +} + +void entry_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->style_hov, "selected", _en_selected); + if (icon) + { + evas_object_del(icon); + icon = NULL; + } +} + +Evas_Object *entry_cb(void *data) +{ + Evas_Object *wbox, *obox, *en, *tb, *ck; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + en = elm_entry_add(wbox); + tb = widget_min_set(en, wbox, ELM_SCALE_SIZE(400), 0); + evas_object_event_callback_add(tb, EVAS_CALLBACK_DEL, table_del_cb, NULL); + elm_object_text_set(en, "Input Field"); + elm_entry_scrollable_set(en, EINA_TRUE); + elm_entry_single_line_set(en, EINA_TRUE); + elm_box_pack_end(wbox, tb); + evas_object_show(tb); + evas_object_show(en); + + table = tb; + entry = en; + is_pin_style = EINA_FALSE; + evas_object_smart_callback_add(ad->style_hov, "selected", _en_selected, NULL); + + // option box + ck = elm_check_add(obox); + elm_object_text_set(ck, " Limit # of Characters to 20"); + elm_check_state_pointer_set(ck, &ck1); + evas_object_smart_callback_add(ck, "changed", _ck_changed, (void *)1); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + check = ck; + + return table; +} diff --git a/src/gengrid.c b/src/gengrid.c new file mode 100644 index 0000000..d36748a --- /dev/null +++ b/src/gengrid.c @@ -0,0 +1,193 @@ +#include "main.h" +#include "util.h" + +#define ITEM_NUMS 20 +#define BUFFER_SIZE 256 + + +char *_gg_item_styles[] = +{ + "default", + NULL +}; + +static const char *img[] = { + "sky.jpg", + NULL +}; + +typedef struct _Item_Data +{ + const char *path; + int onoff; +} Item_Data; + +static void +_horizontal_grid(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Evas_Object *grid = data; + elm_gengrid_horizontal_set(grid, elm_check_state_get(obj)); +} + +static void +_mouse_disable(void *data, Evas_Object *obj, + void *event_info) +{ + elm_gengrid_wheel_disabled_set(data, !(elm_gengrid_wheel_disabled_get(data))); + printf("Current mouse disable status:%d\n", elm_gengrid_wheel_disabled_get(data)); +} + +static void +_gengrid_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, + void *event_info) +{ + printf("%s: %p\n", (char *)data, event_info); +} + +static void +_gengrid_focus_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Key_Down *ev = event_info; + printf("\n=== Key Down : %s ===\n", ev->keyname); +} + +static void _gengrid_longpress_cb(void *data, Evas_Object *obj, void *event_info) +{ + printf("item longressed: %p\n", event_info); +} + +char *grid_text_get(void *data, Evas_Object *obj, const char *part) +{ + char buf[BUFFER_SIZE]; + + if (!strcmp(part, "elm.text.time")) + snprintf(buf, sizeof(buf), "00:04:41"); + else + snprintf(buf, sizeof(buf), "Sample Text"); + + return strdup(buf); +} + +Evas_Object *grid_content_get(void *data, Evas_Object *obj, const char *part) +{ + const Item_Data *ti = data; + + Evas_Object *image = elm_image_add(obj); + elm_image_file_set(image, ti->path, NULL); + elm_image_aspect_fixed_set(image, EINA_FALSE); + evas_object_show(image); + + return image; +} + +Eina_Bool grid_state_get(void *data, Evas_Object *obj, const char *part) +{ + return EINA_FALSE; +} + +void grid_del(void *data, Evas_Object *obj) +{ + Item_Data *ti = data; + + eina_stringshare_del(ti->path); + free(ti); +} + +static void grid_sel(void *data, Evas_Object *obj, void *event_info) +{ + printf("sel item data [%p] on grid obj [%p], pointer [%p]\n", data, obj, event_info); +} + +static void _gengrid_renew(Evas_Object *obj, const char *style) +{ + Elm_Gengrid_Item_Class *ic; + Item_Data *ti; + char buf[BUFFER_SIZE]; + int i; + + if (!obj) return; + + elm_gengrid_clear(obj); + ic = elm_gengrid_item_class_new(); + ic->item_style = style; + ic->func.text_get = grid_text_get; + ic->func.content_get = grid_content_get; + ic->func.state_get = grid_state_get; + ic->func.del = grid_del; + + for (i = 0; i < ITEM_NUMS; i++) + { + snprintf(buf, sizeof(buf), "%s%s", IMAGE_DIR, img[0]); + ti = calloc(1, sizeof(Item_Data)); + ti->path = eina_stringshare_add(buf); + elm_gengrid_item_append(obj, ic, ti, grid_sel, NULL); + } + + elm_gengrid_item_size_set(obj, ELM_SCALE_SIZE(290), ELM_SCALE_SIZE(350)); + + elm_gengrid_item_class_free(ic); +} + +static void +_gg_it_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *gg = data; + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); + + _gengrid_renew(gg, txt); +} + +void gengrid_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->item_hov, "selected", _gg_it_selected); +} + +Evas_Object *gengrid_cb(void *data) +{ + Evas_Object *wbox, *obox, *grid, *ck; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + grid = elm_gengrid_add(wbox); + elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL); + _gengrid_renew(grid, "default"); + evas_object_show(grid); + + evas_object_smart_callback_add(ad->item_hov, "selected", _gg_it_selected, grid); + elm_box_pack_end(wbox, grid); + + evas_object_smart_callback_add(grid, "item,focused", _gengrid_focus_item_cb, "item,focused"); + evas_object_smart_callback_add(grid, "item,unfocused", _gengrid_focus_item_cb, "item,unfocused"); + evas_object_smart_callback_add(grid, "selected", _gengrid_focus_item_cb, "selected"); + evas_object_smart_callback_add(grid, "unselected", _gengrid_focus_item_cb, "unselected"); + evas_object_smart_callback_add(grid, "activated", _gengrid_focus_item_cb, "activated"); + evas_object_smart_callback_add(grid, "highlighted", _gengrid_focus_item_cb, "highlighted"); + evas_object_smart_callback_add(grid, "unhighlighted", _gengrid_focus_item_cb, "unhighlighted"); + evas_object_event_callback_add(grid, EVAS_CALLBACK_KEY_DOWN, _gengrid_focus_key_down_cb, NULL); + evas_object_smart_callback_add(grid, "longpressed", _gengrid_longpress_cb, NULL); + + // option box + ck = elm_check_add(obox); + elm_object_text_set(ck, " Horizontal"); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _horizontal_grid, grid); + elm_box_pack_end(obox, ck); + evas_object_show(ck); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Disable Wheel"); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _mouse_disable, grid); + elm_box_pack_end(obox, ck); + evas_object_show(ck); + + return grid; +} diff --git a/src/genlist.c b/src/genlist.c new file mode 100644 index 0000000..b52a4ce --- /dev/null +++ b/src/genlist.c @@ -0,0 +1,260 @@ +#include "main.h" + +#define N_ITEMS 10 +#define BUFFER_SIZE 256 + + +char *_gl_item_styles[] = +{ + "default", + "1icon", + "1icon/no_padding", + "groupindex", + "select_all", + "groupindex.sub", + "1line", + "1line.2", + "2line.top", + "2line.top.2", + "2line.top.3", + "2line.top.4", + "2line.bottom", + "2line.bottom.2", + "2line.bottom.3", + "2line.bottom.4", + "multiline_sub", + "multiline_main", + "multiline_sub.main", + "multiline_sub.main.sub", + "multiline_sub.sub.main", + "multiline_main.sub", + "multiline_sub.main.1icon", + "multiline_sub.main.1icon.1", + "multiline_sub.sub.main.1icon", + "multiline_sub.sub.main.1icon.1", + NULL +}; + +static void _item_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Coord x = 0, y = 0, w = 0, h = 0; + Eina_Bool visible; + Elm_Object_Item *it = event_info; + Evas_Object *track = elm_object_item_track(it); + evas_object_geometry_get(track, &x, &y, &w, &h); + + visible = evas_object_visible_get(track); + printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n", + data, obj, event_info); + printf("track geometry = (%d %d %d %d) visible(%d)\n", + x, y, w, h, visible); + elm_object_item_untrack(it); +} + +static void _item_longpressed_cb(void *data, Evas_Object *obj, void *event_info) +{ + printf("item longpressed! %p \n", event_info); +} + +static Evas_Object *_item_content_get_default(void *data, Evas_Object *obj, const char *part) +{ + Evas_Object *ic = NULL; + + if (!strcmp(part, "elm.swallow.icon")) + { + ic = elm_icon_add(obj); + elm_icon_standard_set(ic, "clock"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + else if (!strcmp(part, "elm.swallow.content")) + { + ic = elm_icon_add(obj); + elm_icon_standard_set(ic, "home"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + else if (!strcmp(part, "elm.swallow.icon.1")) + { + ic = elm_icon_add(obj); + elm_icon_standard_set(ic, "folder"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + else if (!strcmp(part, "elm.swallow.icon.2")) + { + ic = elm_icon_add(obj); + elm_icon_standard_set(ic, "home"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + else if (!strcmp(part, "elm.swallow.bottom")) + { + ic = elm_progressbar_add(obj); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, 0.5); + } + else if (!strcmp(part, "elm.swallow.end")) + { + ic = elm_check_add(obj); + elm_object_focus_allow_set(ic, EINA_FALSE); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + else + { + ic = elm_icon_add(obj); + elm_icon_standard_set(ic, "home"); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + + return ic; +} + +static Evas_Object *_item_content_get_progress(void *data, Evas_Object *obj, const char *part) +{ + Evas_Object *ic = NULL; + + if (!strcmp(part, "elm.swallow.icon")) + { + ic = elm_progressbar_add(obj); + elm_progressbar_span_size_set(ic, 200); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_style_set(ic, "default"); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, 0.5); + } + else if (!strcmp(part, "elm.swallow.end")) + { + ic = elm_check_add(obj); + elm_object_focus_allow_set(ic, EINA_FALSE); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + } + + return ic; +} + +static char *_item_label_get(void *data, Evas_Object *obj, const char *part) +{ + char buf[BUFFER_SIZE]; + + if (!strcmp(part, "elm.text")) + { + if ((int) data == 0) sprintf(buf, "%s", "Time Warner Cable(Cable)"); + else if ((int) data == 1) sprintf(buf, "%s", "ComCast (Cable)"); + else if ((int) data == 2) sprintf(buf, "%s", "Dish (Satellite)"); + else if ((int) data == 3) sprintf(buf, "%s", "DirecTV (Satellite)"); + else if ((int) data == 4) sprintf(buf, "%s", "Tata Sky (Satellite)"); + else if ((int) data == 5) sprintf(buf, "%s", "Nextra Cable(Cable)"); + else if ((int) data == 6) sprintf(buf, "%s", "DD Plus (Cable)"); + else if ((int) data == 7) sprintf(buf, "%s", "Tikona Cable(Cable)"); + else if ((int) data == 8) sprintf(buf, "%s", "True Provider (Cable)"); + else if ((int) data == 9) sprintf(buf, "%s", "Vodafone (Satellite)"); + else sprintf(buf, "%s", "Sample Text"); + } + else if (!strcmp(part, "elm.text2")) + { + sprintf(buf, "sub text (%d)", (int) data); + } + else if (!strcmp(part, "elm.text3")) + { + sprintf(buf, "sub text#2 (%d)", (int) data); + } + else if (!strcmp(part, "elm.text4")) + { + sprintf(buf, "sub text#3 (%d)", (int) data); + } + else + { + sprintf(buf, "genlist item text sample (%d)", (int) data); + } + + return strdup(buf); +} + +static void _genlist_renew(Evas_Object *obj, const char *style) +{ + Elm_Genlist_Item_Class *ic; + int i; + + if (!obj) return; + + elm_genlist_clear(obj); + + ic = elm_genlist_item_class_new(); + ic->item_style = style; + ic->func.text_get = _item_label_get; + if (!strcmp(style, "progress")) + ic->func.content_get = _item_content_get_progress; + else + ic->func.content_get = _item_content_get_default; + ic->func.state_get = NULL; + ic->func.del = NULL; + + for (i = 0; i < N_ITEMS; i++) + elm_genlist_item_append(obj, ic, (void *)i, NULL, ELM_GENLIST_ITEM_NONE, _item_sel_cb, NULL); + + elm_genlist_item_class_free(ic); +} + +static void +_gl_focus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + printf("genlist item focused: %s\n", elm_object_item_text_get(event_info)); +} + +static void +_gl_unfocus_item_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + printf("genlist item unfocused: %s\n", elm_object_item_text_get(event_info)); +} + +static void +_gl_focus_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Key_Down *ev = event_info; + printf("\n=== Key Down : %s ===\n", ev->keyname); +} + +static void +_gl_it_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *gl = data; + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); + + _genlist_renew(gl, txt); +} + +void genlist_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->item_hov, "selected", _gl_it_selected); +} + +Evas_Object *genlist_cb(void *data) +{ + Evas_Object *wbox, *gl; + appdata *ad = data; + + wbox = ad->widget_box; + + gl = elm_genlist_add(wbox); + evas_object_smart_callback_add(ad->item_hov, "selected", _gl_it_selected, gl); + + elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); + + _genlist_renew(gl, "default"); + evas_object_show(gl); + + evas_object_smart_callback_add(gl, "item,focused", _gl_focus_item_cb, "item,focused"); + evas_object_smart_callback_add(gl, "item,unfocused", _gl_unfocus_item_cb, "item,unfocused"); + evas_object_smart_callback_add(gl, "activated", _gl_focus_item_cb, "activated"); + evas_object_event_callback_add(gl, EVAS_CALLBACK_KEY_DOWN, _gl_focus_key_down_cb, NULL); + evas_object_smart_callback_add(gl, "longpressed", _item_longpressed_cb, NULL); + + elm_box_pack_end(wbox, gl); + + return gl; +} diff --git a/src/hoversel.c b/src/hoversel.c new file mode 100644 index 0000000..350ae1f --- /dev/null +++ b/src/hoversel.c @@ -0,0 +1,106 @@ +#include "main.h" +#include "util.h" + +/* macro to store evas-object data key string for hoversel object last selected item */ +#define KEY_LAST_SELECTED_ITEM "last_selected_item" + + +static void _hoversel_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + printf("Hover button is clicked and 'clicked' callback is called.\n"); +} + +static void _hoversel_selected_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *last_selected_it, *hoversel_it; + Evas_Object *ic = NULL; + const char *item_label, *icon; + + hoversel_it = event_info; + last_selected_it = evas_object_data_get(obj, KEY_LAST_SELECTED_ITEM); + if (hoversel_it == last_selected_it) return; + if (hoversel_it == NULL) return; + + evas_object_data_set(obj, KEY_LAST_SELECTED_ITEM, (void*)hoversel_it); + item_label = elm_object_item_text_get(hoversel_it); + elm_object_text_set(obj, item_label); + + printf("Item selected: %s\n", item_label); + + elm_hoversel_item_icon_get(hoversel_it, &icon, NULL, NULL); + if (icon) + { + ic = elm_icon_add(obj); + elm_image_file_set(ic, icon, NULL); + } + elm_object_content_set(obj, ic); +} + +static void _hoversel_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + printf("'dismissed' callback is called.\n"); +} + +static void _hoversel_expanded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + const Eina_List *l; + Elm_Object_Item *last_selected_it, *hoversel_it, *last_it = NULL; + const Eina_List *items = elm_hoversel_items_get(obj); + + printf("'expanded' callback is called.\n"); + + last_selected_it = evas_object_data_get(obj, KEY_LAST_SELECTED_ITEM); + if (last_selected_it != NULL) + elm_object_item_signal_emit(last_selected_it, "elm,state,highlight", "elm"); + + EINA_LIST_FOREACH(items, l, hoversel_it) + { + last_it = hoversel_it; + } + elm_object_item_signal_emit(last_it, "elm,state,last,item", "elm"); +} + +void hoversel_del_cb(void *data) +{ + //If you need to do anyting when + //hoversel is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *hoversel_cb(void *data) +{ + Evas_Object *wbox, *table, *hoversel; + appdata *ad = data; + Elm_Object_Item *it; + + wbox = ad->widget_box; + + hoversel = elm_hoversel_add(wbox); + table = widget_min_set(hoversel, wbox, ELM_SCALE_SIZE(400), ELM_SCALE_SIZE(50)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + elm_hoversel_hover_parent_set(hoversel, ad->win); + elm_object_text_set(hoversel, "Hoversel"); + it = elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_icon_set(it, IMAGE_DIR"ico_arrow_down.png", NULL, ELM_ICON_FILE); + it = elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_FILE, NULL, NULL); + elm_hoversel_item_icon_set(it, IMAGE_DIR"ico_arrow_up.png", NULL, ELM_ICON_FILE); + elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 4", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 5 This item is long", NULL, ELM_ICON_NONE, NULL, NULL); + it = elm_hoversel_item_add(hoversel, "Item 6 This item is long", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_icon_set(it, IMAGE_DIR"ico_arrow_down.png", NULL, ELM_ICON_FILE); + it = elm_hoversel_item_add(hoversel, "Item 7 This item is long", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_icon_set(it, IMAGE_DIR"ico_arrow_up.png", NULL, ELM_ICON_FILE); + + evas_object_smart_callback_add(hoversel, "clicked", _hoversel_clicked_cb, NULL); + evas_object_smart_callback_add(hoversel, "selected", _hoversel_selected_cb, NULL); + evas_object_smart_callback_add(hoversel, "dismissed", _hoversel_dismissed_cb, NULL); + evas_object_smart_callback_add(hoversel, "expanded", _hoversel_expanded_cb, NULL); + + evas_object_show(table); + evas_object_show(hoversel); + + elm_box_pack_end(wbox, table); + + return table; +} diff --git a/src/index.c b/src/index.c new file mode 100644 index 0000000..bae1aa5 --- /dev/null +++ b/src/index.c @@ -0,0 +1,29 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *index_cb(void *data) +{ + Evas_Object *wbox, *index; + appdata *ad = data; + int i = 0; + char buf[4] = {0, }; + + wbox = ad->widget_box; + + index = elm_index_add(wbox); + + for (i = 65; i <= 90; i++) { + sprintf(buf, "%c", i); + elm_index_item_append(index, buf, NULL, NULL); + } + elm_index_level_go(index, 0); + + evas_object_size_hint_weight_set(index, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(index, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(index); + elm_box_pack_end(wbox, index); + + return index; +} diff --git a/src/label.c b/src/label.c new file mode 100644 index 0000000..bf5d9c5 --- /dev/null +++ b/src/label.c @@ -0,0 +1,18 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *label_cb(void *data) +{ + Evas_Object *wbox, *label; + appdata *ad = data; + + wbox = ad->widget_box; + + label = elm_label_add(wbox); + elm_object_text_set(label, "This is a label"); + evas_object_show(label); + elm_box_pack_end(wbox, label); + + return label; +} diff --git a/src/layout.c b/src/layout.c new file mode 100644 index 0000000..6add43d --- /dev/null +++ b/src/layout.c @@ -0,0 +1,31 @@ +#include "main.h" +#include "util.h" + +void layout_del_cb(void *data) +{ + //If you need to do anyting when + //layout is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *layout_cb(void *data) +{ + Evas_Object *wbox, *layout; + appdata *ad = data; + + wbox = ad->widget_box; + + // widget box + layout = elm_layout_add(wbox); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_layout_theme_set(layout, "layout", "application", "nocontent"); + + elm_object_part_text_set(layout, "elm.text", "No Plugged Source"); + elm_object_part_text_set(layout, "elm.text.1", "check connection status or install any cloud service."); + + elm_box_pack_end(wbox, layout); + evas_object_show(layout); + + return layout; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..4326905 --- /dev/null +++ b/src/main.c @@ -0,0 +1,282 @@ +#include <Elementary.h> +#include "config.h" +#include "main.h" + +#if DESKTOP == 0 +#include <appcore-efl.h> +#endif + + +extern char *_btn_styles[]; +extern char *_ck_styles[]; +extern char *_en_styles[]; +extern char *_sc_styles[]; +extern char *_sl_styles[]; +extern char *_gg_item_styles[]; +extern char *_gl_item_styles[]; + +static widget_item widget_its[] = +{ + { "Bg", bg_cb, NULL, NULL, NULL }, + { "Button", button_cb, button_del_cb, _btn_styles, NULL }, + { "Check", checkbox_cb, checkbox_del_cb, _ck_styles, NULL }, + { "Colorselector", colorselector_cb, NULL, NULL, NULL }, + { "Ctxpopup", ctxpopup_cb, ctxpopup_del_cb, NULL, NULL }, + { "Datetime", datetime_cb, datetime_del_cb, NULL, NULL }, + { "Entry", entry_cb, entry_del_cb, _en_styles, NULL }, + { "Gengrid", gengrid_cb, gengrid_del_cb, NULL, _gg_item_styles }, + { "Genlist", genlist_cb, genlist_del_cb, NULL, _gl_item_styles }, + { "Index", index_cb, NULL, NULL, NULL }, + { "Label", label_cb, NULL, NULL, NULL }, + { "Hoversel", hoversel_cb, hoversel_del_cb, NULL, NULL }, + { "Layout", layout_cb, layout_del_cb, NULL, NULL }, + { "Multibuttonentry", multibuttonentry_cb, NULL, NULL, NULL }, + { "Panel", panel_cb, NULL, NULL, NULL }, + { "Popup", popup_cb, popup_del_cb, NULL, NULL }, + { "Progressbar", progressbar_cb, progressbar_del_cb, NULL, NULL }, + { "Radio", radio_cb, radio_del_cb, NULL, NULL }, + { "Scroller", scroller_cb, scroller_del_cb, _sc_styles, NULL }, + { "Slider", slider_cb, slider_del_cb, _sl_styles, NULL }, + { "Spinner", spinner_cb, NULL, NULL, NULL }, + { "Toolbar", toolbar_cb, NULL, NULL, NULL }, + { "Tooltip", tooltip_cb, tooltip_del_cb, NULL, NULL }, + { NULL, NULL, NULL, NULL, NULL } +}; + +static appdata *app_data = NULL; + +void table_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + elm_table_clear(obj, EINA_TRUE); +} + +static void _back_btn_clicked_cb(void *data, Evas_Object *obj, void *event) +{ + elm_naviframe_item_pop(obj); +} + +static char *_text_get(void *data, Evas_Object *obj, const char *part) +{ + int i = (int) data; + char buf[32]; + sprintf(buf, "%d %s", (i+1), widget_its[i].name); + + return strdup(buf); +} + +static void +_selected(void *data, Evas_Object *obj, void *event_info) +{ + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); +} + +static void +_item_sel(void *data, Evas_Object *obj, void *event_info) +{ + int i = (int) data, j; + Evas_Object *layout, *box, *hov; + + layout = elm_layout_add(app_data->naviframe); + elm_layout_file_set(layout, DATA_DIR"layout.edj", "elm_demo/main"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(layout); + + // box 1 + box = elm_box_add(layout); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(layout, "widget", box); + evas_object_show(box); + app_data->widget_box = box; + + // box 2 + box = elm_box_add(layout); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(layout, "option", box); + evas_object_show(box); + app_data->option_box = box; + elm_box_horizontal_set(box, EINA_TRUE); + + // hoversel 1 + hov = elm_hoversel_add(layout); + elm_hoversel_hover_parent_set(hov, layout); + evas_object_show(hov); + evas_object_smart_callback_add(hov, "selected", _selected, NULL); + elm_object_part_content_set(layout, "widget.style", hov); + elm_object_disabled_set(hov, EINA_TRUE); + app_data->style_hov = hov; + + if (widget_its[i].styles) { + j = 0; + elm_object_disabled_set(app_data->style_hov, EINA_FALSE); + elm_object_text_set(app_data->style_hov, widget_its[i].styles[0]); + while(widget_its[i].styles[j]) { + elm_hoversel_item_add(app_data->style_hov, + widget_its[i].styles[j], NULL, ELM_ICON_NONE, NULL, NULL); + j++; + } + } + else { + elm_object_text_set(app_data->style_hov, "default"); + elm_object_disabled_set(app_data->style_hov, EINA_TRUE); + } + + // hoversel 2 + if (widget_its[i].it_styles) { + elm_layout_signal_emit(layout, "item,style,show", "elm"); + edje_object_signal_emit(elm_layout_edje_get(layout), "item,style,show", "elm"); + + hov = elm_hoversel_add(layout); + elm_hoversel_hover_parent_set(hov, layout); + evas_object_show(hov); + evas_object_smart_callback_add(hov, "selected", _selected, NULL); + elm_object_part_content_set(layout, "item.style", hov); + elm_object_disabled_set(hov, EINA_TRUE); + app_data->item_hov = hov; + + elm_object_text_set(app_data->item_hov, "default"); + j = 0; + elm_object_disabled_set(app_data->item_hov, EINA_FALSE); + elm_object_text_set(app_data->item_hov, widget_its[i].it_styles[0]); + while(widget_its[i].it_styles[j]) { + elm_hoversel_item_add(app_data->item_hov, + widget_its[i].it_styles[j], NULL, ELM_ICON_NONE, NULL, NULL); + j++; + } + } + + widget_its[i].func(app_data); + elm_naviframe_item_push(app_data->naviframe, + widget_its[i].name, NULL, NULL, layout, NULL); +} + +static Evas_Object *_widget_list_create(Evas_Object *parent) +{ + Evas_Object *list; + int i = 0; + + list = elm_genlist_add(parent); + elm_genlist_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS); + evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); + + Elm_Genlist_Item_Class *itc; + itc = elm_genlist_item_class_new(); + itc->item_style = "default"; + itc->func.text_get = _text_get; + itc->func.content_get = NULL; + itc->func.state_get = NULL; + itc->func.del = NULL; + + while(widget_its[i].name) + { + elm_genlist_item_append(list, itc, (void *)i, NULL, ELM_GENLIST_ITEM_NONE, _item_sel, (void *)i); + i++; + } + + elm_genlist_item_class_free(itc); + + return list; +} + +void app_init(appdata *ad) +{ + Evas_Object *win, *conform, *naviframe, *list; + + elm_config_focus_highlight_enabled_set(EINA_TRUE); + elm_config_focus_highlight_animate_set(EINA_TRUE); + elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); + elm_theme_extension_add(NULL, DATA_DIR"button.edj"); // for customized button + + // window + win = elm_win_util_standard_add("elm-demo-tizen-mobile", "elm-demo-tizen-mobile"); + elm_win_autodel_set(win, EINA_TRUE); + elm_win_fullscreen_set(win, EINA_TRUE); + elm_win_focus_highlight_style_set(win, "elmtv"); + evas_object_show(win); + ad->win = win; + + // conform + conform = elm_conformant_add(win); + evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, conform); + evas_object_show(conform); + ad->conform = conform; + + // naviframe + naviframe = elm_naviframe_add(conform); + elm_object_content_set(conform, naviframe); + evas_object_show(naviframe); + ad->naviframe = naviframe; + + // widget list + list = _widget_list_create(naviframe); + elm_naviframe_item_push(naviframe, "Tizen 3.0 Mobile", NULL, NULL, list, NULL); + eext_object_event_callback_add(naviframe, EEXT_CALLBACK_BACK, _back_btn_clicked_cb, NULL); +} + +#if DESKTOP == 1 +EAPI_MAIN +int elm_main(int argc, char **argv) +{ + char *edj_path = NULL; + + appdata *ad = calloc(1, sizeof(appdata)); + app_data = ad; + + if(argc == 2) + { + int len = strlen(argv[1]) + 1; + edj_path = (char *)malloc(len); + strncpy(edj_path, argv[1], len - 1); + edj_path[len-1] = '\0'; + + // Theme overlay when there is a command line parameter + // otherwise, use environment variable. + elm_theme_overlay_add(NULL, edj_path); + + free(edj_path); + } + + app_init(ad); + + elm_run(); + + elm_shutdown(); + + free(ad); + + return 0; +} +ELM_MAIN() +#else +bool app_create(void *userdata) +{ + appdata *ad = userdata; + + app_init(ad); + + return true; +} + +void app_terminate(void *user_data) +{ +} + +int main(int argc, char **argv) +{ + appdata app; + memset(&app, 0, sizeof(app)); + struct appcore_ops ops = { + .data = &app, + .create = app_create, + .terminate = app_terminate, + .pause = NULL, + .resume = NULL, + .reset = NULL, + }; + return appcore_efl_main("org.tizen.elm-demo-tizen-mobile", &argc, &argv, &ops); +} +#endif diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..dc7fbe8 --- /dev/null +++ b/src/main.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __DEF_elm_demo_H_ +#define __DEF_elm_demo_H_ + +#include <Elementary.h> +#include <efl_extension.h> + +typedef struct _widget_item +{ + char *name; + Evas_Object* (*func)(void *data); + void (*del_func)(void *data); + char **styles; + char **it_styles; + +} widget_item; + +typedef struct _appdata +{ + Evas_Object *win; + Evas_Object *conform; + Evas_Object *naviframe; + Evas_Object *widget_box; + Evas_Object *option_box; + Evas_Object *style_hov; + Evas_Object *item_hov; + +} appdata; + +Evas_Object *bg_cb(void *data); +Evas_Object *button_cb(void *data); +Evas_Object *checkbox_cb(void *data); +Evas_Object *colorselector_cb(void *data); +Evas_Object *ctxpopup_cb(void *data); +Evas_Object *datetime_cb(void *data); +Evas_Object *entry_cb(void *data); +Evas_Object *gengrid_cb(void *data); +Evas_Object *genlist_cb(void *data); +Evas_Object *index_cb(void *data); +Evas_Object *label_cb(void *data); +Evas_Object *hoversel_cb(void *data); +Evas_Object *layout_cb(void *data); +Evas_Object *multibuttonentry_cb(void *data); +Evas_Object *panel_cb(void *data); +Evas_Object *popup_cb(void *data); +Evas_Object *progressbar_cb(void *data); +Evas_Object *radio_cb(void *data); +Evas_Object *scroller_cb(void *data); +Evas_Object *slider_cb(void *data); +Evas_Object *spinner_cb(void *data); +Evas_Object *toolbar_cb(void *data); +Evas_Object *tooltip_cb(void *data); + +void button_del_cb(void *data); +void checkbox_del_cb(void *data); +void ctxpopup_del_cb(void *data); +void datetime_del_cb(void *data); +void entry_del_cb(void *data); +void gengrid_del_cb(void *data); +void genlist_del_cb(void *data); +void hoversel_del_cb(void *data); +void layout_del_cb(void *data); +void popup_del_cb(void *data); +void progressbar_del_cb(void *data); +void radio_del_cb(void *data); +void scroller_del_cb(void *data); +void slider_del_cb(void *data); +void tooltip_del_cb(void *data); + +void table_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); + +#endif /* __DEF_elm_demo_H__ */ diff --git a/src/multibuttonentry.c b/src/multibuttonentry.c new file mode 100644 index 0000000..4f8ce8a --- /dev/null +++ b/src/multibuttonentry.c @@ -0,0 +1,20 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *multibuttonentry_cb(void *data) +{ + Evas_Object *wbox, *mbe; + appdata *ad = data; + + wbox = ad->widget_box; + + mbe = elm_multibuttonentry_add(wbox); + elm_object_text_set(mbe, "To: "); + evas_object_show(mbe); + evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(mbe, EVAS_HINT_FILL, 0.0); + elm_box_pack_end(wbox, mbe); + + return mbe; +} diff --git a/src/panel.c b/src/panel.c new file mode 100644 index 0000000..be01e37 --- /dev/null +++ b/src/panel.c @@ -0,0 +1,36 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *panel_cb(void *data) +{ + Evas_Object *wbox, *panel, *list; + appdata *ad = data; + int i; + char buf[64]; + + wbox = ad->widget_box; + + panel = elm_panel_add(wbox); + elm_panel_scrollable_set(panel, EINA_TRUE); + elm_panel_hidden_set(panel, EINA_TRUE); + elm_panel_orient_set(panel, ELM_PANEL_ORIENT_LEFT); + evas_object_size_hint_weight_set(panel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(panel, EVAS_HINT_FILL, EVAS_HINT_FILL); + + list = elm_list_add(panel); + evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL); + + for (i = 0; i < 20; i++) { + sprintf(buf, "list item %d", i); + elm_list_item_append(list, buf, NULL, NULL, NULL, NULL); + } + evas_object_show(list); + elm_object_content_set(panel, list); + + evas_object_show(panel); + elm_box_pack_end(wbox, panel); + + return panel; +} diff --git a/src/popup.c b/src/popup.c new file mode 100644 index 0000000..4a7c82d --- /dev/null +++ b/src/popup.c @@ -0,0 +1,133 @@ +#include "main.h" +#include "util.h" + + +static Eina_Bool title = EINA_FALSE, timeout = EINA_FALSE; +static int btn_num = 0; + +static void _response_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + evas_object_del(data); +} + +static void +_selected(void *data EINA_UNUSED, Evas_Object *obj, void *event_info) +{ + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); + + if (strcmp(txt, "1 Button") == 0) btn_num = 1; + else if (strcmp(txt, "2 Buttons") == 0) btn_num = 2; + else if (strcmp(txt, "3 Buttons") == 0) btn_num = 3; + else btn_num = 0; +} + +static void +_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Eina_Bool state = elm_check_state_get(obj); + + if (state) timeout = EINA_TRUE; + else timeout = EINA_FALSE; +} + +static void +_changed_cb2(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Eina_Bool state = elm_check_state_get(obj); + + if (state) title = EINA_TRUE; + else title = EINA_FALSE; +} + +static void +_btn_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *win = data; + Evas_Object *popup = elm_popup_add(win); + Evas_Object *btn; + + elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER); + elm_object_text_set(popup, "Title Sample</br>" + "Check the antenna cable connection."); + evas_object_smart_callback_add(popup, "block,clicked", _response_cb, popup); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _response_cb, popup); + evas_object_show(popup); + + if (timeout) elm_popup_timeout_set(popup, 2.0); + if (title) elm_object_part_text_set(popup, "title,text", "Title"); + + if (btn_num > 0) { + btn = elm_button_add(popup); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button1", btn); + evas_object_smart_callback_add(btn, "clicked", _response_cb, popup); + } + if (btn_num > 1) { + btn = elm_button_add(popup); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button2", btn); + evas_object_smart_callback_add(btn, "clicked", _response_cb, popup); + } + if (btn_num > 2) { + btn = elm_button_add(popup); + elm_object_text_set(btn, "Cancel"); + elm_object_part_content_set(popup, "button3", btn); + evas_object_smart_callback_add(btn, "clicked", _response_cb, popup); + } +} + +void popup_del_cb(void *data) +{ + //If you need to do anyting when + //popup is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *popup_cb(void *data) +{ + Evas_Object *wbox, *obox, *btn, *ck, *table, *hov; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + btn = elm_button_add(wbox); + elm_object_text_set(btn, "Click here to show popup"); + evas_object_show(btn); + elm_box_pack_end(wbox, btn); + evas_object_smart_callback_add(btn, "clicked", _btn_clicked, (void *)ad->win); + + // option box + ck = elm_check_add(obox); + evas_object_show(ck); + elm_object_text_set(ck, " Timeout"); + elm_box_pack_end(obox, ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _changed_cb, NULL); + + ck = elm_check_add(obox); + evas_object_show(ck); + elm_object_text_set(ck, " Set Title"); + elm_box_pack_end(obox, ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_smart_callback_add(ck, "changed", _changed_cb2, NULL); + + hov = elm_hoversel_add(obox); + elm_hoversel_hover_parent_set(hov, ad->win); + elm_object_text_set(hov, "No Button"); + evas_object_show(hov); + elm_hoversel_item_add(hov, "No Button", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "1 Button", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "2 Buttons", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "3 Buttons", NULL, ELM_ICON_NONE, NULL, NULL); + evas_object_smart_callback_add(hov, "selected", _selected, NULL); + table = widget_min_set(hov, obox, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(50)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + evas_object_show(table); + elm_box_pack_end(obox, table); + evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + return btn; +} diff --git a/src/progressbar.c b/src/progressbar.c new file mode 100644 index 0000000..953ccb1 --- /dev/null +++ b/src/progressbar.c @@ -0,0 +1,140 @@ +#include "main.h" +#include "util.h" + + +typedef struct Progressbar +{ + Evas_Object *pb1; + Eina_Bool run; + Ecore_Timer *timer; +} Progressbar; + +static Progressbar _test_progressbar; + +static Eina_Bool cb_vertical, cb_invert, cb_pulse; + +static void _cb_changed(void *data, Evas_Object *obj, void *event_info) +{ + int val = (int)(uintptr_t)data; + if (val == 1) { //vertical + elm_progressbar_horizontal_set(_test_progressbar.pb1, !cb_vertical); + } + else if (val == 2) { //invert + elm_progressbar_inverted_set(_test_progressbar.pb1, cb_invert); + } + else if (val == 3) { //pulse + if (_test_progressbar.run) { + ecore_timer_del(_test_progressbar.timer); + _test_progressbar.run = EINA_FALSE; + } + elm_progressbar_pulse(_test_progressbar.pb1, EINA_FALSE); + elm_progressbar_pulse_set(_test_progressbar.pb1, cb_pulse); + } +} + +static Eina_Bool _my_progressbar_value_set(void *data) +{ + double progress; + + progress = elm_progressbar_value_get (_test_progressbar.pb1); + if (progress < 1.0) progress += 0.0123; + else progress = 0.0; + + elm_progressbar_value_set(_test_progressbar.pb1, progress); + if (progress < 1.0) return ECORE_CALLBACK_RENEW; + _test_progressbar.run = 0; + + return ECORE_CALLBACK_CANCEL; +} + +static void _progress_filling_start(void *data, Evas_Object *obj, void *event_info) +{ + if (cb_pulse) + elm_progressbar_pulse(_test_progressbar.pb1, EINA_TRUE); + else if (!_test_progressbar.run) + { + _test_progressbar.timer = ecore_timer_add(0.1, _my_progressbar_value_set, NULL); + _test_progressbar.run = EINA_TRUE; + } +} + +static void _progress_filling_stop(void *data, Evas_Object *obj, void *event_info) +{ + if (cb_pulse) + elm_progressbar_pulse(_test_progressbar.pb1, EINA_FALSE); + else if (_test_progressbar.run) + { + ecore_timer_del(_test_progressbar.timer); + _test_progressbar.run = EINA_FALSE; + } +} + +void progressbar_del_cb(void *data) +{ + //If you need to do anyting when + //progressbar is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *progressbar_cb(void *data) +{ + Evas_Object *wbox, *obox, *table, *pb, *bt, *ck; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + pb = elm_progressbar_add(wbox); + elm_progressbar_span_size_set(pb, ELM_SCALE_SIZE(200)); + evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_style_set(pb, "default"); + evas_object_show(pb); + + table = widget_min_set(pb, wbox, ELM_SCALE_SIZE(800), ELM_SCALE_SIZE(500)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + evas_object_show(table); + elm_box_pack_end(wbox, table); + _test_progressbar.pb1 = pb; + + // option box + bt = elm_button_add(obox); + elm_object_text_set(bt, "Start"); + evas_object_smart_callback_add(bt, "clicked", _progress_filling_start, NULL); + evas_object_show(bt); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, bt); + + bt = elm_button_add(obox); + elm_object_text_set(bt, "Stop"); + evas_object_smart_callback_add(bt, "clicked", _progress_filling_stop, NULL); + evas_object_show(bt); + evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, bt); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Vertical"); + elm_check_state_pointer_set(ck, &cb_vertical); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)1); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Invert"); + elm_check_state_pointer_set(ck, &cb_invert); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)2); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Pulse"); + elm_check_state_pointer_set(ck, &cb_pulse); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)3); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + return table; +} diff --git a/src/radio.c b/src/radio.c new file mode 100644 index 0000000..597a8f7 --- /dev/null +++ b/src/radio.c @@ -0,0 +1,83 @@ +#include "main.h" +#include "util.h" + + +static int val = 1; + +static void _cb(void *data, Evas_Object *obj, void *event_info) +{ + printf("val is now: %d\n", val); +} + +void radio_del_cb(void *data) +{ + //If you need to do anyting when + //radio is deleted and another widget is selected on the menu, + //please do in this function. +} + +Evas_Object *radio_cb(void *data) +{ + Evas_Object *wbox, *table, *radio, *group, *ic; + appdata *ad = data; + + wbox = ad->widget_box; + + // widget box + table = elm_table_add(wbox); + elm_table_padding_set(table, ELM_SCALE_SIZE(7), ELM_SCALE_SIZE(7)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + + // radio 1 + group = radio = elm_radio_add(table); + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_text_set(radio, "Tizen"); + elm_radio_state_value_set(radio, 1); + elm_radio_value_pointer_set(radio, &val); + evas_object_smart_callback_add(radio, "changed", _cb, NULL); + evas_object_show(radio); + + ic = elm_icon_add(radio); + elm_icon_standard_set(ic, "home"); + elm_object_part_content_set(radio, "icon", ic); + + elm_table_pack(table, radio, 0, 1, 1, 1); + + // radio 2 + radio = elm_radio_add(table); + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_text_set(radio, "Android"); + elm_radio_state_value_set(radio, 2); + elm_radio_value_pointer_set(radio, &val); + evas_object_smart_callback_add(radio, "changed", _cb, NULL); + evas_object_show(radio); + + ic = elm_icon_add(radio); + elm_icon_standard_set(ic, "file"); + elm_object_part_content_set(radio, "icon", ic); + + elm_table_pack(table, radio, 0, 2, 1, 1); + elm_radio_group_add(radio, group); + + // radio 3 + radio = elm_radio_add(table); + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_text_set(radio, " Disabled "); + elm_object_disabled_set(radio, EINA_TRUE); + evas_object_show(radio); + + ic = elm_icon_add(radio); + elm_icon_standard_set(ic, "folder"); + elm_object_part_content_set(radio, "icon", ic); + + elm_table_pack(table, radio, 0, 3, 1, 1); + elm_radio_group_add(radio, group); + + evas_object_show(table); + elm_box_pack_end(wbox, table); + + return table; +} diff --git a/src/scroller.c b/src/scroller.c new file mode 100644 index 0000000..b29ac1c --- /dev/null +++ b/src/scroller.c @@ -0,0 +1,64 @@ +#include "main.h" +#include "util.h" + + +char *_sc_styles[] = +{ + "default", + "white", + "no_bar", + NULL +}; + +static void +_sc_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *sc = data; + const char *txt = elm_object_item_text_get(event_info); + + elm_object_style_set(sc, txt); +} + +void scroller_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->style_hov, "selected", _sc_selected); +} + +Evas_Object *scroller_cb(void *data) +{ + Evas_Object *wbox, *sc, *table, *btn; + appdata *ad = data; + int i, j; + + wbox = ad->widget_box; + + // widget box + sc = elm_scroller_add(wbox); + evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(sc); + elm_box_pack_end(wbox, sc); + + evas_object_smart_callback_add(ad->style_hov, "selected", _sc_selected, sc); + + table = elm_table_add(sc); + elm_table_padding_set(table, ELM_SCALE_SIZE(20), ELM_SCALE_SIZE(20)); + elm_table_homogeneous_set(table, EINA_TRUE); + evas_object_size_hint_align_set(table, 0.5, EVAS_HINT_FILL); + elm_object_content_set(sc, table); + evas_object_show(table); + + for (i = 0; i < 15; i++) + { + for (j = 0; j < 15; j++) + { + btn = elm_button_add(table); + elm_object_text_set(btn, "scroller"); + elm_table_pack(table, btn, i, j, 1, 1); + evas_object_show(btn); + } + } + + return sc; +} diff --git a/src/slider.c b/src/slider.c new file mode 100644 index 0000000..2403b7b --- /dev/null +++ b/src/slider.c @@ -0,0 +1,98 @@ +#include "main.h" +#include "util.h" + + +char *_sl_styles[] = +{ + "default", + "progress", + NULL +}; + +static Evas_Object *sl; +static Eina_Bool ck1, ck2, ck3; + +static void _cb_changed(void *data, Evas_Object *obj, void *event_info) +{ + int val = (int) data; + if (val == 1) { + elm_slider_inverted_set(sl, ck1); + } + else if (val == 2) { + elm_slider_indicator_show_set(sl, !ck2); + } + else if (val == 3) { + elm_slider_indicator_show_on_focus_set(sl, ck3); + } +} + +static void +_sl_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *sl = data; + const char *txt = elm_object_item_text_get(event_info); + + elm_object_style_set(sl, txt); + + _cb_changed((void *) 1, NULL, NULL); + _cb_changed((void *) 2, NULL, NULL); + _cb_changed((void *) 3, NULL, NULL); +} + +void slider_del_cb(void *data) +{ + appdata *ad = data; + evas_object_smart_callback_del(ad->style_hov, "selected", _sl_selected); +} + +Evas_Object *slider_cb(void *data) +{ + Evas_Object *wbox, *obox, *table, *slider, *ck; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + slider = elm_slider_add(wbox); + elm_slider_indicator_format_set(slider, "%02.0f"); + elm_object_text_set(slider, "0"); + elm_slider_unit_format_set(slider, "%1.0f "); + elm_slider_min_max_set(slider, 0, 100); + evas_object_show(slider); + + table = widget_min_set(slider, wbox, ELM_SCALE_SIZE(400), ELM_SCALE_SIZE(50)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + evas_object_show(table); + elm_box_pack_end(wbox, table); + + sl = slider; + evas_object_smart_callback_add(ad->style_hov, "selected", _sl_selected, sl); + + // option box + ck = elm_check_add(obox); + elm_object_text_set(ck, " Invert"); + elm_check_state_pointer_set(ck, &ck1); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)1); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Disable Indicator"); + elm_check_state_pointer_set(ck, &ck2); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)2); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + ck = elm_check_add(obox); + elm_object_text_set(ck, " Indicator on Focus"); + elm_check_state_pointer_set(ck, &ck3); + evas_object_smart_callback_add(ck, "changed", _cb_changed, (void *)3); + evas_object_show(ck); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(obox, ck); + + return table; +} diff --git a/src/spinner.c b/src/spinner.c new file mode 100644 index 0000000..b90f27b --- /dev/null +++ b/src/spinner.c @@ -0,0 +1,19 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *spinner_cb(void *data) +{ + Evas_Object *wbox, *spinner; + appdata *ad = data; + + wbox = ad->widget_box; + + spinner = elm_spinner_add(wbox); + evas_object_size_hint_align_set(spinner, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(spinner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(spinner); + elm_box_pack_end(wbox, spinner); + + return spinner; +} diff --git a/src/toolbar.c b/src/toolbar.c new file mode 100644 index 0000000..0ec56ee --- /dev/null +++ b/src/toolbar.c @@ -0,0 +1,25 @@ +#include "main.h" +#include "util.h" + + +Evas_Object *toolbar_cb(void *data) +{ + Evas_Object *wbox, *toolbar; + appdata *ad = data; + + wbox = ad->widget_box; + + toolbar = elm_toolbar_add(wbox); + + elm_toolbar_item_append(toolbar, NULL, "Item1", NULL, NULL); + elm_toolbar_item_append(toolbar, NULL, "Item2", NULL, NULL); + elm_toolbar_item_append(toolbar, NULL, "Item3", NULL, NULL); + + evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(toolbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + evas_object_show(toolbar); + elm_box_pack_end(wbox, toolbar); + + return toolbar; +} diff --git a/src/tooltip.c b/src/tooltip.c new file mode 100644 index 0000000..7d05ce3 --- /dev/null +++ b/src/tooltip.c @@ -0,0 +1,73 @@ +#include "main.h" +#include "util.h" + + +static void _btn_focus_cb(void *data, Evas_Object *obj, void *event_info ) +{ + printf("signal : %s\n", (char*)event_info); +} + +static void _btn_unfocus_cb(void *data, Evas_Object *obj, void *event_info ) +{ + printf("signal : %s\n", (char*)event_info); + elm_object_tooltip_hide(obj); +} + +static void +_selected(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *bt = data; + const char *txt = elm_object_item_text_get(event_info); + elm_object_text_set(obj, txt); + + if (!strcmp(txt, "Top")) + { + elm_object_tooltip_orient_set(bt, ELM_TOOLTIP_ORIENT_TOP); + elm_object_tooltip_text_set(bt, "Top Tooltip"); + } + else if (!strcmp(txt, "Bottom")) + { + elm_object_tooltip_orient_set(bt, ELM_TOOLTIP_ORIENT_BOTTOM); + elm_object_tooltip_text_set(bt, "Bottom Tooltip"); + } +} + +void tooltip_del_cb(void *data) +{ +} + +Evas_Object *tooltip_cb(void *data) +{ + Evas_Object *wbox, *obox, *bt, *table, *hov; + appdata *ad = data; + + wbox = ad->widget_box; + obox = ad->option_box; + + // widget box + bt = elm_button_add(wbox); + elm_object_text_set(bt, "Mouse over to show tooltip"); + elm_object_tooltip_text_set(bt, "Top Tooltip"); + elm_object_tooltip_orient_set(bt, ELM_TOOLTIP_ORIENT_TOP); + evas_object_show(bt); + elm_box_pack_end(wbox, bt); + evas_object_smart_callback_add(bt, "focused", _btn_focus_cb, bt); + evas_object_smart_callback_add(bt, "unfocused", _btn_unfocus_cb, bt); + + // option box + hov = elm_hoversel_add(obox); + elm_hoversel_hover_parent_set(hov, ad->win); + elm_object_text_set(hov, "Top"); + evas_object_show(hov); + elm_hoversel_item_add(hov, "Top", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hov, "Bottom", NULL, ELM_ICON_NONE, NULL, NULL); + evas_object_smart_callback_add(hov, "selected", _selected, bt); + + table = widget_min_set(hov, obox, ELM_SCALE_SIZE(250), ELM_SCALE_SIZE(50)); + evas_object_event_callback_add(table, EVAS_CALLBACK_DEL, table_del_cb, NULL); + evas_object_show(table); + elm_box_pack_end(obox, table); + evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + return bt; +} diff --git a/src/util.c b/src/util.c new file mode 100644 index 0000000..784ccc5 --- /dev/null +++ b/src/util.c @@ -0,0 +1,110 @@ +#include "util.h" + +/***************** Evas helper functions *******************************/ +/** +* @fn create_image +* @brief This function return the object of the image. +* +* @param [in] parent +* @param [in] path +* @param [in] group +* +* @param [out] Return the image object +*/ +Evas_Object *create_image(Evas_Object *parent, char *path, char *group) +{ + Evas_Object *img; + img = elm_image_add(parent); + elm_image_file_set(img, path, group); + evas_object_show(img); + + return img; +} + +/** +* @fn add separater +* @brief This function return the object of the separater. +* +* @param [in] parent +* @param [in] box +* @param [in] horizontal +* +* @param [out] Return the separator object +*/ +Evas_Object *add_separator(Evas_Object *parent, Evas_Object *box, Eina_Bool horizontal) +{ + Evas_Object *sp = elm_separator_add(parent); + elm_separator_horizontal_set(sp, horizontal); // by default, separator is vertical, we must set it horizontal + elm_box_pack_end(box, sp); + evas_object_show(sp); + + return sp; +} + +/** +* @fn create widget_min_set +* @brief This function create the object of the table. +* +* @param [in] obj +* @param [in] parent +* @param [in] coordinate w +* @param [in] coordinate h +* +* @param [out] Return the table object +*/ +Evas_Object *widget_min_set(Evas_Object *obj, Evas_Object *parent, Evas_Coord w, Evas_Coord h) +{ + Evas_Object *table, *rect; + + table = elm_table_add(parent); + + rect = evas_object_rectangle_add(evas_object_evas_get(table)); + evas_object_size_hint_min_set(rect, w, h); + evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(table, rect, 0, 0, 1, 1); + + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_table_pack(table, obj, 0, 0, 1, 1); + + return table; +} + +/** +* @fn create getKey +* @brief This function return the object of the key. +* +* @param [in] obj +* +* @param [out] Return the key object +*/ +char *getKey(KEY_TYPE kt) +{ + static char *keys[] = + { + "XF86Back", + "Escape" + }; + + return keys[kt]; +} + +/** +* @fn create get_format +* @brief This function return the length of string. +* +* @param [in] format +* @param [in] value +* +* @param [out] Return the string +*/ + +char *get_format(char *format, char *value) +{ + int len = strlen(format) + strlen(value); + char *str = (char *)malloc(len+1); + sprintf(str, format, value); + + return str; +} diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..42faf71 --- /dev/null +++ b/src/util.h @@ -0,0 +1,68 @@ +#ifndef ELM_PLUGIN_UTIL_H +#define ELM_PLUGIN_UTIL_H + +#include <Elementary.h> + +#define D_LOG fprintf(stderr, "FILE: %s, LINE: %d, Function: %s\n", \ + __FILE__, __LINE__, __FUNCTION__) + +/*******************Evas Util functions*************************/ +/** +* @fn create_image +* @brief This function return the object of the image. +* +* @param [in] parent +* @param [in] path +* @param [in] group +* +* @param [out] Return the image object +*/ +Evas_Object *create_image(Evas_Object *, char *, char *); + +/** +* @fn add separater +* @brief This function return the object of the separater. +* +* @param [in] parent +* @param [in] box +* @param [in] horizontal +* +* @param [out] Return the separator object +*/ + +Evas_Object *add_separator(Evas_Object *parent, Evas_Object *box, Eina_Bool horizontal); + +/** +* @fn create widget_min_set +* @brief This function create the object of the table. +* +* @param [in] obj +* @param [in] parent +* @param [in] coordinate w +* @param [in] coordinate h +* +* @param [out] Return the table object +*/ +Evas_Object *widget_min_set(Evas_Object *obj, Evas_Object *parent, Evas_Coord w, Evas_Coord h); +/***************************************************************/ + +/*********************** Key event function ************************/ +typedef enum _KEY_TYPE +{ + RETURN_KEY, + ESCAPE_KEY, +}KEY_TYPE; + +/** +* @fn create getKey +* @brief This function return the object of the key. +* +* @param [in] obj +* +* @param [out] Return the key object +*/ +char *getKey(KEY_TYPE); + +/****************************************************************/ + +#endif |