From: Seoyeon Kim Date: Tue, 12 Jun 2018 05:00:44 +0000 (+0900) Subject: Add SetRepeatInfo and GetRepeatInfo to Keyboard X-Git-Tag: dali_1.3.35~3^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=refs%2Fchanges%2F17%2F181317%2F7 Add SetRepeatInfo and GetRepeatInfo to Keyboard - Added to set and get keyboard repeat information in ecore walyand Change-Id: Ia874e896e3640de14067a9a843c5b2e4f0388984 Signed-off-by: Seoyeon Kim --- diff --git a/dali/devel-api/adaptor-framework/keyboard.h b/dali/devel-api/adaptor-framework/keyboard.h new file mode 100755 index 0000000..9fc3d82 --- /dev/null +++ b/dali/devel-api/adaptor-framework/keyboard.h @@ -0,0 +1,63 @@ +#ifndef DALI_KEYBOARD_H +#define DALI_KEYBOARD_H + +/* + * 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. + * + */ + +// INTERNAL INCLUDES +#include + +namespace Dali +{ +/** + * @addtogroup dali_adaptor_framework + * @{ + */ + +/** + * @brief Keyboard functions. + */ +namespace Keyboard +{ + +/** + * @brief Sets keyboard repeat information. + * + * @param[in] rate The key repeat rate value in seconds + * @param[in] delay The key repeat delay value in seconds + * @return true if setting the keyboard repeat succeeds + */ +DALI_ADAPTOR_API bool SetRepeatInfo( float rate, float delay ); + + +/** + * @brief Gets keyboard repeat information. + * + * @param[in] rate The key repeat rate value in seconds + * @param[in] delay The key repeat delay value in seconds + * @return true if getting the keyboard repeat succeeds, false otherwise + */ +DALI_ADAPTOR_API bool GetRepeatInfo( float& rate, float& delay ); + +} // namespace Keyboard + +/** + * @} + */ +} // namespace Dali + +#endif // DALI_KEYBOARD_H diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 4fc7506..65ac23d 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -50,6 +50,7 @@ devel_api_adaptor_framework_header_files = \ $(adaptor_devel_api_dir)/adaptor-framework/gif-loading.h \ $(adaptor_devel_api_dir)/adaptor-framework/input-method-context.h \ $(adaptor_devel_api_dir)/adaptor-framework/input-method-options.h \ + $(adaptor_devel_api_dir)/adaptor-framework/keyboard.h \ $(adaptor_devel_api_dir)/adaptor-framework/lifecycle-controller.h \ $(adaptor_devel_api_dir)/adaptor-framework/orientation.h \ $(adaptor_devel_api_dir)/adaptor-framework/performance-logger.h \ diff --git a/dali/internal/input/common/keyboard.cpp b/dali/internal/input/common/keyboard.cpp new file mode 100644 index 0000000..5731d39 --- /dev/null +++ b/dali/internal/input/common/keyboard.cpp @@ -0,0 +1,43 @@ +/* + * 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. + * + */ + +// CLASS HEADER +#include + +// INTERNAL INCLUDES +#include + +namespace Dali +{ + +namespace Keyboard +{ + +bool SetRepeatInfo( float rate, float delay ) +{ + return Dali::Internal::Adaptor::WindowSystem::SetKeyboardRepeatInfo( rate, delay ); +} + +bool GetRepeatInfo( float& rate, float& delay ) +{ + return Dali::Internal::Adaptor::WindowSystem::GetKeyboardRepeatInfo( rate, delay ); +} + +} // namespace Keyboard + +} // namespace Dali + diff --git a/dali/internal/input/file.list b/dali/internal/input/file.list index 6f0ea5d..1d45842 100755 --- a/dali/internal/input/file.list +++ b/dali/internal/input/file.list @@ -7,6 +7,7 @@ adaptor_input_common_src_files=\ ${adaptor_input_dir}/common/input-method-context-impl.cpp \ ${adaptor_input_dir}/common/key-grab.cpp \ ${adaptor_input_dir}/common/key-impl.cpp \ + ${adaptor_input_dir}/common/keyboard.cpp \ ${adaptor_input_dir}/common/long-press-gesture-detector.cpp \ ${adaptor_input_dir}/common/pan-gesture-detector-base.cpp \ ${adaptor_input_dir}/common/pan-gesture-detector.cpp \ diff --git a/dali/internal/window-system/common/window-system.h b/dali/internal/window-system/common/window-system.h index fc5f983..978e334 100644 --- a/dali/internal/window-system/common/window-system.h +++ b/dali/internal/window-system/common/window-system.h @@ -43,6 +43,16 @@ void Shutdown(); */ void GetScreenSize( int& width, int& height ); +/** + * @copydoc Dali::Keyboard::SetRepeatInfo() + */ +bool SetKeyboardRepeatInfo( float rate, float delay ); + +/** + * @copydoc Dali::Keyboard::GetRepeatInfo() + */ +bool GetKeyboardRepeatInfo( float& rate, float& delay ); + } // namespace WindowSystem } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-system-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-system-ecore-wl.cpp index b515bc7..a38aa6e 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-system-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-system-ecore-wl.cpp @@ -48,6 +48,21 @@ void GetScreenSize( int& width, int& height ) ecore_wl_screen_size_get( &width, &height ); } +bool SetKeyboardRepeatInfo( float rate, float delay ) +{ + return ecore_wl_keyboard_repeat_info_set( static_cast( rate ), static_cast( delay ) ); +} + +bool GetKeyboardRepeatInfo( float& rate, float& delay ) +{ + double rateVal, delayVal; + bool ret = ecore_wl_keyboard_repeat_info_get( &rateVal, &delayVal ); + rate = static_cast( rateVal ); + delay = static_cast( delayVal ); + + return ret; +} + } // namespace WindowSystem } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp index 5ccf6cd..2c733db 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp @@ -17,6 +17,7 @@ // INTERNAL HEADERS #include +#include // EXTERNAL_HEADERS #include @@ -52,6 +53,23 @@ void GetScreenSize( int& width, int& height ) } } +bool SetKeyboardRepeatInfo( float rate, float delay ) +{ + Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get( ecore_wl2_connected_display_get( NULL ) ); + return ecore_wl2_input_keyboard_repeat_set( input, static_cast( rate ), static_cast( delay ) ); +} + +bool GetKeyboardRepeatInfo( float& rate, float& delay ) +{ + Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get( ecore_wl2_connected_display_get( NULL ) ); + double rateVal, delayVal; + bool ret = ecore_wl2_input_keyboard_repeat_get( input, &rateVal, &delayVal ); + rate = static_cast( rateVal ); + delay = static_cast( delayVal ); + + return ret; +} + } // namespace WindowSystem } // namespace Adaptor diff --git a/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp index f38402d..23341c5 100644 --- a/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp @@ -17,6 +17,7 @@ // INTERNAL HEADERS #include +#include // EXTERNAL_HEADERS #include @@ -48,6 +49,16 @@ void GetScreenSize( int& width, int& height ) ecore_x_screen_size_get( ecore_x_default_screen_get(), &width, &height ); } +bool SetKeyboardRepeatInfo( float rate, float delay ) +{ + return false; +} + +bool GetKeyboardRepeatInfo( float& rate, float& delay ) +{ + return false; +} + } // namespace WindowSystem } // namespace Adaptor