Add color-controller extension 81/196481/11
authorSeungho, Baek <sbsh.baek@samsung.com>
Mon, 31 Dec 2018 02:39:41 +0000 (11:39 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Tue, 22 Jan 2019 05:47:30 +0000 (14:47 +0900)
Change-Id: I25089776f5b323cc0a651a16a6ea2c2100ba1495
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
build/tizen/color-controller/Makefile.am [new file with mode: 0755]
build/tizen/color-controller/configure.ac [new file with mode: 0755]
build/tizen/configure.ac
dali-extension/color-controller/file.list [new file with mode: 0644]
dali-extension/color-controller/tizen-color-controller.cpp [new file with mode: 0644]
dali-extension/color-controller/tizen-color-controller.h [new file with mode: 0644]
packaging/dali-extension.spec

diff --git a/build/tizen/color-controller/Makefile.am b/build/tizen/color-controller/Makefile.am
new file mode 100755 (executable)
index 0000000..ef606d5
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2018 Samsung Electronics Co., Ltd.
+#
+# 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.
+#
+
+# Build the Dali color controller
+
+extension_src_dir = ../../../dali-extension
+
+include ../../../dali-extension/color-controller/file.list
+
+lib_LTLIBRARIES =
+
+lib_LTLIBRARIES += libdali-color-controller-plugin.la
+
+libdali_color_controller_plugin_la_includes =
+
+libdali_color_controller_plugin_la_SOURCES = \
+                     $(color_controller_plugin_src_files)
+
+libdali_color_controller_plugin_la_DEPENDENCIES =
+
+libdali_color_controller_plugin_la_CXXFLAGS = \
+                      $(DLOG_CFLAGS) \
+                      $(DALI_CFLAGS) \
+                      -I../../../dali-extension/color-controller \
+                      -Werror -Wall
+
+libdali_color_controller_plugin_la_LIBADD = \
+                      $(DLOG_LIBS) \
+                      $(DALI_LIBS)
+
+libdali_color_controller_plugin_la_LDFLAGS = \
+                      -rdynamic
\ No newline at end of file
diff --git a/build/tizen/color-controller/configure.ac b/build/tizen/color-controller/configure.ac
new file mode 100755 (executable)
index 0000000..c4df6b7
--- /dev/null
@@ -0,0 +1,26 @@
+4_define([dali_version],[0.1.0])
+AC_INIT([dali], [dali_version])
+AM_INIT_AUTOMAKE([-Wall foreign])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+LT_INIT
+
+DALI_EXTENSION_VERSION=dali_version
+AC_SUBST(DALI_EXTENSION_VERSION)
+
+PKG_CHECK_MODULES([DALI], [dali-core dali-adaptor dali-toolkit])
+
+devincludepath=${includedir}
+AC_SUBST(devincludepath)
+
+AC_CONFIG_FILES([
+Makefile
+])
+
+AC_OUTPUT
index c625100..a6c8ea6 100755 (executable)
@@ -21,6 +21,7 @@ AC_CONFIG_SUBDIRS(video-player)
 AC_CONFIG_SUBDIRS(web-engine-chromium)
 AC_CONFIG_SUBDIRS(image-loader)
 AC_CONFIG_SUBDIRS(vector-animation-renderer)
+AC_CONFIG_SUBDIRS(color-controller)
 
 AC_CONFIG_FILES([
 Makefile
diff --git a/dali-extension/color-controller/file.list b/dali-extension/color-controller/file.list
new file mode 100644 (file)
index 0000000..864428d
--- /dev/null
@@ -0,0 +1,2 @@
+color_controller_plugin_src_files = \
+   $(extension_src_dir)/color-controller/tizen-color-controller.cpp
\ No newline at end of file
diff --git a/dali-extension/color-controller/tizen-color-controller.cpp b/dali-extension/color-controller/tizen-color-controller.cpp
new file mode 100644 (file)
index 0000000..6431f1c
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include "tizen-color-controller.h"
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/constants.h>
+
+// The plugin factories
+extern "C" DALI_EXPORT_API Dali::ColorControllerPlugin* CreateColorControllerPlugin( void )
+{
+  return new Dali::Plugin::TizenColorController;
+}
+
+namespace Dali
+{
+
+namespace Plugin
+{
+
+TizenColorController::TizenColorController()
+{
+}
+
+TizenColorController::~TizenColorController()
+{
+}
+
+bool TizenColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue ) const
+{
+  colorValue = Color::WHITE;
+  return true;
+}
+
+bool TizenColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor ) const
+{
+  textColor = Color::WHITE;
+  textOutlineColor = Color::WHITE;
+  textShadowColor = Color::WHITE;
+  return true;
+}
+
+} // namespace Plugin
+
+} // namespace Dali;
\ No newline at end of file
diff --git a/dali-extension/color-controller/tizen-color-controller.h b/dali-extension/color-controller/tizen-color-controller.h
new file mode 100644 (file)
index 0000000..e777290
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef DALI_TIZEN_COLOR_CONTROLLER_PLUGIN_H
+#define DALI_TIZEN_COLOR_CONTROLLER_PLUGIN_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+#include <dali/public-api/math/vector4.h>
+#include <dali/devel-api/adaptor-framework/color-controller-plugin.h>
+
+namespace Dali
+{
+
+namespace Plugin
+{
+
+class TizenColorController : public Dali::ColorControllerPlugin
+{
+
+public:
+
+  /**
+   * @brief TizenColorController constructor.
+   */
+  TizenColorController();
+
+  /**
+   * @brief TizenColorController destructor.
+   */
+  virtual ~TizenColorController();
+
+public:
+  /**
+   * @copydoc Dali::ColorControllerPlugin::RetrieveColor(const std::string&, Vector4&)
+   */
+  virtual bool RetrieveColor( const std::string& colorCode, Vector4& colorValue ) const;
+
+  /**
+   * @copydoc Dali::ColorControllerPlugin::RetrieveColor(const std::string&, Vector4&, Vector4&, Vector4&)
+   */
+  virtual bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor ) const;
+};
+
+}
+}
+#endif // DALI_TIZEN_COLOR_CONTROLLER_PLUGIN_H
index 7e87467..bdfb5d5 100755 (executable)
@@ -99,6 +99,17 @@ BuildRequires:  pkgconfig(lottie-player)
 %description vector-animation-renderer-plugin
 Plugin to render a vector animation
 
+####################################
+# color controller Plugin
+####################################
+
+%package color-controller-plugin
+Summary:    Plugin to load color theme
+Group:      System/Libraries
+
+%description color-controller-plugin
+Plugin to load color theme
+
 ##############################
 # Preparation
 ##############################
@@ -178,6 +189,10 @@ exit 0
 /sbin/ldconfig
 exit 0
 
+%post color-controller-plugin
+/sbin/ldconfig
+exit 0
+
 ##############################
 #   Pre Uninstall old package
 ##############################
@@ -211,6 +226,10 @@ exit 0
 /sbin/ldconfig
 exit 0
 
+%postun color-controller-plugin
+/sbin/ldconfig
+exit 0
+
 ##############################
 # Files in Binary Packages
 ##############################
@@ -257,3 +276,9 @@ exit 0
 %defattr(-,root,root,-)
 %{_libdir}/libdali-vector-animation-renderer-plugin.so*
 %license LICENSE
+
+%files color-controller-plugin
+%manifest dali-extension.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libdali-color-controller-plugin.so*
+%license LICENSE