#include <FMedia.h>
#include <FUi.h>
+#include "GlFileListPresentationModel.h"
+
enum TouchLocation
{
INSIDE_CROPBOX = 0,
};
class ImageCropForm
- : public Tizen::Ui::Controls::Form
+ : public IFormContentUpdateEventListener
+ , public Tizen::Ui::Controls::Form
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::IActionEventListener
, public Tizen::Ui::IOrientationEventListener
virtual result OnInitializing(void);
virtual result OnDraw(void);
+ virtual void OnContentUpdated(void);
+ virtual void ShowAnimation(void){};
+ virtual void StopAnimation(void){};
+
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
Tizen::Graphics::Point __touchStart;
Tizen::Graphics::Rectangle __cropBox;
Tizen::Graphics::Rectangle __imageBox;
- Tizen::Media::ImageBuffer __imageBuffer;
+ Tizen::Media::ImageBuffer* __imageBuffer;
Tizen::Media::ImageFormat __imageFormat;
TouchLocation __pointLocation;
bool __isOrientationChanged;
int __formHeight;
int __formWidth;
int __skipMoveEvent;
+ FileListPresentationModel* __pPresentationModel;
};
#endif /* _GL_IMAGE_CROP_H_ */
, __pCurrentBitmap(null)
, __pRectangleBitmap(null)
, __imageFormat(IMG_FORMAT_NONE)
+ , __imageBuffer(null)
, __pointLocation(OUTSIDE_CROPBOX)
, __isOrientationChanged(false)
, __imageHeight(0)
, __formHeight(0)
, __formWidth(0)
, __skipMoveEvent(0)
+
{
}
pFooter->AddItem(footerItem1);
}
+ __pPresentationModel = FileListPresentationModel::GetInstance();
+
AddTouchEventListener(*this);
AddOrientationEventListener(*this);
SetFormBackEventListener(this);
r = utf8.GetByteCount(GetFileName(destFilePath), inputLength);
}
- pCropBuffer = __imageBuffer.CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
+ pCropBuffer = __imageBuffer->CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
(__cropBox.width * __imageWidth) / __imageBox.width, (__cropBox.height * __imageHeight) / __imageBox.height);
if (pCropBuffer != null)
{
AppLogDebug("OnSceneActivatedN");
+ __pPresentationModel->AddContentEventListener(this);
+
if (pArgs != null)
{
__sourceFilePath = *(static_cast<String*>(pArgs->GetAt(0)));
if (__sourceFilePath.IsEmpty() == false)
{
- result r = __imageBuffer.Construct(__sourceFilePath.GetPointer());
+ if ( __imageBuffer != null)
+ {
+ delete __imageBuffer;
+ __imageBuffer = null;
+ }
+
+ __imageBuffer = new (std::nothrow) ImageBuffer();
+
+ result r = __imageBuffer->Construct(__sourceFilePath.GetPointer());
if (r == E_SUCCESS)
{
- __imageWidth = __imageBuffer.GetWidth();
- __imageHeight = __imageBuffer.GetHeight();
+ __imageWidth = __imageBuffer->GetWidth();
+ __imageHeight = __imageBuffer->GetHeight();
int physicalHeight = CoordinateSystem::ConvertToPhysicalY(__imageHeight);
int physicalWidth = CoordinateSystem::ConvertToPhysicalX(__imageWidth);
- __pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, physicalWidth, physicalHeight);
+ __pCurrentBitmap = __imageBuffer->GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, physicalWidth, physicalHeight);
SetValue();
Image img;
ImageCropForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
{
AppLogDebug("OnSceneDeactivated");
-
+ __pPresentationModel->RemoveContentEventListener(this);
RemoveOrientationEventListener(*this);
}
return strResult;
}
+
+void
+ImageCropForm::OnContentUpdated()
+{
+ AppLogDebug("ENTER");
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
+
+ AppLogDebug("EXIT(%s)");
+}