#include "FUi_Rectanglef.h"
#include "FUi_CoordinateSystemUtils.h"
-
+#include "FUiAnim_IVisualElementCaptureProvider.h"
#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_VisualElementCanvas.h"
, __pBoundsChangedCallbackData(null)
, __pDestroyedCallback(null)
, __pDestroyedCallbackData(null)
+ , __pCaptureProvider(null)
{
ClearLastResult();
, __pBoundsChangedCallbackData(modelImpl.__pBoundsChangedCallbackData)
, __pDestroyedCallback(modelImpl.__pDestroyedCallback)
, __pDestroyedCallbackData(modelImpl.__pDestroyedCallbackData)
+ , __pCaptureProvider(null)
{
ClearLastResult();
{
_EflVisualElementSurfaceImpl* pSurfImpl = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*__pSharedData->pSurface));
- if(pSurfImpl && pSurfImpl->GetNativeHandle() && pSurfImpl->__isImageObject)
+ if(pSurfImpl && pSurfImpl->GetNativeHandle() )
{
BufferInfo info;
- __pSharedData->pSurface->GetBufferInfo(info);
+ byte* pStart = null;
+ bool isCaptured = false;
- byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
- _DisplayManager::RestoreContext();
+ if(pSurfImpl->__isImageObject)
+ {
+ __pSharedData->pSurface->GetBufferInfo(info);
- if(pStart)
+ pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
+ _DisplayManager::RestoreContext();
+ }
+ else
{
+ if(__pCaptureProvider)
+ {
+ isCaptured = true;
+ if(__pCaptureProvider->OnCaptureAcquire(info))
+ {
+ pStart = (byte*)info.pPixels;
+ }
+ _DisplayManager::RestoreContext();
+ }
+ }
+ if(pStart)
+ {
_VisualElementCoordinateSystem::ConvertRectangleToPhysicalIntegral(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
-
BufferInfo copyInfo;
copyInfo.bitsPerPixel = info.bitsPerPixel;
copyInfo.width = drawRect.width;
}
delete [] pCopy;
}
+ if(isCaptured && __pCaptureProvider)
+ {
+ __pCaptureProvider->OnCaptureRleased();
+ }
+
}
+
}
-#endif
}
+#endif
}
else
{
if(pSurfImpl && pSurfImpl->GetNativeHandle() && pSurfImpl->__isImageObject)
{
- byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
- _DisplayManager::RestoreContext();
-
BufferInfo info;
- __pSharedData->pSurface->GetBufferInfo(info);
+ byte* pStart = null;
+ bool isCaptured = false;
+ if(pSurfImpl->__isImageObject)
+ {
+ __pSharedData->pSurface->GetBufferInfo(info);
+
+ pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
+ _DisplayManager::RestoreContext();
+ }
+ else
+ {
+ if(__pCaptureProvider)
+ {
+ isCaptured = true;
+ if(__pCaptureProvider->OnCaptureAcquire(info))
+ {
+ pStart = (byte*)info.pPixels;
+ }
+ _DisplayManager::RestoreContext();
+ }
+ }
if(pStart)
{
delete pBitmap;
}
}
+ if(isCaptured && __pCaptureProvider)
+ {
+ __pCaptureProvider->OnCaptureRleased();
+ }
}
}
#endif
__pDestroyedCallbackData = pData;
}
+void
+_VisualElementImpl::SetCaptureProvider(_IVisualElementCaptureProvider* pProvider)
+{
+ __pCaptureProvider = pProvider;
+}
+
+_IVisualElementCaptureProvider*
+_VisualElementImpl::GetCaptureProvider(void) const
+{
+ return __pCaptureProvider;
+}
// delegate---------------------------------------------------------------------------------
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 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.
+//
+
+/**
+ * @file FUiAnim_IVisualElementCaptureProvider.h
+ * @brief Header file of _IVisualElementCaptureProvider class
+ *
+ * This file contains declarations _IVisualElementCaptureProvider class.
+ */
+
+#ifndef _FUI_ANIM_INTERNAL_IVISUALELEMENT_CAPTUREPROVIDER_H_
+#define _FUI_ANIM_INTERNAL_IVISUALELEMENT_CAPTUREPROVIDER_H_
+
+namespace Tizen { namespace Graphics {
+class BufferInfo;
+}}
+namespace Tizen { namespace Ui { namespace Animations
+{
+
+class _IVisualElementCaptureProvider
+{
+public:
+ virtual bool OnCaptureAcquire(Tizen::Graphics::BufferInfo& output) = 0;
+ virtual void OnCaptureRleased(void) = 0;
+
+ virtual ~_IVisualElementCaptureProvider(void){};
+};
+
+}}} // Tizen::Ui::Animations
+
+#endif // _FUI_ANIM_INTERNAL_INATIVENODE_H_
#include <FUiAnimVisualElementSurface.h>
#include <FUiAnimVisualElement.h>
-
#include "FUi_PropertyBase.h"
#include "FUiAnim_RootVisualElement.h"
namespace Tizen { namespace Ui { namespace Animations
{
-class _IVisualElementObserver;
class IVisualElementAnimationProvider;
class IVisualElementContentProvider;
class IVisualElementEventListener;
class _AnimationManager;
-
+class _IVisualElementCaptureProvider;
extern const wchar_t* VePropBounds;
extern const wchar_t* VePropContentBounds;
typedef void (*DestroyedCallback)(void*);
void SetDestroyedCallback(DestroyedCallback pCallback, void* pData);
+ void SetCaptureProvider(_IVisualElementCaptureProvider* pProvider);
+ _IVisualElementCaptureProvider* GetCaptureProvider(void) const;
+
protected:
// virtual _VisualElementImpl* CloneN(void);
DestroyedCallback __pDestroyedCallback;
void* __pDestroyedCallbackData;
+ _IVisualElementCaptureProvider* __pCaptureProvider;
+
friend class _VeDebug;
friend class _EflNode;
friend class _VisualElementModelObserver;