comparison src/aci2/bmi/mmiCameraTest.c @ 120:3c2acfa1a72f

src/aci2/bmi: file renames to make filename case consistent
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 07 Oct 2016 03:46:05 +0000
parents src/aci2/bmi/MmiCameraTest.c@93999a60b835
children
comparison
equal deleted inserted replaced
119:b92a33c204b6 120:3c2acfa1a72f
1 /*******************************************************************************
2
3 CONDAT (UK)
4
5 ********************************************************************************
6
7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner.
9
10 ********************************************************************************
11
12 $Project name: Basic MMI
13 $Project code: BMI (6349)
14 $Module: CAMERATEST
15 $File: MmiCameraTest.c
16 $Revision: 1.0
17 $Author: Texas Instruments France
18 $Date: 25/06/04
19
20 ********************************************************************************
21
22 Description:
23
24 This module provides the Camera functionality.
25
26 ********************************************************************************
27 $History: MmiCameraTest.c
28
29 Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
30 Description: Locosto: MIgration to New LCD APIs
31 Solution: Migrated to New APIs by replacing the old driver APIs with
32 corresponding New LCD APIs
33
34 Aug 22 2005, xpradipg - LOCOSTO-ENH-31154
35 Description: Application to test camera
36 Solution: Implemented the camera application with following functionalities
37 preview, snapshot and image saving.
38
39 25/06/04 Texas Instruments France original version
40
41 $End
42
43 *******************************************************************************/
44
45
46
47
48 /*******************************************************************************
49
50 Include files
51
52 *******************************************************************************/
53 #define ENTITY_MFW
54 /* includes */
55 #include <string.h>
56 #include <stdio.h>
57 #include <stdlib.h>
58
59 #include "typedefs.h"
60 #include "vsi.h"
61 #include "pei.h"
62 #include "custom.h"
63
64 #if defined (NEW_FRAME)
65
66 #include "typedefs.h"
67 #include "vsi.h"
68 #include "pei.h"
69 #include "custom.h"
70 #include "prim.h"
71
72 #else
73
74 #include "STDDEFS.H"
75 #include "custom.h"
76 #include "gsm.h"
77 #include "vsi.h"
78
79 #endif
80
81 #include "message.h" /* included for aci_cmh.h .... */
82 #include "aci_cmh.h" /* included for mfw_sat.h, included for MmiDummy.h, included for MmiMenu.h */
83
84 #include "mfw_mfw.h"
85 #include "mfw_win.h"
86 #include "mfw_icn.h" /* included for mfw_mnu.h */
87 #include "mfw_mnu.h"
88 #include "mfw_tim.h"
89 #include "mfw_kbd.h"
90 #include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */
91 #include "mfw_cm.h"
92 #include "mfw_cam.h"
93 #include "MmiBlkLangDB.h"
94 #include "mmiColours.h"
95 #include "MmiDialogs.h"
96
97 #include "MmiDummy.h" /* included for MmiMenu.h */
98 #include "MmiLists.h"
99 #include "MmiMenu.h"
100 #include "MmiSoftKeys.h"
101 #include "AUIEditor.h"
102 #include "MmiMain.h"
103 #include "Mmiicons.h"
104 #include "MmiCameraTest.h"
105 #include "MmiWindow.h"
106 #include "MmiCall.h"
107
108 #include "r2d/r2d.h"
109
110 /*******************************************************************************
111
112 internal data
113
114 *******************************************************************************/
115 //Events for window
116 #define CT_INIT 0
117 #define CT_RETURN 1
118 #define CT_RESUME 2
119
120 //Events for editor
121 #define CT_EDITOR_CANCEL 2
122 #define CT_EDITOR_SELECT 3
123
124 //Dialog Screen timeout
125 #define CT_INFO_SCRN_TIMEOUT 1000
126 //Default Filename of the Jpeg file to be saved.
127 #define CT_DEFAULT_FILENAME "Snapshot"
128 #define CT_FILENAME_EDITOR_INPUT_LEN 45
129
130 /*
131 * Structures
132 */
133
134 /*camera window structure*/
135 typedef struct{
136 T_MMI_CONTROL mmi_control;
137 MfwHnd win;
138 MfwHnd mfwwin;
139 T_MFW_HND optwin;
140 T_MFW_HND infowin;
141 MfwHnd parent;
142 MfwHnd kbd;
143 MfwIcnAttr ct_bitmap;
144 SHORT id;
145 } T_MMI_CT_Win_data;
146
147 typedef struct
148 {
149 /* administrative data */
150
151 T_MMI_CONTROL mmi_control;
152 T_MFW_HND win;
153 SHORT id;
154 T_MFW_HND parent;
155 /* associated handlers */
156 T_MFW_HND kbd;
157 T_MFW_HND kbd_long;
158 T_MFW_HND menu;
159
160 } T_MMI_CT_Opt_data;
161
162 /*editor data structure*/
163 typedef struct{
164 T_MMI_CONTROL mmi_control;
165 MfwHnd win;
166 MfwHnd ct_win_editor;
167 UBYTE ct_buffer[CT_FILE_NAME_LENGTH+1];
168 } T_CT_Editor_Data;
169
170 //Camera Option Menu Items
171 static const MfwMnuItem Mmi_camera_OPTItems [] =
172 {
173 {0,0,0,(char *)TxtQuality,0,(MenuFunc)M_exeQuality,item_flag_none},
174 //{0,0,0,(char *)TxtColour,0,(MenuFunc)M_exeColor,item_flag_none},
175 //{0,0,0,(char *)TxtDigiZoom,0,(MenuFunc)M_exeZoom,item_flag_none},
176 {0,0,0,(char *)TxtFilename,0,(MenuFunc)mmi_camera_edit_filename,item_flag_none}
177 };
178
179 //Camera Option menu Atrributes
180 static const MfwMnuAttr Mmi_camera_OPTAttrib =
181 {
182 &SmsSend_R_OPTArea,
183 MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
184 -1, /* use default font */
185 (MfwMnuItem*)Mmi_camera_OPTItems, /* with these items */
186 sizeof(Mmi_camera_OPTItems)/sizeof(MfwMnuItem), /* number of items */
187 COLOUR_LIST_SMS, TxtNull, NULL, MNUATTRSPARE
188
189 };
190 //Variable to track the different Camera states.
191 extern UBYTE camera_state;
192 //Window Handler for Option window.
193 T_MFW_HND optwin;
194 //Variable to track active Call
195 extern T_call call_data;
196 //Default filename for captured image
197 char new_filename[CT_FILE_NAME_LENGTH] = CT_DEFAULT_FILENAME;
198 UBYTE IsCamInit = FALSE; //Variable to initialise Camil only once.
199 T_MFW_HND digwin1 = NULL; //Window handler for Info Dialog.
200 /*******************************************************************************
201
202 Local prototypes
203
204 *******************************************************************************/
205 int mmi_camera_test_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
206 T_MFW_HND mmi_camera_test_win_create(T_MFW_HND parent);
207 static int mmi_camera_test_opt_kbd_cb (MfwEvt e, MfwKbd *k);
208 static int mmi_camera_test_opt_mnu_cb (MfwEvt e, MfwMnu *m);
209 void mmi_camera_test_opt_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
210 int mmi_camera_test_opt_win_cb (MfwEvt evt, MfwHnd win);
211 static int mmi_camera_test_kbd_cntrl (MfwEvt e, MfwKbd *k);
212 static void mmi_camera_test_opt_destroy(MfwHnd own_window);
213 void mmi_camera_test_update_softkeys (int lsk, int rsk);
214 T_MFW_HND mmi_camera_editor_create(T_MFW_HND parent);
215
216 /*******************************************************************************
217
218 $Function: mmi_camera_test_show_info
219
220 $Description: Displays the dialog box
221
222 $Returns: Dialog window
223
224 $Arguments: parent -parent window for dialog
225 str1- String to be displayed in dialog
226 str2 -String to be displayed in dialog
227 callback- Callback function
228
229 *******************************************************************************/
230 static MfwHnd mmi_camera_test_show_info(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback)
231 {
232 T_DISPLAY_DATA display_info;
233 T_MFW_HND win;
234
235 TRACE_EVENT ("mmi_camera_test_show_info()");
236
237 /*
238 ** Create a timed dialog to display the Message .
239 */
240 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS);
241 dlg_initDisplayData_events( &display_info, callback, THREE_SECS, KEY_LEFT | KEY_CLEAR | KEY_HUP/*0*/);
242
243 win = info_dialog(parent, &display_info);
244 dspl_Enable(1);
245 return win;
246 }
247
248 /*******************************************************************************
249
250 $Function: mmi_camera_test_show_saving_info
251
252 $Description: Displays the Saving dialog box
253
254 $Returns: Dialog window
255
256 $Arguments: parent -parent window for dialog
257 callback- Callback function
258
259 *******************************************************************************/
260
261 static MfwHnd mmi_camera_test_show_saving_info(T_MFW_HND parent, T_VOID_FUNC callback)
262 {
263 T_DISPLAY_DATA display_info;
264 T_MFW_HND win;
265 TRACE_EVENT ("mmi_camera_test_show_saving_info()");
266
267 dspl_Clear(0,0,SCREEN_SIZE_X-1,SCREEN_SIZE_Y-1 );
268 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtSnapSaving,TxtNull, COLOUR_STATUS);
269 dlg_initDisplayData_events( &display_info, callback, FOREVER, KEY_LEFT | KEY_CLEAR | KEY_HUP/*0*/);
270 win = info_dialog(parent, &display_info);
271 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
272 //replaced the flag with the function call, to migrate to the new Lcd APIs
273 dspl_control(DSPL_ACCESS_ENABLE);
274 dspl_Enable(1);
275 return win;
276 }
277 /*******************************************************************************
278
279 $Function: mmi_camera_test_win_cntrl
280
281 $Description: This is the dialog control function for the Camera Window. It
282 receives the signals from the MFW and determines what action, if any, to take.
283
284 $Returns: None
285
286 $Arguments: win : The pointer to the window handler, so the function can reference the
287 dynamic user data, if any.
288 event : The incoming event
289 value : Generic incoming Parameter, it will be 'event' dependant
290 parameter : Generic incoming Parameter, it will be 'event' dependant
291
292 *******************************************************************************/
293 int mmi_camera_test_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
294 {
295 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
296 T_MMI_CT_Win_data * data = (T_MMI_CT_Win_data *)win_data->user;
297
298 TRACE_EVENT ("mmi_camera_test_exec_cb()");
299 switch (event)
300 {
301 case CT_INIT:
302 TRACE_EVENT(">> mmi_camera_test_exec_cb(), CT_INIT ");
303 camera_state = CAMERA_STATE_VIEWFINDER;
304 //Create keyboard handler
305 data->kbd = kbd_create (data->win,KEY_ALL,(T_MFW_CB)mmi_camera_test_kbd_cntrl);
306 winShow(data->win);
307 break;
308
309 case CT_RESUME:
310 break;
311
312 case CT_RETURN:
313 TRACE_EVENT(">> mmi_camera_test_exec_cb(), CT_RETURN ");
314 winShow(data->win);
315 break;
316 default:
317 TRACE_EVENT(">> mmi_camera_test_exec_cb(), default ");
318
319 }
320 return MFW_EVENT_CONSUMED;
321 }
322
323
324 /*******************************************************************************
325
326 $Function: mmi_camera_dialog_cb
327
328 $Description: Callback for Dialog
329
330 $Returns:None
331
332 $Arguments: win - Window Handler
333 identifier - Identifier
334 reason -
335
336 *******************************************************************************/
337 void mmi_camera_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
338 {
339 TRACE_FUNCTION ("mmi_camera_dialog_cb()");
340
341 switch (reason)
342 {
343 case INFO_TIMEOUT:
344 /* no break; */
345 case INFO_KCD_HUP:
346 /* no break; */
347 case INFO_KCD_LEFT:
348 /* no break; */
349 case INFO_KCD_RIGHT:
350 /* no break; */
351 case INFO_KCD_CLEAR:
352 if( digwin1)
353 dialog_info_destroy(digwin1);
354 digwin1 = NULL;
355 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
356 rvf_delay(40);
357 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
358 //replaced the flag with the function call, to migrate to the new Lcd APIs
359 dspl_control(DSPL_ACCESS_DISABLE);
360 mfw_cam_set_viewfinder_mode();
361 break;
362 }
363 }
364
365 /*******************************************************************************
366
367 $Function: mmi_camera_saving_info_cb
368
369 $Description: Callback for Dialog
370
371 $Returns:None
372
373 $Arguments: win - Window Handler
374 identifier - Identifier
375 reason -
376
377 *******************************************************************************/
378 void mmi_camera_saving_info_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
379 {
380 }
381
382 /*******************************************************************************
383
384 $Function: mmi_camera_test_kbd_cntrl
385
386 $Description: Keyboard event handler for camera window
387
388 $Returns: status int
389
390 $Arguments: e - window handle event
391 k - keyboard control block
392 *******************************************************************************/
393 static int mmi_camera_test_kbd_cntrl (MfwEvt e, MfwKbd *k)
394 {
395 T_MFW_HND win = mfwParent(mfw_header());
396 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
397 T_MMI_CT_Win_data * data = (T_MMI_CT_Win_data *)win_data->user;
398
399 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()");
400 switch (k->code)
401 {
402
403 case KCD_LEFT:
404
405 TRACE_EVENT ("mmi_camera_test_kbd_cntrl() KCD_LEFT");
406 switch (camera_state)
407 {
408 case CAMERA_STATE_SNAPSHOT:
409 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-CAMERA_STATE_SNAPSHOT");
410 //call MFW function to save snapshot
411 camera_state = CAMERA_STATE_SAVE;
412 if(mfw_cam_save_snapshot() == MFW_CAM_FAILED)
413 {
414 //Display the error message
415 mmi_camera_test_show_info(win, TxtFailed, TxtNull, (T_VOID_FUNC)mmi_camera_dialog_cb);
416 break;
417 }
418 //Display the Saving Dialog box
419 digwin1 = mmi_camera_test_show_saving_info(win,(T_VOID_FUNC)mmi_camera_saving_info_cb);
420
421 break;
422
423 case CAMERA_STATE_VIEWFINDER:
424 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-CAMERA_STATE_VIEWFINDER");
425 if(data)
426 {
427 //Disable sensor and display the Options window.
428 mfw_cam_disable_sensor();
429 rvf_delay(40); //Since MMI is not waiting the callback of disable camera, a delay is given.
430 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
431 //replaced the flag with the function call, to migrate to the new Lcd APIs
432 dspl_control(DSPL_ACCESS_ENABLE);
433 camera_state = CAMERA_STATE_CONFIGURE;
434 mmi_camera_test_opt_start(data->win,(MfwMnuAttr*)&Mmi_camera_OPTAttrib);
435 }
436 break;
437
438 case CAMERA_STATE_SAVE:
439 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-CAMERA_STATE_SAVE");
440 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
441 mfw_cam_set_viewfinder_mode();
442 break;
443 }
444 break;
445 case KCD_MNUSELECT:
446 switch (camera_state)
447 {
448 case CAMERA_STATE_VIEWFINDER:
449 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-CAMERA_STATE_SNAPSHOT");
450 camera_state = CAMERA_STATE_SNAPSHOT;
451 //Take the Snapshot
452 mfw_cam_take_snapshot();
453 //Display the softkeys for Snapshot
454 mmi_camera_test_update_softkeys(TxtSoftSnapSave,TxtSoftBack);
455 rvf_delay(40);
456 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
457 //replaced the flag with the function call, to migrate to the new Lcd APIs
458 dspl_control(DSPL_ACCESS_DISABLE);
459 break;
460 }
461 break;
462 case KCD_RIGHT:
463 case KCD_HUP:
464 TRACE_EVENT ("mmi_camera_test_kbd_cntrl() Back");
465 switch (camera_state)
466 {
467 case CAMERA_STATE_SNAPSHOT:
468 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-mfw_cam_set_viewfinder_mode snapshot");
469 camera_state = CAMERA_STATE_VIEWFINDER;
470 //Goback to the Viewfinder Mode
471 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
472 rvf_delay(40);
473 mfw_cam_set_viewfinder_mode();
474 break;
475
476 case CAMERA_STATE_SAVE:
477 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-mfw_cam_set_viewfinder_mode save");
478 camera_state = CAMERA_STATE_VIEWFINDER;
479 //Goback to the Viewfinder Mode
480 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
481 mfw_cam_set_viewfinder_mode();
482 break;
483
484 case CAMERA_STATE_VIEWFINDER:
485 TRACE_EVENT ("mmi_camera_test_kbd_cntrl()-CAMERA_STATE_VIEWFINDER");
486 //Disable the Camera and goto the Application Menu
487 mfw_cam_disable_sensor();
488 rvf_delay(100);
489 camera_state = CAMERA_STATE_IDLE;
490 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
491 //replaced the flag with the function call, to migrate to the new Lcd APIs
492 dspl_control(DSPL_ACCESS_ENABLE);
493 if(data->win != NULL)
494 {
495 winDelete (data->win);
496 mfwFree((void *)data, sizeof (T_MMI_CT_Win_data));
497 }
498 break;
499
500 }
501 break;
502
503 default:
504
505 break;
506 }
507 return MFW_EVENT_CONSUMED;
508 }
509
510
511 /*******************************************************************************
512
513 $Function: mmi_camera_test_win_cb
514
515 $Description: This function is the windows callback function for the mmi camera Root window.
516 It has no display.
517
518 $Returns: MFW_EVENT_CONSUMED
519
520 $Arguments: event - window handle event
521 win - Camera window
522
523 *******************************************************************************/
524 int mmi_camera_test_win_cb (MfwEvt evt, MfwHnd win)
525 {
526 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
527 T_MMI_CT_Win_data *data = (T_MMI_CT_Win_data *)win_data->user;
528
529 TRACE_EVENT("mmi_camera_test_win_cb()");
530 switch (evt)
531 {
532 case MfwWinVisible: /* window is visible */
533
534 TRACE_EVENT("mmi_camera_test_win_cb()---MfwWinVisible");
535 if(camera_state == CAMERA_STATE_IDLE || camera_state == CAMERA_STATE_VIEWFINDER )
536 {
537
538 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
539 rvf_delay(40);
540 mfw_cam_launch_viewfinder_dma();
541 }
542 break;
543
544 // Post the SUSPEND event
545 case MfwWinSuspend: /* window is suspended */
546
547 TRACE_EVENT("mmi_camera_test_win_cb()-suspend");
548 break;
549
550 // Post the RESUME event
551 case MfwWinResume: /* window is resumed */
552 TRACE_EVENT("mmi_camera_test_win_cb()-resume");
553 camera_state = CAMERA_STATE_VIEWFINDER;
554 break;
555
556 case MfwWinFocussed: /* input focus / selected */
557 TRACE_EVENT("mmi_camera_test_win_cb()-MfwWinFocussed");
558 case MfwWinDelete: /* window will be deleted */
559 default:
560 return MFW_EVENT_REJECTED;
561 }
562 return MFW_EVENT_CONSUMED;
563 }
564
565
566
567 /*******************************************************************************
568
569 $Function: mmi_camera_test_win_create
570
571 $Description: This function performs the necessary steps to create the a window to handle the
572 viewfinder related softkeys and the viewfinder bitmaps. It will be removed,
573 or rather remove itself on returning the data to the Mfw.
574
575 $Returns: T_MFW_HND : Window Handle to the New Window, Null if failed.
576
577 $Arguments: parent : pointer to the parent window.
578
579 *******************************************************************************/
580 T_MFW_HND mmi_camera_test_win_create(T_MFW_HND parent)
581 {
582 T_MMI_CT_Win_data *data;
583 T_MFW_WIN * win;
584
585 TRACE_EVENT ("mmi_camera_test_win_create()");
586
587 data = (T_MMI_CT_Win_data *)mfwAlloc((U16)sizeof(T_MMI_CT_Win_data));
588
589 data->win = winCreate(parent, 0, E_WIN_VISIBLE|MfwWinSuspend|MfwWinResume, mmi_camera_test_win_cb);
590
591 if (data->win == NULL)
592 {
593 /*
594 ** Failed to start : Free Memory, and exit
595 */
596 mfwFree((U8 *)data, (U16)sizeof(T_MMI_CT_Win_data));
597 data = NULL;
598 return data;
599 }
600 else
601 {
602
603 /*
604 ** Setup the Dialog control functions
605 */
606 data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_camera_test_exec_cb;
607 data->mmi_control.data = data;
608 win = ((T_MFW_HDR *)data->win)->data;
609 win->user = (void *)data;
610 //initialize bitmap data
611 data->ct_bitmap.area.px = 0;
612 data->ct_bitmap.area.py = 0;
613 data->ct_bitmap.area.sx = 175;
614 data->ct_bitmap.area.sy = 220;
615 data->ct_bitmap.icnType = BMP_FORMAT_16BIT_LCD_COLOUR;
616 data->ct_bitmap.iconCol = COLOUR_ICON_XX;
617 scrDrawFilledRect ( data->ct_bitmap.area.px, data->ct_bitmap.area.py, data->ct_bitmap.area.sx, data->ct_bitmap.area.sy, dspl_GetBgdColour() );
618 //define softkeys
619 displaySoftKeys(TxtSoftOptions,TxtSoftBack);
620 dspl_Enable(1);
621 if(IsCamInit == FALSE)
622 {
623 TRACE_EVENT("Initialising Camil");
624 mfw_cam_init();
625 IsCamInit = TRUE;
626 }
627 }
628
629 return data->win;
630
631 }
632
633 /*******************************************************************************
634
635 $Function: mmi_camera_test_start
636
637 $Description: create a new camera dialog
638
639 $Returns: Dialogue info win
640
641 $Arguments: parent win, display info
642
643 *******************************************************************************/
644 T_MFW_HND mmi_camera_test_start (T_MFW_HND parent_win)
645 {
646 T_MFW_HND win;
647 TRACE_FUNCTION("mmi_camera_test_start()");
648
649 win = mmi_camera_test_win_create(parent_win);
650 if (win NEQ NULL)
651 {
652 SEND_EVENT (win, CT_INIT, NULL, NULL);
653 }
654
655 return win;
656 }
657
658 /*******************************************************************************
659
660 $Function: mmi_camera_test_launch_view_finder
661
662 $Description: Create the window which is going to have
663 the viewfinder bitmaps displayed on top of it.
664
665 $Returns: Always returns MFW_EVENT_CONSUMED (1)
666
667 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called.
668 i : pointer to the item data from the menu.
669
670 *******************************************************************************/
671 GLOBAL int mmi_camera_test_launch_view_finder (MfwMnu* m, MfwMnuItem* i)
672 {
673
674 T_MFW_HND win = mfw_parent(mfw_header());
675
676 TRACE_EVENT("mmi_camera_test_launch_view_finder()");
677 mmi_camera_test_start(win);
678
679 return MFW_EVENT_CONSUMED;
680 }
681
682
683 /*******************************************************************************
684
685 $Function: mmi_camera_test_opt_start
686
687 $Description: called when the user press the Option menu in Camera Window
688
689 $Returns: T_MFW_HND : Window Handle to the New Window, Null if failed.
690
691 $Arguments: parent_window -parent window handle
692 menuAttr - Menu attributes.
693
694 *******************************************************************************/
695
696 T_MFW_HND mmi_camera_test_opt_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
697 {
698 T_MFW_HND win;
699
700 TRACE_FUNCTION ("mmi_camera_test_opt_start()");
701
702 optwin = (T_MFW_HND)mmi_camera_test_opt_create (parent_window);
703
704 if (optwin NEQ NULL)
705 {
706 SEND_EVENT (optwin, CT_INIT, NULL, (void *)menuAttr);
707 }
708 return win;
709 }
710
711 /*******************************************************************************
712
713 $Function: mmi_camera_test_opt_win_create
714
715 $Description: This function performs the necessary steps to create the a window .
716
717 $Returns: T_MFW_HND : Window Handle to the New Window, Null if failed.
718
719 $Arguments: parent : pointer to the parent window.
720
721 *******************************************************************************/
722 T_MFW_HND mmi_camera_test_opt_create(T_MFW_HND parent)
723 {
724 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)ALLOC_MEMORY (sizeof (T_MMI_CT_Opt_data));
725 T_MFW_WIN * win;
726
727 TRACE_FUNCTION ("mmi_camera_test_opt_create()");
728
729 /*
730 * Create window handler
731 */
732
733 data->win =
734 win_create (parent, 0, E_WIN_VISIBLE, (T_MFW_CB)mmi_camera_test_opt_win_cb);
735 if (data->win EQ NULL)
736 {
737 return NULL;
738 }
739 /*
740 * connect the dialog data to the MFW-window
741 */
742
743 data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_camera_test_opt_exec_cb;
744 data->mmi_control.data = data;
745 win = ((T_MFW_HDR *)data->win)->data;
746 win->user = (void *)data;
747 data->parent = parent;
748
749 /*
750 * return window handle
751 */
752
753 return data->win;
754 }
755
756 /*******************************************************************************
757
758 $Function: mmi_camera_test_opt_win_cb
759
760 $Description: This function is the windows callback function for the mmi camera option window.
761
762 $Returns: MFW_EVENT_CONSUMED
763
764 $Arguments: event - window handle event
765 win - Camera window
766
767 *******************************************************************************/
768 int mmi_camera_test_opt_win_cb (MfwEvt evt, MfwHnd win)
769 {
770 TRACE_EVENT("mmi_camera_test_opt_win_cb()");
771 switch (evt)
772 {
773 case MfwWinVisible: /* window is visible */
774 displaySoftKeys(TxtSoftSelect,TxtSoftBack);
775 break;
776 case MfwWinFocussed: /* input focus / selected */
777 case MfwWinDelete: /* window will be deleted */
778 default:
779 return MFW_EVENT_REJECTED;
780 }
781 return MFW_EVENT_CONSUMED;
782
783 }
784
785 /*******************************************************************************
786
787 $Function: mmi_camera_test_opt_exec_cb
788
789 $Description: This is the dialog control function for the Camera Option Window. It
790 receives the signals from the MFW and determines what action, if any, to take.
791
792 $Returns: None
793
794 $Arguments: win : The pointer to the window handler, so the function can reference the
795 dynamic user data, if any.
796 event : The incoming event
797 value : Generic incoming Parameter, it will be 'event' dependant
798 parameter : Generic incoming Parameter, it will be 'event' dependant
799
800 *******************************************************************************/
801 void mmi_camera_test_opt_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
802 {
803 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
804 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)win_data->user;
805 TRACE_FUNCTION ("mmi_camera_test_opt_exec_cb()");
806 switch (event)
807 {
808 case CT_INIT:
809 TRACE_EVENT(">> mmi_camera_test_opt_exec_cb(), CT_INIT ");
810 /* initialization of administrative data */
811 data->id = value;
812
813 data->kbd = kbdCreate(data->win,KEY_ALL, (MfwCb)mmi_camera_test_opt_kbd_cb);
814 data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)mmi_camera_test_opt_kbd_cb);
815 data->menu = mnuCreate(data->win,(MfwMnuAttr *)&Mmi_camera_OPTAttrib, E_MNU_ESCAPE, (MfwCb)mmi_camera_test_opt_mnu_cb);
816 mnuLang(data->menu,mainMmiLng);
817
818 /* put the (new) dialog window on top of the window stack */
819 mnuUnhide(data->menu);
820 winShow(data->win);
821 break;
822
823 case CT_RETURN:
824 TRACE_EVENT(">> mmi_camera_test_opt_exec_cb(), CT_RETURN ");
825 mmi_camera_test_opt_destroy(optwin);
826 mmi_camera_test_update_softkeys(TxtSoftOptions,TxtSoftBack);
827 mfw_cam_launch_viewfinder_dma();
828 break;
829
830 default:
831 return;
832 }
833 }
834
835 /*******************************************************************************
836
837 $Function: mmi_camera_test_opt_kbd_cb
838
839 $Description: Keyboard event handler for camera Option window
840
841 $Returns: execution status
842
843 $Arguments: e - event id
844 k - keyboard info
845 *******************************************************************************/
846
847 static int mmi_camera_test_opt_kbd_cb (MfwEvt e, MfwKbd *k)
848 {
849 T_MFW_HND win = mfwParent(mfw_header());
850 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
851 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)win_data->user;
852
853 TRACE_FUNCTION ("mmi_camera_test_opt_kbd_cb()");
854
855 if (e & KEY_LONG)
856 {
857 switch (k->code)
858 {
859 case KCD_HUP: /* back to previous menu */
860 mnuEscape(data->menu);
861 break;
862 case KCD_RIGHT: /* Power Down */
863 return MFW_EVENT_REJECTED; /* handled by idle */
864 default: /* no response to all other keys */
865 return MFW_EVENT_CONSUMED;
866 }
867 }
868 else
869 {
870 switch (k->code)
871 {
872 case KCD_MNUUP: /* highlight previous entry */
873 mnuUp(data->menu);
874 break;
875 case KCD_MNUDOWN: /* highlight next entry */
876 mnuDown(data->menu);
877 break;
878 case KCD_MNUSELECT:
879 case KCD_LEFT: /* activate this entry */
880 mnuSelect(data->menu);
881 break;
882 case KCD_HUP: /* back to previous menu */
883 case KCD_RIGHT: /* back to previous menu */
884 mnuEscape(data->menu);
885 break;
886 default: /* no response to all other keys */
887 return MFW_EVENT_CONSUMED;
888 }
889 }
890 return MFW_EVENT_CONSUMED;
891 }
892
893 /*******************************************************************************
894
895 $Function: mmi_camera_test_opt_mnu_cb
896
897 $Description: Menu callback function for the Option window
898
899 $Returns: Execution status
900
901 $Arguments: e - event id
902 m - menu handle
903 *******************************************************************************/
904
905 static int mmi_camera_test_opt_mnu_cb (MfwEvt e, MfwMnu *m)
906 {
907 T_MFW_HND win = mfwParent(mfw_header());
908 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
909 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)win_data->user;
910
911 TRACE_FUNCTION ("mmi_camera_test_opt_mnu_cb()");
912
913 switch (e)
914 {
915 case E_MNU_ESCAPE: /* back to previous menu */
916 TRACE_EVENT("E_MNU_ESCAPE");
917 SEND_EVENT (optwin, CT_RETURN, data->id, NULL);
918 camera_state = CAMERA_STATE_VIEWFINDER;
919 break;
920 default: /* in mnuCreate() only E_MNU_ESCAPE has been enabled! */
921 return MFW_EVENT_REJECTED;
922 }
923 return MFW_EVENT_CONSUMED;
924 }
925
926 /*******************************************************************************
927
928 $Function: mmi_camera_test_opt_destroy
929
930 $Description: Destroy the Camera Option window
931
932 $Returns: mfw window handle
933
934 $Arguments: own_window - current window
935
936 *******************************************************************************/
937
938 static void mmi_camera_test_opt_destroy(MfwHnd own_window)
939 {
940 T_MFW_WIN * win_data;
941 T_MMI_CT_Opt_data * data;
942
943 TRACE_FUNCTION ("mmi_camera_test_opt_destroy()");
944
945 if (own_window)
946 {
947 win_data = ((T_MFW_HDR *)own_window)->data;
948 data = (T_MMI_CT_Opt_data *)win_data->user;
949
950 if (data)
951 {
952
953 /*
954 ** Failed to start : Free Memory, and exit
955 */
956
957 if(data->kbd != NULL)
958 {
959 kbdDelete (data->kbd);
960 }
961
962 if(data->kbd_long!= NULL)
963 {
964 kbdDelete (data->kbd_long);
965 }
966
967 if(data->menu!= NULL)
968 {
969 mnuDelete(data->menu);
970 }
971
972 // Delete WIN handler
973
974 win_delete (data->win);
975
976 // Free Memory
977
978 FREE_MEMORY ((void *)data, sizeof (T_MMI_CT_Opt_data));
979 }
980 else
981 {
982 TRACE_EVENT ("mmi_camera_test_opt_destroy() called twice");
983 }
984 }
985 }
986
987 /*******************************************************************************
988
989 $Function: mmi_camera_test_set_quality
990
991 $Description: Set the Quality factor for the image to be saved.
992
993 $Returns: Always returns MFW_EVENT_CONSUMED (1)
994
995 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called.
996 i : pointer to the item data from the menu.
997
998 *******************************************************************************/
999 GLOBAL int mmi_camera_test_set_quality (MfwMnu* m, MfwMnuItem* i)
1000 {
1001 int txtId = TxtStandard;
1002 UBYTE qfactor;
1003 TRACE_FUNCTION ("mmi_camera_test_set_quality()");
1004 switch (m->lCursor[m->level])
1005 {
1006 case 0:
1007 txtId = TxtEconomy;
1008 qfactor = QUALITY_ECONOMY;
1009
1010 break;
1011 case 1:
1012 txtId = TxtStandard;
1013 qfactor = QUALITY_STANDARD;
1014 break;
1015 case 2:
1016 txtId = TxtHigh;
1017 qfactor = QUALITY_HIGH;
1018 break;
1019
1020 default:
1021 txtId = TxtStandard;
1022 qfactor = QUALITY_STANDARD;
1023 break;
1024
1025 }
1026 //Set the Quality Factor.
1027 mfw_cam_set_quality_factor(qfactor);
1028 //Display the dialgbox to the user.
1029 mmi_camera_test_show_info(0, txtId,TxtNull,NULL);
1030 return MFW_EVENT_CONSUMED;
1031 }
1032
1033 /*******************************************************************************
1034
1035 $Function: mmi_camera_test_set_color
1036
1037 $Description: Set the Color for the Viewfinder
1038
1039 $Returns: Always returns MFW_EVENT_CONSUMED (1)
1040
1041 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called.
1042 i : pointer to the item data from the menu.
1043
1044 *******************************************************************************/
1045 GLOBAL int mmi_camera_test_set_color (MfwMnu* m, MfwMnuItem* i)
1046 {
1047 int txtId;
1048 UBYTE blackandwhite;
1049 TRACE_FUNCTION ("mmi_camera_test_set_color()");
1050 switch (m->lCursor[m->level])
1051 {
1052 case 0:
1053 txtId = TxtColor;
1054 blackandwhite = FALSE;
1055 break;
1056 case 1:
1057 txtId = TxtSepia;
1058 blackandwhite = FALSE;
1059 break;
1060 case 2:
1061 txtId = TxtBlackandWhite;
1062 blackandwhite = TRUE;
1063 break;
1064 case 3:
1065 txtId = TxtNegative;
1066 blackandwhite = FALSE;
1067 break;
1068
1069 }
1070 mfw_cam_set_viewfinder_param_color(blackandwhite);
1071 mmi_camera_test_show_info(0, txtId,TxtNull,NULL);
1072 return MFW_EVENT_CONSUMED;
1073 }
1074
1075
1076 /*******************************************************************************
1077
1078 $Function: M_exeQuality
1079
1080 $Description: This function is called when the user press "Quality" in the
1081 Camera Options screen.This function creates and displays the
1082 Quality menu in the option screen.
1083
1084 $Returns: Execution status
1085
1086 $Arguments: m - menu handler
1087 i - Menu item selected
1088
1089 *******************************************************************************/
1090
1091 int M_exeQuality(MfwMnu* m, MfwMnuItem* i)
1092 {
1093
1094 T_MFW_HND win = mfwParent(mfw_header());
1095 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1096 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)win_data->user;
1097 TRACE_FUNCTION("M_exeQuality");
1098
1099 bookMenuStart(data->win, qualityMenuAttributes(),0);
1100 return MFW_EVENT_CONSUMED;
1101
1102 }
1103
1104 /*******************************************************************************
1105
1106 $Function: M_exeColor
1107
1108 $Description: This function is called when the user press "Color" in the
1109 Camera Options screen.This function creates and displays the
1110 Color menu in the option screen.
1111
1112 $Returns: Execution status
1113
1114 $Arguments: m - menu handler
1115 i - Menu item selected
1116
1117 *******************************************************************************/
1118
1119 int M_exeColor(MfwMnu* m, MfwMnuItem* i)
1120 {
1121 T_MFW_HND win = mfwParent(mfw_header());
1122 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1123 T_MMI_CT_Opt_data * data = (T_MMI_CT_Opt_data *)win_data->user;
1124 TRACE_FUNCTION("M_exeColor");
1125
1126 bookMenuStart(data->win, colorMenuAttributes(),0);
1127 return MFW_EVENT_CONSUMED;
1128 }
1129
1130 /*******************************************************************************
1131
1132 $Function: M_exeZoom
1133
1134 $Description: This function is called when the user press "Zoom" in the
1135 Camera Options screen.This function creates and displays the
1136 Zoom menu in the option screen.
1137
1138 $Returns: Execution status
1139
1140 $Arguments: m - menu handler
1141 i - Menu item selected
1142
1143 *******************************************************************************/
1144
1145 int M_exeZoom(MfwMnu* m, MfwMnuItem* i)
1146 {
1147 int txtId = TxtDigiZoom;
1148 TRACE_FUNCTION("M_exeZoom");
1149 mfw_cam_set_viewfinder_param_zoom(TRUE);
1150 mmi_camera_test_show_info(0, txtId,TxtNull,NULL);
1151 return MFW_EVENT_CONSUMED;
1152 }
1153
1154 /*******************************************************************************
1155
1156 $Function: mmi_filename_editor_cb
1157
1158 $Description: This function provides the callback functionality to the editor to rename the
1159 default jpeg filename.
1160
1161 $Returns: None
1162
1163 $Arguments:
1164
1165 *******************************************************************************/
1166 static void mmi_filename_editor_cb(T_MFW_HND win, USHORT identifier, SHORT reason)
1167 {
1168 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1169 T_CT_Editor_Data* dev_name_data = (T_CT_Editor_Data *)win_data->user;
1170 UBYTE * editor_buffer = NULL;
1171 SHORT max_edit_size = 0;
1172 T_MFW_HND editor_win;
1173 T_MFW_HND parent;
1174
1175 TRACE_FUNCTION ("mmi_filename_editor_cb()");
1176
1177 editor_buffer = dev_name_data->ct_buffer;
1178 max_edit_size =CT_FILENAME_EDITOR_INPUT_LEN;
1179 editor_win = dev_name_data->ct_win_editor;
1180 parent = dev_name_data->win;
1181
1182 switch (reason)
1183 {
1184 case INFO_KCD_LEFT:
1185 {
1186 /*
1187 ** If there is no string entered, treat this as if it was a "Cancel"
1188 */
1189 if (editor_buffer[0] == NULL)
1190 {
1191 /*
1192 ** Send a "Cancel" to the window
1193 */
1194 SEND_EVENT(parent, CT_EDITOR_CANCEL, identifier, NULL);
1195 }
1196 else
1197 {
1198 //If the file extn is not jpg, send cancel event
1199 /*
1200 ** Send a "Select" to the window
1201 */
1202 SEND_EVENT(parent, CT_EDITOR_SELECT, identifier, NULL);
1203 }
1204 }
1205 break;
1206
1207 case INFO_KCD_RIGHT:
1208 if (strlen((char *)editor_buffer) == NULL)
1209 {
1210
1211 /*
1212 ** Send a "Cancel" to the window
1213 */
1214 SEND_EVENT(parent, CT_EDITOR_CANCEL, identifier, NULL);
1215 }
1216 break;
1217
1218 case INFO_KCD_HUP:
1219 /*
1220 ** Set the buffer to NULLS
1221 */
1222 memset(editor_buffer, 0x00, max_edit_size);
1223
1224 /*
1225 ** Send a "Cancel" to the window
1226 */
1227 SEND_EVENT(parent, CT_EDITOR_CANCEL, identifier, NULL);
1228 break;
1229
1230 default:
1231 /* otherwise no action to be performed
1232 */
1233 break;
1234 }
1235 }
1236
1237
1238 /*******************************************************************************
1239
1240 $Function: mmi_camera_test_update_softkeys
1241
1242 $Description: This function updates only the softkeys region.
1243
1244 $Returns: None
1245
1246 $Arguments: None
1247
1248 *******************************************************************************/
1249 void mmi_camera_test_update_softkeys (int lsk, int rsk)
1250 {
1251 TRACE_EVENT("mmi_camera_test_update_softkeys");
1252 dspl_SetBgdColour(COL_White);
1253 dspl_ClearAll();
1254 displaySoftKeys(lsk,rsk);
1255 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
1256 //replaced the flag with the function call, to migrate to the new Lcd APIs
1257 dspl_control(DSPL_ACCESS_ENABLE);
1258 dspl_Enable(1);
1259 }
1260
1261 /*******************************************************************************
1262
1263 $Function: mmi_camera_editor_destroy
1264
1265 $Description: Destroy the filename editor window
1266
1267 $Returns: mfw window handle
1268
1269 $Arguments: own_window - current window
1270
1271 *******************************************************************************/
1272 MfwRes mmi_camera_editor_destroy(T_MFW_HND win)
1273 {
1274 T_MFW_WIN * win_data;
1275 T_CT_Editor_Data * data;
1276
1277 TRACE_FUNCTION ("mmi_camera_editor_destroy");
1278 if (win == NULL)
1279 return MfwResIllHnd;
1280
1281 win_data = ((T_MFW_HDR *) win)->data;
1282 data = (T_CT_Editor_Data *)win_data->user;
1283
1284 /*
1285 ** Destroy the Window
1286 */
1287 win_delete(data->win);
1288
1289 /*
1290 ** Free the dynamically allocated memory
1291 */
1292 mfwFree((U8 *)data, (U16)sizeof(T_CT_Editor_Data));
1293
1294 return MfwResOk;
1295 }
1296
1297 /*******************************************************************************
1298
1299 $Function: mmi_camera_editor_cntrl
1300
1301 $Description: Exec callback function for the edit filename window
1302
1303 $Returns: none
1304
1305 $Arguments: win - current window
1306 event - event id
1307 value - unique id
1308 parameter - optional data.
1309
1310 *******************************************************************************/
1311 void mmi_camera_editor_cntrl (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
1312 {
1313 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1314 T_CT_Editor_Data * data = (T_CT_Editor_Data *)win_data->user;
1315 T_AUI_EDITOR_DATA editor_data;
1316
1317 TRACE_FUNCTION ("mmi_camera_editor_cntrl");
1318
1319 switch (event)
1320 {
1321 case CT_INIT:
1322 #ifdef NEW_EDITOR
1323 //Clear the editor buffer
1324 memset(&editor_data,'\0',sizeof(editor_data));
1325 // copy the default name in the editor buffer
1326 strcpy((char *)data->ct_buffer,CT_DEFAULT_FILENAME);
1327
1328 /*
1329 ** Initialise the editor
1330 */
1331 AUI_edit_SetDefault(&editor_data);
1332 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->ct_buffer, CT_FILE_NAME_LENGTH);
1333 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtFilename, NULL);
1334 AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack);
1335 AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_filename_editor_cb);
1336 data->ct_win_editor = AUI_edit_Start(data->win, &editor_data);
1337 #endif
1338 break;
1339
1340 case CT_EDITOR_CANCEL:
1341 /*
1342 ** The editor will be destroyed. Reset the Window handler
1343 */
1344 data->ct_win_editor = NULL;
1345
1346 /*
1347 ** Destroy the editor Window
1348 */
1349 TRACE_FUNCTION ("mmi_camera_editor_cntrl CT_EDITOR_CANCEL");
1350 mmi_camera_editor_destroy(data->win);
1351 SEND_EVENT (optwin, CT_RETURN, NULL, NULL);
1352 camera_state = CAMERA_STATE_VIEWFINDER;
1353 break;
1354
1355 case CT_EDITOR_SELECT:
1356 //copy the file name from the editor
1357 strcpy(new_filename,(char *)data->ct_buffer);
1358 mmi_camera_editor_destroy(data->win);
1359 SEND_EVENT (optwin, CT_RETURN, NULL, NULL);
1360 camera_state = CAMERA_STATE_VIEWFINDER;
1361 break;
1362
1363 default:
1364 TRACE_FUNCTION ("mmi_camera_editor_cntrl(), Unexpected Event!");
1365 break;
1366 }
1367
1368
1369 }
1370
1371 /*******************************************************************************
1372
1373 $Function: mmi_camera_edit_filename
1374
1375 $Description: This function is called when the user press Filename in the option menu .
1376
1377 $Returns: Execution status
1378
1379 $Arguments: m - menu handler
1380 i - Menu item selected
1381
1382 *******************************************************************************/
1383 GLOBAL int mmi_camera_edit_filename(MfwMnu* m, MfwMnuItem* i)
1384 {
1385 T_MFW_HND win = mfw_parent(mfw_header());
1386 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
1387 T_CT_Editor_Data * data = (T_CT_Editor_Data *)(win_data->user);
1388
1389 TRACE_FUNCTION ("mmi_camera_edit_filename()");
1390
1391 data->ct_win_editor = (MfwHnd)mmi_camera_editor_create(win);
1392
1393 if (data->ct_win_editor != NULL)
1394 {
1395 SEND_EVENT(data->ct_win_editor, CT_INIT, 0, NULL);
1396 }
1397 else
1398 {
1399 TRACE_FUNCTION ("mmi_camera_edit_filename() : Unable to create Editor Win!");
1400 }
1401 return MFW_EVENT_CONSUMED;
1402 }
1403
1404 /*******************************************************************************
1405
1406 $Function: mmi_camera_editor_create
1407
1408 $Description: Create a window for editing the image file name to be saved.
1409
1410 $Returns: window handle
1411
1412 $Arguments: parent - parent window.
1413
1414 *******************************************************************************/
1415
1416
1417 T_MFW_HND mmi_camera_editor_create(T_MFW_HND parent)
1418 {
1419 T_CT_Editor_Data *data;
1420 T_MFW_WIN * win;
1421
1422 TRACE_FUNCTION ("mmi_camera_editor_create");
1423
1424 data = (T_CT_Editor_Data *)mfwAlloc((U16)sizeof(T_CT_Editor_Data));
1425
1426 if (data == NULL)
1427 return data;
1428
1429 data->win = winCreate(parent, 0, E_WIN_VISIBLE, NULL);
1430
1431 if (data->win == NULL)
1432 {
1433 /*
1434 ** Failed to start : Free Memory, and exit
1435 */
1436 mfwFree((U8 *)data, (U16)sizeof(T_CT_Editor_Data));
1437 data = NULL;
1438 return data;
1439 }
1440 else
1441 {
1442 /*
1443 ** Setup the Dialog control functions
1444 */
1445 data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_camera_editor_cntrl;
1446 data->mmi_control.data = data;
1447
1448 win = ((T_MFW_HDR *)data->win)->data;
1449 win->user = (void *)data;
1450 }
1451
1452 return data->win;
1453
1454 }
1455
1456 /*******************************************************************************
1457
1458 $Function: display_saved_image
1459
1460 $Description: Displays the Dialog to show the status of save image
1461
1462 $Returns: None
1463
1464 $Arguments: res - Status of Save Image
1465
1466 *******************************************************************************/
1467
1468 void display_saved_image(BOOL res)
1469 {
1470
1471 if(call_data.win)
1472 {
1473 dialog_info_destroy(digwin1);
1474 digwin1 = NULL;
1475 return;
1476 }
1477 //Sept 15, 2005 REF: LOCOSTO-ENH-34257 - xpradipg
1478 //replaced the flag with the function call, to migrate to the new Lcd APIs
1479 dspl_control(DSPL_ACCESS_ENABLE);
1480 dspl_Clear(0,0,SCREEN_SIZE_X-1,SCREEN_SIZE_Y-1 );
1481 if( res)
1482 mmi_camera_test_show_info(digwin1, TxtSaved, TxtNull,(T_VOID_FUNC) mmi_camera_dialog_cb);
1483 else
1484 mmi_camera_test_show_info(digwin1, TxtFailed, TxtNull,(T_VOID_FUNC) mmi_camera_dialog_cb);
1485 }
1486
1487