1 #ifndef DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
2 #define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/math/vector2.h>
23 #include <dali/public-api/rendering/renderer.h>
26 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
27 #include <dali-toolkit/internal/visuals/visual-event-observer.h>
28 #include <dali-toolkit/public-api/align-enumerations.h>
29 #include <dali-toolkit/public-api/visuals/visual-properties.h>
58 IS_ATLASING_APPLIED = 1<<1,
59 IS_PREMULTIPLIED_ALPHA = 1 << 2,
60 IS_SYNCHRONOUS_RESOURCE_LOADING = 1 << 3
65 CustomShader( const Property::Map& map );
66 void SetPropertyMap( const Property::Map& map );
67 void CreatePropertyMap( Property::Map& map ) const;
69 std::string mVertexShader;
70 std::string mFragmentShader;
71 Dali::ImageDimensions mGridSize;
72 Dali::Shader::Hint::Value mHints; //(bitfield) values from enum Shader::Hint
78 * Default constructor ensures the visual fills the control
83 * Use the property map to set zero or more of the transform
84 * attributes, and sets the remaining attributes to their default
87 void SetPropertyMap( const Property::Map& map );
90 * Add the transform attributes to the map (using integer keys)
92 void GetPropertyMap( Property::Map& map ) const;
95 * Update zero or more attributes from the property map.
97 void UpdatePropertyMap( const Property::Map& map );
100 * Register or set the uniform properties onto the renderer
102 void RegisterUniforms( Renderer renderer, Toolkit::Direction::Type direction );
105 * Convert the control size and the transform attributes into the actual
106 * size of the visual.
108 Vector2 GetVisualSize( const Vector2& controlSize );
112 Vector4 mOffsetSizeMode;
113 Toolkit::Align::Type mOrigin;
114 Toolkit::Align::Type mAnchorPoint;
118 CustomShader* mCustomShader;
119 SlotDelegate<Visual::Base>* mBlendSlotDelegate; ///< Used to own mix color animation connection
120 EventObserver* mEventObserver; ///< Allows controls to observe when the visual has events to notify
122 Transform mTransform;
126 Property::Index mMixColorIndex;
127 Property::Index mOpacityIndex;
129 Toolkit::Visual::ResourceStatus mResourceStatus;
132 } // namespace Visual
134 } // namespace Internal
136 } // namespace Toolkit
140 #endif // DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H