diff options
| -rw-r--r-- | launcher/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | launcher/DeviceLauncherSection.cpp | 6 | ||||
| -rw-r--r-- | launcher/DeviceLauncherSection.h | 4 | ||||
| -rw-r--r-- | launcher/TrashLauncherIcon.cpp | 6 | ||||
| -rw-r--r-- | launcher/TrashLauncherIcon.h | 6 | ||||
| -rw-r--r-- | launcher/VolumeImp.cpp | 12 | ||||
| -rw-r--r-- | launcher/VolumeImp.h | 4 | ||||
| -rw-r--r-- | tests/test_trash_launcher_icon.cpp | 10 | ||||
| -rw-r--r-- | tests/test_volume_imp.cpp | 14 | ||||
| -rw-r--r-- | unity-shared/BackgroundEffectHelper.cpp | 5 | ||||
| -rw-r--r-- | unity-shared/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | unity-shared/FileManager.h (renamed from launcher/FileManagerOpener.h) | 22 | ||||
| -rw-r--r-- | unity-shared/GnomeFileManager.cpp (renamed from launcher/FileManagerOpenerImp.cpp) | 9 | ||||
| -rw-r--r-- | unity-shared/GnomeFileManager.h (renamed from launcher/FileManagerOpenerImp.h) | 14 |
14 files changed, 54 insertions, 60 deletions
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index b32d93953..86b774269 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -32,7 +32,6 @@ set (LAUNCHER_SOURCES FavoriteStore.cpp FavoriteStoreGSettings.cpp FavoriteStorePrivate.cpp - FileManagerOpenerImp.cpp HudLauncherIcon.cpp Launcher.cpp LauncherController.cpp diff --git a/launcher/DeviceLauncherSection.cpp b/launcher/DeviceLauncherSection.cpp index 41443eca7..778640e43 100644 --- a/launcher/DeviceLauncherSection.cpp +++ b/launcher/DeviceLauncherSection.cpp @@ -20,8 +20,8 @@ #include "DeviceLauncherSection.h" #include "DeviceNotificationDisplayImp.h" #include "DevicesSettings.h" -#include "FileManagerOpenerImp.h" #include "VolumeImp.h" +#include "unity-shared/GnomeFileManager.h" namespace unity { @@ -32,7 +32,7 @@ DeviceLauncherSection::DeviceLauncherSection(AbstractVolumeMonitorWrapper::Ptr v DevicesSettings::Ptr devices_settings) : monitor_(volume_monitor) , devices_settings_(devices_settings) - , file_manager_opener_(std::make_shared<FileManagerOpenerImp>()) + , file_manager_(std::make_shared<GnomeFileManager>()) , device_notification_display_(std::make_shared<DeviceNotificationDisplayImp>()) { monitor_->volume_added.connect(sigc::mem_fun(this, &DeviceLauncherSection::OnVolumeAdded)); @@ -57,7 +57,7 @@ void DeviceLauncherSection::TryToCreateAndAddIcon(glib::Object<GVolume> volume) if (map_.find(volume) != map_.end()) return; - auto vol = std::make_shared<VolumeImp>(volume, file_manager_opener_, device_notification_display_); + auto vol = std::make_shared<VolumeImp>(volume, file_manager_, device_notification_display_); VolumeLauncherIcon::Ptr icon(new VolumeLauncherIcon(vol, devices_settings_)); map_[volume] = icon; diff --git a/launcher/DeviceLauncherSection.h b/launcher/DeviceLauncherSection.h index 255353fb1..e86172e0b 100644 --- a/launcher/DeviceLauncherSection.h +++ b/launcher/DeviceLauncherSection.h @@ -26,8 +26,8 @@ #include "AbstractVolumeMonitorWrapper.h" #include "DevicesSettings.h" #include "DeviceNotificationDisplay.h" -#include "FileManagerOpener.h" #include "VolumeLauncherIcon.h" +#include "unity-shared/FileManager.h" namespace unity { @@ -53,7 +53,7 @@ private: std::map<GVolume*, VolumeLauncherIcon::Ptr> map_; AbstractVolumeMonitorWrapper::Ptr monitor_; DevicesSettings::Ptr devices_settings_; - FileManagerOpener::Ptr file_manager_opener_; + FileManager::Ptr file_manager_; DeviceNotificationDisplay::Ptr device_notification_display_; }; diff --git a/launcher/TrashLauncherIcon.cpp b/launcher/TrashLauncherIcon.cpp index 96b0aeb6d..03adba72b 100644 --- a/launcher/TrashLauncherIcon.cpp +++ b/launcher/TrashLauncherIcon.cpp @@ -31,7 +31,7 @@ #include "Launcher.h" #include "QuicklistManager.h" #include "QuicklistMenuItemLabel.h" -#include "FileManagerOpenerImp.h" +#include "unity-shared/GnomeFileManager.h" namespace unity { @@ -44,9 +44,9 @@ namespace const std::string TRASH_URI = "trash:"; } -TrashLauncherIcon::TrashLauncherIcon(FileManagerOpener::Ptr const& fmo) +TrashLauncherIcon::TrashLauncherIcon(FileManager::Ptr const& fmo) : SimpleLauncherIcon(IconType::TRASH) - , file_manager_(fmo ? fmo : std::make_shared<FileManagerOpenerImp>()) + , file_manager_(fmo ? fmo : std::make_shared<GnomeFileManager>()) , cancellable_(g_cancellable_new()) { tooltip_text = _("Trash"); diff --git a/launcher/TrashLauncherIcon.h b/launcher/TrashLauncherIcon.h index 640886bf0..b6b5d8e65 100644 --- a/launcher/TrashLauncherIcon.h +++ b/launcher/TrashLauncherIcon.h @@ -26,7 +26,7 @@ #include "DndData.h" #include "SimpleLauncherIcon.h" -#include "FileManagerOpener.h" +#include "unity-shared/FileManager.h" namespace unity { @@ -37,7 +37,7 @@ class TrashLauncherIcon : public SimpleLauncherIcon { public: - TrashLauncherIcon(FileManagerOpener::Ptr const& = nullptr); + TrashLauncherIcon(FileManager::Ptr const& = nullptr); ~TrashLauncherIcon(); protected: @@ -56,7 +56,7 @@ private: static void UpdateTrashIconCb(GObject* source, GAsyncResult* res, gpointer data); bool empty_; - FileManagerOpener::Ptr file_manager_; + FileManager::Ptr file_manager_; glib::Object<GCancellable> cancellable_; glib::Object<GFileMonitor> trash_monitor_; glib::Signal<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent> trash_changed_signal_; diff --git a/launcher/VolumeImp.cpp b/launcher/VolumeImp.cpp index b00ccd965..bba205a49 100644 --- a/launcher/VolumeImp.cpp +++ b/launcher/VolumeImp.cpp @@ -36,14 +36,14 @@ class VolumeImp::Impl { public: Impl(glib::Object<GVolume> const& volume, - FileManagerOpener::Ptr const& file_manager_opener, + FileManager::Ptr const& file_manager, DeviceNotificationDisplay::Ptr const& device_notification_display, VolumeImp* parent) : parent_(parent) , open_timestamp_(0) , cancellable_(g_cancellable_new()) , volume_(volume) - , file_manager_opener_(file_manager_opener) + , file_manager_(file_manager) , device_notification_display_(device_notification_display) { signal_volume_changed_.Connect(volume_, "changed", [this] (GVolume*) { @@ -173,7 +173,7 @@ public: void OpenInFileManager() { - file_manager_opener_->Open(GetUri(), open_timestamp_); + file_manager_->Open(GetUri(), open_timestamp_); } std::string GetUri() @@ -222,7 +222,7 @@ public: unsigned long long open_timestamp_; glib::Object<GCancellable> cancellable_; glib::Object<GVolume> volume_; - FileManagerOpener::Ptr file_manager_opener_; + FileManager::Ptr file_manager_; DeviceNotificationDisplay::Ptr device_notification_display_; glib::Signal<void, GVolume*> signal_volume_changed_; @@ -234,9 +234,9 @@ public: // VolumeImp::VolumeImp(glib::Object<GVolume> const& volume, - FileManagerOpener::Ptr const& file_manager_opener, + FileManager::Ptr const& file_manager, DeviceNotificationDisplay::Ptr const& device_notification_display) - : pimpl(new Impl(volume, file_manager_opener, device_notification_display, this)) + : pimpl(new Impl(volume, file_manager, device_notification_display, this)) {} VolumeImp::~VolumeImp() diff --git a/launcher/VolumeImp.h b/launcher/VolumeImp.h index cea1768de..bac826c59 100644 --- a/launcher/VolumeImp.h +++ b/launcher/VolumeImp.h @@ -25,8 +25,8 @@ #include <UnityCore/GLibWrapper.h> #include "DeviceNotificationDisplay.h" -#include "FileManagerOpener.h" #include "Volume.h" +#include "unity-shared/FileManager.h" namespace unity { @@ -39,7 +39,7 @@ public: typedef std::shared_ptr<VolumeImp> Ptr; VolumeImp(glib::Object<GVolume> const& volume, - FileManagerOpener::Ptr const& file_manager_opener, + FileManager::Ptr const& file_manager, DeviceNotificationDisplay::Ptr const& device_notification_display); virtual ~VolumeImp(); diff --git a/tests/test_trash_launcher_icon.cpp b/tests/test_trash_launcher_icon.cpp index 95bd08c86..a13d63b77 100644 --- a/tests/test_trash_launcher_icon.cpp +++ b/tests/test_trash_launcher_icon.cpp @@ -26,7 +26,7 @@ using namespace unity::launcher; namespace { -struct MockFileManagerOpener : launcher::FileManagerOpener +struct MockFileManager : FileManager { MOCK_METHOD2(Open, void(std::string const& uri, unsigned long long time)); }; @@ -34,11 +34,11 @@ struct MockFileManagerOpener : launcher::FileManagerOpener struct TestTrashLauncherIcon : testing::Test { TestTrashLauncherIcon() - : fmo_(std::make_shared<MockFileManagerOpener>()) - , icon(fmo_) + : fm_(std::make_shared<MockFileManager>()) + , icon(fm_) {} - std::shared_ptr<MockFileManagerOpener> fmo_; + std::shared_ptr<MockFileManager> fm_; TrashLauncherIcon icon; }; @@ -50,7 +50,7 @@ TEST_F(TestTrashLauncherIcon, Position) TEST_F(TestTrashLauncherIcon, Activate) { unsigned long long time = g_random_int(); - EXPECT_CALL(*fmo_, Open("trash:", time)); + EXPECT_CALL(*fm_, Open("trash:", time)); icon.Activate(ActionArg(ActionArg::Source::LAUNCHER, 0, time)); } diff --git a/tests/test_volume_imp.cpp b/tests/test_volume_imp.cpp index e421805ca..ddbf30b2b 100644 --- a/tests/test_volume_imp.cpp +++ b/tests/test_volume_imp.cpp @@ -31,10 +31,10 @@ using namespace unity; namespace { -class MockFileManagerOpener : public launcher::FileManagerOpener +class MockFileManager : public FileManager { public: - typedef std::shared_ptr<MockFileManagerOpener> Ptr; + typedef std::shared_ptr<MockFileManager> Ptr; MOCK_METHOD2(Open, void(std::string const& uri, unsigned long long time)); }; @@ -53,14 +53,14 @@ public: void SetUp() { gvolume_ = g_mock_volume_new(); - file_manager_opener_.reset(new MockFileManagerOpener); + file_manager_.reset(new MockFileManager); device_notification_display_.reset(new MockDeviceNotificationDisplay); volume_.reset(new launcher::VolumeImp(glib::Object<GVolume>(G_VOLUME(gvolume_.RawPtr()), glib::AddRef()), - file_manager_opener_, device_notification_display_)); + file_manager_, device_notification_display_)); } glib::Object<GMockVolume> gvolume_; - MockFileManagerOpener::Ptr file_manager_opener_; + MockFileManager::Ptr file_manager_; MockDeviceNotificationDisplay::Ptr device_notification_display_; launcher::VolumeImp::Ptr volume_; }; @@ -129,14 +129,14 @@ TEST_F(TestVolumeImp, TestEjectAndShowNotification) TEST_F(TestVolumeImp, TestMountAndOpenInFileManager) { unsigned long long time = g_random_int(); - EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI, time)); + EXPECT_CALL(*file_manager_, Open(ROOT_FILE_URI, time)); volume_->MountAndOpenInFileManager(time); EXPECT_EQ(g_mock_volume_last_mount_had_mount_operation(gvolume_), TRUE); EXPECT_TRUE(volume_->IsMounted()); time = g_random_int(); - EXPECT_CALL(*file_manager_opener_, Open(ROOT_FILE_URI, time)); + EXPECT_CALL(*file_manager_, Open(ROOT_FILE_URI, time)); volume_->MountAndOpenInFileManager(time); EXPECT_EQ(g_mock_volume_last_mount_had_mount_operation(gvolume_), TRUE); diff --git a/unity-shared/BackgroundEffectHelper.cpp b/unity-shared/BackgroundEffectHelper.cpp index 6a1ea94d2..33b1ee03a 100644 --- a/unity-shared/BackgroundEffectHelper.cpp +++ b/unity-shared/BackgroundEffectHelper.cpp @@ -203,6 +203,7 @@ nux::ObjectPtr<nux::IOpenGLBaseTexture> BackgroundEffectHelper::GetBlurRegion(nu { float noise_factor = 1.1f; float gaussian_sigma = opengl_version >= 3 ? sigma_high : sigma_med; + int blur_passes = 1; nux::ObjectPtr<nux::IOpenGLBaseTexture> device_texture = gpu_device->backup_texture0_; nux::ObjectPtr<nux::CachedBaseTexture> noise_device_texture = graphics_engine->CacheResource(noise_texture_); @@ -211,9 +212,9 @@ nux::ObjectPtr<nux::IOpenGLBaseTexture> BackgroundEffectHelper::GetBlurRegion(nu unsigned int buffer_height = larger_blur_geometry.height; blur_fx_struct_.src_texture = device_texture; - graphics_engine->QRP_GLSL_GetLSBlurFx(0, 0, buffer_width, buffer_height, + graphics_engine->QRP_GLSL_GetHQBlurFx(0, 0, buffer_width, buffer_height, &blur_fx_struct_, texxform__bg, nux::color::White, - gaussian_sigma); + gaussian_sigma, blur_passes); nux::TexCoordXForm texxform; nux::TexCoordXForm noise_texxform; diff --git a/unity-shared/CMakeLists.txt b/unity-shared/CMakeLists.txt index ead1ec981..b4078c418 100644 --- a/unity-shared/CMakeLists.txt +++ b/unity-shared/CMakeLists.txt @@ -26,6 +26,7 @@ set (UNITY_SHARED_SOURCES DebugDBusInterface.cpp DefaultThumbnailProvider.cpp DeltaRestrainment.cpp + GnomeFileManager.cpp FontSettings.cpp GraphicsUtils.cpp IMTextEntry.cpp diff --git a/launcher/FileManagerOpener.h b/unity-shared/FileManager.h index b96d495fd..e19cdf5d7 100644 --- a/launcher/FileManagerOpener.h +++ b/unity-shared/FileManager.h @@ -1,6 +1,6 @@ // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- /* - * Copyright (C) 2012 Canonical Ltd + * Copyright (C) 2012-2013 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as @@ -15,34 +15,32 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> + * Marco Trevisan <marco.trevisan@canonical.com> */ -#ifndef UNITYSHELL_FILEMANAGER_OPENER_H -#define UNITYSHELL_FILEMANAGER_OPENER_H +#ifndef UNITYSHELL_FILEMANAGER_H +#define UNITYSHELL_FILEMANAGER_H #include <memory> #include <string> namespace unity { -namespace launcher -{ -class FileManagerOpener +class FileManager { public: - typedef std::shared_ptr<FileManagerOpener> Ptr; + typedef std::shared_ptr<FileManager> Ptr; - FileManagerOpener() = default; - virtual ~FileManagerOpener() {} + FileManager() = default; + virtual ~FileManager() {} virtual void Open(std::string const& uri, unsigned long long timestamp = 0) = 0; private: - FileManagerOpener(FileManagerOpener const&) = delete; - FileManagerOpener& operator=(FileManagerOpener const&) = delete; + FileManager(FileManager const&) = delete; + FileManager& operator=(FileManager const&) = delete; }; } -} #endif diff --git a/launcher/FileManagerOpenerImp.cpp b/unity-shared/GnomeFileManager.cpp index 4d5068c26..0e2ebb4a7 100644 --- a/launcher/FileManagerOpenerImp.cpp +++ b/unity-shared/GnomeFileManager.cpp @@ -18,19 +18,17 @@ * Marco Trevisan <marco.trevisan@canonical.com> */ -#include "FileManagerOpenerImp.h" +#include "GnomeFileManager.h" #include <NuxCore/Logger.h> #include <UnityCore/GLibWrapper.h> #include <gdk/gdk.h> namespace unity { -namespace launcher -{ -DECLARE_LOGGER(logger, "unity.launcher.filemanager.opener.imp"); +DECLARE_LOGGER(logger, "unity.filemanager.gnome"); -void FileManagerOpenerImp::Open(std::string const& uri, unsigned long long timestamp) +void GnomeFileManager::Open(std::string const& uri, unsigned long long timestamp) { if (uri.empty()) { @@ -55,4 +53,3 @@ void FileManagerOpenerImp::Open(std::string const& uri, unsigned long long times } } -} diff --git a/launcher/FileManagerOpenerImp.h b/unity-shared/GnomeFileManager.h index 09785ed5b..12eee929e 100644 --- a/launcher/FileManagerOpenerImp.h +++ b/unity-shared/GnomeFileManager.h @@ -1,6 +1,6 @@ // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- /* - * Copyright (C) 2012 Canonical Ltd + * Copyright (C) 2012-2013 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as @@ -15,25 +15,23 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> + * Marco Trevisan <marco.trevisan@canonical.com> */ -#ifndef UNITYSHELL_FILEMANAGER_OPENER_IMP_H -#define UNITYSHELL_FILEMANAGER_OPENER_IMP_H +#ifndef UNITYSHELL_GNOME_FILEMANAGER_H +#define UNITYSHELL_GNOME_FILEMANAGER_H -#include "FileManagerOpener.h" +#include "FileManager.h" namespace unity { -namespace launcher -{ -class FileManagerOpenerImp : public FileManagerOpener +class GnomeFileManager : public FileManager { public: virtual void Open(std::string const& uri, unsigned long long timestamp); }; } -} #endif |
