%define tizen_feature_wi_fi_support 0
%define tizen_feature_tv_display_support 1
%define tizen_feature_tvchannel_support 1
+%define tizen_feature_tvwindow_support 1
%endif # tizen_profile_tv
BuildRequires: pkgconfig(tvs-api)
%endif
+%if 0%{?tizen_feature_tvwindow_support}
+BuildRequires: pkgconfig(tvs-api)
+%endif
+
%if 0%{?tizen_feature_exif_support}
BuildRequires: pkgconfig(libexif)
%endif
'tvaudio/tvaudio.gyp:*',
'tvchannel/tvchannel.gyp:*',
'tvinputdevice/tvinputdevice.gyp:*',
+ 'tvwindow/tvwindow.gyp:*',
],
},
], # end tv
--- /dev/null
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_tvwindow',
+ 'type': 'loadable_module',
+ 'variables': {
+ 'packages': [
+ 'tvs-api',
+ ],
+ },
+ 'dependencies': [
+ '../tizen/tizen.gyp:tizen',
+ ],
+ 'includes': [
+ '../common/pkg-config.gypi',
+ ],
+ 'sources': [
+ 'tvwindow_api.js',
+ 'tvwindow_extension.cc',
+ 'tvwindow_extension.h',
+ 'tvwindow_manager.cc',
+ 'tvwindow_manager.h',
+ 'tvwindow_instance.cc',
+ 'tvwindow_instance.h',
+ ],
+ },
+ ],
+}
--- /dev/null
+//Copyright (c) 2013 Intel Corporation. All rights reserved.
+//Use of this source code is governed by a BSD-style license that can be
+//found in the LICENSE file.
+
+extension.setMessageListener(function(msg) {
+
+});
+
+//TVWindowManager interface
+function TVWindowManager() {
+ if (!(this instanceof TVWindowManager)) {
+ throw new TypeError;
+ }
+}
+
+
+TVWindowManager.prototype.getAvailableWindows = function(successCallback, errorCallback)
+ {
+ return undefined;
+};
+
+TVWindowManager.prototype.setSource = function(videosource, successCallback, errorCallback, type)
+ {
+ return undefined;
+};
+
+TVWindowManager.prototype.getSource = function(type)
+ {
+ return undefined;
+};
+
+TVWindowManager.prototype.show = function(successCallback, errorCallback, rectangle, type)
+ {
+ return undefined;
+};
+
+TVWindowManager.prototype.hide = function(successCallback, errorCallback, type)
+ {
+ return undefined;
+};
+
+TVWindowManager.prototype.getRect = function(successCallback, errorCallback, unit, type)
+ {
+ return undefined;
+};
+
+exports = new TVWindowManager();
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvwindow/tvwindow_extension.h"
+#include "tvwindow/tvwindow_instance.h"
+
+// This will be generated from datasync_api.js.
+extern const char kSource_tvwindow_api[];
+
+namespace extension {
+namespace tvwindow {
+
+TVWindowExtension::TVWindowExtension() {
+ SetExtensionName("tizen.tvwindow");
+ SetJavaScriptAPI(kSource_tvwindow_api);
+}
+
+TVWindowExtension::~TVWindowExtension() {}
+
+TVWindowManager& TVWindowExtension::manager() {
+ // Initialize API on first request
+ return TVWindowManager::getInstance();
+}
+
+common::Instance* TVWindowExtension::CreateInstance() {
+ return new TVWindowInstance(*this);
+}
+
+} // namespace tvwindow
+} // namespace extension
+
+// entry point
+common::Extension* CreateExtension() {
+ return new extension::tvwindow::TVWindowExtension;
+}
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVWINDOW_TVWINDOW_EXTENSION_H_
+#define SRC_TVWINDOW_TVWINDOW_EXTENSION_H_
+
+#include "common/extension.h"
+#include "tvwindow/tvwindow_manager.h"
+
+namespace extension {
+namespace tvwindow {
+
+class TVWindowExtension : public common::Extension {
+ public:
+ TVWindowExtension();
+ virtual ~TVWindowExtension();
+
+ TVWindowManager& manager();
+
+ private:
+ // common::Extension implementation.
+ virtual common::Instance* CreateInstance();
+};
+
+} // namespace tvwindow
+} // namespace extension
+
+#endif // SRC_TVWINDOW_TVWINDOW_EXTENSION_H_
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvwindow/tvwindow_instance.h"
+#include "common/logger.h"
+#include "tizen/tizen.h"
+#include "common/picojson.h"
+
+namespace extension {
+namespace tvwindow {
+
+TVWindowInstance::TVWindowInstance(TVWindowExtension const& extension) {
+ LOGD("Entered");
+}
+
+TVWindowInstance::~TVWindowInstance() {
+ LOGD("Entered");
+}
+
+void TVWindowInstance::HandleMessage(const char* msg) {
+ // this is stub, no async messages
+ LOGD("Entered");
+}
+
+void TVWindowInstance::HandleSyncMessage(const char* msg) {
+ LOGD("Entered %s", msg);
+ picojson::object answer;
+ answer["answer"] = picojson::value(true);
+
+ SendSyncReply(picojson::value(answer).serialize().c_str());
+}
+
+} // namespace tvwindow
+} // namespace extension
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVWINDOW_TVWINDOW_INSTANCE_H_
+#define SRC_TVWINDOW_TVWINDOW_INSTANCE_H_
+
+#include <string>
+
+#include "common/extension.h"
+#include "common/picojson.h"
+
+#include "tvwindow/tvwindow_extension.h"
+
+namespace extension {
+namespace tvwindow {
+
+class TVWindowInstance : public common::ParsedInstance {
+ public:
+ explicit TVWindowInstance(TVWindowExtension const& extension);
+ virtual ~TVWindowInstance();
+
+ private:
+ virtual void HandleMessage(const char* msg);
+ virtual void HandleSyncMessage(const char* msg);
+};
+
+} // namespace tvwindow
+} // namespace extension
+
+#endif // SRC_TVWINDOW_TVWINDOW_INSTANCE_H_
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tvwindow/tvwindow_manager.h"
+
+namespace extension {
+namespace tvwindow {
+
+TVWindowManager::TVWindowManager() {
+ LOGD("Enter");
+}
+
+TVWindowManager& TVWindowManager::getInstance() {
+ static TVWindowManager manager;
+ return manager;
+}
+} // namespace tvwindow
+} // namespace extension
--- /dev/null
+// Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_TVWINDOW_TVWINDOW_MANAGER_H_
+#define SRC_TVWINDOW_TVWINDOW_MANAGER_H_
+
+#include "common/logger.h"
+
+namespace extension {
+namespace tvwindow {
+
+class TVWindowManager {
+ public:
+ static TVWindowManager& getInstance();
+
+ private:
+ TVWindowManager();
+ // Not copyable, assignable, movable
+ TVWindowManager(TVWindowManager const&);
+ void operator=(TVWindowManager const&);
+ TVWindowManager(TVWindowManager &&);
+};
+
+} // namespace tvwindow
+} // namespace extension
+
+#endif // SRC_TVWINDOW_TVWINDOW_MANAGER_H_