From e5f0d430760f1a3d6ebdb7b327530bc804f356a9 Mon Sep 17 00:00:00 2001 From: "sung-su.kim" Date: Fri, 26 Jul 2013 10:53:50 +0900 Subject: [PATCH] [Release] wrt_0.8.251 Change-Id: I539642f74159813695092410932a13f809b91db4 --- CMakeLists.txt | 57 ++- data/Platform.edc | 24 -- data/{Daemon.edc => Wrt.edc} | 110 +----- data/images/backward_1.png | Bin 4449 -> 0 bytes data/images/backward_2.png | Bin 4681 -> 0 bytes data/wrt_theme.edc | 276 ------------- packaging/wrt.spec | 37 +- po/CMakeLists.txt | 7 +- po/ar.po | 18 + po/az.po | 18 + po/bg.po | 18 + po/ca.po | 18 + po/cs.po | 18 + po/da.po | 18 + po/de_DE.po | 18 + po/el_GR.po | 18 + po/en.po | 18 + po/en_PH.po | 18 + po/en_US.po | 18 + po/es_ES.po | 18 + po/es_MX.po | 18 + po/et.po | 18 + po/eu.po | 18 + po/fi.po | 18 + po/fr_CA.po | 18 + po/fr_FR.po | 18 + po/ga.po | 18 + po/gl.po | 18 + po/hi.po | 22 +- po/hr.po | 18 + po/hu.po | 18 + po/hy.po | 18 + po/is.po | 18 + po/it_IT.po | 18 + po/ja_JP.po | 18 + po/ka.po | 18 + po/kk.po | 18 + po/ko_KR.po | 18 + po/lt.po | 18 + po/lv.po | 18 + po/mk.po | 18 + po/nb.po | 18 + po/nl_NL.po | 18 + po/pl.po | 18 + po/pt_BR.po | 18 + po/pt_PT.po | 18 + po/ro.po | 18 + po/ru_RU.po | 18 + po/sk.po | 18 + po/sl.po | 18 + po/sr.po | 18 + po/sv.po | 18 + po/tr_TR.po | 18 + po/uk.po | 18 + po/uz.po | 18 + po/zh_CN.po | 18 + po/zh_HK.po | 18 + po/zh_SG.po | 18 + po/zh_TW.po | 18 + src/CMakeLists.txt | 6 +- src/api_new/CMakeLists.txt | 6 +- src/api_new/core_module.cpp | 5 +- src/api_new/core_module.h | 2 - src/api_new/i_runnable_widget_object.h | 3 +- src/api_new/runnable_widget_object.cpp | 11 +- src/api_new/runnable_widget_object.h | 12 +- src/api_new/user_delegates.h | 6 +- src/{view/common => domain}/application_data.cpp | 2 +- src/{view/common => domain}/application_data.h | 0 src/domain/widget_data_types.cpp | 183 ++++----- src/domain/widget_data_types.h | 116 +++--- src/domain/widget_deserialize_model.cpp | 2 +- src/domain/widget_string.h | 46 ++- src/domain/wrt_log.h | 55 --- src/plugin-service/CMakeLists.txt | 2 + src/plugin-service/wrt_plugin_module.cpp | 23 +- src/view/CMakeLists.txt | 7 +- src/view/common/CMakeLists.txt | 9 +- src/view/common/application_launcher.cpp | 73 ++-- src/view/common/application_launcher.h | 1 - src/view/common/scheme.cpp | 4 +- src/view/common/scheme_action_map.cpp | 3 +- src/view/common/view_logic_apps_support.cpp | 14 +- src/view/common/view_logic_certificate_support.cpp | 5 +- .../common/view_logic_security_origin_support.cpp | 7 +- .../view_logic_service_support.cpp | 0 .../view_logic_service_support.h | 0 src/view/common/view_logic_uri_support.cpp | 4 +- src/view/context_manager.cpp | 42 ++ .../i_context_manager.h} | 31 +- src/view/webkit/CMakeLists.txt | 13 +- .../webkit}/ewk_context_manager.cpp | 89 ++--- src/{api_new => view/webkit}/ewk_context_manager.h | 11 +- src/view/webkit/injected-bundle/CMakeLists.txt | 1 + .../injected_bundle_decryption_support.cpp | 25 +- .../injected_bundle_uri_handling.cpp | 96 ++--- .../injected-bundle/injected_bundle_uri_handling.h | 2 - .../injected_bundle_viewmodes_support.cpp | 14 +- .../webkit/injected-bundle/wrt-injected-bundle.cpp | 58 ++- .../webkit/injected-bundle/wrt-injected-bundle.h | 1 - src/view/webkit/view_logic.cpp | 174 ++++---- src/view/webkit/view_logic.h | 2 - ...view_logic_authentication_challenge_support.cpp | 3 +- src/view/webkit/view_logic_geolocation_support.cpp | 23 +- src/view/webkit/view_logic_orientation_support.cpp | 2 +- src/view/webkit/view_logic_scheme_support.cpp | 8 +- .../webkit/view_logic_web_notification_support.cpp | 14 +- src/wrt-client/CMakeLists.txt | 7 +- src/wrt-client/auto_rotation_support.cpp | 4 +- src/wrt-client/client_command_line_parser.cpp | 119 ++++++ src/wrt-client/client_command_line_parser.h | 31 ++ src/wrt-client/client_ide_support.cpp | 77 ++++ src/wrt-client/client_ide_support.h | 31 ++ src/wrt-client/splash_screen_support.cpp | 4 +- src/wrt-client/window_data.cpp | 440 +++++++++------------ src/wrt-client/window_data.h | 102 ++--- src/wrt-client/wrt-client.cpp | 381 +++++++----------- src/wrt-client/wrt-client.h | 13 +- src/wrt-launchpad-daemon/CMakeLists.txt | 1 + src/wrt-launchpad-daemon/launchpad_src/launchpad.c | 16 +- src/wrt-launchpad-daemon/src/app_sock.c | 25 +- src/wrt-launchpad-daemon/src/process_pool.c | 25 +- src/wrt-launchpad-daemon/wrt_launchpad_run.sh | 17 - .../wrt_launchpad_daemon@.service | 1 - systemd/wrt_launchpad_daemon_1.socket | 10 + systemd/wrt_launchpad_daemon_2.socket | 7 + tests/widgets/TestInit.cpp | 2 +- .../common/include/mock/MockContextManager.h | 8 +- .../common/src/RunnableObjectStateTester.cpp | 2 +- .../widgets/common/src/mock/MockContextManager.cpp | 20 +- wrt_env.sh | 2 + 131 files changed, 2286 insertions(+), 1708 deletions(-) delete mode 100755 data/Platform.edc rename data/{Daemon.edc => Wrt.edc} (68%) delete mode 100755 data/images/backward_1.png delete mode 100755 data/images/backward_2.png delete mode 100644 data/wrt_theme.edc rename src/{view/common => domain}/application_data.cpp (97%) rename src/{view/common => domain}/application_data.h (100%) delete mode 100644 src/domain/wrt_log.h rename src/view/{webkit => common}/view_logic_service_support.cpp (100%) rename src/view/{webkit => common}/view_logic_service_support.h (100%) create mode 100644 src/view/context_manager.cpp rename src/{api_new/abstract_context_manager.h => view/i_context_manager.h} (78%) rename src/{api_new => view/webkit}/ewk_context_manager.cpp (87%) rename src/{api_new => view/webkit}/ewk_context_manager.h (92%) create mode 100644 src/wrt-client/client_command_line_parser.cpp create mode 100644 src/wrt-client/client_command_line_parser.h create mode 100644 src/wrt-client/client_ide_support.cpp create mode 100644 src/wrt-client/client_ide_support.h delete mode 100644 src/wrt-launchpad-daemon/wrt_launchpad_run.sh rename {packaging => systemd}/wrt_launchpad_daemon@.service (97%) create mode 100644 systemd/wrt_launchpad_daemon_1.socket create mode 100644 systemd/wrt_launchpad_daemon_2.socket diff --git a/CMakeLists.txt b/CMakeLists.txt index 5564952..12ce922 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,12 +152,17 @@ SET(TARGET_PLUGIN_MODULE_LIB "wrt-plugin-module") SET(TARGET_VIEW_MODULE_LIB "wrt-view-module") SET(TARGET_CORE_MODULE_LIB "wrt-core-module") SET(TARGET_INJECTED_BUNDLE_LIB "wrt-injected-bundle") - SET(PROF_LIB "") IF(PROFILING) SET(PROF_LIB ${TARGET_PROFILING_LIB}) ENDIF(PROFILING) +############################# +# definitions +ADD_DEFINITIONS("-DWRT_EDJ_PATH=\"/usr/share/edje/wrt/Wrt.edj\"") + +############################# +# install INSTALL(FILES ${PROJECT_SOURCE_DIR}/wrt_reset_db.sh ${PROJECT_SOURCE_DIR}/wrt_reset_all.sh @@ -174,34 +179,14 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/WAC2.0TestRootCA.cert DESTINATION share/wrt-engine/ ) ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_SOURCE_DIR}/data/wrt_theme.edj - COMMAND edje_cc -id ${PROJECT_SOURCE_DIR}/data/images - ARGS ${PROJECT_SOURCE_DIR}/data/wrt_theme.edc - ${PROJECT_SOURCE_DIR}/data/wrt_theme.edj - DEPENDS ${PROJECT_SOURCE_DIR}/data/wrt_theme.edc - ) -ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_SOURCE_DIR}/data/Daemon.edj + OUTPUT ${PROJECT_SOURCE_DIR}/data/Wrt.edj COMMAND edje_cc - ARGS ${PROJECT_SOURCE_DIR}/data/Daemon.edc - ${PROJECT_SOURCE_DIR}/data/Daemon.edj - DEPENDS ${PROJECT_SOURCE_DIR}/data/Daemon.edc - ) -ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_SOURCE_DIR}/data/Platform.edj - COMMAND edje_cc - ARGS ${PROJECT_SOURCE_DIR}/data/Platform.edc - ${PROJECT_SOURCE_DIR}/data/Platform.edj - DEPENDS ${PROJECT_SOURCE_DIR}/data/Platform.edc - ) -ADD_CUSTOM_TARGET( WRT_THEME_EDJES ALL DEPENDS - ${PROJECT_SOURCE_DIR}/data/wrt_theme.edj + ARGS ${PROJECT_SOURCE_DIR}/data/Wrt.edc + ${PROJECT_SOURCE_DIR}/data/Wrt.edj + DEPENDS ${PROJECT_SOURCE_DIR}/data/Wrt.edc ) ADD_CUSTOM_TARGET( WRT_EDJES ALL DEPENDS - ${PROJECT_SOURCE_DIR}/data/Daemon.edj - ) -ADD_CUSTOM_TARGET( WRT_PLATFORM_LAYOUT_EDJES ALL DEPENDS - ${PROJECT_SOURCE_DIR}/data/Platform.edj + ${PROJECT_SOURCE_DIR}/data/Wrt.edj ) ADD_CUSTOM_COMMAND( OUTPUT ${PROJECT_SOURCE_DIR}/data/generic_popup.edj @@ -216,13 +201,7 @@ ADD_CUSTOM_TARGET(generic_popup ALL DEPENDS INSTALL(FILES ${PROJECT_SOURCE_DIR}/data/generic_popup.edj DESTINATION share/edje/ace/ ) -INSTALL(FILES ${PROJECT_SOURCE_DIR}/data/wrt_theme.edj - DESTINATION share/edje/wrt/ - ) -INSTALL(FILES ${PROJECT_SOURCE_DIR}/data/Daemon.edj - DESTINATION share/edje/wrt/ - ) -INSTALL(FILES ${PROJECT_SOURCE_DIR}/data/Platform.edj +INSTALL(FILES ${PROJECT_SOURCE_DIR}/data/Wrt.edj DESTINATION share/edje/wrt/ ) ADD_CUSTOM_COMMAND( @@ -248,6 +227,16 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt_launchpad_daemon.rule INSTALL(FILES ${CMAKE_SOURCE_DIR}/accesses.d/wrt_launchpad_daemon.rule DESTINATION /opt/etc/smack/accesses.d/ ) +# install systemd files +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon@.service + DESTINATION /usr/lib/systemd/system/ + ) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_1.socket + DESTINATION /usr/lib/systemd/system/ + ) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_2.socket + DESTINATION /usr/lib/systemd/system/ + ) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(po) @@ -266,5 +255,3 @@ INSTALL(FILES ${PKGCONFIG_DIR}/wrt-core.pc DESTINATION lib/pkgconfig) IF(WITH_TESTS) add_subdirectory(tests) ENDIF(WITH_TESTS) - - diff --git a/data/Platform.edc b/data/Platform.edc deleted file mode 100755 index 8bc57fa..0000000 --- a/data/Platform.edc +++ /dev/null @@ -1,24 +0,0 @@ -collections { - group { name: "platformlayout"; - parts { - part { name: "elm.swallow.bg"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - } - } - part { name: "elm.swallow.controlbar"; - type: SWALLOW; - description { state: "default" 0.0; - visible: 0; - } - } - } - } -} diff --git a/data/Daemon.edc b/data/Wrt.edc similarity index 68% rename from data/Daemon.edc rename to data/Wrt.edc index 6530335..72b181f 100644 --- a/data/Daemon.edc +++ b/data/Wrt.edc @@ -1,6 +1,6 @@ collections { group { - name: "client"; + name: "web-application"; parts { part { name: "base"; @@ -44,116 +44,8 @@ collections { visible: 1; } } - part { - name: "elm.swallow.backward"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 0; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - min: 91 79; - max: 91 79; - fixed: 1 1; - align: 1.0 1.0; - rel1 { relative: 1.0 1.0; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.rect.comboboxPickerBG"; - scale: 1; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - color: 100 100 100 150; - } - description { - state: "hideComboboxPicker" 0.0; - inherit: "default" 0.0; - } - description { - state: "showComboboxPicker" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.swallow.comboboxPicker"; - scale: 1; - type: SWALLOW; - mouse_events: 1; - description { - state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.0 0.0; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "hideComboboxPicker" 0.0; - inherit: "default" 0.0; - align: 0.0 0.0; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "showComboboxPicker" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.0; - rel1 { relative: 0.0 0.5; } - rel2 { relative: 1.0 1.0; } - } - } }//end of parts - programs { - program { name: "show,backward"; - signal: "show,backward,signal"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.backward"; - } - program { name: "hide,backward"; - signal: "hide,backward,signal"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.backward"; - } - program { name: "showComboboxPicker"; - signal: "show,comboboxPicker"; - action: STATE_SET "showComboboxPicker" 0.0; - target: "elm.rect.comboboxPickerBG"; - after: "showComboboxPicker_"; - } - program { name: "hideComboboxPicker"; - signal: "hide,comboboxPicker"; - action: STATE_SET "hideComboboxPicker" 0.0; - target: "elm.rect.comboboxPickerBG"; - after: "hideComboboxPicker_"; - } - program { name: "showComboboxPicker_"; - signal: "showComboboxPicker_"; - action: STATE_SET "showComboboxPicker" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.comboboxPicker"; - } - program { name: "hideComboboxPicker_"; - signal: "hideComboboxPicker_"; - action: STATE_SET "hideComboboxPicker" 0.0; - transition: DECELERATE 0.5; - target: "elm.swallow.comboboxPicker"; - } program { name: "show,progress"; signal: "show,progress,signal"; action: STATE_SET "visible" 0.0; diff --git a/data/images/backward_1.png b/data/images/backward_1.png deleted file mode 100755 index 318a16a5ae93c7ad46a7aa53da3e3a160db4732c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4449 zcmV-n5uWaeP)j{00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000JzNkl7hC9mb#ep0PdSAqZz;hs0=tvgJSnNHju1FpZ9s^{~w!h90xyCk@x}2g?Hgyco*JJRbjIvs98* zfhPz8G)+f59?!7f?+;6o1h3Z%hG9Su1OR~Nd9=5;H@tfF3YKNn2Yk`uqA2#tvJ9Wk z2ae-FlH`g3T7GOx!?(1w3^X(}ytB9<2%u>iTSaAEX($wmcs!orKp;@k;&ln%)YKH_ zdH&A!?c3M1c-_Hob&Hn;9}0ycf*{-p1OgqESezgT%*@Q}p=ml&$pt%(ldx?&QI%b4 zwLMo+6j>02JEAC_^ZWfM?%Cy9d~tCRZ{NN}Hk*ZQ+vS48vMiXU3DYzuEX$fSP4mg? z*RMya2H)J=9P#;lBmS=iK@dPuR7HVi+cpY?0!-6HB{w;?ZNsuGUk0F8}}y?(#{NiZ0c%LzP1)3l#Gc<|uZ)YMexR@%oM$3Z@yhpy{Lr_+Ca z{`~pLb*DW59zY}(i}gNy`0&{5>}M=(wt?S|xC)R7!sF;zesJl?vx_IeD!C zNT<_y^XAPjUcP*JcfIiMTmYbZXlUrCu~@9jvMj#bt?uyQ!#}@v?OL?L$&~?w0feK` zXvd>RkB((B8D;szIF5r{E{AkFoz*mLXEK@8%YiSdQ`5BW+qZ9@nx3BSSg#A_=jRa) zhx6vHr}>$(<; z#hU)Fv|mF8fRW?Jj}HtF58v$S>Kdmg%BWSa6$*vo+p$}>Zrx-UW`(sGh5Xibgm-Me>UxvMCO0>^P^YisMO7JN}p6-D`UaB%SE zg$oycD@l@8%R$(-ZQGx|<%VynH=2gWpx16o?_LnZvd8ukE#&H}hE-pe*6hjb%k$5~l z+0)b0xpaCW6bc!&$^=Q0{=1>@%a=kh7)&q>lW-iT*nrqj!1ng`NJ~pg$?FjWVdlNS z7hUi^fWNJ#rlt=miYf`u^L(P}fwx)I+S)1?3WYNa!<2+Sc<|ug>K0y-qkUhi1WA&>aombVt7Tc}?Ckt&M@Pq( zHHRk%0xZj(<9U9VW!ZH<16Z1Euq+FX&K>({S;yi|?W4xS(g za2ywDXlNLgW%=EY7RqU6&@>H-qE;O|$8q5E`LwH7ul@$W)78H3y}^?t2~|~lNs@#l zNgMWX({UWAsyf-<-~YSj=H}n8_1X6ZPf-*?p^!W`H@9Kn6h#?_4jp=O`SRt@0F13> z_nNHvzP`S(`}gmEv=Pwz_U-%U`Sa%|6h#?Z%jz|OH%${gJw0Q(uKzI_jUF=$L$1Wy zjg5_oKp>#)*|X=>nKNf5mw=ys-)w&;LuycEeE^^vU$>wuQ38Or^!imj{00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000McNklx!`LL3Rf}PRuxeY^jUgtr zT~SwQQ^kkvL$zri7~fD;sj#inpu3c6TG^ylL2U<-GBp$^>DrELqiI4)a3BF==W-n1 zj?eAg2LdC(Srf;()b%6zi;sMKe&>0f|NFfEV-rd#KC8jtGaNgBbLLr10YC5E+aPF)2t_zP710NOy=+O56eSvmccLIcTn&&?6X%ih&IUsN-21; z6k1};ZKNlfsbzK+3_M{Na5f2Ic}>tOuYX1GH2THz8t{%15QYUPg}u}V!C3~v@_=O) zPS1K@o5SJkgOQn~Ic*-N}o;Xmyqo)dgS z%iiFMmCY}T@|KmkmN+2<3@3mU#O7Qtlv)<3WrCVUh=PXlGMCKc-qr>Fyhuyr zT~cKuY?3GE63-+?5xe#uBq9T_3@tZ!YQfZ1n3)s|Ed?`^>NK@fx2dI1NBYjTzN%Wm0uHmtDJUs6M)9a!O&DI!s-Ko>HJC#-PTdP?az;6H!G= z#|~3NKNRhMN0|@2y!*f#e~+>L20?T$I~Avv3Cqa9(9$r}Br@?RlF=(jLy8b7^nB&otu2RYT$e9OCPi+iqR?+5Ti zB&NAv=!mvlxTXa@ElU@*OlZk*#D*?nr2jnP;r_OpJ#RfSSGBhT2m%Pab1CLOc1~%% z5wqm^3SR5_lJ?crQaHCH6A;4Sx?;F5Ma;S(#gY>l>dv+*Xo)e5UHJgfzOzV;4*qy1 z4IrPOzJ35Z0m#2<4+l?ozb)XnnT+C$n670sw-MnC5=&WTdq>tj}p!NsV4b_+kgf2fMeL zS}Mo=JORV;Ut{XR##z(QSoVY8s8ClJ5+F#wzb(EaS5niGTp@uI%k-Zft1+@$i z%bcK=wUF(Rwdxp_2PcRi9G~~h-w~fgN*&gAYU;{j zmjhvWFuWa1mJM3oe0$3@pv6Z~xpu2+FY&ewcKx;cp-mNmhc;E50@ij`ZG0h2Eo&*K z-_U}=0{{husjIhIVZ-(iXO}{hQW$Cirj`Q5!v5^-^>?q`Q`*$jVd*L?%N$%#_$jTR zCZMZ{#muaHu2)$DNYg4(hoPlF4Ly|io?kA}HyGXA6E>T(%>qU`4%5hV7Am~`(23rk zS**i8-TE>zDHti`>WzQ57gpvOP5=OW_vgpo9GGxyW>|j8aZ^{3iH|@{j6OeWCui9k zI1B^cQ36-x%HX!Ae>b3Twc7;IJ=J!j6nZL#j53talFCc7_3#$%qCr3y2889^gkk2i zEhdDy<^A)HX3pWd-{t+>SDn7qHC*LN*d)(AMyq9NNR3}dX8h`b;R|mlOA600EO^lk zPgUJhI_yUYJGZYUEC=2ufp?a{CV5~h@xkWuWVO|)WkQYJge^Vv_Qk*b`nj3T$t_ly z3a$z~_SoY;I5R+x+N3gIj?V$^JoVunU-{6Y6{ELU?!q! zQ%UU4zx>HJpPn>du;lQR-kRyZ9jNO5$EzbP`GwX2Z9=`@Z=Bopb@||?rrM6#etc2j zO-%)W?zOe9;G==eU)nAtTC>^Cvn_4Q$e>c9A)k|m*Hp6odv|{E50mD~oO}eb$p5iv z!YvcjJ #include -#include - IMPLEMENT_SINGLETON(WRT::CoreModule) namespace { @@ -83,7 +81,7 @@ class CoreModuleImpl { public: - CoreModuleImpl() : m_initialized(false), m_ewkContext(NULL) + CoreModuleImpl() : m_initialized(false) { LogDebug("enter"); } @@ -182,7 +180,6 @@ class CoreModuleImpl private: bool m_initialized; - Ewk_Context* m_ewkContext; }; CoreModule::CoreModule() : m_impl(new CoreModuleImpl()) diff --git a/src/api_new/core_module.h b/src/api_new/core_module.h index 0477d75..02d79a3 100644 --- a/src/api_new/core_module.h +++ b/src/api_new/core_module.h @@ -30,8 +30,6 @@ #include #include -#include - namespace WRT { class CoreModuleImpl; // forward declaration diff --git a/src/api_new/i_runnable_widget_object.h b/src/api_new/i_runnable_widget_object.h index b7d1726..4d072ef 100644 --- a/src/api_new/i_runnable_widget_object.h +++ b/src/api_new/i_runnable_widget_object.h @@ -24,10 +24,11 @@ #define RUNNABLE_WIDGET_OBJECT_INTERFACE_H_ #include -#include #include #include +class Ewk_Context; //forward declaration + namespace WRT { /** diff --git a/src/api_new/runnable_widget_object.cpp b/src/api_new/runnable_widget_object.cpp index f8a3684..bedc0a1 100644 --- a/src/api_new/runnable_widget_object.cpp +++ b/src/api_new/runnable_widget_object.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ /** - * @file core_module.cpp + * @file runnable_widget_object.cpp * @author Przemyslaw Ciezkowski (p.ciezkowski@samsung.com) * @version 1.0 * @brief File contains defitinions of RunnableWidgetObject implementation. @@ -30,8 +30,6 @@ #include #include #include -#include -#include "ewk_context_manager.h" namespace { //Anonymous const unsigned int UID_ROOT = 0; @@ -43,7 +41,7 @@ namespace WRT { RunnableWidgetObject::RunnableWidgetObject(WidgetModelPtr &model) : m_widgetModel(model), m_view(ViewModule::createView()), - m_contextManagerFactoryMethod(makeContextManagerFactoryMethod()) + m_contextManagerFactoryMethod(ViewModule::makeContextManagerFactoryMethod()) { //set initial state of runnable object m_guardstate = std::shared_ptr( @@ -213,7 +211,8 @@ void RunnableWidgetObject::setViewModule(ViewModule::IViewModulePtr ptr) m_view = ptr; } -void RunnableWidgetObject::setContextManagerFactoryMethod(ContextManagerFactoryMethod method) +void RunnableWidgetObject::setContextManagerFactoryMethod( + ViewModule::ContextManagerFactoryMethod method) { LogDebug("Setting ContextManagerFactoryMethod"); m_contextManagerFactoryMethod = method; @@ -222,7 +221,7 @@ void RunnableWidgetObject::setContextManagerFactoryMethod(ContextManagerFactoryM void RunnableWidgetObject::setNewState( std::shared_ptr sptr) { - LogInfo("RunnableWidgetObject changes state to: " << sptr->toString()); + LogDebug("RunnableWidgetObject changes state to: " << sptr->toString()); m_guardstate = sptr; } diff --git a/src/api_new/runnable_widget_object.h b/src/api_new/runnable_widget_object.h index 3c1c047..2acf75d 100644 --- a/src/api_new/runnable_widget_object.h +++ b/src/api_new/runnable_widget_object.h @@ -31,15 +31,15 @@ class StateChange; } } +#include "i_runnable_widget_object.h" + #include #include -#include #include #include #include -#include "ewk_context_manager.h" -#include "i_runnable_widget_object.h" +#include namespace WRT { class RunnableWidgetObject : public IRunnableWidgetObject @@ -63,7 +63,7 @@ public: void FireJavascriptEvent(int event, void* data); void setViewModule(ViewModule::IViewModulePtr ptr); - void setContextManagerFactoryMethod(ContextManagerFactoryMethod method); + void setContextManagerFactoryMethod(ViewModule::ContextManagerFactoryMethod method); private: bool CheckWACTestCertififedWidget(); @@ -72,10 +72,10 @@ public: WidgetModelPtr m_widgetModel; ViewModule::IViewModulePtr m_view; std::shared_ptr m_guardstate; - ContextManagerPtr m_ewkContextManager; + ViewModule::ContextManagerPtr m_ewkContextManager; //factor method to be used for creation of context manager when needed - ContextManagerFactoryMethod m_contextManagerFactoryMethod; + ViewModule::ContextManagerFactoryMethod m_contextManagerFactoryMethod; friend class State::StateChange; }; diff --git a/src/api_new/user_delegates.h b/src/api_new/user_delegates.h index 5112ad7..4adbc12 100644 --- a/src/api_new/user_delegates.h +++ b/src/api_new/user_delegates.h @@ -44,7 +44,8 @@ typedef DPL::FastDelegate1 SuspendCB; typedef DPL::FastDelegate1 ResetCB; typedef DPL::FastDelegate1 BufferUnsetCB; typedef DPL::FastDelegate1 BufferSetCB; -typedef DPL::FastDelegate1 ToggleFullscreenCB; +typedef DPL::FastDelegate2 EnterFullscreenCB; +typedef DPL::FastDelegate1 ExitFullscreenCB; typedef DPL::FastDelegate1 EditorclientImeCB; typedef DPL::FastDelegate1 OrientationCB; typedef DPL::FastDelegate1 HWkeyCB; @@ -66,7 +67,8 @@ struct UserDelegates { ResetCB reset; BufferUnsetCB bufferUnset; BufferSetCB bufferSet; - ToggleFullscreenCB toggleFullscreen; + EnterFullscreenCB enterFullscreen; + ExitFullscreenCB exitFullscreen; OrientationCB setOrientation; HWkeyCB hwkey; }; diff --git a/src/view/common/application_data.cpp b/src/domain/application_data.cpp similarity index 97% rename from src/view/common/application_data.cpp rename to src/domain/application_data.cpp index 23f7fd1..7a20756 100644 --- a/src/view/common/application_data.cpp +++ b/src/domain/application_data.cpp @@ -74,7 +74,7 @@ bool ApplicationData::setEncodedBundle(bundle* originBundle) return false; } - LogInfo("Encoded Bundle : " << m_encodedBundle); + LogDebug("Encoded Bundle : " << m_encodedBundle); return true; } diff --git a/src/view/common/application_data.h b/src/domain/application_data.h similarity index 100% rename from src/view/common/application_data.h rename to src/domain/application_data.h diff --git a/src/domain/widget_data_types.cpp b/src/domain/widget_data_types.cpp index 55a14e8..8837658 100644 --- a/src/domain/widget_data_types.cpp +++ b/src/domain/widget_data_types.cpp @@ -29,7 +29,15 @@ #include +#include + #include +#include + +namespace { +const char* const WRT_WIDGET_DATA_TYPES_LOG_ENABLE = + "WRT_WIDGET_DATA_TYPES_LOG_ENABLE"; +} WidgetAccessList::WidgetAccessList() : m_isAccessAll(false) {} @@ -101,11 +109,19 @@ WidgetSettingList::WidgetSettingList() : m_BackgroundSupport(BackgroundSupport_Disable), m_ProgressbarPresence(ProgressBar_Disable), m_HWkeyEvent(HWkeyEvent_Enable), - m_Accessibility(Accessibility_Enable) -{} + m_Accessibility(Accessibility_Enable), + m_SoundMode(SoundMode_Shared) +{ + m_logEnable = (getenv(WRT_WIDGET_DATA_TYPES_LOG_ENABLE) != NULL); +} WidgetSettingList::WidgetSettingList(WrtDB::WidgetSettings &widgetSettings) { + using namespace TizenSetting::Name; + using namespace TizenSetting::Value; + + m_logEnable = (getenv(WRT_WIDGET_DATA_TYPES_LOG_ENABLE) != NULL); + m_RotationLock = Screen_Portrait; m_IndicatorPresence = Indicator_Enable; m_BackButtonPresence = BackButton_Disable; @@ -115,202 +131,182 @@ WidgetSettingList::WidgetSettingList(WrtDB::WidgetSettings &widgetSettings) m_ProgressbarPresence = ProgressBar_Disable; m_HWkeyEvent = HWkeyEvent_Enable; m_Accessibility = Accessibility_Enable; + m_SoundMode = SoundMode_Shared; - FOREACH(it, widgetSettings) - { + FOREACH(it, widgetSettings) { DPL::String name = it->settingName; DPL::String value = it->settingValue; - if (name == SETTING_NAME_SCREEN_ORIENTATION) { - if (value == SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT) { + if (name == SCREEN_ORIENTATION) { + if (value == SCREEN_ORIENTATION_PORTRAIT) { m_RotationLock = Screen_Portrait; - } else if (value == - SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE) - { + } else if (value == SCREEN_ORIENTATION_LANDSCAPE) { m_RotationLock = Screen_Landscape; - } else if (value == - SETTING_VALUE_SCREEN_ORIENTATION_AUTO_ROTATION) - { + } else if (value == SCREEN_ORIENTATION_AUTO_ROTATION) { m_RotationLock = Screen_AutoRotation; } else { - LogError("Invalid screen orientation value!! [" << - value << "]"); + displayError(name, value); m_RotationLock = Screen_Portrait; } - } else if (name == SETTING_NAME_INDICATOR_PRESENCE) { - if (value == SETTING_VALUE_INDICATOR_PRESENCE_ENALBE) { + } else if (name == INDICATOR_PRESENCE) { + if (value == INDICATOR_PRESENCE_ENALBE) { m_IndicatorPresence = Indicator_Enable; - } else if (value == SETTING_VALUE_INDICATOR_PRESENCE_DISABLE) { + } else if (value == INDICATOR_PRESENCE_DISABLE) { m_IndicatorPresence = Indicator_Disable; } else { - LogError("Invalid indicator presence value!! [" << - value << "]"); + displayError(name, value); m_IndicatorPresence = Indicator_Enable; } - } else if (name == SETTING_NAME_BACKBUTTON_PRESENCE) { - if (value == SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE) { + } else if (name == BACKBUTTON_PRESENCE) { + if (value == BACKBUTTON_PRESENCE_ENALBE) { m_BackButtonPresence = BackButton_Enable; - } else if (value == - SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE) - { + } else if (value == BACKBUTTON_PRESENCE_DISABLE) { m_BackButtonPresence = BackButton_Disable; } else { - LogError("Invalid backbutton presence value!! [" << - value << "]"); + displayError(name, value); m_BackButtonPresence = BackButton_Disable; } - } else if (name == SETTING_NAME_CONTEXT_MENU) - { - if (value == SETTING_VALUE_ENABLE) { + } else if (name == CONTEXT_MENU) { + if (value == CONTEXT_MENU_ENABLE) { m_ContextMenu = ContextMenu_Enable; - } else if (value == SETTING_VALUE_DISABLE) { + } else if (value == CONTEXT_MENU_DISABLE) { m_ContextMenu = ContextMenu_Disable; } else { - LogError("Invalid contextmenu value!! [" << value << "]"); + displayError(name, value); m_ContextMenu = ContextMenu_Enable; } - } else if (name == SETTING_NAME_ENCRYPTION) { - if (value == SETTING_VALUE_ENCRYPTION_ENABLE) { + } else if (name == ENCRYPTION) { + if (value == ENCRYPTION_ENABLE) { m_Encryption = Encryption_Enable; - } else if (value == - SETTING_VALUE_ENCRYPTION_DISABLE) - { + } else if (value == ENCRYPTION_DISABLE) { m_Encryption = Encryption_Disable; } else { - LogError("Invalid encryption value!! [" << value << "]"); + displayError(name, value); m_Encryption = Encryption_Disable; } - } else if (name == SETTING_NAME_BACKGROUND_SUPPORT) { - if (value == SETTING_VALUE_ENABLE) { + } else if (name == BACKGROUND_SUPPORT) { + if (value == ENABLE) { m_BackgroundSupport = BackgroundSupport_Enable; - } else if (value == SETTING_VALUE_DISABLE) { + } else if (value == DISABLE) { m_BackgroundSupport = BackgroundSupport_Disable; } else { - LogError("Invalid background-support value!! [" << - value << "]"); + displayError(name, value); m_BackgroundSupport = BackgroundSupport_Disable; } - } else if (name == SETTING_NAME_USER_AGENT) { + } else if (name == USER_AGENT) { DPL::OptionalString userAgent = value; if (!userAgent.IsNull()) { m_UserAgent = DPL::ToUTF8String(*userAgent); } - } else if (name == SETTING_NAME_PROGRESSBAR_PRESENCE) { - if (value == SETTING_VALUE_PROGRESSBAR_PRESENCE_ENABLE) { + } else if (name == PROGRESSBAR_PRESENCE) { + if (value == PROGRESSBAR_PRESENCE_ENABLE) { m_ProgressbarPresence = ProgressBar_Enable; - } else if (value == SETTING_VALUE_PROGRESSBAR_PRESENCE_DISABLE) { + } else if (value == PROGRESSBAR_PRESENCE_DISABLE) { m_ProgressbarPresence = ProgressBar_Disable; } else { - LogError("Invalid progressbar-presence value!! [" << - value << "]"); + displayError(name, value); m_ProgressbarPresence = ProgressBar_Disable; } - } else if (name == SETTING_NAME_HWKEY_EVENT) { - if (value == SETTING_VALUE_HWKEY_EVENT_ENABLE) { + } else if (name == HWKEY_EVENT) { + if (value == HWKEY_EVENT_ENABLE) { m_HWkeyEvent = HWkeyEvent_Enable; - } else if (value == SETTING_VALUE_HWKEY_EVENT_DISABLE) { + } else if (value == HWKEY_EVENT_DISABLE) { m_HWkeyEvent = HWkeyEvent_Disable; } else { - LogError("Invalid hwkey-event value!! [" << value << "]"); + displayError(name, value); m_HWkeyEvent = HWkeyEvent_Enable; } - } else if (name == SETTING_NAME_ACCESSIBILITY) { - if (value == SETTING_VALUE_ACCESSIBILITY_ENABLE) { + } else if (name == ACCESSIBILITY) { + if (value == ACCESSIBILITY_ENABLE) { m_Accessibility = Accessibility_Enable; - } else if (value == SETTING_VALUE_ACCESSIBILITY_DISABLE) { + } else if (value == ACCESSIBILITY_DISABLE) { m_Accessibility = Accessibility_Disable; } else { - LogError("Invalid accessibility value!! [" << value << "]"); + displayError(name, value); m_Accessibility = Accessibility_Enable; } + } else if (name == SOUND_MODE) { + if (value == SOUND_MODE_SAHRED) { + m_SoundMode = SoundMode_Shared; + } else if (value == SOUND_MODE_EXCLUSIVE) { + m_SoundMode = SoundMode_Exclusive; + } else { + displayError(name, value); + m_SoundMode = SoundMode_Shared; + } } else { - LogError("Invalid setting name!! [" << name << "]"); + displayError(name, value); } } - } WidgetSettingScreenLock WidgetSettingList::getRotationValue() const { - LogDebug("m_RotationLock: " << m_RotationLock); - + if (m_logEnable) {_D("m_RotationLock: %d", m_RotationLock);} return m_RotationLock; } WidgetSettingIndicatorPresence WidgetSettingList::getIndicatorPresence() const { - LogDebug("m_IndicatorPresence: " << m_IndicatorPresence); - + if (m_logEnable) {_D("m_IndicatorPresence: %d", m_IndicatorPresence);} return m_IndicatorPresence; } WidgetSettingBackButtonPresence WidgetSettingList::getBackButtonPresence() const { - LogDebug("m_BackButtonPresence: " << m_BackButtonPresence); - + if (m_logEnable) {_D("m_BackButtonPresence: %d", m_BackButtonPresence);} return m_BackButtonPresence; } WidgetSettingContextMenu WidgetSettingList::getContextMenu() const { - LogDebug("m_ContextMenu: " << m_ContextMenu); - + if (m_logEnable) {_D("m_ContextMenu: %d", m_ContextMenu);} return m_ContextMenu; } WidgetSettingEncryption WidgetSettingList::getEncryption() const { - LogDebug("m_Encryption: " << m_Encryption); - + if (m_logEnable) {_D("m_Encryption: %d", m_Encryption);} return m_Encryption; } WidgetSettingBackgroundSupport WidgetSettingList::getBackgroundSupport() const { - LogDebug("m_BackgroundSupport: " << m_BackgroundSupport); - + if (m_logEnable) {_D("m_BackgroundSupport: %d", m_BackgroundSupport);} return m_BackgroundSupport; } -bool WidgetSettingList::isEncrypted() const -{ - LogDebug("m_Encryption: " << m_Encryption); - - if (m_Encryption == Encryption_Enable) { - return true; - } - return false; -} - std::string WidgetSettingList::getUserAgent() const { - LogDebug("m_UserAgent: " << m_UserAgent); - + if (m_logEnable) {_D("m_UserAgent: %s", m_UserAgent.c_str());} return m_UserAgent; } WidgetSettingProgressBarPresence WidgetSettingList::getProgressBarPresence() const { - LogDebug("m_ProgressbarPresence: " << m_ProgressbarPresence); - + if (m_logEnable) {_D("m_ProgressbarPresence: %d", m_ProgressbarPresence);} return m_ProgressbarPresence; } WidgetSettingHWkeyEventPresence WidgetSettingList::getHWkeyEvent() const { - LogDebug("m_HWkeyEvent: " << m_HWkeyEvent); - + if (m_logEnable) {_D("m_HWkeyEvent: %d", m_HWkeyEvent);} return m_HWkeyEvent; } WidgetSettingAccessibility WidgetSettingList::getAccessibility() const { - LogDebug("m_Accessibility: " << m_Accessibility); - + if (m_logEnable) {_D("m_Accessibility: %d", m_Accessibility);} return m_Accessibility; } +WidgetSettingSoundMode WidgetSettingList::getSoundMode() const +{ + if (m_logEnable) {_D("m_SoundMode: %d", m_SoundMode);} + return m_SoundMode; +} + bool WidgetSettingList::operator ==(const WidgetSettingList& other) const { return m_RotationLock == other.m_RotationLock && @@ -322,5 +318,14 @@ bool WidgetSettingList::operator ==(const WidgetSettingList& other) const m_UserAgent == other.m_UserAgent && m_ProgressbarPresence == other.m_ProgressbarPresence && m_HWkeyEvent == other.m_HWkeyEvent && - m_Accessibility == other.m_Accessibility; + m_Accessibility == other.m_Accessibility && + m_SoundMode == other.m_SoundMode; +} + +void WidgetSettingList::displayError(const DPL::String& name, + const DPL::String& value) +{ + _W("Invalid \"%s\" setting value \"%s\"", + DPL::ToUTF8String(name).c_str(), + DPL::ToUTF8String(value).c_str()); } diff --git a/src/domain/widget_data_types.h b/src/domain/widget_data_types.h index 6e7a87e..3e7435f 100644 --- a/src/domain/widget_data_types.h +++ b/src/domain/widget_data_types.h @@ -96,60 +96,44 @@ class WidgetAccessList bool m_isAccessAll; }; -static const DPL::String SETTING_NAME_SCREEN_ORIENTATION = - L"screen-orientation"; -static const DPL::String SETTING_NAME_INDICATOR_PRESENCE = - L"indicator-presence"; -static const DPL::String SETTING_NAME_BACKBUTTON_PRESENCE = - L"backbutton-presence"; - static const DPL::String SETTING_NAME_CONTEXT_MENU = - L"context-menu"; -static const DPL::String SETTING_NAME_BACKGROUND_SUPPORT = - L"background-support"; -static const DPL::String SETTING_NAME_USER_AGENT = - L"user-agent"; -static const DPL::String SETTING_NAME_PROGRESSBAR_PRESENCE = - L"progressbar-presence"; -static const DPL::String SETTING_NAME_HWKEY_EVENT = - L"hwkey-event"; -static const DPL::String SETTING_NAME_ACCESSIBILITY = - L"accessibility"; -static const DPL::String SETTING_VALUE_ENABLE = - L"enable"; -static const DPL::String SETTING_VALUE_DISABLE = - L"disable"; -static const DPL::String SETTING_NAME_ENCRYPTION = - L"encryption"; -static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_PORTRAIT = - L"portrait"; -static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_LANDSCAPE = - L"landscape"; -static const DPL::String SETTING_VALUE_SCREEN_ORIENTATION_AUTO_ROTATION = - L"auto-rotation"; -static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_ENALBE = - L"enable"; -static const DPL::String SETTING_VALUE_INDICATOR_PRESENCE_DISABLE = - L"disable"; -static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_ENALBE = - L"enable"; -static const DPL::String SETTING_VALUE_BACKBUTTON_PRESENCE_DISABLE = - L"disable"; -static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = - L"enable"; -static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE = - L"disable"; -static const DPL::String SETTING_VALUE_PROGRESSBAR_PRESENCE_ENABLE = - L"enable"; -static const DPL::String SETTING_VALUE_PROGRESSBAR_PRESENCE_DISABLE = - L"disable"; -static const DPL::String SETTING_VALUE_HWKEY_EVENT_ENABLE = - L"enable"; -static const DPL::String SETTING_VALUE_HWKEY_EVENT_DISABLE = - L"disable"; -static const DPL::String SETTING_VALUE_ACCESSIBILITY_ENABLE = - L"enable"; -static const DPL::String SETTING_VALUE_ACCESSIBILITY_DISABLE = - L"disable"; +namespace TizenSetting { +namespace Name { +const DPL::String SCREEN_ORIENTATION = L"screen-orientation"; +const DPL::String INDICATOR_PRESENCE = L"indicator-presence"; +const DPL::String BACKBUTTON_PRESENCE = L"backbutton-presence"; +const DPL::String CONTEXT_MENU = L"context-menu"; +const DPL::String BACKGROUND_SUPPORT = L"background-support"; +const DPL::String USER_AGENT = L"user-agent"; +const DPL::String PROGRESSBAR_PRESENCE = L"progressbar-presence"; +const DPL::String HWKEY_EVENT = L"hwkey-event"; +const DPL::String ACCESSIBILITY = L"accessibility"; +const DPL::String SOUND_MODE = L"sound-mode"; +const DPL::String ENCRYPTION = L"encryption"; +} // namespace Name +namespace Value { +const DPL::String ENABLE = L"enable"; +const DPL::String DISABLE = L"disable"; +const DPL::String SCREEN_ORIENTATION_PORTRAIT = L"portrait"; +const DPL::String SCREEN_ORIENTATION_LANDSCAPE = L"landscape"; +const DPL::String SCREEN_ORIENTATION_AUTO_ROTATION = L"auto-rotation"; +const DPL::String INDICATOR_PRESENCE_ENALBE = ENABLE; +const DPL::String INDICATOR_PRESENCE_DISABLE = DISABLE; +const DPL::String BACKBUTTON_PRESENCE_ENALBE = ENABLE; +const DPL::String BACKBUTTON_PRESENCE_DISABLE = DISABLE; +const DPL::String CONTEXT_MENU_ENABLE = ENABLE; +const DPL::String CONTEXT_MENU_DISABLE = DISABLE; +const DPL::String ENCRYPTION_ENABLE = ENABLE; +const DPL::String ENCRYPTION_DISABLE = DISABLE; +const DPL::String PROGRESSBAR_PRESENCE_ENABLE = ENABLE; +const DPL::String PROGRESSBAR_PRESENCE_DISABLE = DISABLE; +const DPL::String HWKEY_EVENT_ENABLE = ENABLE; +const DPL::String HWKEY_EVENT_DISABLE = DISABLE; +const DPL::String ACCESSIBILITY_ENABLE = ENABLE; +const DPL::String ACCESSIBILITY_DISABLE = DISABLE; +const DPL::String SOUND_MODE_SAHRED = L"shared"; +const DPL::String SOUND_MODE_EXCLUSIVE = L"exclusive"; +} // namespace Value +} // namespace TizenSetting enum WidgetSettingScreenLock { @@ -206,38 +190,35 @@ enum WidgetSettingAccessibility Accessibility_Disable }; +enum WidgetSettingSoundMode +{ + SoundMode_Shared, /* Default */ + SoundMode_Exclusive +}; + class WidgetSettingList { public: WidgetSettingList(); - WidgetSettingList(WrtDB::WidgetSettings &widgetSettings); WidgetSettingScreenLock getRotationValue() const; - WidgetSettingIndicatorPresence getIndicatorPresence() const; - WidgetSettingBackButtonPresence getBackButtonPresence() const; - WidgetSettingContextMenu getContextMenu() const; - WidgetSettingEncryption getEncryption() const; - WidgetSettingBackgroundSupport getBackgroundSupport() const; - - bool isEncrypted() const; - std::string getUserAgent() const; - WidgetSettingProgressBarPresence getProgressBarPresence() const; - WidgetSettingHWkeyEventPresence getHWkeyEvent() const; - WidgetSettingAccessibility getAccessibility() const; - + WidgetSettingSoundMode getSoundMode() const; bool operator ==(const WidgetSettingList& other) const; private: + void displayError(const DPL::String& name, const DPL::String& value); + + bool m_logEnable; WidgetSettingScreenLock m_RotationLock; WidgetSettingIndicatorPresence m_IndicatorPresence; WidgetSettingBackButtonPresence m_BackButtonPresence; @@ -247,6 +228,7 @@ class WidgetSettingList WidgetSettingProgressBarPresence m_ProgressbarPresence; WidgetSettingHWkeyEventPresence m_HWkeyEvent; WidgetSettingAccessibility m_Accessibility; + WidgetSettingSoundMode m_SoundMode; std::string m_UserAgent; }; typedef std::shared_ptr WidgetSettingListPtr; diff --git a/src/domain/widget_deserialize_model.cpp b/src/domain/widget_deserialize_model.cpp index b125cfb..84dd33a 100644 --- a/src/domain/widget_deserialize_model.cpp +++ b/src/domain/widget_deserialize_model.cpp @@ -37,7 +37,7 @@ std::string getTimestamp() gettimeofday(&tv, NULL); sprintf(buff, "%lf", (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f); - LogInfo("timestamp: " << buff); + LogDebug("timestamp: " << buff); return std::string(buff); } diff --git a/src/domain/widget_string.h b/src/domain/widget_string.h index 0fb1412..5bf62bd 100644 --- a/src/domain/widget_string.h +++ b/src/domain/widget_string.h @@ -24,12 +24,54 @@ #define WRT_SRC_DOMAIN_WIDGET_STRING_H_ #include +#include +#include + +#include #define WRT_PS "%s" +#define WRT_PNS "%d$s" + +namespace WrtText { +inline std::string replacePS(std::initializer_list strs) { + std::size_t size = strs.size(); + if (size <= 1 || size >= 10) { + return std::string(""); + } + + std::initializer_list::iterator it = strs.begin(); + std::string ret = *strs.begin(); + std::string arg = *(++it); + + // %s -> arg + std::size_t ps = ret.find(WRT_PS); + if (ps != std::string::npos) { + ret.replace(ps, std::string(WRT_PS).length(), arg); + return ret; + } + + // %n$s -> n_arg + std::string n = "1"; + for ( ; it != strs.end(); ++it) { + std::string pns = WRT_PNS; + pns.replace(1, 1, n); + n[0]++; + ret.replace(ret.find(pns), 4, (*it).c_str()); + } + return ret; +} +} + #define WRT_SK_YES dgettext("sys_string", "IDS_COM_SK_YES") #define WRT_SK_NO dgettext("sys_string", "IDS_COM_SK_NO") -#define WRT_BODY_PS_REQUESTS_YOUR_LOCATION dgettext("wrt", "IDS_BR_BODY_PS_REQUESTS_YOUR_LOCATION") +#define WRT_POP_USERMEDIA_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA") +#define WRT_POP_WEB_NOTIFICATION_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS") +#define WRT_POP_GEOLOCATION_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION") +#define WRT_POP_WEB_STORAGE_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE") +#define WRT_POP_APPLICATION_CACHE_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE") +#define WRT_POP_STARTING_DOWNLOADING dgettext("wrt", "IDS_BR_POP_STARTING_DOWNLOAD_ING") + #define WRT_BODY_REMEMBER_PREFERENCE dgettext("wrt", "IDS_BR_BODY_REMEMBER_PREFERENCE") -#endif // WRT_SRC_DOMAIN_WIDGET_STRING_H_ \ No newline at end of file +#endif // WRT_SRC_DOMAIN_WIDGET_STRING_H_ diff --git a/src/domain/wrt_log.h b/src/domain/wrt_log.h deleted file mode 100644 index 78a3de5..0000000 --- a/src/domain/wrt_log.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file wrt_log.h - * @author Jihoon Chung(jihoon.chung@samsung.com) - * @version 0.1 - * @brief - */ - -#ifndef WRT_SRC_DOMAIN_WRT_LOG_H_ -#define WRT_SRC_DOMAIN_WRT_LOG_H_ - -#include - -#ifdef WRT_LOG -#undef LOG_TAG -#define LOG_TAG "WRT" -#endif - -#ifdef WRT_BUNDLE_LOG -#undef LOG_TAG -#define LOG_TAG "WRT_BUNDLE" -#endif - -#ifndef SECURE_SLOGD -#define SECURE_SLOGD(fmt, arg...) SLOGD(fmt,##arg) -#endif - -#ifndef SECURE_SLOGW -#define SECURE_SLOGW(fmt, arg...) SLOGW(fmt,##arg) -#endif - -#ifndef SECURE_SLOGE -#define SECURE_SLOGE(fmt, arg...) SLOGE(fmt,##arg) -#endif - -#define _D(fmt, arg ...) SECURE_SLOGD(fmt,##arg) -#define _W(fmt, arg ...) SECURE_SLOGW(fmt,##arg) -#define _E(fmt, arg ...) SECURE_SLOGE(fmt,##arg) - -#endif // WRT_SRC_DOMAIN_WRT_LOG_H_ - diff --git a/src/plugin-service/CMakeLists.txt b/src/plugin-service/CMakeLists.txt index ae0fc98..7f9b45a 100644 --- a/src/plugin-service/CMakeLists.txt +++ b/src/plugin-service/CMakeLists.txt @@ -19,6 +19,8 @@ # @version 1.0 # +ADD_DEFINITIONS("-DWRT_PLUGINS_COMMON_LOG") + PKG_CHECK_MODULES(WRT_PLUGIN_DEP wrt-plugin-loading wrt-plugin-js-overlay diff --git a/src/plugin-service/wrt_plugin_module.cpp b/src/plugin-service/wrt_plugin_module.cpp index 80720a3..5fe2951 100644 --- a/src/plugin-service/wrt_plugin_module.cpp +++ b/src/plugin-service/wrt_plugin_module.cpp @@ -23,7 +23,7 @@ #include "wrt_plugin_module.h" -#include +#include #include #include #include @@ -32,7 +32,7 @@ namespace PluginModule { void init(int widgetHandle) { - LogDebug("initializing plugins module"); + _D("called"); PluginLogicSingleton::Instance().initSession(widgetHandle); } @@ -42,13 +42,6 @@ void start(int widgetHandle, const char *encodedBundle, const char *theme) { - LogDebug("starting plugins module with"); - LogDebug("handle: " << widgetHandle); - LogDebug("context: " << context); - LogDebug("scale: " << scale); - LogDebug("Bundle: " << encodedBundle); - LogDebug("theme: " << theme); - PluginLogicSingleton::Instance().startSession(widgetHandle, context, scale, @@ -58,13 +51,13 @@ void start(int widgetHandle, void shutdown() { - LogDebug("shuting down plugins module"); + _D("called"); PluginLogicSingleton::Instance().performLibrariesUnload(); } void stop(JSGlobalContextRef context) { - LogDebug("stopping plugins module"); + _D("called"); PluginLogicSingleton::Instance().stopSession(context); } @@ -73,7 +66,7 @@ void setCustomProperties(JSGlobalContextRef context, const char* encodedBundle, const char* theme) { - LogDebug("reset custom properties of window object"); + _D("called"); PluginLogicSingleton::Instance().setCustomProperties(context, scale, encodedBundle, @@ -84,7 +77,7 @@ void dispatchJavaScriptEvent(JSGlobalContextRef context, WrtPlugins::W3C::CustomEventType eventType, void* data) { - LogDebug("dispatching javascript event"); + _D("called"); PluginLogicSingleton::Instance().dispatchJavaScriptEvent(context, eventType, data); @@ -92,13 +85,13 @@ void dispatchJavaScriptEvent(JSGlobalContextRef context, void loadFrame(JSGlobalContextRef context) { - LogDebug("load frame into web page (context:" << context << ")"); + _D("load frame into web page (context: %p)", context); PluginLogicSingleton::Instance().loadFrame(context); } void unloadFrame(JSGlobalContextRef context) { - LogDebug("unload frame from web page (context:" << context << ")"); + _D("unload frame from web page (context: %p)", context); PluginLogicSingleton::Instance().unloadFrame(context); } } // PluginModule diff --git a/src/view/CMakeLists.txt b/src/view/CMakeLists.txt index 8118c29..5e19ae2 100644 --- a/src/view/CMakeLists.txt +++ b/src/view/CMakeLists.txt @@ -16,8 +16,11 @@ # @file src/view/CMakeLists.txt # @author Pawel Sikorski (p.sikorski@samsung.com) -SET(VIEW_MODULE_SOURCES ${PROJECT_SOURCE_DIR}/src/view/view_module.cpp) -SET(VIEW_COMMON_LIB_STATIC "wrt-view-common") +SET(VIEW_MODULE_SOURCES + ${PROJECT_SOURCE_DIR}/src/view/view_module.cpp + ${PROJECT_SOURCE_DIR}/src/view/context_manager.cpp +) +SET(TARGET_VIEW_COMMON_LIB_STATIC "wrt-view-common") ADD_SUBDIRECTORY(common) #ViewModule common library ADD_SUBDIRECTORY(webkit) #ViewModule based on Webkit2 diff --git a/src/view/common/CMakeLists.txt b/src/view/common/CMakeLists.txt index 8ddee2b..24d5823 100644 --- a/src/view/common/CMakeLists.txt +++ b/src/view/common/CMakeLists.txt @@ -16,8 +16,6 @@ # @file src/view/common/CMakeLists.txt # @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com) -SET(TARGET_VIEW_COMMON_LIB_STATIC "wrt-view-common") - PKG_CHECK_MODULES(SYS_VIEW_COMMON_DEP wrt-commons-custom-handler-dao-ro appsvc @@ -52,16 +50,15 @@ PKG_CHECK_MODULES(VIEW_COMMON_DEP ) SET(VIEW_COMMON_SOURCES - ${PROJECT_SOURCE_DIR}/src/view/common/application_data.cpp ${PROJECT_SOURCE_DIR}/src/view/common/application_launcher.cpp ${PROJECT_SOURCE_DIR}/src/view/common/evas_object.cpp ${PROJECT_SOURCE_DIR}/src/view/common/scheme.cpp ${PROJECT_SOURCE_DIR}/src/view/common/scheme_action_map.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_apps_support.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_custom_header_support.cpp - ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp - ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_origin_support.cpp + ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp + ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_service_support.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_storage_support.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_uri_support.cpp ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_vibration_support.cpp @@ -70,9 +67,7 @@ SET(VIEW_COMMON_SOURCES SET(VIEW_COMMON_INCLUDES ${PROJECT_SOURCE_DIR}/src/domain - ${PROJECT_SOURCE_DIR}/src/global_logic ${PROJECT_SOURCE_DIR}/src/profiling - ${PROJECT_SOURCE_DIR}/src/utils ${PROJECT_SOURCE_DIR}/src/view/common ${VIEW_COMMON_DEP_INCLUDE_DIRS} ) diff --git a/src/view/common/application_launcher.cpp b/src/view/common/application_launcher.cpp index fc8f885..bddbbdd 100644 --- a/src/view/common/application_launcher.cpp +++ b/src/view/common/application_launcher.cpp @@ -21,19 +21,24 @@ */ #include "application_launcher.h" + +#include +#include + #include #include -#include -#include #include +#include +#include +#include IMPLEMENT_SINGLETON(ApplicationLauncher) -using namespace WrtDB; - namespace { const char * const SERVICE_EXTRA_DATA_KEY_PATH = "path"; const char * const SERVICE_EXTRA_DATA_KEY_COOKIE = "cookie"; +const char * const SERVICE_EXTRA_DATA_KEY_MODE = "mode"; +const char * const SERVICE_EXTRA_DATA_VALUE_SLIENT = "silent"; const char * const SCHEME_TYPE_RTSP = "rtsp"; const char * const SCHEME_TYPE_HTML5_VIDEO = "html5video"; @@ -61,16 +66,18 @@ void ApplicationLauncher::OnEventReceived( result = service_send_launch_request(serviceHandle, responseCallback, userData); if (result != SERVICE_ERROR_NONE) { - LogError("Failed to run AppService : " << result); + service_destroy(serviceHandle); + _E("Failed to run service : %d", result); + return; } service_destroy(serviceHandle); + _D("Success to run service"); } void ApplicationLauncher::OnEventReceived( const ApplicationLauncherEvents::LaunchApplicationByPkgname &event) { using namespace ApplicationLauncherPkgname; - LogDebug("LaunchApplicationByPkgname"); std::string pkgName(event.GetArg0()); if (PKG_NAME_DOWNLOAD_PROVIDER == pkgName) { @@ -80,7 +87,7 @@ void ApplicationLauncher::OnEventReceived( std::string cookie(event.GetArg3()); if ("null" == url) { - LogError("url is empty"); + _E("url is empty"); return; } @@ -90,14 +97,14 @@ void ApplicationLauncher::OnEventReceived( // create service ret = service_create(&serviceHandle); if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) { - LogError("Fail to create service"); + _E("Fail to create service"); return; } // set service operation ret = service_set_operation(serviceHandle, SERVICE_OPERATION_DOWNLOAD); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to set operation [" << ret << "]"); + _E("Fail to set operation [%d]", ret); service_destroy(serviceHandle); return; } @@ -105,7 +112,7 @@ void ApplicationLauncher::OnEventReceived( // set service uri ret = service_set_uri(serviceHandle, url.c_str()); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to set uri [" << ret << "]"); + _E("Fail to set uri [%d]"); service_destroy(serviceHandle); return; } @@ -116,12 +123,21 @@ void ApplicationLauncher::OnEventReceived( SERVICE_EXTRA_DATA_KEY_COOKIE, cookie.c_str()); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to add cookie [" << ret << "]"); + _D("Fail to add cookie [%d]", ret); service_destroy(serviceHandle); return; } } + ret = service_add_extra_data(serviceHandle, + SERVICE_EXTRA_DATA_KEY_MODE, + SERVICE_EXTRA_DATA_VALUE_SLIENT); + if (SERVICE_ERROR_NONE != ret) { + _E("Fail to set service extra data [%d]", ret); + service_destroy(serviceHandle); + return; + } + if (m_windowHandle) { service_set_window(serviceHandle, m_windowHandle); } @@ -129,23 +145,23 @@ void ApplicationLauncher::OnEventReceived( //launch service ret = service_send_launch_request(serviceHandle, NULL, NULL); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to launch service [" << ret << "]"); + _E("Fail to launch service [%d]", ret); service_destroy(serviceHandle); return; } - service_destroy(serviceHandle); + notification_status_message_post(WRT_POP_STARTING_DOWNLOADING); return; } else if (PKG_NAME_VIDEO_PLAYER == pkgName) { bool isRunning = false; if (APP_MANAGER_ERROR_NONE != app_manager_is_running(PKG_NAME_VT_MAIN.c_str(), &isRunning)) { - LogError("Fail to get app running information"); + _E("Fail to get app running information"); return; } if (true == isRunning) { - LogError("video-call is running"); + _E("video-call is running"); return; } @@ -155,21 +171,20 @@ void ApplicationLauncher::OnEventReceived( const char* url; if ("null" == scheme) { - LogError("scheme is empty"); + _E("scheme is empty"); return; } if ("null" == uri) { - LogError("uri is empty"); + _E("uri is empty"); return; } - LogDebug("scheme: " << scheme); if (SCHEME_TYPE_RTSP == scheme || SCHEME_TYPE_HTML5_VIDEO == scheme) { url = uri.c_str(); } else { - LogError("scheme is invalid!!"); + _E("scheme is invalid!!"); return; } @@ -179,13 +194,13 @@ void ApplicationLauncher::OnEventReceived( // create service ret = service_create(&serviceHandle); if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) { - LogError("Fail to create service"); + _E("Fail to create service"); return; } // set url if (!url || strlen(url) == 0) { - LogError("Fail to get url"); + _E("Fail to get url"); service_destroy(serviceHandle); return; } @@ -193,7 +208,7 @@ void ApplicationLauncher::OnEventReceived( SERVICE_EXTRA_DATA_KEY_PATH, url); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to set url [" << ret << "]"); + _E("Fail to set url [%d]", ret); service_destroy(serviceHandle); return; } @@ -205,7 +220,7 @@ void ApplicationLauncher::OnEventReceived( SERVICE_EXTRA_DATA_KEY_COOKIE, cookie.c_str()); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to add cookie [" << ret << "]"); + _E("Fail to add cookie [%d]", ret); service_destroy(serviceHandle); return; } @@ -215,7 +230,7 @@ void ApplicationLauncher::OnEventReceived( // set package ret = service_set_package(serviceHandle, PKG_NAME_VIDEO_PLAYER.c_str()); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to set package [" << ret << "]"); + _E("Fail to set package service [%d]", ret); service_destroy(serviceHandle); return; } @@ -228,20 +243,22 @@ void ApplicationLauncher::OnEventReceived( //launch service ret = service_send_launch_request(serviceHandle, NULL, NULL); if (SERVICE_ERROR_NONE != ret) { - LogError("Fail to launch service [" << ret << "]"); + _E("Fail to launch service [%d]", ret); service_destroy(serviceHandle); return; } - - LogDebug("Success launch " << PKG_NAME_VIDEO_PLAYER); service_destroy(serviceHandle); return; + } else { + _E("Not implemented application : ", pkgName.c_str()); } + + _D("Success to launch application : ", pkgName.c_str()); + return; } void ApplicationLauncher::setWidgetTizenId(const std::string& tizenId) { - LogDebug("tizen id: " << tizenId); m_tizenId = tizenId; } diff --git a/src/view/common/application_launcher.h b/src/view/common/application_launcher.h index eaf58c1..eb1807b 100644 --- a/src/view/common/application_launcher.h +++ b/src/view/common/application_launcher.h @@ -27,7 +27,6 @@ #include #include #include -#include #include diff --git a/src/view/common/scheme.cpp b/src/view/common/scheme.cpp index a974414..16cc335 100644 --- a/src/view/common/scheme.cpp +++ b/src/view/common/scheme.cpp @@ -46,10 +46,10 @@ typedef std::map SchemeMap; SchemeMap PopulateMap() { - LogInfo("Populating scheme map..."); + LogDebug("Populating scheme map..."); SchemeMap map; for (size_t st = Scheme::FILE; st < Scheme::COUNT; ++st) { - LogInfo(" * " << type2name[st] << "->" << st); + LogDebug(" * " << type2name[st] << "->" << st); map[type2name[st]] = static_cast(st); } return map; diff --git a/src/view/common/scheme_action_map.cpp b/src/view/common/scheme_action_map.cpp index 77ca39d..bf3b643 100644 --- a/src/view/common/scheme_action_map.cpp +++ b/src/view/common/scheme_action_map.cpp @@ -184,6 +184,7 @@ ServiceOperationMap initializeAppSvcOperations() ServiceOperation telOp; telOp.operation = SERVICE_OPERATION_CALL; telOp.fakeUri = NULL; + telOp.mime = NULL; ret.insert(std::make_pair(Scheme::TEL, telOp)); return ret; @@ -387,7 +388,7 @@ bool HandleUri(const char* uri, // convert scheme text to appsvc format while (cit->regex->Consume(&input, &match)) { - LogInfo("Adding apssvc data: " << cit->key << " " << match); + LogDebug("Adding apssvc data: " << cit->key << " " << match); service_add_extra_data(serviceHandle, cit->key, match.c_str()); } } diff --git a/src/view/common/view_logic_apps_support.cpp b/src/view/common/view_logic_apps_support.cpp index 6b66482..fdf502c 100644 --- a/src/view/common/view_logic_apps_support.cpp +++ b/src/view/common/view_logic_apps_support.cpp @@ -58,7 +58,7 @@ class AppsSupportImplementation bool httpMultimediaRequest(std::string mimeType, std::string uri) { - LogInfo("httpMultimediaRequest called"); + LogDebug("httpMultimediaRequest called"); if ("null" == mimeType || "null" == uri) { LogError("uri/mimeType is null"); @@ -78,7 +78,7 @@ class AppsSupportImplementation service_set_mime(serviceHandle, mimeType.c_str()); service_set_uri(serviceHandle, uri.c_str()); } else { - LogInfo("Not Supported MIME type in WRT"); + LogDebug("Not Supported MIME type in WRT"); service_destroy(serviceHandle); return false; } @@ -226,7 +226,7 @@ class AppsSupportImplementation void localUriRequest(std::string filePath) { - LogInfo("file path = [" << filePath << "]"); + LogDebug("file path = [" << filePath << "]"); // verify request file path if (isFileExist(filePath, false) == false) { @@ -305,7 +305,7 @@ class AppsSupportImplementation const char *mimeType, const char *userParam) { - LogInfo("Download info : " << url << "(" << + LogDebug("Download info : " << url << "(" << mimeType << ", " << userParam << ")"); // separate local & host scheme @@ -319,7 +319,7 @@ class AppsSupportImplementation return; } if (std::string(iri->scheme) == SCHEM_FILE) { - LogInfo("copy to Download directory"); + LogDebug("copy to Download directory"); if (!iri->path) { LogError("file path is empty"); return; @@ -334,7 +334,7 @@ class AppsSupportImplementation url ? std::string(url) : "null"); if (isAppServiceable) { - LogInfo("Application Service start"); + LogDebug("Application Service start"); return; } @@ -349,7 +349,7 @@ class AppsSupportImplementation void html5VideoRequest(void* event_info) { - LogInfo("html5VideoRequestCallback called"); + LogDebug("html5VideoRequestCallback called"); Assert(event_info); HTML5Video* video = static_cast(event_info); diff --git a/src/view/common/view_logic_certificate_support.cpp b/src/view/common/view_logic_certificate_support.cpp index 4207629..63ee8c8 100644 --- a/src/view/common/view_logic_certificate_support.cpp +++ b/src/view/common/view_logic_certificate_support.cpp @@ -33,9 +33,6 @@ #include namespace ViewModule { -namespace { -const char* const DAEMON_EDJ_PATH = "/usr/share/edje/wrt/Daemon.edj"; -} class CertificateSupportImplementation { @@ -106,7 +103,7 @@ Evas_Object* CertificateSupportUtil::createPopup( evas_object_show(label); Evas_Object* layout = elm_layout_add(popup); - elm_layout_file_set(layout, DAEMON_EDJ_PATH, "popupWithCheck"); + elm_layout_file_set(layout, WRT_EDJ_PATH, "popupWithCheck"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); Evas_Object* check = elm_check_add(popup); diff --git a/src/view/common/view_logic_security_origin_support.cpp b/src/view/common/view_logic_security_origin_support.cpp index ff82eb4..8ef40ed 100644 --- a/src/view/common/view_logic_security_origin_support.cpp +++ b/src/view/common/view_logic_security_origin_support.cpp @@ -33,9 +33,6 @@ #include namespace ViewModule { -namespace { -const char* const DAEMON_EDJ_PATH = "/usr/share/edje/wrt/Daemon.edj"; -} class SecurityOriginSupportImplementation { @@ -106,7 +103,7 @@ Evas_Object* SecurityOriginSupportUtil::createPopup( evas_object_show(label); Evas_Object* layout = elm_layout_add(popup); - elm_layout_file_set(layout, DAEMON_EDJ_PATH, "popupWithCheck"); + elm_layout_file_set(layout, WRT_EDJ_PATH, "popupWithCheck"); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); Evas_Object* check = elm_check_add(popup); @@ -153,7 +150,7 @@ Evas_Object* SecurityOriginSupportUtil::getCheck(Evas_Object* popup) } Evas_Object* check = elm_object_part_content_get( elm_object_content_get(popup), - "elm.swallow.end"); + "elm.swallow.checkbox"); return check; } diff --git a/src/view/webkit/view_logic_service_support.cpp b/src/view/common/view_logic_service_support.cpp similarity index 100% rename from src/view/webkit/view_logic_service_support.cpp rename to src/view/common/view_logic_service_support.cpp diff --git a/src/view/webkit/view_logic_service_support.h b/src/view/common/view_logic_service_support.h similarity index 100% rename from src/view/webkit/view_logic_service_support.h rename to src/view/common/view_logic_service_support.h diff --git a/src/view/common/view_logic_uri_support.cpp b/src/view/common/view_logic_uri_support.cpp index e30d300..93db761 100644 --- a/src/view/common/view_logic_uri_support.cpp +++ b/src/view/common/view_logic_uri_support.cpp @@ -371,9 +371,9 @@ std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri) bundle *originBundle = ApplicationDataSingleton::Instance().getBundle(); // search app-control data startUri = getAppControlUri(originBundle, widgetModel).c_str(); - LogInfo("app-control start uri is " << startUri); + LogDebug("app-control start uri is " << startUri); if (startUri == "") { - LogInfo("app-control data doesn't have matched data"); + LogDebug("app-control data doesn't have matched data"); startUri = defaultUri; } diff --git a/src/view/context_manager.cpp b/src/view/context_manager.cpp new file mode 100644 index 0000000..6465bf7 --- /dev/null +++ b/src/view/context_manager.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file context_manager.cpp + * @author Andrzej Surdej (a.surdej@samsung.com) + * @version 1.0 + * @brief context getter function implementation + */ + +#include "i_context_manager.h" +#include + +namespace ViewModule { + +ContextManagerPtr contextManagerFactoryMethod( + const std::string& id, + Ewk_Context* c, + IViewModulePtr view) +{ + ContextManagerPtr ptr (new EwkContextManager(id, c, view)); + return ptr; +} + +ContextManagerFactoryMethod makeContextManagerFactoryMethod() +{ + return contextManagerFactoryMethod; +} + +} // namespace ViewModule diff --git a/src/api_new/abstract_context_manager.h b/src/view/i_context_manager.h similarity index 78% rename from src/api_new/abstract_context_manager.h rename to src/view/i_context_manager.h index 555eb86..5417212 100644 --- a/src/api_new/abstract_context_manager.h +++ b/src/view/i_context_manager.h @@ -14,7 +14,7 @@ * limitations under the License. */ /** - * @file abstract_context_manager.h + * @file i_context_manager.h * @author Iwanek Tomasz (t.iwanek@samsung.com) * @version 0.1 * @brief Abstract file for handling operation regarding Ewk_Context. @@ -25,13 +25,14 @@ #include #include -#include #include -namespace WRT { +class Ewk_Context; // forward declaration of context type -class AbstractContextManager; -typedef std::shared_ptr ContextManagerPtr; +namespace ViewModule { + +class IContextManager; +typedef std::shared_ptr ContextManagerPtr; typedef std::function ContextManagerFactoryMethod; @@ -48,14 +49,14 @@ typedef std::function ContextManagerPtr contextManagerFactoryMethod(const std::string& id, Ewk_Context* c, ViewModule::IViewModulePtr view) -{ - return ContextManagerPtr( new T(id, c, view) ); -} +ContextManagerPtr contextManagerFactoryMethod(const std::string& id, Ewk_Context* c, IViewModulePtr view); -template ContextManagerFactoryMethod makeContextManagerFactoryMethod() -{ - return contextManagerFactoryMethod; -} +ContextManagerFactoryMethod makeContextManagerFactoryMethod(); -} +} // namespace ViewModule #endif // ABSTRACT_CONTEXT_MANAGER_H diff --git a/src/view/webkit/CMakeLists.txt b/src/view/webkit/CMakeLists.txt index 7a1a6be..eacfeb8 100644 --- a/src/view/webkit/CMakeLists.txt +++ b/src/view/webkit/CMakeLists.txt @@ -48,6 +48,7 @@ PKG_CHECK_MODULES(SYS_VIEW_MODULE_DEP ) SET(VIEW_MODULE_SOURCES + ${PROJECT_SOURCE_DIR}/src/view/webkit/ewk_context_manager.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_authentication_challenge_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_certificate_confirm_support.cpp @@ -55,7 +56,6 @@ SET(VIEW_MODULE_SOURCES ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_message_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_orientation_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp - ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_service_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_usermedia_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_notification_support.cpp ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_storage_support.cpp @@ -64,16 +64,11 @@ SET(VIEW_MODULE_SOURCES SET(VIEW_MODULE_INCLUDES ${PROJECT_SOURCE_DIR}/src/api_new - ${PROJECT_SOURCE_DIR}/src/common ${PROJECT_SOURCE_DIR}/src/domain - ${PROJECT_SOURCE_DIR}/src/global_logic - ${PROJECT_SOURCE_DIR}/src/popup-process ${PROJECT_SOURCE_DIR}/src/profiling - ${PROJECT_SOURCE_DIR}/src/utils ${PROJECT_SOURCE_DIR}/src/view ${PROJECT_SOURCE_DIR}/src/view/webkit ${PROJECT_SOURCE_DIR}/src/plugin-service - ${PROJECT_SOURCE_DIR}/src/plugin-service/plugin-loading ${VIEW_MODULE_DEP_INCLUDE_DIRS} ) @@ -86,9 +81,11 @@ ADD_LIBRARY(${TARGET_VIEW_MODULE_LIB} STATIC ${VIEW_MODULE_SOURCES} ) -TARGET_LINK_LIBRARIES(${TARGET_VIEW_MODULE_LIB} - ${VIEW_COMMON_LIB_STATIC} +TARGET_LINK_LIBRARIES( + ${TARGET_VIEW_MODULE_LIB} + ${TARGET_VIEW_COMMON_LIB_STATIC} ${VIEW_MODULE_DEP_LIBRARIES} + ${TARGET_WRT_ENGINE_STATIC} ${PROF_LIB} # ${TARGET_PLUGIN_MODULE_LIB} ) diff --git a/src/api_new/ewk_context_manager.cpp b/src/view/webkit/ewk_context_manager.cpp similarity index 87% rename from src/api_new/ewk_context_manager.cpp rename to src/view/webkit/ewk_context_manager.cpp index 3884276..971b60a 100644 --- a/src/api_new/ewk_context_manager.cpp +++ b/src/view/webkit/ewk_context_manager.cpp @@ -35,15 +35,15 @@ #include #include "ewk_context_manager.h" -namespace WRT { +namespace ViewModule { static const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so"); EwkContextManager::EwkContextManager( const std::string& tizenAppId, Ewk_Context* ewkContext, - ViewModule::IViewModulePtr viewModule) - : AbstractContextManager(tizenAppId, ewkContext, viewModule), + IViewModulePtr viewModule) + : IContextManager(tizenAppId, ewkContext, viewModule), m_initialized(false), m_isInternalContext(false) { if (!initialize()) { @@ -92,7 +92,7 @@ bool EwkContextManager::initialize() // proxy server setting setNetworkProxy(); - LogInfo("ewk_context_certificate_file_set() was called."); + LogDebug("ewk_context_certificate_file_set() was called."); const char* caCertPath = cert_svc_get_certificate_crt_file_path(); if (caCertPath) { ewk_context_certificate_file_set(m_ewkContext, caCertPath); @@ -100,12 +100,6 @@ bool EwkContextManager::initialize() LogError("cert path is null"); } - // set local stroage database path - WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId)); - ewk_context_web_storage_path_set( - m_ewkContext, - dao.getPrivateLocalStoragePath().c_str()); - ewk_context_tizen_extensible_api_set( m_ewkContext, EWK_EXTENSIBLE_API_MEDIA_STREAM_RECORD, @@ -119,25 +113,50 @@ bool EwkContextManager::initialize() EWK_EXTENSIBLE_API_MEDIA_VOLUME_CONTROL, EINA_TRUE); + + // web application dependent settings + WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId)); + ewk_context_web_storage_path_set( + m_ewkContext, + dao.getPrivateLocalStoragePath().c_str()); + setAutoFullscreenMode(); - setBackgroundSupport(); #ifdef CSP_ENABLED if (dao.getSecurityModelVersion() == WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V2) { - setCSPSupport(); + ewk_context_tizen_extensible_api_set(m_ewkContext, + EWK_EXTENSIBLE_API_CSP, + EINA_TRUE); } #endif + // WidgetSettingList dependent settings + WrtDB::WidgetSettings widgetSettings; + dao.getWidgetSettings(widgetSettings); + WidgetSettingList settings(widgetSettings); + + ewk_context_tizen_extensible_api_set( + m_ewkContext, + EWK_EXTENSIBLE_API_BACKGROUND_MUSIC, + settings.getBackgroundSupport() == BackgroundSupport_Enable ? + EINA_TRUE : EINA_FALSE); + // Disable in the RSA + //ewk_context_tizen_extensible_api_set( + // m_ewkContext, + // EWK_EXTENSIBLE_API_SOUND_MODE, + // settings.getSoundMode() == SoundMode_Exclusive ? + // EINA_TRUE : EINA_FALSE); + // ewk storage_path set ewk_context_storage_path_reset(m_ewkContext); std::string pluginsPath = - WrtDB::WidgetConfig::GetWidgetNPRuntimePluginsPath( - dao.getTizenPkgId()); + WrtDB::WidgetConfig::GetWidgetNPRuntimePluginsPath( + dao.getTizenPkgId()); // npruntime plugins path set - LogInfo("ewk_context_additional_plugin_path_set() : " << pluginsPath); + LogDebug("ewk_context_additional_plugin_path_set() : " << pluginsPath); ewk_context_additional_plugin_path_set(m_ewkContext, pluginsPath.c_str()); @@ -223,39 +242,6 @@ void EwkContextManager::setAutoFullscreenMode() fullscreen); } -void EwkContextManager::setBackgroundSupport() -{ - WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId)); - if(!m_ewkContext) { - return; - } - - WrtDB::WidgetSettings widgetSettings; - dao.getWidgetSettings(widgetSettings); - WidgetSettingList settings(widgetSettings); - bool backgroundSupport = false; - if(settings.getBackgroundSupport() == BackgroundSupport_Enable) { - backgroundSupport = true; - } - ewk_context_tizen_extensible_api_set( - m_ewkContext, - EWK_EXTENSIBLE_API_BACKGROUND_MUSIC, - backgroundSupport); -} - -void EwkContextManager::setCSPSupport() -{ - if(!m_ewkContext) { - return; - } - - WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId)); - LogInfo("Setting CSP default policy"); - ewk_context_tizen_extensible_api_set(m_ewkContext, - EWK_EXTENSIBLE_API_CSP, - true); -} - void EwkContextManager::setNetworkProxy() { Assert(m_ewkContext); @@ -273,10 +259,10 @@ void EwkContextManager::setNetworkProxy() char* proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY); if (proxy && strlen(proxy) && strcmp(proxy, "0.0.0.0")) { - LogInfo("proxy address: " << proxy); + LogDebug("proxy address: " << proxy); ewk_context_proxy_uri_set(m_ewkContext, proxy); } else { - LogInfo("proxy address is empty"); + LogDebug("proxy address is empty"); ewk_context_proxy_uri_set(m_ewkContext, NULL); } } @@ -356,5 +342,4 @@ ContextManagerPtr createEwkContextManager( return ContextManagerPtr(new EwkContextManager(tizenAppId, ewkContext, viewModule)); } -} - +} // namespace ViewModule diff --git a/src/api_new/ewk_context_manager.h b/src/view/webkit/ewk_context_manager.h similarity index 92% rename from src/api_new/ewk_context_manager.h rename to src/view/webkit/ewk_context_manager.h index 444c0f7..5903d0d 100644 --- a/src/api_new/ewk_context_manager.h +++ b/src/view/webkit/ewk_context_manager.h @@ -25,11 +25,11 @@ #define EWK_CONTEXT_MANAGER_H #include -#include +#include -namespace WRT { +namespace ViewModule { -class EwkContextManager : public AbstractContextManager { +class EwkContextManager : public IContextManager { public: EwkContextManager( const std::string& tizenAppId, @@ -45,8 +45,6 @@ class EwkContextManager : public AbstractContextManager { void setCallbacks(); void unsetCallbacks(); void setAutoFullscreenMode(); - void setBackgroundSupport(); - void setCSPSupport(); void setNetworkProxy(); // ewk context callback functions @@ -66,7 +64,6 @@ class EwkContextManager : public AbstractContextManager { bool m_initialized; bool m_isInternalContext; }; - -} +} // namespace ViewModule #endif // EWK_CONTEXT_MANAGER_H diff --git a/src/view/webkit/injected-bundle/CMakeLists.txt b/src/view/webkit/injected-bundle/CMakeLists.txt index bf19c61..baf7d14 100644 --- a/src/view/webkit/injected-bundle/CMakeLists.txt +++ b/src/view/webkit/injected-bundle/CMakeLists.txt @@ -46,6 +46,7 @@ SET(INJECTED_BUNDLE_INCLUDES ${INJECTED_BUNDLE_DEP_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/plugin-service ${PROJECT_SOURCE_DIR}/src/view/common + ${PROJECT_SOURCE_DIR}/src/domain ) ADD_DEFINITIONS(${INJECTED_BUNDLE_DEP_CFLAGS}) diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp index 09680b2..a0b4ad4 100644 --- a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp +++ b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp @@ -32,13 +32,14 @@ #include #include -#include #include #include #include #include #include +#include + namespace InjectedBundle { namespace { const char * const SCHEME_FILE_SLASH = "file://"; @@ -103,7 +104,7 @@ class DecryptionSupportImplementation FILE* fp = fopen(filePath.c_str(), "rb"); if (NULL == fp) { - LogDebug("Couldnot open file : " << filePath); + _E("Couldnot open file : %s", filePath.c_str()); return std::string(); } @@ -129,7 +130,7 @@ class DecryptionSupportImplementation int outSize = 0; if (0 != ssmDecrypt(pkgid, (char*)inChunk.get(), (int)decReadSize, &outChunk, &outSize)) { - LogError("Failed to get decrypted resource"); + _E("Failed to get decrypted resource"); fclose(fp); return std::string(); } @@ -140,7 +141,7 @@ class DecryptionSupportImplementation } while( 0 == std::feof(fp)); fclose(fp); memset(DecryptedString.get() + size, '\n', fileSize - size); - LogDebug("resource need to encoding base64"); + BIO *bmem, *b64; BUF_MEM *bptr; @@ -169,14 +170,14 @@ class DecryptionSupportImplementation void initialize(WrtDB::TizenAppId appId) { - LogInfo("initialize"); + _D("called"); m_appId = appId; WrtDB::WidgetDAOReadOnly dao(m_appId); dao.getEncryptedFileList(m_encryptedFiles); if (!m_encryptedFiles.empty()) { m_isEncrypted = true; - LogDebug("encrypted application"); + _D("encrypted application"); } m_pkgId = dao.getTzPkgId(); @@ -185,7 +186,7 @@ class DecryptionSupportImplementation std::string preloadPath(WrtDB::GlobalConfig::GetUserPreloadedWidgetPath()); if (0 == installedPath.compare(0, preloadPath.length(), preloadPath)) { m_isPreload = true; - LogDebug("preload application"); + _D("preload application"); } m_initialized = true; @@ -193,7 +194,7 @@ class DecryptionSupportImplementation void deinitialize(void) { - LogInfo("deinitialize"); + _D("called"); m_encryptedFiles.clear(); m_targetIt = m_encryptedFiles.end(); @@ -205,7 +206,7 @@ class DecryptionSupportImplementation bool isNeedDecryption(std::string url) { if (!m_initialized) { - LogInfo("not initialize"); + _E("not initialized"); return false; } @@ -218,8 +219,8 @@ class DecryptionSupportImplementation std::string filePath = getFilePath(url); info.fileName = DPL::FromUTF8String(filePath); if (m_encryptedFiles.end() != (it = m_encryptedFiles.find(info))) { - LogDebug(" info file name : " << it->fileName); - LogDebug(" info file size : " << it->fileSize); + _D(" info file name : %s", DPL::ToUTF8String(it->fileName).c_str()); + _D(" info file size : %d", it->fileSize); m_targetIt = it; return true; } @@ -229,7 +230,7 @@ class DecryptionSupportImplementation std::string decryptResource(std::string url) { if (!m_initialized) { - LogInfo("not initialize"); + _E("not initialized"); return std::string(); } diff --git a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp index b2ea952..567f1f7 100644 --- a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp +++ b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp @@ -20,7 +20,7 @@ */ #include "injected_bundle_uri_handling.h" -#include +#include #include #include #include @@ -41,10 +41,6 @@ #include // WhiteList check #include -// WKBundle API (i.e. message sending) -#include -#include -#include namespace { char const * const SCHEME_TYPE_FILE = "file"; @@ -119,7 +115,6 @@ bool checkWARP(const char *url, const DPL::String& tizenId) bool checkWhitelist(const char *url) { - LogInfo("Check WhiteList"); if (url == NULL) { return true; } @@ -132,7 +127,6 @@ bool checkWhitelist(const char *url) std::string host = iri->host; if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) { - LogDebug("url doesn't need to check white list"); return true; } @@ -154,7 +148,6 @@ bool checkAllowNavigation(const char *url, const DPL::String& tizenId) std::string host = iri->host; if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) { - LogDebug("url doesn't need to check allow-navigation"); return true; } @@ -169,7 +162,7 @@ bool checkAllowNavigation(const char *url, const DPL::String& tizenId) return true; } } - LogDebug("deny"); + _E("deny"); return false; } @@ -179,6 +172,7 @@ bool preventSymlink(const std::string & url) { return true; } + if(url.size() >= strlen(SCHEME_TYPE_FILE) + 3) { std::string file = url.substr(strlen(SCHEME_TYPE_FILE) + 3); @@ -236,11 +230,9 @@ bool checkACE(const char* url, bool xhr, const DPL::String& tizenId) ace_bool_t result = ACE_FALSE; - LogDebug("Making ace check with new C-API"); - ace_return_t ret = ace_check_access(&aceRequest, &result); - LogDebug("Result is: " << static_cast(result)); + _D("Result is: %d", static_cast(result)); delete[] aceRequest.dev_cap_list.items[0].param_list.items; delete[] aceRequest.dev_cap_list.items; @@ -256,21 +248,17 @@ bool processURI(const std::string& inputURI, { if (version == WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1) { - if (!checkWARP(inputURI.c_str(), tizenId)) - { - LogWarning("Request was blocked by WARP: " << inputURI); - + if (!checkWARP(inputURI.c_str(), tizenId)) { + _E("Request was blocked by WARP: %s", inputURI.c_str()); return false; } } -// disable for performance -#if 0 - if (!preventSymlink(uri)) { - LogWarning("Request for symlink is invalid: " << uri); - return false; - } -#endif + // disable for performance + // if (!preventSymlink(inputURI)) { + // LogWarning("Request for symlink is invalid: " << inputURI); + // return false; + //} return true; } @@ -281,29 +269,12 @@ bool processURI(const DPL::String& inputURI, { DPL::Optional optionalUri(inputURI); if (optionalUri.IsNull()) { - LogDebug("uri is empty"); + _D("uri is empty"); return true; } std::string uri = DPL::ToUTF8String(inputURI); - if (version == - WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1) - { - if (!checkWARP(uri.c_str(), tizenId)) { - LogWarning("Request was blocked by WARP: " << uri); - return false; - } - } - -// disable for performance -#if 0 - if (!preventSymlink(uri)) { - LogWarning("Request for symlink is invalid: " << uri); - return false; - } -#endif - - return true; + return processURI(uri, tizenId, version); } bool processMainResource(const DPL::String& inputURI, @@ -312,7 +283,7 @@ bool processMainResource(const DPL::String& inputURI, { DPL::Optional optionalUri(inputURI); if (optionalUri.IsNull()) { - LogDebug("uri is empty"); + _D("uri is empty"); return true; } @@ -321,7 +292,7 @@ bool processMainResource(const DPL::String& inputURI, WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1) { if (!checkWARP(uri.c_str(), tizenId)) { - LogWarning("Request was blocked by WARP: " << uri); + _E("Request was blocked by WARP: %s", uri.c_str()); return false; } } else if (version == @@ -329,7 +300,7 @@ bool processMainResource(const DPL::String& inputURI, { #ifdef ALLOW_NAVIGATION_ENABLED if (!checkAllowNavigation(uri.c_str(), tizenId)) { - LogWarning("Request was blocked by WARP: " << uri); + _E("Request was blocked by allow-navigation: %s", uri.c_str()); return false; } #else @@ -337,14 +308,11 @@ bool processMainResource(const DPL::String& inputURI, #endif } -// disable for performance -#if 0 - if (!preventSymlink(uri)) { - LogWarning("Request for symlink is invalid: " << uri); - return false; - } -#endif - + // disable for performance + // if (!preventSymlink(uri)) { + // LogWarning("Request for symlink is invalid: " << uri); + // return false; + // } return true; } @@ -362,17 +330,15 @@ std::string localizeURI(const std::string& inputURI, const std::string& tizenId) inputURI.compare(0, strlen(SCHEME_TYPE_FILE), SCHEME_TYPE_FILE) && inputURI.compare(0, strlen(SCHEME_TYPE_APP), SCHEME_TYPE_APP)) { + _D("scheme doesn't need to localize"); return inputURI; } std::string localizedURI = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(tizenId, inputURI); - if (localizedURI.empty()) - { + if (localizedURI.empty()) { return inputURI; - } - else - { + } else { return std::string("file://") + localizedURI; } } @@ -381,12 +347,10 @@ DPL::OptionalString localizeURI(const DPL::String& inputURI, const DPL::String& tizenId) { std::string uri = DPL::ToUTF8String(inputURI); - LogDebug("localizing url: " << uri); - auto urlcstr = uri.c_str(); + const char* urlcstr = uri.c_str(); const char *end = strstr(urlcstr, ":"); if (!end) { - LogDebug("no schema in link, return null"); - // lack of schema + _W("no schema in link, return null"); return DPL::Optional::Null; } std::string scheme(urlcstr, end); @@ -396,7 +360,7 @@ DPL::OptionalString localizeURI(const DPL::String& inputURI, #else if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE) { #endif - LogDebug("scheme doesn't need to localize"); + _D("scheme doesn't need to localize"); return DPL::OptionalString(inputURI); } @@ -407,13 +371,11 @@ DPL::OptionalString localizeURI(const DPL::String& inputURI, if (found.IsNull()) { // In this case, path doesn't need to localize. return input uri - LogDebug("Path not found within current locale in current widget"); - + _W("Path not found within current locale in current widget"); return DPL::OptionalString(inputURI); } else { DPL::String uri(L"file://" + *found); - LogDebug("Will load resource: " << uri); - LogDebug("finished"); + _D("Will load resource: %s", DPL::ToUTF8String(uri).c_str()); return DPL::OptionalString(uri); } } diff --git a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h index f7705b9..b981c3d 100644 --- a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h +++ b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h @@ -24,8 +24,6 @@ #include #include #include -// WKBundleRef type -#include namespace InjectedBundleURIHandling { bool processURI(const DPL::String& inputURI, diff --git a/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp b/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp index 0d94b13..a0a7b7b 100644 --- a/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp +++ b/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -103,13 +103,13 @@ class ViewmodesSupportImplementation void initialize(WKBundlePageRef page) { - LogInfo("initialize"); + _D("initialize"); if (!m_initialized) { Assert(false); } if (isExisted(page)) { - LogError("This page is already initialized"); + _W("This page is already initialized"); return; } @@ -138,7 +138,7 @@ class ViewmodesSupportImplementation void deinitialize(WKBundlePageRef page) { - LogInfo("deinitialize"); + _D("deinitialize"); if (!m_initialized) { Assert(false); } @@ -160,12 +160,12 @@ class ViewmodesSupportImplementation void enterViewmodesAllPages(const std::string& mode) { - LogInfo("setViewmodesAllPages"); + _D("setViewmodesAllPages"); if (!m_initialized) { Assert(false); } if (!isSupportViewmode(mode)) { - LogError("Wrong viewmode : " << mode); + _W("Wrong viewmode : %s", mode.c_str()); return; } @@ -189,7 +189,7 @@ class ViewmodesSupportImplementation void exitViewmodesAllPages(void) { - LogInfo("exitViewmodesAllPages"); + _D("exitViewmodesAllPages"); if (!m_initialized) { Assert(false); } diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp index b0252f4..bd3025a 100644 --- a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp +++ b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include @@ -76,19 +76,20 @@ #include "injected_bundle_viewmodes_support.h" namespace { -const char * const SCHEME_HTTP = "http"; -const char * const SCHEME_HTTPS = "https"; -const char * const SCHEME_FILE = "file"; -const char * const SCHEME_FILE_SLASH = "file://"; -const char * const SCHEME_BOX_SLASH = "box://"; -const char * const BLANK_PAGE_URL = "about:blank"; -const char * const HTML_MIME = "text/html"; -const char * const PHP_MIME = "application/x-php"; +const char SCHEME_HTTP[] = "http"; +const char SCHEME_HTTPS[] = "https"; +const char SCHEME_FILE[] = "file"; +const char SCHEME_FILE_SLASH[] = "file://"; +const char SCHEME_BOX_SLASH[] = "box://"; +const char BLANK_PAGE_URL[] = "about:blank"; +const char HTML_MIME[] = "text/html"; +const char PHP_MIME[] = "application/x-php"; +const char WRT_WILL_SEND_REQUEST_LOG_ENABLE[] = "WRT_WILL_SEND_REQUEST_LOG_ENABLE"; const std::size_t FILE_BUF_MAX_SIZE = 1024; // bytes const std::size_t PLAIN_CHUNK_SIZE = 1008; // bytes const unsigned int UID_ROOT = 0; const unsigned int DEFAULT_PRIORITY = 0; -const char * const PRIVILEGE_APP_TYPE = "wgt"; +const char PRIVILEGE_APP_TYPE[] = "wgt"; #ifdef CORS_WHITELISTING_ENABLED const char * const warpAllowProtocolsForWildcard[] = { "http", "https" }; #endif @@ -100,7 +101,6 @@ Bundle::Bundle(WKBundleRef bundle) : m_encodedBundle(""), m_theme(""), m_willRemoveContext(NULL), - m_widgetType(WrtDB::APP_TYPE_UNKNOWN), m_securityModelVersion( WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1), m_initialized(false), @@ -156,7 +156,7 @@ void Bundle::willDestroyPageCallback( WKBundlePageRef page, const void* clientInfo) { - Bundle* This = static_cast(const_cast(clientInfo)); + Bundle* This = static_cast(const_cast(clientInfo)); This->willDestroyPage(page); } @@ -483,8 +483,6 @@ void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody) _D("Locale: %s", DPL::ToUTF8String(*it).c_str()); } - m_widgetType = dao.getWidgetType(); - _D("Preload PluginLogicSingleton"); PluginModule::init(WrtDB::WidgetDAOReadOnly::getHandle(m_widgetTizenId)); _D("Preload PluginLogicSingleton_end"); @@ -678,7 +676,7 @@ void Bundle::didCommitLoadForFrameCallback( _D("Previous context: %p", This->m_pageGlobalContext.getContextForPage(page)); PluginModule::stop(This->m_pageGlobalContext.getContextForPage(page)); } - LogDebug("New context: " << context); + _D("New context: %p", context); //note that since we need old context for unloading plugins it must be sotred //custom container take care of increamenting and decrementing references This->m_pageGlobalContext.insertContextForPage(page, context); @@ -772,7 +770,7 @@ WKBundlePagePolicyAction Bundle::decidePolicyForResponseCallback( WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request) { - static bool logEnable = (getenv("WRT_WILL_SEND_REQUEST_LOG_ENABLE") != NULL); + static bool logEnable = (getenv(WRT_WILL_SEND_REQUEST_LOG_ENABLE) != NULL); WKURLRef wkUrl = WKURLRequestCopyURL(request); WKStringRef wkStr = WKURLCopyString(wkUrl); @@ -785,6 +783,16 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request) if (logEnable){ _D("willSendRequestForFrame : %s", stdUrl.c_str()); } + std::string scheme = stdUrl.substr(0, stdUrl.find_first_of(':')); + +#ifdef APP_SCHEME_ENABLED + if (scheme == SCHEME_FILE) + { + _E("File schema blocked for: %s", stdUrl.c_str()); + return NULL; + } +#endif + localizedUrl = InjectedBundleURIHandling::localizeURI(stdUrl, DPL::ToUTF8String(m_widgetTizenId)); bool ret = InjectedBundleURIHandling::processURI(localizedUrl, m_widgetTizenId, m_securityModelVersion); @@ -795,14 +803,7 @@ WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request) // log disabled for performance //LogDebug("URI processing result: " << result); - std::string scheme = localizedUrl.substr(0, localizedUrl.find_first_of(':')); - -#ifdef APP_SCHEME_ENABLED - if (scheme == SCHEME_FILE) { - _D("File schema blocked for: %s", stdUrl.c_str()); - return NULL; - } -#endif + scheme = localizedUrl.substr(0, localizedUrl.find_first_of(':')); // Return value must contain details information of input // WKURLRequestRef. Current webkit2 doesn't support api that @@ -913,14 +914,7 @@ WKBundlePagePolicyAction Bundle::decidePolicyForAction( ctx = NEW_WINDOW; } - UriAction action; - if (m_widgetType == WrtDB::APP_TYPE_TIZENWEBAPP) { - action = g_tizenActionMap[type][ctx]; - } else { - _D("Unsupported application type: %d", type); - return WKBundlePagePolicyActionPassThrough; - } - + UriAction action = g_tizenActionMap[type][ctx]; _D("Scheme type: %d, Navigation context: %d, Action: %d", type, ctx, diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.h b/src/view/webkit/injected-bundle/wrt-injected-bundle.h index 41e4524..5d89fe0 100644 --- a/src/view/webkit/injected-bundle/wrt-injected-bundle.h +++ b/src/view/webkit/injected-bundle/wrt-injected-bundle.h @@ -82,7 +82,6 @@ class Bundle std::string m_theme; std::set m_loadedContext; JSGlobalContextRef m_willRemoveContext; - WrtDB::WidgetType m_widgetType; WrtDB::WidgetSecurityModelVersion m_securityModelVersion; bool m_initialized; diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 4a36af3..12261c7 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -35,12 +35,12 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include @@ -222,7 +222,7 @@ bool ViewLogic::createWebView(Ewk_Context* context, const char *theme = elm_theme_get(NULL); if (theme) { m_theme = theme; - LogInfo("theme is " << m_theme); + LogDebug("theme is " << m_theme); } // set members @@ -285,11 +285,6 @@ void ViewLogic::prepareView(WidgetModel* m, const std::string &startUrl) } #endif - if (m_model->SettingList.Get().getAccessibility() == Accessibility_Enable) - { - elm_access_object_register(m_currentEwkView, m_window); - } - ADD_PROFILING_POINT("initializeSupport", "start"); initializeSupport(); ADD_PROFILING_POINT("initializeSupport", "stop"); @@ -311,7 +306,7 @@ void ViewLogic::showWidget() LogError("Localized current URI doesn't exist"); return; } - LogInfo("url : " << url); + LogDebug("url : " << url); // load page ewk_view_url_set(m_currentEwkView, url.c_str()); @@ -324,17 +319,13 @@ void ViewLogic::showWidget() void ViewLogic::hideWidget() { LogDebug("hiding widget"); - if (m_model->SettingList.Get().getAccessibility() == Accessibility_Enable) - { - elm_access_object_unregister(m_currentEwkView); - } ViewModule::StorageSupport::deinitializeStorage(m_model); m_appsSupport->deinitialize(); m_vibrationSupport->deinitialize(); system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE); while (!m_ewkViewList.empty()) { - LogInfo("pop webview: " << m_ewkViewList.back()); + LogDebug("pop webview: " << m_ewkViewList.back()); removeEwkView(m_ewkViewList.back()); } m_ewkViewList.clear(); @@ -342,14 +333,21 @@ void ViewLogic::hideWidget() void ViewLogic::suspendWidget() { - LogInfo("Pausing widget"); + LogDebug("Pausing widget"); Assert(m_model); if (!m_currentEwkView) { LogWarning("Cannot suspend widget without view"); } else { setEwkViewInvisible(m_currentEwkView); + if (!m_isBackgroundSupport) { + FOREACH(it, m_ewkViewList) { + if (*it != m_currentEwkView) { + suspendWebkit(*it); + } + } + suspendWebkit(m_currentEwkView); } } @@ -362,12 +360,20 @@ void ViewLogic::suspendWidget() void ViewLogic::resumeWidget() { - LogInfo("Resume widget"); + LogDebug("Resume widget"); Assert(m_model); - if (m_currentEwkView) { + if (m_currentEwkView) + { setEwkViewVisible(m_currentEwkView); + if (!m_isBackgroundSupport) { + FOREACH(it, m_ewkViewList) { + if (*it != m_currentEwkView) { + resumeWebkit(*it); + } + } + resumeWebkit(m_currentEwkView); } } @@ -387,7 +393,7 @@ void ViewLogic::resumeWidget() void ViewLogic::resetWidget() { - LogInfo("Resetting Widget"); + LogDebug("Resetting Widget"); // handling case of WebProcess is locked if (m_isPopupReplyWait) { @@ -410,7 +416,7 @@ void ViewLogic::resetWidget() // reset web application // destory all webview while (!m_ewkViewList.empty()) { - LogInfo("pop webview: " << m_ewkViewList.back()); + LogDebug("pop webview: " << m_ewkViewList.back()); removeEwkView(m_ewkViewList.back()); } m_ewkViewList.clear(); @@ -446,11 +452,11 @@ void ViewLogic::backward() } else { if (1 >= m_ewkViewList.size()) { // If there is no previous page, widget move to backgroud. - LogInfo("Widget move to backgroud"); + LogDebug("Widget move to backgroud"); elm_win_lower(m_window); } else { // Back to previous webview - LogInfo("Widget move to previous webview"); + LogDebug("Widget move to previous webview"); m_closedEwkView = m_currentEwkView; ecore_idler_add(windowCloseIdlerCallback, this); } @@ -459,7 +465,7 @@ void ViewLogic::backward() void ViewLogic::reloadStartPage() { - LogInfo("Reload Start Page"); + LogDebug("Reload Start Page"); // prevent fail to load plugin bundle side m_isBackgroundReload = true; @@ -487,12 +493,12 @@ void ViewLogic::reloadStartPage() if (!m_cbs->bufferSet.empty()) { m_cbs->bufferSet(m_currentEwkView); } - LogInfo("Reloading Start Page is done!"); + LogDebug("Reloading Start Page is done!"); } Evas_Object* ViewLogic::getCurrentWebview() { - LogInfo("get current webview"); + LogDebug("get current webview"); return m_currentEwkView; } @@ -529,7 +535,7 @@ void ViewLogic::checkSyncMessageFromBundle( *returnData = strdup(ret.c_str()); } } else { - LogInfo("X window isn't exist"); + LogDebug("X window isn't exist"); } } } @@ -611,7 +617,7 @@ void ViewLogic::checkAsyncMessageFromBundle(const char* name, const char* body) void ViewLogic::downloadData(const char* url) { - LogInfo("enter"); + LogDebug("enter"); if (!url) { return; } @@ -620,7 +626,7 @@ void ViewLogic::downloadData(const char* url) void ViewLogic::activateVibration(bool on, uint64_t time) { - LogInfo("enter"); + LogDebug("enter"); if (on) { m_vibrationSupport->startVibration(static_cast(time)); } else { @@ -709,6 +715,11 @@ void ViewLogic::ewkClientInit(Evas_Object *wkView) EA_CALLBACK_MORE, eaKeyCallback, this); + // Always register access object even application doesn't support + // accessibility. In case of accessibility isn't supported, efl_assist + // shows warning message by syspopup. + // initScreenReaderSupport is related method. (window_data.cpp) + elm_access_object_register(wkView, m_window); } void ViewLogic::ewkClientDeinit(Evas_Object *wkView) @@ -737,6 +748,7 @@ void ViewLogic::ewkClientDeinit(Evas_Object *wkView) ecore_timer_del(m_orientationThresholdTimer); m_orientationThresholdTimer = NULL; } + elm_access_object_unregister(wkView); } bool ViewLogic::createEwkView(Evas* canvas) @@ -769,7 +781,7 @@ bool ViewLogic::createEwkView(Evas* canvas) setEwkViewInvisible(m_currentEwkView); } - LogInfo("push webview: " << newEwkView); + LogDebug("push webview: " << newEwkView); m_ewkViewList.push_back(newEwkView); m_currentEwkView = newEwkView; return true; @@ -823,11 +835,11 @@ void ViewLogic::prepareEwkView(Evas_Object *wkView) W3CFileLocalization::getStartFileInfo(m_model->TizenId); if (!fileInfo.IsNull()) { encoding = DPL::ToUTF8String((*fileInfo).encoding); - LogInfo("Found custom encoding in DB: " << encoding); + LogDebug("Found custom encoding in DB: " << encoding); } - LogInfo("Setting encoding: " << encoding); + LogDebug("Setting encoding: " << encoding); if (ewk_settings_default_encoding_set(settings,encoding.c_str())) { - LogInfo("Encoding set properly"); + LogDebug("Encoding set properly"); } else { LogError("Error while setting encoding"); } @@ -865,7 +877,7 @@ void ViewLogic::prepareEwkView(Evas_Object *wkView) void ViewLogic::removeEwkView(Evas_Object *wkView) { - LogInfo("removeEwkView called"); + LogDebug("removeEwkView called"); Assert(wkView); Assert(0 != m_ewkViewList.size()); @@ -878,36 +890,9 @@ void ViewLogic::removeEwkView(Evas_Object *wkView) m_ewkViewList.remove(wkView); } -void ViewLogic::resumeEwkView(Evas_Object *wkView) -{ - LogInfo("resumeEwkView called"); - Assert(wkView); - - // register webview callback - ewkClientInit(wkView); - - // resume webkit - resumeWebkit(wkView); - - return; -} - -void ViewLogic::suspendEwkView(Evas_Object *wkView) -{ - LogInfo("suspendEwkView called"); - Assert(wkView); - - // suspend webkit - suspendWebkit(wkView); - - // unregister webview callbacks - ewkClientDeinit(wkView); - return; -} - void ViewLogic::setEwkViewInvisible(Evas_Object *wkView) { - LogInfo("setEwkViewInvisible called"); + LogDebug("setEwkViewInvisible called"); Assert(wkView); ewk_view_page_visibility_state_set(wkView, @@ -918,7 +903,7 @@ void ViewLogic::setEwkViewInvisible(Evas_Object *wkView) void ViewLogic::setEwkViewVisible(Evas_Object *wkView) { - LogInfo("setEwkViewVisible called"); + LogDebug("setEwkViewVisible called"); Assert(wkView); ewk_view_page_visibility_state_set(wkView, @@ -929,7 +914,7 @@ void ViewLogic::setEwkViewVisible(Evas_Object *wkView) void ViewLogic::resumeWebkit(Evas_Object *wkView) { - LogDebug("resumeWebkit"); + LogDebug("resumeWebkit : " << wkView); Assert(wkView); ewk_view_resume(wkView); @@ -940,7 +925,7 @@ void ViewLogic::resumeWebkit(Evas_Object *wkView) void ViewLogic::suspendWebkit(Evas_Object *wkView) { - LogDebug("suspendWebkit"); + LogDebug("suspendWebkit : " << wkView); Assert(wkView); ewk_view_suspend(wkView); @@ -1082,7 +1067,7 @@ void ViewLogic::processCrashedCallback( Evas_Object* /*obj*/, void* eventInfo) { - LogInfo("processCrashedCallback"); + LogDebug("processCrashedCallback"); Assert(data); ViewLogic const * const view = static_cast(data); @@ -1208,7 +1193,7 @@ void ViewLogic::policyNavigationDecideCallback( * and the previous one is shown. This is not an elegant solution * but we don't have a better one. */ - LogInfo("Scheme has been handled externally. Removing empty view."); + LogDebug("Scheme has been handled externally. Removing empty view."); if (ewk_view_back_possible(This->m_currentEwkView)) { // go back to previous WKPage ewk_view_back(This->m_currentEwkView); @@ -1432,10 +1417,10 @@ void ViewLogic::notificationShowCallback( notiData->m_body = DPL::ToUTF8String(*string); } - LogInfo("notification id : " << notiData->m_id); - LogInfo("notification iconURL : " << notiData->m_iconURL); - LogInfo("notification title : " << notiData->m_title); - LogInfo("notification body : " << notiData->m_body); + LogDebug("notification id : " << notiData->m_id); + LogDebug("notification iconURL : " << notiData->m_iconURL); + LogDebug("notification title : " << notiData->m_title); + LogDebug("notification body : " << notiData->m_body); showWebNotification(notiData); ewk_notification_showed(This->m_ewkContext, ewk_notification_id_get(noti)); @@ -1528,32 +1513,39 @@ Eina_Bool ViewLogic::orientationLockCallback( // Fullscreen API callbacks void ViewLogic::enterFullscreenCallback( void* data, - Evas_Object* /*obj*/, - void* /*eventInfo*/) + Evas_Object* obj, + void* eventInfo) { - LogInfo("enterFullscreenCallback called"); + LogDebug("enterFullscreenCallback called"); Assert(data); ViewLogic* This = static_cast(data); ViewLogicMessageSupport::setViewmodes( This->m_ewkContext, "fullscreen"); - if (!This->m_cbs->toggleFullscreen.empty()) { - This->m_cbs->toggleFullscreen(true); + + bool isFullscreenByPlatform = false; + if (eventInfo) { + isFullscreenByPlatform = + (*static_cast(eventInfo) == EINA_TRUE); + } + if (!This->m_cbs->enterFullscreen.empty()) { + This->m_cbs->enterFullscreen(obj, isFullscreenByPlatform); } } + void ViewLogic::exitFullscreenCallback( void* data, - Evas_Object* /*obj*/, + Evas_Object* obj, void* /*eventInfo*/) { - LogInfo("exitFullscreenCallback called"); + LogDebug("exitFullscreenCallback called"); Assert(data); ViewLogic* This = static_cast(data); ViewLogicMessageSupport::setViewmodes( This->m_ewkContext, Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT); - if (!This->m_cbs->toggleFullscreen.empty()) { - This->m_cbs->toggleFullscreen(false); + if (!This->m_cbs->exitFullscreen.empty()) { + This->m_cbs->exitFullscreen(obj); } } @@ -2033,8 +2025,8 @@ void ViewLogic::didRunJavaScriptCallback( const char* result, void* /*userData*/) { - LogInfo("didRunJavaScriptCallback called"); - LogInfo("result = " << result); + LogDebug("didRunJavaScriptCallback called"); + LogDebug("result = " << result); } void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo) @@ -2045,7 +2037,7 @@ void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo) Ea_Callback_Type keyType = static_cast(reinterpret_cast(eventInfo)); - LogInfo("Key = [" << keyType << "]"); + LogDebug("Key = [" << keyType << "]"); std::string keyName; if (keyType == EA_CALLBACK_BACK) { @@ -2197,7 +2189,7 @@ void ViewLogic::viewFrameRenderedCallback( if (logEnable) { - LogInfo("enter"); + LogDebug("enter"); } } @@ -2205,7 +2197,7 @@ void ViewLogic::mediacontrolRotateHorizontal(void* data, Evas_Object* obj, void* /*eventInfo*/) { - LogInfo("mediacontrolRotateHorizontal called"); + LogDebug("mediacontrolRotateHorizontal called"); Assert(data); Assert(obj); ViewLogic* This = static_cast(data); @@ -2222,7 +2214,7 @@ void ViewLogic::mediacontrolRotateVertical(void* data, Evas_Object* obj, void* /*eventInfo*/) { - LogInfo("mediacontrolRotateVertical called"); + LogDebug("mediacontrolRotateVertical called"); Assert(data); Assert(obj); ViewLogic* This = static_cast(data); @@ -2239,7 +2231,7 @@ void ViewLogic::mediacontrolRotateExit(void* data, Evas_Object* obj, void* /*eventInfo*/) { - LogInfo("mediacontrolRotateExit called"); + LogDebug("mediacontrolRotateExit called"); Assert(data); Assert(obj); ViewLogic* This = static_cast(data); @@ -2281,7 +2273,7 @@ void ViewLogic::mediacontrolRotateExit(void* data, Eina_Bool ViewLogic::orientationThresholdTimerCallback(void* data) { - LogInfo("orientationThresholdTimerCallback"); + LogDebug("orientationThresholdTimerCallback"); ViewLogic* This = static_cast(data); if (This->m_deferredRotateAngle == @@ -2341,7 +2333,7 @@ void ViewLogic::popupReplyWaitStart(void* data, Evas_Object* /*obj*/, void* /*eventInfo*/) { - LogInfo("called"); + LogDebug("called"); Assert(data); ViewLogic* This = static_cast(data); This->m_isPopupReplyWait = true; @@ -2351,7 +2343,7 @@ void ViewLogic::popupReplyWaitFinish(void* data, Evas_Object* /*obj*/, void* /*eventInfo*/) { - LogInfo("called"); + LogDebug("called"); Assert(data); ViewLogic* This = static_cast(data); This->m_isPopupReplyWait = false; @@ -2359,7 +2351,7 @@ void ViewLogic::popupReplyWaitFinish(void* data, void ViewLogic::requestUrlBlocked(const std::string& blockedUrl) { - LogInfo("enter"); + LogDebug("enter"); // block this page and open it in browser LogDebug("Request was blocked : " << blockedUrl); @@ -2399,10 +2391,6 @@ void ViewLogic::windowClose() // get latest ewkView m_currentEwkView = m_ewkViewList.back(); - // resume ewkView - /* In case we support many pages in parallel - * then view is not suspended*/ - //resumeEwkView(m_currentEwkView); setEwkViewVisible(m_currentEwkView); // show ewkView diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h index ca75e06..f6ad295 100644 --- a/src/view/webkit/view_logic.h +++ b/src/view/webkit/view_logic.h @@ -86,8 +86,6 @@ class ViewLogic : public ViewModule::IViewModule bool createEwkView(Evas* canvas); void prepareEwkView(Evas_Object *wkView); void removeEwkView(Evas_Object *wkView); - void resumeEwkView(Evas_Object *wkView); - void suspendEwkView(Evas_Object *wkView); void setEwkViewVisible(Evas_Object *wkView); void setEwkViewInvisible(Evas_Object *wkView); void resumeWebkit(Evas_Object *wkView); diff --git a/src/view/webkit/view_logic_authentication_challenge_support.cpp b/src/view/webkit/view_logic_authentication_challenge_support.cpp index 9b71208..e42c8e9 100644 --- a/src/view/webkit/view_logic_authentication_challenge_support.cpp +++ b/src/view/webkit/view_logic_authentication_challenge_support.cpp @@ -43,7 +43,6 @@ const char* const ELM_SWALLOW_LABEL = "elm.swallow.label"; const char* const ELM_SWALLOW_IDFIELD = "elm.swallow.idfield"; const char* const ELM_SWALLOW_PASSWDFIELD = "elm.swallow.passwdfield"; -const char* const DAEMON_EDJ_PATH = "/usr/share/edje/wrt/Daemon.edj"; const char* const GROUP_NAME_AUTHENTICATION_CHALLENGE_POPUP = "authChallengePopup"; const char* const THEME_EDITFIELD = "editfield"; @@ -129,7 +128,7 @@ void askUserInformation(authenticationData* authData) Evas_Object* popupLayout = elm_layout_add(popup); elm_layout_file_set(popupLayout, - DAEMON_EDJ_PATH, + WRT_EDJ_PATH, GROUP_NAME_AUTHENTICATION_CHALLENGE_POPUP); evas_object_size_hint_weight_set(popupLayout, EVAS_HINT_EXPAND, diff --git a/src/view/webkit/view_logic_geolocation_support.cpp b/src/view/webkit/view_logic_geolocation_support.cpp index ea96943..6ed0497 100644 --- a/src/view/webkit/view_logic_geolocation_support.cpp +++ b/src/view/webkit/view_logic_geolocation_support.cpp @@ -49,20 +49,21 @@ void askUserForGeolocationPermission( PermissionData* data) { LogDebug("askUserForGeolocationPermission called"); - std::string body = WRT_BODY_PS_REQUESTS_YOUR_LOCATION; std::string origin = DPL::ToUTF8String(data->m_originData.origin.host); if (origin.empty()) { - char* name = NULL; - if (app_get_name(&name) == APP_ERROR_NONE) { - origin = name; - free(name); - } else { - origin = "application"; - } + origin = "local"; } - body.replace(body.find(WRT_PS), - std::string(WRT_PS).size(), - origin.c_str()); + std::string appname; + char* name = NULL; + if (app_get_name(&name) == APP_ERROR_NONE) { + appname = name; + free(name); + } else { + appname = "application"; + } + + std::string body = + WrtText::replacePS({WRT_POP_GEOLOCATION_PERMISSION, appname, origin}); Evas_Object* popup = createPopup(window, body.c_str(), WRT_BODY_REMEMBER_PREFERENCE, diff --git a/src/view/webkit/view_logic_orientation_support.cpp b/src/view/webkit/view_logic_orientation_support.cpp index 2a2169f..8e81d7f 100644 --- a/src/view/webkit/view_logic_orientation_support.cpp +++ b/src/view/webkit/view_logic_orientation_support.cpp @@ -67,7 +67,7 @@ int OrientationSupport::getW3COrientationAngle(int ewkOrientation) void OrientationSupport::setEwkOrientation(Evas_Object* ewk, int angle) { - LogInfo("setOrientation called"); + LogDebug("setOrientation called"); ewk_view_orientation_send(ewk, angle); } } // ViewModule diff --git a/src/view/webkit/view_logic_scheme_support.cpp b/src/view/webkit/view_logic_scheme_support.cpp index 3bdabc2..84c2c37 100644 --- a/src/view/webkit/view_logic_scheme_support.cpp +++ b/src/view/webkit/view_logic_scheme_support.cpp @@ -55,7 +55,7 @@ bool SchemeSupport::HandleTizenScheme(const char* uri, Evas_Object* window, Evas_Object* wkView) { - LogInfo("HandleTizenScheme called"); + LogDebug("HandleTizenScheme called"); if (!uri) { LogError("Empty uri"); return false; @@ -66,18 +66,18 @@ bool SchemeSupport::HandleTizenScheme(const char* uri, } if (strncmp(uri, TIZEN_EXIT, strlen(TIZEN_EXIT)) == 0) { - LogInfo("Tizen scheme: " << uri << " exit"); + LogDebug("Tizen scheme: " << uri << " exit"); ecore_idler_add(exitAppIdlerCallback, NULL); return true; } else if (strncmp(uri, TIZEN_HIDE, strlen(TIZEN_HIDE)) == 0) { - LogInfo("Tizen scheme: " << uri << " hide"); + LogDebug("Tizen scheme: " << uri << " hide"); elm_win_lower(window); return true; } else if (strncmp(uri, TIZEN_CHANGE_USERAGNET, strlen(TIZEN_CHANGE_USERAGNET)) == 0) { - LogInfo("Tizen scheme: " << uri << " change UA"); + LogDebug("Tizen scheme: " << uri << " change UA"); const char* userAgentString = strstr(uri, "="); if (NULL == userAgentString) { LogDebug("UA string is NULL"); diff --git a/src/view/webkit/view_logic_web_notification_support.cpp b/src/view/webkit/view_logic_web_notification_support.cpp index 6dba5a5..16c7e4e 100755 --- a/src/view/webkit/view_logic_web_notification_support.cpp +++ b/src/view/webkit/view_logic_web_notification_support.cpp @@ -115,7 +115,7 @@ void webNotificationPermissionRequest( bool showWebNotification(WebNotificationDataPtr notiData) { - LogInfo("showWebNotification called"); + LogDebug("showWebNotification called"); /* TODO : register notification to database */ return notificationShow(notiData); @@ -164,7 +164,7 @@ bool notificationShow(WebNotificationDataPtr notiData) //check uri is "http", https" or not bool validIconURL = true; - LogInfo("url path is " << notiData->m_iconURL); + LogDebug("url path is " << notiData->m_iconURL); if (isExternalUri(PATTERN_CHECK_EXTERNAL, notiData->m_iconURL)) { //download image from url validIconURL = downloadImage(notiData); @@ -192,8 +192,8 @@ bool notificationShow(WebNotificationDataPtr notiData) "Fail to insert notification: " << error); } - LogInfo("Notification is inserted!"); - LogInfo("noti id =[" << notiData->m_id << "] " << + LogDebug("Notification is inserted!"); + LogDebug("noti id =[" << notiData->m_id << "] " << "priv_id =[" << priv_id << "]"); if (noti_h) { @@ -218,7 +218,7 @@ bool notificationShow(WebNotificationDataPtr notiData) bool notificationHide(WebNotificationDataPtr notiData) { - LogInfo("notificationHide called"); + LogDebug("notificationHide called"); Assert(notiData); return true; @@ -226,7 +226,7 @@ bool notificationHide(WebNotificationDataPtr notiData) bool isExternalUri(const std::string &pattern, const std::string &uri) { - LogInfo("isExternalUri called"); + LogDebug("isExternalUri called"); pcrecpp::RE_Options pcreOpt; pcreOpt.set_caseless(true); @@ -237,7 +237,7 @@ bool isExternalUri(const std::string &pattern, const std::string &uri) bool downloadImage(WebNotificationDataPtr notiData) { - LogInfo("downloadImage called"); + LogDebug("downloadImage called"); Assert(notiData); // download path is diff --git a/src/wrt-client/CMakeLists.txt b/src/wrt-client/CMakeLists.txt index b3b51a8..6fb05ea 100644 --- a/src/wrt-client/CMakeLists.txt +++ b/src/wrt-client/CMakeLists.txt @@ -17,6 +17,8 @@ SET(TARGET_WRT_CLIENT "wrt-client") SET(WRT_CLIENT_SRCS ${PROJECT_SOURCE_DIR}/src/wrt-client/window_data.cpp + ${PROJECT_SOURCE_DIR}/src/wrt-client/client_command_line_parser.cpp + ${PROJECT_SOURCE_DIR}/src/wrt-client/client_ide_support.cpp ${PROJECT_SOURCE_DIR}/src/wrt-client/client_service_support.cpp ${PROJECT_SOURCE_DIR}/src/wrt-client/splash_screen_support.cpp ${PROJECT_SOURCE_DIR}/src/wrt-client/wrt-client.cpp @@ -28,15 +30,17 @@ PKG_CHECK_MODULES(CLIENT_DEP appcore-efl capi-appfw-application dpl-wrt-dao-ro - wrt-plugin-js-overlay wrt-popup-wrt-runner appsvc + efl-assist + libsystemd-daemon REQUIRED ) INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/wrt-client ${PROJECT_SOURCE_DIR}/src/api_new + ${PROJECT_SOURCE_DIR}/src/domain ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/include ${CLIENT_DEP_INCLUDE_DIRS} ${SMACK_LABELING_SUPPORT_INCLUDES} @@ -49,6 +53,7 @@ ADD_EXECUTABLE(${TARGET_WRT_CLIENT} TARGET_LINK_LIBRARIES(${TARGET_WRT_CLIENT} ${CLIENT_DEP_LIBRARIES} ${TARGET_CORE_MODULE_LIB} + ${TARGET_WRT_ENGINE_STATIC} ${SMACK_LABELING_SUPPORT_STATIC} "-pie" ) diff --git a/src/wrt-client/auto_rotation_support.cpp b/src/wrt-client/auto_rotation_support.cpp index 2a6edd6..37e64b0 100644 --- a/src/wrt-client/auto_rotation_support.cpp +++ b/src/wrt-client/auto_rotation_support.cpp @@ -33,7 +33,7 @@ const char* const WM_ROTATION_CHANGED_CALLBACK = "wm,rotation,changed"; void AutoRotationSupport::setOrientation(Evas_Object* window, Evas_Object* ewkView, SplashScreenSupport* splashScreen) { - LogInfo("setOrientation"); + LogDebug("setOrientation"); int winAngle = elm_win_rotation_get(window); if (splashScreen && splashScreen->isShowing()) @@ -58,7 +58,7 @@ void AutoRotationSupport::setOrientation(Evas_Object* window, Evas_Object* ewkVi ewkView, OrientationAngle::W3C::Landscape::SECONDARY); } else { - LogInfo("unknown angle is returned"); + LogDebug("unknown angle is returned"); } } diff --git a/src/wrt-client/client_command_line_parser.cpp b/src/wrt-client/client_command_line_parser.cpp new file mode 100644 index 0000000..8218b9b --- /dev/null +++ b/src/wrt-client/client_command_line_parser.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file client_command_line_parser.cpp + * @author Jihoon Chung (jihoon.chung@samsung.com) + */ + +#include "client_command_line_parser.h" + +#include +#include +#include + +#include +#include +#include + +namespace ClientModule { +namespace { + +std::string parseIdField(int argc, char **argv) +{ + if (argv[0] == NULL) { + return ""; + } + + std::string arg = argv[0]; + if (arg.empty()) { + return ""; + } + + if (arg.find("wrt-client") != std::string::npos) { + if (argc <= 1) { + return ""; + } + + arg = argv[1]; + + if (arg == "-h" || arg == "--help") { + return ""; + } else if (arg == "-l" || + arg == "--launch" || + arg == "-t" || + arg == "--tizen") + { + if (argc != 3) { + return ""; + } + return argv[2]; + } else { + return ""; + } + } else { + std::size_t pos = arg.find_last_of('/'); + if (pos != std::string::npos) { + arg = arg.erase(0, pos + 1); + } + return arg; + } +} + +DPL::OptionalUInt getIndex(const std::string& tizenId) +{ + std::size_t pos = + tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX); + if (pos != std::string::npos) { + std::string index = tizenId.substr(pos); + index.erase(strlen(WrtDB::AppControlPrefix::PROCESS_PREFIX)); + std::stringstream s(index); + unsigned int appControlIndex; + s >> appControlIndex; + return appControlIndex; + } + return DPL::OptionalUInt::Null; +} + +std::string removeIndex(const std::string& tizenId) +{ + std::string id = tizenId; + std::size_t pos = + id.find(WrtDB::AppControlPrefix::PROCESS_PREFIX); + if (pos != std::string::npos) { + id.erase(pos); + } + return id; +} +} + +std::string CommandLineParser::getTizenId(int argc, char **argv) +{ + std::string id = parseIdField(argc, argv); + if (id.empty()) { + return ""; + } + return removeIndex(id); +} + +DPL::OptionalUInt CommandLineParser::getAppControlIndex(int argc, char **argv) +{ + std::string id = parseIdField(argc, argv); + if (id.empty()) { + return DPL::OptionalUInt::Null; + } + return getIndex(id); +} +} // ClientModule diff --git a/src/wrt-client/client_command_line_parser.h b/src/wrt-client/client_command_line_parser.h new file mode 100644 index 0000000..615e442 --- /dev/null +++ b/src/wrt-client/client_command_line_parser.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** + * @file client_command_line_parser.h + * @author Jihoon Chung (jihoon.chung@samsung.com) + */ +#ifndef CLIENT_COMMAND_LINE_PARSER_H_ +#define CLIENT_COMMAND_LINE_PARSER_H_ + +#include + +namespace ClientModule { +namespace CommandLineParser { +std::string getTizenId(int argc, char **argv); +DPL::OptionalUInt getAppControlIndex(int argc, char **argv); +} // CommandLineParser +} // ClientModule +#endif // CLIENT_COMMAND_LINE_PARSER_H_ \ No newline at end of file diff --git a/src/wrt-client/client_ide_support.cpp b/src/wrt-client/client_ide_support.cpp new file mode 100644 index 0000000..cb6040c --- /dev/null +++ b/src/wrt-client/client_ide_support.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file client_ide_support.cpp + * @author Jihoon Chung (jihoon.chung@samsung.com) + */ + +#include "client_ide_support.h" +#include +#include +#include + +#include +#include + +namespace ClientModule { +namespace { +const char* const KEY_DEBUG = "debug"; +const char* const KEY_PORT = "port"; +const char* const VALUE_TRUE = "true"; +} + +bool IDESupport::getDebugMode(bundle* b) +{ + if (!b) { + LogWarning("bundle is empty"); + return false; + } + + const char* value = bundle_get_val(b, KEY_DEBUG); + if (value != NULL && !strcmp(value, VALUE_TRUE)) { + return true; + } else { + return false; + } +} + +bool IDESupport::sendReply(bundle* b, unsigned int portNum) +{ + bundle* request = NULL; + if (appsvc_create_result_bundle(b, &request) != APPSVC_RET_OK) { + LogWarning("Fail to create result bundle"); + return false; + } + + char port[10] = {0,}; + sprintf(port, "%u", portNum); + if (appsvc_add_data(request, KEY_PORT, port) != APPSVC_RET_OK) { + LogWarning("Fail to add data"); + bundle_free(request); + return false; + } + + if (appsvc_send_result(request, APPSVC_RES_OK) != APPSVC_RET_OK) { + LogWarning("Fail to send result"); + bundle_free(request); + return false; + } + + bundle_free(request); + return true; +} + +} // ClientModule diff --git a/src/wrt-client/client_ide_support.h b/src/wrt-client/client_ide_support.h new file mode 100644 index 0000000..d392712 --- /dev/null +++ b/src/wrt-client/client_ide_support.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** + * @file client_ide_support.h + * @author Jihoon Chung (jihoon.chung@samsung.com) + */ +#ifndef CLIENT_IDE_SUPPORT_H_ +#define CLIENT_IDE_SUPPORT_H_ + +#include + +namespace ClientModule { +namespace IDESupport { +bool getDebugMode(bundle* b); +bool sendReply(bundle* b, unsigned int portNum); +} // IDESupport +} // ClientModule +#endif // CLIENT_IDE_SUPPORT_H_ \ No newline at end of file diff --git a/src/wrt-client/splash_screen_support.cpp b/src/wrt-client/splash_screen_support.cpp index a898cee..865dfb2 100644 --- a/src/wrt-client/splash_screen_support.cpp +++ b/src/wrt-client/splash_screen_support.cpp @@ -171,7 +171,7 @@ Eina_Bool SplashScreenSupport::timerCallback(void *data) void SplashScreenSupport::startSplashScreen() { - LogInfo("splashImageOn"); + LogDebug("splashImageOn"); if (m_initialized) { @@ -213,7 +213,7 @@ void SplashScreenSupport::stopSplashScreenBuffered() void SplashScreenSupport::stopSplashScreen() { - LogInfo("splashImageOff"); + LogDebug("splashImageOff"); if (m_isShowing) { diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp index 4ed50e0..4ea465e 100644 --- a/src/wrt-client/window_data.cpp +++ b/src/wrt-client/window_data.cpp @@ -25,37 +25,22 @@ #include #include +#include + namespace { -char const* const PLATFORM_EDJ_PATH = "/usr/share/edje/wrt/Platform.edj"; -char const* const DAEMON_EDJ_PATH = "/usr/share/edje/wrt/Daemon.edj"; -char const* const THEME_EDJ_PATH = "/usr/share/edje/wrt/wrt_theme.edj"; -char const* const ELM_STATE_SHOW_CONTENT = "elm,state,show,content"; -char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content"; -char const* const ELM_SWALLOW_BACKWARD = "elm.swallow.backward"; -char const* const ELM_SWALLOW_PROGRESS = "elm.swallow.progress"; -char const* const ELM_STATE_TOOLBAR_INSTANT_OPEN = "elm,state,toolbar,instant_open"; -char const* const ELM_STATE_TOOLBAR_INSTANT_CLOSE = "elm,state,toolbar,instant_close"; - -const char *ELM_EVENT_PROFILE_CHANGED = "profile,changed"; - -char const* const ELM = "elm"; -char const* const LAYOUT = "layout"; -char const* const APPLICATION = "application"; -char const* const INDICATOR = "indicator"; -char const* const NOINDICATOR = "noindicator"; -char const* const INTERNAL_LAYOUT = "internal_layout"; -char const* const FLOATBACKWARD_BUTTON_STYLE = "wrt/backward"; +const char* const PROFILE_CHANGED = "profile,changed"; +const char* const DESKTOP_ICON_PATH = + "/opt/share/icons/default/small/tizenScmgz.png"; const std::string DESKTOP_PROFILE("desktop"); const int PROGRESS_H = 10; } // anonymous namespace WindowData::WindowData(unsigned long pid, bool manualInit) : m_win(NULL), - m_user_layout(NULL), m_conformant(NULL), - m_platform_layout(NULL), - m_navigation(NULL), - m_floatBackButton(NULL), + m_topLayout(NULL), + m_naviframe(NULL), + m_mainLayout(NULL), m_progressbar(NULL), m_ctxpopup(NULL), m_initialized(false), @@ -78,59 +63,99 @@ void WindowData::init() { Assert(m_win != NULL && "m_win is null"); - if (m_initialized == true) - { - LogInfo("Already initilized"); + if (m_initialized == true) { + LogDebug("Already initilized"); return; } - // import button theme - elm_theme_overlay_add(NULL, THEME_EDJ_PATH); - m_conformant = createConformant(m_win); evas_object_show(m_conformant); - m_platform_layout = createPlatformLayout(m_conformant); - evas_object_show(m_platform_layout); - m_navigation = createNavigationBar(m_platform_layout); - evas_object_show(m_navigation); - m_user_layout = createUserLayout(m_navigation); - evas_object_show(m_user_layout); - m_focus = createFocus(m_user_layout); + m_topLayout = createTopLayout(m_conformant); + evas_object_show(m_topLayout); + m_naviframe = createNaviframe(m_topLayout); + evas_object_show(m_naviframe); + m_mainLayout = createMainLayout(m_naviframe); + evas_object_show(m_mainLayout); + m_focus = createFocus(m_mainLayout); evas_object_show(m_focus); - m_progressbar = createProgressBar(m_win, m_user_layout); + m_progressbar = createProgressBar(m_win, m_mainLayout); evas_object_show(m_progressbar); UG_INIT_EFL(m_win, UG_OPT_INDICATOR_ENABLE); m_initialized = true; } -void WindowData::setEvasObjectForLayout(Evas_Object* obj) +bool WindowData::initScreenReaderSupport(bool isSupportAccessibility) +{ + LogDebug("called"); + Assert(m_win != NULL && "x window is Null"); + return ea_screen_reader_support_set( + m_win, + isSupportAccessibility ? EINA_TRUE : EINA_FALSE); +} + +Evas_Object* WindowData::getEvasObject(Layer layer) +{ + EvasObjectDataIt it = m_evasObjectData.find(layer); + if (it == m_evasObjectData.end()) { + return NULL; + } + return it->second; +} + +void WindowData::setWebview(Evas_Object* webview) { - elm_object_part_content_set(m_focus, ELM_SWALLOW_CONTENT, obj); + elm_object_part_content_set(m_focus, "elm.swallow.content", webview); elm_object_focus_set(m_focus, EINA_TRUE); } -void WindowData::unsetEvasObjectForLayout() +void WindowData::unsetWebview() { - elm_object_part_content_unset(m_focus, ELM_SWALLOW_CONTENT); + elm_object_part_content_unset(m_focus, "elm.swallow.content"); } -void WindowData::toggleIndicator(bool fullscreen) +void WindowData::smartCallbackAdd( + Layer layer, + const char* event, + Evas_Smart_Cb callback, + const void* data) { - LogDebug("fullscreen=" << (fullscreen ? "true" : "false")); + Evas_Object* obj = getEvasObject(layer); + if (!obj) { + LogError("Fail to get Evas_Object"); + return; + } + evas_object_smart_callback_add(obj, event, callback, data); + return; +} - if (!fullscreen) { - elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW); - } else { - elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_HIDE); +void WindowData::smartCallbackDel( + Layer layer, + const char* event, + Evas_Smart_Cb callback) +{ + Evas_Object* obj = getEvasObject(layer); + if (!obj) { + LogError("Fail to get Evas_Object"); + return; + } + evas_object_smart_callback_del(m_focus, event, callback); +} + +void WindowData::signalEmit(Layer layer, + const char* emission, + const char* source) +{ + Evas_Object* obj = getEvasObject(layer); + if (!obj) { + LogError("Fail to get Evas_Object"); + return; } + edje_object_signal_emit(elm_layout_edje_get(obj), emission, source); } -void WindowData::setViewMode( - bool fullscreen, - bool backbutton) +void WindowData::setViewMode(bool fullscreen, bool backbutton) { - LogDebug("setViewMode"); LogDebug("fullscreen: " << fullscreen); LogDebug("backbutton: " << backbutton); @@ -142,20 +167,40 @@ void WindowData::setOrientation(int angle) { LogDebug("setOrientation"); Assert(m_win); - elm_win_wm_rotation_preferred_rotation_set( - m_win, - angle); + elm_win_wm_rotation_preferred_rotation_set(m_win, angle); } -void WindowData::createFloatBackButton() +void WindowData::toggleFullscreen(bool fullscreen) { - // Add float backbutton on the left coner - m_floatBackButton = elm_button_add(m_user_layout); - elm_object_style_set(m_floatBackButton, FLOATBACKWARD_BUTTON_STYLE); - elm_object_part_content_set(m_user_layout, - ELM_SWALLOW_BACKWARD, - m_floatBackButton); - evas_object_show(m_floatBackButton); + toggleIndicator(fullscreen || m_currentViewModeFullScreen); +} + +void WindowData::showCtxpopup(void) +{ + m_ctxpopup = createCtxPopup(m_naviframe); + if (!m_ctxpopup) { + return; + } + evas_object_show(m_ctxpopup); +} + +void WindowData::setCtxpopupItemData(CtxpopupItemDataList data) +{ + m_ctxpopupItemDataList = data; +} + +void WindowData::updateProgress(double value) +{ + int x, y, w, h; + evas_object_geometry_get(m_mainLayout, &x, &y, &w, &h); + evas_object_resize(m_progressbar, + static_cast(w * value), + static_cast(PROGRESS_H * elm_config_scale_get())); +} + +void WindowData::setEvasObjectData(Layer layer, Evas_Object* obj) +{ + m_evasObjectData[layer] = obj; } Evas_Object* WindowData::createWindow(unsigned long pid) @@ -173,113 +218,93 @@ Evas_Object* WindowData::createWindow(unsigned long pid) evas_object_resize(window, w, h); evas_object_smart_callback_add(window, - ELM_EVENT_PROFILE_CHANGED, + PROFILE_CHANGED, winProfileChangedCallback, this); + setEvasObjectData(Layer::WINDOW, window); return window; } Evas_Object* WindowData::createConformant(Evas_Object* parent) { Assert(parent != NULL && "Parent is null"); - Evas_Object* conformant = elm_conformant_add(parent); - - evas_object_size_hint_weight_set( - conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_win_resize_object_add(parent, conformant); - return conformant; + Evas_Object* obj = elm_conformant_add(parent); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_win_resize_object_add(parent, obj); + setEvasObjectData(Layer::CONFORMANT, obj); + return obj; } -Evas_Object* WindowData::createPlatformLayout(Evas_Object* parent) +Evas_Object* WindowData::createTopLayout(Evas_Object* parent) { - Evas_Object* platform_layout = elm_layout_add(parent); - - ADD_PROFILING_POINT("elm_layout_theme_set", "start"); - elm_layout_file_set(platform_layout, PLATFORM_EDJ_PATH, "platformlayout"); - ADD_PROFILING_POINT("elm_layout_theme_set", "stop"); - - evas_object_size_hint_align_set(platform_layout, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - evas_object_size_hint_weight_set(platform_layout, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - - elm_object_content_set(parent, platform_layout); - edje_object_signal_emit( - elm_layout_edje_get(platform_layout), ELM_STATE_SHOW_CONTENT, ELM); - return platform_layout; + Assert(parent != NULL && "Parent is null"); + Evas_Object* obj = elm_layout_add(parent); + elm_layout_theme_set(obj, "layout", "application", "default"); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_content_set(parent, obj); + setEvasObjectData(Layer::TOP_LAYOUT, obj); + return obj; } -Evas_Object* WindowData::createNavigationBar(Evas_Object* parent) +Evas_Object* WindowData::createNaviframe(Evas_Object* parent) { - Assert(parent != NULL && "Parent for naviframe is null"); - Evas_Object* navigation = elm_naviframe_add(parent); - - evas_object_size_hint_align_set(navigation, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - evas_object_size_hint_weight_set(navigation, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, navigation); - //elm_object_content_set(parent, navigation); - return navigation; + Assert(parent != NULL && "Parent is null"); + Evas_Object* obj = elm_naviframe_add(parent); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_part_content_set(parent, "elm.swallow.content", obj); + setEvasObjectData(Layer::NAVIFRAME, obj); + return obj; } -Evas_Object* WindowData::createUserLayout(Evas_Object* parent) +Evas_Object* WindowData::createMainLayout(Evas_Object* parent) { - Assert(parent != NULL && "Parent for User Layout is null"); - Evas_Object* layout = elm_layout_add(parent); - elm_layout_file_set(layout, DAEMON_EDJ_PATH, "client"); - evas_object_size_hint_weight_set( - layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - + Assert(parent != NULL && "Parent is null"); + Evas_Object* obj = elm_layout_add(parent); + elm_layout_file_set(obj, WRT_EDJ_PATH, "web-application"); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); ADD_PROFILING_POINT("elm_naviframe_item_push", "start"); - Elm_Object_Item* naviIt = elm_naviframe_item_push( - /* Evas_Object *obj */ - parent, - /* const char *title_label */ - NULL, - /* Evas_Object *prev_btn */ - NULL, - /* Evas_Object *next_btn */ - NULL, - /* Evas_Object *content */ - layout, - /* const char *item_style */ - NULL); + Elm_Object_Item* naviIt = + elm_naviframe_item_push( + parent, // Evas_Object* obj + NULL, // const char* title_label + NULL, // Evas_Object* prev_btn + NULL, // Evas_Object* next_btn + obj, // Evas_Object* content + NULL); // const char* item_style ADD_PROFILING_POINT("elm_naviframe_item_push", "stop"); elm_naviframe_item_title_visible_set(naviIt, EINA_FALSE); - return layout; + setEvasObjectData(Layer::MAIN_LAYOUT, obj); + return obj; } Evas_Object* WindowData::createFocus(Evas_Object* parent) { - Assert(parent != NULL && "Parent for Focus is null"); + Assert(parent != NULL && "Parent is null"); // ewkview isn't elementary widget style. This is reason why ewkview focus // doesn't restore after focus-out and focus-in. To support focus restore // for ewkview, WRT add selectable elementary(button) to manage focus - Evas_Object* focus = elm_button_add(parent); - elm_object_style_set(focus, "focus"); - elm_object_part_content_set(parent, ELM_SWALLOW_CONTENT, focus); - evas_object_size_hint_weight_set(focus, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(focus, EVAS_HINT_FILL, EVAS_HINT_FILL); - return focus; + Evas_Object* obj = elm_button_add(parent); + elm_object_style_set(obj, "transparent"); + elm_object_part_content_set(parent, "elm.swallow.content", obj); + evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + setEvasObjectData(Layer::FOCUS, obj); + return obj; } Evas_Object* WindowData::createProgressBar(Evas_Object* window, Evas_Object* parent) { Assert(parent != NULL && "Parent is null"); - Evas_Object* progressbar = evas_object_rectangle_add(evas_object_evas_get(window)); - evas_object_color_set(progressbar, 91, 166, 255, 255); - elm_object_part_content_set(parent, ELM_SWALLOW_PROGRESS, progressbar); - evas_object_resize(progressbar, 0, 0); - return progressbar; + Evas_Object* obj = evas_object_rectangle_add(evas_object_evas_get(window)); + evas_object_color_set(obj, 91, 166, 255, 255); + elm_object_part_content_set(parent, "elm.swallow.progress", obj); + evas_object_resize(obj, 0, 0); + setEvasObjectData(Layer::PROGRESSBAR, obj); + return obj; } Evas_Object* WindowData::createCtxPopup(Evas_Object* parent) @@ -318,123 +343,15 @@ Evas_Object* WindowData::createCtxPopup(Evas_Object* parent) return object; } -void WindowData::setDesktopIcon() -{ - // set window icon - Evas_Object *icon = evas_object_image_add(evas_object_evas_get(m_win)); - evas_object_image_file_set(icon, - "/opt/share/icons/default/small/tizenScmgz.png", - NULL); - elm_win_icon_object_set(m_win, icon); -} - -void WindowData::addFloatBackButtonCallback( - const char* event, - CallbackType callback, - const void* data) -{ - Assert(m_floatBackButton != NULL && "m_floatBackButton is null"); - evas_object_smart_callback_add(m_floatBackButton, event, callback, data); -} - -void* WindowData::delFloatBackButtonCallback( - const char* event, - CallbackType callBack) -{ - Assert(m_floatBackButton != NULL && "m_floatBackButton is null"); - return evas_object_smart_callback_del(m_floatBackButton, event, callBack); -} - -void WindowData::userlayoutCallbackAdd( - const Evas_Callback_Type event, - EvasCallbackType callback, - const void* data) -{ - Assert(m_user_layout != NULL && "m_user_layout is null"); - evas_object_event_callback_add(m_user_layout, event, callback, data); -} - -void* WindowData::userlayoutCallbackDel( - const Evas_Callback_Type event, - EvasCallbackType callBack) -{ - Assert(m_user_layout != NULL && "m_user_layout is null"); - return evas_object_event_callback_del(m_user_layout, event, callBack); -} - -void WindowData::focusCallbackAdd( - const char* event, - CallbackType callback, - const void* data) -{ - Assert(m_focus != NULL && "m_focus is null"); - evas_object_smart_callback_add(m_focus, event, callback, data); -} - -void* WindowData::focusCallbackDel( - const char* event, - CallbackType callback) -{ - Assert(m_focus != NULL && "m_focus is null"); - return evas_object_smart_callback_del(m_focus, event, callback); -} - -void WindowData::emitSignalForUserLayout( - const char* emission, const char* source) -{ - LogInfo("emitSignalForUserLayout called"); - Assert(m_user_layout != NULL && "m_user_layout is null"); - Assert(emission != NULL && "emission is null"); - Assert(source != NULL && "source is null"); - - edje_object_signal_emit( - elm_layout_edje_get(m_user_layout), emission, source); -} - -void WindowData::toggleFullscreen(bool fullscreen) -{ - LogDebug(__PRETTY_FUNCTION__); - toggleIndicator(fullscreen || m_currentViewModeFullScreen); -} - -void WindowData::winProfileChangedCallback(void *data, - Evas_Object* /*obj*/, - void* /*eventInfo*/) +void WindowData::toggleIndicator(bool fullscreen) { - LogDebug("winProfileChangedCallback"); - if (data == NULL) { - return; - } - WindowData* This = static_cast(data); - const char *profile = elm_config_profile_get(); - - if (DESKTOP_PROFILE == profile) { - elm_win_indicator_mode_set(This->m_win, ELM_WIN_INDICATOR_HIDE); - This->setDesktopIcon(); - } -} + LogDebug("fullscreen=" << (fullscreen ? "true" : "false")); -void WindowData::showCtxpopup(void) -{ - m_ctxpopup = createCtxPopup(m_navigation); - if (!m_ctxpopup) { - return; + if (!fullscreen) { + elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW); + } else { + elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_HIDE); } - evas_object_show(m_ctxpopup); -} - -void WindowData::setCtxpopupItemData(CtxpopupItemDataList data) -{ - m_ctxpopupItemDataList = data; -} - -void WindowData::updateProgress(double value) -{ - int x, y, w, h; - evas_object_geometry_get(m_user_layout, &x, &y, &w, &h); - evas_object_resize(m_progressbar, - static_cast(w * value), - static_cast(PROGRESS_H * elm_config_scale_get())); } void WindowData::ctxpopupItemCallback(void* data, @@ -472,3 +389,24 @@ void WindowData::ctxpopupDismissedCallback(void* data, WindowData* This = static_cast(data); This->m_ctxpopup = NULL; } + +void WindowData::winProfileChangedCallback(void *data, + Evas_Object* /*obj*/, + void* /*eventInfo*/) +{ + LogDebug("winProfileChangedCallback"); + if (data == NULL) { + return; + } + WindowData* This = static_cast(data); + const char* profile = elm_config_profile_get(); + + if (DESKTOP_PROFILE == profile) { + elm_win_indicator_mode_set(This->m_win, ELM_WIN_INDICATOR_HIDE); + // set desktop icon + Evas_Object* icon = + evas_object_image_add(evas_object_evas_get(This->m_win)); + evas_object_image_file_set(icon, DESKTOP_ICON_PATH, NULL); + elm_win_icon_object_set(This->m_win, icon); + } +} diff --git a/src/wrt-client/window_data.h b/src/wrt-client/window_data.h index a9e831d..9326a5f 100644 --- a/src/wrt-client/window_data.h +++ b/src/wrt-client/window_data.h @@ -28,29 +28,21 @@ #include #include +#include #include -/* - * Current layout structure - * - * m_win (elm_win) - * m_platform_layout (elm_layout) - * m_navigation (elm_navigation) - * m_user_layout (elm_layout) - * widget_area (elm_webview) - * - */ +enum class Layer { + WINDOW = 0, + CONFORMANT = 1, + TOP_LAYOUT = 2, + NAVIFRAME = 3, + MAIN_LAYOUT = 4, + FOCUS = 5, + PROGRESSBAR = 6 +}; class WindowData : private DPL::Noncopyable { - private: - typedef void (*CallbackType)( - void* data, Evas_Object* obj, void* event_info); - typedef void (*EvasCallbackType)( - void* data, Evas* evas, Evas_Object* obj, void* event_info); - typedef Eina_Bool (*NaviframePopCallbackType)( - void* data, Elm_Object_Item* it); - public: typedef DPL::FastDelegate0 CtxpopupCallbackType; struct CtxpopupItemData { @@ -67,82 +59,72 @@ class WindowData : private DPL::Noncopyable }; typedef std::list CtxpopupItemDataList; - Evas_Object* m_win; - Evas_Object* m_user_layout; - explicit WindowData(unsigned long pid, bool manualInit = false); virtual ~WindowData(); void init(); - void setEvasObjectForLayout(Evas_Object* evas_object); - void unsetEvasObjectForLayout(); - void addFloatBackButtonCallback( - const char* event, - CallbackType callback, - const void* data); - void* delFloatBackButtonCallback( - const char* event, - CallbackType callBack); - void userlayoutCallbackAdd( - const Evas_Callback_Type event, - EvasCallbackType callback, - const void* data); - void* userlayoutCallbackDel( - const Evas_Callback_Type event, - EvasCallbackType callback); - void focusCallbackAdd( + bool initScreenReaderSupport(bool isSupportAccessibility); + + Evas_Object* getEvasObject(Layer layer); + void setWebview(Evas_Object* evas_object); + void unsetWebview(); + + void smartCallbackAdd( + Layer layer, const char* event, - CallbackType callback, + Evas_Smart_Cb callback, const void* data); - void* focusCallbackDel( + void smartCallbackDel( + Layer layer, const char* event, - CallbackType callback); - void emitSignalForUserLayout( - const char* emission, - const char* source); - void setViewMode( - bool fullscreen, - bool backbutton); + Evas_Smart_Cb callback); + void signalEmit(Layer layer, const char* emission, const char* source); + + void setViewMode(bool fullscreen, bool backbutton); void setOrientation(int angle); void toggleFullscreen(bool fullscreen); - static void winProfileChangedCallback(void *data, - Evas_Object * obj, - void *event_info); void showCtxpopup(void); void setCtxpopupItemData(CtxpopupItemDataList data); void updateProgress(double value); - protected: + private: + Evas_Object* m_win; Evas_Object* m_conformant; - Evas_Object* m_platform_layout; - Evas_Object* m_navigation; + Evas_Object* m_topLayout; + Evas_Object* m_naviframe; + Evas_Object* m_mainLayout; Evas_Object* m_focus; - Evas_Object* m_floatBackButton; Evas_Object* m_progressbar; Evas_Object* m_ctxpopup; bool m_initialized; bool m_currentViewModeFullScreen; CtxpopupItemDataList m_ctxpopupItemDataList; + typedef std::map EvasObjectData; + typedef std::map::iterator EvasObjectDataIt; + EvasObjectData m_evasObjectData; + void setEvasObjectData(Layer layer, Evas_Object* obj); + Evas_Object* createWindow(unsigned long pid); Evas_Object* createConformant(Evas_Object* parent); - Evas_Object* createPlatformLayout(Evas_Object* parent); - Evas_Object* createNavigationBar(Evas_Object* parent); - Evas_Object* createUserLayout(Evas_Object* parent); + Evas_Object* createTopLayout(Evas_Object* parent); + Evas_Object* createNaviframe(Evas_Object* parent); + Evas_Object* createMainLayout(Evas_Object* parent); Evas_Object* createFocus(Evas_Object* parent); Evas_Object* createProgressBar(Evas_Object* window, Evas_Object* parent); Evas_Object* createCtxPopup(Evas_Object* parent); - void alignProgressPosition(); void toggleIndicator(bool fullscreen); - void createFloatBackButton(); - void setDesktopIcon(); static void ctxpopupItemCallback(void* data, Evas_Object* obj, void* eventInfo); static void ctxpopupDismissedCallback(void* data, Evas_Object* obj, void* eventInfo); + static void winProfileChangedCallback(void* data, + Evas_Object* obj, + void* eventInfo); + }; #endif /* WINDOW_INITIALIZE_H_ */ diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index 7acf266..6cfd050 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,16 +39,15 @@ #include #include -#include +#include "client_command_line_parser.h" +#include "client_ide_support.h" #include "client_service_support.h" - //W3C PACKAGING enviroment variable name #define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH" // window signal callback -const char *EDJE_SHOW_BACKWARD_SIGNAL = "show,backward,signal"; const char *EDJE_SHOW_PROGRESS_SIGNAL = "show,progress,signal"; const char *EDJE_HIDE_PROGRESS_SIGNAL = "hide,progress,signal"; const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen"; @@ -77,14 +76,13 @@ WrtClient::WrtClient(int argc, char **argv) : m_launched(false), m_initializing(false), m_initialized(false), - m_sdkLauncherPid(0), m_debugMode(false), - m_debuggerPort(0), m_returnStatus(ReturnStatus::Succeeded), m_widgetState(WidgetState::WidgetState_Stopped), m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED), m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED), - m_isWebkitFullscreen(false) + m_isWebkitFullscreen(false), + m_isFullscreenByPlatform(false) { Touch(); LogDebug("App Created"); @@ -102,12 +100,12 @@ WrtClient::ReturnStatus::Type WrtClient::getReturnStatus() const void WrtClient::OnStop() { - LogInfo("Stopping Dummy Client"); + LogDebug("Stopping Dummy Client"); } void WrtClient::OnCreate() { - LogInfo("On Create"); + LogDebug("On Create"); ADD_PROFILING_POINT("OnCreate callback", "point"); ewk_init(); } @@ -150,13 +148,18 @@ void WrtClient::OnReset(bundle *b) return; } m_widget->Reset(); - m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, ""); m_widgetState = WidgetState_Running; } else { - if (true == checkArgument()) { - setStep(); - } else { + m_tizenId = + ClientModule::CommandLineParser::getTizenId(m_argc, m_argv); + if (m_tizenId.empty()) { showHelpAndQuit(); + } else { + m_appControlIndex = + ClientModule::CommandLineParser::getAppControlIndex(m_argc, + m_argv); + setDebugMode(b); + setStep(); } } @@ -189,80 +192,11 @@ void WrtClient::showHelpAndQuit() Quit(); } -bool WrtClient::checkArgument() -{ - std::string tizenId = getTizenIdFromArgument(m_argc, m_argv); - - if (tizenId.empty()) { - // Just show help - return false; - } else { - std::size_t pos = - tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX); - if (pos != std::string::npos) { - std::string id = tizenId.substr(pos); - id.erase(strlen(WrtDB::AppControlPrefix::PROCESS_PREFIX)); - std::stringstream s(id); - unsigned int appControlIndex; - s >> appControlIndex; - m_appControlIndex = appControlIndex; - tizenId.erase(pos); - LogDebug("app-control execute-index : " << appControlIndex); - } - m_tizenId = tizenId; - LogDebug("Tizen id: " << m_tizenId); - return true; - } -} - -std::string WrtClient::getTizenIdFromArgument(int argc, char **argv) -{ - LogInfo("checkArgument"); - std::string arg = argv[0]; - - if (arg.empty()) { - return ""; - } - - if (arg.find("wrt-client") != std::string::npos) { - if (argc <= 1) { - return ""; - } - - arg = argv[1]; - - if (arg == "-h" || arg == "--help") { - return ""; - } else if (arg == "-l" || arg == "--launch" || - arg == "-t" || arg == "--tizen") - { - if (argc != 3) { - return ""; - } - return argv[2]; - } else { - return ""; - } - } else { - // Launch widget based on application basename - size_t pos = arg.find_last_of('/'); - - if (pos != std::string::npos) { - arg = arg.erase(0, pos + 1); - } - - return arg; - } -} - void WrtClient::setStep() { - LogInfo("setStep"); + LogDebug("setStep"); AddStep(&WrtClient::initStep); - - setSdkLauncherDebugData(); - AddStep(&WrtClient::launchStep); AddStep(&WrtClient::shutdownStep); @@ -271,38 +205,10 @@ void WrtClient::setStep() DPL::Event::ControllerEventHandler::PostEvent(NextStepEvent()); } -void WrtClient::setSdkLauncherDebugData() -{ - LogDebug("setSdkLauncherDebugData"); - - /* check bundle from sdk launcher */ - bundle *bundleFromSdkLauncher; - bundleFromSdkLauncher = bundle_import_from_argv(m_argc, m_argv); - const char *bundle_debug = bundle_get_val(bundleFromSdkLauncher, "debug"); - const char *bundle_pid = bundle_get_val(bundleFromSdkLauncher, "pid"); - if (bundle_debug != NULL && bundle_pid != NULL) { - if (strcmp(bundle_debug, "true") == 0) { - m_debugMode = true; - m_sdkLauncherPid = atoi(bundle_pid); - } else { - m_debugMode = false; - } - } - bundle_free(bundleFromSdkLauncher); -} - -bool WrtClient::checkDebugMode(SDKDebugData* debugData) +void WrtClient::setDebugMode(bundle* b) { - LogError("Checking for debug mode"); - Assert(m_dao); - - bool debugMode = debugData->debugMode; - - LogInfo("[DEBUG_MODE] Widget is launched in " << - (debugMode ? "DEBUG" : "RETAIL") << - " mode."); - - return debugMode; + m_debugMode = ClientModule::IDESupport::getDebugMode(b); + LogDebug("debug mode : " << m_debugMode); } void WrtClient::OnEventReceived(const NextStepEvent& /*event*/) @@ -334,27 +240,7 @@ void WrtClient::loadFinishCallback(Evas_Object* webview) m_splashScreen->stopSplashScreenBuffered(); } - SDKDebugData* debug = new SDKDebugData; - debug->debugMode = m_debugMode; - debug->pid = new unsigned long(getpid()); - - LogInfo("Post result of launch"); - - // Start inspector server, if current mode is debugger mode. - // In the WK2 case, ewk_view_inspector_server_start should - // be called after WebProcess is created. - if (checkDebugMode(debug)) { - debug->portnum = - ewk_view_inspector_server_start(m_widget->GetCurrentWebview(), 0); - if (debug->portnum == 0) { - LogWarning("Failed to get portnum"); - } else { - LogInfo("Assigned port number for inspector : " - << debug->portnum); - } - } else { - LogDebug("Debug mode is disabled"); - } + LogDebug("Post result of launch"); //w3c packaging test debug (message on 4>) const char * makeScreen = getenv(W3C_DEBUG_ENV_VARIABLE); @@ -382,32 +268,19 @@ void WrtClient::loadFinishCallback(Evas_Object* webview) PostEvent(NextStepEvent()); } - if (debug->debugMode) { - LogDebug("Send RT signal to wrt-launcher(pid: " << m_sdkLauncherPid); - union sigval sv; - /* send real time signal with result to wrt-launcher */ - if (webview) { - LogDebug("userData->portnum : " << debug->portnum); - sv.sival_int = debug->portnum; - } else { - sv.sival_int = -1; + if (m_debugMode) { + unsigned int portNum = + ewk_view_inspector_server_start(m_widget->GetCurrentWebview(), 0); + LogDebug("Port for inspector : " << portNum); + bool ret = ClientModule::IDESupport::sendReply( + ApplicationDataSingleton::Instance().getBundle(), + portNum); + if (!ret) { + LogWarning("Fail to send reply"); } - - bundle* request = NULL; - appsvc_create_result_bundle( - ApplicationDataSingleton::Instance().getBundle(), - &request); - char port[10] = {0,}; - sprintf(port, "%d", debug->portnum); - appsvc_add_data(request, "port", port); - appsvc_send_result(request, APPSVC_RES_OK); } ApplicationDataSingleton::Instance().freeBundle(); - - LogDebug("Cleaning wrtClient launch resources..."); - delete debug->pid; - delete debug; } void WrtClient::resetCallback(bool result) @@ -424,7 +297,9 @@ void WrtClient::progressStartedCallback() if (m_settingList->getProgressBarPresence() == ProgressBar_Enable || m_currentViewMode == VIEWMODE_TYPE_WINDOWED) { - m_windowData->emitSignalForUserLayout(EDJE_SHOW_PROGRESS_SIGNAL, ""); + m_windowData->signalEmit(Layer::MAIN_LAYOUT, + EDJE_SHOW_PROGRESS_SIGNAL, + ""); m_windowData->updateProgress(0); } } @@ -443,7 +318,9 @@ void WrtClient::progressFinishCallback() if (m_settingList->getProgressBarPresence() == ProgressBar_Enable || m_currentViewMode == VIEWMODE_TYPE_WINDOWED) { - m_windowData->emitSignalForUserLayout(EDJE_HIDE_PROGRESS_SIGNAL, ""); + m_windowData->signalEmit(Layer::MAIN_LAYOUT, + EDJE_HIDE_PROGRESS_SIGNAL, + ""); } } @@ -463,23 +340,27 @@ void WrtClient::webCrashCallback() NextStepEvent()); } -void WrtClient::toggleFullscreenCallback(bool fullscreen) +void WrtClient::enterFullscreenCallback(Evas_Object* /*obj*/, + bool isFullscreenByPlatform) { - LogError("toggleFullscreen"); - - if (fullscreen) { - // enter fullscreen - m_windowData->toggleFullscreen(true); - m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN; - m_isWebkitFullscreen = true; - } else { - // exit fullscreen - m_windowData->toggleFullscreen(false); - m_currentViewMode = m_initialViewMode; - m_isWebkitFullscreen = false; + // enter fullscreen + m_windowData->toggleFullscreen(true); + m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN; + m_isWebkitFullscreen = true; + if (isFullscreenByPlatform) { + m_isFullscreenByPlatform = true; } } +void WrtClient::exitFullscreenCallback(Evas_Object* /*obj*/) +{ + // exit fullscreen + m_windowData->toggleFullscreen(false); + m_currentViewMode = m_initialViewMode; + m_isWebkitFullscreen = false; + m_isFullscreenByPlatform = false; +} + void WrtClient::launchStep() { ADD_PROFILING_POINT("launchStep", "start"); @@ -539,6 +420,11 @@ void WrtClient::launchStep() s_preparedWindowData = NULL; } ADD_PROFILING_POINT("CreateWindow", "stop"); + if (!m_windowData->initScreenReaderSupport( + m_settingList->getAccessibility() == Accessibility_Enable)) + { + LogWarning("Fail to set screen reader support set"); + } // rotate window to initial value setWindowInitialOrientation(); @@ -550,17 +436,21 @@ void WrtClient::launchStep() DPL::OptionalString splashImgSrc = m_dao->getSplashImgSrc(); if (!splashImgSrc.IsNull()) { - m_splashScreen.reset(new SplashScreenSupport(m_windowData->m_win, - (DPL::ToUTF8String(*splashImgSrc)).c_str(), - m_currentViewMode != VIEWMODE_TYPE_FULLSCREEN, - m_settingList->getRotationValue() == Screen_Landscape)); + m_splashScreen.reset( + new SplashScreenSupport( + m_windowData->getEvasObject(Layer::WINDOW), + (DPL::ToUTF8String(*splashImgSrc)).c_str(), + m_currentViewMode != VIEWMODE_TYPE_FULLSCREEN, + m_settingList->getRotationValue() == Screen_Landscape)); m_splashScreen->startSplashScreen(); } ADD_PROFILING_POINT("Create splash screen", "stop"); DPL::OptionalString startUrl = W3CFileLocalization::getStartFile(m_dao); - if (!m_widget->PrepareView(DPL::ToUTF8String(*startUrl), - m_windowData->m_win, s_preparedEwkContext)) + if (!m_widget->PrepareView( + DPL::ToUTF8String(*startUrl), + m_windowData->getEvasObject(Layer::WINDOW), + s_preparedEwkContext)) { DPL::Event::ControllerEventHandler::PostEvent( NextStepEvent()); @@ -572,8 +462,14 @@ void WrtClient::launchStep() //you can't show window with splash screen before PrepareView //ewk_view_add_with_context() in viewLogic breaks window m_windowData->init(); - m_windowData->focusCallbackAdd("focused", focusedCallback, this); - m_windowData->focusCallbackAdd("unfocused", unfocusedCallback, this); + m_windowData->smartCallbackAdd(Layer::FOCUS, + "focused", + focusedCallback, + this); + m_windowData->smartCallbackAdd(Layer::FOCUS, + "unfocused", + unfocusedCallback, + this); WrtDB::WidgetLocalizedInfo localizedInfo = W3CFileLocalization::getLocalizedInfo(m_dao); @@ -581,10 +477,11 @@ void WrtClient::launchStep() if (!(localizedInfo.name.IsNull())) { name = DPL::ToUTF8String(*(localizedInfo.name)); } - elm_win_title_set(m_windowData->m_win, name.c_str()); + elm_win_title_set(m_windowData->getEvasObject(Layer::WINDOW), + name.c_str()); // window show - evas_object_show(m_windowData->m_win); + evas_object_show(m_windowData->getEvasObject(Layer::WINDOW)); initializeWindowModes(); @@ -595,7 +492,7 @@ void WrtClient::launchStep() NextStepEvent()); return; } - LogInfo("Widget launch accepted. Entering running state"); + LogDebug("Widget launch accepted. Entering running state"); m_widgetState = WidgetState_Running; cbs->progressStarted = DPL::MakeDelegate(this, &WrtClient::progressStartedCallback); @@ -607,13 +504,13 @@ void WrtClient::launchStep() cbs->bufferUnset = DPL::MakeDelegate(this, &WrtClient::unsetLayout); cbs->webkitExit = DPL::MakeDelegate(this, &WrtClient::webkitExitCallback); cbs->webCrash = DPL::MakeDelegate(this, &WrtClient::webCrashCallback); - cbs->toggleFullscreen = DPL::MakeDelegate(this, &WrtClient::toggleFullscreenCallback); + cbs->enterFullscreen = DPL::MakeDelegate(this, &WrtClient::enterFullscreenCallback); + cbs->exitFullscreen = DPL::MakeDelegate(this, &WrtClient::exitFullscreenCallback); cbs->setOrientation = DPL::MakeDelegate(this, &WrtClient::setWindowOrientation); cbs->hwkey = DPL::MakeDelegate(this, &WrtClient::hwkeyCallback); m_widget->SetUserDelegates(cbs); m_widget->Show(); - m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, ""); ADD_PROFILING_POINT("launchStep", "stop"); } @@ -628,21 +525,10 @@ void WrtClient::initializeWindowModes() backbutton); } -void WrtClient::backButtonCallback(void* data, - Evas_Object * /*obj*/, - void * /*event_info*/) -{ - LogInfo("BackButtonCallback"); - Assert(data); - - WrtClient* This = static_cast(data); - This->m_widget->Backward(); -} - Eina_Bool WrtClient::naviframeBackButtonCallback(void* data, Elm_Object_Item* /*it*/) { - LogInfo("BackButtonCallback"); + LogDebug("BackButtonCallback"); Assert(data); WrtClient* This = static_cast(data); @@ -652,7 +538,7 @@ Eina_Bool WrtClient::naviframeBackButtonCallback(void* data, int WrtClient::appcoreLowMemoryCallback(void* /*data*/) { - LogInfo("appcoreLowMemoryCallback"); + LogDebug("appcoreLowMemoryCallback"); //WrtClient* This = static_cast(data); // TODO call RunnableWidgetObject API regarding low memory @@ -713,9 +599,10 @@ void WrtClient::setWindowInitialOrientation(void) } else if (rotationValue == Screen_Landscape) { setWindowOrientation(OrientationAngle::Window::Landscape::PRIMARY); } else if (rotationValue == Screen_AutoRotation) { - if (!AutoRotationSupport::setAutoRotation(m_windowData->m_win, - autoRotationCallback, - this)) + if (!AutoRotationSupport::setAutoRotation( + m_windowData->getEvasObject(Layer::WINDOW), + autoRotationCallback, + this)) { LogError("Fail to set auto rotation"); } @@ -737,7 +624,9 @@ void WrtClient::unsetWindowOrientation(void) WidgetSettingScreenLock rotationValue = m_settingList->getRotationValue(); if (rotationValue == Screen_AutoRotation) { - AutoRotationSupport::unsetAutoRotation(m_windowData->m_win, autoRotationCallback); + AutoRotationSupport::unsetAutoRotation( + m_windowData->getEvasObject(Layer::WINDOW), + autoRotationCallback); } } @@ -805,12 +694,12 @@ void WrtClient::ctxpopupShare(void) return; } if (ClientModule::ServiceSupport::launchShareService( - elm_win_xwindow_get(m_windowData->m_win), + elm_win_xwindow_get(m_windowData->getEvasObject(Layer::WINDOW)), url)) { - LogInfo("success"); + LogDebug("success"); } else { - LogInfo("fail"); + LogDebug("fail"); } } @@ -829,12 +718,12 @@ void WrtClient::ctxpopupLaunchBrowser(void) return; } if (ClientModule::ServiceSupport::launchViewService( - elm_win_xwindow_get(m_windowData->m_win), + elm_win_xwindow_get(m_windowData->getEvasObject(Layer::WINDOW)), url)) { - LogInfo("success"); + LogDebug("success"); } else { - LogInfo("fail"); + LogDebug("fail"); } } @@ -843,6 +732,7 @@ void WrtClient::hwkeyCallback(const std::string& key) if (m_settingList->getBackButtonPresence() == BackButton_Enable || m_currentViewMode == VIEWMODE_TYPE_WINDOWED) { + // windowed UX - hosted application if (key == KeyName::BACK) { if (m_isWebkitFullscreen) { ewk_view_fullscreen_exit(m_widget->GetCurrentWebview()); @@ -853,24 +743,31 @@ void WrtClient::hwkeyCallback(const std::string& key) // UX isn't confirmed // m_windowData->showCtxpopup(); } + } else { + // packaged application + if (key == KeyName::BACK) { + if (m_isFullscreenByPlatform) { + ewk_view_fullscreen_exit(m_widget->GetCurrentWebview()); + } + } } } -void WrtClient::setLayout(Evas_Object* newBuffer) +void WrtClient::setLayout(Evas_Object* webview) { LogDebug("add new webkit buffer to window"); - Assert(newBuffer); - m_windowData->setEvasObjectForLayout(newBuffer); - evas_object_show(newBuffer); - evas_object_show(m_windowData->m_win); + Assert(webview); + m_windowData->setWebview(webview); + evas_object_show(webview); + evas_object_show(m_windowData->getEvasObject(Layer::WINDOW)); } -void WrtClient::unsetLayout(Evas_Object* currentBuffer) +void WrtClient::unsetLayout(Evas_Object* webview) { LogDebug("remove current webkit buffer from window"); - Assert(currentBuffer); - evas_object_hide(currentBuffer); - m_windowData->unsetEvasObjectForLayout(); + Assert(webview); + evas_object_hide(webview); + m_windowData->unsetWebview(); } void WrtClient::shutdownStep() @@ -883,8 +780,12 @@ void WrtClient::shutdownStep() // AutoRotation, focusCallback use m_widget pointer internally. // It must be unset before m_widget is released. unsetWindowOrientation(); - m_windowData->focusCallbackDel("focused", focusedCallback); - m_windowData->focusCallbackDel("unfocused", unfocusedCallback); + m_windowData->smartCallbackDel(Layer::FOCUS, + "focused", + focusedCallback); + m_windowData->smartCallbackDel(Layer::FOCUS, + "unfocused", + unfocusedCallback); m_widget.reset(); ewk_context_delete(s_preparedEwkContext); PrepareExternalStorageSingleton::Instance().Deinitialize(); @@ -899,13 +800,12 @@ void WrtClient::shutdownStep() void WrtClient::autoRotationCallback(void* data, Evas_Object* obj, void* /*event*/) { - LogInfo("entered"); + LogDebug("entered"); Assert(data); Assert(obj); WrtClient* This = static_cast(data); - This->autoRotationSetOrientation(obj); } @@ -913,7 +813,7 @@ void WrtClient::focusedCallback(void* data, Evas_Object* /*obj*/, void* /*eventInfo*/) { - LogInfo("entered"); + LogDebug("entered"); Assert(data); WrtClient* This = static_cast(data); elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_TRUE); @@ -923,7 +823,7 @@ void WrtClient::unfocusedCallback(void* data, Evas_Object* /*obj*/, void* /*eventInfo*/) { - LogInfo("entered"); + LogDebug("entered"); Assert(data); WrtClient* This = static_cast(data); elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_FALSE); @@ -931,7 +831,7 @@ void WrtClient::unfocusedCallback(void* data, void WrtClient::autoRotationSetOrientation(Evas_Object* obj) { - LogInfo("entered"); + LogDebug("entered"); Assert(obj); AutoRotationSupport::setOrientation(obj, m_widget->GetCurrentWebview(), @@ -1026,7 +926,7 @@ static Eina_Bool proces_pool_fd_handler(void* /*data*/, Ecore_Fd_Handler *handle static void vconf_changed_handler(keynode_t* /*key*/, void* /*data*/) { - LogInfo("VCONFKEY_LANGSET vconf-key was changed!"); + LogDebug("VCONFKEY_LANGSET vconf-key was changed!"); // When system language is changed, the candidate process will be created again. exit(-1); @@ -1074,14 +974,14 @@ int main(int argc, if (argc > 1 && argv[1] != NULL && !strcmp(argv[1], "-d")) { - LogInfo("Entered dummy process mode"); + LogDebug("Entered dummy process mode"); sprintf(argv[0], "%s ", DUMMY_PROCESS_PATH); // Set 'root' home directory setenv(HOME, ROOT_HOME_PATH, 1); - LogInfo("Prepare ewk_context"); + LogDebug("Prepare ewk_context"); appcore_set_i18n("wrt-client", NULL); ewk_set_arguments(argc, argv); setenv("WRT_LAUNCHING_PERFORMANCE", "1", 1); @@ -1089,7 +989,7 @@ int main(int argc, if (s_preparedEwkContext == NULL) { - LogInfo("Creating webkit context was failed!"); + LogDebug("Creating webkit context was failed!"); exit(-1); } @@ -1097,24 +997,24 @@ int main(int argc, if (client_fd == -1) { - LogInfo("Connecting process_pool_server was failed!"); + LogDebug("Connecting process_pool_server was failed!"); exit(-1); } // register language changed callback vconf_notify_key_changed(VCONFKEY_LANGSET, vconf_changed_handler, NULL); - LogInfo("Prepare window_data"); + LogDebug("Prepare window_data"); // Temporarily change HOME path to app // This change is needed for getting elementary profile // /opt/home/app/.elementary/config/mobile/base.cfg const char* backupEnv = getenv(HOME); setenv(HOME, APP_HOME_PATH, 1); - LogInfo("elm_init()"); + LogDebug("elm_init()"); elm_init(argc, argv); setenv(HOME, backupEnv, 1); - LogInfo("WindowData()"); + LogDebug("WindowData()"); s_preparedWindowData = new WindowData(static_cast(getpid())); Ecore_Fd_Handler* fd_handler = ecore_main_fd_handler_add(client_fd, @@ -1123,7 +1023,7 @@ int main(int argc, if (fd_handler == NULL) { - LogInfo("fd_handler is NULL"); + LogDebug("fd_handler is NULL"); exit(-1); } @@ -1136,7 +1036,8 @@ int main(int argc, // deregister language changed callback vconf_ignore_key_changed(VCONFKEY_LANGSET, vconf_changed_handler); - std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv); + std::string tizenId = + ClientModule::CommandLineParser::getTizenId(argc, argv); ewk_context_message_post_to_injected_bundle( s_preparedEwkContext, MESSAGE_NAME_INITIALIZE, @@ -1146,14 +1047,10 @@ int main(int argc, else { // This code is to fork a web process without exec. - std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv); - if (!tizenId.empty()) { - std::size_t pos = - tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX); - if (pos != std::string::npos) { - tizenId.erase(pos); - } + std::string tizenId = + ClientModule::CommandLineParser::getTizenId(argc, argv); + if (!tizenId.empty()) { LogDebug("Launching by fork mode"); // Language env setup appcore_set_i18n("wrt-client", NULL); @@ -1164,7 +1061,7 @@ int main(int argc, if (s_preparedEwkContext == NULL) { - LogInfo("Creating webkit context was failed!"); + LogDebug("Creating webkit context was failed!"); Wrt::Popup::PopupInvoker().showInfo("Error", "Creating webkit context was failed.", "OK"); exit(-1); } diff --git a/src/wrt-client/wrt-client.h b/src/wrt-client/wrt-client.h index 090b202..bed4659 100644 --- a/src/wrt-client/wrt-client.h +++ b/src/wrt-client/wrt-client.h @@ -70,18 +70,13 @@ class WrtClient : private: void showHelpAndQuit(); - bool checkArgument(); - void setSdkLauncherDebugData(); - bool checkDebugMode(SDKDebugData* debugData); + void setDebugMode(bundle* b); void initializeWindowModes(); // Events virtual void OnEventReceived(const NextStepEvent& event); // static Callback - static void backButtonCallback(void* data, - Evas_Object* obj, - void* event_info); static Eina_Bool naviframeBackButtonCallback(void* data, Elm_Object_Item* it); static int appcoreLowMemoryCallback(void* data); @@ -123,7 +118,8 @@ class WrtClient : void progressFinishCallback(); void webkitExitCallback(); void webCrashCallback(); - void toggleFullscreenCallback(bool fullscreen); + void enterFullscreenCallback(Evas_Object* obj, bool isFullscreenByPlatform); + void exitFullscreenCallback(Evas_Object* obj); void setLayout(Evas_Object* newBuffer); void unsetLayout(Evas_Object* currentBuffer); @@ -134,9 +130,7 @@ class WrtClient : bool m_launched; bool m_initializing; bool m_initialized; - int m_sdkLauncherPid; bool m_debugMode; - unsigned short m_debuggerPort; ReturnStatus::Type m_returnStatus; WRT::RunnableWidgetObjectPtr m_widget; WrtDB::WidgetDAOReadOnlyPtr m_dao; @@ -147,6 +141,7 @@ class WrtClient : std::string m_initialViewMode; std::string m_currentViewMode; bool m_isWebkitFullscreen; + bool m_isFullscreenByPlatform; }; #endif // WRT_CLIENT_H diff --git a/src/wrt-launchpad-daemon/CMakeLists.txt b/src/wrt-launchpad-daemon/CMakeLists.txt index 9d78b15..bb53a58 100644 --- a/src/wrt-launchpad-daemon/CMakeLists.txt +++ b/src/wrt-launchpad-daemon/CMakeLists.txt @@ -33,6 +33,7 @@ PKG_CHECK_MODULES(WRT_LAUNCH_PAD_DEPS libprivilege-control x11 sqlite3 + libsystemd-daemon REQUIRED ) diff --git a/src/wrt-launchpad-daemon/launchpad_src/launchpad.c b/src/wrt-launchpad-daemon/launchpad_src/launchpad.c index 5e530cb..4171cf1 100644 --- a/src/wrt-launchpad-daemon/launchpad_src/launchpad.c +++ b/src/wrt-launchpad-daemon/launchpad_src/launchpad.c @@ -90,7 +90,7 @@ _static_ int __raise_win_by_x(int pid); _static_ int __send_to_sigkill(int pid); _static_ int __term_app(int pid); _static_ int __resume_app(int pid); -_static_ void __real_send(int clifd, int ret); +_static_ int __real_send(int clifd, int ret); _static_ void __send_result_to_caller(int clifd, int ret); _static_ void __launchpad_exec_dummy(int main_fd, int pool_fd, int client_fd); _static_ void __launchpad_main_loop(int main_fd, int pool_fd); @@ -359,16 +359,19 @@ _static_ int __foward_cmd(int cmd, bundle *kb, int cr_pid) return res; } -_static_ void __real_send(int clifd, int ret) +_static_ int __real_send(int clifd, int ret) { if (send(clifd, &ret, sizeof(int), MSG_NOSIGNAL) < 0) { if (errno == EPIPE) { _E("send failed due to EPIPE.\n"); + close(clifd); + return -1; } _E("send fail to client"); } close(clifd); + return 0; } _static_ void __send_result_to_caller(int clifd, int ret) @@ -377,6 +380,7 @@ _static_ void __send_result_to_caller(int clifd, int ret) int wait_count; int cmdline_changed = 0; int cmdline_exist = 0; + int r; if (clifd == -1) { return; @@ -416,7 +420,13 @@ _static_ void __send_result_to_caller(int clifd, int ret) _E("process launched, but cmdline not changed"); } - __real_send(clifd, ret); + if (__real_send(clifd, ret) < 0) { + r = kill(ret, SIGKILL); + if (r == -1) { + _E("send SIGKILL: %s", strerror(errno)); + } + } + return; } diff --git a/src/wrt-launchpad-daemon/src/app_sock.c b/src/wrt-launchpad-daemon/src/app_sock.c index 9089610..46b2f2c 100644 --- a/src/wrt-launchpad-daemon/src/app_sock.c +++ b/src/wrt-launchpad-daemon/src/app_sock.c @@ -23,7 +23,7 @@ #include #include #include - +#include #include "app_sock.h" #include "simple_util.h" @@ -55,8 +55,28 @@ int __create_server_sock(int pid) struct sockaddr_un saddr; struct sockaddr_un p_saddr; int fd; + int listen_fds=0; + int i; mode_t orig_mask; + memset(&saddr, 0, sizeof(saddr)); + saddr.sun_family = AF_UNIX; + snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid); + + listen_fds = sd_listen_fds(0); + if (listen_fds < 0) { + _E("invalid systemd environment"); + return -1; + } else if (listen_fds > 0) { + for (i = 0; i < listen_fds; i++) { + fd = SD_LISTEN_FDS_START + i; + if (sd_is_socket_unix(fd, SOCK_STREAM, 1, saddr.sun_path, 0)) + return fd; + } + _E("socket not found: %s", saddr.sun_path); + return -1; + } + /* Create basedir for our sockets */ orig_mask = umask(0); (void) mkdir(AUL_SOCK_PREFIX, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX); @@ -77,9 +97,6 @@ int __create_server_sock(int pid) } } - memset(&saddr, 0, sizeof(saddr)); - saddr.sun_family = AF_UNIX; - snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid); unlink(saddr.sun_path); /* labeling to socket for SMACK */ diff --git a/src/wrt-launchpad-daemon/src/process_pool.c b/src/wrt-launchpad-daemon/src/process_pool.c index 327bbe4..170ea68 100644 --- a/src/wrt-launchpad-daemon/src/process_pool.c +++ b/src/wrt-launchpad-daemon/src/process_pool.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "process_pool.h" #include "simple_util.h" @@ -41,8 +42,30 @@ int __create_process_pool_server() { struct sockaddr_un addr; int fd = -1; + int listen_fds=0; + int i; memset(&addr, 0x00, sizeof(struct sockaddr_un)); + addr.sun_family = AF_UNIX; + snprintf(addr.sun_path, UNIX_PATH_MAX, "%s/%s", TMP_PATH, PROCESS_POOL_SERVER); + + listen_fds = sd_listen_fds(0); + if (listen_fds < 0) + { + _E("invalid systemd environment"); + return -1; + } + else if (listen_fds > 0) + { + for (i = 0; i < listen_fds; i++) + { + fd = SD_LISTEN_FDS_START + i; + if (sd_is_socket_unix(fd, SOCK_STREAM, 1, addr.sun_path, 0)) + return fd; + } + _E("socket not found: %s", addr.sun_path); + return -1; + } fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); @@ -52,8 +75,6 @@ int __create_process_pool_server() goto err_create_process_pool_server; } - addr.sun_family = AF_UNIX; - snprintf(addr.sun_path, UNIX_PATH_MAX, "%s/%s", TMP_PATH, PROCESS_POOL_SERVER); unlink(addr.sun_path); _D("bind to %s", addr.sun_path); diff --git a/src/wrt-launchpad-daemon/wrt_launchpad_run.sh b/src/wrt-launchpad-daemon/wrt_launchpad_run.sh deleted file mode 100644 index ebe0936..0000000 --- a/src/wrt-launchpad-daemon/wrt_launchpad_run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -/usr/bin/wrt_launchpad_daemon " " & diff --git a/packaging/wrt_launchpad_daemon@.service b/systemd/wrt_launchpad_daemon@.service similarity index 97% rename from packaging/wrt_launchpad_daemon@.service rename to systemd/wrt_launchpad_daemon@.service index 21f6f26..dca9a0a 100644 --- a/packaging/wrt_launchpad_daemon@.service +++ b/systemd/wrt_launchpad_daemon@.service @@ -1,6 +1,5 @@ [Unit] Description=Start the wrt_launchpad_daemon -After=ac.service [Service] EnvironmentFile=/etc/sysconfig/tizen-mobile-ui diff --git a/systemd/wrt_launchpad_daemon_1.socket b/systemd/wrt_launchpad_daemon_1.socket new file mode 100644 index 0000000..9989eef --- /dev/null +++ b/systemd/wrt_launchpad_daemon_1.socket @@ -0,0 +1,10 @@ +[Socket] +ListenStream=/tmp/alaunch/-3 +DirectoryMode=0777 +SocketMode=0777 +SmackLabelIPIn=* +SmackLabelIPOut=@ +Service=wrt_launchpad_daemon@app.service + +[Install] +WantedBy=sockets.target diff --git a/systemd/wrt_launchpad_daemon_2.socket b/systemd/wrt_launchpad_daemon_2.socket new file mode 100644 index 0000000..dff27df --- /dev/null +++ b/systemd/wrt_launchpad_daemon_2.socket @@ -0,0 +1,7 @@ +[Socket] +ListenStream=/tmp/wrt_process_pool_server +SocketMode=0777 +Service=wrt_launchpad_daemon@app.service + +[Install] +WantedBy=sockets.target diff --git a/tests/widgets/TestInit.cpp b/tests/widgets/TestInit.cpp index 2e1ac8f..b728f69 100644 --- a/tests/widgets/TestInit.cpp +++ b/tests/widgets/TestInit.cpp @@ -26,7 +26,7 @@ int main (int argc, char *argv[]) { - LogInfo("Starting tests"); + LogDebug("Starting tests"); WrtDB::WrtDatabase::attachToThreadRW(); int status = diff --git a/tests/widgets/common/include/mock/MockContextManager.h b/tests/widgets/common/include/mock/MockContextManager.h index b3a6b7f..c1734df 100644 --- a/tests/widgets/common/include/mock/MockContextManager.h +++ b/tests/widgets/common/include/mock/MockContextManager.h @@ -21,14 +21,14 @@ #ifndef MOCKCONTEXTMANAGER_H #define MOCKCONTEXTMANAGER_H -#include +#include -class MockContextManager : public WRT::AbstractContextManager +class MockContextManager : public ViewModule::IContextManager { public: MockContextManager(const std::string& tizenAppId, - Ewk_Context* ewkContext, - ViewModule::IViewModulePtr viewModule); + Ewk_Context* ewkContext, + ViewModule::IViewModulePtr viewModule); virtual ~MockContextManager(); Ewk_Context* getEwkContext() const; void handleLowMemory(); diff --git a/tests/widgets/common/src/RunnableObjectStateTester.cpp b/tests/widgets/common/src/RunnableObjectStateTester.cpp index 6f39595..b6e98d0 100644 --- a/tests/widgets/common/src/RunnableObjectStateTester.cpp +++ b/tests/widgets/common/src/RunnableObjectStateTester.cpp @@ -155,7 +155,7 @@ void RunnableObjectStateTester::runTest(RunnableObjectStateTester::Test func) WRT::RunnableWidgetObject * m_widget_impl = dynamic_cast(m_widget.get()); Assert(m_widget_impl); m_widget_impl->setViewModule(ViewModule::IViewModulePtr(new MockViewModule())); - m_widget_impl->setContextManagerFactoryMethod(WRT::makeContextManagerFactoryMethod()); + m_widget_impl->setContextManagerFactoryMethod(ViewModule::makeContextManagerFactoryMethod()); if(!m_widget) { ThrowMsg(CoreModuleFailure, "getRunnableWidgetObject() fails"); diff --git a/tests/widgets/common/src/mock/MockContextManager.cpp b/tests/widgets/common/src/mock/MockContextManager.cpp index 38ed673..1e94d57 100644 --- a/tests/widgets/common/src/mock/MockContextManager.cpp +++ b/tests/widgets/common/src/mock/MockContextManager.cpp @@ -24,7 +24,7 @@ MockContextManager::MockContextManager( const std::string& tizenAppId, Ewk_Context* ewkContext, ViewModule::IViewModulePtr viewModule) : - AbstractContextManager(tizenAppId, ewkContext, viewModule) + ViewModule::IContextManager(tizenAppId, ewkContext, viewModule) { } @@ -40,3 +40,21 @@ Ewk_Context* MockContextManager::getEwkContext() const void MockContextManager::handleLowMemory() { } + +namespace ViewModule { + +ContextManagerPtr contextManagerFactoryMethod( + const std::string& id, + Ewk_Context* c, + IViewModulePtr view) +{ + ContextManagerPtr ptr (new MockContextManager(id, c, view)); + return ptr; +} + +ContextManagerFactoryMethod makeContextManagerFactoryMethod() +{ + return contextManagerFactoryMethod; +} + +} // namespace ViewModule \ No newline at end of file diff --git a/wrt_env.sh b/wrt_env.sh index 999140b..be0cb5c 100644 --- a/wrt_env.sh +++ b/wrt_env.sh @@ -2,3 +2,5 @@ #export WRT_WILL_SEND_REQUEST_LOG_ENABLE=ON #export WRT_LOAD_PLUGINS_LOG_ENABLE=ON #export WRT_FRAME_RENDERED_LOG_ENABLE=ON +#export WRT_WIDGET_DATA_TYPES_LOG_ENABLE=ON + -- 2.7.4