summaryrefslogtreecommitdiff
diff options
-rw-r--r--CMakeLists.txt35
-rw-r--r--dash/ResultViewGrid.cpp4
-rw-r--r--launcher/ApplicationLauncherIcon.cpp2
-rw-r--r--launcher/CMakeLists.txt8
-rw-r--r--launcher/Launcher.cpp39
-rw-r--r--launcher/Launcher.h11
-rw-r--r--launcher/LauncherController.cpp8
-rw-r--r--launcher/LauncherControllerPrivate.h4
-rw-r--r--launcher/LauncherOptions.h1
-rw-r--r--launcher/TrashLauncherIcon.cpp2
-rw-r--r--tests/CMakeLists.txt137
-rw-r--r--tests/test_launcher_controller.cpp2
-rw-r--r--unity-shared/CMakeLists.txt6
-rw-r--r--unity-shared/DebugDBusInterface.cpp (renamed from plugins/unityshell/src/DebugDBusInterface.cpp)9
-rw-r--r--unity-shared/DebugDBusInterface.h (renamed from plugins/unityshell/src/DebugDBusInterface.h)0
-rw-r--r--unity-shared/ResizingBaseWindow.h2
-rw-r--r--unity-shared/UnityWindowView.cpp2
-rw-r--r--unity-shared/WindowManager.h2
-rw-r--r--unity-shared/XPathQueryPart.cpp (renamed from plugins/unityshell/src/XPathQueryPart.cpp)0
-rw-r--r--unity-shared/XPathQueryPart.h (renamed from plugins/unityshell/src/XPathQueryPart.h)0
20 files changed, 162 insertions, 112 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5afe3c9ea..a7ca21f4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,23 +18,32 @@ set (CMAKE_CXX_FLAGS_DEBUG "-g3")
set (CMAKE_CXX_FLAGS_RELEASE "")
option(
- UNITY_ENABLE_X_ORG_SUPPORT
+ ENABLE_X_SUPPORT
"Enable X.org support in unity"
ON
)
-if(UNITY_ENABLE_X_ORG_SUPPORT)
- add_definitions(-DUNITY_HAS_X_ORG_SUPPORT)
+# This is due to bug lp:668799 - qemu-arm segfaults executing msgmerge
+option(
+ I18N_SUPPORT
+ "Enable I18N, do the .po file thing."
+ ON
+)
+
+if (ENABLE_X_SUPPORT)
+ add_definitions(-DUSE_X11)
message("Unity is configured with support for X.org")
else ()
message("Unity is configured with without X.org")
-endif()
+ add_definitions(-DNO_X11)
+endif ()
if (BUILD_GLES)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNUX_OPENGLES_20 -DUSE_GLES")
- set (UNITY_STANDALONE_LADD "-lunity-core-${UNITY_API_VERSION} -lm -lpthread -ldl")
+ add_definitions(-DNUX_OPENGLES_20)
+ add_definitions(-DUSE_GLES)
+ set (UNITY_STANDALONE_LADD "-lunity-core-${UNITY_API_VERSION} -lm -lpthread -ldl")
else ()
- set (UNITY_STANDALONE_LADD "-lunity-core-${UNITY_API_VERSION} -lm -lpthread -ldl -lGL -lGLU")
+ set (UNITY_STANDALONE_LADD "-lunity-core-${UNITY_API_VERSION} -lm -lpthread -ldl -lGL -lGLU")
endif ()
#
@@ -117,12 +126,14 @@ add_custom_command (OUTPUT ${CMAKE_SOURCE_DIR}/po/unity.pot
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
+if (I18N_SUPPORT)
if (${GETTEXT_FOUND} STREQUAL "TRUE")
set (HAVE_GETTEXT true)
file (GLOB _translations ${CMAKE_SOURCE_DIR}/po/*.po)
GETTEXT_CREATE_TRANSLATIONS (${CMAKE_SOURCE_DIR}/po/${PROJECT_NAME}.pot
ALL ${_translations})
endif (${GETTEXT_FOUND} STREQUAL "TRUE")
+endif()
#
# Enable or disable boot logging
@@ -144,10 +155,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MAINTAINER_CXXFLAGS}")
#
# Compiz Plugins
#
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if (ENABLE_X_SUPPORT)
set (UNITY_PLUGIN_DEPS "compiz>=0.9.8.0;nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;gmodule-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;atk-bridge-2.0;unity-misc>=0.4.0;dbus-glib-1;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;xfixes;unity-protocol-private>=5.95.1;libgeis;xrender>=0.9;zeitgeist-1.0>=0.3.18")
else ()
- set (UNITY_PLUGIN_DEPS "nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;gmodule-2.0;dbusmenu-glib-0.4;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;atk-bridge-2.0;unity-misc>=0.4.0;dbus-glib-1;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;xfixes;unity-protocol-private>=5.95.1;libgeis;xrender>=0.9;zeitgeist-1.0>=0.3.18")
+ set (UNITY_PLUGIN_DEPS "nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;gmodule-2.0;dbusmenu-glib-0.4;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;atk-bridge-2.0;unity-misc>=0.4.0;dbus-glib-1;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;unity-protocol-private>=5.95.1;zeitgeist-1.0>=0.3.18")
endif ()
set (UNITY_PROTOCOL_PRIVATE_DEPS "unity-protocol-private>=5.95.1")
@@ -159,16 +170,16 @@ pkg_check_modules (CACHED_UNITY_PRIVATE_DEPS REQUIRED ${UNITY_PROTOCOL_PRIVATE_D
add_subdirectory(unity-shared)
add_subdirectory(dash)
add_subdirectory(launcher)
-add_subdirectory(shortcuts)
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if (ENABLE_X_SUPPORT)
add_subdirectory(hud)
add_subdirectory(panel)
add_subdirectory(plugins/unityshell)
add_subdirectory(plugins/networkarearegion)
add_subdirectory(plugins/unitydialog)
add_subdirectory(plugins/unity-mt-grab-handles)
+ add_subdirectory(shortcuts)
add_subdirectory(unity-standalone)
-endif()
+endif ()
# subdirs
add_subdirectory(doc)
diff --git a/dash/ResultViewGrid.cpp b/dash/ResultViewGrid.cpp
index fe4d67699..f2a4dfef1 100644
--- a/dash/ResultViewGrid.cpp
+++ b/dash/ResultViewGrid.cpp
@@ -777,7 +777,7 @@ std::tuple<int, int> ResultViewGrid::GetResultPosition(const unsigned int& index
*/
bool ResultViewGrid::DndSourceDragBegin()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
unsigned num_results = GetNumResults();
unsigned drag_index = GetIndexAtPosition(last_mouse_down_x_, last_mouse_down_y_);
@@ -929,7 +929,7 @@ const char* ResultViewGrid::DndSourceGetDataForType(const char* type, int* size,
void ResultViewGrid::DndSourceDragFinished(nux::DndAction result)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
UnReference();
last_mouse_down_x_ = -1;
last_mouse_down_y_ = -1;
diff --git a/launcher/ApplicationLauncherIcon.cpp b/launcher/ApplicationLauncherIcon.cpp
index 131146398..8fabbb8b5 100644
--- a/launcher/ApplicationLauncherIcon.cpp
+++ b/launcher/ApplicationLauncherIcon.cpp
@@ -1300,7 +1300,7 @@ bool ApplicationLauncherIcon::OnShouldHighlightOnDrag(DndData const& dnd_data)
nux::DndAction ApplicationLauncherIcon::OnQueryAcceptDrop(DndData const& dnd_data)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
return ValidateUrisForLaunch(dnd_data).empty() ? nux::DNDACTION_NONE : nux::DNDACTION_COPY;
#else
return nux::DNDACTION_NONE;
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index a4518bf7f..bc2817df6 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -75,13 +75,13 @@ set (LAUNCHER_SOURCES
VolumeMonitorWrapper.cpp
)
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if (ENABLE_X_SUPPORT)
set (LAUNCHER_SOURCES
EdgeBarrierController.cpp
PointerBarrier.cpp
${LAUNCHER_SOURCES}
)
-endif()
+endif ()
add_library (launcher-lib STATIC ${LAUNCHER_SOURCES})
add_dependencies (launcher-lib unity-core-${UNITY_API_VERSION} unity-shared)
@@ -104,8 +104,8 @@ add_executable (launcher StandaloneLauncher.cpp)
add_dependencies (launcher launcher-lib)
target_link_libraries (launcher launcher-lib unity-shared unity-shared-standalone)
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if (ENABLE_X_SUPPORT)
add_executable (switcher StandaloneSwitcher.cpp)
add_dependencies (switcher switcher-lib launcher-lib)
target_link_libraries (switcher switcher-lib launcher-lib unity-shared unity-shared-standalone)
-endif()
+endif ()
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index 4673d8062..a13b764ce 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -106,7 +106,7 @@ Launcher::Launcher(nux::BaseWindow* parent,
nux::ObjectPtr<DNDCollectionWindow> const& collection_window,
NUX_FILE_LINE_DECL)
: View(NUX_FILE_LINE_PARAM)
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
, display(nux::GetGraphicsDisplay()->GetX11Display())
#else
, display(0)
@@ -188,7 +188,7 @@ Launcher::Launcher(nux::BaseWindow* parent,
wm.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
wm.screen_viewport_switch_ended.connect(sigc::mem_fun(this, &Launcher::EnsureAnimation));
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
display.changed.connect(sigc::mem_fun(this, &Launcher::OnDisplayChanged));
#endif
@@ -232,8 +232,8 @@ void Launcher::OnDisplayChanged(Display* display)
_collection_window->display = display;
}
-void
-Launcher::OnDragStart(const nux::GestureEvent &event)
+#ifdef NUX_GESTURES_SUPPORT
+void Launcher::OnDragStart(const nux::GestureEvent &event)
{
_drag_gesture_ongoing = true;
if (_hidden)
@@ -247,16 +247,14 @@ Launcher::OnDragStart(const nux::GestureEvent &event)
}
}
-void
-Launcher::OnDragUpdate(const nux::GestureEvent &event)
+void Launcher::OnDragUpdate(const nux::GestureEvent &event)
{
_drag_out_delta_x =
CLAMP(_drag_out_delta_x + event.GetDelta().x, 0.0f, DRAG_OUT_PIXELS);
EnsureAnimation();
}
-void
-Launcher::OnDragFinish(const nux::GestureEvent &event)
+void Launcher::OnDragFinish(const nux::GestureEvent &event)
{
if (_drag_out_delta_x >= DRAG_OUT_PIXELS - 90.0f)
_hide_machine.SetQuirk(LauncherHideMachine::MT_DRAG_OUT, true);
@@ -266,6 +264,7 @@ Launcher::OnDragFinish(const nux::GestureEvent &event)
EnsureAnimation();
_drag_gesture_ongoing = false;
}
+#endif
void Launcher::AddProperties(GVariantBuilder* builder)
{
@@ -1369,7 +1368,7 @@ int Launcher::GetMouseY() const
bool Launcher::OnUpdateDragManagerTimeout()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (display() == 0)
return false;
@@ -1411,7 +1410,7 @@ bool Launcher::OnUpdateDragManagerTimeout()
void Launcher::DndTimeoutSetup()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (sources_.GetSource(DND_CHECK_TIMEOUT))
return;
@@ -2235,7 +2234,7 @@ void Launcher::RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_
if (GetActionState() == ACTION_NONE)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (nux::Abs(_dnd_delta_y) >= nux::Abs(_dnd_delta_x))
{
_launcher_drag_delta += _dnd_delta_y;
@@ -2310,7 +2309,7 @@ void Launcher::RecvMouseWheel(int x, int y, int wheel_delta, unsigned long butto
EnsureAnimation();
}
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
bool Launcher::HandleBarrierEvent(ui::PointerBarrierWrapper* owner, ui::BarrierEvent::Ptr event)
{
@@ -2542,6 +2541,7 @@ void Launcher::RenderIconToTexture(nux::GraphicsEngine& GfxContext, AbstractLaun
unity::graphics::PopOffscreenRenderTarget();
}
+#ifdef NUX_GESTURES_SUPPORT
nux::GestureDeliveryRequest Launcher::GestureEvent(const nux::GestureEvent &event)
{
switch(event.type)
@@ -2559,6 +2559,7 @@ nux::GestureDeliveryRequest Launcher::GestureEvent(const nux::GestureEvent &even
return nux::GestureDeliveryRequest::NONE;
}
+#endif
bool Launcher::DndIsSpecialRequest(std::string const& uri) const
{
@@ -2567,7 +2568,7 @@ bool Launcher::DndIsSpecialRequest(std::string const& uri) const
void Launcher::OnDNDDataCollected(const std::list<char*>& mimes)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
_dnd_data.Reset();
const std::string uri_list = "text/uri-list";
@@ -2614,7 +2615,7 @@ void Launcher::OnDNDDataCollected(const std::list<char*>& mimes)
void Launcher::ProcessDndEnter()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
SetStateMouseOverLauncher(true);
_dnd_data.Reset();
@@ -2628,7 +2629,7 @@ void Launcher::ProcessDndEnter()
void Launcher::DndReset()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
_dnd_data.Reset();
bool is_overlay_open = IsOverlayOpen();
@@ -2656,7 +2657,7 @@ void Launcher::DndReset()
void Launcher::DndHoveredIconReset()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
_drag_edge_touching = false;
SetActionState(ACTION_NONE);
@@ -2676,7 +2677,7 @@ void Launcher::DndHoveredIconReset()
void Launcher::ProcessDndLeave()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
SetStateMouseOverLauncher(false);
DndHoveredIconReset();
@@ -2685,7 +2686,7 @@ void Launcher::ProcessDndLeave()
void Launcher::ProcessDndMove(int x, int y, std::list<char*> mimes)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (!_data_checked)
{
const std::string uri_list = "text/uri-list";
@@ -2817,7 +2818,7 @@ void Launcher::ProcessDndMove(int x, int y, std::list<char*> mimes)
void Launcher::ProcessDndDrop(int x, int y)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (_steal_drag)
{
for (auto const& uri : _dnd_data.Uris())
diff --git a/launcher/Launcher.h b/launcher/Launcher.h
index a66c0c7ce..99e8ca9d2 100644
--- a/launcher/Launcher.h
+++ b/launcher/Launcher.h
@@ -43,7 +43,7 @@
#include "unity-shared/UBusWrapper.h"
#include "SoftwareCenterLauncherIcon.h"
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
# include "PointerBarrier.h"
# include "EdgeBarrierController.h"
#endif
@@ -57,7 +57,7 @@ extern const char* window_title;
class AbstractLauncherIcon;
class Launcher : public unity::debug::Introspectable,
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
// TODO: abstract this into a more generic class.
public ui::EdgeBarrierSubscriber,
#endif
@@ -148,7 +148,10 @@ public:
void RenderIconToTexture(nux::GraphicsEngine& GfxContext, AbstractLauncherIcon::Ptr const& icon, nux::ObjectPtr<nux::IOpenGLBaseTexture> texture);
+#ifdef NUX_GESTURES_SUPPORT
virtual nux::GestureDeliveryRequest GestureEvent(const nux::GestureEvent &event);
+#endif
+
protected:
// Introspectable methods
std::string GetName() const;
@@ -193,11 +196,13 @@ private:
void OnOptionChanged();
void UpdateOptions(Options::Ptr options);
+#ifdef NUX_GESTURES_SUPPORT
void OnDragStart(const nux::GestureEvent &event);
void OnDragUpdate(const nux::GestureEvent &event);
void OnDragFinish(const nux::GestureEvent &event);
+#endif
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
bool HandleBarrierEvent(ui::PointerBarrierWrapper* owner, ui::BarrierEvent::Ptr event);
#endif
diff --git a/launcher/LauncherController.cpp b/launcher/LauncherController.cpp
index f333a5d25..a23498101 100644
--- a/launcher/LauncherController.cpp
+++ b/launcher/LauncherController.cpp
@@ -114,7 +114,7 @@ Controller::Impl::Impl(Controller* parent)
, gdbus_connection_(nullptr)
, reg_id_(0)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
edge_barriers_.options = parent_->options();
#endif
@@ -200,7 +200,7 @@ void Controller::Impl::EnsureLaunchers(int primary, std::vector<nux::Geometry> c
int monitor = (num_launchers == 1) ? primary : i;
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (launchers[i]->monitor() != monitor)
{
edge_barriers_.Unsubscribe(launchers[i].GetPointer(), launchers[i]->monitor);
@@ -209,7 +209,7 @@ void Controller::Impl::EnsureLaunchers(int primary, std::vector<nux::Geometry> c
launchers[i]->monitor(monitor);
launchers[i]->Resize();
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
edge_barriers_.Subscribe(launchers[i].GetPointer(), launchers[i]->monitor);
#endif
}
@@ -221,7 +221,7 @@ void Controller::Impl::EnsureLaunchers(int primary, std::vector<nux::Geometry> c
{
parent_->RemoveChild(launcher.GetPointer());
launcher->GetParent()->UnReference();
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
edge_barriers_.Unsubscribe(launcher.GetPointer(), launcher->monitor);
#endif
}
diff --git a/launcher/LauncherControllerPrivate.h b/launcher/LauncherControllerPrivate.h
index 253bfbb16..210cedeb0 100644
--- a/launcher/LauncherControllerPrivate.h
+++ b/launcher/LauncherControllerPrivate.h
@@ -28,7 +28,7 @@
#include "AbstractLauncherIcon.h"
#include "DeviceLauncherSection.h"
#include "DevicesSettingsImp.h"
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
#include "EdgeBarrierController.h"
#endif
#include "LauncherController.h"
@@ -129,7 +129,7 @@ public:
AbstractLauncherIcon::Ptr expo_icon_;
AbstractLauncherIcon::Ptr desktop_icon_;
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
ui::EdgeBarrierController edge_barriers_;
#endif
diff --git a/launcher/LauncherOptions.h b/launcher/LauncherOptions.h
index 0a29a5bb6..81b7aabec 100644
--- a/launcher/LauncherOptions.h
+++ b/launcher/LauncherOptions.h
@@ -24,7 +24,6 @@
#include <memory>
#include <vector>
#include <sigc++/sigc++.h>
-#include <core/core.h>
#include <Nux/Nux.h>
diff --git a/launcher/TrashLauncherIcon.cpp b/launcher/TrashLauncherIcon.cpp
index c6f86431e..6f90b2c9f 100644
--- a/launcher/TrashLauncherIcon.cpp
+++ b/launcher/TrashLauncherIcon.cpp
@@ -139,7 +139,7 @@ void TrashLauncherIcon::UpdateTrashIconCb(GObject* source,
nux::DndAction TrashLauncherIcon::OnQueryAcceptDrop(DndData const& dnd_data)
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
return nux::DNDACTION_MOVE;
#else
return nux::DNDACTION_NONE;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index cc0e2805d..36b8183b3 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -112,51 +112,71 @@ if (GTEST_SRC_DIR AND
# The actual test executable (xless) - do not put anything that requires X in here
- add_executable(test-gtest-xless
- test_main_xless.cpp
- test_animator.cpp
- test_launcher_model.cpp
- test_glib_object.cpp
- test_glib_object_utils.cpp
- test_glib_object_utils.h
- test_glib_signals.cpp
- test_glib_signals_utils.cpp
- test_glib_signals_utils.h
- test_glib_source.cpp
- test_glib_variant.cpp
- test_grabhandle.cpp
- test_desktop_utilities.cpp
- test_hud_private.cpp
- test_indicator.cpp
- test_indicator_appmenu.cpp
- test_indicator_entry.cpp
- test_indicators.cpp
- test_introspection.cpp
- test_favorite_store.cpp
- test_favorite_store_gsettings.cpp
- test_favorite_store_private.cpp
- test_home_lens.cpp
- test_launcher_entry_remote.cpp
- test_model_iterator.cpp
- test_pointer_barrier.cpp
- test_previews.cpp
- test_shortcut_model.cpp
- test_shortcut_private.cpp
- test_showdesktop_handler.cpp
- test_ubus.cpp
- test_unityshell_private.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/test_glib_signals_utils_marshal.cpp
- ${UNITY_SRC}/DebugDBusInterface.cpp
- ${UNITY_SRC}/XPathQueryPart.cpp
- ${UNITY_SRC}/UnityshellPrivate.cpp
- ${UNITY_SRC}/UnityShowdesktopHandler.cpp
- ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle.cpp
- ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-group.cpp
- ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-impl-factory.cpp
- ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-layout.cpp
- ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-texture.cpp
- )
- target_link_libraries(test-gtest-xless gtest unity-shared ${GMOCK_LIB} ${GMOCK_MAIN_LIB} ${LIBS} launcher-lib shortcuts-lib hud-lib)
+ set (GTEST_XLESS_SOURCES
+ test_main_xless.cpp
+ test_animator.cpp
+ test_launcher_model.cpp
+ test_glib_object.cpp
+ test_glib_object_utils.cpp
+ test_glib_object_utils.h
+ test_glib_signals.cpp
+ test_glib_signals_utils.cpp
+ test_glib_signals_utils.h
+ test_glib_source.cpp
+ test_glib_variant.cpp
+ test_grabhandle.cpp
+ test_desktop_utilities.cpp
+ test_indicator.cpp
+ test_indicator_appmenu.cpp
+ test_indicator_entry.cpp
+ test_indicators.cpp
+ test_introspection.cpp
+ test_favorite_store.cpp
+ test_favorite_store_gsettings.cpp
+ test_favorite_store_private.cpp
+ test_home_lens.cpp
+ test_launcher_entry_remote.cpp
+ test_model_iterator.cpp
+ test_previews.cpp
+ test_ubus.cpp
+ test_unityshell_private.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/test_glib_signals_utils_marshal.cpp
+ ${UNITY_SRC}/UnityshellPrivate.cpp
+ ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle.cpp
+ ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-group.cpp
+ ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-impl-factory.cpp
+ ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-layout.cpp
+ ${CMAKE_SOURCE_DIR}/plugins/unity-mt-grab-handles/src/unity-mt-texture.cpp
+ )
+
+ set (GTEST_XLESS_LIBS
+ gtest
+ unity-shared
+ launcher-lib
+ ${GMOCK_LIB}
+ ${GMOCK_MAIN_LIB}
+ ${LIBS}
+ )
+
+ if (ENABLE_X_SUPPORT)
+ set (GTEST_XLESS_SOURCES
+ test_hud_private.cpp
+ test_pointer_barrier.cpp
+ test_shortcut_model.cpp
+ test_shortcut_private.cpp
+ ${LAUNCHER_SOURCES}
+ )
+ set (GTEST_XLESS_LIBS
+ ${GTEST_XLESS_LIBS}
+ shortcuts-lib
+ hud-lib
+ )
+ endif ()
+
+ add_executable(test-gtest-xless ${GTEST_XLESS_SOURCES})
+
+ target_link_libraries(test-gtest-xless ${GTEST_XLESS_LIBS})
+
add_test(UnityGTestXless test-gtest-xless)
add_dependencies(test-gtest-xless unity-core-${UNITY_API_VERSION} gtest)
@@ -179,6 +199,7 @@ if (GTEST_SRC_DIR AND
add_test(UnityGTestDBus test-gtest-dbus)
add_dependencies(test-gtest-dbus unity-core-${UNITY_API_VERSION} test-gtest-service gtest)
+if (ENABLE_X_SUPPORT)
# Tests that require X
add_executable(test-gtest
test_main.cpp
@@ -215,6 +236,7 @@ if (GTEST_SRC_DIR AND
test_shortcut_controller.cpp
test_single_monitor_launcher_icon.cpp
test_expo_launcher_icon.cpp
+ test_showdesktop_handler.cpp
test_switcher_controller.cpp
test_switcher_model.cpp
test_texture_cache.cpp
@@ -227,17 +249,20 @@ if (GTEST_SRC_DIR AND
bamf-mock-application.c
gmockmount.c
gmockvolume.c
+ ${UNITY_SRC}/UnityShowdesktopHandler.cpp
${CMAKE_SOURCE_DIR}/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
)
target_link_libraries(test-gtest gtest gmock unity-shared ${LIBS} launcher-lib unity-shared-standalone shortcuts-lib previews-lib hud-lib switcher-lib dash-lib panel-lib)
add_test(UnityGTest test-gtest)
add_dependencies(test-gtest unity-core-${UNITY_API_VERSION} gtest gmock)
-
+endif (ENABLE_X_SUPPORT)
endif (GTEST_SRC_DIR AND
GMOCK_LIB AND
GMOCK_MAIN_LIB)
-add_subdirectory (test-gestures)
+if(ENABLE_X_SUPPORT)
+ add_subdirectory (test-gestures)
+endif()
#
# check target
@@ -245,10 +270,12 @@ add_subdirectory (test-gestures)
set (TEST_RESULT_DIR ${CMAKE_BINARY_DIR}/tests)
set (TEST_RESULT_XML ${TEST_RESULT_DIR}/test-results.xml)
set (TEST_RESULT_HTML ${TEST_RESULT_DIR}/test-results.html)
-set (GTEST_TEST_COMMAND ./test-gtest)
+if (ENABLE_X_SUPPORT)
+ set (GTEST_TEST_COMMAND ./test-gtest)
+ set (GTEST_TEST_COMMAND_GESTURES ./test-gestures/test-gestures)
+endif (ENABLE_X_SUPPORT)
set (GTEST_TEST_COMMAND_XLESS ./test-gtest-xless)
set (GTEST_TEST_COMMAND_DBUS dbus-test-runner --task ./test-gtest-service --task ./test-gtest-dbus)
-set (GTEST_TEST_COMMAND_GESTURES ./test-gestures/test-gestures)
set (TEST_COMMAND
gtester --verbose -k --g-fatal-warnings -o=${TEST_RESULT_XML} ./test-unit
@@ -265,10 +292,16 @@ set (TEST_COMMAND_HEADLESS
&& echo "Warning, DBus test cases are disabled!!")
if (GTEST_SRC_DIR)
- add_custom_target (check COMMAND ${TEST_COMMAND} DEPENDS test-unit test-gtest test-gtest-xless test-gtest-dbus test-gestures)
- add_custom_target (check-headless COMMAND ${TEST_COMMAND_HEADLESS} DEPENDS test-gtest-xless test-gtest-dbus test-gestures)
+ if (ENABLE_X_SUPPORT)
+ add_custom_target (check COMMAND ${TEST_COMMAND} DEPENDS test-unit test-gtest test-gtest-xless test-gtest-dbus test-gestures)
+ add_custom_target (check-headless COMMAND ${TEST_COMMAND_HEADLESS} DEPENDS test-gtest-xless test-gtest-dbus test-gestures)
+ add_custom_target (gcheck COMMAND ${DBUS_TEST_COMMAND} DEPENDS test-gtest test-gtest-xless)
+ else ()
+ add_custom_target (check COMMAND ${TEST_COMMAND} DEPENDS test-unit test-gtest-xless test-gtest-dbus)
+ add_custom_target (check-headless COMMAND ${TEST_COMMAND_HEADLESS} DEPENDS test-gtest-xless test-gtest-dbus)
+ add_custom_target (gcheck COMMAND ${DBUS_TEST_COMMAND} DEPENDS test-gtest-xless)
+ endif ()
add_custom_target (check-report COMMAND ${TEST_UNIT_COMMAND} && gtester-report ${TEST_RESULT_XML} > ${TEST_RESULT_HTML})
- add_custom_target (gcheck COMMAND ${DBUS_TEST_COMMAND} DEPENDS test-gtest test-gtest-xless)
else (GTEST_SRC_DIR)
add_custom_target (check COMMAND ${TEST_COMMAND} DEPENDS test-unit)
endif (GTEST_SRC_DIR)
diff --git a/tests/test_launcher_controller.cpp b/tests/test_launcher_controller.cpp
index 22d197b2d..061f74a4a 100644
--- a/tests/test_launcher_controller.cpp
+++ b/tests/test_launcher_controller.cpp
@@ -380,7 +380,7 @@ TEST_F(TestLauncherController, SingleMonitorSwitchToMultimonitor)
EXPECT_EQ(lc.launchers().size(), max_num_monitors);
}
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
TEST_F(TestLauncherController, MultiMonitorEdgeBarrierSubscriptions)
{
diff --git a/unity-shared/CMakeLists.txt b/unity-shared/CMakeLists.txt
index 0c39967d1..9c7bdaa54 100644
--- a/unity-shared/CMakeLists.txt
+++ b/unity-shared/CMakeLists.txt
@@ -32,6 +32,7 @@ set (UNITY_SHARED_SOURCES
CoverArt.cpp
BackgroundEffectHelper.cpp
DashStyle.cpp
+ DebugDBusInterface.cpp
DefaultThumbnailProvider.cpp
FontSettings.cpp
GraphicsUtils.cpp
@@ -65,9 +66,10 @@ set (UNITY_SHARED_SOURCES
UnityWindowView.cpp
UserThumbnailProvider.cpp
WindowManager.cpp
+ XPathQueryPart.cpp
)
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if(ENABLE_X_SUPPORT)
set (UNITY_SHARED_SOURCES
XKeyboardUtil.cpp
XWindowManager.cpp
@@ -88,7 +90,7 @@ add_dependencies (unity-shared unity-core-${UNITY_API_VERSION})
# We also need to build compiz specific parts and standalone variants of those parts
#
-if(UNITY_ENABLE_X_ORG_SUPPORT)
+if (ENABLE_X_SUPPORT)
# compiz
set (UNITY_SHARED_COMPIZ_SOURCES
PluginAdapter.cpp
diff --git a/plugins/unityshell/src/DebugDBusInterface.cpp b/unity-shared/DebugDBusInterface.cpp
index 9a267ea21..ae07a851b 100644
--- a/plugins/unityshell/src/DebugDBusInterface.cpp
+++ b/unity-shared/DebugDBusInterface.cpp
@@ -24,7 +24,6 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/bind.hpp>
-#include <core/core.h>
#include <NuxCore/Logger.h>
#include <NuxCore/LoggingWriter.h>
@@ -303,7 +302,7 @@ std::list<Introspectable*> GetIntrospectableNodesFromQuery(std::string const& qu
query_strings.end(),
boost::bind( &std::string::empty, _1 ) ),
query_strings.end());
- foreach(std::string part, query_strings)
+ for (auto part : query_strings)
{
query_parts.push_back(XPathQueryPart(part));
}
@@ -343,7 +342,7 @@ std::list<Introspectable*> GetIntrospectableNodesFromQuery(std::string const& qu
start_points.push_back(node);
}
// Add all children of current node to queue.
- foreach(Introspectable* child, node->GetIntrospectableChildren())
+ for (Introspectable* child : node->GetIntrospectableChildren())
{
queue.push(child);
}
@@ -355,7 +354,7 @@ std::list<Introspectable*> GetIntrospectableNodesFromQuery(std::string const& qu
typedef std::pair<Introspectable*, std::list<XPathQueryPart>::iterator> node_match_pair;
std::queue<node_match_pair> traverse_queue;
- foreach(Introspectable *node, start_points)
+ for (Introspectable *node : start_points)
{
traverse_queue.push(node_match_pair(node, query_parts.begin()));
}
@@ -377,7 +376,7 @@ std::list<Introspectable*> GetIntrospectableNodesFromQuery(std::string const& qu
else
{
// push all children of current node to start of queue, advance search iterator, and loop again.
- foreach (Introspectable *child, node->GetIntrospectableChildren())
+ for (Introspectable* child : node->GetIntrospectableChildren())
{
if (query_it->Matches(child))
{
diff --git a/plugins/unityshell/src/DebugDBusInterface.h b/unity-shared/DebugDBusInterface.h
index 3c11a5a0b..3c11a5a0b 100644
--- a/plugins/unityshell/src/DebugDBusInterface.h
+++ b/unity-shared/DebugDBusInterface.h
diff --git a/unity-shared/ResizingBaseWindow.h b/unity-shared/ResizingBaseWindow.h
index c7f50cbb2..d461fcb03 100644
--- a/unity-shared/ResizingBaseWindow.h
+++ b/unity-shared/ResizingBaseWindow.h
@@ -35,7 +35,7 @@ public:
void UpdateInputWindowGeometry()
{
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
if (m_input_window && m_input_window_enabled)
m_input_window->SetGeometry(geo_func_(GetGeometry()));
#endif
diff --git a/unity-shared/UnityWindowView.cpp b/unity-shared/UnityWindowView.cpp
index 6b6a8a920..9de1d5857 100644
--- a/unity-shared/UnityWindowView.cpp
+++ b/unity-shared/UnityWindowView.cpp
@@ -136,7 +136,7 @@ void UnityWindowView::DrawContent(nux::GraphicsEngine& GfxContext, bool force_dr
gPainter.PaintShapeCornerROP(GfxContext,
internal_clip,
nux::color::White,
- nux::eSHAPE_CORNER_ROUND5,
+ nux::eSHAPE_CORNER_ROUND4,
nux::eCornerTopLeft | nux::eCornerTopRight |
nux::eCornerBottomLeft | nux::eCornerBottomRight,
true,
diff --git a/unity-shared/WindowManager.h b/unity-shared/WindowManager.h
index b9a7c7e42..a1f420003 100644
--- a/unity-shared/WindowManager.h
+++ b/unity-shared/WindowManager.h
@@ -28,7 +28,7 @@
#include <NuxCore/Rect.h>
#include <Nux/Utils.h>
-#ifdef UNITY_HAS_X_ORG_SUPPORT
+#ifdef USE_X11
#include <X11/Xlib.h>
#else
typedef unsigned long Window;
diff --git a/plugins/unityshell/src/XPathQueryPart.cpp b/unity-shared/XPathQueryPart.cpp
index 3608a50b4..3608a50b4 100644
--- a/plugins/unityshell/src/XPathQueryPart.cpp
+++ b/unity-shared/XPathQueryPart.cpp
diff --git a/plugins/unityshell/src/XPathQueryPart.h b/unity-shared/XPathQueryPart.h
index b5beb3f4f..b5beb3f4f 100644
--- a/plugins/unityshell/src/XPathQueryPart.h
+++ b/unity-shared/XPathQueryPart.h