From 3b7dbdfeb84b08426d315f62b65cfe1d33ae457b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 15 Aug 2016 22:13:29 +0200 Subject: [PATCH] Re-enable luabridge addProperty() In preparation to expose ARDOUR::SessionConfiguration. Also change the return-type to bool to match Ardour's set/get API --- libs/lua/LuaBridge/detail/Namespace.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index 92aed81530..0be54456b3 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -783,13 +783,12 @@ private: return *this; } -#if 0 // unused //-------------------------------------------------------------------------- /** Add or replace a property member. */ template - Class & addProperty (char const* name, TG (T::* get) () const, void (T::* set) (TS)) + Class & addProperty (char const* name, TG (T::* get) () const, bool (T::* set) (TS)) { // Add to __propget in class and const tables. { @@ -808,7 +807,7 @@ private: // Add to __propset in class table. rawgetfield (L, -2, "__propset"); assert (lua_istable (L, -1)); - typedef void (T::* set_t) (TS); + typedef bool (T::* set_t) (TS); new (lua_newuserdata (L, sizeof (set_t))) set_t (set); lua_pushcclosure (L, &CFunc::CallMember ::f, 1); rawsetfield (L, -2, name); @@ -818,6 +817,7 @@ private: return *this; } +#if 0 // unused // read-only template Class & addProperty (char const* name, TG (T::* get) () const) @@ -835,6 +835,7 @@ private: return *this; } +#endif //-------------------------------------------------------------------------- /** @@ -848,7 +849,7 @@ private: argument respectively. */ template - Class & addProperty (char const* name, TG (*get) (T const*), void (*set) (T*, TS)) + Class & addProperty (char const* name, TG (*get) (T const*), bool (*set) (T*, TS)) { // Add to __propget in class and const tables. { @@ -878,6 +879,7 @@ private: return *this; } +#if 0 // unused // read-only template Class & addProperty (char const* name, TG (*get) (T const*)) @@ -1545,6 +1547,7 @@ public: If the set function is omitted or null, the property is read-only. */ +#if 0 // unused template Namespace& addProperty (char const* name, TG (*get) (), void (*set)(TS) = 0) { @@ -1576,6 +1579,7 @@ public: return *this; } +#endif //---------------------------------------------------------------------------- /**