| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 16 matching lines...) Expand all Loading... |
| 27 #include "../filter/BlockingFilter.h" | 27 #include "../filter/BlockingFilter.h" |
| 28 #include "../filter/WhitelistFilter.h" | 28 #include "../filter/WhitelistFilter.h" |
| 29 #include "../filter/ElemHideBase.h" | 29 #include "../filter/ElemHideBase.h" |
| 30 #include "../filter/ElemHideFilter.h" | 30 #include "../filter/ElemHideFilter.h" |
| 31 #include "../filter/ElemHideException.h" | 31 #include "../filter/ElemHideException.h" |
| 32 #include "../filter/ElemHideEmulationFilter.h" | 32 #include "../filter/ElemHideEmulationFilter.h" |
| 33 #include "../subscription/Subscription.h" | 33 #include "../subscription/Subscription.h" |
| 34 #include "../subscription/DownloadableSubscription.h" | 34 #include "../subscription/DownloadableSubscription.h" |
| 35 #include "../subscription/UserDefinedSubscription.h" | 35 #include "../subscription/UserDefinedSubscription.h" |
| 36 #include "../storage/FilterStorage.h" | 36 #include "../storage/FilterStorage.h" |
| 37 #include "../ElemHide.h" |
| 38 #include "../ElemHideEmulation.h" |
| 37 #include "../FilterNotifier.h" | 39 #include "../FilterNotifier.h" |
| 38 | 40 |
| 39 ABP_NS_USING | 41 ABP_NS_USING |
| 40 | 42 |
| 41 int main() | 43 int main() |
| 42 { | 44 { |
| 43 try | 45 try |
| 44 { | 46 { |
| 45 class_<Filter>("Filter") | 47 class_<Filter>("Filter") |
| 46 .property("text", &Filter::GetText) | 48 .property("text", &Filter::GetText) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 139 |
| 138 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) | 140 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) |
| 139 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) | 141 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) |
| 140 .function("subscriptionAt", &FilterStorage::SubscriptionAt) | 142 .function("subscriptionAt", &FilterStorage::SubscriptionAt) |
| 141 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) | 143 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) |
| 142 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor
Filter) | 144 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor
Filter) |
| 143 .function("addSubscription", &FilterStorage::AddSubscription) | 145 .function("addSubscription", &FilterStorage::AddSubscription) |
| 144 .function("removeSubscription", &FilterStorage::RemoveSubscription) | 146 .function("removeSubscription", &FilterStorage::RemoveSubscription) |
| 145 .function("moveSubscription", &FilterStorage::MoveSubscription); | 147 .function("moveSubscription", &FilterStorage::MoveSubscription); |
| 146 | 148 |
| 149 class_<ElemHide_SelectorList>("ElemHide_SelectorList") |
| 150 .property("selectorCount", &ElemHide_SelectorList::GetSelectorCount) |
| 151 .function("selectorAt", &ElemHide_SelectorList::SelectorAt) |
| 152 .function("filterKeyAt", &ElemHide_SelectorList::FilterKeyAt); |
| 153 |
| 154 class_<ElemHide>("ElemHide") |
| 155 .class_function("create", &ElemHide::Create) |
| 156 .function("add", &ElemHide::Add) |
| 157 .function("remove", &ElemHide::Remove) |
| 158 .function("clear", &ElemHide::Clear) |
| 159 .function("getSelectorsForDomain", &ElemHide::GetSelectorsForDomain) |
| 160 .function("getUnconditionalSelectors", &ElemHide::GetUnconditionalSelect
ors); |
| 161 |
| 162 class_<ElemHideEmulation_FilterList>("ElemHideEmulation_FilterList") |
| 163 .property("filterCount", &ElemHideEmulation_FilterList::GetFilterCount) |
| 164 .function("filterAt", &ElemHideEmulation_FilterList::FilterAt); |
| 165 |
| 166 class_<ElemHideEmulation>("ElemHideEmulation") |
| 167 .class_function("create", &ElemHideEmulation::Create) |
| 168 .function("add", &ElemHideEmulation::Add) |
| 169 .function("remove", &ElemHideEmulation::Remove) |
| 170 .function("clear", &ElemHideEmulation::Clear) |
| 171 .function("getRulesForDomain", &ElemHideEmulation::GetRulesForDomain); |
| 172 |
| 147 printBindings(); | 173 printBindings(); |
| 148 RegExpFilter::GenerateCustomBindings(); | 174 RegExpFilter::GenerateCustomBindings(); |
| 149 FilterNotifier::GenerateCustomBindings(); | 175 FilterNotifier::GenerateCustomBindings(); |
| 150 | 176 |
| 151 return 0; | 177 return 0; |
| 152 } | 178 } |
| 153 catch (const std::exception& e) | 179 catch (const std::exception& e) |
| 154 { | 180 { |
| 155 EM_ASM_ARGS( | 181 EM_ASM_ARGS( |
| 156 console.error("Error occurred generating JavaScript bindings: " + | 182 console.error("Error occurred generating JavaScript bindings: " + |
| 157 Module.AsciiToString($0)), e.what() | 183 Module.AsciiToString($0)), e.what() |
| 158 ); | 184 ); |
| 159 return 1; | 185 return 1; |
| 160 } | 186 } |
| 161 } | 187 } |
| LEFT | RIGHT |