From e91b08555b1ad35692c2a8789275b539fa1c12c7 Mon Sep 17 00:00:00 2001 From: chitta ranjan Date: Sat, 6 Apr 2013 18:19:07 +0900 Subject: [PATCH] Removed setter form Change-Id: I26b85d95182f54730906af2ad14038a107786c61 Signed-off-by: chitta ranjan --- inc/IvImageSetterForm.h | 93 ----- inc/IvImageViewerPresentationModel.h | 1 - inc/IvTypes.h | 3 - res/screen-size-normal/IDL_FORM_IMAGE_SETTER.xml | 14 - src/IvFormFactory.cpp | 8 - src/IvImageCropForm.cpp | 24 -- src/IvImageSetterForm.cpp | 493 ----------------------- src/IvImageViewerForm.cpp | 22 +- src/IvImageViewerPresentationModel.cpp | 9 - src/IvMainFrame.cpp | 1 - src/IvTypes.cpp | 3 - 11 files changed, 2 insertions(+), 669 deletions(-) delete mode 100644 inc/IvImageSetterForm.h delete mode 100644 res/screen-size-normal/IDL_FORM_IMAGE_SETTER.xml delete mode 100644 src/IvImageSetterForm.cpp diff --git a/inc/IvImageSetterForm.h b/inc/IvImageSetterForm.h deleted file mode 100644 index fc75b2d..0000000 --- a/inc/IvImageSetterForm.h +++ /dev/null @@ -1,93 +0,0 @@ -// -// Copyright (c) 2012 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. -// - -/** - * @file IvImageSetterForm.h - * @brief This is the header file for ImageSetterForm class. - */ - -#ifndef _IV_IMAGE_SETTER_FORM_H_ -#define _IV_IMAGE_SETTER_FORM_H_ - -#include -#include -#include -#include -#include -#include - -#include "IvFileUpdateEventListener.h" - -class ImageViewerPresentationModel; - -class ImageSetterForm - : public Tizen::Ui::Controls::Form - , public Tizen::Ui::IActionEventListener - , public Tizen::Ui::IOrientationEventListener - , public Tizen::Ui::Controls::IFormBackEventListener - , public Tizen::Ui::Controls::IGalleryEventListener - , public Tizen::Ui::Controls::IGalleryItemProvider - , public Tizen::Ui::Scenes::ISceneEventListener - , public IFileUpdateEventListener -{ -public: - ImageSetterForm(); - virtual ~ImageSetterForm(); - - result Initialize(void); - - virtual result OnInitializing(void); - virtual result OnTerminating(void); - - virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); - - virtual void OnOrientationChanged(const Tizen::Ui::Control& source, - Tizen::Ui::OrientationStatus orientationStatus); - - virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source); - - virtual void OnGalleryCurrentItemChanged (Tizen::Ui::Controls::Gallery &view, int index); - virtual void OnGalleryItemClicked(Tizen::Ui::Controls::Gallery& listView, int index); - virtual void OnGallerySlideShowStarted(Tizen::Ui::Controls::Gallery& gallery); - virtual void OnGallerySlideShowStopped(Tizen::Ui::Controls::Gallery& gallery); - - virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index); - virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem); - virtual int GetItemCount(void); - - virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, - const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs); - virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, - const Tizen::Ui::Scenes::SceneId& nextSceneId); - - virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId); - -private: - result InitializeButton(void); - void CreateGallery(void); - -private: - Tizen::Ui::Controls::Button* __pSetButton; - Tizen::Ui::Controls::Button* __pCancelButton; - Tizen::Ui::Controls::Gallery* __pGallery; - int __statusValue; - int __currentImageIndex; - long long __contentId; - Tizen::Graphics::Bitmap* __pCurrentBitmap; - ImageViewerPresentationModel* __pPresentationModel; -}; - -#endif /* _IV_IMAGE_SETTER_FORM_H_ */ diff --git a/inc/IvImageViewerPresentationModel.h b/inc/IvImageViewerPresentationModel.h index 33a2242..e07d96d 100644 --- a/inc/IvImageViewerPresentationModel.h +++ b/inc/IvImageViewerPresentationModel.h @@ -61,7 +61,6 @@ public: Tizen::Base::Collection::ArrayList* GetImageCache() const; ImageInfo* GetImageCacheAt(const int index) const; void AddImageCache(const Tizen::Base::String& filePath); - void SetImageCacheAt(const int index, const Tizen::Base::String& filePath); int GetFileCount(void) const; Tizen::Base::String GetType(void) const; diff --git a/inc/IvTypes.h b/inc/IvTypes.h index 90bf4f8..acdac2f 100644 --- a/inc/IvTypes.h +++ b/inc/IvTypes.h @@ -81,17 +81,14 @@ enum IVFileEventTypes }; extern const wchar_t* IDL_FORM_IMAGE_VIEWER; -extern const wchar_t* IDL_FORM_IMAGE_SETTER; extern const wchar_t* IDL_FORM_NAME_EDITOR; extern const wchar_t* IDL_FORM_IMAGE_CROP; extern const wchar_t* FORM_IMAGE_VIEWER; -extern const wchar_t* FORM_IMAGE_SETTER; extern const wchar_t* FORM_IMAGE_CROP; extern const wchar_t* FORM_IMAGE_NAME_EDITOR; extern const wchar_t* IDSCN_IMAGE_VIEWER; -extern const wchar_t* IDSCN_IMAGE_SETTER; extern const wchar_t* IDSCN_IMAGE_CROP; extern const wchar_t* IDSCN_IMAGE_NAME_EDITOR; diff --git a/res/screen-size-normal/IDL_FORM_IMAGE_SETTER.xml b/res/screen-size-normal/IDL_FORM_IMAGE_SETTER.xml deleted file mode 100644 index d481add..0000000 --- a/res/screen-size-normal/IDL_FORM_IMAGE_SETTER.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - 720 -
- - - - -
diff --git a/src/IvFormFactory.cpp b/src/IvFormFactory.cpp index b03bcc3..f699411 100644 --- a/src/IvFormFactory.cpp +++ b/src/IvFormFactory.cpp @@ -22,7 +22,6 @@ #include "IvFormFactory.h" #include "IvImageCropForm.h" #include "IvImageNameEditorForm.h" -#include "IvImageSetterForm.h" #include "IvImageViewerForm.h" using namespace Tizen::Base; @@ -54,13 +53,6 @@ FormFactory::CreateFormN(const String& formId, const SceneId& sceneId) SceneManager::GetInstance()->AddSceneEventListener(sceneId, *pForm); pNewForm = pForm; } - else if (formId == FORM_IMAGE_SETTER) - { - ImageSetterForm* pForm = new (std::nothrow) ImageSetterForm(); - pForm->Initialize(); - SceneManager::GetInstance()->AddSceneEventListener(sceneId, *pForm); - pNewForm = pForm; - } else if (formId == FORM_IMAGE_CROP) { ImageCropForm* pForm = new (std::nothrow) ImageCropForm(); diff --git a/src/IvImageCropForm.cpp b/src/IvImageCropForm.cpp index 8b277f9..093be06 100644 --- a/src/IvImageCropForm.cpp +++ b/src/IvImageCropForm.cpp @@ -231,30 +231,6 @@ ImageCropForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& } } } -// if (pArgs != null) -// { -// __sourceFilePath = *(static_cast(pArgs->GetAt(0))); -// __cropMode = *(static_cast(pArgs->GetAt(1))); -// delete pArgs; -// } -// else -// { -// __sourceFilePath = __pPresentationModel->GetFilePathAt(0); -// } -/* if (__sourceFilePath.IsEmpty() == false && __cropMode.IsEmpty() == false) - { - __cropMode.ToLowerCase(); - result r = __imageBuffer.Construct(__sourceFilePath.GetPointer()); - if (r == E_SUCCESS) - { - __imageWidth = __imageBuffer.GetWidth(); - __imageHeight = __imageBuffer.GetHeight(); - __pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_AUTO); - } - Image img; - __imageFormat = img.GetImageFormat(__sourceFilePath); - }*/ - SetValue(); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } diff --git a/src/IvImageSetterForm.cpp b/src/IvImageSetterForm.cpp deleted file mode 100644 index 5ca85f1..0000000 --- a/src/IvImageSetterForm.cpp +++ /dev/null @@ -1,493 +0,0 @@ -// -// Copyright (c) 2012 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. -// - -/** - * @file IvImageSetterForm.cpp - * @brief This is the implementation file for ImageSetterForm class. - */ - -#include -#include -#include "IvImageViewerPresentationModel.h" -#include "IvImageSetterForm.h" -#include "IvResourceManager.h" -#include "IvTypes.h" - -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; -using namespace Tizen::App; -using namespace Tizen::Ui; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Ui::Scenes; -using namespace Tizen::Graphics; -using namespace Tizen::Io; -using namespace Tizen::Media; -using namespace Tizen::Social; -using namespace Tizen::System; - -static const unsigned int COLOR_SET_BUTTON = Color32<0, 0, 0, 100>::Value; - -static const int SET_BUTTON_WIDTH = 86; -static const int SET_BUTTON_HEIGHT = 86; -static const int ID_BUTTON_SET = 101; -static const int ID_BUTTON_CANCEL = 102; - -static const int GALLERY_INDEX_ZERO = 0; -static const int GALLERY_CONTROL_DURATION = 3000; - -static const int MAX_GALLEY_ITEM_COUNT = 1; - -ImageSetterForm::ImageSetterForm() - : __pSetButton(null) - , __pCancelButton(null) - , __pGallery(null) - , __statusValue(0) - , __currentImageIndex(0) - , __contentId(0) - , __pCurrentBitmap(null) - , __pPresentationModel(null) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -ImageSetterForm::~ImageSetterForm() -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -result -ImageSetterForm::Initialize(void) -{ - AppLogDebug("ENTER"); - result r = Form::Construct(IDL_FORM_IMAGE_SETTER); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return r; -} - -result -ImageSetterForm::OnInitializing(void) -{ - AppLogDebug("ENTER"); - SetFormBackEventListener(this); - - result r = SetActionBarsTranslucent(FORM_ACTION_BAR_INDICATOR, true); - AddOrientationEventListener(*this); - - __pPresentationModel = ImageViewerPresentationModel::GetInstance(); - __currentImageIndex = __pPresentationModel->GetSetterIndex(); - __pPresentationModel->AddFileUpdateListener(this); - CreateGallery(); - InitializeButton(); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return r; -} - -void -ImageSetterForm::CreateGallery(void) -{ - AppLogDebug("ENTER"); - Rectangle clientRect = GetClientAreaBounds(); - Rectangle rect = GetBounds(); - - __pGallery = new (std::nothrow) Gallery(); - __pGallery->Construct(Rectangle(0, -clientRect.y, rect.width, rect.height)); - __pGallery->SetItemProvider(*this); - __pGallery->AddGalleryEventListener(*this); - AddControl(*__pGallery); - - __pGallery->SetTextOfEmptyGallery(ResourceManager::GetString(L"IDS_COM_BODY_LOADING")); - __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_DISSOLVE); - __pGallery->SetSlideShowViewDuration(GALLERY_CONTROL_DURATION); - __pGallery->SetZoomingEnabled(false); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -result -ImageSetterForm::InitializeButton(void) -{ - AppLogDebug("ENTER"); - __pSetButton = new (std::nothrow) Button(); - - Rectangle rect = GetBounds(); - - if (__pSetButton != null) - { - __pSetButton->Construct(Rectangle(29, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - __pSetButton->SetActionId(ID_BUTTON_SET); - AddControl(*__pSetButton); - - Bitmap* pNormalBackgroundBitmap = ResourceManager::GetBitmapN(IDB_IMAGE_SETTERFORM_BUTTON_SET); - Bitmap* pPressedBackgroundBitmap = ResourceManager::GetBitmapN(IDB_IMAGE_SETTERFORM_BUTTON_SET_PRESS); - - __pSetButton->SetNormalBackgroundBitmap(*pNormalBackgroundBitmap); - __pSetButton->SetPressedBackgroundBitmap(*pPressedBackgroundBitmap); - - delete pNormalBackgroundBitmap; - delete pPressedBackgroundBitmap; - - __pSetButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_SET_BUTTON); - __pSetButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_SET_BUTTON); - __pSetButton->AddActionEventListener(*this); - } - - __pCancelButton = new (std::nothrow) Button(); - if (__pCancelButton != null) - { - __pCancelButton->Construct(Rectangle(rect.width - 115, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - __pCancelButton->SetActionId(ID_BUTTON_CANCEL); - AddControl(*__pCancelButton); - - Bitmap* pNormalBackgroundBitmap = ResourceManager::GetBitmapN(IDB_IMAGE_SETTERFORM_BUTTON_CANCEL); - Bitmap* pPressedBackgroundBitmap = ResourceManager::GetBitmapN(IDB_IMAGE_SETTERFORM_BUTTON_CANCEL_PRESS); - - __pCancelButton->SetNormalBackgroundBitmap(*pNormalBackgroundBitmap); - __pCancelButton->SetPressedBackgroundBitmap(*pPressedBackgroundBitmap); - - delete pNormalBackgroundBitmap; - delete pPressedBackgroundBitmap; - - __pCancelButton->AddActionEventListener(*this); - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return E_SUCCESS; -} - -void -ImageSetterForm::OnOrientationChanged(const Control &source, OrientationStatus orientationStatus) -{ - AppLogDebug("ENTER"); - Rectangle clientRect = GetClientAreaBounds(); - Rectangle rect = GetBounds(); - - if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || - orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE) - { - __pSetButton->SetBounds(Rectangle(29, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - __pCancelButton->SetBounds(Rectangle(rect.width - 115, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - } - else if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE || - orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE) - { - __pSetButton->SetBounds(Rectangle(140, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - __pCancelButton->SetBounds(Rectangle(rect.width - 228, rect.height - 168, SET_BUTTON_WIDTH, SET_BUTTON_HEIGHT)); - } - - __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height)); - Draw(); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -int -ImageSetterForm::GetItemCount(void) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return MAX_GALLEY_ITEM_COUNT; -} - -GalleryItem* -ImageSetterForm::CreateItem(int index) -{ - AppLogDebug("ENTER"); - GalleryItem* pGallery = new (std::nothrow) GalleryItem(); - - String filePath = __pPresentationModel->GetFilePathAt(__currentImageIndex); - Bitmap* pBitmap = null; - ImageBuffer pImageBuffer; - result r = pImageBuffer.Construct(filePath); - if (r == E_SUCCESS) - { - pBitmap = pImageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, BUFFER_SCALING_AUTO); - } - - __pCurrentBitmap = pBitmap; - pGallery->Construct(*__pCurrentBitmap, filePath); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return pGallery; -} - -bool -ImageSetterForm::DeleteItem(int index, GalleryItem* pItem) -{ - AppLogDebug("ENTER"); - delete pItem; - pItem = null; - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return true; -} - -void -ImageSetterForm::OnGalleryCurrentItemChanged(Gallery& view, int index) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnGalleryItemClicked(Gallery& view, int index) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnGallerySlideShowStarted(Gallery& gallery) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnGallerySlideShowStopped(Gallery& gallery) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -result -ImageSetterForm::OnTerminating(void) -{ - AppLogDebug("ENTER"); - if (__pCurrentBitmap != null) - { - delete __pCurrentBitmap; - } - __pPresentationModel->RemoveFileUpdateListener(*this); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return E_SUCCESS; -} - -void -ImageSetterForm::OnActionPerformed(const Control& source, int actionId) -{ - AppLogDebug("ENTER"); - SceneManager* pSceneManager = SceneManager::GetInstance(); - - int status = __statusValue; - - String filePath = __pPresentationModel->GetFilePathAt(__currentImageIndex); - - switch (actionId) - { - case ID_BUTTON_SET: - if (status == SET_AT_TYPE_HOME_SCREEN_WALLPAPER) - { - Image image; - result r = image.Construct(); - if (r == E_SUCCESS) - { - String destPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; - r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPath, true); - if (r == E_SUCCESS) - { - r = SettingInfo::SetValue(SETTING_VALUE_HOME_SCREEN_WALLPAPER, destPath); - } - else if (r == E_OVERFLOW) - { - MessageBox messageBox; - messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - } - } - } - else if (status == SET_AT_TYPE_LOCK_SCREEN_WALLPAPER) - { - Image image; - result r = image.Construct(); - if (r == E_SUCCESS) - { - String destPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; - r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPath, true); - if (r == E_SUCCESS) - { - r = SettingInfo::SetValue(SETTING_VALUE_LOCK_SCREEN_WALLPAPER, destPath); - } - else if (r == E_OVERFLOW) - { - MessageBox messageBox; - messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - } - } - } - else if (status == SET_AT_TYPE_CALLER_IMAGE) - { - Contact* pContact = null; - AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance(); - Addressbook* pAddressbook = null; - - pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID); - pContact = pAddressbook->GetContactN(__contentId); - pContact->SetThumbnail(filePath); - pAddressbook->UpdateContact(*pContact); - - delete pContact; - delete pAddressbook; - } - else if (status == SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER ) - { - Image image; - result r = image.Construct(); - if (r == E_SUCCESS) - { - String destPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; - r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPath, true); - if (r == E_SUCCESS) - { - r = SettingInfo::SetValue(SETTING_VALUE_LOCK_SCREEN_WALLPAPER, destPath); - } - else if (r == E_OVERFLOW) - { - MessageBox messageBox; - messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - } - - String destPathHome = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; - r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPathHome, true); - if (r == E_SUCCESS) - { - r = SettingInfo::SetValue(SETTING_VALUE_HOME_SCREEN_WALLPAPER, destPathHome); - } - else if (r == E_OVERFLOW) - { - MessageBox messageBox; - messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - } - - } - } - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER)); - break; - case ID_BUTTON_CANCEL: - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER)); - break; - default: - break; - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnFormBackRequested(Form& source) -{ - AppLogDebug("ENTER"); - UiApp* pApp = UiApp::GetInstance(); - pApp->Terminate(); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnSceneActivatedN(const SceneId& previousSceneId, - const SceneId& currentSceneId, IList* pArgs) -{ - AppLogDebug("ENTER"); - if (previousSceneId == IDSCN_IMAGE_VIEWER) - { - if (pArgs != null) - { - IEnumerator* pEnum = pArgs->GetEnumeratorN(); - if (pEnum->MoveNext() != E_SUCCESS) - { - delete pEnum; - delete pArgs; - AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); - - return; - } - Integer *pIndex = static_cast(pEnum->GetCurrent()); - if (pIndex != null) - { - __currentImageIndex = pIndex->ToInt(); - } - - if (pEnum->MoveNext() != E_SUCCESS) - { - delete pEnum; - delete pArgs; - AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult())); - - return; - } - Integer *pStatus = static_cast(pEnum->GetCurrent()); - if (pStatus != null) - { - __statusValue = pStatus->ToInt(); - } - - if (__statusValue == SET_AT_TYPE_CALLER_IMAGE) - { - if (pEnum->MoveNext() != E_SUCCESS) - { - delete pEnum; - delete pArgs; - AppLogDebug("EXIT 3(%s)", GetErrorMessage(GetLastResult())); - - return; - } - - LongLong* pContentId = static_cast(pEnum->GetCurrent()); - if (pContentId != null) - { - __contentId = pContentId->ToLongLong(); - } - } - - delete pEnum; - delete pArgs; - } - } - - if (__pGallery != null) - { - __pGallery->RefreshGallery(GALLERY_INDEX_ZERO, GALLERY_REFRESH_TYPE_ITEM_MODIFY); - __pGallery->Draw(); - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void -ImageSetterForm::OnSceneDeactivated(const SceneId& currentSceneId, - const SceneId& nextSceneId) -{ - AppLogDebug("ENTER"); - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} - -void ImageSetterForm::OnFormFileEventOccuered(const int index, const unsigned long eventId) -{ - AppLogDebug(" ENTER"); - if (__currentImageIndex == index && eventId == IV_FILE_DELETE) - { - SceneManager* pSceneManager = SceneManager::GetInstance(); - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER)); - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -} diff --git a/src/IvImageViewerForm.cpp b/src/IvImageViewerForm.cpp index 8a830b6..818a9fa 100644 --- a/src/IvImageViewerForm.cpp +++ b/src/IvImageViewerForm.cpp @@ -776,8 +776,6 @@ ImageViewerForm::InitializeContextMenuMore(void) __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_SET_AS"), ACTION_ID_CONTEXTMENU_SET_AS); __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_BODY_CROP"), ACTION_ID_FOOTER_BUTTON_CROP); - //__pContextMenuMore->AddItem("Rotate Left", ACTION_ID_FOOTER_BUTTON_ROTATE_LEFT); - //__pContextMenuMore->AddItem("Rotate Right", ACTION_ID_FOOTER_BUTTON_ROTATE_RIGHT); } if (__pGallery->GetItemCount() > 1) @@ -1422,7 +1420,6 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) { String filePath; String cropMode = L"auto"; - //String cropMode = L"auto"; ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex()); pList->Add(new (std::nothrow) String(filePath)); @@ -1437,8 +1434,6 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) RotateMode rotateMode = ROTATE_MODE_RIGHT; __pPresentationModel->SetImageRotateStatus(true); RotateImage(filePath, rotateMode); - AppLog("Manish After Rotate"); - //__pPresentationModel->SetImageCacheAt(currentIndex, filePath); ImageInfo* pImageInfo = null; pImageInfo->Construct(filePath, null); pImageInfo->ClearBitmap(); @@ -1487,7 +1482,6 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) pList->Add(new (std::nothrow) String(filePath)); pList->Add(new (std::nothrow) String(cropMode)); pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_SCREEN_WALLPAPER)); - //__pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList); break; } @@ -1499,7 +1493,6 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) pList->Add(new (std::nothrow) String(filePath)); pList->Add(new (std::nothrow) String(cropMode)); pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_LOCK_SCREEN_WALLPAPER)); - //__pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList); break; } @@ -1527,7 +1520,6 @@ ImageViewerForm::OnActionPerformed(const Control& source, int actionId) pList->Add(new (std::nothrow) String(filePath)); pList->Add(new (std::nothrow) String(cropMode)); pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER)); - //__pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList); break; } @@ -1589,13 +1581,13 @@ ImageViewerForm::RotateImage(String& filePath, RotateMode rotateMode) ImageFormat imageFormat; Image img; r = img.Construct(); + if (r == E_SUCCESS) { imageFormat = img.GetImageFormat(filePath); } - r = rotateBuffer.Construct(filePath); - //ImageBuffer::GetImageInfo(filePath, imageFormat, width, height); + r = rotateBuffer.Construct(filePath); if (r == E_SUCCESS) { if (rotateMode == ROTATE_MODE_RIGHT) @@ -1656,11 +1648,9 @@ ImageViewerForm::OnSceneActivatedN(const SceneId& previousSceneId, if (previousSceneId == IDSCN_IMAGE_CROP && pArgs != null) { - AppLog("Manish hello"); String filePath; filePath = *(static_cast(pArgs->GetAt(0))); delete pArgs; - AppLog("Manish %ls", filePath.GetPointer()); int count = __pPresentationModel->GetFileCount(); __pPresentationModel->AddImageCache(filePath); __pGallery->UpdateGallery(); @@ -1730,14 +1720,6 @@ ImageViewerForm::OnAppControlCompleteResponseReceived(const AppId& appId, pList->Add(new (std::nothrow) LongLong(lresult)); SceneManager* pSceneManager = SceneManager::GetInstance(); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList); - /*ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter); - pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex())); - pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_CALLER_IMAGE)); - pList->Add(new (std::nothrow) LongLong(lresult)); - __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex()); - - SceneManager* pSceneManager = SceneManager::GetInstance(); - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList);*/ } } diff --git a/src/IvImageViewerPresentationModel.cpp b/src/IvImageViewerPresentationModel.cpp index 19e455a..57733b3 100644 --- a/src/IvImageViewerPresentationModel.cpp +++ b/src/IvImageViewerPresentationModel.cpp @@ -318,15 +318,6 @@ ImageViewerPresentationModel::AddImageCache(const String& filePath) __pImageCaches->Add(pImageInfo); } -void -ImageViewerPresentationModel::SetImageCacheAt(const int index, const String& filePath) -{ - ImageInfo* pImageInfo = null; - pImageInfo->Construct(filePath, null); - pImageInfo->ClearBitmap(); - //__pImageCaches->SetAt(pImageInfo, index); -} - int ImageViewerPresentationModel::GetFileCount(void) const { diff --git a/src/IvMainFrame.cpp b/src/IvMainFrame.cpp index ae852d1..47dd263 100644 --- a/src/IvMainFrame.cpp +++ b/src/IvMainFrame.cpp @@ -54,7 +54,6 @@ MainFrame::OnInitializing(void) pSceneManager->RegisterFormFactory(formFactory); pSceneManager->RegisterScene(IDSCN_IMAGE_VIEWER, FORM_IMAGE_VIEWER, PANEL_BLANK); - pSceneManager->RegisterScene(IDSCN_IMAGE_SETTER, FORM_IMAGE_SETTER, PANEL_BLANK); pSceneManager->RegisterScene(IDSCN_IMAGE_CROP, FORM_IMAGE_CROP, PANEL_BLANK); pSceneManager->RegisterScene(IDSCN_IMAGE_NAME_EDITOR, FORM_IMAGE_NAME_EDITOR, PANEL_BLANK); diff --git a/src/IvTypes.cpp b/src/IvTypes.cpp index 0bf844f..b9e12f1 100644 --- a/src/IvTypes.cpp +++ b/src/IvTypes.cpp @@ -24,17 +24,14 @@ #include "IvTypes.h" const wchar_t* IDL_FORM_IMAGE_VIEWER = L"IDL_FORM_IMAGE_VIEWER"; -const wchar_t* IDL_FORM_IMAGE_SETTER = L"IDL_FORM_IMAGE_SETTER"; const wchar_t* IDL_FORM_NAME_EDITOR = L"IDL_FORM_NAME_EDITOR"; const wchar_t* IDL_FORM_IMAGE_CROP = L"IDL_FORM_IMAGE_CROP"; const wchar_t* FORM_IMAGE_VIEWER = L"ImageViewerForm"; -const wchar_t* FORM_IMAGE_SETTER = L"ImageSetterForm"; const wchar_t* FORM_IMAGE_CROP = L"ImageCropForm"; const wchar_t* FORM_IMAGE_NAME_EDITOR = L"ImageNameEditorForm"; const wchar_t* IDSCN_IMAGE_VIEWER = L"SceneImageView"; -const wchar_t* IDSCN_IMAGE_SETTER = L"SceneImageSetterForm"; const wchar_t* IDSCN_IMAGE_CROP = L"SceneImageCropForm"; const wchar_t* IDSCN_IMAGE_NAME_EDITOR = L"SceneImageNameEditorForm"; -- 2.7.4