Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A0E5510941 for ; Wed, 12 Jun 2013 17:15:56 +0000 (UTC) Received: (qmail 6888 invoked by uid 500); 12 Jun 2013 17:15:35 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 6510 invoked by uid 500); 12 Jun 2013 17:15:31 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 5340 invoked by uid 99); 12 Jun 2013 17:15:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 17:15:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0D1048A3A13; Wed, 12 Jun 2013 17:15:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: commits@cordova.apache.org Date: Wed, 12 Jun 2013 17:15:28 -0000 Message-Id: <609650680e5942b2a4b5fefd2e5fb172@git.apache.org> In-Reply-To: <892da121a6f547df8657f2c4836f57c1@git.apache.org> References: <892da121a6f547df8657f2c4836f57c1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/56] [abbrv] [partial] start of lazy loading: axe all vendored-in libs http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/com.blackberry.utils/plugin.xml ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/com.blackberry.utils/plugin.xml b/lib/cordova-blackberry/plugins/com.blackberry.utils/plugin.xml deleted file mode 100644 index 746fa76..0000000 --- a/lib/cordova-blackberry/plugins/com.blackberry.utils/plugin.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so b/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so deleted file mode 100644 index 126d02c..0000000 Binary files a/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/device/libutils.so and /dev/null differ http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so b/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so deleted file mode 100644 index 392ad33..0000000 Binary files a/lib/cordova-blackberry/plugins/com.blackberry.utils/src/blackberry10/native/simulator/libutils.so and /dev/null differ http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/plugin.xml ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/plugin.xml b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/plugin.xml deleted file mode 100644 index 474077e..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/plugin.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/Makefile ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/Makefile b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/Makefile deleted file mode 100644 index 0cc5eae..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=CPU -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/Makefile ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/Makefile b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/Makefile deleted file mode 100644 index 0e22650..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -LIST=VARIANT -ifndef QRECURSE -QRECURSE=recurse.mk -ifdef QCONFIG -QRDIR=$(dir $(QCONFIG)) -endif -endif -include $(QRDIR)$(QRECURSE) http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/Makefile ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/Makefile b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/Makefile deleted file mode 100644 index 2c76089..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/Makefile +++ /dev/null @@ -1 +0,0 @@ -include ../../common.mk http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/libpimcontacts.so ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/libpimcontacts.so b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/libpimcontacts.so deleted file mode 100755 index f90047f..0000000 Binary files a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/arm/so.le-v7/libpimcontacts.so and /dev/null differ http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/common.mk ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/common.mk b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/common.mk deleted file mode 100644 index 7bc06fb..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/common.mk +++ /dev/null @@ -1,18 +0,0 @@ -ifndef QCONFIG -QCONFIG=qconfig.mk -endif -include $(QCONFIG) - -NAME=pimcontacts -PLUGIN=yes -UTILS=yes - -include ../../../../../../meta.mk - -SRCS+=pim_contacts_qt.cpp \ - pim_contacts_js.cpp \ - contact_account.cpp - -include $(MKFILES_ROOT)/qtargets.mk - -LIBS+=bbpim bbcascadespickers QtCore img http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.cpp ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.cpp b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.cpp deleted file mode 100644 index 3476e70..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "contact_account.hpp" - -ContactAccount& ContactAccount::GetAccountInstance() -{ - static ContactAccount ca; - return ca; -} - -ContactAccount::ContactAccount() -{ - fetchContactAccounts(); -} - -ContactAccount::~ContactAccount() -{} - -QList ContactAccount::GetContactAccounts(bool fresh) -{ - if (fresh) { - fetchContactAccounts(); - } - return _accounts; -} - -bb::pim::account::Account ContactAccount::GetAccount(bb::pim::account::AccountKey id, bool fresh) -{ - if (fresh) { - fetchContactAccounts(); - } - return _accountMap.value(id); -} - -Json::Value ContactAccount::Account2Json(const bb::pim::account::Account& account) -{ - Json::Value jsonAccount; - jsonAccount["id"] = webworks::Utils::intToStr(account.id()); - jsonAccount["name"] = account.displayName().isEmpty() ? account.provider().name().toStdString() : account.displayName().toStdString(); - jsonAccount["enterprise"] = account.isEnterprise() == 1 ? true : false; - - return jsonAccount; -} - -void ContactAccount::fetchContactAccounts() -{ - QList accounts = _accountService.accounts(bb::pim::account::Service::Contacts); - - _accounts.clear(); - _accountMap.clear(); - for (QList::const_iterator it = accounts.begin(); it != accounts.end(); ++it) { - if ((it->id() != ID_UNIFIED_ACCOUNT) && (it->id() != ID_ENHANCED_ACCOUNT)) { - _accounts.append(*it); - _accountMap.insert(it->id(), (bb::pim::account::Account)(*it)); - } - } -} - - http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.hpp ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.hpp b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.hpp deleted file mode 100644 index 3910de8..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/contact_account.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _CONTACT_ACCOUNT_HPP_ -#define _CONTACT_ACCOUNT_HPP_ - -#include -#include -#include - -#include -#include -#include - -class ContactAccount -{ -public: - static ContactAccount& GetAccountInstance(); - - // get all available accounts which provide contact service - QList GetContactAccounts(bool fresh = false); - // get the contact account with the specific id - bb::pim::account::Account GetAccount(bb::pim::account::AccountKey id, bool fresh = false); - // serialize account to json object - static Json::Value Account2Json(const bb::pim::account::Account& account); - -private: - ContactAccount(); - ~ContactAccount(); - explicit ContactAccount(ContactAccount const&); - void operator=(ContactAccount const&); - // Refresh the accounts list and map - void fetchContactAccounts(); - QMap _accountMap; - QList _accounts; - bb::pim::account::AccountService _accountService; - static const int ID_UNIFIED_ACCOUNT = 4; - static const int ID_ENHANCED_ACCOUNT = 6; -}; - -#endif // end of _CONTACT_ACCOUNT_HPP_ http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/device/libpimcontacts.so ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/device/libpimcontacts.so b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/device/libpimcontacts.so deleted file mode 100644 index f90047f..0000000 Binary files a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/device/libpimcontacts.so and /dev/null differ http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.cpp ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.cpp b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.cpp deleted file mode 100644 index 4788bd1..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include "pim_contacts_js.hpp" -#include "pim_contacts_qt.hpp" - -PimContacts::PimContacts(const std::string& id) : m_id(id) -{ -} - -char* onGetObjList() -{ - // Return list of classes in the object - static char name[] = "PimContacts"; - return name; -} - -JSExt* onCreateObject(const std::string& className, const std::string& id) -{ - // Make sure we are creating the right class - if (className != "PimContacts") { - return 0; - } - - return new PimContacts(id); -} - -std::string PimContacts::InvokeMethod(const std::string& command) -{ - unsigned int index = command.find_first_of(" "); - - string strCommand; - string jsonObject; - Json::Value *obj; - - if (index != std::string::npos) { - strCommand = command.substr(0, index); - jsonObject = command.substr(index + 1, command.length()); - - // Parse the JSON - obj = new Json::Value; - bool parse = Json::Reader().parse(jsonObject, *obj); - - if (!parse) { - return "Cannot parse JSON object"; - } - } else { - strCommand = command; - obj = NULL; - } - - if (strCommand == "find") { - startThread(FindThread, obj); - } else if (strCommand == "save") { - startThread(SaveThread, obj); - } else if (strCommand == "remove") { - startThread(RemoveThread, obj); - } else if (strCommand == "getContact") { - std::string result = Json::FastWriter().write(webworks::PimContactsQt().GetContact(*obj)); - delete obj; - return result; - } else if (strCommand == "invokePicker") { - Json::Value result = webworks::PimContactsQt::InvokePicker(*obj); - delete obj; - - std::string event = Json::FastWriter().write(result); - NotifyEvent("invokeContactPicker.invokeEventId", event); - } else if (strCommand == "getContactAccounts") { - return Json::FastWriter().write(webworks::PimContactsQt::GetContactAccounts()); - } - - return ""; -} - -bool PimContacts::CanDelete() -{ - return true; -} - -// Notifies JavaScript of an event -void PimContacts::NotifyEvent(const std::string& eventId, const std::string& event) -{ - std::string eventString = m_id + " result "; - eventString.append(eventId); - eventString.append(" "); - eventString.append(event); - SendPluginEvent(eventString.c_str(), m_pContext); -} - -bool PimContacts::startThread(ThreadFunc threadFunction, Json::Value *jsonObj) { - webworks::PimContactsThreadInfo *thread_info = new webworks::PimContactsThreadInfo; - thread_info->parent = this; - thread_info->jsonObj = jsonObj; - thread_info->eventId = jsonObj->removeMember("_eventId").asString(); - - pthread_attr_t thread_attr; - pthread_attr_init(&thread_attr); - pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); - - pthread_t thread; - pthread_create(&thread, &thread_attr, threadFunction, static_cast(thread_info)); - pthread_attr_destroy(&thread_attr); - - if (!thread) { - return false; - } - - return true; -} - - -// Static functions: - -void* PimContacts::FindThread(void *args) -{ - webworks::PimContactsThreadInfo *thread_info = static_cast(args); - - webworks::PimContactsQt pim_qt; - Json::Value result = pim_qt.Find(*(thread_info->jsonObj)); - delete thread_info->jsonObj; - - std::string event = Json::FastWriter().write(result); - thread_info->parent->NotifyEvent(thread_info->eventId, event); - delete thread_info; - - return NULL; -} - -void* PimContacts::SaveThread(void *args) -{ - webworks::PimContactsThreadInfo *thread_info = static_cast(args); - - webworks::PimContactsQt pim_qt; - Json::Value result = pim_qt.Save(*(thread_info->jsonObj)); - delete thread_info->jsonObj; - - std::string event = Json::FastWriter().write(result); - thread_info->parent->NotifyEvent(thread_info->eventId, event); - delete thread_info; - - return NULL; -} - -void* PimContacts::RemoveThread(void *args) -{ - webworks::PimContactsThreadInfo *thread_info = static_cast(args); - - webworks::PimContactsQt pim_qt; - Json::Value result = pim_qt.DeleteContact(*(thread_info->jsonObj)); - delete thread_info->jsonObj; - - std::string event = Json::FastWriter().write(result); - thread_info->parent->NotifyEvent(thread_info->eventId, event); - delete thread_info; - - return NULL; -} - http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/09ee1837/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.hpp ---------------------------------------------------------------------- diff --git a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.hpp b/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.hpp deleted file mode 100644 index df8bbd7..0000000 --- a/lib/cordova-blackberry/plugins/org.apache.cordova.blackberry10.pimlib/src/blackberry10/native/pim_contacts_js.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PIM_CONTACTS_JS_H_ -#define PIM_CONTACTS_JS_H_ - -#include -#include -#include -#include "../common/plugin.h" - -typedef void* ThreadFunc(void *args); - -class PimContacts : public JSExt -{ -public: - explicit PimContacts(const std::string& id); - virtual ~PimContacts() {} - virtual std::string InvokeMethod(const std::string& command); - virtual bool CanDelete(); - void NotifyEvent(const std::string& eventId, const std::string& event); - - static void* FindThread(void *args); - static void* SaveThread(void *args); - static void* RemoveThread(void *args); -private: - bool startThread(ThreadFunc threadFunction, Json::Value *jsonObj); - - std::string m_id; -}; - -#endif // PIM_CONTACTS_JS_H_