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-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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 .property("title", &Subscription::GetTitle, &Subscription::SetTitle) | 97 .property("title", &Subscription::GetTitle, &Subscription::SetTitle) |
98 .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisa
bled) | 98 .property("disabled", &Subscription::GetDisabled, &Subscription::SetDisa
bled) |
99 .property("listed", &Subscription::GetListed) | 99 .property("listed", &Subscription::GetListed) |
100 .property("filterCount", &Subscription::GetFilterCount) | 100 .property("filterCount", &Subscription::GetFilterCount) |
101 .function("filterAt", &Subscription::FilterAt) | 101 .function("filterAt", &Subscription::FilterAt) |
102 .function("indexOfFilter", &Subscription::IndexOfFilter) | 102 .function("indexOfFilter", &Subscription::IndexOfFilter) |
103 .function("serialize", &Subscription::Serialize) | 103 .function("serialize", &Subscription::Serialize) |
104 .function("serializeFilters", &Subscription::SerializeFilters) | 104 .function("serializeFilters", &Subscription::SerializeFilters) |
105 .class_function("fromURL", &Subscription::FromID) | 105 .class_function("fromURL", &Subscription::FromID) |
106 .subclass_differentiator(&Subscription::mType, { | 106 .subclass_differentiator(&Subscription::mType, { |
107 {Subscription::Type::USERDEFINED, "SpecialSubscription"}, | 107 {Subscription::Type::USERDEFINED, "UserDefinedSubscription"}, |
108 {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"}, | 108 {Subscription::Type::DOWNLOADABLE, "DownloadableSubscription"}, |
109 }); | 109 }); |
110 | 110 |
111 class_<UserDefinedSubscription,Subscription>("SpecialSubscription") | 111 class_<UserDefinedSubscription,Subscription>("UserDefinedSubscription") |
112 .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor) | 112 .function("isDefaultFor", &UserDefinedSubscription::IsDefaultFor) |
113 .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor) | 113 .function("makeDefaultFor", &UserDefinedSubscription::MakeDefaultFor) |
114 .function("isGeneric", &UserDefinedSubscription::IsGeneric) | 114 .function("isGeneric", &UserDefinedSubscription::IsGeneric) |
115 .function("insertFilterAt", &UserDefinedSubscription::InsertFilterAt) | 115 .function("insertFilterAt", &UserDefinedSubscription::InsertFilterAt) |
116 .function("removeFilterAt", &UserDefinedSubscription::RemoveFilterAt) | 116 .function("removeFilterAt", &UserDefinedSubscription::RemoveFilterAt) |
117 .function("serialize", &UserDefinedSubscription::Serialize); | 117 .function("serialize", &UserDefinedSubscription::Serialize); |
118 | 118 |
119 class_<DownloadableSubscription,Subscription>("DownloadableSubscription") | 119 class_<DownloadableSubscription,Subscription>("DownloadableSubscription") |
120 .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &Downl
oadableSubscription::SetFixedTitle) | 120 .property("fixedTitle", &DownloadableSubscription::GetFixedTitle, &Downl
oadableSubscription::SetFixedTitle) |
121 .property("homepage", &DownloadableSubscription::GetHomepage, &Downloada
bleSubscription::SetHomepage) | 121 .property("homepage", &DownloadableSubscription::GetHomepage, &Downloada
bleSubscription::SetHomepage) |
122 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloa
dableSubscription::SetLastCheck) | 122 .property("lastCheck", &DownloadableSubscription::GetLastCheck, &Downloa
dableSubscription::SetLastCheck) |
123 .property("expires", &DownloadableSubscription::GetHardExpiration, &Down
loadableSubscription::SetHardExpiration) | 123 .property("hardExpiration", &DownloadableSubscription::GetHardExpiration
, &DownloadableSubscription::SetHardExpiration) |
124 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration
, &DownloadableSubscription::SetSoftExpiration) | 124 .property("softExpiration", &DownloadableSubscription::GetSoftExpiration
, &DownloadableSubscription::SetSoftExpiration) |
125 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D
ownloadableSubscription::SetLastDownload) | 125 .property("lastDownload", &DownloadableSubscription::GetLastDownload, &D
ownloadableSubscription::SetLastDownload) |
126 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus
, &DownloadableSubscription::SetDownloadStatus) | 126 .property("downloadStatus", &DownloadableSubscription::GetDownloadStatus
, &DownloadableSubscription::SetDownloadStatus) |
127 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow
nloadableSubscription::SetLastSuccess) | 127 .property("lastSuccess", &DownloadableSubscription::GetLastSuccess, &Dow
nloadableSubscription::SetLastSuccess) |
128 .property("errors", &DownloadableSubscription::GetErrorCount, &Downloada
bleSubscription::SetErrorCount) | 128 .property("errorCount", &DownloadableSubscription::GetErrorCount, &Downl
oadableSubscription::SetErrorCount) |
129 .property("version", &DownloadableSubscription::GetDataRevision, &Downlo
adableSubscription::SetDataRevision) | 129 .property("dataRevision", &DownloadableSubscription::GetDataRevision, &D
ownloadableSubscription::SetDataRevision) |
130 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi
on, &DownloadableSubscription::SetRequiredVersion) | 130 .property("requiredVersion", &DownloadableSubscription::GetRequiredVersi
on, &DownloadableSubscription::SetRequiredVersion) |
131 .property("downloadCount", &DownloadableSubscription::GetDownloadCount,
&DownloadableSubscription::SetDownloadCount) | 131 .property("downloadCount", &DownloadableSubscription::GetDownloadCount,
&DownloadableSubscription::SetDownloadCount) |
132 .function("serialize", &DownloadableSubscription::Serialize); | 132 .function("serialize", &DownloadableSubscription::Serialize); |
133 | 133 |
134 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) | 134 singleton<FilterStorage>("FilterStorage", &FilterStorage::GetInstance) |
135 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) | 135 .property("subscriptionCount", &FilterStorage::GetSubscriptionCount) |
136 .function("subscriptionAt", &FilterStorage::SubscriptionAt) | 136 .function("subscriptionAt", &FilterStorage::SubscriptionAt) |
137 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) | 137 .function("indexOfSubscription", &FilterStorage::IndexOfSubscription) |
138 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor
Filter) | 138 .function("getSubscriptionForFilter", &FilterStorage::GetSubscriptionFor
Filter) |
139 .function("addSubscription", &FilterStorage::AddSubscription) | 139 .function("addSubscription", &FilterStorage::AddSubscription) |
140 .function("removeSubscription", &FilterStorage::RemoveSubscription) | 140 .function("removeSubscription", &FilterStorage::RemoveSubscription) |
141 .function("moveSubscription", &FilterStorage::MoveSubscription); | 141 .function("moveSubscription", &FilterStorage::MoveSubscription); |
142 | 142 |
143 printBindings(); | 143 printBindings(); |
144 RegExpFilter::GenerateCustomBindings(); | 144 RegExpFilter::GenerateCustomBindings(); |
145 FilterNotifier::GenerateCustomBindings(); | 145 FilterNotifier::GenerateCustomBindings(); |
146 | 146 |
147 return 0; | 147 return 0; |
148 } | 148 } |
149 catch (const std::exception& e) | 149 catch (const std::exception& e) |
150 { | 150 { |
151 EM_ASM_ARGS( | 151 EM_ASM_ARGS( |
152 console.error("Error occurred generating JavaScript bindings: " + | 152 console.error("Error occurred generating JavaScript bindings: " + |
153 Module.AsciiToString($0)), e.what() | 153 Module.AsciiToString($0)), e.what() |
154 ); | 154 ); |
155 return 1; | 155 return 1; |
156 } | 156 } |
157 } | 157 } |
OLD | NEW |