#define DALI_TOOLKIT_INTERNAL_N_PATCH_VISUAL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
{
* | %Property Name | Type |
* |--------------------------|------------------|
* | url | STRING |
- * | borderOnly | BOOLEAN
- *
+ * | borderOnly | BOOLEAN |
+ * | border | RECTANGLE |
+ * | auxiliaryImage | STRING |
+ * | auxiliaryImageAlpha | FLOAT |
*/
class NPatchVisual: public Visual::Base
{
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
- static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl, const Property::Map& properties );
+ static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl, const Property::Map& properties );
/**
* @brief Create an N-patch visual using an image URL.
* @param[in] imageUrl The URL to 9 patch image resource to use
* @return A smart-pointer to the newly allocated visual.
*/
- static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl );
+ static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl );
/**
* @brief Create an N-patch visual with a NinePatchImage resource.
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ /**
+ * @copydoc Visual::Base::CreateInstancePropertyMap
+ */
+ virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
protected:
/**
private:
/**
+ * Loads the NPatch image and the Auxiliary image if needed
+ */
+ void LoadImages();
+
+ /**
* @brief Creates a geometry for this renderer's grid size
*
* @return Returns the created geometry for this renderer's grid size
private:
- NPatchLoader& mLoader; ///< reference to N patch loader for fast access
- std::string mImageUrl; ///< The url to the N patch to load
- std::size_t mId; ///< id of the N patch (from loader/cache)
- bool mBorderOnly; ///< if only border is desired
-
+ NPatchLoader& mLoader; ///< reference to N patch loader for fast access
+ VisualUrl mImageUrl; ///< The url to the N patch to load
+ VisualUrl mAuxiliaryUrl; ///< An auxiliary image that can be displayed on top of the N-Patch
+ std::size_t mId; ///< id of the N patch (from loader/cache)
+ Devel::PixelBuffer mAuxiliaryPixelBuffer; ///< pixel buffer of the auxiliary mask image
+ bool mBorderOnly; ///< if only border is desired
+ Rect<int> mBorder; ///< The size of the border
+ float mAuxiliaryImageAlpha; ///< The alpha value for the auxiliary image only
};
} // namespace Internal