SET(TARGET_PROFILING_LIB "wrt-profiling")
SET(TARGET_PLUGIN_MODULE_LIB "wrt-plugin-module")
SET(TARGET_VIEW_MODULE_LIB "wrt-view-module")
+SET(TARGET_VIEW_COMMON_LIB_STATIC "wrt-view-common")
SET(TARGET_CORE_MODULE_LIB "wrt-core-module")
SET(TARGET_INJECTED_BUNDLE_LIB "wrt-injected-bundle")
SET(PROF_LIB "")
#git:framework/web/wrt
Name: wrt
Summary: web runtime
-Version: 0.8.251
+Version: 0.8.257
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
%endif
%build
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+%endif
+
export LDFLAGS+="-Wl,--rpath=/usr/lib"
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
INCLUDE_DIRECTORIES( SYSTEM ${SYS_CORE_MODULE_DEP_INCLUDE_DIRS})
+
+#
+#Set libraries that should be linked to the file that is linking wrt-core-module
+#Do not set any static libraries as it will be included in wrt-core-module
+#
+SET(WRT_CORE_MODULE_INTERFACE_LIBRARIES
+ ${WRT_ENGINE_DEPS_LIBRARIES}
+ ${SYS_WRT_ENGINE_DEPS_LIBRARIES}
+ ${CORE_MODULE_DEP_LIBRARIES}
+ ${SYS_CORE_MODULE_DEP_LIBRARIES}
+)
+
TARGET_LINK_LIBRARIES(${TARGET_CORE_MODULE_LIB}
-# include all symbols that could be used by wrt-client
+# include all symbols that could be used by wrt-client or other binaries
"-Wl,--whole-archive"
${TARGET_WRT_ENGINE_STATIC}
+ ${TARGET_VIEW_COMMON_LIB_STATIC}
"-Wl,--no-whole-archive"
- ${WRT_ENGINE_DEPS_LIBRARIES}
- ${SYS_WRT_ENGINE_DEPS_LIBRARIES}
${TARGET_VIEW_MODULE_LIB}
- ${CORE_MODULE_DEP_LIBRARIES}
- ${SYS_CORE_MODULE_DEP_LIBRARIES}
+ ${WRT_CORE_MODULE_INTERFACE_LIBRARIES}
+)
+
+SET_TARGET_PROPERTIES(${TARGET_CORE_MODULE_LIB}
+ PROPERTIES
+ LINK_INTERFACE_LIBRARIES "${WRT_CORE_MODULE_INTERFACE_LIBRARIES}"
)
INSTALL(TARGETS ${TARGET_CORE_MODULE_LIB}
*/
#include "application_data.h"
-#include <dpl/singleton_impl.h>
+#include <dpl/singleton_safe_impl.h>
#include <dpl/log/log.h>
#include <bundle.h>
-IMPLEMENT_SINGLETON(ApplicationData)
+IMPLEMENT_SAFE_SINGLETON(ApplicationData)
ApplicationData::ApplicationData() :
m_originBundle(NULL),
${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
${PROJECT_SOURCE_DIR}/src/view/common/view_logic_custom_header_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
namespace ToUIProcess {
const char * const BLOCKED_URL = "ToUIProcess::BLOCKED_URL";
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
const char * const SEND_WEBPROCESS_PID = "ToUIProcess::SEND_WEBPROCESS_PID";
-#endif
} // namespace ToUIProcess
namespace TizenScheme {
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file view_logic_service_support.cpp
- * @author Lukasz Marek (l.marek@samsung.com)
- * @version 1.0
- */
-
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
-
-#include "view_logic_service_support.h"
-#include <string>
-#include <cstring>
-#include <sstream>
-#include <iostream>
-#include <fstream>
-#include <pcrecpp.h>
-#include <appsvc.h>
-#include <aul.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-namespace {
-const char *XWINDOW_PID_PROPERTY_NAME = "_NET_WM_PID";
-const char *XWINDOW_WEBPROCESS_PID_PROPERTY_NAME = "WRT_WEB_PROCESS_PID";
-}
-
-namespace ServiceSupport {
-
-void setWebProcessPidWindowProperty(unsigned int window, unsigned int pid)
-{
- ecore_x_window_prop_property_set(
- window,
- ecore_x_atom_get(XWINDOW_WEBPROCESS_PID_PROPERTY_NAME),
- ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
-}
-
-unsigned int checkProperty(int pid, Display* display, Window window, Atom atom)
-{
- Atom type;
- int format;
- unsigned long count;
- unsigned long bytesAfter;
- unsigned char *propPID = 0;
-
- if (Success == XGetWindowProperty(display,
- window,
- atom,
- 0,
- 1,
- False,
- XA_CARDINAL,
- &type,
- &format,
- &count,
- &bytesAfter,
- &propPID))
- {
- if (count) {
- if (XA_CARDINAL == type && 32 == format) {
- unsigned int windowpid = *((unsigned int *)propPID);
- if (pid == windowpid) {
- LogDebug("found window " << window);
- XFree(propPID);
- return window;
- }
- }
- else {
- LogError("Unsupported format returned");
- }
- }
- XFree(propPID);
- }
- return 0;
-}
-
-unsigned int XWindowIterate(int pid, Display* display, Window window)
-{
- Atom atomPID = XInternAtom(display, XWINDOW_PID_PROPERTY_NAME, True);
- Atom atomPIDWP = XInternAtom(display, XWINDOW_WEBPROCESS_PID_PROPERTY_NAME, True);
- unsigned int result = checkProperty(pid, display, window, atomPID);
- if (0 == result)
- {
- result = checkProperty(pid, display, window, atomPIDWP);
- }
- if (result) {
- return result;
- }
-
- Window root;
- Window parent;
- Window *children = NULL;
- unsigned int noOfChildren;
- int status = XQueryTree(display,
- window,
- &root,
- &parent,
- &children,
- &noOfChildren);
-
- if (0 == status || 0 == noOfChildren) {
- XFree(children);
- return 0;
- }
-
- for (unsigned int i = 0; i < noOfChildren; ++i) {
- result = XWindowIterate(pid, display, children[i]);
- if (result) {
- break;
- }
- }
-
- XFree(children);
- return result;
-}
-
-std::string commandLineByPid(int pid)
-{
- std::stringstream file;
- std::string result;
- file << "/proc/" << pid << "/cmdline";
- std::ifstream in(file.str().c_str(), std::ios::in);
- if (in.is_open()) {
- std::getline(in, result);
- }
- else {
- LogDebug("Cannot read cmdline");
- }
- return result;
-}
-
-unsigned int xWindowByPid(int pid)
-{
- Display *display = XOpenDisplay(NULL);
- if (!display) {
- LogError("XOpenDisplay failed");
- return 0;
- }
- int screen = DefaultScreen(display);
- Window rootWindow = RootWindow(display, screen);
- return XWindowIterate(pid, display, rootWindow);
-}
-
-std::string mime(bundle *b)
-{
- const char *value = appsvc_get_mime(b);
- return value ? value : std::string();
-}
-
-std::string operation(bundle *b)
-{
- const char *value = appsvc_get_operation(b);
- return value ? value : std::string();
-}
-
-std::string uri(bundle *b)
-{
- const char *value = appsvc_get_uri(b);
- return value ? value : std::string();
-}
-
-Disposition disposition(WidgetModel *model)
-{
- Assert(model);
- Assert(isService(model));
- WrtDB::WidgetAppControlList appControlList = model->AppControlList.Get();
- unsigned index = *model->AppControlIndex.Get();
- FOREACH(appControlIt, appControlList)
- {
- if (index == appControlIt->index)
- {
- switch(appControlIt->disposition) {
- case WrtDB::WidgetAppControl::Disposition::INLINE:
- LogDebug("Control disposition: INLINE");
- return INLINE;
- default:
- break;
- }
- }
- }
- return WINDOW;
-}
-
-int callerPID(bundle *b)
-{
- const char *pid = appsvc_get_data(b, AUL_K_ORG_CALLER_PID);
- if (pid) {
- int result = 0;
- std::stringstream ss(pid);
- if (!(ss >> result)) {
- LogError("PID value is incorrect");
- return 0;
- }
- return result;
- }
- return 0;
-}
-
-bool isService(WidgetModel *model)
-{
- return !model->AppControlIndex.Get().IsNull();
-}
-
-}
-
-#endif
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * @file view_logic_service_support.h
- * @author Lukasz Marek (l.marek@samsung.com)
- * @version 1.0
- */
-
-#ifndef SERVICE_SUPPORT_H_
-#define SERVICE_SUPPORT_H_
-
-#include <bundle.h>
-#include <widget_model.h>
-
-namespace ServiceSupport {
-
-typedef enum
-{
- WINDOW,
- INLINE
-} Disposition;
-
-void setWebProcessPidWindowProperty(unsigned int window, unsigned int pid);
-int callerPID(bundle *b);
-bool isService(WidgetModel *model);
-Disposition disposition(WidgetModel *model);
-unsigned int xWindowByPid(int pid);
-
-}
-
-#endif
${VIEW_MODULE_SOURCES}
)
-TARGET_LINK_LIBRARIES(
- ${TARGET_VIEW_MODULE_LIB}
- ${TARGET_VIEW_COMMON_LIB_STATIC}
+TARGET_LINK_LIBRARIES(${TARGET_VIEW_MODULE_LIB}
${VIEW_MODULE_DEP_LIBRARIES}
- ${TARGET_WRT_ENGINE_STATIC}
${PROF_LIB}
# ${TARGET_PLUGIN_MODULE_LIB}
)
_E("## Db attach was failed! Terminate WebProcess by force. ##");
exit(-1);
}
-
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
- sendWebProcessPid();
-#endif
}
Bundle::~Bundle()
return str;
}
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
-void Bundle::sendWebProcessPid()
-{
- std::stringstream strPid;
- strPid << getpid();
- WKStringRef pidStr = WKStringCreateWithUTF8CString(strPid.str().c_str());
- WKStringRef message =
- WKStringCreateWithUTF8CString(
- Message::ToUIProcess::SEND_WEBPROCESS_PID);
- WKBundlePostMessage(m_bundle, message, pidStr);
- WKRelease(pidStr);
- WKRelease(message);
-}
-#endif
-
extern "C"
{
WK_EXPORT
std::string & argEncodedBundle,
std::string & argTheme);
-
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
- void sendWebProcessPid();
-#endif
#ifdef CORS_WHITELISTING_ENABLED
void bypassCORSforWARPAccessList(WrtDB::WidgetDAOReadOnly &dao);
#endif
#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
#include <popup-runner/PopupInvoker.h>
#include <plugins-ipc-message/ipc_message_support.h>
-
-#include <appsvc/appsvc.h>
-#include <utilX.h>
-
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
-#include "view_logic_service_support.h"
-
-extern "C" int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id);
-extern "C" int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, appsvc_host_res_fn cbfunc, void *data);
-#endif
-
+#include <appsvc.h>
namespace {
// IME State value
const char * const IME_STATE_ON = "on";
return true;
}
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
-int ViewLogic::appServiceCallerIsKilled(void *data)
-{
- Assert(data);
- ViewLogic *This = static_cast<ViewLogic *>(data);
- if (!This->m_cbs->webkitExit.empty()) {
- This->m_cbs->webkitExit();
- }
- return 0;
-}
-#endif
-
void ViewLogic::prepareView(WidgetModel* m, const std::string &startUrl)
{
LogDebug("View prepare");
Assert(NULL != m_ewkContext);
Assert(m_window);
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
- if (ServiceSupport::isService(m_model))
- {
- bundle *b = ApplicationDataSingleton::Instance().getBundle();
- if (ServiceSupport::Disposition::INLINE == ServiceSupport::disposition(m_model))
- {
- LogDebug("Set up INLINE disposition");
- int pid = ServiceSupport::callerPID(b);
- if (pid) {
- unsigned windowId = ServiceSupport::xWindowByPid(pid);
- appsvc_allow_transient_app(b, windowId);
- appsvc_request_transient_app(b, elm_win_xwindow_get(m_window), appServiceCallerIsKilled, this);
- }
- }
- else
- {
- LogDebug("Set up WINDOW disposition");
- }
- }
- else
- {
- LogDebug("Starting regular widget");
- }
-#endif
ADD_PROFILING_POINT("initializeSupport", "start");
initializeSupport();
removeEwkView(m_ewkViewList.back());
}
m_ewkViewList.clear();
+ m_currentEwkView = NULL;
// create new webview
createEwkView(evas_object_evas_get(m_window));
// done by WebProcess itself (see: wrt-injected-bundle.cpp
// and bundle_uri_handling.cpp)
requestUrlBlocked(std::string(body));
- }
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
- else if (!strcmp(name, Message::ToUIProcess::SEND_WEBPROCESS_PID)) {
- std::stringstream ss(body);
- unsigned int pid = 0;
- ss >> pid;
- ServiceSupport::setWebProcessPidWindowProperty(
- elm_win_xwindow_get(m_window),
- pid);
- }
-#endif
- else if (!strcmp(name, Message::TizenScheme::CLEAR_ALL_COOKIES)) {
+ } else if (!strcmp(name, Message::TizenScheme::CLEAR_ALL_COOKIES)) {
Ewk_Cookie_Manager* cookieManager =
ewk_context_cookie_manager_get(m_ewkContext);
if (!cookieManager) {
Evas_Object* obj,
void* eventInfo);
-#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
- static int appServiceCallerIsKilled(void *data);
-#endif
-
void attachToCustomHandlersDao();
void detachFromCustomHandlersDao();
static Eina_Bool exitAppIdlerCallback(void* /*data*/)
{
- // webapp termination
- ewk_shutdown();
elm_exit();
return ECORE_CALLBACK_CANCEL;
}
${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/client_submode_support.cpp
${PROJECT_SOURCE_DIR}/src/wrt-client/splash_screen_support.cpp
${PROJECT_SOURCE_DIR}/src/wrt-client/wrt-client.cpp
${PROJECT_SOURCE_DIR}/src/wrt-client/auto_rotation_support.cpp
TARGET_LINK_LIBRARIES(${TARGET_WRT_CLIENT}
${CLIENT_DEP_LIBRARIES}
${TARGET_CORE_MODULE_LIB}
- ${TARGET_WRT_ENGINE_STATIC}
${SMACK_LABELING_SUPPORT_STATIC}
"-pie"
)
--- /dev/null
+/*
+ * 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_submode_support.cpp
+ * @author Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#include "client_submode_support.h"
+
+#include <memory>
+#include <sstream>
+#include <Ecore.h>
+#include <Elementary.h>
+#include <bundle.h>
+
+#include <dpl/assert.h>
+#include <dpl/log/secure_log.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+#include <application_data.h>
+
+namespace ClientModule {
+namespace {
+const unsigned int EMPTY = 0;
+const unsigned int INLINE_MODE = 1;
+const unsigned int TRANSIENT_WINDOW = 1 << 1;
+}
+
+ //Implementation class
+class SubmodeSupportImplementation
+{
+ private:
+ bool m_initialized;
+ WrtDB::TizenAppId m_appId;
+ unsigned int m_mode;
+
+ void setMode(const int mode)
+ {
+ m_mode |= mode;
+ }
+
+ bool getMode(const int mode)
+ {
+ return m_mode & mode;
+ }
+
+ static Eina_Bool destoryCallback(void* data, int /*type*/, void* event)
+ {
+ _D("called");
+ Ecore_X_Window callerId = reinterpret_cast<Ecore_X_Window>(data);
+
+ Assert(event);
+ Ecore_X_Event_Window_Hide* ev =
+ static_cast<Ecore_X_Event_Window_Hide*>(event);
+
+ if(ev->win == callerId) {
+ elm_exit();
+ }
+ return ECORE_CALLBACK_CANCEL;
+ }
+
+ public:
+ SubmodeSupportImplementation() :
+ m_initialized(false),
+ m_mode(EMPTY)
+ {
+ }
+
+ void initialize(WrtDB::TizenAppId appId)
+ {
+ _D("called");
+
+ m_appId = appId;
+ WrtDB::WidgetDAOReadOnly dao(m_appId);
+ WrtDB::WidgetAppControlList widgetApplicationControlList;
+ dao.getAppControlList(widgetApplicationControlList);
+ FOREACH(it, widgetApplicationControlList) {
+ if (it->disposition ==
+ WrtDB::WidgetAppControl::Disposition::INLINE)
+ {
+ _D("disposition");
+ setMode(INLINE_MODE);
+ }
+ }
+
+ m_initialized = true;
+ }
+
+ void deinitialize(void)
+ {
+ _D("called");
+ m_initialized = false;
+ }
+
+ bool isInlineMode(void)
+ {
+ return getMode(INLINE_MODE);
+ }
+
+ bool isNeedTerminateOnSuspend(void)
+ {
+ if (isInlineMode()) {
+ return !getMode(TRANSIENT_WINDOW);
+ }
+ return false;
+ }
+
+ bool transientWindow(Ecore_X_Window calleeId)
+ {
+ _D("called");
+ if (!m_initialized) {
+ _E("not initialized");
+ return false;
+ }
+
+ bundle* b = ApplicationDataSingleton::Instance().getBundle();
+ if (!b) {
+ _W("Service data is empty");
+ return false;
+ }
+ const char* callerIdPtr = bundle_get_val(b, "__APP_SVC_K_WIN_ID__");
+ if (callerIdPtr) {
+ Ecore_X_Window callerId = atoi(callerIdPtr);
+ _D("Caller x handle = %u", callerId);
+ ecore_x_icccm_transient_for_set(calleeId, callerId);
+ ecore_x_window_client_manage(callerId);
+ ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY,
+ destoryCallback,
+ reinterpret_cast<void*>(callerId));
+ setMode(TRANSIENT_WINDOW);
+ } else {
+ _W("Service data is empty");
+ return false;
+ }
+
+ return true;
+ }
+};
+
+SubmodeSupport::SubmodeSupport() :
+ m_impl(new SubmodeSupportImplementation())
+{
+}
+
+SubmodeSupport::~SubmodeSupport()
+{
+}
+
+void SubmodeSupport::initialize(WrtDB::TizenAppId appId)
+{
+ m_impl->initialize(appId);
+}
+
+void SubmodeSupport::deinitialize(void)
+{
+ m_impl->deinitialize();
+}
+
+bool SubmodeSupport::isInlineMode(void)
+{
+ return m_impl->isInlineMode();
+}
+
+bool SubmodeSupport::isNeedTerminateOnSuspend(void)
+{
+ return m_impl->isNeedTerminateOnSuspend();
+}
+
+bool SubmodeSupport::transientWindow(Ecore_X_Window calleeId)
+{
+ return m_impl->transientWindow(calleeId);
+}
+} // namespace ClientModule
--- /dev/null
+/*
+ * 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_submode_support.h
+ * @author Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#ifndef CLIENT_SUBMODE_SUPPORT_H_
+#define CLIENT_SUBMODE_SUPPORT_H_
+
+#include <memory>
+#include <Ecore_X.h>
+
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+namespace ClientModule {
+class SubmodeSupportImplementation;
+class SubmodeSupport
+{
+ public:
+ SubmodeSupport();
+ virtual ~SubmodeSupport();
+ void initialize(WrtDB::TizenAppId appId);
+ void deinitialize(void);
+ bool isInlineMode(void);
+ bool isNeedTerminateOnSuspend(void);
+ bool transientWindow(Ecore_X_Window win);
+
+ private:
+ std::unique_ptr<SubmodeSupportImplementation> m_impl;
+};
+} // namespace ClientModule
+#endif // CLIENT_SUBMODE_SUPPORT_H_
\ No newline at end of file
#include "client_command_line_parser.h"
#include "client_ide_support.h"
#include "client_service_support.h"
+#include "client_submode_support.h"
//W3C PACKAGING enviroment variable name
#define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH"
m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED),
m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED),
m_isWebkitFullscreen(false),
- m_isFullscreenByPlatform(false)
+ m_isFullscreenByPlatform(false),
+ m_submodeSupport(new ClientModule::SubmodeSupport())
{
Touch();
LogDebug("App Created");
LogWarning("Widget is not running to be suspended");
return;
}
+ if (m_submodeSupport->isNeedTerminateOnSuspend()) {
+ LogDebug("Current mode cannot support suspend");
+ elm_exit();
+ return;
+ }
m_widget->Suspend();
m_widgetState = WidgetState_Suspended;
}
WrtDB::WidgetSettings widgetSettings;
m_dao->getWidgetSettings(widgetSettings);
m_settingList.reset(new WidgetSettingList(widgetSettings));
+ m_submodeSupport->initialize(DPL::FromASCIIString(m_tizenId));
DPL::Optional<DPL::String> defloc = m_dao->getDefaultlocale();
if (!defloc.IsNull()) {
//you can't show window with splash screen before PrepareView
//ewk_view_add_with_context() in viewLogic breaks window
m_windowData->init();
+ // sub-mode support
+ if (m_submodeSupport->isInlineMode()) {
+ if (m_submodeSupport->transientWindow(
+ elm_win_xwindow_get(
+ m_windowData->getEvasObject(Layer::WINDOW))))
+ {
+ LogDebug("Success to set submode");
+ } else {
+ LogWarning("Fail to set submode");
+ }
+
+ }
m_windowData->smartCallbackAdd(Layer::FOCUS,
"focused",
focusedCallback,
m_widget->Hide();
// AutoRotation, focusCallback use m_widget pointer internally.
// It must be unset before m_widget is released.
+ m_submodeSupport->deinitialize();
unsetWindowOrientation();
m_windowData->smartCallbackDel(Layer::FOCUS,
"focused",
#ifndef WRT_CLIENT_H
#define WRT_CLIENT_H
+#include <memory>
#include <dpl/application.h>
#include <dpl/generic_event.h>
#include <dpl/event/controller.h>
DECLARE_GENERIC_EVENT_0(NextStepEvent)
+namespace ClientModule {
+class SubmodeSupport;
+}
+
class WrtClient :
public DPL::Application,
private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
std::string m_currentViewMode;
bool m_isWebkitFullscreen;
bool m_isFullscreenByPlatform;
+
+ std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
};
#endif // WRT_CLIENT_H
break;
case 'd':
- // create service
- ret = service_create(&serviceHandle);
- if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) {
- LogError("Fail to create service");
- return FALSE;
- }
-
- // set debug mode
- ret = service_add_extra_data(serviceHandle,
- "debug",
- "true");
- if (SERVICE_ERROR_NONE != ret) {
- LogError("Fail to set debug mode [" << ret << "]");
- service_destroy(serviceHandle);
- return FALSE;
- }
-
- // set pid
- snprintf(pid, sizeof(pid), "%d", getpid());
- ret = service_add_extra_data(serviceHandle,
- "pid",
- pid);
- if (SERVICE_ERROR_NONE != ret) {
- LogError("Fail to set pid [" << ret << "]");
- service_destroy(serviceHandle);
- return FALSE;
- }
isDebugMode = true;
break;
}
if (op == 's') {
- /* check if this is request for debug mode, or not */
- if (true != isDebugMode) {
- // case of "-d" option, service_create is already allocated
- // create service
- ret = service_create(&serviceHandle);
- if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) {
- printf("result: %s\n", "failed");
- return -1;
- }
+ if (strlen(applicationId) <= 0) {
+ printf("result: %s\n", "failed");
+ return -1;
}
- if (strlen(applicationId) > 0) {
- // do setuid to '5000' uid to communicate
- //with webapp using RT signal.
- gid_t group_list[1];
- group_list[0] = LOGGING_DEFAULT_GID;
-
- if (setgroups(sizeof(group_list), group_list) < 0) {
- printf("result: %s\n", "failed");
- return -1;
- }
+ // create service
+ ret = service_create(&serviceHandle);
+ if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) {
+ printf("result: %s\n", "failed");
+ return -1;
+ }
- if (setreuid(WEBAPP_DEFAULT_UID, WEBAPP_DEFAULT_GID) < 0) {
- printf("result: %s\n", "failed");
- return -1;
- }
+ // set package
+ ret = service_set_package(serviceHandle, applicationId);
+ if (SERVICE_ERROR_NONE != ret) {
+ printf("result: %s\n", "failed");
+ service_destroy(serviceHandle);
+ return -1;
+ }
- // set package
- ret = service_set_package(serviceHandle, applicationId);
+ if (true == isDebugMode) {
+ // set debug mode
+ ret = service_add_extra_data(serviceHandle, "debug", "true");
if (SERVICE_ERROR_NONE != ret) {
- printf("result: %s\n", "failed");
+ LogError("Fail to set debug mode [" << ret << "]");
service_destroy(serviceHandle);
- return -1;
+ return FALSE;
}
- if (true == isDebugMode) {
- ecore_init();
- serviceTimer = ecore_timer_add(timeout, timerCallback, NULL);
+ // set pid
+ snprintf(pid, sizeof(pid), "%d", getpid());
+ ret = service_add_extra_data(serviceHandle, "pid", pid);
+ if (SERVICE_ERROR_NONE != ret) {
+ LogError("Fail to set pid [" << ret << "]");
+ service_destroy(serviceHandle);
+ return FALSE;
}
- //launch service
+ ecore_init();
+ serviceTimer = ecore_timer_add(timeout, timerCallback, NULL);
ret = service_send_launch_request(serviceHandle,
serviceReplyCallback,
serviceTimer);
- if (SERVICE_ERROR_NONE != ret) {
- printf("result: %s\n", "failed");
- service_destroy(serviceHandle);
- return -1;
- }
+ } else {
+ ret = service_send_launch_request(serviceHandle, NULL, NULL);
+ }
+ if (SERVICE_ERROR_NONE != ret) {
+ printf("result: %s\n", "");
service_destroy(serviceHandle);
- } else {
- printf("result: %s\n", "failed");
return -1;
}
+ service_destroy(serviceHandle);
+
if (true == isDebugMode) {
+ // wait response from callee
ecore_main_loop_begin();
return 0;
+ } else {
+ // This text should be showed for IDE
+ printf("result: %s\n", "launched");
}
- // This text should be showed for IDE
- printf("result: %s\n", "launched");
return 0;
} else if (op == 'k') {
bool isRunning = false;