PictureEditor.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:158k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * PictureEditor.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- *
- *
- * Author:
- * -------
- *
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : PictureEditor.c
- PURPOSE : Main functions of the Picture Editor application
- REMARKS : nil
- AUTHOR : Yogesh
- DATE : Jan-13-2004
- **************************************************************/
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "Fat_fs.h"
- #ifdef __MMI_PICTURE_EDITOR_SUPPORT__
- #include "PictureEditorDefs.h"
- #include "PictureEditorDecl.h"
- #include "PictureEditorProts.h"
- #include "CustDataProts.h"
- #include "GlobalDefs.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "DebugInitDef.h"
- #include "MainMenuDef.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_defs.h"
- #include "wgui_categories_PE.h"
- #include "wgui_categories_popup.h"
- #include "HistoryGprot.h"
- #include "CustMenuRes.h"
- #include "CommonScreens.h"
- #include "Downloaddefs.h"
- #include "DownloadProtos.h"
- #include "FileMgr.h" /* Should include FileMgr.h before ProfileMgrGprot.h */
- #include "FileSystemDef.h"
- #include "FileSystemGProt.h"
- #include "SettingProfile.h"
- #include "FunAndGamesDefs.h"
- #include "ProfileGprots.h"
- #include "FileManagerGProt.h"
- #include "FileManagerDef.h"
- /**********************Defines************************/
- /**********************Local Variables************************/
- static DYNIMAGEINFO gPicEditorInfo[MAXIMUM_PICTURE_EDITOR_IMAGES];
- static S32 g_pe_color_index = 0;
- static U8 nSelPEPenSetting;
- static U8 nSelPEEditOpt;
- static U8 nSelPEViewOpt;
- static S32 nInlinePenSize = 0;
- static S32 nInlinePenMoveFactor = 0;
- static S32 nInlinePenColorIndex = 0;
- static U8 *pInlinePenSizeList[MAX_TYPE_PEN_PIXEL];
- #ifndef __MMI_TOUCH_SCREEN__ /* PMT MANISH 20050616 */
- static U8 *pInlinePenMoveFactorList[MAX_TYPE_PEN_MOVE];
- #endif
- static U8 *pInlinePenColorIndexList[MAX_TYPE_PEN_COLOR - 1];
- static U8 inlinePERGBlist[MAX_TYPE_PEN_COLOR][3];
- static U8 inlineCustomRGB[3];
- static mmi_cat91_color_slider_enum highlighted_slider = MMI_CAT91_COLOR_SLIDER_RED_COLOR;
- static InlineItem PicEditInLineItems[MAX_RESIZE_INLINE_EDIT];
- static S32 nInlinePEScr = PE_SCR_2;
- static U8 *pInlinePEScrList[MAX_TYPE_SCR_TYPE];
- static U8 nInlinePEScrWidth[4 * ENCODING_LENGTH];
- static U8 nInlinePEScrHeight[4 * ENCODING_LENGTH];
- /**********************Global Variables************************/
- U16 gPEAttrib = 0;
- U8 gPicEditCurrPic;
- U8 gPicEditSelectedPic;
- U8 gPEImageCount = 0;
- U8 gPECurrentAction = SEL_PE_EDIT_OPT_SAVE_PIC;
- S16 gPEImageWidth = PE_SCR_SIZE_2;
- S16 gPEImageHeight = PE_SCR_SIZE_2;
- S16 gPEImageWidth_bak = PE_SCR_SIZE_2;
- S16 gPEImageHeight_bak = PE_SCR_SIZE_2;
- MMI_BOOL gPEImageResized = MMI_FALSE;
- /**********************Extern Variables************************/
- extern PU8 gpPEBackupDataBuff;
- extern PictureEditorPen *gpPicEditPen;
- extern PictureEditorPen *gpPicEditBackupPen;
- extern PicEditMarkBox gPicEditMark;
- extern U8 *gpPEFileBuff;
- extern U8 gPEBitsPerPixel;
- /* 051605 Calvin added */
- #if defined(__MMI_MAINLCD_240X320__)
- extern U8 *gpPicEditFillColorIndex;
- #endif
- /* Calvin end */
- /*****************************************************************************
- * FUNCTION
- * InitPictureEditor
- * DESCRIPTION
- * Initializes the NVRAM buffer for Image Editor
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitPictureEditor(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitRedoUndoBuffers();
- ReadPicEditListFromNVRAM();
- }
- /*****************************************************************************
- * FUNCTION
- * InitPicEditPen
- * DESCRIPTION
- * Initializes the Image Editor Pen setting to default values
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitPicEditPen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPEAttrib &= ~(PE_IMAGE_EDIT | PE_UNDO_IMAGE | PE_ZOOM_IMAGE | PE_PEN_DOWN | PE_MARK_IMAGE | PE_COPY_IMAGE);
- gPECurrentAction = SEL_PE_EDIT_OPT_SAVE_PIC;
- nInlinePEScr = PE_SCR_2;
- gpPicEditPen->penPixel = PIC_EDIT_PEN_PIXEL_1;
- gpPicEditPen->penColorIndex = PE_COLOR_BLACK;
- gpPicEditPen->penBackgrdColorIndex = PE_COLOR_WHITE;
- gpPicEditPen->penMove = PIC_EDIT_PEN_MOVE_1;
- #ifdef __MMI_TOUCH_SCREEN__
- gpPicEditPen->penContextSaved = MMI_FALSE;
- #endif
- gpPicEditBackupPen->penPixel = PIC_EDIT_PEN_PIXEL_1;
- gpPicEditBackupPen->penColorIndex = PE_COLOR_BLACK;
- gpPicEditBackupPen->penBackgrdColorIndex = PE_COLOR_WHITE;
- gpPicEditBackupPen->penMove = PIC_EDIT_PEN_MOVE_1;
- #ifdef __MMI_TOUCH_SCREEN__
- gpPicEditBackupPen->penContextSaved = MMI_FALSE;
- #endif
- #if defined(__MMI_MAINLCD_240X320__)
- *gpPicEditFillColorIndex = PE_COLOR_WHITE;
- #endif
- gPEColorRGB[PE_COLOR_CUSTOM_1] = 0x00408000;
- SetPicEditPenBoundary();
- SetPicEditPenAtCenter(TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditSelectMenu
- * DESCRIPTION
- * Entry function for image editor select image menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditSelectMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U8 jCount;
- DYNAMICINFO dynInfo;
- U8 *pPicEditList[MAXIMUM_PICTURE_EDITOR_IMAGES];
- S8 imagePath[100];
- S8 imageData[100 * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitPicEditPen();
- EntryNewScreen(SCR_PE_SELECT_PIC_MENU, ExitScr4PicEditSelectMenu, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_PE_SELECT_PIC_MENU);
- SetParentHandler(0);
- RegisterHighlightHandler(ChangePicEditSelectMenuSoftKey);
- ReadPicEditListFromNVRAM();
- if (guiBuffer == NULL)
- {
- dynInfo.DynInfoType = IMAGEINFO;
- dynInfo.DYNINFOUNION.ImageInfo = gPicEditorInfo;
- dynInfo.NoOfEntries = gPEImageCount;
- memset(imagePath, 0, sizeof(imagePath));
- sprintf(imagePath, "%c:\", MMI_PUBLIC_DRV);
- AnsiiToUnicodeString(imageData, imagePath);
- pfnUnicodeStrcat((S8*) imageData, (S8*) FMGR_DEFAULT_FOLDER_IMAGES);
- SyncPicEditFileSystem(imageData, &dynInfo);
- }
- /*
- * for (jCount=0; jCount<gPEImageCount; jCount++)
- * {
- * pPicEditList[jCount] = (U8*)gPicEditorInfo[jCount].ImageName;
- * }
- *
- * for (jCount=gPEImageCount; jCount<MAXIMUM_PICTURE_EDITOR_IMAGES; jCount++)
- * {
- * pPicEditList[jCount] = (U8*)GetString(STR_GLOBAL_EMPTY_LIST);
- * }
- */
- for (jCount = 0; jCount < MAXIMUM_PICTURE_EDITOR_IMAGES; jCount++)
- {
- if (((gPicEditorInfo[jCount].ImagesId >= (U16) PICTURE_EDITOR_IMAGE_BASE) &&
- (gPicEditorInfo[jCount].ImagesId <= PICTURE_EDITOR_IMAGE_BASE_END)))
- {
- pPicEditList[jCount] = (U8*) gPicEditorInfo[jCount].ImageName;
- }
- else
- {
- pPicEditList[jCount] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
- }
- }
- ShowCategory84Screen(
- STR_PE_DRAW_PICTURE,
- GetRootTitleIcon(MENU_PICTURE_EDITOR),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAXIMUM_PICTURE_EDITOR_IMAGES,
- (U8 **) pPicEditList,
- (PU16) gIndexIconsImageList,
- LIST_MENU,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler (SCR_PE_SELECT_PIC_MENU, ExitScr4PicEditSelectMenu); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditSelectMenu
- * DESCRIPTION
- * Exit function for EntryScr4PicEditSelectMenu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditSelectMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_PE_SELECT_PIC_MENU;
- h.entryFuncPtr = EntryScr4PicEditSelectMenu;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /*****************************************************************************
- * FUNCTION
- * ChangePicEditSelectMenuSoftKey
- * DESCRIPTION
- * Changes softkey according to the selected image
- * PARAMETERS
- * nIndex [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ChangePicEditSelectMenuSoftKey(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetPicEditCurrPic(nIndex);
- /* if(gPicEditCurrPic<gPEImageCount) */
- if (gPicEditorInfo[nIndex].ImagesId)
- /* if (((gPicEditorInfo[gPicEditCurrPic].ImagesId>=(U16)PICTURE_EDITOR_IMAGE_BASE)&&(gPicEditorInfo[gPicEditCurrPic].ImagesId<=PICTURE_EDITOR_IMAGE_BASE_END))) */
- {
- ChangeLeftSoftkey(STR_GLOBAL_VIEW, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(EntryScr4PicEditShowImage, KEY_EVENT_UP);
- SetKeyHandler(EntryScr4PicEditShowImage, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ADD, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(EntryPicEditAddPic, KEY_EVENT_UP);
- SetKeyHandler(EntryPicEditAddPic, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SET_PE_ADD_IMAGE(gPEAttrib);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPicEditAddPic
- * DESCRIPTION
- * Entry function for add image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPicEditAddPic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitRedoUndoBuffers();
- InitPicEditPen();
- SetPicEditEmptyImageDataBuff();
- SavePEContext();
- SetCurrentImageParams();
- UNSET_PE_IMAGE_CHANGED(gPEAttrib);
- EntryScr4PicEditEditImage();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowPicEditPrevImage
- * DESCRIPTION
- * Shows previous image on image viewing window
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowPicEditPrevImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPEImageCount == 1)
- {
- return;
- }
- do
- {
- gPicEditCurrPic = gPicEditCurrPic ? gPicEditCurrPic - 1 : MAXIMUM_PICTURE_EDITOR_IMAGES - 1;
- } while (!gPicEditorInfo[gPicEditCurrPic].ImagesId);
- ShowPicEditImage();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowPicEditNextImage
- * DESCRIPTION
- * Shows Next image on image viewing window
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowPicEditNextImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPEImageCount == 1)
- {
- return;
- }
- do
- {
- gPicEditCurrPic = (gPicEditCurrPic == (MAXIMUM_PICTURE_EDITOR_IMAGES - 1)) ? 0 : gPicEditCurrPic + 1;
- } while (!gPicEditorInfo[gPicEditCurrPic].ImagesId);
- ShowPicEditImage();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowPicEditImage
- * DESCRIPTION
- * Show image on view image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowPicEditImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPicEditorInfo[gPicEditCurrPic].ImagesId)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(EntryScr4PicEditViewOpt, KEY_EVENT_UP);
- SetKeyHandler(EntryScr4PicEditViewOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetPicEditImageDataBuff(gPicEditorInfo[gPicEditCurrPic].ImageName);
- }
- else
- {
- ChangeLeftSoftkey((U16) NULL, (U16) NULL);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- nInlinePEScr = PE_SCR_2;
- SetPicEditPenBoundary();
- SetPicEditEmptyImageDataBuff();
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- ShowPicEditImageWindow(&gpPEFileBuff[-MAX_IMAGE_HEADER_LENGTH]);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditViewOpt
- * DESCRIPTION
- * Entry function for View image option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditViewOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 nPEViewOptList[13];
- U16 noOfChildren;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- noOfChildren = GetNumOfChild(MENU_PE_VIEW_OPT);
- guiBuffer = GetCurrGuiBuffer(SCR_PE_VIEW_OPTION);
- /* ExecuteCurrExitHandler (); */
- EntryNewScreen(SCR_PE_VIEW_OPTION, ExitScr4PicEditViewOpt, NULL, NULL);
- GetSequenceStringIds(MENU_PE_VIEW_OPT, nPEViewOptList);
- SetParentHandler(MENU_PE_VIEW_OPT);
- SetHiliteHandler(MENU_PE_VIEW_OPT_EDIT, SelPEViewOptEdit);
- SetHiliteHandler(MENU_PE_VIEW_OPT_DELETE, SelPEViewOptDelete);
- SetHiliteHandler(MENU_PE_VIEW_OPT_DELETEALL, SelPEViewOptDeleteAll);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_PICTURE_EDITOR),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- noOfChildren,
- nPEViewOptList,
- (PU16) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPicEditViewOpt, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler (SCR_PE_VIEW_OPTION, ExitScr4PicEditViewOpt); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditViewOpt
- * DESCRIPTION
- * Exit function for EntryScr4PicEditViewOpt
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditViewOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_PE_VIEW_OPTION;
- h.entryFuncPtr = EntryScr4PicEditViewOpt;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEViewOptEdit
- * DESCRIPTION
- * Hilite handler for option screen of view image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEViewOptEdit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEViewOpt = SEL_PE_VIEW_OPT_EDIT;
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEViewOptDelete
- * DESCRIPTION
- * Hilite handler for option screen of view image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEViewOptDelete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEViewOpt = SEL_PE_VIEW_OPT_DELETE;
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEViewOptDeleteAll
- * DESCRIPTION
- * Hilite handler for option screen of view image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEViewOptDeleteAll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEViewOpt = SEL_PE_VIEW_OPT_DELETEALL;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPicEditViewOpt
- * DESCRIPTION
- * Entry function depending of the selected option of view image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPicEditViewOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (nSelPEViewOpt)
- {
- case SEL_PE_VIEW_OPT_EDIT: /* Edit */
- UNSET_PE_ADD_IMAGE(gPEAttrib);
- InitRedoUndoBuffers();
- InitPicEditPen();
- if (SetPicEditImageDataBuff(gPicEditorInfo[gPicEditCurrPic].ImageName) == MMI_FALSE)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_NO, 0, 1000, (U8) ERROR_TONE);
- break;
- }
- SavePEContext();
- SetCurrentImageParams();
- UNSET_PE_IMAGE_CHANGED(gPEAttrib);
- EntryScr4PicEditEditImage();
- break;
- case SEL_PE_VIEW_OPT_DELETE: /* Delete */
- EntryScr4PicEditDeleteConfirm();
- break;
- case SEL_PE_VIEW_OPT_DELETEALL: /* Delete All */
- EntryScr4PicEditDeleteAllConfirm();
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditDeleteConfirm
- * DESCRIPTION
- * Entry function for delete image confirmation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditDeleteConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DELETE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(PicEditDeleteImage, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditDeleteConfirm
- * DESCRIPTION
- * Exit function for EntryScr4PicEditDeleteConfirm
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditDeleteConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h; /* Variable to hold the history data */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- h.scrnID = SCR_PE_DELETE_CONFIRM;
- h.entryFuncPtr = EntryScr4PicEditDeleteConfirm;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * PicEditDeleteImage
- * DESCRIPTION
- * Deletes the image and shows a pop up for success
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PicEditDeleteImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (SetDeletePicEditImage() == MMI_FALSE)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- PE_NOTIFYDURATION,
- WARNING_TONE);
- }
- else
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, PE_NOTIFYDURATION, SUCCESS_TONE);
- }
- DeleteUptoScrID(SCR_PE_SELECT_PIC_MENU);
- }
- /*****************************************************************************
- * FUNCTION
- * SetDeletePicEditImage
- * DESCRIPTION
- * Sets the image delete in nvram buffers
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL SetDeletePicEditImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *pFileName;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pFileName = GetPictureEditorImageNameWithPathInFileSystem(gPicEditorInfo[gPicEditCurrPic].ImagesId);
- if (pFileName && pfError(pfdelete(pFileName)))
- {
- #ifdef MMI_ON_HARDWARE_P
- if (pfopen((U16*) pFileName, FS_READ_ONLY) < 0)
- #else
- if (pfopen(pFileName, PFS_READ) < 0)
- #endif
- {
- DeletePictureEditorImage(gPicEditorInfo[gPicEditCurrPic].ImagesId);
- WritePicEditListToNVRAM();
- return MMI_TRUE;
- }
- PRINT_INFORMATION(("Error Deleting File"));
- return MMI_FALSE;
- }
- else
- {
- DeletePictureEditorImage(gPicEditorInfo[gPicEditCurrPic].ImagesId);
- WritePicEditListToNVRAM();
- return MMI_TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditDeleteAllConfirm
- * DESCRIPTION
- * Entry function for delete all image confirmation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditDeleteAllConfirm(void)
- {
- #if (0)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* (0) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DELETE_ALL),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(PicEditDeleteAllImages, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- // playRequestedTone(WARNING_TONE) ;
- //SetExitHandler(SCR_PE_DELETE_ALL_CONFIRM, ExitScr4PicEditDeleteAllConfirm);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditDeleteAllConfirm
- * DESCRIPTION
- * Exit function for EntryScr4PicEditDeleteAllConfirm
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditDeleteAllConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h; /* Variable to hold the history data */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- h.scrnID = SCR_PE_DELETE_ALL_CONFIRM;
- h.entryFuncPtr = EntryScr4PicEditDeleteAllConfirm;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * PicEditDeleteAllImages
- * DESCRIPTION
- * Calls a fucntion to delete all images and shows pop up
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PicEditDeleteAllImages(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDeleteAllPicEditImage();
- DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, PE_NOTIFYDURATION, SUCCESS_TONE);
- DeleteUptoScrID(SCR_PE_SELECT_PIC_MENU);
- }
- /*****************************************************************************
- * FUNCTION
- * SetDeleteAllPicEditImage
- * DESCRIPTION
- * Sets NVRAM buffer for delete all images
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetDeleteAllPicEditImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *pFileName;
- U8 jCount;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (jCount = 0; jCount < MAXIMUM_PICTURE_EDITOR_IMAGES; jCount++)
- {
- if (gPicEditorInfo[gPicEditCurrPic].ImagesId)
- {
- pFileName = GetPictureEditorImageNameWithPathInFileSystem(gPicEditorInfo[jCount].ImagesId);
- if (pFileName && pfError(pfdelete(pFileName)))
- {
- PRINT_INFORMATION(("Error Deleting File"));
- }
- }
- }
- memset(&gPicEditorInfo, ' ', NVRAM_PICTURE_EDITOR_SIZE);
- WritePicEditListToNVRAM();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditEditOpt
- * DESCRIPTION
- * Entry function for Options screen for edit image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditEditOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 nPEOptionList[13];
- U16 noOfChildren;
- U16 menuId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = gPECurrentAction;
- if (!IS_PE_ZOOM_IMAGE(gPEAttrib))
- {
- if (!IS_PE_MARK_IMAGE(gPEAttrib))
- {
- if (!IS_PE_IMAGE_EDIT(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_1;
- }
- else if (!IS_PE_UNDO_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_2;
- }
- else
- {
- menuId = MENU_PE_EDIT_OPT_3;
- }
- }
- else
- {
- if (!IS_PE_COPY_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_4;
- }
- else if (!IS_PE_IMAGE_EDIT(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_5;
- }
- else if (!IS_PE_UNDO_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_6;
- }
- else
- {
- menuId = MENU_PE_EDIT_OPT_7;
- }
- }
- }
- else
- {
- if (!IS_PE_MARK_IMAGE(gPEAttrib))
- {
- if (!IS_PE_IMAGE_EDIT(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_8;
- }
- else if (!IS_PE_UNDO_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_9;
- }
- else
- {
- menuId = MENU_PE_EDIT_OPT_10;
- }
- }
- else
- {
- if (!IS_PE_COPY_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_11;
- }
- else if (!IS_PE_IMAGE_EDIT(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_12;
- }
- else if (!IS_PE_UNDO_IMAGE(gPEAttrib))
- {
- menuId = MENU_PE_EDIT_OPT_13;
- }
- else
- {
- menuId = MENU_PE_EDIT_OPT_14;
- }
- }
- }
- noOfChildren = GetNumOfChild(menuId);
- guiBuffer = GetCurrGuiBuffer(SCR_PE_EDIT_PIC_OPT);
- /* ExecuteCurrExitHandler (); */
- EntryNewScreen(SCR_PE_EDIT_PIC_OPT, ExitScr4PicEditEditOpt, NULL, NULL);
- GetSequenceStringIds(menuId, nPEOptionList);
- SetParentHandler(menuId);
- InitPicEditHiliteHandlers();
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_PICTURE_EDITOR),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- noOfChildren,
- nPEOptionList,
- (PU16) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPEEditOpt, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler (SCR_PE_EDIT_PIC_OPT, ExitScr4PicEditEditOpt); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditEditOpt
- * DESCRIPTION
- * Exit function for EntryScr4PicEditEditOpt
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditEditOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_PE_EDIT_PIC_OPT;
- h.entryFuncPtr = EntryScr4PicEditEditOpt;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptSavePic
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptSavePic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_SAVE_PIC;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptSavePicAs
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptSavePicAs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_SAVE_PIC_AS;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptPenSetting
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptPenSetting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_PEN_SETTING;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptFillPic
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptFillPic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_FILL_PIC;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptMark
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptMark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_MARK;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptCut
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptCut(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_CUT;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptCopy
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptCopy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_COPY;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptPaste
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptPaste(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_PASTE;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptUndo
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptUndo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_UNDO;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptRedo
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptRedo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_REDO;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptZoom
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptZoom(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_ZOOM;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptFullSize
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptFullSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_FULL_SIZE;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptResize
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptResize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_RESIZE;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SelPEEditOptHelp
- * DESCRIPTION
- * Hilite handler fucntion for option screen of edit/draw image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelPEEditOptHelp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nSelPEEditOpt = SEL_PE_EDIT_OPT_HELP;
- SetKeyHandler(EntryPEEditOpt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPEEditOpt
- * DESCRIPTION
- * Selects the entry functions depending on the option selected of image edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPEEditOpt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (nSelPEEditOpt)
- {
- case SEL_PE_EDIT_OPT_SAVE_PIC: /* Save */
- gPECurrentAction = nSelPEEditOpt;
- result = SavePicEditImageDataBuff();
- if (result == FS_NO_ERROR)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- PE_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) get_string(GetFileSystemErrorString(result)),
- IMG_GLOBAL_ERROR,
- 1,
- PE_NOTIFYDURATION,
- ERROR_TONE);
- }
- DeleteUptoScrID(SCR_PE_SELECT_PIC_MENU);
- break;
- case SEL_PE_EDIT_OPT_SAVE_PIC_AS: /* Save As */
- gPECurrentAction = nSelPEEditOpt;
- EntryScr4PicEditSaveAs();
- break;
- case SEL_PE_EDIT_OPT_PEN_SETTING: /* Pen Setting */
- EntryScr4PicEditPenSetting();
- break;
- case SEL_PE_EDIT_OPT_FILL_PIC: /* Fill Picture */
- gPECurrentAction = nSelPEEditOpt;
- /* Pixtel patch */
- nInlinePenColorIndex = gpPicEditPen->penBackgrdColorIndex - 1;
- EntryScr4PicEditFillPic();
- break;
- case SEL_PE_EDIT_OPT_MARK: /* Mark */
- gPECurrentAction = nSelPEEditOpt;
- gPicEditMark.minX = gpPicEditPen->penX;
- gPicEditMark.minY = gpPicEditPen->penY;
- gPicEditMark.maxX = gpPicEditPen->penX;
- gPicEditMark.maxY = gpPicEditPen->penY;
- UNSET_PE_PEN_DOWN(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_CUT: /* Cut */
- gPECurrentAction = nSelPEEditOpt;
- SavePEContext();
- SaveDataBuffer();
- gpPicEditPen->penColorIndex = gpPicEditPen->penBackgrdColorIndex;
- PutPixtelInBuff(
- gPicEditMark.minX,
- gPicEditMark.minY,
- (U16) (gPicEditMark.maxX + 1),
- (U16) (gPicEditMark.maxY + 1),
- &gpPEFileBuff[PIC_EDIT_FILE_HEADER_SIZE]);
- gpPicEditPen->penColorIndex = gpPicEditBackupPen->penColorIndex;
- UNSET_PE_PEN_DOWN(gPEAttrib);
- SET_PE_IMAGE_EDIT(gPEAttrib);
- SET_PE_COPY_IMAGE(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_COPY: /* Copy */
- gPECurrentAction = nSelPEEditOpt;
- UNSET_PE_PEN_DOWN(gPEAttrib);
- SaveDataBuffer();
- SET_PE_COPY_IMAGE(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_PASTE: /* Paste */
- gPECurrentAction = nSelPEEditOpt;
- SavePEContext();
- PasteBoxInImageBuffer(&gpPEFileBuff[PIC_EDIT_FILE_HEADER_SIZE], gpPEBackupDataBuff);
- UNSET_PE_PEN_DOWN(gPEAttrib);
- SET_PE_IMAGE_EDIT(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_UNDO: /* Undo */
- case SEL_PE_EDIT_OPT_REDO: /* Redo */
- gPECurrentAction = nSelPEEditOpt;
- ExchangePEContext();
- SetPicEditZoomWindow(TRUE);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_ZOOM: /* Zoom */
- gPECurrentAction = nSelPEEditOpt;
- SetPicEditZoomWindow(TRUE);
- SET_PE_ZOOM_IMAGE(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_FULL_SIZE: /* Full Size */
- gPECurrentAction = SEL_PE_EDIT_OPT_SAVE_PIC;
- UNSET_PE_ZOOM_IMAGE(gPEAttrib);
- GoBackHistory();
- break;
- case SEL_PE_EDIT_OPT_RESIZE: /* Resize */
- SetResizeInlineItemValues();
- EntryScr4PicEditScrResize();
- break;
- case SEL_PE_EDIT_OPT_HELP: /* Help */
- EntryScr4PicEditHelp();
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PicEditCancelSaveAs
- * DESCRIPTION
- * restore current pic if user cancel "save as" option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PicEditCancelSaveAs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPicEditSelectedPic != gPicEditCurrPic)
- {
- gPicEditCurrPic = gPicEditSelectedPic;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditSaveAs
- * DESCRIPTION
- * Entry function image editor select image menu for save as
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditSaveAs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U8 jCount;
- DYNAMICINFO dynInfo;
- U8 *pPicEditList[MAXIMUM_PICTURE_EDITOR_IMAGES];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* ExecuteCurrExitHandler(); */
- EntryNewScreen(SCR_PE_EDIT_SAVE_AS, ExitScr4PicEditSaveAs, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_PE_EDIT_SAVE_AS);
- SetParentHandler(0);
- gPicEditSelectedPic = gPicEditCurrPic;
- RegisterHighlightHandler(SetPicEditCurrPic);
- ReadPicEditListFromNVRAM();
- if (guiBuffer == NULL)
- {
- dynInfo.DynInfoType = IMAGEINFO;
- dynInfo.DYNINFOUNION.ImageInfo = gPicEditorInfo;
- dynInfo.NoOfEntries = gPEImageCount;
- SyncPicEditFileSystem(PICTURE_EDITOR_PATH, &dynInfo);
- }
- /*
- * for (jCount=0; jCount<gPEImageCount; jCount++)
- * {
- * pPicEditList[jCount] = (U8*)gPicEditorInfo[jCount].ImageName;
- * }
- *
- * for (jCount=gPEImageCount; jCount<MAXIMUM_PICTURE_EDITOR_IMAGES; jCount++)
- * {
- * pPicEditList[jCount] = (U8*)GetString(STR_GLOBAL_EMPTY);
- * }
- */
- for (jCount = 0; jCount < MAXIMUM_PICTURE_EDITOR_IMAGES; jCount++)
- {
- if (((gPicEditorInfo[jCount].ImagesId >= (U16) PICTURE_EDITOR_IMAGE_BASE) &&
- (gPicEditorInfo[jCount].ImagesId <= PICTURE_EDITOR_IMAGE_BASE_END)))
- {
- pPicEditList[jCount] = (U8*) gPicEditorInfo[jCount].ImageName;
- }
- else
- {
- pPicEditList[jCount] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
- }
- }
- ShowCategory84Screen(
- STR_PE_EDIT_OPT_SAVE_PIC_AS,
- MAIN_MENU_TITLE_FUNANDGAMES_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAXIMUM_PICTURE_EDITOR_IMAGES,
- (U8 **) pPicEditList,
- (PU16) gIndexIconsImageList,
- LIST_MENU,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(PicEditSaveImageAs, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PicEditCancelSaveAs, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler (SCR_PE_EDIT_SAVE_AS, ExitScr4PicEditSaveAs); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditSaveAs
- * DESCRIPTION
- * Exit function for EntryScr4PicEditSaveAs
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditSaveAs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_PE_EDIT_SAVE_AS;
- h.entryFuncPtr = EntryScr4PicEditSaveAs;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /*****************************************************************************
- * FUNCTION
- * SetPicEditCurrPic
- * DESCRIPTION
- * Sets the global varibale for current image
- * PARAMETERS
- * nIndex [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetPicEditCurrPic(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("Task # : %d", nIndex));
- gPicEditCurrPic = (U8) nIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * PicEditSaveImageAs
- * DESCRIPTION
- * Saves Image and shows a pop up for success else if replace image, confirms for replacement
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PicEditSaveImageAs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if(gPicEditCurrPic<gPEImageCount) */
- if (gPicEditorInfo[gPicEditCurrPic].ImagesId)
- {
- UNSET_PE_ADD_IMAGE(gPEAttrib);
- EntryScr4PicEditSaveAsConfirm();
- }
- else
- {
- S32 result;
- SET_PE_ADD_IMAGE(gPEAttrib);
- result = SavePicEditImageDataBuff();
- if (result == FS_NO_ERROR)
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, PE_NOTIFYDURATION, SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) get_string(GetFileSystemErrorString(result)),
- IMG_GLOBAL_ERROR,
- 1,
- PE_NOTIFYDURATION,
- ERROR_TONE);
- }
- DeleteUptoScrID(SCR_PE_SELECT_PIC_MENU);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditSaveAsConfirm
- * DESCRIPTION
- * Confirmation screen for confirming to replace selected image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditSaveAsConfirm(void)
- {
- #if (0)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* (0) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_PE_EDIT_OPT_REPLACE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ReplacePicEditSelectedImage, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackPicEditSaveAsConfirmHistory, KEY_EVENT_UP);
- /* playRequestedTone(WARNING_TONE) ; */
- /* SetExitHandler(SCR_PE_EDIT_SAVE_AS_CONFIRM, ExitScr4PicEditSaveAsConfirm); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScr4PicEditSaveAsConfirm
- * DESCRIPTION
- * Exit function for EntryScr4PicEditFillPicSaveConfirm
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScr4PicEditSaveAsConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h; /* Variable to hold the history data */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- h.scrnID = SCR_PE_EDIT_SAVE_AS_CONFIRM;
- h.entryFuncPtr = EntryScr4PicEditSaveAsConfirm;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackPicEditSaveAsConfirmHistory
- * DESCRIPTION
- * Go Back history function for the confirmation screen for Save As image
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoBackPicEditSaveAsConfirmHistory(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPicEditSelectedPic != gPicEditCurrPic)
- {
- if (!gPicEditorInfo[gPicEditSelectedPic].ImagesId)
- {
- SET_PE_ADD_IMAGE(gPEAttrib);
- }
- gPicEditCurrPic = gPicEditSelectedPic;
- }
- DeleteUptoScrID(SCR_PE_EDIT_PIC_OPT);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ReplacePicEditSelectedImage
- * DESCRIPTION
- * Replace selected image with the current image buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ReplacePicEditSelectedImage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- result = SavePicEditImageDataBuff();
- if (result == FS_NO_ERROR)
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, PE_NOTIFYDURATION, SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) get_string(GetFileSystemErrorString(result)),
- IMG_GLOBAL_ERROR,
- 1,
- PE_NOTIFYDURATION,
- ERROR_TONE);
- }
- DeleteUptoScrID(SCR_PE_SELECT_PIC_MENU);
- }
- /*****************************************************************************
- * FUNCTION
- * PicEditPenColorHiLiteHandler
- * DESCRIPTION
- * hilight handler of category92
- * PARAMETERS
- * index [IN] Selected color index
- * RETURNS
- * void
- *****************************************************************************/
- void PicEditPenColorHiLiteHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pe_color_index = index;
- }
- /*****************************************************************************
- * FUNCTION
- * SetPicEditPenSettingInlineItemData
- * DESCRIPTION
- * Setup inline item data for Pen Setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetPicEditPenSettingInlineItemData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&PicEditInLineItems[i++], (U8*) (get_string(STR_PE_PEN_SIZE)));
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(&PicEditInLineItems[i++], MAX_TYPE_PEN_PIXEL, pInlinePenSizeList, &nInlinePenSize);
- #ifndef __MMI_TOUCH_SCREEN__
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&PicEditInLineItems[i++], (PU8) (get_string(STR_PE_PEN_MOVE_FACTOR)));
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(&PicEditInLineItems[i++], MAX_TYPE_PEN_MOVE, pInlinePenMoveFactorList, &nInlinePenMoveFactor);
- #endif /* __MMI_TOUCH_SCREEN__ */
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&PicEditInLineItems[i++], (PU8) (get_string(STR_PE_PEN_COLOR)));
- SetInlineItemActivation(&PicEditInLineItems[i], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &PicEditInLineItems[i],
- MAX_TYPE_PEN_COLOR - 1,
- pInlinePenColorIndexList,
- &nInlinePenColorIndex);
- RegisterInlineSelectHighlightHandler(&PicEditInLineItems[i], PicEditPenColorHiLiteHandler);
- /* g_cat92_n_items = i; */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScr4PicEditPenSetting
- * DESCRIPTION
- * Entry function for Pen setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScr4PicEditPenSetting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer; /* added for inline edit history */
- U16 inputBufferSize; /* added for inline edit history */
- U8 iCount;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* ExecuteCurrExitHandler(); */
- EntryNewScreen(SCR_PE_PEN_SETTING, ExitScr4PicEditPenSetting, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_PE_PEN_SETTING);
- InitializeCategory57Screen();
- for (iCount = 0; iCount < MAX_TYPE_PEN_PIXEL; ++iCount)
- {
- pInlinePenSizeList[iCount] = (U8*) GetString((U16) (iCount + STR_PE_PEN_SIZE_1));
- }
- #ifndef __MMI_TOUCH_SCREEN__ /* PMT MANISH 20050616 */
- for (iCount = 0; iCount < MAX_TYPE_PEN_MOVE; ++iCount)
- {
- pInlinePenMoveFactorList[iCount] = (U8*) GetString((U16) (iCount + STR_PE_PEN_MOVE_1));
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- nInlinePenColorIndex = gpPicEditPen->penColorIndex - 1;
- switch (gpPicEditPen->penPixel)
- {
- case PIC_EDIT_PEN_PIXEL_1:
- nInlinePenSize = 0;
- break;
- case PIC_EDIT_PEN_PIXEL_2:
- nInlinePenSize = 1;
- break;
- case PIC_EDIT_PEN_PIXEL_3:
- nInlinePenSize = 2;
- break;
- case PIC_EDIT_PEN_PIXEL_4:
- nInlinePenSize = 3;
- break;
- default: