[Verification] Code compiles.
Change-Id: Ice74943c7da19a19c0616968167f4b59df394283
Signed-off-by: Tomasz Marciniak <t.marciniak@samsung.com>
%endif
%define tizen_feature_time_support 1
%define tizen_feature_web_setting_support 1
+%define tizen_feature_widget_support 0
%if 0%{?tizen_is_emulator}
%define tizen_feature_wi_fi_support 0
%else
%define tizen_feature_telephony_support 0
%define tizen_feature_time_support 1
%define tizen_feature_web_setting_support 0
+%define tizen_feature_widget_support 0
%define tizen_feature_wi_fi_support 1
%define tizen_feature_inputdevice_support 1
%define tizen_feature_tvinputdevice_support 0
%define tizen_feature_telephony_support 0
%define tizen_feature_time_support 1
%define tizen_feature_web_setting_support 1
+%define tizen_feature_widget_support 0
%define tizen_feature_wi_fi_support 1
%define tizen_feature_inputdevice_support 0
%define tizen_feature_tvinputdevice_support 1
BuildRequires: pkgconfig(capi-content-media-content)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(widget_service)
%if %{with wayland}
%define display_type wayland
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_feature_time_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_feature_inputdevice_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_feature_web_setting_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_support=%{?tizen_feature_widget_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_feature_wi_fi_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_feature_tvinputdevice_support}"
],
},
],
+ [
+ 'tizen_feature_widget_support==1', {
+ 'dependencies': [
+ 'widget/widget.gyp:*',
+ ],
+ },
+ ],
], # end conditions
},
], # end targets
--- /dev/null
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_widget',
+ 'type': 'loadable_module',
+ 'dependencies': [
+ '../common/common.gyp:tizen_common',
+ ],
+ 'sources': [
+ 'widget_api.js',
+ 'widget_extension.cc',
+ 'widget_extension.h',
+ 'widget_instance.cc',
+ 'widget_instance.h',
+ ],
+ 'conditions': [
+ ['tizen == 1', {
+ 'variables': {
+ 'packages': [
+ 'widget_service',
+ ]
+ },
+ }],
+ ],
+ },
+ ],
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 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.
+ */
+
+var validator = xwalk.utils.validator;
+var converter = xwalk.utils.converter;
+var type = xwalk.utils.type;
+var native = new xwalk.utils.NativeManager(extension);
+
+function WidgetManager() {
+}
+
+//Exports
+exports = new WidgetManager();
--- /dev/null
+/*
+ * Copyright (c) 2016 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 "widget/widget_extension.h"
+
+#include "widget/widget_instance.h"
+
+// This will be generated from widget_api.js
+extern const char kSource_widget_api[];
+
+common::Extension* CreateExtension() {
+ return new WidgetExtension;
+}
+
+WidgetExtension::WidgetExtension() {
+ SetExtensionName("tizen.widget");
+ SetJavaScriptAPI(kSource_widget_api);
+}
+
+WidgetExtension::~WidgetExtension() {}
+
+common::Instance* WidgetExtension::CreateInstance() {
+ return new extension::widget::WidgetInstance();
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 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 WIDGET_WIDGET_EXTENSION_H_
+#define WIDGET_WIDGET_EXTENSION_H_
+
+#include "common/extension.h"
+
+class WidgetExtension : public common::Extension {
+ public:
+ WidgetExtension();
+ virtual ~WidgetExtension();
+
+ private:
+ virtual common::Instance* CreateInstance();
+};
+
+#endif // WIDGET_WIDGET_EXTENSION_H_
--- /dev/null
+/*
+ * Copyright (c) 2016 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 "widget/widget_instance.h"
+
+namespace extension {
+namespace widget {
+
+namespace {
+const std::string kPrivilegeWidget = "http://tizen.org/privilege/widget.viewer";
+
+} // namespace
+
+WidgetInstance::WidgetInstance() {
+ ScopeLogger();
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+
+#define REGISTER_SYNC(c,x) \
+ RegisterSyncHandler(c, std::bind(&WidgetInstance::x, this, _1, _2));
+
+#undef REGISTER_SYNC
+
+#define REGISTER_ASYNC(c, x) \
+ RegisterHandler(c, std::bind(&WidgetInstance::x, this, _1, _2));
+
+#undef REGISTER_ASYNC
+}
+
+WidgetInstance::~WidgetInstance() {
+ ScopeLogger();
+}
+
+} // namespace widget
+} // namespace extension
--- /dev/null
+/*
+ * Copyright (c) 2016 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 WIDGET_WIDGET_INSTANCE_H_
+#define WIDGET_WIDGET_INSTANCE_H_
+
+#include "common/tizen_instance.h"
+
+namespace extension {
+namespace widget {
+
+class WidgetInstance : public common::TizenInstance {
+ public:
+ WidgetInstance();
+ virtual ~WidgetInstance();
+
+};
+
+} // namespace widget
+} // namespace extension
+
+#endif // WIDGET_WIDGET_INSTANCE_H_