--- /dev/null
+/*
+ * Copyright (c) 2011 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.
+ *
+ */
+
+#define GENGRID_PART_BG_COLOR_INC 0 0 0 0
+#define GENGRID_PART_REORDER_DEFAULT_BG_COLOR_INC 0 0 0 77
+#define GENGRID_PART_BACKGROUND_COLOR_INC 0 0 0 0
+#define GENGRID_DEFAULT_LEFT_TOP_PADDING_INC 8 3
+#define GENGRID_DEFAULT_RIGHT_BOTTOM_PADDING_INC 8 3
+#define GENGRID_DEFAULT_ITEM_BG_LEFT_TOP_PADDING_INC 1 1
+#define GENGRID_DEFAULT_ITEM_BG_RIGHT_BOTTOM_PADDING_INC 1 1
+#define GENGRID_DEFAULT_ITEM_REAL_BG_RIGHT_PADDING_INC 0 0
+#define GENGRID_DEFAULT_LEFT_TOP_FOCUS_PADDING_INC 5 0
+#define GENGRID_DEFAULT_RIGHT_BOTTOM_FOCUS_PADDING_INC 5 2
+
+#define GENGRID_PROGRAM_DEFAULT( TARGET ) \
+ program { name: "default"; \
+ signal: "elm,state,default"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "focus_bg"; \
+ TARGET \
+ } \
+
+collections {
+ base_scale: 1.8;
+
+ styles {
+ style { name: "gengrid_myfile_in_text_style";
+ base: "font=Tizen:style=Bold font_size="34" color=#3e3e40 color_class=T060E align=center wrap=mixed ellipsis=1.0 text_class=T060E";
+ tag: "br" "\n";
+ tag: "ps" "ps";
+ tag: "tab" "\t";
+ tag: "b" "+ font_weight=Bold";
+ }
+ }
+
+ group { name: "elm/gengrid/item/ise/customized_default_style_port2/default";
+ data.item: "texts" "elm.text";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image : "images/gengrid/handwriting_emoticon_pressed.png" COMP;
+ image : "images/gengrid/00_thumbs_loading_bg.png" COMP;
+ }
+ script {
+ public downed;
+ public movement;
+ public highlight_timer;
+ public focus_off(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "default", 0.0);
+ }
+ public focus_mouse_down(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "enabled", 0.0);
+ }
+ public focus_mouse_up(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "default", 0.0);
+ }
+ public select_mouse_down(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"select_clip", "selected", 0.0);
+ }
+ public select_mouse_up(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"select_clip", "default", 0.0);
+ }
+ }
+
+ parts {
+ part { name: "select_clip";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "selected" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "bg";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ color: GENGRID_PART_BACKGROUND_COLOR_INC;
+ }
+ }
+ part { name: "left_top_padding";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_LEFT_TOP_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_RIGHT_BOTTOM_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "item_bg";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "right_bottom_padding";
+ }
+ }
+ }
+ part { name: "item_bg_left_top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_BG_LEFT_TOP_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "item_bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_bg";
+ }
+ }
+ }
+ part { name: "item_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_BG_RIGHT_BOTTOM_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_bg";
+ }
+ rel2.to: "item_bg";
+ }
+ }
+ part { name: "item_real_bg";
+ type: IMAGE;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_bg_right_bottom_padding";
+ }
+ image.normal: "images/gengrid/00_thumbs_loading_bg.png";
+ }
+ }
+ part { name: "item_real_bg_left_top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_REAL_BG_RIGHT_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "item_real_bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_real_bg";
+ }
+ }
+ }
+ part { name: "item_real_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_REAL_BG_RIGHT_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_real_bg";
+ }
+ rel2.to: "item_real_bg";
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 48;
+ align: 0.5 1.0;
+ text {
+ style: "gengrid_myfile_in_text_style";
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_real_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_real_bg_right_bottom_padding";
+ }
+ }
+ }
+ part { name: "reorder_bg";
+ type: RECT;
+ scale : 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: GENGRID_PART_BG_COLOR_INC;
+ rel1.to: "item_bg";
+ rel2.to: "item_bg";
+ }
+ description { state: "enabled" 0.0;
+ inherit: "default" 0.0;
+ color: GENGRID_PART_REORDER_DEFAULT_BG_COLOR_INC;
+ }
+ }
+ part { name: "focus_bg_left_top_padding";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_LEFT_TOP_FOCUS_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "focus_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_RIGHT_BOTTOM_FOCUS_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "focus_bg";
+ type: IMAGE;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "focus_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "focus_bg_right_bottom_padding";
+ }
+ image.normal: "images/gengrid/handwriting_emoticon_pressed.png";
+ image.border: 3 3 3 6;
+ }
+ description { state: "enabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "touch_snd";
+ signal: "touch_snd,1";
+ source: "elm";
+ }
+
+ program { name: "go_reorder_disabled";
+ signal: "elm,state,reorder,disabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "reorder_bg";
+ target: "focus_bg";
+ transition: ACCELERATE 0.3;
+ }
+ program { name: "go_reorder_enabled";
+ signal: "elm,state,reorder,enabled";
+ source: "elm";
+ action: STATE_SET "enabled" 0.0;
+ target: "reorder_bg";
+ target: "focus_bg";
+ transition: DECELERATE 0.3;
+ }
+ program { name: "selected";
+ signal: "elm,state,selected";
+ source: "elm";
+ script {
+ set_state(PART:"focus_bg", "enabled", 0.0);
+ set_int(highlight_timer, timer(0.3, "focus_off", 1));
+ }
+ after: "touch_snd";
+ }
+ program { name: "unselected";
+ signal: "elm,state,unselected";
+ source: "elm";
+ script {
+ set_state(PART:"focus_bg", "default", 0.0);
+ if (get_int(highlight_timer)) {
+ cancel_timer(get_int(highlight_timer));
+ }
+ }
+ }
+ GENGRID_PROGRAM_DEFAULT(
+ target: "item_bg";
+ target: "item_real_bg";
+ target: "elm.swallow.icon";
+ )
+ }
+
+ }
+
+#define GENGRID_DEFAULT_LEFT_TOP_PADDING_LAND_INC 6 2
+#define GENGRID_DEFAULT_RIGHT_BOTTOM_PADDING_LAND_INC 6 1
+#define GENGRID_DEFAULT_LEFT_TOP_FOCUS_PADDING_LAND_INC 4 0
+#define GENGRID_DEFAULT_RIGHT_BOTTOM_FOCUS_PADDING_LAND_INC 4 0
+
+
+
+ group { name: "elm/gengrid/item/ise/customized_default_style_land2/default";
+ data.item: "texts" "elm.text";
+ data.item: "contents" "elm.swallow.icon";
+ images {
+ image : "images/gengrid/handwriting_emoticon_pressed.png" COMP;
+ image : "images/gengrid/00_thumbs_loading_bg.png" COMP;
+ }
+ script {
+ public downed;
+ public movement;
+ public highlight_timer;
+ public focus_off(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "default", 0.0);
+ }
+ public focus_mouse_down(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "enabled", 0.0);
+ }
+ public focus_mouse_up(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"focus_bg", "default", 0.0);
+ }
+ public select_mouse_down(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"select_clip", "selected", 0.0);
+ }
+ public select_mouse_up(val) {
+ if (get_int(highlight_timer))
+ cancel_timer(get_int(highlight_timer));
+ set_int(highlight_timer, 0);
+ set_state(PART:"select_clip", "default", 0.0);
+ }
+ }
+
+ parts {
+ part { name: "select_clip";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "selected" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "bg";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ color: GENGRID_PART_BACKGROUND_COLOR_INC;
+ }
+ }
+ part { name: "left_top_padding";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_LEFT_TOP_PADDING_LAND_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_RIGHT_BOTTOM_PADDING_LAND_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "item_bg";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "right_bottom_padding";
+ }
+ }
+ }
+ part { name: "item_bg_left_top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_BG_LEFT_TOP_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "item_bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_bg";
+ }
+ }
+ }
+ part { name: "item_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_BG_RIGHT_BOTTOM_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_bg";
+ }
+ rel2.to: "item_bg";
+ }
+ }
+ part { name: "item_real_bg";
+ type: IMAGE;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_bg_right_bottom_padding";
+ }
+ image.normal: "images/gengrid/00_thumbs_loading_bg.png";
+ }
+ }
+ part { name: "item_real_bg_left_top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_REAL_BG_RIGHT_PADDING_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "item_real_bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_real_bg";
+ }
+ }
+ }
+ part { name: "item_real_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_ITEM_REAL_BG_RIGHT_PADDING_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_real_bg";
+ }
+ rel2.to: "item_real_bg";
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 48;
+ align: 0.5 1.0;
+ text {
+ style: "gengrid_myfile_in_text_style";
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "item_real_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "item_real_bg_right_bottom_padding";
+ }
+ }
+ }
+ part { name: "reorder_bg";
+ type: RECT;
+ scale : 1;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: GENGRID_PART_BG_COLOR_INC;
+ rel1.to: "item_bg";
+ rel2.to: "item_bg";
+ }
+ description { state: "enabled" 0.0;
+ inherit: "default" 0.0;
+ color: GENGRID_PART_REORDER_DEFAULT_BG_COLOR_INC;
+ }
+ }
+ part { name: "focus_bg_left_top_padding";
+ type: SPACER;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_LEFT_TOP_FOCUS_PADDING_LAND_INC;
+ align: 0.0 0.0;
+ fixed: 1 1;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "focus_bg_right_bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: GENGRID_DEFAULT_RIGHT_BOTTOM_FOCUS_PADDING_LAND_INC;
+ align: 1.0 1.0;
+ fixed: 1 1;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "focus_bg";
+ type: IMAGE;
+ scale : 1;
+ description { state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "focus_bg_left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "focus_bg_right_bottom_padding";
+ }
+ image.normal: "images/gengrid/handwriting_emoticon_pressed.png";
+ image.border: 3 3 3 6;
+ }
+ description { state: "enabled" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program { name: "touch_snd";
+ signal: "touch_snd,1";
+ source: "elm";
+ }
+
+ program { name: "go_reorder_disabled";
+ signal: "elm,state,reorder,disabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "reorder_bg";
+ target: "focus_bg";
+ transition: ACCELERATE 0.3;
+ }
+ program { name: "go_reorder_enabled";
+ signal: "elm,state,reorder,enabled";
+ source: "elm";
+ action: STATE_SET "enabled" 0.0;
+ target: "reorder_bg";
+ target: "focus_bg";
+ transition: DECELERATE 0.3;
+ }
+ program { name: "selected";
+ signal: "elm,state,selected";
+ source: "elm";
+ script {
+ set_state(PART:"focus_bg", "enabled", 0.0);
+ set_int(highlight_timer, timer(0.3, "focus_off", 1));
+ }
+ after: "touch_snd";
+ }
+ program { name: "unselected";
+ signal: "elm,state,unselected";
+ source: "elm";
+ script {
+ set_state(PART:"focus_bg", "default", 0.0);
+ if (get_int(highlight_timer)) {
+ cancel_timer(get_int(highlight_timer));
+ }
+ }
+ }
+ GENGRID_PROGRAM_DEFAULT(
+ target: "item_bg";
+ target: "item_real_bg";
+ target: "elm.swallow.icon";
+ )
+ }
+
+ }
+
+ group { name: "elm/gengrid/item/ise/customized_default_style_port/default";
+ data.item: "contents" "elm.swallow.icon";
+ parts {
+ part { name: "bg";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "left_top_padding";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 12 5;
+ align: 0.0 0.0;
+ visible: 0;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "right_bottom_padding";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 12 5;
+ align: 1.0 1.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "right_bottom_padding";
+ }
+ }
+ }
+ }
+ }
+
+ group { name: "elm/gengrid/item/ise/customized_default_style_land/default";
+ data.item: "contents" "elm.swallow.icon";
+ parts {
+ part { name: "bg";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "left_top_padding";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 12 0;
+ align: 0.0 0.0;
+ visible: 0;
+ rel1.to: "bg";
+ rel2 {
+ relative: 0.0 0.0;
+ to: "bg";
+ }
+ }
+ }
+ part { name: "right_bottom_padding";
+ type: RECT;
+ scale : 1;
+ description { state: "default" 0.0;
+ min: 12 6;
+ align: 1.0 1.0;
+ visible: 0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "bg";
+ }
+ rel2.to: "bg";
+ }
+ }
+ part { name: "elm.swallow.icon";
+ type: SWALLOW;
+ scale : 1;
+ description { state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to: "left_top_padding";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to: "right_bottom_padding";
+ }
+ }
+ }
+ }
+ }
+ }
#ifdef SUPPORTS_EMOTICONS
-#include "ise-emoticon-mode.h"
-#include "ise.h"
#include <Elementary.h>
#include <algorithm>
+#include "ise-emoticon-mode.h"
+#include "ise.h"
#undef LOG_TAG
#define LOG_TAG "ISE_DEFAULT"
#include <dlog.h>
+#define EVAS_CANDIDATE_LAYER 32000
+#define ISE_WIDTH_PORT 540
+#define ISE_HEIGHT_PORT 333
+#define ISE_WIDTH_LAND 960
+#define ISE_HEIGHT_LAND 238
+
+#define EMOTICON_DIR "/usr/share/emoticons/"
+#define EMOTICON_EDJ_FILE_PATH "/usr/share/isf/ise/ise-default/720x1280/default/sdk/edc/layout_keypad.edj"
+#define CUSTOM_GENGRID_EDJ_FILE_PATH "/usr/share/isf/ise/ise-default/720x1280/default/sdk/edc/customised_gengrid.edj"
+
+#define EMOTICON_EDJ_GROUP_PORT_CANDIDATE_ON "emoticon.main.portrait.candidate.on"
+#define EMOTICON_EDJ_GROUP_LAND_CANDIDATE_ON "emoticon.main.landscape.candidate.on"
+
+#define EMOTICON_EDJ_GROUP_PORT_CANDIDATE_OFF "emoticon.main.portrait.candidate.off"
+#define EMOTICON_EDJ_GROUP_LAND_CANDIDATE_OFF "emoticon.main.landscape.candidate.off"
+
+#define EMOTICON_GENGRID_ITEM_STYLE_PORT "ise/customized_default_style_port"
+#define EMOTICON_GENGRID_ITEM_STYLE_LAND "ise/customized_default_style_land"
+
+#define EMOTICON_GENGRID_ITEM_STYLE_PORT2 "ise/customized_default_style_port2"
+#define EMOTICON_GENGRID_ITEM_STYLE_LAND2 "ise/customized_default_style_land2"
+
#define IND_NUM 20
-#define EMOTICON_ICON_WIDTH_PORT 54
-#define EMOTICON_ICON_HEIGHT_PORT 54
-#define EMOTICON_ICON_GAP_WIDTH_PORT 18
+#define EMOTICON_ICON_WIDTH_PORT 30
+#define EMOTICON_ICON_HEIGHT_PORT 30
+
+#define EMOTICON_ICON_GAP_WIDTH_PORT 12
#define EMOTICON_ICON_GAP_HEIGHT_PORT 6
#define EMOTICON_WIDTH_PORT (EMOTICON_ICON_WIDTH_PORT + EMOTICON_ICON_GAP_WIDTH_PORT)
#define EMOTICON_HEIGHT_PORT (EMOTICON_ICON_HEIGHT_PORT + EMOTICON_ICON_GAP_HEIGHT_PORT)
-#define EMOTICON_ICON_WIDTH_LAND 72
-#define EMOTICON_ICON_HEIGHT_LAND 72
+#define EMOTICON_ICON_WIDTH_LAND 30
+#define EMOTICON_ICON_HEIGHT_LAND 30
-#define EMOTICON_ICON_GAP_WIDTH_LAND 24
-#define EMOTICON_ICON_GAP_HEIGHT_LAND 6
+#define EMOTICON_ICON_GAP_WIDTH_LAND 12
+#define EMOTICON_ICON_GAP_HEIGHT_LAND 4
#define EMOTICON_WIDTH_LAND (EMOTICON_ICON_WIDTH_LAND + EMOTICON_ICON_GAP_WIDTH_LAND)
#define EMOTICON_HEIGHT_LAND (EMOTICON_ICON_HEIGHT_LAND + EMOTICON_ICON_GAP_HEIGHT_LAND)
+#define MIN_RECENT_EMOTICON_NEEDED_IN_PORT 22 // (7*3 + 1)
+#define MIN_RECENT_EMOTICON_NEEDED_IN_LAND 27 // (13*2 + 1)
+
#define MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS (EMOTICON_GROUP_1_NUM > EMOTICON_GROUP_2_NUM ? (EMOTICON_GROUP_1_NUM > EMOTICON_GROUP_3_NUM ? EMOTICON_GROUP_1_NUM : EMOTICON_GROUP_3_NUM) : (EMOTICON_GROUP_2_NUM > EMOTICON_GROUP_3_NUM ? EMOTICON_GROUP_2_NUM : EMOTICON_GROUP_3_NUM))
#define MAX_SIZE_AMONG_EMOTICON_GROUPS (EMOTICON_GROUP_4_NUM > EMOTICON_GROUP_5_NUM ? (EMOTICON_GROUP_4_NUM > MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS ? EMOTICON_GROUP_4_NUM : MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS) : (EMOTICON_GROUP_5_NUM > MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS ? EMOTICON_GROUP_5_NUM : MAX_SIZE_AMONG_FIRST_3_EMOTICON_GROUPS))
-#define EMOTION_SCREEN_WIDTH 540
-#define EMOTION_SCREEN_HEIGHT 960
-#define EMOTION_ITEM_LEFT_MARGIN 27
-#define EMOTION_ITEM_TOP_MARGIN 9
-#define EMOTION_SCROLLER_WIDTH 540
-#define EMOTION_SCROLLER_HEIGHT 234
-static double g_screen_width_rate = 0;
-static double g_screen_height_rate = 0;
-static bool is_emoticon_mode = false;
+bool is_emoticon_mode = false;
emoticon_group_t current_emoticon_group = EMOTICON_GROUP_RECENTLY_USED;
std::vector <int> emoticon_list_recent;
bool is_recently_used_emoticon_mode_disabled = true;
+
extern int * emoticon_list[];
unsigned short int emoticon_group_items[MAX_EMOTICON_GROUP] =
{
- EMOTICON_GROUP_RECENTLY_USED_NUM,
- EMOTICON_GROUP_1_NUM,
- EMOTICON_GROUP_2_NUM,
- EMOTICON_GROUP_3_NUM,
- EMOTICON_GROUP_4_NUM,
- EMOTICON_GROUP_5_NUM
+ EMOTICON_GROUP_RECENTLY_USED_NUM,
+ EMOTICON_GROUP_1_NUM,
+ EMOTICON_GROUP_2_NUM,
+ EMOTICON_GROUP_3_NUM,
+ EMOTICON_GROUP_4_NUM,
+ EMOTICON_GROUP_5_NUM
};
struct emoticon_item_t
{
- Elm_Object_Item *item;
- int code;
- std::string path;
- Eina_Unicode keyevent;
+ Elm_Object_Item *item;
+ int code;
+ std::string path;
+ Eina_Unicode keyevent;
};
emoticon_item_t emoticon_items[MAX_SIZE_AMONG_EMOTICON_GROUPS] = {{0,},};
-static Evas_Object *g_main_window = NULL;
-static Evas_Object *scroller = NULL;
+// Static variable declarations
static Evas_Object *layout = NULL;
static Evas_Object *gengrid = NULL;
static Elm_Theme *theme = NULL;
static Elm_Gengrid_Item_Class *gic = NULL;
-// Function declarations
+// Static Function declarations
static void __ise_emoticon_create_gengrid(unsigned short int screen_degree);
static void __ise_emoticon_append_items_to_gengrid(emoticon_group_t emoticon_group);
+static void __ise_emoticon_create_item_class(unsigned short int screen_degree);
+#if SUPPORTS_EMOTICONS_BY_IMAGE
static Evas_Object * grid_content_get(void *data, Evas_Object *obj, const char *part);
static void grid_content_del(void *data, Evas_Object *obj);
+#else
+static char * grid_text_get(void *data, Evas_Object *obj, const char *part);
+#endif
static void _item_selected(void *data, Evas_Object *obj, void *event_info);
-static void __ise_emoticon_create_item_class(unsigned short int screen_degree);
static Eina_Bool _focus_done(void *data);
static void _multi_down(void *data, Evas *e, Evas_Object *o, void *event_info);
static void _multi_up(void *data, Evas *e, Evas_Object *o, void *event_info);
-void ise_show_emoticon_window(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window)
+void ise_read_recent_emoticon_list_from_scim(void)
{
- g_main_window = (Evas_Object *)main_window;
- ise_destroy_emoticon_window();
-
- int w = 0;
- int h = 0;
- elm_win_screen_size_get(g_main_window, NULL, NULL, &w, &h);
- g_screen_width_rate = (double)w/EMOTION_SCREEN_WIDTH;
- g_screen_height_rate = (double)h/EMOTION_SCREEN_HEIGHT;
- scroller = elm_scroller_add((Evas_Object *)main_window);
- evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
- evas_object_move(scroller, g_screen_width_rate*EMOTION_ITEM_LEFT_MARGIN, g_screen_height_rate*EMOTION_ITEM_TOP_MARGIN);
- evas_object_resize(scroller, g_screen_width_rate*EMOTION_SCROLLER_WIDTH, g_screen_height_rate*EMOTION_SCROLLER_HEIGHT);
-
- __ise_emoticon_create_gengrid((unsigned short)screen_degree);
- __ise_emoticon_create_item_class((unsigned short)screen_degree);
- __ise_emoticon_append_items_to_gengrid(emoticon_group);
-
- elm_object_content_set(scroller, gengrid);
-
- evas_object_show(gengrid);
- evas_object_layer_set(gengrid, 32001);
- evas_object_layer_set(scroller, 32001);
- evas_object_show(scroller);
-
- is_emoticon_mode = true;
- current_emoticon_group = emoticon_group;
+ //g_core.config_read_int(ISE_CONFIG_RECENT_EMOTICONS_LIST, &emoticon_list_recent);
}
-void ise_destroy_emoticon_window(void)
-{
- /* According to UI FW team, when the a parent is deleted, all its child content will
- * also be deleted. So no need to delete gengrid explicitly. Just setting the gendrid
- * pointer to NULL should suffice here.
- * OR
- * We can first delete all the child elements and then we delete the parent.
- * This approach is currently used below
- */
-
- if(gic) {
- elm_gengrid_item_class_free(gic);
- gic = NULL;
- }
- if(gengrid) {
- evas_object_hide(gengrid);
- elm_gengrid_clear(gengrid);
- evas_object_del(gengrid);
- gengrid = NULL;
- }
+void ise_write_recent_emoticon_list_to_scim(void)
+{
+ //g_core.config_read_int(ISE_CONFIG_RECENT_EMOTICONS_LIST, emoticon_list_recent);
+}
- if(scroller) {
- evas_object_hide(scroller);
- evas_object_del(scroller);
- scroller = NULL;
- }
+void ise_show_emoticon_window(emoticon_group_t emoticon_group, const int screen_degree, const bool is_candidate_on, void *main_window)
+{
+ //xt9_send_flush(0);
+ ise_init_emoticon_list();
+
+ if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
+ ise_read_recent_emoticon_list_from_scim();
+ if(emoticon_list_recent.size() == 0) {
+ //PRINTFUNC(DLOG_ERROR,"Cannot display recently used emoticons group. No recently used emoticons available");
+ return;
+ }
+ }
+
+ ise_destroy_emoticon_window();
+
+ layout = elm_layout_add((Evas_Object *)main_window);
+ 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);
+
+/* Display *display = (Display *)ecore_x_display_get ();
+ int width = DisplayWidth (display, DefaultScreen (display));
+ int height = DisplayHeight (display, DefaultScreen (display));
+ LOGD ("screen width:%d, height:%d", width, height);*/
+ evas_object_move (layout, 0, 0);
+
+ if(is_candidate_on) {
+ if(screen_degree == 0 || screen_degree == 180)
+ elm_layout_file_set(layout, EMOTICON_EDJ_FILE_PATH, EMOTICON_EDJ_GROUP_PORT_CANDIDATE_ON);
+ else
+ elm_layout_file_set(layout, EMOTICON_EDJ_FILE_PATH, EMOTICON_EDJ_GROUP_LAND_CANDIDATE_ON);
+ } else {
+ if(screen_degree == 0 || screen_degree == 180) {
+ elm_layout_file_set(layout, EMOTICON_EDJ_FILE_PATH, EMOTICON_EDJ_GROUP_PORT_CANDIDATE_OFF);
+ evas_object_resize (layout, ISE_WIDTH_PORT, ISE_HEIGHT_PORT);
+ } else {
+ elm_layout_file_set(layout, EMOTICON_EDJ_FILE_PATH, EMOTICON_EDJ_GROUP_LAND_CANDIDATE_OFF);
+ evas_object_resize (layout, ISE_WIDTH_LAND, ISE_HEIGHT_LAND);
+ }
+ }
+
+ theme = elm_theme_new();
+ elm_theme_ref_set(theme, NULL); // refer to default theme
+ elm_theme_extension_add(theme, CUSTOM_GENGRID_EDJ_FILE_PATH);
+
+ __ise_emoticon_create_gengrid((unsigned short)screen_degree);
+ __ise_emoticon_create_item_class((unsigned short)screen_degree);
+ __ise_emoticon_append_items_to_gengrid(emoticon_group);
+
+ elm_object_part_content_set(layout, "emoticon.swallow.gengrid", gengrid);
+ //elm_win_resize_object_add(main_window, layout);
+
+ evas_object_show(gengrid);
+ evas_object_layer_set(layout, EVAS_CANDIDATE_LAYER-1);
+ evas_object_show(layout);
+
+ is_emoticon_mode = true;
+ current_emoticon_group = emoticon_group;
+}
- is_emoticon_mode = false;
+void ise_destroy_emoticon_window(void)
+{
+ /* According to UI FW team, when the a parent is deleted, all its child content will
+ * also be deleted. So no need to delete gengrid explicitly. Just setting the gendrid
+ * pointer to NULL should suffice here.
+ * OR
+ * We can first delete all the child elements and then we delete the parent.
+ * This approach is currently used below
+ */
+
+ if(gengrid) {
+ elm_gengrid_clear(gengrid);
+ evas_object_del(gengrid);
+ gengrid = NULL;
+ }
+
+ if(layout) {
+ evas_object_del(layout);
+ layout = NULL;
+ }
+
+ if(theme) {
+ elm_theme_free(theme);
+ theme = NULL;
+ }
}
void ise_change_emoticon_mode(emoticon_group_t emoticon_group)
{
- if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
-// ise_read_recent_emoticon_list_from_scim();
- if(emoticon_list_recent.size() == 0) {
-// PRINTFUNC(DLOG_ERROR,"Cannot display recently used emoticons group. No recently used emoticons available");
- return;
- }
- }
-
- if(gengrid) {
- elm_gengrid_clear(gengrid);
- }
-
- __ise_emoticon_append_items_to_gengrid(emoticon_group);
- current_emoticon_group = emoticon_group;
+ if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
+ ise_read_recent_emoticon_list_from_scim();
+ if(emoticon_list_recent.size() == 0) {
+ //PRINTFUNC(DLOG_ERROR,"Cannot display recently used emoticons group. No recently used emoticons available");
+ return;
+ }
+ }
+
+ if(gengrid) {
+ elm_gengrid_clear(gengrid);
+ }
+
+ __ise_emoticon_append_items_to_gengrid(emoticon_group);
+ current_emoticon_group = emoticon_group;
}
static Eina_Bool _focus_done(void *data)
{
- Elm_Object_Item *item = (Elm_Object_Item *)data;
+ Elm_Object_Item *item = (Elm_Object_Item *)data;
- elm_object_item_signal_emit(item,"mouse,up,1","reorder_bg");
+ elm_object_item_signal_emit(item,"mouse,up,1","reorder_bg");
- return ECORE_CALLBACK_CANCEL;
+ return ECORE_CALLBACK_CANCEL;
}
static void _multi_down(void *data, Evas *e, Evas_Object *o, void *event_info)
{
- Evas_Event_Multi_Down *ev = (Evas_Event_Multi_Down*)event_info;
+ Evas_Event_Multi_Down *ev = (Evas_Event_Multi_Down*)event_info;
-// PRINTFUNC(DLOG_DEBUG,"MULTI: down @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
- if (ev->device >= IND_NUM)
- return;
+// PRINTFUNC(DLOG_DEBUG,"MULTI: down @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
+ if (ev->device >= IND_NUM)
+ return;
- Elm_Object_Item *item;
- item = elm_gengrid_at_xy_item_get(o, ev->canvas.x, ev->canvas.y, NULL, NULL);
+ Elm_Object_Item *item;
+ item = elm_gengrid_at_xy_item_get(o, ev->canvas.x, ev->canvas.y, NULL, NULL);
- elm_object_item_signal_emit(item,"mouse,down,1","reorder_bg");
+ elm_object_item_signal_emit(item,"mouse,down,1","reorder_bg");
- ecore_timer_add (0.5, _focus_done, item );
+ ecore_timer_add (0.5, _focus_done, item );
}
static void _multi_up(void *data, Evas *e, Evas_Object *o, void *event_info)
{
- Evas_Event_Multi_Up *ev = (Evas_Event_Multi_Up*)event_info;
-// PRINTFUNC(DLOG_DEBUG,"MULTI: up @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
- if (ev->device >= IND_NUM)
- return;
+ Evas_Event_Multi_Up *ev = (Evas_Event_Multi_Up*)event_info;
+// PRINTFUNC(DLOG_DEBUG,"MULTI: up @ %4i %4i | dev: %i\n", ev->canvas.x, ev->canvas.y, ev->device);
+ if (ev->device >= IND_NUM)
+ return;
- Elm_Object_Item *item = NULL;
- item = elm_gengrid_at_xy_item_get(o, ev->canvas.x, ev->canvas.y, NULL, NULL);
+ Elm_Object_Item *item = NULL;
+ item = elm_gengrid_at_xy_item_get(o, ev->canvas.x, ev->canvas.y, NULL, NULL);
- elm_object_item_signal_emit(item,"mouse,up,1","reorder_bg");
+ elm_object_item_signal_emit(item,"mouse,up,1","reorder_bg");
- elm_gengrid_item_selected_set(item, EINA_TRUE);
+ elm_gengrid_item_selected_set(item, EINA_TRUE);
}
static void __ise_emoticon_create_gengrid(unsigned short int screen_degree)
{
- gengrid = elm_gengrid_add(g_main_window);
- elm_object_style_set(gengrid,"no_effect");
- elm_gengrid_align_set(gengrid, 0, 0);
- evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- if(screen_degree == 0 || screen_degree == 180){
- elm_gengrid_item_size_set(gengrid, EMOTICON_WIDTH_PORT*g_screen_width_rate, EMOTICON_HEIGHT_PORT*g_screen_height_rate);
- }
- else
- elm_gengrid_item_size_set(gengrid, EMOTICON_WIDTH_LAND, EMOTICON_HEIGHT_LAND);
-
- elm_gengrid_highlight_mode_set(gengrid, EINA_TRUE);
- elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS);
- elm_gengrid_multi_select_set(gengrid, EINA_FALSE);
-
-// evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MULTI_DOWN, _multi_down, NULL);
-// evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MULTI_UP, _multi_up, NULL);
+ gengrid = elm_gengrid_add(layout);
+ elm_object_theme_set(gengrid, theme);
+ //elm_object_style_set(gengrid,"no_effect");
+ elm_gengrid_align_set(gengrid, 0.5, 0);
+
+ evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ if(screen_degree == 0 || screen_degree == 180)
+ elm_gengrid_item_size_set(gengrid, ELM_SCALE_SIZE(EMOTICON_WIDTH_PORT), ELM_SCALE_SIZE(EMOTICON_HEIGHT_PORT));
+ else
+ elm_gengrid_item_size_set(gengrid, ELM_SCALE_SIZE(EMOTICON_WIDTH_LAND), ELM_SCALE_SIZE(EMOTICON_HEIGHT_LAND));
+
+ elm_gengrid_highlight_mode_set(gengrid, EINA_TRUE);
+ elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+// elm_gengrid_cache_mode_set(gengrid, EINA_TRUE);
+ elm_gengrid_multi_select_set(gengrid, EINA_TRUE);
+
+ evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MULTI_DOWN, _multi_down, NULL);
+ evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MULTI_UP, _multi_up, NULL);
}
+#if SUPPORTS_EMOTICONS_BY_IMAGE
static void __ise_emoticon_append_items_to_gengrid(emoticon_group_t emoticon_group)
{
- char img_name[10];
- short int items = 0;
- std::string file_path = "";
-
- if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
- items = emoticon_list_recent.size();
-
- for(int i = 0; i < items; i++) {
- emoticon_items[i].code = emoticon_list_recent[i];
- emoticon_items[i].keyevent = emoticon_list_recent[i];
- emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
- }
- } else {
- if(emoticon_group != EMOTICON_GROUP_DESTROY) {
- items = emoticon_group_items[emoticon_group];
- }
- for (int i = 0; i < items; i++) {
- emoticon_items[i].code = emoticon_list[emoticon_group-1][i];
- emoticon_items[i].keyevent = emoticon_list[emoticon_group-1][i];
- emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
- }
- }
-// Elm_Object_Item * it = elm_gengrid_first_item_get(gengrid);
-// elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_NONE);
+ char img_name[10];
+ short int items = 0;
+ std::string file_path = "";
+
+ if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
+ items = emoticon_list_recent.size();
+
+ for(int i = 0; i < items; i++) {
+ snprintf(img_name, 10, "%x", emoticon_list_recent[i]);
+ emoticon_items[i].code = emoticon_list_recent[i];
+ emoticon_items[i].keyevent = emoticon_list_recent[i];
+ emoticon_items[i].path = (std::string)EMOTICON_DIR + (std::string)"u" + (std::string)img_name + (std::string)".png";
+ emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
+ }
+ } else {
+ if(emoticon_group != EMOTICON_GROUP_DESTROY) {
+ items = emoticon_group_items[emoticon_group];
+ }
+ for (int i = 0; i < items; i++) {
+ snprintf(img_name, 10, "%x", emoticon_list[emoticon_group-1][i]);
+ file_path = (std::string)EMOTICON_DIR + (std::string)"u" + (std::string)img_name + (std::string)".png";
+ if(ise_util_does_file_exists(file_path)) {
+ emoticon_items[i].code = emoticon_list[emoticon_group-1][i];
+ emoticon_items[i].keyevent = emoticon_list[emoticon_group-1][i];
+ emoticon_items[i].path = file_path;
+ emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
+// PRINTFUNC(SECURE_DEBUG,"file_path = %s\n",file_path.c_str());
+ }
+ }
+ }
+ Elm_Object_Item * it = elm_gengrid_first_item_get(gengrid);
+ elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_NONE);
}
+
static void __ise_emoticon_create_item_class(unsigned short int screen_degree)
{
- if(!gic)
- gic = elm_gengrid_item_class_new();
+ if(!gic)
+ gic = elm_gengrid_item_class_new();
+
+ if(screen_degree == 0 || screen_degree == 180)
+ gic->item_style = EMOTICON_GENGRID_ITEM_STYLE_PORT2;
+ else
+ gic->item_style = EMOTICON_GENGRID_ITEM_STYLE_LAND2;
+
+ gic->func.text_get = NULL;
+ gic->func.content_get = grid_content_get;
+ gic->func.state_get = NULL;
+ gic->func.del = grid_content_del;
- gic->func.text_get = NULL;
- gic->func.content_get = grid_content_get;
- gic->func.state_get = NULL;
- gic->func.del = grid_content_del;
}
static Evas_Object * grid_content_get(void *data, Evas_Object *obj, const char *part)
{
- emoticon_item_t *ti = (emoticon_item_t *)data;
+ emoticon_item_t *ti = (emoticon_item_t *)data;
if(ti == NULL)
return NULL;
- if (!strcmp(part, "elm.swallow.icon")) {
- char chText[255] = {0};
- sprintf(chText, "&#x%x;", ti->code);
- Evas_Object *label = elm_label_add(obj);
- elm_object_text_set(label, chText);
- evas_object_resize(label, 72, 72);
- evas_object_show(label);
- evas_object_layer_set(label, 32001);
- return label;
- }
-
- return NULL;
+ if (!strcmp(part, "elm.swallow.icon")) {
+ if (ti->path.c_str()) {
+ Eina_Bool is_image_file_set = false;
+ Evas_Object *icon = elm_image_add(obj);
+ is_image_file_set = elm_image_file_set(icon, ti->path.c_str(), NULL);
+ if(!is_image_file_set) {
+ //PRINTFUNC(SECURE_ERROR,"image \"%s\" not set",ti->path.c_str());
+ } else {
+ elm_image_aspect_fixed_set(icon, EINA_FALSE);
+ elm_image_preload_disabled_set(icon, EINA_FALSE);
+ evas_object_show(icon);
+ }
+ evas_object_data_set(icon, "code", (void *)ti->code);
+ return icon;
+ }
+ }
+
+ return NULL;
}
static void grid_content_del(void *data, Evas_Object *obj)
{
- emoticon_item_t *ti = (emoticon_item_t *)data;
+ emoticon_item_t *ti = (emoticon_item_t *)data;
if(!ti)
return;
Evas_Object *icon = elm_object_item_part_content_get(ti->item, "elm.swallow.icon");
if(icon) {
- evas_object_hide(icon);
evas_object_data_del(icon, "code");
}
return;
}
+#else //SUPPORTS_EMOTICONS_BY_IMAGE
+static void __ise_emoticon_append_items_to_gengrid(emoticon_group_t emoticon_group)
+{
+ char img_name[10];
+ short int items = 0;
+ std::string file_path = "";
+
+ if(emoticon_group == EMOTICON_GROUP_RECENTLY_USED) {
+ items = emoticon_list_recent.size();
+
+ for(int i = 0; i < items; i++) {
+ snprintf(img_name, 10, "%x", emoticon_list_recent[i]);
+ emoticon_items[i].keyevent = emoticon_list_recent[i];
+ emoticon_items[i].path = (std::string)img_name;
+ emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
+ }
+ } else {
+ if(emoticon_group != EMOTICON_GROUP_DESTROY) {
+ items = emoticon_group_items[emoticon_group];
+ }
+ for (int i = 0; i < items; i++) {
+ snprintf(img_name, 10, "%x", emoticon_list[emoticon_group-1][i]);
+ file_path = (std::string)img_name;
+ emoticon_items[i].keyevent = emoticon_list[emoticon_group-1][i];
+ emoticon_items[i].path = file_path;
+ emoticon_items[i].item = elm_gengrid_item_append(gengrid, gic, &(emoticon_items[i]), _item_selected, &(emoticon_items[i]));
+ }
+ }
+ Elm_Object_Item * it = elm_gengrid_first_item_get(gengrid);
+ elm_gengrid_item_show(it, ELM_GENGRID_ITEM_SCROLLTO_NONE);
+}
+
+static void __ise_emoticon_create_item_class(unsigned short int screen_degree)
+{
+ if(!gic)
+ gic = elm_gengrid_item_class_new();
+
+ if(screen_degree == 0 || screen_degree == 180)
+ gic->item_style = EMOTICON_GENGRID_ITEM_STYLE_PORT2;
+ else
+ gic->item_style = EMOTICON_GENGRID_ITEM_STYLE_LAND2;
+
+ gic->func.text_get = grid_text_get;
+ gic->func.content_get = NULL;
+ gic->func.state_get = NULL;
+ gic->func.del = NULL;
+}
+
+static char * grid_text_get(void *data, Evas_Object *obj, const char *part)
+{
+ emoticon_item_t *ti = (emoticon_item_t *)data;
+
+ char *utf_8 = NULL;
+ int length = 0;
+
+ if (!strcmp(part, "elm.text")) {
+ if(ti && !(ti->path.empty())) {
+ const Eina_Unicode unicode_event[2] = {ti->keyevent,0};
+ utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
+ return (utf_8);
+ }
+ }
+
+ return NULL;
+}
+#endif //SUPPORTS_EMOTICONS_BY_IMAGE
+
static void _item_selected(void *data, Evas_Object *obj, void *event_info)
{
- emoticon_item_t *ti = (emoticon_item_t *)data;
- char *utf_8 = NULL;
- int length = 0;
-
- std::vector<int>::iterator it;
-
- if(event_info) {
- elm_gengrid_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- if(ti && ti->keyevent) {
- const Eina_Unicode unicode_event[2] = {ti->keyevent,0};
- utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
- if (utf_8) {
- ise_send_string((char *)utf_8);
- free(utf_8);
- }
-
- if(current_emoticon_group != EMOTICON_GROUP_RECENTLY_USED) {
- if(emoticon_list_recent.size() < EMOTICON_GROUP_RECENTLY_USED_NUM) {
- it = find(emoticon_list_recent.begin(), emoticon_list_recent.end(), ti->keyevent);
- if(it == emoticon_list_recent.end()) { // Item not found
- emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
- } else {
- emoticon_list_recent.erase(it);
- emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
- }
- }
- else {
- it = find(emoticon_list_recent.begin(), emoticon_list_recent.end(), ti->keyevent);
- emoticon_list_recent.erase(it);
- emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
- }
-/*
- ise_write_recent_emoticon_list_to_scim();
- if(is_recently_used_emoticon_mode_disabled){
- ise_disable_recently_used_emoticon_key(false);
- }
-*/
- }
- }
- }
+ emoticon_item_t *ti = (emoticon_item_t *)data;
+ char *utf_8 = NULL;
+ int length = 0;
+
+ std::vector<int>::iterator it;
+
+/* static CSCLUtils *utils = CSCLUtils::get_instance();
+ if (utils) {
+ utils->play_sound(FB_SOUND_STYLE_01);
+ utils->play_vibration(FB_VIBE_STYLE_01, DEFAULT_VIBE_DURATION);
+ }*/
+
+ if(event_info) {
+ elm_gengrid_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
+ if(ti && ti->keyevent) {
+ const Eina_Unicode unicode_event[2] = {ti->keyevent,0};
+// PRINTFUNC(DLOG_DEBUG,"unicode_event is %x",unicode_event);
+ utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
+
+ if (utf_8) {
+ ise_send_string((sclchar *)utf_8);
+ free(utf_8);
+ }
+
+ if(current_emoticon_group != EMOTICON_GROUP_RECENTLY_USED) {
+ if(emoticon_list_recent.size() < EMOTICON_GROUP_RECENTLY_USED_NUM) {
+ it = find(emoticon_list_recent.begin(), emoticon_list_recent.end(), ti->keyevent);
+ if(it == emoticon_list_recent.end()) { // Item not found
+ emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
+ } else {
+ emoticon_list_recent.erase(it);
+ emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
+ }
+ }
+ else {
+ it = find(emoticon_list_recent.begin(), emoticon_list_recent.end(), ti->keyevent);
+ emoticon_list_recent.erase(it);
+ emoticon_list_recent.insert(emoticon_list_recent.begin(),ti->keyevent);
+ }
+ ise_write_recent_emoticon_list_to_scim();
+ if(is_recently_used_emoticon_mode_disabled)
+ ;//ise_disable_recently_used_emoticon_key(false);
+ }
+ }
+ }
+ //PRINTFUNC(DLOG_DEBUG,"_item_selected() ends");
}
bool is_emoticon_show(void)