Enable building without ecore-x 04/3604/1
authorRusty Lynch <rusty.lynch@intel.com>
Tue, 21 May 2013 01:06:02 +0000 (18:06 -0700)
committerRusty Lynch <rusty.lynch@intel.com>
Tue, 21 May 2013 01:22:30 +0000 (18:22 -0700)
Source/WebCore/platform/graphics/gstreamer/tizen/SharedVideoPlatformSurfaceTizen.cpp
Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/tizen/ClipboardHelper.cpp
Source/WebKit2/UIProcess/API/efl/tizen/ClipboardHelper.h
Source/WebKit2/UIProcess/API/efl/tizen/ScreenReaderProxy.cpp
Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
packaging/webkit2-efl.spec

index 044b166..397130a 100644 (file)
@@ -159,8 +159,12 @@ bool VideoPlatformSurface::createPlatformSurface(IntSize size)
         return false;
 
     if (!m_nativeDisplay) {
+#ifdef HAVE_ECORE_X
         ecore_x_init(0);
         m_nativeDisplay = (Display*)ecore_x_display_get();
+#else
+        m_nativeDisplay = 0;
+#endif
     }
 
     if (!m_nativeWindow)
@@ -279,13 +283,15 @@ void SharedVideoPlatformSurfaceTizen::registerDamageHandler()
 {
     if (!m_platformSurface)
         return;
-
+#ifdef HAVE_ECORE_X
     m_damage = ecore_x_damage_new(m_platformSurface->id(), ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES);
     m_damageHandler = ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, notifyDamageUpdated, this);
+#endif
 }
 
 void SharedVideoPlatformSurfaceTizen::unregisterDamageHandler()
 {
+#ifdef HAVE_ECORE_X
     if (m_damage) {
         ecore_x_damage_free(m_damage);
         m_damage = 0;
@@ -295,6 +301,7 @@ void SharedVideoPlatformSurfaceTizen::unregisterDamageHandler()
         ecore_event_handler_del(m_damageHandler);
         m_damageHandler = 0;
     }
+#endif
 }
 
 int SharedVideoPlatformSurfaceTizen::graphicsSurfaceFlags() const
index 888fbc9..8bdb54e 100755 (executable)
@@ -30,7 +30,9 @@
 
 #include "PluginProcess.h"
 #include <Ecore.h>
+#ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
+#endif
 #include <WebCore/RunLoop.h>
 #include <runtime/InitializeThreading.h>
 #include <wtf/MainThread.h>
@@ -76,8 +78,10 @@ WK_EXPORT int PluginProcessMainEfl(int argc, char* argv[])
     if (!eina_init())
         return 1;
 
+#ifdef HAVE_ECORE_X
     if (!ecore_x_init(0))
         return 1;
+#endif
 
     JSC::initializeThreading();
     WTF::initializeMainThread();
index c60fdcd..5a37231 100644 (file)
@@ -55,7 +55,9 @@
 #include "ewk_settings_private.h"
 #include "ewk_view_private.h"
 #include <Ecore_Evas.h>
+#ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
+#endif
 #include <WebKit2/WKPageGroup.h>
 #include <wtf/text/CString.h>
 
@@ -2466,6 +2468,7 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
 #endif
 
 #if ENABLE(TIZEN_ISF_PORT)
+#ifdef HAVE_ECORE_X
     Ecore_X_Window rootWin = ecore_x_window_root_first_get();
     ecore_x_event_mask_set(rootWin, ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
     Ecore_X_Atom xAtom = ecore_x_atom_get("X External Keyboard Exist");
@@ -2494,6 +2497,7 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter
         )
         return false;
 #endif
+#endif
 
     // caret position can be outside of visible rect.
     // we need to consider it.
index dace03f..6ae7b3d 100755 (executable)
@@ -31,7 +31,9 @@
 #include "PageClientImpl.h"
 #include <Evas.h>
 #include <Ecore_Evas.h>
+#ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
+#endif
 #include <Elementary.h>
 #include <X11/Xatom.h>
 #include <X11/Xlib.h>
@@ -50,9 +52,10 @@ enum ClipType
 
 struct ClipData
 {
+#ifdef HAVE_ECORE_X
     Ecore_X_Selection selection;
     void (* request)(Ecore_X_Window window, const char* pTarget);
-
+#endif
     Elm_Sel_Format format;
 
     Elm_Sel_Format requestedFormat;
@@ -61,8 +64,13 @@ struct ClipData
     ClipboardHelper* clipboardHelper;
 };
 
+#ifdef HAVE_ECORE_X
 typedef int (*ClipNotifyHandler)(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData);
+#else
+typedef int (*ClipNotifyHandler)(ClipData* clipData, void* notifyData);
+#endif
 
+#ifdef HAVE_ECORE_X
 enum
 {
     ATOM_TARGETS = 0,
@@ -100,6 +108,7 @@ struct AtomData
 
 AtomData atomList[ATOM_MAX];
 ClipData clipList[CLIP_TYPE_MAX];
+#endif // HAVE_ECORE_X
 
 static Eina_Bool cbhmPropertyChangeCallback(void* data, int type, void* event);
 static Eina_Bool clientMessageCallback(void* data, int type, void* event);
@@ -116,22 +125,27 @@ ClipboardHelper::ClipboardHelper(EwkViewImpl* viewImpl)
 #endif
 {
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
+#ifdef HAVE_ECORE_X
     m_clientMessageHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, clientMessageCallback, this);
 #endif
+#endif
 }
 
 ClipboardHelper::~ClipboardHelper()
 {
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
+#ifdef HAVE_ECORE_X
     ecore_event_handler_del(m_clientMessageHandler);
     m_clientMessageHandler = 0;
     clearClipboardSelectionHandler();
 #endif
+#endif
 }
 
 // This function references from elementary's cbhm_helper.c
 int ClipboardHelper::numberOfItems()
 {
+#ifdef HAVE_ECORE_X
     // 1. Get CBHM Ecore_X_Window.
     Ecore_X_Atom xAtom;
     xAtom = ecore_x_atom_get("CBHM_XWIN");
@@ -203,12 +217,13 @@ int ClipboardHelper::numberOfItems()
         free(data);
         return count;
     }
-
+#endif
     return 0;
 }
 
 void ClipboardHelper::setData(const String& data, const String& type)
 {
+#ifdef HAVE_ECORE_X
     Ecore_X_Atom dataType = 0;
 
     if (type == "PlainText" || type == "URIList" || type == "URL")
@@ -222,6 +237,7 @@ void ClipboardHelper::setData(const String& data, const String& type)
     }
 
     setClipboardItem(dataType, data);
+#endif
 }
 
 void ClipboardHelper::clear()
@@ -241,6 +257,7 @@ void ClipboardHelper::processResult(const String& data, const String& type)
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
 Eina_Bool cbhmPropertyChangeCallback(void* data, int type, void* event)
 {
+#ifdef HAVE_ECORE_x
     ClipboardHelper *clipboardHelper = static_cast<ClipboardHelper*>(data);
     Ecore_X_Event_Window_Property *ev = (Ecore_X_Event_Window_Property*) event;
 
@@ -248,12 +265,13 @@ Eina_Bool cbhmPropertyChangeCallback(void* data, int type, void* event)
         return ECORE_CALLBACK_PASS_ON;
 
     clipboardHelper->updateClipboardWindowState(ev);
-
+#endif
     return ECORE_CALLBACK_PASS_ON;
 }
 
 Eina_Bool clientMessageCallback(void* data, int type, void* event)
 {
+#ifdef HAVE_ECORE_X
     //This callback function is support for open CBHM window from IME clipboard button
     ClipboardHelper *clipboardHelper = static_cast<ClipboardHelper*>(data);
     Ecore_X_Event_Client_Message *ev = (Ecore_X_Event_Client_Message*) event;
@@ -264,7 +282,7 @@ Eina_Bool clientMessageCallback(void* data, int type, void* event)
     if (!strcmp("SET_OWNER", ev->data.b)) {
         clipboardHelper->openClipboardWindow(clipboardHelper->page()->editorState().isContentRichlyEditable);
     }
-
+#endif
     return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -277,6 +295,7 @@ static void pasteSelectedClipboardItem(const String& data, const String& type, C
 
 static Eina_Bool clearClip(void* data, int type, void* event)
 {
+#ifdef HAVE_ECORE_X
     Ecore_X_Event_Selection_Clear* clearEvent = (Ecore_X_Event_Selection_Clear*) event;
     Ecore_X_Window window = clearEvent->win;
 
@@ -284,12 +303,13 @@ static Eina_Bool clearClip(void* data, int type, void* event)
     clipList[clipType].requestedFormat = static_cast<Elm_Sel_Format>(ELM_SEL_FORMAT_TEXT | ELM_SEL_FORMAT_IMAGE);
 
     ecore_x_selection_secondary_request(window, ECORE_X_SELECTION_TARGET_TARGETS);
-
+#endif
     return ECORE_CALLBACK_PASS_ON;
 }
 
 static Eina_Bool notifyClip(void* data , int type, void* event)
 {
+#ifdef HAVE_ECORE_X
     Ecore_X_Event_Selection_Notify* notifytEvent = (Ecore_X_Event_Selection_Notify*) event;
 
     int i = 0;
@@ -310,10 +330,11 @@ static Eina_Bool notifyClip(void* data , int type, void* event)
             }
         }
     }
-
+#endif
     return ECORE_CALLBACK_PASS_ON;
 }
 
+#ifdef HAVE_ECORE_X
 static int notifyTarget(ClipData* clipData, Ecore_X_Event_Selection_Notify* notifyData)
 {
     Ecore_X_Atom dataType = 0;
@@ -351,6 +372,7 @@ static int notifyTarget(ClipData* clipData, Ecore_X_Event_Selection_Notify* noti
 
     FOUND:
     clipData->request(notifyData->win, atomList[j].pName);
+
     return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -393,9 +415,11 @@ static int notifyHtml(ClipData* clipData, Ecore_X_Event_Selection_Notify* notify
 
     return 0;
 }
+#endif // HAVE_ECORE_X
 
 void ClipboardHelper::initializeAtomList()
 {
+#ifdef HAVE_ECORE_X
     atomList[ATOM_TARGETS].pName = "TARGETS";
     atomList[ATOM_TARGETS].formats = ELM_SEL_FORMAT_TARGETS;
     atomList[ATOM_TARGETS].notify = notifyTarget;
@@ -528,8 +552,10 @@ void ClipboardHelper::initializeAtomList()
     m_cbhmPropertyChangeHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, cbhmPropertyChangeCallback, this);
     m_selectionClearHandler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, clearClip, this);
     m_selectionNotifyHandler = ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, notifyClip, this);
+#endif
 }
 
+#ifdef HAVE_ECORE_X
 Ecore_X_Window ClipboardHelper::getCbhmWindow()
 {
     Ecore_X_Atom xAtomCbhm = ecore_x_atom_get("CBHM_XWIN");
@@ -547,9 +573,11 @@ Ecore_X_Window ClipboardHelper::getCbhmWindow()
 
     return xCbhmWin;
 }
+#endif // HAVE_ECORE_X
 
 bool ClipboardHelper::sendCbhmMessage(String message)
 {
+#ifdef HAVE_ECORE_X
     Ecore_X_Window xCbhmWin = getCbhmWindow();
     Ecore_X_Atom xAtomCbhmMsg = ecore_x_atom_get("CBHM_MSG");
 
@@ -582,8 +610,12 @@ bool ClipboardHelper::sendCbhmMessage(String message)
     ecore_x_sync();
 
     return true;
+#else
+    return false;
+#endif
 }
 
+#ifdef HAVE_ECORE_X
 bool ClipboardHelper::setClipboardItem(Ecore_X_Atom dataType,const String& data)
 {
     Ecore_X_Window cbhmWin = getCbhmWindow();
@@ -600,6 +632,7 @@ bool ClipboardHelper::setClipboardItem(Ecore_X_Atom dataType,const String& data)
 
     return false;
 }
+#endif // HAVE_ECORE_X
 
 void ClipboardHelper::openClipboardWindow(bool isContentRichlyEditable)
 {
@@ -632,7 +665,9 @@ bool ClipboardHelper::isClipboardWindowOpened()
 
 void ClipboardHelper::connectClipboardWindow()
 {
+#ifdef HAVE_ECORE_X
     ecore_x_selection_secondary_set(elm_win_xwindow_get(elm_object_parent_widget_get(m_viewImpl->view())), "",1);
+#endif
 }
 
 void ClipboardHelper::clearClipboardSelectionHandler()
@@ -652,6 +687,7 @@ void ClipboardHelper::clearClipboardSelectionHandler()
     m_clipboardWindowOpened = false;
 }
 
+#ifdef HAVE_ECORE_X
 bool ClipboardHelper::getSelectedCbhmItem(Ecore_X_Atom* pDataType)
 {
     Ecore_X_Window cbhmWin = getCbhmWindow();
@@ -719,9 +755,11 @@ String ClipboardHelper::getCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property,
 
     return chbmData;
 }
+#endif // HAVE_ECORE_X
 
 bool ClipboardHelper::retrieveClipboardItem(int index, int* format, String* pData)
 {
+#ifdef HAVE_ECORE_X
     if (!pData)
         return false;
 
@@ -751,6 +789,9 @@ bool ClipboardHelper::retrieveClipboardItem(int index, int* format, String* pDat
         return false;
 
     return true;
+#else
+    return false;
+#endif
 }
 
 void ClipboardHelper::pasteClipboardLastItem(bool isContentEditable)
@@ -793,6 +834,7 @@ void ClipboardHelper::pasteClipboardLastItem(bool isContentEditable)
     }
 }
 
+#ifdef HAVE_ECORE_X
 void ClipboardHelper::updateClipboardWindowState(Ecore_X_Event_Window_Property* ev)
 {
     Ecore_X_Illume_Clipboard_State state = ecore_x_e_illume_clipboard_state_get(ev->win);
@@ -805,6 +847,7 @@ void ClipboardHelper::updateClipboardWindowState(Ecore_X_Event_Window_Property*
     else if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_ON)
         m_clipboardWindowOpened = true;
 }
+#endif // HAVE_ECORE_X
 #endif // TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD
 }// namespace WebKit
 
index 700bb7c..28b7256 100755 (executable)
 
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
 #include <Ecore.h>
+#ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
 #endif
+#endif
 
 namespace WebKit {
 
@@ -109,8 +111,10 @@ public:
     void clearClipboardSelectionHandler();
     Evas_Object* ewkView() { return m_viewImpl->view(); }
     WebPageProxy* page() { return m_viewImpl->page(); }
+#ifdef HAVE_ECORE_X
     bool getSelectedCbhmItem(Ecore_X_Atom* pDataType);
     void updateClipboardWindowState(Ecore_X_Event_Window_Property* ev);
+#endif // HAVE_ECORE_X
 #endif
 
 private:
@@ -118,10 +122,12 @@ private:
 
 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
     void initializeAtomList();
-    Ecore_X_Window getCbhmWindow();
     bool sendCbhmMessage(String message);
+#ifdef HAVE_ECORE_X
+    Ecore_X_Window getCbhmWindow();
     bool setClipboardItem(Ecore_X_Atom dataType, const String& data);
     String getCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property, Ecore_X_Atom* pDataType);
+#endif // HAVE_ECORE_X
     bool retrieveClipboardItem(int index, int* format, String* pData);
 #endif
 
index ae4fa26..c0d1fd3 100755 (executable)
@@ -31,7 +31,9 @@
 #include "EwkViewImpl.h"
 #include "PageClientImpl.h"
 
+#ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
+#endif
 
 using namespace WebCore;
 
index ae00f5d..a5ffc5b 100644 (file)
@@ -80,6 +80,7 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
         return 1;
     }
 
+#ifdef HAVE_ECORE_X
     if (!ecore_x_init(0)) {
         // Could not init ecore_x.
         // PlatformScreenEfl and systemBeep() functions
@@ -88,9 +89,12 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
         eina_shutdown();
         return 1;
     }
+#endif
 
     if (!ecore_file_init()) {
+#ifdef HAVE_ECORE_X
         ecore_x_shutdown();
+#endif
         ecore_shutdown();
         eina_shutdown();
         return 1;
@@ -137,7 +141,9 @@ WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
     RunLoop::run();
 
     ecore_file_shutdown();
+#ifdef HAVE_ECORE_X
     ecore_x_shutdown();
+#endif
     ecore_shutdown();
     eina_shutdown();
 
index 7d1f544..0e407ea 100644 (file)
@@ -1,4 +1,5 @@
 %bcond_with mesa
+%bcond_with wayland
 Name: webkit2-efl
 Summary: Webkit2 EFL
 Version: 123997_0.11.47
@@ -126,13 +127,19 @@ export GSTREAMER_API="-DGST_API_VERSION_1=Off"
 export GSTREAMER_API="-DGST_API_VERSION_1=On"
 %endif
 
+%if %{with wayland}
+export ECORE_X="-DENABLE_ECORE_X=Off"
+%else
+export ECORE_X="-DENABLE_ECORE_X=On"
+%endif
+
 mkdir -p $WEBKIT_BUILD_DIR
 cd $WEBKIT_BUILD_DIR
 
 export MAKE_OPTION=%{MAKE_OPTION}
 if [ "{MAKE_OPTION}" == "${MAKE_OPTION#%}" ]
 then
-    cmake $SOURCE_DIR -DPORT=Efl -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_WEBKIT=Off -DENABLE_WEBKIT2=On -DENABLE_ALLINONE=On -DENABLE_TIZEN_SCREEN_READER=Off -DEFL_TARGET=%{EFL_TARGET} -DDefaultTheme_RESOURCE_NAME=webkit.edj $TIZEN_WEBKIT_EXTRA_OPTIONS $GSTREAMER_API
+    cmake $SOURCE_DIR -DPORT=Efl -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_WEBKIT=Off -DENABLE_WEBKIT2=On -DENABLE_ALLINONE=On -DENABLE_TIZEN_SCREEN_READER=Off -DEFL_TARGET=%{EFL_TARGET} -DDefaultTheme_RESOURCE_NAME=webkit.edj $TIZEN_WEBKIT_EXTRA_OPTIONS $GSTREAMER_API $ECORE_X
     make %{?jobs:-j%jobs}
 else
     make %{MAKE_OPTION} %{?jobs:-j%jobs}