OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCKPLUS_TOOLS_H |
| 2 #define ADBLOCKPLUS_TOOLS_H |
| 3 |
| 4 #include <emscripten.h> |
| 5 #include <cstddef> |
| 6 #include <string> |
| 7 |
| 8 #define PROPERTY(classprefix, type, name) \ |
| 9 private:\ |
| 10 type name;\ |
| 11 public:\ |
| 12 type get_##name()\ |
| 13 {\ |
| 14 return name;\ |
| 15 }\ |
| 16 void set_##name(type value)\ |
| 17 {\ |
| 18 if (name != value)\ |
| 19 {\ |
| 20 type oldvalue = value;\ |
| 21 name = value;\ |
| 22 /* TODO FilterNotifier.triggerListeners(#classprefix "." #name, this,
value, oldValue); */\ |
| 23 }\ |
| 24 } |
| 25 |
| 26 #define EXPOSE_PROPERTY(class, t, name) \ |
| 27 t EMSCRIPTEN_KEEPALIVE class##_get_##name(class* obj)\ |
| 28 {\ |
| 29 return obj->get_##name();\ |
| 30 }\ |
| 31 void EMSCRIPTEN_KEEPALIVE class##_set_##name(class* obj, t value)\ |
| 32 {\ |
| 33 obj->set_##name(value);\ |
| 34 } |
| 35 |
| 36 #define FILTER_PROPERTY(type, name) PROPERTY(filter, type, name) |
| 37 |
| 38 char16_t* stringToBuffer(const std::u16string& str, size_t* resultLen); |
| 39 |
| 40 #endif |
OLD | NEW |