Add build config support for X11 31/4231/1
authorRusty Lynch <rusty.lynch@intel.com>
Tue, 18 Jun 2013 02:17:04 +0000 (19:17 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Mon, 24 Jun 2013 23:00:19 +0000 (16:00 -0700)
CMakeLists.txt
packaging/wrt.spec
src/CMakeLists.txt
src/view/webkit/view_logic_service_support.cpp
src/wrt-client/window_data.cpp

index 3097d32..b2207ee 100644 (file)
@@ -52,6 +52,10 @@ OPTION(DECRYPT_SUPPORT "Enable appmanager capabilities" ON)
 IF(DECRYPT_SUPPORT)
     ADD_DEFINITIONS("-DDECRYPT")
 ENDIF(DECRYPT_SUPPORT)
+OPTION(X11_SUPPORT "Enable X11" ON)
+IF(X11_SUPPORT)
+    ADD_DEFINITIONS("-DX11")
+ENDIF(X11_SUPPORT)
 IF(CSP_SUPPORT)
     ADD_DEFINITIONS("-DCSP_ENABLED")
 ENDIF(CSP_SUPPORT)
index 8ae66df..4954b7b 100644 (file)
@@ -93,8 +93,10 @@ export LDFLAGS+="-Wl,--rpath=%{_libdir}"
          -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
 %if %{with wayland}
          -DDECRYPT_SUPPORT=Off \
+         -DX11_SUPPORT=Off \
 %else
          -DDECRYPT_SUPPORT=On \
+         -DX11_SUPPORT=On \
 %endif
         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
 
index 33084d2..879c80d 100644 (file)
@@ -61,7 +61,7 @@ SET(WRT_BASIC_DEP
     security-client
 )
 
-
+IF(X11_SUPPORT)
 SET(SYS_WRT_BASIC_DEP
     openssl
     libpcrecpp
@@ -84,6 +84,30 @@ SET(SYS_WRT_BASIC_DEP
     secure-storage
     app2sd
 )
+ELSE(X11_SUPPORT)
+SET(SYS_WRT_BASIC_DEP
+    openssl
+    libpcrecpp
+    glib-2.0
+    gthread-2.0
+    libsoup-2.4
+    libiri
+    appsvc
+    cert-svc-vcore
+    edje
+    ecore
+    ecore-wayland
+    evas
+    eina
+    ewebkit2
+    elementary
+    vconf
+    cert-svc
+    ui-gadget-1
+    secure-storage
+    app2sd
+)
+ENDIF(X11_SUPPORT)
 
 IF(SMACK_ENABLED)
   LIST(APPEND SYS_WRT_BASIC_DEP libprivilege-control)
index 3f55d2c..65e1e21 100644 (file)
@@ -44,14 +44,17 @@ namespace ServiceSupport {
 
 void setWebProcessPidWindowProperty(unsigned int window, unsigned int pid)
 {
+#ifdef X11
     ecore_x_window_prop_property_set(
         window,
         ecore_x_atom_get(XWINDOW_WEBPROCESS_PID_PROPERTY_NAME),
         ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
+#endif
 }
 
 unsigned int checkProperty(int pid, Display* display, Window window, Atom atom)
 {
+#ifdef X11
     Atom type;
     int format;
     unsigned long count;
@@ -86,11 +89,13 @@ unsigned int checkProperty(int pid, Display* display, Window window, Atom atom)
         }
         XFree(propPID);
     }
+#endif
     return 0;
 }
 
 unsigned int XWindowIterate(int pid, Display* display, Window window)
 {
+#ifdef X11
     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);
@@ -127,6 +132,9 @@ unsigned int XWindowIterate(int pid, Display* display, Window window)
 
     XFree(children);
     return result;
+#else
+    return 0;
+#endif
 }
 
 std::string commandLineByPid(int pid)
@@ -146,6 +154,7 @@ std::string commandLineByPid(int pid)
 
 unsigned int xWindowByPid(int pid)
 {
+#ifdef X11
    Display *display = XOpenDisplay(NULL);
    if (!display) {
        LogError("XOpenDisplay failed");
@@ -154,6 +163,9 @@ unsigned int xWindowByPid(int pid)
    int screen = DefaultScreen(display);
    Window rootWindow = RootWindow(display, screen);
    return XWindowIterate(pid, display, rootWindow);
+#else
+   return 0;
+#endif
 }
 
 std::string mime(bundle *b)
@@ -218,4 +230,4 @@ bool isService(WidgetModel *model)
 
 }
 
-#endif
\ No newline at end of file
+#endif
index 8a22767..4568ccd 100644 (file)
 #include <ui-gadget.h>
 #include <dpl/log/log.h>
 
+#ifndef X11
+#include <Ecore_Wayland.h>
+#endif
+
 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";
@@ -84,7 +88,9 @@ void WindowData::init()
     m_user_layout = createUserLayout(m_navigation);
     evas_object_show(m_user_layout);
 
+#ifdef X11
     UG_INIT_EFL(m_win, UG_OPT_INDICATOR_ENABLE);
+#endif
     m_initialized = true;
 }
 
@@ -139,16 +145,20 @@ void WindowData::createFloatBackButton()
 
 Evas_Object* WindowData::createWindow(unsigned long pid)
 {
+    int w, h;
     ADD_PROFILING_POINT("elm_win_add", "start");
     Evas_Object* window = elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC);
     ADD_PROFILING_POINT("elm_win_add", "stop");
+#ifdef X11
     ecore_x_window_prop_property_set(
         elm_win_xwindow_get(window),
         ECORE_X_ATOM_NET_WM_PID,
         ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
     elm_win_conformant_set(window, EINA_TRUE);
-    int w, h;
     ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+#else
+    ecore_wl_screen_size_get(&w, &h);
+#endif
     evas_object_resize(window, w, h);
 
     evas_object_smart_callback_add(window,