From: Kim Kibum Date: Mon, 9 Apr 2012 03:11:58 +0000 (+0900) Subject: Tizen release 1.0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=364de46d92de55eccc84bf4de8a33296517f2cd4;p=apps%2Fhome%2Fmemo.git Tizen release 1.0 --- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6c261a6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,106 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(memo C) + +SET(SRCS extend/supplement.c + extend/extended-elm.c + src/memo.c + src/memo-assist.c + src/memo-genlist.c + src/memo_list.c + src/memo_edit.c + src/memo_edit_list.c + src/memo_list_viewer.c + src/memo_list_editor.c + src/memo_text_viewer.c + src/memo_text_editor.c + src/memo_doodle_viewer.c + src/memo_doodle_editor.c + src/memo_detail.c + src/memo_ug.c) + +SET(VENDOR "tizen") +SET(PKGPREFIX "org.${VENDOR}") +SET(PACKAGE ${PROJECT_NAME}) +SET(PKGNAME "${PKGPREFIX}.${PACKAGE}") +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(BINDIR "${PREFIX}/bin") +SET(RESDIR "${PREFIX}/res") +SET(DATADIR "${PREFIX}/data") +SET(LOCALEDIR "${RESDIR}/locale") +SET(ICONDIR "${RESDIR}/icons/default/small") +SET(EDJDIR "${RESDIR}/edje") +SET(DOODLEDIR "${DATADIR}/doodle") + +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extend) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED appcore-efl elementary ecore ecore-x ecore-imf ecore-input eina evas edje memo iniparser ui-gadget dlog bundle appsvc heynoti) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_C_FLAGS_RELEASE "-O2") + +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"") +ADD_DEFINITIONS("-DPACKAGE_PREFIX=\"${PKGPREFIX}\"") +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") +ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"") +ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") +ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") +ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"") +ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") +ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"") +ADD_DEFINITIONS("-DEDJ_DIR=\"${EDJDIR}\"") +ADD_DEFINITIONS("-DEDJ_FILE=\"${EDJDIR}/${PACKAGE}.edj\"") +ADD_DEFINITIONS("-DDOODLEDIR=\"${DOODLEDIR}\"") +ADD_DEFINITIONS("-DMEMO_BUFFER_SIZE=256") +ADD_DEFINITIONS("-DLOG_TAG=\"${PROJECT_NAME}\"") + +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed") + +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie" "-lm -L/usr/lib -licui18n -licuuc -licudata -lm") + +ADD_CUSTOM_TARGET(memo.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images + ${CMAKE_SOURCE_DIR}/memo.edc ${CMAKE_BINARY_DIR}/memo.edj + DEPENDS ${CMAKE_SOURCE_DIR}/memo.edc +) +ADD_DEPENDENCIES(${PROJECT_NAME} memo.edj) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/memo.edj DESTINATION ${EDJDIR}) +INSTALL(DIRECTORY DESTINATION ${DOODLEDIR}) + +# install desktop file & icon +CONFIGURE_FILE(${PKGNAME}.desktop.in ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop) +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.memo.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_edit.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_add.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_others.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_cancel.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_done.png DESTINATION ${ICONDIR}) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/images/01_header_icon_delete.png DESTINATION ${ICONDIR}) + +# i18n +ADD_SUBDIRECTORY(po) +# theme +ADD_SUBDIRECTORY(theme) + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..3f81c54 --- /dev/null +++ b/INSTALL @@ -0,0 +1,33 @@ +1. make the build directory + + ex) + + $ mkdir build + + +2. change the working directory to the build directory + + ex) + + $ cd build + + +3. run 'cmake' + + $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@ + + ex) + + $ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@ + + or + + $ cmake .. + + +4. make & make install + + ex) + + $ make -j 2 && make install + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..ded3804 --- /dev/null +++ b/NOTICE @@ -0,0 +1 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. \ No newline at end of file diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a39a720 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,144 @@ +memo (0.1.5-78) unstable; urgency=low + + * Cancel button of editor can be triggered more than once by keyboard. + * Git: apps/m/memo + * Tag : memo_0.1.5-78 + + -- canjiang.lu Thu, 05 Apr 2012 11:43:33 +0800 + +memo (0.1.5-77) unstable; urgency=low + + * IME is opened automatically when entring into detail view. + * Git: apps/m/memo + * Tag : memo_0.1.5-77 + + -- canjiang.lu Mon, 26 Mar 2012 15:36:06 +0800 + +memo (0.1.5-76) unstable; urgency=low + + * Default mode of color selector is ELM_COLORSELECTOR_COMPONENTS. + * Git: apps/m/memo + * Tag : memo_0.1.5-76 + + -- canjiang.lu Fri, 23 Mar 2012 13:37:44 +0800 + +memo (0.1.5-75) unstable; urgency=low + + * Update version + * Git: apps/m/memo + * Tag : memo_0.1.5-75 + + -- canjiang.lu Sat, 17 Mar 2012 17:20:30 +0800 + +memo (0.1.5-74) unstable; urgency=low + + * Update version + * Git: apps/m/memo + * Tag : memo_0.1.5-74 + + -- canjiang.lu Sat, 17 Mar 2012 16:21:36 +0800 + +memo (0.1.5-73) unstable; urgency=low + + * Update version + * Git: apps/m/memo + * Tag : memo_0.1.5-73 + + -- canjiang.lu Sat, 17 Mar 2012 15:34:19 +0800 + +memo (0.1.5-72) unstable; urgency=low + + * Update version + * Git: apps/m/memo + * Tag : memo_0.1.5-72 + + -- zhibin.zhou Fri, 24 Feb 2012 07:59:12 +0800 + +memo (0.1.5-70) unstable; urgency=low + + * Fix bug that Memo Memo/Create/when click text size or color button, the responsive time is very low. + * Git: apps/m/memo + * Tag : memo_0.1.5-70 + + -- Zhibin Zhou Tue, 21 Feb 2012 15:47:28 +0800 + +memo (0.1.5-69) unstable; urgency=low + + * upload + * Git: apps/m/memo + * Tag : memo_0.1.5-69 + + -- Canjiang Lu Wed, 04 Jan 2012 16:32:39 +0800 + +memo (0.1.5-68) unstable; urgency=low + + * Disable message&email options in share popup. + * Git: apps/m/memo + * Tag : memo_0.1.5-68 + + -- Canjiang Lu Thu, 29 Dec 2011 14:46:13 +0800 + +memo (0.1.5-67) unstable; urgency=low + + * Remove twitter&facebook releated code + * Git: apps/m/memo + * Tag : memo_0.1.5-67 + + -- Canjiang Lu Mon, 26 Dec 2011 17:28:37 +0800 + +memo (0.1.5-66) unstable; urgency=low + + * Hide stroke tools when entering into comment mode. + * Git: apps/m/memo + * Tag : memo_0.1.5-66 + + -- Canjiang Lu Mon, 26 Dec 2011 09:08:37 +0800 + +memo (0.1.5-65) unstable; urgency=low + + * upload + * Git: apps/m/memo + * Tag : memo_0.1.5-65 + + -- Canjiang Lu Fri, 23 Dec 2011 09:32:18 +0800 + +memo (0.1.5-64) unstable; urgency=low + + * upload + * Git: apps/m/memo + * Tag : memo_0.1.5-64 + + -- Canjiang Lu Wed, 21 Dec 2011 14:16:14 +0800 + +memo (0.1.5-63) unstable; urgency=low + + * [Request]Rename default memo(samsung->tizen). + * Git: apps/m/memo + * Tag : memo_0.1.5-63 + + -- Canjiang Lu Mon, 19 Dec 2011 17:30:11 +0800 + +memo (0.1.5-62) unstable; urgency=low + + * Rename theme name from nbeat to tizen + * Git: apps/m/memo + * Tag: memo_0.1.5-62 + + -- zhouzhibin Fri, 16 Dec 2011 17:07:18 +0800 + +memo (0.1.5-61) unstable; urgency=low + + * Update version + * Git: apps/m/memo + * Tag: memo_0.1.5-61 + + -- Lee Goo Thu, 15 Dec 2011 12:35:22 +0900 + +memo (0.1.0-1) unstable; urgency=low + + * Git Initial Release + * Git: apps/m/memo + * Tag: memo_0.1.0-1 + + -- Lu Chang-Yu Wed, 07 Dec 2011 11:15:22 +0900 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..db8e3d6 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: memo +Section: devel +Priority: extra +Maintainer: maintainer Zhibin Zhou , Canjiang Lu , Goo Lee +Build-Depends: debhelper (>= 5), libappcore-efl-dev, libelm-dev, libecore-dev, libeina-dev, libevas-dev, libedje-dev, libslp-memo-dev, iniparser-dev, libui-gadget-dev, libug-contacts-dev, dlog-dev, libbundle-dev, libicu-dev, libappsvc-dev, libheynoti-dev +Standards-Version: 0.1.0 + +Package: org.tizen.memo +Section: utils +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: memo + +Package: org.tizen.memo-dbg +Section: debug +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: memo for debugging + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..a0f0008 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +CMakeLists.txt diff --git a/debian/org.tizen.memo.install.in b/debian/org.tizen.memo.install.in new file mode 100644 index 0000000..fcd6fb1 --- /dev/null +++ b/debian/org.tizen.memo.install.in @@ -0,0 +1,6 @@ +@PREFIX@/bin/* +@PREFIX@/res/locale/* +@PREFIX@/res/icons/* +@PREFIX@/res/edje/* +@PREFIX@/data/* +/opt/share/applications/* diff --git a/debian/org.tizen.memo.postinst.in b/debian/org.tizen.memo.postinst.in new file mode 100644 index 0000000..a15f185 --- /dev/null +++ b/debian/org.tizen.memo.postinst.in @@ -0,0 +1,7 @@ +#!/bin/sh +if [ ${USER} == "root" ] +then + # Change file owner + chown -R 5000:5000 @DATADIR@ +fi + # Change file permissions diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..1a430c6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,117 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS += -Wall -g +LDFLAGS ?= +PREFIX ?= /opt/apps/org.tizen.memo +RESDIR ?= /opt/apps/org.tizen.memo/res +DATADIR ?= /opt/apps/org.tizen.memo/data + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +CFLAGS += -fPIC +LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both + +CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \ + CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)" + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + cd $(CMAKE_BUILD_DIR) && $(MAKE) + + for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ + cat $$f > $${f%.in}; \ + sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \ + sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \ + sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ + done + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + rm -rf $(CMAKE_BUILD_DIR) + + for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ + rm -f $${f%.in}; \ + done + + rm -fr $(CURDIR)/debian/memo-dbg/ + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/wavplayer. + cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + #dh_installchangelogs + #dh_installdocs + dh_installexamples + dh_install --sourcedir=debian/tmp +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip --dbg-package=org.tizen.memo-dbg + dh_compress + dh_fixperms +# dh_perl + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/edc/common.edc b/edc/common.edc new file mode 100644 index 0000000..f14ccb5 --- /dev/null +++ b/edc/common.edc @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#define GENLIST_PART_BOTTOM_LINE \ +part { \ + name: "bottom_line"; \ + type: RECT; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: 87 87 87 255; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + } \ + } \ +} + +styles +{ + style + { + name: "textblock_style_main"; + base: "font=Helvetica_Neue:style=Roman font_size=42 align=left color=#F9F9F9 wrap=char"; + } +} + +#define PART_TEXT_BLACK_LEFT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 0.0, 0.5, 0, 0, 0, 255) + +#define PART_TEXT_GRAY_RIGHT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 1.0, 0.5, 85, 70, 58, 255) + +#define PART_TEXT_WHITE_LEFT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 0.0, 0.5, 255, 255, 255, 255) + +#define PART_TEXT_GRAY_CENTER(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 0.5, 0.5, 85, 70, 58, 255) + +#define PART_TEXT_DETAIL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 0.0, 0.5, 249, 249, 249, 255) + +#define PART_TEXT_DATE(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize)\ +PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, \ + iText, iFont, iSize, 0.0, 0.5, 100, 100, 100, 255) + +group{ + name: "empty_layout"; + parts{ + PART_BG("bg") + PART_SWALLOW("elm.swallow.content", "bg") + } +} + +#define IMF_HEIGHT_480_800 360 +#define IMF_HEIGHT_600_1024 460 +#define IMF_HEIGHT_720_1280 580 diff --git a/edc/doodle_editor.edc b/edc/doodle_editor.edc new file mode 100644 index 0000000..2b3dbc8 --- /dev/null +++ b/edc/doodle_editor.edc @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#define DOODLE_EDITOR(iName, imf_height)\ +group{\ + name: iName;\ + parts{\ + PART_BG("bg") /* 720 * unknown */\ + PART_V_PIXEL_RECT("top_margin", 16, "bg", 0.0, 0.0)\ + PART_V_PIXEL_RECT("text.bg", 48, "top_margin", 1.0, 0.0)\ + PART_V_PIXEL_RECT("top_margin2", 10, "text.bg", 1.0, 0.0)\ + PART_RECT("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "bottom_margin2")\ + PART_V_PIXEL_RECT("bottom_margin2", 108, "bottom_margin", 0.0, 1.0)\ + PART_V_PIXEL_RECT("bottom_margin", 86, "bg", 1.0, 1.0)\ + PART_V_PIXEL_RECT("_bottom_margin", 108, "bg", 1.0, 1.0)\ + PART_V_PIXEL_RECT("tool.bg", imf_height, "bg", 1.0, 1.0)\ + /* layout */\ + PART_RECT("doodle.bg", 0.0, 0.0, "_doodle.bg", 1.0, 1.0, "_doodle.bg")\ + PART_COLOR_RECT("doodle.bg.color", "doodle.bg", 255, 255, 255, 255)\ + PART_V_PIXEL_RECT("toolbar.bg", 86, "bg", 1.0, 1.0)\ + PART_V_PIXEL_RECT("toolbar.bg.up", 86, "tool.bg", 0.0, 1.0)\ + PART_V_PIXEL_RECT("comment.bg.up", 108, "tool.bg", 0.0, 1.0)\ + PART_V_PIXEL_RECT("comment.bg", 108, "bottom_margin", 0.0, 1.0)\ + PART_V_PIXEL_RECT("comment.bg.down", 108, "bg", 1.0, 1.0)\ + /* content */\ + PART_TEXT_GRAY_RIGHT("elm.text.date", 16/720, 0.0, "text.bg", (720-16)/720, 1.0, "text.bg", "date", "Helvetica Neue:style=Medium", 32)\ + PART_SWALLOW_REL("elm.swallow.doodle", 16/720, 0.0, "doodle.bg", (720-16)/720, 1.0, "doodle.bg")\ + PART_SWALLOW("elm.swallow.toolbar", "toolbar.bg")\ + PART_SWALLOW("elm.swallow.tool", "tool.bg")\ + PART_SWALLOW("elm.swallow.comment", "comment.bg")\ + }/* end part */\ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART("elm.swallow.toolbar");\ + SCRIPT_CUSTOM_PART("elm.swallow.comment");\ + SCRIPT_CUSTOM_PART("_doodle.bg");\ + }\ + } /* end program */\ +\ + program {\ + name: "abbrev";\ + signal: "abbrev";\ + source: "elm";\ + script {\ + SCRIPT_SET_VISIBLE(elm.swallow.toolbar, 1);\ + SCRIPT_SET_VISIBLE(elm.swallow.comment, 0);\ + SCRIPT_SET_REL(elm.swallow.toolbar, 0.0, 0.0, "toolbar.bg.up", 1.0, 1.0, "toolbar.bg.up");\ + SCRIPT_SET_REL("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "bottom_margin2");\ + }\ + } /* end program */\ + program {\ + name: "expand";\ + signal: "expand";\ + source: "elm";\ + script {\ + SCRIPT_SET_VISIBLE(elm.swallow.toolbar, 1);\ + SCRIPT_SET_VISIBLE(elm.swallow.comment, 1);\ + SCRIPT_SET_REL(elm.swallow.toolbar, 0.0, 0.0, "toolbar.bg", 1.0, 1.0, "toolbar.bg");\ + SCRIPT_SET_REL(elm.swallow.comment, 0.0, 0.0, "comment.bg", 1.0, 1.0, "comment.bg");\ + SCRIPT_SET_REL("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "bottom_margin2");\ + }\ + } /* end program */\ + program {\ + name: "comment_abbrev";\ + signal: "abbrev";\ + source: "comment";\ + script {\ + SCRIPT_SET_VISIBLE(elm.swallow.toolbar, 0);\ + SCRIPT_SET_VISIBLE(elm.swallow.comment, 1);\ + SCRIPT_SET_REL(elm.swallow.comment, 0.0, 0.0, "comment.bg.up", 1.0, 1.0, "comment.bg.up");\ + SCRIPT_SET_REL("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "_bottom_margin");\ + }\ + } /* end program */\ + program {\ + name: "comment_expand";\ + signal: "expand";\ + source: "comment";\ + script {\ + SCRIPT_SET_VISIBLE(elm.swallow.toolbar, 0);\ + SCRIPT_SET_VISIBLE(elm.swallow.comment, 1);\ + SCRIPT_SET_REL(elm.swallow.comment, 0.0, 0.0, "comment.bg.down", 1.0, 1.0, "comment.bg.down");\ + SCRIPT_SET_REL("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "_bottom_margin");\ + }\ + } /* end program */\ + }/* end programs */\ +} + +DOODLE_EDITOR("doodle_editor_480_800", IMF_HEIGHT_480_800) +DOODLE_EDITOR("doodle_editor_600_1024", IMF_HEIGHT_600_1024) +DOODLE_EDITOR("doodle_editor_720_1280", IMF_HEIGHT_720_1280) + +group{ + name: "doodle_comment"; + images { + image: "00_search_input_field_bg.png" COMP; + } + parts{ + PART_BG("bg") /* 720 * 67 */ + PART_COLOR_RECT("bg.color", "bg", 30, 25, 22, 255) + PART_RECT("image.bg", 16/720, 8/67, "bg", (720-16)/720, (67-9)/67, "bg") + PART_BORDER_IMAGE("image", "image.bg", "00_search_input_field_bg.png", 6, 6, 7, 5) + PART_V_PIXEL_RECT("editfield.bg", 50, "image.bg", 0.5, 0.5) + PART_SWALLOW_REL("elm.swallow.editfield", 10/460, 0.0, "editfield.bg", (460-10)/460, 1.0, "editfield.bg") + }/* end parts */ +}/* end group */ + diff --git a/edc/doodle_viewer.edc b/edc/doodle_viewer.edc new file mode 100644 index 0000000..d14eeb9 --- /dev/null +++ b/edc/doodle_viewer.edc @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#define DOODLE_VIEWER(iName, imf_height)\ +group {\ + name: iName;\ + parts{\ + PART_BG("bg") /* 720 * unknown */\ + PART_V_PIXEL_RECT("top_margin", 10, "bg", 0.0, 0.0)\ + PART_V_PIXEL_RECT("text.bg", 48, "top_margin", 1.0, 0.0)\ + PART_V_PIXEL_RECT("top_margin2", 10, "text.bg", 1.0, 0.0)\ + PART_RECT("_doodle.bg", 0.0, 1.0, "top_margin2", 1.0, 0.0, "bottom_margin")\ + PART_V_PIXEL_RECT("bottom_margin", 108, "bg", 1.0, 1.0)\ + PART_V_PIXEL_RECT("imf.bg", imf_height-100, "bg", 1.0, 1.0)\ + /* layout */\ + PART_V_PIXEL_RECT("doodle.bg", 700, "_doodle.bg", 0.5, 0.5)\ + PART_COLOR_RECT("doodle.bg.color", "doodle.bg", 255, 255, 255, 255)\ + PART_V_PIXEL_RECT("comment.bg.up", 108, "imf.bg", 0.0, 1.0)\ + PART_V_PIXEL_RECT("comment.bg", 108, "bg", 1.0, 1.0)\ + /* content */\ + PART_TEXT_GRAY_RIGHT("elm.text.date", 16/720, 0.0, "text.bg", (720-16)/720, 1.0, "text.bg", "date", "Helvetica Neue:style=Medium", 32)\ + PART_SWALLOW_REL("elm.swallow.doodle", 16/720, 0.0, "doodle.bg", (720-16)/720, 1.0, "doodle.bg")\ + PART_SWALLOW("elm.swallow.comment", "comment.bg")\ + }/* end part */\ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART("elm.swallow.comment");\ + }\ + } /* end program */\ + program {\ + name: "comment_abbrev";\ + signal: "abbrev";\ + source: "comment";\ + script {\ + SCRIPT_SET_REL(elm.swallow.comment, 0.0, 0.0, "comment.bg.up", 1.0, 1.0, "comment.bg.up");\ + }\ + } /* end program */\ + program {\ + name: "comment_expand";\ + signal: "expand";\ + source: "comment";\ + script {\ + SCRIPT_SET_REL(elm.swallow.comment, 0.0, 0.0, "comment.bg", 1.0, 1.0, "comment.bg");\ + }\ + } /* end program */\ + }/* end programs */\ +} + +DOODLE_VIEWER("doodle_viewer_480_800", IMF_HEIGHT_480_800) +DOODLE_VIEWER("doodle_viewer_600_1024", IMF_HEIGHT_600_1024) +DOODLE_VIEWER("doodle_viewer_720_1280", IMF_HEIGHT_720_1280) diff --git a/edc/edit_list.edc b/edc/edit_list.edc new file mode 100644 index 0000000..92ba295 --- /dev/null +++ b/edc/edit_list.edc @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +group{ + name: "edit_list_frame"; + parts{ + PART_BG("bg") /* 480 x 705 */ + PART_SWALLOW_REL("elm.swallow.select.all", 0.0, 0.0, "bg", 1.0, 66/705, "bg") + PART_SWALLOW_REL("elm.swallow.content", 0.0, 66/705, "bg", 1.0, /* (706-70)/705 */ 1.0, "bg") + }/* end parts */ +}/* end group */ + +group { + name: "edit_list_item_select_all"; + parts { + /* area definition */ + PART_BG("bg"); /* 480 x 66 */ + PART_SWALLOW_REL("elm.swallow.check", 15/480, 8/66, "bg", 65/480, 58/66, "bg"); + PART_TEXT_DETAIL("elm.text.select.all", 75/480, 0.0, "bg", 1.0, 1.0, "bg", "Select all", "SLP", 44); + PART_V_PIXEL_RECT("bottom.margin", 2, "bg", 1.0, 1.0) + PART_COLOR_RECT("bottom.margin.color", "bottom.margin", 87, 87, 87, 255) + PART_EVENT_RECT("event", "bg") + } /* parts */ +} /* group */ + +#define EDIT_GL_STYLE(iStyle, iX2TextBlock) \ +group { name: "elm/genlist/item/memo/edit/"iStyle"/default"; \ + alias: "elm/genlist/item_odd/memo/edit/"iStyle"/default"; \ + data.item: "stacking" "above"; \ + data.item: "selectraise" "on"; \ + data.item: "texts" "elm.text elm.text.date"; \ + data.item: "contents" "elm.swallow.doodle elm.swallow.check"; \ + data.item: "treesize" "20"; \ + parts { \ + PART_BG("bg") \ + PART_SWALLOW_REL("elm.swallow.check", 16/720, 16/128, "bg", (16+96)/720, (128-16)/128, "bg") \ + part \ + { \ + name: "elm.text"; \ + type: TEXTBLOCK; \ + mouse_events: 1; \ + scale: 1; \ + description \ + { \ + state: "default" 0.0; \ + fixed: 1 0; \ + min: (iX2TextBlock-16-96-16) 56; \ + max: (iX2TextBlock-16-96-16) 56; \ + align: 0 0; \ + rel1 { relative: (16+96+16)/720 16/128; to: "bg"; } \ + rel2 { relative: iX2TextBlock/720 (128-16-32-8)/128; to: "bg"; } \ + text \ + { \ + style: "textblock_style_main"; \ + min: 1 1; \ + } \ + } \ + } \ + PART_TEXT_DATE("elm.text.date", (16+96+16)/720, (128-16-32)/128, "bg", (720-16)/720, (128-16)/128, "bg", "", "Helvetica Neue:style=Medium", 32) \ + PART_SWALLOW_REL("elm.swallow.doodle", (720-16-96)/720, 16/128, "bg", (720-16)/720, (128-16)/128, "bg") \ + GENLIST_PART_BOTTOM_LINE \ + PART_EVENT_RECT("event", "bg") \ + }/* end parts */ \ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART(bg);\ + SCRIPT_SET_COLOR(bg, 0, 0, 0, 255);\ + }\ + } /* end program */\ + program \ + {\ + name: "go_active"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + script {\ + SCRIPT_SET_COLOR(bg, 50, 50, 50, 255);\ + }\ + transition: LINEAR 0.1; \ + } \ + program \ + { \ + name: "go_passive"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + script {\ + SCRIPT_SET_COLOR(bg, 0, 0, 0, 255);\ + }\ + transition: LINEAR 0.1; \ + }\ + }\ +} + +EDIT_GL_STYLE("list", (720-16)) +EDIT_GL_STYLE("list_draw", (720-16-96-16)) diff --git a/edc/edit_tool.edc b/edc/edit_tool.edc new file mode 100644 index 0000000..f712091 --- /dev/null +++ b/edc/edit_tool.edc @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +group{ + name: "color_selector"; + parts{ + PART_BG("bg") + PART_V_PIXEL_RECT("rect.up", 200, "bg", 0.0, 0.0) + PART_PIXEL_RECT("border.bg", (500+6), (160+5), 0.5, 0.5, "rect.up", 0.5, 0.5) + PART_PIXEL_RECT("color.bg", 500, 160, 0.5, 0.5, "rect.up", 0.5, 0.5) + PART_SWALLOW_REL("elm.swallow.color", 0.0, 0.0, "color.bg", 1.0, 1.0, "color.bg") + PART_EVENT_RECT("event", "rect.up") + PART_SWALLOW_REL("elm.swallow.selector", 4/480, 1.0, "rect.up", (480-4)/480, 1.0, "bg") + }/* end parts */ + programs { + program { + name: "init"; + signal: "load"; + source: ""; + script { + SCRIPT_CUSTOM_PART(bg); + SCRIPT_CUSTOM_PART(border.bg); + } + } /* end program */ + program + { + name: "black_theme"; + signal: "black"; + source: "elm"; + script { + SCRIPT_SET_COLOR(bg, 0, 0, 0, 255); + SCRIPT_SET_COLOR(border.bg, 255, 255, 255, 255); + } + } + program + { + name: "white_theme"; + signal: "white"; + source: "elm"; + script { + SCRIPT_SET_COLOR(bg, 255, 255, 255, 255); + SCRIPT_SET_COLOR(border.bg, 0, 0, 0, 255); + } + } + }/* end programs */ +}/* end group */ + +group{ + name: "pencil_size_selector"; + parts{ + PART_BG("bg") + PART_SWALLOW("bg.color", "bg") + PART_RECT("rect.up", 0.0, 0.0, "bg", 1.0, 0.5, "bg") + PART_PIXEL_RECT("pencil.bg", 300, 0, 0.5, 0.5, "rect.up", 0.5, 0.5) + PART_SWALLOW("elm.swallow.pencil", "pencil.bg") + PART_EVENT_RECT("event", "rect.up") + PART_SWALLOW_REL("elm.swallow.selector", 5/480, 0.5, "bg", (480-5)/480, 1.0, "bg") + }/* end parts */ +}/* end group */ + +group{ + name: "font_size_selector"; + parts{ + PART_BG("bg") + PART_SWALLOW("bg.color", "bg") + PART_RECT("rect.up", 0.0, 0.0, "bg", 1.0, 0.5, "bg") + PART_SWALLOW("elm.swallow.label", "rect.up") + PART_EVENT_RECT("event", "rect.up") + PART_SWALLOW_REL("elm.swallow.selector", 5/480, 0.5, "bg", (480-5)/480, 1.0, "bg") + }/* end parts */ +}/* end group */ + +group{ + name: "edit_toolbar"; + parts{ + PART_BG("bg") /* 720 x 86 */ + PART_COLOR_RECT("color", "bg", 204, 204, 204, 255) + PART_SWALLOW_REL("elm.swallow.btn1", (10)/720, 10/86, "bg", (10+74)/720, (86-10)/86, "bg") + PART_SWALLOW_REL("elm.swallow.btn2", (10+16+74)/720, 10/86, "bg", (10+16+74*2)/720, (86-10)/86, "bg") + PART_SWALLOW_REL("elm.swallow.btn3", (10+16*2+74*2)/720, 10/86, "bg", (10+16*2+74*3)/720, (86-10)/86, "bg") + PART_SWALLOW_REL("elm.swallow.btn4", (720-10-160)/720, 10/86, "bg", (720-10)/720, (86-10)/86, "bg") + PART_V_PIXEL_RECT("bottom_margin", 1, "bg", 1.0, 0.0) + PART_COLOR_RECT("bottom_margin_color", "bottom_margin", 204, 204, 204, 255) + }/* end parts */ +}/* end group */ diff --git a/edc/list.edc b/edc/list.edc new file mode 100644 index 0000000..24b85c5 --- /dev/null +++ b/edc/list.edc @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +group{ + name: "list_frame"; + parts{ + PART_BG("bg") /* unknown x 480 */ + PART_V_PIXEL_RECT("search.bg", 88, "bg", 0.0, 0.0) + PART_SWALLOW("elm.swallow.search", "search.bg") + PART_SWALLOW_REL("elm.swallow.nocontent", 0.0, 1.0, "search.bg", 1.0, 1.0, "bg") + PART_SWALLOW_REL("elm.swallow.content", 0.0, 1.0, "search.bg", 1.0, 1.0, "bg") + }/* end part */ + programs { + program { + name: "init"; + signal: "load"; + source: ""; + script { + SCRIPT_CUSTOM_PART(elm.swallow.nocontent); + } + } /* end program */ + program + { + name: "show_nocontent"; + signal: "show"; + source: "nocontent"; + script { + SCRIPT_SET_VISIBLE(elm.swallow.nocontent, 1); + } + } + program + { + name: "hide_nocontent"; + signal: "hide"; + source: "nocontent"; + script { + SCRIPT_SET_VISIBLE(elm.swallow.nocontent, 0); + } + } + }/* end programs */ +} + +#define GL_STYLE(iStyle, iX2TextBlock) \ +group { name: "elm/genlist/item/memo/"iStyle"/default"; \ + alias: "elm/genlist/item_odd/memo/"iStyle"/default"; \ + alias: "elm/genlist/item_compress/memo/"iStyle"/default"; \ + alias: "elm/genlist/item_compress_odd/memo/"iStyle"/default"; \ + data.item: "texts" "elm.text.date elm.text"; \ + data.item: "contents" "elm.swallow.doodle"; \ + data.item: "allow_slide" "1"; \ + parts { \ + PART_BG("bg") \ + part \ + { \ + name: "elm.text"; \ + type: TEXTBLOCK; \ + mouse_events: 1; \ + scale: 1; \ + description \ + { \ + state: "default" 0.0; \ + fixed: 1 0; \ + min: (iX2TextBlock-16) 56; \ + max: (iX2TextBlock-16) 56; \ + align: 0 0; \ + rel1 { relative: 16/720 16/128; to: "bg"; } \ + rel2 { relative: iX2TextBlock/720 (128-16-32-8)/128; to: "bg"; } \ + text \ + { \ + style: "textblock_style_main"; \ + min: 1 1; \ + } \ + } \ + } \ + PART_TEXT_DATE("elm.text.date", 16/720, (128-16-32)/128, "bg", (720-16)/720, (128-16)/128, "bg", "", "Helvetica Neue:style=Medium", 32) \ + PART_SWALLOW_REL("elm.swallow.doodle", (720-16-96)/720, 16/128, "bg", (720-16)/720, (128-16)/128, "bg") \ + /* margin */ \ + GENLIST_PART_BOTTOM_LINE \ + PART_EVENT_RECT("event", "bg") \ + }/* end parts */ \ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART(bg);\ + SCRIPT_SET_COLOR(bg, 0, 0, 0, 255);\ + }\ + } /* end program */\ + program \ + {\ + name: "go_active"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + script {\ + SCRIPT_SET_COLOR(bg, 50, 50, 50, 255);\ + }\ + transition: LINEAR 0.1; \ + } \ + program \ + { \ + name: "go_passive"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + script {\ + SCRIPT_SET_COLOR(bg, 0, 0, 0, 255);\ + }\ + transition: LINEAR 0.1; \ + }\ + }\ +} + +GL_STYLE("list", (720-16)) +GL_STYLE("list_draw", (720-16-96-16)) diff --git a/edc/text_editor.edc b/edc/text_editor.edc new file mode 100644 index 0000000..c1f5505 --- /dev/null +++ b/edc/text_editor.edc @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#define TEXT_EDITOR(iName, imf_height)\ +group{\ + name: iName;\ + parts{\ + PART_BG("bg") /* 720 * unknown */\ + PART_V_PIXEL_RECT("top_margin", 16, "bg", 0.0, 0.0)\ + PART_V_PIXEL_RECT("text.bg", 48, "top_margin", 1.0, 0.0)\ + PART_V_PIXEL_RECT("top_margin2", 10, "text.bg", 1.0, 0.0)\ + PART_V_PIXEL_RECT("toolbar.bg", 86, "tool.bg", 0.0, 1.0)\ + PART_V_PIXEL_RECT("tool.bg", 0, "bg", 1.0, 1.0)\ + /* content */\ + PART_TEXT_GRAY_RIGHT("elm.text.date", 16/720, 0.0, "text.bg", (720-16)/720, 1.0, "text.bg", "date", "Helvetica Neue:style=Medium", 32)\ + PART_SWALLOW_REL("elm.swallow.text", 16/720, 1.0, "top_margin2", (720-16)/720, 0.0, "toolbar.bg")\ + PART_SWALLOW("elm.swallow.toolbar", "toolbar.bg")\ + PART_SWALLOW("elm.swallow.tool", "tool.bg")\ + }/* end part */\ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART("tool.bg");\ + SCRIPT_CUSTOM_PART("elm.swallow.text");\ + }\ + } /* end program */\ +\ + program {\ + name: "abbrev";\ + signal: "abbrev";\ + source: "elm";\ + script {\ + set_state_val(PART:"tool.bg", STATE_MIN, 0, imf_height);\ + }\ + } /* end program */\ + program {\ + name: "expand";\ + signal: "expand";\ + source: "elm";\ + script {\ + set_state_val(PART:"tool.bg", STATE_MIN, 0, 0);\ + }\ + } /* end program */\ + }/* end programs */\ +} + +TEXT_EDITOR("text_editor_480_800", IMF_HEIGHT_480_800) +TEXT_EDITOR("text_editor_600_1024", IMF_HEIGHT_600_1024) +TEXT_EDITOR("text_editor_720_1280", IMF_HEIGHT_720_1280) diff --git a/edc/text_viewer.edc b/edc/text_viewer.edc new file mode 100644 index 0000000..7c6ff32 --- /dev/null +++ b/edc/text_viewer.edc @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +group{ + name: "text_viewer"; + parts{ + PART_BG("bg") /* 480 * unknown */ + PART_V_PIXEL_RECT("top_margin", 10, "bg", 0.0, 0.0) + PART_V_PIXEL_RECT("text.bg", 48, "top_margin", 1.0, 0.0) + PART_V_PIXEL_RECT("top_margin2", 10, "text.bg", 1.0, 0.0) + /* content */ + PART_TEXT_GRAY_RIGHT("elm.text.date", 10/480, 0.0, "text.bg", 470/480, 1.0, "text.bg", "date", "Helvetica Neue:style=Medium", 32) + PART_SWALLOW_REL("elm.swallow.text", 10/480, 1.0, "top_margin2", 470/480, 1.0, "bg") + }/* end part */ +} diff --git a/extend/extended-edc.h b/extend/extended-edc.h new file mode 100644 index 0000000..0b999f5 --- /dev/null +++ b/extend/extended-edc.h @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __EXTENDED_EDC_H__ +#define __EXTENDED_EDC_H__ + +#define PPART PART: +#define PIMAGE IMAGE: + +/***********************************************************************/ +/* size difinition layer */ +#define PART_BG(iName)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_BG_EX(iName, iMinx, iMiny)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + min: iMinx iMiny;\ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_RECT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: iR1x iR1y; to: iR1t; } \ + rel2 { relative: iR2x iR2y; to: iR2t; } \ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_V_PIXEL_RECT(iName, size, iTo, iRy, iAy)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + min: 0 size;\ + align: 0.5 iAy;\ + fixed: 0 1;\ + rel1 { relative: 0.0 iRy; to: iTo; } \ + rel2 { relative: 1.0 iRy; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_H_PIXEL_RECT(iName, size, iTo, iRx, iAx)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + min: size 0;\ + align: iAx 0.5;\ + fixed: 1 0;\ + rel1 { relative: iRx 0.0; to: iTo; } \ + rel2 { relative: iRx 1.0; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_PIXEL_RECT(iName, iX, iY, iRx, iRy, iTo, iAx, iAy)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + min: iX iY;\ + align: iAx iAy;\ + fixed: 1 1;\ + rel1 { relative: iRx iRy; to: iTo; } \ + rel2 { relative: iRx iRy; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + + +/* vertical divided rect, index range from 0~N-1 + * iIndex must be immediate integer and expression like (1+2) is not allowed + */ +#define PART_V_DIVID_RECT(iName, iTo, iIndex, iN)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 (iIndex%iN)/iN; to: iTo; } \ + rel2 { relative: 1.0 (iIndex%iN+1)/iN; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + +/* horizontal divided rect, index range from 0~N-1 + * iIndex must be immediate integer and expression like (1+2) is not allowed + */ +#define PART_H_DIVID_RECT(iName, iTo, iIndex, iN)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: (iIndex%iN)/iN 0.0; to: iTo; } \ + rel2 { relative: (iIndex%iN+1)/iN 1.0; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + +#define PART_CLIPPER_RECT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: iR1x iR1y; to: iR1t; } \ + rel2 { relative: iR2x iR2y; to: iR2t; } \ + color: 255 255 255 255;\ + } \ +} \ + +/***********************************************************************/ +/* mouse event filter layer */ +#define PART_EVENT_RECT(iName, iTo)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 1;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + color: 0 0 0 0;\ + } \ +} \ + +/***********************************************************************/ +/* content layer */ +#define PART_COLOR_RECT(iName, iTo, iCr, iCg, iCb, iCa)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + color: iCr iCg iCb iCa;\ + } \ +} \ + +#define PART_COLOR_RECT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t, iCr, iCg, iCb, iCa)\ +part {\ + name: iName;\ + type: RECT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: iR1x iR1y; to: iR1t; } \ + rel2 { relative: iR2x iR2y; to: iR2t; } \ + color: iCr iCg iCb iCa;\ + } \ +} \ + +#define PART_IMAGE(iName, iTo, iImage)\ +part {\ + name: iName;\ + type: IMAGE;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + image.normal : iImage;\ + } \ +} \ + +#define PART_IMAGE_REL(iName, iImage, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_IMAGE(iName, "_"iName, iImage)\ + +#define PART_BORDER_IMAGE(iName, iTo, iImage, iBl, iBr, iBt, iBb)\ +part {\ + name: iName;\ + type: IMAGE;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + image.normal : iImage;\ + image.border : iBl iBr iBt iBb;\ + } \ +} \ + +#define PART_SWALLOW(iName, iTo)\ +part {\ + name: iName;\ + type: SWALLOW;\ + mouse_events: 1;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + fixed: 1 1; \ + } \ +} \ + +#define PART_SWALLOW_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_SWALLOW(iName, "_"iName)\ + +#define PART_UNVISIBLE_SWALLOW(iName, iTo)\ +part {\ + name: iName;\ + type: SWALLOW;\ + mouse_events: 1;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + visible: 0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + } \ +} \ + +#define PART_UNVISIBLE_SWALLOW_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_UNVISIBLE_SWALLOW(iName, "_"iName)\ + +#define PART_CLIPPED_SWALLOW(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t,\ + iAx, iAy, iCliper)\ +part {\ + name: iName;\ + type: SWALLOW;\ + mouse_events: 0;\ + scale: 1;\ + clip_to: iCliper;\ + description {\ + state: "default" 0.0;\ + align: iAx iAy;\ + fixed: 1 1;\ + rel1 { relative: iR1x iR1y; to: iR1t; } \ + rel2 { relative: iR2x iR2y; to: iR2t; } \ + } \ +} \ + +#define PART_TEXT(iName, iTo, iText, iFont, iSize,\ + iAx, iAy, iCr, iCg, iCb, iCa)\ +part {\ + name: iName;\ + type: TEXT;\ + mouse_events: 0;\ + scale: 1;\ + description {\ + state: "default" 0.0;\ + rel1 { relative: 0.0 0.0; to: iTo; } \ + rel2 { relative: 1.0 1.0; to: iTo; } \ + color: iCr iCg iCb iCa;\ + text {\ + text: iText;\ + font: iFont;\ + size: iSize;\ + align: iAx iAy;\ + } \ + } \ +} \ + +#define PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t,\ + iText, iFont, iSize, iAx, iAy, iCr, iCg, iCb, iCa)\ +PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +PART_TEXT(iName, "_"iName, iText, iFont, iSize, iAx, iAy, iCr, iCg, iCb, iCa)\ + +/***********************************************************************/ +/* script */ +/* ugh!!!, iPart, iR1t, iR2t and iV of SCRIPT_SET_IMAGE should not be quoted with "" */ +#define SCRIPT_CUSTOM_PART(iPart)\ +custom_state(PPART#iPart, "default", 0.0);\ +set_state(PPART#iPart, "custom", 0.0) + +/* pay attention, rel paramater can only be float, script will not do evaluation of mathematics expression + eg. 10/100 is illegal, 0.1 is correct */ +#define SCRIPT_SET_REL(iPart, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\ +set_state_val(PPART#iPart, STATE_REL1, iR1x, iR1y);\ +set_state_val(PPART#iPart, STATE_REL1_TO, PPART#iR1t, PPART#iR1t);\ +set_state_val(PPART#iPart, STATE_REL2, iR2x, iR2y);\ +set_state_val(PPART#iPart, STATE_REL2_TO, PPART#iR2t, PPART#iR2t)\ + +#define SCRIPT_SET_VISIBLE(iPart, iV)\ +set_state_val(PPART#iPart, STATE_VISIBLE, iV) + +#define SCRIPT_SET_IMAGE(iPart, iV)\ +set_state_val(PPART#iPart, STATE_IMAGE, PIMAGE#iV) + +#define SCRIPT_SET_COLOR(iPart, iCr, iCg, iCb, iCa)\ +set_state_val(PPART#iPart, STATE_COLOR, iCr, iCg, iCb, iCa) + + +/***********************************************************************/ +/* program */ +/* ugh!!! isignal, isource, iPart should not quoted with "" */ +#define PROGRAM_SET_VISIBLE(isignal, isource, iPart, iV)\ +program {\ + name: #isource#isignal;\ + source: #isource;\ + signal: #isignal;\ + script {\ + SCRIPT_SET_VISIBLE(iPart, iV);\ + } \ +} \ + +#endif /* __EXTENDED_EDC_H__ */ diff --git a/extend/extended-elm.c b/extend/extended-elm.c new file mode 100644 index 0000000..1d1e546 --- /dev/null +++ b/extend/extended-elm.c @@ -0,0 +1,442 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include + +/** + * elm_scroller_create + * + * @brief This function is an encapsulated vesion of elm_scroller_add + * + * @param [in] parent The parent object + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_scroller_create(Evas_Object *parent) +{ + Evas_Object *sc; + sc = elm_scroller_add(parent); + elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + 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); + return sc; +} + +/** + * elm_layout_create + * + * @brief This function is an encapsulated vesion of elm_layout_add + * + * @param [in] parent The parent object + * + * @param [in] file The path to file (edj) that will be used as layout + * + * @param [in] group The group that the layout belongs in edje file + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_layout_create(Evas_Object *parent, const char *file, const char *group) +{ + Evas_Object *ly; + ly = elm_layout_add(parent); + if (elm_layout_file_set(ly, file, group)) { + evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, 0); + evas_object_show(ly); + } else { + evas_object_del(ly); + ly = NULL; + } + return ly; +} + +/** + * elm_label_create + * + * @brief This function is an encapsulated vesion of elm_label_add + * + * @param [in] parent The parent object + * + * @param [in] text The label will be used on the object + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_label_create(Evas_Object *parent, const char *text) +{ + Evas_Object *label; + label = elm_label_add(parent); + elm_label_line_wrap_set(label, ELM_WRAP_CHAR); + elm_object_text_set(label, text); + evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0); + evas_object_show(label); + return label; +} + +/** + * elm_check_create + * + * @brief This function is an encapsulated vesion of elm_check_add + * + * @param [in] parent The parent object + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_check_create(Evas_Object *parent) +{ + Evas_Object *check; + check = elm_check_add(parent); + evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0); + evas_object_show(check); + return check; +} + +/** + * elm_button_create + * + * @brief This function is an encapsulated vesion of elm_button_add + * + * @param [in] parent The parent object + * + * @param [in] text The label will be used on the object + * + * @param [in] click_cb The callback function when clicked + * + * @param [in] data User data to be passed to the callback function + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_button_create(Evas_Object *parent, const char *text, Evas_Smart_Cb click_cb, + void *data) +{ + Evas_Object *btn; + btn = elm_button_add(parent); + elm_object_text_set(btn, text); + evas_object_smart_callback_add(btn, "clicked", click_cb, data); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0); + evas_object_show(btn); + return btn; +} + +/** + * elm_entry_create + * + * @brief This function is an encapsulated vesion of elm_entry_add + * + * @param [in] parent The parent object + * + * @param [in] text The label will be used on the object + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_entry_create(Evas_Object *parent, const char *text) +{ + Evas_Object *entry; + entry = elm_entry_add(parent); + elm_entry_entry_set(entry, text); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0); + elm_entry_input_panel_enabled_set(entry, EINA_FALSE); + elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT); + evas_object_show(entry); + return entry; +} + +/** + * elm_icon_create + * + * @brief This function is an encapsulated vesion of elm_icon_add + * + * @param [in] parent The parent object + * + * @param [in] file The path of icon file + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_icon_create(Evas_Object *parent, const char *file) +{ + Evas_Object *ic; + ic = elm_icon_add(parent); + elm_icon_file_set(ic, file, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_icon_resizable_set(ic, 1, 1); + evas_object_show(ic); + return ic; +} + +/** + * elm_navigator_btn_create + * + * @brief This function is an encapsulated vesion of elm_icon_add + * + * @param [in] parent The parent object + * + * @param [in] text The label will be used on the object + * + * @param [in] icon_path The icon will be displayed on the object + * + * @param [in] style "navigationbar_control/left(center|right)" + * + * @param [in] click_cb The callback function when clicked + * + * @param [in] data User data to be passed to the callback function + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_navigator_btn_create(Evas_Object *parent, const char *text, + const char *icon_path, const char *style, + Evas_Smart_Cb click_cb, void *data) +{ + Evas_Object *btn = NULL; + + btn = elm_button_create(parent, text, click_cb, data); + elm_object_style_set(btn, "naviframe/title/default"); + return btn; +} + +/** + * elm_swallowed_scroller + * + * @brief This function is an encapsulated vesion of elm_scroller_add + * + * @param [in] parent The parent object + * + * @param [in] part The swallow part name in the parent layout obj + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_swallowed_scroller(Evas_Object *parent, const char *part) +{ + Evas_Object *eo = elm_scroller_create(parent); + elm_object_part_content_set(parent, part, eo); + return eo; +} + +/** + * elm_swallowed_layout + * + * @brief This function is an encapsulated vesion of elm_layout_add + * + * @param [in] parent The parent object + * + * @param [in] part The swallow part name in the parent layout obj + * + * @param [in] file The path to file (edj) that will be used as layout + * + * @param [in] group The group that the layout belongs in edje file + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_swallowed_layout(Evas_Object *parent, const char *part, const char *file, + const char *group) +{ + Evas_Object *eo = elm_layout_create(parent, file, group); + elm_object_part_content_set(parent, part, eo); + return eo; +} + +/** + * elm_swallowed_button + * + * @brief This function is an encapsulated vesion of elm_button_add + * + * @param [in] parent The parent object + * + * @param [in] part The swallow part name in the parent layout obj + * + * @param [in] text The label will be used on the object + * + * @param [in] click_cb The callback function when clicked + * + * @param [in] data User data to be passed to the callback function + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_swallowed_button(Evas_Object *parent, const char *part, const char *text, + Evas_Smart_Cb click_cb, void *data) +{ + Evas_Object *eo = elm_button_create(parent, text, click_cb, data); + elm_object_part_content_set(parent, part, eo); + return eo; +} + +/** + * elm_swallowed_entry + * + * @brief This function is an encapsulated vesion of elm_entry_add + * + * @param [in] parent The parent object + * + * @param [in] part The swallow part name in the parent layout obj + * + * @param [in] text The label will be used on the object + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_swallowed_entry(Evas_Object *parent, const char *part, const char *text) +{ + Evas_Object *eo = elm_entry_create(parent, text); + elm_object_part_content_set(parent, part, eo); + return eo; +} + +/** + * elm_swallowed_icon + * + * @brief This function is an encapsulated vesion of elm_icon_add + * + * @param [in] parent The parent object + * + * @param [in] part The swallow part name in the parent layout obj + * + * @param [in] file The path of icon file + * + * @return Return pointer to elm object (Success) or NULL (Failed) + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *elm_swallowed_icon(Evas_Object *parent, const char *part, const char *file) +{ + Evas_Object *eo = elm_icon_create(parent, file); + elm_object_part_content_set(parent, part, eo); + return eo; +} + +/** + * elm_layout_content_del + * + * @brief Destroy object from layout + * + * @param [in] parent The parent object + * + * @param [in] part The name of swallowed part in the parent layout obj + * + * @return None + * + * @exception None + * + * @remark None + * + * @see + * + */ +void elm_layout_content_del(Evas_Object *parent, const char *part) +{ + Evas_Object *eo = elm_object_part_content_unset(parent, part); + if (eo != NULL) { + evas_object_del(eo); + } +} + diff --git a/extend/extended-elm.h b/extend/extended-elm.h new file mode 100644 index 0000000..da295b9 --- /dev/null +++ b/extend/extended-elm.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __EXTENDED_ELM_H__ +#define __EXTENDED_ELM_H__ + +#include + +Evas_Object *elm_scroller_create(Evas_Object *parent); +Evas_Object *elm_layout_create(Evas_Object *parent, const char *file, const char *group); +Evas_Object *elm_label_create(Evas_Object *parent, const char *text); +Evas_Object *elm_check_create(Evas_Object *parent); +Evas_Object *elm_button_create(Evas_Object *parent, const char *text, Evas_Smart_Cb click_cb, + void *data); +Evas_Object *elm_entry_create(Evas_Object *parent, const char *text); +Evas_Object *elm_icon_create(Evas_Object *parent, const char *file); +Evas_Object *elm_navigator_btn_create(Evas_Object *parent, const char *text, + const char *icon_path, const char *style, + Evas_Smart_Cb click_cb, void *data); +Evas_Object *elm_swallowed_scroller(Evas_Object *parent, const char *part); +Evas_Object *elm_swallowed_layout(Evas_Object *parent, const char *part, const char *file, + const char *group); +Evas_Object *elm_swallowed_button(Evas_Object *parent, const char *part, const char *text, + Evas_Smart_Cb click_cb, void *data); +Evas_Object *elm_swallowed_entry(Evas_Object *parent, const char *part, const char *text); +Evas_Object *elm_swallowed_icon(Evas_Object *parent, const char *part, const char *file); +void elm_layout_content_del(Evas_Object *parent, const char *part); + +#endif /* __EXTENDED_ELM_H__ */ diff --git a/extend/gravel.h b/extend/gravel.h new file mode 100644 index 0000000..73190c1 --- /dev/null +++ b/extend/gravel.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __GRAVEL_H__ +#define __GRAVEL_H__ + +#include + +/* use prefix 'P' means print */ +#define PTAG LOGD("[%s : %d]\n", __FILE__, __LINE__) +#define PLOG(fmt, arg...) LOGD(" ## "fmt, ##arg) +#define PFUNC_ENTER LOGD("ENTER : %s\n", __func__) +#define PFUNC_LEAVE LOGD("LEAVE : %s\n", __func__) + +#define ARRAY_SIZE(array) \ + ((int)(sizeof(array) / sizeof(array[0]))) + +#define STR_EQUAL(str1, str2) \ + (strcmp(str1, str2) == 0) + +#define SSTRLEN(str)\ + (str == NULL ? 0 : strlen(str))\ + +#define sncat(to, size, from) \ + strncat(to, from, size-strlen(to)-1) + +#define sncatprintf(s, size, fmt, args...) \ + snprintf(s+strlen(s), size-strlen(s), fmt, ##args) + +#define SMALLOC(Type)\ + (Type *)calloc(1, sizeof(Type))\ + +#define SFREE(var)\ + if (var != NULL) {\ + free(var);\ + var = NULL;\ + } \ + +#define RETIF(condition)\ + if (condition) return + +#define RETVIF(condition, val)\ + if (condition) return val + +#endif /* __GRAVEL_H__ */ diff --git a/extend/supplement.c b/extend/supplement.c new file mode 100644 index 0000000..ef9ec07 --- /dev/null +++ b/extend/supplement.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include + +static void _bundle_iterate_dump_cb(const char *k, const char *v, void *data) +{ + LOGD("%s -> %s\n", k, v); +} + +void bundle_dump(bundle *b) +{ + if (b != NULL) { + bundle_iterate(b, _bundle_iterate_dump_cb, NULL); + } +} + +Eina_Bool bundle_key_check(bundle *b, const char *key, const char *val) +{ + const char *str = bundle_get_val(b, key); + if (str != NULL) { + if (strcmp(str, val) == 0) { + return EINA_TRUE; + } + } + return EINA_FALSE; +} + +void evas_object_geometry_dump(Evas_Object *eo) +{ + Evas_Coord x, y, w, h; + evas_object_geometry_get(eo, &x, &y, &w, &h); + LOGD("[evas_object_geometry_dump] geometry of %x : %d %d %d %d\n", eo, x, y, w, h); +} + +void evas_object_event_hit(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + LOGD("[%s] %x : %s\n", __func__, obj, (char *)data); +} + +void evas_object_smart_event_hit(void *data, Evas_Object *obj, void *event_info) +{ + LOGD("[%s] %x : %s\n", __func__, obj, (char *)data); +} + +typedef struct __rf_data_t { + Evas_Smart_Cb cb; + void *data; +}rf_data_t; + +static void _render_flush_post_cb(void *data, Evas *e, void *event_info) +{ + rf_data_t *rf = (rf_data_t *)data; + rf->cb(rf->data, NULL, NULL); + evas_event_callback_del(e, EVAS_CALLBACK_RENDER_FLUSH_POST, _render_flush_post_cb); + SFREE(rf); +} + +void evas_object_render_flush_hook(Evas_Object *obj, Evas_Smart_Cb cb, void *data) +{ + RETIF(obj==NULL); + Evas *e = evas_object_evas_get(obj); + rf_data_t *rf = SMALLOC(rf_data_t); + RETIF(rf==NULL); + rf->cb = cb; + rf->data = data; + evas_event_callback_add(e, EVAS_CALLBACK_RENDER_FLUSH_POST, _render_flush_post_cb, rf); +} + diff --git a/extend/supplement.h b/extend/supplement.h new file mode 100644 index 0000000..f530f5c --- /dev/null +++ b/extend/supplement.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __SUPPLEMENT_H__ +#define __SUPPLEMENT_H__ + +#include +#include +#include + +/* extended type definition */ +typedef struct ui_gadget ui_gadget_t; +typedef struct ug_cbs ug_cbs_t; + +/* extended macroes */ +#define evas_object_single_event_dump(obj, event) \ + evas_object_event_callback_add(obj, event, evas_object_event_hit, #obj"\t"#event) + +#define evas_object_events_dump(obj) \ +do { \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_MOVE); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_RESIZE); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_MOUSE_DOWN); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_HOLD); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_MOUSE_UP); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_DEL); \ + evas_object_single_event_dump(obj, EVAS_CALLBACK_FREE); \ +} while (0) + +/* dump specified event of smart object */ +#define evas_object_smart_event_dump(obj, event) \ + evas_object_smart_callback_add(obj, event, evas_object_smart_event_hit, #obj "\t" event); + +/* extended functions */ +void bundle_dump(bundle *b); +Eina_Bool bundle_key_check(bundle *b, const char *key, const char *val); +void evas_object_geometry_dump(Evas_Object *eo); +void evas_object_event_hit(void *data, Evas *e, Evas_Object *obj, void *event_info); +void evas_object_smart_event_hit(void *data, Evas_Object *obj, void *event_info); +void evas_object_render_flush_hook(Evas_Object *obj, Evas_Smart_Cb cb, void *data); +void elm_widget_on_focus_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data); + +#endif /* __SUPPLEMENT_H__ */ diff --git a/images/00_search_input_field_bg.png b/images/00_search_input_field_bg.png new file mode 100644 index 0000000..cc89625 Binary files /dev/null and b/images/00_search_input_field_bg.png differ diff --git a/images/01_header_icon_add.png b/images/01_header_icon_add.png new file mode 100644 index 0000000..43c4984 Binary files /dev/null and b/images/01_header_icon_add.png differ diff --git a/images/01_header_icon_cancel.png b/images/01_header_icon_cancel.png new file mode 100644 index 0000000..4fb54c3 Binary files /dev/null and b/images/01_header_icon_cancel.png differ diff --git a/images/01_header_icon_delete.png b/images/01_header_icon_delete.png new file mode 100644 index 0000000..07e2898 Binary files /dev/null and b/images/01_header_icon_delete.png differ diff --git a/images/01_header_icon_done.png b/images/01_header_icon_done.png new file mode 100644 index 0000000..d771640 Binary files /dev/null and b/images/01_header_icon_done.png differ diff --git a/images/01_header_icon_edit.png b/images/01_header_icon_edit.png new file mode 100644 index 0000000..ea2535d Binary files /dev/null and b/images/01_header_icon_edit.png differ diff --git a/images/01_header_icon_others.png b/images/01_header_icon_others.png new file mode 100644 index 0000000..4fc9dfa Binary files /dev/null and b/images/01_header_icon_others.png differ diff --git a/include/memo-assist.h b/include/memo-assist.h new file mode 100644 index 0000000..74b1bee --- /dev/null +++ b/include/memo-assist.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_ASSIST_H__ +#define __MEMO_ASSIST_H__ + +#include +#include +#include + +#define DOODLE_TITLE_PREFIX "Drawing-" + +#define ARGB_JOIN(a, r, g, b) \ + (((a) << 24) + ((r) << 16) + ((g) << 8) + (b)) + +#define IN_RECT_CHECK(x, y, rx, ry, rw, rh)\ + (((unsigned)((x) - (rx)) < (rw)) && ((unsigned)((y) - (ry)) < (rh))) + +#define CLIP_RECT_TO_RECT(x, y, w, h, rx, ry, rw, rh)\ +{\ + int _t0, _t1;\ +\ + _t0 = MAX(x, (rx));\ + _t1 = MIN(x + w, (rx) + (rw));\ + x = _t0;\ + w = _t1 - _t0;\ + _t0 = MAX(y, (ry));\ + _t1 = MIN(y + h, (ry) + (rh));\ + y = _t0;\ + h = _t1 - _t0;\ +} + +typedef void (*Memo_Component_Callback)(void *data, const char *msg, void *event); + +typedef struct memo_data memo_data_t; +typedef struct memo_data_list memo_data_list_t; + +char * strcasestr (const char *haystack, const char *needle); +char * strptime (const char *s, const char *fmt, struct tm *tp); +void icu_init(); +char *memo_get_doodle_title(); +void memo_time_format(char *buf, int len, time_t time); +time_t memo_get_binary_release_date(); +void memo_com_dummy_cb(void *data, const char *msg, void *event); +void memo_create_yes_no_popup(Evas_Object *win, const char *msg, Evas_Smart_Cb on_yes, Evas_Smart_Cb on_no, void *data); +void memo_tool_btn_focus_set(Evas_Object *eo, Eina_Bool status); +void *memo_load_font_size_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_del_font_size_selector(void *h_fss); +void *memo_load_color_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_del_color_selector(void *h_cs); +void *memo_load_pencil_size_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_del_pencil_size_selector(void *h_pss); +Eina_Bool memo_black_theme_check(); +void memo_navigator_pop(Evas_Object *navi); +Elm_Object_Item *memo_naviframe_item_push(Evas_Object *obj, const char *title_label, + Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style); +Eina_Bool memo_comment_savable(Evas_Object *entry, const char *orig_utf8); +void memo_comment_recover(Evas_Object *entry, const char *orig_utf8); +Evas_Object *memo_controlbar_add(Evas_Object *parent); + +#endif /* __MEMO_ASSIST_H__ */ diff --git a/include/memo-genlist.h b/include/memo-genlist.h new file mode 100644 index 0000000..5a4c93b --- /dev/null +++ b/include/memo-genlist.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_GENLIST_H__ +#define __MEMO_GENLIST_H__ + +typedef struct __gl_data_t { + /* common */ + int index; + int has_doodle; + time_t mod_time; + Evas_Smart_Cb on_select; + /* checkbox */ + Eina_Bool check; + Evas_Smart_Cb on_change; + /* sweep */ + Evas_Smart_Cb on_delete; + Evas_Smart_Cb on_send; + /* search */ + const char *search; + /* user data */ + void *user_data; +} gl_data_t; + +char *memo_gl_label_get(void *data, Evas_Object *obj, const char *part); +Evas_Object *memo_gl_icon_get(void *data, Evas_Object *obj, const char *part); +Eina_Bool memo_gl_state_get(void *data, Evas_Object *obj, const char *part); +void memo_gl_del(void *data, Evas_Object *obj); +void memo_gl_itc_init(Elm_Genlist_Item_Class *itc, const char *style); +void memo_gld_init(gl_data_t *data, memo_data_t *md, void *user_data, Evas_Smart_Cb on_select); + +#endif /* __MEMO_GENLIST_H__ */ diff --git a/include/memo.h b/include/memo.h new file mode 100644 index 0000000..1cf28e7 --- /dev/null +++ b/include/memo.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_APP_H__ +#define __MEMO_APP_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define MEMO_GROUP_NAME_MAX 128 /**< max length for group name */ +#define MEMO_MAX_RECORD 400 + +#define MAX_REALIZED_RECORD 8 + +#define DEFAULT_FONT_SIZE 32 + +#define AUL_PARAM_ID "__AUL_PARAM_ID" +#define MEMO_NAVIFRAME_ITEM_PREV_BTN "prev_btn" + +typedef enum { + MEMO_VIEW_NULL = 0, + MEMO_LIST_VIEW, + MEMO_DETAIL_VIEW, + MEMO_EDIT_VIEW, + MEMO_EDIT_LIST_VIEW, + MEMO_VIEWS, +} memo_view_type_t; + +typedef struct __appdata { + Evas *evas; + Evas_Object *win_main; + Evas_Object *ly_main; /* window */ + Evas_Object *navigator; + + /* add more variables here */ + memo_view_type_t init_view; + int index; /* index of last clicked memo */ + int index_detail; /* for temporarily usage only */ + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + char *init_str; + Evas_Object *popup; /* popup when data modified by external app(kies) */ +} appdata; + +void *memo_load_list_view(appdata *ad); +void *memo_load_edit_view(appdata *ad); +void *memo_load_edit_list_view(appdata *ad); +void *memo_load_detail_view(appdata *ad); + +void *memo_load_list_viewer(Evas_Object *parent, Evas_Object *win, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_list_viewer(void *h_lv); +void memo_list_editor_share_records(void *h_le); +void memo_list_editor_delete_records(void *h_le); +void *memo_load_list_editor(Evas_Object *parent, Evas_Object *win, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_list_editor(void *h_le); +void *memo_load_text_viewer(Evas_Object *parent, Evas_Object *win, int id, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_text_viewer(void *h_tv); +void memo_text_viewer_share_record(void *h_tv); +void *memo_load_doodle_viewer(Evas_Object *parent, Evas_Object *win, int id, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_doodle_viewer(void *h_dv); +void memo_doodle_viewer_pre_del(void *h_dv); +void memo_doodle_viewer_share_record(void *h_dv); +void memo_doodle_viewer_save(void *h_dv); +void memo_doodle_viewer_cancel(void *h_dv); + +#endif /* __MEMO_APP_H__ */ diff --git a/include/memo_doodle_editor.h b/include/memo_doodle_editor.h new file mode 100644 index 0000000..278ed42 --- /dev/null +++ b/include/memo_doodle_editor.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_DOODLE_EDITOR_H__ +#define __MEMO_DOODLE_EDITOR_H__ + +void memo_doodle_editor_time_format_update(void *h_de); +void memo_doodle_editor_cancel(void *h_de); +void memo_doodle_editor_save(void *h_de); +void *memo_load_doodle_editor(Evas_Object *win, Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_doodle_editor(void *h_de); + +#endif /* __MEMO_DOODLE_EDITOR_H__ */ diff --git a/include/memo_string.h b/include/memo_string.h new file mode 100644 index 0000000..d789ee3 --- /dev/null +++ b/include/memo_string.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_STRING_H__ +#define __MEMO_STRING_H__ + +/* system string */ +#define MEMO_I18N_BACK dgettext("sys_string", "IDS_COM_BODY_BACK") /* Back */ +#define MEMO_I18N_CALENDAR dgettext("sys_string", "IDS_COM_BODY_CALENDAR") /* Calendar */ +#define MEMO_I18N_CANCEL dgettext("sys_string", "IDS_COM_POP_CANCEL") /* Cancel */ +#define MEMO_I18N_CLOSE dgettext("sys_string", "IDS_COM_BODY_CLOSE") /* Close */ +#define MEMO_I18N_CREATE dgettext("sys_string", "IDS_COM_BODY_CREATE") /* Create */ +#define MEMO_I18N_DELETE dgettext("sys_string", "IDS_COM_BODY_DELETE") /* Delete */ +#define MEMO_I18N_EDIT dgettext("sys_string", "IDS_COM_BODY_EDIT") /* Edit */ +#define MEMO_I18N_EMAIL dgettext("sys_string", "IDS_COM_BODY_EMAIL") /* Email */ +#define MEMO_I18N_FACEBOOK dgettext("sys_string", "IDS_COM_BODY_FACEBOOK") /* Facebook */ +#define MEMO_I18N_MEMO dgettext("sys_string", "IDS_COM_BODY_MEMO") /* Memo */ +#define MEMO_I18N_MESSAGE dgettext("sys_string", "IDS_COM_BODY_MESSAGE") /* Message */ +#define MEMO_I18N_NO dgettext("sys_string", "IDS_COM_SK_NO") /* No */ +#define MEMO_I18N_SAVE dgettext("sys_string", "IDS_COM_OPT_SAVE") /* Save */ +#define MEMO_I18N_SEARCH dgettext("sys_string", "IDS_COM_BODY_SEARCH") /* Search */ +#define MEMO_I18N_SELECT_ALL dgettext("sys_string", "IDS_COM_BODY_SELECT_ALL") /* Select all */ +#define MEMO_I18N_SEND dgettext("sys_string", "IDS_COM_BODY_SEND") /* Send */ +#define MEMO_I18N_SEND_MESSAGE dgettext("sys_string", "IDS_COM_BODY_SEND_MESSAGE") /* Send message */ +#define MEMO_I18N_SET dgettext("sys_string", "IDS_COM_SK_SET") /* Set */ +#define MEMO_I18N_SHARE dgettext("sys_string", "IDS_COM_BUTTON_SHARE") /* Share */ +#define MEMO_I18N_TWITTER dgettext("sys_string", "IDS_COM_BODY_TWITTER") /* Twitter */ +#define MEMO_I18N_VIDEO_CALL dgettext("sys_string", "IDS_COM_BODY_VIDEO_CALL") /* Video call */ +#define MEMO_I18N_VOICE_CALL dgettext("sys_string", "IDS_COM_BODY_VOICE_CALL") /* Voice call */ +#define MEMO_I18N_YES dgettext("sys_string", "IDS_COM_SK_YES") /* Yes */ + +/* app string */ +#define MEMO_I18N_ADD_COMMENT dgettext("memo", "IDS_MEMO_BODY_ADD_COMMENT") /* Add comment */ +#define MEMO_I18N_ADD_TO_CONTACT dgettext("memo", "IDS_MEMO_BODY_ADD_TO_CONTACT") /* Add to contact */ +#define MEMO_I18N_DRAWING dgettext("memo", "IDS_MEMO_BODY_DRAWING") /* Drawing */ +#define MEMO_I18N_EDIT_NOTE dgettext("memo", "IDS_MEMO_BODY_EDIT_NOTE") /* Edit note */ +#define MEMO_I18N_NO_MEMOS dgettext("memo", "IDS_MEMO_BODY_NO_MEMOS") /* No memos */ +#define MEMO_I18N_SAVE_MEMO dgettext("memo", "IDS_MEMO_POP_DIALOG_SAVE_MEMO") /* Save memo? */ +#define MEMO_I18N_SELECT_MEMO dgettext("memo", "IDS_MEMO_HEADER_SELECT_MEMO_ABB") /* Select memo */ +#define MEMO_I18N_SEND_EMAIL dgettext("memo", "IDS_MEMO_OPT_SEND_EMAIL") /* Send email */ +#define MEMO_I18N_TEXT dgettext("memo", "IDS_MEMO_BODY_TEXT") /* Text */ +#define MEMO_I18N_1_MEMO_SELECTED dgettext("memo", "IDS_MEMO_POP_1_MEMO_SELECTED") /* 1 memo selected */ +#define MEMO_I18N_D_MEMOS_SELECTED dgettext("memo", "IDS_MEMO_POP_PD_MEMOS_SELECTED") /* %d memos selected */ + +/* custom string */ +#define MEMO_I18N_EDIT_COMMENT _("Edit comment") /* Edit comment */ +#define MEMO_I18N_EDIT_DRAWING _("Edit drawing") /* Edit drawing */ +#define MEMO_I18N_CREATE_DRAWING _("Create Drawing") /* Create Drawing */ +#define MEMO_I18N_CREATE_NOTE _("Create Note") /* Create Note */ + +#endif /* __MEMO_STRING_H__ */ diff --git a/include/memo_text_editor.h b/include/memo_text_editor.h new file mode 100644 index 0000000..e7e33ee --- /dev/null +++ b/include/memo_text_editor.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#ifndef __MEMO_TEXT_EDITOR_H__ +#define __MEMO_TEXT_EDITOR_H__ + +void memo_text_editor_time_format_update(void *h_de); +void memo_text_editor_cancel(void *h_te); +void memo_text_editor_save(void *h_te); +void *memo_load_text_editor(Evas_Object *win, Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data); +void memo_destroy_text_editor(void *h_te); + +#endif /* __MEMO_TEXT_EDITOR_H__ */ diff --git a/include/memo_ug.h b/include/memo_ug.h new file mode 100644 index 0000000..4ef39ba --- /dev/null +++ b/include/memo_ug.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ +#ifndef __MEMO_SG_H__ +#define __MEMO_SG_H__ + +#include +#include +#include + +/* UG Name */ +#define UG_NAME_EMAIL "email-composer-efl" +#define UG_NAME_MESSAGE "msg-composer-efl" +#define UG_NAME_CONTACT_ADD "contacts-details-efl" +#define UG_NAME_CALENDAR "calendar-edit-efl" + +/* AUL NAME */ +#define AUL_NAME_CALENDER PACKAGE_PREFIX".efl-calendar" +#define AUL_NAME_VIOCE_CALL PACKAGE_PREFIX".call" +#define AUL_NAME_VEDIO_CALL PACKAGE_PREFIX".vtmain" + +/* UG Function Declaration*/ +/* auto stripped function prototype from (../src/memo_ug.c) */ +void ug_launch_common(bundle *bd, char *ug_name); +void ug_launch_common_var(char *ug_name, ...); +void ug_launch_calender(Eina_List *list); +void memo_ug_init(Evas_Object *win); +void memo_share(Evas_Object *parent, int *indexes, int n); +/* end auto strip */ + +#endif /* __MEMO_SG_H__ */ diff --git a/memo.edc b/memo.edc new file mode 100644 index 0000000..09f7d16 --- /dev/null +++ b/memo.edc @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include + +collections { + #include + #include + #include + #include + #include + #include + #include + #include +} diff --git a/org.tizen.memo.desktop.in b/org.tizen.memo.desktop.in new file mode 100644 index 0000000..652c8f4 --- /dev/null +++ b/org.tizen.memo.desktop.in @@ -0,0 +1,27 @@ +Name=@PROJECT_NAME@ +Exec=@BINDIR@/@PROJECT_NAME@ +Icon=@PKGNAME@.png +Type=Application +MimeType= +Nodisplay=False +Version=0.1.0 +X-Tizen-TaskManage=True +X-Tizen-Multiple=False +X-Tizen-Removable=false + +Name[en_US]=Memo +Name[nl_NL]=Notities +Name[de_DE]=Memo +Name[zh_HK]=備忘錄 +Name[zh_CN]=备忘录 +Name[ru_RU]=Заметки +Name[ko_KR]=메모 +Name[zh_TW]=備忘錄 +Name[ja_JP]=メモ +Name[es_ES]=Notas +Name[el_GR]=Σημείωση +Name[it_IT]=Promemoria +Name[tr_TR]=Not +Name[pt_PT]=Memorando +Name[fr_FR]=Mémo + diff --git a/org.tizen.memo.png b/org.tizen.memo.png new file mode 100644 index 0000000..493aaae Binary files /dev/null and b/org.tizen.memo.png differ diff --git a/packaging/org.tizen.memo.spec b/packaging/org.tizen.memo.spec new file mode 100644 index 0000000..165b5e1 --- /dev/null +++ b/packaging/org.tizen.memo.spec @@ -0,0 +1,60 @@ +Name: org.tizen.memo +Summary: Memo displays the time as text +Version: 0.1.5 +Release: 78 +Group: TO_BE/FILLED_IN +License: Samsung Proprietary License +Source0: %{name}-%{version}.tar.gz +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(appsvc) +BuildRequires: pkgconfig(bundle) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(ecore-imf) +BuildRequires: pkgconfig(ecore-input) +BuildRequires: pkgconfig(ecore-x) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(eina) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(heynoti) +BuildRequires: pkgconfig(iniparser) +BuildRequires: pkgconfig(memo) +BuildRequires: pkgconfig(ui-gadget) +BuildRequires: pkgconfig(icu-uc) +BuildRequires: libug-contacts-devel + +BuildRequires: cmake +BuildRequires: edje-bin +BuildRequires: embryo-bin +BuildRequires: gettext-tools + + +%description +Memo displays the time as text (e.g. "It's just gone +five to ten"), and your next appointments, memos, +and alarms in a small window. + +%prep +%setup -q + +%build +export PREFIX="/opt/apps/org.tizen.memo" +export CFLAGS+=" -fPIC" +export LDFLAGS+=" -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both" + +cmake . -DCMAKE_INSTALL_PREFIX="$PREFIX" + +make %{?jobs:-j%jobs} + +%install +%make_install + +%post +chown -R 5000:5000 /opt/apps/org.tizen.memo/data + +%files +/opt/apps/org.tizen.memo/bin/* +/opt/apps/org.tizen.memo/res/* +/opt/apps/org.tizen.memo/data/* +/opt/share/applications/org.tizen.memo.desktop diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..fe43d1f --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,24 @@ +# for i18n + +SET(POFILES de_DE.po el_GR.po en.po es_ES.po fr_FR.po it_IT.po ja_JP.po ko_KR.po nl_NL.po pt_PT.po ru_RU.po tr_TR.po zh_CN.po zh_HK.po zh_TW.po) + +SET(MSGFMT "/usr/bin/msgfmt") + +FOREACH(pofile ${POFILES}) + SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile}) + MESSAGE("PO: ${pofile}") + GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE) + SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND( + OUTPUT ${moFile} + COMMAND ${MSGFMT} -o ${moFile} ${absPofile} + DEPENDS ${absPofile} + ) + INSTALL(FILES ${moFile} + DESTINATION ${LOCALEDIR}/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +MESSAGE(".mo files: ${moFiles}") +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..0efcb39 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,8 @@ +# List of source files containing translatable strings. +src/memo.c +src/memo_edit.c +src/memo_edit_list.c +src/memo_portrait_view.c +src/memo_search.c +src/memo_sg.c +src/memo_util.c diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100644 index 0000000..e74f0dd --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Memo speichern?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 Memo ausgewählt." + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d Memos ausgewählt." + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "E-Mail senden" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Kommentar hinzufügen" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Zu Kontakt hinzufügen" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Zeichnung" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Memo bearbeiten" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Text" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Memo wählen" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Memo erstellen" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Memo bearbeiten" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Keine Memos" + diff --git a/po/el_GR.po b/po/el_GR.po new file mode 100644 index 0000000..44b663b --- /dev/null +++ b/po/el_GR.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Αποθήκευση σημειώματος;" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "Επιλέχθηκε 1 σημείωμα" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "Επιλέχθηκαν %d σημειώματα" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Αποστολή email" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Προσθήκη σχολίου" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Προσθήκη σε επαφή" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Σχέδιο" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Επεξεργασία σημείωσης" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Κείμενο" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Επιλογή σημειώματος" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Δημιουργία σημειώματος" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Επεξεργασία σημειώματος" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Κανένα σημείωμα" + diff --git a/po/en.po b/po/en.po new file mode 100644 index 0000000..058ae46 --- /dev/null +++ b/po/en.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Save memo?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 memo selected" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d memos selected" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Send email" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Add comment" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Add to contact" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Drawing" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Edit note" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Text" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Select memo" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Create memo" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Edit memo" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "No memos" + diff --git a/po/es_ES.po b/po/es_ES.po new file mode 100644 index 0000000..6ba2fb8 --- /dev/null +++ b/po/es_ES.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "¿Guardar nota?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 nota seleccionada" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d notas seleccionadas" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Enviar correo electrónico" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Añadir comentario" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Añadir a contacto" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Dibujo" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Editar nota" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Texto" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Seleccionar nota" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Crear nota" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Editar nota" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "No hay notas" + diff --git a/po/fr_FR.po b/po/fr_FR.po new file mode 100644 index 0000000..4396486 --- /dev/null +++ b/po/fr_FR.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Enregistrer un mémo ?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 mémo sélectionné" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d mémos sélectionnés" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Envoyer un e-mail" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Ajouter commentaire" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Ajouter aux contacts" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Dessin" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Modifier note" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Texte" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Sélectionner mémo" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Nouveau mémo" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Modifier un mémo" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Aucun mémo" + diff --git a/po/header.sh b/po/header.sh new file mode 100755 index 0000000..20805ad --- /dev/null +++ b/po/header.sh @@ -0,0 +1 @@ +cat en.po | awk '{ if($1=="msgid") {ID=$0;} else if ($1=="msgstr"){printf("%s %s\n", ID, $0);}}' | sed "s/msgid//" | sed "s/msgstr//" | sed "s/^.*IDS_MEMO_\(.*\)\".*\"\(.*\)\".*$/#define MEMO_I18N_\1 _(\"IDS_MEMO_\1\") \/\/\2/" diff --git a/po/it_IT.po b/po/it_IT.po new file mode 100644 index 0000000..8dcbe0b --- /dev/null +++ b/po/it_IT.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Salvare promemoria?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 promemoria selezionato" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d promemoria selezionati" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Invia e-mail" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Agg. commento" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Aggiungi a contatto" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Disegno" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Modifica nota" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Testo" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Seleziona promemoria" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Crea promemoria" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Modifica promemoria" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Nessun promemoria" + diff --git a/po/ja_JP.po b/po/ja_JP.po new file mode 100644 index 0000000..fb98fc6 --- /dev/null +++ b/po/ja_JP.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "メモ​を​保存​しますか?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1件のメモを選択" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d件のメモを選択" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Eメール送信" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "コメント​​追加​" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "電話帳に追加" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "スケッチ" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "ノート​を​編集​します" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "テキスト" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "メモ​を​選択​して​ください" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "メモ​を​作成​します" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "メモ​を​編集" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "メモがありません。" + diff --git a/po/ko_KR.po b/po/ko_KR.po new file mode 100644 index 0000000..be2c236 --- /dev/null +++ b/po/ko_KR.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "메모를 저장할까요?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1개의 메모가 선택되었습니다" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d개의 메모가 선택되었습니다" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "이메일 보내기" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "댓글 추가" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "연락처에 추가" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "그림" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "메모 편집" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "문자" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "메모 선택" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "메모 추가" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "메모 편집" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "메모가 없습니다" + diff --git a/po/memo.pot b/po/memo.pot new file mode 100644 index 0000000..f600dba --- /dev/null +++ b/po/memo.pot @@ -0,0 +1,85 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-13 09:15+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/memo_edit.c:400 +msgid "Text" +msgstr "" + +#: src/memo_edit.c:401 +msgid "Draw" +msgstr "" + +#. create right button of navi bar +#: src/memo_edit.c:730 +msgid "IDS_COM_SK_DONE" +msgstr "" + +#. create right button of navi bar +#: src/memo_edit.c:732 src/memo_edit_list.c:277 src/memo_search.c:139 +msgid "IDS_MEMO_SK3_CANCEL" +msgstr "" + +#: src/memo_edit.c:733 +msgid "New" +msgstr "" + +#. buttons +#: src/memo_edit.c:733 src/memo_edit_list.c:278 src/memo_portrait_view.c:394 +msgid "IDS_COM_SK_EDIT" +msgstr "" + +#: src/memo_edit_list.c:160 src/memo_edit_list.c:185 +#: src/memo_portrait_view.c:116 src/memo_portrait_view.c:142 +msgid "via message" +msgstr "" + +#: src/memo_edit_list.c:164 src/memo_edit_list.c:186 +#: src/memo_portrait_view.c:120 src/memo_portrait_view.c:143 +msgid "via email" +msgstr "" + +#: src/memo_edit_list.c:187 src/memo_portrait_view.c:144 +msgid "to calendar" +msgstr "" + +#: src/memo_edit_list.c:188 src/memo_portrait_view.c:145 +msgid "to Facebook" +msgstr "" + +#: src/memo_edit_list.c:189 src/memo_portrait_view.c:146 +msgid "to Twitter" +msgstr "" + +#: src/memo_edit_list.c:191 src/memo_portrait_view.c:148 +#: src/memo_portrait_view.c:310 +msgid "Close" +msgstr "" + +#. create right button of navi bar +#. buttons +#: src/memo_edit_list.c:276 src/memo_portrait_view.c:307 +msgid "IDS_COM_SK_DELETE" +msgstr "" + +#: src/memo_edit_list.c:286 src/memo_portrait_view.c:308 +msgid "IDS_COM_SK_SEND" +msgstr "" + +#: src/memo_search.c:140 +msgid "IDS_COM_SK_SEARCH" +msgstr "" diff --git a/po/nl_NL.po b/po/nl_NL.po new file mode 100644 index 0000000..aef89bb --- /dev/null +++ b/po/nl_NL.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Notitie opslaan?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 notitie geselecteerd" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d notities geselecteerd" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "E-mail verzenden" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Opmerking toevoegen" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Toevoegen aan contactpersoon" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Tekening" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Notitie wijzigen" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Tekst" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Memo selecteren" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Nieuwe notitie" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Notitie wijzigen" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Geen notities" + diff --git a/po/pt_PT.po b/po/pt_PT.po new file mode 100644 index 0000000..196b8c2 --- /dev/null +++ b/po/pt_PT.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Guardar memorando?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 memorando seleccionado" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d memorandos seleccionados" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Enviar e-mail" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Adicionar comentário" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Adicionar a contacto" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Desenho" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Editar nota" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Texto" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Seleccionar memorando" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Criar memorando" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Editar memorando" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Nenhuns memos" + diff --git a/po/ru_RU.po b/po/ru_RU.po new file mode 100644 index 0000000..d929d11 --- /dev/null +++ b/po/ru_RU.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Сохранить заметку?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "Выбрана 1 заметка" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "Выбрано заметок: %d" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "Отправить E-mail" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Добавить комментарий" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Добавить к контакту" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Рисунок" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Текст" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Текст" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Выберите заметку" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Создать заметку" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Изменить заметку" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Нет заметок" + diff --git a/po/tr_TR.po b/po/tr_TR.po new file mode 100644 index 0000000..b95adee --- /dev/null +++ b/po/tr_TR.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "Not kaydet?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "1 not seçildi" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "%d not seçildi" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "E-posta gönder" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "Yorum ekle" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "Rehbere ekle" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "Çizim" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "Notu düzenle" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "Metin" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "Not seçin" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "Not oluştur" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "Not düzenle" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "Not yok" + diff --git a/po/update-po.sh b/po/update-po.sh new file mode 100755 index 0000000..73a4be2 --- /dev/null +++ b/po/update-po.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +PACKAGE=memo +SRCROOT=.. +POTFILES=POTFILES.in + +#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW +ALL_LINGUAS="de el en_US es fr it ja ko nl pt ru tk zh_CN zh_HK zh_TW" + +XGETTEXT=/usr/bin/xgettext +MSGMERGE=/usr/bin/msgmerge + +echo -n "Make ${PACKAGE}.pot " +if [ ! -e $POTFILES ] ; then + echo "$POTFILES not found" + exit 1 +fi + +$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \ + --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES +if [ $? -ne 0 ]; then + echo "xgettext error" + exit 1 +fi + +if [ ! -f ${PACKAGE}.po ]; then + echo "No such file: ${PACKAGE}.po" + exit 1 +fi + +rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot +echo "done" + +for LANG in $ALL_LINGUAS; do + echo "$LANG : " + + if [ ! -e $LANG.po ] ; then + sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po + echo "${LANG}.po created" + else + if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then + if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then + rm -f ${LANG}.new.po + else + if mv -f ${LANG}.new.po ${LANG}.po; then + echo "" + else + echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2 + rm -f ${LANG}.new.po + exit 1 + fi + fi + else + echo "msgmerge for $LANG failed!" + rm -f ${LANG}.new.po + fi + fi + echo "" +done + diff --git a/po/zh_CN.po b/po/zh_CN.po new file mode 100644 index 0000000..479eb02 --- /dev/null +++ b/po/zh_CN.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "要保存备忘录吗?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "已选择1个备忘录" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "已选择%d个备忘录" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "发送邮件" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "添加评论" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "添加到联系人" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "画图" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "编辑注释" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "文本" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "选择备忘录" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "新建备忘录" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "编辑备忘录" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "无备忘录" + diff --git a/po/zh_HK.po b/po/zh_HK.po new file mode 100644 index 0000000..98d1834 --- /dev/null +++ b/po/zh_HK.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "要儲存備忘錄嗎?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "已選擇 1 個備忘錄" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "已選擇 %d 個備忘錄" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "發送電子郵件" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "加入評語" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "加到聯絡人" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "繪製" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "編輯記事" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "文字" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "選擇備忘錄" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "建立備忘錄" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "編輯備忘錄" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "沒有備忘錄" + diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100644 index 0000000..72afc6f --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,39 @@ +msgid "IDS_MEMO_POP_DIALOG_SAVE_MEMO" +msgstr "要儲存備忘錄嗎?" + +msgid "IDS_MEMO_POP_1_MEMO_SELECTED" +msgstr "已選取 1 項備忘錄" + +msgid "IDS_MEMO_POP_PD_MEMOS_SELECTED" +msgstr "已選取 %d 項備忘錄" + +msgid "IDS_MEMO_OPT_SEND_EMAIL" +msgstr "傳送電子郵件" + +msgid "IDS_MEMO_BODY_ADD_COMMENT" +msgstr "新增留言" + +msgid "IDS_MEMO_BODY_ADD_TO_CONTACT" +msgstr "加到聯絡人" + +msgid "IDS_MEMO_BODY_DRAWING" +msgstr "繪圖" + +msgid "IDS_MEMO_BODY_EDIT_NOTE" +msgstr "編輯備註" + +msgid "IDS_MEMO_BODY_TEXT" +msgstr "文字" + +msgid "IDS_MEMO_HEADER_SELECT_MEMO_ABB" +msgstr "選擇備忘錄" + +msgid "IDS_MEMO_HEADER_CREATE_MEMO" +msgstr "建立備忘錄" + +msgid "IDS_MEMO_BODY_EDIT_MEMO" +msgstr "編輯備忘錄" + +msgid "IDS_MEMO_BODY_NO_MEMOS" +msgstr "無備忘錄" + diff --git a/scripts/float.sh b/scripts/float.sh new file mode 100755 index 0000000..f1e8a4f --- /dev/null +++ b/scripts/float.sh @@ -0,0 +1,28 @@ +#!/bin/bash +dest="../include/memo_edc_float.h" +scale=5 + +rm -f $dest +cat ./copyright > $dest +echo "#ifndef __MEMO_EDC_FLOAT_H__ +#define __MEMO_EDC_FLOAT_H__ + +/* Don't modify this file manually, generate it by float.sh located in scripts directory!!! */ +" >> $dest + +files=$(ls ../edc/ | grep "in$") +for i in $files ; do + rpath=$(realpath ../edc/$i) + echo "Handling $rpath ..." + while l=$(line) ; do + n=$(echo $l | awk '{print $1}') + f=$(echo $l | sed -r "s/^\w+\s+/scale=$scale;/" | bc | sed -r "s/^\./0./") + echo "#define $n $f" >> $dest + done < $rpath +done + +echo " +#endif /* __MEMO_EDC_FLOAT_H__ */ +" >> $dest + +chmod -w $dest diff --git a/scripts/images_strip.sh b/scripts/images_strip.sh new file mode 100755 index 0000000..7c79afa --- /dev/null +++ b/scripts/images_strip.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#theme image strip +find ../theme -depth -iname "*.png" | xargs -n 1 -I {} basename {} | sort -u > /tmp/origin +while LINE=$(line) ; do + result=$(grep $LINE ../theme -r) + if [[ "$result" == "" ]] ; then + echo "remove $LINE ......" + find ../theme -depth -iname "$LINE" | xargs -n 1 rm -f + fi +done < /tmp/origin + +#system image strip +find ../images -depth -iname "*.png" | xargs -n 1 -I {} basename {} | sort -u > /tmp/origin +while LINE=$(line) ; do + result=$(grep $LINE ../src ../edc ../memo.edc ../include ../extend -r) + if [[ "$result" == "" ]] ; then + echo "remove $LINE ......" + find ../images -depth -iname "$LINE" | xargs -n 1 rm -f + fi +done < /tmp/origin diff --git a/scripts/str.in b/scripts/str.in new file mode 100644 index 0000000..9d28d00 --- /dev/null +++ b/scripts/str.in @@ -0,0 +1,37 @@ +Add comment +Add to contact +Back +Calendar +Cancel +Close +Create +Delete +Drawing +Edit +Edit comment +Edit drawing +Edit note +Email +Facebook +Memo +Message +Create Drawing +Create Note +No +Save +Save memo? +Search +Select all +Select memo +Send +Send email +Send message +Set +Share +Text +Twitter +Video call +Voice call +Yes +1 memo selected +%d memos selected diff --git a/scripts/string.sh b/scripts/string.sh new file mode 100755 index 0000000..4e845d6 --- /dev/null +++ b/scripts/string.sh @@ -0,0 +1,93 @@ +SYS_MO="$HOME/sbs/target-armel/usr/share/locale/en/LC_MESSAGES/sys_string.mo" +APP_MO="$HOME/sbs/target-armel/opt/apps/org.tizen.memo/res/locale/en/LC_MESSAGES/memo.mo" +TEMP_STR="./temp" +IN="str.in" +APP_NAME="memo" + +declare -a SYS_ID +declare -a APP_ID +declare -a CUSTOM_ID + +out=../include/"$APP_NAME""_string.h" +rm -fr $out + +sbs -et apt-get install sys-string-0 -y --force-yes + +function get_str_id () { + local str=$1 + local mo=$2 + local result="" + if [[ -e $mo ]] ; then + result=`msgunfmt $mo | grep "\"$str\"" -B 1 | head -n 1 | awk '{print $2}'` + fi + echo $result +} + +function get_tmp_id () { + local str=$1 + local result="" + if [[ -e $TEMP_STR ]] ; then + result=`cat $TEMP_STR | grep "$str" -A 1 | tail -n 1 | awk '{print $1}'` + fi + echo $result +} + +function gen_id () { + local prefix=$1 + local str=$2 + local id=$prefix`echo $str | tr a-z A-Z | sed "s/ /_/g" | sed "s/?//g" | sed "s/%//g"` + echo $id +} + +function dump () { + local dest=$1 + local str=$2 + printf "$str\n" >> $dest +} + +#copy right +cat ./copyright > $out +dump $out "" +dump $out "#ifndef __MEMO_STRING_H__" +dump $out "#define __MEMO_STRING_H__" + +LINES=`cat $IN |wc -l` +for (( i=1; i<=$LINES; i++ )) ; do + string=`cat $IN | sed -n "$i p"` + sys_id=$(get_str_id "$string" "$SYS_MO") + app_id=$(get_str_id "$string" "$APP_MO") + tmp_id=$(get_tmp_id "$string") + if [ "$sys_id" != "" ] ; then + SYS_ID[${#SYS_ID[@]}]=$(gen_id "MEMO_I18N_" "$string") #append id to array + SYS_ID[${#SYS_ID[@]}]="dgettext(\"sys_string\", $sys_id) /* $string */" #append def to array + elif [ "$app_id" != "" ] ; then + APP_ID[${#APP_ID[@]}]=$(gen_id "MEMO_I18N_" "$string") + APP_ID[${#APP_ID[@]}]="dgettext(\"memo\", $app_id) /* $string */" + elif [ "$tmp_id" != "" ] ; then + CUSTOM_ID[${#CUSTOM_ID[@]}]=$(gen_id "MEMO_I18N_" "$string") + CUSTOM_ID[${#CUSTOM_ID[@]}]="dgettext(\"memo\", \"$tmp_id\") /* $string */" + else + CUSTOM_ID[${#CUSTOM_ID[@]}]=$(gen_id "MEMO_I18N_" "$string") + CUSTOM_ID[${#CUSTOM_ID[@]}]="_(\"$string\") /* $string */" + fi +done + +#dump results +dump $out "" +dump $out "/* system string */" +for (( i=0; i<${#SYS_ID[@]} ; i+=2 )) ; do + printf "#define %-36s %s\n" ${SYS_ID[$i]} "${SYS_ID[$i+1]}">> $out +done +dump $out "" +dump $out "/* app string */" +for (( i=0; i<${#APP_ID[@]} ; i+=2 )) ; do + printf "#define %-36s %s\n" ${APP_ID[$i]} "${APP_ID[$i+1]}">> $out +done +dump $out "" +dump $out "/* custom string */" +for (( i=0; i<${#CUSTOM_ID[@]} ; i+=2 )) ; do + printf "#define %-36s %s\n" "${CUSTOM_ID[$i]}" "${CUSTOM_ID[$i+1]}" >> $out +done + +dump $out "" +dump $out "#endif /* __MEMO_STRING_H__ */" diff --git a/scripts/temp b/scripts/temp new file mode 100644 index 0000000..650ebc9 --- /dev/null +++ b/scripts/temp @@ -0,0 +1,2 @@ +#Add comment +#IDS_MEMO_ADD_COMMENT diff --git a/src/memo-assist.c b/src/memo-assist.c new file mode 100644 index 0000000..8cc9b70 --- /dev/null +++ b/src/memo-assist.c @@ -0,0 +1,554 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ICU_TIME_BUFFER 256 +static UDateFormat* dfmt = NULL; + +/** + * memo_get_doodle_title + * + * @brief + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +char *memo_get_doodle_title() +{ + memo_data_list_t *l = NULL; + memo_data_list_t *t = NULL; + char buf[MEMO_BUFFER_SIZE]; + int i = 0; + int d = 0; + l = memo_get_all_data_list(); + for (t = l; t != NULL; t = t->next) { + if (t->md.has_doodle) { + d = atoi(t->md.content + strlen(DOODLE_TITLE_PREFIX)); + i = (d > i) ? d : i; + } + } + i++; + snprintf(buf, MEMO_BUFFER_SIZE, "%s%04d", DOODLE_TITLE_PREFIX, i); + memo_free_data_list(l); + return strdup(buf); +} + +void icu_init() +{ + UErrorCode status = U_ZERO_ERROR; + const char *locale; + UChar ubuf[ICU_TIME_BUFFER]; + UChar bestPattern[ICU_TIME_BUFFER]; + UDateTimePatternGenerator *generator; + enum appcore_time_format timeformat; + char *timezone_id = NULL; + UChar utimezone_id[256] = {0,}; + + /* reset timezone according to vconf */ + timezone_id = vconf_get_str(VCONFKEY_SETAPPL_TIMEZONE_ID); + u_uastrcpy(utimezone_id, timezone_id); + SFREE(timezone_id); + ucal_setDefaultTimeZone(utimezone_id , &status); + /* init */ + uloc_setDefault(getenv("LC_TIME"), &status); /* ICU API to set default locale */ + locale = uloc_getDefault(); + /* format */ + appcore_get_timeformat(&timeformat); + if (timeformat==APPCORE_TIME_FORMAT_24) { + /* 14 May 09 15:37 */ + u_strFromUTF8(ubuf, MEMO_BUFFER_SIZE, NULL, "dMMMyyHHmm", -1, &status); + } else { + /* 14 May 09 03:37 PM */ + u_strFromUTF8(ubuf, MEMO_BUFFER_SIZE, NULL, "dMMMyyhhmma", -1, &status); + } + /* get pattern */ + generator = udatpg_open(locale, &status); + udatpg_getBestPattern(generator, ubuf, u_strlen(ubuf), bestPattern, ICU_TIME_BUFFER, &status); + udatpg_close(generator); + /* format */ + if (dfmt != NULL) { + udat_close(dfmt); + } + dfmt = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, NULL, -1, bestPattern, -1, &status); +} + +/** + * memo_time_format + * + * @brief + * + * @param [in] buf buffer used to store formated time + * + * @param [in] len length of buf + * + * @param [in] time actual time + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +void memo_time_format(char *buf, int len, time_t time) +{ + UErrorCode status = U_ZERO_ERROR; + UChar ubuf[ICU_TIME_BUFFER]; + + if (dfmt == NULL) { + icu_init(); + } + udat_format(dfmt, (UDate)time*1000, ubuf, ICU_TIME_BUFFER, NULL, &status); + u_strToUTF8(buf, len, NULL, ubuf, -1, &status); +} + +time_t memo_get_binary_release_date() +{ + struct tm time = {0}; + char *date = NULL; + dictionary *about_dic = iniparser_load("/etc/info.ini"); + + RETVIF(about_dic==NULL, 0); + date = iniparser_getstr(about_dic, "Build:Date"); + strptime(date, "%Y.%m.%d", &time); + iniparser_freedict(about_dic); + return timelocal(&time); +} + +void memo_com_dummy_cb(void *data, const char *msg, void *event) +{ + LOGD("msg : %s\n", msg); +} + +typedef struct __pop_data_t { + Evas_Smart_Cb on_yes; + Evas_Smart_Cb on_no; + void *user_data; + Evas_Object *pop; +} pop_data_t; + +static void _on_yes_cb(void *data, Evas_Object *obj, void *event_info) +{ + pop_data_t *pData = (pop_data_t *)data; + if (pData->on_yes != NULL) { + pData->on_yes(pData->user_data, obj, event_info); + } + evas_object_del(pData->pop); + SFREE(pData); +} + +static void _on_no_cb(void *data, Evas_Object *obj, void *event_info) +{ + pop_data_t *pData = (pop_data_t *)data; + if (pData->on_no != NULL) { + pData->on_no(pData->user_data, obj, event_info); + } + evas_object_del(pData->pop); + SFREE(pData); +} + +/** + * memo_create_yes_no_popup + * + * @brief + * + * @param [in] win + * + * @param [in] msg + * + * @param [in] on_yes + * + * @param [in] on_no + * + * @param [in] data + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +void memo_create_yes_no_popup(Evas_Object *win, const char *msg, Evas_Smart_Cb on_yes, Evas_Smart_Cb on_no, void *data) +{ + pop_data_t *pd = SMALLOC(pop_data_t); + RETIF(pd == NULL); + + pd->on_yes = on_yes; + pd->on_no = on_no; + pd->user_data = data; + Evas_Object *popup = elm_popup_add(win); + pd->pop = popup; + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, msg); + Evas_Object *btn1 = elm_button_add(popup); + elm_object_text_set(btn1, MEMO_I18N_YES); + elm_object_part_content_set(popup, "button1", btn1); + evas_object_smart_callback_add(btn1, "clicked", _on_yes_cb, pd); + Evas_Object *btn2 = elm_button_add(popup); + elm_object_text_set(btn2, MEMO_I18N_NO); + elm_object_part_content_set(popup, "button2", btn2); + evas_object_smart_callback_add(btn2, "clicked", _on_no_cb, pd); + evas_object_show(popup); +} + +void memo_tool_btn_focus_set(Evas_Object *eo, Eina_Bool status) +{ + edje_object_signal_emit(elm_layout_edje_get(eo), (status ? "focus" : "normal"), "elm"); +} + +static void _set_bg(Evas_Object *obj, bundle *bd) +{ + unsigned char *color = NULL; + int bg_color = 0xFFFFFFFF; /* ARGB */ + const char *s = bundle_get_val(bd, "bg_color"); + if (s != NULL) { + bg_color = atoi(s); + } + color = (unsigned char *)&bg_color; + evas_object_color_set(obj, color[2], color[1], color[0], color[3]); +} + +typedef struct __font_size_selector_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + /* content */ + Evas_Object *body_main; + Evas_Object *slider; + Evas_Object *label; + /* other */ + int min; + int max; + int current; +}font_size_selector_t; + +static void _on_font_size_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + font_size_selector_t *fss = (font_size_selector_t *)data; + int s = elm_slider_value_get(fss->slider); + if (s != fss->current) { + fss->current = s; + char buf[MEMO_BUFFER_SIZE]; + snprintf(buf, MEMO_BUFFER_SIZE, "Abc", fss->current); + elm_object_text_set(fss->label, buf); + fss->cb(fss->data, "change", (void *)fss->current); + } +} + +void *memo_load_font_size_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data) +{ + font_size_selector_t *fss = SMALLOC(font_size_selector_t); + RETVIF(fss==NULL, NULL); + bundle_dump(bd); + fss->parent = parent; + fss->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + fss->data = data; + + /* init */ + fss->min = 20; + fss->max = 60; + fss->current = 30; + const char *s = bundle_get_val(bd, "current"); + if (s != NULL) { + fss->current = atoi(s); + } + + fss->body_main = elm_layout_create(fss->parent, EDJ_FILE, "font_size_selector"); + fss->cb(fss->data, "layout", fss->body_main); + + /* background */ + Evas_Object *bg = evas_object_rectangle_add(evas_object_evas_get(parent)); + _set_bg(bg, bd); + elm_object_part_content_set(fss->body_main, "bg.color", bg); + /* slider */ + fss->slider = elm_slider_add(fss->body_main); + elm_slider_indicator_show_set(fss->slider, EINA_TRUE); + elm_slider_min_max_set(fss->slider, fss->min, fss->max); + elm_slider_indicator_format_set(fss->slider, "%1.0f"); + elm_slider_value_set(fss->slider, fss->current); + evas_object_smart_callback_add(fss->slider, "changed", _on_font_size_change_cb, fss); + elm_object_part_content_set(fss->body_main, "elm.swallow.selector", fss->slider); + /* preview text */ + fss->label = elm_label_add(fss->body_main); + char buf[MEMO_BUFFER_SIZE]; + snprintf(buf, MEMO_BUFFER_SIZE, "Abc", fss->current); + elm_object_text_set(fss->label, buf); + elm_object_part_content_set(fss->body_main, "elm.swallow.label", fss->label); + + return (void *)fss; +} + +void memo_del_font_size_selector(void *h_fss) +{ + font_size_selector_t *fss = (font_size_selector_t *)h_fss; + evas_object_del(fss->body_main); + SFREE(fss); +} + +typedef struct __color_selector_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + /* content */ + Evas_Object *body_main; + Evas_Object *selector; + Evas_Object *rect; /* color rect */ + /* other */ + int color; /* ARGB */ +}color_selector_t; + +static void _on_color_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + int r, g, b, a; + color_selector_t *cs = (color_selector_t *)data; + elm_colorselector_color_get(cs->selector, &r, &g, &b, &a); + evas_object_color_set(cs->rect, r, g, b, a); + int color = ARGB_JOIN(a, r, g, b); + if (cs->color != color) { + cs->color = color; + cs->cb(cs->data, "change", (void *)cs->color); + } +} + +void *memo_load_color_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data) +{ + color_selector_t *cs = SMALLOC(color_selector_t); + RETVIF(cs==NULL, NULL); + bundle_dump(bd); + cs->parent = parent; + cs->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + cs->data = data; + + /* init */ + cs->color = 0xFFFFFFFF; + const char *s = bundle_get_val(bd, "color"); + if (s != NULL) { + cs->color = atoi(s); + } + cs->body_main = elm_layout_create(cs->parent, EDJ_FILE, "color_selector"); + cs->cb(cs->data, "layout", cs->body_main); + + /* background */ + s = bundle_get_val(bd, "bg_color"); + if (s != NULL) { + edje_object_signal_emit(elm_layout_edje_get(cs->body_main), "black", "elm"); + } else { + edje_object_signal_emit(elm_layout_edje_get(cs->body_main), "white", "elm"); + } + /* selector */ + cs->selector = elm_colorselector_add(cs->body_main); + elm_colorselector_mode_set(cs->selector, ELM_COLORSELECTOR_COMPONENTS); + elm_object_part_content_set(cs->body_main, "elm.swallow.selector", cs->selector); + unsigned char *color = (unsigned char *)&cs->color; + elm_colorselector_color_set(cs->selector, color[2], color[1], color[0], color[3]); + evas_object_smart_callback_add(cs->selector, "changed", _on_color_change_cb, cs); + /* preview color rect */ + cs->rect = evas_object_rectangle_add(evas_object_evas_get(parent)); + evas_object_color_set(cs->rect, color[2], color[1], color[0], color[3]); + elm_object_part_content_set(cs->body_main, "elm.swallow.color", cs->rect); + + return (void *)cs; +} + +void memo_del_color_selector(void *h_cs) +{ + color_selector_t *cs = (color_selector_t *)h_cs; + evas_object_del(cs->body_main); + SFREE(cs); +} + +typedef struct __pencil_size_selector_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + /* content */ + Evas_Object *body_main; + Evas_Object *slider; + Evas_Object *rect; /* previw rect */ + /* other */ + int min; + int max; + int current; +}pencil_size_selector_t; + +static void _on_pencil_size_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + pencil_size_selector_t *pss = (pencil_size_selector_t *)data; + pss->current = elm_slider_value_get(pss->slider); + evas_object_size_hint_min_set(pss->rect, 0, pss->current); + pss->cb(pss->data, "change", (void *)pss->current); +} + +void *memo_load_pencil_size_selector(Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data) +{ + pencil_size_selector_t *pss = SMALLOC(pencil_size_selector_t); + RETVIF(pss==NULL, NULL); + bundle_dump(bd); + pss->parent = parent; + pss->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + pss->data = data; + + /* init */ + pss->min = 1; + pss->max = 8; + pss->current = 8; + const char *s = bundle_get_val(bd, "current"); + if (s != NULL) { + pss->current = atoi(s); + } + + pss->body_main = elm_layout_create(pss->parent, EDJ_FILE, "pencil_size_selector"); + pss->cb(pss->data, "layout", pss->body_main); + + /* background */ + Evas_Object *bg = evas_object_rectangle_add(evas_object_evas_get(parent)); + _set_bg(bg, bd); + elm_object_part_content_set(pss->body_main, "bg.color", bg); + /* slider */ + pss->slider = elm_slider_add(pss->body_main); + elm_slider_indicator_show_set(pss->slider, EINA_TRUE); + elm_slider_min_max_set(pss->slider, pss->min, pss->max); + elm_slider_indicator_format_set(pss->slider, "%1.0f"); + elm_slider_value_set(pss->slider, pss->current); + evas_object_smart_callback_add(pss->slider, "changed", _on_pencil_size_change_cb, pss); + elm_object_part_content_set(pss->body_main, "elm.swallow.selector", pss->slider); + /* preview size rect */ + pss->rect = evas_object_rectangle_add(evas_object_evas_get(parent)); + evas_object_color_set(pss->rect, 0, 0, 0, 255); + evas_object_size_hint_min_set(pss->rect, 0, pss->current); + elm_object_part_content_set(pss->body_main, "elm.swallow.pencil", pss->rect); + + return (void *)pss; +} + +void memo_del_pencil_size_selector(void *h_pss) +{ + pencil_size_selector_t *pss = (pencil_size_selector_t *)h_pss; + evas_object_del(pss->body_main); + SFREE(pss); +} + +Eina_Bool memo_black_theme_check() +{ + Eina_Bool black = EINA_FALSE; + char *str = vconf_get_str("db/setting/selected_theme"); + if (str != NULL) { + LOGD("%s:%d current theme : %s\n", __FUNCTION__, __LINE__, str); + if ((strcmp(str, "tizen-black") == 0) + || (strcmp(str, "tizen-black-hd") == 0)) { + black = EINA_TRUE; + } + free(str); + } + return black; +} + +void memo_navigator_pop(Evas_Object *navi) +{ + Elm_Object_Item *top_it = elm_naviframe_top_item_get(navi); + Evas_Object *eo = elm_object_item_content_get(top_it); + Evas_Object *prev_eo = evas_object_data_get(eo, "previous_obj"); + if(prev_eo == NULL) { /* exit when view stack is empty */ + elm_exit(); + } else { + Evas_Smart_Cb cb = evas_object_data_get(prev_eo, "update_cb"); + RETIF(cb == NULL); + void *cb_data = evas_object_data_get(prev_eo, "update_data"); + cb(cb_data, NULL, NULL); + } + elm_naviframe_item_pop(navi); +} + +Elm_Object_Item *memo_naviframe_item_push(Evas_Object *obj, const char *title_label, + Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style) +{ + Elm_Object_Item *top_it = elm_naviframe_top_item_get(obj); + if (top_it != NULL) { + Evas_Object *eo = elm_object_item_content_get(top_it); + if (eo != NULL) { + evas_object_data_set(content, "previous_obj", eo); + } + } + + return elm_naviframe_item_push(obj, title_label, prev_btn, next_btn, content, item_style); +} + +Eina_Bool memo_comment_savable(Evas_Object *entry, const char *orig_utf8) +{ + const char *text = elm_entry_entry_get(entry); + char *content = elm_entry_markup_to_utf8(text); + Eina_Bool savable = EINA_TRUE; + + if (strcmp(content, "") == 0) { + savable = EINA_FALSE; + } else if (orig_utf8 != NULL) { /* check if same as init string */ + if (strcmp(orig_utf8, content)==0) { + savable = EINA_FALSE; + } + } + SFREE(content); + return savable; +} + +void memo_comment_recover(Evas_Object *entry, const char *orig_utf8) +{ + if (orig_utf8 == NULL) { + elm_entry_entry_set(entry, NULL); + } else { + char *content = elm_entry_utf8_to_markup(orig_utf8); + elm_entry_entry_set(entry, content); + SFREE(content); + } +} + +Evas_Object *memo_controlbar_add(Evas_Object *parent) +{ + Evas_Object *toolbar = elm_toolbar_add(parent); + elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); + elm_toolbar_homogeneous_set(toolbar, EINA_FALSE); + return toolbar; +} diff --git a/src/memo-genlist.c b/src/memo-genlist.c new file mode 100644 index 0000000..c969176 --- /dev/null +++ b/src/memo-genlist.c @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static void _str_append_utf8(char *s, int size, const char *utf8) +{ + char *content = NULL; + content = elm_entry_utf8_to_markup(utf8); + RETIF(content == NULL); + sncat(s,size, content); + SFREE(content); +} +/** + * memo_gl_label_get + * + * @brief + * + * @param [in] data user specified data + * + * @param [in] obj evas_object of elm_genlist_item + * + * @param [in] part part name in genlist group + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +char *memo_gl_label_get(void *data, Evas_Object *obj, const char *part) +{ + gl_data_t *gld = (gl_data_t *)data; + char buf[MEMO_BUFFER_SIZE] = {0}; + char input[MEMO_BUFFER_SIZE] = {0}; + char output[MEMO_BUFFER_SIZE] = {0}; + const char *p = NULL; + const char *pre = NULL; + + if (!strcmp(part, "elm.text.date")) { + memo_time_format(buf, MEMO_BUFFER_SIZE, gld->mod_time); + return strdup(buf); + } else if (!strcmp(part, "elm.slide.text.1")) { + memo_data_t *md = memo_get_data(gld->index); + snprintf(input, MEMO_BUFFER_SIZE, "%s", + (md->comment == NULL ? md->content : md->comment)); /* limit input */ + memo_free_data(md); + return strdup(input); + } else if (!strcmp(part, "elm.text")) { + memo_data_t *md = memo_get_data(gld->index); + /* limit input */ + if (md->comment != NULL) { + snprintf(input, MEMO_BUFFER_SIZE, "%s", md->comment); + } else { + snprintf(input, MEMO_BUFFER_SIZE, "%s", md->content); + } + /* truncate to single line */ + p = strstr(input, "\342\200\251"); + if (p != NULL) { + input[p-input] = '\0'; + } + /* font color information */ + unsigned char *color = (unsigned char *)&md->font_color; + snprintf(output, MEMO_BUFFER_SIZE, "", color[2], color[1], color[0]); + /* append text information */ + if (gld->search == NULL) { + _str_append_utf8(output, MEMO_BUFFER_SIZE, input); + } else { + pre = input; + /* search and composite */ + p = (const char *)strcasestr(pre, gld->search); + if (p != NULL) { + /* append characters before matched string */ + if (p != pre) { + buf[0]='\0'; + strncat(buf, pre, p-pre); + _str_append_utf8(output, MEMO_BUFFER_SIZE, buf); + } + /* highlight str */ + sncat(output, MEMO_BUFFER_SIZE, ""); + buf[0]='\0'; + strncat(buf, p, strlen(gld->search)); + _str_append_utf8(output, MEMO_BUFFER_SIZE, buf); + sncat(output, MEMO_BUFFER_SIZE, ""); + /* set pointer after matched string */ + pre = p+strlen(gld->search); + } + /* append remaining string */ + _str_append_utf8(output, MEMO_BUFFER_SIZE, pre); + } + memo_free_data(md); + return strdup(output); + } + return NULL; +} + +/** + * memo_gl_icon_get + * + * @brief + * + * @param [in] data user specified data + * + * @param [in] obj evas_object of elm_genlist_item + * + * @param [in] part part name in genlist group + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +Evas_Object *memo_gl_icon_get(void *data, Evas_Object *obj, const char *part) +{ + gl_data_t *gld = (gl_data_t *)data; + char buf[MEMO_BUFFER_SIZE]; + Evas_Object *eo = NULL; + + if (!strcmp(part, "elm.swallow.doodle")) { + if (gld->has_doodle != 0) { + snprintf(buf, MEMO_BUFFER_SIZE, DOODLEDIR "/%d.png", gld->index); + eo = elm_icon_create(obj, buf); + } + } else if (!strcmp(part, "elm.swallow.check")) { + eo = elm_check_add(obj); + elm_check_state_pointer_set(eo, &gld->check); + if (gld->on_change != NULL) { + evas_object_smart_callback_add(eo, "changed", gld->on_change, gld); + } + } else if (!strcmp(part, "elm.slide.swallow.1")) { + eo = elm_button_create(obj, MEMO_I18N_DELETE, gld->on_delete, gld); + } else if (!strcmp(part, "elm.slide.swallow.2")) { + eo = elm_button_create(obj, MEMO_I18N_SHARE, gld->on_send, gld); + } + return eo; +} + +Eina_Bool memo_gl_state_get(void *data, Evas_Object *obj, const char *part) +{ + return EINA_FALSE; +} + +/** + * memo_gl_del + * + * @brief + * + * @param [in] data user specified data + * + * @param [in] obj evas_object of elm_genlist_item + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +void memo_gl_del(void *data, Evas_Object *obj) +{ + gl_data_t *gld = (gl_data_t *)data; + SFREE(gld); + return; +} + +/** + * memo_gl_itc_init + * + * @brief + * + * @param [in] itc handle of Elm_Genlist_Item_Class + * + * @param [in] style + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +void memo_gl_itc_init(Elm_Genlist_Item_Class *itc, const char *style) +{ + itc->item_style = style; + itc->func.text_get = memo_gl_label_get; + itc->func.content_get = memo_gl_icon_get; + itc->func.state_get = memo_gl_state_get; + itc->func.del = memo_gl_del; +} + +/** + * memo_gld_init + * + * @brief + * + * @param [in] data handle of gl_data_t + * + * @param [in] md original memo record data + * + * @param [in] user_data user specified data + * + * @param [in] on_select callback function when genlist item is selected + * + * @return + * + * @exception None + * + * @remark None + * + * @see + * + */ +void memo_gld_init(gl_data_t *data, memo_data_t *md, void *user_data, Evas_Smart_Cb on_select) +{ + data->index = md->id; + data->has_doodle = md->has_doodle; + data->mod_time = md->modi_time; + data->on_select = on_select; + data->user_data = user_data; +} + diff --git a/src/memo.c b/src/memo.c new file mode 100644 index 0000000..58d27b0 --- /dev/null +++ b/src/memo.c @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include /* ug_send_key_event */ +#include +#include +#include +#include +#include + +static int heynoti_fd = -1; + +static void on_time_format_update(appdata *ad) +{ + Elm_Object_Item *top_it = elm_naviframe_top_item_get(ad->navigator); + Evas_Object *eo = elm_object_item_content_get(top_it); + if(eo != NULL) { + Evas_Smart_Cb cb = evas_object_data_get(eo, "time_format_update_cb"); + RETIF(cb == NULL); + void *cb_data = evas_object_data_get(eo, "time_format_update_data"); + cb(cb_data, NULL, NULL); + } +} + +void memo_timezone_changed_cb(void *data) +{ + appdata *ad = data; + /* update ICU */ + icu_init(); + /* update top view */ + on_time_format_update(ad); +} + +int tzone_heynoti_init(void *data) +{ + int fd = -1; + if((fd = heynoti_init()) < 0) { + return -1; + } + if(heynoti_subscribe(fd, "setting_time_changed", memo_timezone_changed_cb, data)) { + return -1; + } + if(heynoti_attach_handler(fd)) { + return -1; + } + LOGD("tzone heynoti register success!\n"); + return fd; +} + +void tzone_heynoti_fini() +{ + int fd = heynoti_fd; + if (fd < 0) { + return; + } + + heynoti_unsubscribe(fd, "setting_time_changed", memo_timezone_changed_cb); + heynoti_close(fd); +} + +static void win_del(void *data, Evas_Object *obj, void *event) +{ + elm_exit(); +} + +static int lang_changed(void *data) +{ + return 0; +} + +static int region_changed(void *data) +{ + appdata *ad = data; + /* time format 12/24 chanaged, update ICU */ + icu_init(); + /* update top view */ + on_time_format_update(ad); + return 0; +} + +static Evas_Object *create_win(const char *name) +{ + Evas_Object *eo; + int w, h; + + eo = elm_win_add(NULL, name, ELM_WIN_BASIC); + if (eo) { + elm_win_title_set(eo, name); + elm_win_borderless_set(eo, EINA_TRUE); + evas_object_smart_callback_add(eo, "delete,request", win_del, NULL); + ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); + evas_object_resize(eo, w, h); + } + + return eo; +} + +static void _on_reload_cb(void *data, Evas_Object *obj, void *event_info) +{ + evas_object_del(obj); + elm_exit(); +} + +void on_change(keynode_t *node, void *user_data) +{ + appdata *ad = (appdata *)user_data; + int sync = vconf_keynode_get_int(node); + if (sync == 1) { + if (ad->popup == NULL) { + Evas_Object *popup = elm_popup_add(ad->win_main); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, "Memo data changed unexpectedly, close application and reload!"); + Evas_Object *btn1 = elm_button_add(popup); + elm_object_text_set(btn1, MEMO_I18N_YES); + elm_object_part_content_set(popup, "button1", btn1); + evas_object_smart_callback_add(btn1, "clicked", _on_reload_cb, popup); + evas_object_show(popup); + ad->popup = popup; + } + } +} + +static int app_create_delay(void *data) +{ + appdata *ad = (appdata *)data; + Evas_Object *win; + int r; + + /* create window */ + win = create_win(PACKAGE); + if (win == NULL) { + return -1; + } + ad->win_main = win; + + /* monitor update of memo database from external application */ + int sync = 0; + if (vconf_get_int("memory/mobex_engine/memo_sync_status", &sync) == 0) { + if (sync == 1) { /* KIES syncing */ + Evas_Object *popup = elm_popup_add(ad->win_main); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, "Memo data changed unexpectedly, close application and reload!"); + Evas_Object *btn1 = elm_button_add(popup); + elm_object_text_set(btn1, MEMO_I18N_YES); + elm_object_part_content_set(popup, "button1", btn1); + evas_object_smart_callback_add(btn1, "clicked", _on_reload_cb, popup); + evas_object_show(popup); + ad->popup = popup; + } + } + vconf_notify_key_changed("memory/mobex_engine/memo_sync_status", on_change, ad); + + /* theme extension */ + elm_theme_extension_add(NULL, EDJ_FILE); + + /* show indicator */ + elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW); + + /* init ui gadget */ + memo_ug_init(ad->win_main); + + /* bg */ + Evas_Object *bg = elm_bg_add(win); + elm_bg_color_set(bg, 0, 0, 0); /* black */ + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, bg); + evas_object_show(bg); + /* window */ + ad->ly_main = elm_layout_add(win); + elm_layout_theme_set(ad->ly_main, "layout", "application", "default"); + evas_object_size_hint_weight_set(ad->ly_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ad->win_main, ad->ly_main); + evas_object_show(ad->ly_main); + + /* navigationbar */ + ad->navigator = elm_naviframe_add(ad->ly_main); + elm_object_part_content_set(ad->ly_main, "elm.swallow.content", ad->navigator); + + if (ad->init_view == MEMO_LIST_VIEW) { + memo_load_list_view(ad); + } else if (ad->init_view == MEMO_DETAIL_VIEW) { + memo_load_detail_view(ad); + } else if (ad->init_view == MEMO_EDIT_VIEW) { + memo_load_edit_view(ad); + } + + /* init internationalization */ + r = appcore_set_i18n(PACKAGE, LOCALEDIR); + if (r) { + return -1; + } + lang_changed(ad); + + appcore_set_event_callback(APPCORE_EVENT_REGION_CHANGE, region_changed, ad); + + /* timezone inoti */ + heynoti_fd = tzone_heynoti_init(ad); + + /* add system event callback */ + appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, lang_changed, ad); + + return 0; +} + +static int app_create(void *data) +{ + /* init memo database */ + memo_init(NULL); + return 0; +} + +static int app_terminate(void *data) +{ + appdata *ad = data; + /* fini memo database */ + memo_fini(); + + tzone_heynoti_fini(); + if (ad->win_main) { + evas_object_del(ad->win_main); + } + + return 0; +} + +static int app_pause(void *data) +{ + return 0; +} + +static int app_resume(void *data) +{ + return 0; +} + +static int app_reset(bundle *bd, void *data) +{ + appdata *ad = (appdata *)data; + + if (ad->win_main != NULL) { /* memo has already launced. */ + elm_win_activate(ad->win_main); + return 0; + } + + /* launch memo */ + ad->init_view = MEMO_LIST_VIEW; + ad->index = -1; + if (bd != NULL) { /* launch type check */ + /* detail view */ + const char *s = bundle_get_val(bd, AUL_PARAM_ID); + if (s != NULL) { + int id = atoi(s); + memo_data_t *md = memo_get_data(id); + if (md != NULL) { /* launch detail view */ + ad->init_view = MEMO_DETAIL_VIEW; + ad->index = id; + memo_free_data(md); + } + } + /* voice memo, launch edit view with specified text */ + s = bundle_get_val(bd, "memo"); + if (s != NULL) { /* launch edit text view */ + ad->init_view = MEMO_EDIT_VIEW; + ad->index = -1; + ad->init_str = strdup(s); /* ugh, edit text view will take over init_str, no need to free explicitly */ + } + } + app_create_delay(ad); + evas_object_show(ad->win_main); + + return 0; +} + +int main(int argc, char *argv[]) +{ + appdata ad; + struct appcore_ops ops = { + .create = app_create, + .terminate = app_terminate, + .pause = app_pause, + .resume = app_resume, + .reset = app_reset, + }; + + memset(&ad, 0x0, sizeof(appdata)); + ops.data = &ad; + + return appcore_efl_main(PACKAGE, &argc, &argv, &ops); +} diff --git a/src/memo_detail.c b/src/memo_detail.c new file mode 100644 index 0000000..6d067b7 --- /dev/null +++ b/src/memo_detail.c @@ -0,0 +1,384 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define MODE_DETAIL 0 +#define MODE_COMMENT 1 + +typedef struct __detail_view_t { + appdata *ad; + Evas_Object *navigator; + Elm_Object_Item *navi_it; + Evas_Object *body_main; /* content */ + Evas_Object *ctrl_bar; + Evas_Object *content; + Evas_Object *btn_cancel; + Evas_Object *btn_done; + + int indexes[MEMO_MAX_RECORD]; + int count; + int p; /* position of current record in indexes */ + void *viewer; + int effect; + Eina_Bool text_mode; /* text or doodle mode */ +} detail_view_t; + +static void _doodle_viewer_callback(void *data, const char *msg, void *event); +static void _text_viewer_callback(void *data, const char *msg, void *event); +static void _memo_detail_load_content(detail_view_t *dv); + +typedef void (*Transit_Done_Cb) (void *data, Elm_Transit * transit); + +void _transition_apply(Evas_Object *obj, int effect, Transit_Done_Cb on_done, void *data) +{ + if (effect == 0) { + if (on_done != NULL) { + on_done(data, NULL); + } + return; + } + + Elm_Transit *transit = elm_transit_add(); + elm_transit_objects_final_state_keep_set(transit, EINA_TRUE); + elm_transit_object_add(transit, obj); + if (effect == 1) { /* show & left */ + elm_transit_effect_translation_add(transit, 0, 0, -480, 0); + } else if (effect == 2) { /* show &right */ + elm_transit_effect_translation_add(transit, 0, 0, 480, 0); + } else if (effect == 3) { /* hide & left */ + elm_transit_effect_translation_add(transit, 0, 0, -480, 0); + } else if (effect == 4) { /* hide &right */ + elm_transit_effect_translation_add(transit, 0, 0, 480, 0); + } + elm_transit_del_cb_set(transit, on_done, data); + elm_transit_tween_mode_set(transit, ELM_TRANSIT_TWEEN_MODE_LINEAR); + elm_transit_duration_set(transit, 0.4); + elm_transit_go(transit); +} + +static void _on_load_transit_done_cb(void *data, Elm_Transit * transit) +{ + detail_view_t *dv = (detail_view_t *)data; + elm_object_part_content_set(dv->body_main, "elm.swallow.content", dv->content); +} + +static void _on_text_fade_transit_done_cb(void *data, Elm_Transit * transit) +{ + memo_destroy_text_viewer(data); +} + +static void _on_doodle_fade_transit_done_cb(void *data, Elm_Transit * transit) +{ + memo_destroy_doodle_viewer(data); +} + +static void _on_back_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + memo_navigator_pop(dv->navigator); +} + +static void _on_create_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + appdata *ad = dv->ad; + ad->index_detail = dv->indexes[dv->p]; + ad->index = -1; + memo_load_edit_view(ad); +} + +static void _on_delete_yes(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + int index = -1; + int i = 0; + + /* delete records */ + memo_del_data(dv->indexes[dv->p]); + /* check effect */ + if (dv->p < dv->count-1) { /* next */ + index = dv->indexes[dv->p+1]; + dv->effect = 1; + } else if (dv->p > 0) { /* prev */ + index = dv->indexes[dv->p-1]; + dv->effect = 2; + } else { /* no record */ + memo_navigator_pop(dv->navigator); + return; + } + /* recalculate position */ + dv->count = memo_get_indexes(dv->indexes, MEMO_MAX_RECORD, MEMO_SORT_CREATE_TIME); + for (i=0; icount; i++) { + if (dv->indexes[i] == index) { + dv->p = i; + break; + } + } + elm_object_part_content_unset(dv->body_main, "elm.swallow.content"); + _transition_apply(dv->content, dv->effect+2, dv->text_mode ? _on_text_fade_transit_done_cb : _on_doodle_fade_transit_done_cb, dv->viewer); + _memo_detail_load_content(dv); +} + +static void _on_delete_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + appdata *ad = dv->ad; + snprintf(dv->ad->buf, MEMO_BUFFER_SIZE, "%s?", MEMO_I18N_DELETE); + memo_create_yes_no_popup(ad->win_main, dv->ad->buf, _on_delete_yes, NULL, dv); +} + +static void _on_edit_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + appdata *ad = dv->ad; + ad->index = dv->indexes[dv->p]; + ad->index_detail = dv->indexes[dv->p]; + if (!dv->text_mode) { + /* hide IMF panel of comment editor immediately */ + /* destroy doodle immediately, otherwise doodle disappear when edit */ + memo_doodle_viewer_pre_del(dv->viewer); + } + memo_load_edit_view(ad); +} + +static void _on_share_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + if (dv->text_mode) { + memo_text_viewer_share_record(dv->viewer); + } else { + memo_doodle_viewer_share_record(dv->viewer); + } +} + +static void _on_done_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + memo_doodle_viewer_save(dv->viewer); +} + +static void _on_cancel_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + memo_doodle_viewer_cancel(dv->viewer); +} + +static void _memo_detail_load_content(detail_view_t *dv) +{ + memo_data_t *record = memo_get_data(dv->indexes[dv->p]); + if (record->has_doodle) { + dv->viewer = memo_load_doodle_viewer(dv->body_main, dv->ad->win_main, record->id, NULL, _doodle_viewer_callback, dv); + dv->text_mode = EINA_FALSE; + } else { + dv->viewer = memo_load_text_viewer(dv->body_main, dv->ad->win_main, record->id, NULL, _text_viewer_callback, dv); + dv->text_mode = EINA_TRUE; + } + memo_free_data(record); + snprintf(dv->ad->buf, MEMO_BUFFER_SIZE, "%d/%d", dv->p + 1, dv->count); + elm_object_item_text_set(dv->navi_it, dv->ad->buf); +} + +static void _memo_detail_navibar_mode_set(detail_view_t *dv, int mode) +{ + if (MODE_DETAIL == mode) { + snprintf(dv->ad->buf, MEMO_BUFFER_SIZE, "%d/%d", dv->p + 1, dv->count); + elm_object_item_text_set(dv->navi_it, dv->ad->buf); + if (dv->btn_cancel != NULL) { + elm_object_item_part_content_unset(dv->navi_it, "title_left_btn"); + evas_object_del(dv->btn_cancel); + dv->btn_cancel = NULL; + } + if (dv->btn_done != NULL) { + elm_object_item_part_content_unset(dv->navi_it, "title_right_btn"); + evas_object_del(dv->btn_done); + dv->btn_done = NULL; + } + } else if (MODE_COMMENT == mode) { + if (dv->btn_cancel == NULL) { + dv->btn_cancel = elm_navigator_btn_create(dv->navigator, MEMO_I18N_CANCEL, ICONDIR "/01_header_icon_cancel.png", + "navigationbar_control/left", _on_cancel_btn_clicked, dv); + elm_object_item_part_content_set(dv->navi_it, "title_left_btn", dv->btn_cancel); + } + if (dv->btn_done == NULL) { + dv->btn_done = elm_navigator_btn_create(dv->navigator, MEMO_I18N_SAVE, ICONDIR "/01_header_icon_done.png", + "navigationbar_control/right", _on_done_btn_clicked, dv); + elm_object_item_part_content_set(dv->navi_it, "title_right_btn", dv->btn_done); + } + } +} + +static void _text_viewer_callback(void *data, const char *msg, void *event) +{ + detail_view_t *dv = (detail_view_t *)data; + if (strcmp(msg, "layout") == 0) { + if (dv->effect != 0) { + Evas_Object *obj = (Evas_Object *)event; + int x, y, w, h; + evas_object_geometry_get(dv->content, &x, &y, &w, &h); + evas_object_resize(obj, w, h); + if (dv->effect == 1) { /* show & left */ + evas_object_move(obj, x+480, y); + } else if (dv->effect == 2) { /* show &right */ + evas_object_move(obj, x-480, y); + } else { + evas_object_move(obj, x, y); + } + _transition_apply(obj, dv->effect, _on_load_transit_done_cb, dv); + dv->effect = 0; + } else { + elm_object_part_content_set(dv->body_main, "elm.swallow.content", (Evas_Object *)event); + } + dv->content = (Evas_Object *)event; + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(dv->navi_it, (const char *)event); + } +} + +static void _doodle_viewer_callback(void *data, const char *msg, void *event) +{ + detail_view_t *dv = (detail_view_t *)data; + if (strcmp(msg, "layout") == 0) { + if (dv->effect != 0) { + Evas_Object *obj = (Evas_Object *)event; + int x, y, w, h; + evas_object_geometry_get(dv->content, &x, &y, &w, &h); + evas_object_resize(obj, w, h); + if (dv->effect == 1) { /* show & left */ + evas_object_move(obj, x+480, y); + } else if (dv->effect == 2) { /* show &right */ + evas_object_move(obj, x-480, y); + } else { + evas_object_move(obj, x, y); + } + _transition_apply(obj, dv->effect, _on_load_transit_done_cb, dv); + } else { + elm_object_part_content_set(dv->body_main, "elm.swallow.content", (Evas_Object *)event); + } + dv->content = (Evas_Object *)event; + dv->effect = 0; + } else if (strcmp(msg, "savable") == 0) { + elm_object_disabled_set(dv->btn_done, (int)event==0? EINA_TRUE : EINA_FALSE); + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(dv->navi_it, (const char *)event); + } else if (strcmp(msg, "comment_save") == 0) { + } else if (strcmp(msg, "comment_mode") == 0) { + _memo_detail_navibar_mode_set(dv, (int)event); + } +} + +static void _on_delete(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + elm_object_part_content_unset(dv->body_main, "elm.swallow.content"); + if (dv->text_mode) { + memo_destroy_text_viewer(dv->viewer); + } else { + memo_destroy_doodle_viewer(dv->viewer); + } + dv->viewer = NULL; + if (dv->btn_cancel != NULL) { + evas_object_del(dv->btn_cancel); + } + if (dv->btn_done != NULL) { + evas_object_del(dv->btn_done); + } + SFREE(dv); +} + +static void _on_update(void *data, Evas_Object *obj, void *event_info) +{ + detail_view_t *dv = (detail_view_t *)data; + elm_object_part_content_unset(dv->body_main, "elm.swallow.content"); + if (dv->text_mode) { + memo_destroy_text_viewer(dv->viewer); + } else { + memo_destroy_doodle_viewer(dv->viewer); + } + + int i = 0; + dv->p = -1; + dv->count = memo_get_indexes(dv->indexes, MEMO_MAX_RECORD, MEMO_SORT_CREATE_TIME); + for (i=0; icount; i++) { + if (dv->indexes[i] == dv->ad->index) { + dv->p = i; + break; + } + } + + _memo_detail_navibar_mode_set(dv, MODE_DETAIL); + _memo_detail_load_content(dv); +} + +void *memo_load_detail_view(appdata *ad) +{ + detail_view_t *dv = SMALLOC(detail_view_t); + RETVIF(dv == NULL, NULL); + dv->ad = ad; + int i = 0; + + /* init */ + dv->p = -1; + dv->count = memo_get_indexes(dv->indexes, MEMO_MAX_RECORD, MEMO_SORT_CREATE_TIME); + for (i=0; icount; i++) { + if (dv->indexes[i] == ad->index) { + dv->p = i; + break; + } + } + + dv->navigator = ad->navigator; + /* body main */ + dv->body_main = elm_layout_create(dv->navigator, EDJ_FILE, "empty_layout"); + evas_object_event_callback_add(dv->body_main, EVAS_CALLBACK_DEL, _on_delete, dv); + evas_object_data_set(dv->body_main, "update_cb", _on_update); + evas_object_data_set(dv->body_main, "update_data", dv); + evas_object_data_set(dv->body_main, "time_format_update_cb", _on_update); + evas_object_data_set(dv->body_main, "time_format_update_data", dv); + /* delete "<-" button */ + Evas_Object *btn = elm_button_add(dv->navigator); + evas_object_smart_callback_add(btn, "clicked", _on_back_btn_clicked, dv); + elm_object_style_set(btn, "naviframe/back_btn/default"); + /* compose */ + Elm_Object_Item *navi_it = memo_naviframe_item_push(dv->navigator, "", btn, NULL, dv->body_main, NULL); + dv->navi_it = navi_it; + + /* contrl bar */ + dv->ctrl_bar = memo_controlbar_add(dv->navigator); + elm_toolbar_item_append(dv->ctrl_bar, NULL, MEMO_I18N_DELETE, _on_delete_btn_clicked, dv); + elm_toolbar_item_append(dv->ctrl_bar, NULL, MEMO_I18N_EDIT, _on_edit_btn_clicked, dv); + elm_toolbar_item_append(dv->ctrl_bar, NULL, MEMO_I18N_SHARE, _on_share_btn_clicked, dv); + elm_toolbar_item_append(dv->ctrl_bar, NULL, MEMO_I18N_CREATE, _on_create_btn_clicked, dv); + elm_object_item_part_content_set(navi_it, "controlbar", dv->ctrl_bar); + _memo_detail_navibar_mode_set(dv, MODE_DETAIL); + /* load content */ + _memo_detail_load_content(dv); + return (void *)dv; +} + diff --git a/src/memo_doodle_editor.c b/src/memo_doodle_editor.c new file mode 100644 index 0000000..ded6a67 --- /dev/null +++ b/src/memo_doodle_editor.c @@ -0,0 +1,651 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __doodle_editor_t { + Evas_Object *win; + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + memo_data_t *record; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + Eina_Bool savable; + Eina_Bool erase; /* erase mode */ + Eina_Bool comment; /* edit comment mode */ + Eina_Bool doodle_init; + Eina_Bool stroke_down; /* see comment in _on_doodle_move_cb */ + int stroke_size; + int stroke_color; + + /* content */ + Evas_Object *body_main; + Evas_Object *doodle; + Evas_Object *toolbar; + Evas_Object *btn_size; + void *h_ss; + Evas_Object *btn_color; + void *h_cs; + Evas_Object *edit_field; + + /* entry */ + Evas_Object *entry; + Ecore_IMF_Context *imf_context; + + Eina_Bool cancel_forbidden; /* in usb keyboard mode, cancel can be triggered more than once */ +} doodle_editor_t; + +/* auto stripped function prototype */ +static void _save_record(doodle_editor_t *de); +static void _on_save_yes(void *data, Evas_Object *obj, void *event_info); +static void _on_save_no(void *data, Evas_Object *obj, void *event_info); +static Eina_Bool _launch_yes_no_popup(void *data); +static void _stroke_size_selector_callback(void *data, const char *msg, void *event); +static void _stroke_size_selector_del(doodle_editor_t *de); +static void _on_stroke_size_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info); +static void _stroke_color_selector_del(doodle_editor_t *de); +static void _on_stroke_color_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info); +static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value); +static void _on_entry_content_change(void *data, Evas_Object *obj, void *event_info); +static void _draw_argb32(int *img, int w, int h, int x, int y, int size, int color); +static void _on_doodle_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _on_doodle_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _on_doodle_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _on_doodle_resize_cb(void *data, Evas_Object *obj, void *event_info); +static void _on_eraser_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info); +static void _on_yes(void *data, Evas_Object *obj, void *event_info); +static void _on_no(void *data, Evas_Object *obj, void *event_info); +static void _on_text_mode(void *data, Evas_Object *obj, void *event_info); +static void _create_doodle_editor_layout(doodle_editor_t *de, bundle *bd); +/* end auto strip */ + +static void _save_record(doodle_editor_t *de) +{ + memo_begin_trans(); + if (de->record->id != -1) { + memo_mod_data(de->record); + } else { + de->record->content = memo_get_doodle_title(); + memo_add_data(de->record); + } + /* save doodle to file */ + snprintf(de->buf, MEMO_BUFFER_SIZE, DOODLEDIR "/%d.png", (int)de->record->id); + evas_object_image_save(de->doodle, de->buf, NULL, NULL); + memo_end_trans(); +} + +static void _on_save_yes(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + _save_record(de); + de->cb(de->data, "save", NULL); +} + +static void _on_save_no(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + de->cb(de->data, "cancel", NULL); +} + +static Eina_Bool _launch_yes_no_popup(void *data) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + memo_create_yes_no_popup(de->win, MEMO_I18N_SAVE_MEMO, _on_save_yes, _on_save_no, de); + return EINA_FALSE; +} + +static void _stroke_size_selector_callback(void *data, const char *msg, void *event) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(de->body_main, "elm.swallow.tool", (Evas_Object *)event); + } else if (strcmp(msg, "change") == 0) { + de->stroke_size = (int)event; + } else if (strcmp(msg, "flick,down") == 0) { + _stroke_size_selector_del(de); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + } +} + +static void _stroke_size_selector_del(doodle_editor_t *de) +{ + if (de->h_ss != NULL) { + elm_object_part_content_unset(de->body_main, "elm.swallow.tool"); + memo_del_pencil_size_selector(de->h_ss); + de->h_ss = NULL; + memo_tool_btn_focus_set(de->btn_size, EINA_FALSE); + } +} + +static void _on_stroke_size_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (de->h_ss != NULL) { /* stroke size selector already open */ + return; + } + if (de->h_cs != NULL) { /* destroy stroke color selector */ + _stroke_color_selector_del(de); + } + if (de->erase) { /* deselect eraser */ + de->erase = EINA_FALSE; + Evas_Object *eo = (Evas_Object *)elm_object_part_content_get(de->toolbar, "elm.swallow.btn3"); + memo_tool_btn_focus_set(eo, de->erase); + } + /* load stroke size selector */ + bundle *bd = bundle_create(); + snprintf(de->buf, MEMO_BUFFER_SIZE, "%d", de->stroke_size); + bundle_add(bd, "current", de->buf); + de->h_ss = memo_load_pencil_size_selector(de->body_main, bd, _stroke_size_selector_callback, de); + bundle_free(bd); + memo_tool_btn_focus_set(de->btn_size, EINA_TRUE); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "abbrev", "elm"); +} + +void _stroke_color_selector_callback(void *data, const char *msg, void *event) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(de->body_main, "elm.swallow.tool", (Evas_Object *)event); + } else if (strcmp(msg, "change") == 0) { + de->stroke_color = (int)event; + } else if (strcmp(msg, "flick,down") == 0) { + _stroke_color_selector_del(de); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + } +} + +static void _stroke_color_selector_del(doodle_editor_t *de) +{ + if (de->h_cs != NULL) { + elm_object_part_content_unset(de->body_main, "elm.swallow.tool"); + memo_del_color_selector(de->h_cs); + memo_tool_btn_focus_set(de->btn_color, EINA_FALSE); + de->h_cs = NULL; + } +} + +static void _on_stroke_color_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (de->h_cs!= NULL) { /* stroke color selector already open */ + return; + } + if (de->h_ss!= NULL) { /* destroy stroke size selector */ + _stroke_size_selector_del(de); + } + if (de->erase) { /* deselect eraser */ + de->erase = EINA_FALSE; + Evas_Object *eo = (Evas_Object *)elm_object_part_content_get(de->toolbar, "elm.swallow.btn3"); + memo_tool_btn_focus_set(eo, de->erase); + } + /* load stroke color selector */ + bundle *bd = bundle_create(); + snprintf(de->buf, MEMO_BUFFER_SIZE, "%d", de->stroke_color); + bundle_add(bd, "color", de->buf); + de->h_cs = memo_load_color_selector(de->body_main, bd, _stroke_color_selector_callback, de); + bundle_free(bd); + memo_tool_btn_focus_set(de->btn_color, EINA_TRUE); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "abbrev", "elm"); +} + +static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + if (de->comment) { + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "comment"); + } + } else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "abbrev", "comment"); + if (!de->comment) { /* first shift to comment mode */ + if (de->record->comment == NULL) { /* remove DUMMY_COMMENT */ + elm_entry_entry_set(de->entry, ""); + } + de->cb(de->data, "savable", (void *)0); + } + de->comment = EINA_TRUE; + de->cb(de->data, "title", de->record->comment == NULL ? MEMO_I18N_ADD_COMMENT : MEMO_I18N_EDIT_COMMENT); + } +} + +static void _on_entry_content_change(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + RETIF(!de->comment); + if (elm_object_focus_get(de->edit_field)) { + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(de->edit_field, "elm,state,eraser,hide", "elm"); + else + elm_object_signal_emit(de->edit_field, "elm,state,eraser,show", "elm"); + } + Eina_Bool savable = memo_comment_savable(de->entry, de->record->comment); + de->cb(de->data, "savable", (void *)(savable?1:0)); +} + +static void _focused_cb(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext. +{ +#ifdef __i386__ + doodle_editor_t *de = (doodle_editor_t *)data; + if (!elm_entry_is_empty(obj)) { + elm_object_signal_emit(de->edit_field, "elm,state,eraser,show", "elm"); + } + elm_object_signal_emit(de->edit_field, "elm,state,guidetext,hide", "elm"); + + Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(de->entry); + if (ecore_imf_context_input_panel_state_get(imf_context) != + ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + //USB keyboard is inactive + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "abbrev", "comment"); + } + else { + if (!de->comment) { /* first shift to comment mode */ + if (de->record->comment == NULL) { /* remove DUMMY_COMMENT */ + elm_entry_entry_set(de->entry, ""); + } + de->cb(de->data, "savable", (void *)0); + } + de->comment = EINA_TRUE; + de->cb(de->data, "title", de->record->comment == NULL ? MEMO_I18N_ADD_COMMENT : MEMO_I18N_EDIT_COMMENT); + } +#else + if (!elm_entry_is_empty(obj)) + elm_object_signal_emit(data, "elm,state,eraser,show", "elm"); + elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm"); +#endif +} + +static void _unfocused_cb(void *data, Evas_Object *obj, void *event_info) // Unfocused callback will show guidetext and hide X marked button. +{ +#ifdef __i386__ + doodle_editor_t *de = (doodle_editor_t *)data; + if (elm_entry_is_empty(obj)) { + elm_object_signal_emit(de->edit_field, "elm,state,guidetext,show", "elm"); + } + elm_object_signal_emit(de->edit_field, "elm,state,eraser,hide", "elm"); + + Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(de->entry); + if (ecore_imf_context_input_panel_state_get(imf_context) == + ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + //USB keyboard is active + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + de->cb(de->data, "title", de->record->id==-1 ? MEMO_I18N_CREATE_DRAWING : MEMO_I18N_EDIT_DRAWING); + } +#else + if (elm_entry_is_empty(obj)) { + elm_object_signal_emit(data, "elm,state,guidetext,show", "elm"); + } + elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); +#endif +} + +static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) // When X marked button is clicked, empty entry's contents. +{ + elm_entry_entry_set(data, ""); +} + +static void _draw_argb32(int *img, int w, int h, int x, int y, int size, int color) +{ + int cx, cy, cw, ch; + int i, j; + + cx = x; + cy = y; + cw = size; + ch = size; + CLIP_RECT_TO_RECT(cx, cy, cw, ch, 0, 0, w, h); + for (i = 0; i < ch; i++) { + for (j = 0; j < cw; j++) { + memcpy(img + (i + cy) * w + (cx + j), &color, 4); + } + } +} + +static void _on_doodle_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + + Evas_Event_Mouse_Move *event = (Evas_Event_Mouse_Move *)event_info; + int *img_data = NULL; + Evas_Coord x, y, w, h; + int color = 0; + + if (de->comment) { + return; + } + if (de->h_ss!= NULL) { /* destroy stroke size selector */ + _stroke_size_selector_del(de); + } + if (de->h_cs != NULL) { /* destroy stroke color selector */ + _stroke_color_selector_del(de); + } + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + de->stroke_down = EINA_TRUE; + de->record->has_doodle = 1; + if (!de->erase) { + de->savable = EINA_TRUE; + } else if (de->record->id != -1) { /* edit existing doodle with eraser */ + de->savable = EINA_TRUE; + } + de->cb(de->data, "savable", (void *)(de->savable?1:0)); + + //Fix bug N_SE-149 + color = de->erase ? 0xFFFFFFFF : de->stroke_color; + evas_object_geometry_get(de->doodle, &x, &y, &w, &h); + img_data = evas_object_image_data_get(de->doodle, 1); + _draw_argb32(img_data, w, h, event->cur.output.x - x, event->cur.output.y - y, de->stroke_size, color); + evas_object_image_data_update_add(de->doodle, 0, 0, w, h); + +} + +static void _on_doodle_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + Evas_Event_Mouse_Move *event = (Evas_Event_Mouse_Move *)event_info; + int *img_data = NULL; + Evas_Coord x, y, w, h; + int px = 0; + int py = 0; + int i = 0; + int gap_max = 0; + int gap_x = 0; + int gap_y = 0; + int color = 0; + + /* a little mouse move events will be received before mouse down event, + if those mouse move event is not filtered, + a line (from last up point to current move point) will be draw */ + if (!de->stroke_down) { + return; + } + + color = de->erase ? 0xFFFFFFFF : de->stroke_color; + evas_object_geometry_get(de->doodle, &x, &y, &w, &h); + img_data = evas_object_image_data_get(de->doodle, 1); + gap_x = event->cur.output.x - event->prev.output.x; + gap_y = event->cur.output.y - event->prev.output.y; + gap_max = MAX(abs(gap_x), abs(gap_y)); + + for (i = 0; i < gap_max; i++) { + px = event->prev.output.x + i * gap_x / gap_max; + py = event->prev.output.y + i * gap_y / gap_max; + /* mouse position in image */ + px -= x; + py -= y; + _draw_argb32(img_data, w, h, px, py, de->stroke_size, color); + } + evas_object_image_data_update_add(de->doodle, 0, 0, w, h); +} + +static void _on_doodle_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + de->stroke_down = EINA_FALSE; +} + +/* this function must be execute only once + * in resize callback we will get the actual size of doodle + * we need to transfer origin image data to fit the actual canvas size + */ +static void _on_doodle_resize_cb(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + Evas_Coord w, h; + int *img_data = NULL; + + if (de->doodle_init) { /* reenter control */ + return; + } else { + de->doodle_init = EINA_TRUE; + evas_object_geometry_get(de->doodle, NULL, NULL, &w, &h); + evas_object_image_size_set(de->doodle, w, h); + img_data = evas_object_image_data_get(de->doodle, 1); + if (img_data != NULL) { /* set background color as white */ + memset(img_data, 0xFFFFFFFF, sizeof(int)*w*h); + evas_object_image_data_update_add(de->doodle, 0, 0, w, h); + } + } +} + +static void _on_eraser_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (de->h_ss!= NULL) { /* destroy stroke size selector */ + _stroke_size_selector_del(de); + } + if (de->h_cs != NULL) { /* destroy stroke color selector */ + _stroke_color_selector_del(de); + } + de->erase = !(de->erase); + Evas_Object *eo = (Evas_Object *)elm_object_part_content_get(de->toolbar, "elm.swallow.btn3"); + memo_tool_btn_focus_set(eo, de->erase); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); +} + +static void _on_yes(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + _save_record(de); + de->cb(de->data, "text", NULL); +} + +static void _on_no(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + de->cb(de->data, "text", NULL); +} + +static void _on_text_mode(void *data, Evas_Object *obj, void *event_info) +{ + doodle_editor_t *de = (doodle_editor_t *)data; + if (de->savable) { /* modified, need user confirmation */ + memo_create_yes_no_popup(de->win, MEMO_I18N_SAVE_MEMO, _on_yes, _on_no, de); + } else { + de->cb(de->data, "text", NULL); + } +} + +static void _create_doodle_editor_layout(doodle_editor_t *de, bundle *bd) +{ + int w = 0; + int h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); + snprintf(de->buf, MEMO_BUFFER_SIZE, "doodle_editor_%d_%d", w, h); + LOGD("-----------load %s\n", de->buf); + de->body_main = elm_layout_create(de->parent, EDJ_FILE, de->buf); + de->cb(de->data, "layout", de->body_main); + /* title */ + de->cb(de->data, "title", de->record->id==-1 ? MEMO_I18N_CREATE_DRAWING : MEMO_I18N_EDIT_DRAWING); + /* date */ + memo_time_format(de->buf, MEMO_BUFFER_SIZE, de->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(de->body_main), "elm.text.date", de->buf); + + /* toolbar */ + de->toolbar = elm_swallowed_layout(de->body_main, "elm.swallow.toolbar", EDJ_FILE, "edit_toolbar"); + de->btn_size = elm_swallowed_layout(de->toolbar, "elm.swallow.btn1", EDJ_DIR"/black/memo.edj", "tl_stroke_size"); + evas_object_event_callback_add(de->btn_size, EVAS_CALLBACK_MOUSE_UP, _on_stroke_size_btn_up, de); + de->btn_color = elm_swallowed_layout(de->toolbar, "elm.swallow.btn2", EDJ_DIR"/black/memo.edj", "tl_stroke_color"); + evas_object_event_callback_add(de->btn_color, EVAS_CALLBACK_MOUSE_UP, _on_stroke_color_btn_up, de); + Evas_Object *eo = elm_swallowed_layout(de->toolbar, "elm.swallow.btn3", EDJ_DIR"/black/memo.edj", "tl_stroke_eraser"); + evas_object_event_callback_add(eo, EVAS_CALLBACK_MOUSE_UP, _on_eraser_up, de); + if (!bundle_key_check(bd, "toggle", "disable")) { + elm_swallowed_button(de->toolbar, "elm.swallow.btn4", MEMO_I18N_TEXT, _on_text_mode, de); + } + + /* doodle */ + Evas *evas = evas_object_evas_get(de->parent); + de->doodle = evas_object_image_filled_add(evas); + evas_object_image_colorspace_set(de->doodle, EVAS_COLORSPACE_ARGB8888); + evas_object_image_alpha_set(de->doodle, 1); + /* doodle data */ + if (de->record->has_doodle == 1) { + snprintf(de->buf, MEMO_BUFFER_SIZE, DOODLEDIR "/%d.png", (int)de->record->id); + evas_object_image_file_set(de->doodle, de->buf, NULL); + } else { + evas_object_render_flush_hook(de->doodle, _on_doodle_resize_cb, de); + } + evas_object_event_callback_add(de->doodle, EVAS_CALLBACK_MOUSE_DOWN, _on_doodle_down_cb, de); + evas_object_event_callback_add(de->doodle, EVAS_CALLBACK_MOUSE_MOVE, _on_doodle_move_cb, de); + evas_object_event_callback_add(de->doodle, EVAS_CALLBACK_MOUSE_UP, _on_doodle_up_cb, de); + evas_object_show(de->doodle); + elm_object_part_content_set(de->body_main, "elm.swallow.doodle", de->doodle); + + /* comment */ + eo = elm_swallowed_layout(de->body_main, "elm.swallow.comment", EDJ_FILE, "doodle_comment"); + //EditField + Evas_Object *layout = elm_layout_add(eo); + elm_layout_theme_set(layout, "layout", "editfield", "default"); + elm_object_part_content_set(eo, "elm.swallow.editfield", layout); + Evas_Object *entry = elm_entry_add(eo); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + de->edit_field = layout; + + elm_object_style_set(entry, "font_color_black"); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout, EVAS_HINT_EXPAND, 0.5); + de->entry = entry; + elm_entry_cnp_mode_set(de->entry, ELM_CNP_MODE_PLAINTEXT); + de->imf_context = elm_entry_imf_context_get(de->entry); + /* if not hide explicitly, seems hide event of sweep down can not be received */ + ecore_imf_context_input_panel_hide(de->imf_context); + memo_comment_recover(de->entry, de->record->comment); + ecore_imf_context_input_panel_event_callback_add(de->imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, + _input_panel_event_callback, de); + evas_object_smart_callback_add(de->entry, "changed", _on_entry_content_change, de); +#ifdef __i386__ + evas_object_smart_callback_add(de->entry, "focused", _focused_cb, de); + evas_object_smart_callback_add(de->entry, "unfocused", _unfocused_cb, de); +#else + evas_object_smart_callback_add(de->entry, "focused", _focused_cb, layout); + evas_object_smart_callback_add(de->entry, "unfocused", _unfocused_cb, layout); +#endif + elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, entry); + + /* savable */ + de->cb(de->data, "savable", (void *)(de->savable?1:0)); +} + +void memo_doodle_editor_time_format_update(void *h_de) +{ + doodle_editor_t *de = (doodle_editor_t *)h_de; + memo_time_format(de->buf, MEMO_BUFFER_SIZE, de->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(de->body_main), "elm.text.date", de->buf); +} + +void memo_doodle_editor_cancel(void *h_de) +{ + doodle_editor_t *de = (doodle_editor_t *)h_de; + if (de->cancel_forbidden) { + return; + } + if (de->comment) { + de->comment = EINA_FALSE; + ecore_imf_context_input_panel_hide(de->imf_context); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + memo_comment_recover(de->entry, de->record->comment); + de->cb(de->data, "title", de->record->id==-1 ? MEMO_I18N_CREATE_DRAWING : MEMO_I18N_EDIT_DRAWING); + de->cb(de->data, "savable", (void *)(de->savable?1:0)); + de->cb(de->data, "comment cancel", NULL); + } else { + if (!de->savable) { /* not modified, return directly */ + de->cb(de->data, "cancel", NULL); + } else { + de->cancel_forbidden = EINA_TRUE; + _launch_yes_no_popup(de); + } + } +} + +void memo_doodle_editor_save(void *h_de) +{ + doodle_editor_t *de = (doodle_editor_t *)h_de; + if (de->comment) { + ecore_imf_context_input_panel_hide(de->imf_context); + edje_object_signal_emit(elm_layout_edje_get(de->body_main), "expand", "elm"); + Eina_Bool savable = memo_comment_savable(de->entry, de->record->comment); + if (savable) { + de->record->comment = elm_entry_markup_to_utf8(elm_entry_entry_get(de->entry)); + if (de->record->id != -1) { /* when edit existing, modification of comment will make record savable */ + de->savable = EINA_TRUE; + } + } + de->cb(de->data, "title", de->record->id==-1 ? MEMO_I18N_CREATE_DRAWING : MEMO_I18N_EDIT_DRAWING); + de->cb(de->data, "savable", (void *)(de->savable?1:0)); + elm_object_focus_set(de->edit_field, EINA_FALSE); /* when disable done button, focus may reset to edit field */ + de->comment = EINA_FALSE; + de->cb(de->data, "comment done", NULL); + } else { + _save_record(de); + de->cb(de->data, "save", NULL); + } +} + +void *memo_load_doodle_editor(Evas_Object *win, Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data) +{ + doodle_editor_t *de = SMALLOC(doodle_editor_t); + RETVIF(de==NULL, NULL); + bundle_dump(bd); + de->win = win; + de->parent = parent; + de->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + de->data = data; + + /* init */ + const char *s = bundle_get_val(bd, "index"); + if (s == NULL) { + de->record = memo_create_data(); + de->record->id = -1; + de->record->modi_time = time((time_t *) 0); + } else { /* load item */ + de->record = memo_get_data(atoi(s)); + } + de->stroke_size = 8; + de->stroke_color = 0xff000000; + + _create_doodle_editor_layout(de, bd); + return (void *)de; +} + +void memo_destroy_doodle_editor(void *h_de) +{ + doodle_editor_t *de = (doodle_editor_t *)h_de; + if (de->h_ss!= NULL) { /* destroy stroke size selector */ + _stroke_size_selector_del(de); + } + if (de->h_cs != NULL) { /* destroy stroke color selector */ + _stroke_color_selector_del(de); + } + memo_free_data(de->record); + evas_object_del(de->body_main); + SFREE(de); +} diff --git a/src/memo_doodle_viewer.c b/src/memo_doodle_viewer.c new file mode 100644 index 0000000..0670018 --- /dev/null +++ b/src/memo_doodle_viewer.c @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __doodle_viewer_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + + /* content */ + Evas_Object *win_main; + memo_data_t *record; + Evas_Object *body_main; + Evas_Object *doodle; + Evas_Object *edit_field; + Evas_Object *entry; + Ecore_IMF_Context *imf_context; + Eina_Bool comment_mode; +} doodle_viewer_t; + +/* auto stripped function prototype */ +static void _on_entry_content_change(void *data, Evas_Object *obj, void *event_info); +static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value); +static void _create_doodle_viewer_layout(doodle_viewer_t *dv, bundle *bd); +/* end auto strip */ + +static void _on_entry_content_change(void *data, Evas_Object *obj, void *event_info) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)data; + if (elm_object_focus_get(dv->edit_field)) { + if (elm_entry_is_empty(obj)) { + elm_object_signal_emit(dv->edit_field, "elm,state,eraser,hide", "elm"); + } else { + elm_object_signal_emit(dv->edit_field, "elm,state,eraser,show", "elm"); + } + } + Eina_Bool savable = memo_comment_savable(dv->entry, dv->record->comment); + dv->cb(dv->data, "savable", (void *)(savable?1:0)); +} + +// Focused callback will show X marked button and hide guidetext +static void _focused_cb(void *data, Evas_Object *obj, void *event_info) +{ +#ifdef __i386__ + doodle_viewer_t *dv = (doodle_viewer_t *)data; + if (!elm_entry_is_empty(obj)) { + elm_object_signal_emit(dv->edit_field, "elm,state,eraser,show", "elm"); + } + elm_object_signal_emit(dv->edit_field, "elm,state,guidetext,hide", "elm"); + + Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(dv->entry); + if (ecore_imf_context_input_panel_state_get(imf_context) != + ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + //USB keyboard is inactive + edje_object_signal_emit(elm_layout_edje_get(dv->body_main), "abbrev", "comment"); + } + else { + if (dv->record->comment == NULL) { /* remove DUMMY_COMMENT */ + elm_entry_entry_set(dv->entry, ""); + } + dv->comment_mode = EINA_TRUE; + dv->cb(dv->data, "comment_mode", (void *)(dv->comment_mode?1:0)); + dv->cb(dv->data, "title", dv->record->comment == NULL ? MEMO_I18N_ADD_COMMENT : MEMO_I18N_EDIT_COMMENT); + Eina_Bool savable = memo_comment_savable(dv->entry, dv->record->comment); + dv->cb(dv->data, "savable", (void *)(savable?1:0)); + } +#else + if (!elm_entry_is_empty(obj)) { + elm_object_signal_emit(data, "elm,state,eraser,show", "elm"); + } + elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm"); +#endif +} + +// Unfocused callback will show guidetext and hide X marked button +static void _unfocused_cb(void *data, Evas_Object *obj, void *event_info) +{ +#ifdef __i386__ + doodle_viewer_t *dv = (doodle_viewer_t *)data; + if (elm_entry_is_empty(obj)){ + elm_object_signal_emit(dv->edit_field, "elm,state,guidetext,show", "elm"); + } + elm_object_signal_emit(dv->edit_field, "elm,state,eraser,hide", "elm"); + + Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(dv->entry); + if (ecore_imf_context_input_panel_state_get(imf_context) == + ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + //USB keyboard is active + elm_object_focus_allow_set(dv->entry, EINA_FALSE); + } +#else + if (elm_entry_is_empty(obj)){ + elm_object_signal_emit(data, "elm,state,guidetext,show", "elm"); + } + elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); +#endif +} + +// When X marked button is clicked, empty entry’s contents +static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + elm_entry_entry_set(data, ""); +} + +static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)data; + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + edje_object_signal_emit(elm_layout_edje_get(dv->body_main), "expand", "comment"); + } else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + edje_object_signal_emit(elm_layout_edje_get(dv->body_main), "abbrev", "comment"); + if (dv->record->comment == NULL) { /* remove DUMMY_COMMENT */ + elm_entry_entry_set(dv->entry, ""); + } + dv->comment_mode = EINA_TRUE; + dv->cb(dv->data, "comment_mode", (void *)(dv->comment_mode?1:0)); + dv->cb(dv->data, "title", dv->record->comment == NULL ? MEMO_I18N_ADD_COMMENT : MEMO_I18N_EDIT_COMMENT); + Eina_Bool savable = memo_comment_savable(dv->entry, dv->record->comment); + dv->cb(dv->data, "savable", (void *)(savable?1:0)); + } +} + +static void _create_doodle_viewer_layout(doodle_viewer_t *dv, bundle *bd) +{ + int w = 0; + int h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); + snprintf(dv->buf, MEMO_BUFFER_SIZE, "doodle_viewer_%d_%d", w, h); + LOGD("-----------load %s\n", dv->buf); + dv->body_main = elm_layout_create(dv->parent, EDJ_FILE, dv->buf); + dv->cb(dv->data, "layout", dv->body_main); + + /* date */ + memo_time_format(dv->buf, MEMO_BUFFER_SIZE, dv->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(dv->body_main), "elm.text.date", dv->buf); + + /* doodle */ + snprintf(dv->buf, MEMO_BUFFER_SIZE, DOODLEDIR "/%d.png", dv->record->id); + dv->doodle = elm_swallowed_icon(dv->body_main, "elm.swallow.doodle", dv->buf); + + /* comment */ + Evas_Object *eo = elm_swallowed_layout(dv->body_main, "elm.swallow.comment", EDJ_FILE, "doodle_comment"); + //EdieField + Evas_Object *layout = elm_layout_add(eo); + elm_layout_theme_set(layout, "layout", "editfield", "default"); + elm_object_part_content_set(eo, "elm.swallow.editfield", layout); + Evas_Object *ef = elm_entry_add(eo); + elm_object_part_content_set(layout, "elm.swallow.content", ef); + dv->edit_field = layout; + + elm_object_style_set(ef, "font_color_black"); + elm_entry_single_line_set(ef, EINA_TRUE); + elm_entry_scrollable_set(ef, EINA_TRUE); + evas_object_size_hint_weight_set(ef, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ef, EVAS_HINT_EXPAND, 0.5); + + dv->entry = ef; + elm_entry_cnp_mode_set(dv->entry, ELM_CNP_MODE_PLAINTEXT); + memo_comment_recover(dv->entry, dv->record->comment); + /* if not hide explicitly, seems hide event of sweep down can not be received */ + dv->imf_context = elm_entry_imf_context_get(dv->entry); + ecore_imf_context_input_panel_hide(dv->imf_context); + ecore_imf_context_input_panel_event_callback_add(dv->imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, + _input_panel_event_callback, dv); + evas_object_smart_callback_add(dv->entry, "changed", _on_entry_content_change, dv); +#ifdef __i386__ + evas_object_smart_callback_add(dv->entry, "focused", _focused_cb, dv); + evas_object_smart_callback_add(dv->entry, "unfocused", _unfocused_cb, dv); +#else + evas_object_smart_callback_add(dv->entry, "focused", _focused_cb, layout); + evas_object_smart_callback_add(dv->entry, "unfocused", _unfocused_cb, layout); +#endif + elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, dv->entry); +} + +void memo_doodle_viewer_share_record(void *h_dv) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)h_dv; + memo_share(dv->win_main, (int *)&dv->record->id, 1); +} + +void memo_doodle_viewer_save(void *h_dv) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)h_dv; + dv->record->comment = elm_entry_markup_to_utf8(elm_entry_entry_get(dv->entry)); + memo_mod_data(dv->record); + dv->cb(dv->data, "comment_save", NULL); + dv->comment_mode = EINA_FALSE; + dv->cb(dv->data, "comment_mode", (void *)(dv->comment_mode?1:0)); + elm_object_focus_set(dv->edit_field, EINA_FALSE); +#ifdef __i386__ + elm_object_focus_allow_set(dv->entry, EINA_TRUE); +#endif +} + +void memo_doodle_viewer_cancel(void *h_dv) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)h_dv; + memo_comment_recover(dv->entry, dv->record->comment); + dv->comment_mode = EINA_FALSE; + dv->cb(dv->data, "comment_mode", (void *)(dv->comment_mode?1:0)); + elm_object_focus_set(dv->edit_field, EINA_FALSE); +#ifdef __i386__ + elm_object_focus_allow_set(dv->entry, EINA_TRUE); +#endif +} + +void *memo_load_doodle_viewer(Evas_Object *parent, Evas_Object *win, int id, bundle *bd, Memo_Component_Callback cb, void *data) +{ + doodle_viewer_t *dv = SMALLOC(doodle_viewer_t); + RETVIF(dv==NULL, NULL); + bundle_dump(bd); + dv->parent = parent; + dv->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + dv->data = data; + + /* init */ + dv->win_main = win; + dv->record = memo_get_data(id); + _create_doodle_viewer_layout(dv, bd); + return (void *)dv; +} + +void memo_doodle_viewer_pre_del(void *h_dv) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)h_dv; + if (dv->imf_context != NULL) { + ecore_imf_context_input_panel_event_callback_del(dv->imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_event_callback); + ecore_imf_context_input_panel_hide(dv->imf_context); + } + dv->imf_context = NULL; + elm_layout_content_del(dv->body_main, "elm.swallow.doodle"); +} + +void memo_destroy_doodle_viewer(void *h_dv) +{ + doodle_viewer_t *dv = (doodle_viewer_t *)h_dv; + if (dv->imf_context != NULL) { + ecore_imf_context_input_panel_event_callback_del(dv->imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_event_callback); + ecore_imf_context_input_panel_hide(dv->imf_context); + } + evas_object_del(dv->body_main); + memo_free_data(dv->record); + SFREE(dv); +} + diff --git a/src/memo_edit.c b/src/memo_edit.c new file mode 100644 index 0000000..da688eb --- /dev/null +++ b/src/memo_edit.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +typedef struct __edit_view_t { + appdata *ad; + Evas_Object *navigator; + Elm_Object_Item *navi_it; + Evas_Object *body_main; /* content */ + Evas_Object *l_btn; + Evas_Object *r_btn; + Eina_Bool drawing; /* drawing or text mode */ + + /* add more variables here */ + void *h_ed; +} edit_view_t; + +static void _text_editor_callback(void *data, const char *msg, void *event); +static void _doodle_editor_callback(void *data, const char *msg, void *event); + +static void _on_left_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + edit_view_t *ev = (edit_view_t *)data; + if (ev->drawing) { + memo_doodle_editor_cancel(ev->h_ed); + } else { + memo_text_editor_cancel(ev->h_ed); + } +} + +static void _on_right_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + edit_view_t *ev = (edit_view_t *)data; + if (ev->drawing) { + memo_doodle_editor_save(ev->h_ed); + } else { + memo_text_editor_save(ev->h_ed); + } +} + +static void _text_editor_callback(void *data, const char *msg, void *event) +{ + edit_view_t *ev = (edit_view_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(ev->body_main, "elm.swallow.content", (Evas_Object *)event); + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(ev->navi_it, (const char *)event); + } else if (strcmp(msg, "savable") == 0) { + elm_object_disabled_set(ev->r_btn, (int)event==0? EINA_TRUE:EINA_FALSE); + } else if (strcmp(msg, "save") == 0) { + ev->ad->index = ev->ad->index_detail; + memo_navigator_pop(ev->navigator); + } else if (strcmp(msg, "cancel") == 0) { + ev->ad->index = ev->ad->index_detail; + memo_navigator_pop(ev->navigator); + } else if (strcmp(msg, "drawing") == 0) { + elm_object_part_content_unset(ev->body_main, "elm.swallow.content"); + memo_destroy_text_editor(ev->h_ed); + ev->h_ed = memo_load_doodle_editor(ev->ad->win_main, ev->body_main, NULL, _doodle_editor_callback, ev); + ev->drawing = EINA_TRUE; + } +} + +static void _doodle_editor_callback(void *data, const char *msg, void *event) +{ + edit_view_t *ev = (edit_view_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(ev->body_main, "elm.swallow.content", (Evas_Object *)event); + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(ev->navi_it, (const char *)event); + } else if (strcmp(msg, "savable") == 0) { + elm_object_disabled_set(ev->r_btn, (int)event==0? EINA_TRUE:EINA_FALSE); + } else if (strcmp(msg, "save") == 0) { + ev->ad->index = ev->ad->index_detail; + memo_navigator_pop(ev->navigator); + } else if (strcmp(msg, "cancel") == 0) { + ev->ad->index = ev->ad->index_detail; + memo_navigator_pop(ev->navigator); + } else if (strcmp(msg, "text") == 0) { + elm_object_part_content_unset(ev->body_main, "elm.swallow.content"); + memo_destroy_doodle_editor(ev->h_ed); + ev->h_ed = memo_load_text_editor(ev->ad->win_main, ev->body_main, NULL, _text_editor_callback, ev); + ev->drawing = EINA_FALSE; + } +} + +static void _edit_on_delete(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + edit_view_t *ev = (edit_view_t *)data; + elm_object_part_content_unset(ev->body_main, "elm.swallow.content"); + if (ev->drawing) { + memo_destroy_doodle_editor(ev->h_ed); + } else { + memo_destroy_text_editor(ev->h_ed); + } + evas_object_del(ev->l_btn); + evas_object_del(ev->r_btn); + SFREE(ev); +} + +static void _on_update(void *data, Evas_Object *obj, void *event_info) +{ + edit_view_t *ev = (edit_view_t *)data; + if (ev->drawing) { + memo_doodle_editor_time_format_update(ev->h_ed); + } else { + memo_text_editor_time_format_update(ev->h_ed); + } +} + +void *memo_load_edit_view(appdata *ad) +{ + edit_view_t *ev = SMALLOC(edit_view_t); + RETVIF(ev == NULL, NULL); + ev->ad = ad; + + ev->navigator = ad->navigator; + /* body main */ + ev->body_main = elm_layout_create(ev->navigator, EDJ_FILE, "empty_layout"); + elm_naviframe_prev_btn_auto_pushed_set(ev->navigator, EINA_FALSE); + Elm_Object_Item *navi_it = memo_naviframe_item_push(ev->navigator, "", NULL, NULL, ev->body_main, NULL); + ev->navi_it = navi_it; + evas_object_event_callback_add(ev->body_main, EVAS_CALLBACK_DEL, _edit_on_delete, ev); + evas_object_data_set(ev->body_main, "time_format_update_cb", _on_update); + evas_object_data_set(ev->body_main, "time_format_update_data", ev); + /* delete "<-" button */ + Evas_Object *btn = elm_object_item_part_content_get(navi_it, MEMO_NAVIFRAME_ITEM_PREV_BTN); + if (btn != NULL) { + evas_object_del(btn); + } + ev->l_btn = elm_navigator_btn_create(ev->navigator, MEMO_I18N_CANCEL, + ICONDIR "/01_header_icon_cancel.png", "navigationbar_control/left", + _on_left_btn_clicked, ev); + elm_object_item_part_content_set(navi_it, "title_left_btn", ev->l_btn); + ev->r_btn = elm_navigator_btn_create(ev->navigator, MEMO_I18N_SAVE, + ICONDIR "/01_header_icon_done.png", "navigationbar_control/right", + _on_right_btn_clicked, ev); + elm_object_item_part_content_set(navi_it, "title_right_btn", ev->r_btn); + + /* load editor */ + if (ad->index == -1) { + ev->h_ed = memo_load_text_editor(ev->ad->win_main, ev->body_main, NULL, _text_editor_callback, ev); + ev->drawing = EINA_FALSE; + } else { + memo_data_t *md = memo_get_data(ad->index); + bundle *bd = bundle_create(); + snprintf(ev->ad->buf, MEMO_BUFFER_SIZE, "%d", ad->index); + bundle_add(bd, "index", ev->ad->buf); + if (ad->init_str != NULL) { + bundle_add(bd, "text", ev->ad->buf); + SFREE(ad->init_str); + } + if (md->has_doodle == 1) { + ev->h_ed = memo_load_doodle_editor(ev->ad->win_main, ev->body_main, bd, _doodle_editor_callback, ev); + ev->drawing = EINA_TRUE; + } else { + ev->h_ed = memo_load_text_editor(ev->ad->win_main, ev->body_main, bd, _text_editor_callback, ev); + ev->drawing = EINA_FALSE; + } + bundle_free(bd); + memo_free_data(md); + } + return (void *)ev; +} + diff --git a/src/memo_edit_list.c b/src/memo_edit_list.c new file mode 100644 index 0000000..0303913 --- /dev/null +++ b/src/memo_edit_list.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "memo_ug.h" + +typedef struct __edit_list_view_t { + appdata *ad; + Evas_Object *navigator; + Elm_Object_Item *navi_it; + Evas_Object *body_main; + Elm_Object_Item *delete_btn; + Elm_Object_Item *share_btn; + Evas_Object *control_bar; + void *viewer; +} edit_list_view_t; + +static void on_delete_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + memo_list_editor_delete_records(elv->viewer); +} + +static void _on_cancel_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + memo_navigator_pop(elv->navigator); +} + +static void _elv_on_send_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + memo_list_editor_share_records(elv->viewer); +} + +static void _list_editor_callback(void *data, const char *msg, void *event) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(elv->body_main, "elm.swallow.content", (Evas_Object *)event); + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(elv->navi_it, (const char *)event); + } else if (strcmp(msg, "count") == 0) { + elm_object_item_disabled_set(elv->delete_btn, ((int)event == 0) ? EINA_TRUE : EINA_FALSE); + elm_object_item_disabled_set(elv->share_btn, ((int)event != 1) ? EINA_TRUE : EINA_FALSE); + } else if (strcmp(msg, "delete_done") == 0) { + memo_navigator_pop(elv->navigator); + } +} + +void _on_delete(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + elm_object_part_content_unset(elv->body_main, "elm.swallow.content"); + memo_destroy_list_editor(elv->viewer); + elv->viewer = NULL; + SFREE(elv); +} + +static void _on_update(void *data, Evas_Object *obj, void *event_info) +{ + edit_list_view_t *elv = (edit_list_view_t *)data; + if (elv->viewer != NULL) { + elm_object_part_content_unset(elv->body_main, "elm.swallow.content"); + memo_destroy_list_editor(elv->viewer); + } + elv->viewer = memo_load_list_editor(elv->body_main, elv->ad->win_main, NULL, _list_editor_callback, elv); +} + +void *memo_load_edit_list_view(appdata *ad) +{ + edit_list_view_t *elv = SMALLOC(edit_list_view_t); + RETVIF(elv == NULL, NULL); + + elv->ad = ad; + elv->navigator = ad->navigator; + + /* body main */ + elv->body_main = elm_layout_create(elv->navigator, EDJ_FILE, "empty_layout"); + Elm_Object_Item *navi_it = memo_naviframe_item_push(elv->navigator, MEMO_I18N_SELECT_MEMO, NULL, NULL, elv->body_main, NULL); + elv->navi_it = navi_it; + evas_object_event_callback_add(elv->body_main, EVAS_CALLBACK_DEL, _on_delete, elv); + evas_object_data_set(elv->body_main, "time_format_update_cb", _on_update); + evas_object_data_set(elv->body_main, "time_format_update_data", elv); + /* delete "<-" button */ + Evas_Object *btn = elm_object_item_part_content_get(navi_it, MEMO_NAVIFRAME_ITEM_PREV_BTN); + if (btn != NULL) { + evas_object_del(btn); + } + /* control bar */ + Evas_Object *ctrl_bar = memo_controlbar_add(elv->navigator); + elm_toolbar_item_append(ctrl_bar, NULL, MEMO_I18N_CANCEL, _on_cancel_btn_clicked, elv); + elv->delete_btn = elm_toolbar_item_append(ctrl_bar, NULL, MEMO_I18N_DELETE, on_delete_btn_clicked, elv); + elv->share_btn = elm_toolbar_item_append(ctrl_bar, NULL, MEMO_I18N_SHARE, _elv_on_send_btn_clicked, elv); + elm_object_item_part_content_set(navi_it, "controlbar", ctrl_bar); + /* custom body main here */ + elv->viewer = memo_load_list_editor(elv->body_main, elv->ad->win_main, NULL, _list_editor_callback, elv); + return elv; +} + diff --git a/src/memo_list.c b/src/memo_list.c new file mode 100644 index 0000000..91ade9d --- /dev/null +++ b/src/memo_list.c @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include + +typedef struct __list_view_t { + appdata *ad; + Evas_Object *navigator; + Elm_Object_Item *navi_it; + Evas_Object *body_main; + Elm_Object_Item *l_btn; + void *viewer; +} list_view_t; + +static void _on_left_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + list_view_t *lv = (list_view_t *)data; + appdata *ad = lv->ad; + ad->index = -1; + memo_load_edit_list_view(ad); +} + +static void _on_right_btn_clicked(void *data, Evas_Object *obj, void *event_info) +{ + list_view_t *lv = (list_view_t *)data; + appdata *ad = lv->ad; + ad->index = -1; + memo_load_edit_view(ad); +} + +static Eina_Bool _launch_detail_view(void *data) +{ + list_view_t *lv = (list_view_t *)data; + /* destroy content to make sure no doodle file is referenced, + otherwise, doodle may disappear when edit */ + elm_object_part_content_unset(lv->body_main, "elm.swallow.content"); + memo_destroy_list_viewer(lv->viewer); + lv->viewer = NULL; + memo_load_detail_view(lv->ad); + return EINA_FALSE; +} + +static void _list_viewer_callback(void *data, const char *msg, void *event) +{ + list_view_t *lv = (list_view_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(lv->body_main, "elm.swallow.content", (Evas_Object *)event); + } else if (strcmp(msg, "title") == 0) { + elm_object_item_text_set(lv->navi_it, (const char *)event); + } else if (strcmp(msg, "delete") == 0) { + } else if (strcmp(msg, "count") == 0) { + /* disable edit button */ + elm_object_item_disabled_set(lv->l_btn, ((int)event == 0) ? EINA_TRUE : EINA_FALSE); + } else if (strcmp(msg, "select") == 0) { + lv->ad->index = (int)event; + ecore_idler_add(_launch_detail_view, lv); + } +} + +static void _on_delete(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + list_view_t *lv = (list_view_t *)data; + if (lv->viewer != NULL) { + elm_object_part_content_unset(lv->body_main, "elm.swallow.content"); + memo_destroy_list_viewer(lv->viewer); + lv->viewer = NULL; + } + SFREE(lv); +} + +static void _on_update(void *data, Evas_Object *obj, void *event_info) +{ + list_view_t *lv = (list_view_t *)data; + if (lv->viewer != NULL) { + elm_object_part_content_unset(lv->body_main, "elm.swallow.content"); + memo_destroy_list_viewer(lv->viewer); + } + lv->viewer = memo_load_list_viewer(lv->body_main, lv->ad->win_main, NULL, _list_viewer_callback, lv); +} + +void _back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + /* change Applications's windwos to background */ + Evas_Object *win = (Evas_Object *) data; + elm_win_lower(win); +} + +void *memo_load_list_view(appdata *ad) +{ + list_view_t *lv = SMALLOC(list_view_t); + RETVIF(lv == NULL, NULL); + lv->ad = ad; + + lv->navigator = ad->navigator; + /* body main */ + lv->body_main = elm_layout_create(lv->navigator, EDJ_FILE, "empty_layout"); + /* back btn of navigation bar */ + Evas_Object *btn = elm_button_add(lv->navigator); + evas_object_smart_callback_add(btn, "clicked", _back_btn_clicked_cb, lv->ad->win_main); + Elm_Object_Item *navi_it = memo_naviframe_item_push(lv->navigator, "", btn, NULL, lv->body_main, NULL); + lv->navi_it = navi_it; + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_event_callback_add(lv->body_main, EVAS_CALLBACK_DEL, _on_delete, lv); + evas_object_data_set(lv->body_main, "update_cb", _on_update); + evas_object_data_set(lv->body_main, "update_data", lv); + evas_object_data_set(lv->body_main, "time_format_update_cb", _on_update); + evas_object_data_set(lv->body_main, "time_format_update_data", lv); + /* control bar */ + Evas_Object *ctrl_bar = memo_controlbar_add(lv->navigator); + lv->l_btn = elm_toolbar_item_append(ctrl_bar, NULL, MEMO_I18N_EDIT, _on_left_btn_clicked, lv); + elm_toolbar_item_append(ctrl_bar, NULL, MEMO_I18N_CREATE, _on_right_btn_clicked, lv); + elm_object_item_part_content_set(navi_it, "controlbar", ctrl_bar); +#ifdef __i386__ + //Fix bug N_SE-238 + elm_object_focus_set(ctrl_bar, EINA_FALSE); + elm_object_focus_allow_set(btn, EINA_FALSE); +#endif + /* custom body main here */ + lv->viewer = memo_load_list_viewer(lv->body_main, lv->ad->win_main, NULL, _list_viewer_callback, lv); + return (void *)lv; +} + diff --git a/src/memo_list_editor.c b/src/memo_list_editor.c new file mode 100644 index 0000000..8bca224 --- /dev/null +++ b/src/memo_list_editor.c @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __list_editor { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + + /* content */ + Evas_Object *body_main; + Evas_Object *select_all; + Evas_Object *genlist; + + /* other */ + Evas_Object *win_main; + Elm_Genlist_Item_Class itc; + Elm_Genlist_Item_Class itc_draw; + int count; /* count of records */ + int select_count; /* count of records */ + Evas_Object *selectioninfo; + Evas_Object *selectioninfo_layout; +} list_editor; + +#pragma GCC diagnostic ignored "-Wformat-extra-args" +static void create_selectioninfo(list_editor *le) +{ + if (le->selectioninfo == NULL) { + le->selectioninfo = elm_notify_add(le->body_main); + elm_notify_orient_set(le->selectioninfo, ELM_NOTIFY_ORIENT_BOTTOM); + le->selectioninfo_layout = elm_layout_add(le->body_main); + elm_layout_theme_set(le->selectioninfo_layout, "standard", "selectioninfo", + "vertical/bottom_12"); + elm_object_content_set(le->selectioninfo, le->selectioninfo_layout); + } + + if (le->select_count == 0) { + evas_object_hide(le->selectioninfo); + } else { + char text[128]; + if (le->select_count == 1) { + snprintf(text, 128, "%s", MEMO_I18N_1_MEMO_SELECTED); + } else { + snprintf(text, 128, MEMO_I18N_D_MEMOS_SELECTED, le->select_count); + } + edje_object_part_text_set(elm_layout_edje_get(le->selectioninfo_layout), "elm.text", text); + evas_object_show(le->selectioninfo); + } +} +#pragma GCC diagnostic warning "-Wformat-extra-args" + +static void _on_item_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + gl_data_t *gld = (gl_data_t *)elm_object_item_data_get(it); + list_editor *le = (list_editor *)gld->user_data; + + elm_genlist_item_selected_set(it, 0); + + gld->check = !gld->check; + elm_genlist_item_update(it); + (gld->check) ? (le->select_count++) : (le->select_count--); + if (le->select_count == le->count) { /* update select all */ + elm_check_state_set(le->select_all, EINA_TRUE); + } else { + elm_check_state_set(le->select_all, EINA_FALSE); + } + /* update select info */ + create_selectioninfo(le); + le->cb(le->data, "count", (void *)le->select_count); +} + +static void memo_data_iterate_cb (memo_data_t *md, void *user_data) +{ + list_editor *le = (list_editor *)user_data; + gl_data_t *gld = SMALLOC(gl_data_t); + RETIF(gld == NULL); + memo_gld_init(gld, md, le, NULL); + if (md->has_doodle) { + elm_genlist_item_append(le->genlist, &le->itc_draw,(void *)gld, + NULL, ELM_GENLIST_ITEM_NONE, _on_item_select_cb, NULL); + } else { + elm_genlist_item_append(le->genlist, &le->itc,(void *)gld, + NULL, ELM_GENLIST_ITEM_NONE, _on_item_select_cb, NULL); + } + le->count++; +} + +static void on_select_all_change_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + list_editor *le = (list_editor *)data; + Evas_Event_Mouse_Up *ev = event_info; + Eina_Bool bSelect = EINA_FALSE; + Eina_List *realized_list; + Elm_Object_Item *it; + Eina_List *l = NULL; + gl_data_t *gld = NULL; + + Evas_Coord x, y, w, h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + if (!IN_RECT_CHECK(ev->output.x, ev->output.y, x, y, w, h)) { + return; + } + + bSelect = elm_check_state_get(le->select_all); + bSelect = !bSelect; + elm_check_state_set(le->select_all, bSelect); + bSelect ? (le->select_count = le->count) : (le->select_count = 0); + it = elm_genlist_first_item_get(le->genlist); + while (it != NULL) { + gld = (gl_data_t *)elm_object_item_data_get(it); + if (gld->index != -1) { + gld->check = bSelect; + } + it = elm_genlist_item_next_get(it); + } + realized_list = elm_genlist_realized_items_get(le->genlist); + EINA_LIST_FOREACH(realized_list, l, it) { + elm_genlist_item_update(it); + } + create_selectioninfo(le); + le->cb(le->data, "count", (void *)le->select_count); +} + +static void _create_list_editor_layout(list_editor *le, bundle *bd) +{ + Evas_Object *eo = NULL; + Evas_Object *check = NULL; + + le->body_main = elm_layout_create(le->parent, EDJ_FILE, "edit_list_frame"); + le->cb(le->data, "layout", le->body_main); + + /* select all */ + eo = elm_layout_create(le->body_main, EDJ_FILE, "edit_list_item_select_all"); + edje_object_part_text_set(elm_layout_edje_get(eo), "elm.text.select.all", MEMO_I18N_SELECT_ALL); + check = elm_check_create(eo); + elm_object_part_content_set(eo, "elm.swallow.check", check); + evas_object_event_callback_add(eo, EVAS_CALLBACK_MOUSE_UP, on_select_all_change_cb, le); + elm_object_part_content_set(le->body_main, "elm.swallow.select.all", eo); + le->select_all = check; + /* genlist */ + le->genlist = elm_genlist_add(le->body_main); + elm_object_part_content_set(le->body_main, "elm.swallow.content", le->genlist); + elm_genlist_block_count_set(le->genlist, 8); + /* records */ + le->count = 0; + memo_all_data(memo_data_iterate_cb, le); + /* notify */ + le->cb(le->data, "count", (void *)le->select_count); +} + +static void on_delete_yes(void *data, Evas_Object *obj, void *event_info) +{ + list_editor *le = (list_editor *)data; + Elm_Object_Item *it; + Elm_Object_Item *pre; + gl_data_t *gld = NULL; + + memo_begin_trans(); + it = elm_genlist_first_item_get(le->genlist); + while (it != NULL) { + pre = it; + it = elm_genlist_item_next_get(it); + gld = (gl_data_t *)elm_object_item_data_get(pre); + if (gld->check) { + memo_del_data(gld->index); + elm_object_item_del(pre); + } + } + memo_end_trans(); + le->cb(le->data, "delete_done", le->body_main); +} + +void memo_list_editor_share_records(void *h_le) +{ + list_editor *le = (list_editor *)h_le; + int indexes[400] = {0}; + int c = 0; + Elm_Object_Item *it; + gl_data_t *gld = NULL; + it = elm_genlist_first_item_get(le->genlist); + while (it != NULL) { + gld = (gl_data_t *)elm_object_item_data_get(it); + if (gld->check) { + indexes[c++] = gld->index; + } + it = elm_genlist_item_next_get(it); + } + memo_share(le->win_main, indexes, c); +} + +void memo_list_editor_delete_records(void *h_le) +{ + list_editor *le = (list_editor *)h_le; + snprintf(le->buf, MEMO_BUFFER_SIZE, "%s?", MEMO_I18N_DELETE); + memo_create_yes_no_popup(le->win_main, le->buf, on_delete_yes, NULL, le); +} + +void *memo_load_list_editor(Evas_Object *parent, Evas_Object *win, bundle *bd, Memo_Component_Callback cb, void *data) +{ + list_editor *le = SMALLOC(list_editor); + RETVIF(le==NULL, NULL); + bundle_dump(bd); + le->parent = parent; + le->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + le->data = data; + + /* init */ + memo_gl_itc_init(&le->itc, "memo/edit/list"); + memo_gl_itc_init(&le->itc_draw, "memo/edit/list_draw"); + le->win_main = win; + + _create_list_editor_layout(le, bd); + return (void *)le; +} + +void memo_destroy_list_editor(void *h_le) +{ + list_editor *le = (list_editor *)h_le; + evas_object_del(le->body_main); + SFREE(le); +} + diff --git a/src/memo_list_viewer.c b/src/memo_list_viewer.c new file mode 100644 index 0000000..b7c432e --- /dev/null +++ b/src/memo_list_viewer.c @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __list_viewer_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + + /* content */ + Evas_Object *body_main; + Evas_Object *searchbar; + Evas_Object *searchbar_layout; + Evas_Object *genlist; + Evas_Object *nocontent; + + /* other */ + Evas_Object *win_main; + Elm_Genlist_Item_Class itc; + Elm_Genlist_Item_Class itc_draw; + Ecore_IMF_Context *imf_context; + Elm_Entry_Filter_Limit_Size limit_filter_data; + int mode; /* 0:list, 1:search */ + char *search_str; + int count; /* count of records */ +} list_viewer_t; + +static void _on_item_select_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *it = (Elm_Object_Item *)event_info; + gl_data_t *gld = (gl_data_t *)elm_object_item_data_get(it); + list_viewer_t *lv = (list_viewer_t *)gld->user_data; + + elm_genlist_item_selected_set(it, 0); + RETIF(gld->index == -1); + lv->cb(lv->data, "select", (void *)gld->index); +} + +static void _on_delete_yes(void *data, Evas_Object *obj, void *event_info) +{ + gl_data_t *gld = (gl_data_t *)data; + gl_data_t *d = NULL; + list_viewer_t *lv = (list_viewer_t *)gld->user_data; + Elm_Object_Item *it = NULL; + + it = elm_genlist_first_item_get(lv->genlist); + while (it != NULL) { + d = (gl_data_t *)elm_object_item_data_get(it); + if (d->index == gld->index) { + memo_del_data(gld->index); + lv->cb(lv->data, "delete", NULL); + elm_object_item_del(it); + lv->count--; + snprintf(lv->buf, MEMO_BUFFER_SIZE, "%s(%d)", MEMO_I18N_MEMO, lv->count); + lv->cb(lv->data, "title", lv->buf); + lv->cb(lv->data, "count", (void *)lv->count); + break; + } + it = elm_genlist_item_next_get(it); + } +} + +static void _on_delete_button_clicked(void *data, Evas_Object *obj, void *event_info) +{ + gl_data_t *gld = (gl_data_t *)data; + list_viewer_t *lv = (list_viewer_t *)gld->user_data; + snprintf(lv->buf, MEMO_BUFFER_SIZE, "%s?", MEMO_I18N_DELETE); + memo_create_yes_no_popup(lv->win_main,lv->buf, _on_delete_yes, NULL, gld); +} + +static void _on_send_button_clicked(void *data, Evas_Object *obj, void *event_info) +{ + gl_data_t *gld = (gl_data_t *)data; + gl_data_t *d = NULL; + list_viewer_t *lv = (list_viewer_t *)gld->user_data; + Elm_Object_Item *it = NULL; + + it = elm_genlist_first_item_get(lv->genlist); + while (it != NULL) { + d = (gl_data_t *)elm_object_item_data_get(it); + if (d->index == gld->index) { + memo_share(lv->win_main, &gld->index, 1); + break; + } + it = elm_genlist_item_next_get(it); + } +} + +static void memo_data_iterate_cb (memo_data_t *md, void *user_data) +{ + list_viewer_t *lv = (list_viewer_t *)user_data; + gl_data_t *gld = SMALLOC(gl_data_t); + RETIF(gld == NULL); + memo_gld_init(gld, md, lv, NULL); + gld->on_send = _on_send_button_clicked; + gld->on_delete = _on_delete_button_clicked; + gld->search = (lv->mode==1 ? lv->search_str : NULL); + if (md->has_doodle) { + elm_genlist_item_append(lv->genlist, &lv->itc_draw,(void *)gld, + NULL, ELM_GENLIST_ITEM_NONE, _on_item_select_cb, NULL); + } else { + elm_genlist_item_append(lv->genlist, &lv->itc,(void *)gld, + NULL, ELM_GENLIST_ITEM_NONE, _on_item_select_cb, NULL); + } + lv->count++; +} + +static void _on_search_activated(void *data, Evas_Object *obj, void *event_info) +{ + list_viewer_t *lv = (list_viewer_t *)data; + ecore_imf_context_input_panel_hide(lv->imf_context); +} + +static void _update_list(void *data, Evas_Object *obj, void *event_info) +{ + list_viewer_t *lv = (list_viewer_t *)data; + + /* clear search result */ + elm_genlist_clear(lv->genlist); + /* get search string */ + SFREE(lv->search_str); + lv->search_str = elm_entry_markup_to_utf8(elm_object_text_get(lv->searchbar)); + if (strcmp(lv->search_str, "") == 0) { + SFREE(lv->search_str); + lv->search_str = NULL; + } + + if (lv->mode == 0) { + lv->count = 0; + memo_all_data(memo_data_iterate_cb, lv); + snprintf(lv->buf, MEMO_BUFFER_SIZE, "%s(%d)", MEMO_I18N_MEMO, lv->count); + lv->cb(lv->data, "title", lv->buf); + lv->cb(lv->data, "count", (void *)lv->count); + } else { + memo_search_data((lv->search_str == NULL ? "" : lv->search_str) , -1, 0, MEMO_SORT_CREATE_TIME, memo_data_iterate_cb, lv); + } + if (lv->count == 0) { + edje_object_signal_emit(elm_layout_edje_get(lv->body_main), "show", "nocontent"); + } else { + edje_object_signal_emit(elm_layout_edje_get(lv->body_main), "hide", "nocontent"); + } +} + +static void _focused_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (!elm_entry_is_empty(obj)) + elm_object_signal_emit(data, "elm,state,eraser,show", "elm"); + elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm"); + elm_object_signal_emit(data, "cancel,in", ""); +} + +static void _on_searchbar_clicked(void *data, Evas_Object *obj, void *event_info) +{ + list_viewer_t *lv = (list_viewer_t *)data; + lv->mode = 1; /* shift to search mode */ + if (!elm_entry_is_empty(obj)) { + elm_object_signal_emit(lv->searchbar_layout, "elm,state,eraser,show", "elm"); + } + elm_object_signal_emit(lv->searchbar_layout, "elm,state,guidetext,hide","elm"); + _update_list(lv, NULL, NULL); +} + +static void _unfocused_cb(void *data, Evas_Object *obj, void *event_info) +{ + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(data, "elm,state,guidetext,show", "elm"); + elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); +} + +// When X marked button is clicked, empty entry’s contents +static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + elm_entry_entry_set(data, ""); +} + +static void _bg_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + elm_object_focus_set(data, EINA_TRUE); +} + +static void _searchsymbol_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + //LOGD("[Search Bar] SearchSymbol Callback Called"); + elm_object_focus_set(data, EINA_TRUE); +} + +static void _cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + list_viewer_t *lv = (list_viewer_t *)data; + lv->mode = 0; /* shift to list mode */ + const char* text; + evas_object_hide(obj); + + elm_object_signal_emit(lv->searchbar_layout, "cancel,out", ""); + text = elm_entry_entry_get(lv->searchbar); + if (text != NULL && strlen(text) > 0) { + elm_entry_entry_set(lv->searchbar, NULL); + } + elm_object_focus_set(lv->searchbar, EINA_FALSE); +} + +static void _create_list_viewer_layout(list_viewer_t *lv, bundle *bd) +{ + lv->body_main = elm_layout_create(lv->parent, EDJ_FILE, "list_frame"); + lv->cb(lv->data, "layout", lv->body_main); + + /* search bar */ + Evas_Object *searchbar_layout = elm_layout_add(lv->body_main); + elm_layout_theme_set(searchbar_layout, "layout", "searchbar", "cancel_button"); + Evas_Object *entry = elm_entry_add(searchbar_layout); /*Create entry*/ + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_object_part_content_set(searchbar_layout, "elm.swallow.content", entry); + elm_object_part_text_set(searchbar_layout, "elm.guidetext", "Search"); /*Should be Language Specific*/ + + evas_object_size_hint_weight_set(searchbar_layout, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(searchbar_layout, EVAS_HINT_FILL, 0.0); + elm_object_part_content_set(lv->body_main, "elm.swallow.search", searchbar_layout); + + Evas_Object *cancel_btn = elm_button_add(searchbar_layout); + elm_object_part_content_set(searchbar_layout, "button_cancel", cancel_btn); + elm_object_style_set(cancel_btn, "searchbar/default"); + elm_object_text_set(cancel_btn, "Cancel"); + + lv->searchbar = entry; + lv->searchbar_layout = searchbar_layout; + elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT); + lv->imf_context = elm_entry_imf_context_get(entry); + lv->limit_filter_data.max_char_count = 0; + lv->limit_filter_data.max_byte_count = 64; + + /* limit size */ + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &lv->limit_filter_data); + evas_object_smart_callback_add(entry, "changed", _on_searchbar_clicked, lv); + evas_object_smart_callback_add(entry, "focused", _focused_cb, searchbar_layout); + evas_object_smart_callback_add(entry, "unfocused", _unfocused_cb, searchbar_layout); + elm_object_signal_callback_add(searchbar_layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, entry); + elm_object_signal_callback_add(searchbar_layout, "elm,bg,clicked", "elm", _bg_clicked_cb, entry); + elm_object_signal_callback_add(searchbar_layout, "elm,action,click", "", _searchsymbol_clicked_cb, entry); + evas_object_smart_callback_add(cancel_btn, "clicked", _cancel_clicked_cb, lv); + evas_object_smart_callback_add(entry, "activated", _on_search_activated, lv); + + /* no content */ + lv->nocontent = elm_layout_add(lv->body_main); + elm_layout_theme_set(lv->nocontent, "layout", "nocontents", "text"); + elm_object_part_text_set(lv->nocontent, "elm.text", MEMO_I18N_NO_MEMOS); + elm_object_style_set(lv->nocontent, "text"); + elm_object_part_content_set(lv->body_main, "elm.swallow.nocontent", lv->nocontent); + + /* genlist */ + lv->genlist = elm_genlist_add(lv->body_main); + elm_object_part_content_set(lv->body_main, "elm.swallow.content", lv->genlist); + elm_genlist_block_count_set(lv->genlist, 10); + + _update_list(lv, NULL, NULL); +} + +void *memo_load_list_viewer(Evas_Object *parent, Evas_Object *win, bundle *bd, Memo_Component_Callback cb, void *data) +{ + list_viewer_t *lv = SMALLOC(list_viewer_t); + RETVIF(lv==NULL, NULL); + bundle_dump(bd); + lv->parent = parent; + lv->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + lv->data = data; + + /* init */ + memo_gl_itc_init(&lv->itc, "memo/list"); + memo_gl_itc_init(&lv->itc_draw, "memo/list_draw"); + lv->win_main = win; + + _create_list_viewer_layout(lv, bd); + return (void *)lv; +} + +void memo_destroy_list_viewer(void *h_lv) +{ + list_viewer_t *lv = (list_viewer_t *)h_lv; + evas_object_del(lv->body_main); + SFREE(lv->search_str); + SFREE(lv); +} + diff --git a/src/memo_text_editor.c b/src/memo_text_editor.c new file mode 100644 index 0000000..2419e12 --- /dev/null +++ b/src/memo_text_editor.c @@ -0,0 +1,431 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __text_editor_t { + Evas_Object *win; + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + memo_data_t *record; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + Eina_Bool savable; + + /* content */ + Evas_Object *body_main; + Evas_Object *toolbar; + Evas_Object *btn_size; + void *h_fss; + Evas_Object *btn_color; + void *h_fcs; + + /* entry */ + Evas_Object *entry; + Ecore_IMF_Context *imf_context; + Elm_Entry_Filter_Limit_Size limit_filter_data; + + /* original font information */ + int init_fsize; + int init_fcolor; +} text_editor_t; + +static void _font_size_selector_del(text_editor_t *te); +static void _font_color_selector_del(text_editor_t *te); + +static void _save_record(text_editor_t *te) +{ + if (te->record->content != NULL) { + SFREE(te->record->content); + } + + /* content will be freed automatically in memo_free_data when editor destoried */ + te->record->content = elm_entry_markup_to_utf8(elm_entry_entry_get(te->entry)); + /* records synced from KIES has no font info, apply font enforce policy here to overwrite default font info */ + te->record->font_respect = 1; + if (te->record->id != -1) { + memo_mod_data(te->record); + } else { + memo_add_data(te->record); + } +} + +static void _on_save_yes(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + _save_record(te); + te->cb(te->data, "save", NULL); +} + +static void _on_save_no(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + te->cb(te->data, "cancel", NULL); +} + +static Eina_Bool _launch_yes_no_popup(void *data) +{ + text_editor_t *te = (text_editor_t *)data; + memo_create_yes_no_popup(te->win, MEMO_I18N_SAVE_MEMO, _on_save_yes, _on_save_no, te); + return EINA_FALSE; +} + +static void _entry_content_update(text_editor_t *te) +{ + unsigned char *color = (unsigned char *)&te->record->font_color; + char *content = elm_entry_markup_to_utf8(elm_entry_entry_get(te->entry)); + char *markup = elm_entry_utf8_to_markup(content); + snprintf(te->buf, MEMO_BUFFER_SIZE, + "", te->record->font_size, color[2], color[1], + color[0]); + elm_entry_entry_set(te->entry, te->buf); + elm_entry_entry_insert(te->entry, markup); + SFREE(content); + SFREE(markup); +} + +static void _font_size_selector_callback(void *data, const char *msg, void *event) +{ + text_editor_t *te = (text_editor_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(te->body_main, "elm.swallow.tool", (Evas_Object *)event); + } else if (strcmp(msg, "change") == 0) { + te->record->font_size = (int)event; + _entry_content_update(te); + } else if (strcmp(msg, "flick,down") == 0) { + _font_size_selector_del(te); + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "expand", "elm"); + } +} + +static void _font_size_selector_del(text_editor_t *te) +{ + if (te->h_fss != NULL) { + elm_object_part_content_unset(te->body_main, "elm.swallow.tool"); + memo_del_font_size_selector(te->h_fss); + te->h_fss = NULL; + memo_tool_btn_focus_set(te->btn_size, EINA_FALSE); + } +} + +static void _on_font_size_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + if (te->h_fss != NULL) { /* font size selector already open */ + return; + } + if (te->h_fcs != NULL) { /* destroy font color selector */ + _font_color_selector_del(te); + } + /* load font size selector */ + bundle *bd = bundle_create(); + snprintf(te->buf, MEMO_BUFFER_SIZE, "%d", te->record->font_size); + bundle_add(bd, "current", te->buf); + snprintf(te->buf, MEMO_BUFFER_SIZE, "%d", 0xFF000000); + bundle_add(bd, "bg_color", te->buf); + te->h_fss = memo_load_font_size_selector(te->body_main, bd, _font_size_selector_callback, te); + bundle_free(bd); + memo_tool_btn_focus_set(te->btn_size, EINA_TRUE); + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "abbrev", "elm"); + /* hide input panel */ + ecore_imf_context_input_panel_hide(te->imf_context); +} + +void _font_color_selector_callback(void *data, const char *msg, void *event) +{ + text_editor_t *te = (text_editor_t *)data; + if (strcmp(msg, "layout") == 0) { + elm_object_part_content_set(te->body_main, "elm.swallow.tool", (Evas_Object *)event); + } else if (strcmp(msg, "change") == 0) { + LOGD("%s : %x\n", msg, (int)event); + te->record->font_color = (int)event; + _entry_content_update(te); + } else if (strcmp(msg, "flick,down") == 0) { + _font_color_selector_del(te); + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "expand", "elm"); + } +} + +static void _font_color_selector_del(text_editor_t *te) +{ + if (te->h_fcs != NULL) { + elm_object_part_content_unset(te->body_main, "elm.swallow.tool"); + memo_del_color_selector(te->h_fcs); + memo_tool_btn_focus_set(te->btn_color, EINA_FALSE); + te->h_fcs = NULL; + } +} + +static void _on_font_color_btn_up(void *data, Evas *e, Evas_Object *evas_obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + if (te->h_fcs!= NULL) { /* font color selector already open */ + return; + } + if (te->h_fss!= NULL) { /* destroy font size selector */ + _font_size_selector_del(te); + } + /* load font color selector */ + bundle *bd = bundle_create(); + snprintf(te->buf, MEMO_BUFFER_SIZE, "%d", te->record->font_color); + bundle_add(bd, "color", te->buf); + snprintf(te->buf, MEMO_BUFFER_SIZE, "%d", 0xFF000000); + bundle_add(bd, "bg_color", te->buf); + te->h_fcs = memo_load_color_selector(te->body_main, bd, _font_color_selector_callback, te); + bundle_free(bd); + memo_tool_btn_focus_set(te->btn_color, EINA_TRUE); + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "abbrev", "elm"); + /* hide input panel */ + ecore_imf_context_input_panel_hide(te->imf_context); +} + +static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int value) +{ + text_editor_t *te = (text_editor_t *)data; + if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + if ((te->h_fss==NULL) && (te->h_fcs==NULL)) { /* hide by sweep donw */ + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "expand", "elm"); + } + } else if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "abbrev", "elm"); + } +} + +static void _on_entry_clicked(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + if (te->h_fss!= NULL) { /* destroy font size selector */ + _font_size_selector_del(te); + } + if (te->h_fcs != NULL) { /* destroy font color selector */ + _font_color_selector_del(te); + } + +#ifdef __i386__ + Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(te->entry); + if (ecore_imf_context_input_panel_state_get(imf_context) == + ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + //USB keyboard is active + edje_object_signal_emit(elm_layout_edje_get(te->body_main), "expand", "elm"); + } +#endif +} + +static void _on_entry_content_change(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + unsigned char *color = (unsigned char *)&te->record->font_color; + + const char *text = elm_entry_entry_get(te->entry); + char *content = elm_entry_markup_to_utf8(text); + te->savable = EINA_TRUE; + if (strcmp(content, "") == 0) { + te->savable = EINA_FALSE; + } else if (te->record->content != NULL) { /* check if same as init string */ + if ((te->init_fsize==te->record->font_size) + && (te->init_fcolor==te->record->font_color) + && (strcmp(te->record->content, content)==0)) { + te->savable = EINA_FALSE; + } + } + te->cb(te->data, "savable", (void *)(te->savable?1:0)); + + /* after paste/cut, the font size/color information may be cleared */ + snprintf(te->buf, MEMO_BUFFER_SIZE, "", + te->record->font_size, color[2], color[1], color[0]); + if (text[0] == '\0') { /* no content */ + elm_entry_entry_insert(te->entry, te->buf); + } else if (text[0] != '<') { /* insert font information */ + elm_entry_cursor_begin_set(te->entry); + elm_entry_entry_insert(te->entry, te->buf); + elm_entry_cursor_end_set(te->entry); + } + SFREE(content); +} + +static void _on_yes(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + _save_record(te); + te->cb(te->data, "drawing", NULL); +} + +static void _on_no(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + te->cb(te->data, "drawing", NULL); +} + +static void _on_drawing_mode(void *data, Evas_Object *obj, void *event_info) +{ + text_editor_t *te = (text_editor_t *)data; + if (te->savable) { /* modified, need user confirmation */ + memo_create_yes_no_popup(te->parent, MEMO_I18N_SAVE_MEMO, _on_yes, _on_no, te); + } else { + te->cb(te->data, "drawing", NULL); + } +} + +static void _create_text_editor_layout(text_editor_t *te, bundle *bd) +{ + int w = 0; + int h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); + snprintf(te->buf, MEMO_BUFFER_SIZE, "text_editor_%d_%d", w, h); + LOGD("-----------load %s\n", te->buf); + te->body_main = elm_layout_create(te->parent, EDJ_FILE, te->buf); + te->cb(te->data, "layout", te->body_main); + /* title */ + te->cb(te->data, "title", te->record->id==-1 ? MEMO_I18N_CREATE_NOTE : MEMO_I18N_EDIT_NOTE); + /* date */ + memo_time_format(te->buf, MEMO_BUFFER_SIZE, te->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(te->body_main), "elm.text.date", te->buf); + /* toolbar */ + te->toolbar = elm_swallowed_layout(te->body_main, "elm.swallow.toolbar", EDJ_FILE, "edit_toolbar"); + te->btn_size = elm_swallowed_layout(te->toolbar, "elm.swallow.btn1", EDJ_DIR"/black/memo.edj", "tl_font_size"); + evas_object_event_callback_add(te->btn_size, EVAS_CALLBACK_MOUSE_UP, _on_font_size_btn_up, te); + te->btn_color = elm_swallowed_layout(te->toolbar, "elm.swallow.btn2", EDJ_DIR"/black/memo.edj", "tl_font_color"); + evas_object_event_callback_add(te->btn_color, EVAS_CALLBACK_MOUSE_UP, _on_font_color_btn_up, te); + if (!bundle_key_check(bd, "toggle", "disable")) { + elm_swallowed_button(te->toolbar, "elm.swallow.btn4", MEMO_I18N_DRAWING, _on_drawing_mode, te); + } + /* entry */ + Evas_Object *sc = elm_swallowed_scroller(te->body_main, "elm.swallow.text"); + unsigned char *color = (unsigned char *)&te->record->font_color; + snprintf(te->buf, MEMO_BUFFER_SIZE, "", + te->record->font_size, color[2], color[1], color[0]); + te->entry = elm_entry_create(te->body_main, te->buf); + elm_entry_input_panel_enabled_set(te->entry, EINA_TRUE); + evas_object_size_hint_align_set(te->entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(te->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_entry_autocapital_type_set(te->entry, ELM_AUTOCAPITAL_TYPE_SENTENCE); + elm_object_content_set(sc, te->entry); + evas_object_smart_callback_add(te->entry, "changed", _on_entry_content_change, te); + evas_object_smart_callback_add(te->entry, "clicked", _on_entry_clicked, te); + /* limit size */ + elm_entry_markup_filter_append(te->entry, elm_entry_filter_limit_size, &te->limit_filter_data); + /* entry content */ + if (te->record->content != NULL) { + char *content = elm_entry_utf8_to_markup(te->record->content); + elm_entry_entry_insert(te->entry, content); + SFREE(content); + } else { /* set init string */ + const char *str = bundle_get_val(bd, "init_str"); + if (str != NULL) { + elm_entry_entry_insert(te->entry, str); + } + } + elm_object_focus_set(te->entry, EINA_TRUE); + /* imf context */ + te->imf_context = elm_entry_imf_context_get(te->entry); + ecore_imf_context_input_panel_event_callback_add(te->imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_event_callback, te); + /* savable */ + te->cb(te->data, "savable", (void *)(te->savable?1:0)); +} + +void memo_text_editor_time_format_update(void *h_te) +{ + text_editor_t *te = (text_editor_t *)h_te; + memo_time_format(te->buf, MEMO_BUFFER_SIZE, te->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(te->body_main), "elm.text.date", te->buf); +} + +void memo_text_editor_cancel(void *h_te) +{ + text_editor_t *te = (text_editor_t *)h_te; + if (!te->savable) { /* not modified, return directly */ + te->cb(te->data, "cancel", NULL); + } else { + /* hide imf, otherwise popup will be covered by imf */ + if (te->imf_context != NULL) { + ecore_imf_context_input_panel_hide(te->imf_context); + } + _launch_yes_no_popup(te); + } +} + +void memo_text_editor_save(void *h_te) +{ + text_editor_t *te = (text_editor_t *)h_te; + _save_record(te); + te->cb(te->data, "save", NULL); +} + +void *memo_load_text_editor(Evas_Object *win, Evas_Object *parent, bundle *bd, Memo_Component_Callback cb, void *data) +{ + text_editor_t *te = SMALLOC(text_editor_t); + RETVIF(te==NULL, NULL); + bundle_dump(bd); + te->win = win; + te->parent = parent; + te->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + te->data = data; + + /* init */ + const char *s = bundle_get_val(bd, "index"); + if (s == NULL) { + te->record = memo_create_data(); + te->record->id = -1; + te->record->modi_time = time((time_t *) 0); + te->record->font_size = 44; + te->record->font_color = 0xffffffff; + } else { /* load item */ + te->record = memo_get_data(atoi(s)); + } + te->init_fsize = te->record->font_size; + te->init_fcolor = te->record->font_color; + /* limitation */ + te->limit_filter_data.max_char_count = 0; + te->limit_filter_data.max_byte_count = 1000; + + _create_text_editor_layout(te, bd); + return (void *)te; +} + +void memo_destroy_text_editor(void *h_te) +{ + text_editor_t *te = (text_editor_t *)h_te; + ecore_imf_context_input_panel_event_callback_del(te->imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_event_callback); + ecore_imf_context_input_panel_hide(te->imf_context); + if (te->h_fss!= NULL) { /* destroy font size selector */ + _font_size_selector_del(te); + } + if (te->h_fcs != NULL) { /* destroy font color selector */ + _font_color_selector_del(te); + } + memo_free_data(te->record); + evas_object_del(te->body_main); + SFREE(te); +} diff --git a/src/memo_text_viewer.c b/src/memo_text_viewer.c new file mode 100644 index 0000000..23ecf55 --- /dev/null +++ b/src/memo_text_viewer.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __text_viewer_t { + Evas_Object *parent; + Memo_Component_Callback cb; + void *data; + char buf[MEMO_BUFFER_SIZE]; /* for temporarily usage only */ + + /* content */ + Evas_Object *win_main; + memo_data_t *record; + Evas_Object *body_main; + Evas_Object *entry; + char *content; +} text_viewer_t; + +static void _on_entry_resize(void *data, Evas_Object *obj, void *event_info) +{ + LOGD("---------------_on_entry_resize"); + text_viewer_t *tv = (text_viewer_t *)data; + elm_entry_entry_set(tv->entry, tv->content); +} + +static void _create_text_viewer_layout(text_viewer_t *tv, bundle *bd) +{ + tv->body_main = elm_layout_create(tv->parent, EDJ_FILE, "text_viewer"); + tv->cb(tv->data, "layout", tv->body_main); + + /* date */ + memo_time_format(tv->buf, MEMO_BUFFER_SIZE, tv->record->modi_time); + edje_object_part_text_set(elm_layout_edje_get(tv->body_main), "elm.text.date", tv->buf); + + /* text */ + Evas_Object *sc = elm_swallowed_scroller(tv->body_main, "elm.swallow.text"); + unsigned char *color = (unsigned char *)&tv->record->font_color; + snprintf(tv->buf, MEMO_BUFFER_SIZE, + "", tv->record->font_size, color[2], + color[1], color[0]); + tv->entry = elm_entry_create(tv->body_main, tv->buf); + char *markup = elm_entry_utf8_to_markup(tv->record->content); + elm_entry_entry_insert(tv->entry, markup); + SFREE(markup); + tv->content = strdup(elm_entry_entry_get(tv->entry)); + evas_object_size_hint_weight_set(tv->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(tv->entry, EVAS_HINT_FILL, EVAS_HINT_EXPAND); + elm_entry_editable_set(tv->entry, EINA_FALSE); + elm_entry_autocapital_type_set(tv->entry, ELM_AUTOCAPITAL_TYPE_SENTENCE); + elm_object_content_set(sc, tv->entry); + evas_object_render_flush_hook(tv->entry, _on_entry_resize, tv); +} + +void memo_text_viewer_share_record(void *h_tv) +{ + text_viewer_t *tv = (text_viewer_t *)h_tv; + memo_share(tv->win_main, (int *)&tv->record->id, 1); +} + +void *memo_load_text_viewer(Evas_Object *parent, Evas_Object *win, int id, bundle *bd, Memo_Component_Callback cb, void *data) +{ + text_viewer_t *tv = SMALLOC(text_viewer_t); + RETVIF(tv==NULL, NULL); + bundle_dump(bd); + tv->parent = parent; + tv->cb = (cb==NULL ? memo_com_dummy_cb : cb); /* make sure cb is not null, no need to check legitimacy of cb when call */ + tv->data = data; + + /* init */ + tv->win_main = win; + tv->record = memo_get_data(id); + _create_text_viewer_layout(tv, bd); + return (void *)tv; +} + +void memo_destroy_text_viewer(void *h_tv) +{ + text_viewer_t *tv = (text_viewer_t *)h_tv; + evas_object_del(tv->body_main); + memo_free_data(tv->record); + SFREE(tv->content); + SFREE(tv); +} + diff --git a/src/memo_ug.c b/src/memo_ug.c new file mode 100644 index 0000000..bc6f5b1 --- /dev/null +++ b/src/memo_ug.c @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ +#include +#include +#include +#include "memo.h" +#include +#include "memo_ug.h" +#include "memo_string.h" + +static GString *get_shared_text(Eina_List *list) +{ + Eina_List *l = NULL; + struct memo_data *md = NULL; + GString *buf = g_string_new(""); + + EINA_LIST_FOREACH(list, l, md) { + if ((md != NULL) && !(md->has_doodle)) { + g_string_append_printf(buf, "%s\n", md->content); + } + } + + return buf; +} + +static void _ug_layout_cb(ui_gadget_t *ug, enum ug_mode mode, void *priv) +{ + Evas_Object *base, *win; + base = (Evas_Object *)ug_get_layout(ug); + if (base == NULL) { + return; + } + + win = ug_get_window(); + switch (mode) { + case UG_MODE_FULLVIEW: + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, base); + /* disable effect */ + //ug_disable_effect(ug); + evas_object_show(base); + break; + default: + break; + } +} + +static void _ug_result_cb(ui_gadget_t *ug, bundle *result, void *priv) +{ + bundle_dump(result); +} + +static void _ug_destroy_cb(ui_gadget_t *ug, void *priv) +{ + if (ug != NULL) { + ug_destroy(ug); + } +} + +/** + * ug_launch_common + * + * @description + * This is a basic function which designed to invoke any ui gadget. + * + * @param[in] bd a bundle type which will send to ug directly + * @param[in] ug_name UG name marco defined in memo_ug.h + * @return void + */ +void ug_launch_common(bundle *bd, char *ug_name) +{ + ug_cbs_t cbs={0, }; + + cbs.layout_cb = _ug_layout_cb; + cbs.destroy_cb = _ug_destroy_cb; + cbs.result_cb = _ug_result_cb; + cbs.priv = NULL; + + bundle_dump(bd); + ug_create(NULL, ug_name, UG_MODE_FULLVIEW, bd, &cbs); + bundle_free(bd); +} + +/** + * ug_launch_common_var + * + * @description + * This function supply a variadic version of ug_launch_common_var. + * The first and only required variable is the ug_name. + * Its type is string, but the caller should use the macro name which defined in memo_ug.h + * The other variables are optional, it should appear for key-value pair + * The end of optional variables must be NULL. + * + * @param[in] ug_name UG name marco defined in memo_ug.h + * @param[in] ... pair of key and value, end with NULL + * @return void + */ +void ug_launch_common_var(char *ug_name, ...) +{ + char *key = NULL; + char *val = NULL; + bundle *bd = bundle_create(); + + va_list ap; + va_start(ap, ug_name); + while (1) { + key = va_arg(ap, char *); + val = va_arg(ap, char *); + + if (key == NULL || val == NULL) { + break; + } + bundle_add(bd, key, val); + } + va_end(ap); + + ug_launch_common(bd, ug_name); +} + +void ug_launch_calender(Eina_List *list) +{ + GString *text = get_shared_text(list); + + bundle *bd = bundle_create(); + bundle_add(bd, "index", "0"); + bundle_add(bd, "note", text->str); + + ug_launch_common(bd, UG_NAME_CALENDAR); + + g_string_free(text, TRUE); +} + +void memo_ug_init(Evas_Object *win) +{ + enum ug_option opt = UG_OPT_INDICATOR_ENABLE; + UG_INIT_EFL(win, opt); +} + +/* BEGIN SHARE POPUP */ + +typedef struct _share_popup_data { + Evas_Object *popup; + Eina_List *list; /* records of memo */ + char *lib_path_facebook; /* lib path of facebook UG */ +}share_popup_data; + +static void _on_response_cb(void *data, Evas_Object *obj, void *event_info); + +static void _share_calender_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + share_popup_data *spd = (share_popup_data *)data; + ug_launch_calender(spd->list); + _on_response_cb(spd, spd->popup, NULL); +} + +static void _on_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + share_popup_data *spd = (share_popup_data *)data; + if (spd->popup != NULL) { + evas_object_del(spd->popup); + spd->popup = NULL; + } + if (spd->list != NULL) { + memo_data_t *md = NULL; + EINA_LIST_FREE(spd->list, md) { + memo_free_data(md); + } + } + SFREE(spd->lib_path_facebook); + SFREE(spd); +} + +static char *_gl_label_get(void *data, Evas_Object *obj, const char *part) +{ + char *label = (char *)data; + if (strcmp(part, "elm.text") == 0) { + return strdup(label); + } + return NULL; +} + +void memo_share(Evas_Object *parent, int *indexes, int n) +{ + share_popup_data *spd = SMALLOC(share_popup_data); + RETIF(spd == NULL); + + int i = 0; + int c = 0; + Evas_Object *box = NULL; + Eina_Bool has_doodle = EINA_FALSE; + memo_data_t *md = NULL; + for (i=0; ihas_doodle) { + has_doodle = EINA_TRUE; + } + spd->list = eina_list_append(spd->list, md); + } + + static Elm_Genlist_Item_Class itc; + memset(&itc, 0, sizeof(Elm_Genlist_Item_Class)); + itc.item_style = "1text"; + itc.func.text_get = _gl_label_get; + + Evas_Object *popup = elm_popup_add(parent); + spd->popup = popup; + elm_object_style_set(popup, "min_menustyle"); + elm_object_part_text_set(popup, "title,text", MEMO_I18N_SHARE); + Evas_Object *btn1 = elm_button_add(popup); + elm_object_text_set(btn1, MEMO_I18N_CLOSE); + elm_object_part_content_set(popup, "button1", btn1); + evas_object_smart_callback_add(btn1, "clicked", _on_response_cb, spd); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *genlist = elm_genlist_add(popup); + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + + Elm_Object_Item *it = NULL; + it = elm_genlist_item_append(genlist, &itc, MEMO_I18N_MESSAGE, + NULL, ELM_GENLIST_ITEM_NONE, NULL, spd); + elm_object_item_disabled_set(it, EINA_TRUE); + c++; + it = elm_genlist_item_append(genlist, &itc, MEMO_I18N_EMAIL, + NULL, ELM_GENLIST_ITEM_NONE, NULL, spd); + elm_object_item_disabled_set(it, EINA_TRUE); + c++; + + if (!has_doodle) { + /* calendar */ + elm_genlist_item_append(genlist, &itc, MEMO_I18N_CALENDAR, + NULL, ELM_GENLIST_ITEM_NONE, _share_calender_selected_cb, spd); + c++; + } + evas_object_show(genlist); + box = elm_box_add(popup); + evas_object_size_hint_min_set(box, 0, (c>3 ? 3 : c)*71); + elm_box_pack_end(box, genlist); + evas_object_show(box); + elm_object_content_set(popup, box); + evas_object_show(popup); +} + diff --git a/theme/CMakeLists.txt b/theme/CMakeLists.txt new file mode 100644 index 0000000..990eec3 --- /dev/null +++ b/theme/CMakeLists.txt @@ -0,0 +1,18 @@ +SET(THFILES white black) + +FOREACH(thfile ${THFILES}) + SET(src ${CMAKE_CURRENT_SOURCE_DIR}/${thfile}/memo.edc) + SET(obj ${CMAKE_CURRENT_BINARY_DIR}/${thfile}.edj) + MESSAGE("THEME: ${thfile}") + ADD_CUSTOM_COMMAND( + OUTPUT ${obj} + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/${thfile}/images + ${src} ${obj} DEPENDS ${src} + ) + INSTALL(FILES ${obj} + DESTINATION ${EDJDIR}/${thfile} RENAME memo.edj) + SET(edjFiles ${edjFiles} ${obj}) +ENDFOREACH(thfile) + +MESSAGE(".edj files: ${edjFiles}") +ADD_CUSTOM_TARGET(th ALL DEPENDS ${edjFiles}) diff --git a/theme/black/images/00_picker_btn_normal.png b/theme/black/images/00_picker_btn_normal.png new file mode 100644 index 0000000..9dc73c4 Binary files /dev/null and b/theme/black/images/00_picker_btn_normal.png differ diff --git a/theme/black/images/00_picker_btn_press.png b/theme/black/images/00_picker_btn_press.png new file mode 100644 index 0000000..f65239f Binary files /dev/null and b/theme/black/images/00_picker_btn_press.png differ diff --git a/theme/black/images/P02_icon_color.png b/theme/black/images/P02_icon_color.png new file mode 100644 index 0000000..8394206 Binary files /dev/null and b/theme/black/images/P02_icon_color.png differ diff --git a/theme/black/images/P02_icon_color_focus.png b/theme/black/images/P02_icon_color_focus.png new file mode 100644 index 0000000..8394206 Binary files /dev/null and b/theme/black/images/P02_icon_color_focus.png differ diff --git a/theme/black/images/P02_icon_eraser.png b/theme/black/images/P02_icon_eraser.png new file mode 100644 index 0000000..0cab038 Binary files /dev/null and b/theme/black/images/P02_icon_eraser.png differ diff --git a/theme/black/images/P02_icon_eraser_press.png b/theme/black/images/P02_icon_eraser_press.png new file mode 100644 index 0000000..0cab038 Binary files /dev/null and b/theme/black/images/P02_icon_eraser_press.png differ diff --git a/theme/black/images/P02_icon_font_color.png b/theme/black/images/P02_icon_font_color.png new file mode 100644 index 0000000..a2bd5b4 Binary files /dev/null and b/theme/black/images/P02_icon_font_color.png differ diff --git a/theme/black/images/P02_icon_font_color_press.png b/theme/black/images/P02_icon_font_color_press.png new file mode 100644 index 0000000..a2bd5b4 Binary files /dev/null and b/theme/black/images/P02_icon_font_color_press.png differ diff --git a/theme/black/images/P02_icon_font_size.png b/theme/black/images/P02_icon_font_size.png new file mode 100644 index 0000000..52931cb Binary files /dev/null and b/theme/black/images/P02_icon_font_size.png differ diff --git a/theme/black/images/P02_icon_font_size_press.png b/theme/black/images/P02_icon_font_size_press.png new file mode 100644 index 0000000..52931cb Binary files /dev/null and b/theme/black/images/P02_icon_font_size_press.png differ diff --git a/theme/black/images/P02_icon_stroke.png b/theme/black/images/P02_icon_stroke.png new file mode 100644 index 0000000..656b788 Binary files /dev/null and b/theme/black/images/P02_icon_stroke.png differ diff --git a/theme/black/images/P02_icon_stroke_press.png b/theme/black/images/P02_icon_stroke_press.png new file mode 100644 index 0000000..656b788 Binary files /dev/null and b/theme/black/images/P02_icon_stroke_press.png differ diff --git a/theme/black/memo.edc b/theme/black/memo.edc new file mode 100644 index 0000000..957b9e8 --- /dev/null +++ b/theme/black/memo.edc @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include <../../extend/extended-edc.h> + +collections { + #include <../common.edc> +} diff --git a/theme/common.edc b/theme/common.edc new file mode 100644 index 0000000..9074b14 --- /dev/null +++ b/theme/common.edc @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#define ICON_BUTTON(iName, img_default, img_focus)\ +group {\ + name: iName;\ + images{\ + image: img_default COMP;\ + image: img_focus COMP;\ + image: "00_picker_btn_press.png" COMP;\ + image: "00_picker_btn_normal.png" COMP;\ + }\ + parts {\ + PART_BG("bg")\ + PART_BORDER_IMAGE("image_bg", "bg", "00_picker_btn_normal.png", 4, 4, 0, 0)\ + PART_IMAGE("image_icon", "bg", img_default)\ + PART_EVENT_RECT("event", "bg")\ + }/* end parts */\ +\ + programs {\ + program {\ + name: "init";\ + signal: "load";\ + source: "";\ + script {\ + SCRIPT_CUSTOM_PART("image_bg");\ + SCRIPT_CUSTOM_PART("image_icon");\ + }\ + } /* end program */\ + program {\ + name: "focus";\ + signal: "focus";\ + source: "elm";\ + script {\ + SCRIPT_SET_IMAGE("image_bg", "00_picker_btn_press.png");\ + SCRIPT_SET_IMAGE("image_icon", img_focus);\ + }\ + } /* end program */\ + program {\ + name: "normal";\ + signal: "normal";\ + source: "elm";\ + script {\ + SCRIPT_SET_IMAGE("image_bg", "00_picker_btn_normal.png");\ + SCRIPT_SET_IMAGE("image_icon", img_default);\ + }\ + } /* end program */\ + }/* end programs */\ +} + +ICON_BUTTON("tl_font_size", "P02_icon_font_size.png", "P02_icon_font_size_press.png") +ICON_BUTTON("tl_font_color", "P02_icon_font_color.png", "P02_icon_font_color_press.png") +ICON_BUTTON("tl_stroke_size", "P02_icon_stroke.png", "P02_icon_stroke_press.png") +ICON_BUTTON("tl_stroke_color", "P02_icon_color.png", "P02_icon_color_focus.png") +ICON_BUTTON("tl_stroke_eraser", "P02_icon_eraser.png", "P02_icon_eraser_press.png") + diff --git a/theme/white/images/00_picker_btn_normal.png b/theme/white/images/00_picker_btn_normal.png new file mode 100644 index 0000000..df4433e Binary files /dev/null and b/theme/white/images/00_picker_btn_normal.png differ diff --git a/theme/white/images/00_picker_btn_press.png b/theme/white/images/00_picker_btn_press.png new file mode 100644 index 0000000..83284d1 Binary files /dev/null and b/theme/white/images/00_picker_btn_press.png differ diff --git a/theme/white/images/P02_icon_color.png b/theme/white/images/P02_icon_color.png new file mode 100644 index 0000000..23a7fe7 Binary files /dev/null and b/theme/white/images/P02_icon_color.png differ diff --git a/theme/white/images/P02_icon_color_focus.png b/theme/white/images/P02_icon_color_focus.png new file mode 100644 index 0000000..23a7fe7 Binary files /dev/null and b/theme/white/images/P02_icon_color_focus.png differ diff --git a/theme/white/images/P02_icon_eraser.png b/theme/white/images/P02_icon_eraser.png new file mode 100644 index 0000000..ab26f48 Binary files /dev/null and b/theme/white/images/P02_icon_eraser.png differ diff --git a/theme/white/images/P02_icon_eraser_press.png b/theme/white/images/P02_icon_eraser_press.png new file mode 100644 index 0000000..82e1ce1 Binary files /dev/null and b/theme/white/images/P02_icon_eraser_press.png differ diff --git a/theme/white/images/P02_icon_font_color.png b/theme/white/images/P02_icon_font_color.png new file mode 100644 index 0000000..2e9c514 Binary files /dev/null and b/theme/white/images/P02_icon_font_color.png differ diff --git a/theme/white/images/P02_icon_font_color_press.png b/theme/white/images/P02_icon_font_color_press.png new file mode 100644 index 0000000..2e75f62 Binary files /dev/null and b/theme/white/images/P02_icon_font_color_press.png differ diff --git a/theme/white/images/P02_icon_font_size.png b/theme/white/images/P02_icon_font_size.png new file mode 100644 index 0000000..b397b98 Binary files /dev/null and b/theme/white/images/P02_icon_font_size.png differ diff --git a/theme/white/images/P02_icon_font_size_press.png b/theme/white/images/P02_icon_font_size_press.png new file mode 100644 index 0000000..4966066 Binary files /dev/null and b/theme/white/images/P02_icon_font_size_press.png differ diff --git a/theme/white/images/P02_icon_stroke.png b/theme/white/images/P02_icon_stroke.png new file mode 100644 index 0000000..5a317a8 Binary files /dev/null and b/theme/white/images/P02_icon_stroke.png differ diff --git a/theme/white/images/P02_icon_stroke_press.png b/theme/white/images/P02_icon_stroke_press.png new file mode 100644 index 0000000..5e26ff8 Binary files /dev/null and b/theme/white/images/P02_icon_stroke_press.png differ diff --git a/theme/white/memo.edc b/theme/white/memo.edc new file mode 100644 index 0000000..957b9e8 --- /dev/null +++ b/theme/white/memo.edc @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * This file is part of the memo + * Written by Zhibin Zhou , Canjiang Lu , + * Feng Li + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no + * representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for a particular purpose, or non- + * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + * + */ + +#include <../../extend/extended-edc.h> + +collections { + #include <../common.edc> +}