GetImplementation(*this).SetName(name);
}
-unsigned int Actor::GetId() const
+uint32_t Actor::GetId() const
{
return GetImplementation(*this).GetId();
}
GetImplementation(*this).Unparent();
}
-unsigned int Actor::GetChildCount() const
+uint32_t Actor::GetChildCount() const
{
return GetImplementation(*this).GetChildCount();
}
-Actor Actor::GetChildAt(unsigned int index) const
+Actor Actor::GetChildAt( uint32_t index ) const
{
Internal::ActorPtr child = GetImplementation(*this).GetChildAt( index );
return Actor( child.Get() );
return Actor( child.Get() );
}
-Actor Actor::FindChildById(const unsigned int id)
+Actor Actor::FindChildById( const uint32_t id )
{
Internal::ActorPtr child = GetImplementation(*this).FindChildById( id );
return Actor( child.Get() );
return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) );
}
-int Actor::GetHierarchyDepth()
+int32_t Actor::GetHierarchyDepth()
{
return GetImplementation(*this).GetHierarchyDepth();
}
return GetImplementation(*this).OffStageSignal();
}
-unsigned int Actor::AddRenderer( Renderer& renderer )
+uint32_t Actor::AddRenderer( Renderer& renderer )
{
return GetImplementation(*this).AddRenderer( GetImplementation( renderer ) );
}
-unsigned int Actor::GetRendererCount() const
+uint32_t Actor::GetRendererCount() const
{
return GetImplementation(*this).GetRendererCount();
}
-Renderer Actor::GetRendererAt( unsigned int index )
+Renderer Actor::GetRendererAt( uint32_t index )
{
Internal::RendererPtr renderer = GetImplementation(*this).GetRendererAt( index );
return Renderer( renderer.Get() );
GetImplementation(*this).RemoveRenderer( GetImplementation( renderer ) );
}
-void Actor::RemoveRenderer( unsigned int index )
+void Actor::RemoveRenderer( uint32_t index )
{
GetImplementation(*this).RemoveRenderer( index );
}
// EXTERNAL INCLUDES
#include <string>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/actors/actor-enumerations.h>
* @return The ID
* @pre The Actor has been initialized.
*/
- unsigned int GetId() const;
+ uint32_t GetId() const;
// Containment
* @return The number of children
* @pre The Actor has been initialized.
*/
- unsigned int GetChildCount() const;
+ uint32_t GetChildCount() const;
/**
* @brief Retrieve and child actor by index.
* @return The actor for the given index or empty handle if children not initialized
* @pre The Actor has been initialized.
*/
- Actor GetChildAt(unsigned int index) const;
+ Actor GetChildAt( uint32_t index ) const;
/**
* @brief Search through this actor's hierarchy for an actor with the given name.
* @return A handle to the actor if found, or an empty handle if not
* @pre The Actor has been initialized.
*/
- Actor FindChildById(const unsigned int id);
+ Actor FindChildById( const uint32_t id );
/**
* @brief Retrieves the actor's parent.
* @SINCE_1_0.0
* @return The current depth in the hierarchy of the actor, or @c -1 if actor is not in the hierarchy
*/
- int GetHierarchyDepth();
+ int32_t GetHierarchyDepth();
public: // Renderer
* @pre The renderer must be initialized.
*
*/
- unsigned int AddRenderer( Renderer& renderer );
+ uint32_t AddRenderer( Renderer& renderer );
/**
* @brief Gets the number of renderers on this actor.
* @SINCE_1_0.0
* @return The number of renderers on this actor
*/
- unsigned int GetRendererCount() const;
+ uint32_t GetRendererCount() const;
/**
* @brief Gets a Renderer by index.
* @pre The index must be between 0 and GetRendererCount()-1
*
*/
- Renderer GetRendererAt( unsigned int index );
+ Renderer GetRendererAt( uint32_t index );
/**
* @brief Removes a renderer from the actor.
* @pre The index must be between 0 and GetRendererCount()-1
*
*/
- void RemoveRenderer( unsigned int index );
+ void RemoveRenderer( uint32_t index );
public: // Signals
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/object/property.h>
#include <dali/public-api/object/ref-object.h>
* @endcode
* @param[in] depth The depth in the hierarchy for the actor
*/
- virtual void OnStageConnection( int depth ) = 0;
+ virtual void OnStageConnection( int32_t depth ) = 0;
/**
* @brief Called after the actor has been disconnected from Stage.
LAST_ACTOR_FLAG ///< Special marker for last actor flag @SINCE_1_0.0
};
- static const int ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
+ static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
/**
* @brief Creates a CustomActorImpl.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return *this;
}
-unsigned int Layer::GetDepth() const
+uint32_t Layer::GetDepth() const
{
return GetImplementation(*this).GetDepth();
}
return GetImplementation(*this).IsClipping();
}
-void Layer::SetClippingBox(int x, int y, int width, int height)
+void Layer::SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height)
{
GetImplementation(*this).SetClippingBox(x, y, width, height);
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/actors/actor.h>
* @SINCE_1_0.0
* @see Dali::Layer::SetClippingBox()
*/
-typedef Rect<int> ClippingBox;
+typedef Rect<int32_t> ClippingBox;
/**
* @brief Layers provide a mechanism for overlaying groups of actors on top of each other.
enum
{
CLIPPING_ENABLE = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "clippingEnable", type bool @SINCE_1_0.0
- CLIPPING_BOX, ///< name "clippingBox", type Rect<int> @SINCE_1_0.0
+ CLIPPING_BOX, ///< name "clippingBox", type Rect<int32_t> @SINCE_1_0.0
BEHAVIOR, ///< name "behavior", type String @SINCE_1_0.0
};
};
* @pre Layer is on the stage.
* If layer is not added to the stage, returns 0.
*/
- unsigned int GetDepth() const;
+ uint32_t GetDepth() const;
/**
* @brief Increments the depth of the layer.
* @param[in] width The width of the box
* @param[in] height The height of the box
*/
- void SetClippingBox(int x, int y, int width, int height);
+ void SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height);
/**
* @brief Sets the clipping box of a layer in window coordinates.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
-constexpr unsigned int BitMaskOfN( unsigned int bits )
+constexpr uint32_t BitMaskOfN( uint32_t bits )
{
return ( 1 << bits ) - 1;
}
+
} // unnamed namespace
AlphaFunction::AlphaFunction()
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
GetImplementation(*this).SetLooping(looping);
}
-void Animation::SetLoopCount(int count)
+void Animation::SetLoopCount(int32_t count)
{
GetImplementation(*this).SetLoopCount(count);
}
-int Animation::GetLoopCount()
+int32_t Animation::GetLoopCount()
{
return GetImplementation(*this).GetLoopCount();
}
-int Animation::GetCurrentLoop()
+int32_t Animation::GetCurrentLoop()
{
return GetImplementation(*this).GetCurrentLoop();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/animation/alpha-function.h>
#include <dali/public-api/animation/key-frames.h>
* @SINCE_1_1.20
* @param[in] count The number of times to loop
*/
- void SetLoopCount(int count);
+ void SetLoopCount(int32_t count);
/**
* @brief Gets the loop count.
* @SINCE_1_1.20
* @return The number of times to loop
*/
- int GetLoopCount();
+ int32_t GetLoopCount();
/**
* @brief Gets the current loop count.
* @SINCE_1_1.20
* @return The current number of loops that have occured
*/
- int GetCurrentLoop();
+ int32_t GetCurrentLoop();
/**
* @brief Queries whether the animation will loop.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(*this).GetRemoveAction();
}
-void Constraint::SetTag( const unsigned int tag )
+void Constraint::SetTag( uint32_t tag )
{
GetImplementation(*this).SetTag( tag );
}
-unsigned int Constraint::GetTag() const
+uint32_t Constraint::GetTag() const
{
return GetImplementation(*this).GetTag();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/animation/constraint-source.h>
#include <dali/public-api/common/dali-vector.h>
* @SINCE_1_0.0
* @param[in] tag An integer to identify the constraint
*/
- void SetTag( const unsigned int tag );
+ void SetTag( uint32_t tag );
/**
* @brief Gets the tag.
* @SINCE_1_0.0
* @return The tag
*/
- unsigned int GetTag() const;
+ uint32_t GetTag() const;
public: // Not intended for use by Application developers
namespace
{
-const int MAX_NUM_STACK_FRAMES = 25;
+const int32_t MAX_NUM_STACK_FRAMES = 25;
}
std::string Demangle(const char* symbol)
mangledSymbol[tokenLength] = '\0';
size_t size;
- int status;
+ int32_t status;
char* demangled=NULL;
demangled = abi::__cxa_demangle( mangledSymbol, NULL, &size, &status );
if( demangled != NULL )
DALI_LOG_ERROR_NOFN("Backtrace:\n");
void* frameArray[MAX_NUM_STACK_FRAMES];
- int nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
+ int32_t nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
char** symbols = backtrace_symbols(frameArray, nSize);
- for(int i=1; i< nSize; i++)
+ for(int32_t i=1; i< nSize; i++)
{
std::string demangled_symbol = Demangle(symbols[i]);
DALI_LOG_ERROR_NOFN("[%02d] %s\n", i, demangled_symbol.c_str() );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
// adjust pointer to real beginning
SizeType* metadata = reinterpret_cast< SizeType* >( mData );
- // TODO would be nice to memset to a bitpattern to catch illegal use of container after release
- // but that would require knowledge of the itemsize
+
delete [] ( metadata - 2u );
mData = 0u;
}
if( capacity > oldCapacity )
{
const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
- void* wholeData = reinterpret_cast< void* >( new unsigned char[ wholeAllocation ] );
+ void* wholeData = reinterpret_cast< void* >( new uint8_t[ wholeAllocation ] );
DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
#if defined( DEBUG_ENABLED )
// EXTERNAL INCLUDES
#include <cstddef>
#include <algorithm>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
std::size_t offset = at - reinterpret_cast<char*>( mData );
// need more space
- Reserve( NextPowerOfTwo( newCount ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
+ Reserve( NextPowerOfTwo( static_cast<uint32_t>( newCount ) ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
// Set the new at pointer.
at = reinterpret_cast<char*>( mData ) + offset;
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(*this).GetSize();
}
-unsigned int Stage::GetLayerCount() const
+uint32_t Stage::GetLayerCount() const
{
return GetImplementation(*this).GetLayerCount();
}
-Layer Stage::GetLayer(unsigned int depth) const
+Layer Stage::GetLayer(uint32_t depth) const
{
return GetImplementation(*this).GetLayer(depth);
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/signals/dali-signal.h>
* @SINCE_1_0.0
* @return The number of layers
*/
- unsigned int GetLayerCount() const;
+ uint32_t GetLayerCount() const;
/**
* @brief Retrieves the layer at a specified depth.
* @return The layer found at the given depth
* @pre Depth is less than layer count; see GetLayerCount().
*/
- Layer GetLayer(unsigned int depth) const;
+ Layer GetLayer(uint32_t depth) const;
/**
* @brief Returns the Stage's Root Layer.
namespace Dali
{
-const unsigned int CORE_MAJOR_VERSION = 1;
-const unsigned int CORE_MINOR_VERSION = 3;
-const unsigned int CORE_MICRO_VERSION = 45;
+const uint32_t CORE_MAJOR_VERSION = 1;
+const uint32_t CORE_MINOR_VERSION = 3;
+const uint32_t CORE_MICRO_VERSION = 45;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
namespace Dali
{
-DALI_CORE_API extern const unsigned int CORE_MAJOR_VERSION; ///< The major version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MINOR_VERSION; ///< The minor version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MICRO_VERSION; ///< The micro version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MAJOR_VERSION; ///< The major version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MINOR_VERSION; ///< The minor version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MICRO_VERSION; ///< The micro version number of the Core library.
DALI_CORE_API extern const char * const CORE_BUILD_DATE; ///< The date/time the Core library was built.
} // namespace Dali
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/handle.h>
namespace Dali
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
/**
* @brief The time the gesture took place.
*/
- unsigned int time;
+ uint32_t time;
protected: // Creation
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
-unsigned int HoverEvent::GetPointCount() const
+uint32_t HoverEvent::GetPointCount() const
{
- return points.size();
+ return static_cast<uint32_t>( points.size() );
}
-const TouchPoint& HoverEvent::GetPoint(unsigned int point) const
+const TouchPoint& HoverEvent::GetPoint( uint32_t point ) const
{
DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
return points[point];
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/events/touch-point.h>
* @SINCE_1_0.0
* @return Total number of Points
*/
- unsigned int GetPointCount() const;
+ uint32_t GetPointCount() const;
/**
* @brief Returns a touch point at the index requested.
* @note "point" should be less than the value returned by GetPointCount().
* If out of range, then program asserts.
*/
- const TouchPoint& GetPoint(unsigned int point) const;
+ const TouchPoint& GetPoint( uint32_t point) const;
};
/**
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL = 0x2;
-const unsigned int MODIFIER_ALT = 0x4;
-const int KEY_INVALID_CODE = -1;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL = 0x2;
+const uint32_t MODIFIER_ALT = 0x4;
+const int32_t KEY_INVALID_CODE = -1;
}
KeyEvent::KeyEvent()
new Internal::KeyEventImpl( this );
}
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,unsigned long timeStamp, const State& keyState)
+KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier,unsigned long timeStamp, const State& keyState)
: keyPressedName(keyName),
keyPressed(keyString),
keyCode(keyCode),
// EXTERNAL INCLUDES
#include <string>
+#include <cstdint> // int32_t
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
* @param[in] timeStamp The time (in ms) that the key event occurred
* @param[in] keyState The state of the key event
*/
- KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState);
+ KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State& keyState);
/**
* @brief Copy constructor.
* platform-specific key code. You need to use IsKey() to know what a key event means
* instead of direct comparison of key code value.
*/
- int keyCode;
+ int32_t keyCode;
/**
* @brief special keys like shift, alt and control which modify the next key pressed.
*/
- int keyModifier;
+ int32_t keyModifier;
/**
* @brief The time (in ms) that the key event occurred.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return LongPressGestureDetector(internal.Get());
}
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int touchesRequired)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t touchesRequired)
{
Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(touchesRequired);
return LongPressGestureDetector(internal.Get());
}
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int minTouches, unsigned int maxTouches)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t minTouches, uint32_t maxTouches)
{
Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(minTouches, maxTouches);
return *this;
}
-void LongPressGestureDetector::SetTouchesRequired(unsigned int touches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
{
GetImplementation(*this).SetTouchesRequired(touches);
}
-void LongPressGestureDetector::SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches)
{
GetImplementation(*this).SetTouchesRequired(minTouches, maxTouches);
}
-unsigned int LongPressGestureDetector::GetMinimumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMinimumTouchesRequired() const
{
return GetImplementation(*this).GetMinimumTouchesRequired();
}
-unsigned int LongPressGestureDetector::GetMaximumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMaximumTouchesRequired() const
{
return GetImplementation(*this).GetMaximumTouchesRequired();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture-detector.h>
#include <dali/public-api/signals/dali-signal.h>
* @param[in] touchesRequired The number of touches required
* @return A handle to a newly allocated Dali resource
*/
- static LongPressGestureDetector New(unsigned int touchesRequired);
+ static LongPressGestureDetector New(uint32_t touchesRequired);
/**
* @brief Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
* @param[in] maxTouches The maximum number of touches required
* @return A handle to a newly allocated Dali resource
*/
- static LongPressGestureDetector New(unsigned int minTouches, unsigned int maxTouches);
+ static LongPressGestureDetector New(uint32_t minTouches, uint32_t maxTouches);
/**
* @brief Downcasts a handle to LongPressGestureDetector handle.
* @pre The gesture detector has been initialized.
* @note The default is '1'.
*/
- void SetTouchesRequired(unsigned int touches);
+ void SetTouchesRequired(uint32_t touches);
/**
* @brief Sets the minimum and maximum touches required.
* @pre The gesture detector has been initialized.
* @note The default is '1'.
*/
- void SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches);
+ void SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches);
public: // Getters
* @return The minimum number of touches required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMinimumTouchesRequired() const;
+ uint32_t GetMinimumTouchesRequired() const;
/**
* @brief Retrieves the maximum number of touches required.
* @return The maximum number of touches required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMaximumTouchesRequired() const;
+ uint32_t GetMaximumTouchesRequired() const;
public: // Signals
* @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had
* on the screen to generate the long press gesture.
*/
- unsigned int numberOfTouches;
+ uint32_t numberOfTouches;
/**
* @brief This is the point, in screen coordinates, where the long press occurred.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return *this;
}
-void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
+void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
{
GetImplementation(*this).SetMinimumTouchesRequired(minimum);
}
-void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
+void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
{
GetImplementation(*this).SetMaximumTouchesRequired(maximum);
}
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
{
return GetImplementation(*this).GetMinimumTouchesRequired();
}
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
{
return GetImplementation(*this).GetMaximumTouchesRequired();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture-detector.h>
#include <dali/public-api/object/property-index-ranges.h>
* @pre The gesture detector has been initialized.
* @note The default minimum is '1'.
*/
- void SetMinimumTouchesRequired(unsigned int minimum);
+ void SetMinimumTouchesRequired(uint32_t minimum);
/**
* @brief This is the maximum number of touches required for the pan gesture to be detected.
* @pre The gesture detector has been initialized.
* @note The default maximum is '1'.
*/
- void SetMaximumTouchesRequired(unsigned int maximum);
+ void SetMaximumTouchesRequired(uint32_t maximum);
public: // Getters
* @return The minimum touches required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMinimumTouchesRequired() const;
+ uint32_t GetMinimumTouchesRequired() const;
/**
* @brief Retrieves the maximum number of touches required for the pan gesture to be detected.
* @return The maximum touches required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMaximumTouchesRequired() const;
+ uint32_t GetMaximumTouchesRequired() const;
public: // Directional Panning
/**
* @brief The total number of fingers touching the screen in a pan gesture.
*/
- unsigned int numberOfTouches;
+ uint32_t numberOfTouches;
// Convenience Methods
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return TapGestureDetector(internal.Get());
}
-TapGestureDetector TapGestureDetector::New(unsigned int tapsRequired )
+TapGestureDetector TapGestureDetector::New(uint32_t tapsRequired )
{
Internal::TapGestureDetectorPtr internal = Internal::TapGestureDetector::New( tapsRequired );
return *this;
}
-void TapGestureDetector::SetMinimumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMinimumTapsRequired(uint32_t taps)
{
GetImplementation(*this).SetMinimumTapsRequired(taps);
}
-void TapGestureDetector::SetMaximumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMaximumTapsRequired(uint32_t taps)
{
GetImplementation(*this).SetMaximumTapsRequired(taps);
}
-unsigned int TapGestureDetector::GetMinimumTapsRequired() const
+uint32_t TapGestureDetector::GetMinimumTapsRequired() const
{
return GetImplementation(*this).GetMinimumTapsRequired();
}
-unsigned int TapGestureDetector::GetMaximumTapsRequired() const
+uint32_t TapGestureDetector::GetMaximumTapsRequired() const
{
return GetImplementation(*this).GetMaximumTapsRequired();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture-detector.h>
#include <dali/public-api/signals/dali-signal.h>
* @param[in] tapsRequired The minimum & maximum number of taps required
* @return A handle to a newly allocated Dali resource
*/
- static TapGestureDetector New( unsigned int tapsRequired );
+ static TapGestureDetector New( uint32_t tapsRequired );
/**
* @brief Downcasts a handle to TapGestureDetector handle.
* @pre The gesture detector has been initialized.
* @note The default is '1'.
*/
- void SetMinimumTapsRequired( unsigned int minimumTaps );
+ void SetMinimumTapsRequired( uint32_t minimumTaps );
/**
* @brief Sets the maximum number of taps required.
* @pre The gesture detector has been initialized.
* @note The default is '1'.
*/
- void SetMaximumTapsRequired( unsigned int maximumTaps );
+ void SetMaximumTapsRequired( uint32_t maximumTaps );
public: // Getters
* @return The minimum taps required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMinimumTapsRequired() const;
+ uint32_t GetMinimumTapsRequired() const;
/**
* @brief Retrieves the maximum number of taps required.
* @return The maximum taps required
* @pre The gesture detector has been initialized.
*/
- unsigned int GetMaximumTapsRequired() const;
+ uint32_t GetMaximumTapsRequired() const;
public: // Signals
/**
* @brief The number of taps in this tap gesture.
*/
- unsigned int numberOfTaps;
+ uint32_t numberOfTaps;
/**
* @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
* screen to generate the tap gesture.
*/
- unsigned int numberOfTouches;
+ uint32_t numberOfTouches;
/**
* @brief This is the point, in screen coordinates, where the tap occurred.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
-unsigned int TouchEvent::GetPointCount() const
+uint32_t TouchEvent::GetPointCount() const
{
- return points.size();
+ return static_cast<uint32_t>( points.size() );
}
-const TouchPoint& TouchEvent::GetPoint(unsigned int point) const
+const TouchPoint& TouchEvent::GetPoint( uint32_t point ) const
{
DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
return points[point];
* @SINCE_1_0.0
* @return Total number of Points
*/
- unsigned int GetPointCount() const DALI_DEPRECATED_API;
+ uint32_t GetPointCount() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_1.37
* @note "point" should be less than the value returned by GetPointCount().
* If out of range, then program asserts.
*/
- const TouchPoint& GetPoint(unsigned int point) const DALI_DEPRECATED_API;
+ const TouchPoint& GetPoint( uint32_t point ) const DALI_DEPRECATED_API;
};
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
: deviceId(id),
state(state),
local(screenX, screenY),
{
}
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
: deviceId(id),
state(state),
local(localX, localY),
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/actors/actor.h>
* @param[in] screenX The X co-ordinate relative to the screen's origin
* @param[in] screenY The Y co-ordinate relative to the screen's origin
*/
- TouchPoint(int id, State state, float screenX, float screenY);
+ TouchPoint(int32_t id, State state, float screenX, float screenY);
/**
* @brief Constructor.
* @param[in] localX The X co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
* @param[in] localY The Y co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
*/
- TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY);
+ TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
/**
* @brief Destructor.
/**
* @brief Each touch point has a unique device ID which specifies the touch device for that point.
*/
- int deviceId;
+ int32_t deviceId;
/**
* @brief State of the point.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL = 0x2;
-const unsigned int MODIFIER_ALT = 0x4;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL = 0x2;
+const uint32_t MODIFIER_ALT = 0x4;
}
{
}
-WheelEvent::WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp )
+WheelEvent::WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp )
: type( type ),
direction( direction ),
modifiers( modifiers ),
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/vector2.h>
* @param[in] z The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
* @param[in] timeStamp The time the wheel is being rolled
*/
- WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp );
+ WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp );
/**
* @brief Destructor.
*
* 0 means the default vertical wheel, and 1 means horizontal wheel.
*/
- int direction;
+ int32_t direction;
/**
* @brief Modifier keys pressed during the event (such as shift, alt and control).
*/
- unsigned int modifiers;
+ uint32_t modifiers;
/**
* @brief The co-ordinates of the cursor relative to the top-left of the screen
* @brief The offset of the wheel rolling, where positive value means rolling down or clockwise
* and negative value means rolling up or counter-clockwise.
*/
- int z;
+ int32_t z;
/**
* @brief The time when the wheel is being rolled.
*/
- unsigned int timeStamp;
+ uint32_t timeStamp;
};
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return BufferImage(internal);
}
-BufferImage BufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelformat)
+BufferImage BufferImage::New(uint32_t width, uint32_t height, Pixel::Format pixelformat)
{
DALI_ASSERT_ALWAYS( 0u != width && "Invalid BufferImage width requested" );
DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
return BufferImage(internal.Get());
}
-BufferImage BufferImage::New(PixelBuffer* pixBuf, unsigned int width, unsigned int height, Pixel::Format pixelformat, unsigned int stride)
+BufferImage BufferImage::New(PixelBuffer* pixBuf, uint32_t width, uint32_t height, Pixel::Format pixelformat, uint32_t stride)
{
DALI_ASSERT_ALWAYS( 0u != width && "Invalid BufferImage width requested" );
DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
return GetImplementation(*this).GetBuffer();
}
-unsigned int BufferImage::GetBufferSize() const
+uint32_t BufferImage::GetBufferSize() const
{
return GetImplementation(*this).GetBufferSize();
}
-unsigned int BufferImage::GetBufferStride() const
+uint32_t BufferImage::GetBufferStride() const
{
return GetImplementation(*this).GetBufferStride();
}
class BufferImage;
}
-typedef unsigned char PixelBuffer; ///< pixel data buffer @SINCE_1_0.0
-typedef Rect<unsigned int> RectArea; ///< rectangular area (x,y,w,h) @SINCE_1_0.0
+typedef uint8_t PixelBuffer; ///< pixel data buffer @SINCE_1_0.0
+typedef Rect<uint32_t> RectArea; ///< rectangular area (x,y,w,h) @SINCE_1_0.0
/**
* @note default resource management policies are Immediate and Never
*
*/
- static BufferImage New(unsigned int width,
- unsigned int height,
+ static BufferImage New(uint32_t width,
+ uint32_t height,
Pixel::Format pixelformat=Pixel::RGBA8888) DALI_DEPRECATED_API;
/**
* @pre width & height are greater than zero
*/
static BufferImage New(PixelBuffer* pixelBuffer,
- unsigned int width,
- unsigned int height,
+ uint32_t width,
+ uint32_t height,
Pixel::Format pixelFormat=Pixel::RGBA8888,
- unsigned int stride=0) DALI_DEPRECATED_API;
+ uint32_t stride=0) DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_2.41
* @SINCE_1_0.0
* @return The buffer size in bytes
*/
- unsigned int GetBufferSize() const DALI_DEPRECATED_API;
+ uint32_t GetBufferSize() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_2.41
* @SINCE_1_0.0
* @return The buffer stride
*/
- unsigned int GetBufferStride() const DALI_DEPRECATED_API;
+ uint32_t GetBufferStride() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_2.41
*
*/
-// EXTERNAL INCLUDES
-#include <stdint.h>
-
// INTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/images/image-operations.h>
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return *this;
}
-FrameBufferImage FrameBufferImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
+FrameBufferImage FrameBufferImage::New( uint32_t width, uint32_t height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
{
Dali::Vector2 stageSize = Stage::GetCurrent().GetSize();
Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New(
- (0 == width) ? stageSize.width : width,
- (0 == height) ? stageSize.height : height,
+ (0 == width) ? static_cast<uint32_t>( stageSize.width ) : width,
+ (0 == height) ? static_cast<uint32_t>( stageSize.height ) : height,
pixelformat,
bufferformat);
* @return A handle to a new instance of a FrameBufferImage
* @post When the FrameBufferImage is first used as a render target, an exception may be thrown if pixelFormat is not supported on the hardware platform.
*/
- static FrameBufferImage New(unsigned int width = 0, unsigned int height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
+ static FrameBufferImage New(uint32_t width = 0, uint32_t height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
RenderBuffer::Format bufferFormat = RenderBuffer::COLOR) DALI_DEPRECATED_API;
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return Image( dynamic_cast<Dali::Internal::Image*>(handle.GetObjectPtr()) );
}
-unsigned int Image::GetWidth() const
+uint32_t Image::GetWidth() const
{
return GetImplementation(*this).GetWidth();
}
-unsigned int Image::GetHeight() const
+uint32_t Image::GetHeight() const
{
return GetImplementation(*this).GetHeight();
}
// EXTERNAL INCLUDES
#include <string>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
* @SINCE_1_0.0
* @return Width of the image in pixels
*/
- unsigned int GetWidth() const DALI_DEPRECATED_API;
+ uint32_t GetWidth() const DALI_DEPRECATED_API;
/**
* @DEPRECATED_1_2.41
* @SINCE_1_0.0
* @return Height of the image in pixels
*/
- unsigned int GetHeight() const DALI_DEPRECATED_API;
+ uint32_t GetHeight() const DALI_DEPRECATED_API;
public: // Signals
#define __DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <cstddef>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
* @return A GL error code
* @pre There is a GL context for the current thread.
*/
- virtual unsigned int TargetTexture() = 0;
+ virtual uint32_t TargetTexture() = 0;
/**
* @brief Called internally for each Bind call for this texture to allow implementation specific operations.
* @SINCE_1_0.0
* @return Width
*/
- virtual unsigned int GetWidth() const = 0;
+ virtual uint32_t GetWidth() const = 0;
/**
* @brief Returns the height of the NativeImage.
* @SINCE_1_0.0
* @return Height
*/
- virtual unsigned int GetHeight() const = 0;
+ virtual uint32_t GetHeight() const = 0;
/**
* @brief Queries whether blending is required.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// CLASS HEADER
-#include "pixel-data.h"
-
-// EXTERNAL INLCUDES
-#include <stdlib.h>
+#include <dali/public-api/images/pixel-data.h>
// INTERNAL INCLUDES
#include <dali/internal/event/images/pixel-data-impl.h>
namespace Dali
{
-PixelData PixelData::New(unsigned char* buffer,
- unsigned int bufferSize,
- unsigned int width,
- unsigned int height,
- Pixel::Format pixelFormat,
- ReleaseFunction releaseFunction)
+PixelData PixelData::New( uint8_t* buffer,
+ uint32_t bufferSize,
+ uint32_t width,
+ uint32_t height,
+ Pixel::Format pixelFormat,
+ ReleaseFunction releaseFunction )
{
IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
return PixelData( internal.Get() );
return *this;
}
-unsigned int PixelData::GetWidth() const
+uint32_t PixelData::GetWidth() const
{
return GetImplementation(*this).GetWidth();
}
-unsigned int PixelData::GetHeight() const
+uint32_t PixelData::GetHeight() const
{
return GetImplementation(*this).GetHeight();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint8_t, uint32_t
+
+// INTERNAL INCLUDES
#include <dali/public-api/images/pixel.h>
#include <dali/public-api/object/base-handle.h>
* @param[in] releaseFunction The function used to release the memory
* @return A handle to the PixelData
*/
- static PixelData New( unsigned char* buffer,
- unsigned int bufferSize,
- unsigned int width,
- unsigned int height,
+ static PixelData New( uint8_t* buffer,
+ uint32_t bufferSize,
+ uint32_t width,
+ uint32_t height,
Pixel::Format pixelFormat,
ReleaseFunction releaseFunction);
* @SINCE_1_1.43
* @return The width of the buffer in pixels
*/
- unsigned int GetWidth() const;
+ uint32_t GetWidth() const;
/**
* @brief Gets the height of the buffer in pixels.
* @SINCE_1_1.43
* @return The height of the buffer in pixels
*/
- unsigned int GetHeight() const;
+ uint32_t GetHeight() const;
/**
* @brief Gets the pixel format.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return false;
}
-unsigned int Pixel::GetBytesPerPixel(Format pixelFormat)
+uint32_t Pixel::GetBytesPerPixel(Format pixelFormat)
{
switch (pixelFormat)
{
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
* @param[in] pixelFormat The pixel format
* @return The number of bytes per pixel
*/
-DALI_CORE_API unsigned int GetBytesPerPixel(Format pixelFormat);
+DALI_CORE_API uint32_t GetBytesPerPixel(Format pixelFormat);
/**
* @brief Returns the offset of the byte containing the alpha value from the start of the pixel data
#define __DALI_MATH_UTILS_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/constants.h>
* @param[in] i Input number
* @return The next power of two or i itself in case it's a power of two
*/
-inline unsigned int NextPowerOfTwo( unsigned int i )
+inline uint32_t NextPowerOfTwo( uint32_t i )
{
- DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(unsigned) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
+ DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(uint32_t) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
if(i==0u)
{
return 1u;
* @param[in] i Input number
* @return True if i is power of two.
*/
-inline bool IsPowerOfTwo( unsigned int i )
+inline bool IsPowerOfTwo( uint32_t i )
{
return (i != 0u) && ((i & (i - 1u)) == 0u);
}
const float absA = fabsf( a );
const float absB = fabsf( b );
const float absF = absA > absB ? absA : absB;
- const int absI = absF;
+ const int32_t absI = static_cast<int32_t>( absF ); // truncated
float epsilon = Math::MACHINE_EPSILON_10000;
if (absF < 0.1f)
* @param[in] pos decimal place
* @return a rounded float
*/
-inline float Round(float value, int pos)
+inline float Round( float value, int32_t pos )
{
float temp;
- temp = value * powf( 10, pos );
- temp = floorf( temp + 0.5 );
- temp *= powf( 10, -pos );
+ temp = value * powf( 10.f, static_cast<float>( pos ) );
+ temp = floorf( temp + 0.5f );
+ temp *= powf( 10.f, static_cast<float>( -pos ) );
return temp;
}
* @return -1 for negative values, +1 for positive values and 0 if value is 0
*/
template <typename T>
-int Sign( T value )
+int32_t Sign( T value )
{
return ( T(0) < value ) - ( value < T(0) );
}
return false;
}
- det = 1.0 / det;
+ det = 1.0f / det;
- for (int i = 0; i < 16; i++)
+ for( int32_t i = 0; i < 16; i++)
{
out[i] = inv[i] * det;
}
#ifndef __ARM_NEON__
- for( int i=0; i < 4; i++ )
+ for( int32_t i=0; i < 4; i++ )
{
// i<<2 gives the first vector / column
- int loc = i<<2;
- int loc1 = loc + 1;
- int loc2 = loc + 2;
- int loc3 = loc + 3;
+ int32_t loc = i<<2;
+ int32_t loc1 = loc + 1;
+ int32_t loc2 = loc + 2;
+ int32_t loc3 = loc + 3;
float value0 = lhsPtr[loc];
float value1 = lhsPtr[loc1];
float value2 = lhsPtr[loc2];
#ifndef __ARM_NEON__
- for( int i=0; i < 4; i++ )
+ for( int32_t i=0; i < 4; i++ )
{
// i<<2 gives the first vector / column
- int loc = i<<2;
- int loc1 = loc + 1;
- int loc2 = loc + 2;
- int loc3 = loc + 3;
+ int32_t loc = i<<2;
+ int32_t loc1 = loc + 1;
+ int32_t loc2 = loc + 2;
+ int32_t loc3 = loc + 3;
float value0 = lhsPtr[loc];
float value1 = lhsPtr[loc1];
float value2 = lhsPtr[loc2];
// In the case where the determinant is exactly zero, the matrix is non-invertible
if( ! EqualsZero( det ) )
{
- det = 1.0 / det;
- for (int i = 0; i < 9; i++)
+ det = 1.0f / det;
+ for( int32_t i = 0; i < 9; i++ )
{
mElements[i] = cof[i] * det;
}
const float* rhsPtr = rhs.AsFloat();
const float* lhsPtr = lhs.AsFloat();
- for( int i=0; i < 3; i++ )
+ for( int32_t i=0; i < 3; i++ )
{
- int loc = i * 3;
- int loc1 = loc + 1;
- int loc2 = loc + 2;
+ int32_t loc = i * 3;
+ int32_t loc1 = loc + 1;
+ int32_t loc2 = loc + 2;
float value0 = lhsPtr[loc];
float value1 = lhsPtr[loc1];
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
//Formula for angle θ between two quaternion is:
//θ = cos^−1 (2⟨q1,q2⟩^2 − 1), Where (q1,q2) is inner product of the quaternions.
float X = from.mVector.Dot4(to.mVector);
- float theta = acos( (2 * X * X) - 1);
+ float theta = acosf( (2 * X * X) - 1); // float arc cosine
return theta;
}
#define __DALI_RANDOM_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static bool initialized( false );
if( !initialized )
{
- auto seed = time( NULL );
+ uint32_t seed = static_cast<uint32_t>( time( NULL ) );
srand( seed );
initialized = true;
}
- auto randValue = rand();
- return (randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
+ int32_t randValue = rand();
+ return static_cast<float>(randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
}
/**
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <iosfwd>
// INTERNAL INCLUDES
* @param[in] index Subscript index
* @return The float at the given index
*/
- const float& operator[](const unsigned int index) const
+ const float& operator[](const uint32_t index) const
{
DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
* @param[in] index Subscript index
* @return The float at the given index
*/
- float& operator[](const unsigned int index)
+ float& operator[](const uint32_t index)
{
DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <iosfwd>
// INTERNAL INCLUDES
* @param[in] index Subscript index
* @return The float at the given index
*/
- const float& operator[](const unsigned int index) const
+ const float& operator[](const uint32_t index) const
{
DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
* @param[in] index Subscript index
* @return The float at the given index
*/
- float& operator[](const unsigned int index)
+ float& operator[](const uint32_t index)
{
DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
#include <iosfwd>
// INTERNAL INCLUDES
* @param[in] index Subscript index
* @return The float at the given index
*/
- const float& operator[](const unsigned int index) const
+ const float& operator[](const uint32_t index) const
{
DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
* @param[in] index Subscript index
* @return The float at the given index
*/
- float& operator[](const unsigned int index)
+ float& operator[](const uint32_t index)
{
DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
#define __DALI_VIEWPORT_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // int32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/math/rect.h>
* @brief Typedef for a viewport ( a rectangle representing a screen area ).
* @SINCE_1_0.0
*/
-typedef Rect<int> Viewport;
+typedef Rect<int32_t> Viewport;
/**
* @}
* Any floatVariable( 4.5f );
* Any strVariable( std::string( "Hello world" ) );
* uintVariable = 1u;
- * unsigned int variable = AnyCast< unsigned int >( uintVariable );
+ * uint32_t variable = AnyCast< uint32_t >( uintVariable );
* if ( typeid( int ) == uintVariable.GetType() )
* \endcode
* @SINCE_1_0.0
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return GetImplementation(*this).Supports( capability );
}
-unsigned int Handle::GetPropertyCount() const
+uint32_t Handle::GetPropertyCount() const
{
return GetImplementation(*this).GetPropertyCount();
}
GetImplementation(*this).RemoveConstraints();
}
-void Handle::RemoveConstraints( unsigned int tag )
+void Handle::RemoveConstraints( uint32_t tag )
{
GetImplementation(*this).RemoveConstraints( tag );
}
// EXTERNAL INCLUDES
#include <string>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
* @SINCE_1_0.0
* @return The number of properties
*/
- unsigned int GetPropertyCount() const;
+ uint32_t GetPropertyCount() const;
/**
* @brief Queries the name of a property.
* @param[in] tag The tag of the constraints which will be removed
* @pre The Object has been initialized.
*/
- void RemoveConstraints( unsigned int tag );
+ void RemoveConstraints( uint32_t tag );
};
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::ostream& operator<<( std::ostream& stream, const Property::Array& array )
{
stream << "Array(" << array.Count() << ") = [";
- for( unsigned int i=0; i<array.Count(); ++i )
+ for( Property::Array::SizeType i=0; i<array.Count(); ++i )
{
if( i>0 )
{
{
stream << "Map(" << map.Count() << ") = {";
- int count = 0;
+ int32_t count = 0;
// Output the String-Value pairs
for ( StringValueContainer::iterator iter = map.mImpl->mStringValueContainer.begin(), endIter = map.mImpl->mStringValueContainer.end(); iter != endIter; ++iter )
{
"MAP",
"EXTENTS",
};
-const unsigned int PROPERTY_TYPE_NAMES_COUNT = sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* );
+const uint32_t PROPERTY_TYPE_NAMES_COUNT = static_cast<uint32_t>( sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* ) );
}
namespace PropertyTypes
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
floatValue( floatValue )
{ }
- Impl( int integerValue )
+ Impl( int32_t integerValue )
: type( Property::INTEGER ),
integerValue( integerValue )
{ }
{
}
- Impl( const Rect<int>& rectValue )
+ Impl( const Rect<int32_t>& rectValue )
: type( Property::RECTANGLE ),
rectValue( new Rect<int>( rectValue ) )
{
Type type;
union
{
- int integerValue;
+ int32_t integerValue;
float floatValue;
// must use pointers for any class value pre c++ 11
Vector2* vector2Value;
Matrix* matrixValue;
AngleAxis* angleAxisValue;
std::string* stringValue;
- Rect<int>* rectValue;
+ Rect<int32_t>* rectValue;
Property::Array* arrayValue;
Property::Map* mapValue;
Extents* extentsValue;
{
}
-Property::Value::Value( int integerValue )
+Property::Value::Value( int32_t integerValue )
: mImpl( new Impl( integerValue ) )
{
}
}
case Property::RECTANGLE:
{
- mImpl = new Impl( Rect<int>(0,0,0,0) );
+ mImpl = new Impl( Rect<int32_t>(0,0,0,0) );
break;
}
case Property::ROTATION:
}
else if( mImpl->type == FLOAT )
{
- integerValue = static_cast< int >( mImpl->floatValue );
+ integerValue = static_cast< int32_t >( mImpl->floatValue );
converted = true;
}
}
* @SINCE_1_0.0
* @param[in] integerValue An integer value
*/
- Value( int integerValue );
+ Value( int32_t integerValue );
/**
* @brief Creates a float property value.
* @SINCE_1_0.0
* @param[in] vectorValue A vector of 4 integer values
*/
- Value( const Rect<int>& vectorValue );
+ Value( const Rect<int32_t>& vectorValue );
/**
* @brief Creates an orientation property value.
* @return @c true if the value is successfully retrieved, @c false if the type is not convertible
* @pre GetType() is a type convertible to int.
*/
- bool Get( int& integerValue ) const;
+ bool Get( int32_t& integerValue ) const;
/**
* @brief Retrieves an integer rectangle.
* @return @c true if the value is successfully retrieved, @c false if the type is not convertible
* @pre GetType() is a type convertible to Rect<int>.
*/
- bool Get( Rect<int>& rect ) const;
+ bool Get( Rect<int32_t>& rect ) const;
/**
* @brief Retrieves a vector value.
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-const int Property::INVALID_INDEX = -1;
-const int Property::INVALID_KEY = -1;
-const int Property::INVALID_COMPONENT_INDEX = -1;
+const int32_t Property::INVALID_INDEX = -1;
+const int32_t Property::INVALID_KEY = -1;
+const int32_t Property::INVALID_COMPONENT_INDEX = -1;
Property::Property(Handle& obj, Property::Index propIndex)
: object(obj),
{
}
-Property::Property(Handle& obj, Property::Index propIndex, int compIndex)
+Property::Property(Handle& obj, Property::Index propIndex, int32_t compIndex)
: object(obj),
propertyIndex(propIndex),
componentIndex(compIndex)
propertyIndex = object.GetPropertyIndex( propertyName );
}
-Property::Property(Handle& obj, const std::string& propertyName, int compIndex)
+Property::Property(Handle& obj, const std::string& propertyName, int32_t compIndex)
: object(obj),
propertyIndex(Property::INVALID_INDEX),
componentIndex(compIndex)
// EXTERNAL INCLUDES
#include <string>
#include <utility>
+#include <cstdint> // int32_t
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
* @brief A valid property index is zero or greater.
* @SINCE_1_0.0
*/
- typedef int Index;
+ typedef int32_t Index;
- static const int INVALID_INDEX; ///< -1 is not a valid property index
- static const int INVALID_KEY; ///< -1 is not a valid property key
- static const int INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
+ static const int32_t INVALID_INDEX; ///< -1 is not a valid property index
+ static const int32_t INVALID_KEY; ///< -1 is not a valid property key
+ static const int32_t INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices @SINCE_1_0.0
* @param[in] propertyIndex The index of a property.
* @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1)
*/
- Property( Handle& object, Property::Index propertyIndex, int componentIndex );
+ Property( Handle& object, Property::Index propertyIndex, int32_t componentIndex );
/**
* @brief Creates a Property instance.
* @note This performs a property index query and is therefore slower than
* constructing a Property directly with the index.
*/
- Property( Handle& object, const std::string& propertyName, int componentIndex );
+ Property( Handle& object, const std::string& propertyName, int32_t componentIndex );
/**
* @brief Non-virtual destructor; Property is not intended as a base class.
Index propertyIndex; ///< The index of a property provided by object.
- int componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
+ int32_t componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
};
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
-int RefObject::ReferenceCount()
+uint32_t RefObject::ReferenceCount()
{
return mCount;
}
*/
// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
+// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/intrusive-ptr.h>
* @SINCE_1_0.0
* @return The reference count
*/
- int ReferenceCount();
+ uint32_t ReferenceCount();
protected:
private:
- volatile int mCount; ///< Reference count
+ volatile uint32_t mCount; ///< Reference count
};
/**
Internal::TypeRegistry::Get()->RegisterAnimatableProperty( registered, name, index, value );
}
-AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex)
+AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
{
DALI_ASSERT_ALWAYS( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) );
// EXTERNAL INCLUDES
#include <typeinfo>
+#include <cstdint> // uint32_t
// INTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
* @param[in] componentIndex The index of the component (e.g. 0 for the x component of a Vector2 property and 1 for the y component of a Vector2 property)
* @pre "registered" must be registered with the TypeRegistry.
*/
- AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+ AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex );
};
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
GetImplementation(*this).RemoveTask( task );
}
-unsigned int RenderTaskList::GetTaskCount() const
+uint32_t RenderTaskList::GetTaskCount() const
{
return GetImplementation(*this).GetTaskCount();
}
-RenderTask RenderTaskList::GetTask( unsigned int index ) const
+RenderTask RenderTaskList::GetTask( uint32_t index ) const
{
return GetImplementation(*this).GetTask( index );
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
* @SINCE_1_0.0
* @return The number of render-tasks
*/
- unsigned int GetTaskCount() const;
+ uint32_t GetTaskCount() const;
/**
* @brief Retrieves a render-task.
* @return A handle to the render-task
* @pre index should be in range i.e. less than GetTaskCount().
*/
- RenderTask GetTask( unsigned int index ) const;
+ RenderTask GetTask( uint32_t index ) const;
public: // Not intended for application developers
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
RenderTask::ConstScreenToFrameBufferFunction RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION = DefaultScreenToFrameBufferFunction;
RenderTask::ConstScreenToFrameBufferFunction RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION = FullScreenFrameBufferFunction;
-const bool RenderTask::DEFAULT_EXCLUSIVE = false;
-const bool RenderTask::DEFAULT_INPUT_ENABLED = true;
-const Vector4 RenderTask::DEFAULT_CLEAR_COLOR = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
-const bool RenderTask::DEFAULT_CLEAR_ENABLED = false;
-const bool RenderTask::DEFAULT_CULL_MODE = true;
-const unsigned int RenderTask::DEFAULT_REFRESH_RATE = REFRESH_ALWAYS;
+const bool RenderTask::DEFAULT_EXCLUSIVE = false;
+const bool RenderTask::DEFAULT_INPUT_ENABLED = true;
+const Vector4 RenderTask::DEFAULT_CLEAR_COLOR = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
+const bool RenderTask::DEFAULT_CLEAR_ENABLED = false;
+const bool RenderTask::DEFAULT_CULL_MODE = true;
+const uint32_t RenderTask::DEFAULT_REFRESH_RATE = REFRESH_ALWAYS;
RenderTask::RenderTask()
{
return GetImplementation(*this).GetCullMode();
}
-void RenderTask::SetRefreshRate( unsigned int refreshRate )
+void RenderTask::SetRefreshRate( uint32_t refreshRate )
{
GetImplementation(*this).SetRefreshRate( refreshRate );
}
-unsigned int RenderTask::GetRefreshRate() const
+uint32_t RenderTask::GetRefreshRate() const
{
return GetImplementation(*this).GetRefreshRate();
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/math/viewport.h>
#include <dali/public-api/object/handle.h>
REFRESH_ALWAYS = 1 ///< Process every frame. @SINCE_1_0.0
};
- static const bool DEFAULT_EXCLUSIVE; ///< false
- static const bool DEFAULT_INPUT_ENABLED; ///< true
- static const Vector4 DEFAULT_CLEAR_COLOR; ///< Color::BLACK
- static const bool DEFAULT_CLEAR_ENABLED; ///< false
- static const bool DEFAULT_CULL_MODE; ///< true
- static const unsigned int DEFAULT_REFRESH_RATE; ///< REFRESH_ALWAYS
+ static const bool DEFAULT_EXCLUSIVE; ///< false
+ static const bool DEFAULT_INPUT_ENABLED; ///< true
+ static const Vector4 DEFAULT_CLEAR_COLOR; ///< Color::BLACK
+ static const bool DEFAULT_CLEAR_ENABLED; ///< false
+ static const bool DEFAULT_CULL_MODE; ///< true
+ static const uint32_t DEFAULT_REFRESH_RATE; ///< REFRESH_ALWAYS
/**
* @brief Creates an empty RenderTask handle.
* @SINCE_1_0.0
* @param[in] refreshRate The new refresh rate
*/
- void SetRefreshRate( unsigned int refreshRate );
+ void SetRefreshRate( uint32_t refreshRate );
/**
* @brief Queries the refresh-rate of the RenderTask.
* @SINCE_1_0.0
* @return The refresh-rate
*/
- unsigned int GetRefreshRate() const;
+ uint32_t GetRefreshRate() const;
/**
* @brief Gets viewport coordinates for given world position.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use *this file except in compliance with the License.
namespace Dali
{
-FrameBuffer FrameBuffer::New( unsigned int width, unsigned int height, unsigned int attachments )
+FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height, uint32_t attachments )
{
Internal::FrameBufferPtr frameBuffer = Internal::FrameBuffer::New( width, height, attachments );
return FrameBuffer( frameBuffer.Get() );
AttachColorTexture( texture, 0u, 0u );
}
-void FrameBuffer::AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer )
{
if( texture )
{
*
*/
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
// INTERNAL INCLUDES
#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/rendering/texture.h>
* @param[in] attachments The attachments comprising the format of the FrameBuffer (the type is int to allow multiple bitmasks to be ORd)
* @return A handle to a newly allocated FrameBuffer
*/
- static FrameBuffer New( unsigned int width, unsigned int height, unsigned int attachments );
+ static FrameBuffer New( uint32_t width, uint32_t height, uint32_t attachments );
/**
* @brief Default constructor, creates an empty handle.
* @note The specified texture mipmap has to have the same size than the FrameBuffer
* otherwise it won't be attached.
*/
- void AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer );
+ void AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer );
/**
* @brief Gets the color texture used as output in the FrameBuffer.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use *this file except in compliance with the License.
GetImplementation(*this).RemoveVertexBuffer( index );
}
-void Geometry::SetIndexBuffer( const unsigned short* indices, size_t count )
+void Geometry::SetIndexBuffer( const uint16_t* indices, size_t count )
{
GetImplementation(*this).SetIndexBuffer( indices, count );
}
// EXTERNAL INCLUDES
#include <cstddef> // std::size_t
+#include <cstdint> // uint16_t
// INTERNAL INCLUDES
#include <dali/public-api/object/handle.h> // Dali::Handle
* @param[in] indices Array of indices
* @param[in] count Number of indices in the array
*/
- void SetIndexBuffer( const unsigned short* indices, size_t count );
+ void SetIndexBuffer( const uint16_t* indices, size_t count );
/**
* @brief Sets the type of primitives this geometry contains.
void PropertyBuffer::SetData( const void* data, std::size_t size )
{
- GetImplementation(*this).SetData( data, size );
+ GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
}
std::size_t PropertyBuffer::GetSize() const
* texturedQuadVertices.SetData( texturedQuadVertexData, 4 );
*
* // Create indices
- * unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ * uint32_t indexData[6] = { 0, 3, 1, 0, 2, 3 };
*
* // Create the geometry object
* Geometry texturedQuadGeometry = Geometry::New();
if( texture )
{
Internal::TexturePtr texturePtr( &GetImplementation( texture ) );
- GetImplementation(*this).SetTexture( index, texturePtr );
+ GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), texturePtr ); // only support 4,294,967,295 textures
}
else
{
- GetImplementation(*this).SetTexture( index, NULL );
+ GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 textures
}
}
Texture TextureSet::GetTexture( size_t index ) const
{
- Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( index );
+ Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 textures
return Dali::Texture( texturePtr );
}
if( sampler )
{
Internal::SamplerPtr samplerPtr( &GetImplementation( sampler ) );
- GetImplementation(*this).SetSampler( index, samplerPtr );
+ GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), samplerPtr ); // only support 4,294,967,295 samplers
}
else
{
- GetImplementation(*this).SetSampler( index, NULL );
+ GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 samplers
}
}
Sampler TextureSet::GetSampler( size_t index ) const
{
- Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( index );
+ Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 samplers
return Dali::Sampler( samplerPtr );
}
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use *this file except in compliance with the License.
namespace Dali
{
-Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture Texture::New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height )
{
Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
return Texture( texture.Get() );
}
bool Texture::Upload( PixelData pixelData,
- unsigned int layer, unsigned int mipmap,
- unsigned int xOffset, unsigned int yOffset,
- unsigned int width, unsigned int height )
+ uint32_t layer, uint32_t mipmap,
+ uint32_t xOffset, uint32_t yOffset,
+ uint32_t width, uint32_t height )
{
Internal::PixelData& internalPixelData = GetImplementation( pixelData );
return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height );
return GetImplementation(*this).GenerateMipmaps();
}
-unsigned int Texture::GetWidth() const
+uint32_t Texture::GetWidth() const
{
return GetImplementation(*this).GetWidth();
}
-unsigned int Texture::GetHeight() const
+uint32_t Texture::GetHeight() const
{
return GetImplementation(*this).GetHeight();
}
* These constants should be used as the "layer" parameter when uploading a cube-map with Texture::Upload.
* @SINCE_1_1.43
*/
- const unsigned int POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
- const unsigned int NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
- const unsigned int POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
- const unsigned int NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
- const unsigned int POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
- const unsigned int NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
+ const uint32_t POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
+ const uint32_t NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
+ const uint32_t POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
+ const uint32_t NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
+ const uint32_t POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
+ const uint32_t NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
} // namespace CubeMapLayer
* @param[in] height The height of the texture
* @return A handle to a newly allocated Texture
*/
- static Texture New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height );
+ static Texture New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height );
/**
* @brief Creates a new Texture object from a native image.
* @return True if the PixelData object has compatible pixel format and fits in the rectangle specified, false otherwise
*/
bool Upload( PixelData pixelData,
- unsigned int layer, unsigned int mipmap,
- unsigned int xOffset, unsigned int yOffset,
- unsigned int width, unsigned int height );
+ uint32_t layer, uint32_t mipmap,
+ uint32_t xOffset, uint32_t yOffset,
+ uint32_t width, uint32_t height );
/**
* @brief Generates mipmaps for the texture.
* @SINCE_1_1.43
* @return The width, in pixels, of the texture
*/
- unsigned int GetWidth() const;
+ uint32_t GetWidth() const;
/**
* @brief Returns the height of the texture.
* @SINCE_1_1.43
* @return The height, in pixels, of the texture
*/
- unsigned int GetHeight() const;
+ uint32_t GetHeight() const;
public:
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace
{
-const int INVALID_CALLBACK_INDEX = -1;
+const int32_t INVALID_CALLBACK_INDEX = -1;
} // unnamed namespace
{
DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
- int index = FindCallback( callback );
+ int32_t index = FindCallback( callback );
// Don't double-connect the same callback
if( INVALID_CALLBACK_INDEX == index )
{
DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
- int index = FindCallback( callback );
+ int32_t index = FindCallback( callback );
if( index > INVALID_CALLBACK_INDEX )
{
DALI_ASSERT_ALWAYS( NULL != tracker && "Invalid ConnectionTrackerInterface pointer passed to Connect()" );
DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
- int index = FindCallback( callback );
+ int32_t index = FindCallback( callback );
// Don't double-connect the same callback
if( INVALID_CALLBACK_INDEX == index )
DALI_ASSERT_ALWAYS( NULL != tracker && "Invalid ConnectionTrackerInterface pointer passed to Disconnect()" );
DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
- int index = FindCallback( callback );
+ int32_t index = FindCallback( callback );
if( index > INVALID_CALLBACK_INDEX )
{
return callback;
}
-int BaseSignal::FindCallback( CallbackBase* callback )
+int32_t BaseSignal::FindCallback( CallbackBase* callback )
{
- int index( INVALID_CALLBACK_INDEX );
+ int32_t index( INVALID_CALLBACK_INDEX );
// A signal can have multiple slots connected to it.
// We need to search for the slot which has the same call back function (if it's static)
// Or the same object / member function (for non-static)
- const std::size_t count( mSignalConnections.Count() );
- for( std::size_t i=0; i < count; ++i )
+ const std::size_t count = mSignalConnections.Count();
+ for( std::size_t i = 0; i < count; ++i )
{
const CallbackBase* connectionCallback = GetCallback( i );
// Note that values are set to NULL in DeleteConnection
- if( connectionCallback &&
- ( *connectionCallback == *callback ) )
+ if( connectionCallback && ( *connectionCallback == *callback ) )
{
- index = i;
+ index = static_cast<int>( i ); // only 2,147,483,647 connections supported, no error check
break;
}
}
* @param[in] callback The call back object
* @return A valid index if the callback is connected
*/
- int FindCallback( CallbackBase* callback );
+ int32_t FindCallback( CallbackBase* callback );
/**
* @brief Deletes a connection object from the list of connections.