From 582c820f7708e3597a37fff8a0a9cfdec8040627 Mon Sep 17 00:00:00 2001 From: Chulheon Date: Mon, 12 Aug 2013 19:40:58 +0900 Subject: [PATCH] fixed bug(P130730-6872)fixed bug(P130730-6872) Change-Id: I41d4ba9ba7f06d6c5b9a7308b7d7d35a651f423a --- src/ui/CMakeLists.txt | 1 + src/ui/FUi_InputConnectionImpl.cpp | 14 ++-------- src/ui/FUi_InputConnectionUtils.cpp | 55 +++++++++++++++++++++++++++++++++++++ src/ui/FUi_InputConnectionUtils.h | 46 +++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 src/ui/FUi_InputConnectionUtils.cpp create mode 100644 src/ui/FUi_InputConnectionUtils.h diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 0bf345d..bb0f61f 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -225,6 +225,7 @@ SET (${this_target}_SOURCE_FILES FUi_CardLayoutImpl.cpp FUiInputConnection.cpp FUi_InputConnectionImpl.cpp + FUi_InputConnectionUtils.cpp FUi_Matrix3Df.cpp FUi_TouchEventManagerImpl.cpp FUiTouchEventManager.cpp diff --git a/src/ui/FUi_InputConnectionImpl.cpp b/src/ui/FUi_InputConnectionImpl.cpp index 375fb45..9d49d1e 100644 --- a/src/ui/FUi_InputConnectionImpl.cpp +++ b/src/ui/FUi_InputConnectionImpl.cpp @@ -33,6 +33,7 @@ #include "FUi_EcoreEvas.h" #include "FUi_EcoreEvasMgr.h" #include "FUi_InputConnectionImpl.h" +#include "FUi_InputConnectionUtils.h" #include "FUi_UiEventManager.h" #include "FUiAnim_EflNode.h" #include "FUiAnim_VisualElement.h" @@ -1519,18 +1520,7 @@ _InputConnectionImpl::GetInstance(const InputConnection& inputConnection) int _InputConnectionImpl::CheckUSBKeyboardStatus(void) { - Ecore_X_Window rootWindow = ecore_x_window_root_first_get(); - Ecore_X_Atom keyboardExist = 0; - unsigned int keyboardNumber = 0; - int ret = 0; - - if (!keyboardExist) - { - keyboardExist = ecore_x_atom_get("X External Keyboard Exist"); - } - ret = ecore_x_window_prop_card32_get(rootWindow, keyboardExist, &keyboardNumber, 1); - - return keyboardNumber; + return _InputConnectionUtils::CheckUSBKeyboardStatus(); } result diff --git a/src/ui/FUi_InputConnectionUtils.cpp b/src/ui/FUi_InputConnectionUtils.cpp new file mode 100644 index 0000000..ec96dc5 --- /dev/null +++ b/src/ui/FUi_InputConnectionUtils.cpp @@ -0,0 +1,55 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 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. +// + +/** + * @file FUi_InputConnectionUtils.cpp + * @brief This is the implementation file for the _InputConnectionUtils class. + */ +#include +#include "FUi_EcoreEvas.h" +#include "FUi_EcoreEvasMgr.h" +#include "FUi_InputConnectionUtils.h" + +namespace Tizen { namespace Ui +{ + +_InputConnectionUtils::_InputConnectionUtils(void) +{ +} + +_InputConnectionUtils::~_InputConnectionUtils(void) +{ +} + +int +_InputConnectionUtils::CheckUSBKeyboardStatus(void) +{ + Ecore_X_Window rootWindow = ecore_x_window_root_first_get(); + Ecore_X_Atom keyboardExist = 0; + unsigned int keyboardNumber = 0; + int ret = 0; + + if (!keyboardExist) + { + keyboardExist = ecore_x_atom_get("X External Keyboard Exist"); + } + ret = ecore_x_window_prop_card32_get(rootWindow, keyboardExist, &keyboardNumber, 1); + + return keyboardNumber; +} + +}} // Tizen::Ui diff --git a/src/ui/FUi_InputConnectionUtils.h b/src/ui/FUi_InputConnectionUtils.h new file mode 100644 index 0000000..2bc054d --- /dev/null +++ b/src/ui/FUi_InputConnectionUtils.h @@ -0,0 +1,46 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 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. +// + +/** + * @file FUi_InputConnectionUtils.h + * @brief This is the header file for the _InputConnectionUtils class. + * + * This header file contains the declarations of the _InputConnectionUtils class. + */ + +#ifndef _FUI_INTERNAL_INPUTCONNECTION_UTILS_H_ +#define _FUI_INTERNAL_INPUTCONNECTION_UTILS_H_ + +namespace Tizen { namespace Ui +{ + +class _InputConnectionUtils +{ +public: + static int CheckUSBKeyboardStatus(void); + +private: + _InputConnectionUtils(void); + ~_InputConnectionUtils(void); + + _InputConnectionUtils(const _InputConnectionUtils& rhs); + _InputConnectionUtils& operator =(const _InputConnectionUtils& rhs); +}; //_InputConnectionUtils + +}} // Tizen::Ui + +#endif //_FUI_INTERNAL_INPUTCONNECTION_UTILS_H_ \ No newline at end of file -- 2.7.4