OLD | NEW |
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 void register_property(TYPEID classID, const char* name, | 197 void register_property(TYPEID classID, const char* name, |
198 const FunctionInfo& getter, const FunctionInfo& setter, | 198 const FunctionInfo& getter, const FunctionInfo& setter, |
199 const char* jsValue = ""); | 199 const char* jsValue = ""); |
200 | 200 |
201 void register_method(TYPEID classID, const char* name, | 201 void register_method(TYPEID classID, const char* name, |
202 const FunctionInfo& call); | 202 const FunctionInfo& call); |
203 | 203 |
204 void register_differentiator(TYPEID classID, size_t offset, | 204 void register_differentiator(TYPEID classID, size_t offset, |
205 std::vector<std::pair<int, std::string>>& mapping); | 205 std::vector<std::pair<int, std::string>>& mapping); |
206 | 206 |
207 std::string generateCall(const FunctionInfo& call, | |
208 std::vector<std::string>& params); | |
209 | |
210 std::string wrapCall(const FunctionInfo& call, bool isFunction = true); | 207 std::string wrapCall(const FunctionInfo& call, bool isFunction = true); |
211 | |
212 void printHelpers(); | |
213 | |
214 void printClass(const ClassInfo& cls); | |
215 } | 208 } |
216 | 209 |
217 template<typename ClassType, | 210 template<typename ClassType, |
218 typename BaseClass = bindings_internal::NoBaseClass, | 211 typename BaseClass = bindings_internal::NoBaseClass, |
219 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ
e* = nullptr> | 212 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ
e* = nullptr> |
220 class class_ | 213 class class_ |
221 { | 214 { |
222 public: | 215 public: |
223 class_(const char* name) | 216 class_(const char* name) |
224 { | 217 { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 for (const auto& item : list) | 282 for (const auto& item : list) |
290 mapping.emplace_back(item.first, item.second); | 283 mapping.emplace_back(item.first, item.second); |
291 | 284 |
292 bindings_internal::register_differentiator( | 285 bindings_internal::register_differentiator( |
293 bindings_internal::TypeInfo<ClassType>(), offset, mapping); | 286 bindings_internal::TypeInfo<ClassType>(), offset, mapping); |
294 return *this; | 287 return *this; |
295 } | 288 } |
296 }; | 289 }; |
297 | 290 |
298 void printBindings(); | 291 void printBindings(); |
OLD | NEW |