| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 { | 186 { |
| 187 TYPEID id; | 187 TYPEID id; |
| 188 TYPEID baseClass; | 188 TYPEID baseClass; |
| 189 std::string name; | 189 std::string name; |
| 190 std::vector<PropertyInfo> properties; | 190 std::vector<PropertyInfo> properties; |
| 191 std::vector<MethodInfo> methods; | 191 std::vector<MethodInfo> methods; |
| 192 DifferentiatorInfo subclass_differentiator; | 192 DifferentiatorInfo subclass_differentiator; |
| 193 ptrdiff_t ref_counted_offset; | 193 ptrdiff_t ref_counted_offset; |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 typedef std::function<void()> CustomGenerator; | |
| 197 | |
| 198 void register_class(const char* name, TYPEID classID, TYPEID baseClassID, | 196 void register_class(const char* name, TYPEID classID, TYPEID baseClassID, |
| 199 ptrdiff_t ref_counted_offset); | 197 ptrdiff_t ref_counted_offset); |
| 200 | 198 |
| 201 void register_property(TYPEID classID, const char* name, | 199 void register_property(TYPEID classID, const char* name, |
| 202 const FunctionInfo& getter, const FunctionInfo& setter, | 200 const FunctionInfo& getter, const FunctionInfo& setter, |
| 203 const char* jsValue = ""); | 201 const char* jsValue = ""); |
| 204 | 202 |
| 205 void register_method(TYPEID classID, const char* name, | 203 void register_method(TYPEID classID, const char* name, |
| 206 const FunctionInfo& call); | 204 const FunctionInfo& call); |
| 207 | 205 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 std::vector<std::pair<int, std::string>> mapping; | 292 std::vector<std::pair<int, std::string>> mapping; |
| 295 for (const auto& item : list) | 293 for (const auto& item : list) |
| 296 mapping.emplace_back(item.first, item.second); | 294 mapping.emplace_back(item.first, item.second); |
| 297 | 295 |
| 298 bindings_internal::register_differentiator( | 296 bindings_internal::register_differentiator( |
| 299 bindings_internal::TypeInfo<ClassType>(), offset, mapping); | 297 bindings_internal::TypeInfo<ClassType>(), offset, mapping); |
| 300 return *this; | 298 return *this; |
| 301 } | 299 } |
| 302 }; | 300 }; |
| 303 | 301 |
| 304 void custom_generator(bindings_internal::CustomGenerator generator); | |
| 305 | |
| 306 void printBindings(); | 302 void printBindings(); |
| LEFT | RIGHT |