From dceb9f7d6058785cf60d9dbcc8eecdcee1053412 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Nov 2014 13:40:43 +0100 Subject: Implement proper font handling --- src/settings.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/settings.h') diff --git a/src/settings.h b/src/settings.h index f0ef9f6b2..0faccba4d 100644 --- a/src/settings.h +++ b/src/settings.h @@ -45,6 +45,9 @@ struct ValueSpec const char *help; }; +/** function type to register a changed callback */ +typedef void (*setting_changed_callback)(const std::string); + class Settings { @@ -139,7 +142,7 @@ public: void clear(); void updateValue(const Settings &other, const std::string &name); void update(const Settings &other); - + void registerChangedCallback(std::string name, setting_changed_callback cbf); private: /*********************** @@ -166,9 +169,11 @@ private: void updateNoLock(const Settings &other); void clearNoLock(); + void doCallbacks(std::string name); std::map m_settings; std::map m_defaults; + std::map > m_callbacks; // All methods that access m_settings/m_defaults directly should lock this. mutable JMutex m_mutex; }; -- cgit v1.2.3