From fcfe9c350c8256524fa539e4603f909718cdda07 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Thu, 7 Apr 2016 14:11:14 +0200 Subject: [PATCH] [Events] Code structure changed to match cordova architecture. Change-Id: I148576302885da489c84490ddcc0ac0fb6743e48 Signed-off-by: Pawel Andruszkiewicz --- src/cordova-api.gyp | 1 - src/events/cordova_events.gyp | 25 ------------ src/events/cordova_events_extension.cc | 39 ------------------- src/events/cordova_events_extension.h | 36 ----------------- src/lib/cordova_plugins.js | 5 +++ .../cordova-plugin-events/tizen/Events.js} | 4 -- 6 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 src/events/cordova_events.gyp delete mode 100755 src/events/cordova_events_extension.cc delete mode 100755 src/events/cordova_events_extension.h rename src/{events/cordova_events_api.js => lib/plugins/cordova-plugin-events/tizen/Events.js} (97%) diff --git a/src/cordova-api.gyp b/src/cordova-api.gyp index 21eb766..970edd7 100644 --- a/src/cordova-api.gyp +++ b/src/cordova-api.gyp @@ -9,7 +9,6 @@ 'type': 'none', 'dependencies': [ 'cordova/cordova.gyp:*', - 'events/cordova_events.gyp:*', 'file/cordova_file.gyp:*', 'globalization/cordova_globalization.gyp:*', 'networkinformation/cordova_networkinformation.gyp:*', diff --git a/src/events/cordova_events.gyp b/src/events/cordova_events.gyp deleted file mode 100644 index a269cd9..0000000 --- a/src/events/cordova_events.gyp +++ /dev/null @@ -1,25 +0,0 @@ -{ - 'includes':[ - '/usr/include/webapi-plugins/src/common/common.gypi', - ], - 'targets': [ - { - 'target_name': 'tizen_cordova_events', - 'type': 'loadable_module', - 'sources': [ - 'cordova_events_api.js', - 'cordova_events_extension.cc', - 'cordova_events_extension.h', - ], - 'include_dirs': [ - '../', - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'variables': { - 'packages': [ - 'webapi-plugins', - ], - }, - }, - ], -} diff --git a/src/events/cordova_events_extension.cc b/src/events/cordova_events_extension.cc deleted file mode 100755 index 0f59ffe..0000000 --- a/src/events/cordova_events_extension.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 "events/cordova_events_extension.h" - -// This will be generated from cordova_events_api.js -extern const char kSource_cordova_events_api[]; - -common::Extension* CreateExtension() { - return new extension::cordova::events::CordovaEventsExtension(); -} - -namespace extension { -namespace cordova { -namespace events { - -CordovaEventsExtension::CordovaEventsExtension() { - SetExtensionName("tizen.cordova.events"); - SetJavaScriptAPI(kSource_cordova_events_api); -} - -CordovaEventsExtension::~CordovaEventsExtension() {} - -} // events -} // cordova -} // extension diff --git a/src/events/cordova_events_extension.h b/src/events/cordova_events_extension.h deleted file mode 100755 index 6d85a7a..0000000 --- a/src/events/cordova_events_extension.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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 EVENTS_CORDOVA_EVENTS_EXTENSION_H_ -#define EVENTS_CORDOVA_EVENTS_EXTENSION_H_ - -#include - -namespace extension { -namespace cordova { -namespace events { - -class CordovaEventsExtension : public common::Extension { - public: - CordovaEventsExtension(); - virtual ~CordovaEventsExtension(); -}; - -} // events -} // cordova -} // extension - -#endif // EVENTS_CORDOVA_EVENTS_EXTENSION_H_ diff --git a/src/lib/cordova_plugins.js b/src/lib/cordova_plugins.js index c2ef0cf..699af6e 100644 --- a/src/lib/cordova_plugins.js +++ b/src/lib/cordova_plugins.js @@ -62,6 +62,11 @@ module.exports = [ "id": "cordova-plugin-events.register", "runs": true }, + { + "file": "plugins/cordova-plugin-events/tizen/Events.js", + "id": "cordova-plugin-events.tizen.Events", + "runs": true + }, { "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js", "id": "cordova-plugin-file.DirectoryEntry", diff --git a/src/events/cordova_events_api.js b/src/lib/plugins/cordova-plugin-events/tizen/Events.js similarity index 97% rename from src/events/cordova_events_api.js rename to src/lib/plugins/cordova-plugin-events/tizen/Events.js index a407271..6c4f048 100755 --- a/src/events/cordova_events_api.js +++ b/src/lib/plugins/cordova-plugin-events/tizen/Events.js @@ -188,8 +188,4 @@ console.log('Loaded cordova.events API'); // TODO: remove when added to public cordova repository -> begin }); - -exports = function(require) { - require('cordova-tizen').addPlugin('cordova-plugin-events.register', plugin_name, 'runs'); -}; // TODO: remove -> end -- 2.34.1