Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
hot_reload.hpp
Go to the documentation of this file.
1// Hot reload — the XML and theme files of the screen shown, watched on a
2// desktop, and the activity built again when one changes.
3// Copyright (C) 2026 JigSawFr. GPLv3-or-later (see LICENSE.GPL).
4#pragma once
5
6#include <string>
7#include <vector>
8
9namespace aurore
10{
11
12class Activity;
13
19{
20 public:
21 static void setEnabled(bool enabled, const std::string& resourcesDir = "");
22 static bool isEnabled() { return enabled; }
23
29 static std::string diskResource(const std::string& value);
30
31 // An XML file read from disk
32 static void noteXMLFile(const std::string& path);
33
34 // The theme file in use (Theme::loadFile) and the files it includes and
35 // inherits, replacing the ones before; empty without a theme file. A
36 // change to one of them reads the theme file in use again.
37 static void setThemeFiles(const std::vector<std::string>& paths);
38
39 // The activity whose content is being made, to which the XML files read
40 // are counted (the activity on top otherwise)
41 inline static Activity* building = nullptr;
42 static void forgetActivity(Activity* activity);
43
44 // From the main loop: looks at the files now and then
45 static void poll();
46
47 private:
48 inline static bool enabled = false;
49};
50
51} // namespace aurore
Definition activity.hpp:45
Definition hot_reload.hpp:19
static Activity * building
Definition hot_reload.hpp:41
static void poll()
static void setEnabled(bool enabled, const std::string &resourcesDir="")
static void setThemeFiles(const std::vector< std::string > &paths)
static std::string diskResource(const std::string &value)
static void noteXMLFile(const std::string &path)
static bool isEnabled()
Definition hot_reload.hpp:22
static void forgetActivity(Activity *activity)
Definition actions.hpp:25