From 975b4ed1924f500b0064dd4c05cabb94af5bad08 Mon Sep 17 00:00:00 2001 From: Daniel McEwen Date: Tue, 26 Mar 2019 10:38:28 +0000 Subject: [PATCH] Fix conversion warnings for event refactor Some driveby changes are also included to slowly reduce the total conversion warnings in adaptor - the goal being to turn that warning back on Change-Id: I2d7f52456f963c7c40985660256466646cd72623 --- .../common/accessibility-adaptor-impl.cpp | 10 +- .../common/accessibility-adaptor-impl.h | 6 +- .../tizen-ivi/accessibility-adaptor-impl-ivi.cpp | 6 +- .../accessibility-adaptor-impl-mobile.cpp | 6 +- .../accessibility-adaptor-impl-wearable.cpp | 6 +- dali/internal/adaptor/common/adaptor-impl.cpp | 2 +- .../common/combined-update-render-controller.h | 1 + .../adaptor/tizen-wayland/adaptor-impl-tizen.cpp | 6 +- .../adaptor/tizen-wayland/dali-ecore-wayland.h | 26 +++ .../adaptor/tizen-wayland/dali-ecore-wl2.h | 26 +++ .../adaptor/tizen-wayland/framework-tizen.cpp | 4 +- dali/internal/adaptor/ubuntu/framework-ubuntu.cpp | 6 +- .../tizen-wayland/clipboard-impl-ecore-wl.cpp | 23 +-- .../clipboard/ubuntu-x11/clipboard-impl-x.cpp | 4 +- dali/internal/imaging/common/image-operations.cpp | 48 ++--- .../internal/imaging/common/pixel-manipulation.cpp | 54 ++--- .../ubuntu-x11/native-image-source-impl-x.cpp | 4 +- .../ubuntu-x11/native-image-source-impl-x.h | 10 +- .../input/common/drag-and-drop-detector-impl.h | 8 +- dali/internal/input/common/gesture-detector.h | 8 +- dali/internal/input/common/gesture-manager.h | 8 +- dali/internal/input/common/key-impl.h | 8 +- .../input/common/long-press-gesture-detector.cpp | 6 +- .../input/common/long-press-gesture-detector.h | 10 +- .../input/common/pan-gesture-detector-base.cpp | 15 +- .../input/common/pan-gesture-detector-base.h | 11 +- dali/internal/input/common/pan-gesture-detector.h | 8 +- .../internal/input/common/physical-keyboard-impl.h | 8 +- .../input/common/pinch-gesture-detector.cpp | 6 +- .../internal/input/common/pinch-gesture-detector.h | 8 +- .../internal/input/common/tap-gesture-detector.cpp | 16 +- dali/internal/input/common/tap-gesture-detector.h | 19 +- dali/internal/input/common/virtual-keyboard-impl.h | 8 +- dali/internal/input/linux/dali-ecore-imf.h | 26 +++ .../input/tizen-wayland/ecore-virtual-keyboard.cpp | 9 +- .../input/tizen-wayland/ecore-virtual-keyboard.h | 10 +- .../input-method-context-impl-ecore-wl.cpp | 11 +- .../input-method-context-impl-ecore-wl.h | 12 +- .../virtual-keyboard-impl-ecore-wl.cpp | 6 +- dali/internal/input/ubuntu-x11/dali-ecore-input.h | 26 +++ .../ubuntu-x11/input-method-context-impl-x.cpp | 17 +- .../input/ubuntu-x11/input-method-context-impl-x.h | 12 +- .../input/ubuntu-x11/virtual-keyboard-impl-x.cpp | 6 +- .../system/linux/callback-manager-ecore.cpp | 9 +- dali/internal/system/linux/dali-ecore-x.h | 26 +++ dali/internal/system/linux/dali-ecore.h | 26 +++ dali/internal/system/linux/dali-elementary.h | 25 +++ .../system/linux/file-descriptor-monitor-ecore.cpp | 9 +- dali/internal/system/linux/timer-impl-ecore.cpp | 12 +- .../system/ubuntu-x11/system-settings-x.cpp | 13 +- .../window-system/common/damage-observer.h | 8 +- .../common/ecore-server-connection.cpp | 222 --------------------- .../window-system/common/ecore-server-connection.h | 148 -------------- .../window-system/common/event-handler.cpp | 22 +- dali/internal/window-system/common/event-handler.h | 15 +- .../window-system/common/orientation-impl.h | 8 +- .../window-system/common/rotation-observer.h | 8 +- dali/internal/window-system/common/window-base.cpp | 2 - dali/internal/window-system/common/window-base.h | 5 +- .../window-system/common/window-event-interface.h | 8 +- .../common/window-visibility-observer.h | 8 +- dali/internal/window-system/file.list | 1 - .../ubuntu-x11/display-connection-impl-x.cpp | 4 +- .../window-system/ubuntu-x11/ecore-x-types.h | 8 +- .../ubuntu-x11/pixmap-render-surface-ecore-x.h | 4 +- .../ubuntu-x11/window-base-ecore-x.cpp | 34 ++-- .../window-system/ubuntu-x11/window-base-ecore-x.h | 6 +- .../ubuntu-x11/window-interface-ecore-x.h | 10 +- .../ubuntu-x11/window-system-ecore-x.cpp | 4 +- third-party/glyphy/glyphy-geometry.hh | 5 +- third-party/glyphy/vector-font-cache.cpp | 24 +-- 71 files changed, 483 insertions(+), 721 deletions(-) create mode 100644 dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h create mode 100644 dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h create mode 100644 dali/internal/input/linux/dali-ecore-imf.h create mode 100644 dali/internal/input/ubuntu-x11/dali-ecore-input.h create mode 100644 dali/internal/system/linux/dali-ecore-x.h create mode 100644 dali/internal/system/linux/dali-ecore.h create mode 100644 dali/internal/system/linux/dali-elementary.h delete mode 100644 dali/internal/window-system/common/ecore-server-connection.cpp delete mode 100644 dali/internal/window-system/common/ecore-server-connection.h diff --git a/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp b/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp index 728fd87..7f2aa76 100644 --- a/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp +++ b/dali/internal/accessibility/common/accessibility-adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,8 +160,8 @@ bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y); - mReadPosition.x = x; - mReadPosition.y = y; + mReadPosition.x = static_cast< float > (x); + mReadPosition.y = static_cast< float > (y); if( mActionHandler ) { @@ -242,7 +242,7 @@ bool AccessibilityAdaptor::HandleActionClearFocusEvent() return ret; } -bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp) +bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp) { bool ret = false; @@ -271,7 +271,7 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsi return ret; } -bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp) +bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, uint32_t timeStamp) { bool ret = false; diff --git a/dali/internal/accessibility/common/accessibility-adaptor-impl.h b/dali/internal/accessibility/common/accessibility-adaptor-impl.h index a997dac..06dff1f 100644 --- a/dali/internal/accessibility/common/accessibility-adaptor-impl.h +++ b/dali/internal/accessibility/common/accessibility-adaptor-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,12 +141,12 @@ public: /** * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollEvent() */ - bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp); + bool HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp); /** * @copydoc Dali::AccessibilityAdaptor::HandleActionTouchEvent() */ - bool HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp); + bool HandleActionTouchEvent(const TouchPoint& point, uint32_t timeStamp); /** * @copydoc Dali::AccessibilityAdaptor::HandleActionBackEvent() diff --git a/dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp b/dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp index f2f50e6..b8c9e1d 100644 --- a/dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp +++ b/dali/internal/accessibility/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ #include #ifndef WAYLAND -#include -#include +#include +#include #endif #include diff --git a/dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp b/dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp index f2f50e6..b8c9e1d 100644 --- a/dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp +++ b/dali/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ #include #ifndef WAYLAND -#include -#include +#include +#include #endif #include diff --git a/dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp b/dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp index a849963..c33fafd 100644 --- a/dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp +++ b/dali/internal/accessibility/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ #include #ifndef WAYLAND -#include -#include +#include +#include #endif #include diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index fe220af..0bdf2c7 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -161,7 +161,7 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: PositionSize size = defaultWindow->GetSurface()->GetPositionSize(); - mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions); + mGestureManager = new GestureManager(*this, Vector2(static_cast(size.width), static_cast(size.height)), mCallbackManager, *mEnvironmentOptions); mGraphics = &( graphicsFactory.Create() ); mGraphics->Initialize( mEnvironmentOptions ); diff --git a/dali/internal/adaptor/common/combined-update-render-controller.h b/dali/internal/adaptor/common/combined-update-render-controller.h index bdb51b0..a8cb5f2 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.h +++ b/dali/internal/adaptor/common/combined-update-render-controller.h @@ -315,6 +315,7 @@ private: pthread_t* mUpdateRenderThread; ///< The Update/Render thread. float mDefaultFrameDelta; ///< Default time delta between each frame (used for animations). Not protected by lock, but written to rarely so not worth adding a lock when reading. + // TODO: mDefaultFrameDurationMilliseconds is defined as uint64_t, the only place where it is used, it is converted to an unsigned int!!! uint64_t mDefaultFrameDurationMilliseconds; ///< Default duration of a frame (used for predicting the time of the next frame). Not protected by lock, but written to rarely so not worth adding a lock when reading. uint64_t mDefaultFrameDurationNanoseconds; ///< Default duration of a frame (used for sleeping if not enough time elapsed). Not protected by lock, but written to rarely so not worth adding a lock when reading. uint64_t mDefaultHalfFrameNanoseconds; ///< Is half of mDefaultFrameDurationNanoseconds. Using a member variable avoids having to do the calculation every frame. Not protected by lock, but written to rarely so not worth adding a lock when reading. diff --git a/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp b/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp index 029a86f..3e2865d 100644 --- a/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,9 @@ #endif #ifdef ECORE_WAYLAND2 -#include +#include #else -#include +#include #endif diff --git a/dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h b/dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h new file mode 100644 index 0000000..6eb6038 --- /dev/null +++ b/dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WAYLAND_H +#define DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WAYLAND_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WAYLAND_H */ diff --git a/dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h b/dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h new file mode 100644 index 0000000..c733e31 --- /dev/null +++ b/dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WL2_H +#define DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WL2_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WL2_H */ diff --git a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp index 8e6d5be..09ee3fb 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/framework-tizen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/dali/internal/adaptor/ubuntu/framework-ubuntu.cpp b/dali/internal/adaptor/ubuntu/framework-ubuntu.cpp index 1cc0ce6..6588896 100644 --- a/dali/internal/adaptor/ubuntu/framework-ubuntu.cpp +++ b/dali/internal/adaptor/ubuntu/framework-ubuntu.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ #include // EXTERNAL INCLUDES -#include -#include +#include +#include #include #include diff --git a/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp b/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp index 77b48de..8721844 100644 --- a/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp +++ b/dali/internal/clipboard/tizen-wayland/clipboard-impl-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,12 @@ #include // EXTERNAL INCLUDES -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#include +#include #ifdef ECORE_WAYLAND2 -#include +#include #else -#include +#include #endif #include @@ -135,9 +132,9 @@ struct Clipboard::Impl char *ExcuteSend( void *event ) { #ifdef ECORE_WAYLAND2 - Ecore_Wl2_Event_Data_Source_Send *ev = (Ecore_Wl2_Event_Data_Source_Send *)event; + Ecore_Wl2_Event_Data_Source_Send *ev = reinterpret_cast( event ); #else - Ecore_Wl_Event_Data_Source_Send *ev = (Ecore_Wl_Event_Data_Source_Send *)event; + Ecore_Wl_Event_Data_Source_Send *ev = reinterpret_cast( event ); #endif int len_buf = mSendBuffer.length(); @@ -160,12 +157,12 @@ struct Clipboard::Impl char *ExcuteReceive( void *event ) { #ifdef ECORE_WAYLAND2 - Ecore_Wl2_Event_Selection_Data_Ready *ev = (Ecore_Wl2_Event_Selection_Data_Ready *)event; + Ecore_Wl2_Event_Selection_Data_Ready *ev = reinterpret_cast( event ); #else - Ecore_Wl_Event_Selection_Data_Ready *ev = (Ecore_Wl_Event_Selection_Data_Ready *)event; + Ecore_Wl_Event_Selection_Data_Ready *ev = reinterpret_cast( event ); #endif - return (char *)ev->data; + return reinterpret_cast( ev->data ); } int GetCount() @@ -328,5 +325,3 @@ char* Clipboard::ExcuteBuffered( bool type, void *event ) } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp b/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp index 0a6b1f4..38a488e 100644 --- a/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp +++ b/dali/internal/clipboard/ubuntu-x11/clipboard-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include // EXTERNAL INCLUDES -#include +#include #include #include #include diff --git a/dali/internal/imaging/common/image-operations.cpp b/dali/internal/imaging/common/image-operations.cpp index ae88aef..2fdeb4f 100755 --- a/dali/internal/imaging/common/image-operations.cpp +++ b/dali/internal/imaging/common/image-operations.cpp @@ -1268,9 +1268,9 @@ void HalveScanlineInPlaceRGB888( unsigned char * const pixels, const unsigned in const unsigned int c23 = pixels[pixel * 3 + 5]; // Save the averaged byte pixel components: - pixels[outPixel * 3] = AverageComponent( c11, c21 ); - pixels[outPixel * 3 + 1] = AverageComponent( c12, c22 ); - pixels[outPixel * 3 + 2] = AverageComponent( c13, c23 ); + pixels[outPixel * 3] = static_cast( AverageComponent( c11, c21 ) ); + pixels[outPixel * 3 + 1] = static_cast( AverageComponent( c12, c22 ) ); + pixels[outPixel * 3 + 2] = static_cast( AverageComponent( c13, c23 ) ); } } @@ -1321,8 +1321,8 @@ void HalveScanlineInPlace2Bytes( unsigned char * const pixels, const unsigned in const unsigned int c22 = pixels[pixel * 2 + 3]; // Save the averaged byte pixel components: - pixels[outPixel * 2] = AverageComponent( c11, c21 ); - pixels[outPixel * 2 + 1] = AverageComponent( c12, c22 ); + pixels[outPixel * 2] = static_cast( AverageComponent( c11, c21 ) ); + pixels[outPixel * 2 + 1] = static_cast( AverageComponent( c12, c22 ) ); } } @@ -1339,7 +1339,7 @@ void HalveScanlineInPlace1Byte( unsigned char * const pixels, const unsigned int const unsigned int c2 = pixels[pixel + 1]; // Save the averaged byte pixel component: - pixels[outPixel] = AverageComponent( c1, c2 ); + pixels[outPixel] = static_cast( AverageComponent( c1, c2 ) ); } } @@ -1356,7 +1356,7 @@ void AverageScanlines1( const unsigned char * const scanline1, for( unsigned int component = 0; component < width; ++component ) { - outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] ); + outputScanline[component] = static_cast( AverageComponent( scanline1[component], scanline2[component] ) ); } } @@ -1369,7 +1369,7 @@ void AverageScanlines2( const unsigned char * const scanline1, for( unsigned int component = 0; component < width * 2; ++component ) { - outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] ); + outputScanline[component] = static_cast( AverageComponent( scanline1[component], scanline2[component] ) ); } } @@ -1382,7 +1382,7 @@ void AverageScanlines3( const unsigned char * const scanline1, for( unsigned int component = 0; component < width * 3; ++component ) { - outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] ); + outputScanline[component] = static_cast( AverageComponent( scanline1[component], scanline2[component] ) ); } } @@ -1684,9 +1684,9 @@ void PointSample3BPP( const uint8_t * inPixels, ///@ToDo: Optimise - Benchmark one 32bit load that will be unaligned 2/3 of the time + 3 rotate and masks, versus these three aligned byte loads, versus using an RGB packed, aligned(1) struct and letting compiler pick a strategy. // Output the pixel components: - outScanline[outX] = c0; - outScanline[outX + 1] = c1; - outScanline[outX + 2] = c2; + outScanline[outX] = static_cast( c0 ); + outScanline[outX + 1] = static_cast( c1 ); + outScanline[outX + 2] = static_cast( c2 ); // Increment the fixed-point input coordinate: inX += deltaX; @@ -1743,15 +1743,15 @@ namespace /** @brief Blend 4 pixels together using horizontal and vertical weights. */ inline uint8_t BilinearFilter1BPPByte( uint8_t tl, uint8_t tr, uint8_t bl, uint8_t br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ) { - return BilinearFilter1Component( tl, tr, bl, br, fractBlendHorizontal, fractBlendVertical ); + return static_cast( BilinearFilter1Component( tl, tr, bl, br, fractBlendHorizontal, fractBlendVertical ) ); } /** @copydoc BilinearFilter1BPPByte */ inline Pixel2Bytes BilinearFilter2Bytes( Pixel2Bytes tl, Pixel2Bytes tr, Pixel2Bytes bl, Pixel2Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ) { Pixel2Bytes pixel; - pixel.l = BilinearFilter1Component( tl.l, tr.l, bl.l, br.l, fractBlendHorizontal, fractBlendVertical ); - pixel.a = BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ); + pixel.l = static_cast( BilinearFilter1Component( tl.l, tr.l, bl.l, br.l, fractBlendHorizontal, fractBlendVertical ) ); + pixel.a = static_cast( BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ) ); return pixel; } @@ -1759,18 +1759,18 @@ inline Pixel2Bytes BilinearFilter2Bytes( Pixel2Bytes tl, Pixel2Bytes tr, Pixel2B inline Pixel3Bytes BilinearFilterRGB888( Pixel3Bytes tl, Pixel3Bytes tr, Pixel3Bytes bl, Pixel3Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ) { Pixel3Bytes pixel; - pixel.r = BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ); - pixel.g = BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ); - pixel.b = BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical ); + pixel.r = static_cast( BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ) ); + pixel.g = static_cast( BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ) ); + pixel.b = static_cast( BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical ) ); return pixel; } /** @copydoc BilinearFilter1BPPByte */ inline PixelRGB565 BilinearFilterRGB565( PixelRGB565 tl, PixelRGB565 tr, PixelRGB565 bl, PixelRGB565 br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ) { - const PixelRGB565 pixel = (BilinearFilter1Component( tl >> 11u, tr >> 11u, bl >> 11u, br >> 11u, fractBlendHorizontal, fractBlendVertical ) << 11u) + + const PixelRGB565 pixel = static_cast( (BilinearFilter1Component( tl >> 11u, tr >> 11u, bl >> 11u, br >> 11u, fractBlendHorizontal, fractBlendVertical ) << 11u) + (BilinearFilter1Component( (tl >> 5u) & 63u, (tr >> 5u) & 63u, (bl >> 5u) & 63u, (br >> 5u) & 63u, fractBlendHorizontal, fractBlendVertical ) << 5u) + - BilinearFilter1Component( tl & 31u, tr & 31u, bl & 31u, br & 31u, fractBlendHorizontal, fractBlendVertical ); + BilinearFilter1Component( tl & 31u, tr & 31u, bl & 31u, br & 31u, fractBlendHorizontal, fractBlendVertical ) ); return pixel; } @@ -1778,10 +1778,10 @@ inline PixelRGB565 BilinearFilterRGB565( PixelRGB565 tl, PixelRGB565 tr, PixelRG inline Pixel4Bytes BilinearFilter4Bytes( Pixel4Bytes tl, Pixel4Bytes tr, Pixel4Bytes bl, Pixel4Bytes br, unsigned int fractBlendHorizontal, unsigned int fractBlendVertical ) { Pixel4Bytes pixel; - pixel.r = BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ); - pixel.g = BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ); - pixel.b = BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical ); - pixel.a = BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ); + pixel.r = static_cast( BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ) ); + pixel.g = static_cast( BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ) ); + pixel.b = static_cast( BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical ) ); + pixel.a = static_cast( BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ) ); return pixel; } diff --git a/dali/internal/imaging/common/pixel-manipulation.cpp b/dali/internal/imaging/common/pixel-manipulation.cpp index f115f02..e37c88e 100644 --- a/dali/internal/imaging/common/pixel-manipulation.cpp +++ b/dali/internal/imaging/common/pixel-manipulation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -413,20 +413,20 @@ void WriteChannel( unsigned char* pixelData, { if( channel == RED ) { - *pixelData &= ~0xF8; + *pixelData &= static_cast( ~0xF8 ); *pixelData |= static_cast( (channelValue << 3) & 0xF8 ); } else if( channel == GREEN ) { - *pixelData &= ~0x07; + *pixelData &= static_cast( ~0x07 ); *pixelData |= static_cast( (channelValue >> 3) & 0x07 ); - *(pixelData+1) &= ~0xE0; + *(pixelData+1) &= static_cast( ~0xE0 ); *(pixelData+1) |= static_cast( (channelValue << 5) & 0xE0 ); } else if( channel == BLUE ) { - *(pixelData+1) &= ~0x1F; + *(pixelData+1) &= static_cast( ~0x1F ); *(pixelData+1) |= static_cast( channelValue & 0x1F ); } break; @@ -436,20 +436,20 @@ void WriteChannel( unsigned char* pixelData, { if( channel == BLUE ) { - *pixelData &= ~0xF8; + *pixelData &= static_cast( ~0xF8 ); *pixelData |= static_cast( (channelValue << 3) & 0xF8 ); } else if( channel == GREEN ) { - *pixelData &= ~0x07; + *pixelData &= static_cast( ~0x07 ); *pixelData |= static_cast( (channelValue >> 3) & 0x07 ); - *(pixelData+1) &= ~0xE0; + *(pixelData+1) &= static_cast( ~0xE0 ); *(pixelData+1) |= static_cast( (channelValue << 5) & 0xE0 ); } else if( channel == RED ) { - *(pixelData+1) &= ~0x1F; + *(pixelData+1) &= static_cast( ~0x1F ); *(pixelData+1) |= static_cast( channelValue & 0x1F ); } break; @@ -536,22 +536,22 @@ void WriteChannel( unsigned char* pixelData, { if( channel == RED ) { - *pixelData &= ~0xF0; + *pixelData &= static_cast( ~0xF0 ); *pixelData |= static_cast( (channelValue << 4) & 0xF0 ); } else if( channel == GREEN ) { - *pixelData &= ~0x0F; + *pixelData &= static_cast( ~0x0F ); *pixelData |= static_cast( channelValue & 0x0F ); } else if( channel == BLUE ) { - *(pixelData+1) &= ~0xF0; + *(pixelData+1) &= static_cast( ~0xF0 ); *(pixelData+1) |= static_cast( (channelValue << 4) & 0xF0 ); } else if( channel == ALPHA ) { - *(pixelData+1) &= ~0x0F; + *(pixelData+1) &= static_cast( ~0x0F ); *(pixelData+1) |= static_cast( channelValue & 0x0F ); } break; @@ -561,22 +561,22 @@ void WriteChannel( unsigned char* pixelData, { if( channel == BLUE ) { - *pixelData &= ~0xF0; + *pixelData &= static_cast( ~0xF0 ); *pixelData |= static_cast( (channelValue << 4) & 0xF0 ); } else if( channel == GREEN ) { - *pixelData &= ~0x0F; + *pixelData &= static_cast( ~0x0F ); *pixelData |= static_cast( channelValue & 0x0F ); } else if( channel == RED ) { - *(pixelData+1) &= ~0xF0; + *(pixelData+1) &= static_cast( ~0xF0 ); *(pixelData+1) |= static_cast( (channelValue << 4) & 0xF0 ); } else if( channel == ALPHA ) { - *(pixelData+1) &= ~0x0F; + *(pixelData+1) &= static_cast( ~0x0F ); *(pixelData+1) |= static_cast( channelValue & 0x0F ); } break; @@ -588,25 +588,25 @@ void WriteChannel( unsigned char* pixelData, // F8 7 C0 3E 1 if( channel == RED ) { - *pixelData &= ~0xF8; + *pixelData &= static_cast( ~0xF8 ); *pixelData |= static_cast( (channelValue << 3) & 0xF8 ); } else if( channel == GREEN ) { - *pixelData &= ~0x07; + *pixelData &= static_cast( ~0x07 ); *pixelData |= static_cast( (channelValue >> 2) & 0x07 ); - *(pixelData+1) &= ~0xC0; + *(pixelData+1) &= static_cast( ~0xC0 ); *(pixelData+1) |= static_cast( (channelValue << 6) & 0xC0 ); } else if( channel == BLUE ) { - *(pixelData+1) &= ~0x3E; + *(pixelData+1) &= static_cast( ~0x3E ); *(pixelData+1) |= static_cast( (channelValue << 1) & 0x3E ); } else if( channel == ALPHA ) { - *(pixelData+1) &= ~0x01; + *(pixelData+1) &= static_cast( ~0x01 ); *(pixelData+1) |= static_cast( channelValue & 0x01 ); } break; @@ -616,25 +616,25 @@ void WriteChannel( unsigned char* pixelData, { if( channel == BLUE ) { - *pixelData &= ~0xF8; + *pixelData &= static_cast( ~0xF8 ); *pixelData |= static_cast( (channelValue << 3) & 0xF8 ); } else if( channel == GREEN ) { - *pixelData &= ~0x07; + *pixelData &= static_cast( ~0x07 ); *pixelData |= static_cast( (channelValue >> 2) & 0x07 ); - *(pixelData+1) &= ~0xC0; + *(pixelData+1) &= static_cast( ~0xC0 ); *(pixelData+1) |= static_cast( (channelValue << 6) & 0xC0 ); } else if( channel == RED ) { - *(pixelData+1) &= ~0x3E; + *(pixelData+1) &= static_cast( ~0x3E ); *(pixelData+1) |= static_cast( (channelValue << 1 ) & 0x3E ); } else if( channel == ALPHA ) { - *(pixelData+1) &= ~0x01; + *(pixelData+1) &= static_cast( ~0x01 ); *(pixelData+1) |= static_cast( channelValue & 0x01 ); } break; diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp index 18e8f1c..82518f5 100644 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include // EXTERNAL INCLUDES -#include +#include #include #include #include diff --git a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h index 0cb3bca..fb8ae29 100755 --- a/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h +++ b/dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ -#define __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ +#ifndef DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H +#define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES #include @@ -197,4 +197,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__ +#endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H diff --git a/dali/internal/input/common/drag-and-drop-detector-impl.h b/dali/internal/input/common/drag-and-drop-detector-impl.h index ddfa5aa..cc755be 100644 --- a/dali/internal/input/common/drag-and-drop-detector-impl.h +++ b/dali/internal/input/common/drag-and-drop-detector-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__ -#define __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__ +#ifndef DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H +#define DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -201,4 +201,4 @@ inline const Internal::Adaptor::DragAndDropDetector& GetImplementation(const Dal } // namespace Dali -#endif // __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__ +#endif // DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H diff --git a/dali/internal/input/common/gesture-detector.h b/dali/internal/input/common/gesture-detector.h index d4e3ab7..e4b90a4 100644 --- a/dali/internal/input/common/gesture-detector.h +++ b/dali/internal/input/common/gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_GESTURE_DETECTOR_H__ -#define __DALI_INTERNAL_GESTURE_DETECTOR_H__ +#ifndef DALI_INTERNAL_GESTURE_DETECTOR_H +#define DALI_INTERNAL_GESTURE_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,4 +106,4 @@ typedef IntrusivePtr GestureDetectorPtr; } // namespace Dali -#endif // __DALI_INTERNAL_GESTURE_DETECTOR_H__ +#endif // DALI_INTERNAL_GESTURE_DETECTOR_H diff --git a/dali/internal/input/common/gesture-manager.h b/dali/internal/input/common/gesture-manager.h index 5d2d287..82a203d 100644 --- a/dali/internal/input/common/gesture-manager.h +++ b/dali/internal/input/common/gesture-manager.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_GESTURE_MANAGER_H__ -#define __DALI_INTERNAL_GESTURE_MANAGER_H__ +#ifndef DALI_INTERNAL_GESTURE_MANAGER_H +#define DALI_INTERNAL_GESTURE_MANAGER_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,4 +132,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_GESTURE_MANAGER_H__ +#endif // DALI_INTERNAL_GESTURE_MANAGER_H diff --git a/dali/internal/input/common/key-impl.h b/dali/internal/input/common/key-impl.h index 983ec73..474fe1b 100644 --- a/dali/internal/input/common/key-impl.h +++ b/dali/internal/input/common/key-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_KEY_IMPL_H__ -#define __DALI_KEY_IMPL_H__ +#ifndef DALI_KEY_IMPL_H +#define DALI_KEY_IMPL_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,4 +82,4 @@ int GetDaliKeyCode( const char* keyName ); } // namespace Dali -#endif // __DALI_KEY_IMPL_H__ +#endif // DALI_KEY_IMPL_H diff --git a/dali/internal/input/common/long-press-gesture-detector.cpp b/dali/internal/input/common/long-press-gesture-detector.cpp index 7fc75fe..2716cf4 100644 --- a/dali/internal/input/common/long-press-gesture-detector.cpp +++ b/dali/internal/input/common/long-press-gesture-detector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -209,7 +209,7 @@ bool LongPressGestureDetector::TimerCallback() void LongPressGestureDetector::EmitGesture(Gesture::State state) { - unsigned int touchPoints ( mTouchPositions.size() ); + unsigned int touchPoints ( static_cast( mTouchPositions.size() ) ); // We should tell Core about the Possible and Cancelled states regardless of whether we have satisfied long press requirements. if ( (state == Gesture::Possible) || @@ -224,7 +224,7 @@ void LongPressGestureDetector::EmitGesture(Gesture::State state) { longPress.point += iter->second; } - longPress.point /= touchPoints; + longPress.point /= static_cast( touchPoints ); longPress.time = mTouchTime; if ( state != Gesture::Possible ) diff --git a/dali/internal/input/common/long-press-gesture-detector.h b/dali/internal/input/common/long-press-gesture-detector.h index a885002..595e0e8 100644 --- a/dali/internal/input/common/long-press-gesture-detector.h +++ b/dali/internal/input/common/long-press-gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__ -#define __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__ +#ifndef DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H +#define DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,7 @@ private: unsigned int mMaximumTouchesRequired; ///< The maximum touches allowable. Any more and a long press is not emitted. std::map mTouchPositions; ///< A map with all the touch down positions. - unsigned long mTouchTime; ///< The time we first pressed down. + uint32_t mTouchTime; ///< The time we first pressed down. Dali::Timer mTimer; ///< The timer used to determine a long press. SlotDelegate< LongPressGestureDetector > mTimerSlot; @@ -128,4 +128,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__ +#endif // DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H diff --git a/dali/internal/input/common/pan-gesture-detector-base.cpp b/dali/internal/input/common/pan-gesture-detector-base.cpp index cef2a34..ad4774e 100644 --- a/dali/internal/input/common/pan-gesture-detector-base.cpp +++ b/dali/internal/input/common/pan-gesture-detector-base.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,8 @@ PanGestureDetectorBase::PanGestureDetectorBase(Vector2 screenSize, const Integra // Usually, we do not want to apply the threshold straight away, but phased over the first few pans // Set our distance to threshold adjustments ratio here. - mThresholdTotalAdjustments = minimumDistance * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO; + float fMinimumDistance = static_cast( minimumDistance ); + mThresholdTotalAdjustments = static_cast( fMinimumDistance * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ); } int minimumEvents = environmentOptions->GetMinimumPanEvents(); @@ -135,7 +136,7 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event) Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation); if ( ( mMotionEvents >= mMinimumMotionEvents ) && - ( delta.LengthSquared() >= mMinimumDistanceSquared ) ) + ( delta.LengthSquared() >= static_cast( mMinimumDistanceSquared ) ) ) { // If the touch point(s) have moved enough distance to be considered a pan, then tell Core that the pan gesture has started and change our state accordingly. mState = Started; @@ -145,7 +146,7 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event) else if (primaryPointState == PointState::UP) { Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation); - if(delta.LengthSquared() >= mMinimumDistanceSquared) + if (delta.LengthSquared() >= static_cast( mMinimumDistanceSquared ) ) { SendPan(Gesture::Started, event); mTouchEvents.push_back(event); @@ -277,7 +278,7 @@ void PanGestureDetectorBase::SendPan(Gesture::State state, const Integration::To const Integration::TouchEvent& previousEvent( *( mTouchEvents.rbegin() + 1 ) ); Vector2 previousPosition( mPreviousPosition ); - unsigned long previousTime( previousEvent.time ); + uint32_t previousTime( previousEvent.time ); // If we've just started then we want to remove the threshold from Core calculations. if ( state == Gesture::Started ) @@ -290,7 +291,7 @@ void PanGestureDetectorBase::SendPan(Gesture::State state, const Integration::To if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS ) { mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments; - mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / mThresholdTotalAdjustments; + mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast( mThresholdTotalAdjustments ); } else { @@ -306,7 +307,7 @@ void PanGestureDetectorBase::SendPan(Gesture::State state, const Integration::To if ( mThresholdAdjustmentsRemaining > 0 ) { --mThresholdAdjustmentsRemaining; - gesture.currentPosition -= mThresholdAdjustmentPerFrame * mThresholdAdjustmentsRemaining; + gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast( mThresholdAdjustmentsRemaining ); } mPreviousPosition = gesture.currentPosition; diff --git a/dali/internal/input/common/pan-gesture-detector-base.h b/dali/internal/input/common/pan-gesture-detector-base.h index 933e311..ea35e6a 100644 --- a/dali/internal/input/common/pan-gesture-detector-base.h +++ b/dali/internal/input/common/pan-gesture-detector-base.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__ -#define __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__ +#ifndef DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H +#define DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include // uint32_t #include #include #include @@ -116,7 +117,7 @@ private: unsigned int mThresholdAdjustmentsRemaining; ///< No. of threshold adjustments still to apply (for a slow-pan). unsigned int mThresholdTotalAdjustments; ///< The total number of adjustments required. - unsigned long mPrimaryTouchDownTime; ///< The initial touch down time. + uint32_t mPrimaryTouchDownTime; ///< The initial touch down time. unsigned int mMinimumTouchesRequired; ///< The minimum touches required before a pan should be emitted. unsigned int mMaximumTouchesRequired; ///< The maximum touches after which a pan should not be emitted. @@ -131,4 +132,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__ +#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H diff --git a/dali/internal/input/common/pan-gesture-detector.h b/dali/internal/input/common/pan-gesture-detector.h index c7ae582..e64574a 100644 --- a/dali/internal/input/common/pan-gesture-detector.h +++ b/dali/internal/input/common/pan-gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_PAN_GESTURE_DETECTOR_H__ -#define __DALI_INTERNAL_PAN_GESTURE_DETECTOR_H__ +#ifndef DALI_INTERNAL_PAN_GESTURE_DETECTOR_H +#define DALI_INTERNAL_PAN_GESTURE_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,4 +83,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_PAN_GESTURE_DETECTOR_H__ +#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_H diff --git a/dali/internal/input/common/physical-keyboard-impl.h b/dali/internal/input/common/physical-keyboard-impl.h index fab20ff..7bf323b 100644 --- a/dali/internal/input/common/physical-keyboard-impl.h +++ b/dali/internal/input/common/physical-keyboard-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__ -#define __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__ +#ifndef DALI_INTERNAL_PHYSICAL_KEYBOARD_H +#define DALI_INTERNAL_PHYSICAL_KEYBOARD_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,4 +116,4 @@ inline static const Internal::Adaptor::PhysicalKeyboard& GetImplementation( con } // namespace Dali -#endif // __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__ +#endif // DALI_INTERNAL_PHYSICAL_KEYBOARD_H diff --git a/dali/internal/input/common/pinch-gesture-detector.cpp b/dali/internal/input/common/pinch-gesture-detector.cpp index baeaaa0..1f7732b 100644 --- a/dali/internal/input/common/pinch-gesture-detector.cpp +++ b/dali/internal/input/common/pinch-gesture-detector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -233,8 +233,8 @@ void PinchGestureDetector::SendPinch(Gesture::State state, const Integration::To gesture.scale = currentDistance / mStartingDistance; float distanceDelta = fabsf(firstDistance - currentDistance); - unsigned long timeDelta = currentEvent.time - firstEvent.time; - gesture.speed = (distanceDelta / timeDelta) * 1000.0f; + float timeDelta = static_cast ( currentEvent.time - firstEvent.time ); + gesture.speed = ( distanceDelta / timeDelta ) * 1000.0f; gesture.centerPoint = GetCenterPoint(currentPoint1, currentPoint2); } diff --git a/dali/internal/input/common/pinch-gesture-detector.h b/dali/internal/input/common/pinch-gesture-detector.h index 9e17eab..547950f 100644 --- a/dali/internal/input/common/pinch-gesture-detector.h +++ b/dali/internal/input/common/pinch-gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H__ -#define __DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H__ +#ifndef DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H +#define DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,4 +115,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H__ +#endif // DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H diff --git a/dali/internal/input/common/tap-gesture-detector.cpp b/dali/internal/input/common/tap-gesture-detector.cpp index 320f3ce..060a12d 100644 --- a/dali/internal/input/common/tap-gesture-detector.cpp +++ b/dali/internal/input/common/tap-gesture-detector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event) case Touched: { - unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ; + uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime; if ( pointState == PointState::UP ) { @@ -108,12 +108,12 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event) { if ( pointState == PointState::UP ) { - unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ; + uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime; if ( deltaBetweenTouchDownTouchUp < MAXIMUM_TIME_ALLOWED ) { // This is a possible multiple tap, so has it been quick enough ? - unsigned long timeDelta = abs( event.time - mLastTapTime ); + uint32_t timeDelta = event.time - mLastTapTime; if ( timeDelta > MAXIMUM_TIME_ALLOWED ) // If exceeded time between taps then just a single tap. { mLastTapTime = event.time; @@ -138,7 +138,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event) Vector2 distanceDelta(abs(mTouchPosition.x - screen.x), abs(mTouchPosition.y - screen.y)); - unsigned long timeDelta = abs( event.time - mLastTapTime ); + uint32_t timeDelta = event.time - mLastTapTime; if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED || distanceDelta.y > MAXIMUM_MOTION_ALLOWED || @@ -201,7 +201,7 @@ void TapGestureDetector::Update(const Integration::GestureRequest& request) mMaximumTapsRequired = tap.maxTaps; } -void TapGestureDetector::EmitGesture( Gesture::State state, unsigned int time ) +void TapGestureDetector::EmitGesture( Gesture::State state, uint32_t time ) { if ( (state == Gesture::Cancelled) || (mTapsRegistered >= mMinimumTapsRequired && mTapsRegistered <= mMaximumTapsRequired) ) @@ -212,7 +212,7 @@ void TapGestureDetector::EmitGesture( Gesture::State state, unsigned int time ) } } -void TapGestureDetector::EmitSingleTap( unsigned int time, const Integration::Point& point ) +void TapGestureDetector::EmitSingleTap( uint32_t time, const Integration::Point& point ) { Integration::TapGestureEvent event( Gesture::Started ); const Vector2& screen( point.GetScreenPosition() ); @@ -228,7 +228,7 @@ void TapGestureDetector::EmitSingleTap( unsigned int time, const Integration::Po EmitTap( time, event ); } -void TapGestureDetector::EmitTap( unsigned int time, Integration::TapGestureEvent& event ) +void TapGestureDetector::EmitTap( uint32_t time, Integration::TapGestureEvent& event ) { event.numberOfTaps = mTapsRegistered; event.point = mTouchPosition; diff --git a/dali/internal/input/common/tap-gesture-detector.h b/dali/internal/input/common/tap-gesture-detector.h index 8090eae..4dd5e55 100644 --- a/dali/internal/input/common/tap-gesture-detector.h +++ b/dali/internal/input/common/tap-gesture-detector.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__ -#define __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__ +#ifndef DALI_INTERNAL_TAP_GESTURE_DETECTOR_H +#define DALI_INTERNAL_TAP_GESTURE_DETECTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include // uint32_t #include #include #include @@ -83,7 +84,7 @@ private: * @param[in] state current state of incomplete gesture * @param[in] time time of this latest touch event */ - void EmitGesture( Gesture::State state, unsigned int time ); + void EmitGesture( Gesture::State state, uint32_t time ); /** * Initialises tap gesture detector for next tap sequence @@ -106,7 +107,7 @@ private: * @param[in] time time of this latest touch event * @param[in] point position touch event occurred */ - void EmitSingleTap( unsigned int time, const Integration::Point& point ); + void EmitSingleTap( uint32_t time, const Integration::Point& point ); /** * Emit a tap event @@ -114,7 +115,7 @@ private: * @param[in] time time of this latest touch event * @param[in] event registered touch event */ - void EmitTap( unsigned int time, Integration::TapGestureEvent& event ); + void EmitTap( uint32_t time, Integration::TapGestureEvent& event ); private: @@ -137,8 +138,8 @@ private: int mTapsRegistered; ///< In current detection, the number of taps registered. Vector2 mTouchPosition; ///< The initial touch down position. - unsigned long mTouchTime; ///< The initial touch down time. - unsigned long mLastTapTime; ///< Time last tap gesture was registered + uint32_t mTouchTime; ///< The initial touch down time. + uint32_t mLastTapTime; ///< Time last tap gesture was registered }; @@ -148,4 +149,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__ +#endif // DALI_INTERNAL_TAP_GESTURE_DETECTOR_H diff --git a/dali/internal/input/common/virtual-keyboard-impl.h b/dali/internal/input/common/virtual-keyboard-impl.h index 711a21b..da0fccb 100755 --- a/dali/internal/input/common/virtual-keyboard-impl.h +++ b/dali/internal/input/common/virtual-keyboard-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_VIRTUAL_KEYBOARD_H__ -#define __DALI_INTERNAL_VIRTUAL_KEYBOARD_H__ +#ifndef DALI_INTERNAL_VIRTUAL_KEYBOARD_H +#define DALI_INTERNAL_VIRTUAL_KEYBOARD_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,4 +99,4 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection(); } // namespace Dali -#endif // __DALI_INTERNAL_VIRTUAL_KEYBOARD_H__ +#endif // DALI_INTERNAL_VIRTUAL_KEYBOARD_H diff --git a/dali/internal/input/linux/dali-ecore-imf.h b/dali/internal/input/linux/dali-ecore-imf.h new file mode 100644 index 0000000..62aef33 --- /dev/null +++ b/dali/internal/input/linux/dali-ecore-imf.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_INPUT_LINUX_DALI_ECORE_IMF_H +#define DALI_INTERNAL_INPUT_LINUX_DALI_ECORE_IMF_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_INPUT_LINUX_DALI_ECORE_IMF_H */ diff --git a/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.cpp b/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.cpp index ed453a4..1a63ccf 100755 --- a/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.cpp +++ b/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ #include // INTERNAL INCLUDES -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" #include #include #include @@ -154,7 +151,7 @@ void ApplySettings( const Property::Map& settingsMap ) { using namespace InputMethod; // Allows exclusion of namespace in TOKEN_STRING. - for ( unsigned int i = 0, count = settingsMap.Count(); i < count; ++i ) + for ( unsigned long i = 0, count = settingsMap.Count(); i < count; ++i ) { Property::Key key = settingsMap.GetKeyAt( i ); if( key.type == Property::Key::INDEX ) @@ -211,5 +208,3 @@ Dali::VirtualKeyboard::TextDirection GetTextDirection() } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h b/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h index 85e9b74..0226342 100644 --- a/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h +++ b/dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H__ -#define __DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H__ +#ifndef DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H +#define DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include // INTERNAL INCLUDES #include @@ -61,4 +61,4 @@ void DisconnectCallbacks( Ecore_IMF_Context *imfContext ); } // namespace Dali -#endif // __DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H__ +#endif // DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 34255a5..ef4fc15 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,6 @@ */ // CLASS HEADER -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" #include @@ -977,7 +974,7 @@ bool InputMethodContextEcoreWl::ProcessEventKeyDown( const KeyEvent& keyEvent ) { eventHandled = ecore_imf_context_filter_event(mIMFContext, ECORE_IMF_EVENT_KEY_DOWN, - (Ecore_IMF_Event *) &ecoreKeyDownEvent); + reinterpret_cast( &ecoreKeyDownEvent ) ); } // If the event has not been handled by InputMethodContext then check if we should reset our input method context @@ -1020,7 +1017,7 @@ bool InputMethodContextEcoreWl::ProcessEventKeyUp( const KeyEvent& keyEvent ) eventHandled = ecore_imf_context_filter_event(mIMFContext, ECORE_IMF_EVENT_KEY_UP, - (Ecore_IMF_Event *) &ecoreKeyUpEvent); + reinterpret_cast( &ecoreKeyUpEvent ) ); } return eventHandled; } @@ -1084,5 +1081,3 @@ Ecore_IMF_Keyboard_Locks InputMethodContextEcoreWl::EcoreInputModifierToEcoreIMF } // Internal } // Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h index 4630637..eca83cd 100755 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H -#define __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H +#ifndef DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H +#define DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ */ // EXTERNAL INCLUDES -#include -#include +#include +#include #include #include @@ -317,4 +317,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H +#endif // DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H diff --git a/dali/internal/input/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp index f1fe613..4c664ac 100755 --- a/dali/internal/input/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/virtual-keyboard-impl-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ #include // EXTERNAL INCLUDES -#include -#include +#include +#include #include #include diff --git a/dali/internal/input/ubuntu-x11/dali-ecore-input.h b/dali/internal/input/ubuntu-x11/dali-ecore-input.h new file mode 100644 index 0000000..4598b70 --- /dev/null +++ b/dali/internal/input/ubuntu-x11/dali-ecore-input.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_INPUT_UBUNTU_X11_DALI_ECORE_INPUT_H +#define DALI_INTERNAL_INPUT_UBUNTU_X11_DALI_ECORE_INPUT_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_INPUT_UBUNTU_X11_DALI_ECORE_INPUT_H */ diff --git a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp index 7a2ab0e..add026d 100755 --- a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp +++ b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ #include // EXTERNAL INCLUDES -#include -#include +#include +#include #include #include #include @@ -33,9 +33,6 @@ #include #include #include -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" #include namespace Dali @@ -357,7 +354,7 @@ void InputMethodContextX::PreEditChanged( void*, ImfContext* imfContext, void* e const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character. if ( byteIndex == attr->end_index ) { - cursorPosition = visualCharacterIndex; + cursorPosition = static_cast( visualCharacterIndex ); break; // end loop as found cursor position that matches byte position } @@ -785,7 +782,7 @@ bool InputMethodContextX::ProcessEventKeyDown( const KeyEvent& keyEvent ) { eventHandled = ecore_imf_context_filter_event(mIMFContext, ECORE_IMF_EVENT_KEY_DOWN, - (Ecore_IMF_Event *) &ecoreKeyDownEvent); + reinterpret_cast( &ecoreKeyDownEvent )); } // If the event has not been handled by InputMethodContext then check if we should reset our IMFcontext @@ -827,7 +824,7 @@ bool InputMethodContextX::ProcessEventKeyUp( const KeyEvent& keyEvent ) eventHandled = ecore_imf_context_filter_event(mIMFContext, ECORE_IMF_EVENT_KEY_UP, - (Ecore_IMF_Event *) &ecoreKeyUpEvent); + reinterpret_cast( &ecoreKeyUpEvent )); } return eventHandled; } @@ -891,5 +888,3 @@ Ecore_IMF_Keyboard_Locks InputMethodContextX::EcoreInputModifierToEcoreIMFLock( } // Internal } // Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h index 95ea0d5..c12d777 100755 --- a/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h +++ b/dali/internal/input/ubuntu-x11/input-method-context-impl-x.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H -#define __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H +#ifndef DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H +#define DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ */ // EXTERNAL INCLUDES -#include -#include +#include +#include #include @@ -317,4 +317,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H +#endif // DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H diff --git a/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp b/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp index 7271fd3..864814d 100755 --- a/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp +++ b/dali/internal/input/ubuntu-x11/virtual-keyboard-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include #include @@ -75,7 +75,7 @@ void RotateTo(int angle) // Get Focus window XGetInputFocus(display, &focusWindow, &revert); - ecore_x_window_prop_property_set( focusWindow, + ecore_x_window_prop_property_set( static_cast( focusWindow ), ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE, ECORE_X_ATOM_CARDINAL, 32, &angle, 1 ); XCloseDisplay(display); diff --git a/dali/internal/system/linux/callback-manager-ecore.cpp b/dali/internal/system/linux/callback-manager-ecore.cpp index 8398a75..286c946 100644 --- a/dali/internal/system/linux/callback-manager-ecore.cpp +++ b/dali/internal/system/linux/callback-manager-ecore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,7 @@ #include // EXTERNAL INCLUDES -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#include +#include #include @@ -270,5 +267,3 @@ CallbackManager* CallbackManager::New() } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/system/linux/dali-ecore-x.h b/dali/internal/system/linux/dali-ecore-x.h new file mode 100644 index 0000000..e9c0cd9 --- /dev/null +++ b/dali/internal/system/linux/dali-ecore-x.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_X_H +#define DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_X_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_X_H */ diff --git a/dali/internal/system/linux/dali-ecore.h b/dali/internal/system/linux/dali-ecore.h new file mode 100644 index 0000000..61fb714 --- /dev/null +++ b/dali/internal/system/linux/dali-ecore.h @@ -0,0 +1,26 @@ +#ifndef DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_H +#define DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_H */ diff --git a/dali/internal/system/linux/dali-elementary.h b/dali/internal/system/linux/dali-elementary.h new file mode 100644 index 0000000..1621aff --- /dev/null +++ b/dali/internal/system/linux/dali-elementary.h @@ -0,0 +1,25 @@ +#ifndef DALI_INTERNAL_SYSTEM_LINUX_DALI_ELEMENTARY_H +#define DALI_INTERNAL_SYSTEM_LINUX_DALI_ELEMENTARY_H + +/* + * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#pragma GCC system_header +#include + + + +#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ELEMENTARY_H */ diff --git a/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp b/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp index 2cfa602..88e9de3 100644 --- a/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp +++ b/dali/internal/system/linux/file-descriptor-monitor-ecore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,7 @@ #include // EXTERNAL INCLUDES -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#include +#include // INTERNAL INCLUDES #include @@ -147,5 +144,3 @@ FileDescriptorMonitor::~FileDescriptorMonitor() } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/system/linux/timer-impl-ecore.cpp b/dali/internal/system/linux/timer-impl-ecore.cpp index 46ef603..fde050d 100644 --- a/dali/internal/system/linux/timer-impl-ecore.cpp +++ b/dali/internal/system/linux/timer-impl-ecore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,7 @@ #include #include -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#include +#include namespace Dali { @@ -90,7 +87,8 @@ void Timer::Start() { Stop(); } - mImpl->mId = ecore_timer_add( (double)mImpl->mInterval/1000.0f, (Ecore_Task_Cb)TimerSourceFunc, this ); + double interval = static_cast ( mImpl->mInterval ) / 1000.0f; + mImpl->mId = ecore_timer_add( interval, reinterpret_cast( TimerSourceFunc ), this ); } void Timer::Stop() @@ -196,5 +194,3 @@ bool Timer::IsRunning() const } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/system/ubuntu-x11/system-settings-x.cpp b/dali/internal/system/ubuntu-x11/system-settings-x.cpp index 2e612e1..e0b9b57 100644 --- a/dali/internal/system/ubuntu-x11/system-settings-x.cpp +++ b/dali/internal/system/ubuntu-x11/system-settings-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,6 @@ * */ -// EXTERNAL INCLUDES -#ifndef DALI_PROFILE_UBUNTU -#include -#endif // DALI_PROFILE_UBUNTU -#include - // INTERNAL INCLUDES #include @@ -35,12 +29,7 @@ namespace Adaptor int GetElmAccessActionOver() { -#ifndef DALI_PROFILE_UBUNTU - // ELM_ACCESS_ACTION_OVER not available in common profile - return ELM_ACCESS_ACTION_LAST; -#else // DALI_PROFILE_UBUNTU return 0; -#endif // DALI_PROFILE_UBUNTU } int GetLongPressTime( int defaultTime ) diff --git a/dali/internal/window-system/common/damage-observer.h b/dali/internal/window-system/common/damage-observer.h index d0a2316..b6442a7 100644 --- a/dali/internal/window-system/common/damage-observer.h +++ b/dali/internal/window-system/common/damage-observer.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_DAMAGE_OBSERVER_H__ -#define __DALI_INTERNAL_DAMAGE_OBSERVER_H__ +#ifndef DALI_INTERNAL_DAMAGE_OBSERVER_H +#define DALI_INTERNAL_DAMAGE_OBSERVER_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,4 +69,4 @@ protected: } // namespace Dali -#endif // __DALI_INTERNAL_DAMAGE_OBSERVER_H__ +#endif // DALI_INTERNAL_DAMAGE_OBSERVER_H diff --git a/dali/internal/window-system/common/ecore-server-connection.cpp b/dali/internal/window-system/common/ecore-server-connection.cpp deleted file mode 100644 index 61b48e2..0000000 --- a/dali/internal/window-system/common/ecore-server-connection.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// EXTERNAL INCLUDES -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" -#include - -#include - -// INTERNAL INCLUDES - -namespace -{ -// Copied from ecore_evas_extn_engine.h -// procotol version - change this as needed -const int MAJOR( 0x2011 ); -} - - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ -#if defined(DEBUG_ENABLED) -Debug::Filter* gServerConnectionLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SERVER_CONNECTION"); -#endif - -ServerConnection::ServerConnection( - const char* serviceName, - int serviceNumber, - bool isSystem, - ServerConnection::Observer* observer) - -: mConnected(false), - mObserver(observer) -{ - Ecore_Ipc_Type ipctype = ECORE_IPC_LOCAL_USER; - - ecore_ipc_init(); - mService.name = eina_stringshare_add(serviceName); - mService.num = serviceNumber; - mService.isSystem = isSystem; - - if( mService.isSystem ) - { - ipctype = ECORE_IPC_LOCAL_SYSTEM; - } - - DALI_LOG_INFO( gServerConnectionLogFilter, Debug::General, "ServerConnection: Connecting to %s %d\n", mService.name, mService.num ); - - mIpcServer = ecore_ipc_server_connect( ipctype, (char *)mService.name, mService.num, this ); - - if( !mIpcServer ) - { - DALI_LOG_INFO( gServerConnectionLogFilter, Debug::General, "mIpcServer is null\n" ); - ecore_ipc_shutdown(); - } - else - { - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_ADD, - &ServerConnection::IpcServerAdd, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DEL, - &ServerConnection::IpcServerDel, - this ) ); - - mIpcHandlers.push_back( ecore_event_handler_add( ECORE_IPC_EVENT_SERVER_DATA, - &ServerConnection::IpcServerData, - this)); - - mConnected = true; - } -} - -ServerConnection::~ServerConnection() -{ - CloseConnection(); - - if( mService.name != NULL ) - { - eina_stringshare_del(mService.name); - } - - for( Handlers::iterator iter = mIpcHandlers.begin(); iter != mIpcHandlers.end(); ++iter ) - { - ecore_event_handler_del(*iter); - } - mIpcHandlers.clear(); -} - -bool ServerConnection::IsConnected() -{ - return mConnected; -} - -void ServerConnection::OnDisconnect() -{ - mConnected = false; - mIpcServer = NULL; - ecore_ipc_shutdown(); - if( mObserver ) - { - mObserver->ConnectionClosed(); - } -} - -bool ServerConnection::SendEvent( int event, const void *data, int size ) -{ - return SendEvent(event, 0, 0, data, size); -} - -bool ServerConnection::SendEvent( int event, int ref, int ref_to, const void *data, int size ) -{ - if( mIpcServer != NULL && ecore_ipc_server_send(mIpcServer, MAJOR, event, ref, ref_to, 0, data, size) ) - { - return true; - } - else - { - return false; - } -} - -Eina_Bool ServerConnection::IpcServerAdd( void *data, int /*type*/, void *event ) -{ - DALI_LOG_INFO(gServerConnectionLogFilter, Debug::General, "ServerConnection: IpcServerAdd\n" ); - - return ECORE_CALLBACK_PASS_ON; -} - -Eina_Bool ServerConnection::IpcServerDel( void *data, int /*type*/, void *event ) -{ - DALI_LOG_INFO( gServerConnectionLogFilter, Debug::General, "ServerConnection: IpcServerDel\n" ); - - Ecore_Ipc_Event_Server_Del *e = static_cast( event ); - ServerConnection* connection = static_cast( data ); - - if( connection != NULL ) - { - if( connection->mIpcServer == e->server) - { - // No longer have a server connection - connection->OnDisconnect(); - } - } - - return ECORE_CALLBACK_PASS_ON; -} - -Eina_Bool ServerConnection::IpcServerData( void *data, int /*type*/, void *event ) -{ - DALI_LOG_INFO( gServerConnectionLogFilter, Debug::General, "ServerConnection: IpcServerData\n" ); - - Ecore_Ipc_Event_Server_Data *e = static_cast( event ); - ServerConnection* connection = static_cast( data ); - - if( connection != NULL ) - { - if( connection != ecore_ipc_server_data_get( e->server ) ) - { - return ECORE_CALLBACK_PASS_ON; - } - - if( e->major != MAJOR ) - { - return ECORE_CALLBACK_PASS_ON; - } - - if( connection->mObserver ) - { - connection->mObserver->DataReceived( event ); - } - } - return ECORE_CALLBACK_PASS_ON; -} - -void ServerConnection::CloseConnection() -{ - if( mConnected ) - { - DALI_LOG_INFO( gServerConnectionLogFilter, Debug::General, "ServerConnection: CloseConnection\n" ); - - if( mIpcServer ) - { - ecore_ipc_server_del( mIpcServer ); - mIpcServer = NULL; - } - - ecore_ipc_shutdown(); - mConnected = false; - } -} - -} // Adaptor - -} // Internal - -} // Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/window-system/common/ecore-server-connection.h b/dali/internal/window-system/common/ecore-server-connection.h deleted file mode 100644 index d81cdfe..0000000 --- a/dali/internal/window-system/common/ecore-server-connection.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_ -#define __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_ - -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include -#include - -#include - -namespace Dali -{ -namespace Internal -{ -namespace Adaptor -{ - -/** - * Makes a connection to a given service as a client - */ -class ServerConnection -{ -public: - /** - * Observes the connection for data and connection closure - */ - class Observer - { - public: - /** - * Inform that data has been received on the connection - * @param[in] event The event that has been received - */ - virtual void DataReceived(void* event) = 0; - - /** - * Inform the observer that the connection has closed - */ - virtual void ConnectionClosed() = 0; - }; - -public: - /** - * Constructor - * @param[in] serviceName The name of the service - * @param[in] serviceNumber The number of the service - * @param[in] isSystem Whether to connect as local user or system user - * @param[in] observer The connection observer - */ - ServerConnection(const char *serviceName, int serviceNumber, bool isSystem, Observer* observer); - - /** - * Destructor - */ - ~ServerConnection(); - - /** - * Test if the connection is still alive - * @return True if the connection is still alive - */ - bool IsConnected(); - - /** - * Disconnect from the server. Will trigger ConnectionClosed() observer callback - */ - void OnDisconnect(); - - /** - * Send an event to the server. - * @param[in] event Event id - * @param[in] data Pointer to the event data - * @param[in] size Size of the event data - * @return whether the event is sent successfully or not - */ - bool SendEvent( int event, const void *data, int size ); - - /** - * Send an event to the server. - * @param[in] event Event id - * @param[in] ref Message Reference number - * @param[in] refTo Reference number of the message this refers to - * @param[in] data Pointer to the event data - * @param[in] size Size of the event data - * @return whether the event is sent successfully or not - */ - bool SendEvent( int event, int ref, int refTo, const void *data, int size ); - -private: // Class callbacks - /** - * Callback when server added - */ - static Eina_Bool IpcServerAdd(void *data, int type, void *event); - - /** - * Callback when server deleted - */ - static Eina_Bool IpcServerDel(void *data, int type, void *event); - - /** - * Callback when data available from server - */ - static Eina_Bool IpcServerData(void *data, int type, void *event); - -private: - - ServerConnection( const ServerConnection& ); ///< Undefined - ServerConnection& operator=( const ServerConnection& ); ///< Undefined - - void CloseConnection(); - -private: - typedef std::vector Handlers; - - struct Service - { - const char *name; - int num; - bool isSystem; - }; - - Service mService; - bool mConnected; - Observer* mObserver; - Ecore_Ipc_Server* mIpcServer; - Handlers mIpcHandlers; -}; - -} // Adaptor -} // Internal -} // Dali - -#endif // __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_ diff --git a/dali/internal/window-system/common/event-handler.cpp b/dali/internal/window-system/common/event-handler.cpp index 692c1b4..0c21cf4 100755 --- a/dali/internal/window-system/common/event-handler.cpp +++ b/dali/internal/window-system/common/event-handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ namespace { // Copied from x server -static unsigned int GetCurrentMilliSeconds(void) +static uint32_t GetCurrentMilliSeconds(void) { struct timeval tv; @@ -89,11 +89,11 @@ static unsigned int GetCurrentMilliSeconds(void) } if (clockid != ~0L && clock_gettime(clockid, &tp) == 0) { - return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L); + return static_cast( (tp.tv_sec * 1000 ) + (tp.tv_nsec / 1000000L) ); } gettimeofday(&tv, NULL); - return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); + return static_cast( (tv.tv_sec * 1000 ) + (tv.tv_usec / 1000) ); } } // unnamed namespace @@ -138,7 +138,7 @@ EventHandler::~EventHandler() mGestureManager.Stop(); } -void EventHandler::SendEvent( Integration::Point& point, unsigned long timeStamp ) +void EventHandler::SendEvent( Integration::Point& point, uint32_t timeStamp ) { if( timeStamp < 1 ) { @@ -224,7 +224,7 @@ void EventHandler::SendRotationRequestEvent( ) // No need to separate event into prepare and request } -void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp) +void EventHandler::FeedTouchPoint( TouchPoint& point, uint32_t timeStamp) { Integration::Point convertedPoint( point ); SendEvent( convertedPoint, timeStamp ); @@ -283,7 +283,7 @@ void EventHandler::SetRotationObserver( RotationObserver* observer ) mRotationObserver = observer; } -void EventHandler::OnTouchEvent( Integration::Point& point, unsigned long timeStamp ) +void EventHandler::OnTouchEvent( Integration::Point& point, uint32_t timeStamp ) { SendEvent( point, timeStamp ); } @@ -627,20 +627,20 @@ void EventHandler::ConvertTouchPosition( Integration::Point& point ) { case 90: { - convertedPosition.x = mWindowWidth - position.y; + convertedPosition.x = static_cast( mWindowWidth ) - position.y; convertedPosition.y = position.x; break; } case 180: { - convertedPosition.x = mWindowWidth - position.x; - convertedPosition.y = mWindowHeight - position.y; + convertedPosition.x = static_cast( mWindowWidth ) - position.x; + convertedPosition.y = static_cast( mWindowHeight ) - position.y; break; } case 270: { convertedPosition.x = position.y; - convertedPosition.y = mWindowHeight - position.x; + convertedPosition.y = static_cast( mWindowHeight ) - position.x; break; } default: diff --git a/dali/internal/window-system/common/event-handler.h b/dali/internal/window-system/common/event-handler.h index d0f73e7..9005530 100755 --- a/dali/internal/window-system/common/event-handler.h +++ b/dali/internal/window-system/common/event-handler.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_EVENT_HANDLER_H__ -#define __DALI_INTERNAL_EVENT_HANDLER_H__ +#ifndef DALI_INTERNAL_EVENT_HANDLER_H +#define DALI_INTERNAL_EVENT_HANDLER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include // uint32_t #include #include @@ -83,7 +84,7 @@ public: * Feed (Send) touch event to core and gesture manager * @param[in] touchEvent The touch event holding the touch point information. */ - void FeedTouchPoint( TouchPoint& point, int timeStamp ); + void FeedTouchPoint( TouchPoint& point, uint32_t timeStamp ); /** * Feed (Send) wheel event to core and gesture manager @@ -126,7 +127,7 @@ private: * @param[in] point The touch point information. * @param[in] timeStamp The time the touch occurred. */ - void SendEvent(Integration::Point& point, unsigned long timeStamp); + void SendEvent(Integration::Point& point, uint32_t timeStamp); /** * Send key event to core. @@ -172,7 +173,7 @@ private: /** * Called when a touch event is received. */ - void OnTouchEvent( Integration::Point& point, unsigned long timeStamp ); + void OnTouchEvent( Integration::Point& point, uint32_t timeStamp ); /** * Called when a mouse wheel is received. @@ -256,4 +257,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_EVENT_HANDLER_H__ +#endif // DALI_INTERNAL_EVENT_HANDLER_H diff --git a/dali/internal/window-system/common/orientation-impl.h b/dali/internal/window-system/common/orientation-impl.h index e48ff0e..47c058d 100644 --- a/dali/internal/window-system/common/orientation-impl.h +++ b/dali/internal/window-system/common/orientation-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_ORIENTATION_H__ -#define __DALI_INTERNAL_ORIENTATION_H__ +#ifndef DALI_INTERNAL_ORIENTATION_H +#define DALI_INTERNAL_ORIENTATION_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -149,4 +149,4 @@ inline const Orientation& GetImplementation(const Dali::Orientation& orientation } // namespace Dali -#endif // __DALI_INTERNAL_ORIENTATION_H__ +#endif // DALI_INTERNAL_ORIENTATION_H diff --git a/dali/internal/window-system/common/rotation-observer.h b/dali/internal/window-system/common/rotation-observer.h index 034b082..46ad874 100644 --- a/dali/internal/window-system/common/rotation-observer.h +++ b/dali/internal/window-system/common/rotation-observer.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_ROTATION_OBSERVER_H__ -#define __DALI_INTERNAL_ROTATION_OBSERVER_H__ +#ifndef DALI_INTERNAL_ROTATION_OBSERVER_H +#define DALI_INTERNAL_ROTATION_OBSERVER_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,4 +79,4 @@ protected: } // namespace Dali -#endif // __DALI_INTERNAL_ROTATION_OBSERVER_H__ +#endif // DALI_INTERNAL_ROTATION_OBSERVER_H diff --git a/dali/internal/window-system/common/window-base.cpp b/dali/internal/window-system/common/window-base.cpp index bd1337a..8c63be3 100644 --- a/dali/internal/window-system/common/window-base.cpp +++ b/dali/internal/window-system/common/window-base.cpp @@ -118,5 +118,3 @@ WindowBase::AccessibilitySignalType& WindowBase::AccessibilitySignal() } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 1642a3e..e93287e 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ #include #include #include +#include namespace Dali { @@ -70,7 +71,7 @@ public: typedef Signal< void ( const RotationEvent& ) > RotationSignalType; // Input events - typedef Signal< void ( Integration::Point&, unsigned long ) > TouchEventSignalType; + typedef Signal< void ( Integration::Point&, uint32_t ) > TouchEventSignalType; typedef Signal< void ( WheelEvent& ) > WheelEventSignalType; typedef Signal< void( Integration::KeyEvent& ) > KeyEventSignalType; diff --git a/dali/internal/window-system/common/window-event-interface.h b/dali/internal/window-system/common/window-event-interface.h index e8dc98d..c9d9c8b 100644 --- a/dali/internal/window-system/common/window-event-interface.h +++ b/dali/internal/window-system/common/window-event-interface.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H__ -#define __DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H__ +#ifndef DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H +#define DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,4 +107,4 @@ protected: } // namespace Dali -#endif // __DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H__ +#endif // DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H diff --git a/dali/internal/window-system/common/window-visibility-observer.h b/dali/internal/window-system/common/window-visibility-observer.h index 0c8a9c8..179c0de 100644 --- a/dali/internal/window-system/common/window-visibility-observer.h +++ b/dali/internal/window-system/common/window-visibility-observer.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H__ -#define __DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H__ +#ifndef DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H +#define DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,4 +67,4 @@ protected: } // namespace Dali -#endif // __DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H__ +#endif // DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H diff --git a/dali/internal/window-system/file.list b/dali/internal/window-system/file.list index b52444d..ef02bc9 100644 --- a/dali/internal/window-system/file.list +++ b/dali/internal/window-system/file.list @@ -3,7 +3,6 @@ # module: window-system, backend: common adaptor_window_system_common_src_files=\ ${adaptor_window_system_dir}/common/display-connection.cpp \ - ${adaptor_window_system_dir}/common/ecore-server-connection.cpp \ ${adaptor_window_system_dir}/common/event-handler.cpp \ ${adaptor_window_system_dir}/common/native-render-surface-factory.cpp \ ${adaptor_window_system_dir}/common/orientation-impl.cpp \ diff --git a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp index ba1af14..1e85ebe 100644 --- a/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include // EXTERNAL_HEADERS -#include +#include #include // INTERNAL HEADERS diff --git a/dali/internal/window-system/ubuntu-x11/ecore-x-types.h b/dali/internal/window-system/ubuntu-x11/ecore-x-types.h index f425033..e5bc6c9 100644 --- a/dali/internal/window-system/ubuntu-x11/ecore-x-types.h +++ b/dali/internal/window-system/ubuntu-x11/ecore-x-types.h @@ -1,8 +1,8 @@ -#ifndef __DALI_X11_TYPES_H__ -#define __DALI_X11_TYPES_H__ +#ifndef DALI_X11_TYPES_H +#define DALI_X11_TYPES_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,4 +31,4 @@ typedef ::Screen XScreen; } // namespace Dali -#endif /* __DALI_X11_TYPES_H__ */ +#endif /* DALI_X11_TYPES_H */ diff --git a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h index 1f4a305..1e51708 100644 --- a/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h @@ -2,7 +2,7 @@ #define DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ // EXTERNAL INCLUDES #include -#include +#include namespace Dali diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index cc99dfd..e2f650b 100755 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,6 @@ * */ -// Ecore is littered with C style cast -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wold-style-cast" - // CLASS HEADER #include @@ -31,7 +27,7 @@ #include #include #include -#include +#include namespace Dali { @@ -468,7 +464,7 @@ void WindowBaseEcoreX::OnMouseButtonUp( void* data, int type, void* event ) point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) ); point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) ); point.SetPressure( touchEvent->multi.pressure ); - point.SetAngle( Degree( touchEvent->multi.angle ) ); + point.SetAngle( Degree( static_cast( touchEvent->multi.angle ) ) ); if( touchEvent->buttons) { point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) ); @@ -487,10 +483,10 @@ void WindowBaseEcoreX::OnMouseButtonMove( void* data, int type, void* event ) Integration::Point point; point.SetDeviceId( touchEvent->multi.device ); point.SetState( PointState::MOTION ); - point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) ); - point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) ); - point.SetPressure( touchEvent->multi.pressure ); - point.SetAngle( Degree( touchEvent->multi.angle ) ); + point.SetScreenPosition( Vector2( static_cast( touchEvent->x ), static_cast( touchEvent->y ) ) ); + point.SetRadius( static_cast( touchEvent->multi.radius ), Vector2( static_cast( touchEvent->multi.radius_x ), static_cast( touchEvent->multi.radius_y ) ) ); + point.SetPressure( static_cast( touchEvent->multi.pressure ) ); + point.SetAngle( Degree( static_cast( touchEvent->multi.angle ) ) ); mTouchEventSignal.Emit( point, touchEvent->timestamp ); } @@ -504,7 +500,7 @@ void WindowBaseEcoreX::OnMouseWheel( void* data, int type, void* event ) { DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreX::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z ); - WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); + WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( static_cast( mouseWheelEvent->x ), static_cast( mouseWheelEvent->y ) ), mouseWheelEvent->z, mouseWheelEvent->timestamp ); mWheelEventSignal.Emit( wheelEvent ); } @@ -826,15 +822,11 @@ bool WindowBaseEcoreX::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali void WindowBaseEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { - // calculate DPI - float xres, yres; - // 1 inch = 25.4 millimeters - xres = ecore_x_dpi_get(); - yres = ecore_x_dpi_get(); + // ecore does not account for differing DPI in the x and y axes, so only get for x is available - dpiHorizontal = int( xres + 0.5f ); // rounding - dpiVertical = int( yres + 0.5f ); + dpiHorizontal = ecore_x_dpi_get(); + dpiVertical = ecore_x_dpi_get(); } int WindowBaseEcoreX::GetScreenRotationAngle() @@ -870,7 +862,7 @@ unsigned int WindowBaseEcoreX::GetSurfaceId( Any surface ) const } else { - surfaceId = AnyCast< XWindow >( surface ); + surfaceId = static_cast( AnyCast< XWindow >( surface ) ); } } return surfaceId; @@ -901,5 +893,3 @@ void WindowBaseEcoreX::CreateWindow( PositionSize positionSize, bool isTranspare } // namespace Internal } // namespace Dali - -#pragma GCC diagnostic pop diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 7b29723..c30eba6 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ #include // EXTERNAL HEADERS -#include -#include +#include +#include namespace Dali { diff --git a/dali/internal/window-system/ubuntu-x11/window-interface-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-interface-ecore-x.h index e28fa28..b9e0b3b 100644 --- a/dali/internal/window-system/ubuntu-x11/window-interface-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-interface-ecore-x.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__ -#define __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__ +#ifndef DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H +#define DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include // INTERNAL INCLUDES @@ -83,4 +83,4 @@ namespace WindowInterface } // namespace Dali -#endif // __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__ +#endif // DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H diff --git a/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp index 23341c5..20b141c 100644 --- a/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-system-ecore-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include // EXTERNAL_HEADERS -#include +#include namespace Dali { diff --git a/third-party/glyphy/glyphy-geometry.hh b/third-party/glyphy/glyphy-geometry.hh index c9b26ef..bf76761 100644 --- a/third-party/glyphy/glyphy-geometry.hh +++ b/third-party/glyphy/glyphy-geometry.hh @@ -588,7 +588,10 @@ inline double Arc::extended_dist (const Point &p) const { Point m = p0.lerp (.5, p1); Vector dp = p1 - p0; Vector pp = dp.ortho (); - float d2 = tan2atan (d); + /* + * In the original file, there was no explicit cast to float. + */ + float d2 = static_cast( tan2atan (d) ); if ((p - m) * (p1 - m) < 0) return (p - p0) * (pp + dp * d2).normalized (); else diff --git a/third-party/glyphy/vector-font-cache.cpp b/third-party/glyphy/vector-font-cache.cpp index 9f48f9e..434d9e9 100644 --- a/third-party/glyphy/vector-font-cache.cpp +++ b/third-party/glyphy/vector-font-cache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,15 +104,15 @@ struct VectorGlyph if( endpoints.size() ) { - glyphy_outline_winding_from_even_odd( &endpoints[0], endpoints.size (), false ); + glyphy_outline_winding_from_even_odd( &endpoints[0], static_cast( endpoints.size() ), false ); } unsigned int blobLength( 0 ); double averageFetchAchieved( 0.0 ); if (!glyphy_arc_list_encode_blob( endpoints.size() ? &endpoints[0] : NULL, - endpoints.size(), + static_cast( endpoints.size() ), &newGlyph->blobData[0], - newGlyph->blobData.capacity(), + static_cast( newGlyph->blobData.capacity() ), upem / ( MIN_FONT_SIZE * M_SQRT2 ), 4, &averageFetchAchieved, @@ -142,14 +142,14 @@ struct VectorGlyph } else { - newGlyph->glyphInfo.width = (newGlyph->extents.max_x - newGlyph->extents.min_x); - newGlyph->glyphInfo.height = (newGlyph->extents.max_y - newGlyph->extents.min_y); + newGlyph->glyphInfo.width = static_cast( newGlyph->extents.max_x - newGlyph->extents.min_x ); + newGlyph->glyphInfo.height = static_cast( newGlyph->extents.max_y - newGlyph->extents.min_y ); - newGlyph->glyphInfo.xBearing = newGlyph->extents.min_x; - newGlyph->glyphInfo.yBearing = newGlyph->glyphInfo.height + (newGlyph->extents.min_y); + newGlyph->glyphInfo.xBearing = static_cast( newGlyph->extents.min_x ); + newGlyph->glyphInfo.yBearing = newGlyph->glyphInfo.height + static_cast( newGlyph->extents.min_y ); } - newGlyph->glyphInfo.advance = face->glyph->metrics.horiAdvance / upem; + newGlyph->glyphInfo.advance = static_cast( static_cast( face->glyph->metrics.horiAdvance ) / upem ); newGlyph->glyphInfo.scaleFactor = 0.0f; return newGlyph; @@ -332,7 +332,7 @@ void VectorFontCache::GetVectorBlob( FontId vectorFontId, VectorGlyph* glyph = cache[foundIndex]; blob = &glyph->blobData[0]; - blobLength = glyph->blobData.size(); + blobLength = static_cast( glyph->blobData.size() ); nominalWidth = glyph->nominalWidth; nominalHeight = glyph->nominalHeight; } @@ -343,7 +343,7 @@ void VectorFontCache::GetVectorBlob( FontId vectorFontId, if( newGlyph ) { blob = &newGlyph->blobData[0]; - blobLength = newGlyph->blobData.size(); + blobLength = static_cast( newGlyph->blobData.size() ); nominalWidth = newGlyph->nominalWidth; nominalHeight = newGlyph->nominalHeight; @@ -386,7 +386,7 @@ FontId VectorFontCache::CreateFont( const string& url ) if( FT_Err_Ok == error ) { mImpl->mIdLookup.push_back( url ); - id = mImpl->mIdLookup.size(); + id = static_cast( mImpl->mIdLookup.size() ); VectorFont* newFont = new VectorFont( face ); mImpl->mVectorFonts.push_back( newFont ); -- 2.7.4