* @since 2.0
*
* @return An error code
- * @param[in] pattern The list containing the information of dash pattern.
+ * @param[in] pattern The list containing the information of dash pattern @n
+ * If any value in the specific dash pattern is negative, @c E_INVALID_ARG is returned.
* @param[in] offset The offset into the dash pattern at which the stroke must start
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specific input parameter is invalid.
* @since 2.1
*
* @return An error code
- * @param[in] pattern The list containing the information of dash pattern
+ * @param[in] pattern The list containing the information of dash pattern @n
+ * If any value in the specific dash pattern is negative, @c E_INVALID_ARG is returned.
* @param[in] offset The offset into the dash pattern at which the stroke must start
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG A specific input parameter is invalid.
*
* @since 2.0
*
- * @return The pointer to the system clipboard
- * @remarks The copy and paste operation is performed through the system
- * clipboard that can be obtained through this method. @n
- * The method returns @c null if a system error occurs.
+ * @return The pointer to the system clipboard, @n
+ * else @c null if a system error has occurred
+ * @remarks The copy and paste operation is performed through the system clipboard.
*/
static Clipboard* GetInstance(void);
* @return An error code
* @param[in] item The item to save in the system clipboard
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified input parameter is invalid.
+ * @exception E_INVALID_ARG The specified input parameter is either invalid or not constructed.
* @exception E_SYSTEM A system error has occurred.
- * @remarks This method returns @c E_INVALID_ARG if the specified item is
- * not constructed. @n
- * For the text and image data type, the data itself is copied
- * by the method and kept by the system clipboard.
+ * @remarks For the text, image data, and html types, the data itself is copied by the method and kept by the system clipboard. @n
+ * For the other types, only the file path is copied and kept.
*/
result CopyItem(const ClipboardItem& item);
* Retrieves a collection of items that matches the specified data types from the
* system clipboard.
*
- * @since 2.0
+ * @since 2.0
*
- * @return The pointer to a Tizen::Base::Collection::IList that contains a collection of ClipboardItem, @n
- * else @c null if an error occurs
- * @param[in] dataTypes The types of items @n Multiple data types can be
- * combined using bitwise OR.
+ * @return The pointer to a Tizen::Base::Collection::IList that contains a collection of ClipboardItem, @n
+ * else @c null if an error has occurred @n
+ * The items are sorted in the reverse order in which they are copied to the system clipboard. So, the first item is the latest one among them.
+ * @param[in] dataTypes The types of items @n
+ * Multiple data types of ClipboardDataType can be combined using bitwise OR.
* @exception E_SUCCESS The method is successful.
* @exception E_OBJ_NOT_FOUND The item of the specified data types is not found.
* @exception E_SYSTEM A system error has occurred.
- * @remarks The specific error code can be accessed using the GetLastResult() method. @n
- * This method returns a pointer to an Tizen::Base::Collection::IList that contains
- * a collection of ClipboardItem. The returned pointer to %Tizen::Base::Collection::IList
- * and all the elements in %Tizen::Base::Collection::IList must be deleted by applications. @n
- * The items in %Tizen::Base::Collection::IList are sorted in the reverse order in which
- * they are copied to the system clipboard. So, the first
- * item in %Tizen::Base::Collection::IList is the latest one among them. @n
- * @c dataType can be a combination of ClipboardDataType.
- * @see Tizen::Ui::ClipboardDataType
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Base::Collection::IList* RetrieveItemsN(unsigned long dataTypes);
* @since 2.0
*
* @return The pointer to a ClipboardItem instance, @n
- * else @c null if an error occurs
- * @param[in] dataTypes The types of items @n Multiple data types can be
+ * else @c null if an error has occurred or there is no matched item in the system clipboard
+ * @param[in] dataTypes The types of items @n Multiple data types of ClipboardDataType can be
* combined using bitwise OR.
* @exception E_SUCCESS The method is successful.
* @exception E_OBJ_NOT_FOUND The item of the specified data types is not found.
* @exception E_SYSTEM A system error has occurred.
- * @remarks The specific error code can be accessed using the GetLastResult() method. @n
- * This method returns the pointer to a ClipboardItem instance. The
- * returned %ClipboardItem must be deleted by applications. @n
- * If there is no matched item in the system clipboard, this method
- * returns @c null. @n
- * @c dataType can be a combination of ClipboardDataType.
- * @see Tizen::Ui::ClipboardDataType
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Ui::ClipboardItem* RetrieveLatestItemN(unsigned long dataTypes);
/**
- * Shows the clipboard popup with the specified parameters.
+ * Shows the clipboard popup that is including the current contents of the system clipboard with the specified parameters.
*
* @since 2.0
*
* @return An error code
- * @param[in] dataTypes The types of items @n Multiple data types can be
- * combined using bitwise OR.
+ * @param[in] dataTypes The types of items to decide whether the clipboard popup shows image items or not @n
+ * Multiple data types of ClipboardDataType can be combined using bitwise OR. @n
+ * If the value contains #CLIPBOARD_DATA_TYPE_IMAGE, all types of items are shown. @n
+ * If not, text items, html items, video items, and audio items are shown except image items.
* @param[in] listener The clipboard popup event listener
* @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_OPERATION The current state of the instance
- * prohibits the execution of the specified
- * operation.
+ * @exception E_INVALID_OPERATION Either the clipboard popup is currently being shown or attempting to show the clipboard popup
+ * when the application is in the background.
* @exception E_SYSTEM A system error has occurred.
- * @remarks @c dataTypes can decide whether the clipboard popup shows image items or not.
- * If @c dataTypes contains #CLIPBOARD_DATA_TYPE_IMAGE, all types of items are shown.
- * If not, text items, html items, video items, and audio items are shown except image items. @n
- * This method returns @c E_INVALID_OPERATION if the clipboard popup is currently
- * being shown. Furthermore, attempting to show the clipboard popup when the application is
- * in the background will return @c E_INVALID_OPERATION. @n
- * The clipboard popup shows the current content of the system clipboard. The user
- * can clear the system clipboard or choose a clipboard item for the paste operation.
- * @see Tizen::Ui::ClipboardDataType
+ * @remarks The user can operate the system clipboard when the clipboard popup is shown,
+ * for example, clear the system clipboard or choose a clipboard item for the paste operation.
*/
static result ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener& listener);
* @return An error code
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
+ * - No clipboard popup is currently being shown.
* @exception E_SYSTEM A system error has occurred.
- * @remarks This method returns @c E_INVALID_OPERATION if no clipboard popup is currently being shown.
*/
static result HidePopup(void);
*
* @since 2.0
*
- * @return The pointer to the data
- * @remarks The application needs to type-cast the returned data object
- * according to its data type.
+ * @return The pointer to the data @n
+ * The application needs to type-cast the returned data object according to its data type.
*/
Tizen::Base::Object* GetData(void) const;
* @return The y position of the control
* @see GetBounds()
* @see GetPosition()
- * @see Get()
+ * @see GetX()
*/
int GetY(void) const;
void SetDateTime(const Tizen::Base::DateTime& dateTime);
/**
- * Sets the date and time value of the %DateTimePicker control with the current date and time in the Coordinated Universal Time (UTC) mode.
+ * Sets the date and time value of the %DateTimePicker control with the current date and time in the wall time mode.
*
* @since 2.0
*/
void RemoveTimeChangeEventListener(Tizen::Ui::ITimeChangeEventListener& listener);
/**
- * Initializes this instance of %EditTime with the specified parameters.
+ * Initializes this instance of %EditTime to the current time in the wall time mode.
*
* @since 2.0
*
result Construct(const Tizen::Graphics::Point& point, const Tizen::Base::String& title = L"");
/**
- * Initializes this instance of %EditTime with the specified parameters.
+ * Initializes this instance of %EditTime to the current time in the wall time mode.
*
* @since 2.1
*
void SetTime(const Tizen::Base::DateTime& time);
/**
- * Sets the value of the %EditTime control using the current system time.
+ * Sets the value of the %EditTime control with the current system time in the wall time mode.
*
* @since 2.0
*/
* @param[in] pBadgeIcon The bitmap for the icon
* @exception E_SUCCESS The method is successful.
* @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
- * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB, @n
- * ::HEADER_STYLE_TAB_WITH_TITLE or ::HEADER_STYLE_TAB_LARGE.
+ * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB @n
+ * or ::HEADER_STYLE_TAB_LARGE.
*/
result SetButtonBadgeIcon(ButtonPosition position, const Tizen::Graphics::Bitmap* pBadgeIcon);
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c number must be in the range defined by @c 0 and @c 99999.
* @exception E_UNSUPPORTED_OPERATION This operation is not supported. @n
- * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB, @n
- * ::HEADER_STYLE_TAB_WITH_TITLE or ::HEADER_STYLE_TAB_LARGE.
+ * The operation is not supported when the style of the %Header control is ::HEADER_STYLE_TAB @n
+ * or ::HEADER_STYLE_TAB_LARGE.
* @remarks To remove the numbered badge icon from an item, pass @c 0 as the value of @c number.
*/
result SetButtonNumberedBadgeIcon(ButtonPosition position, int number);
* with the menu item.
* Note that %OptionMenu cannot be used in a Popup.
*
- * @image html ui_controls_optionmenu.png
+ * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_optionmenu.htm">OptionMenu</a>.
*
* The following examples demonstrate how to use an %OptionMenu control.
*
void SetTime(const Tizen::Base::DateTime& time);
/**
- * Sets the time value of the %TimePicker control with the current system time in the Coordinated Universal Time (UTC) mode.
+ * Sets the time value of the %TimePicker control with the current system time in the wall time mode.
*
* @since 2.0
*/
+%define debug_package %{nil}
%define __strip /bin/true
Name: osp-uifw
Summary: The UI Framework library of OSP
-Version: 1.2.2.0
-Release: 61
+Version: 1.2.2.1
+Release: 62
Group: TO_BE/FILLED_IN
License: TO BE FILLED IN
Source0: %{name}-%{version}.tar.gz
--- /dev/null
+//
+// 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 FApp_CoordinateInfo.cpp
+ * @brief This is the implementation for the _CoordinateInfo class.
+ */
+
+#include <FBaseSysLog.h>
+#include <FBaseInteger.h>
+#include <FBaseUtilStringTokenizer.h>
+#include <FIoFile.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FApp_AppInfo.h>
+#include <FGrp_CoordinateSystem.h>
+#include <FApp_CoordinateInfo.h>
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+using namespace Tizen::Graphics;
+
+namespace Tizen { namespace App
+{
+
+const wchar_t* _coord_info_file = L"uiscalability.info";
+
+result
+_CoordinateInfo::GetAppCoordinateSystem(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, _BaseScreenSize& logicalBaseScreenSize)
+{
+ result r;
+
+ r = _CoordinateInfo::GetAppCoordinateSystemFromInfoFile(isCoordinateSystemLogical, logicalCoordinateSystemInt, logicalBaseScreenSize);
+
+ if (r != E_SUCCESS)
+ r = _CoordinateInfo::GetAppCoordinateSystemFromDatabase(isCoordinateSystemLogical, logicalCoordinateSystemInt, logicalBaseScreenSize);
+
+ return r;
+}
+
+result
+_CoordinateInfo::GetAppCoordinateSystemFromInfoFile(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, _BaseScreenSize& logicalBaseScreenSize)
+{
+ // Get UI scalability info from info/[appId]uiscalability.info
+ String uiScalabilityInfoString;
+ result r = E_SUCCESS;
+ const String appId(_AppInfo::GetApplicationId());
+ SysTryReturnResult(NID_APP, appId != null, E_OBJ_NOT_FOUND, "[%s] Cannot get application id", GetErrorMessage(r));
+
+ {
+ File uiScalabilityInfoFile;
+ const String scalabilityInfoFilePath(L"info/" + appId + L"/" + _coord_info_file);
+
+ // Get UI Scalability Infomation
+ r = uiScalabilityInfoFile.Construct(_AppInfo::GetAppRootPath() + scalabilityInfoFilePath, L"r");
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = uiScalabilityInfoFile.Read(uiScalabilityInfoString);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ StringTokenizer infoTokenizer(uiScalabilityInfoString, L" ");
+
+ // Check MagicNumer of UI scalability info
+ {
+ String magicNumString(null);
+ r = infoTokenizer.GetNextToken(magicNumString);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ int magicNumber = 0;
+ r = Integer::Parse(magicNumString, magicNumber);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_APP, magicNumber == 1, E_SYSTEM, "[E_SYSTEM] The magic number(%d) is invalid.", magicNumber);
+ }
+
+ // Get Application Coordinate Status (Logical or Physical)
+ String coordinateSystem(null);
+ r = infoTokenizer.GetNextToken(coordinateSystem);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (coordinateSystem.Equals(L"Physical", false))
+ {
+ isCoordinateSystemLogical = false;
+ logicalCoordinateSystemInt = 0;
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_DEFAULT;
+
+ return E_SUCCESS;
+ } else if (coordinateSystem.Equals(L"Logical", false)){
+ isCoordinateSystemLogical = true;
+ // Get Base Screen
+ String baseScreenSize(null);
+ r = infoTokenizer.GetNextToken(baseScreenSize);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ // logicalBaseScreenSize
+ if (baseScreenSize.Equals(L"Large", false))
+ {
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_LARGE;
+ }
+ else
+ {
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_NORMAL;
+ }
+
+ // Get Application Logical Resolution
+ String logicalCoordinate(null);
+ r = infoTokenizer.GetNextToken(logicalCoordinate);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = Integer::Parse(logicalCoordinate, logicalCoordinateSystemInt);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SysLog(NID_APP, "The current values of UI scalability information are coordinate status : %ls, base resolution : %ls and logical resolution : %ls.", coordinateSystem.GetPointer(), baseScreenSize.GetPointer(), logicalCoordinate.GetPointer());
+
+ } else {
+ SysLog(NID_APP, "Cannot recognize the UI scalability information (check [app_root_dir]/info/%ls/%s", appId.GetPointer(),_coord_info_file);
+ return E_FAILURE;
+ }
+
+ return r;
+}
+
+result
+_CoordinateInfo::GetAppCoordinateSystemFromDatabase(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, _BaseScreenSize& logicalBaseScreenSize)
+{
+ _PackageInfoImpl infoImpl;
+
+ {
+ result r = infoImpl.Construct(_AppInfo::GetPackageId());
+ SysTryReturn(NID_APP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ String baseScreenSize;
+ String coordinateSystem;
+ String logicalCoordinate;
+
+ result r = infoImpl.GetUiScalabilityInfo(baseScreenSize, coordinateSystem, logicalCoordinate);
+ SysTryReturn(NID_APP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (coordinateSystem.Equals(L"Physical", false))
+ {
+ isCoordinateSystemLogical = false;
+ logicalCoordinateSystemInt = 0;
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_DEFAULT;
+
+ return E_SUCCESS;
+ } else {
+ isCoordinateSystemLogical = true;
+ }
+
+ //Logical Resolution
+ r = Integer::Parse(logicalCoordinate, logicalCoordinateSystemInt);
+ SysTryReturn(NID_APP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ // BaseScreenSize
+ if (baseScreenSize.Equals(L"Large", false))
+ {
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_LARGE;
+ }
+ else
+ {
+ // temp
+ logicalBaseScreenSize = BASE_SCREEN_SIZE_NORMAL;
+ }
+
+ return r;
+}
+
+} } //Tizen::App
+
--- /dev/null
+//
+// 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 FApp_ThemeInfo.cpp
+ * @brief This is the implementation for the _ThemeInfo class.
+ */
+
+#include <FBaseSysLog.h>
+#include <FBaseInteger.h>
+#include <FBaseUtilStringTokenizer.h>
+#include <FIoFile.h>
+
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FApp_AppInfo.h>
+#include <FApp_ThemeInfo.h>
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Io;
+
+namespace Tizen { namespace App
+{
+
+const wchar_t* _theme_info_file = L"uitheme.info";
+
+result
+_ThemeInfo::LoadThemeInformation(String& systemTheme, String& userTheme)
+{
+ result r;
+
+ r = _ThemeInfo::LoadThemeInfoFromInfoFile(systemTheme, userTheme);
+
+ if( r != E_SUCCESS)
+ _ThemeInfo::LoadThemeInfoFromDatabase(systemTheme, userTheme);
+
+ return r;
+}
+
+result
+_ThemeInfo::LoadThemeInfoFromInfoFile(String& systemTheme, String& userTheme)
+{
+ AppId appId = _AppInfo::GetApplicationId();
+ SysLog(NID_UI, "AppId = %ls" , appId.GetPointer());
+ String uiThemeInfoString;
+ result r;
+
+ // Get UI theme info from info/[appId]/uitheme.info
+ {
+ File uiThemeInfoFile;
+ const String themeInfoFilePath(L"info/" + appId + L"/" + _theme_info_file);
+
+ r = uiThemeInfoFile.Construct(_AppInfo::GetAppRootPath() + themeInfoFilePath, L"r");
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = uiThemeInfoFile.Read(uiThemeInfoString);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ StringTokenizer infoTokenizer(uiThemeInfoString, L" ");
+
+ // Check magic number of UI theme info
+ {
+ String magicNumString(null);
+ r = infoTokenizer.GetNextToken(magicNumString);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ int magicNumber = 0;
+ r = Integer::Parse(magicNumString, magicNumber);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_APP, magicNumber == 1, E_SYSTEM, "[E_SYSTEM] The magic number(%d) is invalid.", magicNumber);
+ }
+
+ // Get application UI theme info (SystemTheme, UserDefinedTheme)
+ String _systemTheme(null);
+ r = infoTokenizer.GetNextToken(_systemTheme);
+ SysTryReturnResult(NID_APP, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (_systemTheme.Equals(L"White", false))
+ {
+ systemTheme = L"white";
+ }
+ else if (_systemTheme.Equals(L"Default", false))
+ {
+ systemTheme = L"default";
+ }
+ else
+ {
+ // By default, black system theme
+ systemTheme = L"black";
+ }
+ SysLog(NID_UI, "Application UI Theme : %ls" , systemTheme.GetPointer());
+
+ // Get User Defined Theme
+ String _userTheme(null);
+ r = infoTokenizer.GetNextToken(_userTheme);
+
+ if (!(_userTheme.IsEmpty()))
+ {
+ SysLog(NID_UI, "Custom theme :%ls" , _userTheme.GetPointer());
+ userTheme = _userTheme;
+ }
+
+ return E_SUCCESS;
+}
+
+result
+_ThemeInfo::LoadThemeInfoFromDatabase(String& systemTheme, String& userTheme)
+{
+ AppId appId = _AppInfo::GetApplicationId();
+ SysLog(NID_UI, "AppId = %ls" , appId.GetPointer());
+ _PackageAppInfoImpl packageManager;
+ packageManager.Construct(appId);
+ String key = packageManager.GetAppFeature(L"UserDefinedTheme");
+ if (!(key.IsEmpty()))
+ {
+ SysLog(NID_UI, "Custom theme %ls" , key.GetPointer());
+ userTheme = key;
+ }
+ key = packageManager.GetAppFeature(L"SystemTheme");
+ if (key.IsEmpty())
+ {
+ systemTheme = L"black";
+ }
+ else
+ {
+ SysLog(NID_UI, "System theme %ls" , key.GetPointer());
+ systemTheme = key;
+ systemTheme.ToLowerCase();
+ }
+ return E_SUCCESS;
+}
+
+} } //Tizen::App
+
Frame* pFrame = dynamic_cast<Frame*>(__pFrameList->GetAt(0));
_EcoreEvas* pEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ const int type = _AppInfo::GetAppType();
+
+ if (type & _APP_TYPE_IME_APP)
+ {
+ bundle* pBundle = _AppArg::GetBundleFromSvc(service);
+ const int pid = _AppArg::GetCallerPid(pBundle);
+ if (pid > 0)
+ {
+ SysLogException(NID_APP, E_SYSTEM, "ImeApp should not be the target for launch API (caller : %d).", pid);
+ _Process::Exit(-1);
+ }
+ }
+
// make OnForeground event
if (pFrame != null)
{
// handle submode
if (pEvas && _AppInfo::IsSubMode())
{
+ unsigned int win = 0;
+ service_get_window(service, &win);
+
_FrameImpl* pFrameImpl = _FrameImpl::GetInstance(*pFrame);
- if (pFrameImpl != null)
+ if (static_cast<int>(win) > 0 && pFrameImpl != null)
{
const unsigned int curHandle = pFrameImpl->GetNativeHandle();
const int pid = _AppArg::GetCallerPid(pBundle);
if (pid <= 0 || ((kill(pid, 0) < 0) && errno == ESRCH))
{
- SysLogException(NID_APP, E_SYSTEM, "Caller process %d not exist : terminating %d.", pid, getpid());
+ SysLogException(NID_APP, E_SYSTEM, "Caller process %d with %d not exist : terminating %d.", pid, win, getpid());
_Process::Exit(-1);
}
_UiAppImpl::OnWindowHandleRequest(void)
{
long handle = -1;
- int type = _AppInfo::GetAppType();
+ const int type = _AppInfo::GetAppType();
if (type & _APP_TYPE_IME_APP)
{
--- /dev/null
+//
+// 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 FApp_CoordinateInfo.h
+ * @brief This is the header file for the %_CoordinateInfo class.
+ */
+
+#ifndef _FAPP_INTERNAL_COORDINATE_INFO_H_
+#define _FAPP_INTERNAL_COORDINATE_INFO_H_
+
+//#include <FBaseObject.h>
+#include <FBaseString.h>
+#include <FGrp_CoordinateSystem.h>
+
+
+
+namespace Tizen { namespace App
+{
+
+/**
+ * @class _CoordinateInfo
+ * @brief This class handles the application coordinate system information
+ *
+ * This class handles the coordinate system
+ */
+class _CoordinateInfo
+{
+public:
+ /**
+ * Get the application coordinate system
+ */
+ static result GetAppCoordinateSystem(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, Tizen::Graphics::_BaseScreenSize& logicalBaseScreenSize);
+
+private:
+ /**
+ * This is the default constructor for this class.
+ */
+ _CoordinateInfo(void);
+
+ /**
+ * This is the destructor for this class.
+ */
+ ~_CoordinateInfo(void);
+
+ /**
+ * This is the copy constructor for the this class.
+ */
+ _CoordinateInfo(const _CoordinateInfo& value);
+
+ /**
+ * This is the assignment operator for this class.
+ */
+ _CoordinateInfo& operator =(const _CoordinateInfo& value);
+
+ /**
+ * Get the application coordinate system from info file
+ */
+ static result GetAppCoordinateSystemFromInfoFile(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, Tizen::Graphics::_BaseScreenSize& logicalBaseScreenSize);
+
+ /**
+ * Get the application coordinate system from database
+ */
+ static result GetAppCoordinateSystemFromDatabase(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, Tizen::Graphics::_BaseScreenSize& logicalBaseScreenSize);
+
+}; //_CoordinateInfo
+
+} } //Tizen::App
+
+#endif // _FAPP_INTERNAL_COORDINATE_INFO_H_
+
--- /dev/null
+//
+// 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 FApp_ThemeInfo.h
+ * @brief This is the header file for the %_ThemeInfo class.
+ */
+
+#ifndef _FAPP_INTERNAL_THEME_INFO_H_
+#define _FAPP_INTERNAL_THEME_INFO_H_
+
+#include <FBaseString.h>
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace App
+{
+
+
+/**
+ * @class _ThemeInfo
+ * @brief This class handles the application theme information
+ *
+ * This class handles the theme
+ */
+class _ThemeInfo
+{
+public:
+ /**
+ * Get the application theme
+ */
+ static result LoadThemeInformation(String& systemTheme, String& userTheme);
+
+private:
+ /**
+ * This is the default constructor for this class.
+ */
+ _ThemeInfo(void);
+
+ /**
+ * This is the destructor for this class.
+ */
+ ~_ThemeInfo(void);
+
+ /**
+ * This is the copy constructor for the this class.
+ */
+ _ThemeInfo(const _ThemeInfo& value);
+
+ /**
+ * This is the assignment operator for this class.
+ */
+ _ThemeInfo& operator =(const _ThemeInfo& value);
+
+ /**
+ * Get the application theme from info file
+ */
+ static result LoadThemeInfoFromInfoFile(String& systemTheme, String& userTheme);
+
+ /**
+ * Get the application theme from database
+ */
+ static result LoadThemeInfoFromDatabase(String& systemTheme, String& userTheme);
+
+}; //_ThemeInfo
+
+} } //Tizen::App
+
+#endif // _FAPP_INTERNAL_THEME_INFO_H_
+
}
result
-_Bitmap::Construct(const void* pExtBuffer, int width, int height, int bitsPerPixel)
+_Bitmap::Construct(const void* pExtBuffer, int width, int height, int bitsPerPixel, int pixelsPerLine)
{
+ if (pixelsPerLine == 0)
+ {
+ pixelsPerLine = width;
+ }
+
switch (bitsPerPixel)
{
case 16:
{
typedef unsigned short Pixel;
- __pScratchPad16 = new (std::nothrow) _Util::ScratchPad<Pixel>((Pixel*) pExtBuffer, width, height, width);
+ __pScratchPad16 = new (std::nothrow) _Util::ScratchPad<Pixel>((Pixel*) pExtBuffer, width, height, pixelsPerLine);
__pBuffer = (unsigned char*) pExtBuffer;
}
break;
{
typedef unsigned long Pixel;
- __pScratchPad32 = new (std::nothrow) _Util::ScratchPad<Pixel>((Pixel*) pExtBuffer, width, height, width);
+ __pScratchPad32 = new (std::nothrow) _Util::ScratchPad<Pixel>((Pixel*) pExtBuffer, width, height, pixelsPerLine);
__pBuffer = (unsigned char*) pExtBuffer;
}
break;
{
info.width = __pScratchPad16->GetWidth();
info.height = __pScratchPad16->GetHeight();
- info.pitch = __pScratchPad16->GetWidth() * 2;
+
+ {
+ unsigned short* pBuffer;
+ int pitch;
+
+ __pScratchPad16->GetBuffer(pBuffer, pitch);
+ info.pitch = pitch * 2;
+ }
+
info.bitsPerPixel = 16;
info.pixelFormat = PIXEL_FORMAT_RGB565;
info.pPixels = (void*) this->__pBuffer;
{
info.width = __pScratchPad32->GetWidth();
info.height = __pScratchPad32->GetHeight();
- info.pitch = __pScratchPad32->GetWidth() * 4;
+
+ {
+ unsigned long* pBuffer;
+ int pitch;
+
+ __pScratchPad32->GetBuffer(pBuffer, pitch);
+ info.pitch = pitch * 4;
+ }
+
info.bitsPerPixel = 32;
info.pixelFormat = PIXEL_FORMAT_ARGB8888;
info.pPixels = (void*) this->__pBuffer;
result Construct(const _Bitmap& bitmap, const Rectangle& rect);
result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat);
result Construct(const byte* pBuffer, int bufSize, const Dimension& rq_dim, BitmapPixelFormat pixelFormat);
- result Construct(const void* pExtBuffer, int width, int height, int bitsPerPixel);
+ result Construct(const void* pExtBuffer, int width, int height, int bitsPerPixel, int pixelsPerLine = 0);
bool IsValid(void) const;
, "Unsupported format (BufferInfo::pixelFormat = %d)"
, bufferInfo.pixelFormat);
- result r = this->Construct(static_cast<const byte*>(bufferInfo.pPixels), bufferInfo.pitch * bufferInfo.height, Dimension(bufferInfo.width, bufferInfo.height), bitmapPixelFormat, false);
+ result r = this->Construct(static_cast<const byte*>(bufferInfo.pPixels), bufferInfo.width, bufferInfo.height, bitmapPixelFormat, bufferInfo.pitch);
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory.");
- SysTryReturnResult(NID_GRP, pBuffer, E_INVALID_ARG, "The specified buffer pointer is invalid.", rq_dim.width, rq_dim.height);
+ SysTryReturnResult(NID_GRP, pBuffer, E_INVALID_ARG, "The specified buffer pointer is invalid.");
SysTryReturnResult(NID_GRP, rq_dim.width > 0 && rq_dim.height > 0, E_INVALID_ARG, "Both of width(%d) and height(%d) of a dimension MUST be greater than 0.", rq_dim.width, rq_dim.height);
}
result
+_BitmapImpl::Construct(const byte* pExtBuffer, int width, int height, BitmapPixelFormat pixelFormat, int pitch)
+{
+ SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet.");
+
+ SysTryReturnResult(NID_GRP, this->_sharedItem.get(), E_OUT_OF_MEMORY, "Fails to allocate memory.");
+
+ SysTryReturnResult(NID_GRP, pExtBuffer, E_INVALID_ARG, "The specified buffer pointer is invalid.", width, height);
+
+ SysTryReturnResult(NID_GRP, width > 0 && height > 0, E_INVALID_ARG, "Both of width(%d) and height(%d) of a dimension MUST be greater than 0.", width, height);
+
+ SysTryReturnResult(NID_GRP, pixelFormat > BITMAP_PIXEL_FORMAT_MIN && pixelFormat < BITMAP_PIXEL_FORMAT_MAX, E_INVALID_ARG, "BitmapPixelFormat(%d) is the invalid argument.", pixelFormat);
+
+ // SysAssert(this->_sharedItem->coordHolder->size.pcInt.w > 0 && this->_sharedItem->coordHolder->size.pcInt.h > 0);
+
+ int bpp = _GetBytesPerPixel(pixelFormat);
+
+ SysTryReturnResult(NID_GRP, bpp > 0, E_INVALID_ARG, "BitmapPixelFormat(%d) is the invalid argument.", pixelFormat);
+
+ result r = this->_sharedItem->nativeBitmap->Construct(pExtBuffer, width, height, bpp * 8, pitch / bpp);
+
+ if (!IsFailed(r))
+ {
+ _Util::Dimension<int> pcDim = { width, height };
+
+ this->_sharedItem->coordHolder->ResetFromPc(pcDim);
+ }
+
+ return r;
+}
+
+result
_BitmapImpl::Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& rq_dim, BitmapPixelFormat pixelFormat, BufferScaling bufferScaling)
{
SysTryReturnResult(NID_GRP, this, E_OUT_OF_MEMORY, "This instance is not allocated yet.");
{
SysTryReturnResult(NID_GRP, &bitmap && bitmap.IsValid(), E_INVALID_ARG, "The source bitmap is invalid.\n");
- _Util::Point<double> pointD =
+ int alphaConstant = this->_GetAlphaAttenuation(bitmap);
+
{
- double(point.x),
- double(point.y)
- };
+ Rectangle clipRect;
+ this->__GetClipBounds(clipRect);
+
+ bool pass = false;
+
+ {
+ _Util::LockManagerFast srcLock(bitmap);
+ _Util::LockManagerFast dstLock(*this);
+
+ SysTryReturnResult(NID_GRP, srcLock.IsValid(), E_OPERATION_FAILED, "The source bitmap cannot be locked.\n");
+ SysTryReturnResult(NID_GRP, dstLock.IsValid(), E_OPERATION_FAILED, "The canvas cannot be locked.\n");
+
+ const BufferInfo& srcBufferInfo = srcLock.GetBufferInfo();
+ const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
+
+ {
+ _Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
+ _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
+
+ _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
+ _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(clipRect.x,clipRect.y, clipRect.width, clipRect.height);
+
+ if (srcBufferInfo.pixelFormat == PIXEL_FORMAT_RGB565 && srcImage.enableColorKey == 0 && dstBufferInfo.pixelFormat == PIXEL_FORMAT_ARGB8888 && !this->__isClipBoundsSet)
+ {
+ pixman_image_t* pPixmanSrc = pixman_image_create_bits(PIXMAN_r5g6b5, srcBufferInfo.width, srcBufferInfo.height, (uint32_t*)srcBufferInfo.pPixels, srcBufferInfo.pitch);
+ pixman_image_t* pPixmanDst = pixman_image_create_bits(PIXMAN_a8r8g8b8, dstBufferInfo.width, dstBufferInfo.height, (uint32_t*)dstBufferInfo.pPixels, dstBufferInfo.pitch);
+
+ if (pPixmanSrc && pPixmanDst)
+ {
+ pixman_image_composite32(PIXMAN_OP_SRC, pPixmanSrc,NULL, pPixmanDst, 0, 0, 0, 0, point.x, point.y, srcBufferInfo.width, srcBufferInfo.height);
+ pass = true;
+ }
+
+ if (pPixmanDst)
+ {
+ pixman_image_unref(pPixmanDst);
+ }
+
+ if (pPixmanSrc)
+ {
+ pixman_image_unref(pPixmanSrc);
+ }
+ }
+ }
+
+ {
+ Color color;
- return this->DrawBitmap(pointD, bitmap);
+ bool isPixmanSupported = !(bitmap.__isOpaqueAllOver && GetCompositeMode() == COMPOSITE_MODE_SRC_OVER) && (!this->__useStableRenderer || bitmap.__isPremultiplied);
+
+ if (isPixmanSupported)
+ {
+ Color color;
+
+ isPixmanSupported = !((bitmap.GetBitsPerPixel() == 16) && (bitmap.GetMaskingColor(color) == E_SUCCESS));
+ }
+
+ if (isPixmanSupported)
+ {
+ _Util::Rectangle<int> outRect = { 0, 0, -1, -1 };
+ _Util::Rectangle<int> dstRect = { point.x, point.y, srcBufferInfo.width, srcBufferInfo.height };
+ _Util::Rectangle<int> tgtRect = { clipRect.x, clipRect.y, clipRect.width, clipRect.height };
+
+ if (_Util::IntersectRect(outRect, tgtRect, dstRect))
+ {
+ _Util::Bounds<int> outBounds = { outRect.x, outRect.y, outRect.x + outRect.w, outRect.y + outRect.h };
+ _Util::Bounds<int> dstBounds = { dstRect.x, dstRect.y, dstRect.x + dstRect.w, dstRect.y + dstRect.h };
+ _Util::Bounds<int> srcBounds =
+
+ {
+ (outBounds.x1 - dstBounds.x1),
+ (outBounds.y1 - dstBounds.y1),
+ srcBufferInfo.width + (outBounds.x2 - dstBounds.x2),
+ srcBufferInfo.height + (outBounds.y2 - dstBounds.y2),
+ };
+
+ srcBounds.x1 = (srcBounds.x1 >= 0) ? srcBounds.x1 :0;
+ srcBounds.y1 = (srcBounds.y1 >= 0) ? srcBounds.y1 :0;
+ srcBounds.x2 = (srcBounds.x2 <= srcBufferInfo.width) ? srcBounds.x2 : srcBufferInfo.width;
+ srcBounds.y2 = (srcBounds.y2 <= srcBufferInfo.height) ? srcBounds.y2 : srcBufferInfo.height;
+
+ _Util::Pixmap srcImageUnclipped(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
+ _Util::Pixmap srcImage = srcImageUnclipped.GetSubBitmap(srcBounds.x1, srcBounds.y1, srcBounds.x2 - srcBounds.x1, srcBounds.y2 - srcBounds.y1);
+ _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
+
+ _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
+ _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(outRect.x, outRect.y, outRect.w, outRect.h);
+
+ pixman_transform_t transform;
+ pixman_transform_init_identity(&transform);
+
+ if (alphaConstant < 255)
+ {
+ std::unique_ptr<_Util::Pixmap> modifiedSrcImage(srcImage.GetAlphaAttenuatedPixmap(alphaConstant));
+
+ if (modifiedSrcImage != null)
+ {
+ pass = _Pixman::CopyPixmap(dstImage, *modifiedSrcImage.get(), GetDrawingQuality(), GetCompositeMode());
+ }
+ }
+
+ if (!pass)
+ {
+ pass = _Pixman::CopyPixmap(dstImage, srcImage, GetDrawingQuality(), GetCompositeMode());
+ }
+ }
+ }
+
+ if (!pass)
+ {
+ _Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
+ _ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
+
+ _Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
+ _Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
+ pass = Tizen::Graphics::_Effect::DrawImageWithAlpha(dstImage, point.x - clipRect.x, point.y - clipRect.y, srcImage, alphaConstant);
+ }
+ }
+ }
+
+ SysTryReturnResult(NID_GRP, pass, E_INVALID_ARG, "The source bitmap is invalid.\n");
+
+ return E_SUCCESS;
+ }
}
result
_Util::Pixmap srcImageEx(clippedSrcRect.width, clippedSrcRect.height, sizeof(SystemPixel) * 8, pSrcAddr, srcPitch * sizeof(SystemPixel));
_Util::Pixmap dstImageEx(__pScratchPad->GetWidth(), __pScratchPad->GetHeight(), sizeof(SystemPixel) * 8, pDstAddr, dstPitch * sizeof(SystemPixel));
- Tizen::Graphics::_Effect::ScaleImage(dstImageEx, destRect.x, destRect.y, destRect.width, destRect.height, srcImageEx);
+ Tizen::Graphics::_Effect::ScaleImage(dstImageEx, destRect.x, destRect.y, destRect.width, destRect.height, srcImageEx, _Effect::ROP_COPY);
}
return E_SUCCESS;
void
SetDash(cairo_t* pCairo, double* pDashes, int dashCount, double offset)
{
- cairo_set_dash(pCairo, pDashes, dashCount, offset);
+ double sum = 0.0;
+
+ for (int i = 0; i < dashCount; i++)
+ {
+ sum += pDashes[i];
+ }
+
+ if (sum == 0.0 && dashCount > 0)
+ {
+ // used the maximum value of integer type instead of double type(1.79769e+308).
+ const double infiniteValue = double(2147483647);
+ const double zeroDashes[2] = { 0.0, infiniteValue };
+
+ cairo_set_dash(pCairo, zeroDashes, 2, offset);
+ }
+ else
+ {
+ cairo_set_dash(pCairo, pDashes, dashCount, offset);
+ }
}
void
SysTryReturnResult(NID_GRP, BITMAP_IS_VALID(bitmap), E_INVALID_ARG, "The source bitmap is invalid.");
+ // This code is executed using neon.acceleration.
+ {
+ bool isXEqualToInteger = _Util::Abs(vcPointF.x - int(vcPointF.x)) <= 0.01;
+ bool isYEqualToInteger = _Util::Abs(vcPointF.y - int(vcPointF.y)) <= 0.01;
+
+ bool isCompositeModeUnbound = GetCompositeMode() == COMPOSITE_MODE_SRC_IN
+ || GetCompositeMode() == COMPOSITE_MODE_DST_IN
+ || GetCompositeMode() == COMPOSITE_MODE_SRC_OUT
+ || GetCompositeMode() == COMPOSITE_MODE_DST_ATOP;
+
+ if (isXEqualToInteger && isYEqualToInteger && !isCompositeModeUnbound)
+ {
+ return this->DrawBitmap(Point(int(vcPointF.x), int(vcPointF.y)), bitmap);
+ }
+ }
+
FloatRectangle rtCanvasF = _GetBoundsRelF(*this);
if (rtCanvasF.IsEmpty())
{
SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.");
+ int dashValue = 0;
+
+ for (int i = 0; i < pattern.GetCount(); i++)
+ {
+ pattern.GetAt(i, dashValue);
+ SysTryReturn(NID_GRP, dashValue >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] One of the values of the specified pattern is negative(%d).", dashValue);
+ }
+
result r = E_SUCCESS;
// It is NOT the strong guarantee for an exception
{
SysTryReturn(NID_GRP, INSTANCE_IS_VALID, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.");
+ float dashValue = 0.0f;
+
+ for (int i = 0; i < pattern.GetCount(); i++)
+ {
+ pattern.GetAt(i, dashValue);
+ SysTryReturn(NID_GRP, dashValue >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] One of the values of the specified pattern is negative(%f).", dashValue);
+ }
+
result r = E_SUCCESS;
// It is NOT the strong guarantee for an exception
}
{
- float dashIntValue = 0.0f;
+ float dashFloatValue = 0.0f;
Tizen::Graphics::_Util::AccumList<double> dashValueList;
for (int i = 0; i < pattern.GetCount(); i++)
{
- pattern.GetAt(i, dashIntValue);
- dashValueList.Push(double(dashIntValue));
+ pattern.GetAt(i, dashFloatValue);
+ dashValueList.Push(double(dashFloatValue));
}
r = this->_pNativeCanvas->SetDashPattern(dashValueList, double(offset));
}
else
{
- premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
+ bool pass = false;
+ bool isInternalSolutionEnable = !((dstImage.width == srcImage.width) && (dstImage.height == srcImage.height) && pixman_transform_is_identity(&transform));
- if (premultipliedSrcImage.get())
+ if (isInternalSolutionEnable)
{
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
- }
- else
- {
- // slow but it does not create additional buffer
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_x8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- pPixmanMsk.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
+ premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
- if (pPixmanMsk == null)
+ if (premultipliedSrcImage.get())
{
- return false;
+ pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
+ pass = true;
}
}
- }
- break;
- default:
- return false;
- }
-
- if (pPixmanSrc)
- {
- pixman_image_set_transform(pPixmanSrc, &transform);
- if (pPixmanMsk)
- {
- pixman_image_set_transform(pPixmanMsk, &transform);
- }
-
- pixman_image_set_filter(pPixmanSrc, filter, NULL, 0);
- pixman_image_set_repeat(pPixmanSrc, repeatMethod);
-
- if (rop == PIXMAN_OP_COPY)
- {
- rop = PIXMAN_OP_SRC;
- }
-
- pixman_image_composite32(pixman_op_t(rop), pPixmanSrc, pPixmanMsk, pPixmanDst, 0, 0, 0, 0, 0, 0, dstImage.width, dstImage.height);
-
- return true;
- }
- }
-
- return false;
-}
-
-bool __CompositePixmap(Tizen::Graphics::_Util::Pixmap& dstImage, const Tizen::Graphics::_Util::Pixmap& srcImage, int rop, pixman_filter_t filter, pixman_transform_t transform, pixman_repeat_t repeatMethod, pixman_region32_t resultRect)
-{
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanDst;
-
- switch (dstImage.depth)
- {
- case 16:
- pPixmanDst.Bind(pixman_image_create_bits(PIXMAN_r5g6b5, dstImage.width, dstImage.height, (uint32_t*)dstImage.pBitmap, dstImage.bytesPerLine));
- break;
- case 32:
- pPixmanDst.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, dstImage.width, dstImage.height, (uint32_t*)dstImage.pBitmap, dstImage.bytesPerLine));
- break;
- default:
- return false;
- }
-
- if (pPixmanDst)
- {
- std::auto_ptr<Tizen::Graphics::_Util::Pixmap> premultipliedSrcImage;
-
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanMsk;
- Tizen::Graphics::_Util::AutoDeletor<pixman_image_t> pPixmanSrc;
-
- switch (srcImage.depth)
- {
- case 16:
- // color key is not supporting
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_r5g6b5, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- break;
- case 32:
- if (srcImage.isPremultiplied || rop == PIXMAN_OP_COPY)
- {
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
- }
- else
- {
- premultipliedSrcImage.reset(srcImage.GetPremultipliedPixmap());
-
- if (premultipliedSrcImage.get())
- {
- pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_a8r8g8b8, premultipliedSrcImage->width, premultipliedSrcImage->height, (uint32_t*)premultipliedSrcImage->pBitmap, premultipliedSrcImage->bytesPerLine));
- }
- else
+ if (!pass)
{
// slow but it does not create additional buffer
pPixmanSrc.Bind(pixman_image_create_bits(PIXMAN_x8r8g8b8, srcImage.width, srcImage.height, (uint32_t*)srcImage.pBitmap, srcImage.bytesPerLine));
pixman_image_set_filter(pPixmanSrc, filter, NULL, 0);
pixman_image_set_repeat(pPixmanSrc, repeatMethod);
- pixman_image_set_clip_region32 (pPixmanDst, &resultRect);
-
if (rop == PIXMAN_OP_COPY)
{
rop = PIXMAN_OP_SRC;
return __pNativeFont;
}
+ // Check the BlackList
+ _FontRsrcManager& mgr = _FontRsrcManager::GetInstance();
+
+ if (mgr.SearchBlackList(character))
+ {
+ return __pNativeFont;
+ }
+
//------------------------------------------------------
//
// 1-2. check if this glyph is in the fallback list.
//
//------------------------------------------------------
- _FontRsrcManager& mgr = _FontRsrcManager::GetInstance();
_IFont::FontMapT* pFallbackFontMap = __pNativeFont->GetFallbackMap();
#ifdef USE_HASHMAP_FOR_FONT
}
}
- return (pFallbackFont != null) ? pFallbackFont : __pNativeFont;
+ if (pFallbackFont == null)
+ {
+ mgr.AddBlackList(character);
+
+ return __pNativeFont;
+ }
+
+ return pFallbackFont;
CATCH:
// if failed find out fallback font,
}
}
}
- else
+ else if (int(this->__glyphCount) < textLength)
{
int tempCount = this->__glyphCount;
pAuxInfo->xAdvance.Reset(pPosition->x_advance);
pAuxInfo->yAdvance.Reset(pPosition->y_advance);
- bool isColltionElement = false;
+ bool isCollationElement = false;
if (script == G_UNICODE_SCRIPT_ARABIC)
{
- isColltionElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex + 1), *(reorderedText.pStart + textIndex)));
+ isCollationElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex + 1), *(reorderedText.pStart + textIndex)));
}
else
{
- isColltionElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex), *(reorderedText.pStart + textIndex + 1)));
+ isCollationElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex), *(reorderedText.pStart + textIndex + 1)));
}
- if (isColltionElement)
+ if (isCollationElement)
{
++pAuxInfo;
++textIndex;
}
}
}
+ else if (int(this->__glyphCount) > textLength)
+ {
+ this->__pGlyphAuxInfo = new (std::nothrow) GlyphAuxInfo[this->__glyphCount];
+
+ if (this->__pGlyphAuxInfo)
+ {
+ memset(static_cast<void*>(this->__pGlyphAuxInfo), 0, sizeof(GlyphAuxInfo) * this->__glyphCount);
+
+ hb_glyph_position_t* pPosition = hb_buffer_get_glyph_positions(hBuffer, NULL);
+ hb_glyph_info_t* pInfo = hb_buffer_get_glyph_infos(hBuffer, NULL);
+
+ GlyphAuxInfo* pAuxInfo = &this->__pGlyphAuxInfo[0];
+ GlyphAuxInfo* pAuxInfoEnd = pAuxInfo + this->__glyphCount;
+
+ int textIndex = 0;
+
+ while (pAuxInfo < pAuxInfoEnd)
+ {
+ pAuxInfo->isAvailable = true;
+ pAuxInfo->glyphIndex = pInfo->codepoint;
+ pAuxInfo->xOffset.Reset(pPosition->x_offset);
+ pAuxInfo->yOffset.Reset(pPosition->y_offset);
+ pAuxInfo->xAdvance.Reset(pPosition->x_advance);
+ pAuxInfo->yAdvance.Reset(pPosition->y_advance);
+
+ bool isCollationElement = false;
+
+ if (script == G_UNICODE_SCRIPT_ARABIC)
+ {
+ isCollationElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex + 1), *(reorderedText.pStart + textIndex)));
+ }
+ else
+ {
+ isCollationElement = ((textIndex + 1 < textLength) && _TextBidiUtil::IsCollationElement(*(reorderedText.pStart + textIndex), *(reorderedText.pStart + textIndex + 1)));
+ }
+
+ if (isCollationElement)
+ {
+ ++pAuxInfo;
+ ++textIndex;
+ pAuxInfo->isAvailable = false;
+ }
+
+ ++pInfo;
+ ++pPosition;
+ ++pAuxInfo;
+ ++textIndex;
+ }
+ }
+ }
hb_buffer_destroy(hBuffer);
hb_font_destroy(hSubFont);
return E_SUCCESS;
}
+result
+_FontImpl::__GetTextExtent(const wchar_t* text, int textLength, int length, FloatDimension& vcDim, bool outline) const
+{
+ // This method must synchronize with _FontImpl::GetTextExtent(const Tizen::Base::String& text, int length, FloatDimension& vcDim, bool outline)
+
+ CRITICAL_SECTION;
+ IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED);
+
+ int dummyCount = 0;
+ Dimension pcDim;
+
+ result r = _pNativeFont->GetTextExtent(INT_MAX, _Util::String(text, textLength, 0, length), outline, dummyCount, pcDim);
+
+ if (IsSucceeded(r))
+ {
+ vcDim.width = _ResUtil::ConvertToVirCoord(static_cast<float>(pcDim.width));
+ vcDim.height = _ResUtil::ConvertToVirCoord(static_cast<float>(pcDim.height));
+ }
+
+ return r;
+}
+
+result
+_FontImpl::__GetTextExtent(float vcWidth, const wchar_t* text, int textLength, int startIndex, int length, bool outline, int& count, FloatDimension& vcDim) const
+{
+ // This method must synchronize with _FontImpl::GetTextExtent(float vcWidth, const Tizen::Base::String& text, int startIndex, int length, bool outline, int& count, FloatDimension& vcDim)
+
+ CRITICAL_SECTION;
+ IF_NOT_CONSTRUCTED(return E_OPERATION_FAILED);
+
+ SysTryReturnResult(NID_GRP, startIndex >= 0 && length >= 0 && startIndex < textLength, E_OUT_OF_RANGE,
+ "The length(%d) & startIndex(%d) of the given text is out of range", length, startIndex);
+
+ int pcWidth = _FloatToIntForPos(_ResUtil::ToPhyCoordW(vcWidth));
+ Dimension pcDim;
+ result r = _pNativeFont->GetTextExtent(pcWidth, _Util::String(text, textLength, startIndex, length), outline, count, pcDim);
+
+ if (IsSucceeded(r))
+ {
+ vcDim.width = _ResUtil::ConvertToVirCoord(static_cast<float>(pcDim.width));
+ vcDim.height = _ResUtil::ConvertToVirCoord(static_cast<float>(pcDim.height));
+ }
+
+ return r;
+}
+
}} // Tizen::Graphics
const char* _DEFAULT_SYSTEM_FONT = "DefaultSystemFont";
const char* _DEFAULT_SYSTEM_BOLD_FONT = "DefaultSystemBoldFont";
const _Util::FixedPoint26_6 _SYSTEM_DEFAULT_FONT_SIZE(16);
+const int _BLACK_LIST_MAX_COUNT = 1000;
class _FontNull
: public Tizen::Graphics::_IFont
__appFontMap.Construct(0, 0, fontHashCodeProviderEx, fontComparerEx);
#endif
-
__defaultSystemFontPath.Clear();
__defaultSystemBoldFontPath.Clear();
__pDefaultSystemFont = null;
return E_SUCCESS;
}
-
bool
_FontRsrcManager::SearchFont(const _Util::WString& fontName)
{
return (__SearchFont(fontName, sharedFont) == true);
}
+void
+_FontRsrcManager::AddBlackList(const wchar_t unicode)
+{
+ if (__blackListUnicodeSet.size() > _BLACK_LIST_MAX_COUNT)
+ {
+ this->ClearBlackList();
+ }
+
+ __blackListUnicodeSet.insert(unicode);
+}
+
+bool
+_FontRsrcManager::SearchBlackList(const wchar_t unicode) const
+{
+ BlackListSetT::const_iterator blackListIterator = __blackListUnicodeSet.find(unicode);
+
+ return (blackListIterator != __blackListUnicodeSet.end());
+}
+
+void
+_FontRsrcManager::ClearBlackList()
+{
+ __blackListUnicodeSet.clear();
+}
+
result
_FontRsrcManager::GetFont(const byte* pFontData, int fontDataSize, int style, _Util::FixedPoint26_6 size, SharedFontResource& out)
{
#endif
pFont->CleanCache();
+ this->ClearBlackList();
}
return true;
#include <algorithm>
#endif
+#include <set>
#include <FBaseString.h>
#include <FBaseDataType.h>
#include <FBaseColArrayListT.h>
{
public:
typedef std::tr1::shared_ptr<_IFont> SharedFontResource;
+ typedef std::set<wchar_t> BlackListSetT;
#ifdef USE_HASHMAP_FOR_FONT
typedef Tizen::Base::Collection::HashMapT <_Util::WString, SharedFontResource> FontMapT;
typedef Tizen::Base::Collection::HashMapT <_Util::WString, _Util::WString> AppFontMapT;
result AddFont(const _Util::WString& fontPath, SharedFontResource& out);
bool SearchFont(const _Util::WString& fontName);
+ void AddBlackList(const wchar_t);
+ bool SearchBlackList(const wchar_t) const;
+ void ClearBlackList(void);
+
bool ReloadDefaultSystemFont(void);
_FontMemoryManager& GetMemoryManager(void);
_Font& GetDefaultSystemFont(void);
bool __CreateFont(int fontEngine, const void* pBuffer, long bufSize, long face, _IFont** pOut);
bool __CreateFont(int fontEngine, const char* filePath, long face, _IFont** pOut);
bool __CreateStaticFont(int fontEngine, const void* pBuffer, long bufSize, long face, _IFont** pOut);
- bool __SearchFont(const _Util::WString& fontName, SharedFontResource& out) const;
bool __AddFont(const _Util::WString& key, const SharedFontResource& font);
+ bool __SearchFont(const _Util::WString& fontName, SharedFontResource& out) const;
+
void __RemoveUnusedFont(void);
long __GetMaxFontEngine(void) const;
const Tizen::Base::String& __GetDefaultSystemFontPath(bool isBold);
private:
FontMapT __fontRsrcMap;
AppFontMapT __appFontMap;
+ BlackListSetT __blackListUnicodeSet;
Tizen::Base::String __defaultSystemFontPath;
Tizen::Base::String __defaultSystemBoldFontPath;
result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, bool autoScaling);
result Construct(const byte* pBuffer, int bufferSize, const Dimension& dim, BitmapPixelFormat pixelFormat, bool autoScaling);
+ result Construct(const byte* pExtBuffer, int width, int height, BitmapPixelFormat pixelFormat, int pitch);
bool __CheckValidity(bool canBufferExpand = true);
bool __RealizeBuffer(void);
class _Font;
+namespace _Text
+{
+class TextUtility;
+}
+
struct _FloatPair
{
float first;
_FontImpl(const _FontImpl& obj);
_FontImpl& operator =(const _FontImpl& rhs);
+ result __GetTextExtent(const wchar_t* text, int textLength, int length, FloatDimension& dim, bool outline = false) const;
+ result __GetTextExtent(float width, const wchar_t* text, int textLength, int startIndex, int length, bool outline, int& count, FloatDimension& dim) const;
+
friend class _Font;
+ friend class _Text::TextUtility;
}; // _FontImpl
#include <FUiCtrlFrame.h>
#include <FUiWindow.h>
+#include <FBaseColQueue.h>
+
#include <FUi_EcoreEvasMgr.h>
#include <FUi_EcoreEvas.h>
using namespace Tizen::Ui::Animations;
using namespace Tizen::Ui;
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
namespace Tizen { namespace Graphics
{
void _UnregisterRenderCallback(Evas_Object* pObject);
int __registerCallbackCount = 0;
_SglInfo* __pPreviousSglInfo = null;
+Queue* __pSwapQueue = null;
+
bool __needRestoreContext = false;
#endif
const int MAX_SGL_INDEX = 100;
class _SglInfo
+ : public Tizen::Base::Object
{
public:
_SglInfo(void)
, height(0)
#endif
, isBackbuffer(true)
- , swapDone(false)
, isFirstSwap(true)
, pSecondSglInfo(null)
, pBitmapPointer(null)
, pBitmapLocked(null)
+ , pBitmapCopyNeeded(null)
+ , isCopyNeeded(false)
{
}
}
}
-#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
- _UnregisterRenderCallback(pObject);
-#endif
evas_object_del(pObject);
delete pVisualElementSurface;
delete pBitmap;
+ delete pBitmapCopyNeeded;
bool needAllocateObject = true;
if (__isDoublePixmapEnabled)
height = 0;
#endif
isBackbuffer = true;
- swapDone = false;
isFirstSwap = true;
pSecondSglInfo = null;
+
+ pBitmapCopyNeeded = null;
+ isCopyNeeded = false;
}
public:
int height;
#endif
bool isBackbuffer;
- bool swapDone;
bool isFirstSwap;
_SglInfo* pSecondSglInfo;
void* pBitmapPointer;
Bitmap* pBitmapLocked;
+ Bitmap* pBitmapCopyNeeded;
+ bool isCopyNeeded;
+
private:
_SglInfo(const _SglInfo& sglInfo);
_SglInfo& operator =(const _SglInfo& rhs);
&& pSglInfo->pWindow != null
, E_INVALID_STATE, "Invalid state.");
+ if (__pSwapQueue != null && __pSwapQueue->Contains(*pSglInfo))
+ {
+ int count = __pSwapQueue->GetCount();
+ for (int i = 0; i < count; i++)
+ {
+ _SglInfo* pObject = dynamic_cast<_SglInfo*> (__pSwapQueue->Dequeue());
+ if (pObject != pSglInfo)
+ {
+ __pSwapQueue->Enqueue(pObject);
+ }
+ }
+ }
+
if (pSglInfo == __pPreviousSglInfo || pSglInfo->pSecondSglInfo == __pPreviousSglInfo)
{
__pPreviousSglInfo = null;
pSglInfo->nativePixmap = nativePixmap;
pSglInfo->surface = eglSurface;
pSglInfo->isBackbuffer = true;
- pSglInfo->swapDone = false;
pSglInfo->isFirstSwap = true;
if (__isDoublePixmapEnabled)
pSglInfoSecond->surface = eglSurface;
pSglInfoSecond->pBitmap = bitmapSecond.release();
pSglInfoSecond->isBackbuffer = true;
- pSglInfoSecond->swapDone = true;
pSglInfo->isFirstSwap = true;
__needRestoreContext = false;
#endif
+ if (pSglInfo->isCopyNeeded)
+ {
+ delete pSglInfo->pBitmapCopyNeeded;
+ std::auto_ptr <Bitmap> bitmap(new (std::nothrow) Bitmap);
+ SysTryReturnVoidResult(NID_GRP, bitmap.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+ result r = bitmap.get()->Construct(Rectangle(0, 0, width, height));
+ SysTryReturnVoidResult(NID_GRP, r == E_SUCCESS, r, "Propagating.");
+ pSglInfo->pBitmapCopyNeeded = bitmap.release();
+ }
+
return;
}
}
else
{
- BufferInfo bufferInfo;
- pSglInfo->pBitmap->Lock(bufferInfo);
- evas_object_image_data_set(pSglInfo->pObject, bufferInfo.pPixels);
- pSglInfo->pBitmap->Unlock();
+ if (pSglInfo->isCopyNeeded)
+ {
+ BufferInfo bufferInfo;
+ pSglInfo->pBitmapCopyNeeded->Lock(bufferInfo);
+ evas_object_image_data_set(pSglInfo->pObject, bufferInfo.pPixels);
+ pSglInfo->pBitmapCopyNeeded->Unlock();
+ }
+ else
+ {
+ BufferInfo bufferInfo;
+ pSglInfo->pBitmap->Lock(bufferInfo);
+ evas_object_image_data_set(pSglInfo->pObject, bufferInfo.pPixels);
+ pSglInfo->pBitmap->Unlock();
+ }
}
}
void
_PostRenderCallback(Ecore_Evas* ee)
{
+ if (__pSwapQueue != null)
+ {
+ int count = __pSwapQueue->GetCount();
+ for (int i = 0; i < count; i++)
+ {
+ _SglInfo* pSglInfo = dynamic_cast<_SglInfo*> (__pSwapQueue->Dequeue());
+ if (pSglInfo != null)
+ {
+ _SglInfo* pBackSglInfo = null;
+ _SglInfo* pFrontSglInfo = null;
+
+ if (pSglInfo->isBackbuffer)
+ {
+ pBackSglInfo = pSglInfo;
+ pFrontSglInfo = pSglInfo->pSecondSglInfo;
+ }
+ else
+ {
+ pBackSglInfo = pSglInfo->pSecondSglInfo;
+ pFrontSglInfo = pSglInfo;
+ }
+
+ if (pSglInfo->pVisualElement != null)
+ {
+ pBackSglInfo->isBackbuffer = false;
+ pFrontSglInfo->isBackbuffer = true;
+
+ pSglInfo->pVisualElement->SetSurface(pBackSglInfo->pVisualElementSurface);
+ evas_object_image_pixels_dirty_set(pBackSglInfo->pObject, EINA_TRUE);
+ evas_object_hide(pFrontSglInfo->pObject);
+ }
+ }
+ }
+ }
+
if (__pPreviousSglInfo != null)
{
EGLDisplay display = __pPreviousSglInfo->display;
EGLSurface surface = __pPreviousSglInfo->surface;
EGLContext context = __pPreviousSglInfo->context;
- if (__isDoublePixmapEnabled)
+ if (__isDoublePixmapEnabled && __pPreviousSglInfo->pSecondSglInfo != null)
{
_SglInfo* pBackSglInfo = null;
_SglInfo* pFrontSglInfo = null;
}
surface = pBackSglInfo->surface;
-
- if (!pFrontSglInfo->swapDone && __pPreviousSglInfo->pVisualElement != null)
- {
- pBackSglInfo->isBackbuffer = false;
- pFrontSglInfo->isBackbuffer = true;
- pFrontSglInfo->swapDone = true;
-
- __pPreviousSglInfo->pVisualElement->SetSurface(pBackSglInfo->pVisualElementSurface);
- evas_object_image_pixels_dirty_set(pBackSglInfo->pObject, EINA_TRUE);
- evas_object_hide(pFrontSglInfo->pObject);
- surface = pFrontSglInfo->surface;
- }
}
EGLBoolean ret = eglMakeCurrent(display, surface, surface, context);
void
_SaveCurrentContext(_SglInfo* pSglInfo)
{
- __pPreviousSglInfo = pSglInfo;
+ if (pSglInfo != null)
+ {
+ __pPreviousSglInfo = pSglInfo;
+ }
}
void
}
ecore_evas_callback_post_render_set(pEcoreEvas, _PostRenderCallback);
+
+ if (__pSwapQueue == null)
+ {
+ std::auto_ptr <Queue> swapQueue(new (std::nothrow) Queue);
+ SysTryReturnVoidResult(NID_GRP, swapQueue.get() != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
+
+ result r = swapQueue.get()->Construct(MAX_SGL_INDEX / 2);
+ SysTryReturnVoidResult(NID_GRP, r == E_SUCCESS, r, "Propagating.");
+
+ __pSwapQueue = swapQueue.release();
+ }
}
__registerCallbackCount++;
}
}
ecore_evas_callback_post_render_set(pEcoreEvas, NULL);
+
+ delete __pSwapQueue;
+ __pSwapQueue = null;
}
}
}
pObject = evas_object_image_filled_add(pEvas);
SysTryReturn(NID_GRP, pObject != null, EGL_NO_SURFACE, E_OPERATION_FAILED, "Invalid object.");
+ __evasEngineType = _GetEvasEngineType(pObject);
+
int widthPhysical = static_cast<int> (CoordinateSystem::ConvertToPhysicalX(rect.width));
int heightPhysical = static_cast<int> (CoordinateSystem::ConvertToPhysicalY(rect.height));
pSglInfo->pVisualElementSurface = pVisualElementSurface;
pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
- __evasEngineType = _GetEvasEngineType(pObject);
-
#if defined (FGRAPHICS_INTERNAL_USE_DOUBLE_PIXMAP)
if (__evasEngineType == ENGINE_TYPE_OPENGL_X11)
{
pSglInfoSecond->pWindow = pWindow;
pSglInfoSecond->pObject = pObject;
pSglInfoSecond->pVisualElementSurface = pVisualElementSurface;
- pSglInfoSecond->swapDone = true;
pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
pSglInfo->pSecondSglInfo = pSglInfoSecond;
Bool ret = False;
drm_magic_t magic = 0;
+ int pitch = 0;
#endif
_SglInfo* pSglInfo = null;
_SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
}
pPixmapInfo->pTbmBufferObject = tbm_bo_import(pPixmapInfo->pTbmBufMgr, pDri2Buffer->name);
+ pitch = pDri2Buffer->pitch;
free(pDri2Buffer);
if (pPixmapInfo->pTbmBufferObject == null)
{
goto CATCH_06;
}
- r = Tizen::Graphics::_BitmapTool::ChangeBuffer(*pBitmap, tbmData.ptr, width * bitsPerPixel / 8,
+ r = Tizen::Graphics::_BitmapTool::ChangeBuffer(*pBitmap, tbmData.ptr, pitch,
_PixmapSurfaceDestroyCallback, (void*)pPixmapInfo);
if (r != E_SUCCESS)
{
goto CATCH_06;
}
+ if (__evasEngineType == ENGINE_TYPE_ETC && pitch != width * bitsPerPixel / 8)
+ {
+ std::auto_ptr <Bitmap> bitmap(new (std::nothrow) Bitmap);
+ if (bitmap.get() == null)
+ {
+ goto CATCH_06;
+ }
+
+ result r = bitmap.get()->Construct(Rectangle(0, 0, width, height));
+ if (r != E_SUCCESS)
+ {
+ goto CATCH_06;
+ }
+
+ pSglInfo->isCopyNeeded = true;
+ pSglInfo->pBitmapCopyNeeded = bitmap.release();
+ }
+
#else
#if defined(FGRAPHICS_INTERNAL_USE_EGLCOPYBUFFER)
{
}
pPixmapInfo->pTbmBufferObject = tbm_bo_import(pPixmapInfo->pTbmBufMgr, pDri2Buffer->name);
+ bufferInfo.pitch = pDri2Buffer->pitch;
free(pDri2Buffer);
if (pPixmapInfo->pTbmBufferObject == null)
{
bufferInfo.bitsPerPixel = 32;
bufferInfo.pixelFormat = PIXEL_FORMAT_ARGB8888;
- bufferInfo.pitch = bufferInfo.width * bufferInfo.bitsPerPixel / 8;
memset(bufferInfo.pPixels, 0, bufferInfo.pitch * bufferInfo.height);
r = pBitmapImpl->Construct(bufferInfo);
if (r != E_SUCCESS)
return eglDestroySurface(dpy, EGL_NO_SURFACE);
}
+ if (__pSwapQueue != null && __pSwapQueue->Contains(*pSglInfo))
+ {
+ int count = __pSwapQueue->GetCount();
+ for (int i = 0; i < count; i++)
+ {
+ _SglInfo* pObject = dynamic_cast<_SglInfo*> (__pSwapQueue->Dequeue());
+ if (pObject != pSglInfo)
+ {
+ __pSwapQueue->Enqueue(pObject);
+ }
+ }
+ }
+
#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
if (pSglInfo == __pPreviousSglInfo || pSglInfo->pSecondSglInfo == __pPreviousSglInfo)
{
pSglInfoTableManipulatorInstance->DestroySglIndex(pSglInfo->pSecondSglInfo->sglIndex);
}
+#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
+ if (pSglInfo->pVisualElementSurface != null)
+ {
+ _UnregisterRenderCallback(pSglInfo->pObject);
+ }
+#endif
+
pSglInfoTableManipulatorInstance->DestroySglIndex(sglIndex);
return ret;
#endif
#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
- if (draw != EGL_NO_SURFACE)
- {
- _SaveCurrentContext(pSglInfoDraw);
- }
+ _SaveCurrentContext(pSglInfoDraw);
#endif
if (pSglInfoDraw->glVersion == 0 && ctx != EGL_NO_CONTEXT)
{
- eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &pSglInfoDraw->glVersion);
+ eglQueryContext(dpy, ctx, EGL_CONTEXT_CLIENT_VERSION, &pSglInfoDraw->glVersion);
}
pSglInfoTableManipulatorInstance->UnlockSglInfoTable();
{
if (__isDoublePixmapEnabled && pSglInfo->pSecondSglInfo != null)
{
- if (pSglInfo->swapDone || pSglInfo->pSecondSglInfo->swapDone)
+ if (!__pSwapQueue->Contains(*pSglInfo))
{
+ __pSwapQueue->Enqueue(pSglInfo);
_SglInfo* pBackSglInfo = null;
_SglInfo* pFrontSglInfo = null;
pFrontSglInfo = pSglInfo;
}
- pFrontSglInfo->swapDone = false;
if (pSglInfo->pVisualElement != null)
{
{
if (pSglInfo->pVisualElement != null)
{
+ if (pSglInfo->isCopyNeeded)
+ {
+ BufferInfo bufferInfo;
+ pSglInfo->pBitmapCopyNeeded->Lock(bufferInfo);
+ pSglInfo->pBitmapCopyNeeded->Merge(Point(0, 0), *pSglInfo->pBitmap, Rectangle(0, 0, bufferInfo.width, bufferInfo.height));
+ pSglInfo->pBitmapCopyNeeded->Unlock();
+ }
pSglInfo->pVisualElement->SetFlushNeeded();
}
}
if (_pGlesLib1 == NULL)
{
_pGlesLib1 = dlopen("/usr/lib/libGLES_CM.so", RTLD_LAZY | RTLD_GLOBAL);
+ if (_pGlesLib1 == NULL)
+ {
+ _pGlesLib1 = dlopen("/usr/lib/egl/libGLES_CM.so", RTLD_LAZY | RTLD_GLOBAL);
+ }
}
}
#endif
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
SetAbbrevObjectFontInfo(pSimpleText);
- __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
}
+ __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
SetAbbrevObjectFontInfo(pSimpleText);
- __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
}
+ __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
SetAbbrevObjectFontInfo(pSimpleText);
- __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
}
+ __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
SetAbbrevObjectFontInfo(pSimpleText);
- __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
}
+ __pAbbrevTextElement->GetRegion(0, 1, abbrevTextDim.width, abbrevTextDim.height);
ForwardAnalyze(startTextIndex, __length - startTextIndex, adjustedRect.width - abbrevTextDim.width
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
}
TextElement*
-TextComposite::GetElementAtElementIndex(int nodeIndex) const
+TextComposite::GetElementAtElementIndex(int elementIndex) const
{
result r = E_SUCCESS;
TextElement* pTextElement = null;
- pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(nodeIndex));
+ pTextElement = static_cast < TextElement* >(__pTextElementList->GetAt(elementIndex));
SysTryReturn(NID_GRP, r == E_SUCCESS, null, r, "[%s] Fail to add element.", GetErrorMessage(r));
return pTextElement;
SysTryReturn(NID_GRP, pSimpleText, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
SetAbbrevObjectFontInfo(pSimpleText);
- __pAbbrevTextElement->GetRegion(0, 1, abbrevTextSize.width, abbrevTextSize.height);
}
+ __pAbbrevTextElement->GetRegion(0, 1, abbrevTextSize.width, abbrevTextSize.height);
ForwardAnalyze(lineOffset, __length - lineOffset, lineBounds.width - abbrevTextSize.width
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, lineLength, textSize.width, textSize.height);
int linkOffset = 0;
int totalLength = text.GetLength();
int length = 0;
+ const wchar_t* pText = text.GetPointer();
String prefix(L"");
String subString(L"");
}
r = text.SubString(index, length, subString);
- SysTryReturn(
- NID_GRP, r == E_SUCCESS, false, E_OUT_OF_RANGE,
+ SysTryReturn(NID_GRP, r == E_SUCCESS, false, E_OUT_OF_RANGE,
"[E_OUT_OF_RANGE] SubString offset(%d) must greater than 0 and length(%d) must be less than total string length(%d).",
index, prefix.GetLength(), totalLength);
if (prefix.CompareTo(subString) == 0)
{
linkOffset = index;
- while (index < totalLength && IsGenericCharacter(text[index]))
+ while (index < totalLength && IsGenericCharacter(pText[index]))
{
- if (dotFound == false && text[index] == '.')
+ if (dotFound == false && pText[index] == '.')
{
dotFound = true;
}
- if (validTextAfterDot == false && dotFound == true && text[index] != '.')
+ if (validTextAfterDot == false && dotFound == true && pText[index] != '.')
{
validTextAfterDot = true;
}
if (dotFound == true)
{
- while (text[index - 1] == L'.' || text[index - 1] == L',')
+ while (pText[index - 1] == L'.' || pText[index - 1] == L',')
{
index--;
}
bool dotFound = false;
bool validTextBeforeDot = false;
int linkOffset = index;
+ const wchar_t* pText = text.GetPointer();
while (lastLinkEndIndex <= linkOffset)
{
- if (!IsGenericCharacter(text[linkOffset]) || text[linkOffset] == L'(' || text[linkOffset] == L'[')
+ if (!IsGenericCharacter(pText[linkOffset]) || pText[linkOffset] == L'(' || pText[linkOffset] == L'[')
{
linkOffset++;
break;
}
- if (dotFound == false && text[linkOffset] == L'.')
+ if (dotFound == false && pText[linkOffset] == L'.')
{
dotFound = true;
}
- if (validTextBeforeDot == false && dotFound == true && text[linkOffset] != L'.')
+ if (validTextBeforeDot == false && dotFound == true && pText[linkOffset] != L'.')
{
validTextBeforeDot = true;
}
linkOffset--;
+
+ if (lastLinkEndIndex > linkOffset)
+ {
+ linkOffset++;
+ break;
+ }
}
if (dotFound == true && validTextBeforeDot != true)
if (dotFound == true)
{
- while (text[linkOffset] == L'.' || text[linkOffset] == L',')
+ while (pText[linkOffset] == L'.' || pText[linkOffset] == L',')
{
linkOffset++;
}
}
index += domainLength;
- if (text[index] == L'/')
+ if (pText[index] == L'/')
{
while (index > 0)
{
- if (!IsGenericCharacter(text[index]) && text[index] != L')' && text[index] != L']')
+ if (!IsGenericCharacter(pText[index]) && pText[index] != L')' && pText[index] != L']')
{
break;
}
index++;
}
}
- else if (text[index] != null && text[index] != L' ' && text[index] != TEXT_JAPANESE_SPACE &&
- text[index] != L')' && text[index] != L']' && text[index] != 0xFFFC &&
- text[index] != 0x000A && text[index] != 0x000D)
+ else if (pText[index] != null && pText[index] != L' ' && pText[index] != TEXT_JAPANESE_SPACE &&
+ pText[index] != L')' && pText[index] != L']' && pText[index] != 0xFFFC &&
+ pText[index] != 0x000A && pText[index] != 0x000D)
{
return false;
}
int atIndex = 0;
int totalLength = text.GetLength();
int linkOffset = index;
+ const wchar_t* pText = text.GetPointer();
- if (text[index + 1] == L'@')
+ if (pText[index + 1] == L'@')
{
return false;
}
if (index > lastLinkEndIndex)
{
- while (IsEmailCharacter(text[linkOffset]) && lastLinkEndIndex <= linkOffset)
+ while (IsEmailCharacter(pText[linkOffset]) && lastLinkEndIndex <= linkOffset)
{
linkOffset--;
}
atIndex = index;
index++;
- while (IsEmailCharacter(text[index]) && index < totalLength)
+ while (IsEmailCharacter(pText[index]) && index < totalLength)
{
if (validTextAfterAt == false)
{
validTextAfterAt = true;
}
- if (text[index] == '.')
+ if (pText[index] == '.')
{
- if (text[index + 1] == '.')
+ if (pText[index + 1] == '.')
{
break;
}
return false;
}
- while (text[index - 1] == L'.')
+ while (pText[index - 1] == L'.')
{
index--;
}
int oneDot = false;
int linkOffset = 0;
int blankCount = 0;
-
+ const wchar_t* pText = text.GetPointer();
int totalLength = text.GetLength();
- if (text[index] == L'+')
+
+ if (pText[index] == L'+')
{
k = 0;
- if (!Character::IsDigit(text[index + 1]))
+ if (!Character::IsDigit(pText[index + 1]))
{
return false;
}
while (k < _MIN_PHONE_NUMBER_LENGTH)
{
- if (Character::IsDigit(text[index + j]) || text[index + j] == L'*' || text[index + j] == L'#')
+ if (Character::IsDigit(pText[index + j]) || pText[index + j] == L'*' || pText[index + j] == L'#')
{
k++;
oneHyphen = false;
oneDot = false;
}
- else if (oneHyphen == false && text[index + j] == L'-')
+ else if (oneHyphen == false && pText[index + j] == L'-')
{
oneHyphen = true;
}
- else if (oneDot == false && text[index + j] == L'.')
+ else if (oneDot == false && pText[index + j] == L'.')
{
oneDot = true;
}
- else if (text[index + j] == L' ' || text[index + j] == TEXT_JAPANESE_SPACE || text[index + j] == L'(' || text[index + j] == L')')
+ else if (pText[index + j] == L' ' || pText[index + j] == TEXT_JAPANESE_SPACE || pText[index + j] == L'(' || pText[index + j] == L')')
{
// empty statement
}
linkOffset = index;
while (index < totalLength &&
- (Character::IsDigit(text[index]) || (text[index] == L'*') ||
- (text[index] == L'#') || (text[index] == L'-') ||
- (text[index] == L' ') || (text[index] == TEXT_JAPANESE_SPACE) || (text[index] == L'+') ||
- (text[index] == L'.') || (text[index] == L'(') ||
- (text[index] == L')') || (index == linkOffset && (text[linkOffset] == L'+'))))
+ (Character::IsDigit(pText[index]) || (pText[index] == L'*') ||
+ (pText[index] == L'#') || (pText[index] == L'-') ||
+ (pText[index] == L' ') || (pText[index] == TEXT_JAPANESE_SPACE) || (pText[index] == L'+') ||
+ (pText[index] == L'.') || (pText[index] == L'(') ||
+ (pText[index] == L')') || (index == linkOffset && (pText[linkOffset] == L'+'))))
{
index++;
- if (blankCount == 0 && (text[index] == L' ' || text[index] == TEXT_JAPANESE_SPACE))
+ if (blankCount == 0 && (pText[index] == L' ' || pText[index] == TEXT_JAPANESE_SPACE))
{
blankCount++;
}
- else if (blankCount == 1 && (text[index] == L' ' || text[index] == TEXT_JAPANESE_SPACE))
+ else if (blankCount == 1 && (pText[index] == L' ' || pText[index] == TEXT_JAPANESE_SPACE))
{
blankCount++;
break;
}
- else if (Character::IsDigit(text[index]) || text[index] == L'*' || text[index] == L'#')
+ else if (Character::IsDigit(pText[index]) || pText[index] == L'*' || pText[index] == L'#')
{
blankCount = 0;
}
- else if (text[index] == L'-' && text[index + 1] == L'-')
+ else if (pText[index] == L'-' && pText[index + 1] == L'-')
{
break;
}
- else if (text[index] == L'(' || text[index] == L')')
+ else if (pText[index] == L'(' || pText[index] == L')')
{
break;
}
- else if ((text[index] == L'.' &&
- text[index + 1] == L'.') || (text[index] == L'.' && !Character::IsDigit(text[index + 1])))
+ else if ((pText[index] == L'.' &&
+ pText[index + 1] == L'.') || (pText[index] == L'.' && !Character::IsDigit(pText[index + 1])))
{
break;
}
}
}
- if (text[index - 1] == L' ' || text[index - 1] == TEXT_JAPANESE_SPACE)
+ if (pText[index - 1] == L' ' || pText[index - 1] == TEXT_JAPANESE_SPACE)
{
index -= 1;
- while (text[index] == L' ' || text[index] == TEXT_JAPANESE_SPACE)
+ while (pText[index] == L' ' || pText[index] == TEXT_JAPANESE_SPACE)
{
index--;
}
if (!gpUrlPrefixes)
{
gpUrlPrefixes = new (std::nothrow) ArrayListT <String>;
- SysTryCatch(NID_GRP
- , gpUrlPrefixes != null
- , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_GRP, gpUrlPrefixes != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
r = gpUrlPrefixes->Construct();
- SysTryCatch(NID_GRP
- , r == E_SUCCESS
- , , r, "[%s] Propagated.", GetErrorMessage(r));
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagated.", GetErrorMessage(r));
gpUrlPrefixes->Add(L"www.");
gpUrlPrefixes->Add(L"http://");
if (!gpDomainNames)
{
gpDomainNames = new (std::nothrow) ArrayListT <Tizen::Base::String>;
- SysTryCatch(NID_GRP
- , gpDomainNames != null
- , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_GRP, gpDomainNames != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
r = gpDomainNames->Construct();
- SysTryCatch(NID_GRP
- , r == E_SUCCESS
- , , r, "[%s] Propagated.", GetErrorMessage(r));
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Propagated.", GetErrorMessage(r));
gpDomainNames->Add(L".com");
gpDomainNames->Add(L".net");
}
pTextLink = CreateTextLinkInfo(0, 0, LINK_TYPE_NONE);
- SysTryCatch(NID_GRP
- , pTextLink != null
- , , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_GRP, pTextLink != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
pTextLink->index = -1;
else
{
TextLinkInfo* pNextLink = CreateTextLinkInfo(linkStartIndex, linkLength, linkType);
- SysTryCatch(NID_GRP
- , pNextLink != null,
- r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
+ SysTryCatch(NID_GRP, pNextLink != null,r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
AppendTextLinkInfo(pTextLink, pNextLink);
}
result
TextCutLinkParser::SetCutLinkMask(int mask)
{
- SysTryReturn(NID_GRP
- , LINK_TYPE_NONE <= mask && mask < LINK_TYPE_MAX
+ SysTryReturn(NID_GRP, LINK_TYPE_NONE <= mask && mask < LINK_TYPE_MAX
, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
__linkMask = mask;
TextCutLinkParser::CreateTextLinkInfo(int offset, int length, LinkType linkType)
{
TextLinkInfo* pTextLinkInfo = new (std::nothrow) TextLinkInfo;
- SysTryReturn(NID_GRP
- , pTextLinkInfo != null
- , null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
+ SysTryReturn(NID_GRP, pTextLinkInfo != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
pTextLinkInfo->index = 0;
pTextLinkInfo->srcOffset = offset;
${CMAKE_SOURCE_DIR}/src/graphics/inc
${CMAKE_SOURCE_DIR}/src/graphics/text
${CMAKE_SOURCE_DIR}/src/graphics/effect
+ ${CMAKE_SOURCE_DIR}/src/app/inc
.
./inc
./controls
animations/FUiAnim_VisualElementSurfaceImpl.cpp
animations/FUiAnim_EflNode.cpp
animations/FUiAnim_EflLayer.cpp
+ animations/FUiAnim_EflLayerConfiguration.cpp
animations/FUiAnim_EflVisualElementSurfaceImpl.cpp
animations/FUiAnim_MatrixUtil.cpp
animations/FUiAnimAnimationBase.cpp
FUi_FocusManagerImpl.cpp
FUiKeyboardMap.cpp
FUi_PublicOrientationEvent.cpp
- FUi_ActiveWindowEvent.cpp
FUiTouch.cpp
FUiTouchEventInfo.cpp
FUi_TouchEventInfoImpl.cpp
FloatRectangle
_AccessibilityContainer::GetAbsoluteBounds(void) const
{
- return __pOwner->GetAbsoluteBoundsF();
+ return __pOwner->GetAbsoluteBoundsF(true);
}
void
, __setHintByUser(false)
, __disabledHint(false)
, __updateContents(false)
+ , __publicLabelUpdated(false)
{
}
_AccessibilityElement::~_AccessibilityElement(void)
FloatRectangle
_AccessibilityElement::GetAbsoluteBounds(void) const
{
- FloatRectangle controlAbsBounds = GetParent()->GetOwner().GetAbsoluteBoundsF();
+ FloatRectangle controlAbsBounds = GetParent()->GetOwner().GetAbsoluteBoundsF(true);
FloatRectangle rect(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height);
const_cast<FloatRectangle&>(__absBounds).SetBounds(controlAbsBounds.x+__bounds.x, controlAbsBounds.y+__bounds.y, __bounds.width, __bounds.height);
return rect;
__pValueId[length] = '\0';
}
+void
+_AccessibilityElement::SetPublicLabelUpdate(bool isPublicLabelUpdated)
+{
+ __publicLabelUpdated = isPublicLabelUpdated;
+}
+
+bool
+_AccessibilityElement::IsPublicLabelUpdated(void)
+{
+ return __publicLabelUpdated;
+}
+
}}
_AccessibilityElementImpl::SetLabel(const Tizen::Base::String& label)
{
SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error.");
+ __pCore->SetPublicLabelUpdate(true);
return __pCore->SetLabel(label);
}
void
{
if (controlList.GetAt(i, pControl) == E_SUCCESS)
{
- FloatRectangle rect = pControl->GetAbsoluteBoundsF();
+ FloatRectangle rect = pControl->GetAbsoluteBoundsF(true);
if (rect.x + rect.width <= 0.0f || (rect.x) >= margin)
{
bool inside = false;
pControl = &(pPositionByControlListElement->GetParent()->GetOwner());
while (pControl)
{
- rect = pControl->GetAbsoluteBounds();
+ rect = pControl->GetAbsoluteBounds(true);
if (rect.y >0)
{
break;
_Window* pWindow = _ControlManager::GetInstance()->GetTopVisibleWindow();
if (!(pWindow->IsLayoutChangable()))
{
- Rectangle topWindowAbsBounds = pWindow->GetAbsoluteBounds();
+ Rectangle topWindowAbsBounds = pWindow->GetAbsoluteBounds(true);
pt.x = pt.x + topWindowAbsBounds.x;
pt.y = pt.y + topWindowAbsBounds.y;
}
pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt);
- if (pControl == null || !(pControl->GetAbsoluteBounds().Contains(pt)))
+ if (pControl == null || !(pControl->GetAbsoluteBounds(true).Contains(pt)))
{
return false;
}
_AccessibilityContainer* pAccContainer = pControl->GetAccessibilityContainer();
- while(!(pAccContainer->IsActivated()))
+ _AccessibilityElement* pElement = null;
+ while(pElement == null)
{
+ pElement = pAccContainer->Hit(pt);
+ if(pElement)
+ {
+ break;
+ }
_Control* _pControl = pAccContainer->GetOwner().GetParent();
if (_pControl == null)
{
return false;
}
pAccContainer = _pControl->GetAccessibilityContainer();
- if (pAccContainer == null)
+ if(pAccContainer == null)
{
return false;
}
}
- _AccessibilityElement* pElement = pAccContainer->Hit(pt);
- if (pElement == null)
- {
- return false;
- }
if (__pTargetElement == pElement)
{
_AccessibilityTtsPlayer::Deactivate(void)
{
__initialized = false;
- tts_state_e ttsState = TTS_STATE_READY;
-
- int ttsError = tts_get_state(__ttsHandle, &ttsState);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to get the current state.", GetEngineErrorMessage(ttsError));
- if (ttsState == TTS_STATE_PLAYING || ttsState == TTS_STATE_PAUSED)
- {
- ttsError = tts_stop(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to stop.", GetEngineErrorMessage(ttsError));
- }
if (__activated)
{
- ttsError = tts_unprepare(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to unprepare.", GetEngineErrorMessage(ttsError));
-
- ttsError = tts_unset_utterance_completed_cb(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to unset the utterance completed callback.", GetEngineErrorMessage(ttsError));
-
- ttsError = tts_unset_utterance_started_cb(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to unset the utterance started callback.", GetEngineErrorMessage(ttsError));
-
- ttsError = tts_unset_state_changed_cb(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to unset the state changed callback.", GetEngineErrorMessage(ttsError));
-
- ttsError = tts_unset_error_cb(__ttsHandle);
- SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to unset the error callback.", GetEngineErrorMessage(ttsError));
-
+ int ttsError = TTS_ERROR_NONE;
ttsError = tts_destroy(__ttsHandle);
SysTryLog(NID_UI, ttsError == TTS_ERROR_NONE, "[%s] Failed to destroy.", GetEngineErrorMessage(ttsError));
+++ /dev/null
-//
-// 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_ActiveWindowEvent.cpp
- * @brief This is the implementation for the _ActiveWindowEvent class.
- * @since 2.0
- */
-#include <new>
-#include <FBaseErrors.h>
-#include <FBaseSysLog.h>
-#include "FUi_ActiveWindowEvent.h"
-
-using namespace Tizen::Base;
-using namespace Tizen::Base::Runtime;
-using namespace Tizen::App;
-
-namespace Tizen { namespace Ui
-{
-
-class _ActiveWindowEventArg
- : public Tizen::Base::Runtime::IEventArg
- , public Tizen::Base::Object
-{
-public:
- _ActiveWindowEventArg(unsigned int xid, int pid, char* pAppName);
-
- virtual ~_ActiveWindowEventArg(void);
-
- unsigned int GetWindowId(void) const;
- int GetProcessId(void) const;
- char* GetAppName(void) const;
-
-private:
- _ActiveWindowEventArg(const _ActiveWindowEventArg& rhs);
- _ActiveWindowEventArg& operator =(const _ActiveWindowEventArg& rhs);
-
-private:
- unsigned int __xid;
- int __pid;
- char* __pAppName;
-}; // _ActiveWindowEventArg
-
-_ActiveWindowEventArg::_ActiveWindowEventArg(unsigned int xid, int pid, char* pAppName)
- : __xid(xid)
- , __pid(pid)
- , __pAppName(pAppName)
-{
-}
-
-_ActiveWindowEventArg::~_ActiveWindowEventArg(void)
-{
-}
-
-unsigned int
-_ActiveWindowEventArg::GetWindowId(void) const
-{
- return __xid;
-}
-
-int
-_ActiveWindowEventArg::GetProcessId(void) const
-{
- return __pid;
-}
-
-char*
-_ActiveWindowEventArg::GetAppName(void) const
-{
- return __pAppName;
-}
-
-_ActiveWindowEvent*
-_ActiveWindowEvent::CreateInstanceN(void)
-{
- _ActiveWindowEvent* pActiveWindowEvent = new (std::nothrow) _ActiveWindowEvent();
- SysTryReturn(NID_UI, pActiveWindowEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
- result r = GetLastResult();
- SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- SetLastResult(E_SUCCESS);
-
- return pActiveWindowEvent;
-
-CATCH:
- delete pActiveWindowEvent;
- return null;
-}
-
-IEventArg*
-_ActiveWindowEvent::CreateActiveWindowEventArgN(unsigned int xid, int pid, char* pAppName)
-{
- _ActiveWindowEventArg* pEventArg = new (std::nothrow) _ActiveWindowEventArg(xid, pid, pAppName);
- SysTryReturn(NID_UI, pEventArg, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
- SetLastResult(E_SUCCESS);
-
- return pEventArg;
-}
-
-_ActiveWindowEvent::~_ActiveWindowEvent(void)
-{
-}
-
-void
-_ActiveWindowEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
-{
- _IActiveWindowEventListener* pEventListener = dynamic_cast <_IActiveWindowEventListener*>(&listener);
- SysTryReturnVoidResult(NID_UI, pEventListener, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid.");
-
- const _ActiveWindowEventArg* pArg = dynamic_cast <const _ActiveWindowEventArg*>(&arg);
- SysTryReturnVoidResult(NID_UI, pArg, E_INVALID_ARG, "[E_INVALID_ARG] A specified input parameter is invalid.");
-
- pEventListener->OnActiveWindowChanged(pArg->GetWindowId(), pArg->GetProcessId(), pArg->GetAppName());
-
- SetLastResult(E_SUCCESS);
-}
-
-_ActiveWindowEvent::_ActiveWindowEvent(void)
-{
- result r = _Event::Initialize();
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- SetLastResult(E_SUCCESS);
-}
-
-}} // Tizen::Ui
+++ /dev/null
-//
-// 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_ActiveWindowEvent.h
- * @brief This is the header file for _ActiveWindowEvent class.
- * @since 2.0
- *
- */
-#ifndef _FUI_INTERNAL_ACTIVE_WINDOW_EVENT_H_
-#define _FUI_INTERNAL_ACTIVE_WINDOW_EVENT_H_
-
-#include <FBaseResult.h>
-#include <FBaseRt_Event.h>
-#include <FApp_IActiveWindowEventListener.h>
-
-namespace Tizen { namespace Ui
-{
-class _ActiveWindowEvent
- : public Tizen::Base::Runtime::_Event
-{
-public:
- static _ActiveWindowEvent* CreateInstanceN(void);
- static Tizen::Base::Runtime::IEventArg* CreateActiveWindowEventArgN(unsigned int xid, int pid, char* pAppName);
-
- virtual ~_ActiveWindowEvent(void);
-
-private:
- virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
-
- _ActiveWindowEvent(void);
-
- _ActiveWindowEvent(const _ActiveWindowEvent& rhs);
- _ActiveWindowEvent& operator =(const _ActiveWindowEvent& rhs);
-}; // _ActiveWindowEvent
-
-}} // Tizen::Ui
-
-#endif // _FUI_INTERNAL_ACTIVE_WINDOW_EVENT_H_
namespace
{
-const int _CLIPBOARD_ITEM_MAX = 12;
-const int _CBHM_ITEM_MAX = 12;
+const int _CLIPBOARD_ITEM_MAX = 20;
+const int _CBHM_ITEM_MAX = 20;
const String _CLIPBOARD_DEFAULT_PATH = L"/tmp/clipboard/clipboard_";
const String _CLIPBOARD_DEFAULT_EXTENSION = L".png";
} // Anonymous
}
result
-_Clipboard::ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener &listener)
+_Clipboard::ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener &listener, bool internal)
{
- SysTryReturn(NID_UI, IsPopupVisible() == false, E_INVALID_OPERATION, E_INVALID_OPERATION,
- "[E_INVALID_OPERATION] The popup is already shown.");
+ if (internal == false)
+ {
+ SysTryReturn(NID_UI, IsPopupVisible() == false, E_INVALID_OPERATION, E_INVALID_OPERATION,
+ "[E_INVALID_OPERATION] The popup is already shown.");
+ }
result r = E_SUCCESS;
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
+ if (internal == true)
+ {
+ __pPublicEvent->RemoveListener(listener);
+ }
r = __pPublicEvent->AddListener(listener);
SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
Tizen::Base::Collection::IList* RetrieveItemsN(unsigned long dataTypes);
const _ClipboardItem* RetrieveLatestItemN(unsigned long dataTypes);
- result ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener &listener);
+ result ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener &listener, bool internal = false);
result HidePopup(void);
bool IsPopupVisible(void);
bool
_Control::OnFocusGained(const _Control& source)
{
- bool isfocusMode = _FocusManagerImpl::GetInstance()->IsFocusModeStateEnabled();
- if (isfocusMode)
+ bool isFocusMode = _FocusManagerImpl::GetInstance()->IsFocusModeStateEnabled();
+ bool isFocusalbeControl = _FocusManagerImpl::GetInstance()->IsFocusable(this);
+ if (isFocusMode && isFocusalbeControl)
{
DrawFocus();
}
{
if (__pFocusVisualElement)
{
- __pFocusVisualElement.reset();
+ __pFocusVisualElement->SetShowState(false);
}
return false;
}
}
void
+_Control::InvalidateHierarchyAbsoluteBounds(void)
+{
+ struct _Visitor
+ : public Visitor
+ {
+ virtual VisitType Visit(_Control& control)
+ {
+ control.__needRecalcAbsBounds = true;
+ control.__needRecalcAbsBoundsF = true;
+
+ return VISIT_DOWNWARD;
+ }
+ };
+
+ _Visitor visitor;
+ Accept(visitor);
+}
+
+void
_Control::Draw(bool recursive)
{
ClearLastResult();
ClearLastResult();
_VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(*GetVisualElement());
- result r = pImpl->SetZOrderGroup(::GetZOrderGroupOfVisualElement(layer));
+ result r = pImpl->SetZOrderGroup(GetZOrderGroupOfVisualElement(layer));
__layer = layer;
SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
{
child.SetParent(this);
child.InvalidateHierarchyRootWindow();
+ child.InvalidateHierarchyAbsoluteBounds();
FloatRectangle floatBounds(child.GetBoundsF().x, child.GetBoundsF().y, child.GetBoundsF().width, child.GetBoundsF().height);
{
if (__pFocusVisualElement)
{
- __pFocusVisualElement.reset();
+ __pFocusVisualElement->SetShowState(false);
}
}
ClearLastResult();
result r = E_SUCCESS;
- SysTryReturn(NID_UI,
- child.GetParent() == this, E_INVALID_ARG,
- E_INVALID_ARG, "[E_INVALID_ARG] Not my child.");
+ if (child.GetParent() != this)
+ {
+ SetLastResult(E_INVALID_ARG);
+ return E_INVALID_ARG;
+ }
if (IsAttachedToMainTree())
{
}
}
- SysLog(NID_UI, "%d children are not detached from this container.", notDetachedChildCount);
+ if (notDetachedChildCount > 0)
+ {
+ SysLog(NID_UI, "%d children are not detached from this container.", notDetachedChildCount);
+ }
}
ClearLastResult();
return false;
}
+void
+_Control::SetFocusWindowActivationChecked(bool isChecked)
+{
+ __isFocusWindowActivationChecked = isChecked;
+}
+
+bool
+_Control::IsFocusWindowActivationChecked(void)
+{
+ return __isFocusWindowActivationChecked;
+}
+
result
_Control::SetFocused(bool on)
{
{
ClearLastResult();
- SysTryReturn(NID_UI, IsAttachedToMainTree(), false, E_SYSTEM, "[E_SYSTEM] This control should be attached to the main tree.");
+ if (IsAttachedToMainTree() == false)
+ {
+ SetLastResult(E_SYSTEM);
+ return false;
+ }
struct _Visitor
: public Visitor
}
}
+ if (moved || resized)
+ {
+ InvalidateHierarchyAbsoluteBounds();
+ }
+
ClearLastResult();
return E_SUCCESS;
}
}
Rectangle
-_Control::GetAbsoluteBounds(void) const
+_Control::GetAbsoluteBounds(bool recalcAlways) const
{
+ if (!recalcAlways && !__needRecalcAbsBounds)
+ {
+ return __absoluteBounds;
+ }
+
Point accumPoint;
Rectangle absoluteBounds;
Rectangle clientBounds;
absoluteBounds.width = __bounds.width;
absoluteBounds.height = __bounds.height;
+ const_cast<_Control*>(this)->__absoluteBounds = absoluteBounds;
+ const_cast<_Control*>(this)->__needRecalcAbsBounds = false;
+
return absoluteBounds;
}
FloatRectangle
-_Control::GetAbsoluteBoundsF(void) const
+_Control::GetAbsoluteBoundsF(bool recalcAlways) const
{
+ if (!recalcAlways && !__needRecalcAbsBoundsF)
+ {
+ return __absoluteBoundsF;
+ }
+
FloatPoint accumPoint;
FloatRectangle absoluteBounds;
FloatRectangle clientBounds;
absoluteBounds.width = __bounds.width;
absoluteBounds.height = __bounds.height;
+ const_cast<_Control*>(this)->__absoluteBoundsF = absoluteBounds;
+ const_cast<_Control*>(this)->__needRecalcAbsBoundsF = false;
+
return absoluteBounds;
}
// E_SYSTEM
_Control::_Control(void)
: __needRecalcRootWindow(true)
+ , __needRecalcAbsBounds(true)
+ , __needRecalcAbsBoundsF(true)
, __pRootWindow(null)
, __name(L"")
, __pParent(null)
, __bounds(0.0f, 0.0f, 0.0f, 0.0f)
, __contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __clientBounds(0.0f, 0.0f, 0.0f, 0.0f)
- , __absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f)
+ , __absoluteBounds(0, 0, 0, 0)
+ , __absoluteBoundsF(0.0f, 0.0f, 0.0f, 0.0f)
, __invalidatedBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __minSize(FloatDimension(0.0f, 0.0f))
, __maxSize(FloatDimension(MAX_LENGTH, MAX_LENGTH))
, __isCalledGetCanvasN(false)
, __isFocusMode(false)
, __isNavigatable(true)
+ , __isFocusWindowActivationChecked(false)
, __pVisualElementContentProvider(null)
, __pVisualElement(null)
, __pVisualElementEventListener(null)
void
_Control::OnDrawFocus(void)
{
- unique_ptr<VisualElement, _VisualElementDeleter> pFocusVisualElement (new (std::nothrow) VisualElement, _VisualElementDeleter());
- SysTryReturn(NID_UI, pFocusVisualElement, , E_SYSTEM, "[E_SYSTEM] System error");
+ if (__pFocusVisualElement.get() == null)
+ {
+ unique_ptr<VisualElement, _VisualElementDeleter> pFocusVisualElement (new (std::nothrow) VisualElement, _VisualElementDeleter());
+ SysTryReturn(NID_UI, pFocusVisualElement, , E_SYSTEM, "[E_SYSTEM] System error");
- result r = pFocusVisualElement->Construct();
- SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error");
+ result r = pFocusVisualElement->Construct();
+ SysTryReturn(NID_UI, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] System error");
- __pFocusVisualElement.reset(pFocusVisualElement.release());
- __pFocusVisualElement->SetImplicitAnimationEnabled(false);
- __pFocusVisualElement->SetShowState(true);
+ _VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(*pFocusVisualElement);
+ SysTryReturn(NID_UI, pImpl, , E_SYSTEM, "[E_SYSTEM] pImpl System error");
+ pImpl->SetZOrderGroup(GetZOrderGroupOfVisualElement(_CONTROL_LAYER_SYSTEM));
- _VisualElement* pControVisualElement = this->GetVisualElement();
- pControVisualElement->AttachChild(*__pFocusVisualElement);
+ __pFocusVisualElement.reset(pFocusVisualElement.release());
+ __pFocusVisualElement->SetImplicitAnimationEnabled(false);
- if (__pFocusVisualElement)
- {
- Rectangle rectangle = GetBounds();
- __pFocusVisualElement->SetBounds(FloatRectangle(0, 0, rectangle.width, rectangle.height));
- unique_ptr<Canvas>pCanvas(__pFocusVisualElement->GetCanvasN());
- if (pCanvas)
- {
- pCanvas->SetBackgroundColor(0x55555555);
- pCanvas->Clear();
- }
- Color contentHighlightedColor;
- GET_COLOR_CONFIG(FOCUSUI::CONTENT_BG_HIGHLIGHTED, contentHighlightedColor);
- Bitmap* pBitmap = null;
- Bitmap* pTempBitmap = null;
- result r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
- pBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentHighlightedColor);
-
- if (pBitmap)
+ _VisualElement* pControVisualElement = this->GetVisualElement();
+ pControVisualElement->AttachChild(*__pFocusVisualElement);
+
+
+ if (__pFocusVisualElement)
{
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
+ Rectangle rectangle = GetBounds();
+ __pFocusVisualElement->SetBounds(FloatRectangle(0, 0, rectangle.width, rectangle.height));
+ unique_ptr<Canvas>pCanvas(__pFocusVisualElement->GetCanvasN());
+ if (pCanvas)
{
- if (pCanvas)
- {
- r = pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap);
- }
+ pCanvas->SetBackgroundColor(0x55555555);
+ pCanvas->Clear();
}
- else
+ Color contentHighlightedColor;
+ GET_COLOR_CONFIG(FOCUSUI::CONTENT_BG_HIGHLIGHTED, contentHighlightedColor);
+ Bitmap* pBitmap = null;
+ Bitmap* pTempBitmap = null;
+ result r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
+ pBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentHighlightedColor);
+
+ if (pBitmap)
{
- if (pCanvas)
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
{
- r = pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap);
+ if (pCanvas)
+ {
+ r = pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap);
+ }
+ }
+ else
+ {
+ if (pCanvas)
+ {
+ r = pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, rectangle.width, rectangle.height), *pBitmap);
+ }
}
}
+
}
- __pFocusVisualElement->SetShowState(true);
}
+ __pFocusVisualElement->SetShowState(true);
}
void
const _ControlHandle controlHandle = pControlImpl->GetCore().GetHandle();
- TouchEventInfo publicTouchInfo;
+ TouchEventInfo publicTouchInfo;
- _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo);
+ _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo);
SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
- publicTouchInfo.Construct(*pEventArg);
+ publicTouchInfo.Construct(*pEventArg);
- if (pEventArg)
- {
- delete pEventArg;
- pEventArg = null;
- }
+ if (pEventArg)
+ {
+ delete pEventArg;
+ pEventArg = null;
+ }
isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchMoved(control, publicTouchInfo);
- if (isFiltered)
- {
- return true;
- }
+ if (isFiltered)
+ {
+ return true;
+ }
_Control* pControl = _ControlManager::GetInstance()->GetObject(controlHandle);
SysTryReturn(NID_UI, pControl, true, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Target control is deleted.");
- }
+ }
return __impl.CallOnTouchMoved(source, touchInfo);
}
const _ControlHandle controlHandle = pControlImpl->GetCore().GetHandle();
- TouchEventInfo publicTouchInfo;
+ TouchEventInfo publicTouchInfo;
- _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo);
+ _TouchEventArg* pEventArg = GetTouchEventArgN(touchInfo);
SysTryReturn(NID_UI, pEventArg, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
- publicTouchInfo.Construct(*pEventArg);
+ publicTouchInfo.Construct(*pEventArg);
- if (pEventArg)
- {
- delete pEventArg;
- pEventArg = null;
- }
+ if (pEventArg)
+ {
+ delete pEventArg;
+ pEventArg = null;
+ }
isFiltered = __impl.__pPublicPropagatedTouchEventListener->OnTouchCanceled(control, publicTouchInfo);
- if (isFiltered)
- {
- return true;
- }
+ if (isFiltered)
+ {
+ return true;
+ }
_Control* pControl = _ControlManager::GetInstance()->GetObject(controlHandle);
SysTryReturn(NID_UI, pControl, true, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Target control is deleted.");
- }
+ }
return __impl.CallOnTouchCanceled(source, touchInfo);
}
Control& control = static_cast<Control&>(pControlImpl->GetPublic());
- KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
- static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
+ KeyEventInfo keyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()), static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
- isFiltered = __impl.__pPublicPropagatedKeyEventListener->TranslateKeyEventInfo(control, *pKeyEventInfo);
+ isFiltered = __impl.__pPublicPropagatedKeyEventListener->TranslateKeyEventInfo(control, keyEventInfo);
if (isFiltered)
{
- keyInfo.SetKeyCode(static_cast<_KeyCode>(pKeyEventInfo->GetKeyCode()));
- keyInfo.SetKeyModifier(static_cast<_KeyModifier>(pKeyEventInfo->GetKeyModifier()));
+ keyInfo.SetKeyCode(static_cast<_KeyCode>(keyEventInfo.GetKeyCode()));
+ keyInfo.SetKeyModifier(static_cast<_KeyModifier>(keyEventInfo.GetKeyModifier()));
return true;
}
}
bool isFiltered = false;
- //SysLog(NID_UI, ">>> [impl.1] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
-
if (__impl.__pPublicPropagatedKeyEventListener != null)
{
_ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData());
Control& control = static_cast<Control&>(pControlImpl->GetPublic());
- KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
- static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
+ KeyEventInfo keyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()), static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
- //SysLog(NID_UI, ">>> [impl.2] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
-
- isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyPressed(control, *pKeyEventInfo);
- if (isFiltered)
- {
- return true;
- }
+ isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyPressed(control, keyEventInfo);
+ if (isFiltered)
+ {
+ return true;
}
-
- //SysLog(NID_UI, ">>> [impl.3] OnKeyPressed(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
+ }
if (&source == &__core)
{
bool isFiltered = false;
- //SysLog(NID_UI, ">>> [impl.1] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
-
if (__impl.__pPublicPropagatedKeyEventListener != null)
{
_ControlImpl* pControlImpl = static_cast<_ControlImpl*>(source.GetUserData());
Control& control = static_cast<Control&>(pControlImpl->GetPublic());
- KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
- static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
-
- //SysLog(NID_UI, ">>> [impl.2] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
+ KeyEventInfo keyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()), static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
- isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyReleased(control, *pKeyEventInfo);
- if (isFiltered)
- {
- return true;
- }
+ isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnKeyReleased(control, keyEventInfo);
+ if (isFiltered)
+ {
+ return true;
}
-
- //SysLog(NID_UI, ">>> [impl.3] OnKeyReleased(%d, %d)", keyInfo.GetKeyCode(), keyInfo.GetKeyModifier());
+ }
if (&source == &__core)
{
Control& control = static_cast<Control&>(pControlImpl->GetPublic());
- KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
- static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
+ KeyEventInfo keyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()), static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
- isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyPressed(control, *pKeyEventInfo);
+ isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyPressed(control, keyEventInfo);
if (isFiltered)
{
return true;
Control& control = static_cast<Control&>(pControlImpl->GetPublic());
- KeyEventInfo* pKeyEventInfo = new (std::nothrow) KeyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()),
- static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
+ KeyEventInfo keyEventInfo(static_cast<KeyCode>(keyInfo.GetKeyCode()), static_cast<KeyModifier>(keyInfo.GetKeyModifier()));
- isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyReleased(control, *pKeyEventInfo);
+ isFiltered = __impl.__pPublicPropagatedKeyEventListener->OnPreviewKeyReleased(control, keyEventInfo);
if (isFiltered)
{
return true;
result
_ControlImpl::Draw(bool recursive)
{
- SysTryReturn(NID_UI,
- IsAttachedToMainTree(), E_INVALID_OPERATION,
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] The control should be attached to the main tree.");
+ if (IsAttachedToMainTree() == false)
+ {
+ SetLastResult(E_INVALID_OPERATION);
+ return E_INVALID_OPERATION;
+ }
GetCore().Draw(recursive);
void
_ControlImpl::Invalidate(bool recursive)
{
- SysTryReturnVoidResult(NID_UI,
- IsAttachedToMainTree(),
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] The control should be attached to the main tree.");
+ if (IsAttachedToMainTree() == false)
+ {
+ SetLastResult(E_INVALID_OPERATION);
+ return;
+ }
GetCore().Invalidate(recursive);
}
void
_ControlImpl::Invalidate(const Rectangle& rect)
{
- SysTryReturnVoidResult(NID_UI,
- IsAttachedToMainTree(),
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] The control should be attached to the main tree.");
+ if (IsAttachedToMainTree() == false)
+ {
+ SetLastResult(E_INVALID_OPERATION);
+ return;
+ }
GetCore().Invalidate(rect);
}
void
_ControlImpl::Invalidate(const FloatRectangle& rect)
{
- SysTryReturnVoidResult(NID_UI,
- IsAttachedToMainTree(),
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] The control should be attached to the main tree.");
+ if (IsAttachedToMainTree() == false)
+ {
+ SetLastResult(E_INVALID_OPERATION);
+ return;
+ }
GetCore().Invalidate(rect);
}
if ((IsMovable() == false) && (IsResizable() == false))
{
- SysLog(NID_UI, "Control is not animatable.\n");
+ SysLog(NID_UI, "Control is not animatable.");
+ return null;
+ }
+
+ const _WindowImpl* pWindowImpl = dynamic_cast <const _WindowImpl*>(this);
+ if (pWindowImpl != null)
+ {
+ SysLog(NID_UI, "Window is not animatable.");
return null;
}
#include <FBaseSysLog.h>
#include <FGrpRectangle.h>
#include <FApp_AppInfo.h>
-#include <FAppPkg_PackageInfoImpl.h>
+#include <FApp_CoordinateInfo.h>
#include <FGrp_Screen.h>
#include <FGrp_FontImpl.h>
#include <FSys_SettingInfoImpl.h>
using namespace std;
using namespace Tizen::App;
-using namespace Tizen::App::Package;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
return __objectManager.GetObjectCount();
}
-result
-_ControlManager::GetAppCoordinateSystem(bool& isCoordinateSystemLogical, int& logicalCoordinateSystemInt, _BaseScreenSize& logicalBaseScreenSize)
-{
- _PackageInfoImpl infoImpl;
- {
- String subAppId(_AppInfo::GetPackageId());
-
- result r = infoImpl.Construct(subAppId);
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- String baseScreenSize(null);
- String coordinateSystem(null);
- String logicalCoordinate(null);
-
- result r = infoImpl.GetUiScalabilityInfo(baseScreenSize, coordinateSystem, logicalCoordinate);
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- if (coordinateSystem.Equals(L"Physical", false))
- {
- isCoordinateSystemLogical = false;
- logicalCoordinateSystemInt = 0;
- logicalBaseScreenSize = BASE_SCREEN_SIZE_DEFAULT;
-
- return E_SUCCESS;
- }
-
- //Logical Resolution
- r = Integer::Parse(logicalCoordinate, logicalCoordinateSystemInt);
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- // BaseScreenSize
- if (baseScreenSize.Equals(L"Large", false))
- {
- logicalBaseScreenSize = BASE_SCREEN_SIZE_LARGE;
- }
- else // temp
- {
- logicalBaseScreenSize = BASE_SCREEN_SIZE_NORMAL;
- }
-
- return r;
-}
-
bool
_ControlManager::IsCoordinateSystemLogical(void) const
{
, __pClipboardOwner(null)
, __pControlManagerEventListenerList(new (std::nothrow) LinkedListT<_IControlManagerEventListener*>)
{
- result r = GetAppCoordinateSystem(__isCoordinateSystemLogical, __logicalCoordinateSystem, __logicalBaseScreenSize);
+ result r = _CoordinateInfo::GetAppCoordinateSystem(__isCoordinateSystemLogical, __logicalCoordinateSystem, __logicalBaseScreenSize);
SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] System error occurred.");
Dimension deviceResolution = CoordinateSystem::GetPhysicalResolution();
if (GetLastResult() == E_SUCCESS)
{
__pFocusControl = const_cast<_Control*>(&control);
- _UiFocusEvent event(control.GetHandle(), FOCUS_GAINED);
- _UiEventManager::GetInstance()->SendEvent(event);
+ if (__pFocusControl->IsFocusWindowActivationChecked() == false || IsFrameActivated() == true)
+ {
+ _UiFocusEvent event(control.GetHandle(), FOCUS_GAINED);
+ _UiEventManager::GetInstance()->SendEvent(event);
+ }
}
}
else
case DATA_BINDING_DATA_TYPE_INTEGER:
switch (sourceType) // INTEGER from BOOLEAN, DOUBLE, FLOAT, INTEGER, LONG, STRING
{
- case DATA_BINDING_DATA_TYPE_BOOLEAN:
- {
- Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
{
- return false;
+ Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool()?1:0;
+ return true;
}
- pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool()?1:0;
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_FLOAT:
- {
- Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT:
{
- return false;
+ Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToInt();
+ return true;
}
- pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToInt();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_INTEGER:
- {
- Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_INTEGER:
{
- return false;
+ Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToInt();
+ return true;
}
- pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToInt();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_LONG:
- {
- Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
{
- return false;
+ Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToInt();
+ return true;
}
- pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToInt();
- return true;
+ break;
+ case DATA_BINDING_DATA_TYPE_COLOR:
+ {
+ Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Color&>(const_cast<Object&>(sourceData)).GetRGB32();
+ return true;
+ }
+ break;
+ default:
+ {
+ return false;
+ }\r
}
break;
- case DATA_BINDING_DATA_TYPE_COLOR:
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ switch (sourceType)
{
- Tizen::Base::Integer* pTarget = dynamic_cast<Tizen::Base::Integer*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_INTEGER:
+ {
+ Boolean* pTarget = dynamic_cast<Boolean*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).CompareTo(0) == 0 ? false:true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ {
+ Boolean* pTarget = dynamic_cast<Boolean*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)) == true ?true:false;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT:
+ {
+ Boolean* pTarget = dynamic_cast<Boolean*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).CompareTo(0.0f) == 0 ?false:true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_DOUBLE:
+ {
+ Boolean* pTarget = dynamic_cast<Boolean*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Double&>(const_cast<Object&>(sourceData)).CompareTo(0.0f) == 0 ?false:true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
+ {
+ Boolean* pTarget = dynamic_cast<Boolean*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).CompareTo(0) == 0 ? false:true;
+ }
+ break;
+ default:
{
return false;
}
- pTarget->value = static_cast<Color&>(const_cast<Object&>(sourceData)).GetRGB32();
- return true;
- }
- break;
- default:
- return false;
}
break;
case DATA_BINDING_DATA_TYPE_FLOAT:
switch (sourceType) // FLOAT from DOUBLE, FLOAT, INTEGER, LONG, STRING
{
- case DATA_BINDING_DATA_TYPE_BOOLEAN:
- {
- Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
{
- return false;
+ Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1.0 : 0.0;
+ return true;
}
- pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1.0 : 0.0;
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_FLOAT:
- {
- Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT:
{
- return false;
+ Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToFloat();
+ return true;
}
- pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToFloat();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_INTEGER:
- {
- Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_INTEGER:
{
- return false;
+ Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToFloat();
+ return true;
}
- pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToFloat();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_LONG:
- {
- Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
+ {
+ Tizen::Base::Float* pTarget = dynamic_cast<Tizen::Base::Float*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToFloat();
+ return true;
+ }
+ break;
+ default:
{
return false;
}
- pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToFloat();
- return true;
- }
- break;
- default:
- return false;
}
break;
case DATA_BINDING_DATA_TYPE_DOUBLE:
switch (sourceType) // DOUBLE from DOUBLE, FLOAT, INTEGER, LONG, STRING
{
- case DATA_BINDING_DATA_TYPE_DOUBLE:
- {
- Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_DOUBLE:
{
- return false;
+ Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Double&>(const_cast<Object&>(sourceData)).ToDouble();
+ return true;
}
- pTarget->value = static_cast<Double&>(const_cast<Object&>(sourceData)).ToDouble();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_FLOAT:
- {
- Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT:
{
- return false;
+ Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToDouble();
+ return true;
}
- pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToDouble();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_INTEGER:
- {
- Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_INTEGER:
{
- return false;
+ Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToDouble();
+ return true;
}
- pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToDouble();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_LONG:
- {
- Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
{
- return false;
+ Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToDouble();
+ return true;
}
- pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToDouble();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_BOOLEAN:
- {
- Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ {
+ Tizen::Base::Double* pTarget = dynamic_cast<Tizen::Base::Double*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1.0 : 0.0;
+ return true;
+ }
+ break;
+ default:
{
return false;
}
- pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1.0 : 0.0;
- return true;
- }
- break;
- default:
- return false;
}
break;
case DATA_BINDING_DATA_TYPE_LONG:
switch (sourceType) // LONG from DOUBLE, FLOAT, INTEGER, LONG, STRING
{
- case DATA_BINDING_DATA_TYPE_FLOAT:
- {
- Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_FLOAT:
{
- return false;
- }
- pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToLong();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_INTEGER:
- {
- Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
- if(!pTarget)
+ Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Float&>(const_cast<Object&>(sourceData)).ToLong();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_INTEGER:
{
- return false;
+ Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToLong();
+ return true;
}
- pTarget->value = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToLong();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_LONG:
- {
- Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
{
- return false;
+ Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToLong();
+ return true;
}
- pTarget->value = static_cast<Long&>(const_cast<Object&>(sourceData)).ToLong();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_BOOLEAN:
- {
- Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ {
+ Tizen::Base::Long* pTarget = dynamic_cast<Tizen::Base::Long*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1 : 0;
+ return true;
+ }
+ break;
+ default:
{
return false;
}
- pTarget->value = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToBool() ? 1 : 0;
- return true;
- }
- break;
- default:
- return false;
}
break;
case DATA_BINDING_DATA_TYPE_STRING:
switch (sourceType) // STRING from DOUBLE, FLOAT, INTEGER, LONG, STRING
{
- case DATA_BINDING_DATA_TYPE_DOUBLE:
- {
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_DOUBLE:
{
- return false;
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<Double&>(const_cast<Object&>(sourceData)).ToString();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<Float&>(const_cast<Object&>(sourceData)).ToString();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_INTEGER:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToString();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_LONG:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<Long&>(const_cast<Object&>(sourceData)).ToString();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_STRING:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<String&>(const_cast<Object&>(sourceData));
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ *pTarget = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToString();
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_COLOR:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+ r= pTarget->Append(L"#");
+ if(r != E_SUCCESS)
+ {
+ return false;
+ }
+ wchar_t tempString[] = L"XXXXXXXX";
+ swprintf(tempString, (sizeof(tempString) / sizeof(wchar_t)), L"%X",static_cast<Color &>(const_cast<Object&>(sourceData)).GetRGB32());
+ r= pTarget->Append(tempString);
+ if(r != E_SUCCESS)
+ {
+ return false;
+ }
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_DIMENSION:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ Dimension* pDimension = &static_cast<Dimension&>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"width:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pDimension->width);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", height:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pDimension->height);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_POINT:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ Point* pPoint = &static_cast<Point &>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"x:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pPoint->x);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", y:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pPoint->y);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_RECTANGLE:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ Rectangle* pRectangle = &static_cast<Rectangle &>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"x:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->x);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", y:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->y);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+
+ r = pString->Append(L", width:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->width);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+
+ r = pString->Append(L", height:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->height);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
+ }
+ case DATA_BINDING_DATA_TYPE_FLOAT_DIMENSION:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ FloatDimension* pDimension = &static_cast<FloatDimension&>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"width:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pDimension->width);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", height:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pDimension->height);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_POINT:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ FloatPoint* pPoint = &static_cast<FloatPoint &>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"x:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pPoint->x);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", y:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pPoint->y);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
+ }
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
+ {
+ Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->Clear();
+
+ String* pString = new (std::nothrow) String(L"");
+ SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
+
+ FloatRectangle* pRectangle = &static_cast<FloatRectangle &>(const_cast<Object&>(sourceData));
+ r = pString->Append(L"x:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->x);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", y:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->y);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(L", width:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->width);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+
+ r = pString->Append(L", height:");
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ r = pString->Append(pRectangle->height);
+ if(r != E_SUCCESS)
+ {
+ delete pString;
+ return false;
+ }
+ *pTarget = *pString;
+ delete pString;
+ return true;
}
- *pTarget = static_cast<Double&>(const_cast<Object&>(sourceData)).ToString();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_FLOAT:
- {
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
+ default:
{
return false;
}
- *pTarget = static_cast<Float&>(const_cast<Object&>(sourceData)).ToString();
- return true;
}
break;
- case DATA_BINDING_DATA_TYPE_INTEGER:
+ case DATA_BINDING_DATA_TYPE_COLOR:
+ if (sourceType == DATA_BINDING_DATA_TYPE_COLOR)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ Color* pTarget = dynamic_cast<Color*>(&destinationData);
if(!pTarget)
{
return false;
}
- *pTarget = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToString();
+ *pTarget = static_cast<Color&>(const_cast<Object&>(sourceData));
return true;
}
- break;
- case DATA_BINDING_DATA_TYPE_LONG:
+ else if (sourceType == DATA_BINDING_DATA_TYPE_INTEGER)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ Color* pTarget = dynamic_cast<Color*>(&destinationData);
if(!pTarget)
{
return false;
}
- *pTarget = static_cast<Long&>(const_cast<Object&>(sourceData)).ToString();
+ *pTarget = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToInt();
return true;
}
- break;
- case DATA_BINDING_DATA_TYPE_STRING:
+ else
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
- {
- return false;
- }
- *pTarget = static_cast<String&>(const_cast<Object&>(sourceData));
- return true;
+ return false;
}
break;
- case DATA_BINDING_DATA_TYPE_BOOLEAN:
+ case DATA_BINDING_DATA_TYPE_POINT:
+ switch (sourceType)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
+ case DATA_BINDING_DATA_TYPE_POINT:
{
- return false;
+ Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetPosition(static_cast<Point&>(const_cast<Object&>(sourceData)).x, static_cast<Point&>(const_cast<Object&>(sourceData)).y);
+ return true;
}
- *pTarget = static_cast<Boolean&>(const_cast<Object&>(sourceData)).ToString();
- return true;
- }
- break;
- case DATA_BINDING_DATA_TYPE_COLOR:
- {
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_POINT:
{
- return false;
+ Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetPosition(static_cast<FloatPoint&>(const_cast<Object&>(sourceData)).x, static_cast<FloatPoint&>(const_cast<Object&>(sourceData)).y);
+ return true;
}
- pTarget->Clear();
- r= pTarget->Append(L"#");
- if(r != E_SUCCESS)
+ break;
+ case DATA_BINDING_DATA_TYPE_RECTANGLE:
{
- return false;
+ Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetPosition(static_cast<Rectangle&>(const_cast<Object&>(sourceData)).x, static_cast<Rectangle&>(const_cast<Object&>(sourceData)).y);
+ return true;
}
- wchar_t tempString[] = L"XXXXXXXX";
- swprintf(tempString, (sizeof(tempString) / sizeof(wchar_t)), L"%X",static_cast<Color &>(const_cast<Object&>(sourceData)).GetRGB32());
- r= pTarget->Append(tempString);
- if(r != E_SUCCESS)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
{
- return false;
+ Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetPosition(static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).x, static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).y);
+ return true;
}
- return true;
+ break;
+ default:
+ return false;
}
break;
- case DATA_BINDING_DATA_TYPE_DIMENSION:
+ case DATA_BINDING_DATA_TYPE_RECTANGLE:
+ if (sourceType == DATA_BINDING_DATA_TYPE_RECTANGLE)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ Rectangle* pTarget = dynamic_cast<Rectangle*>(&destinationData);
if(!pTarget)
{
return false;
}
- pTarget->Clear();
-
- String* pString = new (std::nothrow) String(L"");
- SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
-
- Dimension* pDimension = &static_cast<Dimension&>(const_cast<Object&>(sourceData));
- r = pString->Append(L"width:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pDimension->width);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(L", height:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pDimension->height);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- *pTarget = *pString;
- delete pString;
+ pTarget->SetBounds(static_cast<Rectangle&>(const_cast<Object&>(sourceData)).x, static_cast<Rectangle&>(const_cast<Object&>(sourceData)).y, static_cast<Rectangle&>(const_cast<Object&>(sourceData)).width, static_cast<Rectangle&>(const_cast<Object&>(sourceData)).height);
return true;
}
- break;
- case DATA_BINDING_DATA_TYPE_POINT:
+ else if (sourceType == DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
+ Rectangle* pTarget = dynamic_cast<Rectangle*>(&destinationData);
if(!pTarget)
{
return false;
}
- pTarget->Clear();
-
- String* pString = new (std::nothrow) String(L"");
- SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
-
- Point* pPoint = &static_cast<Point &>(const_cast<Object&>(sourceData));
- r = pString->Append(L"x:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pPoint->x);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(L", y:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pPoint->y);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- *pTarget = *pString;
- delete pString;
+ pTarget->SetBounds(static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).x, static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).y, static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).width, static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).height);
return true;
}
+ else
+ {
+ return false;
+ }
break;
- case DATA_BINDING_DATA_TYPE_RECTANGLE:
+ case DATA_BINDING_DATA_TYPE_DIMENSION:
+ switch (sourceType)
{
- Tizen::Base::String* pTarget = dynamic_cast<Tizen::Base::String*>(&destinationData);
- if(!pTarget)
- {
- return false;
- }
- pTarget->Clear();
-
- String* pString = new (std::nothrow) String(L"");
- SysTryReturn(NID_UI, pString, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed.");
-
- Rectangle* pRectangle = &static_cast<Rectangle &>(const_cast<Object&>(sourceData));
- r = pString->Append(L"x:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pRectangle->x);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(L", y:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pRectangle->y);
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
-
- r = pString->Append(L", width:");
- if(r != E_SUCCESS)
- {
- delete pString;
- return false;
- }
- r = pString->Append(pRectangle->width);
- if(r != E_SUCCESS)
+ case DATA_BINDING_DATA_TYPE_DIMENSION:
{
- delete pString;
- return false;
+ Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetSize(static_cast<Dimension&>(const_cast<Object&>(sourceData)).width, static_cast<Dimension&>(const_cast<Object&>(sourceData)).height);
+ return true;
}
-
- r = pString->Append(L", height:");
- if(r != E_SUCCESS)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_DIMENSION:
{
- delete pString;
- return false;
+ Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetSize(static_cast<FloatDimension&>(const_cast<Object&>(sourceData)).width, static_cast<FloatDimension&>(const_cast<Object&>(sourceData)).height);
+ return true;
}
- r = pString->Append(pRectangle->height);
- if(r != E_SUCCESS)
+ break;
+ case DATA_BINDING_DATA_TYPE_RECTANGLE:
{
- delete pString;
- return false;
+ Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetSize(static_cast<Rectangle&>(const_cast<Object&>(sourceData)).width, static_cast<Rectangle&>(const_cast<Object&>(sourceData)).height);
+ return true;
}
- *pTarget = *pString;
- delete pString;
- return true;
- }
- default:
- return false;
- }
- break;
- case DATA_BINDING_DATA_TYPE_COLOR:
- if (sourceType == DATA_BINDING_DATA_TYPE_COLOR)
- {
- Color* pTarget = dynamic_cast<Color*>(&destinationData);
- if(!pTarget)
+ break;
+ case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
{
- return false;
+ Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ if(!pTarget)
+ {
+ return false;
+ }
+ pTarget->SetPosition(static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).x, static_cast<FloatRectangle&>(const_cast<Object&>(sourceData)).y);
+ return true;
}
- *pTarget = static_cast<Color&>(const_cast<Object&>(sourceData));
- return true;
- }
- else if (sourceType == DATA_BINDING_DATA_TYPE_INTEGER)
- {
- Color* pTarget = dynamic_cast<Color*>(&destinationData);
- if(!pTarget)
- {
+ break;
+ default:
return false;
- }
- *pTarget = static_cast<Integer&>(const_cast<Object&>(sourceData)).ToInt();
- return true;
- }
- else
- {
- return false;
}
break;
- case DATA_BINDING_DATA_TYPE_POINT:
+ case DATA_BINDING_DATA_TYPE_FLOAT_POINT:
switch (sourceType)
{
case DATA_BINDING_DATA_TYPE_POINT:
{
- Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ FloatPoint* pTarget = dynamic_cast<FloatPoint*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_FLOAT_POINT:
{
- Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ FloatPoint* pTarget = dynamic_cast<FloatPoint*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_RECTANGLE:
{
- Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ FloatPoint* pTarget = dynamic_cast<FloatPoint*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
{
- Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ FloatPoint* pTarget = dynamic_cast<FloatPoint*>(&destinationData);
if(!pTarget)
{
return false;
return false;
}
break;
- case DATA_BINDING_DATA_TYPE_RECTANGLE:
+ case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
if (sourceType == DATA_BINDING_DATA_TYPE_RECTANGLE)
{
- Rectangle* pTarget = dynamic_cast<Rectangle*>(&destinationData);
+ FloatRectangle* pTarget = dynamic_cast<FloatRectangle*>(&destinationData);
if(!pTarget)
{
return false;
return false;
}
break;
- case DATA_BINDING_DATA_TYPE_DIMENSION:
+ case DATA_BINDING_DATA_TYPE_FLOAT_DIMENSION:
switch (sourceType)
{
case DATA_BINDING_DATA_TYPE_DIMENSION:
{
- Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ FloatDimension* pTarget = dynamic_cast<FloatDimension*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_FLOAT_DIMENSION:
{
- Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ FloatDimension* pTarget = dynamic_cast<FloatDimension*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_RECTANGLE:
{
- Dimension* pTarget = dynamic_cast<Dimension*>(&destinationData);
+ FloatDimension* pTarget = dynamic_cast<FloatDimension*>(&destinationData);
if(!pTarget)
{
return false;
break;
case DATA_BINDING_DATA_TYPE_FLOAT_RECTANGLE:
{
- Point* pTarget = dynamic_cast<Point*>(&destinationData);
+ FloatPoint* pTarget = dynamic_cast<FloatPoint*>(&destinationData);
if(!pTarget)
{
return false;
default:
return false;
}
+ return true;
}
bool
_DefaultTransformer::IsTransformable(DataBindingDataType sourceType, DataBindingDataType destinationType)
r = pImpl->SetZOrderGroup(_ControlVisualElement::Z_ORDER_GROUP_CONTROL + 4);
- DrawBackgroundBitmap();
+ DrawBackground();
}
else
{
}
result
-_DimmingLayer::DrawBackgroundBitmap(void)
+_DimmingLayer::DrawBackground(void)
{
result r = E_SUCCESS;
const FloatDimension size = _ControlManager::GetInstance()->GetScreenSizeF();
- Bitmap* pPortraitBitmap = null;
- Bitmap* pLandscapeBitmap = null;
- r = GET_BITMAP_CONFIG_N(DIMMINGLAYER::BG_PORTRAIT, BITMAP_PIXEL_FORMAT_ARGB8888, pPortraitBitmap);
- r = GET_BITMAP_CONFIG_N(DIMMINGLAYER::BG_LANDSCAPE, BITMAP_PIXEL_FORMAT_ARGB8888, pLandscapeBitmap);
- SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- String imagePath = L"";
- if (__pControl->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
+ if (__pDimmingElement)
{
- if (pPortraitBitmap)
+ Canvas* pCanvas = null;
+ if (__pControl->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
{
- imagePath = _BitmapImpl::GetInstance(*pPortraitBitmap)->GetFileName();
+ pCanvas = __pDimmingElement->GetCanvasN(FloatRectangle(0, 0, size.width, size.height));
}
- }
- else
- {
- if (pLandscapeBitmap)
+ else
{
- imagePath = _BitmapImpl::GetInstance(*pLandscapeBitmap)->GetFileName();
+ pCanvas = __pDimmingElement->GetCanvasN(FloatRectangle(0, 0, size.height, size.width));
}
- }
- if (__pDimmingElement)
- {
- __pDimmingElement->SetImageSource(imagePath);
- }
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ Color bgColor(0x7F000000);
+ pCanvas->SetBackgroundColor(bgColor);
+ pCanvas->Clear();
- delete pPortraitBitmap;
- delete pLandscapeBitmap;
+ delete pCanvas;
+ }
return r;
}
#include <FBaseErrors.h>
#include <FBaseSysLog.h>
#include <FBaseRtThread.h>
-#include <FApp_IActiveWindowEventListener.h>
#include <FBase_StringConverter.h>
#include <FGrp_CanvasImpl.h>
#include "FUi_CoordinateSystemUtils.h"
#include "FUi_Clipboard.h"
#include "FUi_TouchManager.h"
#include "FUi_ControlManager.h"
-#include "FUi_ActiveWindowEvent.h"
#include "FUi_ControlImplManager.h"
#include "FUiCtrl_Popup.h"
#include "FUiCtrl_ContextMenu.h"
rotatePartial = false;
}
}
+ else
+ {
+ if (orientation != 0) //(orientation == 90 || orientation == 270 )
+ {
+ //WARNNING: It's for the issue that popup window does not mapped.
+ // when orientation
+ pLayer->SetOrientationChanged();
+ }
+ }
_Window* pWindow = const_cast<_Window*>(&window);
if (pWindow->IsLayoutChangable() == true)
{
ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
-
if ((orientation == 0) || (orientation == 180))
{
pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
return (ret ? true : false);
}
-// [ToDo] Remove API
-void
-_EcoreEvas::AddActiveWindowEventListener(const _IActiveWindowEventListener& listener)
-{
-}
-
-// [ToDo] Remove API
-void
-_EcoreEvas::RemoveActiveWindowEventListener(const _IActiveWindowEventListener& listener)
-{
-}
-
unsigned int
_EcoreEvas::GetActiveWindow(void)
{
#endif
// [ToDo] Remove API
-_OSP_EXPORT_ void
-_AddActiveWindowEventListener(const _IActiveWindowEventListener& listener)
-{
- GetEcoreEvasMgr()->GetEcoreEvas()->AddActiveWindowEventListener(listener);
-}
-
-// [ToDo] Remove API
-_OSP_EXPORT_ void
-_RemoveActiveWindowEventListener(const _IActiveWindowEventListener& listener)
-{
- GetEcoreEvasMgr()->GetEcoreEvas()->RemoveActiveWindowEventListener(listener);
-}
-
-// [ToDo] Remove API
_OSP_EXPORT_ unsigned int
_GetActiveWindow(void)
{
while (pParent)
{
_Window* pWindow = dynamic_cast<_Window*>(pParent);
- if (pWindow
- && (pWindow->GetNativeWindowActivated() == true || (pWindow->GetNativeWindowActivated() == false && pWindow->GetWindowType() == _WINDOW_TYPE_VE)))
+ if (pWindow && (pWindow->GetNativeWindowActivated() == true))
{
nativeWindowActivated = true;
break;
{
r = GetPosition(status, x, y, current);
SysTryReturnVoidResult(NID_UI, r != E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] A system error occurred.");
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (r != E_SUCCESS)
+ {
+ SetLastResult(E_SYSTEM);
+ return;
+ }
}
else
{
{
pTouchManager->ResetTouchInfo();
SysSecureLog(NID_UI, "ResetTouchInfo x(%d), y(%d), deviceID(%d), pointID(%d)", current.x, current.y, deviceId, pointId);
- SysTryReturnVoidResult(NID_UI, false, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ SetLastResult(E_SYSTEM);
+ return;
}
else
{
r = __pTouchEventManager->AddControl(pointId, pControl->GetHandle());
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (r != E_SUCCESS)
+ {
+ SetLastResult(E_SYSTEM);
+ return;
+ }
}
}
else
if (pControl->GetChangingEventTarget() == true && pControl->GetVisibleState() == true)
{
r = __pTouchEventManager->AddControl(pointId, pControl->GetHandle());
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
SysSecureLog(NID_UI, "touch_moved, touch_released : pointId = %d, AddControl = 0x%x", pointId, pControl);
+ if (r != E_SUCCESS)
+ {
+ SetLastResult(E_SYSTEM);
+ return;
+ }
}
}
}
{
_Window* pWindow = null;
pWindow = pControlManager->GetTouchedWindow();
- SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (pWindow == null)
+ {
+ SetLastResult(E_SYSTEM);
+ return null;
+ }
Rectangle winBounds = pWindow->GetBounds();
pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
}
- SysTryReturn(NID_UI, pRootControlElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (pRootControlElement == null)
+ {
+ SetLastResult(E_SYSTEM);
+ return null;
+ }
_ControlVisualElement* pControlVisualElement = pRootControlElement->GetControlChildAtPoint(ptf);
- SysTryReturn(NID_UI, pControlVisualElement, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (pControlVisualElement == null)
+ {
+ SetLastResult(E_SYSTEM);
+ return null;
+ }
pControl = static_cast <_Control*>(pControlVisualElement->GetUserData());
- SysTryReturn(NID_UI, pControl, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+ if (pControl == null)
+ {
+ SetLastResult(E_SYSTEM);
+ return null;
+ }
if (pCapturedControl)
{
_Control* pOwner = pWindow->GetOwner();
if (pOwner)
{
- Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds(true));
if ((x >= ownerRc.x) && (x <= (ownerRc.x + ownerRc.width)) && (y >= ownerRc.y) && (y <= (ownerRc.y + ownerRc.height)))
{
pControl = pOwner;
}
}
- Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds(true));
if ((x >= rc.x) && (x <= (rc.x + rc.width)) && (y >= rc.y) && (y <= (rc.y + rc.height)))
{
pControl = pCapturedControl;
}
else
{
- Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds(true));
if ((x < rc.x) || (x > (rc.x + rc.width)) || (y < rc.y) || (y > (rc.y + rc.height)))
{
_Control* pOwner = pWindow->GetOwner();
if (pOwner)
{
- Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle ownerRc(pOwner->GetAbsoluteBounds(true));
if ((x >= ownerRc.x) && (x <= (ownerRc.x + ownerRc.width)) && (y >= ownerRc.y) && (y <= (ownerRc.y + ownerRc.height)))
{
pControl = pOwner;
}
}
- Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds(true));
if ((x >= rc.x) && (x <= (rc.x + rc.width)) && (y >= rc.y) && (y <= (rc.y + rc.height)))
{
pControl = pCapturedControl;
}
else
{
- Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds());
+ Tizen::Graphics::Rectangle rc(pCapturedControl->GetAbsoluteBounds(true));
if ((x < rc.x) || (x > (rc.x + rc.width)) || (y < rc.y) || (y > (rc.y + rc.height)))
{
if (pEv->buttons == _MOUSE_BUTTON_LEFT || pEv->buttons == _MOUSE_BUTTON_NONE)
{
- _TouchEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, pEv->timestamp, null);
+ _TouchEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, pEv->timestamp, null);
- result r = GetLastResult();
- if (r != E_SUCCESS)
- {
- SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
- return ECORE_CALLBACK_PASS_ON;
- }
+ result r = GetLastResult();
+ if (r != E_SUCCESS)
+ {
+ SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
+ return ECORE_CALLBACK_PASS_ON;
+ }
- event.Send();
+ event.Send();
}
else
{
//_MouseEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, 0, pEv->buttons, pEv->timestamp, null);
_MouseEvent event(pEv->multi.device, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, 0, _MOUSE_BUTTON_RIGHT, pEv->timestamp, null);
- result r = GetLastResult();
- if (r != E_SUCCESS)
- {
- SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
- return ECORE_CALLBACK_PASS_ON;
- }
+ result r = GetLastResult();
+ if (r != E_SUCCESS)
+ {
+ SysLog(NID_UI, "[%s] Propagating.", GetErrorMessage(r));
+ return ECORE_CALLBACK_PASS_ON;
+ }
- event.Send();
+ event.Send();
_UiEventManager* pEventManager = _UiEventManager::GetInstance();
SysTryReturn(NID_UI, pEventManager, ECORE_CALLBACK_PASS_ON, E_SYSTEM, "[E_SYSTEM] System error occurred.");
- pEventManager->GenerateKeyEvent(KEY_PRESSED, _KEY_OEM_2, _KEY_MODIFIER_NONE, false);
- pEventManager->GenerateKeyEvent(KEY_RELEASED, _KEY_OEM_2, _KEY_MODIFIER_NONE, false);
+ pEventManager->GenerateKeyEvent(KEY_PRESSED, _KEY_BACK, _KEY_MODIFIER_NONE, false);
+ pEventManager->GenerateKeyEvent(KEY_RELEASED, _KEY_BACK, _KEY_MODIFIER_NONE, false);
}
SetLastResult(E_SUCCESS);
//_MouseEvent event(pEv->multi.device, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, 0, pEv->buttons, pEv->timestamp, null);
_MouseEvent event(pEv->multi.device, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, 0, _MOUSE_BUTTON_RIGHT, pEv->timestamp, null);
-
result r = GetLastResult();
if (r!= E_SUCCESS)
{
, __focusDirection(FOCUS_DIRECTION_DOWNWARD)
{
#ifdef _FOCUS_UI_
- result r = _UiEventManager::GetInstance()->AddPostKeyEventListener(*this);
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ _UiEventManager* pUiEventManager = _UiEventManager::GetInstance();
+ if (pUiEventManager)
+ {
+ result r = pUiEventManager->AddPostKeyEventListener(*this);
+ SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- r = _UiEventManager::GetInstance()->AddTouchEventListener(*this);
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pUiEventManager->AddTouchEventListener(*this);
+ SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
#endif
}
void
_FocusManagerImpl::StartFocusTraversal(_Control* pControl, FocusDirection focusDirection)
{
+ _Control* pOriginalControl = pControl;
_Window* pTop = pControl->GetRootWindow();
if (pTop == null)
{
if (__isFocusMode == false)
{
__isFocusMode = true;
- pControl->OnFocusModeStateChanged();
+ if (pOriginalControl)
+ {
+ pOriginalControl->OnFocusModeStateChanged();
+ }
}
if (focusMode == false && pControl->IsFocused())
_Window* pTop = source.GetRootWindow();
if (pTop)
{
- _Control* pFocusTraversalControl = pTop->GetFocusTraversalControl(pSourceControl);
- if (pFocusTraversalControl)
+ _Control* pControl = pTop->GetFocusControl(pSourceControl);
+ if (pControl)
{
- pFocusTraversalControl->OnFocusModeStateChanged();
- pFocusTraversalControl->RemoveFocusRing();
+ pControl->OnFocusModeStateChanged();
+ pControl->RemoveFocusRing();
}
}
if (pControl)
{
Rectangle absoluteControlRectangle;
- absoluteControlRectangle = pControl->GetAbsoluteBounds();
+ absoluteControlRectangle = pControl->GetAbsoluteBounds(true);
cursorRectangle.x += absoluteControlRectangle.x;
cursorRectangle.y += absoluteControlRectangle.y;
}
if (pControl)
{
FloatRectangle absoluteControlRectangle;
- absoluteControlRectangle = pControl->GetAbsoluteBoundsF();
+ absoluteControlRectangle = pControl->GetAbsoluteBoundsF(true);
cursorRectangle.x += absoluteControlRectangle.x;
cursorRectangle.y += absoluteControlRectangle.y;
}
}
delete pEnum;
- return true;
+ return false;
CATCH:
delete pEnum;
}
delete pEnum;
- return true;
+ return false;
CATCH:
delete pEnum;
}
else
{
- if (!((callback == true) && (pOwnee->IsRotationSynchronized() == true)))
+ if (!(/*(callback == true) && */(pOwnee->IsRotationSynchronized() == true)))
{
pOwnee->ChangeLayout(coreOrientation);
}
}
else
{
- if (!((callback == true) && (pOwnee->IsRotationSynchronized() == true)))
+ if (!(/*(callback == true) && */(pOwnee->IsRotationSynchronized() == true)))
{
pOwnee->ChangeLayout(coreOrientation);
}
#include <FMediaImageTypes.h>
#include <FUiCtrlAnimationFrame.h>
#include <FApp_AppInfo.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
+#include <FApp_ThemeInfo.h>
#include <FIo_DirectoryImpl.h>
#include <FGrp_BitmapImpl.h>
#include <FGrp_CanvasImpl.h>
#include "FUi_ResourceMapContainer.h"
using namespace Tizen::App;
-using namespace Tizen::App::Package;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
Dimension dim = _CoordinateSystemUtils::InverseTransform(Dimension(_Screen::GetWidth(), _Screen::GetHeight()));
__logicalWidth = dim.width;
__logicalHeight = dim.height;
- LoadThemeInformation(__systemTheme, __userTheme);
+ _ThemeInfo::LoadThemeInformation(__systemTheme, __userTheme);
// theme 2.0
__pMapContainer[MAP_CONTAINER_TYPE_APP_BASE_PORTRAIT] = new (std::nothrow) MapContainer();
}
result
-_ResourceManager::GetBitmapInternalN(const String& fileName, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool isCustom, Bitmap*& pBitmap)
+_ResourceManager::GetBitmapInternalN(const String& fileName, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool isCustom, bool replacementColor, int color, Bitmap*& pBitmap)
{
result r = E_SYSTEM;
Bitmap* pTempBitmap = null;
}
else
{
+ if(replacementColor)
+ {
+ Bitmap* pReplacementBitmap = null;
+ pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), color);
+ if(pReplacementBitmap)
+ {
+ delete pTempBitmap;
+ pTempBitmap = pReplacementBitmap;
+ }
+ }
float scaleFactor = (float)((float)__targetWidth/(float)foundFolderWidth);
r = pTempBitmap->Scale(Dimension(pTempBitmap->GetWidth()*scaleFactor, pTempBitmap->GetHeight()*scaleFactor));
if (r == E_SUCCESS)
}
result
-_ResourceManager::GetBitmapN(int bitmapId, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, Bitmap*& pBitmap)
+_ResourceManager::GetBitmapN(int bitmapId, BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool replacementColor, int color, Bitmap*& pBitmap)
{
result r = E_SYSTEM;
ResourceItem* pItem = null;
}
else
{
- r = GetBitmapInternalN(fileName, pixelFormat, orientation, IsCustomBitmap(bitmapId), pBitmap);
+ r = GetBitmapInternalN(fileName, pixelFormat, orientation, IsCustomBitmap(bitmapId), replacementColor, color, pBitmap);
}
}
return r;
ResourceAnimationFrame frame;
r = pAnimationList->GetAt(i, frame);
SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM,"System error is occured.");
- r = GetBitmapInternalN(frame.__fileName, BITMAP_PIXEL_FORMAT_ARGB8888, _CONTROL_ORIENTATION_PORTRAIT, isCustom, pBitmap);
+ r = GetBitmapInternalN(frame.__fileName, BITMAP_PIXEL_FORMAT_ARGB8888, _CONTROL_ORIENTATION_PORTRAIT, isCustom, false, 0, pBitmap);
SysTryCatch(NID_UI, r == E_SUCCESS, , E_SYSTEM,"System error is occured.");
pFrame = new (std::nothrow) AnimationFrame(*pBitmap, frame.__duration);
SysTryCatch(NID_UI, pFrame, , E_SYSTEM,"System error is occured.");
ADD_PALETTE(BASIC::B0221L2, 0xFF697082);
ADD_PALETTE(BASIC::B0221L3, 0xFF6B707E);
ADD_PALETTE(BASIC::B0221L4, 0xFF525252);
- ADD_PALETTE(BASIC::B0222, 0x3FFFFFFF);
+ ADD_PALETTE(BASIC::B0222, 0xFF404040);
ADD_PALETTE(BASIC::B0223, 0x00000000);
ADD_PALETTE(BASIC::B0224, 0xFF27282B);
ADD_PALETTE(BASIC::B0225, 0xFF2A5181);
}
}
-result
-_ResourceManager::LoadThemeInformation(String& systemTheme, String& userTheme)
-{
- AppId appId = _AppInfo::GetApplicationId();
- SysLog(NID_UI, "%ls" , appId.GetPointer());
- _PackageAppInfoImpl packageManager;
- packageManager.Construct(appId);
- String key = packageManager.GetAppFeature(L"UserDefinedTheme");
- if (!(key.IsEmpty()))
- {
- SysLog(NID_UI, "custem theme %ls" , key.GetPointer());
- userTheme = key;
- }
- key = packageManager.GetAppFeature(L"SystemTheme");
- if (key.IsEmpty())
- {
- systemTheme = L"black";
- }
- else
- {
- SysLog(NID_UI, "System theme %ls" , key.GetPointer());
- systemTheme = key;
- systemTheme.ToLowerCase();
- }
- return E_SUCCESS;
-}
-
void
_ResourceManager::GetThemeName(String& systemTheme, String& userTheme) const
{
SysTryReturnVoidResult(NID_UI, pTouchManager, E_SYSTEM, "[E_SYSTEM] _TouchManager does not exist.");
result r = pTouchManager->AddPoint(touchInfo.GetPointId(), currentPoint, _TOUCH_CANCELED);
- SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] System error occurred.");
+ if (r != E_SUCCESS)
+ {
+ SetLastResult(E_SYSTEM);
+ return;
+ }
SysLog(NID_UI, "SendTouchCancelEvent");
pEventManager->SendEvent(event);
return FireListener(pFocusListener, isFiltered);
}
+bool
+_UiFocusEvent::IsEventEnabled(const _Control& control) const
+{
+ // call a listener method by the key state
+ if (FOCUS_GAINED == GetFocusState())
+ {
+ return _UiEvent::IsEventEnabled(control);
+ }
+
+ return true;
+}
+
result
_UiFocusEvent::FireListener(const _IFocusEventListener* pListener, bool& isFiltered)
{
_UiTouchEvent::GetRelativePoint(const _Control& control, const FloatPoint& point) const
{
FloatPoint relativePoint(point);
- FloatRectangle absRect = control.GetAbsoluteBoundsF();
+ FloatRectangle absRect = control.GetAbsoluteBoundsF(true);
relativePoint.x -= absRect.x;
relativePoint.y -= absRect.y;
_UiMouseEvent::GetRelativePoint(const _Control& control, const FloatPoint& point) const
{
FloatPoint relativePoint(point);
- FloatRectangle absRect = control.GetAbsoluteBoundsF();
+ FloatRectangle absRect = control.GetAbsoluteBoundsF(true);
relativePoint.x -= absRect.x;
relativePoint.y -= absRect.y;
if (pEcoreEvas)
{
String osp(L"OSP_");
- String appName = _AppInfo::GetAppName();
+ String appName = _AppInfo::GetAppExecutableName();
osp.Append(appName);
pEcoreEvas->SetWindowName(*this, osp);
bool
_Window::GetNativeWindowActivated(void)
{
- return __nativeWindowActivated;
+ if ((GetWindowType() == _WINDOW_TYPE_VE) || IsSystemWindow())
+ {
+ return true;
+ }
+ else
+ {
+ return __nativeWindowActivated;
+ }
}
_RootVisualElement*
_Control* focusedControl = GetCurrentFocusControl();
+ SetFocusWindowActivationChecked(true);
if (focusedControl)
{
focusedControl->SetFocused();
{
SetFocused();
}
-
- if (!isFrameActivated)
- {
- return;
- }
+ SetFocusWindowActivationChecked(false);
_TouchManager* pTouchMgr = _TouchManager::GetInstance();
if (pTouchMgr)
FloatRectangle realBounds = pElement->__bounds;
_Window* pWindow = dynamic_cast< Tizen::Ui::_Window* >(static_cast< Tizen::Ui::_Window* >(pElement->GetUserData()));
- if (pWindow)
- {
- Rectangle windowRect = pWindow->GetBounds();
- realBounds.x += windowRect.x;
- realBounds.y += windowRect.y;
- }
+// if (pWindow)
+// {
+// Rectangle windowRect = pWindow->GetBounds();
+// realBounds.x += windowRect.x;
+// realBounds.y += windowRect.y;
+// }
_VisualElementCoordinateSystem::ConvertDimensionToPhysical(realBounds.width, realBounds.height);
_VisualElementCoordinateSystem::MakeIntegralPoint(realBounds.width, realBounds.height, relative.width, relative.height);
_VisualElementCoordinateSystem::ConvertPointToPhysical(realBounds.x, realBounds.y);
#include "FUiAnim_RootVisualElement.h"
#include "FUiAnim_AnimationManager.h"
#include "FUiAnim_DisplayManager.h"
+#include "FBaseColIList.h"
#include "FUi_Math.h"
-
+#include "FUiAnim_EflLayerConfiguration.h"
using namespace Tizen;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
//#define PRINT(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
+//#define PRINT(...) SysLog(NID_UI_ANIM, __VA_ARGS__)
#define PRINT(...)
void
OnRenderFlushPost(void* pData, Evas* pEvas, void* ev)
{
-// _EflLayer* pLayer = (_EflLayer*)pData;
-// int w, h;
-// evas_output_size_get(pLayer->GetEvas(), &w, &h);
-// int rotate = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
-// PRINT("[%#x] OnRenderFlushPost size(%d,%d) rotate=%d\n", (unsigned int)pData, w, h, rotate);
+ _EflLayer* pLayer = (_EflLayer*)pData;
+ int w, h;
+ evas_output_size_get(pLayer->GetEvas(), &w, &h);
+ int rotate = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
+ PRINT("[%#x] OnRenderFlushPost size(%d,%d) rotate=%d\n", (unsigned int)pData, w, h, rotate);
}
Eina_Bool
return EINA_TRUE;
}
+#endif // USE_WORKAROUND
+
Eina_Bool
OnXWindowHidden(void* pData, int type, void* pEventInfo)
{
_EflLayer* pLayer = (_EflLayer*)pData;
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
- PRINT("[%#x] ############ Hidden -> EventDone() \n" , (unsigned int)pData);
+ pLayer->SetMapped(false);
+ PRINT("[%#x | %#x] ############ Hidden -> EventDone() \n" , (unsigned int)pData , pEvent->win);
}
return EINA_TRUE;
_EflLayer* pLayer = (_EflLayer*)pData;
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
+ pLayer->SetMapped(true);
+ FloatRectangle bounds = pLayer->GetBounds();
+ evas_damage_rectangle_add(pLayer->GetEvas(),0,0,(int)bounds.width, (int)bounds.height);
//ecore_evas_rotation_set(pLayer->GetEcoreEvas(), 270);
- PRINT("[%#x] ############ Shown -> EventDone() \n" , (unsigned int)pData);
+ PRINT("[%#x | %#x] ############ Shown -> EventDone() \n" , (unsigned int)pData, pEvent->win);
+ _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+ if (pDisplayManager)
+ {
+ pDisplayManager->AddWakeUpEvent();
+ }
}
return EINA_TRUE;
}
-#endif // USE_WORKAROUND
-
//static const double fpsLimitInterval = 1.0 / 55.0;
{
_DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
-// PRINT("OnIdleLoopIterate()\n");
+ // PRINT("OnIdleLoopIterate()\n");
if (!pDisplayManager)
}
//CHECK ME : how about the performance?
-// double currentTime = ecore_time_get();
-// static double prevFlushTime = 0;
+ // double currentTime = ecore_time_get();
+ // static double prevFlushTime = 0;
-// if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
+ // if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
{
pAnimationManager->ProcessAnimationTick();
-// prevFlushTime = currentTime;
+ // prevFlushTime = currentTime;
pDisplayManager->RenderAll();
, _needAsyncVisibilityChangeRequest(true)
, _isMainType(true)
, _needRender(true)
+ , _isMapped(false)
+ , _needForceManualRender(false)
, _pOnWindowDamagedHandler(null)
, _pOnWindowConfiguredHandler(null)
, _pOnWindowHideHandler(null)
, _pOnWindowShowHandler(null)
, __isWinObject(true)
, __bounds()
+ , _pConfiguration(null)
{
_countOfLayer++;
+ _pConfiguration = _EflLayerConfiguration::GetInstance();
}
_EflLayer::_EflLayer(bool isMainType)
, _needAsyncVisibilityChangeRequest(true)
, _isMainType(isMainType)
, _needRender(true)
+ , _isMapped(false)
+ , _needForceManualRender(false)
, _pOnWindowDamagedHandler(null)
, _pOnWindowConfiguredHandler(null)
, _pOnWindowHideHandler(null)
, _pOnWindowShowHandler(null)
, __isWinObject(true)
, __bounds()
+ , _pConfiguration(null)
{
_countOfLayer++;
+ _pConfiguration = _EflLayerConfiguration::GetInstance();
}
_EflLayer::~_EflLayer(void)
{
_countOfLayer--;
+ if (_pConfiguration)
+ {
+ _pConfiguration->ReleaseInstance();
+ _pConfiguration = null;
+ }
#ifdef VE_VSYNC_UPDATE
if (_pEcoreEvas)
{
ecore_event_handler_del(_pOnWindowConfiguredHandler);
_pOnWindowConfiguredHandler = null;
}
+
+ if (_pEvas)
+ {
+ evas_event_callback_del(_pEvas, EVAS_CALLBACK_RENDER_FLUSH_POST, OnRenderFlushPost);
+ }
+
+#endif // USE_WORKAROUND
+
if (_pOnWindowHideHandler)
{
ecore_event_handler_del(_pOnWindowHideHandler);
ecore_event_handler_del(_pOnWindowShowHandler);
_pOnWindowShowHandler = null;
}
-#endif // USE_WORKAROUND
+
#endif
if(_isMainType)
{
_pWindow = elm_win_add(NULL, NULL, ELM_WIN_BASIC);
- PRINT("[%#x] CREATE WINDOW [MAIN TYPE]\n", (unsigned int)this);
}
else
{
_pWindow = elm_win_add(NULL, NULL, ELM_WIN_UTILITY);
- PRINT("[%#x] CREATE WINDOW [UTIL TYPE]\n", (unsigned int)this);
}
SysTryReturnResult(NID_UI, _pWindow, E_SYSTEM, "A system error has been occurred.");
evas_object_del(_pWindow);
return E_SYSTEM;
}
-
Ecore_X_Window window = (Ecore_X_Window) ecore_evas_window_get(_pEcoreEvas);
SysTryReturnResult(NID_UI, window != 0,E_SYSTEM, "A system error has been occurred.");
+ PRINT("[%#x | %#x] CREATE WINDOW [%s]\n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), (_isMainType)?"ELM_WIN_BASIC":"ELM_WIN_UTILITY");
+
+ if (_pConfiguration)
+ {
+ _pConfiguration->ApplyCustomizedConfig(_pWindow);
+ }
+
#ifdef VE_VSYNC_UPDATE
ecore_x_vsync_animator_tick_source_set(window);
ecore_evas_manual_render_set(_pEcoreEvas, EINA_TRUE);
__isWinObject = false;
}
-// CHECK ME: Is this needed for GL mode?
+ // CHECK ME: Is this needed for GL mode?
#ifdef USE_WORKAROUND
if(_pOnWindowDamagedHandler == null)
_pOnWindowConfiguredHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, OnXWindowConfigured, this);
}
+ evas_event_callback_add(_pEvas, EVAS_CALLBACK_RENDER_FLUSH_POST, OnRenderFlushPost, (void*)this);
+#endif // USE_WORKAROUND
+
if (_pOnWindowHideHandler == null)
{
_pOnWindowHideHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, OnXWindowHidden, this);
{
_pOnWindowShowHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnXWindowShown, this);
}
- evas_event_callback_add(_pEvas, EVAS_CALLBACK_RENDER_FLUSH_POST, OnRenderFlushPost, (void*)this);
-#endif // USE_WORKAROUND
#ifdef VE_VSYNC_UPDATE
}
result
+_EflLayer::SetOrientationChanged(void)
+{
+ _needForceManualRender = true;
+ PRINT("[%#x | %#x] Called SetOrientationChanged(%d) \n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), _needForceManualRender);
+ return E_SUCCESS;
+}
+
+result
_EflLayer::Configure(_RootVisualElement& rootElement)
{
_EflNode* pNode = dynamic_cast<_EflNode*>(rootElement.GetNativeNode());
result
_EflLayer::SetBounds(const FloatRectangle& bounds)
{
- if (__bounds == bounds)
- return E_SUCCESS;
+ // WARNING: this code makes a touch coordination error, when device orientation is swapped 0' to 180'. (For test application : UiFrameMode)
+ // if (__bounds == bounds)
+ // return E_SUCCESS;
__bounds = bounds;
evas_object_move(_pWindow, __bounds.x, __bounds.y);
evas_object_resize(_pWindow, __bounds.width, __bounds.height);
- PRINT("[%#x] Initialzing evas_object_move(%f, %f) \n", (unsigned int)this, __bounds.x, __bounds.y);
- PRINT("[%#x] Initialzing evas_object_resize(%f, %f) \n", (unsigned int)this, __bounds.width, __bounds.height);
+ PRINT("[%#x | %#x] Initialzing evas_object_move(%f, %f) \n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), __bounds.x, __bounds.y);
+ PRINT("[%#x | %#x] Initialzing evas_object_resize(%f, %f) \n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), __bounds.width, __bounds.height);
return E_SUCCESS;
}
{
if (_isShow == show)
{
+ PRINT("[%#x | %#x] Cancel SetShowState request (%d)\n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), show);
return E_SUCCESS;
}
{
// Show State is not applied yet. Need cancel the visibility change request.
_needShowStateChangeRequest = false;
- PRINT("[%#x] Cancel SetShowState request (%d)\n", (unsigned int)this, show);
+ PRINT("[%#x | %#x] Cancel SetShowState request (%d)\n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), show);
}
else
{
{
pDisplayManager->AddWakeUpEvent();
}
- PRINT("[%#x] SetShowState request (%d)\n", (unsigned int)this, show);
+ PRINT("[%#x | %#x] SetShowState request (%d)\n", (unsigned int)this, ecore_evas_window_get(_pEcoreEvas), show);
}
_isShow = show;
if (__isWinObject == true)
{
elm_win_alpha_set(_pWindow, EINA_FALSE);
+ if (_pConfiguration)
+ {
+ _pConfiguration->ApplyCustomizedConfig(_pWindow);
+ }
}
int r,g,b,a;
if (__isWinObject == true)
{
elm_win_alpha_set(_pWindow, EINA_TRUE);
+ if (_pConfiguration)
+ {
+ _pConfiguration->ApplyCustomizedConfig(_pWindow);
+ }
}
int r,g,b,a;
a = opacity*255;
evas_object_color_set(_pWindow, r, g, b, a);
}
- PRINT("[%#x] ALPHA SET(opacity=%f)\n", (unsigned int)this, opacity);
+ PRINT("[%#x | %#x] ALPHA SET(opacity=%f)\n", (unsigned int)this,ecore_evas_window_get(_pEcoreEvas), opacity);
}
float
}
+
+static int __GetChildrenCount(VisualElement* pVe)
+{
+ if(pVe == null)
+ return 0;
+
+ int count = pVe->GetChildrenCount();
+ if(count > 0)
+ {
+ IList* pList = pVe->GetChildrenN();
+ for(int i = 0;i<count; i++)
+ {
+ count += __GetChildrenCount( (VisualElement*)pList->GetAt(i) );
+ }
+ delete pList;
+ }
+ return count;
+}
+
void
_EflLayer::Flush(void)
{
if (_isShow)
{
evas_object_show(_pWindow);
- PRINT("[%#x] evas_object_show \n", (unsigned int)this);
+ PRINT("[%#x | %#x] evas_object_show \n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas));
}
else
{
evas_object_hide(_pWindow);
- PRINT("[%#x] evas_object_hide \n", (unsigned int)this);
+ PRINT("[%#x | %#x] evas_object_hide \n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas));
}
_needShowStateChangeRequest = false;
}
FloatRectangle rect = GetBounds();
if(!_needRender)
{
- PRINT("[%#x] _needRender = false bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
+ PRINT("[%#x | %#x] _needRender = false bounds(%f %f %f %f)\n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas), __bounds.x, __bounds.y, __bounds.width, __bounds.height);
return;
}
- //PRINT("[%#x] ecore_evas_manual_render bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
+ if(__isWinObject)
+ {
+ if (_isMapped)
+ {
+ PRINT("[%#x | %#x] ecore_evas_manual_render -- mapped (child:%d)\n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas), __GetChildrenCount(_pRootVisualElement));
+ __needPreRender = false;
+ // evas_damage_rectangle_add(_pEvas,0,0,(int)__bounds.width, (int)__bounds.height);
+ ecore_evas_manual_render(_pEcoreEvas);
- __needPreRender = false;
- ecore_evas_manual_render(_pEcoreEvas);
- __needPreRender = true;
- }
+ __needPreRender = true;
+ _DisplayManager::RestoreContext();
+ }
+ else
+ {
+ if(_isShow && _needForceManualRender)
+ {
+ PRINT("[%#x | %#x] ecore_evas_manual_render -- _needForceManualRender (child:%d)\n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas), __GetChildrenCount(_pRootVisualElement));
+ __needPreRender = false;
+ ecore_evas_manual_render(_pEcoreEvas);
+ __needPreRender = true;
+ _DisplayManager::RestoreContext();
+ _needForceManualRender = false;
+ return;
+ }
+
+ PRINT("[%#x | %#x] ecore_evas_manual_render -- unmapped - not called(child:%d)\n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas), __GetChildrenCount(_pRootVisualElement));
+ }
+ }
+ else // not window type
+ {
+ PRINT("[%#x | %#x] ecore_evas_manual_render -- unknown type(child:%d)\n", (unsigned int)this ,ecore_evas_window_get(_pEcoreEvas), __GetChildrenCount(_pRootVisualElement));
+ __needPreRender = false;
+ // evas_damage_rectangle_add(_pEvas,0,0,(int)__bounds.width, (int)__bounds.height);
+ ecore_evas_manual_render(_pEcoreEvas);
+ __needPreRender = true;
+ _DisplayManager::RestoreContext();
+ }
+ }
}
--- /dev/null
+//
+// 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 FUiAnim_EflLayerConfiguration.cpp
+ * @brief This file contains implementation of _EflLayer class
+ *
+ * This file contains implementation _EflLayer class.
+ */
+
+#include "FUiAnim_EflLayerConfiguration.h"
+
+#define null 0
+
+namespace Tizen { namespace Ui { namespace Animations
+{
+_EflLayerConfiguration* pEflLayerConfiguration = null;
+_EflLayerConfiguration*
+_EflLayerConfiguration::GetInstance(void)
+{
+ if (pEflLayerConfiguration == null)
+ {
+ pEflLayerConfiguration = new _EflLayerConfiguration();
+ }
+ else
+ {
+ pEflLayerConfiguration->__refCount++;
+ }
+ return pEflLayerConfiguration;
+}
+
+void
+_EflLayerConfiguration::ReleaseInstance(void)
+{
+ if (pEflLayerConfiguration->__refCount > 1)
+ {
+ pEflLayerConfiguration->__refCount--;
+ }
+ else
+ {
+ delete pEflLayerConfiguration;
+ pEflLayerConfiguration = null;
+ }
+}
+
+void
+_EflLayerConfiguration::ApplyCustomizedConfig(void* pWin)
+{
+}
+
+_EflLayerConfiguration::_EflLayerConfiguration(void)
+ : __refCount(1)
+{
+}
+
+_EflLayerConfiguration::~_EflLayerConfiguration(void)
+{
+}
+}}}//namespace Tizen { namespace Ui { namespace Animations
\ No newline at end of file
_AnimationData* pAnimationData = null;
- int animationCount = pAnimationList->GetCount();
-
- for (int index = 0; index < animationCount; index++)
+ for (int index = 0; index < pAnimationList->GetCount(); index++)
{
pAnimationData = static_cast< _AnimationData* >(pAnimationList->GetAt(index));
VisualElementPropertyAnimation* pPropertyAnimation = null;
_AnimationData* pAnimationData = null;
- int animationCount = pAnimationList->GetCount();
-
- for (int index = 0; index < animationCount; index++)
+ for (int index = 0; index < pAnimationList->GetCount(); index++)
{
pAnimationData = static_cast< _AnimationData* >(pAnimationList->GetAt(index));
pPropertyAnimation = dynamic_cast< VisualElementPropertyAnimation* >(&(pAnimationData->GetAnimation()));
result r = E_SUCCESS;
_AnimationData* pAnimationData = null;
- int animationCount = pAnimationList->GetCount();
-
- for (int index = 0; index < animationCount; index++)
+ for (int index = 0; index < pAnimationList->GetCount(); index++)
{
pAnimationData = static_cast< _AnimationData* >(pAnimationList->GetAt(index));
bounds = tempRect;
- if (!drawRect.IsEmpty())
+ if (!tempRect.IsEmpty() && drawRect.x>=0.0f && drawRect.y>=0.0f)
{
if (pRenderTarget && HAVE_SURFACE(pRenderTarget)) // If element have surface , justly draw to the canvas
{
for (int i = 0; i < count; i++)
{
pChild = __children.GetChildAt(i);
- if (unlikely(!pChild) || unlikely(!VE_VISIBLE(pChild)))
+ if (unlikely(!pChild) || unlikely(!VE_VISIBLE(pChild)) || clipBounds.IsEmpty() ||
+ (!__childrenTransform.IsIdentity() && !_MatrixUtilIsTranslation(__childrenTransform)) ||
+ (!pChild->__transform.IsIdentity() && !_MatrixUtilIsTranslation(pChild->__transform)) )
{
continue;
- }
+ }
pChild->CaptureI(outputCanvas, rectDest, reference, rectRef, clipBounds, true, depth + 1);
}
}
const _DatePickerImpl* pImpl = _DatePickerImpl::GetInstance(*this);
if (pImpl == null)
{
- r = SystemTime::GetCurrentTime(WALL_TIME, dateTime);
+ r = SystemTime::GetCurrentTime(TIME_MODE_WALL, dateTime);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, dateTime, r, "[%s] Propagating.", GetErrorMessage(r));
return dateTime;
}
SysAssertf((pSliderImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class.");
int sliderStyle = 0;
- if (showTitle == true)
+ if (showTitle)
{
sliderStyle |= SLIDER_STYLE_TITLE;
}
SysAssertf((pSliderImpl == null), "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class.");
int sliderStyle = 0;
- if (showTitle == true)
+ if (showTitle)
{
sliderStyle |= SLIDER_STYLE_TITLE;
}
const _TimePickerImpl* pImpl = _TimePickerImpl::GetInstance(*this);
if (pImpl == null)
{
- r = SystemTime::GetCurrentTime(WALL_TIME, dateTime);
+ r = SystemTime::GetCurrentTime(TIME_MODE_WALL, dateTime);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, dateTime, r, "[%s] Propagating.", GetErrorMessage(r));
return dateTime;
}
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
}
_Animation::~_Animation(void)
{
- if (__pAnimationEvent != null)
- {
- delete __pAnimationEvent;
- __pAnimationEvent = null;
- }
+ delete __pAnimationEvent;
+ __pAnimationEvent = null;
if (__pAnimationFrames != null)
{
delete __pAnimationPresenter;
__pAnimationPresenter = null;
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->Activate(false);
__pAccessibilityElement = null;
void
_Animation::OnTimerExpired(Timer& timer)
{
- if (__pAnimationPresenter->IsTimerExpired(timer) == true)
+ if (__pAnimationPresenter->IsTimerExpired(timer))
{
IEventArg* pEventArg = _AnimationEvent::CreateAnimationEventArgN();
if (pEventArg != null)
result
_Animation::OnAttachedToMainTree(void)
{
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
return E_SUCCESS;
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
__pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0, 0, GetBounds().width, GetBounds().height));
__pAccessibilityElement->SetName(L"Animation");
return;
}
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0, 0, GetBounds().width, GetBounds().height));
}
_AnimationImpl::~_AnimationImpl(void)
{
- if (__pPublicAnimationEvent != null)
- {
- delete __pPublicAnimationEvent;
- __pPublicAnimationEvent = null;
- }
+ delete __pPublicAnimationEvent;
+ __pPublicAnimationEvent = null;
}
_AnimationImpl*
{
result r = E_SUCCESS;
- if (__isTimerRunning == true)
+ if (__isTimerRunning)
{
return E_SUCCESS;
}
result
_AnimationPresenter::Stop(void)
{
- if (__isTimerRunning == true)
+ if (__isTimerRunning)
{
if (__pTimer != null)
{
Canvas* pCanvas = null;
AnimationFrame* pFrame = null;
- if (__lazyDecode == true)
+ if (__lazyDecode)
{
Bitmap* pBitmap = null;
pFrame = GetCurrentFrame();
delete __pCurrentFrame;
__pCurrentFrame = null;
- if (__pTimer != null && __isTimerRunning == true)
+ if (__pTimer != null && __isTimerRunning)
{
__pTimer->Cancel();
}
, __topMargin(0.0f)
, __rightMargin(0.0f)
, __bottomMargin(0.0f)
- , __leftTouchMargin(0.0f)
- , __topTouchMargin(0.0f)
- , __rightTouchMargin(0.0f)
- , __bottomTouchMargin(0.0f)
, __userDefinedTextArea(0.0f, 0.0f, 0.0f, 0.0f)
, __pTextElement(null)
{
FloatPoint
_Button::GetBitmapPositionF(_ButtonStatus status) const
{
- return FloatPoint(__bitmapPosition[status].x + __leftTouchMargin, __bitmapPosition[status].y + __topTouchMargin);
+ return FloatPoint(__bitmapPosition[status].x, __bitmapPosition[status].y);
}
result
FloatPoint
_Button::GetEffectBitmapPositionF(_ButtonStatus status) const
{
- return FloatPoint(__effectBitmapPosition[status].x + __leftTouchMargin, __effectBitmapPosition[status].y + __topTouchMargin);
+ return FloatPoint(__effectBitmapPosition[status].x, __effectBitmapPosition[status].y);
}
result
_ButtonStatus
_Button::GetButtonStatus(void) const
{
- return __buttonStatus;
+ if (IsEnabled())
+ {
+ return __buttonStatus;
+ }
+ else
+ {
+ return _BUTTON_STATUS_DISABLED;
+ }
}
result
Font* pFont = __pButtonPresenter->GetFont();
FloatRectangle previousRect = pTextObject->GetBoundsF();
+ TextObjectActionType previousActionType = pTextObject->GetAction();
dimension.width = GetBoundsF().width - __leftMargin * 2;
dimension.height = GetBoundsF().height - __topMargin * 2;
}
pTextObject->SetBounds(previousRect);
+ pTextObject->SetAction(previousActionType);
- dimension.width += __leftMargin * 4 - __leftTouchMargin - __rightTouchMargin;
- dimension.height += __topMargin * 4 - __topTouchMargin - __bottomTouchMargin;
+ dimension.width += __leftMargin * 4;
+ dimension.height += __topMargin * 4;
for (int i = 0; i < NUMBER_OF_BUTTON_STATUS; i++)
{
}
result
-_Button::SetTouchMargin(int leftTouchMargin, int topTouchMargin, int rightTouchMargin, int bottomTouchMargin)
-{
- float floatLeftTouchMargin = _CoordinateSystemUtils::ConvertToFloat(leftTouchMargin);
- float floatTopTouchMargin = _CoordinateSystemUtils::ConvertToFloat(topTouchMargin);
- float floatRightTouchMargin = _CoordinateSystemUtils::ConvertToFloat(rightTouchMargin);
- float floatBottomTouchMargin = _CoordinateSystemUtils::ConvertToFloat(bottomTouchMargin);
-
- return SetTouchMargin(floatLeftTouchMargin, floatTopTouchMargin, floatRightTouchMargin, floatBottomTouchMargin);
-}
-
-result
-_Button::SetTouchMargin(float leftTouchMargin, float topTouchMargin, float rightTouchMargin, float bottomTouchMargin)
-{
- __leftTouchMargin = leftTouchMargin;
- __topTouchMargin = topTouchMargin;
- __rightTouchMargin = rightTouchMargin;
- __bottomTouchMargin = bottomTouchMargin;
-
- return E_SUCCESS;
-}
-
-int
-_Button::GetLeftTouchMargin(void) const
-{
- return _CoordinateSystemUtils::ConvertToInteger(GetLeftTouchMarginF());
-}
-
-float
-_Button::GetLeftTouchMarginF(void) const
-{
- return __leftTouchMargin;
-}
-
-int
-_Button::GetTopTouchMargin(void) const
-{
- return _CoordinateSystemUtils::ConvertToInteger(GetTopTouchMarginF());
-}
-
-float
-_Button::GetTopTouchMarginF(void) const
-{
- return __topTouchMargin;
-}
-
-int
-_Button::GetRightTouchMargin(void) const
-{
- return _CoordinateSystemUtils::ConvertToInteger(GetRightTouchMarginF());
-}
-
-float
-_Button::GetRightTouchMarginF(void) const
-{
- return __rightTouchMargin;
-}
-
-int
-_Button::GetBottomTouchMargin(void) const
-{
- return _CoordinateSystemUtils::ConvertToInteger(GetBottomTouchMarginF());
-}
-
-float
-_Button::GetBottomTouchMarginF(void) const
-{
- return __bottomTouchMargin;
-}
-
-result
_Button::SetMultilineTextSize(const Variant& textSize)
{
result r = E_SUCCESS;
result
_ButtonImpl::OnAttachedToMainTree(void)
{
- SetFocusable(true);
+ //SetFocusable(true); // for TDIS-6998
_ControlImpl::OnAttachedToMainTree();
, __fontSize(0.0f)
, __pTextSlideTimer(null)
, __textRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
- , __pTabLargeSelectedBitmap(null)
+ , __pTextSlideClippedBitmap(null)
{
}
__pTextSlideTimer = null;
}
- if (__pTabLargeSelectedBitmap)
+ if (__pTextSlideClippedBitmap)
{
- delete __pTabLargeSelectedBitmap;
- __pTabLargeSelectedBitmap = null;
+ delete __pTextSlideClippedBitmap;
+ __pTextSlideClippedBitmap = null;
}
}
float rightMargin = __pButton->GetRightMarginF();
float bottomMargin = __pButton->GetBottomMarginF();
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
__pTextObject->RemoveAll(true);
pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pButton->GetText().GetPointer()), __pButton->GetText().GetLength());
SetTextSize(__pButton->GetTextSizeF());
__pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
__pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
- __pTextObject->SetBounds(FloatRectangle(leftMargin + leftTouchMargin, topMargin + topTouchMargin,
- __pButton->GetBoundsF().width - (leftMargin + rightMargin) - (leftTouchMargin + rightTouchMargin),
- __pButton->GetBoundsF().height - (topMargin + bottomMargin) - (topTouchMargin + bottomTouchMargin)));
+ __pTextObject->SetBounds(FloatRectangle(leftMargin, topMargin,
+ __pButton->GetBoundsF().width - (leftMargin + rightMargin),
+ __pButton->GetBoundsF().height - (topMargin + bottomMargin)));
__pTextObject->Compose();
return E_SUCCESS;
DrawBackground();
}
- DrawSubTitleEffectBitmap();
+ if (__pButton->GetSubTitleEffectBitmap() != null)
+ {
+ DrawSubTitleEffectBitmap();
+ }
+
DrawBitmap();
if (!__pButton->GetText().IsEmpty())
Color bgColor = __pButton->GetBackgroundColor();
String imagePath = L"";
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
- FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin)
- , __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin));
+ FloatRectangle bounds(0, 0, __pButton->GetBoundsF().width,
+ __pButton->GetBoundsF().height);
_ButtonStatus status = __pButton->GetButtonStatus();
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
_ButtonStatus status = __pButton->GetButtonStatus();
Bitmap* pToolbarItemBackgroundBitmap = __pButton->GetToolbarItemBackgroundBitmap(status);
if (pToolbarItemBackgroundBitmap)
{
- FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin),
- __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin));
+ FloatRectangle bounds(0, 0, __pButton->GetBoundsF().width, __pButton->GetBoundsF().height);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pToolbarItemBackgroundBitmap))
{
}
}
- if (__pTabLargeSelectedBitmap)
- {
- delete __pTabLargeSelectedBitmap;
- __pTabLargeSelectedBitmap = null;
- }
-
- __pTabLargeSelectedBitmap = new (std::nothrow) Bitmap();
-
- if (__pButton->UserDefinedText())
- {
- __pTabLargeSelectedBitmap->Construct(*pCanvas, __pButton->GetUserDefinedTextAreaF());
- }
- else
- {
- __pTabLargeSelectedBitmap->Construct(*pCanvas, __textRect);
- }
-
delete pCanvas;
return;
Bitmap* pEffectBitmap = __pButton->GetEffectBitmap(status);
Bitmap* pNormalEffectBitmap = __pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL);
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
- FloatRectangle bounds(leftTouchMargin, topTouchMargin, __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin),
- __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin));
+ FloatRectangle bounds(0, 0, __pButton->GetBoundsF().width, __pButton->GetBoundsF().height);
if (pBitmap)
{
return;
}
- if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(status).x - rightTouchMargin < pBitmap->GetWidthF()
- || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(status).y - bottomTouchMargin < pBitmap->GetHeightF())
+ if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(status).x < pBitmap->GetWidthF()
+ || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(status).y < pBitmap->GetHeightF())
{
pCanvas->DrawBitmap(bounds, *pBitmap, FloatRectangle(0.0f, 0.0f, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
return;
}
- if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).x - rightTouchMargin < pNormalBitmap->GetWidthF()
- || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).y - bottomTouchMargin < pNormalBitmap->GetHeightF())
+ if (__pButton->GetSizeF().width - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).x < pNormalBitmap->GetWidthF()
+ || __pButton->GetSizeF().height - __pButton->GetBitmapPositionF(_BUTTON_STATUS_NORMAL).y < pNormalBitmap->GetHeightF())
{
pCanvas->DrawBitmap(bounds, *pNormalBitmap, FloatRectangle(0.0f, 0.0f, pNormalBitmap->GetWidthF(), pNormalBitmap->GetHeightF()));
void
_ButtonPresenter::DrawText(void)
{
- TimerForTitleSlideInit();
+ TimerForTextSlideInit();
//TextSimple* pSimpleText = null;
TextObjectAlignment horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER;
TextObjectAlignment verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE;
float rightMargin = __pButton->GetRightMarginF();
float bottomMargin = __pButton->GetBottomMarginF();
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
Canvas* pCanvas = __pButton->GetCanvasN();
if (pCanvas == null)
{
//pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pButton->GetText().GetPointer()), __pButton->GetText().GetLength());
//__pTextObject->AppendElement(*pSimpleText);
- __textRect = FloatRectangle(leftMargin + leftTouchMargin, topMargin + topTouchMargin,
- __pButton->GetBoundsF().width - (leftMargin + rightMargin) - (leftTouchMargin + rightTouchMargin),
- __pButton->GetBoundsF().height - (topMargin + bottomMargin) - (topTouchMargin + bottomTouchMargin));
+ __textRect = FloatRectangle(leftMargin, topMargin,
+ __pButton->GetBoundsF().width - (leftMargin + rightMargin),
+ __pButton->GetBoundsF().height - (topMargin + bottomMargin));
if (__pButton->UserDefinedText())
{
__pTextObject->SetBounds(__textRect);
}
+ if (__pTextSlideClippedBitmap)
+ {
+ delete __pTextSlideClippedBitmap;
+ __pTextSlideClippedBitmap = null;
+ }
+
+ __pTextSlideClippedBitmap = new (std::nothrow) Bitmap();
+
+ if (__pButton->UserDefinedText())
+ {
+ __pTextSlideClippedBitmap->Construct(*pCanvas, __pButton->GetUserDefinedTextAreaF());
+ }
+ else
+ {
+ __pTextSlideClippedBitmap->Construct(*pCanvas, __textRect);
+ }
+
__pTextObject->SetAlignment(horizontalAlign | verticalAlign);
if (__pButton->GetButtonStatus() == _BUTTON_STATUS_SELECTED && __pButton->IsTabTextSlide())
__pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
}
+ SetTextSize(__pButton->GetTextSizeF());
__pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
__pTextObject->Compose();
DrawTabTextDimBitmap();
- TimerForTitleSlideStart();
+ TimerForTextSlideStart();
}
else
{
float selectedBitmapHeight = 0.0f;
float segmentedHeight = 0.0f;
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
GET_SHAPE_CONFIG(HEADER::HEADER_ITEM_SELECTED_BITMAP_MARGIN, __pButton->GetOrientation(), selectedBitmapMargin);
GET_SHAPE_CONFIG(HEADER::HEADER_ITEM_SELECTED_BITMAP_HEIGHT, __pButton->GetOrientation(), selectedBitmapHeight);
GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, __pButton->GetOrientation(), segmentedHeight);
return;
}
- FloatRectangle bounds(selectedBitmapMargin + leftTouchMargin,
- __pButton->GetBoundsF().height - bottomTouchMargin - selectedBitmapHeight,
- __pButton->GetBoundsF().width - selectedBitmapMargin * 2 - (leftTouchMargin + rightTouchMargin), selectedBitmapHeight + 1);
+ FloatRectangle bounds(selectedBitmapMargin,
+ __pButton->GetBoundsF().height - selectedBitmapHeight,
+ __pButton->GetBoundsF().width - selectedBitmapMargin * 2, selectedBitmapHeight + 1);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pUnderlineBitmap))
{
void
_ButtonPresenter::DrawSubTitleEffectBitmap(void)
{
- float leftTouchMargin = __pButton->GetLeftTouchMarginF();
- float topTouchMargin = __pButton->GetTopTouchMarginF();
- float rightTouchMargin = __pButton->GetRightTouchMarginF();
- float bottomTouchMargin = __pButton->GetBottomTouchMarginF();
-
Bitmap* pSubTitleEffectBitmap = __pButton->GetSubTitleEffectBitmap();
if (pSubTitleEffectBitmap)
return;
}
- FloatRectangle bounds(leftTouchMargin, topTouchMargin,
- __pButton->GetBoundsF().width - (leftTouchMargin + rightTouchMargin), __pButton->GetBoundsF().height - (topTouchMargin + bottomTouchMargin));
+ FloatRectangle bounds(0, 0, __pButton->GetBoundsF().width, __pButton->GetBoundsF().height);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pSubTitleEffectBitmap))
{
{
_KeyCode keyCode = keyInfo.GetKeyCode();
- if (__pButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
+ if (__pButton->IsFocused() && __pButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
{
if (__pButton->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
{
if (__pButton->GetEnableState())
{
__pButton->SetButtonStatus(_BUTTON_STATUS_NORMAL);
- __pButton->Invalidate();
}
else
{
__pButton->SetButtonStatus(_BUTTON_STATUS_DISABLED);
- __pButton->Invalidate();
}
return;
if (onTimer == __pTextSlideTimer)
{
- TimerForTitleSlideTimeout();
+ TimerForTextSlideTimeout();
}
return;
}
result
-_ButtonPresenter::TimerForTitleSlideInit(void)
+_ButtonPresenter::TimerForTextSlideInit(void)
{
result r = E_SUCCESS;
}
result
-_ButtonPresenter::TimerForTitleSlideStart(void)
+_ButtonPresenter::TimerForTextSlideStart(void)
{
result r = E_SUCCESS;
}
result
-_ButtonPresenter::TimerForTitleSlideTimeout(void)
+_ButtonPresenter::TimerForTextSlideTimeout(void)
{
Canvas* pCanvas = __pButton->GetCanvasN();
SysTryReturnResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pCanvas is invalid!");
{
pCanvas->Clear(__pButton->GetUserDefinedTextAreaF());
- if (__pTabLargeSelectedBitmap)
+ if (__pTextSlideClippedBitmap)
{
- pCanvas->DrawBitmap(CoordinateSystem::AlignToDevice(__pButton->GetUserDefinedTextAreaF()), *__pTabLargeSelectedBitmap);
+ pCanvas->DrawBitmap(CoordinateSystem::AlignToDevice(__pButton->GetUserDefinedTextAreaF()), *__pTextSlideClippedBitmap);
}
}
else
{
pCanvas->Clear(__textRect);
- if (__pTabLargeSelectedBitmap)
+ if (__pTextSlideClippedBitmap)
{
- pCanvas->DrawBitmap(CoordinateSystem::AlignToDevice(__textRect), *__pTabLargeSelectedBitmap);
+ pCanvas->DrawBitmap(CoordinateSystem::AlignToDevice(__textRect), *__pTextSlideClippedBitmap);
}
}
if (__pTextObject->GetRepeatCount() < 3)
{
- TimerForTitleSlideStart();
+ TimerForTextSlideStart();
}
}
else
{
if(__pCheckButton->IsSelected())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"ticked");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_TICK_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"unticked");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_UNTICK_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
}
else if (style == CHECK_BUTTON_STYLE_RADIO || style == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || style == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
{
if(__pCheckButton->IsSelected())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"selected");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_OPT_SELECT,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"unselected");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_NOT_SELECTED_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
}
else if (style == CHECK_BUTTON_STYLE_ONOFF || style == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER
{
if(__pCheckButton->IsSelected())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"on");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_ON,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"off");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_OFF,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
}
return true;
, __titleText(L"")
, __pCircleNormalEffectBitmap(null)
, __pCirclePressedEffectBitmap(null)
+ , __pDetailedRightNormalEffectBitmap(null)
+ , __pDetailedRightPressedEffectBitmap(null)
, __pBackgroundNormalEffectBitmap(null)
, __pBackgroundPressedEffectBitmap(null)
, __pBackgroundTopNormalEffectBitmap(null)
__pCirclePressedEffectBitmap = null;
}
+ if (__pDetailedRightNormalEffectBitmap)
+ {
+ delete __pDetailedRightNormalEffectBitmap;
+ __pDetailedRightNormalEffectBitmap = null;
+ }
+
+ if (__pDetailedRightPressedEffectBitmap)
+ {
+ delete __pDetailedRightPressedEffectBitmap;
+ __pDetailedRightPressedEffectBitmap = null;
+ }
+
if (__pBackgroundNormalEffectBitmap)
{
delete __pBackgroundNormalEffectBitmap;
pContainer->AddElement(*__pDetailButtonElement);
}
__pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF()));
- __pDetailButtonElement->SetLabel(L"More");
__pDetailButtonElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
__pDetailButtonElement->SetName(L"MoreButtonText");
}
pContainer->AddElement(*__pDetailButtonElement);
}
__pDetailButtonElement->SetBounds(FloatRectangle(__pCheckButtonPresenter->GetDetailedButtonBoundsF()));
- __pDetailButtonElement->SetLabel(L"More");
__pDetailButtonElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
__pDetailButtonElement->SetName(L"MoreButtonText");
}
r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_ICON_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDetailedRightBitmap[_CHECK_BUTTON_STATUS_HIGHLIGHTED]);
r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_ICON_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDetailedRightBitmap[_CHECK_BUTTON_STATUS_SELECTED]);
+ r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_ICON_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDetailedRightNormalEffectBitmap);
+ r = GET_BITMAP_CONFIG_N(CHECKBUTTON::DETAILED_ICON_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pDetailedRightPressedEffectBitmap);
+
return r;
}
}
Bitmap*
+_CheckButton::GetDetailedRightNormalEffectBitmap(void) const
+{
+ return __pDetailedRightNormalEffectBitmap;
+}
+
+Bitmap*
+_CheckButton::GetDetailedRightPressedEffectBitmap(void) const
+{
+ return __pDetailedRightPressedEffectBitmap;
+}
+
+Bitmap*
_CheckButton::GetDetailedRightBitmap(_CheckButtonStatus checkButtonStatus) const
{
return __pDetailedRightBitmap[checkButtonStatus];
}
else
{
- __pButtonElement->SetValue(L"unselected");
+ __pButtonElement->SetValueWithStringId("IDS_TPLATFORM_BODY_NOT_SELECTED_T_TTS");
}
}
}
{
Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
Bitmap* pDetailedRightNormalBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_NORMAL);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
{
Bitmap* pCircleDisabledBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_DISABLED);
Bitmap* pDetailedRightDisabledBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_DISABLED);
+ Bitmap* pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ Bitmap* pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
if (pCircleDisabledBitmap)
{
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_DISABLED);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
{
Bitmap* pCirclePressedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
Bitmap* pDetailedRightPressedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_PRESSED);
if (themeBgBitmap == false)
{
- Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
-
- if (pCirclePressedEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
Bitmap* pDetailedRightHighlightedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightHighlightedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_HIGHLIGHTED);
if (themeBgBitmap == false)
{
- Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
-
- if (pCirclePressedEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
{
Bitmap* pCircleSelectedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_SELECTED);
Bitmap* pDetailedRightSelectedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_SELECTED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightSelectedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_SELECTED);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
{
Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
Bitmap* pDetailedRightNormalBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_NORMAL);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
{
Bitmap* pCircleDisabledBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_DISABLED);
Bitmap* pDetailedRightDisabledBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_DISABLED);
+ Bitmap* pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ Bitmap* pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
if (pCircleDisabledBitmap)
{
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_DISABLED);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
{
Bitmap* pCirclePressedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
Bitmap* pDetailedRightPressedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_PRESSED);
if (themeBgBitmap == false)
{
- Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
-
- if (pCirclePressedEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
Bitmap* pDetailedRightHighlightedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightHighlightedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_HIGHLIGHTED);
if (themeBgBitmap == false)
{
- Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
-
- if (pCirclePressedEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
{
Bitmap* pCircleSelectedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_SELECTED);
Bitmap* pDetailedRightSelectedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_SELECTED);
+ Bitmap* pCircleEffectBitmap = null;
+ Bitmap* pDetailedRightEffectBitmap = null;
if (__detailedPressed == true)
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
}
else
{
{
pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightSelectedColor);
}
+
+ pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
+ pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
}
if (pReColorCircleBitmap)
pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
}
+ bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
+
+ if (themeBgBitmap == false)
+ {
+ if (pCircleEffectBitmap)
+ {
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
+ }
+ }
+
if (pReColorRightBitmap)
{
float arrowWidth = pReColorRightBitmap->GetWidthF();
, __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
}
- bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
+ themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_SELECTED);
if (themeBgBitmap == false)
{
- Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
-
- if (pCircleNormalEffectBitmap)
+ if (pDetailedRightEffectBitmap)
{
- pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
+ float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
+ float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
+
+ pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
+ , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
}
}
}
if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON
|| checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
{
- StartCheckAnimationTimer();
- __ratio = 0;
+ if (__detailedPressed == false)
+ {
+ StartCheckAnimationTimer();
+ __ratio = 0;
+ }
}
__pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
SysTryReturn(NID_UI_CTRL, (pColorChangeEvent != null), null, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] Memory allocation failed.");
- if (IsFailed(GetLastResult()) == true)
+ if (IsFailed(GetLastResult()))
{
delete pColorChangeEvent;
return null;
__pLuminanceHandler = null;
}
- if (__pHueBarElement)
+ if (__pHueBarElement != null)
{
__pHueBarElement->Activate(false);
__pHueBarElement = null;
}
- if (__pSaturationBarElement)
+ if (__pSaturationBarElement != null)
{
__pSaturationBarElement->Activate(false);
__pSaturationBarElement = null;
}
- if (__pLuminanceBarElement)
+ if (__pLuminanceBarElement != null)
{
__pLuminanceBarElement->Activate(false);
__pLuminanceBarElement = null;
{
__pColorPickerPresenter->SetHue(hue.ToInt());
- if (__pHueBarElement)
+ if (__pHueBarElement != null)
{
String hueValue;
hueValue.Append(__pColorPickerPresenter->GetHue());
{
__pColorPickerPresenter->SetSaturation(saturation.ToInt());
- if (__pSaturationBarElement)
+ if (__pSaturationBarElement != null)
{
String saturationValue;
saturationValue.Append(__pColorPickerPresenter->GetSaturation());
{
__pColorPickerPresenter->SetLuminance(luminance.ToInt());
- if (__pLuminanceBarElement)
+ if (__pLuminanceBarElement != null)
{
String luminanceValue;
luminanceValue.Append(__pColorPickerPresenter->GetLuminance());
__pHueBarElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnVoidResult(NID_UI_CTRL, __pHueBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- __pHueBarElement->SetName("ColorPickerColorSlider");
- __pHueBarElement->SetLabel("Hue Slider");
+ __pHueBarElement->SetName(L"ColorPickerColorSlider");
+ __pHueBarElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_COLOUR_CONTROL_SLIDER_T_TALKBACK");
__pHueBarElement->SetHintWithStringId("IDS_TPLATFORM_BODY_FLICK_UP_AND_DOWN_TO_ADJUST_THE_POSITION_T_TTS");
__pHueBarElement->SetSupportOperatingGesture(false);
__pHueBarElement->SetBounds(FloatRectangle(floatBounds.x, floatBounds.y, floatBounds.width, blockHeight));
__pSaturationBarElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnVoidResult(NID_UI_CTRL, __pSaturationBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- __pSaturationBarElement->SetName("ColorPickerSaturationSlider");
- __pSaturationBarElement->SetLabel("Saturation Slider");
- __pSaturationBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
+ __pSaturationBarElement->SetName(L"ColorPickerSaturationSlider");
+ __pSaturationBarElement->SetTrait(L"Saturation Slider");
__pSaturationBarElement->SetHintWithStringId("IDS_TPLATFORM_BODY_FLICK_UP_AND_DOWN_TO_ADJUST_THE_POSITION_T_TTS");
__pSaturationBarElement->SetSupportOperatingGesture(false);
__pSaturationBarElement->SetBounds(FloatRectangle(floatBounds.x, floatBounds.y + blockHeight, floatBounds.width, blockHeight));
__pLuminanceBarElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnVoidResult(NID_UI_CTRL, __pLuminanceBarElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- __pLuminanceBarElement->SetName("ColorPickerBrightnessSlider");
- __pLuminanceBarElement->SetLabel("Luminance Slider");
- __pLuminanceBarElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
+ __pLuminanceBarElement->SetName(L"ColorPickerBrightnessSlider");
+ __pLuminanceBarElement->SetTrait(L"Luminance Slider");
__pLuminanceBarElement->SetHintWithStringId("IDS_TPLATFORM_BODY_FLICK_UP_AND_DOWN_TO_ADJUST_THE_POSITION_T_TTS");
__pLuminanceBarElement->SetSupportOperatingGesture(false);
__pLuminanceBarElement->SetBounds(FloatRectangle(floatBounds.x, floatBounds.y + 2 * blockHeight, floatBounds.width, blockHeight));
bool
_ColorPicker::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- if (GetEnableState() == false)
+ if (!GetEnableState())
{
return true;
}
bool
_ColorPicker::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- if (GetEnableState() == false)
+ if (!GetEnableState())
{
return true;
}
_ColorPickerImpl::~_ColorPickerImpl(void)
{
- if (__pPublicColorChangeEvent != null)
- {
- delete __pPublicColorChangeEvent;
- __pPublicColorChangeEvent = null;
- }
+ delete __pPublicColorChangeEvent;
+ __pPublicColorChangeEvent = null;
}
_ColorPickerImpl*
SysTryReturn(NID_UI_CTRL, (pColorPickerModel != null), null, E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] Memory allocation failed.");
- if (IsFailed(GetLastResult()) == true)
+ if (IsFailed(GetLastResult()))
{
delete pColorPickerModel;
return null;
rightLeftArrowIconBounds.height = rightLeftArrowIconSize.height;
- if (__pColorPicker->IsEnabled() == false)
+ if (!__pColorPicker->IsEnabled())
{
isCustomBitmap = IS_CUSTOM_BITMAP(COLORPICKER::ARROW_BUTTON_BG_DISABLED);
r = DrawResourceBitmap(canvas, rcButton, __pColorDisabledReplacementBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomBitmap == false)
+ if (!isCustomBitmap)
{
r = DrawResourceBitmap(canvas, rcButton, __pDisabledEffectBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = DrawResourceBitmap(canvas, rcButton, __pColorPressedReplacementBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomBitmap == false)
+ if (!isCustomBitmap)
{
r = DrawResourceBitmap(canvas, rcButton, __pPressedEffectBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = DrawResourceBitmap(canvas, rcButton, __pColorNormalReplacementBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomBitmap == false)
+ if (!isCustomBitmap)
{
r = DrawResourceBitmap(canvas, rcButton, __pNormalEffectBgBitmap);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
bool isHueChanged = __hueColor != __pColorPickerModel->GetHueColor();
bool isSaturationChanged = __saturationColor != __pColorPickerModel->GetSaturationColor();
- if (isHueChanged == true || isSaturationChanged == true)
+ if (isHueChanged || isSaturationChanged)
{
Canvas* pCanvas = __pColorPicker->GetCanvasN();
if (pCanvas != null)
{
- if (isHueChanged == true)
+ if (isHueChanged)
{
DrawSaturationSlider(*pCanvas);
}
- if (isSaturationChanged == true)
+ if (isSaturationChanged)
{
DrawLuminanceSlider(*pCanvas);
}
_ColorPickerComponentType
_ColorPickerPresenter::GetTouchActionType(const FloatPoint& position) const
{
- if (__componentBounds[HUE_BAR].Contains(position) == true)
+ if (__componentBounds[HUE_BAR].Contains(position))
{
return HUE_HANDLER;
}
- else if (__componentBounds[SAT_BAR].Contains(position) == true)
+ else if (__componentBounds[SAT_BAR].Contains(position))
{
return SAT_HANDLER;
}
- else if (__componentBounds[LUM_BAR].Contains(position) == true)
+ else if (__componentBounds[LUM_BAR].Contains(position))
{
return LUM_HANDLER;
}
for (int type = HUE_ARROWLEFT; type < COMPONENT_TYPE_MAX; type++)
{
- if (__componentBounds[type].Contains(position) == true)
+ if (__componentBounds[type].Contains(position))
{
return (_ColorPickerComponentType)type;
}
SetTouchCapture(true, false);
}
+ GetEcoreEvasMgr()->GetEcoreEvas()->SetWindowBounds(*this, GetBoundsF());
+
SetAllAccessibilityElement();
_VisualElement* pVisualElement = GetVisualElement();
pElement->SetName(L"ContextMenuItem" + Integer::ToString(i));
if (pItem->GetType() == CONTEXT_MENU_ITEM_DRAWING_TYPE_BITMAP)
{
- pElement->SetLabel(L"icon");
+ pElement->SetLabelWithStringId("IDS_TPLATFORM_BODY_ICON");
}
else
{
float screenLeftMargin = __screenLeftMargin;
float screenRightMargin = __screenRightMargin;
+ int scrollPanelMargin;
+ GET_SHAPE_CONFIG(CONTEXTMENU::SCROLL_PANEL_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, scrollPanelMargin);
+
FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition();
FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF();
AdjustItemLayout();
bodyRect.width = __layoutSize.width + bodyLeftMargin + bodyRightMargin;
- bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin;
+ bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin + 2 * scrollPanelMargin;
// calculate the position of the arrow and body rect.
if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_UP) // down Arrow
}
itemRect.x = bodyRect.x + bodyLeftMargin;
- itemRect.y = bodyRect.y + bodyTopMargin;
+ itemRect.y = bodyRect.y + bodyTopMargin + scrollPanelMargin;
itemRect.width = __layoutSize.width;
itemRect.height = __layoutSize.height;
// _Scroll visual interaction if Bounds < ScrollAreaBounds
if (__pContextMenu->IsVisible())
{
- int itemTopMargin;
- GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_BG_PRESSED_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemTopMargin);
- __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + itemTopMargin,
- __layoutSize.width, __layoutSize.height - 2 * itemTopMargin));
+ __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + scrollPanelMargin,
+ __layoutSize.width, __layoutSize.height));
int itemCount = __pModel->GetItemCount();
float itemHeight = __itemHeight + (__dividerHeight * 2.0f);
float layoutClientHeight = itemCount * itemHeight - (__dividerHeight * 2.0f);
- __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight - 2 * itemTopMargin);
+ __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight);
}
__pContextMenu->SetMovable(true);
{
maxItemWidth = itemSize.width;
}
+ __itemWidth = maxItemWidth;
}
-
- __itemWidth = maxItemWidth;
}
int
_DatePickerImpl::~_DatePickerImpl(void)
{
- if (__pPublicDateTimeChangeEvent != null)
- {
- delete __pPublicDateTimeChangeEvent;
- __pPublicDateTimeChangeEvent = null;
- }
+ delete __pPublicDateTimeChangeEvent;
+ __pPublicDateTimeChangeEvent = null;
}
_DatePickerImpl*
ClearLastResult();
DateTime dateTime;
- SystemTime::GetCurrentTime(WALL_TIME, dateTime);
+ SystemTime::GetCurrentTime(TIME_MODE_WALL, dateTime);
SetDate(dateTime);
}
GetVisualElement()->RemoveAllAnimations();
}
- if (__pDateTimeChangeEvent != null)
- {
- delete __pDateTimeChangeEvent;
- __pDateTimeChangeEvent = null;
- }
+ delete __pDateTimeChangeEvent;
+ __pDateTimeChangeEvent = null;
- if (__pActionEvent)
- {
- delete __pActionEvent;
- __pActionEvent = null;
- }
+ delete __pActionEvent;
+ __pActionEvent = null;
delete __pDateTimeBarPresenter;
__pDateTimeBarPresenter = null;
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
pContainer->AddListener(*this);
result r = E_OBJ_NOT_FOUND;
- if (__pActionEvent)
+ if (__pActionEvent != null)
{
r = __pActionEvent->RemoveListener(listener);
}
{
ClearLastResult();
- if (__pActionEvent)
+ if (__pActionEvent != null)
{
Tizen::Base::Runtime::IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(actionId);
result r = GetLastResult();
return;
}
+void
+_DateTimeBar::RemoveAllAnimations(void)
+{
+ VisualElement *pDateTimeBarElement = GetVisualElement();
+
+ if (pDateTimeBarElement != null)
+ {
+ pDateTimeBarElement->RemoveAllAnimations();
+ }
+}
+
bool
_DateTimeBar::OnFocusGained(const _Control& control)
{
bool
_DateTimeBar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
{
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ if (keyCode == _KEY_ENTER && __isAnimating)
+ {
+ if (GetSelectedBoxId() >= DATETIME_ID_YEAR && GetSelectedBoxId() <= DATETIME_ID_DAY)
+ {
+ FireDateTimeChangeEvent(DATE_INTERNAL_CHANGE_CANCELED);
+ }
+ else if (GetSelectedBoxId() >= DATETIME_ID_HOUR && GetSelectedBoxId() <= DATETIME_ID_MINUTE)
+ {
+ FireDateTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
+ }
+ Close();
+ return true;
+ }
+
return __pDateTimeBarPresenter->OnKeyReleased(source,keyInfo);
}
}
pBoundsAnimation->SetDuration(ANIMATION_DURATION);
pBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
+ __isAnimating = true;
pAnimationGroup->AddAnimation(*pBoundsAnimation);
delete pBoundsAnimation;
pBoundsAnimation = null;
VisualElement* pVisualElement = null;
VisualElementAnimation *pAnimation = null;
- __isAnimating = true;
pVisualElement = GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element.");
pAnimation = CreateAnimationN(*pVisualElement, false);
if (itemStatus == DATETIMEBAR_ITEM_STATUS_SELECTED || itemStatus == DATETIMEBAR_ITEM_STATUS_HIGHLIGHTED)
{
- (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize);
+ (_FontImpl::GetInstance(*__pFont))->SetSize(fontSize);
(_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD);
pTextObject->SetFont(__pFont, 0, pTextObject->GetTextLength());
pTextObject->SetForegroundColor(textPressedColor, 0, pTextObject->GetTextLength());
itemBounds.x = itemBounds.x - (itemMargin / 2.0f);
itemBounds.width = itemBounds.width + itemMargin;
- if (itemBounds.Contains(point) == true)
+ if (itemBounds.Contains(point))
{
return itemIndex;
}
break;
}
-
case KEY_LEFT:
{
if ((__focusBounds.x - __focusBounds.width) < 0)
__pDateTimeBar->Invalidate();
break;
}
+ default:
+ {
+ return false;
+ }
+ }
+ return true;
+}
+bool
+_DateTimeBarPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ if (!__isFocused && keyCode == _KEY_ENTER)
+ {
+ return true;
+ }
+
+ switch (keyCode)
+ {
case KEY_ENTER:
{
+ if (__isInitialAnimation)
+ {
+ if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_YEAR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_DAY)
+ {
+ __pDateTimeBar->FireDateTimeChangeEvent(DATE_INTERNAL_CHANGE_CANCELED);
+ }
+ else if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_HOUR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_MINUTE)
+ {
+ __pDateTimeBar->FireDateTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
+ }
+ __pDateTimeBar->CloseDateTimeBar();
+ __isFocused = false;
+ return true;
+ }
+
_DateTimeBarItem* pItem = null;
SetItemSelected(__focusedIndex);
if (pItem != null)
{
- __pDateTimeBar->SetVisibleState(false);
__pDateTimeBar->CloseDateTimeBar();
__pDateTimeBar->FireActionEvent(pItem->GetActionId());
__isFocused = false;
break;
}
+ case KEY_ESC:
+ //fall through
+ case KEY_BACK:
+ {
+ __pDateTimeBar->CloseDateTimeBar();
+ ResetFlickAnimationTimer();
+ if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_YEAR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_DAY)
+ {
+ __pDateTimeBar->FireDateTimeChangeEvent(DATE_INTERNAL_CHANGE_CANCELED);
+ }
+ else if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_HOUR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_MINUTE)
+ {
+ __pDateTimeBar->FireDateTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
+ }
+ break;
+ }
default:
{
return false;
}
}
-
return true;
}
bool
-_DateTimeBarPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
-{
- _KeyCode keyCode = keyInfo.GetKeyCode();
-
- if (keyCode == _KEY_ESC || keyCode == _KEY_BACK)
- {
- __pDateTimeBar->CloseDateTimeBar();
- ResetFlickAnimationTimer();
-
- if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_YEAR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_DAY)
- {
- __pDateTimeBar->FireDateTimeChangeEvent(DATE_INTERNAL_CHANGE_CANCELED);
- }
- else if (__pDateTimeBar->GetSelectedBoxId() >= DATETIME_ID_HOUR && __pDateTimeBar->GetSelectedBoxId() <= DATETIME_ID_MINUTE)
- {
- __pDateTimeBar->FireDateTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
- }
-
- return true;
- }
-
- return false;
-}
-
-bool
_DateTimeBarPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
if (__isFocused)
, __hour(0)
, __minute(0)
{
- SystemTime::GetCurrentTime(WALL_TIME, __dateTime);
+ SystemTime::GetCurrentTime(TIME_MODE_WALL, __dateTime);
}
_DateTimeChangeEventArg::~_DateTimeChangeEventArg(void)
void
_DateTimeDisplayBox::DrawDisplayBox(Canvas& canvas, DateTimePickerStatus status)
{
- if ((__focusable == false) && (status == DATETIME_STATUS_HIGHLIGHTED))
+ if ((!__focusable) && (status == DATETIME_STATUS_HIGHLIGHTED))
{
status = DATETIME_STATUS_NORMAL;
}
isCustomBitmap[DATETIME_STATUS_DISABLED] = IS_CUSTOM_BITMAP(DATETIMEPICKER::CONTENT_BG_DISABLED);
}
- if (isCustomBitmap[status] == false && __pBackgroundEffectBitmap[status] != null)
+ if (!isCustomBitmap[status] && __pBackgroundEffectBitmap[status] != null)
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBackgroundEffectBitmap[status]))
{
_DateTimeModel::SetCurrentDateTime(void)
{
DateTime dateTime;
- SystemTime::GetCurrentTime(WALL_TIME, dateTime);
+ SystemTime::GetCurrentTime(TIME_MODE_WALL, dateTime);
SetYear(dateTime.GetYear());
SetMonth(dateTime.GetMonth());
, __pDateTimeChangeEvent(null)
, __pFont(null)
, __pDisplayVisualElement(null)
+ , __isInFocusMode(false)
{
}
{
SettingInfo::RemoveSettingEventListener(*this);
- if (__pDateTimeChangeEvent != null)
- {
- delete __pDateTimeChangeEvent;
- __pDateTimeChangeEvent = null;
- }
+ delete __pDateTimeChangeEvent;
+ __pDateTimeChangeEvent = null;
if (__pFooter != null)
{
r = pCancelButton->SetText(text);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
- r = pFooter->AddItem(pSaveButton);
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
-
r = pFooter->AddItem(pCancelButton);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.");
+ r = pFooter->AddItem(pSaveButton);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
if (__pFooter != null)
{
DetachSystemChild(*__pFooter);
{
FloatRectangle displayBoxBounds = pBox->GetDisplayBoxBounds();
- if (__pDisplayVisualElement)
+ if (__pDisplayVisualElement != null)
{
displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
}
bool
_DateTimePicker::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
{
- if (&source != this)
+ if (&source != this && &source != __pFooter)
{
return false;
}
bool
_DateTimePicker::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
{
- if (&source != this)
+ if (&source != this && &source != __pFooter)
{
return false;
}
_DateTimePicker::OnDrawFocus(void)
{
__pPresenter->DrawFocus();
+ __isInFocusMode = true;
return;
}
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
_Control::OnFocusLost(source);
+ __isInFocusMode = false;
return true;
}
void
_DateTimePicker::OnFocusModeStateChanged(void)
{
- __pPresenter->ReleaseFocus();
+ if (__isInFocusMode)
+ {
+ __pPresenter->ReleaseFocus();
+ __isInFocusMode = false;
+ }
+
return;
}
displayBoxBounds.y -= topMargin;
displayBoxBounds.height += 2 * topMargin;
- if (__pDisplayVisualElement)
+ if (__pDisplayVisualElement != null)
{
displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
}
amPmBoxBounds.x += leftMargin;
- if (__pDisplayVisualElement)
+ if (__pDisplayVisualElement != null)
{
amPmBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
}
_DateTimePickerImpl::~_DateTimePickerImpl(void)
{
- if (__pPublicDateTimeChangeEvent != null)
- {
- delete __pPublicDateTimeChangeEvent;
- __pPublicDateTimeChangeEvent = null;
- }
+ delete __pPublicDateTimeChangeEvent;
+ __pPublicDateTimeChangeEvent = null;
}
_DateTimePickerImpl*
delete __pPmBox;
__pPmBox = null;
- if ((__inputPadEnabled == true) && (__pInputPad != null))
+ if ((__inputPadEnabled) && (__pInputPad != null))
{
__pView->DetachChild(*__pInputPad);
delete __pInputPad;
UpdateTimeFormat();
LoadPickerData();
- if (__inputPadEnabled == true)
+ if (__inputPadEnabled)
{
__pInputPad = new (std::nothrow) _InputPad;
SysTryCatch(NID_UI_CTRL, (__pInputPad != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__pInputPad->SetFont(__pFont);
- if (__pInputPad->IsFocusable() == true)
+ if (__pInputPad->IsFocusable())
{
__pInputPad->SetFocusable(false);
}
int touchedAreaId = CalculateTouchArea(touchinfo.GetCurrentPosition().x, touchinfo.GetCurrentPosition().y);
- if (__isPmButtonPressed == true)
+ if (__isPmButtonPressed)
{
if (touchedAreaId == DATETIME_AREA_OUTPUT_AMPM)
{
return false;
}
- if (__isPmButtonPressed == true && keyCode == _KEY_ENTER)
+ if (__isPmButtonPressed && keyCode == _KEY_ENTER)
{
__isPm = (!__isPm);
__isPmButtonPressed = false;
void
_DateTimePresenter::HandleInputPadValueChange(int inputPadReturnValue)
{
- if ((__inputPadEnabled == false) || (inputPadReturnValue == -1))
+ if ((!__inputPadEnabled) || (inputPadReturnValue == -1))
{
return;
}
- if ((__keypadEnabled == true) && (__pickerStyle != DATETIME_OUTPUT_STYLE_DATE) && (__focusedBoxIndex == __outputBoxMaxCount))
+ if ((__keypadEnabled) && (__pickerStyle != DATETIME_OUTPUT_STYLE_DATE) && (__focusedBoxIndex == __outputBoxMaxCount))
{
//in case of Am/Pm if keypad enabled, inputpad values need not be handled though in focus
return;
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_SIP, __pView);
__changeFocusCounter++;
- if (__isFocusBoxChanged == true)
+ if (__isFocusBoxChanged)
{
newNumber = inputPadReturnValue;
__isFocusBoxChanged = false;
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_SIP, __pView);
__changeFocusCounter++;
- if (__isFocusBoxChanged == true)
+ if (__isFocusBoxChanged)
{
newNumber = inputPadReturnValue;
__isFocusBoxChanged = false;
boxCount++;
// AmPm Button
- if (__is24HourNotation == false)
+ if (!__is24HourNotation)
{
pPmBox = new (std::nothrow) _DateTimeDisplayBox(amPmBounds, DATETIME_ID_AMPM);
SysTryCatch(NID_UI_CTRL, (pPmBox != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = _FontImpl::GetInstance(*__pFont)->SetSize(fontSize);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
- if (__pView->IsEnabled() == false)
+ if (!__pView->IsEnabled())
{
status = DATETIME_STATUS_DISABLED;
}
{
String text;
- if ((__is24HourNotation == true) || (__pPmBox == null))
+ if ((__is24HourNotation) || (__pPmBox == null))
{
return;
}
_DateTimeUtils dateTimeUtils;
- if (__isPm == false)
+ if (!__isPm)
{
dateTimeUtils.GetAmPm(text, AM_TYPE);
}
__pPmBox->SetText(text);
- if (__pView->IsEnabled() == false)
+ if (!__pView->IsEnabled())
{
__pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_DISABLED);
}
- else if (__isPmButtonPressed == true)
+ else if (__isPmButtonPressed)
{
__pPmBox->DrawDisplayBox(canvas, DATETIME_STATUS_SELECTED);
}
canvas.SetBackgroundColor(backgroundColor);
canvas.Clear();
- if (__pBgNormalBitmap)
+ if (__pBgNormalBitmap != null)
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBgNormalBitmap))
{
}
}
- if (__pBgEffectBitmap)
+ if (__pBgEffectBitmap != null)
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBgEffectBitmap))
{
void
_DateTimePresenter::ChangeInputPadStyle(int boxId)
{
- if (__inputPadEnabled == false)
+ if (!__inputPadEnabled)
{
return;
}
__day = GetDay();
__hour = GetHour();
- if (__is24HourNotation == false)
+ if (!__is24HourNotation)
{
int max = DATETIME_HOUR_MAX_FOR_24NOTATION;
SetMonth(__month);
SetDay(__day);
- if (__is24HourNotation == false)
+ if (!__is24HourNotation)
{
int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
- if (__isPm == true)
+ if (__isPm)
{
if (__hour < maxHour)
{
case DATETIME_ID_HOUR:
__hour = GetHour();
- if (__is24HourNotation == false)
+ if (!__is24HourNotation)
{
int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
case DATETIME_ID_HOUR:
minValue = DATETIME_HOUR_MIN;
maxValue = DATETIME_HOUR_MAX;
- if (__is24HourNotation == false)
+ if (!__is24HourNotation)
{
maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
}
else if (pEditPresenter->IsCopyPasteHandle(source))
{
- pEditPresenter->ReleaseCopyPastePopup();
return false;
}
else if (pEditPresenter->IsCopyPastePopupExist())
{
__pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
__pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
- __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
+// __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
__pClearButtonTextAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
__pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton");
pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement);
{
__pClearButtonTextAccessibilityElement = new _AccessibilityElement(true);
__pClearButtonTextAccessibilityElement->SetBounds(_pEditPresenter->GetClearIconBoundsF());
- __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
+// __pClearButtonTextAccessibilityElement->SetLabel(L"all clear");
__pClearButtonTextAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
__pClearButtonTextAccessibilityElement->SetName(L"EditFieldClearButton");
pEditAccessibilityContainer->AddElement(*__pClearButtonTextAccessibilityElement);
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, eventstatus);
SysTryReturn(NID_UI_CTRL, pEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create _KeypadEventArg.");
+ _pEditPresenter->SetSentKeypadEvent(eventstatus);
+
__pKeypadEvent->Fire(*pEventArg);
}
* @file FUiCtrl_EditCopyPasteManager.cpp
* @brief This is the implementation file for the _EditCopyPasteManager class.
*/
-
+#include "FUiAnim_ControlVisualElement.h"
+#include "FUiAnim_VisualElementImpl.h"
#include <appsvc/appsvc.h>
#include <FApp_AppControlManager.h>
#include <FApp_AppMessageImpl.h>
const int COPY_PASTE_SEARCH_ID = 237;
class _EditCopyPasteMagnifier
- : public _Window
+ : public _Control
{
public:
- _EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, int handlerCursorPos);
+ _EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, int handlerCursorPos);
virtual ~_EditCopyPasteMagnifier(void);
- static _EditCopyPasteMagnifier* CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager);
+ static _EditCopyPasteMagnifier* CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow);
virtual void OnDraw(void);
void CaptureTextArea(Canvas& canvas);
void MoveMagnifier(const FloatPoint& point, int handlerCursorPos);
Bitmap* GetMagnifierBitmap(void) const;
- virtual result OnAttachedToMainTree(void);
- result OnBoundsChanging(const FloatRectangle& bounds);
- result OnBoundsChanging(const Rectangle& bounds);
void SetRowColumnIndex(int rowIndex, int columnIndex);
private:
FloatRectangle __windowBounds;
int __rowIndex;
int __columnIndex;
+ _Window* __pParentWindow;
};
-_EditCopyPasteMagnifier::_EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, int handlerCursorPos)
+_EditCopyPasteMagnifier::_EditCopyPasteMagnifier(_EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, int handlerCursorPos)
: __pCopyPasteManager(pCopyPasteManager)
, __pMagnifierBitmap(null)
, __pMagnifierMaskBitmap(null)
, __windowBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __rowIndex(-1)
, __columnIndex(-1)
+ , __pParentWindow(pParentWindow)
{
AcquireHandle();
- __pRoot = GetVisualElement();
- __pRoot->SetSurfaceOpaque(false);
GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierBitmap);
GET_BITMAP_CONFIG_N(EDIT::COPY_PASTE_MAGNIFIER_MASK, BITMAP_PIXEL_FORMAT_ARGB8888, __pMagnifierMaskBitmap);
+
+ if (__pParentWindow)
+ {
+ __pParentWindow->AttachChild(*this);
+ }
+
+ _VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(*GetVisualElement());
+ pImpl->SetZOrderGroup(_ControlVisualElement::Z_ORDER_GROUP_CONTROL + 5);
}
_EditCopyPasteMagnifier::~_EditCopyPasteMagnifier(void)
{
+ if (__pParentWindow)
+ {
+ __pParentWindow->DetachChild(*this);
+ }
if (__pMagnifierBitmap)
{
delete __pMagnifierBitmap;
}
_EditCopyPasteMagnifier*
-_EditCopyPasteMagnifier::CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager)
+_EditCopyPasteMagnifier::CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow)
{
- _EditCopyPasteMagnifier* pCopyPasteMagnifier = new (std::nothrow) _EditCopyPasteMagnifier(pCopyPasteManager, handlerCursorPos);
+ _EditCopyPasteMagnifier* pCopyPasteMagnifier = new (std::nothrow) _EditCopyPasteMagnifier(pCopyPasteManager, pParentWindow, handlerCursorPos);
SysTryReturn(NID_UI_CTRL, pCopyPasteMagnifier != null, null, E_OUT_OF_MEMORY, "pCopyPasteMagnifier is null");
FloatPoint cursorPoint(point);
Bitmap* pMagnifierBitmap = pCopyPasteMagnifier->GetMagnifierBitmap();
SysTryReturn(NID_UI_CTRL, pMagnifierBitmap != null, null, E_OUT_OF_MEMORY, "pMagnifierBitmap is null");
- result r = pCopyPasteMagnifier->CreateRootVisualElement();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pCopyPasteMagnifier->SetActivationEnabled(false);
-
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_WIDTH, orientation, width);
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_HEIGHT, orientation, height);
{
bounds.y = 0.0f;
}
+ bounds.x -= (pParentWindow->GetAbsoluteBoundsF(true).x + pParentWindow->GetClientBoundsF().x);
+ bounds.y -= (pParentWindow->GetAbsoluteBoundsF(true).y + pParentWindow->GetClientBoundsF().y);
pCopyPasteMagnifier->SetBounds(bounds);
- pCopyPasteMagnifier->Open();
return pCopyPasteMagnifier;
-
-CATCH:
- pCopyPasteMagnifier->Close();
- delete pCopyPasteMagnifier;
-
- return null;
-}
-
-result
-_EditCopyPasteMagnifier::OnAttachedToMainTree(void)
-{
- result r = E_SUCCESS;
-
- if (GetOwner() == null)
- {
- _Edit* pEdit = __pCopyPasteManager->GetEdit();
- SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEdit.");
-
- _EditPresenter* pEditPresenter = pEdit->GetPresenter();
- SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEditPresenter.");
-
- _Form* pParentForm = pEditPresenter->GetParentForm();
- if (pParentForm)
- {
- SetOwner(pParentForm);
- }
- else
- {
- _Form* pForm = null;
- _Frame* pCurrentFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- if (pCurrentFrame)
- {
- pForm = pCurrentFrame->GetCurrentForm();
- if (pForm)
- {
- SetOwner(pForm);
- }
- else
- {
- SetOwner(pCurrentFrame);
- }
- }
- }
- }
-
- return r;
}
void
_EditCopyPasteMagnifier::OnDraw(void)
{
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- SysTryReturnVoidResult(NID_UI_CTRL, pEcoreEvas, E_INVALID_STATE, "pEcoreEvas is null.");
-
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), __windowBounds);
-
Canvas* pCanvas = GetCanvasN();
if (pCanvas == null)
{
Color editColor = __pCopyPasteManager->GetEdit()->GetColor(EDIT_STATUS_HIGHLIGHTED);
if (editColor.GetAlpha() == 0x00)
{
- editColor = Color::GetColor(COLOR_ID_WHITE);
+ byte r,g,b,a;
+ editColor = __pCopyPasteManager->GetEdit()->GetTextColor(EDIT_STATUS_HIGHLIGHTED);
+ editColor.GetColorComponents(r,g,b,a);
+ byte max = (r >= g) ? r:g;
+ max = (max >= b) ? max:b;
+ if (max >= 255/2)
+ {
+ editColor = Color::GetColor(COLOR_ID_BLACK);
+ }
+ else
+ {
+ editColor = Color::GetColor(COLOR_ID_WHITE);
+ }
}
Bitmap* pReplacedMaskBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pMagnifierMaskBitmap, Color::GetColor(COLOR_ID_MAGENTA), editColor);
float adjustPosY = 0.0f;
FloatRectangle cursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle captureBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _VisualElementImpl* pEditVisualElementImpl = null;
_Edit* pEdit = __pCopyPasteManager->GetEdit();
SysTryReturnVoidResult(NID_UI_CTRL, pEdit, E_INVALID_STATE, "pEdit is null.");
+ _VisualElement* pEditVisualElement = pEdit->GetVisualElement();
+ SysTryReturnVoidResult(NID_UI_CTRL, pEditVisualElement, E_INVALID_STATE, "pEditVisualElement is null.");
+
_EditPresenter* pEditPresenter = pEdit->GetPresenter();
SysTryReturnVoidResult(NID_UI_CTRL, pEditPresenter, E_INVALID_STATE, "pEditPresenter is null.");
- pEditPresenter->CalculateCursorBounds(pEditPresenter->GetTextBoundsF(), cursorBounds, __handlerCursorPos);
+ pEditPresenter->CalculateCursorBounds(pEditPresenter->GetTextBoundsF(), cursorBounds,__handlerCursorPos);
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_CAPTURE_WIDTH, pEdit->GetOrientation(), captureWidth);
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_CAPTURE_HEIGHT, pEdit->GetOrientation(), captureHeight);
GET_SHAPE_CONFIG(EDIT::COPYPASTE_MAGNIFIER_CAPTURE_POSITION_Y, pEdit->GetOrientation(), capturePosY);
FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
-
- // textobject minimum width/height
- if (pEdit->GetBoundsF().width < textObjectBounds.width)
- {
- textObjectBounds.width = pEdit->GetBoundsF().width - pEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN) - pEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
- }
-
- captureBounds.x = cursorBounds.x + cursorBounds.width/2.0f - captureWidth/2.0f;
+ captureBounds.x = cursorBounds.x - captureWidth/2.0f;
captureBounds.y = cursorBounds.y + cursorBounds.height/2.0f - captureHeight/2.0f;
captureBounds.width = captureWidth;
captureBounds.height = captureHeight;
adjustPosY = captureHeight - captureBounds.height;
}
- Bitmap* pOriginalBitmp = pEdit->GetCapturedBitmapN(true);
- SysTryReturnVoidResult(NID_UI_CTRL, pOriginalBitmp, E_INVALID_STATE, "pOriginalBitmp is null.");
+ Bitmap* pOriginalBitmp = null;
+ Canvas* pCanvas = new (std::nothrow) Canvas;
+ SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, E_OUT_OF_MEMORY, "pCanvas is null.");
- Bitmap bitmap;
- r = bitmap.Construct(FloatRectangle(0, 0, captureBounds.width, captureBounds.height));
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pCanvas->Construct(FloatRectangle(0, 0, captureBounds.width, captureBounds.height));
+ SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagated.", GetErrorMessage(r));
- r = bitmap.Merge(FloatPoint(0.0f, 0.0f), *pOriginalBitmp, CoordinateSystem::AlignToDevice(FloatRectangle(captureBounds.x, captureBounds.y, captureBounds.width, captureBounds.height)));
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ pEditVisualElementImpl = _VisualElementImpl::GetInstance(*pEditVisualElement);
+
+ pEditVisualElementImpl->Capture(*pCanvas, CoordinateSystem::AlignToDevice(FloatRectangle(0, 0, captureBounds.width, captureBounds.height)), CoordinateSystem::AlignToDevice(captureBounds), true);
+
+ pOriginalBitmp = new (std::nothrow) Bitmap;
+ SysTryCatch(NID_UI, pOriginalBitmp != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+
+ r = pOriginalBitmp->Construct(*pCanvas, CoordinateSystem::AlignToDevice(FloatRectangle(0, 0, captureBounds.width, captureBounds.height)));
- r = bitmap.SetScalingQuality(BITMAP_SCALING_QUALITY_HIGH);
+ r = pOriginalBitmp->SetScalingQuality(BITMAP_SCALING_QUALITY_HIGH);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = bitmap.Scale(CoordinateSystem::AlignToDevice(FloatDimension(bitmap.GetActualWidth()*1.5f, bitmap.GetActualHeight()*1.5f)));
+ r = pOriginalBitmp->Scale(CoordinateSystem::AlignToDevice(FloatDimension(pOriginalBitmp->GetActualWidth()*1.5f, pOriginalBitmp->GetActualHeight()*1.5f)));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- canvas.DrawBitmap(CoordinateSystem::AlignToDevice(FloatPoint(capturePosX + adjustPosX*1.5f, capturePosY + adjustPosY*1.5f)), bitmap);
+ canvas.DrawBitmap(CoordinateSystem::AlignToDevice(FloatPoint(capturePosX + adjustPosX*1.5f, capturePosY + adjustPosY*1.5f)), *pOriginalBitmp);
+ delete pCanvas;
delete pOriginalBitmp;
return;
CATCH:
+ delete pCanvas;
delete pOriginalBitmp;
return;
{
bounds.y = 0.0f;
}
+ bounds.x -= (__pParentWindow->GetAbsoluteBoundsF(true).x + __pParentWindow->GetClientBoundsF().x);
+ bounds.y -= (__pParentWindow->GetAbsoluteBoundsF(true).y + __pParentWindow->GetClientBoundsF().y);
SetBounds(bounds);
Invalidate();
}
-result
-_EditCopyPasteMagnifier::OnBoundsChanging(const FloatRectangle& bounds)
-{
- result r = E_SUCCESS;
-
- __windowBounds = bounds;
-
- return r;
-}
-
-result
-_EditCopyPasteMagnifier::OnBoundsChanging(const Rectangle& bounds)
-{
- result r = E_SUCCESS;
-
- return r;
-}
-
void
_EditCopyPasteMagnifier::SetRowColumnIndex(int rowIndex, int columnIndex)
{
*
*/
class _EditCopyPasteHandler
- : public _Window
+ : public _Control
, virtual public IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
* This is the default class constructor.
*
*/
- _EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler);
- _EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler);
+ _EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler);
+ _EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler);
/**
* This is the default class destructor.
HANDLER_DIRECTION_REVERSE_3,//horizontal vertical reverse
};
- static _EditCopyPasteHandler* CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler = true);
- static _EditCopyPasteHandler* CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler = true);
+ static _EditCopyPasteHandler* CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler = true);
+ static _EditCopyPasteHandler* CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler = true);
int GetHandlerCursorPosition(void) const;
void GetHandlerRowColumnIndex(int& rowIndex, int& columnIndex) const;
void SetHandlerCursorPosition(int handlerCursorPos);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
virtual bool IsActivatedOnOpen(void) const;
virtual void OnChangeLayout(_ControlOrientation orientation);
- virtual result OnAttachedToMainTree(void);
-
- result OnBoundsChanging(const Rectangle& bounds);
- result OnBoundsChanging(const FloatRectangle& bounds);
- result SetWindowBounds(const Rectangle& bounds);
- result SetWindowBounds(const FloatRectangle& bounds);
private:
_EditCopyPasteHandler(const _EditCopyPasteHandler& value);
bool __isTouchMoving;
int __rowIndex;
int __columnIndex;
+ _Window* __pParentWindow;
}; // _EditCopyPasteHandler
Bitmap*
{
pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, cursorBounds);
}
- __pCopyPasteMagnifier = _EditCopyPasteMagnifier::CreateInstanceN(FloatPoint(cursorBounds.x, cursorBounds.y), __handlerCursorPos, __pCopyPasteManager);
+ __pCopyPasteMagnifier = _EditCopyPasteMagnifier::CreateInstanceN(FloatPoint(cursorBounds.x, cursorBounds.y), __handlerCursorPos, __pCopyPasteManager, __pParentWindow);
SysTryReturn(NID_UI_CTRL, __pCopyPasteMagnifier, false, E_INVALID_STATE, "[E_INVALID_STATE] __pCopyPasteMagnifier is null.\n");
__pCopyPasteMagnifier->SetRowColumnIndex(__rowIndex, __columnIndex);
{
if (__pCopyPasteMagnifier)
{
- __pCopyPasteMagnifier->Close();
delete __pCopyPasteMagnifier;
__pCopyPasteMagnifier = null;
}
}
}
-_EditCopyPasteHandler::_EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler)
+_EditCopyPasteHandler::_EditCopyPasteHandler(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler)
: __pRoot(null)
, __pHandlerBitmap(null)
, __touchPressedPoint(0.0f, 0.0f)
, __isTouchMoving(false)
, __rowIndex(-1)
, __columnIndex(-1)
+ , __pParentWindow(pParentWindow)
{
- AcquireHandle();
-
- __pRoot = GetVisualElement();
- __pRoot->SetSurfaceOpaque(false);
-
Point handlerPoint(point);
if (singleHandler)
FloatRectangle bounds(handlerPoint.x, handlerPoint.y, __pHandlerBitmap->GetWidth(), __pHandlerBitmap->GetHeight());
}
-_EditCopyPasteHandler::_EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler)
+_EditCopyPasteHandler::_EditCopyPasteHandler(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler)
: __pRoot(null)
, __pHandlerBitmap(null)
, __touchPressedPoint(0.0f, 0.0f)
, __isTouchMoving(false)
, __rowIndex(-1)
, __columnIndex(-1)
+ , __pParentWindow(pParentWindow)
{
- AcquireHandle();
-
- __pRoot = GetVisualElement();
- __pRoot->SetSurfaceOpaque(false);
//To do .....
//Point handlerPoint(_CoordinateSystemUtils::ConvertToInteger(point));
}
_EditCopyPasteHandler*
-_EditCopyPasteHandler::CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler)
+_EditCopyPasteHandler::CreateInstanceN(const Point& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler)
{
- _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, singleHandler, leftHandler);
+ _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, pParentWindow, singleHandler, leftHandler);
SysTryReturn(NID_UI_CTRL, pCopyPasteHandler != null, null, E_OUT_OF_MEMORY, "pContextMenu is null");
Point handlerPoint(point);
Rectangle bounds(0, 0, 0, 0);
Bitmap* pHandlerBitmap = pCopyPasteHandler->GetHandlerBitmap();
- result r = pCopyPasteHandler->CreateRootVisualElement();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pCopyPasteHandler->SetActivationEnabled(false);
-
if (singleHandler)
{
handlerPoint.x = handlerPoint.x - (pHandlerBitmap->GetWidth() / 2);
bounds.width = pHandlerBitmap->GetWidth();
bounds.height = pHandlerBitmap->GetHeight();
+ bounds.x -= pParentWindow->GetAbsoluteBounds(true).x;
+ bounds.y -= pParentWindow->GetAbsoluteBounds(true).y;
+
pCopyPasteHandler->SetBounds(bounds);
pCopyPasteHandler->CheckReverseStatus();
- pCopyPasteHandler->Open(false);
+ pCopyPasteHandler->AcquireHandle();
return pCopyPasteHandler;
-
-CATCH:
- pCopyPasteHandler->Close();
- delete pCopyPasteHandler;
-
- return null;
}
_EditCopyPasteHandler*
-_EditCopyPasteHandler::CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, bool singleHandler, bool leftHandler)
+_EditCopyPasteHandler::CreateInstanceN(const FloatPoint& point, int handlerCursorPos, _EditCopyPasteManager* pCopyPasteManager, _Window* pParentWindow, bool singleHandler, bool leftHandler)
{
- _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, singleHandler, leftHandler);
+ _EditCopyPasteHandler* pCopyPasteHandler = new (std::nothrow) _EditCopyPasteHandler(point, handlerCursorPos, pCopyPasteManager, pParentWindow, singleHandler, leftHandler);
SysTryReturn(NID_UI_CTRL, pCopyPasteHandler != null, null, E_OUT_OF_MEMORY, "pContextMenu is null");
FloatPoint handlerPoint(point);
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
Bitmap* pHandlerBitmap = pCopyPasteHandler->GetHandlerBitmap();
- result r = pCopyPasteHandler->CreateRootVisualElement();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pCopyPasteHandler->SetActivationEnabled(false);
-
if (singleHandler)
{
handlerPoint.x = handlerPoint.x - (pHandlerBitmap->GetWidthF() / 2.0f);
bounds.width = pHandlerBitmap->GetWidthF();
bounds.height = pHandlerBitmap->GetHeightF();
+ bounds.x -= (pParentWindow->GetAbsoluteBoundsF(true).x + pParentWindow->GetClientBoundsF().x);
+ bounds.y -= (pParentWindow->GetAbsoluteBoundsF(true).y + pParentWindow->GetClientBoundsF().y);
pCopyPasteHandler->SetBounds(bounds);
pCopyPasteHandler->CheckReverseStatus();
- pCopyPasteHandler->Open(false);
+ pCopyPasteHandler->AcquireHandle();
return pCopyPasteHandler;
-
-CATCH:
- pCopyPasteHandler->Close();
- delete pCopyPasteHandler;
-
- return null;
}
int
_EditCopyPasteHandler::AdjustBounds(void)
{
FloatRectangle cursorRect;
- FloatRectangle rect = GetBoundsF();
+ FloatRectangle rect = GetAbsoluteBoundsF(true);
FloatPoint checkPoint(0.0f, 0.0f);
_Edit* pEdit = __pCopyPasteManager->GetEdit();
_EditPresenter* pEditPresenter = pEdit->GetPresenter();
if (visibleState && !GetVisibleState())
{
SetVisibleState(true);
- Open();
}
else if (!visibleState && GetVisibleState())
{
SetVisibleState(false);
- Close();
}
}
-
+ rect.x -= (__pParentWindow->GetAbsoluteBoundsF(true).x + __pParentWindow->GetClientBoundsF().x);
+ rect.y -= (__pParentWindow->GetAbsoluteBoundsF(true).y + __pParentWindow->GetClientBoundsF().y);
SetBounds(rect);
+ Invalidate();
return;
}
}
delete pCanvas;
-
- if (__reverseCheck)
- {
- SetWindowBounds(__windowBounds);
- __reverseCheck = false;
- }
- else
- {
- SetWindowBounds(__windowBounds);
- }
}
bool
_EditCopyPasteHandler::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
- __pCopyPasteManager->ReleaseCopyPastePopup();
+ _ContextMenu* pCopyPastePopup = __pCopyPasteManager->GetCopyPastePopup();
+ if (pCopyPastePopup)
+ {
+ pCopyPastePopup->SetVisibleState(false);
+ pCopyPastePopup->Close();
+ }
+
#if EDIT_COPY_PASTE_MAGNIFIER
- CreateCopyPasteMagnifier();
+ if (!__pCopyPasteMagnifier)
+ {
+ CreateCopyPasteMagnifier();
+ }
+ else
+ {
+ __pCopyPasteMagnifier->SetVisibleState(true);
+ __pCopyPasteMagnifier->Invalidate();
+ }
#endif
__touchPressedPoint = touchinfo.GetCurrentPosition();
__absoluteTouchPressedPoint = FloatPoint(GetBoundsF().x + __touchPressedPoint.x, GetBoundsF().y + __touchPressedPoint.y);
_ControlManager* pControlManager = _ControlManager::GetInstance();
_Edit* pEdit = __pCopyPasteManager->GetEdit();
_ControlOrientation orientation = pEdit->GetOrientation();
- FloatRectangle rect = GetBoundsF();
+ FloatRectangle rect = GetAbsoluteBoundsF(true);
FloatRectangle cursorAbsBounds = __pCopyPasteManager->GetCursorBoundsF(true);
float clipboardHeight = 0.0f;
FloatRectangle keypadBounds(0.0f, 0.0f, 0.0f, 0.0f);
__handlerDirection = HANDLER_DIRECTION_REVERSE_2;
rect.y -= (cursorAbsBounds.height + rect.height);
__reverseCheck = true;
+ ChangeHandlerBitmap();
+ rect.x -= (__pParentWindow->GetAbsoluteBoundsF(true).x + __pParentWindow->GetClientBoundsF().x);
+ rect.y -= (__pParentWindow->GetAbsoluteBoundsF(true).y + __pParentWindow->GetClientBoundsF().y);
+ SetBounds(rect);
}
else if ((__handlerDirection == HANDLER_DIRECTION_REVERSE_2) && ((cursorAbsBounds.y + cursorAbsBounds.height + rect.height) <= screenSize.height))
{
__handlerDirection = HANDLER_DIRECTION_NONE;
rect.y += (cursorAbsBounds.height + rect.height);
__reverseCheck = true;
+ ChangeHandlerBitmap();
+ rect.x -= (__pParentWindow->GetAbsoluteBoundsF(true).x + __pParentWindow->GetClientBoundsF().x);
+ rect.y -= (__pParentWindow->GetAbsoluteBoundsF(true).y + __pParentWindow->GetClientBoundsF().y);
+ SetBounds(rect);
}
- ChangeHandlerBitmap();
- SetBounds(rect);
return;
}
__reverseCheck = true;
}
}
+ rect.x -= (__pParentWindow->GetAbsoluteBoundsF(true).x + __pParentWindow->GetClientBoundsF().x);
+ rect.y -= (__pParentWindow->GetAbsoluteBoundsF(true).y + __pParentWindow->GetClientBoundsF().y);
SetBounds(rect);
}
CheckReverseStatus();
__isTouchPressed = false;
__absoluteTouchPressedPoint = FloatPoint(0.0f, 0.0f);
- DestroyCopyPasteMagnifier();
- __pCopyPasteManager->CreateCopyPastePopup();
+ if (__pCopyPasteMagnifier)
+ {
+ __pCopyPasteMagnifier->SetVisibleState(false);
+ }
+ _ContextMenu* pCopyPastePopup = __pCopyPasteManager->GetCopyPastePopup();
+ if (pCopyPastePopup && !__isTouchMoving)
+ {
+ pCopyPastePopup->SetVisibleState(true);
+ pCopyPastePopup->Open();
+ }
+ else
+ {
+ __pCopyPasteManager->CreateCopyPastePopup();
+ }
__pCopyPasteManager->Show();
__pCopyPasteManager->SendTextBlockEvent();
Invalidate();
float firstDisplayY = pTextObject->GetFirstDisplayPositionYF();
FloatRectangle absTextObjectBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
- FloatRectangle absEditBounds = pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absEditBounds = pEdit->GetAbsoluteBoundsF(true);
absTextObjectBounds.x = absEditBounds.x + textObjectBounds.x;
absTextObjectBounds.y = absEditBounds.y + textObjectBounds.y;
absTextObjectBounds.width = textObjectBounds.width;
if (!__singleHandler)
{
__pCopyPasteManager->RefreshBlock(__leftHandler);
+ CheckReverseStatus();
}
else
{
}
pEditPresenter->DrawText();
AdjustBounds();
+ CheckReverseStatus();
}
MoveCopyPasteMagnifier();
return;
}
-result
-_EditCopyPasteHandler::OnAttachedToMainTree(void)
-{
- result r = E_SUCCESS;
-
- if (GetOwner() == null)
- {
- _Edit* pEdit = __pCopyPasteManager->GetEdit();
- SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEdit.");
-
- _EditPresenter* pEditPresenter = pEdit->GetPresenter();
- SysTryReturnResult(NID_UI_CTRL, pEdit, GetLastResult(), "Unable to get pEditPresenter.");
-
- _Form* pParentForm = pEditPresenter->GetParentForm();
- if (pParentForm)
- {
- SetOwner(pParentForm);
- }
- else
- {
- _Form* pForm = null;
- _Frame* pCurrentFrame = dynamic_cast <_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- if (pCurrentFrame)
- {
- pForm = pCurrentFrame->GetCurrentForm();
- if (pForm)
- {
- SetOwner(pForm);
- }
- else
- {
- SetOwner(pCurrentFrame);
- }
- }
- }
- }
-
- return r;
-}
-
-result
-_EditCopyPasteHandler::OnBoundsChanging(const FloatRectangle& bounds)
-{
- result r = E_SUCCESS;
-
- __windowBounds = bounds;
-
- if (!GetVisibleState())
- {
- return r;
- }
-
- if (!__reverseCheck)
- {
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
- result r = GetLastResult();
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- return r;
-}
-
-result
-_EditCopyPasteHandler::OnBoundsChanging(const Rectangle& bounds)
-{
- result r = E_SUCCESS;
- //To do
- return r;
-}
-result
-_EditCopyPasteHandler::SetWindowBounds(const Rectangle& bounds)
-{
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
- result r = GetLastResult();
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return r;
-}
-
-result
-_EditCopyPasteHandler::SetWindowBounds(const FloatRectangle& bounds)
-{
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
- pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
- result r = GetLastResult();
- SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return r;
-}
-
_EditCopyPasteManager::_EditCopyPasteManager(_Edit& parenEdit)
: __pCopyPastePopup(null)
, __contextMenuAlign(CONTEXT_MENU_CORE_ALIGN_UP)
, __needToReleaseBlock(true)
, __isHandlerMoving(false)
, __editVisibleArea(0.0f, 0.0f, 0.0f, 0.0f)
+ , __pParentWindow(null)
+ , __parentWindowClipFlagChanged(false)
{
__pEditPresenter = __pEdit->GetPresenter();
__pHandle[HANDLER_TYPE_CENTER] = null;
__pHandle[HANDLER_TYPE_LEFT] = null;
__pHandle[HANDLER_TYPE_RIGHT] = null;
- CreateHandle();
+ _Control* pControlCore = null;
+
+ for (pControlCore = __pEdit->GetParent(); __pParentWindow == null; pControlCore = pControlCore->GetParent())
+ {
+ if (pControlCore == null)
+ {
+ break;
+ }
+
+ __pParentWindow = dynamic_cast<_Window*>(pControlCore);
+ if (__pParentWindow)
+ {
+ break;
+ }
+ }
+ if (!__pParentWindow)
+ {
+ __pParentWindow = _ControlManager::GetInstance()->GetCurrentFrame();
+ }
+ if (__pParentWindow)
+ {
+ _VisualElement* pVisualElement = __pParentWindow->GetVisualElement();
+ if (pVisualElement && pVisualElement->IsClipChildrenEnabled())
+ {
+ __parentWindowClipFlagChanged = true;
+ pVisualElement->SetClipChildrenEnabled(false);
+ }
+ }
+ CreateHandle();
}
_EditCopyPasteManager::~_EditCopyPasteManager(void)
{
+ if (__parentWindowClipFlagChanged && __pParentWindow)
+ {
+ _VisualElement* pVisualElement = __pParentWindow->GetVisualElement();
+ if (pVisualElement)
+ {
+ pVisualElement->SetClipChildrenEnabled(true);
+ }
+ }
+
Release();
if (__pCoreCopyPasteEvent)
if (__pHandle[HANDLER_TYPE_CENTER])
{
- __pHandle[HANDLER_TYPE_CENTER]->Close();
+ if (__pParentWindow)
+ {
+ __pParentWindow->DetachChild(*__pHandle[HANDLER_TYPE_CENTER]);
+ }
delete __pHandle[HANDLER_TYPE_CENTER];
__pHandle[HANDLER_TYPE_CENTER] = null;
}
if (__pHandle[HANDLER_TYPE_LEFT])
{
- __pHandle[HANDLER_TYPE_LEFT]->Close();
+ if (__pParentWindow)
+ {
+ __pParentWindow->DetachChild(*__pHandle[HANDLER_TYPE_LEFT]);
+ }
delete __pHandle[HANDLER_TYPE_LEFT];
__pHandle[HANDLER_TYPE_LEFT] = null;
}
if (__pHandle[HANDLER_TYPE_RIGHT])
{
- __pHandle[HANDLER_TYPE_RIGHT]->Close();
+ if (__pParentWindow)
+ {
+ __pParentWindow->DetachChild(*__pHandle[HANDLER_TYPE_RIGHT]);
+ }
delete __pHandle[HANDLER_TYPE_RIGHT];
__pHandle[HANDLER_TYPE_RIGHT] = null;
}
__contextMenuHeight = __contextMenuHeight + contextMenuHeight;
}
- editAbsRect = __pEdit->GetAbsoluteBoundsF();
+ editAbsRect = __pEdit->GetAbsoluteBoundsF(true);
_Toolbar* pCommandButton = __pEditPresenter->GetKeypadCommandButton();
if (pCommandButton)
{
- commandButtonBounds = pCommandButton->GetAbsoluteBoundsF();
+ commandButtonBounds = pCommandButton->GetAbsoluteBoundsF(true);
commandButtonExist = true;
}
_Form* pForm = __pEditPresenter->GetParentForm();
_ScrollPanel* pPanel = __pEditPresenter->GetParentPanel();
if (pPanel)
{
- panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF();
+ panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF(true);
}
__pEdit->GetKeypadBounds(keypadBounds);
editShowAreaAbsRect.y = panelAbsoulteBounds.y;
editShowAreaAbsRect.height -= (panelAbsoulteBounds.y - editShowAreaAbsRect.y);
}
- __editVisibleArea = editShowAreaAbsRect;
+ __editVisibleArea = CoordinateSystem::AlignToDevice(editShowAreaAbsRect);
}
FloatPoint copyPastePoint(0.0f, 0.0f);
__contextMenuAlign = CONTEXT_MENU_CORE_ALIGN_UP;
FloatPoint leftHandler(startRect.x, startRect.y + startRect.height);
FloatPoint rightHandler(endRect.x, endRect.y + endRect.height);
-
- __pHandle[HANDLER_TYPE_LEFT] = _EditCopyPasteHandler::CreateInstanceN(leftHandler, start, this, false, true);
- __pHandle[HANDLER_TYPE_RIGHT] = _EditCopyPasteHandler::CreateInstanceN(rightHandler, end, this, false, false);
+ if (__pParentWindow)
+ {
+ __pHandle[HANDLER_TYPE_LEFT] = _EditCopyPasteHandler::CreateInstanceN(leftHandler, start, this, __pParentWindow, false, true);
+ __pParentWindow->AttachChild(*__pHandle[HANDLER_TYPE_LEFT]);
+ }
+ if (__pParentWindow)
+ {
+ __pHandle[HANDLER_TYPE_RIGHT] = _EditCopyPasteHandler::CreateInstanceN(rightHandler, end, this, __pParentWindow, false, false);
+ __pParentWindow->AttachChild(*__pHandle[HANDLER_TYPE_RIGHT]);
+ }
}
else
{
__pEdit->CalculateAbsoluteCursorBounds(__pEdit->GetCursorPosition(), centerRect);
FloatPoint centerHandler(centerRect.x, centerRect.y + centerRect.height);
- __pHandle[HANDLER_TYPE_CENTER] = _EditCopyPasteHandler::CreateInstanceN(centerHandler, __pEdit->GetCursorPosition(), this, true, true);
+ if (__pParentWindow)
+ {
+ __pHandle[HANDLER_TYPE_CENTER] = _EditCopyPasteHandler::CreateInstanceN(centerHandler, __pEdit->GetCursorPosition(), this, __pParentWindow, true, true);
+ __pParentWindow->AttachChild(*__pHandle[HANDLER_TYPE_CENTER]);
+ }
#if EDIT_COPY_PASTE_MAGNIFIER
// __pHandle[HANDLER_TYPE_CENTER]->CreateCopyPasteMagnifier();
#endif
__pHandle[HANDLER_TYPE_CENTER]->AdjustBounds();
__pHandle[HANDLER_TYPE_CENTER]->CheckReverseStatus();
__pHandle[HANDLER_TYPE_CENTER]->Invalidate();
- __pEditPresenter->DrawText();
}
if (__pHandle[HANDLER_TYPE_LEFT] && __pHandle[HANDLER_TYPE_RIGHT])
if (__pCopyPastePopup)
{
__pCopyPastePopup->Open();
+ {
+ _Window* pWindow = null;
+ _Control* pControlCore = null;
+
+ for (pControlCore = __pEdit->GetParent(); pWindow == null; pControlCore = pControlCore->GetParent())
+ {
+ if (pControlCore == null)
+ {
+ break;
+ }
+
+ pWindow = dynamic_cast<_Window*>(pControlCore);
+ if (pWindow)
+ {
+ __pCopyPastePopup->SetOwner(pWindow);
+ break;
+ }
+ }
+ }
__pCopyPastePopup->ReleaseTouchCapture();
_Control* pControl = __pCopyPastePopup->GetOwner();
FloatRectangle commandButtonBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle formClientBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f);
- FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF(true);
FloatRectangle textObjectBounds = __pEditPresenter->GetTextBoundsF();
if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
_Toolbar* pCommandButton = __pEditPresenter->GetKeypadCommandButton();
if (pCommandButton)
{
- commandButtonBounds = pCommandButton->GetAbsoluteBoundsF();
+ commandButtonBounds = pCommandButton->GetAbsoluteBoundsF(true);
hasCommandButton = true;
}
_Form* pForm = __pEditPresenter->GetParentForm();
_ScrollPanel* pPanel = __pEditPresenter->GetParentPanel();
if (pPanel)
{
- panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF();
+ panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF(true);
hasParentPanel = true;
}
break;
case COPY_PASTE_CLIPBOARD_ID:
- pClipBoard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
+ pClipBoard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit, true);
ReleaseCopyPastePopup();
SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_CLIPBOARD);
break;
delete __pEditDatePresenter;
__pEditDatePresenter = null;
- if (__pDateChangeEvent != null)
- {
- delete __pDateChangeEvent;
- __pDateChangeEvent = null;
- }
+ delete __pDateChangeEvent;
+ __pDateChangeEvent = null;
- if (__pAccessibilityEditDateElement)
+ if (__pAccessibilityEditDateElement != null)
{
__pAccessibilityEditDateElement->Activate(false);
__pAccessibilityEditDateElement = null;
}
- if (__pAccessibilityYearElement)
+ if (__pAccessibilityYearElement != null)
{
__pAccessibilityYearElement->Activate(false);
__pAccessibilityYearElement = null;
}
- if (__pAccessibilityMonthElement)
+ if (__pAccessibilityMonthElement != null)
{
__pAccessibilityMonthElement->Activate(false);
__pAccessibilityMonthElement = null;
}
- if (__pAccessibilityDayElement)
+ if (__pAccessibilityDayElement != null)
{
__pAccessibilityDayElement->Activate(false);
__pAccessibilityDayElement = null;
pEditDate->__pEditDatePresenter->SetCurrentDate();
- if (title.IsEmpty() != true)
+ if (!title.IsEmpty())
{
pEditDate->__title = title;
}
pContainer = pEditDate->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
pEditDate->CreateAccessibilityElement();
{
result r = E_OBJ_NOT_FOUND;
- if (__pDateChangeEvent)
+ if (__pDateChangeEvent != null)
{
r = __pDateChangeEvent->RemoveListener(listener);
}
__pEditDatePresenter->Initialize();
- if (__pAccessibilityEditDateElement)
+ if (__pAccessibilityEditDateElement != null)
{
__pAccessibilityEditDateElement->SetBounds(GetClientBoundsF());
}
- if (__pAccessibilityYearElement)
+ if (__pAccessibilityYearElement != null)
{
__pAccessibilityYearElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR));
}
- if (__pAccessibilityMonthElement)
+ if (__pAccessibilityMonthElement != null)
{
__pAccessibilityMonthElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH));
}
- if (__pAccessibilityDayElement)
+ if (__pAccessibilityDayElement != null)
{
__pAccessibilityDayElement->SetBounds(__pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_DAY));
}
bool
_EditDate::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
{
+ return __pEditDatePresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_EditDate::OnKeyReleased(const _Control &source, const _KeyInfo &keyInfo)
+{
_KeyCode keyCode = keyInfo.GetKeyCode();
switch (keyCode)
{
case _KEY_ENTER:
{
-
FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
break;
}
default:
+ {
break;
-
+ }
}
- return __pEditDatePresenter->OnKeyPressed(source, keyInfo);
+ return __pEditDatePresenter->OnKeyReleased(source, keyInfo);
}
bool
_EditDate::OnFocusGained(const _Control &source)
{
__pEditDatePresenter->SetFocusedElement();
+ Invalidate();
return true;
}
return;
}
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
string.Append(__title);
string.Append(L", ");
_EditDateImpl::~_EditDateImpl(void)
{
- if (__pPublicDateChangeEvent)
- {
- delete __pPublicDateChangeEvent;
- __pPublicDateChangeEvent = null;
- }
+ delete __pPublicDateChangeEvent;
+ __pPublicDateChangeEvent = null;
ClearLastResult();
}
result r = E_OBJ_NOT_FOUND;
- if (__pPublicDateChangeEvent)
+ if (__pPublicDateChangeEvent != null)
{
r = __pPublicDateChangeEvent->RemoveListener(listener);
}
if (pControl->GetElement(L"accessibilityHint", elementStringOne))
{
AccessibilityContainer* pContainer = pEditDate->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement("EditDateText");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementStringOne);
}
delete __pContentBgEffectDisabledBitmap;
__pContentBgEffectDisabledBitmap = null;
- if (__pContentProvider)
+ if (__pContentProvider != null)
{
__pContentProvider->Destroy();
__pContentProvider = null;
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pFont != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
__titleBounds.x = titleLeftMargin;
__titleBounds.y = (editDateHeight - (__titleBounds.height + titledateMargin + dateHeight)) / 2.0f;
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
DrawTitle(*pCanvas);
}
return displayBoxId;
}
- if (__dayBounds.Contains(point) == true)
+ if (__dayBounds.Contains(point))
{
displayBoxId = DATETIME_ID_DAY;
}
- else if (__monthBounds.Contains(point) == true)
+ else if (__monthBounds.Contains(point))
{
displayBoxId = DATETIME_ID_MONTH;
}
- else if (__yearBounds.Contains(point) == true)
+ else if (__yearBounds.Contains(point))
{
displayBoxId = DATETIME_ID_YEAR;
}
{
return false;
}
- _KeyCode keyCode = keyInfo.GetKeyCode();
-
- int minValue = -1;
- int maxValue = -1;
- int displayValue = -1;
- _DateTimeId boxId = DATETIME_ID_NONE;
+ _KeyCode keyCode = keyInfo.GetKeyCode();
_DateTimeUtils dateTimeUtils;
int localeDateFormat = dateTimeUtils.GetLocaleDateFormat();
__pEditDate->Invalidate();
break;
}
-
case _KEY_LEFT:
{
if (__focusId == DATETIME_ID_DAY)
__pEditDate->Invalidate();
break;
}
+ default:
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool
+_EditDatePresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+ if (!__isFocused)
+ {
+ return false;
+ }
+
+ if (__isAnimating)
+ {
+ VisualElement *pEditDateElement = __pEditDate->GetVisualElement();
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (pEditDateElement != null), false, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEditDateElement->RemoveAllAnimations();
+ }
+
+ int minValue = -1;
+ int maxValue = -1;
+ int displayValue = -1;
+ _DateTimeId boxId = DATETIME_ID_NONE;
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ switch (keyCode)
+ {
case _KEY_ENTER:
{
__isEnterKeyPressed = true;
if (__pEditDate->GetDateTimeBar()->IsActivated())
{
+ __pEditDate->GetDateTimeBar()->RemoveAllAnimations();
__pEditDate->GetDateTimeBar()->Close();
+ __pEditDate->GetDateTimeBar()->SetVisibleState(true);
__pEditDate->GetDateTimeBar()->Open();
}
else
SysTryReturnVoidResult(NID_UI_CTRL, (pEditDateElement != null), r, "[%s] Propagating.", GetErrorMessage(r));
//__pContentProvider will be destroyed in destructor when OnFormBackRequested() callback is received
- if (__pContentProvider)
+ if (__pContentProvider != null)
{
pEditDateElement->DetachChild(*__pContentProvider);
__pContentProvider->Destroy();
, __pCommandButton(null)
, __pInputConnection(null)
, __isInputConnectionBound(false)
+ , __sentKeypadEvent(CORE_KEYPAD_EVENT_STATUS_CLOSE)
, __pClipboard(null)
, __guideText()
, __titleText()
}
else
{
- if (!__isClipboardExist)
+ if (GetLastSentKeypadEvent() != CORE_KEYPAD_EVENT_STATUS_OPEN)
{
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+ if (!__isClipboardExist)
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+ }
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
}
- __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
}
}
else if (showState == INPUT_PANEL_SHOW_STATE_HIDE)// 1.unbound 2.bounded&usb off -> usb on 3.Flick keypad hide
}
else
{
- if (__isInputConnectionBound)// keypad drag down
+ if (__isInputConnectionBound)// keypad hided by back key or prediction hided by usb mode changed(on -> off)
{
if (!__isKeypadCommandButtonVisible && !__isClipboardExist)
{
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
}
AdjustParentPanelHeight(true);
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
__pParentForm->Draw();
}
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
}
return false;
}
+void
+_EditPresenter::SetSentKeypadEvent(CoreKeypadEventStatus sentKeypadEvent)
+{
+ __sentKeypadEvent = sentKeypadEvent;
+}
+
+CoreKeypadEventStatus
+_EditPresenter::GetLastSentKeypadEvent(void)
+{
+ return __sentKeypadEvent;
+}
+
+
_EditPresenter*
_EditPresenter::CreateInstanceN(void)
{
return true;
}
- FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(true);
FloatPoint touchStartPoint = __pressedAbsolutePoint;
//After internal touch core complete the float conversion, we need to change the code here
FloatPoint touchPoint = touchInfo.GetCurrentPosition();
__pScrollEffect->previousX = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().x);
__pScrollEffect->currentX = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().x);
- __pScrollEffect->previousAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().x + touchInfo.GetCurrentPosition().x);
- __pScrollEffect->currentAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().x + touchInfo.GetCurrentPosition().x);
- __pScrollEffect->previousAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
- __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
+ __pScrollEffect->previousAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).x + touchInfo.GetCurrentPosition().x);
+ __pScrollEffect->currentAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).x + touchInfo.GetCurrentPosition().x);
+ __pScrollEffect->previousAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
+ __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
__pScrollEffect->cursorPosition = GetCursorPosition();
- FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(true);
__pressedPoint = touchInfo.GetCurrentPosition();
__pressedAbsolutePoint.x = __pressedPoint.x + absoluteEditRect.x;
}
}
}
+ else
+ {
+ if ((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) == false)
+ {
+ SetCursorPosition(GetTextLength());
+ }
+ }
+
FadeOutScrollBar();
if (!__isCopyPasteManagerExist && !__pFlickAnimationTimer)
{
if (IsCurrentFocused() && !tokenEditting && needToCreatePopup)
{
+ if (__pPasswordTimer)
+ {
+ ChangePasswordToEchoCharacter(__pTextBuffer, __echoChar);
+ StopPasswordTimer();
+ }
__pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "Unable to create _EditCopyPasteManager instance.");
__pCopyPasteManager->AddCopyPasteEventListener(*this);
__isTouchMoving = false;
__pEdit->Invalidate();
+ if (GetSearchBarFlag())
+ {
+ return false;
+ }
+
return true;
}
__pScrollEffect->currentY = touchInfo.GetCurrentPosition().y;
__pScrollEffect->previousAbsY = __pScrollEffect->currentAbsY;
- __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
+ __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
// float moveGap = __pScrollEffect->previousY - __pScrollEffect->currentY;
float moveGap = __pScrollEffect->previousAbsY - __pScrollEffect->currentAbsY;
__isMovingCursorByTouchMove = false;
}
- if (!(__pEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL))
+ if (!(__pEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL) && !(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
{
if (__pScrollBar)
{
if (__pParentPanel)
{
- panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+ panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
GetCursorBounds(true, absCursorBounds);
if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
if (__pParentPanel)
{
- panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+ panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
GetCursorBounds(true, absCursorBounds);
if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y)))
{
if (__pParentPanel)
{
- panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+ panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
GetCursorBounds(true, absCursorBounds);
if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
if (__pParentPanel)
{
- panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+ panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
GetCursorBounds(true, absCursorBounds);
if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
}
else if (_KEY_OEM_1 == keyCode)
{
- __pClipboard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
+ __pClipboard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit, true);
__clipboardConnected = true;
return true;
}
{
return true;
}
+ else if (_KEY_TAB == keyCode)
+ {
+ if (__isCopyPasteManagerExist)
+ {
+ InitializeCopyPasteManager();
+ if ((__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false)
+ {
+ DrawText();
+ }
+ else
+ {
+ __pEdit->Invalidate();
+ }
+ }
+ return false;
+ }
return false;
}
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
+ ScrollPanelToCursorPosition();
+
__pEdit->SendTextEvent(CORE_TEXT_EVENT_CHANGED);
__pEdit->Invalidate();
FinishTextComposition();
+ if (__pPasswordTimer)
+ {
+ ChangePasswordToEchoCharacter(__pTextBuffer, __echoChar);
+ StopPasswordTimer();
+ }
+
int cursorPos = GetCursorPositionAt(__pressedPoint);
if (cursorPos != -1)
{
delete pClipboardItem;
ReplaceTextIntoPasswordHyphenString();
+ if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD)
+ {
+ __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), 0);
+ }
ScrollPanelToCursorPosition();
__isInputConnectionBound = false;
AdjustParentPanelHeight(true);
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0);
if (!__pEdit->IsFullScreenKeypadEdit())
bool
_EditPresenter::IsContained(FloatRectangle& paramRect) const
{
- FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
if ((paramRect.x < absBounds.x) ||
(paramRect.y < absBounds.y) ||
float cursorRelativeX = 0.0f;
float cursorRelativeY = 0.0f;
- FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
__pTextObject->SetBounds(GetTextBoundsF());
if (index != __cursorPos)
float cursorRelativeX = 0.0f;
float cursorRelativeY = 0.0f;
- FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
__pTextObject->SetBounds(GetTextBoundsF());
if (isAbsRect)
{
- FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+ FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
cursorBounds.x += absBounds.x;
cursorBounds.y += absBounds.y;
}
{
__pCommandButton->SetResizable(true);
__pCommandButton->SetMovable(true);
- SysLog(NID_UI_CTRL, "Command position changed!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+ SysLog(NID_UI_CTRL, "Command position changed!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
r = __pCommandButton->SetBounds(bounds);
__pCommandButton->SetResizable(false);
__pCommandButton->SetResizable(true);
__pCommandButton->SetMovable(true);
- SysLog(NID_UI_CTRL, "Command created!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+ SysLog(NID_UI_CTRL, "Command created!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
r = __pCommandButton->SetBounds(bounds);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
{
if (isVisible)
{
- SysLog(NID_UI_CTRL, "SetFooterVisible TRUE!!!!!");
+ SysLog(NID_UI_CTRL, "SetFooterVisible TRUE!!!");
}
else
{
- SysLog(NID_UI_CTRL, "SetFooterVisible FALSE!!!!!");
+ SysLog(NID_UI_CTRL, "SetFooterVisible FALSE!!!");
}
__footerVisibleChanged = true;
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0);
__pParentForm->Draw();
}
{
if ((absKeypadBounds.y != screenSize.height))
{
- SysLog(NID_UI_CTRL, "KEYPAD EXIST!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+ SysLog(NID_UI_CTRL, "KEYPAD EXIST!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
return true;
}
else
{
- SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+ SysLog(NID_UI_CTRL, "NO KEYPAD!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
return false;
}
}
else
{
- SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+ SysLog(NID_UI_CTRL, "NO KEYPAD!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
return false;
}
}
//layout rearrange
if (__isUSBKeyboardConnected)
{
- SysLog(NID_UI_CTRL, "ShowKeypad called in USB ON mode!!!!");
+ SysLog(NID_UI_CTRL, "ShowKeypad called in USB ON mode!!!");
__isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //prediction alreaedy exists
SetFooterVisible(false);
ChangeLayoutInternal(__pEdit->GetOrientation());
AdjustParentPanelHeight(false);
+ ScrollPanelToCursorPosition();
__pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
__pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+
+ if (__pParentForm)
+ {
+ __pParentForm->Draw();
+ }
}
else
{
if (__isKeypadExist)
{
+ if (__pParentForm)
+ {
+ sendKeypadEventForcely = !__pParentForm->IsDeflated();
+ }
+
+ if (sendKeypadEventForcely)
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+ __pEdit->AttachScrollPanelEvent();
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
+ }
+
ChangeLayoutInternal(__pEdit->GetOrientation());
AdjustParentPanelHeight(false);
+ ScrollPanelToCursorPosition();
+
+ if (__pParentForm)
+ {
+ __pParentForm->Draw();
+ }
+
+ if (sendKeypadEventForcely)
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+ }
}
}
-
- ScrollPanelToCursorPosition();
}
else
{
- SysLog(NID_UI_CTRL, "ShowKeypad called in USB OFF mode!!!!");
+ SysLog(NID_UI_CTRL, "ShowKeypad called in USB OFF mode!!!");
__isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //call once only from here.
{
if(!__isClipboardExist && __pParentPanel)
{
- __initialParentHeight = 0.0f;
+ if (__initialParentHeight)
+ {
+ AdjustParentPanelHeight(true);
+ }
}
ScrollPanelToCursorPosition();
}
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
}
{
if (__pParentPanel == null)
{
+ SysLog(NID_UI_CTRL, "__pParentPanel is NULL!!!, so skip resizing scrollpanel");
return;
}
__pParentPanel->SetBounds(scrollPanelBounds);
__pParentPanel->Invalidate();
}
+ else
+ {
+ SysLog(NID_UI_CTRL, "initialParentHeight is ZERO!!!, so skip scrollPanel height recovery!!!");
+ }
}
else
{
GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight);
}
- absScrollPanelBounds = __pParentPanel->GetAbsoluteBoundsF();
+ absScrollPanelBounds = __pParentPanel->GetAbsoluteBoundsF(true);
displayedPanelHeight = screenSize.height - commandButtonHeight - absScrollPanelBounds.y;
gapY = (absKeypadBounds.y - commandButtonHeight)- absScrollPanelBounds.y;
if (__isUSBKeyboardConnected)
{
- SysLog(NID_UI_CTRL, "HideKeypad called in USB ON mode!!!!");
+ SysLog(NID_UI_CTRL, "HideKeypad called in USB ON mode!!!");
if (__pCommandButton && __isKeypadCommandButtonVisible)
{
SetFooterVisible(true);
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
}
}
else
{
- SysLog(NID_UI_CTRL, "HideKeypad called in USB OFF mode!!!!");
+ SysLog(NID_UI_CTRL, "HideKeypad called in USB OFF mode!!!");
if (__pCommandButton && __isKeypadCommandButtonVisible)
{
if (!__isKeypadExist)
if (__pParentForm)
{
- SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+ SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
__pParentForm->DeflateClientRectHeight(0.0f);
}
__pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
dspStrBuffer[bufferLength] = null;
__isCursorChanged = true;
+ __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), 0);
+ UpdateComponentInformation();
+
return r;
}
if (!__pParentPanel)
return;
- FloatRectangle editAbsoluteBounds = __pEdit->GetAbsoluteBoundsF();
- FloatRectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBoundsF();
+ FloatRectangle editAbsoluteBounds = __pEdit->GetAbsoluteBoundsF(true);
+ FloatRectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBoundsF(true);
float scrollPosition = __pParentPanel->GetScrollPosition() + (editAbsoluteBounds.y - panelAbsoluteBounds.y);
__pParentPanel->SetScrollPosition(scrollPosition);
result r = E_SUCCESS;
+ UpdateComponentInformation();
+
FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
r = CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds);
return;
}
- FloatRectangle absPanelRect = __pParentPanel->GetAbsoluteBoundsF();
+ FloatRectangle absPanelRect = __pParentPanel->GetAbsoluteBoundsF(true);
float panelHeight = __pParentPanel->GetBoundsF().height;
float scrollPosition = __pParentPanel->GetScrollPosition();
if (upSideGap > 0.0f || downSideGap > 0.0f)
{
float gap = 0.0f;
- float topTextMargin = __textObjectBounds.y;
- float bottomTextMargin = __pEdit->GetBoundsF().height - __textObjectBounds.y - __textObjectBounds.height;
+ float topTextMargin = 0.0f;
+ float bottomTextMargin = 0.0f;
+
+ if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE)
+ {
+ topTextMargin = __pEdit->GetBoundsF().y;
+ bottomTextMargin = __pEdit->GetBoundsF().height;
+ }
+ else
+ {
+ topTextMargin = __textObjectBounds.y;
+ bottomTextMargin = __pEdit->GetBoundsF().height - __textObjectBounds.y - __textObjectBounds.height;
+ }
if (upSideGap > 0.0f)
{
delete __pEditTimePresenter;
__pEditTimePresenter = null;
- if (__pTimeChangeEvent != null)
- {
- delete __pTimeChangeEvent;
- __pTimeChangeEvent = null;
- }
+ delete __pTimeChangeEvent;
+ __pTimeChangeEvent = null;
- if (__pAccessibilityEditTimeElement)
+ if (__pAccessibilityEditTimeElement != null)
{
__pAccessibilityEditTimeElement->Activate(false);
__pAccessibilityEditTimeElement = null;
}
- if (__pAccessibilityHourElement)
+ if (__pAccessibilityHourElement != null)
{
__pAccessibilityHourElement->Activate(false);
__pAccessibilityHourElement = null;
}
- if (__pAccessibilityMinuteElement)
+ if (__pAccessibilityMinuteElement != null)
{
__pAccessibilityMinuteElement->Activate(false);
__pAccessibilityMinuteElement = null;
}
- if (__pAccessibilityAmPmElement)
+ if (__pAccessibilityAmPmElement != null)
{
__pAccessibilityAmPmElement->Activate(false);
__pAccessibilityAmPmElement = null;
pEditTime->__pEditTimePresenter->SetCurrentTime();
- if (title.IsEmpty() != true)
+ if (!title.IsEmpty())
{
pEditTime->__title = title;
}
pContainer = pEditTime->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
pEditTime->CreateAccessibilityElement();
{
result r = E_OBJ_NOT_FOUND;
- if (__pTimeChangeEvent)
+ if (__pTimeChangeEvent != null)
{
r = __pTimeChangeEvent->RemoveListener(listener);
}
__pAccessibilityMinuteElement->SetHint(hintText);
pContainer->AddElement(*__pAccessibilityMinuteElement);
- if (Is24HourNotationEnabled() == false)
+ if (!Is24HourNotationEnabled())
{
__pAccessibilityAmPmElement = new _AccessibilityElement(true);
__pAccessibilityAmPmElement->SetBounds(ampmBounds);
__pAccessibilityHourElement->SetBounds(hourBounds);
__pAccessibilityMinuteElement->SetBounds(minuteBounds);
- if (__pAccessibilityAmPmElement)
+ if (__pAccessibilityAmPmElement != null)
{
__pAccessibilityHourElement->SetBounds(FloatRectangle(hourBounds.x, ampmBounds.y, hourBounds.width, ampmBounds.height));
__pAccessibilityMinuteElement->SetBounds(FloatRectangle(minuteBounds.x, ampmBounds.y, minuteBounds.width, ampmBounds.height));
int hour = 0;
hour = actionId;
- if (amEnable == false && Is24HourNotationEnabled() == false)
+ if (!amEnable && !Is24HourNotationEnabled())
{
if (hour < DATETIME_HOUR_MAX_FOR_24NOTATION)
{
hour += DATETIME_HOUR_MAX_FOR_24NOTATION;
}
}
- else if (amEnable == true && Is24HourNotationEnabled() == false)
+ else if (amEnable && !Is24HourNotationEnabled())
{
if (hour == DATETIME_HOUR_MAX_FOR_24NOTATION)
{
bool
_EditTime::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
{
+ return __pEditTimePresenter->OnKeyPressed(source, keyInfo);
+}
+
+bool
+_EditTime::OnKeyReleased(const _Control &source, const _KeyInfo &keyInfo)
+{
_KeyCode keyCode = keyInfo.GetKeyCode();
switch (keyCode)
break;
}
default:
- break;
-
+ {
+ break;
+ }
}
- return __pEditTimePresenter->OnKeyPressed(source, keyInfo);
+ return __pEditTimePresenter->OnKeyReleased(source, keyInfo);
}
bool
_EditTime::OnFocusGained(const _Control &source)
{
__pEditTimePresenter->SetFocusedElement();
+ Invalidate();
return true;
}
SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityHourElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Hour accessibility element must not be null.");
SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityMinuteElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Minute accessibility element must not be null.");
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
string.Append(__title);
string.Append(L", ");
int hour = GetHour();
int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
- if (Is24HourNotationEnabled() == false && (hour > maxHour))
+ if (!Is24HourNotationEnabled() && (hour > maxHour))
{
hourString.Format(10, L"%02d", hour - DATETIME_HOUR_MAX_FOR_24NOTATION);
}
FloatRectangle minuteBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
FloatRectangle ampmBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
- if (Is24HourNotationEnabled() == false)
+ if (!Is24HourNotationEnabled())
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
SysTryReturnVoidResult(NID_UI_CTRL, (pContainer != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
dateTimeUtils.GetAmPm(amString, AM_TYPE);
dateTimeUtils.GetAmPm(pmString, PM_TYPE);
- if (__pEditTimePresenter->GetAmEnabled() == true)
+ if (__pEditTimePresenter->GetAmEnabled())
{
__pAccessibilityAmPmElement->SetLabel(amString);
string.Append(amString.GetPointer());
_EditTimeImpl::~_EditTimeImpl(void)
{
- if (__pPublicTimeChangeEvent)
- {
- delete __pPublicTimeChangeEvent;
- __pPublicTimeChangeEvent = null;
- }
+ delete __pPublicTimeChangeEvent;
+ __pPublicTimeChangeEvent = null;
ClearLastResult();
}
result r = E_OBJ_NOT_FOUND;
- if (__pPublicTimeChangeEvent)
+ if (__pPublicTimeChangeEvent != null)
{
r = __pPublicTimeChangeEvent->RemoveListener(listener);
}
if (pControl->GetElement(L"accessibilityHint", elementString))
{
AccessibilityContainer* pContainer = pEditTime->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement(L"EditTimeText");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementString);
}
int hour = GetHour();
int minute = GetMinute();
- if (__24hours == false)
+ if (!__24hours)
{
int max = DATETIME_HOUR_MAX_FOR_24NOTATION;
__amEnable = amEnable;
int hour = GetHour();
- if (__amEnable == true)
+ if (__amEnable)
{
__ampmString = textAm;
if (hour >= DATETIME_HOUR_MAX_FOR_24NOTATION)
hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
colonBounds.x = hourBounds.x + hourBounds.width + colonMargin;
colonBounds.y = hourBounds.y + (hourBounds.height - colonBounds.height) / 2.0f;
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
r = DrawTitle(*pCanvas);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
r = DrawColon(*pCanvas, colonBounds);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (__24hours == false)
+ if (!__24hours)
{
r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
FloatRectangle hoursBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle minutesBounds(0.0f, 0.0f, 0.0f, 0.0f);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
}
return displayBoxId;
}
- if (hoursBounds.Contains(point) == true)
+ if (hoursBounds.Contains(point))
{
displayBoxId = DATETIME_ID_HOUR;
}
- else if (minutesBounds.Contains(point) == true)
+ else if (minutesBounds.Contains(point))
{
displayBoxId = DATETIME_ID_MINUTE;
}
- else if (ampmBounds.Contains(point) == true)
+ else if (ampmBounds.Contains(point))
{
displayBoxId = DATETIME_ID_AMPM;
}
}
_KeyCode keyCode = keyInfo.GetKeyCode();
- int minValue = -1;
- int maxValue = -1;
- int displayValue = -1;
-
- _DateTimeId boxId = DATETIME_ID_HOUR;
-
switch (keyCode)
{
case _KEY_RIGHT:
__pEditTime->Invalidate();
break;
}
-
case _KEY_LEFT:
{
__isEnterKeyPressed = false;
break;
}
+ default:
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool
+_EditTimePresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+ if (!__isFocused)
+ {
+ return false;
+ }
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ if (__isAnimating)
+ {
+ VisualElement *pEditTimeElement = __pEditTime->GetVisualElement();
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (pEditTimeElement != null), false, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEditTimeElement->RemoveAllAnimations();
+ }
+
+ int minValue = -1;
+ int maxValue = -1;
+ int displayValue = -1;
+
+ _DateTimeId boxId = DATETIME_ID_HOUR;
+
+ switch (keyCode)
+ {
case _KEY_ENTER:
{
__isEnterKeyPressed = true;
hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
}
{
if (__pEditTime->GetDateTimeBar() != null)
{
- if (__24hours == false)
+ if (!__24hours)
{
if (GetHour() == 0)
{
if (__pEditTime->GetDateTimeBar()->IsActivated())
{
+ __pEditTime->GetDateTimeBar()->RemoveAllAnimations();
__pEditTime->GetDateTimeBar()->Close();
+ __pEditTime->GetDateTimeBar()->SetVisibleState(true);
__pEditTime->GetDateTimeBar()->Open();
}
else
editTimeHeight = __pEditTime->GetBoundsF().height;
}
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
SetTitleBounds();
if (!__isEditTimeInitialized)
_ExpandableEditAreaImpl::~_ExpandableEditAreaImpl(void)
{
- if (__pExpandableEditArea)
+ if (__pExpandableEditArea != null)
{
__pExpandableEditArea->RemoveTextEventListener(*this);
__pExpandableEditArea->RemoveExpandableEditAreaEventListener(*this);
result r = E_SUCCESS;
- if (__pExpandableEditArea)
+ if (__pExpandableEditArea != null)
{
delete __pExpandableEditArea;
__pExpandableEditArea = null;
void
_ExpandableEditAreaImpl::OnExpandableEditAreaLineAdded(const _Control& source, int newLineCount)
{
- if (__pPublicExpandableEditAreaEvent)
+ if (__pPublicExpandableEditAreaEvent != null)
{
IEventArg* pEventArg = _PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(
EXPANDABLE_EDITAREA_EVENT_ADDED, newLineCount);
void
_ExpandableEditAreaImpl::OnExpandableEditAreaLineRemoved(const _Control& source, int newLineCount)
{
- if (__pPublicExpandableEditAreaEvent)
+ if (__pPublicExpandableEditAreaEvent != null)
{
IEventArg* pEventArg = _PublicExpandableEditAreaEvent::CreateExpandableEditAreaEventArgN(
EXPANDABLE_EDITAREA_EVENT_REMOVED, newLineCount);
void
_ExpandableEditAreaImpl::OnKeypadWillOpen(void)
{
- if (__pPublicKeypadEvent)
+ if (__pPublicKeypadEvent != null)
{
IEventArg* pKeypadEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
GetPublic(), KEYPAD_ACTION_ENTER, KEYPAD_EVENT_STATUS_CREATED);
void
_ExpandableEditAreaImpl::OnKeypadOpened(void)
{
- if (__pPublicKeypadEvent)
+ if (__pPublicKeypadEvent != null)
{
IEventArg* pKeypadEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
GetPublic(), KEYPAD_ACTION_ENTER, KEYPAD_EVENT_STATUS_OPEN);
void
_ExpandableEditAreaImpl::OnKeypadClosed(void)
{
- if (__pPublicKeypadEvent)
+ if (__pPublicKeypadEvent != null)
{
IEventArg* pKeypadEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
GetPublic(), KEYPAD_ACTION_ENTER, KEYPAD_EVENT_STATUS_CLOSE);
void
_ExpandableEditAreaImpl::OnKeypadBoundsChanged(void)
{
- if (__pPublicKeypadEvent)
+ if (__pPublicKeypadEvent != null)
{
IEventArg* pKeypadEventArg = _PublicKeypadEvent::CreateKeypadEventArgN(
GetPublic(), KEYPAD_ACTION_ENTER, KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
void
_ExpandableEditAreaImpl::OnLanguageChanged(LanguageCode oldLanguage, LanguageCode newLanguage)
{
- if (__pPublicLanguageEvent)
+ if (__pPublicLanguageEvent != null)
{
IEventArg* pKLanguageEventArg = _PublicLanguageEvent::CreateLanguageEventArgN(GetPublic(), oldLanguage, newLanguage);
result r = GetLastResult();
void
_ExpandableEditAreaImpl::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
{
- if (__pPublicKeypadEvent)
+ if (__pPublicKeypadEvent != null)
{
KeypadAction onKeypadAction = KEYPAD_ACTION_ENTER;
switch (keypadAction)
_ExpandableEditAreaImpl::ReplaceToken(const String& token, String& replacement)
{
bool enable = false;
- if (__pTokenFilter)
+ if (__pTokenFilter != null)
{
enable = __pTokenFilter->ReplaceToken(token, replacement);
}
{
textSize = _LocalizedNumParser::ToDouble(elementString, "C");
_ICoordinateSystemTransformer* pTransform = GetTransformer();
- if (pTransform)
+ if (pTransform != null)
{
textSize = pTransform->Transform(textSize);
}
if (pControl->GetElement(L"accessibilityHint", elementString))
{
AccessibilityContainer* pContainer = pExpandableEditArea->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement(L"EditText");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementString);
}
pAccessibilityElement->SetBounds(pIndexView->GetIndexBounds());
pAccessibilityElement->SetTrait(L"Fast scroll bar");
pAccessibilityElement->SetName(L"FastScroll");
- pAccessibilityElement->SetHint(L"double tap to enter fast scroll mode");
+ pAccessibilityElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_ENABLE_FAST_SCROLLING_T_TTS");
r = pAccessibilityContainer->AddElement(*pAccessibilityElement);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Add accessibility element.", GetErrorMessage(r));
}
if (pFrame && IsAttachedToMainTree())
{
FrameShowMode mode = pFrame->GetShowMode();
- if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
+ if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
{
- opacity = __pIndicator->GetIndicatorOpacity();
- SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
- {
- transparent = true;
- }
- else if (opacity == _INDICATOR_OPACITY_OPAQUE)
- {
- transparent = false;
- }
- else
+ if (mode == FRAME_SHOW_MODE_MINIMIZED)
{
- transparent = true;
+ if (pFrame->GetShowMode(false) != FRAME_SHOW_MODE_FULL_SCREEN)
+ {
+ return transparent;
+ }
}
}
+ opacity = __pIndicator->GetIndicatorOpacity();
+ SysTryReturn(NID_UI_CTRL, GetLastResult() == E_SUCCESS, false, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
+ {
+ transparent = true;
+ }
+ else if (opacity == _INDICATOR_OPACITY_OPAQUE)
+ {
+ transparent = false;
+ }
+ else
+ {
+ transparent = true;
+ }
}
else
{
if (pFrame && IsAttachedToMainTree())
{
FrameShowMode mode = pFrame->GetShowMode();
- if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
+ if (mode != FRAME_SHOW_MODE_FULL_SCREEN)
+ {
+ if (mode == FRAME_SHOW_MODE_MINIMIZED)
+ {
+ if (pFrame->GetShowMode(false) == FRAME_SHOW_MODE_FULL_SCREEN)
+ {
+ __pIndicator->SetIndicatorAutoHide(portrait, landscape);
+ r = GetLastResult();
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ }
+ }
+ else if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
{
__pIndicator->SetIndicatorAutoHide(portrait, landscape);
r = GetLastResult();
}
else
{
- if (GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
+ if (GetCore().GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE)
{
indicatorBounds.height = 0.0f;
}
if (__pOriAgent)
{
+ OrientationStatus status = __pOriAgent->GetStatus();
+ _ControlOrientation coreOrientation =
+ (status == ORIENTATION_STATUS_PORTRAIT || status == ORIENTATION_STATUS_PORTRAIT_REVERSE) ?
+ _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
+
+ OnChangeLayout(coreOrientation);
__pOriAgent->RequestOrientationEvent();
}
{
SysLog(NID_UI, "activated(%d)", __activated);
- if (!__activated)
- {
- return;
- }
-
_Window::OnActivated();
_Form* pCurrentForm = GetCurrentForm();
pCurrentForm->AddIndicatorObject();
+ SetFocusWindowActivationChecked(true);
_Control* pFocusControl = pCurrentForm->GetFocusControl();
if (pFocusControl)
{
{
pCurrentForm->SetFocused();
}
+ SetFocusWindowActivationChecked(false);
_AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM);
}
_FrameImpl::GetCurrentForm(void) const
{
_Control* pFormCore = GetCore().GetCurrentForm();
- SysTryReturn(NID_UI_CTRL, pFormCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ if (!pFormCore)
+ {
+ return null;
+ }
_FormImpl* pFormImpl = static_cast<_FormImpl*>(pFormCore->GetUserData());
if (__pCellsArray[i][columnIndex].isMerged)
{
- if (__pCellsArray[i][columnIndex].isParent == false)
+ if (!__pCellsArray[i][columnIndex].isParent)
{
__pCellsArray[i][columnIndex].cellBounds.width = width;
}
- if (__pCellsArray[row][column].isBoundsModified == false)
+ if (!__pCellsArray[row][column].isBoundsModified)
{
__pCellsArray[row][column].cellBounds.width -= (__pCellsArray[i][columnIndex].actualSize.width - width);
__pCellsArray[row][column].isBoundsModified = true;
FloatRectangle previousCellBounds = __pCellsArray[i][j + 1].cellBounds;
__pCellsArray[i][j + 1].cellBounds.x = __pCellsArray[i][j].cellBounds.x + __pCellsArray[i][j].actualSize.width + __lineWidth;
- if (HasChild(i, j + 1) == true)
+ if (HasChild(i, j + 1))
{
_Control* pControl = GetControlCoreAt(i, j + 1);
- if (pControl)
+ if (pControl != null)
{
FloatPoint controlPosition = pControl->GetPositionF();
float updatedPosition = controlPosition.x - previousCellBounds.x;
if (__pCellsArray[rowIndex][j].isMerged)
{
- if (__pCellsArray[rowIndex][j].isParent == false)
+ if (!__pCellsArray[rowIndex][j].isParent)
{
__pCellsArray[rowIndex][j].cellBounds.height = height;
}
- if (__pCellsArray[row][column].isBoundsModified == false)
+ if (!__pCellsArray[row][column].isBoundsModified)
{
__pCellsArray[row][column].cellBounds.height -= (__pCellsArray[rowIndex][j].actualSize.height - height);
__pCellsArray[row][column].isBoundsModified = true;
FloatRectangle previousCellBounds = __pCellsArray[i + 1][j].cellBounds;
__pCellsArray[i + 1][j].cellBounds.y = __pCellsArray[i][j].cellBounds.y + __pCellsArray[i][j].actualSize.height + __lineWidth;
- if (HasChild(i + 1, j) == true)
+ if (HasChild(i + 1, j))
{
_Control* pControl = GetControlCoreAt(i + 1, j);
- if (pControl)
+ if (pControl != null)
{
FloatPoint controlPosition = pControl->GetPositionF();
float updatedPosition = controlPosition.y - previousCellBounds.y;
//Allow merge if Control is added in parent cell
if (i != rowStartIndex || j != columnStartIndex)
{
- if (HasChild(i, j) == true)
+ if (HasChild(i, j))
{
return E_INVALID_ARG;
}
__pCellsArray[rowIndex][columnIndex].cellMargin.top = topMargin;
__pCellsArray[rowIndex][columnIndex].cellMargin.bottom = bottomMargin;
- if (HasChild(rowIndex, columnIndex) == true)
+ if (HasChild(rowIndex, columnIndex))
{
FloatRectangle controlRect(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle rect = GetBoundsAt(rowIndex, columnIndex);
_Control* pControl = GetControlCoreAt(rowIndex, columnIndex);
- if (pControl)
+ if (pControl != null)
{
controlRect = pControl->GetBoundsF();
rect.x = rect.x + leftMargin + localCellControlRect.x;
rect.y = rect.y + topMargin + localCellControlRect.y;
- if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true)
+ if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled)
{
controlRect.width = rect.width - (leftMargin + localCellControlRect.x + rightMargin);
controlRect.height = rect.height - (topMargin + localCellControlRect.y + bottomMargin);
SysTryReturnResult(NID_UI_CTRL, (rowIndex >= 0 && columnIndex >= 0 && rowIndex < __rowCount && columnIndex < __columnCount), E_OUT_OF_RANGE, "rowIndex(%d) or columnIndex(%d) is out of range.", rowIndex, columnIndex);
- if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true)
+ if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled)
{
- if (HasChild(rowIndex, columnIndex) == true)
+ if (HasChild(rowIndex, columnIndex))
{
FloatRectangle rect = GetBoundsAt(rowIndex, columnIndex);
_Control* pControl = GetControlCoreAt(rowIndex, columnIndex);
- if (pControl)
+ if (pControl != null)
{
FloatRectangle controlRect = pControl->GetBoundsF();
- if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled == true)
+ if (__pCellsArray[rowIndex][columnIndex].isResizeEnabled)
{
rect.width = rect.width - (controlRect.x - rect.x + __pCellsArray[rowIndex][columnIndex].cellMargin.right);
rect.height = rect.height - (controlRect.y - rect.y + __pCellsArray[rowIndex][columnIndex].cellMargin.bottom);
_Control* pControl = null;
_ControlManager *pControlManager = null;
pControlManager = _ControlManager::GetInstance();
- if (pControlManager)
+ if (pControlManager != null)
{
pControl = pControlManager->GetObject(__pCellsArray[rowIndex][columnIndex].controlHandle);
}
- if (!pControl)
+ if (pControl == null)
{
SysLogException(NID_UI_CTRL, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Failed to get control at specified index.");
}
{
for (int columnIndex = 0; columnIndex < __columnCount; columnIndex++)
{
- if (__pStretchableColumnIndex[columnIndex] == true && columnWidthIndex != columnIndex)
+ if (__pStretchableColumnIndex[columnIndex] && columnWidthIndex != columnIndex)
{
if (width > 0)
{
for (int columnIndex = 0; columnIndex < __columnCount; columnIndex++)
{
- if (__pStretchableColumnIndex[columnIndex] == true && columnWidthIndex != columnIndex)
+ if (__pStretchableColumnIndex[columnIndex] && columnWidthIndex != columnIndex)
{
columnWidth[columnIndex] = columnWidth[columnIndex] + __pCellsArray[0][columnIndex].actualSize.width + stretchableWidth;
{
for (int rowIndex = 0; rowIndex < __rowCount; rowIndex++)
{
- if (__pStretchableRowIndex[rowIndex] == true && rowIndex != rowHeightIndex)
+ if (__pStretchableRowIndex[rowIndex] && rowIndex != rowHeightIndex)
{
if (height > 0)
{
for (int rowIndex = 0; rowIndex < __rowCount; rowIndex++)
{
- if (__pStretchableRowIndex[rowIndex] == true && rowIndex != rowHeightIndex)
+ if (__pStretchableRowIndex[rowIndex] && rowIndex != rowHeightIndex)
{
rowHeight[rowIndex] = rowHeight[rowIndex] + __pCellsArray[rowIndex][0].actualSize.height + stretchableHeight;
_GroupContainerRegister::_GroupContainerRegister(void)
{
_UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
- if (pUiBuilderControlTableManager)
+ if (pUiBuilderControlTableManager != null)
{
pUiBuilderControlTableManager->RegisterControl(L"GroupContainer", _GroupContainerMaker::GetInstance);
}
_GroupContainerRegister::~_GroupContainerRegister(void)
{
_UiBuilderControlTableManager* pUiBuilderControlTableManager = _UiBuilderControlTableManager::GetInstance();
- if (pUiBuilderControlTableManager)
+ if (pUiBuilderControlTableManager != null)
{
pUiBuilderControlTableManager->UnregisterControl(L"GroupContainer");
}
r = GET_BITMAP_CONFIG_N(GROUPCONTAINER::SYSTEM_CONTROL_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pSystemChildBgBitmap);
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__pSystemChildColorReplacedBgBitmap)
+ if (__pSystemChildColorReplacedBgBitmap != null)
{
delete __pSystemChildColorReplacedBgBitmap;
__pSystemChildColorReplacedBgBitmap = null;
r = GET_BITMAP_CONFIG_N(GROUPCONTAINER::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pGroupContainerBgBitmap);
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__pGroupContainerColorReplacedBgBitmap)
+ if (__pGroupContainerColorReplacedBgBitmap != null)
{
delete __pGroupContainerColorReplacedBgBitmap;
__pGroupContainerColorReplacedBgBitmap = null;
int rows = __pGroupContainer->GetRowCount();
int columns = __pGroupContainer->GetColumnCount();
float lineWidth = __pGroupContainer->GetLineWidth();
+ float verticalDividerHeight = 0.0f;
if (__parentBgColor != GetParentColor() || __bgColor != __pGroupContainer->GetBackgroundColor())
{
rect = __pGroupContainer->GetBoundsAt(rowIndex , columnIndex);
//Draw Cell Left and Top Lines for all cells
- if ((__pGroupContainer->IsMerged(rowIndex, columnIndex) == false) || (__pGroupContainer->IsParent(rowIndex, columnIndex) == true))
+ if ((!__pGroupContainer->IsMerged(rowIndex, columnIndex)) || (__pGroupContainer->IsParent(rowIndex, columnIndex)))
{
//Cells's Top Line
if (rowIndex != 0)
//Cell's Left Line
if (columnIndex != 0)
{
- pCanvas->DrawLine(FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y), FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y + rect.height));
+ verticalDividerHeight = rect.height / 2;
+ pCanvas->DrawLine(FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y + (verticalDividerHeight / 2)), FloatPoint(rect.x - lineWidth + lineAdjustPosition, rect.y + (verticalDividerHeight / 2) + verticalDividerHeight));
}
}
}
_GroupContainerPresenter::GetParentColor(void) const
{
_Control* pParentControl = __pGroupContainer->GetParent();
- if (!pParentControl)
+ if (pParentControl == null)
{
return Color(0, 0, 0, 0);
}
while (pForm == null && parentBgColor.GetAlpha() == 0x00)
{
pParentControl = pParentControl->GetParent();
- if (!pParentControl)
+ if (pParentControl == null)
{
break;
}
if (__isOrientationChanged)
{
+ if (GetCore().IsTableViewFocused())
+ {
+ GetCore().RestoreFocus(true);
+ }
__isOrientationChanged = false;
UpdateList();
}
result
_HeaderImpl::SetButton(ButtonPosition position, const ButtonItem& button)
{
- SysTryReturnResult(NID_UI_CTRL, (!(__style == HEADER_STYLE_TAB || __style == HEADER_STYLE_TAB_WITH_TITLE || __style == HEADER_STYLE_TAB_LARGE)), E_INVALID_OPERATION,
+ SysTryReturnResult(NID_UI_CTRL, (!(__style == HEADER_STYLE_TAB || __style == HEADER_STYLE_TAB_LARGE)), E_INVALID_OPERATION,
"[E_INVALID_OPERATION] This operation is not supported.");
SysTryReturnResult(NID_UI_CTRL, (button.GetActionId() >= HEADER_ACTION_ID_MIN && button.GetActionId() <= HEADER_ACTION_ID_MAX),
int count = GetItemCount();
- SysTryReturnResult(NID_UI_CTRL, (count <= HEADER_MAX_ITEM_COUNT_WITH_BUTTON), E_SYSTEM,
- "[E_SYSTEM] If the item count is larger then 4, no button can be set.");
+ if (HEADER_STYLE_TAB_WITH_TITLE != __style)
+ {
+ SysTryReturnResult(NID_UI_CTRL, (count <= HEADER_MAX_ITEM_COUNT_WITH_BUTTON), E_SYSTEM,
+ "[E_SYSTEM] If the item count is larger then 4, no button can be set.");
+ }
SysTryReturnResult(NID_UI_CTRL, (position == BUTTON_POSITION_LEFT || position == BUTTON_POSITION_RIGHT), E_INVALID_ARG,
"[E_INVALID_ARG] The position is invalid.");
goto CATCH;
}
- if ((count >= HEADER_MAX_ITEM_COUNT_WITH_BUTTON) &&
+ if ((HEADER_STYLE_TAB_WITH_TITLE != __style) && (count >= HEADER_MAX_ITEM_COUNT_WITH_BUTTON) &&
(true == IsButtonSet(BUTTON_POSITION_LEFT) || true == IsButtonSet(BUTTON_POSITION_RIGHT)))
{
SysLogException(NID_UI_CTRL, E_MAX_EXCEEDED, "[E_MAX_EXCEEDED] The number of items with button have exceeded the maximum limit.");
for (int bottomIndex = __firstDrawnIndex + GetItemCountPerAxis() - 1; bottomIndex <= lastItemIndex; bottomIndex += GetItemCountPerAxis())
{
- if (bottomIndex == __highlightedIndex)
+ if (bottomIndex == __highlightedIndex || __highlightedIndex == lastItemIndex)
{
isFocusUiBottom = true;
break;
if ((keyInfo.GetKeyCode() == _KEY_UP && isFocusUiTop) || (keyInfo.GetKeyCode() == _KEY_DOWN && isFocusUiBottom))
{
+ RedrawItem(__highlightedIndex);
+ __highlightedIndex = INVALID_INDEX;
return false;
}
else if ((keyInfo.GetKeyCode() == _KEY_LEFT && (__highlightedIndex >= 0 && __highlightedIndex <= GetItemCountPerAxis() - 1)) || (keyInfo.GetKeyCode() == _KEY_RIGHT && (__highlightedIndex >= lastLineTopIndex && __highlightedIndex <= lastItemIndex)))
ecore_evas_callback_msg_handle_set(pPortraitEe, _Indicator::OnMessageHandle);
ecore_evas_callback_msg_handle_set(pLandscapeEe, _Indicator::OnMessageHandle);
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- int rotation = 0;
- if (pEcoreEvas && __pWindow)
- {
- rotation = pEcoreEvas->GetWindowRotation(*__pWindow);
- }
-
- if(rotation == 0 || rotation == 180)
- {
- ecore_evas_msg_parent_send(pPortraitEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
- }
- else
- {
- ecore_evas_msg_parent_send(pLandscapeEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
- }
-
return r;
}
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
}
}
-
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- int rotation = 0;
- Ecore_Evas *pPortraitEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
- SysTryReturnVoidResult(NID_UI_CTRL, pPortraitEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
- Ecore_Evas *pLandscapeEe = ecore_evas_object_ecore_evas_get(__pLandscapeIndicatorEvasObject);
- SysTryReturnVoidResult(NID_UI_CTRL, pLandscapeEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
-
- if (pEcoreEvas && __pWindow)
- {
- rotation = pEcoreEvas->GetWindowRotation(*__pWindow);
- }
-
- if(rotation == 0 || rotation == 180)
- {
- ecore_evas_msg_parent_send(pPortraitEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
- }
- else
- {
- ecore_evas_msg_parent_send(pLandscapeEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
- }
}
result
}
}
}
-
- if (msgId == MSG_ID_INDICATOR_TYPE)
- {
- _IndicatorTypeMode *pIndicatorTypeMode = (_IndicatorTypeMode*)(data);
-
- _Window* pWindow = _ControlManager::GetInstance()->_ControlManager::GetTopVisibleWindow();
- SysTryReturnVoidResult(NID_UI_CTRL, pWindow, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree.");
-
- Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
-
- if (*pIndicatorTypeMode == _INDICATOR_TYPE_1)
- {
- ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
- }
- else if (*pIndicatorTypeMode == _INDICATOR_TYPE_2)
- {
- ecore_x_e_illume_indicator_type_set (win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
- }
- }
}
}
r = __indicatorMap.GetValue(pWindow, pIndicatorComponentArray);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS && pIndicatorComponentArray, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ if (pIndicatorComponentArray[0].pPortraitEvasObject)
+ {
+ evas_object_del(pIndicatorComponentArray[0].pPortraitEvasObject);
+ }
+
+ if (pIndicatorComponentArray[0].pLandscapeEvasObject)
+ {
+ evas_object_del(pIndicatorComponentArray[0].pLandscapeEvasObject);
+ }
+
+ if (pIndicatorComponentArray[1].pPortraitEvasObject)
+ {
+ evas_object_del(pIndicatorComponentArray[1].pPortraitEvasObject);
+ }
+
+ if (pIndicatorComponentArray[1].pLandscapeEvasObject)
+ {
+ evas_object_del(pIndicatorComponentArray[1].pLandscapeEvasObject);
+ }
+
delete pIndicatorComponentArray[0].pPortraitSurface;
delete pIndicatorComponentArray[0].pLandscapeSurface;
delete pIndicatorComponentArray[1].pPortraitSurface;
bool isKeypadExist = false;
bool isClipboardExist = false;
+ FloatDimension indicatorDimension(0.0f, 0.0f);
+ FloatDimension keypadDimsnsion(0.0f, 0.0f);
+
if (__isInitialized || __pChildEdit->IsUsbKeyboardConnected())
{
isKeypadExist = __pChildEdit->CheckKeypadExist(orientation);
GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorHeight);
}
+ indicatorDimension.height = indicatorHeight;
+
SetResizable(true);
SetMovable(true);
- r = SetBounds(bounds);
+ r = SetBounds(CoordinateSystem::AlignToDevice(bounds));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
SetResizable(false);
SetMovable(false);
- FloatRectangle editRect = bounds;
+ FloatRectangle editRect = CoordinateSystem::AlignToDevice(bounds);
- editRect.y = indicatorHeight;
+ editRect.y = CoordinateSystem::AlignToDevice(indicatorDimension).height;
float footerHeight = 0.0f;
+ FloatDimension footerDimension(0.0f, 0.0f);
+
GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, footerHeight);
+ footerDimension.height = footerHeight;
- editRect.height -= indicatorHeight;
- editRect.height -= footerHeight;
+ editRect.height -= CoordinateSystem::AlignToDevice(indicatorDimension).height;
+ editRect.height -= CoordinateSystem::AlignToDevice(footerDimension).height;
if ((isClipboardExist && layoutChangeState == LAYOUT_CHANGE_ROTATE))
{
if (clipboardHeight > keypadRect.height)
{
- editRect.height -= clipboardHeight;
+ keypadDimsnsion.height = clipboardHeight;
}
else
{
- editRect.height -= keypadRect.height;
+ keypadDimsnsion.height = keypadRect.height;
}
+
+ editRect.height -= CoordinateSystem::AlignToDevice(keypadDimsnsion).height;
}
}
FloatRectangle footerBounds(0.0f, 0.0f, 0.0f, 0.0f);
- footerBounds.y = editRect.height + indicatorHeight;
+ footerBounds.y = editRect.height + CoordinateSystem::AlignToDevice(indicatorDimension).height;
footerBounds.width = editRect.width;
- footerBounds.height = footerHeight;
+ footerBounds.height = CoordinateSystem::AlignToDevice(footerDimension).height;
__pFooter->SetResizable(true);
__pFooter->SetMovable(true);
TextObject* pTextObject = __pLabelPresenter->GetTextObject();
FloatRectangle previousRect = pTextObject->GetBoundsF();
+ TextObjectActionType previousActionType = pTextObject->GetAction();
dimension.width = GetBoundsF().width - __leftMargin * 2;
dimension.height = GetBoundsF().height - __topMargin * 2;
}
pTextObject->SetBounds(previousRect);
+ pTextObject->SetAction(previousActionType);
dimension.width += __leftMargin * 2;
dimension.height += __topMargin * 2;
if (__isOrientationChanged)
{
__isOrientationChanged = false;
+ if (GetCore().IsTableViewFocused())
+ {
+ GetCore().RestoreFocus(true);
+ }
UpdateList();
}
}
return false;
}
- ClearLastStateChangedInfo();
StopTextSlideTimer();
FloatPoint pos = touchinfo.GetCurrentPosition();
__touchPressed = true;
__touchEnabled = true;
- SetLastStateChangedInfo();
-
_TableViewItem::OnTouchPressed(source, touchinfo);
+ SetLastStateChangedInfo();
+
// for do not occur annex selection.
if (__selectionEabled)
{
}
else
{
- __pAccessibilityElement->SetValue(L"Unselected");
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_NOT_SELECTED_T_TTS");
}
break;
Color titleBgColor(0x00000000);
Color buttonBgColor(0x00000000);
_AccessibilityContainer* pContainer = null;
+ SetFocusNavigateEnabled(false);
_titleText = title;
_titleState = !(title.Equals(L"", false));
}
}
-void
-_MessageBox::OnDrawFocus(void)
-{
- __pMsgboxPresenter->OnDrawFocus();
- return;
-}
-
bool
_MessageBox::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
__textBounds.width = defaultWidth - GetLeftRightLabelMargin();
__titleBgBounds.width = defaultWidth - (transLeftMargin + transRightMargin);
- __buttonBgBounds.width = defaultWidth - (transLeftMargin + transRightMargin);
// TitleText
if (__pMessageBox->HasTitle() == true)
__pLabel->SetBounds(FloatRectangle(0.0f, 0.0f, __textBounds.width, labelHeight));
}
+ __buttonBgBounds = FloatRectangle(transLeftMargin, __pMessageBox->GetTotalHeight() - bottomHeight - transBottomMargin, defaultWidth- (transLeftMargin + transRightMargin), bottomHeight);
+
for (int i = 0; i < __buttonNum; i++)
{
r = __pButtons[i]->SetBounds(CalculateButtonPositionAndSize(i));
case MSGBOX_STYLE_OK:
__buttonNum = 1;
- GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_OK, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_OK, __buttonText[0]);
break;
case MSGBOX_STYLE_CANCEL:
case MSGBOX_STYLE_OKCANCEL:
__buttonNum = 2;
- GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_OK, __buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_OK, __buttonText[1]);
GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, __buttonText[0]);
break;
if (pLabelElement != null)
{
pLabelElement->SetName(L"MessageBoxText");
- pLabelElement->SetTrait(L"Popup body text");
+ pLabelElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_TEXT_IN_BODY_OF_POP_UP_T_TALKBACK");
}
// Add Container
return true;
}
-void
-_MessageBoxPresenter::OnDrawFocus(void)
-{
- _ControlImpl* pImpl = null;
- _Button* pButtonCore = null;
-
- if (__pButtons[0] != null)
- {
- pImpl = _ControlImpl::GetInstance(*__pButtons[0]);
- pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore());
- __pButtons[0]->SetFocus();
- __pMessageBox->SetFocusTraversalControl(pButtonCore, true);
- }
-
- return;
-}
bool
_MessageBoxPresenter::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
if ((__pButtonListener->GetBeginModal() == true) || (__beginModal == true))
{
- if (__pMessageBox->GetTimeout() != 0)
- {
- switch (style)
- {
- case MSGBOX_STYLE_NONE:
- // fall through
- case MSGBOX_STYLE_OK:
- // fall through
- case MSGBOX_STYLE_YESNO:
- // fall through
- case MSGBOX_STYLE_ABORTRETRYIGNORE:
- _ModalLoopManager::GetInstance()->EndMainLoop(MSGBOX_BUTTON_CLOSE, false);
- __beginModal = false;
-
- break;
- case MSGBOX_STYLE_CANCEL:
- // fall through
- case MSGBOX_STYLE_OKCANCEL:
- // fall through
- case MSGBOX_STYLE_YESNOCANCEL:
- // fall through
- case MSGBOX_STYLE_CANCELTRYCONTINUE:
- // fall through
- case MSGBOX_STYLE_RETRYCANCEL:
- _ModalLoopManager::GetInstance()->EndMainLoop(MSGBOX_BUTTON_CANCEL, false);
- __beginModal = false;
- break;
- }
-
- }
- else if (style == MSGBOX_STYLE_CANCEL || style == MSGBOX_STYLE_OKCANCEL || style == MSGBOX_STYLE_YESNOCANCEL
- || style == MSGBOX_STYLE_CANCELTRYCONTINUE || style == MSGBOX_STYLE_RETRYCANCEL)
+ switch (style)
{
+ case MSGBOX_STYLE_CANCEL:
+ // fall through
+ case MSGBOX_STYLE_OKCANCEL:
+ // fall through
+ case MSGBOX_STYLE_YESNOCANCEL:
+ // fall through
+ case MSGBOX_STYLE_CANCELTRYCONTINUE:
+ // fall through
+ case MSGBOX_STYLE_RETRYCANCEL:
_ModalLoopManager::GetInstance()->EndMainLoop(MSGBOX_BUTTON_CANCEL, false);
__beginModal = false;
+ break;
+ default:
+ break;
}
}
return true;
__pCurrentFrame = null;
- if (__pScrollPanel)
+ if (__pScrollPanel != null)
{
__pScrollPanel->DetachAllChildren();
DetachChild(*__pScrollPanel);
delete __pOptionMenuPresenter;
__pOptionMenuPresenter = null;
- if (__pBackgroundNormalBitmap != null)
- {
- delete __pBackgroundNormalBitmap;
- __pBackgroundNormalBitmap = null;
- }
+ delete __pBackgroundNormalBitmap;
+ __pBackgroundNormalBitmap = null;
- if (__pBackgroundEffectBitmap != null)
- {
- delete __pBackgroundEffectBitmap;
- __pBackgroundEffectBitmap = null;
- }
+ delete __pBackgroundEffectBitmap;
+ __pBackgroundEffectBitmap = null;
- if (__pActionEvent)
- {
- delete __pActionEvent;
- __pActionEvent = null;
- }
+ delete __pActionEvent;
+ __pActionEvent = null;
__actionId.RemoveAll();
r = __pOptionMenuPresenter->CalculateWindowRect();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ GetEcoreEvasMgr()->GetEcoreEvas()->SetWindowBounds(*this, GetBoundsF());
+
SetAllAccessibilityElement();
_VisualElement* pVisualElement = GetVisualElement();
{
ReleaseTouchCapture();
- if (__pCurrentFrame)
+ if (__pCurrentFrame != null)
{
__pCurrentFrame->RemoveFrameEventListener(*this);
}
{
_TouchManager* pTouchManager = _TouchManager::GetInstance();
- if (pTouchManager)
+ if (pTouchManager != null)
{
pTouchManager->SetTouchCanceled(null);
}
GET_SHAPE_CONFIG(OPTIONMENU::MAX_VISIBLE_ITEM_COUNT, __layout, __showItemCount);
}
- if (__isAttachedToMainTree == true)
+ if (__isAttachedToMainTree)
{
if(__rotation != rotation)
{
_OptionMenu::RemoveAllAccessibilityElement(void)
{
_AccessibilityContainer* pAccessibilityContainer = GetAccessibilityContainer();
- if (pAccessibilityContainer && pAccessibilityContainer->IsActivated())
+ if (pAccessibilityContainer != null && pAccessibilityContainer->IsActivated())
{
pAccessibilityContainer->RemoveAllElement();
}
_OptionMenuImpl::~_OptionMenuImpl(void)
{
- if (__pPublicActionEvent != null)
- {
- delete __pPublicActionEvent;
- __pPublicActionEvent = null;
- }
+ delete __pPublicActionEvent;
+ __pPublicActionEvent = null;
}
result
_OptionMenuItem::~_OptionMenuItem(void)
{
- if (__pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL] != null)
- {
- delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL];
- __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL] = null;
- }
+ delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL];
+ __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_NORMAL] = null;
- if (__pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_PRESSED] != null)
- {
- delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_PRESSED];
- __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_PRESSED] = null;
- }
+ delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_PRESSED];
+ __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_PRESSED] = null;
- if (__pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED] != null)
- {
- delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED];
- __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED] = null;
- }
+ delete __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED];
+ __pBitmap[OPTION_MENU_ITEM_DRAWING_STATUS_HIGHLIGHTED] = null;
if (__pUpperDividerLineLabel != null)
{
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->RemoveAllElement();
}
_OptionMenuItem::InitializeAccessibilityElement(void)
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
_AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
_OptionMenuItem::OnBoundsChanged(void)
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
_AccessibilityElement* pElement = pContainer->GetChildElement(0);
- if (pElement)
+ if (pElement != null)
{
pElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
DrawItemBackground();
DrawItemBitmap();
- if (HasSubItem() == true)
+ if (HasSubItem())
{
DrawArrow();
}
AttachChild(*__pArrowLabel);
_AccessibilityContainer* pContainer = __pArrowLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
(__itemHeight - __pArrowBitmap->GetHeight())/2.0f, __pArrowBitmap->GetWidth(), __pArrowBitmap->GetHeight());
__pArrowLabel->SetBounds(FloatRectangle(arrowbounds));
- if (__selected == true)
+ if (__selected)
{
__pArrowLabel->SetBackgroundBitmap(*__pArrowPressedBitmap);
}
AttachChild(*__pUpperDividerLineLabel);
_AccessibilityContainer* pContainer = __pUpperDividerLineLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
MoveChildToBottom(*__pBackgroundLabel);
_AccessibilityContainer* pContainer = __pBackgroundLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
FloatRectangle bounds = GetBoundsF();
Color color= Color(0, 0, 0, 0);
- if (__selected == true)
+ if (__selected)
{
color = __selectedBgColor;
}
AttachChild(*__pLowerDividerLineLabel);
_AccessibilityContainer* pContainer = __pLowerDividerLineLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
_Label* pLabel = null;
- if (pNormalBitmap)
+ if (pNormalBitmap != null)
{
itemType = OPTION_MENU_ITEM_DRAWING_TYPE_BITMAP;
}
pLabel = pItem->GetBitmapLabel();
- if (pLabel)
+ if (pLabel != null)
{
pLabel->SetBackgroundBitmap(*pNormalBitmap);
}
pLabel = pItem->GetTextLabel();
- if (pLabel)
+ if (pLabel != null)
{
pLabel->SetText(text);
pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
pItem->SetBitmapLabel(pLabel);
_AccessibilityContainer* pContainer = pLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
pContainer = pLabel->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(false);
}
{
maxItemWidth = itemSize.width;
}
+
+ __itemWidth = maxItemWidth;
}
- __itemWidth = maxItemWidth;
}
result
float bodyLeftMargin = __leftMargin;
float bodyRightMargin = __rightMargin;
+ int scrollPanelMargin;
+ GET_SHAPE_CONFIG(OPTIONMENU::SCROLL_PANEL_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, scrollPanelMargin);
+
FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF();
_ControlRotation rotation = __pOptionMenu->GetRotation();
AdjustItemLayout();
bodyRect.width = __layoutSize.width + bodyLeftMargin + bodyRightMargin;
- bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin;
+ bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin + 2 * scrollPanelMargin;
if (rotation == _CONTROL_ROTATION_270 && __pOptionMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE)
{
bodyRect.y = 0.0f;
itemRect.x = bodyRect.x + bodyLeftMargin;
- itemRect.y = bodyRect.y + bodyTopMargin;
+ itemRect.y = bodyRect.y + bodyTopMargin + scrollPanelMargin;
itemRect.width = __layoutSize.width;
itemRect.height = __layoutSize.height;
// _Scroll visual interaction if Bounds < ScrollAreaBounds
if (__pOptionMenu->IsVisible())
{
- int itemTopMargin;
- GET_SHAPE_CONFIG(OPTIONMENU::ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemTopMargin);
-
- __pOptionMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + itemTopMargin,
- __layoutSize.width, __layoutSize.height - 2 * itemTopMargin));
+ __pOptionMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + scrollPanelMargin,
+ __layoutSize.width, __layoutSize.height));
int itemCount = __pModel->GetItemCount();
float itemHeight = __itemHeight + (__dividerHeight * 2.0f);
float layoutClientHeight = itemCount * itemHeight - (__dividerHeight * 2.0f);
- __pOptionMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight - 2 * itemTopMargin);
+ __pOptionMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight);
}
__pOptionMenu->SetMovable(true);
pItem->SetParentScrollEnable(__scrollEnable);
pItem->SetBounds(FloatRectangle(0.0f, drawItemY, drawRect.width, drawRect.height));
- if (pItem->HasParent() == false)
+ if (!pItem->HasParent())
{
__pOptionMenu->GetScrollPanel()->AttachChild(*pItem);
}
FloatRectangle drawRect = pItem->GetDrawRect();
- if (drawRect.Contains(position) == true)
+ if (drawRect.Contains(position))
{
index = i;
break;
if (pItem != null)
{
- if (pItem->HasSubItem() == true)
+ if (pItem->HasSubItem())
{
// Show SubItem
__pOptionMenu->ShowSubMenu(selectedIndex, *pItem);
FloatPoint touchPosition = touchinfo.GetCurrentPosition();
FloatRectangle itemRect = __pOptionMenu->GetItemRect();
- if (__pOptionMenu->IsSubMenuShown() == true)
+ if (__pOptionMenu->IsSubMenuShown())
{
__pOptionMenu->DestroySubMenu();
__pOptionMenu->SetTouchCapture(false, false);
if (pItem != null)
{
- if (pItem->HasSubItem() == true)
+ if (pItem->HasSubItem())
{
// Show SubItem
__pOptionMenu->ShowSubMenu(__selectedIndex, *pItem);
for (int i = 0; i < itemCount; i++)
{
_OptionMenuItem* pItem = __pModel->GetItem(i);
- if (pItem)
+ if (pItem != null)
{
_AccessibilityContainer* pContainer = pItem->GetAccessibilityContainer();
if (pContainer != null)
using namespace std;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Runtime;
using namespace Tizen::Graphics;
using namespace Tizen::Io;
using namespace Tizen::Media;
}
};
+_OverlayAgent::_OverlayVisualElement::_OverlayVisualElement(void)
+ : __pTimer(null)
+ , __pImageObject(null)
+ , __showStateChanged(false)
+{
+}
+
+_OverlayAgent::_OverlayVisualElement::_OverlayVisualElement(const _OverlayVisualElement& rhs)
+ : _VisualElement(rhs)
+ , __pTimer(null)
+ , __pImageObject(rhs.__pImageObject)
+ , __showStateChanged(rhs.__showStateChanged)
+{
+}
+
+_OverlayAgent::_OverlayVisualElement::~_OverlayVisualElement(void)
+{
+ if (__pTimer)
+ {
+ __pTimer->Cancel();
+ delete __pTimer;
+ __pTimer = null;
+ }
+
+ if (__pImageObject)
+ {
+ evas_object_event_callback_del(__pImageObject, EVAS_CALLBACK_SHOW, OnImageObjectShown);
+ evas_object_event_callback_del(__pImageObject, EVAS_CALLBACK_HIDE, OnImageObjectHidden);
+ }
+}
+
+result
+_OverlayAgent::_OverlayVisualElement::Construct(void)
+{
+ if (!__pTimer)
+ {
+ __pTimer = new (nothrow) Timer();
+ __pTimer->Construct(*this);
+ }
+
+ return _VisualElement::Construct();
+}
+
+Evas_Object*
+_OverlayAgent::_OverlayVisualElement::GetImageObject(void) const
+{
+ return __pImageObject;
+}
+
+void
+_OverlayAgent::_OverlayVisualElement::SetImageObject(Evas_Object* pImageObject)
+{
+ if (__pImageObject)
+ {
+ evas_object_event_callback_del(__pImageObject, EVAS_CALLBACK_SHOW, OnImageObjectShown);
+ evas_object_event_callback_del(__pImageObject, EVAS_CALLBACK_HIDE, OnImageObjectHidden);
+ }
+
+ __pImageObject = pImageObject;
+
+ if (__pImageObject)
+ {
+ evas_object_event_callback_add(__pImageObject, EVAS_CALLBACK_SHOW, OnImageObjectShown, this);
+ evas_object_event_callback_add(__pImageObject, EVAS_CALLBACK_HIDE, OnImageObjectHidden, this);
+ }
+}
+
+void
+_OverlayAgent::_OverlayVisualElement::SetImageObjectShowStateChanged(void)
+{
+ __showStateChanged = true;
+
+ __pTimer->Start(0);
+}
+
+void
+_OverlayAgent::_OverlayVisualElement::OnImageObjectShown(void* pData, Evas *pEvas, Evas_Object *pImageObject, void *event_info)
+{
+ _OverlayVisualElement* pOverlayVE = reinterpret_cast<_OverlayVisualElement*>(pData);
+ if (pOverlayVE)
+ {
+ pOverlayVE->SetImageObjectShowStateChanged();
+ SysSecureLog(NID_UI_CTRL, "The show state of Renderer VisualElement is set to SHOW");
+ }
+}
+
+void
+_OverlayAgent::_OverlayVisualElement::OnImageObjectHidden(void* pData, Evas *pEvas, Evas_Object *pImageObject, void *event_info)
+{
+ _OverlayVisualElement* pOverlayVE = reinterpret_cast<_OverlayVisualElement*>(pData);
+ if (pOverlayVE)
+ {
+ pOverlayVE->SetImageObjectShowStateChanged();
+ SysSecureLog(NID_UI_CTRL, "The show state of Renderer VisualElement is set to HIDE");
+ }
+}
+
+VisualElement*
+_OverlayAgent::_OverlayVisualElement::CloneN(void) const
+{
+ return new (nothrow) _OverlayVisualElement(*this);
+}
+
+void
+_OverlayAgent::_OverlayVisualElement::OnTimerExpired(Timer& timer)
+{
+ if (__showStateChanged && __pImageObject)
+ {
+ SetShowState(evas_object_visible_get(__pImageObject));
+ __showStateChanged = false;
+ SysSecureLog(NID_UI_CTRL, "Updates show state of Renderer VisualElement");
+ }
+}
+
_OverlayAgent*
_OverlayAgent::CreateInstanceN(_OverlayAgentStyle style, const _Control& parentControl, const FloatRectangle& logicalBounds, const Rectangle& physicalBounds)
{
- unique_ptr<_OverlayAgent> pOverlayAgent(new (std::nothrow) _OverlayAgent(style, parentControl, logicalBounds, physicalBounds));
+ unique_ptr<_OverlayAgent> pOverlayAgent(new (nothrow) _OverlayAgent(style, parentControl, logicalBounds, physicalBounds));
SysTryReturn(NID_UI_CTRL, pOverlayAgent != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
result r = GetLastResult();
}
_OverlayAgent::_OverlayAgent(_OverlayAgentStyle style, const _Control& parentControl, const FloatRectangle& logicalBounds, const Rectangle& physicalBounds)
- : __pParentVE(null)
- , __pRendererVE(null)
+ : __pRendererVE(null)
+ , __pParentVE(null)
, __pImageObject(null)
, __style(style)
, __currentRotation(_OVERLAY_AGENT_ROTATION_NONE)
SysLog(NID_UI_CTRL, "The %dth OverlayAgent is deleted.", __overlayAgentCount);
__overlayAgentCount--;
- UngrabXvPort();
+ if (__xvPort > 0)
+ {
+ UngrabXvPort();
+ }
if (__pPixmapEventHandler)
{
SysTryReturnResult(NID_UI_CTRL, false, E_SYSTEM, "Failed to check XvExtension");
}
- SysTryReturnResult(NID_UI_CTRL, baseXvPort != -1, E_SYSTEM, "The current value of base XvPort is invalid.");
+ SysTryReturnResult(NID_UI_CTRL, baseXvPort > 0, E_SYSTEM, "The current value of base XvPort is invalid.");
SysTryReturnResult(NID_UI_CTRL, portCount >= 1 && portCount <= _OVERLAYAGENT_XV_PORT, E_SYSTEM, "The current count of available XvPort[%d] is invalid.", portCount);
_OverlayAgent::__baseXvPort = baseXvPort;
}
}
- SysTryReturnResult(NID_UI_CTRL, __xvPort != -1, E_SYSTEM, "Failed to grab pixmap[%d]", __pixmap);
+ SysTryReturnResult(NID_UI_CTRL, __xvPort > 0, E_SYSTEM, "Failed to grab pixmap[%d]", __pixmap);
SysSecureLog(NID_UI_CTRL, "The current value of grabbed XvPort is [%d] and pixmap is [%d]", __xvPort, __pixmap);
return E_SUCCESS;
{
ClearLastResult();
- if (__isPortGrabbed[__xvPort - __baseXvPort])
+ if (__xvPort > 0 && (__xvPort - __baseXvPort) >= 0 && __isPortGrabbed[__xvPort - __baseXvPort])
{
Display* pDisplay = (Display*) ecore_x_display_get();
Atom atom = XInternAtom(pDisplay, "_USER_WM_PORT_ATTRIBUTE_STREAM_OFF", False);
result
_OverlayAgent::CreateRendererVisualElement(const _Control& parentControl, const FloatRectangle& logicalBounds, const Rectangle& physicalBounds)
{
+
//Create new VisualElement and insert it to Parent's VisualElement
- unique_ptr<_VisualElement, visualElementDeleter> pRendererVE(new (std::nothrow) _VisualElement());
+ unique_ptr<_OverlayVisualElement, visualElementDeleter> pRendererVE(new (std::nothrow) _OverlayVisualElement());
SysTryReturnResult(NID_UI_CTRL, pRendererVE != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient");
result r = pRendererVE->Construct();
evas_object_resize(__pImageObject, physicalBounds.width, physicalBounds.height);
evas_object_move(__pImageObject, physicalBounds.x, physicalBounds.y);
evas_object_show(__pImageObject);
+ pRendererVE->SetImageObject(__pImageObject);
+
DisplayContext* pDisplayContext = parentControl.GetRootWindow()->GetDisplayContext();
SysTryReturnResult(NID_UI_CTRL, pDisplayContext != null, E_SYSTEM, "[E_SYSTEM] The current value of RootWindow's DisplayContext is null.");
case OverlayPanel::BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR:
format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_YCbCr420_PLANAR;
break;
+ case OverlayPanel::BUFFER_PIXEL_FORMAT_UYVY:
+ format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_UYVY;
+ break;
+ case OverlayPanel::BUFFER_PIXEL_FORMAT_NV12:
+ format = _OVERLAY_AGENT_BUFFER_PIXEL_FORMAT_NV12;
+ break;
default:
SysLogException(NID_UI_CTRL, E_UNSUPPORTED_FORMAT, "The specified pixel format is unsupported.");
return E_UNSUPPORTED_FORMAT;
#include "FUi_ControlManager.h"
#include "FUi_ResourceSizeInfo.h"
#include "FUi_UiBuilder.h"
+#include "FUiCtrl_FormImpl.h"
#include "FUiCtrl_OverlayAgent.h"
#include "FUiCtrl_OverlayPanelImpl.h"
}
void
+_OverlayPanelImpl::SetChildBuilderBounds(_ContainerImpl* pContainerImpl, _ControlOrientation controlOrientation)
+{
+ FloatRectangle builderBounds;
+ _ContainerImpl* pTempContainerImpl;
+
+ for(int i = 0; i < pContainerImpl->GetChildCount(); i++)
+ {
+ _ControlImpl* pControlImpl = pContainerImpl->GetChild(i);
+ bool exist = pControlImpl->GetBuilderBoundsF(controlOrientation, builderBounds);
+ if (!exist)
+ {
+ continue;
+ }
+
+ pControlImpl->SetBounds(builderBounds);
+ pTempContainerImpl = dynamic_cast<_ContainerImpl*>(pControlImpl);
+ if (pTempContainerImpl != null)
+ {
+ SetChildBuilderBounds(pTempContainerImpl, controlOrientation);
+ }
+ }
+}
+
+result
+_OverlayPanelImpl::OnAttachedToMainTree(void)
+{
+ //result r = SetFocusable(false);
+ result r = E_SUCCESS;
+
+ _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+ FloatRectangle builderBounds;
+ bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+
+ if (exist)
+ {
+ _ContainerImpl* pContainerImpl = this;
+ _FormImpl* pParentImpl = null;
+
+ while (pContainerImpl)
+ {
+ pParentImpl = dynamic_cast<_FormImpl*>(pContainerImpl->GetParent());
+ if (pParentImpl != null)
+ {
+ break;
+ }
+ else
+ {
+ pContainerImpl = pContainerImpl->GetParent();
+ }
+ }
+
+ if (pParentImpl)
+ {
+ OrientationStatus orientation = pParentImpl->GetOrientationStatus();
+ if (orientation == ORIENTATION_STATUS_LANDSCAPE || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
+ GetBuilderBoundsF(controlOrientation, builderBounds);
+ }
+
+ r = SetBounds(builderBounds);
+ SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Failed to SetBounds", GetErrorMessage(r));
+ SetChildBuilderBounds(this, controlOrientation);
+ }
+ }
+
+ r = _ContainerImpl::OnAttachedToMainTree();
+ SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "[%s] Failed to OnAttachedToMainTree", GetErrorMessage(r));
+
+ return r;
+}
+
+void
_OverlayPanelImpl::SetRendererRotation(OverlayPanel::Rotation rotation)
{
GetCore().SetRendererRotation(rotation);
SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] The current type of OverlayAgen[%d] is invalid.", overlayRegionType);
return E_SYSTEM;
}
-
return r;
}
_titleState = hasTitle;
__bounds = bounds;
SetClientBounds(GetPopupClientArea());
+ SetFocusNavigateEnabled(false);
_PopupPresenter* pPresenter = new (std::nothrow) _PopupPresenter();
SysTryReturn(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
SysTryReturnVoidResult(NID_UI_CTRL, pPresenter != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
_pTitleTextAccessibilityElement->Construct(L"PopupTitleText", pPresenter->GetTitleTextBounds());
_pTitleTextAccessibilityElement->SetLabel(GetTitleText());
- _pTitleTextAccessibilityElement->SetTrait(L"Popup Title");
+ _pTitleTextAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_POP_UP_HEADER_T_TALKBACK");
pContainer->AddElement(*_pTitleTextAccessibilityElement);
}
}
}
-void
-_Popup::OnDrawFocus(void)
-{
- return;
-}
-
bool
_Popup::IsLayoutChangable(void) const
{
, __init(false)
, __callBoundsChange(false)
, __prevPos(0.0f, 0.0f)
+ , __boundsChangedInternally(false)
+ , __boundsChangedExternally(false)
{
//empty statement
}
FloatRectangle bounds = GetCenterAlignedRect(dim.width, dim.height);
__init = true;
_centerAlign = true;
-
+ __boundsChangedInternally = true;
r = SetBounds(bounds);
+ __boundsChangedInternally = false;
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
return GetCore().Initialize(hasTitle, bounds);
}
{
_centerAlign = true;
- if(GetXmlBounds(bounds))
+ if (__boundsChangedExternally)
{
- bounds = GetCenterAlignedRect(bounds.width, bounds.height);
+ bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
}
else
{
- bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+
+ if(GetXmlBounds(bounds))
+ {
+ bounds = GetCenterAlignedRect(bounds.width, bounds.height);
+ }
+ else
+ {
+ bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+ }
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
}
- r = SetBounds(bounds);
+
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
- if(GetXmlBounds(bounds))
+ if (!__boundsChangedExternally)
{
- r = SetBounds(bounds);
+ if(GetXmlBounds(bounds))
+ {
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
+ }
}
+
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
void
_PopupImpl::OnBoundsChanged(void)
{
+ if (!__boundsChangedInternally && __init)
+ {
+ __boundsChangedExternally = true;
+ }
+
FloatRectangle rect = GetBoundsF();
if (__init)
{
}
_centerAlign = true;
-
+ __boundsChangedInternally = true;
result r = SetBounds(rect, true);
+ __boundsChangedInternally = false;
if (IsFailed(r))
{
// Error propagation fall through
}
}
+ // Draw Outline
+ if (!isCustomBitmap && __pPopup->GetOutlineBitmap() != null &&
+ _FloatCompareGE(pBounds.width, minSize.width) &&
+ _FloatCompareGE(pBounds.height, minSize.height) && __pPopup->GetColor().GetAlpha() != 0x00)
+ {
+ FloatRectangle bounds(0.0f,
+ 0.0f,
+ pBounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin,
+ pBounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin);
+
+ const Bitmap* pOutlineBitmap = __pPopup->GetOutlineBitmap();
+
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pOutlineBitmap))
+ {
+ pBackgroundCanvas->DrawNinePatchedBitmap(bounds, *pOutlineBitmap);
+ }
+ else
+ {
+ pBackgroundCanvas->DrawBitmap(bounds, *pOutlineBitmap);
+ }
+ }
+
// Draw Title
if (__pPopup->HasTitle())
{
}
}
- // Draw Outline
- if (!isCustomBitmap && __pPopup->GetOutlineBitmap() != null &&
- _FloatCompareGE(pBounds.width, minSize.width) &&
- _FloatCompareGE(pBounds.height, minSize.height) && __pPopup->GetColor().GetAlpha() != 0x00)
- {
- FloatRectangle bounds(0.0f,
- 0.0f,
- pBounds.width + bgOutlineEffectLeftMargin + bgOutlineEffectRightMargin,
- pBounds.height + bgOutlineEffectTopMargin + bgOutlineEffectBottomMargin);
-
- const Bitmap* pOutlineBitmap = __pPopup->GetOutlineBitmap();
-
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pOutlineBitmap))
- {
- pBackgroundCanvas->DrawNinePatchedBitmap(bounds, *pOutlineBitmap);
- }
- else
- {
- pBackgroundCanvas->DrawBitmap(bounds, *pOutlineBitmap);
- }
- }
-
//fall thtrough
CATCH:
delete pCanvas;
{
delete __pProgressPresenter;
__pProgressPresenter = null;
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->Activate(false);
__pAccessibilityElement = null;
pProgress->AcquireHandle();
pProgress->SetFocusable(false);
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
pProgress->InitializeAccessibilityElement();
{
result r = E_SUCCESS;
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
return r;
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
__pAccessibilityElement = new _AccessibilityElement(true);
SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
result
_Progress::OnAttachedToMainTree(void)
{
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBounds().width, GetBounds().height));
}
void
_Progress::OnBoundsChanged(void)
{
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBounds().width, GetBounds().height));
}
r = InitializeAccessibilityElement();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
String string;
GET_STRING_CONFIG(IDS_TPLATFORM_BODY_PD_PERCENT_T_TTS, string);
}
}
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
String string;
GET_STRING_CONFIG(IDS_TPLATFORM_BODY_PD_PERCENT_T_TTS, string);
if (pControl->GetElement(L"accessibilityHint", elementString))
{
AccessibilityContainer* pContainer = pProgress->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement(L"ProgressingImage");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementString);
}
__buttonState = cancelButton;
__isTransparent = transparent;
+ SetFocusNavigateEnabled(false);
+
_ProgressPopupPresenter* pPresenter = new (std::nothrow) _ProgressPopupPresenter();
SysTryReturn(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
void
-_ProgressPopup::OnDrawFocus(void)
-{
- _ControlImpl* pImpl = null;
- _Button* pButtonCore = null;
-
- if (__pButton != null)
- {
- pImpl = _ControlImpl::GetInstance(*__pButton);
- pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore());
- __pButton->SetFocus();
- SetFocusTraversalControl(pButtonCore, true);
- }
-
- return;
-}
-
-void
_ProgressPopup::SetButtonText(void)
{
String buttonText;
width = (width) * ((__pProgressModel->GetValue() - minValue) * 100.0f / (maxValue - minValue)) / 100.0f;
}
- if (__pProgress->IsEnabled() == false) // disabled
+ if (!__pProgress->IsEnabled()) // disabled
{
__pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF);
r = DrawBitmap(*pCanvas, FloatRectangle(leftMargin, (bounds.height - height) / 2.0f, (bounds.width - (2.0f * leftMargin)), height), __pBarBgColorReplacementBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomBarBitmap == false)
+ if (!isCustomBarBitmap)
{
r = DrawBitmap(*pCanvas, FloatRectangle(leftMargin, (bounds.height - height) / 2.0f, (bounds.width - (2.0f * leftMargin)), height), __pBarBgResourceEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
__pBarColorReplacementBitmap = pReplacementBitmap;
__currentBarColor = __pProgress->GetBarColor();
}
- if (__pProgress->IsEnabled() == false) // disabled
+ if (!__pProgress->IsEnabled()) // disabled
{
__pBarColorReplacementBitmap->SetAlphaConstant(0x4C);
}
r = DrawBitmap(*pCanvas, FloatRectangle((leftMargin + offset), (bounds.height - height) / 2.0f, width, height), __pBarColorReplacementBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomBarBitmap == false)
+ if (!isCustomBarBitmap)
{
r = DrawBitmap(*pCanvas, FloatRectangle((leftMargin + offset), (bounds.height - height) / 2.0f, width, height), __pBarResourceEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
, __hour(0)
, __minute(0)
{
- SystemTime::GetCurrentTime(WALL_TIME, __dateTime1);
+ SystemTime::GetCurrentTime(TIME_MODE_WALL, __dateTime1);
}
_PublicDateTimeChangeEventArg::~_PublicDateTimeChangeEventArg(void)
SplitPanelEventStatus status = pArg->GetStatus();
if (status == SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE)
{
- if (pSplitPanelEventListener)
+ if (pSplitPanelEventListener != null)
{
pSplitPanelEventListener->OnDividerPositionChanged(*pSource, pSource->GetDividerPosition());
}
- if (pSplitPanelEventListenerF)
+ if (pSplitPanelEventListenerF != null)
{
pSplitPanelEventListenerF->OnDividerPositionChanged(*pSource, pSource->GetDividerPositionF());
}
}
else
{
- if (pSplitPanelEventListener)
+ if (pSplitPanelEventListener != null)
{
pSplitPanelEventListener->OnDividerDoublePressed(*pSource);
}
- if (pSplitPanelEventListenerF)
+ if (pSplitPanelEventListenerF != null)
{
pSplitPanelEventListenerF->OnDividerDoublePressed(*pSource);
}
delete __pScrollEvent;
__pScrollEvent = null;
+ if (__pScrollPanelPresenter != null)
+ {
+ __pScrollPanelPresenter->StopScrollBarLoadEffectTimer();
+ }
+
if (__pVerticalScrollBar != null && IsAncestorOf(*__pVerticalScrollBar))
{
DetachSystemChild(*__pVerticalScrollBar);
float currentPosition = GetScrollPosition();
float targetPosition = CalculatePagingScrollPosition(currentPosition);
- if (!_FloatCompare(targetPosition, currentPosition))
+ if (targetPosition > currentPosition || targetPosition < currentPosition)
{
SetScrollPosition(targetPosition, true);
result r = GetLastResult();
{
__scrollBarLoadEffectStatus = _SCROLL_PANEL_SCROLL_BAR_LOAD_EFFECT_LOADED;
- StopScrollBarLoadEffectTimer();
+ delete __pScrollBarLoadEffectTimer;
+ __pScrollBarLoadEffectTimer = null;
FadeOutScrollBar();
result r = GetLastResult();
void
_ScrollPanelPresenter::StopScrollBarLoadEffectTimer(void)
{
- delete __pScrollBarLoadEffectTimer;
- __pScrollBarLoadEffectTimer = null;
+ if (__pScrollBarLoadEffectTimer)
+ {
+ __pScrollBarLoadEffectTimer->Cancel();
+ }
}
void
#include "FUiCtrl_SearchBarImpl.h"
#include "FUiCtrl_EditFieldImpl.h"
#include "FUiCtrl_ButtonImpl.h"
+#include "FUi_FocusManagerImpl.h"
#include <FSys_SettingInfoImpl.h>
, __isFocusCallbackToBeFired(true)
, __isButtonTextChangedByApp(false)
, __contentVisibilitySetByApp(true)
- , __isInFocusMode(false)
, __isFocusUiInitialized(false)
, __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
, __pBackgroundBitmap(null)
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
}
delete __pSearchBarPresenter;
__pSearchBarPresenter = null;
- if (__pClippedGroupControl)
+ if (__pClippedGroupControl != null)
{
DetachChild(*__pClippedGroupControl);
__pClippedGroupControl = null;
}
- if (__pContainer)
+ if (__pContainer != null)
{
DetachChild(*__pContainer);
__pContainer = null;
}
- if (__pActionEvent)
- {
- delete __pActionEvent;
- __pActionEvent = null;
- }
+ delete __pActionEvent;
+ __pActionEvent = null;
- if (__pKeypadEvent)
- {
- delete __pKeypadEvent;
- __pKeypadEvent = null;
- }
+ delete __pKeypadEvent;
+ __pKeypadEvent = null;
- if (__pTextBlockEvent)
- {
- delete __pTextBlockEvent;
- __pTextBlockEvent = null;
- }
+ delete __pTextBlockEvent;
+ __pTextBlockEvent = null;
- if (__pTextEvent)
- {
- delete __pTextEvent;
- __pTextEvent = null;
- }
+ delete __pTextEvent;
+ __pTextEvent = null;
- if (__pSearchBarEvent)
- {
- delete __pSearchBarEvent;
- __pSearchBarEvent = null;
- }
+ delete __pSearchBarEvent;
+ __pSearchBarEvent = null;
- if (__pLanguageEvent)
- {
- delete __pLanguageEvent;
- __pLanguageEvent = null;
- }
+ delete __pLanguageEvent;
+ __pLanguageEvent = null;
- if (__pAccessibilitySearchBarElement)
+ if (__pAccessibilitySearchBarElement != null)
{
__pAccessibilitySearchBarElement->Activate(false);
__pAccessibilitySearchBarElement = null;
__contentAreaBounds.width = width - controlBounds.x;
__contentAreaBounds.height = height - (controlBounds.y + controlBounds.height);
- if (__pContainer)
+ if (__pContainer != null)
{
result r = E_SUCCESS;
r = __pContainer->SetBounds(__contentAreaBounds);
__pContentControl = const_cast <_Control*>(pContent);
result r = E_SUCCESS;
- if (__pContainer)
+ if (__pContainer != null)
{
r = __pContainer->AttachChild(*__pContentControl);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating");
}
result
-_SearchBar::SetMode(SearchBarMode mode)
+_SearchBar::SetMode(SearchBarMode mode, bool isCalledByApp)
{
_AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
- if (mode == SEARCH_BAR_MODE_NORMAL)
- {
- pEditElement->SetHint("Double Tap To Type Search Text");
- }
- else
- {
- pEditElement->SetHint("Enter Search Text");
- }
-
- pEditElement->SetTrait("SearchBar");
+// if (mode == SEARCH_BAR_MODE_NORMAL)
+// {
+// pEditElement->SetHint("Double Tap To Type Search Text");
+// }
+// else
+// {
+// pEditElement->SetHint("Enter Search Text");
+// }
+
+// pEditElement->SetTrait("SearchBar");
pEditElement->SetName("SearchField");
- return __pSearchBarPresenter->SetMode(mode);
+ return __pSearchBarPresenter->SetMode(mode, isCalledByApp);
}
result
_SearchBar::SetModeLocked(bool modeLocked)
{
- if (modeLocked == true && GetMode() == SEARCH_BAR_MODE_NORMAL)
+ if (modeLocked && GetMode() == SEARCH_BAR_MODE_NORMAL)
{
__pEdit->SetViewModeEnabled(true);
}
- if (modeLocked == false && __pEdit->IsViewModeEnabled())
+ if (!modeLocked && __pEdit->IsViewModeEnabled())
{
__pEdit->SetViewModeEnabled(false);
}
SearchBarButtonStatus buttonStatus = SEARCH_BAR_BUTTON_STATUS_NORMAL;
- if (__isButtonEnabled == false)
+ if (!__isButtonEnabled)
{
buttonStatus = SEARCH_BAR_BUTTON_STATUS_DISABLED;
}
__pSearchBarPresenter->OnBoundsChanged();
}
- if (__pAccessibilitySearchBarElement)
+ if (__pAccessibilitySearchBarElement != null)
{
__pAccessibilitySearchBarElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
return _UI_TOUCH_EVENT_DELIVERY_YES;
}
+bool
+_SearchBar::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
+{
+ __pSearchBarPresenter->OnTouchReleased(source);
+ return true;
+}
+
void
_SearchBar::FireButtonActionEvent(const _Control &source, int actionId)
{
SetFocused();
- if (__pActionEvent)
+ if (__pActionEvent != null)
{
IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(__actionId);
result r = GetLastResult();
{
if (!__isKeypadOpening)
{
- if (__pKeypadEvent)
+ if (__pKeypadEvent != null)
{
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CREATED);
result r = GetLastResult();
void
_SearchBar::OnKeypadOpened(void)
{
- if (__pKeypadEvent)
+ if (__pKeypadEvent != null)
{
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_OPEN);
result r = GetLastResult();
void
_SearchBar::OnKeypadClosed(void)
{
- if (__pKeypadEvent)
+ if (__pKeypadEvent != null)
{
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_CLOSE);
result r = GetLastResult();
void
_SearchBar::OnKeypadBoundsChanged(void)
{
- if (__pKeypadEvent)
+ if (__pKeypadEvent != null)
{
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(CORE_KEYPAD_ACTION_SEARCH, CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
result r = GetLastResult();
void
_SearchBar::OnKeypadActionPerformed(CoreKeypadAction keypadAction)
{
- if (__pKeypadEvent)
+ if (__pKeypadEvent != null)
{
IEventArg* pEventArg = _KeypadEvent::CreateKeypadEventArgN(keypadAction, CORE_KEYPAD_EVENT_STATUS_ENTERACTION);
result r = GetLastResult();
void
_SearchBar::OnTextBlockSelected(_Control& source, int start, int end)
{
- if (__pTextBlockEvent)
+ if (__pTextBlockEvent != null)
{
IEventArg* pEventArg = _TextBlockEvent::CreateTextBlockEventArgN(start, end);
result r = GetLastResult();
_SearchBar::OnDrawFocus(void)
{
__isFocusUiInitialized = true;
- __isInFocusMode = true;
__pEdit->SetSearchFieldFocus(true);
_Control::OnDrawFocus();
return;
}
-void
-_SearchBar::OnFocusModeStateChanged(void)
-{
- __isInFocusMode = false;
-
- if (__pEdit->IsFocused())
- {
- __pEdit->SetSearchFieldFocus(false);
- __pEdit->Invalidate();
- }
-
- if (__pCancelButton->IsFocused())
- {
- __pCancelButton->OnFocusModeStateChanged();
- }
-
- return;
-}
-
bool
_SearchBar::IsChildControlFocusManage(void) const
{
if (keyCode == _KEY_TAB && GetMode() == SEARCH_BAR_MODE_INPUT && __isFocusUiInitialized == false)
{
- __isInFocusMode = true;
__pEdit->SetSearchFieldFocus(true);
__isFocusUiInitialized = true;
return false;
return false;
}
- if (!__isInFocusMode)
+ if (!IsVisible())
+ {
+ return false;
+ }
+
+ _FocusManagerImpl* pFocusMgrImpl = _FocusManagerImpl::GetInstance();
+ if (!pFocusMgrImpl->IsFocusModeStateEnabled())
{
return false;
}
_SearchBar::SendSearchBarEvent(_SearchBarEventStatus status)
{
result r = E_SUCCESS;
- if (__pSearchBarEvent)
+ if (__pSearchBarEvent != null)
{
IEventArg* pEventArg = _SearchBarEvent::CreateSearchBarEventArgN(status);
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (IsContentAreaVisible() == false)
+ if (!IsContentAreaVisible())
{
SetContentAreaVisible(false);
}
__isUserContainerBounds = true;
// set bounds
- if (__pContainer)
+ if (__pContainer != null)
{
r = __pContainer->SetBounds(__contentAreaBounds);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
_AccessibilityElement* pEditElement = __pEdit->GetTextAccessibilityElement();
- pEditElement->SetHint("Double Tap To Type Search Text");
- pEditElement->SetTrait("SearchBar");
+// pEditElement->SetHintWithStringId("Double Tap To Type Search Text");
+// pEditElement->SetTrait("SearchBar");
pEditElement->SetName("SearchField");
pSBContainer->Activate(false);
cancelButtonBounds.height = buttonHeight;
float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
- cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
+ cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
editBounds.x = horizontalMargin;
if (searchBarBounds.height < searchBarMinHeight)
_SearchBarImpl::~_SearchBarImpl(void)
{
- if (__pSearchBar)
+ if (__pSearchBar != null)
{
SetContent(null);
if (__pSearchBar->GetClippedGroupControl())
}
}
- if (__pEditField)
- {
- delete __pEditField;
- __pEditField = null;
- }
+ delete __pEditField;
+ __pEditField = null;
- if (__pButton)
- {
- delete __pButton;
- __pButton = null;
- }
+ delete __pButton;
+ __pButton = null;
- if (__pPublicActionEvent)
- {
- delete __pPublicActionEvent;
- __pPublicActionEvent = null;
- }
+ delete __pPublicActionEvent;
+ __pPublicActionEvent = null;
- if (__pPublicKeypadEvent)
- {
- delete __pPublicKeypadEvent;
- __pPublicKeypadEvent = null;
- }
+ delete __pPublicKeypadEvent;
+ __pPublicKeypadEvent = null;
- if (__pPublicTextBlockEvent)
- {
- delete __pPublicTextBlockEvent;
- __pPublicTextBlockEvent = null;
- }
+ delete __pPublicTextBlockEvent;
+ __pPublicTextBlockEvent = null;
- if (__pPublicTextEvent)
- {
- delete __pPublicTextEvent;
- __pPublicTextEvent = null;
- }
+ delete __pPublicTextEvent;
+ __pPublicTextEvent = null;
- if (__pPublicSearchBarEvent)
- {
- delete __pPublicSearchBarEvent;
- __pPublicSearchBarEvent = null;
- }
+ delete __pPublicSearchBarEvent;
+ __pPublicSearchBarEvent = null;
- if (__pPublicLanguageEvent)
- {
- delete __pPublicLanguageEvent;
- __pPublicLanguageEvent = null;
- }
+ delete __pPublicLanguageEvent;
+ __pPublicLanguageEvent = null;
- if (__pPublicFocusEventListeners)
- {
- delete __pPublicFocusEventListeners;
- __pPublicFocusEventListeners = null;
- }
+ delete __pPublicFocusEventListeners;
+ __pPublicFocusEventListeners = null;
}
_SearchBarImpl*
{
ClearLastResult();
- return __pSearchBar->SetMode(mode);
+ return __pSearchBar->SetMode(mode, true);
}
result
Color color;
_Edit* pEdit = __pSearchBar->GetSearchField();
- if (pEdit)
+ if (pEdit != null)
{
switch (status)
{
result r = E_SUCCESS;
_Edit* pEdit = __pSearchBar->GetSearchField();
- if (pEdit)
+ if (pEdit != null)
{
switch (status)
{
void
_SearchBarImpl::OnLanguageChanged(LanguageCode oldLanguage, LanguageCode newLanguage)
{
- if (__pPublicLanguageEvent)
+ if (__pPublicLanguageEvent != null)
{
IEventArg* pKLanguageEventArg = _PublicLanguageEvent::CreateLanguageEventArgN(GetPublic(), oldLanguage, newLanguage);
result r = GetLastResult();
IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
- if (pEnumerator)
+ if (pEnumerator != null)
{
while (pEnumerator->MoveNext() == E_SUCCESS)
{
}
IEnumeratorT<IEventListener*>* pEnumerator = __pPublicFocusEventListeners->GetEnumeratorN();
- if (pEnumerator)
+ if (pEnumerator != null)
{
while (pEnumerator->MoveNext() == E_SUCCESS)
{
_SearchBarImpl::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
{
IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
- if (pEnumerator)
+ if (pEnumerator != null)
{
while (pEnumerator->MoveNext() == E_SUCCESS)
{
_SearchBarImpl::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
{
IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
- if (pEnumerator)
+ if (pEnumerator != null)
{
while (pEnumerator->MoveNext() == E_SUCCESS)
{
_SearchBarImpl::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
{
IEnumeratorT<IEventListener*>* pEnumerator = GetKeyEventListener()->GetEnumeratorN();
- if (pEnumerator)
+ if (pEnumerator != null)
{
while (pEnumerator->MoveNext() == E_SUCCESS)
{
{
searchFieldTextSize = _LocalizedNumParser::ToDouble(elementString, "C");
_ICoordinateSystemTransformer* pTransform = GetTransformer();
- if (pTransform)
+ if (pTransform != null)
{
searchFieldTextSize = pTransform->Transform(searchFieldTextSize);
}
if (pControl->GetElement(L"accessibilityHint", elementString))
{
AccessibilityContainer* pContainer = pSearchBar->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement(L"EditText");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementString);
}
delete __pSearchBarModel;
__pSearchBarModel = null;
- if (__pReplacedSearchFieldNormalBitmap)
- {
- delete __pReplacedSearchFieldNormalBitmap;
- __pReplacedSearchFieldNormalBitmap = null;
- }
+ delete __pReplacedSearchFieldNormalBitmap;
+ __pReplacedSearchFieldNormalBitmap = null;
- if (__pReplacedSearchFieldDisabledBitmap)
- {
- delete __pReplacedSearchFieldDisabledBitmap;
- __pReplacedSearchFieldDisabledBitmap = null;
- }
+ delete __pReplacedSearchFieldDisabledBitmap;
+ __pReplacedSearchFieldDisabledBitmap = null;
- if (__pReplacedSearchBarBitmap)
- {
- delete __pReplacedSearchBarBitmap;
- __pReplacedSearchBarBitmap = null;
- }
+ delete __pReplacedSearchBarBitmap;
+ __pReplacedSearchBarBitmap = null;
- if (__pSearchBarBitmap)
- {
- delete __pSearchBarBitmap;
- __pSearchBarBitmap = null;
- }
+ delete __pSearchBarBitmap;
+ __pSearchBarBitmap = null;
- if (__pSearchFieldEffectBitmap)
- {
- delete __pSearchFieldEffectBitmap;
- __pSearchFieldEffectBitmap = null;
- }
+ delete __pSearchFieldEffectBitmap;
+ __pSearchFieldEffectBitmap = null;
- if (__pSearchBarEffectBitmap)
- {
- delete __pSearchBarEffectBitmap;
- __pSearchBarEffectBitmap = null;
- }
+ delete __pSearchBarEffectBitmap;
+ __pSearchBarEffectBitmap = null;
}
result
return r;
CATCH:
- if (__pIconElement)
+ if (__pIconElement != null)
{
__pIconElement->Destroy();
__pIconElement = null;
}
result
-_SearchBarPresenter::SetMode(SearchBarMode mode)
+_SearchBarPresenter::SetMode(SearchBarMode mode, bool isCalledByApp)
{
SysTryReturn(NID_UI_CTRL, IsModeLocked() == false, E_INVALID_OPERATION, E_INVALID_OPERATION,
"[E_INVALID_OPERATION] The searchbar mode is locked.");
__pSearchBarModel->SetMode(mode);
- result r = ChangeMode(mode);
+ result r = ChangeMode(mode, isCalledByApp);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. Failed to change the mode of searchbar.");
Bitmap* pBackgroundBitmap = __pSearchBar->GetBackgroundBitmap();
- if (!pBackgroundBitmap)
+ if (pBackgroundBitmap == null)
{
r = DrawSearchBarDefaultBitmap();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
void
_SearchBarPresenter::SetCancelButtonVisible(bool visible)
{
- if ((__pSearchBar->IsUsableCancelButton() == false) && visible)
+ if ((!__pSearchBar->IsUsableCancelButton()) && visible)
{
return;
}
result
-_SearchBarPresenter::ChangeMode(SearchBarMode mode)
+_SearchBarPresenter::ChangeMode(SearchBarMode mode, bool isCalledByApp)
{
result r = E_SUCCESS;
SetCancelButtonVisible(false);
SetContainerVisible(false);
- if (__pEdit)
+ if (__pEdit != null)
{
__pEdit->ClearText();
__pEdit->SetBounds(__searchFieldBounds);
SetCancelButtonVisible(true);
__pSearchBar->SetContentDimming();
- if (__pEdit)
+ if (__pEdit != null)
{
float buttonWidth = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
float cancelButtonWidth = 0.0f;
- cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
+ cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
if (cancelButtonWidth <= buttonWidth)
{
__pEdit->SetBounds(__searchFieldBounds);
}
- __pEdit->ShowKeypad();
+ if (isCalledByApp)
+ {
+ __pEdit->ShowKeypad();
+ }
}
__pSearchBar->SetContentsArea();
{
InitializeViewModeLayout();
- if (__pSearchBar->IsUsableCancelButton() == false)
+ if (!__pSearchBar->IsUsableCancelButton())
{
return;
}
__searchFieldBounds.width = (__pSearchBar->GetBoundsF().width > searchFieldMinWidth) ? __searchFieldBounds.width : searchFieldMinWidth;
float cancelButtonWidth = 0.0f;
- cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
+ cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
if (cancelButtonWidth > buttonWidth)
{
r = __pSearchBar->ResizeCancelButton();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.",GetErrorMessage(r));
- cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
+ cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
}
r = __pEdit->SetBounds(__searchFieldBounds);
return;
}
+void
+_SearchBarPresenter::OnTouchReleased(const _Control& source)
+{
+ if (&source == __pEdit)
+ {
+ __pEdit->ShowKeypad();
+ }
+}
+
Canvas*
_SearchBarPresenter::OnCanvasRequestedN(const FloatRectangle& bounds)
{
Canvas* pCanvas = null;
- if (__lazyDecode == true)
+ if (__lazyDecode)
{
Bitmap* pBackgroundBitmap = __pSearchBar->GetBackgroundBitmap();
SysTryReturn(NID_UI_CTRL, pBackgroundBitmap != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the background bitmap.");
#include <FBaseErrorDefine.h>
#include <FGrp_BitmapImpl.h>
#include "FUi_ResourceManager.h"
-#include "FUi_TouchManager.h"
#include "FUi_AccessibilityContainer.h"
#include "FUi_AccessibilityElement.h"
#include "FUiAnim_VisualElement.h"
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
}
_Slider::~_Slider(void)
{
- if (__pAdjustmentEvent != null)
- {
- delete __pAdjustmentEvent;
- __pAdjustmentEvent = null;
- }
+ delete __pAdjustmentEvent;
+ __pAdjustmentEvent = null;
- if (__pSliderEvent != null)
- {
- delete __pSliderEvent;
- __pSliderEvent = null;
- }
+ delete __pSliderEvent;
+ __pSliderEvent = null;
delete __pLeftBitmap;
__pLeftBitmap = null;
delete __pSliderPresenter;
__pSliderPresenter = null;
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->Activate(false);
__pAccessibilityElement = null;
{
result r = E_SUCCESS;
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
return r;
}
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
__pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
{
__pSliderPresenter->SetFocusMode(false);
- if ((GetStyle() & _SLIDER_STYLE_OVERLAY) && (!__pSliderPresenter->IsTouchPressed()) && (__isKeyPressed == true))
+ if ((GetStyle() & _SLIDER_STYLE_OVERLAY) && (!__pSliderPresenter->IsTouchPressed()) && (__isKeyPressed))
{
_SliderOverlay* pSliderOverlay = __pSliderPresenter->GetSliderOverlay();
pSliderOverlay->SetVisibleState(false);
pSliderOverlay->Close();
}
+ if (__isKeyPressed)
+ {
+ FireAdjustmentValueEvent(GetValue());
+ }
+
__isKeyPressed = false;
Invalidate();
_Slider::OnFocusModeStateChanged()
{
__pSliderPresenter->SetFocusMode(false);
+
+ if ((GetStyle() & _SLIDER_STYLE_OVERLAY) && __isKeyPressed )
+ {
+ _SliderOverlay* pSliderOverlay = __pSliderPresenter->GetSliderOverlay();
+ pSliderOverlay->SetVisibleState(false);
+ pSliderOverlay->Close();
+ }
+
+ if (__isKeyPressed)
+ {
+ FireAdjustmentValueEvent(GetValue());
+ }
+
+ __isKeyPressed = false;
+
Invalidate();
}
{
__pSliderPresenter->OnBoundsChanged();
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBounds().width, GetBounds().height));
}
void
_Slider::SetAccessibilityElementValue()
{
- if (__pAccessibilityElement)
+ if (__pAccessibilityElement != null)
{
- String string;
- GET_STRING_CONFIG(IDS_TPLATFORM_BODY_POSITION_P1SD_OF_P2SD_T_TTS, string);
- char buffer[10] = {0,};
- sprintf(buffer, "%d", GetValue());
- string.Replace(L"%1$d", buffer);
- memset(buffer, 0, 10);
- sprintf(buffer, "%d", __pSliderPresenter->GetMaxValue());
- string.Replace(L"%2$d", buffer);
- __pAccessibilityElement->SetValue(string);
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_POSITION_P1SD_OF_P2SD_T_TTS, string);
+ char buffer[10] = {0,};
+ sprintf(buffer, "%d", GetValue());
+ string.Replace(L"%1$d", buffer);
+ memset(buffer, 0, 10);
+ sprintf(buffer, "%d", __pSliderPresenter->GetMaxValue());
+ string.Replace(L"%2$d", buffer);
+ __pAccessibilityElement->SetValue(string);
}
return;
void
_Slider::OnAncestorVisibleStateChanged(const _Control& control)
{
- _TouchManager* pTouchMgr = _TouchManager::GetInstance();
- if (pTouchMgr && (IsVisible() == false))
- {
- pTouchMgr->SetTouchCanceled(null);
- }
+ __pSliderPresenter->OnAncestorVisibleStateChanged(control);
return;
}
bool
_Slider::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- if (GetEnableState() == false)
+ if (!GetEnableState())
{
return true;
}
bool
_Slider::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- if (GetEnableState() == false)
+ if (!GetEnableState())
{
return true;
}
_SliderImpl::~_SliderImpl(void)
{
- if (__pPublicAdjustmentEvent != null)
- {
- delete __pPublicAdjustmentEvent;
- __pPublicAdjustmentEvent = null;
- }
+ delete __pPublicAdjustmentEvent;
+ __pPublicAdjustmentEvent = null;
- if (__pPublicSliderEvent != null)
- {
- delete __pPublicSliderEvent;
- __pPublicSliderEvent = null;
- }
+ delete __pPublicSliderEvent;
+ __pPublicSliderEvent = null;
}
_SliderImpl*
groupStyleEmum = GROUP_STYLE_BOTTOM;
}
}
- if (isGroupStyle == true)
+ if (isGroupStyle)
{
if (pControl->GetElement(L"min", elementString) && pControl->GetElement(L"max", elementString1))
{
if (pControl->GetElement(L"accessibilityHint", elementString))
{
AccessibilityContainer* pContainer = pSlider->GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
AccessibilityElement* pElement = pContainer->GetElement(L"SliderControl");
- if (pElement)
+ if (pElement != null)
{
pElement->SetHint(elementString);
}
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- if (__isResourceLoaded == false)
+ if (!__isResourceLoaded)
{
r = LoadBitmap();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
if (!__isCustomHandle)
{
- r = GET_SHAPE_CONFIG(SLIDER::HANDLE_OFFSET, orientation, __handleOffset);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
r = GET_SHAPE_CONFIG(SLIDER::HANDLE_WIDTH, orientation, __handleRect.width);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = GET_SHAPE_CONFIG(SLIDER::HANDLE_HEIGHT, orientation, __handleRect.height);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __handleOffset = __handleRect.width / 2;
}
+
__rect = FloatRectangle(0.0f, 0.0f, __pSlider->GetBoundsF().width, __pSlider->GetBoundsF().height);
r = GET_SHAPE_CONFIG(SLIDER::ICON_RIGHT_MARGIN, orientation, iconRightMargin);
r = GET_SHAPE_CONFIG(SLIDER::MINIMUM_WIDTH_WITH_ICON, orientation, minimumWidth);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = GET_SHAPE_CONFIG(SLIDER::BAR_LEFT_MARGIN_WITH_ICON, orientation, barLeftMargin);
+ r = GET_SHAPE_CONFIG(SLIDER::ICON_LEFT_MARGIN, orientation, barLeftMargin);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
titleTextBounds = GetTitleTextBounds();
sliderY = titleTextBounds.y + titleTextBounds.height;
- __touchRect = FloatRectangle(barLeftMargin - __handleOffset , sliderY + (__rect.height - (sliderY + __handleRect.height)) / 2.0f,
- __rect.width - (barLeftMargin + barRightMargin) + (2.0f * __handleOffset) , __handleRect.height);
+ __touchRect = FloatRectangle(barLeftMargin + __barOffset - __handleOffset, sliderY + (__rect.height - (sliderY + __handleRect.height)) / 2.0f,
+ __rect.width - (barLeftMargin + barRightMargin) + (2.0f * __handleOffset) - ( 2.0 * __barOffset), __handleRect.height);
}
else
{
- __touchRect = FloatRectangle(barLeftMargin - __handleOffset, (__rect.height - __handleRect.height) / 2.0f,
- (__rect.width - (barLeftMargin + barRightMargin)) + (2.0f * __handleOffset) , __handleRect.height);
+ __touchRect = FloatRectangle(barLeftMargin + __barOffset - __handleOffset, (__rect.height - __handleRect.height) / 2.0f,
+ (__rect.width - (barLeftMargin + barRightMargin ) - ( 2.0 * __barOffset)) + (2.0f * __handleOffset), __handleRect.height);
}
if (__pSlider->GetIcon(ICON_POSITION_LEFT) != null)
__touchRect.width = __touchRect.width - (iconWidth + iconSideMargin + iconRightMargin);
}
- __barBgRect = FloatRectangle(__touchRect.x + __handleOffset, __touchRect.y +
- ((__handleRect.height - barHeight) / 2.0f), __touchRect.width - (2.0f * __handleOffset), barHeight);
+ __barBgRect = FloatRectangle(__touchRect.x + __handleOffset - __barOffset, __touchRect.y +
+ ((__handleRect.height - barHeight) / 2.0f), __touchRect.width - (2.0f * __handleOffset) + (2.0 * __barOffset), barHeight);
FloatRectangle absBounds = __pSlider->GetAbsoluteBoundsF();
__pSliderOverlay->SetSliderRect(absBounds, __touchRect);
result
_SliderPresenter::Draw(void)
{
- if (__isNeedToBeUpdated == true)
+ if (__isNeedToBeUpdated)
{
Resize();
__isNeedToBeUpdated = false;
r = DrawSliderBar(*pCanvas);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (__isSliderPressed == true || __pSlider->IsKeyPressed())
+ if (__isSliderPressed || __pSlider->IsKeyPressed())
{
if (style & _SLIDER_STYLE_OVERLAY)
{
{
pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgTopBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
r = GetLastResult();
- if (!pBgGroupBitmap)
+ if (pBgGroupBitmap == null)
{
SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
return r;
{
pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgMiddleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
r = GetLastResult();
- if (!pBgGroupBitmap)
+ if (pBgGroupBitmap == null)
{
SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
return r;
{
pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgBottomBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
r = GetLastResult();
- if (!pBgGroupBitmap)
+ if (pBgGroupBitmap == null)
{
SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
return r;
{
pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
r = GetLastResult();
- if (!pBgGroupBitmap)
+ if (pBgGroupBitmap == null)
{
SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
return r;
{
pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
r = GetLastResult();
- if (!pBgGroupBitmap)
+ if (pBgGroupBitmap == null)
{
SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
return r;
DrawBitmap(canvas, __rect, pBgBitmap);
if ( __groupStyle != GROUP_STYLE_NONE)
{
- if (isCustomBitmap == false)
+ if (!isCustomBitmap)
{
DrawBitmap(canvas, __rect, pBgEffectBitmap);
}
int minValue = __pSliderModel->GetMinValue();
int maxValue = __pSliderModel->GetMaxValue();
- if ( __isSliderPressed == true)
+ if (__isSliderPressed)
{
__handleX = ((__touchRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
__pSlider->Invalidate();
__isSetValue = true;
_TouchManager* pTouchMgr = _TouchManager::GetInstance();
- if (pTouchMgr)
+ if (pTouchMgr != null)
{
__isTouchCanceled = true;
pTouchMgr->SetTouchCanceled(null);
bool isCustomHandleBitmap = false;
bool isCustomBarBitmap = false;
- if (__pSlider->IsEnabled() == false) // disabled
+ if (!__pSlider->IsEnabled()) // disabled
{
pHandleBitmap = __pHandleDisabledBitmap;
pHandleEffectBitmap = __pHandleDisabledEffectBitmap;
}
}
}
- else if (__isSliderPressed == true) // pressed
+ else if (__isSliderPressed) // pressed
{
pHandleBitmap = __pHandlePressedBitmap;
pHandleEffectBitmap = __pHandlePressedEffectBitmap;
__barRect = FloatRectangle(__barBgRect.x + __barOffset, __barBgRect.y, __handleRect.x , __barBgRect.height);
- if (__isSetValue == true && __isSliderPressed == false && (maxValue - minValue) != 0)
+ if (__isSetValue && !__isSliderPressed && (maxValue - minValue) != 0)
{
__handleX = ((__touchRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
}
// Redrawing twice is required because, when slider is disabled we are applying alpha channel to the bar
// which will show the previously drawn portion.
- if (__pSlider->IsEnabled() == false) // disabled
+ if (!__pSlider->IsEnabled()) // disabled
{
__pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF);
DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_BG_NORMAL);
DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
- if (isCustomBarBitmap == false)
+ if (!isCustomBarBitmap)
{
DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
}
isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_NORMAL);
DrawBitmap(canvas, __barRect, __pBarColorReplacementBitmap);
- if (isCustomBarBitmap == false)
+ if (!isCustomBarBitmap)
{
DrawBitmap(canvas, __barRect, __pBarResourceEffectBitmap);
}
{
r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (isCustomHandleBitmap == false)
+ if (!isCustomHandleBitmap)
{
r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
- if ((__pSlider->IsFocused()) && (__isFocusModeStateChanged == true))
+ if ((__pSlider->IsFocused()) && (__isFocusModeStateChanged))
{
- if (__pHandleHighlightedBitmap)
+ if (__pHandleHighlightedBitmap != null)
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pHandleHighlightedBitmap))
{
int valueLength = 0;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- if (__pSlider->IsEnabled() == false) // disabled
+ if (!__pSlider->IsEnabled()) // disabled
{
textColor = __handleTextDisabledColor;
}
- else if ((__pSlider->IsFocused() == true) && (__isFocusModeStateChanged == true))
+ else if ((__pSlider->IsFocused()) && (__isFocusModeStateChanged))
{
textColor = __handleTextHighlightedColor;
}
- else if ((__isSliderPressed == true) && !(__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY))
+ else if ((__isSliderPressed) && !(__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY))
{
textColor = __handleTextPressedColor;
}
FloatPoint point = touchinfo.GetCurrentPosition();
- if (__handleRect.Contains(point) == true)
+ if (__handleRect.Contains(point))
{
__isSliderPressed = true;
__isSetValue = false;
delete pCanvas;
pCanvas = null;
- if (__isSliderPressed == true)
+ if (__isSliderPressed)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pSlider);
__isSliderPressed = false;
return false;
}
- if (__isSliderPressed == false)
+ if (!__isSliderPressed)
{
return false;
}
__currentPosition.x = point.x;
__currentPosition.y = point.y;
- if ( __isTimerRunning == false )
+ if (!__isTimerRunning)
{
__isTimerRunning = true;
__pSlideTimer->Start(__timerValue);
}
void
+_SliderPresenter::OnAncestorVisibleStateChanged(const _Control& control)
+{
+
+ if (__pSlideTimer != null)
+ {
+ __isTimerRunning = false;
+ __pSlideTimer->Cancel();
+ }
+
+ __isSliderPressed = false;
+ __isSetValue = true;
+ __isTouchCanceled = false;
+
+ if (__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
+ {
+ __pSliderOverlay->SetVisibleState(false);
+ __pSliderOverlay->Close();
+ }
+
+ return;
+}
+
+void
_SliderPresenter::SetMinValue(int minValue)
{
__pSliderModel->SetMinValue(minValue);
CATCH:
- if (__pDividerVisualElement)
+ if (__pDividerVisualElement != null)
{
__pDividerVisualElement->Destroy();
__pDividerVisualElement = null;
}
- if (__pSplitPanelPresenter)
- {
- delete __pSplitPanelPresenter;
- __pSplitPanelPresenter = null;
- }
+ delete __pSplitPanelPresenter;
+ __pSplitPanelPresenter = null;
- if (__pFirstPaneParent)
+ if (__pFirstPaneParent != null)
{
DetachChild(*__pFirstPaneParent);
__pFirstPaneParent = null;
}
- if (__pSecondPaneParent)
+ if (__pSecondPaneParent != null)
{
DetachChild(*__pSecondPaneParent);
_SplitPanel::~_SplitPanel(void)
{
- if (__pSplitPanelPresenter)
- {
- delete __pSplitPanelPresenter;
- __pSplitPanelPresenter = null;
- }
+ delete __pSplitPanelPresenter;
+ __pSplitPanelPresenter = null;
- if (__pSplitPanelEvent)
- {
- delete __pSplitPanelEvent;
- __pSplitPanelEvent = null;
- }
+ delete __pSplitPanelEvent;
+ __pSplitPanelEvent = null;
- if (__pTapGesture)
+ if (__pTapGesture != null)
{
__pTapGesture->RemoveGestureListener(*this);
RemoveGestureDetector(*__pTapGesture);
__pTapGesture = null;
}
- if (__pDividerVisualElement)
+ if (__pDividerVisualElement != null)
{
GetVisualElement()->DetachChild(*__pDividerVisualElement);
__pDividerVisualElement = null;
}
- if (__pFirstPaneParent)
+ if (__pFirstPaneParent != null)
{
DetachChild(*__pFirstPaneParent);
__pFirstPaneParent = null;
}
- if (__pSecondPaneParent)
+ if (__pSecondPaneParent != null)
{
DetachChild(*__pSecondPaneParent);
_UiTouchEventDelivery
_SplitPanel::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__pSplitPanelPresenter->OnTouchPressed(source, touchinfo) == true)
+ if (__pSplitPanelPresenter->OnTouchPressed(source, touchinfo))
{
return _UI_TOUCH_EVENT_DELIVERY_NO;
}
_UiTouchEventDelivery
_SplitPanel::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__pSplitPanelPresenter->OnTouchReleased(source, touchinfo) == true)
+ if (__pSplitPanelPresenter->OnTouchReleased(source, touchinfo))
{
return _UI_TOUCH_EVENT_DELIVERY_NO;
}
_UiTouchEventDelivery
_SplitPanel::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__pSplitPanelPresenter->OnTouchMoved(source, touchinfo) == true)
+ if (__pSplitPanelPresenter->OnTouchMoved(source, touchinfo))
{
return _UI_TOUCH_EVENT_DELIVERY_NO;
}
_UiTouchEventDelivery
_SplitPanel::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__pSplitPanelPresenter->OnTouchCanceled(source, touchinfo) == true)
+ if (__pSplitPanelPresenter->OnTouchCanceled(source, touchinfo))
{
return _UI_TOUCH_EVENT_DELIVERY_NO;
}
result r = E_SUCCESS;
IEventArg* pEventArg = null;
- if (__pSplitPanelEvent)
+ if (__pSplitPanelEvent != null)
{
pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
r = GetLastResult();
void
_SplitPanel::SetDividerVisualElementBounds(Tizen::Graphics::FloatRectangle& bounds)
{
- if (__pDividerVisualElement)
+ if (__pDividerVisualElement != null)
{
__pDividerVisualElement->SetBounds(bounds);
}
_SplitPanelImpl::~_SplitPanelImpl(void)
{
- __pSplitPanel->RemoveSplitPanelEventListener(*this);
-
- if(__pPublicSplitPanelEvent)
+ if (__pSplitPanel != null)
{
- delete __pPublicSplitPanelEvent;
- __pPublicSplitPanelEvent = null;
+ __pSplitPanel->RemoveSplitPanelEventListener(*this);
}
+ delete __pPublicSplitPanelEvent;
+ __pPublicSplitPanelEvent = null;
+
ClearLastResult();
}
point = touchinfo.GetCurrentPosition();
- if (CheckDividerTouchRegion(point.x, point.y) == true)
+ if (CheckDividerTouchRegion(point.x, point.y))
{
__splitPanelDividerPressed = true;
__pSplitPanel->Invalidate();
bool
_SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__splitPanelDividerPressed == true)
+ if (__splitPanelDividerPressed)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pSplitPanel);
__splitPanelDividerPressed = false;
}
else
{
- if (__isChangeBounds == true)
+ if (__isChangeBounds)
{
__isChangeBounds = false;
}
FloatPoint point(0.0f, 0.0f);
Bitmap* pThumbBitmap = null;
- if (__splitPanelDividerPressed == false )
+ if (!__splitPanelDividerPressed)
{
return false;
}
return false;
}
- if (CheckDividerTouchRegion(point.x, point.y) == true)
+ if (CheckDividerTouchRegion(point.x, point.y))
{
__isChangeBounds = true;
}
bool
_SplitPanelPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
{
- if (__splitPanelDividerPressed == true)
+ if (__splitPanelDividerPressed)
{
__splitPanelDividerPressed = false;
return true;
}
- if (__isChangeBounds == true)
+ if (__isChangeBounds)
{
__isChangeBounds = false;
}
bool
_SplitPanelPresenter::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
{
- if ((__pSplitPanelModel->GetPaneMaximumState() == true)
+ if ((__pSplitPanelModel->GetPaneMaximumState())
&& (__pSplitPanelModel->GetMaximizedPaneOrder() == paneOrder))
{
return true;
{
result r = E_SUCCESS;
- if (__pSplitPanelModel->GetPaneMaximumState() == false)
+ if (!__pSplitPanelModel->GetPaneMaximumState())
{
return E_SUCCESS;
}
_SplitPanelPresenter::Draw(void)
{
if (GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_STOPPED &&
- __pSplitPanelModel->GetPaneMaximumState() == false)
+ !__pSplitPanelModel->GetPaneMaximumState())
{
FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f);
pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
- if (pCanvas)
+ if (pCanvas != null)
{
pCanvas->Clear();
dividerBounds.x = 0.0f;
dividerBounds.y = 0.0f;
- if (__splitPanelDividerPressed == true)
+ if (__splitPanelDividerPressed)
{
pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
}
if ((pFirstPane != null) && (pSecondPane != null))
{
- if (__setFirstDividerPositionChangeEvent == true)
+ if (__setFirstDividerPositionChangeEvent)
{
__setFirstDividerPositionChangeEvent = false;
__pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->IsResizable())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
}
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane != null && !pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->IsResizable())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane != null && !pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->IsResizable())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane != null && !pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->IsResizable())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
}
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane != null && !pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->IsResizable())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->IsResizable())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
}
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane != null && !pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
}
else
{
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane != null && !pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ if (pControlAnimatorFirstPane != null && pFirstPaneControl->IsResizable())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
}
- if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ if (pControlAnimatorSecondPane != null && pSecondPaneControl->IsResizable())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
}
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane != null && !pSecondPaneControl->GetShowState())
{
pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
}
else
{
- if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane != null && !pFirstPaneControl->GetShowState())
{
pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
}
delete __pTabPresenter;
__pTabPresenter = null;
- if (__pActionEvent)
- {
- delete __pActionEvent;
- __pActionEvent = null;
- }
+ delete __pActionEvent;
+ __pActionEvent = null;
__tabItems.RemoveAll(true);
__pGestureLongPress = null;
}
- if (__pBackgroundBitmap)
- {
- delete __pBackgroundBitmap;
- __pBackgroundBitmap = null;
- }
+ delete __pBackgroundBitmap;
+ __pBackgroundBitmap = null;
- if (__pDisabledBackgroundBitmap)
- {
- delete __pDisabledBackgroundBitmap;
- __pDisabledBackgroundBitmap = null;
- }
+ delete __pDisabledBackgroundBitmap;
+ __pDisabledBackgroundBitmap = null;
- if (__pPressedItemBackgroundBitmap)
- {
- delete __pPressedItemBackgroundBitmap;
- __pPressedItemBackgroundBitmap = null;
- }
+ delete __pPressedItemBackgroundBitmap;
+ __pPressedItemBackgroundBitmap = null;
- if (__pPressedItemBackgroundEffectBitmap)
- {
- delete __pPressedItemBackgroundEffectBitmap;
- __pPressedItemBackgroundEffectBitmap = null;
- }
+ delete __pPressedItemBackgroundEffectBitmap;
+ __pPressedItemBackgroundEffectBitmap = null;
- if (__pSelectedItemBackgroundBitmap)
- {
- delete __pSelectedItemBackgroundBitmap;
- __pSelectedItemBackgroundBitmap = null;
- }
+ delete __pSelectedItemBackgroundBitmap;
+ __pSelectedItemBackgroundBitmap = null;
- if (__pHighlightedItemBackgroundBitmap)
- {
- delete __pHighlightedItemBackgroundBitmap;
- __pHighlightedItemBackgroundBitmap = null;
- }
+ delete __pHighlightedItemBackgroundBitmap;
+ __pHighlightedItemBackgroundBitmap = null;
RemoveAllAccessibilityElement();
}
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledBackgroundBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate disabled item background bitmap.");
- if (pDisabledBackgroundBitmap)
+ if (pDisabledBackgroundBitmap != null)
{
__pDisabledBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDisabledBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetDisabledItemBackgroundColor());
SysTryLog(NID_UI_CTRL, (__pDisabledBackgroundBitmap != null), "Failed to locate disabled item background bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pItemBackgroundBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate item background bitmap.");
- if (pItemBackgroundBitmap)
+ if (pItemBackgroundBitmap != null)
{
__pBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetItemBackgroundColor());
SysTryLog(NID_UI_CTRL, (__pBackgroundBitmap != null), "Failed to locate item background bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedItemBackgroundBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate pressed item background bitmap.");
- if (pPressedItemBackgroundBitmap)
+ if (pPressedItemBackgroundBitmap != null)
{
__pPressedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetPressedItemBackgroundColor());
SysTryLog(NID_UI_CTRL, (__pPressedItemBackgroundBitmap != null), "Failed to locate pressed item background bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pSelectedItemBackgroundBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate selected item background bitmap.");
- if (pSelectedItemBackgroundBitmap)
+ if (pSelectedItemBackgroundBitmap != null)
{
__pSelectedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pSelectedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetSelectedItemBackgroundColor());
SysTryLog(NID_UI_CTRL, (__pSelectedItemBackgroundBitmap != null), "Failed to locate selected item background bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedItemBackgroundEffectBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate selected item background bitmap.");
- if (pPressedItemBackgroundEffectBitmap)
+ if (pPressedItemBackgroundEffectBitmap != null)
{
__pPressedItemBackgroundEffectBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedItemBackgroundEffectBitmap, Color::GetColor(COLOR_ID_MAGENTA), pressedEffectColor);
SysTryLog(NID_UI_CTRL, (__pPressedItemBackgroundEffectBitmap != null), "Failed to locate selected item background bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pHighlightedItemBackgroundBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate highlighted item background bitmap.");
- if (pHighlightedItemBackgroundBitmap)
+ if (pHighlightedItemBackgroundBitmap != null)
{
__pHighlightedItemBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedItemBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), GetHighlightedItemBackgroundColor());
SysTryLog(NID_UI_CTRL, (__pHighlightedItemBackgroundBitmap != null), "Failed to locate highlighted item background bitmap.");
SysTryReturn(NID_UI_CTRL, (pBitmap), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- if (__pBackgroundBitmap)
+ if (__pBackgroundBitmap != null)
{
delete __pBackgroundBitmap;
__pBackgroundBitmap = null;
__pBackgroundBitmap = pBitmap;
- if (__pDisabledBackgroundBitmap)
+ if (__pDisabledBackgroundBitmap != null)
{
delete __pDisabledBackgroundBitmap;
__pDisabledBackgroundBitmap = null;
SysTryReturn(NID_UI_CTRL, (pBitmap), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- if (__pSelectedItemBackgroundBitmap)
+ if (__pSelectedItemBackgroundBitmap != null)
{
delete __pSelectedItemBackgroundBitmap;
__pSelectedItemBackgroundBitmap = null;
SysTryReturn(NID_UI_CTRL, (pBitmap), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- if (__pHighlightedItemBackgroundBitmap)
+ if (__pHighlightedItemBackgroundBitmap != null)
{
delete __pHighlightedItemBackgroundBitmap;
__pHighlightedItemBackgroundBitmap = null;
return true;
}
- if (__pActionEvent)
+ if (__pActionEvent != null)
{
IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(pItem->GetActionId());
SysTryReturn(NID_UI_CTRL, pEventArg, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
pContainer = GetAccessibilityContainer();
- if (pContainer)
+ if (pContainer != null)
{
pContainer->Activate(true);
pContainer->AddListener(*this);
}
_KeyCode keyCode = keyInfo.GetKeyCode();
int itemCount = __pTabPresenter->GetItemCount();
- if (itemCount == 0 || __isInFocusMode == false)
+ if (itemCount == 0 || !__isInFocusMode)
{
return false;
}
itemStatus = pItem->GetStatus();
}
- if (pAccessibilityElement)
+ if (pAccessibilityElement != null)
{
pAccessibilityElement->SetBounds(bounds);
if ((__accessibilityElements.GetAt(index, pAccessibilityElement)) == E_SUCCESS)
{
- if (pAccessibilityElement)
+ if (pAccessibilityElement != null)
{
pAccessibilityElement->SetLabel(text);
}
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
- if(itemIndex == 0) //when touchedCOM
- {
- SetItemSelected(0);
- }
-
__tabBar.Invalidate();
return r;
_TabItem::~_TabItem(void)
{
- if (__pbmIcon)
- {
- delete __pbmIcon;
- __pbmIcon = null;
- }
-
- if (__pbmBadge)
- {
- delete __pbmBadge;
- __pbmBadge = null;
- }
+ delete __pbmIcon;
+ __pbmIcon = null;
+
+ delete __pbmBadge;
+ __pbmBadge = null;
+
}
_TableView::~_TableView(void)
{
- __pTableViewPresenter->BlockAnimationCallback(true);
+ if (__pTableViewPresenter)
+ {
+ __pTableViewPresenter->BlockAnimationCallback(true);
+ }
if (GetVisualElement() != null)
{
return E_SUCCESS;
}
+void
+_TableView::RestoreFocus(bool isRestoreFocus)
+{
+ return __pTableViewPresenter->RestoreFocus(isRestoreFocus);
+}
+
+void
+_TableView::SetAnnexFocused(bool isAnnexFocused)
+{
+ return __pTableViewPresenter->SetAnnexFocused(isAnnexFocused);
+}
+
+void
+_TableView::SetTableViewFocused(bool focusStatus)
+{
+ return __pTableViewPresenter->SetTableViewFocused(focusStatus);
+}
+
+bool
+_TableView::IsTableViewFocused(void)
+{
+ return __pTableViewPresenter->IsTableViewFocused();
+}
+
result
_TableView::SetItemChecked(int groupIndex, int itemIndex, bool check)
{
bounds.height,
bounds.height,
0);
- SysTryReturnVoidResult(NID_UI_CTRL, pScroll != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pScroll != null, GetLastResult(), "[%s] Propagating", GetErrorMessage(GetLastResult()));
pScroll->EnableScrollingEffect(false);
pScroll->SetVisibleState(false);
bounds.height,
bounds.height,
0);
- SysTryReturnVoidResult(NID_UI_CTRL, pScroll != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturnVoidResult(NID_UI_CTRL, pScroll != null, GetLastResult(), "[%s] Propagating", GetErrorMessage(GetLastResult()));
pScroll->EnableScrollingEffect(true);
_ScrollPanel::SetScrollBar(pScroll);
}
bool
+_TableView::OnFocusGained(const _Control& source)
+{
+ __pTableViewPresenter->SetTableViewFocused(true);
+
+ return true;
+}
+
+bool
_TableView::OnFlickGestureDetected(_TouchFlickGestureDetector& gesture)
{
return __pTableViewPresenter->OnFlickGestureDetected(gesture);
{
return __pTableViewPresenter->OnFocusModeStateChanged();
}
+
+void
+_TableView::OnVisibleStateChanged(void)
+{
+ return __pTableViewPresenter->OnVisibleStateChanged();
+}
+
+void
+_TableView::OnAncestorEnableStateChanged(const _Control& control)
+{
+ return __pTableViewPresenter->OnAncestorEnableStateChanged(control);
+}
+
+void
+_TableView::OnAncestorVisibleStateChanged(const _Control& control)
+{
+ return __pTableViewPresenter->OnAncestorVisibleStateChanged(control);
+}
+
+void
+_TableView::OnFocusableStateChanged(bool focusalbeState)
+{
+ return __pTableViewPresenter->OnFocusableStateChanged(focusalbeState);
+}
+
}}} // Tizen::Ui::Controls
_TableViewItemControl::~_TableViewItemControl(void)
{
- if(__pBackgroundBitmap)
+ if (__pBackgroundBitmap)
{
delete __pBackgroundBitmap;
__pBackgroundBitmap = null;
, __customHeight(0.0f)
, __animationCount(0)
, __pAccessibilityElement(null)
+ , __pAccessibilityOnOffElement(null)
, __pPressedTimer(null)
, __pReleasedTimer(null)
, __isPressedTimerEnabled(false)
, __isSelectedDetailButton(false)
, __isSimpleLastItem(false)
, __isTouchPressOnScroll(false)
+ , __isTouchCancelOnPressRelease(false)
, __pHighlightVisualElement(null)
, __pBitmapVisualElement(null)
, __pMoveItemAnimation(null)
_VisualElement* pVisualElement = GetVisualElement();
if (pVisualElement != null)
{
- if(__pMoveItemAnimation != null)
+ if (__pMoveItemAnimation != null)
{
__pMoveItemAnimation->SetVisualElementAnimationTickEventListener(null);
__pMoveItemAnimation->SetVisualElementAnimationStatusEventListener(null);
}
- if(__pZoomInOutItemAnimation != null)
+ if (__pZoomInOutItemAnimation != null)
{
__pZoomInOutItemAnimation->SetVisualElementAnimationTickEventListener(null);
__pZoomInOutItemAnimation->SetVisualElementAnimationStatusEventListener(null);
}
- if(__pFadeInOutItemtAnimation != null)
+ if (__pFadeInOutItemtAnimation != null)
{
__pFadeInOutItemtAnimation->SetVisualElementAnimationTickEventListener(null);
__pFadeInOutItemtAnimation->SetVisualElementAnimationStatusEventListener(null);
if (__pAccessibilityElement)
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if(pContainer)
+ if (pContainer)
{
pContainer->RemoveAllElement();
}
__pAccessibilityElement = null;
+
+ if (__pAccessibilityOnOffElement)
+ {
+ __pAccessibilityOnOffElement = null;
+ }
}
}
_Label*
_TableViewItem::GetLabelCore(Label* label)
{
- if(label == null)
+ if (label == null)
{
return null;
}
__pItemBgBitmap[itemState] = pCopyBitmap;
- if(__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] == null &&
+ if (__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] == null &&
__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED] == null &&
__pItemBgBitmap[TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED] == null)
{
- if(__pBitmapVisualElement != null)
+ if (__pBitmapVisualElement != null)
{
__pBitmapVisualElement->Destroy();
__pBitmapVisualElement = null;
}
else
{
- if(__pBitmapVisualElement == null)
+ if (__pBitmapVisualElement == null)
{
FloatRectangle bounds = GetBoundsF();
result r = E_SUCCESS;
void
_TableViewItem::SetItemBackgroundColor(ListItemState itemState, const Color bgColor)
{
- if(__colorItemBg[itemState] == bgColor)
+ if (__colorItemBg[itemState] == bgColor)
{
return;
}
void
_TableViewItem::SetItemHeight(float itemHeight)
{
- if(_FloatCompare(GetSizeF().height, itemHeight))
+ if (_FloatCompare(GetSizeF().height, itemHeight))
{
return;
}
void
_TableViewItem::SetCheckedAnimationEnabled(bool enabled)
{
- if(__isCheckedAnimationEnabled == enabled)
+ if (__isCheckedAnimationEnabled == enabled)
{
return;
}
void
_TableViewItem::SetItemType(const TableViewItemType itemType)
{
- if(__itemType == itemType)
+ if (__itemType == itemType)
{
return;
}
__pContextItem->SetItemType(__itemType);
}
- if(itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
+ if (itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
{
Color titleColor;
GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_PRESSED, titleColor);
- if(titleColor == __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
+ if (titleColor == __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
{
GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BG_PRESSED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
}
return __isItemTapSoundEnabled;
}
+void
+_TableViewItem::DrawAnnexFocus(void)
+{
+ if (__pItemAnnex)
+ {
+ __pItemAnnex->SetFocus();
+ }
+ return;
+}
+
Tizen::Graphics::Canvas*
_TableViewItem::OnCanvasRequestedN(const Tizen::Graphics::FloatRectangle& bounds)
{
Canvas* pCanvas = null;
- if(__pBitmapVisualElement != null && __pBitmapVisualElement->GetImageSource().IsEmpty())
+ if (__pBitmapVisualElement != null && __pBitmapVisualElement->GetImageSource().IsEmpty())
{
Bitmap* pDrawBitmap = __pItemBgBitmap[__drawingStatus];
- if(pDrawBitmap != null)
+ if (pDrawBitmap != null)
{
pCanvas = __pBitmapVisualElement->GetCanvasN();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_MORE;
}
}
- else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
+ else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
{
if (selectedItem)
{
bool
_TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
+ __isTouchCancelOnPressRelease = false;
+
if (IsContextItem() ||
__isContextItemActivated ||
IsAnimationPlaying() ||
__pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
}
- if(__isReleasedTimerEnabled)
+ if (__isReleasedTimerEnabled)
{
StopTouchReleasedTimer();
if (!IsIndividualSelectionEnabled(source))
{
__itemSelected = true;
- if(unlikely((_AccessibilityManager::IsActivated())))
+ if (unlikely((_AccessibilityManager::IsActivated())))
{
FireItemTouchPressed();
}
__isTabSoundPlayed = IS_PLAYED_FEEDBACK();
- if(!__itemTouchMoved && __isPressedTimerEnabled)
+ if (!__itemTouchMoved && __isPressedTimerEnabled)
{
StopTouchPressedTimer();
- if(!IsContextItem())
+ if (!IsContextItem())
{
FireItemTouchPressed();
}
void
_TableViewItem::FireItemTouchPressed()
{
- if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
+ if (__isTouchCancelOnPressRelease == true)
+ {
+ return;
+ }
+
+ if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
{
__drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
SetItemChanged(true);
Invalidate();
}
- else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
+ else if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
}
else
{
- if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
+ if (__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
{
__drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
SetItemChanged(true);
void
_TableViewItem::FireItemTouchReleased()
{
+ if (__isTouchCancelOnPressRelease == true)
+ {
+ return;
+ }
+
bool fireItemEvent = false;
bool selectedItem = true;
{
SetChecked(!checked);
}
- else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
+ else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
{
SetChecked(!checked);
SetCheckedAnimationEnabled(!checked);
}
}
- else if(__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
+ else if (__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
}
else
{
- if(__releasedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
+ if (__releasedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
{
if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
|| (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
SetItemChanged(true);
Invalidate();
-
}
else
{
bool
_TableViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
- if(IsReorderMode())
+ if (IsReorderMode())
{
return false;
}
__itemSelected = false;
DrawAnnexStyle();
}
- else if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
+ else if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
{
__annexOnOffHandlerMoved = true;
}
else
{
- if(!IsIndividualSelectionEnabled(source))
+ if (!IsIndividualSelectionEnabled(source))
{
__itemSelected = false;
__drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
bool
_TableViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
{
+ __isTouchCancelOnPressRelease = true;
+
if (__isPressedTimerEnabled)
{
StopTouchPressedTimer();
{
pContainer->Activate(false);
- if(!(pControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+ if (!(pControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
|| pControl == static_cast<_Control*>(__pItemAnnexRightDivider)
|| pControl == static_cast<_Control*>(__pItemCover)
|| pControl == static_cast<_Control*>(__pItemDivider)
__isPressedTimerEnabled = false;
FireItemTouchPressed();
}
- else if(&timer == __pReleasedTimer)
+ else if (&timer == __pReleasedTimer)
{
__isReleasedTimerEnabled = false;
FireItemTouchReleased();
{
result r = E_SUCCESS;
- SysTryReturnVoidResult(NID_UI_CTRL, __pPressedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
+ if (__pPressedTimer == null)
+ {
+ return;
+ }
if (__isPressedTimerEnabled)
{
{
result r = E_SUCCESS;
- if(__pReleasedTimer == null)
+ if (__pReleasedTimer == null)
{
__pReleasedTimer = new (std::nothrow) Timer();
SysTryCatch(NID_UI_CTRL, __pReleasedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
}
- if(!__isReleasedTimerEnabled)
+ if (!__isReleasedTimerEnabled)
{
r = __pReleasedTimer->Start(TOUCH_RELEASED_DURATION);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
{
result r = E_SUCCESS;
- SysTryReturnVoidResult(NID_UI_CTRL, __pReleasedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
+ if (__pReleasedTimer == null)
+ {
+ return;
+ }
if (__isReleasedTimerEnabled)
{
pMergeBitmap->Construct(*pCanvas, bounds);
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
- if(__pItemAnnex)
+ if (__pItemAnnex)
{
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
__pItemAnnex->Invalidate(false);
__pHeaderFooterItemText->SetBounds(textBounds);
}
- if(__pBitmapVisualElement != null)
+ if (__pBitmapVisualElement != null)
{
FloatRectangle bounds = GetBoundsF();
__pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
}
- if(__pAccessibilityElement != null)
+ if (__pAccessibilityElement != null)
{
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
}
CreateItemCover();
}
- if(__pDrawingProperty->itemDividerEnabled)
+ if (__pDrawingProperty->itemDividerEnabled)
{
CreateItemDivider();
}
SetItemHighlightBounds(*__pHighlightVisualElement, CalculateItemHighlightBounds());
__pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
- if(pDrawBitmap != null && __enabledState)
+ if (pDrawBitmap != null && __enabledState)
{
- if(__pBitmapVisualElement == null)
+ if (__pBitmapVisualElement == null)
{
return;
}
String imagePath = null;
- if(_BitmapImpl::CheckNinePatchedBitmapStrictly(*pDrawBitmap) == false)
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pDrawBitmap) == false)
{
imagePath = _BitmapImpl::GetInstance(*pDrawBitmap)->GetFileName();
}
- if(imagePath.IsEmpty() == false)
+ if (imagePath.IsEmpty() == false)
{
__pBitmapVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() /255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
__pBitmapVisualElement->SetImageSource(imagePath);
}
}
- if(IsContextItem())
+ if (IsContextItem())
{
DrawContextItemBackground();
}
}
else
{
- if(__enabledState)
+ if (__enabledState)
{
if (__itemType == TABLE_VIEW_ITEM_TYPE_HEADER || __itemType == TABLE_VIEW_ITEM_TYPE_FOOTER)
{
SetBackgroundColor(Color(0, 0, 0, 0));
__pHighlightVisualElement->SetBackgroundColor(_Colorf(0.0f, 0.0f, 0.0f, 0.0f));
}
- else if(__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
+ else if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
{
__pHighlightVisualElement->SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
}
if (__enabledState)
{
- if(__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED || __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED)
+ if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED || __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED)
{
if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_PRESSED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_PRESSED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_PRESSED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_PRESSED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_PRESSED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_PRESSED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_PRESSED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_PRESSED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionPressBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
GET_FIXED_VALUE_CONFIG(TABLEVIEW::ITEM_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight);
- if(pSectionPressBg)
+ if (pSectionPressBg)
{
pReplacementSectionPressBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionPressBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
}
}
else
{
- if(bgColor != null)
+ if (bgColor != null)
{
pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
}
{
if (__itemType == TABLE_VIEW_ITEM_TYPE_ONE)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_DISABLED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_SINGLE_BG_DISABLED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_SINGLE_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_TOP)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_DISABLED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_TOP_BG_DISABLED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_TOP_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_MIDDLE)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_DISABLED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_CENTER_BG_DISABLED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_CENTER_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
else if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM)
{
- if(IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_DISABLED))
+ if (IS_CUSTOM_BITMAP(TABLEVIEW::SECTIONITEM_BOTTOM_BG_DISABLED))
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::SECTIONITEM_BOTTOM_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pSectionDisabledBg);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] SectionStyle image load failed");
}
GET_COLOR_CONFIG(TABLEVIEW::ITEM_BG_DISABLED, bgColor);
- if(pSectionDisabledBg)
+ if (pSectionDisabledBg)
{
pReplacementSectionBg = Tizen::Graphics::_BitmapImpl::GetColorReplacedBitmapN(*pSectionDisabledBg, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
}
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
- if(__enabledState)
+ if (__enabledState)
{
- if(bgColor == null)
+ if (bgColor == null)
{
GET_COLOR_CONFIG(TABLEVIEW::CONTEXTITEM_BG_NORMAL, bgColor);
}
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- if(__enabledState)
+ if (__enabledState)
{
if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
{
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- if(__enabledState)
+ if (__enabledState)
{
if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
{
if (IsChecked() == true)
{
- if(__enabledState)
+ if (__enabledState)
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_ON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
}
}
else
{
- if(__enabledState)
+ if (__enabledState)
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_OFF_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
}
}
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pOnOffButtonHandler != null), , E_SYSTEM, "[E_SYSTEM] OnOffButtonHandler image load failed");
- if(__enabledState)
+ if (__enabledState)
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButton);
}
handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler);
- if(__annexOnOffHandlerMoved)
+ if (__annexOnOffHandlerMoved)
{
- if(annexStartPositionX <= __annexOnOffHandlerPositionX
+ if (annexStartPositionX <= __annexOnOffHandlerPositionX
&& annexEndPositionX >= __annexOnOffHandlerPositionX)
{
- if(((annexEndPositionX - annexStartPositionX) / 2) < (__annexOnOffHandlerPositionX + (handlerBounds.width / 2)) - annexStartPositionX )
+ if (((annexEndPositionX - annexStartPositionX) / 2) < (__annexOnOffHandlerPositionX + (handlerBounds.width / 2)) - annexStartPositionX )
{
handlerPositionX = annexEndPositionX;
SetChecked(true);
else
{
SetChecked(!IsChecked());
- if(IsChecked())
+ if (IsChecked())
{
handlerPositionX = annexEndPositionX;
}
handlerBounds = CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pOnOffButtonHandler);
handlerBounds.y = backgroundBounds.y;
- if(IsChecked())
+ if (IsChecked())
{
handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
}
nextHandlerX = handlerBounds.x + (touchEndPosition - __annexTouchStartPosition);
annexX = __pItemAnnex->GetBoundsF().x;
- if((annexX + nextHandlerX + handlerBounds.width) < (annexX + annexWidth + annexMargin)
+ if ((annexX + nextHandlerX + handlerBounds.width) < (annexX + annexWidth + annexMargin)
&& (annexX + nextHandlerX) > annexX)
{
handlerBounds.x = nextHandlerX;
}
- else if(_FloatCompareGE((annexX + nextHandlerX + handlerBounds.width), (annexX + annexWidth + annexMargin)))
+ else if (_FloatCompareGE((annexX + nextHandlerX + handlerBounds.width), (annexX + annexWidth + annexMargin)))
{
handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
}
- else if(_FloatCompareLE((annexX + nextHandlerX), annexX))
+ else if (_FloatCompareLE((annexX + nextHandlerX), annexX))
{
handlerBounds.x = backgroundBounds.x + annexMargin;
}
themeBackgroundBitmap = IS_CUSTOM_BITMAP(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL);
- if(__enabledState)
+ if (__enabledState)
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDetailBg);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS) && (pDetailBg != null), , E_SYSTEM, "[E_SYSTEM] Detail button image load failed");
DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailBgEffect), *pDetailBgEffect);
}
DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pReplacementDetail), *pReplacementDetail);
- if(pDetailEffect)
+ if (pDetailEffect)
{
DrawBitmap(*pCanvas, CalculateAnnexBitmapBounds(annexWidth, annexHeight, *pDetailEffect), *pDetailEffect);
}
void
_TableViewItem::DrawItemDivider(void)
{
- if(__pItemDivider == null || __pItemTopDivider == null)
+ if (__pItemDivider == null || __pItemTopDivider == null)
{
return;
}
__pItemDivider->SetVisibleState(true);
__pItemTopDivider->SetVisibleState(true);
- if( __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED ||
+ if ( __drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED ||
__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_HIGHLIGHTED)
{
- if(__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] != __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
+ if (__colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL] != __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED])
{
- if(__itemType != TABLE_VIEW_ITEM_TYPE_TITLE)
+ if (__itemType != TABLE_VIEW_ITEM_TYPE_TITLE)
{
__pItemDivider->SetVisibleState(false);
}
if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
{
- if(__pItemBgBitmap[__drawingStatus] != null)
+ if (__pItemBgBitmap[__drawingStatus] != null)
{
__pItemDivider->SetVisibleState(false);
}
__pItemTopDivider->SetVisibleState(false);
}
- if(!IsContextItem())
+ if (!IsContextItem())
{
if (!__isSimpleLastItem)
{
- if(__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM || __itemType == TABLE_VIEW_ITEM_TYPE_ONE)
+ if (__itemType == TABLE_VIEW_ITEM_TYPE_BOTTOM || __itemType == TABLE_VIEW_ITEM_TYPE_ONE)
{
__pItemDivider->SetVisibleState(false);
}
dividerBottomBounds.SetBounds(lineLeftMargin, bottomPoint.y - lineHeight, bounds.width - lineLeftMargin * 2.0f, lineHeight);
}
- if(__pItemDivider->GetVisibleState())
+ if (__pItemDivider->GetVisibleState())
{
__pItemDivider->SetBounds(dividerBottomBounds);
- if(customDividerColor == bottomLineColor || __itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
+ if (customDividerColor == bottomLineColor || __itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
{
__pItemDivider->SetBackgroundColor(bottomLineColor);
}
__pItemDivider->Invalidate();
}
- if(__pItemTopDivider->GetVisibleState())
+ if (__pItemTopDivider->GetVisibleState())
{
__pItemTopDivider->SetBounds(dividerTopBounds);
- if(customDividerColor == bottomLineColor)
+ if (customDividerColor == bottomLineColor)
{
__pItemTopDivider->SetBackgroundColor(topLineColor);
}
width = annexWidth;
}
- if(annexHeight > bitmap.GetHeightF())
+ if (annexHeight > bitmap.GetHeightF())
{
topMargin = (annexHeight - bitmap.GetHeightF()) / 2;
height = bitmap.GetHeightF();
bitmapRect.height = elementHeight;
}
- if(__annexStyle == TABLE_VIEW_ANNEX_STYLE_NORMAL)
+ if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_NORMAL)
{
textRect.x = bitmapRect.x + elementWidth + leftMargin;
elementWidth = itemWidth - textRect.x - leftMargin;
result
_TableViewItem::SetSimpleItemTextSize(int size)
{
- if(__simpleItemTextSize == size)
+ if (__simpleItemTextSize == size)
{
return E_SUCCESS;
}
{
__pressedControl = pressedControl;
- if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
+ if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
{
__drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
}
- else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
+ else if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
}
else
{
- if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
+ if (__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
{
__drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
}
if (!_FloatCompare(annexPositionX, annexBounds.x))
{
__pItemAnnex->SetPosition(FloatPoint(annexPositionX, annexBounds.y));
+
+ if (__pAccessibilityOnOffElement != null)
+ {
+ __pAccessibilityOnOffElement->SetBounds(__pItemAnnex->GetBoundsF());
+ }
}
}
}
annexBounds.y = (itemBounds.height - annexBounds.height) / 2;
__pItemAnnex->SetPosition(FloatPoint(annexBounds.x, annexBounds.y));
+ if (__pAccessibilityOnOffElement != null)
+ {
+ __pAccessibilityOnOffElement->SetBounds(__pItemAnnex->GetBoundsF());
+ }
}
void
_AccessibilityContainer* pContainer = const_cast<_Control*>(&control)->GetAccessibilityContainer();
pContainer->Activate(true);
int controlCount = 0;
- for(int i=0; i<GetChildCount(); i++)
+ for (int i=0; i<GetChildCount(); i++)
{
_Control* pChildControl = GetChild(i);
- if(pChildControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+ if (pChildControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
|| pChildControl == static_cast<_Control*>(__pItemAnnexRightDivider)
|| pChildControl == static_cast<_Control*>(__pItemCover)
|| pChildControl == static_cast<_Control*>(__pItemDivider)
controlCount++;
}
- if(controlCount == 0 || __individualSelectionControls.GetCount() == controlCount)
+ if (controlCount == 0 || __individualSelectionControls.GetCount() == controlCount)
{
GetAccessibilityContainer()->Activate(false);
}
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
- if(pContainer != null)
+ if (pContainer != null)
{
- if(__pAccessibilityElement == null)
+ if (__pAccessibilityElement == null)
{
__pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
__pAccessibilityElement->SetName(L"TableViewItem");
pContainer->AddElement(*__pAccessibilityElement);
}
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
+
+ if (__pAccessibilityOnOffElement == null && __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
+ {
+ String hintText(L"Double tap to select");
+ __pAccessibilityOnOffElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityOnOffElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ __pAccessibilityOnOffElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_ON_OFF_BUTTON_T_TTS");
+ __pAccessibilityOnOffElement->SetName(L"OnOffButton");
+ __pAccessibilityOnOffElement->SetHint(hintText);
+
+ pContainer->AddElement(*__pAccessibilityOnOffElement);
+ __pAccessibilityOnOffElement->SetBounds(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f));
+ }
}
}
void
_TableViewItem::SetAccessibilityElementTrait(void)
{
- if(__pAccessibilityElement == null)
+ if (__pAccessibilityElement == null)
{
return;
}
{
case TABLE_VIEW_ANNEX_STYLE_NORMAL:
GetItemIndex(groupIndex, itemIndex);
- if(groupIndex != -1 && itemIndex == -1)
+ if (groupIndex != -1 && itemIndex == -1)
{
__pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_GROUP_INDEX");
}
break;
case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
- case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
__pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_ON_OFF_BUTTON_T_TTS");
break;
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ break;
+
case TABLE_VIEW_ANNEX_STYLE_DETAILED:
__pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
break;
void
_TableViewItem::SetAccessibilityElementValue(void)
{
- if(__pAccessibilityElement == null)
+ if (__pAccessibilityElement == null)
{
return;
}
break;
case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
- case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
if (IsChecked())
{
__pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_ON");
}
break;
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ if (IsChecked())
+ {
+ if (__pAccessibilityOnOffElement != null)
+ {
+ __pAccessibilityOnOffElement->SetValueWithStringId("IDS_TPLATFORM_BODY_ON");
+ }
+ }
+ else
+ {
+ if (__pAccessibilityOnOffElement != null)
+ {
+ __pAccessibilityOnOffElement->SetValueWithStringId("IDS_TPLATFORM_BODY_OFF");
+ }
+ }
+ break;
+
case TABLE_VIEW_ANNEX_STYLE_RADIO:
if (IsChecked())
{
}
else
{
- __pAccessibilityElement->SetValue(L"Unselected");
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_NOT_SELECTED_T_TTS");
}
break;
void
_TableViewItem::SetAccessibilityElementLabel(void)
{
- if(__pAccessibilityElement == null)
+ if (__pAccessibilityElement == null)
{
return;
}
- if(__pAccessibilityElement->GetLabel().GetLength() > 0)
+
+ if (__pAccessibilityElement->IsPublicLabelUpdated())
{
return;
}
+
String accessibilityLabel;
String space = L" ";
int childControlCount = GetChildCount();
case TABLE_VIEW_ANNEX_STYLE_MARK:
if (IsChecked())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"ticked");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_TICK_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"unticked");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_UNTICK_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
break;
-
case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
- case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
if (IsChecked())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"On");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_ON,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"Off");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_OFF,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
+ }
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ if (&element == __pAccessibilityOnOffElement && IsEnabled())
+ {
+ if (IsChecked())
+ {
+ SetChecked(false);
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_OFF,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
+ }
+ else
+ {
+ SetChecked(true);
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_ON,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
+ }
}
break;
case TABLE_VIEW_ANNEX_STYLE_RADIO:
if (IsChecked())
{
- _AccessibilityManager::GetInstance()->ReadContent(L"selected");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_OPT_SELECT,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
else
{
- _AccessibilityManager::GetInstance()->ReadContent(L"unselected");
+ String string;
+ GET_STRING_CONFIG(IDS_TPLATFORM_BODY_NOT_SELECTED_T_TTS,string);
+ _AccessibilityManager::GetInstance()->ReadContent(string);
}
break;
-
default:
break;
}
{
return false;
}
-
+ _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
_KeyCode keyCode = keyInfo.GetKeyCode();
IListT<_Control*>* pFocusList = GetFocusListN();
SysTryReturn(NID_UI_CTRL, pFocusList != null, true, GetLastResult(), "[%s] propagating.", GetErrorMessage(GetLastResult()));
switch (keyCode)
{
case _KEY_LEFT:
- if (IsFocused())
- {
- if (pChildControl == null)
- {
- for (int i=count-1; i>=0; i--)
- {
- pFocusList->GetAt(i, pChildControl);
- if (pChildControl == null)
- {
- continue;
- }
-
- if (pChildControl->IsFocusable())
- {
- break;
- }
- else
- {
- pChildControl = null;
- }
- }
- }
- }
- else
+ if (!IsFocused())
{
- for(int i=count-1; i>=0; i--)
+ for (int i=count-1; i>=0; i--)
{
pFocusList->GetAt(i, pChildControl);
if (pChildControl == null)
break;
}
- for(int j=i-1; j>=0; j--)
+ for (int j=i-1; j>=0; j--)
{
pFocusList->GetAt(j, pChildControl);
if (pChildControl == null)
continue;
}
- if (pChildControl->IsFocusable())
+ if (pChildControl->IsFocusable() && pChildControl->GetEnableState()
+ && pChildControl->GetVisibleState())
{
break;
}
break;
}
}
- }
- if (pChildControl)
- {
- pChildControl->SetFocused(true);
- pChildControl->DrawFocus();
- }
- else
- {
- _Control* pParentControl = pFocusedControl->GetParent();
- _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pParentControl);
-
- if (pItem != null && pItem->GetEnableState() && !pItem->IsFocused())
+ if (pChildControl && pChildControl->GetEnableState()
+ && pChildControl->GetVisibleState() && pChildControl->IsFocusable())
{
- pItem->SetFocused(true);
- pItem->DrawFocus();
+ if (pParent != null)
+ {
+ pParent->SetAnnexFocused(true);
+ }
+ pChildControl->SetFocused(true);
+ pChildControl->DrawFocus();
+ }
+ else
+ {
+ _Control* pParentControl = pFocusedControl->GetParent();
+ _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pParentControl);
+
+ if (pItem != null && pItem->GetEnableState() && !pItem->IsFocused()
+ && pItem->GetVisibleState() && pItem->IsFocusable())
+ {
+ if (pParent != null)
+ {
+ pParent->SetAnnexFocused(false);
+ }
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ }
}
}
break;
continue;
}
- if (pChildControl->IsFocusable())
+ if (pChildControl->IsFocusable() && pChildControl->GetEnableState()
+ && pChildControl->GetVisibleState())
{
break;
}
}
else
{
- for(int i=0; i<count; i++)
+ for (int i=0; i<count; i++)
{
pFocusList->GetAt(i, pChildControl);
if (pChildControl == null)
continue;
}
- if (pChildControl->IsFocusable())
+ if (pChildControl->IsFocusable() && pChildControl->GetEnableState()
+ && pChildControl->GetVisibleState())
{
break;
}
}
}
- if (pChildControl)
+ if (pChildControl && pChildControl->GetEnableState() && pChildControl->GetVisibleState()
+ && pChildControl->IsFocusable())
{
- pChildControl->SetFocused(true);
- pChildControl->DrawFocus();
- }
- else
- {
- _Control* pParentControl = pFocusedControl->GetParent();
- _TableViewItem* pItem = dynamic_cast<_TableViewItem*>(pParentControl);
-
- if (pItem != null && pItem->GetEnableState() && !pItem->IsFocused())
+ if (pParent != null)
{
- pItem->SetFocused(true);
- pItem->DrawFocus();
+ pParent->SetAnnexFocused(true);
}
+ pChildControl->SetFocused(true);
+ pChildControl->DrawFocus();
}
break;
_KeyCode keyCode = keyInfo.GetKeyCode();
- if(keyCode == _KEY_ENTER)
+ if (keyCode == _KEY_ENTER)
{
_TableView* pParent = dynamic_cast<_TableView*>(GetParent());
SysTryReturn(NID_UI_CTRL, pParent != null, true, GetLastResult(), "[%s] propagating.", GetErrorMessage(GetLastResult()));
float position = 0.0f;
_Control* destination = null;
- for(int i=0; i<childControlCount; i++)
+ for (int i=0; i<childControlCount; i++)
{
_Control* pChildControl = pParentControl->GetChild(i);
if (pChildControl != null && pChildControl->IsFocusable())
float position = 0.0f;
_Control* destination = null;
- for(int i=0; i<childControlCount; i++)
+ for (int i=0; i<childControlCount; i++)
{
_Control* pChildControl = pParentControl->GetChild(i);
if (pChildControl != null && pChildControl->IsFocusable())
return __isTouchPressOnScroll;
}
+void
+_TableViewItem::OnVisibleStateChanged(void)
+{
+ if (IsFocused())
+ {
+ RemoveFocusRing();
+ }
+}
+
+void
+_TableViewItem::OnAncestorEnableStateChanged(const _Control& control)
+{
+ if (IsFocused())
+ {
+ RemoveFocusRing();
+ }
+}
+
+void
+_TableViewItem::OnAncestorVisibleStateChanged(const _Control& control)
+{
+ if (IsFocused())
+ {
+ RemoveFocusRing();
+ }
+}
+
+void
+_TableViewItem::OnFocusableStateChanged(bool focusableState)
+{
+ if (IsFocused() && !focusableState)
+ {
+ RemoveFocusRing();
+ }
+}
+
+void
+_TableViewItem::SetPublicLabelUpdate(bool resetPublicLabelUpdate)
+{
+ if (__pAccessibilityElement)
+ {
+ __pAccessibilityElement->SetPublicLabelUpdate(resetPublicLabelUpdate);
+ }
+}
+
}}} // Tizen::Ui::Controls
TableViewGroupItem* pGroupItem = null;
TableViewItemTag index = {groupIndex, itemIndex};
-// Label* pLabel = null;
-
if (itemIndex == -1)
{
if (__style == TABLE_VIEW_STYLE_SIMPLE)
if (pHeaderItem == null)
{
GetDefaultItem()->SetAppInfo(null);
+ __pDefaultItem->SetFocusable(false);
return __pDefaultItem;
}
+ pHeaderItem->SetFocusable(false);
return pHeaderItem;
}
if (pGroupItem == null)
{
GetDefaultItem()->SetAppInfo(null);
+ __pDefaultItem->SetFocusable(false);
return __pDefaultItem;
}
Tizen::Base::String contents = __pTableViewProvider->GetSectionHeader(groupIndex);
HorizontalAlignment contentsAlignment = __pTableViewPresenter->GetSectionHeaderTextHorizontalAlignment(groupIndex);
pItemCore->SetSectionHeaderFooterContents(contents, contentsAlignment, true);
+ pItemCore->SetFocusable(false);
}
}
}
if (pItem == null)
{
GetDefaultItem()->SetAppInfo(null);
+ __pDefaultItem->SetFocusable(false);
return __pDefaultItem;
}
Tizen::Base::String contents = __pTableViewProvider->GetSectionFooter(groupIndex);
HorizontalAlignment contentsAlignment = __pTableViewPresenter->GetSectionFooterTextHorizontalAlignment(groupIndex);
pItemCore->SetSectionHeaderFooterContents(contents, contentsAlignment, false);
+ pItemCore->SetFocusable(false);
}
}
}
#include "FUiCtrl_TableViewPresenter.h"
#include "FUiCtrl_TableViewItemProviderAdaptor.h"
#include "FUi_CoordinateSystemUtils.h"
+#include "FUi_FocusManagerImpl.h"
#include "FUi_Math.h"
#include "FUi_Window.h"
, __scrollPositionOnFlickStarted(0)
, __isAnimationCallbackBlocked(false)
, __lockLoadItemWithScroll(false)
+ , __isRestoreFocus(false)
+ , __isAnnexFocused(false)
+ , __isTableViewFocused(false)
, __itemTouchReleasedEventState(TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_NORMAL)
, __scrollToItemTag()
{
__expandableItemTag.groupIndex = -1;
__expandableItemTag.itemIndex = -1;
+
+ __focusItemTag.groupIndex = -1;
+ __focusItemTag.itemIndex = -1;
}
_TableViewPresenter::~_TableViewPresenter()
return E_SYSTEM;
}
+ if (groupIndex == topDrawnItemPos.groupIndex)
+ {
+ topDrawnItemPos.itemIndex = -1;
+ }
+
if (groupIndex < topDrawnItemPos.groupIndex)
{
topDrawnItemPos.groupIndex--;
}
- if ((groupIndex == topDrawnItemPos.groupIndex) && (GetItemCountAt(groupIndex) < topDrawnItemPos.itemIndex))
+ if ((groupIndex == GetGroupCount()) && (GetGroupCount() > 0))
{
- topDrawnItemPos.itemIndex = -1;
+ topDrawnItemPos.groupIndex--;
+ topDrawnItemPos.itemIndex = GetItemCountAt(GetGroupCount() - 1) - 1;
}
}
else
ResetSweptItem();
}
+ pTableViewItem->SetPublicLabelUpdate(false);
pTableViewItem->SetItemChanged(true);
pTableViewItem->Invalidate();
pTableViewItem->AdjustContextItemBounds();
PreloadItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex, shiftingDistance);
+ if (__isRestoreFocus)
+ {
+ __pTableView->SetFocused(true);
+ __pTableView->DrawFocus();
+ __isRestoreFocus = false;
+ }
+
__statusChangedFlag = true;
if (__itemTouchReleasedEventState == TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_FIRE)
TableViewItemTag itemTag = {groupIndex, itemIndex};
_TableViewItem *pItem = FindItem(itemTag);
+
+ TableViewItemTag topDrawnItemTag = {-1, -1};
+ GetTopDrawnItem(topDrawnItemTag);
+
+ TableViewItemTag bottomDrawnItemTag = {-1, -1};
+ GetBottomDrawnItem(bottomDrawnItemTag);
+
if (pItem != null)
{
- pItem->SetCheckedAnimationEnabled(checked);
+ if (((itemTag.groupIndex == topDrawnItemTag.groupIndex && itemTag.itemIndex >= topDrawnItemTag.itemIndex)
+ || itemTag.groupIndex > topDrawnItemTag.groupIndex) &&
+ ((itemTag.groupIndex == bottomDrawnItemTag.groupIndex && itemTag.itemIndex <= bottomDrawnItemTag.itemIndex)
+ || itemTag.groupIndex < bottomDrawnItemTag.groupIndex))
+ {
+ pItem->SetCheckedAnimationEnabled(checked);
+ }
}
result r = __pListModel->SetItemChecked(groupIndex, itemIndex, checked);
}
void
+_TableViewPresenter::RestoreFocus(bool isRestoreFocus)
+{
+ __isRestoreFocus = isRestoreFocus;
+}
+
+void
+_TableViewPresenter::SetAnnexFocused(bool isAnnexFocused)
+{
+ __isAnnexFocused = isAnnexFocused;
+}
+
+void
+_TableViewPresenter::SetTableViewFocused(bool focusStatus)
+{
+ if (focusStatus == false)
+ {
+ __focusItemTag.groupIndex = -1;
+ __focusItemTag.itemIndex = -1;
+ __isRestoreFocus = false;
+ __isAnnexFocused = false;
+ }
+ __isTableViewFocused = focusStatus;
+}
+
+bool
+_TableViewPresenter::IsTableViewFocused(void)
+{
+ return __isTableViewFocused;
+}
+
+void
_TableViewPresenter::SetItemType(_TableViewItem* pItem, TableViewItemTag itemPosition)
{
TableViewStyle style = __pTableView->GetTableViewStyle();
return;
}
- while (pLastItem->GetBoundsF().y <= currentScrollPos + __pTableView->GetBoundsF().height)
+ while (pLastItem && (pLastItem->GetBoundsF().y <= currentScrollPos + __pTableView->GetBoundsF().height))
{
TableViewItemTag nextItemPos = {-1, -1};
if (GetNextItemPosition(lastLoadedItemPos, nextItemPos))
if (nextItemPos.groupIndex != -1)
{
- _TableViewItem* item = LoadItem(nextItemPos.groupIndex, nextItemPos.itemIndex);
+ _TableViewItem* pItem = LoadItem(nextItemPos.groupIndex, nextItemPos.itemIndex);
+ if (pItem == null)
+ {
+ return;
+ }
FloatRectangle scrollAreaBounds = GetScrollAreaBounds();
- if (item->GetBoundsF().y + item->GetBoundsF().height >= scrollAreaBounds.height)
+ if (pItem->GetBoundsF().y + pItem->GetBoundsF().height >= scrollAreaBounds.height)
{
AdjustClientAreaBounds(true);
}
GetFirstItem(firstItemPos);
if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex)
{
+ SetTableViewFocused(false);
return false;
}
GetFirstItem(firstItemPos);
if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex)
{
+ SetTableViewFocused(false);
return false;
}
}
itemPos.itemIndex = -1;
}
- pItem = static_cast <_TableViewItem*>(__pListModel->LoadItem(itemPos.groupIndex, itemPos.itemIndex));
+ pItem = LoadItem(itemPos.groupIndex, itemPos.itemIndex);
+ if (pItem == null)
+ {
+ SetTableViewFocused(false);
+ return false;
+ }
- if (!pItem->GetVisibleState())
+ if (!pItem->GetVisibleState() || !pItem->GetEnableState()
+ || !pItem->IsFocusable())
{
TableViewItemTag firstItemPos = {-1, -1};
GetFirstItem(firstItemPos);
if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex)
{
+ SetTableViewFocused(false);
return false;
}
ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
}
- if (pItem->GetEnableState())
+ if (pItem->GetEnableState() && pItem->GetVisibleState()
+ && pItem->IsFocusable())
{
pItem->SetFocused(true);
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
pItem->DrawFocus();
break;
}
}
else
{
+ SetTableViewFocused(false);
return false;
}
}
GetLastItem(lastItemPos);
if (itemPos.groupIndex == lastItemPos.groupIndex && itemPos.itemIndex == lastItemPos.itemIndex)
{
+ SetTableViewFocused(false);
return false;
}
itemPos.itemIndex = 0;
}
- pItem = static_cast <_TableViewItem*>(__pListModel->LoadItem(itemPos.groupIndex, itemPos.itemIndex));
+ pItem = LoadItem(itemPos.groupIndex, itemPos.itemIndex);
+ if (pItem == null)
+ {
+ SetTableViewFocused(false);
+ return false;
+ }
- if (!pItem->GetVisibleState())
+ if (!pItem->GetVisibleState() || !pItem->GetEnableState()
+ || !pItem->IsFocusable())
{
TableViewItemTag lastItemPos = {-1, -1};
GetLastItem(lastItemPos);
if (itemPos.groupIndex == lastItemPos.groupIndex && itemPos.itemIndex == lastItemPos.itemIndex)
{
+ SetTableViewFocused(false);
return false;
}
ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
}
- if (pItem->GetEnableState())
+ if (pItem->GetEnableState() && pItem->GetVisibleState()
+ && pItem->IsFocusable())
{
pItem->SetFocused(true);
pItem->DrawFocus();
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
break;
}
}
}
else
{
+ SetTableViewFocused(false);
return false;
}
}
break;
+ case _KEY_TAB:
+ SetTableViewFocused(false);
+ return false;
+
default:
return false;
}
return;
}
- _Control* pFocusedControl = null;
+ _Control* pFocusedControl = null;
_Window* pTop = __pTableView->GetRootWindow();
if (pTop)
{
_TableViewItem* pItem = null;
TableViewItemTag itemPos = {-1, -1};
- if (pFocusedControl != null)
- {
- pTableView = dynamic_cast<_TableView*>(pFocusedControl);
- if (pTableView != null)
- {
- GetFirstItem(itemPos);
- if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE)
- {
- itemPos.itemIndex = 0;
- }
-
- ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
- pItem = FindItem(itemPos);
- if (pItem != null)
- {
- if (pItem->GetEnableState())
- {
- pItem->SetFocused(true);
- pItem->DrawFocus();
- }
- else
- {
- while (GetNextItemPosition(itemPos, itemPos))
- {
- TableViewItemTag topDrawnItemIndex = {-1, -1};
- GetTopDrawnItem(topDrawnItemIndex);
- if (topDrawnItemIndex.groupIndex <= itemPos.groupIndex && topDrawnItemIndex.itemIndex <= itemPos.itemIndex)
- {
- TableViewItemTag bottomDrawnItemIndex = {-1, -1};
- GetBottomDrawnItem(bottomDrawnItemIndex);
- if (bottomDrawnItemIndex.groupIndex >= itemPos.groupIndex && bottomDrawnItemIndex.itemIndex >= itemPos.itemIndex)
- {
- pItem = FindItem(itemPos);
- }
- else
- {
- ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
- pItem = FindItem(itemPos);
- }
- }
- else
- {
- ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
- pItem = FindItem(itemPos);
- }
-
- if (pItem != null)
- {
- if (pItem->GetEnableState())
- {
- pItem->SetFocused(true);
- pItem->DrawFocus();
- break;
- }
- }
- }
- }
- }
- }
- }
+ pItem = FindItem(__focusItemTag);
+
+ if (__isRestoreFocus && pItem != null)
+ {
+ if (pItem->GetEnableState() && pItem->GetVisibleState() && pItem->IsFocusable())
+ {
+ if (__isAnnexFocused)
+ {
+ pItem->DrawAnnexFocus();
+ }
+ else
+ {
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ }
+ }
+
+ __isRestoreFocus = false;
+ return;
+ }
+
+ if (pFocusedControl != null)
+ {
+ pTableView = dynamic_cast<_TableView*>(pFocusedControl);
+ if (pTableView != null)
+ {
+ if (_FocusManagerImpl::GetInstance()->IsForwardDirection() == true)
+ {
+ GetFirstItem(itemPos);
+ if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_SIMPLE)
+ {
+ itemPos.itemIndex = 0;
+ }
+
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
+ pItem = FindItem(itemPos);
+ if (pItem != null)
+ {
+ if (pItem->GetEnableState() && pItem->GetVisibleState()
+ && pItem->IsFocusable())
+ {
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ }
+ else
+ {
+ while (GetNextItemPosition(itemPos, itemPos))
+ {
+ TableViewItemTag topDrawnItemIndex = {-1, -1};
+ GetTopDrawnItem(topDrawnItemIndex);
+ if (topDrawnItemIndex.groupIndex <= itemPos.groupIndex && topDrawnItemIndex.itemIndex <= itemPos.itemIndex)
+ {
+ TableViewItemTag bottomDrawnItemIndex = {-1, -1};
+ GetBottomDrawnItem(bottomDrawnItemIndex);
+ if (bottomDrawnItemIndex.groupIndex >= itemPos.groupIndex && bottomDrawnItemIndex.itemIndex >= itemPos.itemIndex)
+ {
+ pItem = FindItem(itemPos);
+ }
+ else
+ {
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
+ pItem = FindItem(itemPos);
+ }
+ }
+ else
+ {
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP);
+ pItem = FindItem(itemPos);
+ }
+
+ if (pItem != null)
+ {
+ if (!pItem->GetVisibleState() || !pItem->GetEnableState()
+ || !pItem->IsFocusable())
+ {
+ TableViewItemTag lastItemPos = {-1, -1};
+ GetLastItem(lastItemPos);
+
+ if (itemPos.groupIndex == lastItemPos.groupIndex && itemPos.itemIndex == lastItemPos.itemIndex)
+ {
+ return;
+ }
+
+ continue;
+ }
+ else
+ {
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ GetLastItem(itemPos);
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
+ pItem = FindItem(itemPos);
+
+ if (pItem != null)
+ {
+ if (pItem->GetEnableState() && pItem->GetVisibleState()
+ && pItem->IsFocusable())
+ {
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ }
+ else
+ {
+ while (GetPreviousItemPosition(itemPos, itemPos))
+ {
+ TableViewItemTag bottomDrawnItemIndex = {-1, -1};
+ GetBottomDrawnItem(bottomDrawnItemIndex);
+
+ if (bottomDrawnItemIndex.groupIndex >= itemPos.groupIndex && bottomDrawnItemIndex.itemIndex >= itemPos.itemIndex)
+ {
+ TableViewItemTag topDrawnItemIndex = {-1, -1};
+ GetTopDrawnItem(topDrawnItemIndex);
+ if (topDrawnItemIndex.groupIndex <= itemPos.groupIndex && topDrawnItemIndex.itemIndex <= itemPos.itemIndex)
+ {
+ pItem = FindItem(itemPos);
+ }
+ else
+ {
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
+ pItem = FindItem(itemPos);
+ }
+ }
+ else
+ {
+ ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
+ pItem = FindItem(itemPos);
+ }
+
+ if (pItem != null)
+ {
+ if (!pItem->GetVisibleState() || !pItem->GetEnableState()
+ || !pItem->IsFocusable())
+ {
+ TableViewItemTag firstItemPos = {-1, -1};
+ GetFirstItem(firstItemPos);
+ if (itemPos.groupIndex == firstItemPos.groupIndex && itemPos.itemIndex == firstItemPos.itemIndex)
+ {
+ return;
+ }
+
+ continue;
+ }
+ else
+ {
+ __focusItemTag.groupIndex = itemPos.groupIndex;
+ __focusItemTag.itemIndex = itemPos.itemIndex;
+ __isAnnexFocused = false;
+ pItem->SetFocused(true);
+ pItem->DrawFocus();
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
void
_TableViewPresenter::OnFocusModeStateChanged(void)
{
+ __focusItemTag.groupIndex = -1;
+ __focusItemTag.itemIndex = -1;
+ __isRestoreFocus = false;
+ __isAnnexFocused = false;
+
_Window* pTop = __pTableView->GetRootWindow();
if (pTop != null)
}
}
+void
+_TableViewPresenter::OnVisibleStateChanged(void)
+{
+ //reset focus
+ if (__pTableView->IsFocused())
+ {
+ __pTableView->RemoveFocusRing();
+ }
+}
+
+void
+_TableViewPresenter::OnAncestorEnableStateChanged(const _Control& control)
+{
+ //reset focus
+ if (__pTableView->IsFocused())
+ {
+ __pTableView->RemoveFocusRing();
+ }
+}
+
+void
+_TableViewPresenter::OnAncestorVisibleStateChanged(const _Control& control)
+{
+ //reset focus
+ if (__pTableView->IsFocused())
+ {
+ __pTableView->RemoveFocusRing();
+ }
+}
+
+void
+_TableViewPresenter::OnFocusableStateChanged(bool focusableState)
+{
+ if (!focusableState)
+ {
+ //reset focus
+ if (__pTableView->IsFocused())
+ {
+ __pTableView->RemoveFocusRing();
+ }
+ }
+}
+
bool
_TableViewPresenter::GetAccessibilityElementFocusedState(void)
{
{
pTextAccessibilityElement->SetLabel(GetTitleText() + spaceString + GetGuideText() + GetText());
}
- pTextAccessibilityElement->SetHint(L"double tap to edit");
+ pTextAccessibilityElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
}
break;
__pTokenEditPresenter->SetDrawFocusState(true);
- RefreshFocusUi();
-
return;
}
return;
}
-void
-_TokenEdit::RefreshFocusUi(void)
-{
- int focusedTokenIndex = __pTokenEditPresenter->GetFocusedTokenIndex();
-
- if (focusedTokenIndex == -1)
- {
- _Control::OnDrawFocus();
- }
- else
- {
- _Control::OnFocusLost(*this);
- }
-
- return;
-}
}}} //Tizen::Ui::Controls
delete pTextObject;
pTextObject = null;
- if (__pVisualElement)
+ if (__pVisualElement != null)
{
__pVisualElement->Destroy();
__pVisualElement = null;
result r = E_SUCCESS;
FloatDimension textSize;
- if (__pTextBuffer)
+ if (__pTextBuffer != null)
{
delete[] __pTextBuffer;
__pTextBuffer = null;
{
result r = E_SUCCESS;
displayRect = bounds;
- if (__pVisualElement)
+ if (__pVisualElement != null)
{
__pVisualElement->SetBounds(bounds);
}
delete[] __pTextBuffer;
__pTextBuffer = null;
- if (__pVisualElement)
+ if (__pVisualElement != null)
{
__pVisualElement->Destroy();
__pVisualElement = null;
_VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
_VisualElement* pCursorVisualElement = GetCursorVisualElement();
- if (pEditVisualElement && pCursorVisualElement)
+ if (pEditVisualElement != null && pCursorVisualElement != null)
{
VisualElement* pCursorParent = pCursorVisualElement->GetParent();
if (pCursorParent != pEditVisualElement)
{
- if (pCursorParent)
+ if (pCursorParent != null)
{
pCursorParent->DetachChild(*pCursorVisualElement);
pEditVisualElement->AttachChild(*pCursorVisualElement);
}
}
- if (__pTokenList)
+ if (__pTokenList != null)
{
__pTokenList->RemoveAll(true);
delete __pTokenList;
delete __pTokenBgFocusEffectBitmap;
__pTokenBgFocusEffectBitmap = null;
- if (__pDescriptionTextVisualElement)
+ if (__pDescriptionTextVisualElement != null)
{
__pDescriptionTextVisualElement->Destroy();
__pDescriptionTextVisualElement = null;
delete __pDescriptionTextTextObject;
__pDescriptionTextTextObject = null;
- if (__pTimingFunction)
- {
- delete __pTimingFunction;
- __pTimingFunction = null;
- }
+ delete __pTimingFunction;
+ __pTimingFunction = null;
RemoveChildAccessibilityElements();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
TextObject* pTextObject = GetTextObject();
- if (pTextObject)
+ if (pTextObject != null)
{
pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
if ((__isEditingToken) && (__editingTokenIndex >= 0))
{
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element of token.");
Color selectedTokenColor = GetTokenEditColor(TOKEN_EDIT_STATUS_SELECTED);
Bitmap* pReplacementColorBackgroundBitmap = null;
- if (__pTokenBgBitmap)
+ if (__pTokenBgBitmap != null)
{
pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pTokenBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedTokenColor);
pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect);
}
- if (__pTokenBgPressedEffectBitmap && (!isCustomBitmap))
+ if (__pTokenBgPressedEffectBitmap != null && (!isCustomBitmap))
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgPressedEffectBitmap))
{
{
_VisualElement* pTextVisualElement = null;
pTextVisualElement = GetTextVisualElement();
- if (pTextVisualElement)
+ if (pTextVisualElement != null)
{
_EditPresenter::DrawText();
}
{
InitializeAtFirstDrawing();
- if (IsFocused() == true)
+ if (IsFocused())
{
ShowKeypad(false);
}
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "A system error has occurred. Failed to get visual element of token.");
isCustomBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_NORMAL);
isCustomFocusBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_FOCUS);
-
- if (__drawFocusState)
- {
- __pTokenEdit->RefreshFocusUi();
- }
-
if (count == -1)
{
tokenCount = __pTokenList->GetCount();
if (__pressedTokenIndex == i && IsFocused())
{
- if (__pTokenBgBitmap)
+ if (__pTokenBgBitmap != null)
{
pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pTokenBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedTokenColor);
pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect);
}
-
- if (__pTokenBgPressedEffectBitmap && (!isCustomBitmap))
+ if (__pTokenBgPressedEffectBitmap != null && (!isCustomBitmap))
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgPressedEffectBitmap))
{
tokenBgColor = disabledTokenColor;
}
- if (__pTokenBgBitmap)
+ if (__pTokenBgBitmap != null)
{
pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pTokenBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), tokenBgColor);
}
- if (__pTokenBgNormalEffectBitmap && (!isCustomBitmap))
+ if (__pTokenBgNormalEffectBitmap != null && (!isCustomBitmap))
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgNormalEffectBitmap))
{
if (__focusedTokenIndex == i && __drawFocusState && (!__isEditingToken))
{
- if (__pTokenBgReplacementFocusBitmap)
+ if (__pTokenBgReplacementFocusBitmap != null)
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgReplacementFocusBitmap))
{
}
}
- if (__pTokenBgFocusEffectBitmap && (!isCustomFocusBitmap))
+ if (__pTokenBgFocusEffectBitmap != null && (!isCustomFocusBitmap))
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgFocusEffectBitmap))
{
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
- if (pToken)
+ if (pToken != null)
{
tempString = pToken->GetText();
}
SysTryReturnResult(NID_UI_CTRL, index >= 0 && index < __pTokenList->GetCount(), E_OUT_OF_RANGE, "index (%d) is out of range.");
- if (selected == false)
+ SetDrawFocusState(false); // Manual simulation of pressed token.
+
+ if (!selected)
{
__pressedTokenIndex = -1;
}
float textObjectMaxHeight = GetMaxTextHeight();
textBoundsAlignValue = (tokenHeight - textObjectMaxHeight) / 2.0f;
- if (__pTokenList)
+ if (__pTokenList != null)
{
int tokenCount = __pTokenList->GetCount();
Rectangle
_TokenEditPresenter::GetTextBounds(void) const
{
- if ((__isPopupVisible == true || __isLongPressed == true) && __pressedTokenIndex >= 0)
+ if ((__isPopupVisible || __isLongPressed) && __pressedTokenIndex >= 0)
{
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
SysTryReturn(NID_UI_CTRL, pToken, Rectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to get valid token.");
FloatRectangle
_TokenEditPresenter::GetTextBoundsF(void) const
{
- if ((__isPopupVisible == true || __isLongPressed == true) && __pressedTokenIndex >= 0)
+ if ((__isPopupVisible || __isLongPressed) && __pressedTokenIndex >= 0)
{
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
SysTryReturn(NID_UI_CTRL, pToken, FloatRectangle(), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Unable to get valid token.");
GET_SHAPE_CONFIG(TOKENEDIT::DESCRIPTION_TEXT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, descriptionTextSize);
pDescriptionFont = GetFont();
- if (pDescriptionFont)
+ if (pDescriptionFont != null)
{
float editFontSize = GetTextSize();
(_FontImpl::GetInstance(*pDescriptionFont))->SetSize(descriptionTextSize);
pRootElement = __pTokenEdit->GetVisualElement();
SysTryCatch(NID_UI_CTRL, pRootElement, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element.");
- if (!__pDescriptionTextVisualElement)
+ if (__pDescriptionTextVisualElement == null)
{
__pDescriptionTextVisualElement = new (std::nothrow) _VisualElement();
SysTryCatch(NID_UI_CTRL, __pDescriptionTextVisualElement, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pDescriptionTextCanvas->Clear();
__pDescriptionTextTextObject->SetForegroundColor(__pTokenEdit->GetTitleTextColor(GetCurrentStatus()), 0, __pDescriptionTextTextObject->GetTextLength());
- if (IsFocused() == true)
+ if (IsFocused())
{
if (__pDescriptionTextTextObject->GetTextLengthAt(0) < __pDescriptionTextTextObject->GetTextLength())
{
if (!__isTitleSliding)
{
_EditPresenter::StopTitleSlidingTimer();
- if (__pDescriptionTextTextObject->IsActionOn() == true)
+ if (__pDescriptionTextTextObject->IsActionOn())
{
_EditPresenter::StartTitleSlidingTimer();
__isTitleSliding = true;
for (int i = 0; i < tokenCount; i++)
{
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
FloatRectangle tokenRect = pToken->displayRect;
if (tokenRect.Contains(point))
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
pToken = static_cast< _Token* >(__pTokenList->GetAt(prevPressedTokenIndex));
bool isParentChanged = false;
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
pToken = static_cast< _Token* >(__pTokenList->GetAt(prevPressedTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pToken->currTokenLength = inputTokenString.GetLength();
}
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
- if ((__isEditingToken == true) && (__pressedTokenIndex != -1))
+ if ((__isEditingToken) && (__pressedTokenIndex != -1))
{
r = AttachCursorToToken();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
- if (__isEditingToken == false)
+ if (!__isEditingToken)
{
SetCursorDisabled(true);
}
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
bool isParentChanged = false;
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
return E_SYSTEM;
}
- if (IsFocused() == false)
+ if (!IsFocused())
{
- if (__isTouchMoveInProgress == false)
+ if (!__isTouchMoveInProgress)
{
pScroll->SetScrollVisibility(false);
return E_SUCCESS;
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
- if (pTokenVisualElement)
+ if (pTokenVisualElement != null)
{
pTokenVisualElement->SetShowState(true);
}
}
TextObject* pTextObject = GetTextObject();
- if (pTextObject)
+ if (pTextObject != null)
{
pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_NONE);
pTextObject->Compose();
if (__editingTokenIndex >= 0)
{
- _Token* pToken = null;
- pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
- {
- if (GetText().GetLength() > 0)
- {
- OnTextCommitted(L"\n");
- }
- else
- {
- RemoveTokenAt(__editingTokenIndex, true);
- }
- }
+ OnTextCommitted(L"\n");
}
else
{
if (__autoShrink)
{
_Scroll* pScroll = GetScrollBar();
- if (pScroll)
+ if (pScroll != null)
{
pScroll->SetScrollVisibility(false);
}
for (int i = 0; i < tokenCount; i++)
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
for (int i = visibleTokenCount; i < tokenCount; i++)
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
_VisualElement* pTokenVisualElement = pToken->GetVisualElement();
- if (pTokenVisualElement)
+ if (pTokenVisualElement != null)
{
pTokenVisualElement->SetShowState(false);
}
}
TextObject* pTextObject = GetTextObject();
- if (pTextObject)
+ if (pTextObject != null)
{
pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
pTextObject->Compose();
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
float tokenX = pToken->displayRect.x;
float tokenY = pToken->displayRect.y;
}
_Scroll* pScroll = GetScrollBar();
- if (pScroll)
+ if (pScroll != null)
{
pScroll->SetScrollVisibility(false);
}
if (__editingTokenIndex >= 0)
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
int tokenX = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.x);
int tokenY = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.y);
}
else
{
- if (__isEditingToken == false)
+ if (!__isEditingToken)
{
__pressedTokenIndex = -1;
__focusedTokenIndex = -1;
{
if (GetTextLength() == 0 && GetTokenCount()) // There is no candidate token.
{
- if (__isEditingToken == true)
+ if (__isEditingToken)
{
_VisualElement* pEditVisualElement = __pTokenEdit->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pEditVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get root visual element.");
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
{
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
pToken = static_cast< _Token* >(__pTokenList->GetAt(__pressedTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
if (__animatingIndex == (GetTokenCount() - 1))
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(GetTokenCount() - 1));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
}
pToken = static_cast< _Token* >(__pTokenList->GetAt(GetTokenCount() - 1));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
}
//Backspace on Blocked text, delete full block
- if (IsBlocked() == true)
+ if (IsBlocked())
{
GetBlockRange(start, end);
}
{
InitializeCopyPasteManager();
}
- if (IsBlocked() == true)
+ if (IsBlocked())
{
ReleaseTextBlock();
}
- if (__isEditingToken != true)
+ if (!__isEditingToken)
{
DrawText();
}
Rectangle currBounds = __pTokenEdit->GetBounds();
DeleteText(start, end);
__previousCursorPosition = start;
- if (__isEditingToken != true)
+ if (!__isEditingToken)
{
DrawText();
}
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
float tokenHeight = 0.0f;
float tokenVerticalSpacing = 0.0f;
bool
_TokenEditPresenter::IsTextBlockedInTokenEdit(void) const
{
- if ((IsBlocked() == true) && (__isEditingToken) && (__editingTokenIndex >= 0))
+ if ((IsBlocked()) && (__isEditingToken) && (__editingTokenIndex >= 0))
{
return true;
}
if (GetTokenCount())
{
//Scrolling is blocked when a popup is visible or when a text is blocked
- if (IsBlocked() == true || __isLongPressed == true)
+ if (IsBlocked() || __isLongPressed)
{
return false;
}
if (__touchPressInfo.y > 0.0f)
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
float tokenX = pToken->displayRect.x;
float tokenY = pToken->displayRect.y;
if (!(__pTokenEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL))
{
_Scroll* pScroll = GetScrollBar();
- if (pScroll)
+ if (pScroll != null)
{
float tokenBottomMargin = 0.0f;
GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, tokenBottomMargin);
_Token* pToken = null;
pToken = static_cast< _Token* >(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
VisualElementValueAnimation* pAnimation = dynamic_cast< VisualElementValueAnimation* >(const_cast< VisualElementAnimation* >(&animation));
VisualElement* pPresentation = const_cast< VisualElement* >(target.AcquirePresentationInstance());
- if (pPresentation && pAnimation)
+ if (pPresentation != null && pAnimation != null)
{
float diffX = 0.0f;
float diffY = 0.0f;
inputTokenString = replacementString;
}
+ int index = __editingTokenIndex;
+ RemoveTokenAt(__editingTokenIndex, true);
if (inputTokenString.GetLength() > 0)
{
- int index = __editingTokenIndex;
- RemoveTokenAt(__editingTokenIndex, true);
InsertTokenAt(index, inputTokenString);
}
}
_VisualElement* pTokenVisualElement = null;
pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement, E_SYSTEM, "A system error has occurred. Failed to get token visual element.");
pToken = static_cast <_Token*>(__pTokenList->GetAt(__pressedTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
pToken = static_cast <_Token*>(__pTokenList->GetAt(__editingTokenIndex));
- if (pToken)
+ if (pToken != null)
{
pTokenVisualElement = pToken->GetVisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, pTokenVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get token visual element.");
_Token* pToken = null;
pToken = static_cast <_Token*>(__pTokenList->GetAt(i));
- if (pToken)
+ if (pToken != null)
{
pToken->SetBounds(pToken->displayRect);
}
{
SetCursorDisabled(false);
CheckTokenScrolling();
+ __pTokenEdit->Invalidate();
}
StartCursorTimer();
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
- if (pContainer)
+ if (pContainer != null)
{
_AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(tokenCount - 1));
SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
- if (pContainer)
+ if (pContainer != null)
{
_AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
String labelText = pToken->GetText();
pAccessibilityElement->SetBounds(pToken->displayRect);
pAccessibilityElement->SetLabel(labelText);
- pAccessibilityElement->SetHint(L"double tap to edit");
+ pAccessibilityElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
pContainer->AddElement(*pAccessibilityElement);
__accessibilityElements.Add(pAccessibilityElement);
}
_Token* pToken = static_cast< _Token* >(__pTokenList->GetAt(index));
SysTryReturn(NID_UI_CTRL, pToken != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null.");
- if (pContainer)
+ if (pContainer != null)
{
_AccessibilityElement* pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnResult(NID_UI_CTRL, pAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_AccessibilityContainer* pContainer = __pTokenEdit->GetAccessibilityContainer();
_AccessibilityElement* pAccessibilityElement = null;
- if (pContainer)
+ if (pContainer != null)
{
if (__accessibilityElements.GetCount() > 0)
{
if ((__accessibilityElements.GetAt(index, pAccessibilityElement)) == E_SUCCESS)
{
- if (pAccessibilityElement)
+ if (pAccessibilityElement != null)
{
pAccessibilityElement->SetBounds(pToken->displayRect);
}
{
_AccessibilityElement* pTitleAccessibilityElement = __pTokenEdit->GetTitleTextAccessibilityElement();
- if (!pTitleAccessibilityElement)
+ if (pTitleAccessibilityElement == null)
{
return E_SUCCESS;
}
_TokenEditPresenter::ScrollToTitleAccessibilityElement(void)
{
_AccessibilityElement* pTitleAccessibilityElement = __pTokenEdit->GetTitleTextAccessibilityElement();
- if (pTitleAccessibilityElement)
+ if (pTitleAccessibilityElement != null)
{
FloatRectangle titleTextBounds = pTitleAccessibilityElement->GetBounds();
if (titleTextBounds.y < 0)
r = __accessibilityElements.GetAt(__focusOutIndex, pPreviousAccessibilityElement);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r));
- if (pPreviousAccessibilityElement && pPreviousAccessibilityElement->GetAbsoluteBounds().y > element.GetAbsoluteBounds().y) //Left flick
+ if (pPreviousAccessibilityElement != null && pPreviousAccessibilityElement->GetAbsoluteBounds().y > element.GetAbsoluteBounds().y) //Left flick
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(__focusOutIndex - 1));
- if (pToken)
+ if (pToken != null)
{
if (pToken->displayRect.y < 0.0f && __focusOutIndex > 0)
{
}
}
- if (pPreviousAccessibilityElement && pPreviousAccessibilityElement->GetAbsoluteBounds().y < element.GetAbsoluteBounds().y) //Right flick
+ if (pPreviousAccessibilityElement != null && pPreviousAccessibilityElement->GetAbsoluteBounds().y < element.GetAbsoluteBounds().y) //Right flick
{
pToken = static_cast< _Token* >(__pTokenList->GetAt(__focusOutIndex + 1));
- if (pToken)
+ if (pToken != null)
{
if (pToken->displayRect.y + pToken->displayRect.height > __pTokenEdit->GetBoundsF().height)
{
if (pToken == null) //Draw Cursor Accessibility Element
{
_AccessibilityElement* pCursorAccessibilityElement = __pTokenEdit->GetCursorAccessibilityElement();
- if (pCursorAccessibilityElement && pPreviousAccessibilityElement && pCursorAccessibilityElement != pPreviousAccessibilityElement)
+ if (pCursorAccessibilityElement != null && pPreviousAccessibilityElement != null && pCursorAccessibilityElement != pPreviousAccessibilityElement)
{
if (GetTextBoundsF().y - pPreviousAccessibilityElement->GetBounds().y > pPreviousAccessibilityElement->GetBounds().height) //check for different lines
{
if (__pTokenEdit->IsInternalFocused()) // Set cursor as global focus accessibility element only in focused mode.
{
_AccessibilityElement* pCursorAccessibilityElement = __pTokenEdit->GetCursorAccessibilityElement();
- if (pCursorAccessibilityElement)
+ if (pCursorAccessibilityElement != null)
{
_AccessibilityManager::GetInstance()->SetGlobalFocusedElement(*pCursorAccessibilityElement);
_AccessibilityManager::GetInstance()->RequestToDrawFocusUi();
void
_TokenEditPresenter::PerformRemoveTokenAnimation(VisualElement& source)
{
+ FloatRectangle startValue(0.0f, 0.0f, 0.0f, 0.0f);
+
if (__pTimingFunction == null)
{
__pTimingFunction = new (std::nothrow) SineTimingFunction();
SysTryReturnVoidResult(NID_UI_CTRL, __pTimingFunction, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- AnimationTransaction::Begin();
-
VisualElementPropertyAnimation* pOpacityAnimation = new (std::nothrow) VisualElementPropertyAnimation();
SysTryReturnVoidResult(NID_UI_CTRL, pOpacityAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pOpacityAnimation->SetDuration(ANIMATION_DURATION_OPACITY);
pOpacityAnimation->SetTimingFunction(__pTimingFunction);
- source.AddAnimation("OpacityAnimation", *pOpacityAnimation);
- delete pOpacityAnimation;
-
VisualElementValueAnimation* pBoundsAnimation = new (std::nothrow) VisualElementValueAnimation(); //deletion will happen in catch/ in Destroy animation
- SysTryReturnVoidResult(NID_UI_CTRL, pBoundsAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryCatch(NID_UI_CTRL, pBoundsAnimation, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pBoundsAnimation->SetTimingFunction(__pTimingFunction);
- FloatRectangle startValue = source.GetBounds();
+ startValue = source.GetBounds();
startValue.x = startValue.x + startValue.width * 0.05;
startValue.y = startValue.y + startValue.height * 0.05;
startValue.width = startValue.width * 0.9;
pBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
pBoundsAnimation->SetVisualElementAnimationTickEventListener(this);
pBoundsAnimation->SetDuration(ANIMATION_DURATION_BOUNDS);
- source.AddAnimation(L"BoundsAnimation", *pBoundsAnimation);
- delete pBoundsAnimation;
+ AnimationTransaction::Begin();
+ source.AddAnimation(L"BoundsAnimation", *pBoundsAnimation);
+ source.AddAnimation("OpacityAnimation", *pOpacityAnimation);
AnimationTransaction::Commit();
+ delete pBoundsAnimation;
+ // fall through
+CATCH:
+ delete pOpacityAnimation;
+
return;
}
{
if (i == LEFT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ }
}
else if (i == RIGHT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ }
}
if (pButtonItem->GetChildCount() != 0)
{
if (position == LEFT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ }
}
else if (position == RIGHT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ }
}
if (__pButtonItems[position]->GetChildCount() != 0)
{
if (position == LEFT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT);
+ }
}
else if (position == RIGHT_BUTTON)
{
- StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ if (__pAnimation[TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT] != null)
+ {
+ StopWaitingAnimation(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT);
+ }
}
if (__pButtonItems[position]->GetChildCount() != 0)
FloatRectangle bounds = __pButtonItems[position]->GetBoundsF();
- float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF();
- float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF();
-
- bounds.y = bounds.y + topTouchMargin;
- bounds.width = bounds.width - rightTouchMargin;
-
float height = 0.0f;
GET_SHAPE_CONFIG(HEADER::BADGE_HEIGHT_WITH_BUTTON, GetOrientation(), height);
if (pBadgeIconLabel)
{
- pBadgeIconLabel->SetBounds(FloatRectangle(bounds.width - height, bounds.y, height, height));
+ pBadgeIconLabel->SetBounds(FloatRectangle(bounds.width - height, 0, height, height));
pBadgeIconLabel->SetBackgroundBitmap(*pBadgeIcon);
__pButtonItems[position]->AttachChild(*pBadgeIconLabel);
FloatRectangle bounds = __pButtonItems[position]->GetBoundsF();
- float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF();
- float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF();
-
- bounds.y = bounds.y + topTouchMargin;
- bounds.width = bounds.width - rightTouchMargin;
-
if (existingBadgeIcon)
{
float fontSize = 0.0f;
GET_SHAPE_CONFIG(HEADER::BADGE_WIDTH_2DIGIT, GetOrientation(), width);
}
- existingBadgeIcon->SetBounds(FloatRectangle(bounds.width - width, bounds.y, width, height));
+ existingBadgeIcon->SetBounds(FloatRectangle(bounds.width - width, 0, width, height));
existingBadgeIcon->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
Integer tempNumber(number);
pButtonElement->SetName(name);
pButtonElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
- FloatRectangle floatRect = GetButtonBoundsF(position);
- pButtonElement->SetBounds(FloatRectangle(0,floatRect.y, pButton->GetBoundsF().width, floatRect.height));
+ pButtonElement->SetBounds(FloatRectangle(0.0f, 0.0f, pButton->GetBoundsF().width, pButton->GetBoundsF().height));
}
}
}
if (pPressedBackgroundEffectBitmap)
{
- //pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pPressedBackgroundEffectBitmap);
+ pButton->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pPressedBackgroundEffectBitmap);
delete pPressedBackgroundEffectBitmap;
}
if (pHighlightedBackgroundEffectBitmap)
}
}
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
+ if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE)
{
Bitmap* pSubTitleEffectBitmap = null;
Bitmap* pReColorSubTitleEffectBitmap = null;
delete pSubTitleEffectBitmap;
delete pReColorSubTitleEffectBitmap;
}
- }
+ } //if (TOOLBAR_BUTTON == buttonType)
else if (TOOLBAR_ITEM == buttonType)
{
Bitmap* pNormalBackgroundBitmap = null;
float largeTabTopMargin = 0.0f;
float largeTabTextHeight = 0.0f;
- float leftTouchMargin = pButton->GetLeftTouchMarginF();
- float topTouchMargin = pButton->GetTopTouchMarginF();
- float rightTouchMargin = pButton->GetRightTouchMarginF();
- float bottomTouchMargin = pButton->GetBottomTouchMarginF();
-
GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_TEXT_LEFT_MARGIN, GetOrientation(), sideMargin);
GET_SHAPE_CONFIG(HEADER::ICON_TEXT_GAP, GetOrientation(), iconTextGap);
GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, GetOrientation(), segmentedTextAreaHeight);
if (pButton->GetBitmap(_BUTTON_STATUS_NORMAL) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_NORMAL,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_NORMAL)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_PRESSED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_PRESSED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_PRESSED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_DISABLED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_DISABLED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_DISABLED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_SELECTED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_SELECTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_SELECTED)));
}
float buttonItemWidth = pButton->GetSizeF().width;
float buttonItemHeight = pButton->GetSizeF().height;
- float leftTouchMargin = pButton->GetLeftTouchMarginF();
- float topTouchMargin = pButton->GetTopTouchMarginF();
- float rightTouchMargin = pButton->GetRightTouchMarginF();
- float bottomTouchMargin = pButton->GetBottomTouchMarginF();
-
if (pButton->GetBitmap(_BUTTON_STATUS_NORMAL) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_NORMAL,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_NORMAL)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_PRESSED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_PRESSED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_PRESSED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_HIGHLIGHTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_DISABLED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_DISABLED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_DISABLED)));
}
if (pButton->GetBitmap(_BUTTON_STATUS_SELECTED) != null)
{
pButton->SetBitmap(_BUTTON_STATUS_SELECTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
*(pButton->GetBitmap(_BUTTON_STATUS_SELECTED)));
}
if (pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL) != null)
{
pButton->SetEffectBitmap(_BUTTON_STATUS_NORMAL,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL))->GetHeightF()) / 2),
*(pButton->GetEffectBitmap(_BUTTON_STATUS_NORMAL)));
}
if (pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED) != null)
{
pButton->SetEffectBitmap(_BUTTON_STATUS_PRESSED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED))->GetHeightF()) / 2),
*(pButton->GetEffectBitmap(_BUTTON_STATUS_PRESSED)));
}
if (pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED) != null)
{
pButton->SetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED))->GetHeightF()) / 2),
*(pButton->GetEffectBitmap(_BUTTON_STATUS_HIGHLIGHTED)));
}
if (pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED) != null)
{
pButton->SetEffectBitmap(_BUTTON_STATUS_DISABLED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED))->GetHeightF()) / 2),
*(pButton->GetEffectBitmap(_BUTTON_STATUS_DISABLED)));
}
if (pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED) != null)
{
pButton->SetEffectBitmap(_BUTTON_STATUS_SELECTED,
- FloatPoint((buttonItemWidth - (leftTouchMargin + rightTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
- (buttonItemHeight - (topTouchMargin + bottomTouchMargin) - (pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
+ FloatPoint((buttonItemWidth - (pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED))->GetWidthF()) / 2,
+ (buttonItemHeight - (pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED))->GetHeightF()) / 2),
*(pButton->GetEffectBitmap(_BUTTON_STATUS_SELECTED)));
}
float headerButtonItemHeight = 0.0f;
float headerLeftMargin = 0.0f;
float headerRightMargin = 0.0f;
- float tabLeftMargin = 0.0f;
-
- float leftTouchMargin = 0.0f;
- float topTouchMargin = 0.0f;
- float rightTouchMargin = 0.0f;
- float bottomTouchMargin = 0.0f;
GET_SHAPE_CONFIG(HEADER::TOP_MARGIN, GetOrientation(), headerTopMargin);
GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_GAP, GetOrientation(), buttonItemGap);
GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), headerLeftMargin);
GET_SHAPE_CONFIG(HEADER::RIGHT_MARGIN, GetOrientation(), headerRightMargin);
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin);
-
- GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin);
- GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin);
- GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin);
- GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin);
if (__pButtonItems[LEFT_BUTTON])
{
- headerLeftButtonWidth = __pButtonItems[LEFT_BUTTON]->GetSizeF().width;
+ headerLeftButtonWidth = CoordinateSystem::AlignToDevice(__pButtonItems[LEFT_BUTTON]->GetSizeF()).width;
}
if (__pButtonItems[RIGHT_BUTTON])
{
- headerRightButtonWidth = __pButtonItems[RIGHT_BUTTON]->GetSizeF().width;
+ headerRightButtonWidth = CoordinateSystem::AlignToDevice(__pButtonItems[RIGHT_BUTTON]->GetSizeF()).width;
}
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
+ if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE)
{
GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, GetOrientation(), vmargin);
GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, GetOrientation(), headerButtonItemHeight);
}
+ else if (__style == TOOLBAR_TAB_WITH_TITLE)
+ {
+ GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin);
+ GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, GetOrientation(), headerButtonItemHeight);
+ }
else
{
GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_TOP_MARGIN, GetOrientation(), vmargin);
{
if (__pButtonItems[LEFT_BUTTON])
{
- if (__pButtonItems[LEFT_BUTTON]->GetText() == L"")
- {
- if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"")
- {
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - buttonItemGap - headerLeftButtonWidth, vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
-
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- else
- {
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-
- __titleTextArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- }
- else
- {
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth + 1, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - buttonItemGap - headerLeftButtonWidth , vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
-
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- else
- {
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth, vmargin,
+ headerRightButtonWidth, headerButtonItemHeight));
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - buttonItemGap - headerLeftButtonWidth , vmargin,
+ headerLeftButtonWidth, headerButtonItemHeight));
- __titleTextArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- }
+ if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE)
+ {
+ __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
}
else
{
- if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"")
- {
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - buttonItemGap - headerLeftButtonWidth, vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
+ __titleTextArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
-
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- else
- {
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-
- __titleTextArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- }
- else
+ if (__style != TOOLBAR_TAB_WITH_TITLE)
{
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth + 1, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth - buttonItemGap - headerLeftButtonWidth , vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
-
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
- else
- {
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
-
- __titleTextArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
- }
+ __itemArea.width -= (headerLeftButtonWidth + buttonItemGap + headerRightButtonWidth);
}
}
}
else
{
- if (__pButtonItems[RIGHT_BUTTON]->GetText() == L"")
- {
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth, vmargin,
+ headerRightButtonWidth, headerButtonItemHeight));
- __itemArea.width -= (headerRightButtonWidth);
- }
- else
- {
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-
- __titleTextArea.width -= (headerRightButtonWidth);
- __itemArea.width -= (headerRightButtonWidth);
- }
+ if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE)
+ {
+ __itemArea.width -= (headerRightButtonWidth);
}
else
{
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerRightButtonWidth + 1, vmargin,
- headerRightButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
+ __titleTextArea.width -= (headerRightButtonWidth);
- __itemArea.width -= (headerRightButtonWidth);
- }
- else
+ if (__style != TOOLBAR_TAB_WITH_TITLE)
{
- //__pButtonItems[RIGHT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
-
- __titleTextArea.width -= (headerRightButtonWidth);
__itemArea.width -= (headerRightButtonWidth);
}
}
}
else if (__pButtonItems[LEFT_BUTTON])
{
- if (__pButtonItems[LEFT_BUTTON]->GetText() == L"")
- {
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerLeftButtonWidth, vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
-
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
- {
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, 0.0f, rightTouchMargin, 0.0f);
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerLeftButtonWidth, vmargin,
+ headerLeftButtonWidth, headerButtonItemHeight));
- __itemArea.width -= (headerLeftButtonWidth);
- }
- else
- {
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-
- __titleTextArea.width -= (headerLeftButtonWidth);
- __itemArea.width -= (headerLeftButtonWidth);
- }
+ if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE)
+ {
+ __itemArea.width -= (headerLeftButtonWidth);
}
else
{
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(__titleTextArea.width - headerLeftButtonWidth + 1, vmargin,
- headerLeftButtonWidth, headerButtonItemHeight));
+ __titleTextArea.width -= (headerLeftButtonWidth);
- if (__style == TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_TAB_WITH_TITLE)
+ if (__style != TOOLBAR_TAB_WITH_TITLE)
{
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0, 0, 0, 0);
-
- __itemArea.width -= (headerLeftButtonWidth);
- }
- else
- {
- //__pButtonItems[LEFT_BUTTON]->SetTouchMargin(0.0f, topTouchMargin, 0.0f, bottomTouchMargin);
-
- __titleTextArea.width -= (headerLeftButtonWidth);
__itemArea.width -= (headerLeftButtonWidth);
}
}
{
SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT,
(__pButtonItems[LEFT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2,
- topTouchMargin + (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2);
+ (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - processingAnimationIconSize) / 2);
}
if (__pButtonItems[RIGHT_BUTTON] && GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT) != ANIMATION_STOPPED)
{
SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT,
(__pButtonItems[RIGHT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2,
- topTouchMargin + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2);
+ (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - processingAnimationIconSize) / 2);
}
}
else // footer or edit or HEADER_STYLE_BUTTON // side align
float footerLeftMargin = 0.0f;
FloatDimension softkeyDimension(0.0f, 0.0f);
- float leftTouchMargin = 0.0f;
- float topTouchMargin = 0.0f;
- float rightTouchMargin = 0.0f;
- float bottomTouchMargin = 0.0f;
-
- if (__header == true && __style == TOOLBAR_TEXT) // sip
- {
- GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin);
- GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin);
- GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin);
- GET_SHAPE_CONFIG(HEADER::SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin);
- }
- else
- {
- GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_LEFT_TOUCH_MARGIN, GetOrientation(), leftTouchMargin);
- GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_TOP_TOUCH_MARGIN, GetOrientation(), topTouchMargin);
- GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_RIGHT_TOUCH_MARGIN, GetOrientation(), rightTouchMargin);
- GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, GetOrientation(), bottomTouchMargin);
- }
-
if (__header == true && __style == TOOLBAR_TEXT)
{
GET_SHAPE_CONFIG(HEADER::BUTTON_ITEM_WIDTH, GetOrientation(), footerButtonItemWidth);
{
if (__style != TOOLBAR_SOFTKEY)
{
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
- (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth,
+ 0.0f, footerButtonItemWidth + 1, footerButtonItemHeight));
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, (__itemArea.height - footerButtonItemHeight) / 2,
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, 0.0f,
footerButtonItemWidth, footerButtonItemHeight));
-
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
else
{
else
{
__pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - softkeyDimension.width, __itemArea.height - softkeyDimension.height,
- softkeyDimension.width, softkeyDimension.height));
+ softkeyDimension.width + 1, softkeyDimension.height));
}
if (__pButtonItems[LEFT_BUTTON]->GetText() == L"")
{
if (__style != TOOLBAR_SOFTKEY)
{
- __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
- (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
-
- __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+ __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth,
+ 0.0f, footerButtonItemWidth + 1, footerButtonItemHeight));
}
else
{
else
{
__pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - softkeyDimension.width, __itemArea.height - softkeyDimension.height,
- softkeyDimension.width, softkeyDimension.height));
+ softkeyDimension.width + 1, softkeyDimension.height));
}
}
}
{
if (__style != TOOLBAR_SOFTKEY)
{
- __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, (__itemArea.height - footerButtonItemHeight) / 2,
+ __pButtonItems[LEFT_BUTTON]->SetBounds(FloatRectangle(0.0f, 0.0f,
footerButtonItemWidth, footerButtonItemHeight));
-
- __pButtonItems[LEFT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
}
else
{
{
float segmentedItemHeight = 0.0f;
float leftMargin = 0.0f;
- float dividerWidth = 0.0f;
float vmargin = 0.0f;
float blockWidth[__itemCount];
float fontSize = 0.0f;
float multilineFontSize = 0.0f;
GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), leftMargin);
- GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth);
if (__style == TOOLBAR_HEADER_SEGMENTED)
{
{
if (!(__pButtonItems[LEFT_BUTTON] || __pButtonItems[RIGHT_BUTTON])) // no button
{
- blockWidth[0] = blockWidth[1] = (GetSizeF().width - dividerWidth ) / 2;
-
- blockWidth[1] += 1;
+ blockWidth[0] = blockWidth[1] = GetSizeF().width / 2;
}
else
{
- blockWidth[0] = blockWidth[1] = (__itemArea.width + leftMargin - dividerWidth) / 2;
+ blockWidth[0] = blockWidth[1] = (__itemArea.width + leftMargin) / 2;
}
for (int i = 0; i < __itemCount ; i++)
{
- __pItems.at(i)->SetBounds(FloatRectangle(blockWidth[0] * i + dividerWidth * i, vmargin, blockWidth[i], segmentedItemHeight));
+ __pItems.at(i)->SetBounds(FloatRectangle(blockWidth[0] * i, vmargin, blockWidth[i], segmentedItemHeight));
if (__pItems.at(i)->GetChildCount() != 0)
{
{
if (!(__pButtonItems[LEFT_BUTTON] || __pButtonItems[RIGHT_BUTTON])) // no button
{
- blockWidth[0] = blockWidth[1] = blockWidth[2] = (GetSizeF().width - dividerWidth * 2) / 3;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = GetSizeF().width / 3;
+ blockWidth[1] += 1;
__pItems.at(0)->SetBounds(FloatRectangle(0, vmargin, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2],vmargin, blockWidth[2] + 2, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], vmargin, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2], vmargin, blockWidth[2] + 1, segmentedItemHeight));
}
else
{
- blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width + leftMargin - dividerWidth * 2) / 3;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width + leftMargin) / 3;
+ blockWidth[1] += 1;
__pItems.at(0)->SetBounds(FloatRectangle(0, vmargin, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- vmargin, blockWidth[2], segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], vmargin, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] - 1,
+ vmargin, blockWidth[2] + 1, segmentedItemHeight));
}
for (int i = 0; i < __itemCount; i++)
{
if (!(__pButtonItems[LEFT_BUTTON] || __pButtonItems[RIGHT_BUTTON])) // no button
{
- blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (GetSizeF().width - dividerWidth * 3) / 4;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = GetSizeF().width / 4;
__pItems.at(0)->SetBounds(FloatRectangle(0, vmargin, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], vmargin, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1],
vmargin, blockWidth[2], segmentedItemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3,
- vmargin, blockWidth[3] + 1, segmentedItemHeight));
+ __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2],
+ vmargin, blockWidth[3], segmentedItemHeight));
}
else
{
- blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width + leftMargin - dividerWidth * 3) / 4;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width + leftMargin) / 4;
__pItems.at(0)->SetBounds(FloatRectangle(0, vmargin, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0] + dividerWidth, vmargin, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], vmargin, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1],
vmargin, blockWidth[2], segmentedItemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3,
+ __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2],
vmargin, blockWidth[3], segmentedItemHeight));
}
float rightMargin = 0.0f;
float footerLeftMargin = 0.0f;
float iconSize = 0.0f;
- float dividerWidth = 0.0f;
float blockWidth[__itemCount];
float fontSize = 0.0f;
float multilineFontSize = 0.0f;
float itemButtonLeftGap = 0.0f;
float itemButtonRightGap = 0.0f;
+ float dividerWidth = 0.0f;
+
+
GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), leftMargin);
GET_SHAPE_CONFIG(FOOTER::LEFT_MARGIN, GetOrientation(), footerLeftMargin);
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_ICON_SIZE, GetOrientation(), iconSize);
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth * 2, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth * 2, segmentedItemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
}
}
else
itemButtonLeftGap = 0;
}
- blockWidth[0] = blockWidth[1] = (__itemArea.width - dividerWidth) / 2;
+ blockWidth[0] = blockWidth[1] = __itemArea.width / 2;
if (__pButtonItems[LEFT_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] - dividerWidth, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] - dividerWidth, segmentedItemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] + 1, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] + 1, segmentedItemHeight));
}
}
else
if (__pButtonItems[RIGHT_BUTTON])
{
__pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] - dividerWidth, segmentedItemHeight));
}
else
{
__pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1] + 1, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
}
}
itemButtonLeftGap = 0;
}
- blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - dividerWidth * 2) / 3;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = __itemArea.width / 3;
+ blockWidth[1] += 1;
if (__pButtonItems[LEFT_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] - dividerWidth, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] - 1,
+ (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] - dividerWidth + 1, segmentedItemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2],
(GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] + 2, segmentedItemHeight));
}
}
if (__pButtonItems[RIGHT_BUTTON])
{
__pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] - dividerWidth, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(__itemArea.width - blockWidth[2],
+ (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] - dividerWidth + 1, segmentedItemHeight));
}
else
{
__pItems.at(0)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] + 2, segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2],
+ (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2] + 1, segmentedItemHeight));
}
}
{
leftMargin = 0;
- blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = __itemArea.width / 4;
__pItems.at(0)->SetBounds(FloatRectangle(leftMargin, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(1)->SetBounds(FloatRectangle(leftMargin + blockWidth[0], (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1],
(GetSizeF().height - segmentedItemHeight) / 2, blockWidth[2], segmentedItemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3,
- (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[3] + 1, segmentedItemHeight));
+ __pItems.at(3)->SetBounds(FloatRectangle(leftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2],
+ (GetSizeF().height - segmentedItemHeight) / 2, blockWidth[3], segmentedItemHeight));
for (int i = 0; i < __itemCount ; i++)
{
float fontSize = 0.0f;
float multilineFontSize = 0.0f;
float segmentedItemHeight = 0.0f;
- float tabLeftMargin = 0.0f;
float vmargin = 0.0f;
- float dividerWidth = 0.0f;
-
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin);
- GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth);
if (__style == TOOLBAR_TAB || __style == TOOLBAR_TAB_LARGE)
{
if (__itemCount == 1)
{
- itemWidth[0] = __itemArea.width - tabLeftMargin * 2;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight));
+ itemWidth[0] = __itemArea.width;
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, vmargin, itemWidth[0], segmentedItemHeight));
GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE, GetOrientation(), fontSize); // 30
}
else if (__itemCount == 2)
{
- itemWidth[0] = itemWidth[1] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth) / 2;
+ itemWidth[0] = itemWidth[1] = __itemArea.width / 2;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1] + 1, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, vmargin, itemWidth[0], segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(itemWidth[0], vmargin, itemWidth[1], segmentedItemHeight));
GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE, GetOrientation(), fontSize); // 30
}
else if (__itemCount == 3)
{
- itemWidth[0] = itemWidth[1] = itemWidth[2] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth * 2) / 3;
+ itemWidth[0] = itemWidth[1] = itemWidth[2] = __itemArea.width / 3;
+ itemWidth[1] += 1;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + dividerWidth * 2, vmargin, itemWidth[2] + 2, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, vmargin, itemWidth[0], segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(itemWidth[0], vmargin, itemWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(__itemArea.width - itemWidth[2], vmargin, itemWidth[2] + 1, segmentedItemHeight));
GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_3_ITEM, GetOrientation(), fontSize); // 26
}
else
{
- itemWidth[0] = itemWidth[1] = itemWidth[2] = itemWidth[3] = (__itemArea.width - tabLeftMargin * 2 - dividerWidth * 3) / 4;
+ itemWidth[0] = itemWidth[1] = itemWidth[2] = itemWidth[3] = __itemArea.width / 4;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, vmargin, itemWidth[0], segmentedItemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + dividerWidth, vmargin, itemWidth[1], segmentedItemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + dividerWidth * 2,
- vmargin, itemWidth[2], segmentedItemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + itemWidth[0] + itemWidth[1] + itemWidth[2] + dividerWidth * 3,
- vmargin, itemWidth[3] + 1, segmentedItemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, vmargin, itemWidth[0], segmentedItemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(itemWidth[0], vmargin, itemWidth[1], segmentedItemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(itemWidth[0] + itemWidth[1], vmargin, itemWidth[2], segmentedItemHeight));
+ __pItems.at(3)->SetBounds(FloatRectangle(itemWidth[0] + itemWidth[1] + itemWidth[2], vmargin, itemWidth[3], segmentedItemHeight));
GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_4_ITEM, GetOrientation(), fontSize); // 24
GET_SHAPE_CONFIG(HEADER::TAB_ITEM_FONT_SIZE_4_ITEM, GetOrientation(), multilineFontSize); // 24
{
itemWidth[i] = itemWidth[0];
- __pItems.at(i)->SetBounds(FloatRectangle(__pItems.at(i-1)->GetBoundsF().x + dividerWidth + itemWidth[i], vmargin, itemWidth[i], segmentedItemHeight));
+ __pItems.at(i)->SetBounds(FloatRectangle(__pItems.at(i-1)->GetBoundsF().x + itemWidth[i], vmargin, itemWidth[i], segmentedItemHeight));
}
for (int i = 0; i < __itemCount ; i++)
float sideMargin = 0.0f;
float itemButtonLeftGap = 0.0f;
float itemButtonRightGap = 0.0f;
- float tabLeftMargin = 0.0f;
- float dividerWidth = 0.0f;
float iconSize = 0.0f;
float footerLeftMargin = 0.0f;
float segmentedItemHeight = 0.0f;
float blockWidth[__itemCount];
float fontSize = 0.0f;
float multilineFontSize = 0.0f;
+ float dividerWidth = 0.0f;
- GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth);
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_ICON_SIZE, GetOrientation(), iconSize);
GET_SHAPE_CONFIG(FOOTER::LEFT_MARGIN, GetOrientation(), footerLeftMargin);
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, GetOrientation(), tabLeftMargin);
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_BUTTON_STYLE_SIDE_MARGIN, GetOrientation(), sideMargin);
GET_SHAPE_CONFIG(HEADER::SEGMENTED_ITEM_HEIGHT, GetOrientation(), segmentedItemHeight);
GET_SHAPE_CONFIG(HEADER::LEFT_MARGIN, GetOrientation(), headerLeftMargin);
-
- float tabRightMargin = tabLeftMargin;
+ GET_SHAPE_CONFIG(HEADER::DIVIDER_WIDTH, GetOrientation(), dividerWidth);
itemHeight = GetSizeF().height;
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2);
+ __itemArea.width -= ((footerLeftMargin + iconSize + itemButtonLeftGap) * 2);
}
else
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + iconSize + itemButtonLeftGap + tabRightMargin);
+ __itemArea.width -= (footerLeftMargin + iconSize + itemButtonLeftGap);
}
}
else
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabRightMargin = footerLeftMargin;
itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ __itemArea.width -= (itemButtonRightGap + iconSize + footerLeftMargin);
}
-
- iconSize = 0;
}
blockWidth[0] = __itemArea.width;
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth * 2, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth * 2, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
}
}
else
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
}
}
}
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2);
+ __itemArea.width -= ((footerLeftMargin + iconSize + itemButtonLeftGap) * 2);
}
else
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + iconSize + itemButtonLeftGap + tabRightMargin);
+ __itemArea.width -= (footerLeftMargin + iconSize + itemButtonLeftGap);
}
}
else
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabRightMargin = footerLeftMargin;
itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ __itemArea.width -= (itemButtonRightGap + iconSize + footerLeftMargin);
}
-
- iconSize = 0;
}
- blockWidth[0] = blockWidth[1] = (__itemArea.width - dividerWidth * 1) / 2;
+ blockWidth[0] = blockWidth[1] = __itemArea.width / 2;
if (__pButtonItems[LEFT_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1] - dividerWidth, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1] + 1, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1] + 1, itemHeight));
}
}
else
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1] - dividerWidth, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1] + 1, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
}
}
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2);
+ __itemArea.width -= ((footerLeftMargin + iconSize + itemButtonLeftGap) * 2);
}
else
{
- tabLeftMargin = footerLeftMargin;
itemButtonLeftGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + iconSize + itemButtonLeftGap + tabRightMargin);
+ __itemArea.width -= (footerLeftMargin + iconSize + itemButtonLeftGap);
}
}
else
{
if (__pButtonItems[RIGHT_BUTTON])
{
- tabRightMargin = footerLeftMargin;
itemButtonRightGap = footerLeftMargin;
- __itemArea.width -= (tabLeftMargin + itemButtonRightGap + iconSize + tabRightMargin);
+ __itemArea.width -= (itemButtonRightGap + iconSize + footerLeftMargin);
}
else
{
- __itemArea.width -= tabLeftMargin * 2;
+ ;//empty
}
-
- iconSize = 0;
}
- blockWidth[0] = blockWidth[1] = blockWidth[2] = (__itemArea.width - dividerWidth * 2) / 3;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = __itemArea.width / 3;
+ blockWidth[1] += 1;
if (__pButtonItems[LEFT_BUTTON])
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - itemHeight) / 2, blockWidth[2] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] - 1,
+ (GetSizeF().height - itemHeight) / 2, blockWidth[2] - dividerWidth + 1, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(dividerWidth + tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(0)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[0] - dividerWidth, itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(footerLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2],
(GetSizeF().height - itemHeight) / 2, blockWidth[2] + 2, itemHeight));
}
}
{
if (__pButtonItems[RIGHT_BUTTON])
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - itemHeight) / 2, blockWidth[2] - dividerWidth, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(__itemArea.width - blockWidth[2],
+ (GetSizeF().height - itemHeight) / 2, blockWidth[2] - dividerWidth + 1, itemHeight));
}
else
{
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + iconSize + itemButtonLeftGap + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
- (GetSizeF().height - itemHeight) / 2, blockWidth[2] + 2, itemHeight));
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(GetSizeF().width - blockWidth[2],
+ (GetSizeF().height - itemHeight) / 2, blockWidth[2] + 1, itemHeight));
}
}
}
else if (__itemCount == 4)
{
- __itemArea.width -= tabLeftMargin * 2;
-
- blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = (__itemArea.width - dividerWidth * 3) / 4;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = __itemArea.width / 4;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1],
(GetSizeF().height - itemHeight) / 2, blockWidth[2], itemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3,
- (GetSizeF().height - itemHeight) / 2, blockWidth[3] + 1, itemHeight));
+ __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2],
+ (GetSizeF().height - itemHeight) / 2, blockWidth[3], itemHeight));
for (int i = 0; i < __itemCount; i++)
{
}
else if (__itemCount == 5)
{
- __itemArea.width -= tabLeftMargin * 2;
-
- blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = blockWidth[4] = (__itemArea.width - dividerWidth * 4) / 5;
+ blockWidth[0] = blockWidth[1] = blockWidth[2] = blockWidth[3] = blockWidth[4] = __itemArea.width / 5;
- __pItems.at(0)->SetBounds(FloatRectangle(tabLeftMargin, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
- __pItems.at(1)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + dividerWidth, (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
- __pItems.at(2)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + dividerWidth * 2,
+ __pItems.at(0)->SetBounds(FloatRectangle(0.0f, (GetSizeF().height - itemHeight) / 2, blockWidth[0], itemHeight));
+ __pItems.at(1)->SetBounds(FloatRectangle(blockWidth[0], (GetSizeF().height - itemHeight) / 2, blockWidth[1], itemHeight));
+ __pItems.at(2)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1],
(GetSizeF().height - itemHeight) / 2, blockWidth[2], itemHeight));
- __pItems.at(3)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + dividerWidth * 3,
+ __pItems.at(3)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2],
(GetSizeF().height - itemHeight) / 2, blockWidth[3], itemHeight));
- __pItems.at(4)->SetBounds(FloatRectangle(tabLeftMargin + blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3] + dividerWidth * 4,
- (GetSizeF().height - itemHeight) / 2, blockWidth[4] + 1, itemHeight));
+ __pItems.at(4)->SetBounds(FloatRectangle(blockWidth[0] + blockWidth[1] + blockWidth[2] + blockWidth[3],
+ (GetSizeF().height - itemHeight) / 2, blockWidth[4], itemHeight));
for (int i = 0; i < __itemCount; i++)
{
{
__pButtonItems[LEFT_BUTTON]->AttachChild(*__pAnimation[animationPos]);
- float topTouchMargin = __pButtonItems[LEFT_BUTTON]->GetTopTouchMarginF();
- float bottomTouchMargin = __pButtonItems[LEFT_BUTTON]->GetBottomTouchMarginF();
-
SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_LEFT,
(__pButtonItems[LEFT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2,
- topTouchMargin + (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2);
+ (__pButtonItems[LEFT_BUTTON]->GetSizeF().height - processingAnimationIconSize) / 2);
}
else if (animationPos == TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT)
{
__pButtonItems[RIGHT_BUTTON]->AttachChild(*__pAnimation[animationPos]);
- float topTouchMargin = __pButtonItems[RIGHT_BUTTON]->GetTopTouchMarginF();
- float bottomTouchMargin = __pButtonItems[RIGHT_BUTTON]->GetBottomTouchMarginF();
-
SetWaitingAnimationPosition(TOOLBAR_ANIMATION_POSITION_BUTTON_RIGHT,
(__pButtonItems[RIGHT_BUTTON]->GetSizeF().width - processingAnimationIconSize) / 2,
- topTouchMargin + (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - topTouchMargin - bottomTouchMargin - processingAnimationIconSize) / 2);
+ (__pButtonItems[RIGHT_BUTTON]->GetSizeF().height - processingAnimationIconSize) / 2);
}
_AccessibilityContainer* pContainer = __pAnimation[animationPos]->GetAccessibilityContainer();
if (pContainer)
{
FloatRectangle bounds = __pButtonItems[position]->GetBoundsF();
- float leftTouchMargin = __pButtonItems[position]->GetLeftTouchMarginF();
- float topTouchMargin = __pButtonItems[position]->GetTopTouchMarginF();
- float rightTouchMargin = __pButtonItems[position]->GetRightTouchMarginF();
- float bottomTouchMargin = __pButtonItems[position]->GetBottomTouchMarginF();
-
- bounds.x = bounds.x + leftTouchMargin;
- bounds.y = bounds.y + topTouchMargin;
- bounds.width = bounds.width - (leftTouchMargin + rightTouchMargin);
- bounds.height = bounds.height - (topTouchMargin + bottomTouchMargin);
-
return bounds;
}
pCanvas->SetBackgroundColor(backgroundColor);
pCanvas->Clear();
+ //buttonItem Divider
if (style == TOOLBAR_TITLE || style == TOOLBAR_HEADER_SEGMENTED)
{
if (__pToolbar->GetButton(RIGHT_BUTTON))
{
if (__pToolbar->GetButton(LEFT_BUTTON))
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap
- - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
}
else
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
}
}
{
if (__pToolbar->GetButton(LEFT_BUTTON))
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
}
}
{
if (__pToolbar->GetButton(LEFT_BUTTON))
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap
- - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
}
else
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
}
}
{
if (__pToolbar->GetButton(LEFT_BUTTON))
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
}
}
}
+ else if (style == TOOLBAR_TAB_WITH_TITLE)
+ {
+ if (__pToolbar->GetButton(RIGHT_BUTTON))
+ {
+ if (__pToolbar->GetButton(LEFT_BUTTON))
+ {
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
+ (dividerTopMargin - dividerHeight) / 2), pCanvas);
+
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap
+ - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
+ (dividerTopMargin - dividerHeight) / 2), pCanvas);
+ }
+ else
+ {
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
+ (dividerTopMargin - dividerHeight) / 2), pCanvas);
+ }
+ }
+ else
+ {
+ if (__pToolbar->GetButton(LEFT_BUTTON))
+ {
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
+ (dividerTopMargin - dividerHeight) / 2), pCanvas);
+ }
+ }
+ }
else if (style == TOOLBAR_SEGMENTED || style == TOOLBAR_TEXT || style == TOOLBAR_ICON || style == TOOLBAR_ICON_TEXT || style == TOOLBAR_COMMAND)
{
if (__pToolbar->GetButton(RIGHT_BUTTON))
{
- DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap,
+ DrawDividerLine(FloatPoint(bounds.width - __pToolbar->GetButton(RIGHT_BUTTON)->GetBoundsF().width - buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
}
if (__pToolbar->GetButton(LEFT_BUTTON))
{
- DrawDividerLine(FloatPoint(__pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width,
+ DrawDividerLine(FloatPoint(__pToolbar->GetButton(LEFT_BUTTON)->GetBoundsF().width + buttonItemGap / 2,
(__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
}
}
+ // Headeritem, FooterItemDivider
if (itemCount == 1)
{
; // empty
{
for (int i = 0; i < itemCount - 1 ; i++)
{
- DrawDividerLine(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width,
- dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
+ if (i < itemCount - 2)
+ {
+ DrawDividerLine(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width,
+ dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
+ }
+ else // i == (itemCount - 2)
+ {
+ DrawDividerLine(FloatPoint(__pToolbar->GetItem(i + 1)->GetBoundsF().x,
+ dividerTopMargin + (dividerBaseHeight - dividerHeight) / 2), pCanvas);
+ }
}
}
else
{
for (int i = 0; i < itemCount - 1 ; i++)
{
- DrawDividerLine(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width,
- (__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
+ if (i < itemCount - 2)
+ {
+ DrawDividerLine(FloatPoint(__pToolbar->GetItem(i)->GetBoundsF().x + __pToolbar->GetItem(i)->GetBoundsF().width,
+ (__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
+ }
+ else // i == (itemCount - 2)
+ {
+ DrawDividerLine(FloatPoint(__pToolbar->GetItem(i + 1)->GetBoundsF().x,
+ (__pToolbar->GetBoundsF().height - dividerHeight) / 2), pCanvas);
+ }
}
}
}
_Label* pTitleBadgeIcon = __pToolbar->GetTitleBadgeIcon();
float iconWidth = 0.0f;
+ float iconRightMargin = 0.0f;
float titleDisplayHeight = 0.0f;
float leftMargin = 0.0f;
float headerTopMargin = 0.0f;
}
GET_SHAPE_CONFIG(HEADER::ICON_WIDTH, __pToolbar->GetOrientation(), iconWidth);
+ GET_SHAPE_CONFIG(HEADER::ICON_RIGHT_MARGIN, __pToolbar->GetOrientation(), iconRightMargin);
if (!__titleText.IsEmpty())
{
{
pCanvas->DrawBitmap(FloatPoint(usableArea.x, headerTopMargin + (titleDisplayHeight - pTitleIcon->GetHeightF()) / 2), *(pTitleIcon));
- __titleRect.x = usableArea.x + pTitleIcon->GetWidthF() + usableArea.x;
+ __titleRect.x = usableArea.x + pTitleIcon->GetWidthF() + iconRightMargin;
__titleRect.y = headerTopMargin + (titleDisplayHeight - titleHeight) / 2;
if (__pToolbar->GetWaitingAnimationStatus(TOOLBAR_ANIMATION_POSITION_TITLE) != ANIMATION_STOPPED)
if (pTitleIcon)
{
- __titleRect.x = leftMargin + pTitleIcon->GetWidthF() + leftMargin;
+ __titleRect.x = leftMargin + pTitleIcon->GetWidthF() + iconRightMargin;
__titleRect.y = headerTopMargin + (titleDisplayHeight - titleHeight) / 2;
if(__pTitleTextObject->GetAlignment() & TEXT_OBJECT_ALIGNMENT_CENTER)
__touchInitiatedInToolbar = false;
int releasedItemIndex = __pToolbar->GetItemIndexFromPosition(touchPoint);
- float tabLeftMargin = 0.0f;
-
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin);
if ((style == TOOLBAR_TAB || style == TOOLBAR_TAB_WITH_TITLE || style == TOOLBAR_TAB_LARGE) && __beingEdited == true)
{
{
__pToolbar->MoveItem(__editItemIndex, releasedItemIndex);
- AdjustItemPositionX(-__pToolbar->GetItem(__firstLoadedItemIndex)->GetBoundsF().x + tabLeftMargin); // move auto focus
+ AdjustItemPositionX(-__pToolbar->GetItem(__firstLoadedItemIndex)->GetBoundsF().x); // move auto focus
if (__pEditItem)
{
if (__tabMoved)
{
float distance = (touchinfo.GetCurrentPosition()).x - __currentTouchPosition.x;
- float sideMargin = 0.0f;
-
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), sideMargin);
FloatRectangle clientBounds = __pToolbar->GetBoundsF();
itemBounds = pItem->GetBoundsF();
- if (itemBounds.x + distance >= sideMargin && !__beingEdited)
+ if (itemBounds.x + distance >= 0.0f && !__beingEdited)
{
- distance = sideMargin - itemBounds.x;
+ distance = 0.0f - itemBounds.x;
}
}
else if (distance < 0)
itemBounds = pItem->GetBoundsF();
- if (itemBounds.x + itemBounds.width + distance <= clientBounds.width - sideMargin && !__beingEdited)
+ if (itemBounds.x + itemBounds.width + distance <= clientBounds.width && !__beingEdited)
{
- distance = (clientBounds.width - sideMargin) - (itemBounds.x + itemBounds.width);
+ distance = clientBounds.width - (itemBounds.x + itemBounds.width);
}
}
+
if (__beingEdited)
{
- float tabLeftMargin = 0.0f;
-
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin);
-
if (distance > 0) // right move
{
__tabSlideRight = false;
__tabSlideLeft = true;
}
- if (__tabSlideLeft && __pToolbar->GetItem(itemCount-1)->GetBoundsF().x + __pToolbar->GetItem(itemCount-1)->GetBoundsF().width > clientBounds.width - tabLeftMargin)
+ if (__tabSlideLeft && __pToolbar->GetItem(itemCount-1)->GetBoundsF().x + __pToolbar->GetItem(itemCount-1)->GetBoundsF().width > clientBounds.width)
{
AdjustItemPositionX(-distance * 5); // move auto focus
}
__tabSlideRight = true;
}
- if (__tabSlideRight && __pToolbar->GetItem(0)->GetBoundsF().x < tabLeftMargin)
+ if (__tabSlideRight && __pToolbar->GetItem(0)->GetBoundsF().x < 0.0f)
{
AdjustItemPositionX(-distance * 5); // move auto focus
}
int itemCount = __pToolbar->GetItemCount();
_Button* pItem = __pToolbar->GetItem(index);
+ FloatRectangle itemBounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+ if (itemCount < 5)
+ {
+ return E_SUCCESS;
+ }
+ if (distance > 0)
+ {
+ itemBounds = __pToolbar->GetItem(0)->GetBoundsF();
+ if (itemBounds.x + distance > 0.0f)
+ {
+ distance = itemBounds.x - distance;
+ }
+ }
+ else
+ {
+ itemBounds = __pToolbar->GetItem(itemCount - 4)->GetBoundsF();
+ if (itemBounds.x + distance < 0.0f)
+ {
+ distance = itemBounds.x - distance;
+ }
+ }
+
while (pItem != null)
{
FloatRectangle bounds = pItem->GetBoundsF();
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
float fitDistance = 0.0f;
- float tabLeftMargin = 0.0f;
int itemCount = __pToolbar->GetItemCount();
- GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), tabLeftMargin);
-
_Button* pItem = __pToolbar->GetItem(index);
SysTryReturnVoidResult(NID_UI_CTRL, pItem, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
bounds = pItem->GetBoundsF();
- fitDistance = -bounds.x + tabLeftMargin;
+ fitDistance = -bounds.x;
for (int i = 0; i < itemCount; i++)
{
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
- EGL_DEPTH_SIZE, 0,
+ EGL_DEPTH_SIZE, 8,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_NONE
namespace Tizen { namespace Ui { namespace Animations
{
+class _EflLayerConfiguration;
class _OSP_EXPORT_ _EflLayer
- : public _NativeLayer
+ : public _NativeLayer
{
public:
_EflLayer(void);
void SetOpacity(float opacity);
float GetOpacity(void);
- result SetRotation(int angle);
+ result SetOrientationChanged(void);
result SetInternalBounds(void);
void SetOwner(_EflLayer* pOwner);
return _needRender;
}
+ void SetMapped(bool map)
+ {
+ _isMapped = map;
+ }
+
protected:
result Initialize(Evas_Object* pWindow);
virtual result Configure(_RootVisualElement& rootElement);
bool _needAsyncVisibilityChangeRequest;
bool _isMainType;
bool _needRender;
+ bool _isMapped;
+ bool _needForceManualRender;
static int _countOfLayer;
Ecore_Event_Handler* _pOnWindowDamagedHandler;
Ecore_Event_Handler* _pOnWindowConfiguredHandler;
Ecore_Event_Handler* _pOnWindowHideHandler;
Ecore_Event_Handler* _pOnWindowShowHandler;
-
private:
bool __isWinObject;
Tizen::Graphics::FloatRectangle __bounds;
+ _EflLayerConfiguration* _pConfiguration;
};
}}} //namespace Tizen { namespace Ui { namespace Animations
--- /dev/null
+//
+// 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 FUiAnim_EflLayerConfiguration.h
+ * @brief This is the header file for the _EflLayerConfiguration class.
+ *
+ * This header file contains the declarations of the _EflLayerConfiguration class.
+ */
+
+#ifndef _FUI_ANIM_INTERNAL_EFL_LAYER_CONFIGURATION_H_
+#define _FUI_ANIM_INTERNAL_EFL_LAYER_CONFIGURATION_H_
+
+namespace Tizen { namespace Ui { namespace Animations
+{
+
+class _EflLayerConfiguration
+{
+public:
+ static _EflLayerConfiguration* GetInstance(void);
+ void ReleaseInstance(void);
+ void ApplyCustomizedConfig(void* pWin);
+
+private:
+ _EflLayerConfiguration(void);
+ ~_EflLayerConfiguration(void);
+ int __refCount;
+}; // class _EflLayerConfiguration
+
+}}} //namespace Tizen { namespace Ui { namespace Animations
+
+#endif //_FUI_ANIM_INTERNAL_EFL_LAYER_CONFIGURATION_H_
int GetRightMargin(void) const;
int GetBottomMargin(void) const;
- result SetTouchMargin(int leftTouchMargin, int topTouchMargin, int rightTouchMargin, int bottomTouchMargin);
- int GetLeftTouchMargin(void) const;
- int GetTopTouchMargin(void) const;
- int GetRightTouchMargin(void) const;
- int GetBottomTouchMargin(void) const;
-
result SetMargin(float leftMargin, float topMargin, float rightMargin, float bottomMargin);
float GetLeftMarginF(void) const;
float GetTopMarginF(void) const;
float GetRightMarginF(void) const;
float GetBottomMarginF(void) const;
- result SetTouchMargin(float leftTouchMargin, float topTouchMargin, float rightTouchMargin, float bottomTouchMargin);
- float GetLeftTouchMarginF(void) const;
- float GetTopTouchMarginF(void) const;
- float GetRightTouchMarginF(void) const;
- float GetBottomTouchMarginF(void) const;
-
Tizen::Graphics::FloatDimension GetContentSizeInternalF(bool horizontalMode, bool verticalMode) const;
int GetTextExtentSize(void) const;
float GetTextExtentSizeF(void) const;
float __rightMargin;
float __bottomMargin;
- float __leftTouchMargin;
- float __topTouchMargin;
- float __rightTouchMargin;
- float __bottomTouchMargin;
-
Tizen::Graphics::FloatRectangle __userDefinedTextArea;
Tizen::Ui::_AccessibilityElement* __pTextElement;
bool IsEnabledStateChanged(void);
- result TimerForTitleSlideInit(void);
- result TimerForTitleSlideStart(void);
- result TimerForTitleSlideTimeout(void);
+ result TimerForTextSlideInit(void);
+ result TimerForTextSlideStart(void);
+ result TimerForTextSlideTimeout(void);
private:
_Button* __pButton;
Tizen::Base::Runtime::Timer* __pTextSlideTimer;
Tizen::Graphics::FloatRectangle __textRect;
- Tizen::Graphics::Bitmap* __pTabLargeSelectedBitmap;
+ Tizen::Graphics::Bitmap* __pTextSlideClippedBitmap;
}; // _ButtonPresenter
}}} // Tizen::Ui::Controls
Tizen::Graphics::Bitmap* GetCircleNormalEffectBitmap(void) const;
Tizen::Graphics::Bitmap* GetCirclePressedEffectBitmap(void) const;
+ Tizen::Graphics::Bitmap* GetDetailedRightNormalEffectBitmap(void) const;
+ Tizen::Graphics::Bitmap* GetDetailedRightPressedEffectBitmap(void) const;
+
Tizen::Graphics::Bitmap* GetBackgroundBitmap(GroupStyle groupStyle, _CheckButtonStatus checkButtonStatus) const;
Tizen::Graphics::Bitmap* GetBackgroundNormalEffectBitmap(GroupStyle groupStyle) const;
Tizen::Graphics::Bitmap* GetBackgroundPressedEffectBitmap(GroupStyle groupStyle) const;
Tizen::Graphics::Bitmap* __pCirclePressedEffectBitmap;
Tizen::Graphics::Bitmap* __pDetailedRightBitmap[NUMBER_OF_CHECK_BUTTON_STATUS];
+ Tizen::Graphics::Bitmap* __pDetailedRightNormalEffectBitmap;
+ Tizen::Graphics::Bitmap* __pDetailedRightPressedEffectBitmap;
Tizen::Graphics::Bitmap* __pBackgroundBitmap[NUMBER_OF_CHECK_BUTTON_STATUS];
Tizen::Graphics::Bitmap* __pBackgroundNormalEffectBitmap;
void SetParentWindowBounds(Tizen::Graphics::FloatRectangle& parentWindowBounds);
Tizen::Graphics::FloatRectangle GetParentWindowBounds() const;
void RefreshItems(void);
+ void RemoveAllAnimations(void);
virtual bool OnFocusGained(const _Control &source);
virtual bool OnFocusLost(const _Control &source);
Tizen::Base::Collection::LinkedListT<Tizen::Ui::_AccessibilityElement*> __accessibilityElements;
+ bool __isInFocusMode;
+
}; // _DateTimePicker
}}} // Tizen::Ui::Controls
bool __needToReleaseBlock;
bool __isHandlerMoving;
Tizen::Graphics::FloatRectangle __editVisibleArea;
+ _Window* __pParentWindow;
+ bool __parentWindowClipFlagChanged;
}; // _EditCopyPasteManager
}}} // Tizen::Ui::Controls
virtual void OnSettingChanged(Tizen::Base::String& key);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnFocusGained(const _Control& source);
virtual bool OnFocusLost(const _Control& source);
virtual bool OnFocusLost(const _Control& source);
void OnFocusModeStateChanged(void);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
-
+ virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
bool IsUsbKeyboardConnected(void) const;
bool IsCurrentFocused(void);
bool InitializeFocusedCondition(void);
+ void SetSentKeypadEvent(CoreKeypadEventStatus sentKeypadEvent);
+ CoreKeypadEventStatus GetLastSentKeypadEvent(void);
result AppendCharacter(const Tizen::Base::Character& character);
result AppendText(const Tizen::Base::String& text);
_InputConnectionImpl* __pInputConnection;
bool __isInputConnectionBound;
+ CoreKeypadEventStatus __sentKeypadEvent;
_Clipboard* __pClipboard;
virtual void OnSettingChanged(Tizen::Base::String& key);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
bool OnFocusGained(const _Control& source);
bool OnFocusLost(const _Control& source);
virtual void OnFocusModeStateChanged(void);
bool GetAmEnabled(void) const;
result Draw(void);
- void Animate(void);
+ void Animate(void);
void SetFocusedElement(void);
void SetFocusState(bool isFocused);
bool OnFocusLost(const _Control& source);
void OnFocusModeStateChanged(void);
bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
virtual void OnBoundsChanged(void);
virtual void OnSettingChanged(Tizen::Base::String& key);
- virtual void OnDrawFocus(void);
virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
- virtual void OnDrawFocus(void);
bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_X.h>
+#include <Ecore_Evas.h>
#include <FBaseDataType.h>
#include <FBaseByteBuffer.h>
private:
const static int _OVERLAYAGENT_XV_PORT = 100;
+ class _OverlayVisualElement
+ : public Tizen::Ui::Animations::_VisualElement
+ , public Tizen::Base::Runtime::ITimerEventListener
+ {
+ public:
+ _OverlayVisualElement(void);
+ _OverlayVisualElement(const _OverlayVisualElement& rhs);
+
+ result Construct(void);
+ Evas_Object* GetImageObject(void) const;
+ void SetImageObject(Evas_Object* pImageObject);
+ void SetImageObjectShowStateChanged(void);
+
+ private:
+ void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
+
+ virtual ~_OverlayVisualElement(void);
+ virtual VisualElement* CloneN(void) const;
+
+ static void OnImageObjectShown(void* pData, Evas *pEvas, Evas_Object *pImageObject, void *event_info);
+ static void OnImageObjectHidden(void* pData, Evas *pEvas, Evas_Object *pImageObject, void *event_info);
+
+ private:
+ Tizen::Base::Runtime::Timer* __pTimer;
+ Evas_Object* __pImageObject;
+ bool __showStateChanged;
+ };
+
//VisualElements
+ _OverlayVisualElement* __pRendererVE;
Tizen::Ui::Animations::_VisualElement* __pParentVE;
- Tizen::Ui::Animations::_VisualElement* __pRendererVE;
//Renderer property
Evas_Object* __pImageObject;
result GetBackgroundBufferInfo(Tizen::Graphics::BufferInfo& bufferInfo) const;
Tizen::Graphics::Color GetMaskingColor(void) const;
+ virtual result OnAttachedToMainTree(void);
virtual void OnChangeLayout(_ControlOrientation orientation);
virtual const char* GetPublicClassName(void) const;
_OverlayPanelImpl(const _OverlayPanelImpl& rhs);
_OverlayPanelImpl& operator=(const _OverlayPanelImpl& rhs);
+ void SetChildBuilderBounds(Tizen::Ui::_ContainerImpl* pContainerImpl, Tizen::Ui::_ControlOrientation controlOrientation);
+
private:
static bool __overlayPanelPixelFomatList[];
}; // _OverlayPanelImpl
virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
virtual void OnBoundsChanged(void);
- virtual void OnDrawFocus(void);
virtual bool IsLayoutChangable(void) const;
virtual void OnOwnerChanged(_Control* pOldOwner);
virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
bool __init;
bool __callBoundsChange;
Tizen::Graphics::FloatPoint __prevPos;
+ bool __boundsChangedInternally;
+ bool __boundsChangedExternally;
}; // _PopupImpl
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual void OnSettingChanged(Tizen::Base::String& key);
- virtual void OnDrawFocus(void);
-
public:
result AddProgressPopupEventListener(const Tizen::Ui::Controls::_IProgressPopupEventListener& listener);
void SetHorizontalScrollPosition(float position);
float CalculatePagingScrollPosition(float position) const;
+ void StopScrollBarLoadEffectTimer(void);
protected:
// Update Layout
// scroll bar load effect
void DoScrollBarLoadEffect(void);
void StartScrollBarLoadEffectTimer(void);
- void StopScrollBarLoadEffectTimer(void);
// Flick
float CalculateFlickAmount(float flickDistance, float flickDuration);
Tizen::Graphics::Dimension GetContentAreaSize(void) const;
SearchBarMode GetMode(void) const;
bool IsModeLocked(void) const;
- result SetMode(SearchBarMode mode);
+ result SetMode(SearchBarMode mode, bool isCalledByApp = false);
result SetModeLocked(bool modeLocked);
int GetButtonActionId(void) const;
Tizen::Graphics::Color GetButtonColor(SearchBarButtonStatus status) const;
bool IsFocusCallbackToBeFired(void) const;
virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
+ virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
virtual bool OnFocusGained(const _Control& source);
virtual bool OnFocusLost(const _Control& source);
virtual void OnDrawFocus(void);
- virtual void OnFocusModeStateChanged(void);
virtual bool IsChildControlFocusManage(void) const;
virtual bool OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
bool __isFocusCallbackToBeFired;
bool __isButtonTextChangedByApp;
bool __contentVisibilitySetByApp;
- bool __isInFocusMode;
bool __isFocusUiInitialized;
CoreKeypadAction __keypadAction;
// Operations
result Construct(const _SearchBar& searchBar);
result Install(void);
-
- /**
- * Updates the content area of the SearchBar control.
- *
- * @since 2.0
- * @return An error code
- * @param[in] invalidate A Boolean flag indicating whether to perform invalidate on the content area.
- * @exception E_SUCCESS The method was successful.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
- * -- the current mode of SearchBar prohibits the execution of the method. @n
- * @exception E_SYSTEM A system error occurred.
- * @remarks The method performs Invalidate() on the content area.
- */
result UpdateContentArea(bool invalidate = true);
- /**
- * Sets the visibility state of the content area.
- *
- * @since 2.0
- * @return An error code
- * @param[in] visible The visibility state of the content area.
- * @exception E_SUCCESS The method was successful.
- * @exception E_SYSTEM A system error occurred.
- * @see IsContentAreaVisible()
- */
result SetContentAreaVisible(bool visible);
-
- /**
- * Checks whether the content area is visible.
- *
- * @since 2.0
- * @return The visibility state of the content area.
- * @exception E_SUCCESS The method was successful.
- * @see SetContentAreaVisible()
- */
bool IsContentAreaVisible(void) const;
-
- /**
- * Gets the search bar mode.
- *
- * @since 2.0
- * @return The search bar mode
- * @exception E_SUCCESS The method was successful.
- * @exception E_SYSTEM A system error occurred.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
- * @see SetMode()
- */
SearchBarMode GetMode(void) const;
- /**
- * Determines whether the search bar mode is locked.
- *
- * @since 2.0
- * @return @c true if the mode is locked, @n
- * else @c false
- * @exception E_SUCCESS The method was successful.
- * @exception E_SYSTEM A system error occurred.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
- * @see SetModeLock()
- */
bool IsModeLocked(void) const;
- /**
- * Sets the search bar mode.
- *
- * @since 2.0
- * @return An error code
- * @exception E_SUCCESS The method was successful.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or the mode is locked.
- * @exception E_SYSTEM A system error occurred.
- * @see GetMode()
- * @see SetModeLock()
- */
- result SetMode(SearchBarMode mode);
-
- /**
- * Locks or unlocks the search bar mode.
- *
- * @since 2.0
- * @return An error code
- * @param[in] modeLocked The mode lock
- * @exception E_SUCCESS The method was successful.
- * @exception E_SYSTEM A system error occurred.
- * @see GetMode()
- */
+ result SetMode(SearchBarMode mode, bool isCalledByApp = false);
result SetModeLocked(bool modeLocked);
-
- /**
- * Sets the visibility state of the header.
- *
- * @since 2.0
- * @param[in] visible The visibility state of the the header.
- */
void SetHeaderVisibleState(bool visible);
result Draw(void);
// callback
void OnBoundsChanged(void);
+ void OnTouchReleased(const _Control& source);
virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::FloatRectangle& bounds);
private:
result DrawIcon(void);
result DrawSearchBarDefaultBitmap(void);
- result ChangeMode(SearchBarMode mode);
+ result ChangeMode(SearchBarMode mode, bool isCalledByApp);
void InitializeInputModeLayout(void);
void InitializeViewModeLayout(void);
result LoadSearchBarBitmaps(void);
void OnFontChanged(Tizen::Graphics::Font* pFont);
void OnFontInfoRequested(unsigned long& style, float& size);
virtual void OnAncestorEnableStateChanged(const _Control& control);
+ virtual void OnAncestorVisibleStateChanged(const _Control& control);
static _SliderPresenter* CreateInstanceN(const _Slider& slider);
result SetThumbBitmap(SliderThumbStatus status, const Tizen::Graphics::Bitmap& bitmap);
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
+ //Focus
+ virtual bool OnFocusGained(const _Control& source);
+
// gestureListener Callback API
virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture);
virtual bool OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture);
bool IsReorderModeEnabled(void) const;
result SetReorderModeEnabled(bool enable);
+ //Restore list Focus
+ void RestoreFocus(bool isRestoreFocus);
+ void SetAnnexFocused(bool isAnnexFocused);
+ void SetTableViewFocused(bool focusStatus);
+ bool IsTableViewFocused(void);
+
_FastScroll* GetFastScrollBar(void) const;
result SetFastScrollIndex(const Tizen::Base::String& text, bool useSearchIcon);
virtual void OnDrawFocus(void);
virtual void OnFocusModeStateChanged(void);
+ //Enable/Visible state change
+ virtual void OnVisibleStateChanged(void);
+ virtual void OnAncestorEnableStateChanged(const _Control& control);
+ virtual void OnAncestorVisibleStateChanged(const _Control& control);
+ virtual void OnFocusableStateChanged(bool focusalbeState);
+
protected:
// Properties
result SetPropertyItemDividerColor(const Variant& itemDividerColor);
bool __reorderEnabled;
bool __sectionStyle;
bool __groupedLookEnable;
+
TableViewStyle __tableViewStyle;
TableViewScrollBarStyle __scrollStyle;
bool SetItemTapSoundEnabled(bool tapSoundEnabled);
bool GetItemTapSoundEnabled(void);
+ void DrawAnnexFocus(void);
+
virtual Tizen::Graphics::Canvas* OnCanvasRequestedN(const Tizen::Graphics::FloatRectangle& bounds);
+ //Enable/Visible state change
+ virtual void OnVisibleStateChanged(void);
+ virtual void OnAncestorEnableStateChanged(const _Control& control);
+ virtual void OnAncestorVisibleStateChanged(const _Control& control);
+ virtual void OnFocusableStateChanged(bool focusableState);
+
+ //Accessibility
+ void SetPublicLabelUpdate(bool resetPublicLabelUpdate);
+
protected:
_TableViewItem(float nItemHeight);
Tizen::Base::Collection::ArrayList __individualSelectionControls;
Tizen::Ui::_AccessibilityElement* __pAccessibilityElement;
+ Tizen::Ui::_AccessibilityElement* __pAccessibilityOnOffElement;
Tizen::Base::Runtime::Timer* __pPressedTimer;
Tizen::Base::Runtime::Timer* __pReleasedTimer;
bool __isSimpleLastItem;
bool __isTouchPressOnScroll;
+ bool __isTouchCancelOnPressRelease;
+
Tizen::Ui::Animations::_VisualElement* __pHighlightVisualElement;
Tizen::Ui::Animations::_VisualElement* __pBitmapVisualElement;
virtual void OnDrawFocus(void);
virtual void OnFocusModeStateChanged(void);
+ //Enable/Visible state change
+ void OnVisibleStateChanged(void);
+ void OnAncestorEnableStateChanged(const _Control& control);
+ void OnAncestorVisibleStateChanged(const _Control& control);
+ void OnFocusableStateChanged(bool focusableState);
+
void Dispose(void);
result RefreshTableView(int groupIndex, int itemIndex, TableViewRefreshType type, bool animation);
float GetLeftMargin(void) const;
result SetLeftMargin(float leftMargin);
+ //Restore Focus
+ void RestoreFocus(bool isRestoreFocus);
+ void SetAnnexFocused(bool isAnnexFocused);
+ void SetTableViewFocused(bool focusStatus);
+ bool IsTableViewFocused(void);
+
bool IsItemChecked(int groupIndex, int itemIndex) const;
result SetItemChecked(int groupIndex, int itemIndex, bool checked);
Tizen::Graphics::FloatPoint __sweptItemPosition;
TableViewItemTag __sweptItemTag;
+ TableViewItemTag __focusItemTag;
+
TableViewItemTag __reservedScrollItemIndex;
TableViewScrollItemAlignment __reservedScrollItemAlignment;
bool __isAnimationCallbackBlocked;
bool __lockLoadItemWithScroll;
+ bool __isRestoreFocus;
+ bool __isAnnexFocused;
+ bool __isTableViewFocused;
+
int __itemTouchReleasedEventState;
_TableViewScrollToItemTag __scrollToItemTag;
virtual result OnAttachedToMainTree(void);
virtual void OnDrawFocus(void);
virtual void OnFocusModeStateChanged(void);
- void RefreshFocusUi(void);
-
virtual void UpdateAccessibilityElement(EditAccessibilityElementType type);
_AccessibilityElement* GetTitleTextAccessibilityElement(void) const;
void SetStatusWithStringId(const char* id);
void SetValueWithStringId(const char* id);
+ void SetPublicLabelUpdate(bool isPublicLabelUpdated);
+ bool IsPublicLabelUpdated(void);
+
private:
_AccessibilityElement(const _AccessibilityElement& rhs);
_AccessibilityElement& operator =(const _AccessibilityElement& rhs);
bool __setHintByUser;
bool __disabledHint;
bool __updateContents;
+
+ bool __publicLabelUpdated;
};
}}
-#endif //_FUI_INTERNAL_ACCESSIBILITY_ELEMENT_H_
\ No newline at end of file
+#endif //_FUI_INTERNAL_ACCESSIBILITY_ELEMENT_H_
result SetFocused(bool on = true);
bool IsNativeObjectFocusable(void) const;
void SetNativeObjectFocusable(bool focusable);
+ void SetFocusWindowActivationChecked(bool isChecked);
+ bool IsFocusWindowActivationChecked(void);
// Focus UI
void SetPreviousFocus(_Control* pPreviousFocus);
Tizen::Graphics::FloatRectangle GetClientBoundsF(void) const;
Tizen::Graphics::Rectangle GetClientBounds(const Tizen::Graphics::Dimension& size) const;
Tizen::Graphics::FloatRectangle GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const;
- Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const;
- Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(void) const;
+ Tizen::Graphics::Rectangle GetAbsoluteBounds(bool recalcAlways = false) const;
+ Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(bool recalcAlways = false) const;
+ void InvalidateHierarchyAbsoluteBounds(void);
result SetClientBounds(const Tizen::Graphics::Rectangle& bounds);
result SetClientBounds(const Tizen::Graphics::FloatRectangle& bounds);
bool IsCalledSetClientBounds(void);
private:
bool __needRecalcRootWindow;
+ bool __needRecalcAbsBounds;
+ bool __needRecalcAbsBoundsF;
_Window* __pRootWindow;
_ControlHandle __controlHandle;
Tizen::Graphics::FloatRectangle __bounds;
Tizen::Graphics::FloatRectangle __contentAreaBounds;
Tizen::Graphics::FloatRectangle __clientBounds;
- Tizen::Graphics::FloatRectangle __absoluteBounds;
+ Tizen::Graphics::Rectangle __absoluteBounds;
+ Tizen::Graphics::FloatRectangle __absoluteBoundsF;
Tizen::Graphics::FloatRectangle __invalidatedBounds;
Tizen::Graphics::FloatDimension __minSize;
Tizen::Graphics::FloatDimension __maxSize;
bool __isCalledGetCanvasN;
bool __isFocusMode;
bool __isNavigatable;
+ bool __isFocusWindowActivationChecked;
class ControlVisualElementContentProvider;
ControlVisualElementContentProvider* __pVisualElementContentProvider;
result SetDimmingEnabled(bool enabled);
bool IsDimmingEnabled(void) const;
result Rearrange(void);
- result DrawBackgroundBitmap(void);
+ result DrawBackground(void);
private:
_DimmingLayer(const _DimmingLayer& rhs); /* no impl. */
#include <FBaseObject.h>
#include "FUi_Types.h"
-namespace Tizen { namespace App
-{
-class _IActiveWindowEventListener;
-}} // Tizen::App
-
namespace Tizen { namespace Graphics
{
class Rectangle;
class _Control;
class _Window;
-class _ActiveWindowEvent;
class _OSP_EXPORT_ _EcoreEvas
: public Tizen::Base::Object
Tizen::Graphics::Rectangle GetIndicatorBounds(const _Window& window) const;
result SetIndicatorOpacity(const _Window& window, _IndicatorOpacity opacity);
_IndicatorOpacity GetIndicatorOpacity(const _Window& window) const;
- void AddActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener);
- void RemoveActiveWindowEventListener(const Tizen::App::_IActiveWindowEventListener& listener);
Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void)const;
void SetFrame(const _Control& control);
const _Control* GetFrame(void) const;
static void ReleaseInstance(void);
bool IsFocusModeStateEnabled(void) const;
bool IsForwardDirection(void) const;
+ bool IsFocusable(_Control* pControl) const;
private:
/**
void StartFocusTraversal(_Control* pControl, FocusDirection focusDirection);
int GetNextIndex(int currentIndex, FocusDirection focusDirection, const Tizen::Base::Collection::IListT<_Control*>* pFocusControlList) const;
- bool IsFocusable(_Control* pControl) const;
_Control* FindTraversalControlFromChild(_Control* pControl);
bool IsFocusControlListControl(_Control* pControl) const;
DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_MARGIN, 43);
DECLARE_SHAPE_CONFIG(ANCHOR_POPUP_OVERLAP, 44);
DECLARE_SHAPE_CONFIG(LIST_TEXT_GAP, 45);
+ DECLARE_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 46);
DECLARE_FIXED_VALUE_CONFIG(GRID_ITEM_GAP, 1);
DECLARE_END_UI_CONFIG(CONTEXTMENU);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 31);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 32);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 33);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 34);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 35);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 36);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 37);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 34);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 35);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 36);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 37);
DECLARE_SHAPE_CONFIG(SOFTKEY_HEIGHT, 38);
DECLARE_SHAPE_CONFIG(SOFTKEY_TEXT_SIZE, 39);
DECLARE_SHAPE_CONFIG(SOFTKEY_0_LEFT_MARGIN, 40);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_TOP_MARGIN, 30);
//DECLARE_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 31);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 32);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 33);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 34);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 35);
- DECLARE_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 36);
- DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 37);
- DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 38);
- DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 39);
- DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 40);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 33);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 34);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 35);
+ //DECLARE_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 36);
+ //DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 37);
+ //DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 38);
+ //DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 39);
+ //DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 40);
DECLARE_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 41);
DECLARE_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 42);
DECLARE_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 43);
- DECLARE_SHAPE_CONFIG(TAB_LEFT_MARGIN, 44);
+ //DECLARE_SHAPE_CONFIG(TAB_LEFT_MARGIN, 44);
DECLARE_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 45);
DECLARE_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 46);
DECLARE_SHAPE_CONFIG(ICON_WIDTH, 47);
DECLARE_SHAPE_CONFIG(BUTTON_ITEM_MARGIN_WITH_TEXT, 76);
DECLARE_SHAPE_CONFIG(TAB_TEXT_DIM_WIDTH, 77);
DECLARE_SHAPE_CONFIG(TITLE_TEXT_DIM_WIDTH, 78);
+ DECLARE_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 79);
+ //DECLARE_SHAPE_CONFIG(TAB_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 80);
+ //DECLARE_SHAPE_CONFIG(TAB_BUTTON_ITEM_TOP_TOUCH_MARGIN, 81);
+ //DECLARE_SHAPE_CONFIG(TAB_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 82);
+ //DECLARE_SHAPE_CONFIG(TAB_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 83);
DECLARE_END_UI_CONFIG(HEADER);
Tizen::Ui::_ResourceManager::GetInstance()->GetColor(Tizen::Ui::_Resource::_##colorId##_COLOR, x)
#define GET_BITMAP_CONFIG_N(bitmapId, pixelFormat, pOutBitmap)\
- Tizen::Ui::_ResourceManager::GetInstance()->GetBitmapN(Tizen::Ui::_Resource::_##bitmapId##_IMAGE, pixelFormat, _CONTROL_ORIENTATION_PORTRAIT, pOutBitmap)
+ Tizen::Ui::_ResourceManager::GetInstance()->GetBitmapN(Tizen::Ui::_Resource::_##bitmapId##_IMAGE, pixelFormat, _CONTROL_ORIENTATION_PORTRAIT, false, 0, pOutBitmap)
+
+#define GET_REPLACED_BITMAP_CONFIG_N(bitmapId, pixelFormat, color ,pOutBitmap)\
+ Tizen::Ui::_ResourceManager::GetInstance()->GetBitmapN(Tizen::Ui::_Resource::_##bitmapId##_IMAGE, pixelFormat, _CONTROL_ORIENTATION_PORTRAIT, true, color, pOutBitmap)
#define GET_STRING_CONFIG(stringId, string)\
Tizen::Ui::_ResourceManager::GetInstance()->GetString(#stringId, string)
{
public:
static _ResourceManager* GetInstance(void);
- result GetBitmapN(int bitmapId, Tizen::Graphics::BitmapPixelFormat pixelFormat, _ControlOrientation orientation, Tizen::Graphics::Bitmap*& pBitmap);
+ result GetBitmapN(int bitmapId, Tizen::Graphics::BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool replacementColor, int color, Tizen::Graphics::Bitmap*& pBitmap);
result GetString(const char* stringId, Tizen::Base::String& string);
result GetColor(int colorId, Tizen::Graphics::Color& color);
result GetShape(int shapeId, _ControlOrientation orientation, int& value);
MAP_CONTAINER_TYPE_DEFAULT_LANDSCAPE = 3,
MAP_CONTAINER_TYPE_MAX = 4,
};
- result GetBitmapInternalN(const Tizen::Base::String& fileName, Tizen::Graphics::BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool isCustom, Tizen::Graphics::Bitmap*& pBitmap);
+ result GetBitmapInternalN(const Tizen::Base::String& fileName, Tizen::Graphics::BitmapPixelFormat pixelFormat, _ControlOrientation orientation, bool isCustom, bool replacementColor, int color, Tizen::Graphics::Bitmap*& pBitmap);
result GetDefaultShapeWithScaling(int shapeId, _ControlOrientation orientation, int& value);
result GetDefaultShapeWithScaling(int shapeId, _ControlOrientation orientation, Tizen::Graphics::Dimension& value);
result GetDefaultShapeWithScaling(int shapeId, _ControlOrientation orientation, float& value);
DECLARE_SHAPE_CONFIG(LIST_ITEM_FONT_SIZE, 24);
DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_LEFT_RIGHT_MARGIN, 25);
DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, 26);
+ DECLARE_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 27);
+
DECLARE_END_UI_CONFIG(OPTIONMENU);
#endif //_FUI_RESOURCE_OPTION_MENU_CONFIG_H_
DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 21);
DECLARE_SHAPE_CONFIG(HANDLE_WIDTH, 1);
DECLARE_SHAPE_CONFIG(HANDLE_HEIGHT, 2);
- DECLARE_SHAPE_CONFIG(HANDLE_OFFSET, 3);
- DECLARE_SHAPE_CONFIG(HANDLE_ONE_DIGIT_TEXT_SIZE, 4);
- DECLARE_SHAPE_CONFIG(HANDLE_TWO_DIGIT_TEXT_SIZE, 5);
- DECLARE_SHAPE_CONFIG(HANDLE_THREE_DIGIT_TEXT_SIZE, 6);
- DECLARE_SHAPE_CONFIG(BAR_HEIGHT, 7);
- DECLARE_SHAPE_CONFIG(BAR_LEFT_MARGIN, 8);
- DECLARE_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 9);
- DECLARE_SHAPE_CONFIG(BAR_OFFSET, 10);
- DECLARE_SHAPE_CONFIG(ICON_WIDTH, 11);
- DECLARE_SHAPE_CONFIG(ICON_HEIGHT, 12);
- DECLARE_SHAPE_CONFIG(ICON_LEFT_MARGIN, 13);
- DECLARE_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 14);
- DECLARE_SHAPE_CONFIG(TITLE_TEXT_POSITION_X, 15);
- DECLARE_SHAPE_CONFIG(TITLE_TEXT_SIZE, 16);
- DECLARE_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 17);
- DECLARE_SHAPE_CONFIG(OVERLAY_WIDTH, 18);
- DECLARE_SHAPE_CONFIG(OVERLAY_HEIGHT, 19);
- DECLARE_SHAPE_CONFIG(OVERLAY_HEIGHT_WITHOUT_ARROW, 20);
- DECLARE_SHAPE_CONFIG(OVERLAY_BOTTOM_MARGIN, 21);
- DECLARE_SHAPE_CONFIG(OVERLAY_MARGIN, 22);
- DECLARE_SHAPE_CONFIG(OVERLAY_TEXT_SIZE, 23);
- DECLARE_SHAPE_CONFIG(NUMBER_SIZE, 24);
- DECLARE_SHAPE_CONFIG(TEXT_SIZE, 25);
- DECLARE_SHAPE_CONFIG(BAR_LEFT_MARGIN_WITH_ICON, 26);
- DECLARE_SHAPE_CONFIG(MINIMUM_WIDTH_WITHOUT_ICON, 27);
- DECLARE_SHAPE_CONFIG(MINIMUM_WIDTH_WITH_ICON, 28);
- DECLARE_SHAPE_CONFIG(MINIMUM_HEIGHT, 29);
+ DECLARE_SHAPE_CONFIG(HANDLE_ONE_DIGIT_TEXT_SIZE, 3);
+ DECLARE_SHAPE_CONFIG(HANDLE_TWO_DIGIT_TEXT_SIZE, 4);
+ DECLARE_SHAPE_CONFIG(HANDLE_THREE_DIGIT_TEXT_SIZE, 5);
+ DECLARE_SHAPE_CONFIG(BAR_HEIGHT, 6);
+ DECLARE_SHAPE_CONFIG(BAR_LEFT_MARGIN, 7);
+ DECLARE_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 8);
+ DECLARE_SHAPE_CONFIG(BAR_OFFSET, 9);
+ DECLARE_SHAPE_CONFIG(ICON_WIDTH, 10);
+ DECLARE_SHAPE_CONFIG(ICON_HEIGHT, 11);
+ DECLARE_SHAPE_CONFIG(ICON_LEFT_MARGIN, 12);
+ DECLARE_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 13);
+ DECLARE_SHAPE_CONFIG(TITLE_TEXT_POSITION_X, 14);
+ DECLARE_SHAPE_CONFIG(TITLE_TEXT_SIZE, 15);
+ DECLARE_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 16);
+ DECLARE_SHAPE_CONFIG(OVERLAY_WIDTH, 17);
+ DECLARE_SHAPE_CONFIG(OVERLAY_HEIGHT, 18);
+ DECLARE_SHAPE_CONFIG(OVERLAY_HEIGHT_WITHOUT_ARROW, 19);
+ DECLARE_SHAPE_CONFIG(OVERLAY_BOTTOM_MARGIN, 20);
+ DECLARE_SHAPE_CONFIG(OVERLAY_MARGIN, 21);
+ DECLARE_SHAPE_CONFIG(OVERLAY_TEXT_SIZE, 22);
+ DECLARE_SHAPE_CONFIG(NUMBER_SIZE, 23);
+ DECLARE_SHAPE_CONFIG(TEXT_SIZE, 24);
+ DECLARE_SHAPE_CONFIG(MINIMUM_WIDTH_WITHOUT_ICON, 25);
+ DECLARE_SHAPE_CONFIG(MINIMUM_WIDTH_WITH_ICON, 26);
+ DECLARE_SHAPE_CONFIG(MINIMUM_HEIGHT, 27);
DECLARE_END_UI_CONFIG(SLIDER);
public:
FocusStatus GetFocusState(void) const;
+ virtual bool IsEventEnabled(const _Control& control) const;
private:
virtual _UiFocusEvent* CloneN(void) const;
_Control* __pOwner;
_IWindowDelegate* __pWindowDelegate;
bool __activated;
- bool __nativeWindowActivated;
bool __destroying;
Tizen::Ui::Animations::_RootVisualElement* __pRootVisualElement;
int __rotation;
bool __preferredRotation;
bool __orientationCallbackMode;
+ bool __nativeWindowActivated;
friend class _ControlManager;
}; // _Window
ADD_SHAPE_CONFIG(ANCHOR_POPUP_OVERLAP, 1);
ADD_SHAPE_CONFIG(LIST_TEXT_GAP, 20);
+ ADD_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 4);
END_UI_CONFIG_MODE(720x1280);
START_UI_CONFIG_MODE(1280x720);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(BUTTON_ITEM_TEXT_NORMAL, $B052L4);
ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 115);
ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 98);
ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 17.5);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 17.5);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 17.5);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 17.5);
ADD_SHAPE_CONFIG(SOFTKEY_HEIGHT, 117);//720x1280
ADD_SHAPE_CONFIG(SOFTKEY_TEXT_SIZE, 42);
ADD_SHAPE_CONFIG(SOFTKEY_MULTILINE_TEXT_SIZE, 38);
ADD_SHAPE_CONFIG(BUTTON_ITEM_WIDTH, 115);
ADD_SHAPE_CONFIG(BUTTON_ITEM_HEIGHT, 85);
ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 11);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 11);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 11);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 11);
ADD_SHAPE_CONFIG(SOFTKEY_HEIGHT, 117);
ADD_SHAPE_CONFIG(SOFTKEY_TEXT_SIZE, 42);
ADD_SHAPE_CONFIG(SOFTKEY_MULTILINE_TEXT_SIZE, 38);
START_UI_CONFIG(GROUPCONTAINER);
{
ADD_COLOR_CONFIG(NORMAL_BG, $B0217);
- ADD_COLOR_CONFIG(LINE_COLOR_FG, $F032L1);
+ ADD_COLOR_CONFIG(LINE_COLOR_FG, $B0221L4);
ADD_IMAGE_CONFIG(BORDER_BG_EFFECT, #00_list_group_bg_ef.#.png);
ADD_IMAGE_CONFIG(SYSTEM_CONTROL_BG, #00_list_group_press_bg.#.png);
ADD_IMAGE_CONFIG(BG_NORMAL, #00_list_group_bg.#.png);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(SEGMENTED_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(TAB_ITEM_TRANSLUCENT_BG_SELECTED, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_NORMAL, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_DISABLED, $B013);
- ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, $B013P);
+ ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_PRESSED, $B013);
ADD_COLOR_CONFIG(BUTTON_ITEM_TRANSLUCENT_BG_HIGHLIGHTED, $B0514P2);
ADD_COLOR_CONFIG(BUTTON_ITEM_TEXT_NORMAL, $B052L4);
//ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 0);
ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 16.5);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 16.5);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 16.5);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 16.5);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 16.5);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 16.5);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_TOP_TOUCH_MARGIN, 13.5);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 13.5);
+
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 16.5);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 16.5);
ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 75);
ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 63);
ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 45);
- ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 0);
+ //ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 0);
ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 0);
ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 16.5);
ADD_SHAPE_CONFIG(ICON_WIDTH, 45);
ADD_SHAPE_CONFIG(ICON_TEXT_GAP, 8);
+ ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 16);
ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 2);
ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 48);
//ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_TOP_MARGIN, 0);
ADD_SHAPE_CONFIG(BUTTON_ITEM_ICON_SIZE, 63);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 14);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 14);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_TOP_TOUCH_MARGIN, 14);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 14);
+
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_TOP_TOUCH_MARGIN, 3.5);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(TAB_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 3.5);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 14);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
- ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 14);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_LEFT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_TOUCH_MARGIN, 14);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_RIGHT_TOUCH_MARGIN, 26);
+ //ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_BOTTOM_TOUCH_MARGIN, 14);
ADD_SHAPE_CONFIG(SEGMENTED_ITEM_HEIGHT, 75);
ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE, 63);
ADD_SHAPE_CONFIG(TAB_ITEM_ICON_SIZE_WITH_TEXT, 45);
- ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 0);
+ //ADD_SHAPE_CONFIG(TAB_LEFT_MARGIN, 0);
ADD_SHAPE_CONFIG(SIP_BUTTON_ITEM_TOP_MARGIN, 0);//1280x720
ADD_SHAPE_CONFIG(SIP_FOOTER_ITEM_TOP_MARGIN, 14);
ADD_SHAPE_CONFIG(ICON_WIDTH, 45);
ADD_SHAPE_CONFIG(ICON_TEXT_GAP, 8);
+ ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 16);
ADD_SHAPE_CONFIG(DIVIDER_WIDTH, 2);
ADD_SHAPE_CONFIG(DIVIDER_HEIGHT, 48);
START_UI_CONFIG_MODE(480x800);
{
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 8);
}
END_UI_CONFIG_MODE(480x800);
ADD_SHAPE_CONFIG(TEXT_TOP_MRAGIN_NO_BUTTON, 32); // 20130403
ADD_SHAPE_CONFIG(TEXT_TOP_MRAGIN, 20); // 20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14); //20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 16); //20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 16);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 16);
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 15); //20121113
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 15); //20121113
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 15);
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 15);
ADD_SHAPE_CONFIG(BUTTON_HEIGHT, 74); // 20121113
ADD_SHAPE_CONFIG(BUTTON_INTERNAL_GAP, 10); // 20130404
ADD_SHAPE_CONFIG(LIST_DIVIDER_HEIGHT, 1);
ADD_SHAPE_CONFIG(ITEM_BG_PRESSED_LEFT_RIGHT_MARGIN, 4);
ADD_SHAPE_CONFIG(ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, 3);
+ ADD_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 3);
}
END_UI_CONFIG_MODE(720x1280);
}
END_UI_CONFIG_API_VERSION();
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 8);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 8);
}
END_UI_CONFIG_MODE(480x800);
ADD_SHAPE_CONFIG(BOTTOM_BORDER, 30); // Compatibility 2.0
ADD_SHAPE_CONFIG(SIDE_BORDER, 12); // Compatibility 2.0
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14); //20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 16); //20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 16);
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 16);
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 15); //20121113
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 15); //20121113
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 15);
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 15);
ADD_SHAPE_CONFIG(OUTLINE_BORDER, 3);
ADD_SHAPE_CONFIG(PROCESS_ANIMATION_WIDTH, 63); //20130403
ADD_SHAPE_CONFIG(PROCESS_TEXT_TOP_MARGIN, 9); //20130403
ADD_SHAPE_CONFIG(PROCESS_TEXT_BOTTOM_MARGIN, 20); //20121113
- ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 14); //20130122
- ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 16); //20130122
- ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 16); //20130122
- ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 16); //20130122
+ ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_TOP_MARGIN, 15); //20130122
+ ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_BOTTOM_MARGIN, 15); //20130122
+ ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_LEFT_MARGIN, 15); //20130122
+ ADD_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 15); //20130122
}
END_UI_CONFIG_MODE(720x1280);
}
{
ADD_SHAPE_CONFIG(HANDLE_WIDTH, 72);
ADD_SHAPE_CONFIG(HANDLE_HEIGHT, 72);
- ADD_SHAPE_CONFIG(HANDLE_OFFSET, 8);
ADD_SHAPE_CONFIG(HANDLE_ONE_DIGIT_TEXT_SIZE, 42);
ADD_SHAPE_CONFIG(HANDLE_TWO_DIGIT_TEXT_SIZE, 34);
ADD_SHAPE_CONFIG(HANDLE_THREE_DIGIT_TEXT_SIZE, 26);
ADD_SHAPE_CONFIG(BAR_HEIGHT, 27);
- ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN_WITH_ICON, 26);
- ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 36);
+ ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 45);
ADD_SHAPE_CONFIG(BAR_OFFSET, 7);
ADD_SHAPE_CONFIG(ICON_WIDTH, 72);
ADD_SHAPE_CONFIG(ICON_HEIGHT, 72);
ADD_SHAPE_CONFIG(ICON_LEFT_MARGIN, 26);
- ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 16);
+ ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 30);
ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_X, 12);
ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 16);
START_UI_CONFIG(TABLEVIEW);
{
ADD_COLOR_CONFIG(BG_NORMAL, 0x00000000);
- ADD_COLOR_CONFIG(ITEM_DIVIDER_TOP_BG_NORMAL, $B0222);
- ADD_COLOR_CONFIG(ITEM_DIVIDER_BOTTOM_BG_NORMAL, $B0223);
+ ADD_COLOR_CONFIG(ITEM_DIVIDER_TOP_BG_NORMAL, $B0223);
+ ADD_COLOR_CONFIG(ITEM_DIVIDER_BOTTOM_BG_NORMAL, $B0222);
ADD_COLOR_CONFIG(ITEM_BG_NORMAL, 0x00000000);
ADD_COLOR_CONFIG(ITEM_BG_PRESSED, $B041);
ADD_COLOR_CONFIG(ITEM_BG_HIGHLIGHTED, $B041);
ADD_SHAPE_CONFIG(DESCRIPTION_TEXT_RIGHT_MARGIN, 16)
ADD_SHAPE_CONFIG(TOKEN_MIN_WIDTH, 90);
ADD_SHAPE_CONFIG(TOKEN_TEXT_SIZE, 32);
- ADD_SHAPE_CONFIG(DESCRIPTION_TEXT_SIZE, 34);
+ ADD_SHAPE_CONFIG(DESCRIPTION_TEXT_SIZE, 36);
ADD_SHAPE_CONFIG(TEXT_SIZE, 44);
ADD_SHAPE_CONFIG(HIDDEN_TOKEN_COUNT_DISPLAY_MARGIN, 15);
ADD_SHAPE_CONFIG(HIDDEN_TOKEN_COUNT_DISPLAY_TEXT_SIZE, 33);
case _SceneControlEventArg::SCENE_CONTROL_EVENT_TYPE_DESTROY:
if (!__destroyPendingScene.IsEmpty())
{
+ // Give up if the application is terminated.
+ UiApp* pUiApp = UiApp::GetInstance();
+ SysTryLogReturn(NID_UI_SCENES, pUiApp, , "Invalid UiApp");
+ AppState appState = pUiApp->GetAppState();
+ if (appState == TERMINATING || appState == TERMINATED)
+ {
+ SysLog(NID_UI_SCENES, "Application terminated, ignore the destroy event.");
+ return;
+ }
+
SysTryLog(NID_UI_SCENES, __destroyPendingScene == sceneId, "Abnormal! __destroyPendingScene != sceneId");
DestroyScene(sceneId);
if (__destroyPendingScene == sceneId)
${CMAKE_SOURCE_DIR}/src/app/FApp_AppFrame.cpp
${CMAKE_SOURCE_DIR}/src/app/FApp_AppResourceBitmap.cpp
${CMAKE_SOURCE_DIR}/src/app/FApp_AppResourceBitmapUtil.cpp
+ ${CMAKE_SOURCE_DIR}/src/app/FApp_CoordinateInfo.cpp
+ ${CMAKE_SOURCE_DIR}/src/app/FApp_ThemeInfo.cpp
)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall" )