aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/main.cpp8
-rw-r--r--src/service.cpp (renamed from src/rotation-lock.cpp)28
-rw-r--r--src/service.h (renamed from src/rotation-lock.h)12
4 files changed, 25 insertions, 25 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d66cc1c..f0158ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,7 +7,7 @@ add_compile_options(
set (SERVICE_LIB_SOURCES
exporter.cpp
indicator.cpp
- rotation-lock.cpp
+ service.cpp
)
if (ENABLE_LOMIRI_FEATURES)
diff --git a/src/main.cpp b/src/main.cpp
index 03c72c6..49832c6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Canonical Ltd.
- * Copyright 2022 Robert Tari
+ * Copyright 2022-2023 Robert Tari
*
* 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 published
@@ -20,7 +20,7 @@
*/
#include <src/exporter.h>
-#include <src/rotation-lock.h>
+#include <src/service.h>
#ifdef LOMIRI_FEATURES_ENABLED
#include <src/greeter.h>
@@ -57,11 +57,9 @@ main(int /*argc*/, char** /*argv*/)
g_main_loop_quit(loop);
};
- // build all our indicators.
- // Right now we've only got one -- rotation lock -- but hey, we can dream.
std::vector<std::shared_ptr<Indicator>> indicators;
std::vector<std::shared_ptr<Exporter>> exporters;
- indicators.push_back(std::make_shared<RotationLockIndicator>());
+ indicators.push_back(std::make_shared<DisplayIndicator>());
for (auto& indicator : indicators) {
auto exporter = std::make_shared<Exporter>(indicator);
exporter->name_lost().connect(on_name_lost);
diff --git a/src/rotation-lock.cpp b/src/service.cpp
index 9e2971b..121bbac 100644
--- a/src/rotation-lock.cpp
+++ b/src/service.cpp
@@ -19,7 +19,7 @@
* Robert Tari <robert@tari.in>
*/
-#include <src/rotation-lock.h>
+#include <src/service.h>
#include <glib/gi18n.h>
#ifdef COLOR_TEMP_ENABLED
@@ -53,7 +53,7 @@ TempProfile m_lTempProfiles[] =
};
#endif
-class RotationLockIndicator::Impl
+class DisplayIndicator::Impl
{
public:
@@ -150,14 +150,14 @@ public:
m_action_group = create_action_group();
// build the icon
- const char *rotation_lock_icon_name {"orientation-lock"};
+ const char *icon_name {"orientation-lock"};
if (!ayatana_common_utils_is_lomiri())
{
- rotation_lock_icon_name = "display-panel";
+ icon_name = "display-panel";
}
- auto icon = g_themed_icon_new_with_default_fallbacks(rotation_lock_icon_name);
+ auto icon = g_themed_icon_new_with_default_fallbacks(icon_name);
auto icon_deleter = [](GIcon* o){g_object_unref(G_OBJECT(o));};
m_icon.reset(icon, icon_deleter);
@@ -232,7 +232,7 @@ private:
#ifdef COLOR_TEMP_ENABLED
static gboolean updateColor (gpointer pData)
{
- RotationLockIndicator::Impl *pImpl = (RotationLockIndicator::Impl*) pData;
+ DisplayIndicator::Impl *pImpl = (DisplayIndicator::Impl*) pData;
guint nProfile = 0;
g_settings_get (pImpl->m_settings, "color-temp-profile", "q", &nProfile);
gdouble fBrightness = g_settings_get_double (pImpl->m_settings, "brightness");
@@ -360,7 +360,7 @@ private:
static void onGeoClueLoaded (GObject *pObject, GAsyncResult *pResult, gpointer pData)
{
- RotationLockIndicator::Impl *pImpl = (RotationLockIndicator::Impl*) pData;
+ DisplayIndicator::Impl *pImpl = (DisplayIndicator::Impl*) pData;
GError *pError = NULL;
GClueSimple *pSimple = gclue_simple_new_finish (pResult, &pError);
@@ -416,7 +416,7 @@ private:
{
g_simple_action_set_state (pAction, pVariant);
- RotationLockIndicator::Impl *pImpl = (RotationLockIndicator::Impl*) pData;
+ DisplayIndicator::Impl *pImpl = (DisplayIndicator::Impl*) pData;
if (pImpl->bAutoSliderUpdate)
{
@@ -724,31 +724,31 @@ private:
****
***/
-RotationLockIndicator::RotationLockIndicator():
+DisplayIndicator::DisplayIndicator():
impl(new Impl())
{
}
-RotationLockIndicator::~RotationLockIndicator()
+DisplayIndicator::~DisplayIndicator()
{
}
std::vector<std::shared_ptr<Profile>>
-RotationLockIndicator::profiles() const
+DisplayIndicator::profiles() const
{
return impl->profiles();
}
GSimpleActionGroup*
-RotationLockIndicator::action_group() const
+DisplayIndicator::action_group() const
{
return impl->action_group();
}
const char*
-RotationLockIndicator::name() const
+DisplayIndicator::name() const
{
- return "rotation_lock";
+ return "display";
}
/***
diff --git a/src/rotation-lock.h b/src/service.h
index 7bdfb14..da8d8ba 100644
--- a/src/rotation-lock.h
+++ b/src/service.h
@@ -1,5 +1,6 @@
/*
* Copyright 2014 Canonical Ltd.
+ * Copyright 2023 Robert Tari
*
* 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 published
@@ -15,20 +16,21 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
-#ifndef INDICATOR_DISPLAY_ROTATION_LOCK_H
-#define INDICATOR_DISPLAY_ROTATION_LOCK_H
+#ifndef INDICATOR_DISPLAY_SERVICE_H
+#define INDICATOR_DISPLAY_SERVICE_H
#include <src/indicator.h>
#include <memory> // std::unique_ptr
-class RotationLockIndicator: public Indicator
+class DisplayIndicator: public Indicator
{
public:
- RotationLockIndicator();
- ~RotationLockIndicator();
+ DisplayIndicator();
+ ~DisplayIndicator();
const char* name() const override;
GSimpleActionGroup* action_group() const override;