--- /dev/null
+/*
+ * Copyright (c) 2014 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 "color-controller-impl.h"
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+Dali::ColorController ColorController::Get()
+{
+ Dali::ColorController colorController;
+ return colorController;
+}
+
+ColorController::ColorController()
+{
+}
+
+ColorController::~ColorController()
+{
+}
+
+bool RetrieveColor( const std::string& colorCode, Vector4& colorValue )
+{
+ return false;
+}
+
+bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
+{
+ return false;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_INTERNAL_COLOR_CONTROLLER_H__
+#define __DALI_INTERNAL_COLOR_CONTROLLER_H__
+
+/*
+ * Copyright (c) 2014 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.
+ *
+ */
+
+#include <dali/public-api/object/base-object.h>
+#include <public-api/adaptor-framework/common/color-controller.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Implementation of ColorController
+ */
+class ColorController : public BaseObject
+{
+public:
+
+ /**
+ * Constructor.
+ */
+ ColorController();
+
+ /**
+ * @copydoc Dali::ColorController::Get()
+ */
+ static Dali::ColorController Get();
+
+ /**
+ * @copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&)
+ */
+ bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
+
+ /**
+ *copydoc Dali::ColorController::RetrieveColor(const std::string&, Vector4&, Vector4&, Vector4&)
+ */
+ bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
+
+protected:
+ /**
+ * Destructor.
+ */
+ virtual ~ColorController();
+
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+// Additional Helpers for public-api forwarding methods
+inline Internal::Adaptor::ColorController& GetImplementation(Dali::ColorController& controller)
+{
+ DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
+ BaseObject& handle = controller.GetBaseObject();
+ return static_cast<Internal::Adaptor::ColorController&>(handle);
+}
+
+inline const Internal::Adaptor::ColorController& GetImplementation(const Dali::ColorController& controller)
+{
+ DALI_ASSERT_ALWAYS(controller && "ColorController handle is empty");
+ const BaseObject& handle = controller.GetBaseObject();
+ return static_cast<const Internal::Adaptor::ColorController&>(handle);
+}
+
+} // namespace Dali
+
+#endif // __DALI_INTERNAL_COLOR_CONTROLLER_H__
#include <Ecore.h>
#include <Ecore_Input.h>
#include <Ecore_X.h>
+
#include <cstring>
#include <sys/time.h>
namespace
{
+const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
+
// Currently this code is internal to dali/dali/internal/event/text/utf8.h but should be made Public and used from there instead.
size_t Utf8SequenceLength(const unsigned char leadByte)
{
return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
-
} // unnamed namespace
// Impl to hide EFL implementation.
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_X_EVENT_SELECTION_CLEAR, EcoreEventSelectionClear, handler ) );
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_X_EVENT_SELECTION_NOTIFY, EcoreEventSelectionNotify, handler ) );
- // Register Vconf notify - font name and size
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler );
+ // Register Vconf notify - font name, font size and style
+ vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, handler );
vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, handler );
+ vconf_notify_key_changed( VCONFKEY_SETAPPL_CHANGE_UI_THEME_INT, VconfNotifyThemeChanged, handler );
}
}
*/
~Impl()
{
+ vconf_ignore_key_changed( VCONFKEY_SETAPPL_CHANGE_UI_THEME_INT, VconfNotifyThemeChanged );
vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged );
+ vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged );
for( std::vector<Ecore_Event_Handler*>::iterator iter = mEcoreEventHandler.begin(), endIter = mEcoreEventHandler.end(); iter != endIter; ++iter )
{
handler->SendEvent( fontChange );
}
+ /**
+ * Called when style is changed
+ */
+ static void VconfNotifyThemeChanged( keynode_t* node, void* data )
+ {
+ EventHandler* handler( static_cast<EventHandler*>(data) );
+
+ StyleChange themeChange;
+ themeChange.themeChange = true;
+
+ handler->SendEvent( themeChange );
+ }
+
// Data
EventHandler* mHandler;
std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
tizen_adaptor_internal_common_profile_src_files = \
$(tizen_adaptor_internal_src_dir)/key-impl.cpp \
$(tizen_adaptor_internal_src_dir)/system-settings.cpp \
+ $(tizen_adaptor_internal_src_dir)/color-controller-impl.cpp \
\
$(tizen_adaptor_internal_src_dir)/ecore-x/ecore-x-render-surface-factory.cpp
\ No newline at end of file
namespace
{
-void DefaultFontSizeChangeNotification(keynode_t* node, void* data)
-{
- StyleMonitor* styleMonitor = static_cast<StyleMonitor*>(data);
-
- StyleChange styleChange;
- styleChange.defaultFontSizeChange = true;
- styleMonitor->StyleChanged(styleChange);
-}
-
BaseHandle Create()
{
BaseHandle handle( StyleMonitor::Get() );
StyleMonitor::StyleMonitor(Integration::PlatformAbstraction& platformAbstraction)
: mPlatformAbstraction(platformAbstraction)
{
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, DefaultFontSizeChangeNotification, this );
}
StyleMonitor::~StyleMonitor()
{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, DefaultFontSizeChangeNotification );
}
void StyleMonitor::StyleChanged(StyleChange styleChange)
$(tizen_adaptor_internal_src_dir)/key-impl.cpp \
$(tizen_adaptor_internal_src_dir)/../mobile/mobile-render-surface-factory.cpp \
$(tizen_adaptor_internal_src_dir)/../mobile/mobile-native-buffer-render-surface.cpp \
- $(tizen_adaptor_internal_src_dir)/../mobile/mobile-system-settings.cpp
+ $(tizen_adaptor_internal_src_dir)/../mobile/mobile-system-settings.cpp \
+ $(tizen_adaptor_internal_src_dir)/../mobile/mobile-color-controller-impl.cpp
--- /dev/null
+/*
+ * Copyright (c) 2014 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 <internal/common/color-controller-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/type-registry.h>
+#include <efl_assist_theme.h>
+
+// INTERNAL INCLUDES
+#include <internal/common/adaptor-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+
+BaseHandle Create()
+{
+ return ColorController::Get();
+}
+Dali::TypeRegistration COLOR_CONTROLLER_TYPE( typeid(Dali::ColorController), typeid(Dali::BaseHandle), Create );
+
+}
+
+Dali::ColorController ColorController::Get()
+{
+ Dali::ColorController colorController;
+
+ if ( Adaptor::IsAvailable() )
+ {
+ // Check whether the singleton is already created
+ Dali::BaseHandle handle = Dali::Adaptor::Get().GetSingleton( typeid( Dali::ColorController ) );
+ if(handle)
+ {
+ // If so, downcast the handle
+ colorController = Dali::ColorController( dynamic_cast< ColorController* >( handle.GetObjectPtr() ) );
+ }
+ else
+ {
+ Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
+ colorController = Dali::ColorController( new ColorController( ) );
+ adaptorImpl.RegisterSingleton( typeid( colorController ), colorController );
+ }
+ }
+
+ return colorController;
+
+}
+
+ColorController::ColorController()
+{
+}
+
+ColorController::~ColorController()
+{
+}
+
+bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
+{
+ int R = 0;
+ int G = 0;
+ int B = 0;
+ int A = 0;
+
+ if( ea_theme_color_get(colorCode.c_str(), &R, &G, &B, &A, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) )
+ {
+ colorValue.r = (float) (R) / 255.0f;
+ colorValue.g = (float) (G) / 255.0f;
+ colorValue.b = (float) (B) / 255.0f;
+ colorValue.a = (float) (A) / 255.0f;
+
+ return true;
+ }
+
+ return false;
+}
+
+bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
+{
+ int R = 0;
+ int G = 0;
+ int B = 0;
+ int A = 0;
+
+ int outlineR = 0;
+ int outlineG = 0;
+ int outlineB = 0;
+ int outlineA = 0;
+
+ int shadowR = 0;
+ int shadowG = 0;
+ int shadowB = 0;
+ int shadowA = 0;
+
+ if( ea_theme_color_get(colorCode.c_str(), &R, &G, &B, &A, &outlineR, &outlineG, &outlineB, &outlineA, &shadowR, &shadowG, &shadowB, &shadowA) )
+ {
+ textColor.r = (float) (R) / 255.0f;
+ textColor.g = (float) (G) / 255.0f;
+ textColor.b = (float) (B) / 255.0f;
+ textColor.a = (float) (A) / 255.0f;
+
+ textOutlineColor.r = (float) (outlineR) / 255.0f;
+ textOutlineColor.g = (float) (outlineG) / 255.0f;
+ textOutlineColor.b = (float) (outlineB) / 255.0f;
+ textOutlineColor.a = (float) (outlineA) / 255.0f;
+
+ textShadowColor.r = (float) (shadowR) / 255.0f;
+ textShadowColor.g = (float) (shadowG) / 255.0f;
+ textShadowColor.b = (float) (shadowB) / 255.0f;
+ textShadowColor.a = (float) (shadowA) / 255.0f;
+
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
tizen_adaptor_internal_common_src_files += \
$(tizen_adaptor_internal_src_dir)/../tv/tv-key-impl.cpp \
$(tizen_adaptor_internal_src_dir)/../tv/tv-render-surface-factory.cpp \
- $(tizen_adaptor_internal_src_dir)/../tv/tv-system-settings.cpp
+ $(tizen_adaptor_internal_src_dir)/../tv/tv-system-settings.cpp \
+ $(tizen_adaptor_internal_src_dir)/../tv/tv-color-controller-impl.cpp
--- /dev/null
+/*
+ * Copyright (c) 2014 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 <internal/common/color-controller-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+Dali::ColorController ColorController::Get()
+{
+ Dali::ColorController colorController;
+ return colorController;
+}
+
+ColorController::ColorController()
+{
+}
+
+ColorController::~ColorController()
+{
+}
+
+bool RetrieveColor( const std::string& colorCode, Vector4& colorValue )
+{
+ return false;
+}
+
+bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
+{
+ return false;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
--- /dev/null
+/*
+ * Copyright (c) 2014 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 <public-api/adaptor-framework/common/color-controller.h>
+
+// INTERNAL INCLUDES
+#include <internal/common/color-controller-impl.h>
+
+namespace Dali
+{
+
+ColorController::ColorController()
+{
+}
+
+ColorController::ColorController(const ColorController& controller)
+: BaseHandle(controller)
+{
+}
+
+ColorController ColorController::Get()
+{
+ return Internal::Adaptor::ColorController::Get();
+}
+
+ColorController::~ColorController()
+{
+}
+
+bool ColorController::RetrieveColor( const std::string& colorCode, Vector4& colorValue )
+{
+ return GetImplementation(*this).RetrieveColor( colorCode, colorValue );
+}
+
+bool ColorController::RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor)
+{
+ return GetImplementation(*this).RetrieveColor( colorCode, textColor, textOutlineColor, textShadowColor );
+}
+
+ColorController::ColorController(Internal::Adaptor::ColorController* internal)
+: BaseHandle(internal)
+{
+}
+
+}
--- /dev/null
+#ifndef __DALI_COLOR_CONTROLLER_H__
+#define __DALI_COLOR_CONTROLLER_H__
+
+/*
+ * Copyright (c) 2014 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.
+ *
+ */
+
+#include <dali/public-api/object/base-handle.h>
+
+namespace Dali DALI_IMPORT_API
+{
+
+namespace Internal DALI_INTERNAL
+{
+namespace Adaptor
+{
+class ColorController;
+}
+}
+
+/**
+ * Color controller currently caches the changeable color table which updates with the theme change
+ *
+ * It provides the functionality of retrieving a RGBA color by passing in the color code string.
+ */
+class ColorController : public BaseHandle
+{
+public:
+
+ /**
+ * @brief Create an uninitialized ColorController handle.
+ */
+ ColorController();
+
+ /**
+ * @brief Creates a copy of the handle.
+ *
+ * The copy will point to the same implementation as the original.
+ * @param[in] colorController The Color Controller to copy from.
+ */
+ ColorController( const ColorController& colorController);
+
+ /**
+ * @copydoc Dali::BaseHandle::operator=
+ */
+ using BaseHandle::operator=;
+
+ /**
+ * @brief Retrieve the initialized instance of the ColorController.
+ *
+ * @return Handle to ColorController.
+ */
+ static ColorController Get();
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~ColorController();
+
+ /**
+ * @brief Retrieve the RGB value by given the color code.
+ *
+ * @param[in] colorCode The color code string.
+ * @param[out] colorValue The RGBA color
+ * @return true if the color code exists, otherwise false
+ */
+ bool RetrieveColor( const std::string& colorCode, Vector4& colorValue );
+
+ /**
+ * @brief Retrieve the RGB values by given the color code.
+ *
+ * @param[in] colorCode The color code string.
+ * @param[out] textColor The text color.
+ * @param[out] textOutlineColor The text outline color.
+ * @param[out] textShadowColor The text shadow color.
+ * @return true if the color code exists, otherwise false
+ */
+ bool RetrieveColor( const std::string& colorCode , Vector4& textColor, Vector4& textOutlineColor, Vector4& textShadowColor);
+
+
+public: // Not intended for application developers
+ /**
+ * @brief This constructor is used internally to create a handle from an object pointer.
+ * @param [in] colorController A pointer the internal color controller.
+ */
+ explicit DALI_INTERNAL ColorController(Internal::Adaptor::ColorController* colorController);
+};
+
+
+} //namespace Dali
+
+#endif /* __DALI_COLOR_CONTROLLER_H__ */
#include <dali/public-api/adaptor-framework/common/accessibility-action-handler.h>
#include <dali/public-api/adaptor-framework/common/accessibility-gesture-handler.h>
#include <dali/public-api/adaptor-framework/common/event-feeder.h>
+#include <dali/public-api/adaptor-framework/common/color-controller.h>
#include <dali/public-api/adaptor-framework/common/feedback-plugin.h>
#include <dali/public-api/adaptor-framework/common/physical-keyboard.h>
#include <dali/public-api/adaptor-framework/common/tilt-sensor.h>
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/adaptor.cpp \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/clipboard.cpp \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/clipboard-event-notifier.cpp \
+ $(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/color-controller.cpp \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/device-layout.cpp \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/drag-and-drop-detector.cpp \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/event-feeder.cpp \
tizen_adaptor_public_api_common_header_files = \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/accessibility-action-handler.h \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/accessibility-gesture-handler.h \
+ $(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/color-controller.h \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/event-feeder.h \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/feedback-plugin.h \
$(tizen_adaptor_public_api_src_dir)/adaptor-framework/common/physical-keyboard.h \
if MOBILE_PROFILE
libdali_adaptor_common_la_CXXFLAGS += $(ASSIMP_CFLAGS) \
$(DEVICED_CFLAGS) \
+ $(EFL_ASSIST_CFLAGS) \
$(NATIVE_BUFFER_CFLAGS) \
$(NATIVE_BUFFER_POOL_CFLAGS)
libdali_adaptor_common_la_LIBADD += $(ASSIMP_LIBS) \
+ $(EFL_ASSIST_LIBS) \
$(NATIVE_BUFFER_LIBS) \
$(NATIVE_BUFFER_POOL_LIBS)
endif
PKG_CHECK_MODULES(LIBDRM, libdrm)
PKG_CHECK_MODULES(LIBEXIF, libexif)
PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
+PKG_CHECK_MODULES(EFL_ASSIST, efl-assist)
# Check for availability of BulletPhysics
PKG_CHECK_EXISTS(bullet, [