inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
{
const std::string shaderSource = mShaderSources[shader];
- if( static_cast<int>(shaderSource.length()) < bufsize )
+ const int shaderSourceLength = static_cast<int>(shaderSource.length());
+ if( shaderSourceLength < bufsize )
{
- strcpy(source, shaderSource.c_str());
- *length = shaderSource.length();
+ strncpy( source, shaderSource.c_str(), shaderSourceLength );
+ *length = shaderSourceLength;
}
else
{
#define __DALI_ANIMATION_DATA_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
/**
* @brief Adds one AnimationDataElement to the list to describe one animation.
* @param[in] animationDataElement A pre-populated struct to add
+ * @note This class takes ownership of animationDataElement
*/
void Add( AnimationDataElement* animationDataElement );
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
{
++rightmost;
}
- dest[i] = SQUARE( i - parabolas[rightmost] ) + source[parabolas[rightmost]];
+ dest[i] = SQUARE( static_cast< int >( i ) - parabolas[rightmost] ) + source[parabolas[rightmost]];
}
}
{
EnsureRelayoutData();
+ DALI_ASSERT_DEBUG( mRelayoutData && "mRelayoutData not created" );
+
mRelayoutData->relayoutEnabled = relayoutEnabled;
}
}
bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Actor* actor = dynamic_cast< Actor* >( object );
+ Actor* actor = static_cast< Actor* >( object ); // TypeRegistry guarantees that this is the correct type.
if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Animation* animation = dynamic_cast<Animation*>(object);
+ Animation* animation = static_cast< Animation* >(object); // TypeRegistry guarantees that this is the correct type.
if( 0 == signalName.compare( SIGNAL_FINISHED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool ObjectRegistry::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- ObjectRegistry* objectRegistry = dynamic_cast<ObjectRegistry*>( object );
+ ObjectRegistry* objectRegistry = static_cast< ObjectRegistry* >( object ); // TypeRegistry guarantees that this is the correct type.
if( 0 == strcmp( signalName.c_str(), SIGNAL_OBJECT_CREATED ) )
{
bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Stage* stage = dynamic_cast<Stage*>(object);
+ Stage* stage = static_cast< Stage* >(object); // TypeRegistry guarantees that this is the correct type.
if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool LongPressGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- LongPressGestureDetector* gesture = dynamic_cast<LongPressGestureDetector*>(object);
+ LongPressGestureDetector* gesture = static_cast< LongPressGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESS_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool PanGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- PanGestureDetector* gesture = dynamic_cast<PanGestureDetector*>(object);
+ PanGestureDetector* gesture = static_cast< PanGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_PAN_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool PinchGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- PinchGestureDetector* gesture = dynamic_cast<PinchGestureDetector*>(object);
+ PinchGestureDetector* gesture = static_cast< PinchGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_PINCH_DETECTED ) )
{
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
bool TapGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- TapGestureDetector* gesture = dynamic_cast<TapGestureDetector*>(object);
+ TapGestureDetector* gesture = static_cast< TapGestureDetector* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_TAP_DETECTED ) )
{
// unsigned int GetBufferSize() const
virtual size_t GetBufferSize() const
{
- return mBufferWidth*mBytesPerPixel*mBufferHeight;
+ return static_cast< size_t >( mBufferWidth ) * mBytesPerPixel * mBufferHeight; // need to cast to size_t to avoid possibility of overflow
}
/**
* @return The buffer stride (in bytes).
*/
virtual unsigned int GetBufferStride() const;
- //{
- // return mBufferWidth*mBytesPerPixel;
- //}
/**
* Get the pixel format
bool RenderTask::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- RenderTask* renderTask = dynamic_cast<RenderTask*>(object);
+ RenderTask* renderTask = static_cast< RenderTask* >(object); // TypeRegistry guarantees that this is the correct type.
if ( 0 == strcmp( signalName.c_str(), SIGNAL_FINISHED ) )
{
#define __DALI_INTERNAL_RESOURCE_CLIENT_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
void UpdateImageTicket( ResourceId id, const ImageAttributes& imageAttributes ); ///!< Issue #AHC01
private:
+
+ ResourceClient( const ResourceClient& ); ///< Undefined
+ ResourceClient& operator=( const ResourceClient& ); ///< Undefined
+
ResourceManager& mResourceManager; ///< The resource manager
EventThreadServices& mEventThreadServices; ///< Interface to send messages through
#define __DALI_INTERNAL_PROGRAM_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
private:
- // default constructor, not defined
- Program();
- // assignment operator, not defined
- Program& operator=( const Program& );
+ Program(); ///< default constructor, not defined
+ Program( const Program& ); ///< copy constructor, not defined
+ Program& operator=( const Program& ); ///< assignment operator, not defined
/**
* Load the shader, from a precompiled binary if available, else from source code
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
mConditionType(condition),
mArguments(arguments),
mValid(false),
- mNotifyMode( Dali::PropertyNotification::Disabled )
+ mNotifyMode( Dali::PropertyNotification::Disabled ),
+ mConditionFunction(NULL)
{
SetNotifyMode(notifyMode);
#define __DALI_INTERNAL_SCENE_GRAPH_PAN_GESTURE_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
*/
Info& operator=( const Info& rhs )
{
- velocity = rhs.velocity;
- displacement = rhs.displacement;
- position = rhs.position;
+ if( this != &rhs )
+ {
+ velocity = rhs.velocity;
+ displacement = rhs.displacement;
+ position = rhs.position;
+ }
return *this;
}
*/
PanInfo& operator=( const PanInfo& rhs )
{
- time = rhs.time;
- state = rhs.state;
- local = rhs.local;
- screen = rhs.screen;
+ if( this != &rhs )
+ {
+ time = rhs.time;
+ state = rhs.state;
+ local = rhs.local;
+ screen = rhs.screen;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
Gesture& Gesture::operator=( const Gesture& rhs )
{
- type = rhs.type;
- state = rhs.state;
- time = rhs.time;
+ if( this != &rhs )
+ {
+ type = rhs.type;
+ state = rhs.state;
+ time = rhs.time;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
LongPressGesture& LongPressGesture::operator=( const LongPressGesture& rhs )
{
- Gesture::operator=(rhs);
- numberOfTouches = rhs.numberOfTouches;
- screenPoint = rhs.screenPoint;
- localPoint = rhs.localPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ numberOfTouches = rhs.numberOfTouches;
+ screenPoint = rhs.screenPoint;
+ localPoint = rhs.localPoint;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
PanGesture& PanGesture::operator=( const PanGesture& rhs )
{
- Gesture::operator=(rhs);
- velocity = rhs.velocity;
- displacement = rhs.displacement;
- position = rhs.position;
- screenVelocity = rhs.screenVelocity;
- screenDisplacement = rhs.screenDisplacement;
- screenPosition = rhs.screenPosition;
- numberOfTouches = rhs.numberOfTouches;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ velocity = rhs.velocity;
+ displacement = rhs.displacement;
+ position = rhs.position;
+ screenVelocity = rhs.screenVelocity;
+ screenDisplacement = rhs.screenDisplacement;
+ screenPosition = rhs.screenPosition;
+ numberOfTouches = rhs.numberOfTouches;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
PinchGesture& PinchGesture::operator=( const PinchGesture& rhs )
{
- Gesture::operator=(rhs);
- scale = rhs.scale;
- speed = rhs.speed;
- screenCenterPoint = rhs.screenCenterPoint;
- localCenterPoint = rhs.localCenterPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ scale = rhs.scale;
+ speed = rhs.speed;
+ screenCenterPoint = rhs.screenCenterPoint;
+ localCenterPoint = rhs.localCenterPoint;
+ }
return *this;
}
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
TapGesture& TapGesture::operator=( const TapGesture& rhs )
{
- Gesture::operator=(rhs);
- numberOfTaps = rhs.numberOfTaps;
- numberOfTouches = rhs.numberOfTouches;
- screenPoint = rhs.screenPoint;
- localPoint = rhs.localPoint;
+ if( this != &rhs )
+ {
+ Gesture::operator=(rhs);
+ numberOfTaps = rhs.numberOfTaps;
+ numberOfTouches = rhs.numberOfTouches;
+ screenPoint = rhs.screenPoint;
+ localPoint = rhs.localPoint;
+ }
return *this;
}
}
Property::Value::Value( Type type )
+: mImpl( NULL )
{
switch (type)
{