OLD | NEW |
(Empty) | |
| 1 #ifndef ADBLOCK_PLUS_TOOLS_H |
| 2 #define ADBLOCK_PLUS_TOOLS_H |
| 3 |
| 4 #include <emscripten.h> |
| 5 |
| 6 #define FILTER_PROPERTY(type, name, getter, setter) \ |
| 7 private:\ |
| 8 type name;\ |
| 9 public:\ |
| 10 type getter() const\ |
| 11 {\ |
| 12 return name;\ |
| 13 }\ |
| 14 void setter(type value)\ |
| 15 {\ |
| 16 if (name != value)\ |
| 17 {\ |
| 18 type oldvalue = name;\ |
| 19 name = value;\ |
| 20 String action(u"filter."_str #name);\ |
| 21 FilterPtr filter = shared_from_this();\ |
| 22 EM_ASM_ARGS({\ |
| 23 var filter = new (exports[Filter_mapping[$2]])($1);\ |
| 24 FilterNotifier.triggerListeners(getStringData($0), filter, $3, $4);\ |
| 25 }, &action, &filter, GetType(), value, oldvalue);\ |
| 26 }\ |
| 27 } |
| 28 |
| 29 #endif |
OLD | NEW |