-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2014 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 "alignment-impl.h"
-// INTERNAL INCLUDES
-
// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+
+// INTERNAL INCLUDES
namespace Dali
{
{}
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- ScaleToFillConstraint( const ScaleToFillConstraint& rhs )
- : mPadding( rhs.mPadding )
- {}
-
- /**
* Called by render thread
*/
Vector3 operator()( const Vector3& currentSize,
{}
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- ScaleToFitKeepAspectConstraint( const ScaleToFitKeepAspectConstraint& rhs )
- : mPadding( rhs.mPadding ),
- mSizeStored( rhs.mSizeStored ),
- mOriginalSize( rhs.mOriginalSize )
- {}
-
- /**
* Called by render thread
*/
Vector3 operator()( const Vector3& currentSize,
{ }
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- ScaleToFillKeepAspectConstraint( const ScaleToFillKeepAspectConstraint& rhs )
- : mPadding( rhs.mPadding ),
- mSizeStored( rhs.mSizeStored ),
- mOriginalSize( rhs.mOriginalSize )
- {}
-
- /**
* Called by render thread
*/
Vector3 operator()( const Vector3& currentSize,
{}
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- ShrinkToFitConstraint( const ShrinkToFitConstraint& rhs )
- : mPadding( rhs.mPadding ),
- mSizeStored( rhs.mSizeStored ),
- mOriginalSize( rhs.mOriginalSize )
- { }
-
- /**
* Called by render thread
*/
Vector3 operator()( const Vector3& currentSize,
{}
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- ShrinkToFitKeepAspectConstraint( const ShrinkToFitKeepAspectConstraint& rhs )
- : mPadding( rhs.mPadding ),
- mSizeStored( rhs.mSizeStored ),
- mOriginalSize( rhs.mOriginalSize )
- { }
-
- /**
* Called by render thread
*/
Vector3 operator()( const Vector3& currentSize,
{}
/**
- * CopyConstructor. Used by Boost.
- * @param rhs Copying from.
- */
- PositionConstraint( const PositionConstraint& rhs )
- : mPadding( rhs.mPadding ),
- mHorizontalAlignment( rhs.mHorizontalAlignment ),
- mVerticalAlignment( rhs.mVerticalAlignment )
- {}
-
- /**
* Called by render thread.
*/
Vector3 operator()( const Vector3& currentPosition,
void Alignment::SetAlignmentType( Toolkit::Alignment::Type type )
{
// Horizontal Alignment
- bool horizontalSet(false);
-
+ if( type & Toolkit::Alignment::HorizontalRight )
+ {
+ mHorizontal = Toolkit::Alignment::HorizontalRight;
+ }
if( type & Toolkit::Alignment::HorizontalLeft )
{
mHorizontal = Toolkit::Alignment::HorizontalLeft;
- horizontalSet = true;
}
if( type & Toolkit::Alignment::HorizontalCenter )
{
- DALI_ASSERT_ALWAYS(!horizontalSet);
mHorizontal = Toolkit::Alignment::HorizontalCenter;
- horizontalSet = true;
- }
- if( type & Toolkit::Alignment::HorizontalRight )
- {
- DALI_ASSERT_ALWAYS(!horizontalSet);
- mHorizontal = Toolkit::Alignment::HorizontalRight;
}
// Vertical Alignment
- bool verticalSet(false);
-
+ if( type & Toolkit::Alignment::VerticalBottom )
+ {
+ mVertical = Toolkit::Alignment::VerticalBottom;
+ }
if( type & Toolkit::Alignment::VerticalTop )
{
mVertical = Toolkit::Alignment::VerticalTop;
- verticalSet = true;
}
if( type & Toolkit::Alignment::VerticalCenter )
{
- DALI_ASSERT_ALWAYS(!verticalSet);
mVertical = Toolkit::Alignment::VerticalCenter;
- verticalSet = true;
- }
- if( type & Toolkit::Alignment::VerticalBottom )
- {
- DALI_ASSERT_ALWAYS(!verticalSet);
- mVertical = Toolkit::Alignment::VerticalBottom;
}
RelayoutRequest();