X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-data-impl.h;h=347cf7d9caa8acacd95ba164621a6e6ce4c3d7ab;hp=3ffdafb09de4b3564b3a04e33e11db1e9ebdd5ba;hb=5a2a5883422f4d114902ac57d57d7d1e973fbb2e;hpb=99e2ea03e6d6059f5803d700932df1ff1c848cd3 diff --git a/dali-toolkit/internal/visuals/visual-base-data-impl.h b/dali-toolkit/internal/visuals/visual-base-data-impl.h index 3ffdafb..347cf7d 100644 --- a/dali-toolkit/internal/visuals/visual-base-data-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-data-impl.h @@ -24,6 +24,7 @@ // INTERNAL INCLUDES #include +#include namespace Dali { @@ -39,37 +40,90 @@ namespace Visual struct Base::Impl { + /** + * Constructor + */ + Impl(); + + /** + * Destructor + */ + ~Impl(); + enum Flags { IS_ON_STAGE = 1, IS_FROM_CACHE = 1 << 1, - IS_PREMULTIPLIED_ALPHA = 1 << 2, - IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3 + IS_ATLASING_APPLIED = 1<<2, + IS_PREMULTIPLIED_ALPHA = 1 << 3, + IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 4 }; struct CustomShader { + CustomShader( const Property::Map& map ); + void SetPropertyMap( const Property::Map& map ); + void CreatePropertyMap( Property::Map& map ) const; + std::string mVertexShader; std::string mFragmentShader; Dali::ImageDimensions mGridSize; Dali::Shader::Hint::Value mHints; //(bitfield) values from enum Shader::Hint - - CustomShader( const Property::Map& map ); - void SetPropertyMap( const Property::Map& map ); - void CreatePropertyMap( Property::Map& map ) const; }; - Renderer mRenderer; - - CustomShader* mCustomShader; + struct Transform + { + /** + * Default constructor ensures the visual fills the control + */ + Transform(); + + /** + * Use the property map to set zero or more of the transform + * attributes, and sets the remaining attributes to their default + * values. + */ + void SetPropertyMap( const Property::Map& map ); - Vector2 mSize; - Vector2 mOffset; - float mDepthIndex; - int mFlags; + /** + * Add the transform attributes to the map (using integer keys) + */ + void GetPropertyMap( Property::Map& map ) const; + + /** + * Update zero or more attributes from the property map. + */ + void UpdatePropertyMap( const Property::Map& map ); + + /** + * Register or set the uniform properties onto the renderer + */ + void RegisterUniforms( Renderer renderer, Toolkit::Direction::Type direction ); + + /** + * Convert the control size and the transform attributes into the actual + * size of the visual. + */ + Vector2 GetVisualSize( const Vector2& controlSize ); + + Vector2 mOffset; + Vector2 mSize; + Vector4 mOffsetSizeMode; + Toolkit::Align::Type mOrigin; + Toolkit::Align::Type mAnchorPoint; + }; - Impl(); - ~Impl(); + Renderer mRenderer; + CustomShader* mCustomShader; + SlotDelegate* mBlendSlotDelegate; ///< Used to own mix color animation connection + std::string mName; + Transform mTransform; + Vector4 mMixColor; + Size mControlSize; + float mDepthIndex; + Property::Index mMixColorIndex; + Property::Index mOpacityIndex; + int mFlags; }; } // namespace Visual