1 #ifndef __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
2 #define __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__
5 * Copyright (c) 2015 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.
21 #include <dali/devel-api/rendering/geometry.h>
24 #include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
36 * The renderer which renders a solid color to the control's quad border fixed to a specified size.
38 * The following properties are required for create a BorderRender
40 * | %Property Name | Type |
41 * |------------------|-------------|
42 * | border-color | VECTOR4 |
43 * | border-size | FLOAT |
46 class BorderRenderer : public ControlRenderer
56 * @brief A reference counted object may only be deleted by calling Unreference().
58 virtual ~BorderRenderer();
60 public: // from ControlRenderer
63 * @copydoc ControlRenderer::DoInitialize
65 virtual void DoInitialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
68 * @copydoc ControlRenderer::SetClipRect
70 virtual void SetClipRect( const Rect<int>& clipRect );
74 * @copydoc ControlRenderer::DoSetOnStage
76 virtual void DoSetOnStage( Actor& actor );
79 * @copydoc ControlRenderer::CreatePropertyMap
81 virtual void DoCreatePropertyMap( Property::Map& map ) const;
86 * Request the geometry and shader from the cache, if not available, create and save to the cache for sharing.
88 * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
90 void Initialize( RendererFactoryCache& factoryCache );
93 * Set the color of the border.
94 * @param[in] color The border color.
96 void SetBorderColor( const Vector4& color);
99 * Set the size of the border.
100 * @param[in] size The border size.
102 void SetBorderSize( float size );
107 * Create the geometry which presents the border.
108 * @return The border geometry
110 Geometry CreateBorderGeometry();
113 BorderRenderer( const BorderRenderer& borderRenderer );
116 BorderRenderer& operator=( const BorderRenderer& borderRenderer );
120 Vector4 mBorderColor;
123 Property::Index mBorderColorIndex;
124 Property::Index mBorderSizeIndex;
127 } // namespace Internal
129 } // namespace Toolkit
133 #endif /* __DALI_TOOLKIT_INTERNAL_BORDER_RENDERER_H__ */