@geastack/host 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/audio_runtime.cpp CHANGED
@@ -22,6 +22,7 @@
22
22
  #include "freertos/queue.h"
23
23
  #include "freertos/task.h"
24
24
  #include "platform/file_cache.h"
25
+ #include "program.h"
25
26
 
26
27
  // Optional build-embedded asset registry supplied by the native app pipeline.
27
28
  extern "C" bool gea_embedded_asset_lookup(const char*, const unsigned char**, unsigned long*)
@@ -977,8 +978,10 @@ bool audio::AudioSystem::playFile(const std::string &path) {
977
978
  // recording is tens of MB and would exhaust PSRAM).
978
979
  const unsigned char* embedded = nullptr;
979
980
  unsigned long embeddedBytes = 0;
980
- if (gea_embedded_asset_lookup &&
981
- gea_embedded_asset_lookup(path.c_str(), &embedded, &embeddedBytes)) {
981
+ const auto *loaded = gea::framework::program::loaded();
982
+ const bool bundled = loaded ? (loaded->assetLookup && loaded->assetLookup(path.c_str(), &embedded, &embeddedBytes))
983
+ : (gea_embedded_asset_lookup && gea_embedded_asset_lookup(path.c_str(), &embedded, &embeddedBytes));
984
+ if (bundled) {
982
985
  return playEmbeddedWav(embedded, embeddedBytes);
983
986
  }
984
987
  if (!streamPcm16File(path)) {
package/host/apps.cpp CHANGED
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  #include <string>
3
3
 
4
- #include "apps.h"
4
+ #include "geaos.h"
5
5
  #include "gea/embedded-host.h"
6
6
 
7
7
  namespace gea::framework::host {
@@ -9,7 +9,7 @@ namespace gea::framework::host {
9
9
  class AppHost {
10
10
  public:
11
11
  static double launch(const std::string &app_id) {
12
- return apps::AppManager::launch(app_id.c_str()) ? 1.0 : 0.0;
12
+ return gea::geaos::Launcher::launch(app_id) ? 1.0 : 0.0;
13
13
  }
14
14
  };
15
15
 
package/host/image.cpp CHANGED
@@ -7,6 +7,7 @@
7
7
  #undef GEA_CPP_VALUE_AVAILABLE
8
8
  #endif
9
9
  #include "host/image.h"
10
+ #include "program.h"
10
11
 
11
12
  #include "display.h"
12
13
  #include "gea/embedded-host.h"
@@ -93,6 +94,14 @@ extern "C" bool gea_embedded_asset_lookup(const char *path,
93
94
  unsigned long *length)
94
95
  GEA_PROGRAM_HOOK;
95
96
 
97
+ // The running program's bundled assets: a loaded program's own registry
98
+ // (program.h), else the one linked into the firmware.
99
+ bool programAssetLookup(const char *path, const unsigned char **data, unsigned long *length) {
100
+ if (const auto *loaded = gea::framework::program::loaded())
101
+ return loaded->assetLookup && loaded->assetLookup(path, data, length);
102
+ return gea_embedded_asset_lookup && gea_embedded_asset_lookup(path, data, length);
103
+ }
104
+
96
105
  namespace {
97
106
 
98
107
  gea::framework::graphics::ImageStore &store() {
@@ -101,6 +110,13 @@ gea::framework::graphics::ImageStore &store() {
101
110
 
102
111
  int integer(double value) { return static_cast<int>(value); }
103
112
 
113
+ // Bundled-asset decodes by the asset's (stable, flash) address: see
114
+ // ImageService::loadBytesPtr and gea_host_image_dispose_assets.
115
+ std::unordered_map<const void *, int> &assetCache() {
116
+ static std::unordered_map<const void *, int> cache;
117
+ return cache;
118
+ }
119
+
104
120
  // An absolute filesystem path: `/...`, and on Windows also a drive path
105
121
  // (`C:/...`, `C:\...`) or a UNC path (`\\server\...`), which is how an
106
122
  // absolute path is spelled there.
@@ -209,7 +225,7 @@ double ImageService::loadBytesPtr(const std::uint8_t *data,
209
225
  // One decode per asset; an <img> that remounts reuses the same slot instead
210
226
  // of leaking a fresh decode each time. The embedded symbol address is stable,
211
227
  // so it's a safe cache key.
212
- static std::unordered_map<const void *, int> cache;
228
+ auto &cache = assetCache();
213
229
  const auto cached = cache.find(data);
214
230
  if (cached != cache.end())
215
231
  return static_cast<double>(cached->second);
@@ -224,10 +240,10 @@ double ImageService::loadAssetPath(const char *path) const {
224
240
  if (!path)
225
241
  return -1.0;
226
242
  // First: a bundled/flash asset (the common <img src="/logo.png"> case).
227
- if (gea_embedded_asset_lookup) {
243
+ {
228
244
  const unsigned char *data = nullptr;
229
245
  unsigned long length = 0;
230
- if (gea_embedded_asset_lookup(path, &data, &length))
246
+ if (programAssetLookup(path, &data, &length))
231
247
  return loadBytesPtr(data, static_cast<std::size_t>(length));
232
248
  }
233
249
  // Fallback: an absolute filesystem path (e.g. an EPUB cover extracted to the
@@ -444,6 +460,16 @@ void GeaEmbeddedImage::dispose() const { store().dispose(id); }
444
460
 
445
461
  } // namespace gea::host
446
462
 
463
+ // Drops every bundled-asset decode: each slot is disposed (now, or when the
464
+ // last node showing it lets go) and the next load of that asset decodes into a
465
+ // fresh slot. For a program that unloads one screen's images to show
466
+ // another's, so the asset cache does not keep every image it ever showed.
467
+ extern "C" void gea_host_image_dispose_assets() {
468
+ auto &cache = gea::host::assetCache();
469
+ for (const auto &entry : cache) gea::host::store().dispose(entry.second);
470
+ cache.clear();
471
+ }
472
+
447
473
  extern "C" double gea_host_image_load_asset_path(const char *path) {
448
474
  return gea::host::image.loadAssetPath(path);
449
475
  }
@@ -453,10 +479,10 @@ extern "C" double gea_host_image_load_asset_path(const char *path) {
453
479
  extern "C" double gea_host_image_acquire_asset_path(const char *path, bool *owned) {
454
480
  *owned = false;
455
481
  if (!path) return -1.0;
456
- if (gea::host::gea_embedded_asset_lookup) {
482
+ {
457
483
  const unsigned char *data = nullptr;
458
484
  unsigned long length = 0;
459
- if (gea::host::gea_embedded_asset_lookup(path, &data, &length))
485
+ if (gea::host::programAssetLookup(path, &data, &length))
460
486
  return gea::host::image.loadBytesPtr(data, length);
461
487
  }
462
488
  if (!gea::host::isAbsoluteFilePath(path)) return -1.0;
@@ -10,6 +10,8 @@
10
10
 
11
11
  #include <display.h>
12
12
  #include "host/backends.h"
13
+ #include "host/css.h"
14
+ #include "host/dom_rect.h"
13
15
  #include "host/fetch.h"
14
16
  #include "geolocation.h"
15
17
  #include "host/websocket.h"
@@ -447,7 +447,7 @@ public:
447
447
  // closes Settings. Set from the platform's launcher-button task (BOOT
448
448
  // short press on ESP32) and from an application's `_settings_toggle()`
449
449
  // entry stub (fired by `Application::toggleSettings()` for `SettingsToggle`
450
- // events posted via `AppManager::queueSettingsToggle()`).
450
+ // events posted via `gea::geaos::queueSettingsToggle()`).
451
451
  static bool consumeBackButton();
452
452
  };
453
453
 
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ #pragma once
3
+
4
+ #include <string>
5
+ #include <string_view>
6
+
7
+ namespace gea::host::css {
8
+
9
+ // CSSOM's identifier serialization. Non-ASCII characters pass through,
10
+ // so the special cases can be handled directly on the UTF-8 bytes.
11
+ inline std::string escape(std::string_view identifier) {
12
+ constexpr char hex[] = "0123456789abcdef";
13
+ std::string result;
14
+ result.reserve(identifier.size());
15
+ for (std::size_t index = 0; index < identifier.size(); ++index) {
16
+ const auto byte = static_cast<unsigned char>(identifier[index]);
17
+ const bool digit = byte >= '0' && byte <= '9';
18
+ if (byte == 0) {
19
+ result += "\xEF\xBF\xBD";
20
+ } else if (byte <= 0x1f || byte == 0x7f ||
21
+ (digit && (index == 0 || (index == 1 && identifier.front() == '-')))) {
22
+ result += '\\';
23
+ if (byte >= 16) result += hex[byte >> 4];
24
+ result += hex[byte & 15];
25
+ result += ' ';
26
+ } else {
27
+ const bool letter = (byte >= 'A' && byte <= 'Z') || (byte >= 'a' && byte <= 'z');
28
+ const bool loneHyphen = byte == '-' && identifier.size() == 1;
29
+ if (loneHyphen || !(byte >= 0x80 || byte == '-' || byte == '_' || digit || letter)) result += '\\';
30
+ result += identifier[index];
31
+ }
32
+ }
33
+ return result;
34
+ }
35
+
36
+ } // namespace gea::host::css
@@ -0,0 +1,51 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ #pragma once
3
+
4
+ #include <cmath>
5
+ #include <memory>
6
+
7
+ namespace gea::host {
8
+
9
+ class DOMRect {
10
+ struct Coordinates {
11
+ double x, y, width, height;
12
+ };
13
+
14
+ std::shared_ptr<Coordinates> coordinates_;
15
+
16
+ public:
17
+ static DOMRect create(double x = 0, double y = 0,
18
+ double width = 0, double height = 0) {
19
+ DOMRect rect;
20
+ rect.coordinates_ = std::make_shared<Coordinates>(Coordinates{x, y, width, height});
21
+ return rect;
22
+ }
23
+
24
+ explicit operator bool() const { return static_cast<bool>(coordinates_); }
25
+ bool operator==(const DOMRect &) const = default;
26
+
27
+ double &x() const { return coordinates_->x; }
28
+ double &y() const { return coordinates_->y; }
29
+ double &width() const { return coordinates_->width; }
30
+ double &height() const { return coordinates_->height; }
31
+
32
+ double top() const { return minimum(y(), y() + height()); }
33
+ double right() const { return maximum(x(), x() + width()); }
34
+ double bottom() const { return maximum(y(), y() + height()); }
35
+ double left() const { return minimum(x(), x() + width()); }
36
+
37
+ private:
38
+ static double minimum(double a, double b) {
39
+ if (std::isnan(a)) return a;
40
+ if (std::isnan(b)) return b;
41
+ return b < a || (a == b && std::signbit(b)) ? b : a;
42
+ }
43
+
44
+ static double maximum(double a, double b) {
45
+ if (std::isnan(a)) return a;
46
+ if (std::isnan(b)) return b;
47
+ return b > a || (a == b && !std::signbit(b)) ? b : a;
48
+ }
49
+ };
50
+
51
+ } // namespace gea::host
@@ -416,6 +416,10 @@ public:
416
416
  void clearWatch(double id) const { (void)id; }
417
417
  };
418
418
 
419
+ struct NetworkInformation {
420
+ double downlink;
421
+ };
422
+
419
423
  class Navigator {
420
424
  public:
421
425
  const char *userAgent = "gea-embedded";
@@ -1,6 +1,9 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  #pragma once
3
3
 
4
+ #include <string>
5
+ #include <vector>
6
+
4
7
  #ifdef ESP_PLATFORM
5
8
  #include "esp_cpu.h"
6
9
  #include "esp_timer.h"
@@ -46,4 +49,26 @@ struct ProfilerFacade {
46
49
 
47
50
  inline constexpr ProfilerFacade Profiler{};
48
51
 
52
+ struct ResourceTiming {
53
+ double transferSize;
54
+ std::string initiatorType;
55
+ double duration;
56
+ double startTime;
57
+ double responseEnd;
58
+ };
59
+
60
+ struct PerformanceFacade {
61
+ double now() const {
62
+ static const double originUs = Profiler.nowUs();
63
+ return (Profiler.nowUs() - originUs) / 1000.0;
64
+ }
65
+
66
+ std::vector<ResourceTiming> getEntriesByType(const std::string&) const {
67
+ // The native host does not publish resource timing entries.
68
+ return {};
69
+ }
70
+ };
71
+
72
+ inline constexpr PerformanceFacade performance{};
73
+
49
74
  } // namespace gea::host
@@ -3,6 +3,13 @@
3
3
 
4
4
  #include <functional>
5
5
  #include <cstdint>
6
+ #include <type_traits>
7
+
8
+ namespace gea {
9
+ template <typename Signature> struct CallableObject;
10
+ template <typename T> class Optional;
11
+ struct Undefined;
12
+ }
6
13
 
7
14
  namespace gea::host {
8
15
 
@@ -23,9 +30,21 @@ struct AnimationFramePerfStats {
23
30
  int droppedCount = 0;
24
31
  };
25
32
 
26
- double setTimeout(TimerCallback callback, double delayMs);
27
- double setInterval(TimerCallback callback, double delayMs);
33
+ double setTimeout(TimerCallback callback, double delayMs = 0.0);
34
+ template <typename Result, typename Argument, typename Missing = gea::Undefined,
35
+ typename = decltype(static_cast<Argument>(Missing{}))>
36
+ double setTimeout(const gea::CallableObject<Result(Argument)> &callback, double delayMs = 0.0)
37
+ {
38
+ return setTimeout(TimerCallback([callback] { callback.call(static_cast<Argument>(Missing{})); }), delayMs);
39
+ }
40
+ double setInterval(TimerCallback callback, double delayMs = 0.0);
28
41
  void clearTimeout(double id = 0);
42
+ inline void clearTimeout(const gea::Undefined &) {}
43
+ template <typename Number, std::enable_if_t<std::is_arithmetic_v<Number>, int> = 0>
44
+ void clearTimeout(const gea::Optional<Number> &id)
45
+ {
46
+ if (id.has_value()) clearTimeout(static_cast<double>(*id));
47
+ }
29
48
  void clearInterval(double id = 0);
30
49
  void resetScheduledTimers();
31
50
 
@@ -5,15 +5,81 @@
5
5
  #include <event_listener_options.h>
6
6
  #include <ui/document.h>
7
7
  #include <ui/tree_events.h>
8
+ #include <cstddef>
8
9
  #include <string>
9
10
  #include <type_traits>
10
- #include <cstdlib>
11
11
 
12
- namespace gea { template <typename Signature> struct CallableObject; }
12
+ namespace gea {
13
+ template <typename Signature> struct CallableObject;
14
+ template <typename T> class Optional;
15
+ struct Undefined;
16
+ }
13
17
 
14
18
  namespace gea::host {
15
19
 
20
+ [[noreturn]] inline void throwRuntimeError(const char *kind, const std::string &message);
21
+
22
+ // A value token for the one engine-owned document. Its members dispatch
23
+ // through Document::instance(), and copies denote the same document.
24
+ struct DocumentFacade {
25
+ explicit constexpr operator bool() const noexcept { return true; }
26
+ constexpr bool operator==(const DocumentFacade &) const = default;
27
+ constexpr bool valid() const noexcept { return true; }
28
+ std::shared_ptr<void> propertyStorage(const std::shared_ptr<void> &initial = {}) const {
29
+ return gea::embedded::ui::Document::instance().propertyStorage(initial);
30
+ }
31
+ };
32
+
33
+ inline constexpr DocumentFacade documentValue{};
34
+
35
+ using gea::embedded::ui::getComputedStyle;
36
+
37
+ inline auto getComputedStyle(gea::embedded::ui::NodeHandle node, std::nullptr_t)
38
+ {
39
+ return getComputedStyle(node);
40
+ }
41
+
42
+ inline auto getComputedStyle(gea::embedded::ui::NodeHandle node, const gea::Undefined &)
43
+ {
44
+ return getComputedStyle(node);
45
+ }
46
+
47
+ template <typename T>
48
+ auto getComputedStyle(gea::embedded::ui::NodeHandle node, const gea::Optional<T> &pseudo)
49
+ {
50
+ return pseudo.has_value() ? getComputedStyle(node, std::string_view(*pseudo)) : getComputedStyle(node);
51
+ }
52
+
53
+ inline gea::embedded::ui::NodeHandle documentCreateElementNS(const std::string &uri, const std::string &name)
54
+ {
55
+ return gea::embedded::ui::Document::instance().createElementNS(uri, name);
56
+ }
57
+
58
+ inline gea::embedded::ui::NodeHandle documentCreateElementNS(std::nullptr_t, const std::string &name)
59
+ {
60
+ return documentCreateElementNS(std::string{}, name);
61
+ }
62
+
63
+ template <typename T>
64
+ gea::embedded::ui::NodeHandle documentCreateElementNS(const gea::Optional<T> &uri, const std::string &name)
65
+ {
66
+ return uri.has_value() ? documentCreateElementNS(*uri, name) : documentCreateElementNS(nullptr, name);
67
+ }
68
+
69
+ struct SelectionFacade {
70
+ gea::embedded::ui::DocumentSelection state() const {
71
+ return gea::embedded::ui::Document::instance().selection();
72
+ }
73
+ void selectAllChildren(const gea::embedded::ui::NodeHandle &node) const {
74
+ gea::embedded::ui::Document::instance().selectAllChildren(node);
75
+ }
76
+ void removeAllRanges() const {
77
+ gea::embedded::ui::Document::instance().clearSelection();
78
+ }
79
+ };
80
+
16
81
  struct WindowFacade {
82
+ SelectionFacade getSelection() const { return {}; }
17
83
  template <typename Result, typename Argument>
18
84
  void addEventListener(const std::string &type,
19
85
  const gea::CallableObject<Result(Argument)> &handler,
@@ -27,7 +93,8 @@ struct WindowFacade {
27
93
  handler.functionObjectIdentity().get(),
28
94
  gea::framework::events::explicitEventCallback([](auto& held, gea::framework::events::PointerEvent &event) {
29
95
  held.call(static_cast<std::decay_t<Argument>>(event));
30
- }, held), capture, once)) std::abort();
96
+ }, held), capture, once))
97
+ throwRuntimeError("TypeError", "Native window could not register event listener: " + type);
31
98
  }
32
99
  template <typename Result>
33
100
  void addEventListener(const std::string &type,
@@ -38,25 +105,38 @@ struct WindowFacade {
38
105
  if (!gea::embedded::ui::addWindowEventListener(type.c_str(),
39
106
  handler.functionObjectIdentity().get(),
40
107
  gea::framework::events::explicitEventCallback([](auto& held, gea::framework::events::PointerEvent &) { held.call(); }, held),
41
- capture, once)) std::abort();
108
+ capture, once))
109
+ throwRuntimeError("TypeError", "Native window could not register event listener: " + type);
42
110
  }
111
+ template <typename Handler>
112
+ requires (!requires(const Handler &handler) { handler.functionObjectIdentity(); })
113
+ void addEventListener(const std::string &, const Handler &, bool = false, bool = false) const {
114
+ throwRuntimeError("TypeError", "Native window listeners must be functions");
115
+ }
116
+
43
117
  template <typename Handler>
44
118
  void removeEventListener(const std::string &type, const Handler &handler,
45
119
  bool capture = false) const {
46
- gea::embedded::ui::removeWindowEventListener(type.c_str(),
47
- handler.functionObjectIdentity().get(), capture);
120
+ if constexpr (requires { handler.functionObjectIdentity(); })
121
+ gea::embedded::ui::removeWindowEventListener(type.c_str(), handler.functionObjectIdentity().get(), capture);
48
122
  }
49
123
  template <typename Handler, typename Options>
50
124
  requires (!std::is_same_v<std::decay_t<Options>,bool>)
51
125
  void addEventListener(const std::string &type, const Handler &handler, const Options &options) const {
52
- const auto parsed = gea::framework::events::listenerOptions(options);
53
- addEventListener(type,handler,parsed.capture,parsed.once);
126
+ if constexpr (requires { handler.functionObjectIdentity(); }) {
127
+ const auto parsed = gea::framework::events::listenerOptions(options);
128
+ addEventListener(type, handler, parsed.capture, parsed.once);
129
+ } else {
130
+ addEventListener(type, handler);
131
+ }
54
132
  }
55
133
  template <typename Handler, typename Options>
56
134
  requires (!std::is_same_v<std::decay_t<Options>,bool>)
57
135
  void removeEventListener(const std::string &type, const Handler &handler, const Options &options) const {
58
- const auto parsed = gea::framework::events::listenerOptions(options);
59
- removeEventListener(type,handler,parsed.capture);
136
+ if constexpr (requires { handler.functionObjectIdentity(); }) {
137
+ const auto parsed = gea::framework::events::listenerOptions(options);
138
+ removeEventListener(type, handler, parsed.capture);
139
+ }
60
140
  }
61
141
  double innerWidth() const {
62
142
  #if defined(GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT) && GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT
@@ -75,6 +155,10 @@ struct WindowFacade {
75
155
  return static_cast<double>(h > 0 ? h : gea::platform::display::kHeight);
76
156
  #endif
77
157
  }
158
+
159
+ double scrollX() const { return gea::embedded::ui::Document::instance().viewportScrollX(); }
160
+ double scrollY() const { return gea::embedded::ui::Document::instance().viewportScrollY(); }
161
+ void scrollTo(double x, double y) const { gea::embedded::ui::Document::instance().scrollViewportTo(x, y); }
78
162
  };
79
163
 
80
164
  inline constexpr WindowFacade window{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/host",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "GeaStack host bindings and platform service sources.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,14 +1,14 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  #include "services/app_state.h"
3
3
 
4
- #include "apps.h"
4
+ #include "geaos.h"
5
5
  #include "services/mirror.h"
6
6
 
7
7
  namespace gea::framework::services {
8
8
 
9
9
  const char *AppState::currentAppId()
10
10
  {
11
- return gea::framework::apps::AppManager::currentId();
11
+ return gea::geaos::Launcher::currentId();
12
12
  }
13
13
 
14
14
  void AppState::afterAppInit()
@@ -21,7 +21,7 @@
21
21
  #include <cstring>
22
22
 
23
23
  #include <display.h>
24
- #include <apps.h>
24
+ #include "geaos.h"
25
25
  #include "ui/document.h"
26
26
  #include "ui/node.h"
27
27
  #include "ui/style.h"
@@ -73,12 +73,20 @@ private:
73
73
  void open()
74
74
  {
75
75
  brightness_ = clampPct(static_cast<int>(gea::platform::display::Display::brightness()));
76
+ openedBrightness_ = brightness_;
76
77
  buildPanel();
77
78
  active_ = true;
78
79
  }
79
80
 
80
81
  void close()
81
82
  {
83
+ // The brightness the user left it at is the device's from now on
84
+ // (geaos settings, applied at boot); written once, not per step.
85
+ if (active_ && brightness_ != openedBrightness_) {
86
+ auto &settings = gea::geaos::deviceSettings();
87
+ settings.setNumber(gea::geaos::settingKeys::kBrightness, brightness_);
88
+ if (!settings.path().empty()) settings.save(gea::geaos::posixFs());
89
+ }
82
90
  if (rootId_ >= 0) NodeHandle(rootId_).remove();
83
91
  rootId_ = -1;
84
92
  valueId_ = -1;
@@ -172,7 +180,7 @@ private:
172
180
  root.appendChild(value);
173
181
  root.appendChild(chip("+", kPlusX, 0x3186));
174
182
 
175
- const char *appId = apps::AppManager::currentId();
183
+ const char *appId = gea::geaos::Launcher::currentId();
176
184
  char appLine[80];
177
185
  std::snprintf(appLine, sizeof(appLine), "App %s", appId ? appId : "?");
178
186
  root.appendChild(label(appLine, 40, 320, 20, 0x9CD3, 330, -1));
@@ -213,6 +221,7 @@ private:
213
221
  static constexpr int kDoneH = 64;
214
222
 
215
223
  bool active_ = false;
224
+ int openedBrightness_ = -1;
216
225
  int brightness_ = 80;
217
226
  int rootId_ = -1;
218
227
  int valueId_ = -1;