#ifndef __DALI_INTERNAL_NINE_PATCH_IMAGE_H__
#define __DALI_INTERNAL_NINE_PATCH_IMAGE_H__
-//
-// 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.
+ *
+ */
// INTERNAL INCLUDES
#include <dali/public-api/images/nine-patch-image.h>
+#include <dali/internal/event/images/resource-image-impl.h>
#include <dali/internal/event/images/bitmap-image-impl.h>
namespace Dali
* It's image data has a border which determines stretch and fill areas
* Its pixel buffer data is loaded synchronously from file.
*/
-class NinePatchImage : public Image
+class NinePatchImage : public ResourceImage
{
public:
* Dali has ownership of the buffer.
* @param [in] filename File to load synchronously into buffer
* @param [in] attributes Image attributes of the file
- * @param [in] loadPol controls time of loading a resource from the filesystem (default: load when Image is created).
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
*/
static NinePatchImagePtr New( const std::string& filename,
const ImageAttributes& attributes,
- LoadPolicy loadPol = ImageLoadPolicyDefault,
- ReleasePolicy releasePol = ImageReleasePolicyDefault );
+ ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT );
/**
* Create a new NinePatchImage
* The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
* @param [in] filename File to load synchronously into buffer
* @param [in] attributes Image attributes of the file
- * @param [in] loadPol controls time of loading a resource from the filesystem (default: load when Image is created).
* @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
*/
NinePatchImage( const std::string& filename,
const ImageAttributes& attributes,
- LoadPolicy loadPol = ImageLoadPolicyDefault,
- ReleasePolicy releasePol = ImageReleasePolicyDefault );
+ ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT );
/**
* Convert Image object to a 9 patch image object if possible.
* @return A pointer to the 9 patch image object, or NULL
* if the conversion is not possible.
*/
- static NinePatchImage* GetNinePatchImage( Image* image);
+ static NinePatchImage* DownCast( Image* image);
protected:
*/
BitmapImagePtr CreateCroppedBitmapImage();
-private:
- /**
- * Initializes internal data.
- */
- void Initialize();
protected: // From Resource
/**
private:
ResourceClient* mResourceClient;
Integration::BitmapPtr mBitmap;
- SceneGraph::UpdateManager* mUpdateManager;
Vector4 mStretchBorders;
Rect<int> mChildRectangle;
bool mParsedBorder;