From 2d62434325d217c8c69ea43e104e7f497ee1ff5d Mon Sep 17 00:00:00 2001 From: Jeonghyun Yun Date: Fri, 15 Jun 2018 05:26:14 +0000 Subject: Revert "csharp: refactoring edc for elm-sharp-theme mobile" This reverts commit 2132efdabd0650d4ad7615c35b439a7bd236016a. Change-Id: I1987e8a2334c0be18e38fb7e31649bb8d178f2cc --- mobile/Makefile.am | 9 + mobile/color_classes.edc | 14 + mobile/elm-sharp-theme-mobile.edc | 83 +++++- mobile/widgets_csharp/radio.edc | 537 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 630 insertions(+), 13 deletions(-) create mode 100644 mobile/widgets_csharp/radio.edc diff --git a/mobile/Makefile.am b/mobile/Makefile.am index 95840111..7e9f9c56 100644 --- a/mobile/Makefile.am +++ b/mobile/Makefile.am @@ -34,6 +34,15 @@ all: -id ./HD/images/Old\ $(DEFAULT_SRC).edc $(DEFAULT_SRC).edj; edje_cc $(EDJE_FLAGS) $(EDJE_FLAGS_$(V)) \ + -id default/images/tizen-hd -sd default/sounds -fd ../objects \ + -id ./HD/images/\ + -id ./HD/images/Navigation_elements\ + -id ./HD/images/Presentation_views\ + -id ./HD/images/User_Input_Elements\ + -id ./HD/images/Assist_Views\ + -id ./HD/images/Copy_Paste\ + -id ./HD/images/Emoticon\ + -id ./HD/images/Old\ $(CSHARP_SRC)-mobile.edc $(CSHARP_SRC).edj; diff --git a/mobile/color_classes.edc b/mobile/color_classes.edc index 54bda077..063ea973 100644 --- a/mobile/color_classes.edc +++ b/mobile/color_classes.edc @@ -1382,6 +1382,20 @@ color_classes { color_class { "layout/searchfield/bg"; color: 250 250 250 255; } + // ********* CSharp Specific color_classes ********// + color_class { + name: "layout/background/bg"; + color: 0 0 0 0; + } + color_class { + name: "layout/background/opacity"; // Csharp Opacity Property + color: 255 255 255 255; + } + color_class { + name: "layout/elm_widget/opacity"; // Csharp Opacity Property + color: 255 255 255 255; + } + // ************************************************// /* * List diff --git a/mobile/elm-sharp-theme-mobile.edc b/mobile/elm-sharp-theme-mobile.edc index 609b09d0..b3780488 100644 --- a/mobile/elm-sharp-theme-mobile.edc +++ b/mobile/elm-sharp-theme-mobile.edc @@ -38,10 +38,12 @@ // Do not define size(width, height) in here!!!! //****************************************************************************************// -#define BASE_SCALE_INC 2.6 +// Include INC (e.g. HD-inc.edc, HVGA-inc.edc for each resolution) file +#include "HD-inc.edc" externals { external: "elm"; + external: "feedback"; } // BUILD_FIX: Add version to edc as 110. @@ -50,23 +52,78 @@ data.item: "version" "119"; collections { base_scale: BASE_SCALE_INC; + plugins { + plugin { + name: "touch_sound"; + source: "feedback"; + param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_TAP"; // FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TOUCH_TAP - color_classes { - color_class { - name: "layout/background/bg"; - color: 0 0 0 0; - } - color_class { - name: "layout/background/opacity"; - color: 255 255 255 255; - } - color_class { - name: "layout/elm_widget/opacity"; - color: 255 255 255 255; + /* 2014.06.11 updated from libsvi(feedback) + Above plugin will run below external function: + int feedback_play_type(feedback_type_e type, feedback_pattern_e pattern); + + param1: feedback_type_e + FEEDBACK_TYPE_NONE = 0, + FEEDBACK_TYPE_SOUND = 1, + FEEDBACK_TYPE_VIBRATION, + FEEDBACK_TYPE_LED, + FEEDBACK_TYPE_END + + * param2 enumeration: + FEEDBACK_PATTERN_TAP = 0, + FEEDBACK_PATTERN_SIP, + FEEDBACK_PATTERN_SIP_BACKSPACE, + FEEDBACK_PATTERN_SIP_FUNCTION, + FEEDBACK_PATTERN_SIP_FJKEY, + ... + + * For more information please refer libsvi. + */ } } +#include "color_classes.edc" + +#include "widgets/bg.edc" +#include "widgets/button.edc" +#include "widgets/calendar.edc" +#include "widgets/conform.edc" +#include "widgets/ctxpopup.edc" +#include "widgets/flipselector.edc" +#include "widgets/focus_highlight.edc" +#include "widgets/genlist.edc" +#include "widgets/label.edc" +#include "widgets/layout.edc" +#include "widgets/naviframe.edc" +#include "widgets/scroller.edc" +#include "widgets/panel.edc" +#include "widgets/toolbar.edc" +#include "widgets/gengrid.edc" +#include "widgets/entry.edc" +#include "widgets/slider.edc" +#include "widgets/spinner.edc" +#include "widgets/datetime.edc" +#include "widgets/colorselector.edc" +#include "widgets/progressbar.edc" +#include "widgets/check.edc" +//#include "widgets/radio.edc" +#include "widgets/index.edc" +#include "widgets/popup.edc" +#include "widgets/multibuttonentry.edc" +#include "widgets/win.edc" +#include "widgets/hover.edc" +#include "widgets/list.edc" +#include "widgets/floatingbutton.edc" +#include "widgets/border.edc" + +#include "widgets_csharp/radio.edc" #include "widgets_csharp/layout.edc" + color_classes { + color_class { + name: "transparent"; + color: 0 0 0 0; + } + } } diff --git a/mobile/widgets_csharp/radio.edc b/mobile/widgets_csharp/radio.edc new file mode 100644 index 00000000..22fe105d --- /dev/null +++ b/mobile/widgets_csharp/radio.edc @@ -0,0 +1,537 @@ +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +group { "elm/radio/event/default"; + inherit_only: 1; + parts { + rect { "event"; + mouse; + desc { "default"; + color: 0 0 0 0 ; + rel.to: "base"; + } + desc { "disabled"; + inherit: "default"; + hid; + } + } + } + programs { + program { "clicked"; + signal: "mouse,clicked,1"; + source: "event"; + action: SIGNAL_EMIT "elm,action,click" ""; + after: "on_clicked"; + } + program { "pressed"; + signal: "mouse,down,1*"; + source: "event"; + action: SIGNAL_EMIT "elm,action,press" ""; + after: "on_pressed"; + } + program { "unpressed"; + signal: "mouse,up,1"; + source: "event"; + action: SIGNAL_EMIT "elm,action,unpress" ""; + after: "on_unpressed"; + } + program { "set_radio"; + signal: "elm,state,radio,on"; + source: "elm"; + after: "on_set_radio"; + } + program { "unset_radio"; + signal: "elm,state,radio,off"; + source: "elm"; + after: "on_unset_radio"; + } + program { "disabled"; + signal: "elm,state,disabled"; + source: "elm"; + after: "on_disabled"; + } + program { "enabled"; + signal: "elm,state,enabled"; + source: "elm"; + after: "on_enabled"; + } + program { "enable_event_pass"; + signal: "elm,event,pass,enabled"; + source: "elm"; + script { + set_mouse_events(PART:"event", 0); + } + } + program { "disable_event_pass"; + signal: "elm,event,pass,disabled"; + source: "elm"; + script { + set_mouse_events(PART:"event", 1); + } + } + program { "enable_event_repeat"; + signal: "elm,event,repeat,enabled"; + source: "elm"; + script { + set_repeat_events(PART:"event", 1); + } + } + program { "disable_event_repeat"; + signal: "elm,event,repeat,disabled"; + source: "elm"; + script { + set_repeat_events(PART:"event", 0); + } + } + } +} +group { "elm/radio/base/template"; + parts { + spacer { "base"; + desc { "default"; + } + } + } + inherit: "elm/radio/event/default"; + programs { + program { "on_clicked"; + } + program { "on_pressed"; + } + program { "on_unpressed"; + } + program { "on_disabled"; + } + program { "on_enabled"; + } + program { "on_set_radio"; + } + program { "on_unset_radio"; + } + } +} +group { "elm/radio/base/default"; + images{ + vector: core_radio_stroke.svg; + vector: core_radio_icon.svg; + vector: core_radio_bg_01.svg; + vector: core_radio_bg_02.svg; + vector: core_radio_white_bg.svg; + } + nomouse; + target_group: "vector_group" "clipper_bg_vector" "clipper_icon" "clipper_icon_inner" "clipper_icon_outer" "clipper_icon_stroke"; + parts { + spacer { "base"; + scale; + desc { "default"; + min: RADIO_DEFAULT_SIZE_INC; + } + } + //bg shape + vector { "bg_vector"; + scale; + clip: "clipper_bg_vector"; + desc { "default"; + image.normal: "core_radio_white_bg.svg"; + min: RADIO_DEFAULT_SIZE_INC; + rel1.relative: 0 0.5; + rel2.relative: 0 0.5; + align: 0 0.5; + fixed: 1 1; + } + } + rect { "clipper_bg_vector"; + desc { "default"; + color_class: "radio/default/bg"; + } + desc { "on"; + color_class: "radio/default/bg_border_on"; + } + desc { "off"; + inherit: "default"; + } + desc { "disabled_on"; + color_class: "radio/default/bg_border_on_disabled"; + } + desc { "disabled_off"; + color_class: "radio/default/bg_disabled"; + } + } + vector { "icon"; + scale; + clip: "clipper_icon"; + desc { "default"; + image.normal: "core_radio_icon.svg"; + rel1.to: "bg_vector"; + rel2.to: "bg_vector"; + } + } + rect { "clipper_icon"; + desc { "default"; + color: 250 250 250 0; + } + desc { "on"; + color_class: "radio/default/bg_on" ; + } + desc { "off"; + inherit: "default"; + } + desc { "disabled_off"; + inherit: "default"; + } + desc { "disabled_on"; + color_class: "radio/default/bg_on_disabled" ; + } + } + vector { "icon_inner"; + scale; + clip: "clipper_icon_inner"; + desc { "default"; + image.normal: "core_radio_bg_01.svg"; + rel.to: "bg_vector"; + } + } + rect { "clipper_icon_inner"; + desc { "default"; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + rel.to: "bg_vector"; + } + desc { "on"; + rel.to: "bg_vector"; + color_class: "radio/default/icon"; + } + desc { "off"; + inherit: "default"; + } + desc { "disabled_off"; + inherit: "default"; + } + desc { "disabled_on"; + rel.to: "bg_vector"; + color_class: "radio/default/icon_disabled"; + } + } + vector { "icon_outer"; + scale; + clip: "clipper_icon_outer"; + desc { "default"; + image.normal: "core_radio_bg_02.svg"; + rel1.to: "bg_vector"; + rel2.to: "bg_vector"; + } + } + rect { "clipper_icon_outer"; + desc { "default"; + color: 61 185 204 0; + } + desc { "on"; + color_class: "radio/default/icon"; + } + desc { "off"; + inherit: "default"; + } + desc { "disabled_off"; + inherit: "default"; + } + desc { "disabled_on"; + color_class: "radio/default/icon_disabled"; + } + } + vector { "icon_stroke"; + scale; + clip: "clipper_icon_stroke"; + desc { "default"; + image.normal: "core_radio_stroke.svg"; + rel1.to: "bg_vector"; + rel2.to: "bg_vector"; + } + } + rect { "clipper_icon_stroke"; + desc { "default"; + color_class: "radio/default/stroke"; + } + desc { "on"; + color: 61 185 204 0; + } + desc { "off"; + inherit: "default"; + } + desc { "disabled_off"; + color_class: "radio/default/stroke_disabled"; + } + desc { "disabled_on"; + inherit: "on"; + } + } + spacer { "padding_before_text"; + scale; + desc { "default"; + align: 0.0 0.5; + min: 0 0; + rel1 { + to: "bg_vector"; + relative: 1.0 0.0; + } + rel2 { + to: "bg_vector"; + relative: 1.0 1.0; + } + } + desc { "visible"; + inherit: "default" 0.0; + min: RADIO_PAD_BEFORE_TEXT_INC; + fixed: 1 1; + } + } + textblock { "elm.text"; + scale; + desc { "default"; + hid; + fixed: 0 1; + rel1 { + relative: 1.0 0.5; + to_x: "padding_before_text"; + } + rel2 { + relative: 1.0 0.5; + } + align: 0.0 0.5; + text { + style: "radio_default"; + min: 0 0; + } + } + desc { "visible"; + inherit: "default" 0.0; + vis; + text.min: 0 1; + } + desc { "disabled"; + inherit: "default" 0.0; + vis; + text { + style: "radio_default_dim"; + min: 0 1; + } + } + desc { "pressed"; + inherit: "default" 0.0; + vis; + text { + style: "radio_default_press"; + min: 0 1; + } + } + } + } + inherit: "elm/radio/event/default"; + script { + public radio_state; + public disabled; + public text; + public animate = 0; + } + programs { + program { "on_clicked"; + script { + if (get_int(disabled) == 1) return; + emit("elm,action,radio,toggle", ""); + run_program(PROGRAM:"touch_sound"); + } + } + program { "on_pressed"; + script { + if (get_int(disabled) == 1) return; + if (get_int(text) == 1) { + set_state(PART:"elm.text", "pressed", 0.0); + } + } + } + program { "on_unpressed"; + script { + if (get_int(disabled) == 1) return; + if (get_int(radio_state) == 1) { + run_program(PROGRAM:"toggle_on_without_effect"); + }else { + run_program(PROGRAM:"toggle_off_without_effect"); + } + if (get_int(text) == 1) { + set_state(PART:"elm.text", "visible", 0.0); + } + } + } + program { "on_disabled"; + script { + set_int(disabled, 1); + if (get_int(radio_state) == 1) { + run_program(PROGRAM:"toggle_disabled_on_without_effect"); + }else { + run_program(PROGRAM:"toggle_disabled_off_without_effect"); + } + if (get_int(text) == 1) { + set_state(PART:"elm.text", "disabled", 0.0); + } + } + } + program { "on_enabled"; + script { + set_int(disabled, 0); + if (get_int(radio_state) == 1) { + run_program(PROGRAM:"toggle_on_without_effect"); + } else { + run_program(PROGRAM:"toggle_off_without_effect"); + } + if (get_int(text) == 1) { + set_state(PART:"elm.text", "visible", 0.0); + } + } + } + program { "on_set_radio"; + script { + if (get_int(disabled) == 1) { + if (get_int(animate) == 0) { + run_program(PROGRAM:"toggle_disabled_on_without_effect"); + } else { + run_program(PROGRAM:"toggle_disabled_on_with_effect"); + } + }else { + if (get_int(animate) == 0) { + run_program(PROGRAM:"toggle_on_without_effect"); + emit("elm,radio,state,toggle", "tizen_vg"); + } else { + run_program(PROGRAM:"toggle_on_with_effect"); + emit("elm,radio,action,toggle", "tizen_vg"); + } + } + set_int(animate, 0); + set_int(radio_state, 1); + } + } + program { "on_unset_radio"; + script { + if (get_int(disabled) == 1) { + if (get_int(animate) == 0) { + run_program(PROGRAM:"toggle_disabled_off_without_effect"); + } else { + run_program(PROGRAM:"toggle_disabled_off_with_effect"); + } + }else { + if (get_int(animate) == 0) { + run_program(PROGRAM:"toggle_off_without_effect"); + emit("elm,radio,state,toggle", "tizen_vg"); + } else { + run_program(PROGRAM:"toggle_off_with_effect"); + emit("elm,radio,action,toggle", "tizen_vg"); + } + } + set_int(animate, 0); + set_int(radio_state, 0); + } + } + program { "touch_sound"; + action: RUN_PLUGIN "touch_sound"; + } + program { "activate_animate_radio"; + signal: "elm,activate,radio,on"; + source: "elm"; + script { + set_int(animate, 1); + } + } + program { "deactivate_animate_radio"; + signal: "elm,activate,radio,off"; + source: "elm"; + script { + set_int(animate, 1); + } + } + program { "toggle_on_with_effect"; + action: STATE_SET "on"; + transition: DECELERATE 0.3; + target_groups: "vector_group"; + after: "finished_animation"; + } + program { "toggle_off_with_effect"; + action: STATE_SET "default"; + target_groups: "vector_group"; + transition: DECELERATE 0.3; + after: "finished_animation"; + } + program { "toggle_disabled_on_with_effect"; + action: STATE_SET "disabled_on"; + target_groups: "vector_group"; + transition: DECELERATE 0.3; + after: "finished_animation"; + } + program { "toggle_disabled_off_with_effect"; + action: STATE_SET "disabled_off"; + target_groups: "vector_group"; + transition: DECELERATE 0.3; + after: "finished_animation"; + } + program { "toggle_on_without_effect"; + action: STATE_SET "on"; + target_groups: "vector_group"; + } + program { "toggle_off_without_effect"; + action: STATE_SET "default"; + target_groups: "vector_group"; + } + program { "toggle_disabled_on_without_effect"; + action: STATE_SET "disabled_on"; + target_groups: "vector_group"; + } + program { "toggle_disabled_off_without_effect"; + action: STATE_SET "disabled_off"; + target_groups: "vector_group"; + } + program { "finished_animation"; + action: SIGNAL_EMIT "animation,finished" ""; + } + program { "visible_text"; + signal: "elm,state,text,visible"; + source: "elm"; + script { + set_int(text, 1); + set_state(PART:"padding_before_text", "visible", 0.0); + if (get_int(disabled) == 1) { + set_state(PART:"elm.text", "disabled", 0.0); + }else { + set_state(PART:"elm.text", "visible", 0.0); + } + } + } + program { "hidden_text"; + signal: "elm,state,text,hidden"; + source: "elm"; + script { + set_int(text, 0); + set_state(PART:"padding_before_text", "default", 0.0); + set_state(PART:"elm.text", "default", 0.0); + } + } + } +} -- cgit v1.2.3