/*
- * 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.
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 )
{
return ret;
}
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp)
{
bool ret = false;
return ret;
}
-bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, uint32_t timeStamp)
{
bool ret = false;
#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.
/**
* @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()
/*
- * 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.
#include <vconf.h>
#ifndef WAYLAND
-#include <Ecore_X.h>
-#include <Elementary.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
+#include <dali/internal/system/linux/dali-elementary.h>
#endif
#include <vconf.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.
#include <vconf.h>
#ifndef WAYLAND
-#include <Ecore_X.h>
-#include <Elementary.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
+#include <dali/internal/system/linux/dali-elementary.h>
#endif
#include <vconf.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.
#include <vconf.h>
#ifndef WAYLAND
-#include <Ecore_X.h>
-#include <Elementary.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
+#include <dali/internal/system/linux/dali-elementary.h>
#endif
#include <vconf.h>
PositionSize size = defaultWindow->GetSurface()->GetPositionSize();
- mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
+ mGestureManager = new GestureManager(*this, Vector2(static_cast<float>(size.width), static_cast<float>(size.height)), mCallbackManager, *mEnvironmentOptions);
mGraphics = &( graphicsFactory.Create() );
mGraphics->Initialize( mEnvironmentOptions );
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.
/*
- * 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.
#endif
#ifdef ECORE_WAYLAND2
-#include <Ecore_Wl2.h>
+#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h>
#else
-#include <Ecore_Wayland.h>
+#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h>
#endif
--- /dev/null
+#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 <Ecore_Wayland.h>
+
+
+
+#endif /* DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WAYLAND_H */
--- /dev/null
+#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 <Ecore_Wl2.h>
+
+
+
+#endif /* DALI_INTERNAL_ADAPTOR_TIZEN_WAYLAND_DALI_ECORE_WL2_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.
#include <app_control_internal.h>
#include <app_common.h>
#include <bundle.h>
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
#include <system_info.h>
#include <system_settings.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.
#include <dali/internal/adaptor/common/framework.h>
// EXTERNAL INCLUDES
-#include <Ecore.h>
-#include <Elementary.h>
+#include <dali/internal/system/linux/dali-ecore.h>
+#include <dali/internal/system/linux/dali-elementary.h>
#include <X11/Xlib.h>
#include <dali/integration-api/debug.h>
/*
- * 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.
#include <dali/internal/clipboard/common/clipboard-impl.h>
// EXTERNAL INCLUDES
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
#ifdef ECORE_WAYLAND2
-#include <Ecore_Wl2.h>
+#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h>
#else
-#include <Ecore_Wayland.h>
+#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h>
#endif
#include <dali/public-api/object/any.h>
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<Ecore_Wl2_Event_Data_Source_Send *>( 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<Ecore_Wl_Event_Data_Source_Send *>( event );
#endif
int len_buf = mSendBuffer.length();
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<Ecore_Wl2_Event_Selection_Data_Ready *>( 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<Ecore_Wl_Event_Selection_Data_Ready *>( event );
#endif
- return (char *)ev->data;
+ return reinterpret_cast<char *>( ev->data );
}
int GetCount()
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
/*
- * 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.
#include <dali/internal/clipboard/common/clipboard-impl.h>
// EXTERNAL INCLUDES
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
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<unsigned char>( AverageComponent( c11, c21 ) );
+ pixels[outPixel * 3 + 1] = static_cast<unsigned char>( AverageComponent( c12, c22 ) );
+ pixels[outPixel * 3 + 2] = static_cast<unsigned char>( AverageComponent( c13, c23 ) );
}
}
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<unsigned char>( AverageComponent( c11, c21 ) );
+ pixels[outPixel * 2 + 1] = static_cast<unsigned char>( AverageComponent( c12, c22 ) );
}
}
const unsigned int c2 = pixels[pixel + 1];
// Save the averaged byte pixel component:
- pixels[outPixel] = AverageComponent( c1, c2 );
+ pixels[outPixel] = static_cast<unsigned char>( AverageComponent( c1, c2 ) );
}
}
for( unsigned int component = 0; component < width; ++component )
{
- outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] );
+ outputScanline[component] = static_cast<unsigned char>( AverageComponent( scanline1[component], scanline2[component] ) );
}
}
for( unsigned int component = 0; component < width * 2; ++component )
{
- outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] );
+ outputScanline[component] = static_cast<unsigned char>( AverageComponent( scanline1[component], scanline2[component] ) );
}
}
for( unsigned int component = 0; component < width * 3; ++component )
{
- outputScanline[component] = AverageComponent( scanline1[component], scanline2[component] );
+ outputScanline[component] = static_cast<unsigned char>( AverageComponent( scanline1[component], scanline2[component] ) );
}
}
///@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<uint8_t>( c0 );
+ outScanline[outX + 1] = static_cast<uint8_t>( c1 );
+ outScanline[outX + 2] = static_cast<uint8_t>( c2 );
// Increment the fixed-point input coordinate:
inX += deltaX;
/** @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<uint8_t>( 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<uint8_t>( BilinearFilter1Component( tl.l, tr.l, bl.l, br.l, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.a = static_cast<uint8_t>( BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ) );
return pixel;
}
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<uint8_t>( BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.g = static_cast<uint8_t>( BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.b = static_cast<uint8_t>( 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<PixelRGB565>( (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;
}
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<uint8_t>( BilinearFilter1Component( tl.r, tr.r, bl.r, br.r, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.g = static_cast<uint8_t>( BilinearFilter1Component( tl.g, tr.g, bl.g, br.g, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.b = static_cast<uint8_t>( BilinearFilter1Component( tl.b, tr.b, bl.b, br.b, fractBlendHorizontal, fractBlendVertical ) );
+ pixel.a = static_cast<uint8_t>( BilinearFilter1Component( tl.a, tr.a, bl.a, br.a, fractBlendHorizontal, fractBlendVertical ) );
return pixel;
}
/*
- * 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.
{
if( channel == RED )
{
- *pixelData &= ~0xF8;
+ *pixelData &= static_cast<unsigned char>( ~0xF8 );
*pixelData |= static_cast<unsigned char>( (channelValue << 3) & 0xF8 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x07;
+ *pixelData &= static_cast<unsigned char>( ~0x07 );
*pixelData |= static_cast<unsigned char>( (channelValue >> 3) & 0x07 );
- *(pixelData+1) &= ~0xE0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xE0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 5) & 0xE0 );
}
else if( channel == BLUE )
{
- *(pixelData+1) &= ~0x1F;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x1F );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x1F );
}
break;
{
if( channel == BLUE )
{
- *pixelData &= ~0xF8;
+ *pixelData &= static_cast<unsigned char>( ~0xF8 );
*pixelData |= static_cast<unsigned char>( (channelValue << 3) & 0xF8 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x07;
+ *pixelData &= static_cast<unsigned char>( ~0x07 );
*pixelData |= static_cast<unsigned char>( (channelValue >> 3) & 0x07 );
- *(pixelData+1) &= ~0xE0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xE0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 5) & 0xE0 );
}
else if( channel == RED )
{
- *(pixelData+1) &= ~0x1F;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x1F );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x1F );
}
break;
{
if( channel == RED )
{
- *pixelData &= ~0xF0;
+ *pixelData &= static_cast<unsigned char>( ~0xF0 );
*pixelData |= static_cast<unsigned char>( (channelValue << 4) & 0xF0 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x0F;
+ *pixelData &= static_cast<unsigned char>( ~0x0F );
*pixelData |= static_cast<unsigned char>( channelValue & 0x0F );
}
else if( channel == BLUE )
{
- *(pixelData+1) &= ~0xF0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xF0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 4) & 0xF0 );
}
else if( channel == ALPHA )
{
- *(pixelData+1) &= ~0x0F;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x0F );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x0F );
}
break;
{
if( channel == BLUE )
{
- *pixelData &= ~0xF0;
+ *pixelData &= static_cast<unsigned char>( ~0xF0 );
*pixelData |= static_cast<unsigned char>( (channelValue << 4) & 0xF0 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x0F;
+ *pixelData &= static_cast<unsigned char>( ~0x0F );
*pixelData |= static_cast<unsigned char>( channelValue & 0x0F );
}
else if( channel == RED )
{
- *(pixelData+1) &= ~0xF0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xF0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 4) & 0xF0 );
}
else if( channel == ALPHA )
{
- *(pixelData+1) &= ~0x0F;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x0F );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x0F );
}
break;
// F8 7 C0 3E 1
if( channel == RED )
{
- *pixelData &= ~0xF8;
+ *pixelData &= static_cast<unsigned char>( ~0xF8 );
*pixelData |= static_cast<unsigned char>( (channelValue << 3) & 0xF8 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x07;
+ *pixelData &= static_cast<unsigned char>( ~0x07 );
*pixelData |= static_cast<unsigned char>( (channelValue >> 2) & 0x07 );
- *(pixelData+1) &= ~0xC0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xC0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 6) & 0xC0 );
}
else if( channel == BLUE )
{
- *(pixelData+1) &= ~0x3E;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x3E );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 1) & 0x3E );
}
else if( channel == ALPHA )
{
- *(pixelData+1) &= ~0x01;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x01 );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x01 );
}
break;
{
if( channel == BLUE )
{
- *pixelData &= ~0xF8;
+ *pixelData &= static_cast<unsigned char>( ~0xF8 );
*pixelData |= static_cast<unsigned char>( (channelValue << 3) & 0xF8 );
}
else if( channel == GREEN )
{
- *pixelData &= ~0x07;
+ *pixelData &= static_cast<unsigned char>( ~0x07 );
*pixelData |= static_cast<unsigned char>( (channelValue >> 2) & 0x07 );
- *(pixelData+1) &= ~0xC0;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0xC0 );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 6) & 0xC0 );
}
else if( channel == RED )
{
- *(pixelData+1) &= ~0x3E;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x3E );
*(pixelData+1) |= static_cast<unsigned char>( (channelValue << 1 ) & 0x3E );
}
else if( channel == ALPHA )
{
- *(pixelData+1) &= ~0x01;
+ *(pixelData+1) &= static_cast<unsigned char>( ~0x01 );
*(pixelData+1) |= static_cast<unsigned char>( channelValue & 0x01 );
}
break;
/*
- * 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.
#include <dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.h>
// EXTERNAL INCLUDES
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <X11/Xutil.h>
#include <X11/Xlib.h>
#include <dali/integration-api/debug.h>
-#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.
*/
// EXTERNAL INCLUDES
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
// INTERNAL INCLUDES
#include <dali/internal/graphics/common/graphics-interface.h>
} // namespace Dali
-#endif // __DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H__
+#endif // DALI_INTERNAL_NATIVE_IMAGE_SOURCE_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H__
+#endif // DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_GESTURE_DETECTOR_H__
+#endif // DALI_INTERNAL_GESTURE_DETECTOR_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_GESTURE_MANAGER_H__
+#endif // DALI_INTERNAL_GESTURE_MANAGER_H
-#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.
} // namespace Dali
-#endif // __DALI_KEY_IMPL_H__
+#endif // DALI_KEY_IMPL_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.
void LongPressGestureDetector::EmitGesture(Gesture::State state)
{
- unsigned int touchPoints ( mTouchPositions.size() );
+ unsigned int touchPoints ( static_cast<unsigned int>( 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) ||
{
longPress.point += iter->second;
}
- longPress.point /= touchPoints;
+ longPress.point /= static_cast<float>( touchPoints );
longPress.time = mTouchTime;
if ( state != Gesture::Possible )
-#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.
unsigned int mMaximumTouchesRequired; ///< The maximum touches allowable. Any more and a long press is not emitted.
std::map<int, Vector2> 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;
} // namespace Dali
-#endif // __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__
+#endif // 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.
// 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<float>( minimumDistance );
+ mThresholdTotalAdjustments = static_cast<unsigned int>( fMinimumDistance * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO );
}
int minimumEvents = environmentOptions->GetMinimumPanEvents();
Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
- ( delta.LengthSquared() >= mMinimumDistanceSquared ) )
+ ( delta.LengthSquared() >= static_cast<float>( 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;
else if (primaryPointState == PointState::UP)
{
Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
- if(delta.LengthSquared() >= mMinimumDistanceSquared)
+ if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
{
SendPan(Gesture::Started, event);
mTouchEvents.push_back(event);
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 )
if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS )
{
mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments;
- mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / mThresholdTotalAdjustments;
+ mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast<float>( mThresholdTotalAdjustments );
}
else
{
if ( mThresholdAdjustmentsRemaining > 0 )
{
--mThresholdAdjustmentsRemaining;
- gesture.currentPosition -= mThresholdAdjustmentPerFrame * mThresholdAdjustmentsRemaining;
+ gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast<float>( mThresholdAdjustmentsRemaining );
}
mPreviousPosition = gesture.currentPosition;
-#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.
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/math/vector2.h>
#include <dali/integration-api/events/pan-gesture-event.h>
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.
} // namespace Dali
-#endif // __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__
+#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_PAN_GESTURE_DETECTOR_H__
+#endif // DALI_INTERNAL_PAN_GESTURE_DETECTOR_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_PHYSICAL_KEYBOARD_H__
+#endif // 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.
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<float> ( currentEvent.time - firstEvent.time );
+ gesture.speed = ( distanceDelta / timeDelta ) * 1000.0f;
gesture.centerPoint = GetCenterPoint(currentPoint1, currentPoint2);
}
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_PINCH_GESTURE_DETECTOR_H__
+#endif // 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.
case Touched:
{
- unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ;
+ uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime;
if ( pointState == PointState::UP )
{
{
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;
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 ||
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) )
}
}
-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() );
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;
-#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.
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <dali/integration-api/events/tap-gesture-event.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/integration-api/events/point.h>
* @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
* @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
* @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:
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
};
} // namespace Dali
-#endif // __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__
+#endif // DALI_INTERNAL_TAP_GESTURE_DETECTOR_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_VIRTUAL_KEYBOARD_H__
+#endif // DALI_INTERNAL_VIRTUAL_KEYBOARD_H
--- /dev/null
+#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 <Ecore_IMF.h>
+
+
+
+#endif /* DALI_INTERNAL_INPUT_LINUX_DALI_ECORE_IMF_H */
/*
- * 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.
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
#include <dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h>
#include <dali/integration-api/adaptor.h>
#include <dali/internal/system/common/locale-utils.h>
{
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 )
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
-#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.
*/
// EXTERNAL INCLUDES
-#include <Ecore_IMF.h>
+#include <dali/internal/input/linux/dali-ecore-imf.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_VIRTUAL_KEYBOARD_H__
+#endif // DALI_INTERNAL_ECORE_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.
*/
// CLASS HEADER
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
#include <dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.h>
{
eventHandled = ecore_imf_context_filter_event(mIMFContext,
ECORE_IMF_EVENT_KEY_DOWN,
- (Ecore_IMF_Event *) &ecoreKeyDownEvent);
+ reinterpret_cast<Ecore_IMF_Event *>( &ecoreKeyDownEvent ) );
}
// If the event has not been handled by InputMethodContext then check if we should reset our input method context
eventHandled = ecore_imf_context_filter_event(mIMFContext,
ECORE_IMF_EVENT_KEY_UP,
- (Ecore_IMF_Event *) &ecoreKeyUpEvent);
+ reinterpret_cast<Ecore_IMF_Event *>( &ecoreKeyUpEvent ) );
}
return eventHandled;
}
} // Internal
} // Dali
-
-#pragma GCC diagnostic pop
-#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.
*/
// EXTERNAL INCLUDES
-#include <Ecore_IMF.h>
-#include <Ecore.h>
+#include <dali/internal/input/linux/dali-ecore-imf.h>
+#include <dali/internal/system/linux/dali-ecore.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/base-object.h>
} // namespace Dali
-#endif // __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_ECORE_WL_H
+#endif // 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.
#include <dali/internal/input/common/virtual-keyboard-impl.h>
// EXTERNAL INCLUDES
-#include <Ecore.h>
-#include <Ecore_IMF.h>
+#include <dali/internal/system/linux/dali-ecore.h>
+#include <dali/internal/input/linux/dali-ecore-imf.h>
#include <algorithm>
#include <dali/public-api/common/vector-wrapper.h>
--- /dev/null
+#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 <Ecore_Input.h>
+
+
+
+#endif /* DALI_INTERNAL_INPUT_UBUNTU_X11_DALI_ECORE_INPUT_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.
#include <dali/internal/input/ubuntu-x11/input-method-context-impl-x.h>
// EXTERNAL INCLUDES
-#include <Ecore_IMF.h>
-#include <Ecore_Input.h>
+#include <dali/internal/input/linux/dali-ecore-imf.h>
+#include <dali/internal/input/ubuntu-x11/dali-ecore-input.h>
#include <dali/public-api/events/key-event.h>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/internal/system/common/singleton-service-impl.h>
#include <dali/internal/input/common/virtual-keyboard-impl.h>
#include <dali/internal/input/common/key-impl.h>
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
#include <dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h>
namespace Dali
const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character.
if ( byteIndex == attr->end_index )
{
- cursorPosition = visualCharacterIndex;
+ cursorPosition = static_cast<int>( visualCharacterIndex );
break;
// end loop as found cursor position that matches byte position
}
{
eventHandled = ecore_imf_context_filter_event(mIMFContext,
ECORE_IMF_EVENT_KEY_DOWN,
- (Ecore_IMF_Event *) &ecoreKeyDownEvent);
+ reinterpret_cast<Ecore_IMF_Event *>( &ecoreKeyDownEvent ));
}
// If the event has not been handled by InputMethodContext then check if we should reset our IMFcontext
eventHandled = ecore_imf_context_filter_event(mIMFContext,
ECORE_IMF_EVENT_KEY_UP,
- (Ecore_IMF_Event *) &ecoreKeyUpEvent);
+ reinterpret_cast<Ecore_IMF_Event *>( &ecoreKeyUpEvent ));
}
return eventHandled;
}
} // Internal
} // Dali
-
-#pragma GCC diagnostic pop
-#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.
*/
// EXTERNAL INCLUDES
-#include <Ecore_IMF.h>
-#include <Ecore_X.h>
+#include <dali/internal/input/linux/dali-ecore-imf.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <dali/public-api/object/base-object.h>
} // namespace Dali
-#endif // __DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_X_H
+#endif // 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.
// EXTERNAL INCLUDES
#include <X11/Xlib.h>
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <algorithm>
#include <dali/integration-api/debug.h>
// Get Focus window
XGetInputFocus(display, &focusWindow, &revert);
- ecore_x_window_prop_property_set( focusWindow,
+ ecore_x_window_prop_property_set( static_cast<Ecore_X_Window>( focusWindow ),
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
ECORE_X_ATOM_CARDINAL, 32, &angle, 1 );
XCloseDisplay(display);
/*
- * 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.
#include <dali/internal/system/linux/callback-manager-ecore.h>
// EXTERNAL INCLUDES
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
#include <dali/integration-api/debug.h>
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
--- /dev/null
+#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 <Ecore_X.h>
+
+
+
+#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_X_H */
--- /dev/null
+#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 <Ecore.h>
+
+
+
+#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ECORE_H */
--- /dev/null
+#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 <Elementary.h>
+
+
+
+#endif /* DALI_INTERNAL_SYSTEM_LINUX_DALI_ELEMENTARY_H */
/*
- * 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.
#include <dali/internal/system/common/file-descriptor-monitor.h>
// EXTERNAL INCLUDES
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
/*
- * 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.
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/public-api/dali-adaptor-common.h>
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <Ecore.h>
+#include <dali/internal/system/linux/dali-ecore.h>
namespace Dali
{
{
Stop();
}
- mImpl->mId = ecore_timer_add( (double)mImpl->mInterval/1000.0f, (Ecore_Task_Cb)TimerSourceFunc, this );
+ double interval = static_cast<double> ( mImpl->mInterval ) / 1000.0f;
+ mImpl->mId = ecore_timer_add( interval, reinterpret_cast<Ecore_Task_Cb>( TimerSourceFunc ), this );
}
void Timer::Stop()
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
/*
- * 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.
*
*/
-// EXTERNAL INCLUDES
-#ifndef DALI_PROFILE_UBUNTU
-#include <system_settings.h>
-#endif // DALI_PROFILE_UBUNTU
-#include <Elementary.h>
-
// INTERNAL INCLUDES
#include <dali/internal/system/common/system-settings.h>
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 )
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_DAMAGE_OBSERVER_H__
+#endif // DALI_INTERNAL_DAMAGE_OBSERVER_H
+++ /dev/null
-/*
- * 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 <dali/internal/window-system/common/ecore-server-connection.h>
-
-// EXTERNAL INCLUDES
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#include <Ecore.h>
-
-#include <dali/integration-api/debug.h>
-
-// 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<Ecore_Ipc_Event_Server_Del *>( event );
- ServerConnection* connection = static_cast<ServerConnection*>( 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<Ecore_Ipc_Event_Server_Data *>( event );
- ServerConnection* connection = static_cast<ServerConnection*>( 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
+++ /dev/null
-#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 <Ecore.h>
-#include <Ecore_Ipc.h>
-
-#include <dali/public-api/common/vector-wrapper.h>
-
-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<Ecore_Event_Handler *> 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_
/*
- * 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.
{
// Copied from x server
-static unsigned int GetCurrentMilliSeconds(void)
+static uint32_t GetCurrentMilliSeconds(void)
{
struct timeval tv;
}
if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
{
- return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
+ return static_cast<uint32_t>( (tp.tv_sec * 1000 ) + (tp.tv_nsec / 1000000L) );
}
gettimeofday(&tv, NULL);
- return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+ return static_cast<uint32_t>( (tv.tv_sec * 1000 ) + (tv.tv_usec / 1000) );
}
} // unnamed namespace
mGestureManager.Stop();
}
-void EventHandler::SendEvent( Integration::Point& point, unsigned long timeStamp )
+void EventHandler::SendEvent( Integration::Point& point, uint32_t timeStamp )
{
if( timeStamp < 1 )
{
// 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 );
mRotationObserver = observer;
}
-void EventHandler::OnTouchEvent( Integration::Point& point, unsigned long timeStamp )
+void EventHandler::OnTouchEvent( Integration::Point& point, uint32_t timeStamp )
{
SendEvent( point, timeStamp );
}
{
case 90:
{
- convertedPosition.x = mWindowWidth - position.y;
+ convertedPosition.x = static_cast<float>( mWindowWidth ) - position.y;
convertedPosition.y = position.x;
break;
}
case 180:
{
- convertedPosition.x = mWindowWidth - position.x;
- convertedPosition.y = mWindowHeight - position.y;
+ convertedPosition.x = static_cast<float>( mWindowWidth ) - position.x;
+ convertedPosition.y = static_cast<float>( mWindowHeight ) - position.y;
break;
}
case 270:
{
convertedPosition.x = position.y;
- convertedPosition.y = mWindowHeight - position.x;
+ convertedPosition.y = static_cast<float>( mWindowHeight ) - position.x;
break;
}
default:
-#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.
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/integration-api/events/key-event-integ.h>
* 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
* @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.
/**
* 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.
} // namespace Dali
-#endif // __DALI_INTERNAL_EVENT_HANDLER_H__
+#endif // DALI_INTERNAL_EVENT_HANDLER_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_ORIENTATION_H__
+#endif // DALI_INTERNAL_ORIENTATION_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_ROTATION_OBSERVER_H__
+#endif // DALI_INTERNAL_ROTATION_OBSERVER_H
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
#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.
#include <dali/public-api/events/wheel-event.h>
#include <string>
#include <vector>
+#include <cstdint>
namespace Dali
{
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;
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H__
+#endif // DALI_INTERNAL_BASE_WINDOW_EVENT_INTERFACE_H
-#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.
} // namespace Dali
-#endif // __DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H__
+#endif // DALI_INTERNAL_WINDOW_VISIBILITY_OBSERVER_H
# 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 \
/*
- * 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.
#include <dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h>
// EXTERNAL_HEADERS
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <dali/integration-api/debug.h>
// INTERNAL HEADERS
-#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.
} // namespace Dali
-#endif /* __DALI_X11_TYPES_H__ */
+#endif /* DALI_X11_TYPES_H */
#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.
// EXTERNAL INCLUDES
#include <dali/devel-api/threading/conditional-wait.h>
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
namespace Dali
/*
- * 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.
*
*/
-// Ecore is littered with C style cast
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-
// CLASS HEADER
#include <dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h>
#include <dali/public-api/object/any.h>
#include <dali/public-api/events/mouse-button.h>
#include <dali/integration-api/debug.h>
-#include <Ecore_Input.h>
+#include <dali/internal/input/ubuntu-x11/dali-ecore-input.h>
namespace Dali
{
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<float>( touchEvent->multi.angle ) ) );
if( touchEvent->buttons)
{
point.SetMouseButton( static_cast< MouseButton::Type >( touchEvent->buttons) );
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<float>( touchEvent->x ), static_cast<float>( touchEvent->y ) ) );
+ point.SetRadius( static_cast<float>( touchEvent->multi.radius ), Vector2( static_cast<float>( touchEvent->multi.radius_x ), static_cast<float>( touchEvent->multi.radius_y ) ) );
+ point.SetPressure( static_cast<float>( touchEvent->multi.pressure ) );
+ point.SetAngle( Degree( static_cast<float>( touchEvent->multi.angle ) ) );
mTouchEventSignal.Emit( point, touchEvent->timestamp );
}
{
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<float>( mouseWheelEvent->x ), static_cast<float>( mouseWheelEvent->y ) ), mouseWheelEvent->z, mouseWheelEvent->timestamp );
mWheelEventSignal.Emit( wheelEvent );
}
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()
}
else
{
- surfaceId = AnyCast< XWindow >( surface );
+ surfaceId = static_cast<unsigned int>( AnyCast< XWindow >( surface ) );
}
}
return surfaceId;
} // namespace Internal
} // namespace Dali
-
-#pragma GCC diagnostic pop
#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.
#include <dali/internal/window-system/common/window-base.h>
// EXTERNAL HEADERS
-#include <Ecore.h>
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
namespace Dali
{
-#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.
// EXTERNAL INCLUDES
#include <string>
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
#include <X11/Xlib.h>
// INTERNAL INCLUDES
} // namespace Dali
-#endif // __DALI_INTERNAL_ECORE_X_RENDER_SURFACE_H__
+#endif // DALI_INTERNAL_ECORE_X_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.
#include <dali/devel-api/adaptor-framework/keyboard.h>
// EXTERNAL_HEADERS
-#include <Ecore_X.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
namespace Dali
{
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<float>( tan2atan (d) );
if ((p - m) * (p1 - m) < 0)
return (p - p0) * (pp + dp * d2).normalized ();
else
/*
- * 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.
if( endpoints.size() )
{
- glyphy_outline_winding_from_even_odd( &endpoints[0], endpoints.size (), false );
+ glyphy_outline_winding_from_even_odd( &endpoints[0], static_cast<unsigned int>( 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<unsigned int>( endpoints.size() ),
&newGlyph->blobData[0],
- newGlyph->blobData.capacity(),
+ static_cast<unsigned int>( newGlyph->blobData.capacity() ),
upem / ( MIN_FONT_SIZE * M_SQRT2 ),
4,
&averageFetchAchieved,
}
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<float>( newGlyph->extents.max_x - newGlyph->extents.min_x );
+ newGlyph->glyphInfo.height = static_cast<float>( 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<float>( newGlyph->extents.min_x );
+ newGlyph->glyphInfo.yBearing = newGlyph->glyphInfo.height + static_cast<float>( newGlyph->extents.min_y );
}
- newGlyph->glyphInfo.advance = face->glyph->metrics.horiAdvance / upem;
+ newGlyph->glyphInfo.advance = static_cast<float>( static_cast<double>( face->glyph->metrics.horiAdvance ) / upem );
newGlyph->glyphInfo.scaleFactor = 0.0f;
return newGlyph;
VectorGlyph* glyph = cache[foundIndex];
blob = &glyph->blobData[0];
- blobLength = glyph->blobData.size();
+ blobLength = static_cast<unsigned int>( glyph->blobData.size() );
nominalWidth = glyph->nominalWidth;
nominalHeight = glyph->nominalHeight;
}
if( newGlyph )
{
blob = &newGlyph->blobData[0];
- blobLength = newGlyph->blobData.size();
+ blobLength = static_cast<unsigned int>( newGlyph->blobData.size() );
nominalWidth = newGlyph->nominalWidth;
nominalHeight = newGlyph->nominalHeight;
if( FT_Err_Ok == error )
{
mImpl->mIdLookup.push_back( url );
- id = mImpl->mIdLookup.size();
+ id = static_cast<FontId>( mImpl->mIdLookup.size() );
VectorFont* newFont = new VectorFont( face );
mImpl->mVectorFonts.push_back( newFont );