X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fresource-types.h;h=053245119f04027a79f6b43c0a0aad7825b8587b;hb=07c2516c65ef56c71df4c9c3a7461781b06cb91b;hp=1d5182e614dd366276ebdd28e628bdd953030e82;hpb=2262d8325431b336f7bd2c96e27ebf3a016faef9;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/resource-types.h b/dali/integration-api/resource-types.h index 1d5182e..0532451 100644 --- a/dali/integration-api/resource-types.h +++ b/dali/integration-api/resource-types.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTEGRATION_RESOURCE_TYPES_H__ -#define __DALI_INTEGRATION_RESOURCE_TYPES_H__ +#ifndef DALI_INTEGRATION_RESOURCE_TYPES_H +#define DALI_INTEGRATION_RESOURCE_TYPES_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -20,15 +20,10 @@ // EXTERNAL INCLUDES #include -#include // INTERNAL INCLUDES -#include -#include #include #include -#include -#include namespace Dali { @@ -38,57 +33,10 @@ typedef Uint16Pair ImageDimensions; namespace Integration { -// Resource Types - -/** - * Extendable set of resource types - */ -enum ResourceTypeId -{ - ResourceBitmap, - ResourceNativeImage, - ResourceTargetImage -}; - -/** - * The abstract base class for resource types. - */ -struct ResourceType -{ - /** - * Constructor. - * @param[in] typeId resource type id - */ - ResourceType(ResourceTypeId typeId) - : id(typeId) {} - - /** - * Destructor. - */ - virtual ~ResourceType() {} - - /** - * Create a copy of the resource type with the same attributes. - * @return pointer to the new ResourceType. - */ - virtual ResourceType* Clone() const = 0; - - const ResourceTypeId id; - -private: - - // Undefined copy constructor. - ResourceType(const ResourceType& typePath); - - // Undefined assignment operator. - ResourceType& operator=(const ResourceType& rhs); -}; - /** - * BitmapResourceType describes a bitmap resource, which can be requested - * from ResourceLoader::LoadResource() or AllocateBitmapImage. + * BitmapResourceType describes a bitmap resource. */ -struct BitmapResourceType : public ResourceType +struct BitmapResourceType { /** * Constructor. @@ -104,21 +52,17 @@ struct BitmapResourceType : public ResourceType FittingMode::Type scalingMode = FittingMode::DEFAULT, SamplingMode::Type samplingMode = SamplingMode::DEFAULT, bool orientationCorrection = true ) - : ResourceType(ResourceBitmap), - size(size), scalingMode(scalingMode), samplingMode(samplingMode), orientationCorrection(orientationCorrection) {} + : size( size ), + scalingMode( scalingMode ), + samplingMode( samplingMode ), + orientationCorrection( orientationCorrection ) + {} /** * Destructor. */ - virtual ~BitmapResourceType() {} - - /** - * @copydoc ResourceType::Clone - */ - virtual ResourceType* Clone() const - { - return new BitmapResourceType( size, scalingMode, samplingMode, orientationCorrection ); - } + ~BitmapResourceType() + {} /** * Attributes are copied from the request. @@ -135,105 +79,11 @@ private: // Undefined assignment operator. BitmapResourceType& operator=(const BitmapResourceType& rhs); -}; - -/** - * NativeImageResourceType describes a native image resource, which can be injected - * through ResourceManager::AddNativeImage() or requested through ResourceLoader::LoadResource(). - * If the adaptor does not support NativeImages, it can fall back to Bitmap type. - */ -struct NativeImageResourceType : public ResourceType -{ - /** - * Constructor. - */ - NativeImageResourceType() - : ResourceType(ResourceNativeImage) {} - - /** - * Constructor. - * @param[in] dimensions Width and Height to allocate for image. - */ - NativeImageResourceType( ImageDimensions dimensions ) - : ResourceType(ResourceNativeImage), - imageDimensions(dimensions) {} - - /** - * Destructor. - */ - virtual ~NativeImageResourceType() {} - - /** - * @copydoc ResourceType::Clone - */ - virtual ResourceType* Clone() const - { - return new NativeImageResourceType(imageDimensions); - } - - /** - * Attributes are copied from the request (if supplied). - */ - ImageDimensions imageDimensions; - -private: - - // Undefined copy constructor. - NativeImageResourceType(const NativeImageResourceType& typePath); - - // Undefined assignment operator. - NativeImageResourceType& operator=(const NativeImageResourceType& rhs); -}; - -/** - * RenderTargetResourceType describes a bitmap resource, which can injected - * through ResourceManager::AddTargetImage() - */ -struct RenderTargetResourceType : public ResourceType -{ - /** - * Constructor. - */ - RenderTargetResourceType() - : ResourceType(ResourceTargetImage) {} - - /** - * Constructor. - * @param[in] dims Width and Height to allocate for image. - */ - RenderTargetResourceType( ImageDimensions dims ) - : ResourceType(ResourceTargetImage), - imageDimensions(dims) {} - /** - * Destructor. - */ - virtual ~RenderTargetResourceType() {} - - /** - * @copydoc ResourceType::Clone - */ - virtual ResourceType* Clone() const - { - return new RenderTargetResourceType(imageDimensions); - } - - /** - * Image size is copied from the request. - */ - ImageDimensions imageDimensions; - -private: - - // Undefined copy constructor. - RenderTargetResourceType(const RenderTargetResourceType& typePath); - - // Undefined assignment operator. - RenderTargetResourceType& operator=(const RenderTargetResourceType& rhs); }; } // namespace Integration } // namespace Dali -#endif // __DALI_INTEGRATION_RESOURCE_TYPES_H__ +#endif // DALI_INTEGRATION_RESOURCE_TYPES_H