FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/AUIEditor.c @ 135:70ea7526b59e
bmi/AUI*.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Nov 2020 03:18:11 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
134:62480f597962 | 135:70ea7526b59e |
---|---|
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
14 $Module: MMI | 14 $Module: MMI |
15 $File: AUIEditor.c | 15 $File: AUIEditor.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 22/02/01 | 19 $Date: 22/02/01 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 Generic MMI Editor. | 24 Generic MMI Editor. |
25 | 25 |
26 ******************************************************************************** | 26 ******************************************************************************** |
27 | 27 |
28 $History: AUIEditor.c | 28 $History: AUIEditor.c |
29 | 29 |
33 Solution: CB messages and New SMS or Message Full indications are displayed | 33 Solution: CB messages and New SMS or Message Full indications are displayed |
34 in two different zones on the Idle screen. | 34 in two different zones on the Idle screen. |
35 Changes: Added new display zone which is located one line above | 35 Changes: Added new display zone which is located one line above |
36 the softkeys. | 36 the softkeys. |
37 | 37 |
38 Mar 14, 2006 DR: OMAPS00061468 - x0035544. | 38 Mar 14, 2006 DR: OMAPS00061468 - x0035544. |
39 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails | 39 Description: SAT 27.22.4.22.2 SET UP IDLE MODE TEXT (Icon support) fails |
40 Solution : In the function AUI_edit_SetDefault() set the default value for | 40 Solution : In the function AUI_edit_SetDefault() set the default value for |
41 display_type to SAT_ICON_NONE. | 41 display_type to SAT_ICON_NONE. |
42 | 42 |
43 Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S. | 43 Jan 16, 2006 DR: OMAPS00061460 - Shashi Shekar B.S. |
44 Description: SAT Icon support | 44 Description: SAT Icon support |
45 Solution : SAT icon support added. | 45 Solution : SAT icon support added. |
46 | 46 |
47 Dec-20-2004 MMI-SPR-27382 xreddymn | 47 Dec-20-2004 MMI-SPR-27382 xreddymn |
48 Added NULL window handle check for AUI_edit_Destroy | 48 Added NULL window handle check for AUI_edit_Destroy |
49 | 49 |
50 Sep 2, 2004 REF: CRR 21370 xkundadu | 50 Sep 2, 2004 REF: CRR 21370 xkundadu |
51 Description: Giving wrong expected result by long press on "#" key | 51 Description: Giving wrong expected result by long press on "#" key |
52 Fix: When user presses long on '#' key it will display 'p'. | 52 Fix: When user presses long on '#' key it will display 'p'. |
53 Changed the long press of '*' key to display 'w'. | 53 Changed the long press of '*' key to display 'w'. |
54 | 54 |
55 Jul 22,2004 CRR:21605 xrashmic - SASKEN | 55 Jul 22,2004 CRR:21605 xrashmic - SASKEN |
56 Description: After deleting all the characters in the editor the case does not change to | 56 Description: After deleting all the characters in the editor the case does not change to |
57 sentence case. | 57 sentence case. |
58 Fix: After deleting a character, check if editor is empty and then set the case to | 58 Fix: After deleting a character, check if editor is empty and then set the case to |
59 sentence case only if the user has not modified the case. | 59 sentence case only if the user has not modified the case. |
60 | 60 |
61 | 61 |
62 Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN | 62 Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN |
63 Description: By Long press on Left/Right key at 'Message Editor' screen, | 63 Description: By Long press on Left/Right key at 'Message Editor' screen, |
64 cursor not scrolling continuously | 64 cursor not scrolling continuously |
65 Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. | 65 Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. |
66 The continuous long press of a key was being ignored for all keys. Now | 66 The continuous long press of a key was being ignored for all keys. Now |
67 only for left and right keys this is handled, for rest of the keys the continuos | 67 only for left and right keys this is handled, for rest of the keys the continuos |
68 long press is ignored. | 68 long press is ignored. |
69 | 69 |
70 | 70 |
71 31/01/02 Original Condat(UK) BMI version. | 71 31/01/02 Original Condat(UK) BMI version. |
72 | 72 |
73 $End | 73 $End |
74 | 74 |
75 *******************************************************************************/ | 75 *******************************************************************************/ |
76 | 76 |
160 #ifdef NEPTUNE_BOARD | 160 #ifdef NEPTUNE_BOARD |
161 #include "audio.h" | 161 #include "audio.h" |
162 #endif | 162 #endif |
163 | 163 |
164 | 164 |
165 | |
166 #ifndef MFW_EVENT_PASSED | 165 #ifndef MFW_EVENT_PASSED |
167 #define MFW_EVENT_PASSED 0 | 166 #define MFW_EVENT_PASSED 0 |
168 #endif | 167 #endif |
169 | 168 |
170 #define TRACE_AUIEditor // Def/undef this to show/hide the trace_events for this file | 169 #define TRACE_AUIEditor // Def/undef this to show/hide the trace_events for this file |
171 | 170 |
172 static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data); | 171 static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data); |
173 | 172 |
174 /* API - 08/07/03 - CQ10728*/ | 173 /* API - 08/07/03 - CQ10728*/ |
175 static void AUI_Edit_Display_Only_CB(T_MFW_HND win, USHORT Identifier, SHORT reason); | 174 static void AUI_Edit_Display_Only_CB(T_MFW_HND win, USHORT Identifier, SHORT reason); |
201 #define ED_IND_NONE "---" | 200 #define ED_IND_NONE "---" |
202 | 201 |
203 | 202 |
204 /******************************************************************************* | 203 /******************************************************************************* |
205 | 204 |
206 $Function: AUI_edit_Start | 205 $Function: AUI_edit_Start |
207 | 206 |
208 $Description: Start the editor. | 207 $Description: Start the editor. |
209 | 208 |
210 $Returns: None. | 209 $Returns: None. |
211 | 210 |
212 $Arguments: None. | 211 $Arguments: None. |
213 | 212 |
214 *******************************************************************************/ | 213 *******************************************************************************/ |
215 | 214 |
216 T_MFW_HND AUI_edit_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) | 215 T_MFW_HND AUI_edit_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) |
217 { | 216 { |
225 } | 224 } |
226 | 225 |
227 | 226 |
228 /******************************************************************************* | 227 /******************************************************************************* |
229 | 228 |
230 $Function: AUI_edit_QuickStart | 229 $Function: AUI_edit_QuickStart |
231 | 230 |
232 $Description: Start the editor. | 231 $Description: Start the editor. |
233 | 232 |
234 $Returns: Dialog handler for the editor. | 233 $Returns: Dialog handler for the editor. |
235 | 234 |
236 $Arguments: win - the parent window | 235 $Arguments: win - the parent window |
237 TitleId - the text id of the title (or NULL) | 236 TitleId - the text id of the title (or NULL) |
238 TitleString - the text string of the title (or NULL) | 237 TitleString - the text string of the title (or NULL) |
239 buffer - the unicode input buffer | 238 buffer - the unicode input buffer |
240 len - maximum length of the text entered | 239 len - maximum length of the text entered |
241 editor_info - the T_AUI_EDITOR_DATA structure (allocated but empty) | 240 editor_info - the T_AUI_EDITOR_DATA structure (allocated but empty) |
242 | 241 |
243 *******************************************************************************/ | 242 *******************************************************************************/ |
244 | 243 |
245 T_MFW_HND AUI_edit_QuickStart(T_MFW_HND win, USHORT TitleId, UBYTE *TitleString, USHORT *buffer, USHORT len, | 244 T_MFW_HND AUI_edit_QuickStart(T_MFW_HND win, USHORT TitleId, UBYTE *TitleString, USHORT *buffer, USHORT len, |
246 T_AUI_EDITOR_DATA *editor_info, T_AUI_EDIT_CB editor_cb) | 245 T_AUI_EDITOR_DATA *editor_info, T_AUI_EDIT_CB editor_cb) |
247 { | 246 { |
248 | 247 |
249 TRACE_FUNCTION ("AUI_edit_QuickStart()"); | 248 TRACE_FUNCTION ("AUI_edit_QuickStart()"); |
250 | 249 |
251 AUI_edit_SetDisplay(editor_info, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); | 250 AUI_edit_SetDisplay(editor_info, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); |
252 AUI_edit_SetEvents(editor_info, 0, TRUE, FOREVER, editor_cb); | 251 AUI_edit_SetEvents(editor_info, 0, TRUE, FOREVER, editor_cb); |
253 AUI_edit_SetBuffer(editor_info, ATB_DCS_UNICODE, (UBYTE *)buffer, len); | 252 AUI_edit_SetBuffer(editor_info, ATB_DCS_UNICODE, (UBYTE *)buffer, len); |
254 AUI_edit_SetTextStr(editor_info, TxtSoftOK, TxtDelete, TitleId, TitleString); | 253 AUI_edit_SetTextStr(editor_info, TxtSoftOK, TxtDelete, TitleId, TitleString); |
255 AUI_edit_SetAltTextStr(editor_info, 0, NULL, TRUE, TxtSoftBack); | 254 AUI_edit_SetAltTextStr(editor_info, 0, NULL, TRUE, TxtSoftBack); |
256 /* create the dialog handler */ | 255 /* create the dialog handler */ |
257 return AUI_edit_Start(win, editor_info); /* start the common editor */ | 256 return AUI_edit_Start(win, editor_info); /* start the common editor */ |
258 } | 257 } |
259 | 258 |
260 | 259 |
261 /******************************************************************************* | 260 /******************************************************************************* |
262 | 261 |
263 $Function: AUI_edit_Create | 262 $Function: AUI_edit_Create |
264 | 263 |
265 $Description: Create the editor. | 264 $Description: Create the editor. |
266 | 265 |
267 $Returns: Pointer to the editor's window. | 266 $Returns: Pointer to the editor's window. |
268 | 267 |
269 $Arguments: parent - The parent window. | 268 $Arguments: parent - The parent window. |
270 | 269 |
271 *******************************************************************************/ | 270 *******************************************************************************/ |
272 | 271 |
273 static T_MFW_HND AUI_edit_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) | 272 static T_MFW_HND AUI_edit_Create(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data) |
274 { | 273 { |
275 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_INFO)); | 274 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_INFO)); |
276 T_MFW_WIN *win_data; | 275 T_MFW_WIN *win_data; |
277 | 276 |
278 TRACE_FUNCTION ("AUI_edit_Create()"); | 277 TRACE_FUNCTION ("AUI_edit_Create()"); |
279 | 278 |
280 /* Create window handler */ | 279 /* Create window handler */ |
281 | 280 |
282 data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_edit_WinCb); // Create window | 281 data->win = win_create(parent, 0, E_WIN_VISIBLE, (T_MFW_CB)AUI_edit_WinCb); // Create window |
283 | 282 |
284 if (data->win==NULL) // Make sure window exists | 283 if (data->win==NULL) // Make sure window exists |
285 { | 284 { |
286 return NULL; | 285 return NULL; |
287 } | 286 } |
288 | 287 |
289 /* Connect the dialog data to the MFW-window */ | 288 /* Connect the dialog data to the MFW-window */ |
290 | 289 |
291 data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_edit_ExecCb; /* Setup the destination for events */ | 290 data->mmi_control.dialog = (T_DIALOG_FUNC)AUI_edit_ExecCb; /* Setup the destination for events */ |
292 data->mmi_control.data = data; | 291 data->mmi_control.data = data; |
293 data->parent = parent; | 292 data->parent = parent; |
294 win_data = ((T_MFW_HDR *)data->win)->data; | 293 win_data = ((T_MFW_HDR *)data->win)->data; |
295 win_data->user = (void *)data; | 294 win_data->user = (void *)data; |
296 | 295 |
297 data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_edit_KbdCb); | 296 data->kbd = kbd_create(data->win, KEY_ALL,(T_MFW_CB)AUI_edit_KbdCb); |
298 data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_edit_KbdLongCb); | 297 data->kbd_long = kbd_create(data->win, KEY_ALL|KEY_LONG,(T_MFW_CB)AUI_edit_KbdLongCb); |
299 data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); | 298 data->editor = ATB_edit_Create(&data->editor_data.editor_attr,0); |
300 | 299 |
301 data->editor_data = *editor_data; | 300 data->editor_data = *editor_data; |
302 | 301 |
303 // Jul 22,2004 CRR:21605 xrashmic - SASKEN | 302 // Jul 22,2004 CRR:21605 xrashmic - SASKEN |
304 // The initial value of this variable should be false. i.e the user has still not changed the case. | 303 // The initial value of this variable should be false. i.e the user has still not changed the case. |
305 CaseChanged=FALSE; | 304 CaseChanged=FALSE; |
306 | 305 |
307 AUI_edit_Init(data->win); | 306 AUI_edit_Init(data->win); |
308 | 307 |
309 SEND_EVENT(data->win, E_ED_INIT, 0, 0); | 308 SEND_EVENT(data->win, E_ED_INIT, 0, 0); |
310 | 309 |
311 /* Return window handle */ | 310 /* Return window handle */ |
312 | 311 |
313 return data->win; | 312 return data->win; |
314 } | 313 } |
315 | 314 |
316 | 315 |
317 /******************************************************************************* | 316 /******************************************************************************* |
318 | 317 |
319 $Function: AUI_edit_Init | 318 $Function: AUI_edit_Init |
320 | 319 |
321 $Description: Initialise the editor. | 320 $Description: Initialise the editor. |
322 | 321 |
323 $Returns: Pointer to the editor's window. | 322 $Returns: Pointer to the editor's window. |
324 | 323 |
325 $Arguments: win - The editor window | 324 $Arguments: win - The editor window |
326 | 325 |
327 *******************************************************************************/ | 326 *******************************************************************************/ |
328 | 327 |
329 static void AUI_edit_Init(T_MFW_HND win) | 328 static void AUI_edit_Init(T_MFW_HND win) |
330 { | 329 { |
331 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 330 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
332 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 331 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
333 T_ATB_TEXT text={0,0,NULL}; | 332 T_ATB_TEXT text={0,0,NULL}; |
334 | 333 |
335 TRACE_FUNCTION("AUI_edit_Init()"); | 334 TRACE_FUNCTION("AUI_edit_Init()"); |
336 | 335 |
337 data->editor->update = ED_UPDATE_FULL; | 336 data->editor->update = ED_UPDATE_FULL; |
338 data->predText.len = 0; /* Blank out predictive text buffer */ | 337 data->predText.len = 0; /* Blank out predictive text buffer */ |
339 | 338 |
340 /* Set up title information */ | 339 /* Set up title information */ |
341 | 340 |
342 data->hasTitle = FALSE; | 341 data->hasTitle = FALSE; |
343 data->title.len = 0; /* Blank out title buffer */ | 342 data->title.len = 0; /* Blank out title buffer */ |
344 | 343 |
345 if (data->editor_data.TitleId!=NULL) | 344 if (data->editor_data.TitleId!=NULL) |
346 { | 345 { |
347 data->hasTitle = TRUE; | 346 data->hasTitle = TRUE; |
348 text.data = (UBYTE *)GET_TEXT(data->editor_data.TitleId); | 347 text.data = (UBYTE *)GET_TEXT(data->editor_data.TitleId); |
349 } | 348 } |
350 else if (data->editor_data.TitleString!=NULL) | 349 else if (data->editor_data.TitleString!=NULL) |
351 { | 350 { |
352 data->hasTitle = TRUE; | 351 data->hasTitle = TRUE; |
353 text.data = data->editor_data.TitleString; | 352 text.data = data->editor_data.TitleString; |
354 } | 353 } |
355 | 354 |
356 /* If title exists, get its dcs and length */ | 355 /* If title exists, get its dcs and length */ |
357 | 356 |
358 if (data->hasTitle) | 357 if (data->hasTitle) |
359 { | 358 { |
360 if (text.data[0]==0x80) | 359 if (text.data[0]==0x80) |
361 { | 360 { |
362 text.data += 2; /* Skip over two unicode indicator bytes */ | 361 text.data += 2; /* Skip over two unicode indicator bytes */ |
363 text.dcs = ATB_DCS_UNICODE; | 362 text.dcs = ATB_DCS_UNICODE; |
364 } | 363 } |
365 #ifdef EASY_TEXT_ENABLED | 364 #ifdef EASY_TEXT_ENABLED |
366 else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 365 else if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
367 { | 366 { |
368 text.dcs = ATB_DCS_UNICODE; | 367 text.dcs = ATB_DCS_UNICODE; |
369 } | 368 } |
370 #endif | 369 #endif |
371 else | 370 else |
372 { | 371 { |
373 text.dcs = ATB_DCS_ASCII; | 372 text.dcs = ATB_DCS_ASCII; |
374 } | 373 } |
375 | 374 |
376 text.len = ATB_string_Length(&text); | 375 text.len = ATB_string_Length(&text); |
377 | 376 |
378 /* Allocate memory for the title and copy the text there */ | 377 /* Allocate memory for the title and copy the text there */ |
379 data->title.data = (UBYTE *)ALLOC_MEMORY((text.len + 1)*ATB_string_Size(&text)); | 378 data->title.data = (UBYTE *)ALLOC_MEMORY((text.len + 1)*ATB_string_Size(&text)); |
380 | 379 |
381 ATB_string_Copy(&data->title, &text); | 380 ATB_string_Copy(&data->title, &text); |
382 } | 381 } |
383 | 382 |
384 /* Set up correct parameters for easytext */ | 383 /* Set up correct parameters for easytext */ |
385 | 384 |
386 #ifdef EASY_TEXT_ENABLED | 385 #ifdef EASY_TEXT_ENABLED |
387 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | 386 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) |
388 { | 387 { |
389 /* Allocate word buffer memory */ | 388 /* Allocate word buffer memory */ |
390 | 389 |
391 data->predText.data = (UBYTE *)ALLOC_MEMORY((ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); | 390 data->predText.data = (UBYTE *)ALLOC_MEMORY((ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); |
392 data->predText.dcs = ATB_DCS_ASCII; | 391 data->predText.dcs = ATB_DCS_ASCII; |
393 data->predText.len = 0; | 392 data->predText.len = 0; |
394 | 393 |
395 FFS_flashData.PredTextAvailable = TRUE; | 394 FFS_flashData.PredTextAvailable = TRUE; |
396 Initialize_Dict(Mmi_getCurrentLanguage()/*SPR1508*/, 0); | 395 Initialize_Dict(Mmi_getCurrentLanguage()/*SPR1508*/, 0); |
397 ResetDictSearch(); | 396 ResetDictSearch(); |
398 } | 397 } |
399 #endif | 398 #endif |
400 | 399 |
401 /* Initialise editor */ | 400 /* Initialise editor */ |
402 | 401 |
403 ATB_edit_Init(data->editor); | 402 ATB_edit_Init(data->editor); |
404 | 403 |
405 /* Initialise text entry */ | 404 /* Initialise text entry */ |
406 | 405 |
407 data->entry_data = AUI_entry_Create(data->win, data->editor, E_ED_UPDATE); | 406 data->entry_data = AUI_entry_Create(data->win, data->editor, E_ED_UPDATE); |
408 | 407 |
409 /* If there's a timeout, create the timer */ | 408 /* If there's a timeout, create the timer */ |
410 | 409 |
411 if (data->editor_data.timeout && (data->editor_data.timeout != FOREVER)) | 410 if (data->editor_data.timeout && (data->editor_data.timeout != FOREVER)) |
412 { | 411 { |
413 data->timer = tim_create(data->win, data->editor_data.timeout, (T_MFW_CB)AUI_edit_TimerCb); | 412 data->timer = tim_create(data->win, data->editor_data.timeout, (T_MFW_CB)AUI_edit_TimerCb); |
414 tim_start(data->timer); | 413 tim_start(data->timer); |
418 data->timer = NULL; | 417 data->timer = NULL; |
419 } | 418 } |
420 | 419 |
421 /* Title timer, if required, is set up in WinCb */ | 420 /* Title timer, if required, is set up in WinCb */ |
422 | 421 |
423 data->title_timer = NULL; | 422 data->title_timer = NULL; |
424 | 423 |
425 return; | 424 return; |
426 } | 425 } |
427 | 426 |
428 | 427 |
429 /******************************************************************************* | 428 /******************************************************************************* |
430 | 429 |
431 $Function: AUI_edit_Destroy | 430 $Function: AUI_edit_Destroy |
432 | 431 |
433 $Description: Destroy the editor. | 432 $Description: Destroy the editor. |
434 | 433 |
435 $Returns: None. | 434 $Returns: None. |
436 | 435 |
437 $Arguments: window - The editor window. | 436 $Arguments: window - The editor window. |
438 | 437 |
439 *******************************************************************************/ | 438 *******************************************************************************/ |
440 | 439 |
441 void AUI_edit_Destroy(T_MFW_HND win) | 440 void AUI_edit_Destroy(T_MFW_HND win) |
442 { | 441 { |
443 T_MFW_WIN *win_data; | 442 T_MFW_WIN *win_data; |
444 T_AUI_EDITOR_INFO *data; | 443 T_AUI_EDITOR_INFO *data; |
445 | 444 |
446 #ifdef TRACE_AUIEditor | 445 #ifdef TRACE_AUIEditor |
447 TRACE_FUNCTION ("AUI_edit_Destroy()"); | 446 TRACE_FUNCTION ("AUI_edit_Destroy()"); |
448 #endif | 447 #endif |
449 | 448 |
450 if (win == NULL) | 449 if (win == NULL) |
451 { | 450 { |
452 #ifdef TRACE_AUIEditor | 451 #ifdef TRACE_AUIEditor |
453 TRACE_EVENT ("Error : Called with NULL Pointer"); | 452 TRACE_EVENT ("Error : Called with NULL Pointer"); |
454 #endif | 453 #endif |
455 return; | 454 return; |
456 } | 455 } |
457 // xreddymn Dec-21-2004 MMI-SPR-27382: Added NULL window handle check for AUI_edit_Destroy | 456 // xreddymn Dec-21-2004 MMI-SPR-27382: Added NULL window handle check for AUI_edit_Destroy |
458 win_data = ((T_MFW_HDR *)win)->data; | 457 win_data = ((T_MFW_HDR *)win)->data; |
459 if(win_data == NULL) return; | 458 if(win_data == NULL) return; |
460 data = (T_AUI_EDITOR_INFO *)win_data->user; | 459 data = (T_AUI_EDITOR_INFO *)win_data->user; |
461 if (data) | 460 if (data) |
462 { | 461 { |
463 /* Free memory allocated for easytext buffer */ | 462 /* Free memory allocated for easytext buffer */ |
464 | 463 |
465 #ifdef EASY_TEXT_ENABLED | 464 #ifdef EASY_TEXT_ENABLED |
466 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && data->predText.data ) | 465 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && data->predText.data ) |
467 { | 466 { |
468 TRACE_EVENT("Freeing predictive text buffer"); | 467 TRACE_EVENT("Freeing predictive text buffer"); |
469 FREE_MEMORY((void *)data->predText.data, (ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); | 468 FREE_MEMORY((void *)data->predText.data, (ED_PREDTEXT_MAX+1)*sizeof(UBYTE)); |
470 } | 469 } |
471 #endif | 470 #endif |
472 | 471 |
473 /* Free memory allocated for title */ | 472 /* Free memory allocated for title */ |
474 | 473 |
475 if (data->hasTitle) | 474 if (data->hasTitle) |
476 { | 475 { |
477 FREE_MEMORY(data->title.data, (data->title.len + 1)*ATB_string_Size(&data->title)); | 476 FREE_MEMORY(data->title.data, (data->title.len + 1)*ATB_string_Size(&data->title)); |
478 } | 477 } |
479 | 478 |
480 /* Delete timers */ | 479 /* Delete timers */ |
481 | 480 |
482 if (data->timer) | 481 if (data->timer) |
483 { | 482 { |
484 tim_delete(data->timer); | 483 tim_delete(data->timer); |
485 data->timer = NULL; | 484 data->timer = NULL; |
486 } | 485 } |
487 if (data->title_timer) | 486 if (data->title_timer) |
488 { | 487 { |
489 tim_delete(data->title_timer); | 488 tim_delete(data->title_timer); |
490 data->title_timer = NULL; | 489 data->title_timer = NULL; |
491 } | 490 } |
492 | 491 |
493 win_delete (data->win); | 492 win_delete (data->win); |
494 | 493 |
495 /* Free editor memory */ | 494 /* Free editor memory */ |
496 | 495 |
497 AUI_entry_Destroy(data->entry_data); | 496 AUI_entry_Destroy(data->entry_data); |
498 ATB_edit_Destroy(data->editor); | 497 ATB_edit_Destroy(data->editor); |
499 FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); | 498 FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); |
500 } | 499 } |
501 | 500 |
502 return; | 501 return; |
503 } | 502 } |
504 | 503 |
505 | 504 |
506 /******************************************************************************* | 505 /******************************************************************************* |
507 | 506 |
508 $Function: AUI_edit_ExecCb | 507 $Function: AUI_edit_ExecCb |
509 | 508 |
510 $Description: Dialog function for editor. | 509 $Description: Dialog function for editor. |
511 | 510 |
512 $Returns: None. | 511 $Returns: None. |
513 | 512 |
514 $Arguments: None. | 513 $Arguments: None. |
515 | 514 |
516 *******************************************************************************/ | 515 *******************************************************************************/ |
517 | 516 |
518 static void AUI_edit_ExecCb(T_MFW_HND win, USHORT event, USHORT value, void *parameter) | 517 static void AUI_edit_ExecCb(T_MFW_HND win, USHORT event, USHORT value, void *parameter) |
519 { | 518 { |
520 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 519 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
521 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 520 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
522 | 521 |
523 T_MFW_HND parent_win = data->parent; | 522 T_MFW_HND parent_win = data->parent; |
524 USHORT alphachar; | 523 USHORT alphachar; |
525 /* Store these in case editor is destroyed on callback */ | 524 /* Store these in case editor is destroyed on callback */ |
526 USHORT Identifier = data->editor_data.Identifier; | 525 USHORT Identifier = data->editor_data.Identifier; |
527 T_AUI_EDIT_CB Callback = data->editor_data.Callback; | 526 T_AUI_EDIT_CB Callback = data->editor_data.Callback; |
528 UBYTE destroyEditor = data->editor_data.destroyEditor; | 527 UBYTE destroyEditor = data->editor_data.destroyEditor; |
529 | 528 |
530 /* Mar 08, 2006 REF:ER OMAPS00065168 */ | 529 /* Mar 08, 2006 REF:ER OMAPS00065168 */ |
531 #ifdef NEPTUNE_BOARD | 530 #ifdef NEPTUNE_BOARD |
532 UBYTE ringer; | 531 UBYTE ringer; |
533 #endif | 532 #endif |
536 TRACE_FUNCTION ("AUI_edit_ExecCb()"); | 535 TRACE_FUNCTION ("AUI_edit_ExecCb()"); |
537 #endif | 536 #endif |
538 | 537 |
539 switch (event) | 538 switch (event) |
540 { | 539 { |
541 /* Initialise */ | 540 /* Initialise */ |
542 | 541 |
543 case E_ED_INIT: | 542 case E_ED_INIT: |
544 TRACE_EVENT("E_ED_INIT"); | 543 TRACE_EVENT("E_ED_INIT"); |
545 win_show(data->win); | 544 win_show(data->win); |
546 break; | 545 break; |
547 | 546 |
548 /* Destroy the editor */ | 547 /* Destroy the editor */ |
549 | 548 |
550 case E_ED_DESTROY: | 549 case E_ED_DESTROY: |
551 AUI_edit_Destroy(data->win); | 550 AUI_edit_Destroy(data->win); |
552 break; | 551 break; |
553 | 552 |
554 /* De-initialise editor */ | 553 /* De-initialise editor */ |
555 case E_ED_DEINIT: | 554 case E_ED_DEINIT: |
556 TRACE_EVENT("E_ED_DEINIT"); | 555 TRACE_EVENT("E_ED_DEINIT"); |
557 | 556 |
558 /* Mar 08, 2006 REF:ER OMAPS00065168 */ | 557 /* Mar 08, 2006 REF:ER OMAPS00065168 */ |
559 /* Stop playing ring tone on key press */ | 558 /* Stop playing ring tone on key press */ |
560 #ifdef NEPTUNE_BOARD | 559 #ifdef NEPTUNE_BOARD |
561 ringer = getcurrentSMSTone(); | 560 ringer = getcurrentSMSTone(); |
562 audio_StopSoundbyID( AUDIO_BUZZER, ringer ); | 561 audio_StopSoundbyID( AUDIO_BUZZER, ringer ); |
563 | 562 |
564 vsi_t_sleep(0,10); /* small delay */ | 563 vsi_t_sleep(0,10); /* small delay */ |
565 #endif | 564 #endif |
566 | 565 |
567 if (Callback) | 566 if (Callback) |
568 (Callback) (parent_win, Identifier, value); | 567 (Callback) (parent_win, Identifier, value); |
569 | 568 |
570 if(destroyEditor) | 569 if(destroyEditor) |
571 AUI_edit_Destroy(data->win); | 570 AUI_edit_Destroy(data->win); |
572 break; | 571 break; |
573 | 572 |
574 /* Insert a character */ | 573 /* Insert a character */ |
575 | 574 |
576 case E_ED_INSERT: | 575 case E_ED_INSERT: |
577 alphachar = (USHORT)value; | 576 alphachar = (USHORT)value; |
578 /* If value is set, insert character */ | 577 /* If value is set, insert character */ |
579 if (alphachar!=NULL) | 578 if (alphachar!=NULL) |
580 { | 579 { |
581 ATB_edit_Char(data->editor, alphachar, TRUE); | 580 ATB_edit_Char(data->editor, alphachar, TRUE); |
582 #ifdef EASY_TEXT_ENABLED | 581 #ifdef EASY_TEXT_ENABLED |
583 if(FFS_flashData.PredTextAvailable && FFS_flashData.PredTextSelected && ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) | 582 if(FFS_flashData.PredTextAvailable && FFS_flashData.PredTextSelected && ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) |
584 { | 583 { |
585 if ((alphachar == UNICODE_FULLSTOP) ||(alphachar == UNICODE_EXCLAMATION) | 584 if ((alphachar == UNICODE_FULLSTOP) ||(alphachar == UNICODE_EXCLAMATION) |
586 || (alphachar == UNICODE_QUESTION)) | 585 || (alphachar == UNICODE_QUESTION)) |
587 { | 586 { |
588 ATB_edit_Char(data->editor, UNICODE_SPACE, TRUE); | 587 ATB_edit_Char(data->editor, UNICODE_SPACE, TRUE); |
589 } | 588 } |
590 } | 589 } |
591 #endif | 590 #endif |
592 } | 591 } |
593 else | 592 else |
594 /* If parameter is set, insert string */ | 593 /* If parameter is set, insert string */ |
595 if (parameter!=NULL) | 594 if (parameter!=NULL) |
596 { | 595 { |
597 ATB_edit_InsertString(data->editor, (T_ATB_TEXT *)parameter); | 596 ATB_edit_InsertString(data->editor, (T_ATB_TEXT *)parameter); |
598 } | 597 } |
599 win_show(data->win); | 598 win_show(data->win); |
600 break; | 599 break; |
601 | 600 |
602 /* Update word wrap & redraw editor window */ | 601 /* Update word wrap & redraw editor window */ |
603 | 602 |
604 case E_ED_UPDATE: | 603 case E_ED_UPDATE: |
605 //ATB_edit_Refresh(data->editor); /* SPR#2342 - SH */ | 604 //ATB_edit_Refresh(data->editor); /* SPR#2342 - SH */ |
606 win_show(data->win); | 605 win_show(data->win); |
607 break; | 606 break; |
608 | 607 |
609 default: | 608 default: |
610 break; | 609 break; |
611 } | 610 } |
612 return; | 611 return; |
613 } | 612 } |
614 | 613 |
615 | 614 |
616 /******************************************************************************* | 615 /******************************************************************************* |
617 | 616 |
618 $Function: AUI_edit_WinCb | 617 $Function: AUI_edit_WinCb |
619 | 618 |
620 $Description: Editor window event handler. | 619 $Description: Editor window event handler. |
621 | 620 |
622 $Returns: None. | 621 $Returns: None. |
623 | 622 |
624 $Arguments: event - the event | 623 $Arguments: event - the event |
625 win - the editor window | 624 win - the editor window |
626 | 625 |
627 *******************************************************************************/ | 626 *******************************************************************************/ |
628 | 627 |
629 static int AUI_edit_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) | 628 static int AUI_edit_WinCb(T_MFW_EVENT event, T_MFW_WIN *win_data) |
630 { | 629 { |
631 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 630 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
632 T_ED_DATA *editor = data->editor; | 631 T_ED_DATA *editor = data->editor; |
633 USHORT scrollBarSize; | 632 USHORT scrollBarSize; |
634 USHORT scrollBarPos; | 633 USHORT scrollBarPos; |
635 SHORT editX = editor->attr->win_size.px; | 634 SHORT editX = editor->attr->win_size.px; |
636 SHORT editY = editor->attr->win_size.py; | 635 SHORT editY = editor->attr->win_size.py; |
637 SHORT editWidth = editor->attr->win_size.sx; | 636 SHORT editWidth = editor->attr->win_size.sx; |
638 SHORT editHeight = editor->attr->win_size.sy; | 637 SHORT editHeight = editor->attr->win_size.sy; |
639 char lengthIndC[12]; | 638 char lengthIndC[12]; |
640 | 639 |
641 /* Strings for the header */ | 640 /* Strings for the header */ |
642 T_ATB_TEXT string; | 641 T_ATB_TEXT string; |
643 USHORT stringWidth; | 642 USHORT stringWidth; |
644 USHORT stringHeight; | 643 USHORT stringHeight; |
645 T_ATB_TEXT title; | 644 T_ATB_TEXT title; |
646 USHORT titleWidth; | 645 USHORT titleWidth; |
647 USHORT titleHeight; | 646 USHORT titleHeight; |
648 | 647 |
649 USHORT textLen; | 648 USHORT textLen; |
650 | 649 |
651 | 650 |
652 | 651 T_DS_TEXTFORMAT format; |
653 | 652 BOOL showIcons; /* Flag that stores whether icons (e.g. alignment icons) should be shown */ |
654 T_DS_TEXTFORMAT format; | 653 |
655 BOOL showIcons; /* Flag that stores whether icons (e.g. alignment icons) should be shown */ | 654 USHORT leftSK; |
656 | 655 USHORT rightSK; |
657 USHORT leftSK; | 656 USHORT textIndex; |
658 USHORT rightSK; | 657 T_ATB_TEXT newTitle; |
659 USHORT textIndex; | 658 USHORT lastSpace; |
660 T_ATB_TEXT newTitle; | 659 USHORT character; |
661 USHORT lastSpace; | |
662 USHORT character; | |
663 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 660 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
664 #ifdef FF_MMI_SAT_ICON | 661 #ifdef FF_MMI_SAT_ICON |
665 SHORT titleIconWidth = 0; | 662 SHORT titleIconWidth = 0; |
666 SHORT iconX; | 663 SHORT iconX; |
667 SHORT iconY; | 664 SHORT iconY; |
668 #endif | 665 #endif |
669 | 666 |
670 #ifdef TRACE_AUIEditor | 667 #ifdef TRACE_AUIEditor |
671 TRACE_FUNCTION ("AUI_edit_WinCb()"); | 668 TRACE_FUNCTION ("AUI_edit_WinCb()"); |
672 #endif | 669 #endif |
673 | 670 |
674 if (!data) | 671 if (!data) |
675 return MFW_EVENT_CONSUMED; | 672 return MFW_EVENT_CONSUMED; |
676 | 673 |
677 switch(event) | 674 switch(event) |
678 { | 675 { |
679 case E_WIN_VISIBLE: /* window is visible */ | 676 case E_WIN_VISIBLE: /* window is visible */ |
680 if (win_data->flags & E_WIN_VISIBLE) | 677 if (win_data->flags & E_WIN_VISIBLE) |
681 { | 678 { |
682 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 679 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
683 #ifdef FF_MMI_SAT_ICON | 680 #ifdef FF_MMI_SAT_ICON |
684 if (editor->attr->TitleIcon.data != NULL) | 681 if (editor->attr->TitleIcon.data != NULL) |
685 { | 682 { |
686 if (editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) | 683 if (editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) |
687 { | 684 { |
688 titleIconWidth = TITLE_ICON_WIDTH; | 685 titleIconWidth = TITLE_ICON_WIDTH; |
689 } | 686 } |
690 else | 687 else |
691 { | 688 { |
692 titleIconWidth = editor->attr->TitleIcon.width; | 689 titleIconWidth = editor->attr->TitleIcon.width; |
693 } | 690 } |
694 } | 691 } |
695 else | 692 else |
696 { | 693 { |
697 titleIconWidth = 0; | 694 titleIconWidth = 0; |
698 } | 695 } |
699 #endif | 696 #endif |
700 | 697 |
701 textLen = data->editor->attr->text.len; | 698 textLen = data->editor->attr->text.len; |
702 ATB_edit_LineGet(data->editor, data->editor->winStartLine); | 699 ATB_edit_LineGet(data->editor, data->editor->winStartLine); |
703 | 700 |
704 | 701 |
705 if (editor->update==ED_UPDATE_TRIVIAL) | 702 if (editor->update==ED_UPDATE_TRIVIAL) |
706 editor->update = ED_UPDATE_DEFAULT; | 703 editor->update = ED_UPDATE_DEFAULT; |
707 | 704 |
708 TRACE_EVENT("Updating whole screen."); | 705 TRACE_EVENT("Updating whole screen."); |
709 | 706 |
710 | 707 |
711 | 708 /* Show the edited text */ |
712 | 709 /* Don't update editor text if in ED_UPDATE_PARTIAL */ |
713 /* Show the edited text */ | 710 |
714 /* Don't update editor text if in ED_UPDATE_PARTIAL */ | 711 if (editor->update!=ED_UPDATE_PARTIAL) |
715 | 712 { |
716 if (editor->update!=ED_UPDATE_PARTIAL) | 713 ATB_edit_Show(data->editor); |
717 { | 714 } |
718 ATB_edit_Show(data->editor); | 715 |
719 } | 716 /* Set the colour for drawing title and scrollbar */ |
720 | 717 |
721 /* Set the colour for drawing title and scrollbar */ | 718 resources_setTitleColour(COLOUR_EDITOR); |
722 | 719 |
723 resources_setTitleColour(COLOUR_EDITOR); | 720 /* TITLE */ |
724 | 721 |
725 /* TITLE */ | 722 if (data->editor_data.zone_id & ZONE_TITLE) |
726 | 723 { |
727 if (data->editor_data.zone_id & ZONE_TITLE) | 724 dspl_Clear(0,0, SCREEN_SIZE_X-1, editY-1); |
728 { | 725 |
729 dspl_Clear(0,0, SCREEN_SIZE_X-1, editY-1); | 726 /* Display the title, if it exists */ |
730 | 727 |
731 /* Display the title, if it exists */ | 728 string.len = 0; |
732 | 729 string.dcs = ATB_DCS_ASCII; |
733 string.len = 0; | 730 title.len = 0; |
734 string.dcs = ATB_DCS_ASCII; | 731 title.dcs = ATB_DCS_ASCII; |
735 title.len = 0; | 732 |
736 title.dcs = ATB_DCS_ASCII; | 733 if (data->hasTitle) |
737 | 734 { |
738 if (data->hasTitle) | 735 title.data = data->title.data; |
739 { | 736 title.len = data->title.len; |
740 title.data = data->title.data; | 737 title.dcs = data->title.dcs; |
741 title.len = data->title.len; | 738 } |
742 title.dcs = data->title.dcs; | 739 |
743 } | 740 /* Uppercase/lowercase indicator */ |
744 | 741 |
745 /* Uppercase/lowercase indicator */ | 742 if (!ATB_edit_Mode(editor, ED_MODE_READONLY)) |
746 | 743 { |
747 if (!ATB_edit_Mode(editor, ED_MODE_READONLY)) | 744 switch(ATB_edit_GetCasePref(editor)) |
748 { | 745 { |
749 switch(ATB_edit_GetCasePref(editor)) | 746 case ED_CASEPREF_ALPHA_UC: |
750 { | 747 case ED_CASEPREF_ALPHANUM_UC: |
751 case ED_CASEPREF_ALPHA_UC: | 748 string.data = (UBYTE *)ED_IND_UPPER; |
752 case ED_CASEPREF_ALPHANUM_UC: | 749 break; |
753 string.data = (UBYTE *)ED_IND_UPPER; | 750 |
754 break; | 751 case ED_CASEPREF_ALPHA_LC: |
755 | 752 case ED_CASEPREF_ALPHANUM_LC: |
756 case ED_CASEPREF_ALPHA_LC: | 753 string.data = (UBYTE *)ED_IND_LOWER; |
757 case ED_CASEPREF_ALPHANUM_LC: | 754 break; |
758 string.data = (UBYTE *)ED_IND_LOWER; | 755 |
759 break; | 756 case ED_CASEPREF_ALPHANUM: |
760 | 757 if (ATB_edit_GetCase(editor)==ED_CASE_UPPER) |
761 case ED_CASEPREF_ALPHANUM: | 758 string.data = (UBYTE *)ED_IND_UPPER; |
762 if (ATB_edit_GetCase(editor)==ED_CASE_UPPER) | 759 else if (ATB_edit_GetCase(editor)==ED_CASE_LOWER) |
763 string.data = (UBYTE *)ED_IND_UPPER; | 760 string.data = (UBYTE *)ED_IND_LOWER; |
764 else if (ATB_edit_GetCase(editor)==ED_CASE_LOWER) | 761 else if (ATB_edit_GetCase(editor)==ED_CASE_CAPS) |
765 string.data = (UBYTE *)ED_IND_LOWER; | 762 string.data = (UBYTE *)ED_IND_CAPS; |
766 else if (ATB_edit_GetCase(editor)==ED_CASE_CAPS) | 763 else |
767 string.data = (UBYTE *)ED_IND_CAPS; | 764 string.data = (UBYTE *)ED_IND_NUM; |
768 else | 765 break; |
769 string.data = (UBYTE *)ED_IND_NUM; | 766 |
770 break; | 767 case ED_CASEPREF_NUM: |
771 | 768 string.data = (UBYTE *)ED_IND_NUM; |
772 case ED_CASEPREF_NUM: | 769 break; |
773 string.data = (UBYTE *)ED_IND_NUM; | 770 |
774 break; | 771 default: |
775 | 772 string.data = (UBYTE *)ED_IND_NONE; |
776 default: | 773 break; |
777 string.data = (UBYTE *)ED_IND_NONE; | 774 } |
778 break; | 775 |
779 } | 776 string.len = ATB_string_Length(&string); |
780 | |
781 string.len = ATB_string_Length(&string); | |
782 | 777 |
783 #ifdef EASY_TEXT_ENABLED | 778 #ifdef EASY_TEXT_ENABLED |
784 /* Display predicted word in header */ | 779 /* Display predicted word in header */ |
785 | 780 |
786 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected) | 781 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected) |
787 { | 782 { |
788 if (ATB_edit_CapitaliseWord(data->editor)) /* Word is capitalised */ | 783 if (ATB_edit_CapitaliseWord(data->editor)) /* Word is capitalised */ |
789 string.data = (UBYTE *)ED_IND_CAPS; | 784 string.data = (UBYTE *)ED_IND_CAPS; |
790 else | 785 else |
791 string.data = (UBYTE *)ED_IND_LOWER; | 786 string.data = (UBYTE *)ED_IND_LOWER; |
792 string.len = ATB_string_Length(&string); | 787 string.len = ATB_string_Length(&string); |
793 | 788 |
794 if(data->predText.len!=0) | 789 if(data->predText.len!=0) |
795 { | 790 { |
796 title.data = data->predText.data; | 791 title.data = data->predText.data; |
797 title.len = data->predText.len; | 792 title.len = data->predText.len; |
798 title.dcs = data->predText.dcs; | 793 title.dcs = data->predText.dcs; |
799 } | 794 } |
800 } | 795 } |
801 #endif | 796 #endif |
802 if (ATB_edit_Mode(editor, ED_MODE_ALPHA) && title.len==0) | 797 if (ATB_edit_Mode(editor, ED_MODE_ALPHA) && title.len==0) |
803 { | 798 { |
804 /* SPR#1995 - SH - 'size' includes null terminator, so | 799 /* SPR#1995 - SH - 'size' includes null terminator, so |
805 * remaining characters is size-1 */ | 800 * remaining characters is size-1 */ |
806 #ifdef LSCREEN | 801 #ifdef LSCREEN |
807 sprintf(lengthIndC, "%d/%d", textLen, editor->attr->size-1); | 802 sprintf(lengthIndC, "%d/%d", textLen, editor->attr->size-1); |
808 #else | 803 #else |
809 sprintf(lengthIndC, "%d", editor->attr->size-textLen-1); | 804 sprintf(lengthIndC, "%d", editor->attr->size-textLen-1); |
810 #endif | 805 #endif |
811 | 806 |
812 title.data = (UBYTE *)lengthIndC; | 807 title.data = (UBYTE *)lengthIndC; |
813 title.len = ATB_string_Length(&title); | 808 title.len = ATB_string_Length(&title); |
814 } | 809 } |
815 } | 810 } |
816 | 811 |
817 /* Draw the string to the right of the editor - the case/format indicator, and icons (if appropriate) */ | 812 /* Draw the string to the right of the editor - the case/format indicator, and icons (if appropriate) */ |
818 | 813 |
819 stringWidth = 0; | 814 stringWidth = 0; |
820 stringHeight = 0; | 815 stringHeight = 0; |
821 showIcons = FALSE; | 816 showIcons = FALSE; |
822 | 817 |
823 if (string.len) | 818 if (string.len) |
824 { | 819 { |
825 TRACE_EVENT("Displaying string on right"); | 820 TRACE_EVENT("Displaying string on right"); |
826 ATB_display_SetFormatAttr(&format, 0, FALSE); /* Set format to format at cursor */ | 821 ATB_display_SetFormatAttr(&format, 0, FALSE); /* Set format to format at cursor */ |
827 stringWidth = ATB_display_StringWidth(&string, &format)+2; | 822 stringWidth = ATB_display_StringWidth(&string, &format)+2; |
828 stringHeight = ATB_display_StringHeight(&string, &format); | 823 stringHeight = ATB_display_StringHeight(&string, &format); |
829 ATB_display_Text(SCREEN_SIZE_X-stringWidth+2,0, &format, &string); | 824 ATB_display_Text(SCREEN_SIZE_X-stringWidth+2,0, &format, &string); |
830 showIcons = TRUE; /* If showing case, show icons */ | 825 showIcons = TRUE; /* If showing case, show icons */ |
831 } | 826 } |
832 | 827 |
833 #ifdef EASY_TEXT_ENABLED | 828 #ifdef EASY_TEXT_ENABLED |
834 /* Display ezitext icon to the left of the case indicator */ | 829 /* Display ezitext icon to the left of the case indicator */ |
835 | 830 |
836 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) | 831 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) |
837 { | 832 { |
838 if (data->predText.len==0) // Show icons only if there's no predicted text entry currently | 833 if (data->predText.len==0) // Show icons only if there's no predicted text entry currently |
839 showIcons = TRUE; | 834 showIcons = TRUE; |
840 else | 835 else |
841 showIcons = FALSE; | 836 showIcons = FALSE; |
842 } | 837 } |
843 #endif | 838 #endif |
844 | 839 |
845 /* Show icons to the left of the case indicator */ | 840 /* Show icons to the left of the case indicator */ |
846 | 841 |
847 if (showIcons) | 842 if (showIcons) |
848 { | 843 { |
849 | 844 |
850 #ifdef EASY_TEXT_ENABLED | 845 #ifdef EASY_TEXT_ENABLED |
851 /* Display ezitext icon to the left of the case indicator */ | 846 /* Display ezitext icon to the left of the case indicator */ |
852 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) | 847 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected == TRUE) |
853 { | 848 { |
854 stringWidth += 8; | 849 stringWidth += 8; |
855 dspl_BitBlt(SCREEN_SIZE_X-stringWidth+2, | 850 dspl_BitBlt(SCREEN_SIZE_X-stringWidth+2, |
856 0,8,8,0,(char*)TextIconeZiTextSmall,0); | 851 0,8,8,0,(char*)TextIconeZiTextSmall,0); |
857 } | 852 } |
858 #endif | 853 #endif |
859 | 854 |
860 if (stringHeight<Mmi_layout_line_height()) | 855 if (stringHeight<Mmi_layout_line_height()) |
861 stringHeight = Mmi_layout_line_height(); | 856 stringHeight = Mmi_layout_line_height(); |
862 } | 857 } |
863 | 858 |
864 | 859 |
865 /* Draw the string to the left of the screen - the editor title, or the number of characters | 860 /* Draw the string to the left of the screen - the editor title, or the number of characters |
866 * remaining free in the buffer, or the predicted text word. */ | 861 * remaining free in the buffer, or the predicted text word. */ |
867 | 862 |
868 titleWidth = 0; | 863 titleWidth = 0; |
869 titleHeight = 0; | 864 titleHeight = 0; |
870 | 865 |
871 if (title.len) | 866 if (title.len) |
872 { | 867 { |
873 ATB_display_SetFormatAttr(&format, 0, FALSE); /* Clear format */ | 868 ATB_display_SetFormatAttr(&format, 0, FALSE); /* Clear format */ |
874 | 869 |
875 titleWidth = ATB_display_StringWidth(&title, &format)+2; | 870 titleWidth = ATB_display_StringWidth(&title, &format)+2; |
876 titleHeight = ATB_display_StringHeight(&title, &format); | 871 titleHeight = ATB_display_StringHeight(&title, &format); |
877 | 872 |
878 /* Check to see if title fits into top line - if it doesn't, | 873 /* Check to see if title fits into top line - if it doesn't, |
879 * we will need display a section of it. */ | 874 * we will need display a section of it. */ |
880 | 875 |
881 if (titleWidth>(SCREEN_SIZE_X-stringWidth-2)) | 876 if (titleWidth>(SCREEN_SIZE_X-stringWidth-2)) |
882 { | 877 { |
883 /* Create timer if it doesn't exist */ | 878 /* Create timer if it doesn't exist */ |
884 | 879 |
885 if (!data->title_timer) | 880 if (!data->title_timer) |
886 { | 881 { |
887 data->title_timer = tim_create(data->win, 3000, (T_MFW_CB)AUI_edit_TitleTimerCb); | 882 data->title_timer = tim_create(data->win, 3000, (T_MFW_CB)AUI_edit_TitleTimerCb); |
888 data->title_pos = 0; | 883 data->title_pos = 0; |
889 data->title_next_pos = 0; | 884 data->title_next_pos = 0; |
890 tim_start(data->title_timer); | 885 tim_start(data->title_timer); |
891 } | 886 } |
892 | 887 |
893 titleWidth = 0; | 888 titleWidth = 0; |
894 textIndex = data->title_pos; | 889 textIndex = data->title_pos; |
895 lastSpace = 0; | 890 lastSpace = 0; |
896 | 891 |
897 while (titleWidth<(SCREEN_SIZE_X-stringWidth-2) && textIndex<title.len) | 892 while (titleWidth<(SCREEN_SIZE_X-stringWidth-2) && textIndex<title.len) |
898 { | 893 { |
899 character = ATB_string_GetChar(&title, textIndex); | 894 character = ATB_string_GetChar(&title, textIndex); |
900 titleWidth+=ATB_display_GetCharWidth(character, &format); | 895 titleWidth+=ATB_display_GetCharWidth(character, &format); |
901 textIndex++; | 896 textIndex++; |
902 if (character==UNICODE_SPACE) | 897 if (character==UNICODE_SPACE) |
903 lastSpace = textIndex; | 898 lastSpace = textIndex; |
904 } | 899 } |
905 | 900 |
906 TRACE_EVENT_P1("Characters that fit: %d", textIndex); | 901 TRACE_EVENT_P1("Characters that fit: %d", textIndex); |
907 | 902 |
908 /* Calculate next start position */ | 903 /* Calculate next start position */ |
909 | 904 |
910 if (textIndex==title.len) | 905 if (textIndex==title.len) |
911 data->title_next_pos = 0; | 906 data->title_next_pos = 0; |
912 else | 907 else |
913 { | 908 { |
914 /* Word wrap to last space, if there was one */ | 909 /* Word wrap to last space, if there was one */ |
915 | 910 |
916 if (lastSpace>0) | 911 if (lastSpace>0) |
917 textIndex = lastSpace; | 912 textIndex = lastSpace; |
918 data->title_next_pos = textIndex; | 913 data->title_next_pos = textIndex; |
919 } | 914 } |
920 | 915 |
921 TRACE_EVENT_P1("Next position: %d", data->title_next_pos); | 916 TRACE_EVENT_P1("Next position: %d", data->title_next_pos); |
922 | 917 |
923 newTitle.len = textIndex-data->title_pos; | 918 newTitle.len = textIndex-data->title_pos; |
924 newTitle.data = (UBYTE *)ALLOC_MEMORY((newTitle.len+1)*ATB_string_Size(&title)); | 919 newTitle.data = (UBYTE *)ALLOC_MEMORY((newTitle.len+1)*ATB_string_Size(&title)); |
925 newTitle.dcs = title.dcs; | 920 newTitle.dcs = title.dcs; |
926 | 921 |
927 for (textIndex=0; textIndex<newTitle.len; textIndex++) | 922 for (textIndex=0; textIndex<newTitle.len; textIndex++) |
928 { | 923 { |
929 ATB_string_SetChar(&newTitle, textIndex, ATB_string_GetChar(&title, data->title_pos+textIndex)); | 924 ATB_string_SetChar(&newTitle, textIndex, ATB_string_GetChar(&title, data->title_pos+textIndex)); |
930 } | 925 } |
931 ATB_string_SetChar(&newTitle, newTitle.len, UNICODE_EOLN); | 926 ATB_string_SetChar(&newTitle, newTitle.len, UNICODE_EOLN); |
932 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 927 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
933 #ifdef FF_MMI_SAT_ICON | 928 #ifdef FF_MMI_SAT_ICON |
934 /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. | 929 /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. |
935 If the icon is to displayed, move the text by icon width. */ | 930 If the icon is to displayed, move the text by icon width. */ |
936 if (editor->attr->TitleIcon.selfExplanatory == FALSE) | 931 if (editor->attr->TitleIcon.selfExplanatory == FALSE) |
937 ATB_display_Text(titleIconWidth+1,0,&format, &newTitle); | 932 ATB_display_Text(titleIconWidth+1,0,&format, &newTitle); |
938 #else | 933 #else |
939 ATB_display_Text(0,0,&format, &newTitle); | 934 ATB_display_Text(0,0,&format, &newTitle); |
940 #endif | 935 #endif |
941 FREE_MEMORY((UBYTE *)newTitle.data, (newTitle.len+1)*ATB_string_Size(&title)); | 936 FREE_MEMORY((UBYTE *)newTitle.data, (newTitle.len+1)*ATB_string_Size(&title)); |
942 } | 937 } |
943 else | 938 else |
944 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 939 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
945 #ifdef FF_MMI_SAT_ICON | 940 #ifdef FF_MMI_SAT_ICON |
946 { | 941 { |
947 /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. | 942 /* Check if the icon is self-explanatory, GSM 11.14, Sec 6.5.4, 12.32. |
948 If the icon is to displayed, move the text by icon width. */ | 943 If the icon is to displayed, move the text by icon width. */ |
949 if (editor->attr->TitleIcon.selfExplanatory == FALSE) | 944 if (editor->attr->TitleIcon.selfExplanatory == FALSE) |
950 ATB_display_Text(titleIconWidth+1,0,&format, &title); | 945 ATB_display_Text(titleIconWidth+1,0,&format, &title); |
951 } | 946 } |
952 #else | 947 #else |
953 ATB_display_Text(0,0,&format, &title); | 948 ATB_display_Text(0,0,&format, &title); |
954 #endif | 949 #endif |
955 | 950 |
956 #ifdef EASY_TEXT_ENABLED | 951 #ifdef EASY_TEXT_ENABLED |
957 /* Provides a cursor in the predicted word, so the user can tell which of the characters | 952 /* Provides a cursor in the predicted word, so the user can tell which of the characters |
958 * entered are being used to select the word. */ | 953 * entered are being used to select the word. */ |
959 | 954 |
960 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected && data->predText.len!=0) | 955 if(ATB_edit_Mode(editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextSelected && data->predText.len!=0) |
961 { | 956 { |
962 ATB_display_Cursor(&data->predText, data->predTextChar.pos, ED_CURSOR_BLOCK, | 957 ATB_display_Cursor(&data->predText, data->predTextChar.pos, ED_CURSOR_BLOCK, |
963 data->predTextChar.lineWidth, 0, data->predTextChar.width, data->predTextChar.height); | 958 data->predTextChar.lineWidth, 0, data->predTextChar.width, data->predTextChar.height); |
964 } | 959 } |
965 #endif | 960 #endif |
966 } | 961 } |
967 | 962 |
968 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 963 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
969 #ifdef FF_MMI_SAT_ICON | 964 #ifdef FF_MMI_SAT_ICON |
970 if(editor->attr->TitleIcon.data != NULL) | 965 if(editor->attr->TitleIcon.data != NULL) |
971 { | 966 { |
972 | 967 |
973 if (titleHeight == 0) | 968 if (titleHeight == 0) |
974 titleHeight = TITLE_ICON_HEIGHT; | 969 titleHeight = TITLE_ICON_HEIGHT; |
975 | 970 |
976 /* Display '?' icon if the size is bigger, | 971 /* Display '?' icon if the size is bigger, |
977 else display the icon*/ | 972 else display the icon*/ |
978 if ((editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) || (editor->attr->TitleIcon.height > TITLE_ICON_HEIGHT)) | 973 if ((editor->attr->TitleIcon.width > TITLE_ICON_WIDTH) || (editor->attr->TitleIcon.height > TITLE_ICON_HEIGHT)) |
979 { | 974 { |
980 /* iconY calculates place hoilder to place the icon | 975 /* iconY calculates place hoilder to place the icon |
981 at the center of the screen. */ | 976 at the center of the screen. */ |
982 iconX = 1; | 977 iconX = 1; |
983 iconY = 1+ ((titleHeight-2) / 2) - (10 / 2); | 978 iconY = 1+ ((titleHeight-2) / 2) - (10 / 2); |
984 dspl_BitBlt2(iconX, iconY, 8, | 979 dspl_BitBlt2(iconX, iconY, 8, |
985 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); | 980 10, (void*)SATIconQuestionMark, 0, BMP_FORMAT_256_COLOUR); |
986 } | 981 } |
987 else | 982 else |
988 { | 983 { |
989 /* iconY calculates place hoilder to place the icon | 984 /* iconY calculates place hoilder to place the icon |
990 at the center of the screen. */ | 985 at the center of the screen. */ |
991 iconX = 1; | 986 iconX = 1; |
992 iconY = 1+ ((titleHeight-2) / 2) - (editor->attr->TitleIcon.height / 2); | 987 iconY = 1+ ((titleHeight-2) / 2) - (editor->attr->TitleIcon.height / 2); |
993 dspl_BitBlt2(iconX, iconY, editor->attr->TitleIcon.width, editor->attr->TitleIcon.height, | 988 dspl_BitBlt2(iconX, iconY, editor->attr->TitleIcon.width, editor->attr->TitleIcon.height, |
994 (void*)editor->attr->TitleIcon.data, 0, BMP_FORMAT_256_COLOUR); | 989 (void*)editor->attr->TitleIcon.data, 0, BMP_FORMAT_256_COLOUR); |
995 } | 990 } |
996 } | 991 } |
997 #endif | 992 #endif |
998 | 993 |
999 /* Draw line on top */ | 994 /* Draw line on top */ |
1000 | 995 |
1001 if (stringHeight>titleHeight) | 996 if (stringHeight>titleHeight) |
1002 titleHeight = stringHeight; | 997 titleHeight = stringHeight; |
1003 | 998 |
1004 /* Non colour display - draw line between title texts*/ | 999 /* Non colour display - draw line between title texts*/ |
1005 #ifndef LSCREEN | 1000 #ifndef LSCREEN |
1006 if (titleHeight>0) | 1001 if (titleHeight>0) |
1007 { | 1002 { |
1008 if (stringWidth==0) | 1003 if (stringWidth==0) |
1009 stringWidth = 1; /* Make sure end of line is on-screen */ | 1004 stringWidth = 1; /* Make sure end of line is on-screen */ |
1010 dspl_DrawLine(titleWidth, titleHeight/2, SCREEN_SIZE_X-stringWidth, titleHeight/2); /* Line between title & indicator */ | 1005 dspl_DrawLine(titleWidth, titleHeight/2, SCREEN_SIZE_X-stringWidth, titleHeight/2); /* Line between title & indicator */ |
1011 } | 1006 } |
1012 #endif | 1007 #endif |
1013 } | 1008 } |
1014 | 1009 |
1015 /* SCROLLBAR */ | 1010 /* SCROLLBAR */ |
1016 | 1011 |
1017 if (data->editor_data.zone_id & ZONE_SCROLLBAR) | 1012 if (data->editor_data.zone_id & ZONE_SCROLLBAR) |
1018 { | 1013 { |
1019 dspl_Clear(editX+editWidth, editY, editX+editWidth+ED_SCROLLBAR_WIDTH-1, editY+editHeight-1); | 1014 dspl_Clear(editX+editWidth, editY, editX+editWidth+ED_SCROLLBAR_WIDTH-1, editY+editHeight-1); |
1020 | 1015 |
1021 /* Vertical scrollbar - only show if editor is taller than view size */ | 1016 /* Vertical scrollbar - only show if editor is taller than view size */ |
1022 | 1017 |
1023 if (editor->totalHeight > 0 && editor->viewHeight<editor->totalHeight) | 1018 if (editor->totalHeight > 0 && editor->viewHeight<editor->totalHeight) |
1024 { | 1019 { |
1025 dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1); | 1020 dspl_DrawLine(editX+editWidth, editY, editX+editWidth, editY+editHeight-1); |
1026 scrollBarSize = editor->viewHeight * editHeight / editor->totalHeight; | 1021 scrollBarSize = editor->viewHeight * editHeight / editor->totalHeight; |
1027 if (scrollBarSize>editHeight) | 1022 if (scrollBarSize>editHeight) |
1028 scrollBarSize = editHeight; | 1023 scrollBarSize = editHeight; |
1029 scrollBarPos = editor->viewStartPos * editHeight / editor->totalHeight; | 1024 scrollBarPos = editor->viewStartPos * editHeight / editor->totalHeight; |
1030 | 1025 |
1031 dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1, | 1026 dspl_DrawLine(editX+editWidth+1, editY+scrollBarPos, editX+editWidth+1, |
1032 editY+scrollBarPos+scrollBarSize); | 1027 editY+scrollBarPos+scrollBarSize); |
1033 dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2, | 1028 dspl_DrawLine(editX+editWidth+2, editY+scrollBarPos, editX+editWidth+2, |
1034 editY+scrollBarPos+scrollBarSize); | 1029 editY+scrollBarPos+scrollBarSize); |
1035 } | 1030 } |
1036 } | 1031 } |
1037 | 1032 |
1038 /* SOFTKEYS */ | 1033 /* SOFTKEYS */ |
1039 | 1034 |
1040 if (data->editor_data.zone_id & ZONE_SOFTKEYS) | 1035 if (data->editor_data.zone_id & ZONE_SOFTKEYS) |
1041 { | 1036 { |
1042 #ifdef EASY_TEXT_ENABLED | 1037 #ifdef EASY_TEXT_ENABLED |
1043 /* If a word is being entered, display OK and Delete */ | 1038 /* If a word is being entered, display OK and Delete */ |
1044 | 1039 |
1045 if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && data->predText.len!=0 && FFS_flashData.PredTextSelected == TRUE) | 1040 if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && data->predText.len!=0 && FFS_flashData.PredTextSelected == TRUE) |
1046 { | 1041 { |
1047 leftSK = TxtSoftOK; | 1042 leftSK = TxtSoftOK; |
1048 rightSK = TxtDelete; | 1043 rightSK = TxtDelete; |
1049 } | 1044 } |
1050 else | 1045 else |
1051 #endif | 1046 #endif |
1052 { | 1047 { |
1053 /* Entered less than the required number of chars: Alternate Left Softkey appears */ | 1048 /* Entered less than the required number of chars: Alternate Left Softkey appears */ |
1054 if (textLen < data->editor_data.min_enter) | 1049 if (textLen < data->editor_data.min_enter) |
1055 { | 1050 { |
1056 leftSK = data->editor_data.AltLeftSoftKey; | 1051 leftSK = data->editor_data.AltLeftSoftKey; |
1057 } | 1052 } |
1058 else | 1053 else |
1059 { | 1054 { |
1060 leftSK = data->editor_data.LeftSoftKey; | 1055 leftSK = data->editor_data.LeftSoftKey; |
1061 } | 1056 } |
1062 /* Buffer is empty and alternative rsk enabled: alternative rsk appears */ | 1057 /* Buffer is empty and alternative rsk enabled: alternative rsk appears */ |
1063 if (textLen==0 && data->editor_data.change_rsk_on_empty) | 1058 if (textLen==0 && data->editor_data.change_rsk_on_empty) |
1064 { | 1059 { |
1065 rightSK = data->editor_data.AltRightSoftKey; | 1060 rightSK = data->editor_data.AltRightSoftKey; |
1066 } | 1061 } |
1067 else | 1062 else |
1068 { | 1063 { |
1069 rightSK = data->editor_data.RightSoftKey; | 1064 rightSK = data->editor_data.RightSoftKey; |
1070 } | 1065 } |
1071 } | 1066 } |
1072 displaySoftKeys(leftSK, rightSK); | 1067 displaySoftKeys(leftSK, rightSK); |
1073 } | 1068 } |
1074 | 1069 |
1075 /* Finished drawing screen */ | 1070 /* Finished drawing screen */ |
1076 } | 1071 } |
1077 break; | 1072 break; |
1078 | 1073 |
1079 default: | 1074 default: |
1080 return MFW_EVENT_PASSED; | 1075 return MFW_EVENT_PASSED; |
1081 // break; // RAVI | 1076 // break; // RAVI |
1082 } | 1077 } |
1083 | 1078 |
1084 data->editor->update = ED_UPDATE_DEFAULT; | 1079 data->editor->update = ED_UPDATE_DEFAULT; |
1085 | 1080 |
1086 return MFW_EVENT_CONSUMED; | 1081 return MFW_EVENT_CONSUMED; |
1087 } | 1082 } |
1088 | 1083 |
1089 | 1084 |
1090 /******************************************************************************* | 1085 /******************************************************************************* |
1091 | 1086 |
1092 $Function: AUI_edit_KbdCb | 1087 $Function: AUI_edit_KbdCb |
1093 | 1088 |
1094 $Description: Editor keyboard event handler | 1089 $Description: Editor keyboard event handler |
1095 | 1090 |
1096 $Returns: None. | 1091 $Returns: None. |
1097 | 1092 |
1098 $Arguments: event - the keyboard event | 1093 $Arguments: event - the keyboard event |
1099 keyboard | 1094 keyboard |
1100 | 1095 |
1101 *******************************************************************************/ | 1096 *******************************************************************************/ |
1102 | 1097 |
1103 static int AUI_edit_KbdCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) | 1098 static int AUI_edit_KbdCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) |
1104 { | 1099 { |
1105 T_MFW_HND win = mfw_parent (mfw_header()); | 1100 T_MFW_HND win = mfw_parent (mfw_header()); |
1106 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 1101 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
1107 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 1102 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
1108 #if (BOARD != 61) && defined(EASY_TEXT_ENABLED) | 1103 #if (BOARD != 61) && defined(EASY_TEXT_ENABLED) |
1109 T_ATB_TEXT *PredText = &data->predText; | 1104 T_ATB_TEXT *PredText = &data->predText; |
1110 USHORT character; | 1105 USHORT character; |
1111 #endif | 1106 #endif |
1112 ED_RES result; | 1107 ED_RES result; |
1113 | 1108 |
1114 TRACE_FUNCTION("AUI_edit_KbdCb()"); | 1109 TRACE_FUNCTION("AUI_edit_KbdCb()"); |
1115 | 1110 |
1116 /* Suppress unwanted long keypresses */ | 1111 /* Suppress unwanted long keypresses */ |
1117 | 1112 |
1118 data->doNextLongPress = TRUE; /* next Key_long event is correct */ | 1113 data->doNextLongPress = TRUE; /* next Key_long event is correct */ |
1119 | 1114 |
1120 /* Restart the timer */ | 1115 /* Restart the timer */ |
1121 | 1116 |
1122 if (data->timer !=NULL) | 1117 if (data->timer !=NULL) |
1123 { | 1118 { |
1124 tim_stop(data->timer); | 1119 tim_stop(data->timer); |
1125 tim_start(data->timer); | 1120 tim_start(data->timer); |
1126 } | 1121 } |
1127 | 1122 |
1128 #ifdef EASY_TEXT_ENABLED | 1123 #ifdef EASY_TEXT_ENABLED |
1129 if (FFS_flashData.PredTextSelected==FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) | 1124 if (FFS_flashData.PredTextSelected==FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) |
1130 { | 1125 { |
1131 /* Predictive text is off */ | 1126 /* Predictive text is off */ |
1132 #endif | 1127 #endif |
1133 | 1128 |
1134 switch (keyboard->code) | 1129 switch (keyboard->code) |
1135 { | 1130 { |
1136 /* UP key */ | 1131 /* UP key */ |
1137 | 1132 |
1138 case KCD_MNUUP: | 1133 case KCD_MNUUP: |
1139 /* For DSample, up and down move cursor up and down a line in all modes */ | 1134 /* For DSample, up and down move cursor up and down a line in all modes */ |
1140 #ifdef LSCREEN | 1135 #ifdef LSCREEN |
1141 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); | 1136 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); |
1142 | 1137 |
1143 /* For other samples, up and down move left and right when not in read only mode */ | 1138 /* For other samples, up and down move left and right when not in read only mode */ |
1144 #else | 1139 #else |
1145 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Acts as up key in read-only mode */ | 1140 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Acts as up key in read-only mode */ |
1146 { | 1141 { |
1147 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); | 1142 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); |
1148 } | 1143 } |
1149 else | 1144 else |
1150 { | 1145 { |
1151 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); | 1146 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); |
1152 } | 1147 } |
1153 #endif | 1148 #endif |
1154 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ | 1149 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ |
1155 win_show(data->win); | 1150 win_show(data->win); |
1156 break; | 1151 break; |
1157 | 1152 |
1158 /* DOWN key */ | 1153 /* DOWN key */ |
1159 | 1154 |
1160 case KCD_MNUDOWN: | 1155 case KCD_MNUDOWN: |
1161 /* For DSample, up and down move cursor up and down a line in all modes */ | 1156 /* For DSample, up and down move cursor up and down a line in all modes */ |
1162 #ifdef LSCREEN | 1157 #ifdef LSCREEN |
1163 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); | 1158 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); |
1164 | 1159 |
1165 /* For other samples, up and down move left and right when not in read only mode */ | 1160 /* For other samples, up and down move left and right when not in read only mode */ |
1166 #else | 1161 #else |
1167 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Act as down key in read-only mode */ | 1162 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* Act as down key in read-only mode */ |
1168 { | 1163 { |
1169 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); | 1164 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); |
1170 } | 1165 } |
1171 else | 1166 else |
1172 { | 1167 { |
1173 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Otherwise, move cursor left */ | 1168 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Otherwise, move cursor left */ |
1174 } | 1169 } |
1175 #endif | 1170 #endif |
1176 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1171 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1177 win_show(data->win); | 1172 win_show(data->win); |
1178 break; | 1173 break; |
1179 | 1174 |
1180 /* For DSample, left and right keys move cursor left and right */ | 1175 /* For DSample, left and right keys move cursor left and right */ |
1181 #ifdef LSCREEN | 1176 #ifdef LSCREEN |
1182 | 1177 |
1183 /* MENU LEFT */ | 1178 /* MENU LEFT */ |
1184 | 1179 |
1185 case KCD_MNULEFT: | 1180 case KCD_MNULEFT: |
1186 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ | 1181 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ |
1187 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1182 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1188 win_show(data->win); | 1183 win_show(data->win); |
1189 break; | 1184 break; |
1190 | 1185 |
1191 /* MENU RIGHT */ | 1186 /* MENU RIGHT */ |
1192 | 1187 |
1193 case KCD_MNURIGHT: | 1188 case KCD_MNURIGHT: |
1194 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ | 1189 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ |
1195 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1190 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1196 win_show(data->win); | 1191 win_show(data->win); |
1197 break; | 1192 break; |
1198 #endif | 1193 #endif |
1199 | 1194 |
1200 /* LEFT SOFT KEY */ | 1195 /* LEFT SOFT KEY */ |
1201 | 1196 |
1202 case KCD_LEFT: | 1197 case KCD_LEFT: |
1203 if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) | 1198 if (data->editor_data.editor_attr.text.len < data->editor_data.min_enter) |
1204 { | 1199 { |
1205 /* Entered less than the required number of chars */ | 1200 /* Entered less than the required number of chars */ |
1206 if (data->editor_data.AltLeftSoftKey!=TxtNull) | 1201 if (data->editor_data.AltLeftSoftKey!=TxtNull) |
1207 { | 1202 { |
1208 /* an alternate softkey is defined: execute it */ | 1203 /* an alternate softkey is defined: execute it */ |
1209 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); | 1204 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_ALTERNATELEFT, NULL); |
1210 } | 1205 } |
1211 } | 1206 } |
1212 else if (data->editor_data.LeftSoftKey!=TxtNull) | 1207 else if (data->editor_data.LeftSoftKey!=TxtNull) |
1213 { | 1208 { |
1214 /* Left Softkey is enabled (and entered sufficient number of chars): execute it | 1209 /* Left Softkey is enabled (and entered sufficient number of chars): execute it |
1215 * get the orginal text back into the editor instead of the hide buffer ( only filled with '*') */ | 1210 * get the orginal text back into the editor instead of the hide buffer ( only filled with '*') */ |
1216 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) | 1211 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) |
1217 { | 1212 { |
1218 ATB_edit_HiddenExit(data->editor); | 1213 ATB_edit_HiddenExit(data->editor); |
1219 } | 1214 } |
1220 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); | 1215 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); |
1221 } | 1216 } |
1222 break; | 1217 break; |
1223 | 1218 |
1224 /* HANGUP key */ | 1219 /* HANGUP key */ |
1225 | 1220 |
1226 case KCD_HUP: | 1221 case KCD_HUP: |
1227 if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ | 1222 if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ |
1228 { | 1223 { |
1229 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); /* Deinitialise the editor */ | 1224 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); /* Deinitialise the editor */ |
1230 } | 1225 } |
1231 break; | 1226 break; |
1232 | 1227 |
1233 /* SEND KEY */ | 1228 /* SEND KEY */ |
1234 | 1229 |
1235 case KCD_CALL: | 1230 case KCD_CALL: |
1236 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) | 1231 if (data->editor_data.editor_attr.text.len >= data->editor_data.min_enter) |
1237 { | |
1238 /* Send this event to generate an MO call in SMS editor */ | |
1239 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_CALL, NULL); | |
1240 } | |
1241 break; | |
1242 | |
1243 /* RIGHT SOFT KEY */ | |
1244 | |
1245 case KCD_RIGHT: | |
1246 TRACE_EVENT("KCD_RIGHT"); | |
1247 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* in read only mode, */ | |
1248 { | |
1249 TRACE_EVENT("SENDING DEINIT EVENT"); | |
1250 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); /* just deinitialise editor */ | |
1251 } | |
1252 else /* otherwise, RSK acts as clear key */ | |
1253 { | 1232 { |
1254 /* If multitap is in progress, delete current character | 1233 /* Send this event to generate an MO call in SMS editor */ |
1255 * rather than previous character */ | 1234 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_CALL, NULL); |
1256 | |
1257 if (data->editor->multitap) | |
1258 { | |
1259 AUI_entry_StopMultitap(data->entry_data); /* Cancel multitap */ | |
1260 result = ATB_edit_DeleteRight(data->editor, TRUE); /* SPR#2342 - SH */ | |
1261 } | |
1262 else | |
1263 { | |
1264 result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ | |
1265 } | |
1266 | |
1267 /* If we delete from first character in the editor, exit editor */ | |
1268 if (result==ED_DONE) | |
1269 { | |
1270 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); | |
1271 } | |
1272 else | |
1273 { | |
1274 win_show(data->win); | |
1275 } | |
1276 } | 1235 } |
1277 break; | 1236 break; |
1278 | 1237 |
1279 /* Switch text mode: uppercase, lowercase */ | 1238 /* RIGHT SOFT KEY */ |
1280 case KCD_HASH: | 1239 |
1281 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | 1240 case KCD_RIGHT: |
1282 { | 1241 TRACE_EVENT("KCD_RIGHT"); |
1283 // Jul 22,2004 CRR:21605 xrashmic - SASKEN | 1242 if (ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* in read only mode, */ |
1284 // The user has explicitly changed the case. When | 1243 { |
1285 // the editor becomes empty, we should not reset the | 1244 TRACE_EVENT("SENDING DEINIT EVENT"); |
1286 // case to sentence case | 1245 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); /* just deinitialise editor */ |
1287 CaseChanged=TRUE; | 1246 } |
1288 switch(ATB_edit_GetCase(data->editor)) | 1247 else /* otherwise, RSK acts as clear key */ |
1289 { | 1248 { |
1290 case ED_CASE_LOWER: | 1249 /* If multitap is in progress, delete current character |
1291 // Jul 22,2004 CRR:21605 xrashmic - SASKEN | 1250 * rather than previous character */ |
1292 // The user has changed the case to sentence case. | 1251 |
1293 // when the editor becomes empty, we have to reset | 1252 if (data->editor->multitap) |
1294 // the case to sentence case. | 1253 { |
1295 CaseChanged=FALSE; | 1254 AUI_entry_StopMultitap(data->entry_data); /* Cancel multitap */ |
1296 ATB_edit_SetCase(data->editor, ED_CASE_CAPS); | 1255 result = ATB_edit_DeleteRight(data->editor, TRUE); /* SPR#2342 - SH */ |
1297 break; | 1256 } |
1298 case ED_CASE_CAPS: | 1257 else |
1299 ATB_edit_SetCase(data->editor, ED_CASE_UPPER); | 1258 { |
1300 break; | 1259 result = ATB_edit_DeleteLeft(data->editor, TRUE); /* SPR#2342 - SH */ |
1301 case ED_CASE_UPPER: | 1260 } |
1302 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1261 |
1303 | 1262 /* If we delete from first character in the editor, exit editor */ |
1304 /* If easy text selected, switch to it */ | 1263 if (result==ED_DONE) |
1264 { | |
1265 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); | |
1266 } | |
1267 else | |
1268 { | |
1269 win_show(data->win); | |
1270 } | |
1271 } | |
1272 break; | |
1273 | |
1274 /* Switch text mode: uppercase, lowercase */ | |
1275 case KCD_HASH: | |
1276 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | |
1277 { | |
1278 // Jul 22,2004 CRR:21605 xrashmic - SASKEN | |
1279 // The user has explicitly changed the case. When | |
1280 // the editor becomes empty, we should not reset the | |
1281 // case to sentence case | |
1282 CaseChanged=TRUE; | |
1283 switch(ATB_edit_GetCase(data->editor)) | |
1284 { | |
1285 case ED_CASE_LOWER: | |
1286 // Jul 22,2004 CRR:21605 xrashmic - SASKEN | |
1287 // The user has changed the case to sentence case. | |
1288 // when the editor becomes empty, we have to reset | |
1289 // the case to sentence case. | |
1290 CaseChanged=FALSE; | |
1291 ATB_edit_SetCase(data->editor, ED_CASE_CAPS); | |
1292 break; | |
1293 case ED_CASE_CAPS: | |
1294 ATB_edit_SetCase(data->editor, ED_CASE_UPPER); | |
1295 break; | |
1296 case ED_CASE_UPPER: | |
1297 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | |
1298 | |
1299 /* If easy text selected, switch to it */ | |
1305 #ifdef EASY_TEXT_ENABLED | 1300 #ifdef EASY_TEXT_ENABLED |
1306 if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextAvailable) | 1301 if (ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT) && FFS_flashData.PredTextAvailable) |
1307 { | 1302 { |
1308 FFS_flashData.PredTextSelected = TRUE; | 1303 FFS_flashData.PredTextSelected = TRUE; |
1309 } | 1304 } |
1310 #endif | 1305 #endif |
1311 break; | 1306 break; |
1312 case ED_CASE_NUM: | 1307 case ED_CASE_NUM: |
1313 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1308 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); |
1314 break; | 1309 break; |
1315 } | 1310 } |
1316 } | 1311 } |
1317 else | 1312 else |
1318 { | 1313 { |
1319 /* SPR#1788 - SH - Forbid '#' entry in read only mode */ | 1314 /* SPR#1788 - SH - Forbid '#' entry in read only mode */ |
1320 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) | 1315 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) |
1321 AUI_entry_EventKey(data->entry_data, event, keyboard); | 1316 AUI_entry_EventKey(data->entry_data, event, keyboard); |
1322 } | 1317 } |
1323 | 1318 |
1324 win_show(data->win); | 1319 win_show(data->win); |
1325 break; | 1320 break; |
1326 | 1321 |
1327 case (KCD_STAR): | 1322 case (KCD_STAR): |
1328 /* If we're in apha mode and not in read-only mode, display the symbol screen */ | 1323 /* If we're in apha mode and not in read-only mode, display the symbol screen */ |
1329 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && !ATB_edit_Mode(data->editor, ED_MODE_READONLY)) | 1324 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA) && !ATB_edit_Mode(data->editor, ED_MODE_READONLY)) |
1330 { | 1325 { |
1331 AUI_symbol_Start (data->win, E_ED_INSERT); | 1326 AUI_symbol_Start (data->win, E_ED_INSERT); |
1332 } | 1327 } |
1333 else | 1328 else |
1334 { | 1329 { |
1335 /* SPR#1788 - SH - Allow '*' to be entered in numeric mode */ | 1330 /* SPR#1788 - SH - Allow '*' to be entered in numeric mode */ |
1336 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) | 1331 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) |
1337 AUI_entry_EventKey(data->entry_data, event, keyboard); | 1332 AUI_entry_EventKey(data->entry_data, event, keyboard); |
1338 } | 1333 } |
1339 | 1334 |
1340 win_show(data->win); | 1335 win_show(data->win); |
1341 break; | 1336 break; |
1342 | 1337 |
1343 /* KEY ENTRY 0 - 9 */ | 1338 /* KEY ENTRY 0 - 9 */ |
1344 | 1339 |
1345 case KCD_0: | 1340 case KCD_0: |
1346 case KCD_1: | 1341 case KCD_1: |
1347 case KCD_2: | 1342 case KCD_2: |
1348 case KCD_3: | 1343 case KCD_3: |
1349 case KCD_4: | 1344 case KCD_4: |
1350 case KCD_5: | 1345 case KCD_5: |
1351 case KCD_6: | 1346 case KCD_6: |
1352 case KCD_7: | 1347 case KCD_7: |
1353 case KCD_8: | 1348 case KCD_8: |
1354 case KCD_9: | 1349 case KCD_9: |
1355 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) | 1350 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) |
1356 { | 1351 { |
1357 AUI_entry_EventKey(data->entry_data, event, keyboard); | 1352 AUI_entry_EventKey(data->entry_data, event, keyboard); |
1358 win_show(data->win); | 1353 win_show(data->win); |
1359 } | 1354 } |
1360 break; | 1355 break; |
1361 } | 1356 } |
1362 | 1357 |
1363 #ifdef EASY_TEXT_ENABLED | 1358 #ifdef EASY_TEXT_ENABLED |
1364 } | 1359 } |
1365 else | 1360 else |
1366 | 1361 |
1367 /* Short key press in EasyText */ | 1362 /* Short key press in EasyText */ |
1368 | 1363 |
1369 { | 1364 { |
1370 if(FFS_flashData.PredTextAvailable == TRUE) | 1365 if(FFS_flashData.PredTextAvailable == TRUE) |
1371 { | 1366 { |
1372 switch (keyboard->code) | 1367 switch (keyboard->code) |
1373 { | 1368 { |
1374 case KCD_MNUUP: | 1369 case KCD_MNUUP: |
1375 if(PredText->len==0) | 1370 if(PredText->len==0) |
1376 { | 1371 { |
1377 #ifdef LSCREEN | 1372 #ifdef LSCREEN |
1378 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); | 1373 ATB_edit_MoveCursor(data->editor, ctrlUp, TRUE); |
1379 | 1374 |
1380 /* For other samples, up and down move left and right when not in read only mode */ | 1375 /* For other samples, up and down move left and right when not in read only mode */ |
1381 #else | 1376 #else |
1382 ATB_edit_MoveCursor(data->editor,ctrlRight, TRUE); | 1377 ATB_edit_MoveCursor(data->editor,ctrlRight, TRUE); |
1383 #endif | 1378 #endif |
1384 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ | 1379 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ |
1385 win_show(data->win); | 1380 win_show(data->win); |
1386 } | 1381 } |
1387 break; | 1382 break; |
1388 | 1383 |
1389 case KCD_MNUDOWN: | 1384 case KCD_MNUDOWN: |
1390 if(PredText->len==0) | 1385 if(PredText->len==0) |
1391 { | 1386 { |
1392 #ifdef LSCREEN | 1387 #ifdef LSCREEN |
1393 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); | 1388 ATB_edit_MoveCursor(data->editor, ctrlDown, TRUE); |
1394 | 1389 |
1395 /* For other samples, up and down move left and right when not in read only mode */ | 1390 /* For other samples, up and down move left and right when not in read only mode */ |
1396 #else | 1391 #else |
1397 ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); | 1392 ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); |
1398 #endif | 1393 #endif |
1399 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ | 1394 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ |
1400 win_show(data->win); | 1395 win_show(data->win); |
1401 } | 1396 } |
1402 break; | 1397 break; |
1403 | 1398 |
1404 #ifdef LSCREEN | 1399 #ifdef LSCREEN |
1405 case KCD_MNURIGHT: | 1400 case KCD_MNURIGHT: |
1406 if(PredText->len==0) | 1401 if(PredText->len==0) |
1407 { | 1402 { |
1408 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); | 1403 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); |
1409 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ | 1404 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ |
1410 win_show(data->win); | 1405 win_show(data->win); |
1411 } | 1406 } |
1412 break; | 1407 break; |
1413 | 1408 |
1414 case KCD_MNULEFT: | 1409 case KCD_MNULEFT: |
1415 if(PredText->len==0) | 1410 if(PredText->len==0) |
1416 { | 1411 { |
1417 ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); | 1412 ATB_edit_MoveCursor(data->editor,ctrlLeft, TRUE); |
1418 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ | 1413 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update */ |
1419 win_show(data->win); | 1414 win_show(data->win); |
1420 } | 1415 } |
1421 break; | 1416 break; |
1422 #endif | 1417 #endif |
1423 | 1418 |
1424 case KCD_LEFT: | 1419 case KCD_LEFT: |
1425 if(PredText->len==0) | 1420 if(PredText->len==0) |
1426 { | 1421 { |
1427 if (data->editor_data.LeftSoftKey NEQ TxtNull) | 1422 if (data->editor_data.LeftSoftKey NEQ TxtNull) |
1428 { | 1423 { |
1429 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); | 1424 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_LEFT, NULL); |
1430 } | 1425 } |
1431 } | 1426 } |
1432 else | 1427 else |
1433 { | 1428 { |
1434 if ((data->editor_data.editor_attr.text.len + PredText->len) < data->editor_data.editor_attr.size) | 1429 if ((data->editor_data.editor_attr.text.len + PredText->len) < data->editor_data.editor_attr.size) |
1435 { | 1430 { |
1436 if (ATB_string_GetChar(PredText,0)!=UNICODE_STAR) | 1431 if (ATB_string_GetChar(PredText,0)!=UNICODE_STAR) |
1437 { | 1432 { |
1438 /* Capitalise first letter of words and the letter 'I' */ | 1433 /* Capitalise first letter of words and the letter 'I' */ |
1439 | 1434 |
1440 if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText, 0)==ATB_char_Unicode('i'))) | 1435 if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText, 0)==ATB_char_Unicode('i'))) |
1441 { | 1436 { |
1442 ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ | 1437 ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ |
1443 } | 1438 } |
1444 character = ATB_edit_GetCursorChar(data->editor, -1); | 1439 character = ATB_edit_GetCursorChar(data->editor, -1); |
1445 | 1440 |
1446 if ( character != UNICODE_SPACE && character != UNICODE_EOLN) | 1441 if ( character != UNICODE_SPACE && character != UNICODE_EOLN) |
1447 { | 1442 { |
1448 ATB_string_MoveRight(PredText,0,1,ED_PREDTEXT_MAX); | 1443 ATB_string_MoveRight(PredText,0,1,ED_PREDTEXT_MAX); |
1449 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); | 1444 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); |
1450 } | 1445 } |
1451 ATB_edit_InsertString(data->editor,PredText); | 1446 ATB_edit_InsertString(data->editor,PredText); |
1452 } | 1447 } |
1453 } | 1448 } |
1454 ResetDictSearch(); | 1449 ResetDictSearch(); |
1455 AUI_edit_ClearPredText(data); | 1450 AUI_edit_ClearPredText(data); |
1456 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1451 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); |
1457 win_show(data->win); | 1452 win_show(data->win); |
1458 } | 1453 } |
1459 break; | 1454 break; |
1460 | 1455 |
1461 case KCD_HUP: | 1456 case KCD_HUP: |
1462 if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ | 1457 if (data->editor_data.RightSoftKey NEQ TxtNull) /* Right softkey is enabled: execute it */ |
1463 { | 1458 { |
1464 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); | 1459 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_HUP, NULL); |
1465 } | 1460 } |
1466 break; | 1461 break; |
1467 | 1462 |
1468 case KCD_RIGHT: | 1463 case KCD_RIGHT: |
1469 if(PredText->len==0) | 1464 if(PredText->len==0) |
1470 { | 1465 { |
1471 if(ATB_string_GetChar(&data->editor_data.editor_attr.text, 0)!=UNICODE_EOLN) | 1466 if(ATB_string_GetChar(&data->editor_data.editor_attr.text, 0)!=UNICODE_EOLN) |
1472 { | 1467 { |
1473 ATB_edit_Char(data->editor,ctrlBack,TRUE); | 1468 ATB_edit_Char(data->editor,ctrlBack,TRUE); |
1474 win_show(data->win); | 1469 win_show(data->win); |
1475 } | 1470 } |
1476 else | 1471 else |
1477 { | 1472 { |
1478 /* leave editor if buffer already empty */ | 1473 /* leave editor if buffer already empty */ |
1479 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); | 1474 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); |
1480 } | 1475 } |
1481 } | 1476 } |
1482 else | 1477 else |
1483 { | 1478 { |
1484 if (PredText->len==1) | 1479 if (PredText->len==1) |
1485 { | 1480 { |
1486 DictBackSpace((char *)data->predText.data); | 1481 DictBackSpace((char *)data->predText.data); |
1487 AUI_edit_ClearPredText(data); | 1482 AUI_edit_ClearPredText(data); |
1488 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1483 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); |
1489 } | 1484 } |
1490 else | 1485 else |
1491 { | 1486 { |
1492 DictBackSpace((char *)data->predText.data); | 1487 DictBackSpace((char *)data->predText.data); |
1493 data->predTextChar.pos--; /* char deleted, move cursor pos back */ | 1488 data->predTextChar.pos--; /* char deleted, move cursor pos back */ |
1494 AUI_edit_CalcPredText(data); | 1489 AUI_edit_CalcPredText(data); |
1495 } | 1490 } |
1496 win_show(data->win); | 1491 win_show(data->win); |
1497 } | 1492 } |
1498 break; | 1493 break; |
1499 | 1494 |
1500 case KCD_2: | 1495 case KCD_2: |
1501 case KCD_3: | 1496 case KCD_3: |
1502 case KCD_4: | 1497 case KCD_4: |
1503 case KCD_5: | 1498 case KCD_5: |
1504 case KCD_6: | 1499 case KCD_6: |
1505 case KCD_7: | 1500 case KCD_7: |
1506 case KCD_8: | 1501 case KCD_8: |
1507 case KCD_9: | 1502 case KCD_9: |
1508 if (PredText->len==0) | 1503 if (PredText->len==0) |
1509 { | 1504 { |
1510 AUI_edit_ClearPredText(data); | 1505 AUI_edit_ClearPredText(data); |
1511 } | 1506 } |
1512 if (DictAlphaKeyPress(keyboard->code,(char *)PredText->data)) | 1507 if (DictAlphaKeyPress(keyboard->code,(char *)PredText->data)) |
1513 { | 1508 { |
1514 PredText->len = ATB_string_Length(PredText); | 1509 PredText->len = ATB_string_Length(PredText); |
1515 data->predTextChar.pos++; /* The keypress was used to find a word, advance cursor */ | 1510 data->predTextChar.pos++; /* The keypress was used to find a word, advance cursor */ |
1516 AUI_edit_CalcPredText(data); | 1511 AUI_edit_CalcPredText(data); |
1517 } | 1512 } |
1518 win_show(data->win); | 1513 win_show(data->win); |
1519 break; | 1514 break; |
1520 | 1515 |
1521 case KCD_HASH: | 1516 case KCD_HASH: |
1522 switch(ATB_edit_GetCase(data->editor)) | 1517 switch(ATB_edit_GetCase(data->editor)) |
1523 { | 1518 { |
1524 /* Press # once to switch into capitalise mode */ | 1519 /* Press # once to switch into capitalise mode */ |
1525 case ED_CASE_CAPS: | 1520 case ED_CASE_CAPS: |
1526 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1521 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); |
1527 /* Switch out of easy text mode, if we're not entering a word */ | 1522 /* Switch out of easy text mode, if we're not entering a word */ |
1528 if (PredText->len==0) | 1523 if (PredText->len==0) |
1529 { | 1524 { |
1530 FFS_flashData.PredTextSelected = FALSE; | 1525 FFS_flashData.PredTextSelected = FALSE; |
1531 } | 1526 } |
1532 break; | 1527 break; |
1533 default: | 1528 default: |
1534 ATB_edit_SetCase(data->editor, ED_CASE_CAPS); | 1529 ATB_edit_SetCase(data->editor, ED_CASE_CAPS); |
1535 break; | 1530 break; |
1536 } | 1531 } |
1537 win_show(data->win); | 1532 win_show(data->win); |
1538 break; | 1533 break; |
1539 | 1534 |
1540 case KCD_STAR: | 1535 case KCD_STAR: |
1541 if (PredText->len==0) | 1536 if (PredText->len==0) |
1542 { | 1537 { |
1543 AUI_symbol_Start (data->win, E_ED_INSERT); | 1538 AUI_symbol_Start (data->win, E_ED_INSERT); |
1544 } | 1539 } |
1545 else | 1540 else |
1546 { | 1541 { |
1547 int i; | 1542 int i; |
1548 MoreCandidates((char *)PredText->data, &i); | 1543 MoreCandidates((char *)PredText->data, &i); |
1549 AUI_edit_CalcPredText(data); | 1544 AUI_edit_CalcPredText(data); |
1550 win_show(data->win); | 1545 win_show(data->win); |
1551 } | 1546 } |
1552 break; | 1547 break; |
1553 | 1548 |
1554 case KCD_0: | 1549 case KCD_0: |
1555 case KCD_1: | 1550 case KCD_1: |
1556 if (PredText->len!=0) | 1551 if (PredText->len!=0) |
1557 { | 1552 { |
1558 if ((data->editor_data.editor_attr.text.len + PredText->len) < MAX_MSG_LEN) | 1553 if ((data->editor_data.editor_attr.text.len + PredText->len) < MAX_MSG_LEN) |
1559 { | 1554 { |
1560 /* If char b4 cursor full stop/question/exclamation (or last char space and char b4 full stop) */ | 1555 /* If char b4 cursor full stop/question/exclamation (or last char space and char b4 full stop) */ |
1561 if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText,0)==ATB_char_Unicode('i'))) | 1556 if (ATB_edit_CapitaliseWord(data->editor) || (PredText->len==1 && ATB_string_GetChar(PredText,0)==ATB_char_Unicode('i'))) |
1562 ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ | 1557 ATB_string_SetChar(PredText, 0, ATB_edit_FindCapital(ATB_string_GetChar(PredText, 0)));/*SPR1508*/ |
1563 | 1558 |
1564 /* Capitalise first letter of char. If char before cursor not space, insert space */ | 1559 /* Capitalise first letter of char. If char before cursor not space, insert space */ |
1565 character = ATB_edit_GetCursorChar(data->editor, -1); | 1560 character = ATB_edit_GetCursorChar(data->editor, -1); |
1566 | 1561 |
1567 if (ATB_string_GetChar(PredText, 0) != UNICODE_STAR) | 1562 if (ATB_string_GetChar(PredText, 0) != UNICODE_STAR) |
1568 { | 1563 { |
1569 if (keyboard->code == KCD_1) | 1564 if (keyboard->code == KCD_1) |
1570 { | 1565 { |
1571 /* Insert space at end of string */ | 1566 /* Insert space at end of string */ |
1572 ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); | 1567 ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); |
1573 PredText->len++; | 1568 PredText->len++; |
1574 ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); | 1569 ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); |
1575 | 1570 |
1576 if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) | 1571 if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) |
1577 { | 1572 { |
1578 /* Insert space at start of string */ | 1573 /* Insert space at start of string */ |
1579 ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); | 1574 ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); |
1580 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); | 1575 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); |
1581 } | 1576 } |
1582 } | 1577 } |
1583 else | 1578 else |
1584 { | 1579 { |
1585 /* Insert space and full stop at end of string */ | 1580 /* Insert space and full stop at end of string */ |
1586 ATB_string_SetChar(PredText, PredText->len, UNICODE_FULLSTOP); | 1581 ATB_string_SetChar(PredText, PredText->len, UNICODE_FULLSTOP); |
1587 PredText->len++; | 1582 PredText->len++; |
1588 ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); | 1583 ATB_string_SetChar(PredText, PredText->len, UNICODE_SPACE); |
1589 PredText->len++; | 1584 PredText->len++; |
1590 ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); | 1585 ATB_string_SetChar(PredText, PredText->len, UNICODE_EOLN); |
1591 | 1586 |
1592 if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) | 1587 if ( character!=UNICODE_SPACE && character!=UNICODE_EOLN) |
1593 { | 1588 { |
1594 /* Insert space at start of string */ | 1589 /* Insert space at start of string */ |
1595 ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); | 1590 ATB_string_MoveRight(PredText, 0, 1, ED_PREDTEXT_MAX); |
1596 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); | 1591 ATB_string_SetChar(PredText, 0, UNICODE_SPACE); |
1597 } | 1592 } |
1598 } | 1593 } |
1599 ATB_edit_InsertString(data->editor, PredText); | 1594 ATB_edit_InsertString(data->editor, PredText); |
1600 } | 1595 } |
1601 } | 1596 } |
1602 AUI_edit_ClearPredText(data); | 1597 AUI_edit_ClearPredText(data); |
1603 ResetDictSearch(); | 1598 ResetDictSearch(); |
1604 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); | 1599 ATB_edit_SetCase(data->editor, ED_CASE_LOWER); |
1605 win_show(data->win); | 1600 win_show(data->win); |
1606 } | 1601 } |
1607 break; | 1602 break; |
1608 | 1603 |
1609 /* Any key */ | 1604 /* Any key */ |
1610 | 1605 |
1611 default: | 1606 default: |
1612 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ | 1607 if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ |
1613 { | 1608 { |
1614 AUI_entry_EventKey(data->entry_data, event, keyboard); | 1609 AUI_entry_EventKey(data->entry_data, event, keyboard); |
1615 ATB_edit_Char(data->editor,ctrlBack,TRUE); | 1610 ATB_edit_Char(data->editor,ctrlBack,TRUE); |
1616 win_show(data->win); | 1611 win_show(data->win); |
1617 } | 1612 } |
1618 break; | 1613 break; |
1619 } | 1614 } |
1620 } | 1615 } |
1621 } | 1616 } |
1622 #endif | 1617 #endif |
1623 | 1618 |
1624 return MFW_EVENT_CONSUMED; | 1619 return MFW_EVENT_CONSUMED; |
1625 } | 1620 } |
1626 | 1621 |
1627 | 1622 |
1628 /******************************************************************************* | 1623 /******************************************************************************* |
1629 | 1624 |
1630 $Function: AUI_edit_KbdLongCb | 1625 $Function: AUI_edit_KbdLongCb |
1631 | 1626 |
1632 $Description: Editor keyboard event handler for long keypresses | 1627 $Description: Editor keyboard event handler for long keypresses |
1633 | 1628 |
1634 $Returns: None. | 1629 $Returns: None. |
1635 | 1630 |
1636 $Arguments: event - the keyboard event | 1631 $Arguments: event - the keyboard event |
1637 keyboard | 1632 keyboard |
1638 | 1633 |
1639 *******************************************************************************/ | 1634 *******************************************************************************/ |
1640 | 1635 |
1641 static int AUI_edit_KbdLongCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) | 1636 static int AUI_edit_KbdLongCb(T_MFW_EVENT event, T_MFW_KBD *keyboard) |
1642 { | 1637 { |
1643 T_MFW_HND win = mfw_parent (mfw_header()); | 1638 T_MFW_HND win = mfw_parent (mfw_header()); |
1644 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 1639 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
1645 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 1640 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
1646 | 1641 |
1647 #if (BOARD != 61) && defined(EASY_TEXT_ENABLED) | 1642 #if (BOARD != 61) && defined(EASY_TEXT_ENABLED) |
1648 T_ATB_TEXT *PredText = &data->predText; | 1643 T_ATB_TEXT *PredText = &data->predText; |
1649 #endif | 1644 #endif |
1650 | 1645 |
1651 ED_RES result; | 1646 ED_RES result; |
1652 | 1647 |
1653 #ifdef TRACE_AUIEditor | 1648 #ifdef TRACE_AUIEditor |
1654 TRACE_FUNCTION("AUI_edit_KbdLongCb()"); | 1649 TRACE_FUNCTION("AUI_edit_KbdLongCb()"); |
1655 #endif | 1650 #endif |
1656 | 1651 |
1657 /* Suppress unwanted long keypresses */ | 1652 /* Suppress unwanted long keypresses */ |
1658 | 1653 |
1659 if ( data->doNextLongPress ) | 1654 if ( data->doNextLongPress ) |
1660 data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ | 1655 data->doNextLongPress = FALSE; /* mark Key_long event as consumed but do current long press */ |
1661 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN | 1656 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN |
1662 // Description: By Long press on Left/Right key at 'Message Editor' screen, | 1657 // Description: By Long press on Left/Right key at 'Message Editor' screen, |
1663 // cursor not scrolling continuously | 1658 // cursor not scrolling continuously |
1664 // Fix: The continuous long press of a key was being ignored for all keys. | 1659 // Fix: The continuous long press of a key was being ignored for all keys. |
1665 // Now only for left and right keys this is handled. | 1660 // Now only for left and right keys this is handled. |
1666 else if(!(keyboard->code==KCD_MNULEFT ||keyboard->code== KCD_MNURIGHT)) | 1661 else if(!(keyboard->code==KCD_MNULEFT ||keyboard->code== KCD_MNURIGHT)) |
1667 { | 1662 { |
1668 return MFW_EVENT_CONSUMED; /* don't do current long press */ | 1663 return MFW_EVENT_CONSUMED; /* don't do current long press */ |
1669 } | 1664 } |
1670 | 1665 |
1671 /* Restart the timer */ | 1666 /* Restart the timer */ |
1672 | 1667 |
1673 if (data->timer !=NULL) | 1668 if (data->timer !=NULL) |
1674 { | 1669 { |
1675 tim_stop(data->timer); | 1670 tim_stop(data->timer); |
1676 tim_start(data->timer); | 1671 tim_start(data->timer); |
1677 } | 1672 } |
1678 | 1673 |
1679 #ifdef EASY_TEXT_ENABLED | 1674 #ifdef EASY_TEXT_ENABLED |
1680 if (FFS_flashData.PredTextSelected == FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) { | 1675 if (FFS_flashData.PredTextSelected == FALSE || !ATB_edit_Mode(data->editor, ED_MODE_PREDTEXT)) { |
1681 /* Predictive text is off */ | 1676 /* Predictive text is off */ |
1682 #endif | 1677 #endif |
1683 | 1678 |
1684 switch (keyboard->code) | 1679 switch (keyboard->code) |
1685 { | 1680 { |
1686 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN | 1681 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN |
1687 // Description: By Long press on Left/Right key at 'Message Editor' screen, | 1682 // Description: By Long press on Left/Right key at 'Message Editor' screen, |
1688 // cursor not scrolling continuously | 1683 // cursor not scrolling continuously |
1689 // Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. | 1684 // Fix: The Long press of left/right key is now handled in AUI_edit_KbdLongCB. |
1690 case KCD_MNULEFT: | 1685 case KCD_MNULEFT: |
1691 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ | 1686 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ |
1692 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1687 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1693 win_show(data->win); | 1688 win_show(data->win); |
1694 break; | 1689 break; |
1695 case KCD_MNURIGHT: | 1690 case KCD_MNURIGHT: |
1696 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ | 1691 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ |
1697 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1692 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1698 win_show(data->win); | 1693 win_show(data->win); |
1699 break; | 1694 break; |
1700 | 1695 |
1701 case KCD_RIGHT: | 1696 case KCD_RIGHT: |
1702 result = ATB_edit_ClearAll(data->editor); /* Otherwise, clear the editor */ | 1697 result = ATB_edit_ClearAll(data->editor); /* Otherwise, clear the editor */ |
1703 | 1698 |
1704 /* If buffer is empty, right soft key causes exit from editor */ | 1699 /* If buffer is empty, right soft key causes exit from editor */ |
1705 if (result==ED_DONE) | 1700 if (result==ED_DONE) |
1706 { | 1701 { |
1707 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); | 1702 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); |
1708 } | 1703 } |
1709 else | 1704 else |
1710 { | 1705 { |
1711 win_show(data->win); | 1706 win_show(data->win); |
1712 } | 1707 } |
1713 break; | 1708 break; |
1714 | 1709 |
1715 /* KEY ENTRY 0 */ | 1710 /* KEY ENTRY 0 */ |
1716 | 1711 |
1717 case KCD_0: | 1712 case KCD_0: |
1718 /* Alpha mode: insert a '0' */ | 1713 /* Alpha mode: insert a '0' */ |
1719 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | 1714 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) |
1720 { | 1715 { |
1721 if (keyboard->code<=KCD_HASH) | 1716 if (keyboard->code<=KCD_HASH) |
1722 { | 1717 { |
1723 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ | 1718 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ |
1724 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap | 1719 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap |
1725 win_show(data->win); | 1720 win_show(data->win); |
1726 } | 1721 } |
1727 } | 1722 } |
1728 | 1723 |
1729 /* Number mode: insert a '+'*/ | 1724 /* Number mode: insert a '+'*/ |
1730 else if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ | 1725 else if (!ATB_edit_Mode(data->editor, ED_MODE_READONLY)) /* ignore normal keys if in read-only mode */ |
1731 { | 1726 { |
1732 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) /* in hidden mode do not allow entering of '+' */ | 1727 if (ATB_edit_Mode(data->editor, ED_MODE_HIDDEN)) /* in hidden mode do not allow entering of '+' */ |
1733 { | 1728 { |
1734 ATB_edit_DeleteLeft(data->editor, TRUE); /* remove the '0'. SPR#2342 - SH */ | 1729 ATB_edit_DeleteLeft(data->editor, TRUE); /* remove the '0'. SPR#2342 - SH */ |
1735 } | 1730 } |
1736 else | 1731 else |
1737 { | 1732 { |
1738 ATB_edit_Char(data->editor,ctrlBack,FALSE); /* remove the '0' */ | 1733 ATB_edit_Char(data->editor,ctrlBack,FALSE); /* remove the '0' */ |
1739 ATB_edit_Char(data->editor,UNICODE_PLUS,TRUE); /* insert the '+' */ | 1734 ATB_edit_Char(data->editor,UNICODE_PLUS,TRUE); /* insert the '+' */ |
1740 } | 1735 } |
1741 win_show(data->win); | 1736 win_show(data->win); |
1742 } | 1737 } |
1743 break; | 1738 break; |
1744 case (KCD_STAR): | 1739 case (KCD_STAR): |
1745 /* MZ cq11414 add Pause Character */ | 1740 /* MZ cq11414 add Pause Character */ |
1746 ATB_edit_DeleteLeft(data->editor, FALSE); | 1741 ATB_edit_DeleteLeft(data->editor, FALSE); |
1747 | 1742 |
1748 //Sep 2, 2004 REF: CRR 21370 xkundadu | 1743 //Sep 2, 2004 REF: CRR 21370 xkundadu |
1749 //Changed the long press of '*' key to display 'w' | 1744 //Changed the long press of '*' key to display 'w' |
1750 AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('w'), FALSE); | 1745 AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('w'), FALSE); |
1751 win_show(data->win); | 1746 win_show(data->win); |
1752 break; | 1747 break; |
1753 | 1748 |
1754 case (KCD_HASH): | 1749 case (KCD_HASH): |
1755 | 1750 |
1756 /* In alphanumeric mode, a long hold of # selects number case */ | 1751 /* In alphanumeric mode, a long hold of # selects number case */ |
1757 if (ATB_edit_GetCasePref(data->editor)==ED_CASEPREF_ALPHANUM) | 1752 if (ATB_edit_GetCasePref(data->editor)==ED_CASEPREF_ALPHANUM) |
1758 ATB_edit_SetCase(data->editor, ED_CASE_NUM); | 1753 ATB_edit_SetCase(data->editor, ED_CASE_NUM); |
1759 else | 1754 else |
1760 { | 1755 { |
1761 /* MZ cq11414 add Wait Character */ | 1756 /* MZ cq11414 add Wait Character */ |
1762 ATB_edit_DeleteLeft(data->editor, FALSE); | 1757 ATB_edit_DeleteLeft(data->editor, FALSE); |
1763 | 1758 |
1764 //Sep 2, 2004 REF: CRR 21370 xkundadu | 1759 //Sep 2, 2004 REF: CRR 21370 xkundadu |
1765 //Changed the long press of '#' key to display 'p' | 1760 //Changed the long press of '#' key to display 'p' |
1766 AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('p'), FALSE); | 1761 AUI_entry_EditChar(data->entry_data, ATB_char_Unicode('p'), FALSE); |
1767 } | 1762 } |
1768 win_show(data->win); | 1763 win_show(data->win); |
1769 break; | 1764 break; |
1770 | 1765 |
1771 /* KEY ENTRY 1 - 9 */ | 1766 /* KEY ENTRY 1 - 9 */ |
1772 | 1767 |
1773 case KCD_1: | 1768 case KCD_1: |
1774 case KCD_2: | 1769 case KCD_2: |
1775 case KCD_3: | 1770 case KCD_3: |
1776 case KCD_4: | 1771 case KCD_4: |
1777 case KCD_5: | 1772 case KCD_5: |
1778 case KCD_6: | 1773 case KCD_6: |
1779 case KCD_7: | 1774 case KCD_7: |
1780 case KCD_8: | 1775 case KCD_8: |
1781 case KCD_9: | 1776 case KCD_9: |
1782 /* Insert equivalent numeric character, only possible in Alpha modes */ | 1777 /* Insert equivalent numeric character, only possible in Alpha modes */ |
1783 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | 1778 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) |
1784 { | 1779 { |
1785 if (keyboard->code<=KCD_HASH) | 1780 if (keyboard->code<=KCD_HASH) |
1786 { | 1781 { |
1787 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ | 1782 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ |
1788 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap | 1783 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap |
1789 win_show(data->win); | 1784 win_show(data->win); |
1790 } | 1785 } |
1791 } | 1786 } |
1792 break; | 1787 break; |
1793 | 1788 |
1794 } | 1789 } |
1795 | 1790 |
1796 #ifdef EASY_TEXT_ENABLED | 1791 #ifdef EASY_TEXT_ENABLED |
1797 } | 1792 } |
1798 else | 1793 else |
1799 { | 1794 { |
1800 if(FFS_flashData.PredTextAvailable == TRUE) | 1795 if(FFS_flashData.PredTextAvailable == TRUE) |
1801 { | 1796 { |
1802 switch (keyboard->code) | 1797 switch (keyboard->code) |
1803 { | 1798 { |
1804 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN | 1799 // Jul 29, 2004 REF: CRR:20892 xrashmic - SASKEN |
1805 // Description: By Long press on Left/Right key at 'Message Editor' | 1800 // Description: By Long press on Left/Right key at 'Message Editor' |
1806 // screen, cursor not scrolling continuously | 1801 // screen, cursor not scrolling continuously |
1807 // Fix: The Long press of left/right key is now handled in | 1802 // Fix: The Long press of left/right key is now handled in |
1808 // AUI_edit_KbdLongCB. | 1803 // AUI_edit_KbdLongCB. |
1809 case KCD_MNULEFT: | 1804 case KCD_MNULEFT: |
1810 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ | 1805 ATB_edit_MoveCursor(data->editor, ctrlLeft, TRUE); /* Move cursor left */ |
1811 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1806 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1812 win_show(data->win); | 1807 win_show(data->win); |
1813 break; | 1808 break; |
1814 case KCD_MNURIGHT: | 1809 case KCD_MNURIGHT: |
1815 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ | 1810 ATB_edit_MoveCursor(data->editor, ctrlRight, TRUE); /* Move cursor right */ |
1816 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ | 1811 data->editor->update = ED_UPDATE_TRIVIAL; /* This flag speeds up update - no change to text */ |
1817 win_show(data->win); | 1812 win_show(data->win); |
1818 break; | 1813 break; |
1819 | 1814 |
1820 case KCD_RIGHT: /*empty predictive text string */ | 1815 case KCD_RIGHT: /*empty predictive text string */ |
1821 if(PredText->len!=0) | 1816 if(PredText->len!=0) |
1822 { | 1817 { |
1823 PredText->len = 0; | 1818 PredText->len = 0; |
1824 ATB_string_SetChar(PredText, 0, UNICODE_EOLN); | 1819 ATB_string_SetChar(PredText, 0, UNICODE_EOLN); |
1825 ResetDictSearch(); | 1820 ResetDictSearch(); |
1826 win_show(data->win); | 1821 win_show(data->win); |
1827 } | 1822 } |
1828 else /*empty whole editor */ | 1823 else /*empty whole editor */ |
1829 { | 1824 { |
1830 if(data->editor_data.editor_attr.text.len > 0 ) | 1825 if(data->editor_data.editor_attr.text.len > 0 ) |
1831 { | 1826 { |
1832 ATB_edit_ClearAll(data->editor); | 1827 ATB_edit_ClearAll(data->editor); |
1833 win_show(data->win); | 1828 win_show(data->win); |
1834 } | 1829 } |
1835 else | 1830 else |
1836 { | 1831 { |
1837 /* leave editor if buffer already empty */ | 1832 /* leave editor if buffer already empty */ |
1838 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); | 1833 SEND_EVENT (win, E_ED_DEINIT, INFO_KCD_RIGHT, NULL); |
1839 } | 1834 } |
1840 } | 1835 } |
1841 break; | 1836 break; |
1842 | 1837 |
1843 case(KCD_STAR): | 1838 case(KCD_STAR): |
1844 AUI_symbol_Start(data->win, E_ED_INSERT); | 1839 AUI_symbol_Start(data->win, E_ED_INSERT); |
1845 break; | 1840 break; |
1846 | 1841 |
1847 case (KCD_HASH): | 1842 case (KCD_HASH): |
1848 break; | 1843 break; |
1849 | 1844 |
1850 /* KEY ENTRY 1 - 9 */ | 1845 /* KEY ENTRY 1 - 9 */ |
1851 | 1846 |
1852 case KCD_0: | 1847 case KCD_0: |
1853 case KCD_1: | 1848 case KCD_1: |
1854 case KCD_2: | 1849 case KCD_2: |
1855 case KCD_3: | 1850 case KCD_3: |
1856 case KCD_4: | 1851 case KCD_4: |
1857 case KCD_5: | 1852 case KCD_5: |
1858 case KCD_6: | 1853 case KCD_6: |
1859 case KCD_7: | 1854 case KCD_7: |
1860 case KCD_8: | 1855 case KCD_8: |
1861 case KCD_9: | 1856 case KCD_9: |
1862 if(PredText->len==0) | 1857 if(PredText->len==0) |
1863 { | 1858 { |
1864 /* Insert equivalent numeric character, only possible in Alpha modes */ | 1859 /* Insert equivalent numeric character, only possible in Alpha modes */ |
1865 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) | 1860 if (ATB_edit_Mode(data->editor, ED_MODE_ALPHA)) |
1866 { | 1861 { |
1867 if (keyboard->code<=KCD_HASH) | 1862 if (keyboard->code<=KCD_HASH) |
1868 { | 1863 { |
1869 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ | 1864 ATB_edit_DeleteLeft(data->editor, FALSE); /* SPR#2342 - SH */ |
1870 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap | 1865 AUI_entry_EditDigit(data->entry_data, keyboard->code); // enter the character, not multi-tap |
1871 } | 1866 } |
1872 } | 1867 } |
1873 win_show(data->win); | 1868 win_show(data->win); |
1874 } | 1869 } |
1875 break; | 1870 break; |
1876 } | 1871 } |
1877 } | 1872 } |
1878 } | 1873 } |
1879 #endif | 1874 #endif |
1880 | 1875 |
1881 return MFW_EVENT_CONSUMED; | 1876 return MFW_EVENT_CONSUMED; |
1882 } | 1877 } |
1883 | 1878 |
1884 | 1879 |
1885 /******************************************************************************* | 1880 /******************************************************************************* |
1886 | 1881 |
1887 $Function: AUI_edit_TimerCb | 1882 $Function: AUI_edit_TimerCb |
1888 | 1883 |
1889 $Description: Callback function for the editor info timer. | 1884 $Description: Callback function for the editor info timer. |
1890 | 1885 |
1891 $Returns: None. | 1886 $Returns: None. |
1892 | 1887 |
1893 $Arguments: event - the event type | 1888 $Arguments: event - the event type |
1894 timer - the timer | 1889 timer - the timer |
1895 | 1890 |
1896 *******************************************************************************/ | 1891 *******************************************************************************/ |
1897 | 1892 |
1898 static int AUI_edit_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) | 1893 static int AUI_edit_TimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) |
1899 { | 1894 { |
1900 T_MFW_HND win = mfw_parent (mfw_header()); | 1895 T_MFW_HND win = mfw_parent (mfw_header()); |
1901 | 1896 |
1902 | 1897 |
1903 | 1898 |
1904 // T_MFW_HND parent_win = data->parent; // RAVI | 1899 // T_MFW_HND parent_win = data->parent; // RAVI |
1905 // USHORT Identifier = data->editor_data.Identifier; // RAVI | 1900 // USHORT Identifier = data->editor_data.Identifier; // RAVI |
1906 // T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI | 1901 // T_AUI_EDIT_CB Callback = data->editor_data.Callback; // RAVI |
1907 | 1902 |
1908 TRACE_FUNCTION("AUI_edit_TimerCb"); | 1903 TRACE_FUNCTION("AUI_edit_TimerCb"); |
1909 | 1904 |
1910 #if 0 | 1905 #if 0 |
1911 AUI_edit_Destroy(data->win); | 1906 AUI_edit_Destroy(data->win); |
1912 | 1907 |
1913 if (Callback) | 1908 if (Callback) |
1914 (Callback) (parent_win, Identifier, INFO_TIMEOUT); | 1909 (Callback) (parent_win, Identifier, INFO_TIMEOUT); |
1915 #else | 1910 #else |
1916 SEND_EVENT (win, E_ED_DEINIT, INFO_TIMEOUT, NULL); | 1911 SEND_EVENT (win, E_ED_DEINIT, INFO_TIMEOUT, NULL); |
1917 #endif | 1912 #endif |
1918 | 1913 |
1919 return MFW_EVENT_CONSUMED; | 1914 return MFW_EVENT_CONSUMED; |
1920 } | 1915 } |
1921 | 1916 |
1922 /******************************************************************************* | 1917 /******************************************************************************* |
1923 | 1918 |
1924 $Function: AUI_edit_TitleTimerCb | 1919 $Function: AUI_edit_TitleTimerCb |
1925 | 1920 |
1926 $Description: Callback function for the editor title timer. Recalculates title_pos so that | 1921 $Description: Callback function for the editor title timer. Recalculates title_pos so that |
1927 the next part of the string is displayed. | 1922 the next part of the string is displayed. |
1928 | 1923 |
1929 $Returns: None. | 1924 $Returns: None. |
1930 | 1925 |
1931 $Arguments: event - the event type | 1926 $Arguments: event - the event type |
1932 timer - the timer | 1927 timer - the timer |
1933 | 1928 |
1934 *******************************************************************************/ | 1929 *******************************************************************************/ |
1935 | 1930 |
1936 static int AUI_edit_TitleTimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) | 1931 static int AUI_edit_TitleTimerCb (T_MFW_EVENT event, T_MFW_TIM *timer) |
1937 { | 1932 { |
1938 /* Use the mfwHeader property of the timer to get the window */ | 1933 /* Use the mfwHeader property of the timer to get the window */ |
1939 T_MFW_HND win = mfw_parent(timer->mfwHeader); | 1934 T_MFW_HND win = mfw_parent(timer->mfwHeader); |
1940 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 1935 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
1941 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 1936 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
1942 | 1937 |
1943 TRACE_FUNCTION("AUI_edit_TitleTimerCb"); | 1938 TRACE_FUNCTION("AUI_edit_TitleTimerCb"); |
1944 | 1939 |
1945 /* SPR#1597 - SH - Since there may be multiple timers running at once, only | 1940 /* SPR#1597 - SH - Since there may be multiple timers running at once, only |
1946 call win_show if the window is focussed. */ | 1941 call win_show if the window is focussed. */ |
1947 | 1942 |
1948 if (winIsFocussed(win)) | 1943 if (winIsFocussed(win)) |
1949 { | 1944 { |
1950 if (data->title_next_pos!=data->title_pos) | 1945 if (data->title_next_pos!=data->title_pos) |
1951 { | 1946 { |
1952 data->title_pos = data->title_next_pos; | 1947 data->title_pos = data->title_next_pos; |
1953 } | 1948 } |
1954 | 1949 |
1955 data->editor->update = ED_UPDATE_PARTIAL; /* Don't update editor text */ | 1950 data->editor->update = ED_UPDATE_PARTIAL; /* Don't update editor text */ |
1956 win_show(data->win); | 1951 win_show(data->win); |
1957 | 1952 |
1958 tim_start(data->title_timer); | 1953 tim_start(data->title_timer); |
1959 } | 1954 } |
1960 | 1955 |
1961 return MFW_EVENT_CONSUMED; | 1956 return MFW_EVENT_CONSUMED; |
1962 } | 1957 } |
1963 | 1958 |
1964 | 1959 |
1965 /******************************************************************************* | 1960 /******************************************************************************* |
1966 | 1961 |
1967 $Function: AUI_edit_CalcPredText | 1962 $Function: AUI_edit_CalcPredText |
1968 | 1963 |
1969 $Description: Calculate properties of predicted text string. | 1964 $Description: Calculate properties of predicted text string. |
1970 | 1965 |
1971 $Returns: None. | 1966 $Returns: None. |
1972 | 1967 |
1973 $Arguments: data - The AUI editor data | 1968 $Arguments: data - The AUI editor data |
1974 | 1969 |
1975 *******************************************************************************/ | 1970 *******************************************************************************/ |
1976 | 1971 |
1977 static void AUI_edit_CalcPredText(T_AUI_EDITOR_INFO *data) | 1972 static void AUI_edit_CalcPredText(T_AUI_EDITOR_INFO *data) |
1978 { | 1973 { |
1979 USHORT character; | 1974 USHORT character; |
1980 T_ATB_TEXT dummy; | 1975 T_ATB_TEXT dummy; |
1981 | 1976 |
1982 data->predText.len = ATB_string_Length(&data->predText); | 1977 data->predText.len = ATB_string_Length(&data->predText); |
1983 | 1978 |
1984 /* Get position of current entry */ | 1979 /* Get position of current entry */ |
1985 dummy.data = data->predText.data; | 1980 dummy.data = data->predText.data; |
1986 dummy.dcs = data->predText.dcs; | 1981 dummy.dcs = data->predText.dcs; |
1987 dummy.len = data->predTextChar.pos; | 1982 dummy.len = data->predTextChar.pos; |
1988 data->predTextChar.lineWidth = ATB_display_StringWidth(&dummy, &data->predTextChar.format); | 1983 data->predTextChar.lineWidth = ATB_display_StringWidth(&dummy, &data->predTextChar.format); |
1989 data->predTextChar.lineHeight = ATB_display_StringHeight(&dummy, &data->predTextChar.format); | 1984 data->predTextChar.lineHeight = ATB_display_StringHeight(&dummy, &data->predTextChar.format); |
1990 | 1985 |
1991 /* Get width and height of current character */ | 1986 /* Get width and height of current character */ |
1992 character = ATB_string_GetChar(&data->predText, data->predTextChar.pos); | 1987 character = ATB_string_GetChar(&data->predText, data->predTextChar.pos); |
1993 data->predTextChar.width = ATB_display_GetCharWidth(character, &data->predTextChar.format); | 1988 data->predTextChar.width = ATB_display_GetCharWidth(character, &data->predTextChar.format); |
1994 data->predTextChar.height = ATB_display_GetCharHeight(character, &data->predTextChar.format); | 1989 data->predTextChar.height = ATB_display_GetCharHeight(character, &data->predTextChar.format); |
1995 | 1990 |
1996 return; | 1991 return; |
1997 } | 1992 } |
1998 | 1993 |
1999 | 1994 |
2000 /******************************************************************************* | 1995 /******************************************************************************* |
2001 | 1996 |
2002 $Function: AUI_edit_ClearPredText | 1997 $Function: AUI_edit_ClearPredText |
2003 | 1998 |
2004 $Description: Clear the predictive text buffer | 1999 $Description: Clear the predictive text buffer |
2005 | 2000 |
2006 $Returns: None. | 2001 $Returns: None. |
2007 | 2002 |
2008 $Arguments: data - The AUI editor data | 2003 $Arguments: data - The AUI editor data |
2009 | 2004 |
2010 *******************************************************************************/ | 2005 *******************************************************************************/ |
2011 | 2006 |
2012 static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data) | 2007 static void AUI_edit_ClearPredText(T_AUI_EDITOR_INFO *data) |
2013 { | 2008 { |
2014 data->predText.len = 0; | 2009 data->predText.len = 0; |
2015 ATB_string_SetChar(&data->predText,0,UNICODE_EOLN); | 2010 ATB_string_SetChar(&data->predText,0,UNICODE_EOLN); |
2016 memset(&data->predTextChar, 0, sizeof(T_ED_CHAR)); | 2011 memset(&data->predTextChar, 0, sizeof(T_ED_CHAR)); |
2017 return; | 2012 return; |
2018 } | 2013 } |
2019 | 2014 |
2020 | 2015 |
2021 /******************************************************************************* | 2016 /******************************************************************************* |
2022 | 2017 |
2023 $Function: AUI_edit_InsertString | 2018 $Function: AUI_edit_InsertString |
2024 | 2019 |
2025 $Description: Insert a string into the editor | 2020 $Description: Insert a string into the editor |
2026 | 2021 |
2027 $Returns: Pointer to the editor's window. | 2022 $Returns: Pointer to the editor's window. |
2028 | 2023 |
2029 $Arguments: win - The editor window | 2024 $Arguments: win - The editor window |
2030 string - The string to insert | 2025 string - The string to insert |
2031 dcs - The dcs of the string | 2026 dcs - The dcs of the string |
2032 | 2027 |
2033 *******************************************************************************/ | 2028 *******************************************************************************/ |
2034 | 2029 |
2035 void AUI_edit_InsertString(T_MFW_HND win, UBYTE *string, T_ATB_DCS dcs) | 2030 void AUI_edit_InsertString(T_MFW_HND win, UBYTE *string, T_ATB_DCS dcs) |
2036 { | 2031 { |
2037 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 2032 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
2038 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 2033 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
2039 T_ATB_TEXT text; | 2034 T_ATB_TEXT text; |
2040 | 2035 |
2041 text.data = string; | 2036 text.data = string; |
2042 text.dcs = dcs; | 2037 text.dcs = dcs; |
2043 text.len = ATB_string_Length(&text); | 2038 text.len = ATB_string_Length(&text); |
2044 | 2039 |
2045 ATB_edit_InsertString(data->editor, &text); | 2040 ATB_edit_InsertString(data->editor, &text); |
2046 | 2041 |
2047 return; | 2042 return; |
2048 } | 2043 } |
2049 | 2044 |
2050 | 2045 |
2051 /******************************************************************************* | 2046 /******************************************************************************* |
2052 | 2047 |
2053 $Function: AUI_edit_InsertChar | 2048 $Function: AUI_edit_InsertChar |
2054 | 2049 |
2055 $Description: Insert a character into the editor | 2050 $Description: Insert a character into the editor |
2056 | 2051 |
2057 $Returns: Pointer to the editor's window. | 2052 $Returns: Pointer to the editor's window. |
2058 | 2053 |
2059 $Arguments: win - The editor window | 2054 $Arguments: win - The editor window |
2060 character - The character to insert | 2055 character - The character to insert |
2061 | 2056 |
2062 *******************************************************************************/ | 2057 *******************************************************************************/ |
2063 | 2058 |
2064 void AUI_edit_InsertChar(T_MFW_HND win, USHORT character) | 2059 void AUI_edit_InsertChar(T_MFW_HND win, USHORT character) |
2065 { | 2060 { |
2066 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 2061 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
2067 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 2062 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
2068 | 2063 |
2069 ATB_edit_Char(data->editor, character, TRUE); | 2064 ATB_edit_Char(data->editor, character, TRUE); |
2070 | 2065 |
2071 return; | 2066 return; |
2072 } | 2067 } |
2073 | 2068 |
2074 | 2069 |
2075 /******************************************************************************* | 2070 /******************************************************************************* |
2076 | 2071 |
2077 $Function: AUI_edit_GetSpecificWindowSIze | 2072 $Function: AUI_edit_GetSpecificWindowSIze |
2078 | 2073 |
2079 $Description: Sets up window size | 2074 $Description: Sets up window size |
2080 | 2075 |
2081 $Returns: None. | 2076 $Returns: None. |
2082 | 2077 |
2083 $Arguments: attr - The ATB editor attributes | 2078 $Arguments: attr - The ATB editor attributes |
2084 zone_id - Specifies the window size (See ZONE_... in header file) | 2079 zone_id - Specifies the window size (See ZONE_... in header file) |
2085 | 2080 |
2086 *******************************************************************************/ | 2081 *******************************************************************************/ |
2087 #ifndef LSCREEN | 2082 #ifndef LSCREEN |
2088 //Sizes defined for CSAMPLE editore | 2083 //Sizes defined for CSAMPLE editore |
2089 #define BOOKDETAILS_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) | 2084 #define BOOKDETAILS_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) |
2090 #define NUMBER_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , MNU3LINE | 2085 #define NUMBER_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , MNU3LINE |
2091 #define PHONEBOOK_DLG_EDITOR_SIZE 4, Mmi_layout_line(3)+2, SCREEN_SIZE_X-4, SCREEN_SIZE_Y-(Mmi_layout_line(3)+2) | 2086 #define PHONEBOOK_DLG_EDITOR_SIZE 4, Mmi_layout_line(3)+2, SCREEN_SIZE_X-4, SCREEN_SIZE_Y-(Mmi_layout_line(3)+2) |
2092 #define BOOKSDN_EDITOR_SIZE 34, Mmi_layout_line(3)+2, 50, Mmi_layout_line(1)+2 | 2087 #define BOOKSDN_EDITOR_SIZE 34, Mmi_layout_line(3)+2, 50, Mmi_layout_line(1)+2 |
2093 | 2088 |
2094 //MMIbooksearchwindow | 2089 //MMIbooksearchwindow |
2095 //#define BOOKSEARCH_EDITOR_SIZE 0, Mmi_layout_line(SECOND_LAST_LINE_TOP), SCREEN_SIZE_X, Mmi_layout_line(1) | 2090 //#define BOOKSEARCH_EDITOR_SIZE 0, Mmi_layout_line(SECOND_LAST_LINE_TOP), SCREEN_SIZE_X, Mmi_layout_line(1) |
2096 | 2091 |
2097 //MMICall | 2092 //MMICall |
2098 #define CALL_EDITOR_SIZE 4,28,SCREEN_SIZE_X-4, 20 | 2093 #define CALL_EDITOR_SIZE 4,28,SCREEN_SIZE_X-4, 20 |
2099 #define CALLSCRATCHPAD_EDITOR_SIZE 6, Mmi_layout_line(2),SCREEN_SIZE_X-6, 16 | 2094 #define CALLSCRATCHPAD_EDITOR_SIZE 6, Mmi_layout_line(2),SCREEN_SIZE_X-6, 16 |
2100 | 2095 |
2101 //MMIServices | 2096 //MMIServices |
2102 #define SERVICE_CREATE_EDITOR_SIZE 4,Mmi_layout_line(1)+2,SCREEN_SIZE_X-4, MNU3LINE | 2097 #define SERVICE_CREATE_EDITOR_SIZE 4,Mmi_layout_line(1)+2,SCREEN_SIZE_X-4, MNU3LINE |
2103 #define PASSWORD_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , 13 | 2098 #define PASSWORD_EDITOR_SIZE 0, 12, SCREEN_SIZE_X , 13 |
2104 #define EM_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) | 2099 #define EM_EDITOR_SIZE 0, 0, SCREEN_SIZE_X-4, Mmi_layout_line(LAST_LINE_TOP) |
2105 | 2100 |
2106 //From MMIIdle | 2101 //From MMIIdle |
2107 //GW Changed window height from 30 (27?) to 24. | 2102 //GW Changed window height from 30 (27?) to 24. |
2108 #define WIN_DIALLING_SIZE 0,Mmi_layout_line_icons(2), SCREEN_SIZE_X,24 | 2103 #define WIN_DIALLING_SIZE 0,Mmi_layout_line_icons(2), SCREEN_SIZE_X,24 |
2109 #define WIN_DIALLING_C_SIZE 0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,32 | 2104 #define WIN_DIALLING_C_SIZE 0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,32 |
2110 | 2105 |
2111 //Positions for editor windows in mmismssend | 2106 //Positions for editor windows in mmismssend |
2112 #define PHNO_EDITOR_SIZE 0, (Mmi_layout_line(1)+2), SCREEN_SIZE_X, 20 | 2107 #define PHNO_EDITOR_SIZE 0, (Mmi_layout_line(1)+2), SCREEN_SIZE_X, 20 |
2113 | 2108 |
2114 //NB defines below used twice, second time START/SIZE_Y was same as START/SIZE_Y above | 2109 //NB defines below used twice, second time START/SIZE_Y was same as START/SIZE_Y above |
2115 #define CENTRE_EDITOR_SIZE 0, Mmi_layout_line(1), SCREEN_SIZE_X, MNU3LINE+3 | 2110 #define CENTRE_EDITOR_SIZE 0, Mmi_layout_line(1), SCREEN_SIZE_X, MNU3LINE+3 |
2116 | 2111 |
2117 //And for MMIServices - moved here from mmiservices.c | 2112 //And for MMIServices - moved here from mmiservices.c |
2118 #define SAT_EDITOR_SIZE 6,30,SCREEN_SIZE_X-6, 20 | 2113 #define SAT_EDITOR_SIZE 6,30,SCREEN_SIZE_X-6, 20 |
2119 | 2114 |
2120 #define RPWD_EDITOR_SIZE 0,12,SCREEN_SIZE_X,13 | 2115 #define RPWD_EDITOR_SIZE 0,12,SCREEN_SIZE_X,13 |
2121 | 2116 |
2122 //MMIBookCallDetails | 2117 //MMIBookCallDetails |
2123 #define PHB_EDITOR_SIZE 4,0,SCREEN_SIZE_X-4, ALLBUT2LINE | 2118 #define PHB_EDITOR_SIZE 4,0,SCREEN_SIZE_X-4, ALLBUT2LINE |
2124 | 2119 |
2125 //MMIPins | 2120 //MMIPins |
2126 #define PIN_EDIT_RESET_SIZE 12,20,84-12,16 | 2121 #define PIN_EDIT_RESET_SIZE 12,20,84-12,16 |
2127 //MMITimeDate | 2122 //MMITimeDate |
2128 #define TIMEDATE_EDITOR_AREA_SIZE 0,10,70,10 | 2123 #define TIMEDATE_EDITOR_AREA_SIZE 0,10,70,10 |
2129 #endif | 2124 #endif |
2130 /* GW SPR#1840 26/03/03 - Copied from MMieditor.c*/ | 2125 /* GW SPR#1840 26/03/03 - Copied from MMieditor.c*/ |
2131 #ifndef LSCREEN | 2126 #ifndef LSCREEN |
2132 static void setSize(T_ATB_WIN_SIZE *win, int px, int py, int sx, int sy) | 2127 static void setSize(T_ATB_WIN_SIZE *win, int px, int py, int sx, int sy) |
2133 { | 2128 { |
2134 win->px = px; win->py = py; | 2129 win->px = px; win->py = py; |
2135 win->sx = sx; win->sy = sy; | 2130 win->sx = sx; win->sy = sy; |
2136 } | 2131 } |
2137 #endif | 2132 #endif |
2138 void AUI_edit_GetSpecificWindowSize(T_ED_ATTR* attr, int zone_id ) | 2133 void AUI_edit_GetSpecificWindowSize(T_ED_ATTR* attr, int zone_id ) |
2139 { | 2134 { |
2140 switch (zone_id) | 2135 switch (zone_id) |
2141 { | 2136 { |
2142 case ZONE_SMALL_EDITOR: | 2137 case ZONE_SMALL_EDITOR: |
2143 attr->win_size.px = 6; | 2138 attr->win_size.px = 6; |
2144 attr->win_size.py = Mmi_layout_IconHeight()*2; | 2139 attr->win_size.py = Mmi_layout_IconHeight()*2; |
2145 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; | 2140 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; |
2146 attr->win_size.sy = Mmi_layout_line_height()*2+4; | 2141 attr->win_size.sy = Mmi_layout_line_height()*2+4; |
2147 break; | 2142 break; |
2148 | 2143 |
2149 case ZONE_BOTTOM_LINE: | 2144 case ZONE_BOTTOM_LINE: |
2150 attr->win_size.px = 0; | 2145 attr->win_size.px = 0; |
2151 attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); | 2146 attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); |
2152 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; | 2147 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; |
2153 attr->win_size.sy = Mmi_layout_line_height(); | 2148 attr->win_size.sy = Mmi_layout_line_height(); |
2154 break; | 2149 break; |
2155 | 2150 |
2156 case ZONE_BOTTOM_LINE_FIND: //used for phonebook search | 2151 case ZONE_BOTTOM_LINE_FIND: //used for phonebook search |
2157 attr->win_size.px = dspl_GetTextExtent(MmiRsrcGetText(TxtFind),0); | 2152 attr->win_size.px = dspl_GetTextExtent(MmiRsrcGetText(TxtFind),0); |
2158 attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); | 2153 attr->win_size.py = SCREEN_SIZE_Y - Mmi_layout_line_height() - Mmi_layout_softkeyHeight(); |
2159 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; | 2154 attr->win_size.sx = SCREEN_SIZE_X-attr->win_size.px; |
2160 attr->win_size.sy = Mmi_layout_line_height(); | 2155 attr->win_size.sy = Mmi_layout_line_height(); |
2161 break; | 2156 break; |
2162 | 2157 |
2163 #ifndef LSCREEN | 2158 #ifndef LSCREEN |
2164 case BOOKDETAILS_EDITOR: setSize(&attr->win_size,BOOKDETAILS_EDITOR_SIZE); break; | 2159 case BOOKDETAILS_EDITOR: setSize(&attr->win_size,BOOKDETAILS_EDITOR_SIZE); break; |
2165 case NUMBER_EDITOR: setSize(&attr->win_size,NUMBER_EDITOR_SIZE); break; | 2160 case NUMBER_EDITOR: setSize(&attr->win_size,NUMBER_EDITOR_SIZE); break; |
2166 case PHONEBOOK_DLG_EDITOR: setSize(&attr->win_size,PHONEBOOK_DLG_EDITOR_SIZE); break; | 2161 case PHONEBOOK_DLG_EDITOR: setSize(&attr->win_size,PHONEBOOK_DLG_EDITOR_SIZE); break; |
2167 case BOOKSDN_EDITOR: setSize(&attr->win_size,BOOKSDN_EDITOR_SIZE); break; | 2162 case BOOKSDN_EDITOR: setSize(&attr->win_size,BOOKSDN_EDITOR_SIZE); break; |
2168 // case BOOKSEARCH_EDITOR: setSize(&attr->win_size,BOOKSEARCH_EDITOR_SIZE); break; | 2163 // case BOOKSEARCH_EDITOR: setSize(&attr->win_size,BOOKSEARCH_EDITOR_SIZE); break; |
2169 case CALL_EDITOR: setSize(&attr->win_size,CALL_EDITOR_SIZE); break; | 2164 case CALL_EDITOR: setSize(&attr->win_size,CALL_EDITOR_SIZE); break; |
2170 case CALLSCRATCHPAD_EDITOR: setSize(&attr->win_size,CALLSCRATCHPAD_EDITOR_SIZE); break; | 2165 case CALLSCRATCHPAD_EDITOR: setSize(&attr->win_size,CALLSCRATCHPAD_EDITOR_SIZE); break; |
2171 case SERVICE_CREATE_EDITOR: setSize(&attr->win_size,SERVICE_CREATE_EDITOR_SIZE); break; | 2166 case SERVICE_CREATE_EDITOR: setSize(&attr->win_size,SERVICE_CREATE_EDITOR_SIZE); break; |
2172 case PASSWORD_EDITOR: setSize(&attr->win_size,PASSWORD_EDITOR_SIZE); break; | 2167 case PASSWORD_EDITOR: setSize(&attr->win_size,PASSWORD_EDITOR_SIZE); break; |
2173 case EM_CREATE_EDITOR: setSize(&attr->win_size,EM_EDITOR_SIZE); break;/*SPR#1840*/ | 2168 case EM_CREATE_EDITOR: setSize(&attr->win_size,EM_EDITOR_SIZE); break;/*SPR#1840*/ |
2174 | 2169 |
2175 case WIN_DIALLING: | 2170 case WIN_DIALLING: |
2176 case WIN_DIALLING_CB: | 2171 case WIN_DIALLING_CB: |
2177 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 2172 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
2178 setSize(&attr->win_size,WIN_DIALLING_C_SIZE); | 2173 setSize(&attr->win_size,WIN_DIALLING_C_SIZE); |
2179 else | 2174 else |
2180 setSize(&attr->win_size,WIN_DIALLING_SIZE); | 2175 setSize(&attr->win_size,WIN_DIALLING_SIZE); |
2181 break; | 2176 break; |
2182 case WIN_DIALLING_SMS: | 2177 case WIN_DIALLING_SMS: |
2183 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 2178 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
2184 { | 2179 { |
2185 setSize(&attr->win_size,0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,24);/*SPR#1840*/ | 2180 setSize(&attr->win_size,0,Mmi_layout_line_icons(1),SCREEN_SIZE_X,24);/*SPR#1840*/ |
2186 } | 2181 } |
2187 else | 2182 else |
2188 setSize(&attr->win_size,WIN_DIALLING_SIZE); | 2183 setSize(&attr->win_size,WIN_DIALLING_SIZE); |
2189 break; | 2184 break; |
2190 case WIN_DIALLING_SAT: | 2185 case WIN_DIALLING_SAT: |
2191 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) | 2186 if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE) |
2192 setSize(&attr->win_size,WIN_DIALLING_C_SIZE); | 2187 setSize(&attr->win_size,WIN_DIALLING_C_SIZE); |
2193 else | 2188 else |
2194 setSize(&attr->win_size,WIN_DIALLING_SIZE); | 2189 setSize(&attr->win_size,WIN_DIALLING_SIZE); |
2195 break; | 2190 break; |
2196 | 2191 |
2197 case PHNO_EDITOR: setSize(&attr->win_size,PHNO_EDITOR_SIZE); break; | 2192 case PHNO_EDITOR: setSize(&attr->win_size,PHNO_EDITOR_SIZE); break; |
2198 case CENTRE_EDITOR: setSize(&attr->win_size,CENTRE_EDITOR_SIZE); break; | 2193 case CENTRE_EDITOR: setSize(&attr->win_size,CENTRE_EDITOR_SIZE); break; |
2199 case SAT_EDITOR : setSize(&attr->win_size,SAT_EDITOR_SIZE); break; | 2194 case SAT_EDITOR : setSize(&attr->win_size,SAT_EDITOR_SIZE); break; |
2200 case RPWD_EDITOR: setSize(&attr->win_size,RPWD_EDITOR_SIZE); break; | 2195 case RPWD_EDITOR: setSize(&attr->win_size,RPWD_EDITOR_SIZE); break; |
2201 case PHB_EDITOR: setSize(&attr->win_size,PHB_EDITOR_SIZE); break; | 2196 case PHB_EDITOR: setSize(&attr->win_size,PHB_EDITOR_SIZE); break; |
2202 case PIN_EDIT_RESET: setSize(&attr->win_size,PIN_EDIT_RESET_SIZE); break; | 2197 case PIN_EDIT_RESET: setSize(&attr->win_size,PIN_EDIT_RESET_SIZE); break; |
2203 case TIMEDATE_EDITOR_AREA: setSize(&attr->win_size,TIMEDATE_EDITOR_AREA_SIZE); break; | 2198 case TIMEDATE_EDITOR_AREA: setSize(&attr->win_size,TIMEDATE_EDITOR_AREA_SIZE); break; |
2204 #endif | 2199 #endif |
2205 default: | 2200 default: |
2206 break; | 2201 break; |
2207 } | 2202 } |
2208 } | 2203 } |
2209 | 2204 |
2210 /******************************************************************************* | 2205 /******************************************************************************* |
2211 | 2206 |
2212 $Function: AUI_edit_CalculateWindow | 2207 $Function: AUI_edit_CalculateWindow |
2213 | 2208 |
2214 $Description: Sets up window size | 2209 $Description: Sets up window size |
2215 | 2210 |
2216 $Returns: None. | 2211 $Returns: None. |
2217 | 2212 |
2218 $Arguments: attr - The ATB editor attributes | 2213 $Arguments: attr - The ATB editor attributes |
2219 zone_id - Specifies the window size (See ZONE_... in header file) | 2214 zone_id - Specifies the window size (See ZONE_... in header file) |
2220 SPR#1559 - SH - this is now a pointer to the zone_id, allowing | 2215 SPR#1559 - SH - this is now a pointer to the zone_id, allowing |
2221 the zone_id to be modified by this function | 2216 the zone_id to be modified by this function |
2222 | 2217 |
2223 *******************************************************************************/ | 2218 *******************************************************************************/ |
2224 | 2219 |
2225 void AUI_edit_CalculateWindow(T_ED_ATTR* attr, int *zone_id_pointer ) | 2220 void AUI_edit_CalculateWindow(T_ED_ATTR* attr, int *zone_id_pointer ) |
2226 { | 2221 { |
2227 int zone_id = *zone_id_pointer; | 2222 int zone_id = *zone_id_pointer; |
2228 | 2223 |
2229 attr->win_size.px = 0; | 2224 attr->win_size.px = 0; |
2230 attr->win_size.py = 0; | 2225 attr->win_size.py = 0; |
2231 attr->win_size.sx = SCREEN_SIZE_X; | 2226 attr->win_size.sx = SCREEN_SIZE_X; |
2232 attr->win_size.sy = SCREEN_SIZE_Y; | 2227 attr->win_size.sy = SCREEN_SIZE_Y; |
2233 | 2228 |
2234 if (zone_id == ZONE_BORDER_EDITOR) | 2229 if (zone_id == ZONE_BORDER_EDITOR) |
2235 { //Leave border on left/right of screen. | 2230 { //Leave border on left/right of screen. |
2236 attr->win_size.px = 4; | 2231 attr->win_size.px = 4; |
2237 attr->win_size.sx = attr->win_size.sx - 2*attr->win_size.px; | 2232 attr->win_size.sx = attr->win_size.sx - 2*attr->win_size.px; |
2238 zone_id = ZONE_FULLSOFTKEYS; | 2233 zone_id = ZONE_FULLSOFTKEYS; |
2239 *zone_id_pointer = zone_id; | 2234 *zone_id_pointer = zone_id; |
2240 } | 2235 } |
2241 else if ((zone_id != 0x0000) && ((zone_id &0xF000)==0xF000))/*SPR#1840*/ | 2236 else if ((zone_id != 0x0000) && ((zone_id &0xF000)==0xF000))/*SPR#1840*/ |
2242 { | 2237 { |
2243 AUI_edit_GetSpecificWindowSize(attr,zone_id); | 2238 AUI_edit_GetSpecificWindowSize(attr,zone_id); |
2244 return; | 2239 return; |
2245 } | 2240 } |
2246 else if (zone_id == 0) | 2241 else if (zone_id == 0) |
2247 { | 2242 { |
2248 zone_id = ZONE_FULLSOFTKEYS; | 2243 zone_id = ZONE_FULLSOFTKEYS; |
2249 *zone_id_pointer = zone_id; | 2244 *zone_id_pointer = zone_id; |
2250 } | 2245 } |
2251 | 2246 |
2252 if (zone_id & ZONE_ICONS) | 2247 if (zone_id & ZONE_ICONS) |
2253 attr->win_size.py = attr->win_size.py + Mmi_layout_IconHeight(); | 2248 attr->win_size.py = attr->win_size.py + Mmi_layout_IconHeight(); |
2254 | 2249 |
2255 if (zone_id & ZONE_SOFTKEYS) | 2250 if (zone_id & ZONE_SOFTKEYS) |
2256 attr->win_size.sy = attr->win_size.sy - Mmi_layout_softkeyHeight(); | 2251 attr->win_size.sy = attr->win_size.sy - Mmi_layout_softkeyHeight(); |
2257 | 2252 |
2258 if (zone_id & ZONE_TITLE) | 2253 if (zone_id & ZONE_TITLE) |
2259 attr->win_size.py = attr->win_size.py + Mmi_layout_TitleHeight(); | 2254 attr->win_size.py = attr->win_size.py + Mmi_layout_TitleHeight(); |
2260 | 2255 |
2261 if (zone_id & ZONE_CASE_ABC) | 2256 if (zone_id & ZONE_CASE_ABC) |
2262 attr->win_size.sy = attr->win_size.sy - Mmi_layout_line_height(); | 2257 attr->win_size.sy = attr->win_size.sy - Mmi_layout_line_height(); |
2263 | 2258 |
2264 if (zone_id & ZONE_SCROLLBAR) | 2259 if (zone_id & ZONE_SCROLLBAR) |
2265 attr->win_size.sx = attr->win_size.sx - ED_SCROLLBAR_WIDTH; | 2260 attr->win_size.sx = attr->win_size.sx - ED_SCROLLBAR_WIDTH; |
2266 | 2261 |
2267 attr->win_size.sy = attr->win_size.sy - attr->win_size.py; | 2262 attr->win_size.sy = attr->win_size.sy - attr->win_size.py; |
2268 | 2263 |
2269 if ((zone_id & ZONE_FULLSCREEN) == ZONE_FULLSCREEN) | 2264 if ((zone_id & ZONE_FULLSCREEN) == ZONE_FULLSCREEN) |
2270 return; | 2265 return; |
2271 | 2266 |
2272 /*Else window is not entire screen */ | 2267 /*Else window is not entire screen */ |
2273 | 2268 |
2274 switch (zone_id & ZONE_FULL_HEIGHT) | 2269 switch (zone_id & ZONE_FULL_HEIGHT) |
2275 { | 2270 { |
2276 case ZONE_FULL_HEIGHT: | 2271 case ZONE_FULL_HEIGHT: |
2277 break; | 2272 break; |
2278 case ZONE_TOPHALF_HEIGHT: | 2273 case ZONE_TOPHALF_HEIGHT: |
2279 attr->win_size.sy = attr->win_size.sy/2; | 2274 attr->win_size.sy = attr->win_size.sy/2; |
2280 break; | 2275 break; |
2281 case ZONE_MIDDLE_HEIGHT: | 2276 case ZONE_MIDDLE_HEIGHT: |
2282 attr->win_size.sy = attr->win_size.sy/2; | 2277 attr->win_size.sy = attr->win_size.sy/2; |
2283 attr->win_size.py = attr->win_size.py+attr->win_size.sy/2; | 2278 attr->win_size.py = attr->win_size.py+attr->win_size.sy/2; |
2284 break; | 2279 break; |
2285 case ZONE_BOTTOMHALF_HEIGHT: | 2280 case ZONE_BOTTOMHALF_HEIGHT: |
2286 attr->win_size.sy = attr->win_size.sy/2; | 2281 attr->win_size.sy = attr->win_size.sy/2; |
2287 attr->win_size.py = attr->win_size.py+attr->win_size.sy; | 2282 attr->win_size.py = attr->win_size.py+attr->win_size.sy; |
2288 break; | 2283 break; |
2289 case ZONE_BOTTOMTWOLINES_HEIGHT: | 2284 case ZONE_BOTTOMTWOLINES_HEIGHT: |
2290 attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*2; | 2285 attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*2; |
2291 attr->win_size.sy = Mmi_layout_line_height()*2; | 2286 attr->win_size.sy = Mmi_layout_line_height()*2; |
2292 break; | 2287 break; |
2293 /* xreddymn OMAPS00075852 May-15-2006 | 2288 /* xreddymn OMAPS00075852 May-15-2006 |
2294 * This display zone is located one line above the softkeys. | 2289 * This display zone is located one line above the softkeys. |
2295 */ | 2290 */ |
2296 case ZONE_MIDDLETWOLINES_HEIGHT: | 2291 case ZONE_MIDDLETWOLINES_HEIGHT: |
2297 attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*3; | 2292 attr->win_size.py = attr->win_size.py+attr->win_size.sy-Mmi_layout_line_height()*3; |
2298 attr->win_size.sy = Mmi_layout_line_height()*2; | 2293 attr->win_size.sy = Mmi_layout_line_height()*2; |
2299 break; | 2294 break; |
2300 default: | 2295 default: |
2301 //No action | 2296 //No action |
2302 break; | 2297 break; |
2303 } | 2298 } |
2304 | 2299 |
2305 switch (zone_id & ZONE_FULL_WIDTH) | 2300 switch (zone_id & ZONE_FULL_WIDTH) |
2306 { | 2301 { |
2307 case ZONE_FULL_WIDTH: | 2302 case ZONE_FULL_WIDTH: |
2308 break; | 2303 break; |
2309 case ZONE_LEFTHALF_WIDTH: | 2304 case ZONE_LEFTHALF_WIDTH: |
2310 attr->win_size.sx = attr->win_size.sx/2; | 2305 attr->win_size.sx = attr->win_size.sx/2; |
2311 break; | 2306 break; |
2312 case ZONE_MIDDLE_WIDTH : | 2307 case ZONE_MIDDLE_WIDTH : |
2313 attr->win_size.sx = attr->win_size.sx/2; | 2308 attr->win_size.sx = attr->win_size.sx/2; |
2314 attr->win_size.px = attr->win_size.px+attr->win_size.sx/2; | 2309 attr->win_size.px = attr->win_size.px+attr->win_size.sx/2; |
2315 break; | 2310 break; |
2316 case ZONE_RIGHTHALF_WIDTH: | 2311 case ZONE_RIGHTHALF_WIDTH: |
2317 attr->win_size.sx = attr->win_size.sx/2; | 2312 attr->win_size.sx = attr->win_size.sx/2; |
2318 attr->win_size.px = attr->win_size.px+attr->win_size.sx; | 2313 attr->win_size.px = attr->win_size.px+attr->win_size.sx; |
2319 break; | 2314 break; |
2320 default: | 2315 default: |
2321 //No action | 2316 //No action |
2322 break; | 2317 break; |
2323 } | 2318 } |
2324 } | 2319 } |
2325 | 2320 |
2326 | 2321 |
2327 /******************************************************************************* | 2322 /******************************************************************************* |
2328 | 2323 |
2329 $Function: AUI_edit_SetDefault | 2324 $Function: AUI_edit_SetDefault |
2330 | 2325 |
2331 $Description: Sets up standard editor attributes. | 2326 $Description: Sets up standard editor attributes. |
2332 | 2327 |
2333 $Returns: None. | 2328 $Returns: None. |
2334 | 2329 |
2335 $Arguments: editor_data - The MMI editor data that is to be modified. | 2330 $Arguments: editor_data - The MMI editor data that is to be modified. |
2336 | 2331 |
2337 *******************************************************************************/ | 2332 *******************************************************************************/ |
2338 | 2333 |
2339 void AUI_edit_SetDefault(T_AUI_EDITOR_DATA *editor_data) | 2334 void AUI_edit_SetDefault(T_AUI_EDITOR_DATA *editor_data) |
2340 { | 2335 { |
2341 /* Set everything to zero... */ | 2336 /* Set everything to zero... */ |
2342 /* SPR#1559 - Move CalculateWindow to below */ | 2337 /* SPR#1559 - Move CalculateWindow to below */ |
2343 | 2338 |
2344 memset(editor_data, 0, sizeof(T_AUI_EDITOR_DATA)); | 2339 memset(editor_data, 0, sizeof(T_AUI_EDITOR_DATA)); |
2345 | 2340 |
2346 /* Except these things... */ | 2341 /* Except these things... */ |
2347 | 2342 |
2348 editor_data->editor_attr.colour = COLOUR_EDITOR; | 2343 editor_data->editor_attr.colour = COLOUR_EDITOR; |
2349 editor_data->editor_attr.font = EDITOR_FONT; | 2344 editor_data->editor_attr.font = EDITOR_FONT; |
2350 editor_data->editor_attr.cursor = ED_CURSOR_BAR; | 2345 editor_data->editor_attr.cursor = ED_CURSOR_BAR; |
2351 editor_data->editor_attr.mode = ED_MODE_ALPHA; | 2346 editor_data->editor_attr.mode = ED_MODE_ALPHA; |
2352 editor_data->editor_attr.text.dcs = ATB_DCS_ASCII; | 2347 editor_data->editor_attr.text.dcs = ATB_DCS_ASCII; |
2353 editor_data->timeout = FOREVER; | 2348 editor_data->timeout = FOREVER; |
2354 editor_data->destroyEditor = TRUE; | 2349 editor_data->destroyEditor = TRUE; |
2355 editor_data->zone_id = ZONE_FULL_SK_TITLE; | 2350 editor_data->zone_id = ZONE_FULL_SK_TITLE; |
2356 | 2351 |
2357 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 | 2352 // Shashi Shekar B.S., a0876501, Jan 16, 2006, DR: OMAPS00061460 |
2358 #ifdef FF_MMI_SAT_ICON | 2353 #ifdef FF_MMI_SAT_ICON |
2359 editor_data->editor_attr.TitleIcon.data = NULL; | 2354 editor_data->editor_attr.TitleIcon.data = NULL; |
2360 editor_data->editor_attr.TitleIcon.width = 0; | 2355 editor_data->editor_attr.TitleIcon.width = 0; |
2361 editor_data->editor_attr.TitleIcon.height = 0; | 2356 editor_data->editor_attr.TitleIcon.height = 0; |
2362 editor_data->editor_attr.TitleIcon.isTitle = FALSE; | 2357 editor_data->editor_attr.TitleIcon.isTitle = FALSE; |
2363 //x0035544 Mar 14, 2006 DR:OMAPS00061468 | 2358 //x0035544 Mar 14, 2006 DR:OMAPS00061468 |
2364 //set the default value for display_type to SAT_ICON_NONE | 2359 //set the default value for display_type to SAT_ICON_NONE |
2365 editor_data->editor_attr.TitleIcon.display_type = SAT_ICON_NONE; | 2360 editor_data->editor_attr.TitleIcon.display_type = SAT_ICON_NONE; |
2366 editor_data->editor_attr.TitleIcon.selfExplanatory = FALSE; | 2361 editor_data->editor_attr.TitleIcon.selfExplanatory = FALSE; |
2367 #endif | 2362 #endif |
2368 | 2363 |
2369 /* SPR#1559 - SH - CalculateWindow moved here; pointer to zone_id used */ | 2364 /* SPR#1559 - SH - CalculateWindow moved here; pointer to zone_id used */ |
2370 AUI_edit_CalculateWindow(&editor_data->editor_attr, &editor_data->zone_id); | 2365 AUI_edit_CalculateWindow(&editor_data->editor_attr, &editor_data->zone_id); |
2371 | 2366 |
2372 ATB_display_ClearFormat(&editor_data->editor_attr.startFormat); | 2367 ATB_display_ClearFormat(&editor_data->editor_attr.startFormat); |
2373 return; | 2368 return; |
2374 } | 2369 } |
2375 | 2370 |
2376 | 2371 |
2377 /******************************************************************************* | 2372 /******************************************************************************* |
2378 | 2373 |
2379 $Function: AUI_edit_SetDisplay | 2374 $Function: AUI_edit_SetDisplay |
2380 | 2375 |
2381 $Description: Sets up standard editor attributes. | 2376 $Description: Sets up standard editor attributes. |
2382 | 2377 |
2383 $Returns: None. | 2378 $Returns: None. |
2384 | 2379 |
2385 $Arguments: editor_data - The MMI editor data that is to be modified. | 2380 $Arguments: editor_data - The MMI editor data that is to be modified. |
2386 zone_id - Type of editor screen (see header file for ZONE_...) | 2381 zone_id - Type of editor screen (see header file for ZONE_...) |
2387 colour - Colour of the editor | 2382 colour - Colour of the editor |
2388 | 2383 |
2389 *******************************************************************************/ | 2384 *******************************************************************************/ |
2390 | 2385 |
2391 void AUI_edit_SetDisplay(T_AUI_EDITOR_DATA *editor_data, int zone_id, int colour, UBYTE font ) | 2386 void AUI_edit_SetDisplay(T_AUI_EDITOR_DATA *editor_data, int zone_id, int colour, UBYTE font ) |
2392 { | 2387 { |
2393 /* SPR#1559 - SH - Use pointer to zone_id */ | 2388 /* SPR#1559 - SH - Use pointer to zone_id */ |
2394 AUI_edit_CalculateWindow(&editor_data->editor_attr, &zone_id); | 2389 AUI_edit_CalculateWindow(&editor_data->editor_attr, &zone_id); |
2395 editor_data->zone_id = zone_id; | 2390 editor_data->zone_id = zone_id; |
2396 editor_data->editor_attr.colour = colour; | 2391 editor_data->editor_attr.colour = colour; |
2397 editor_data->editor_attr.font = font; | 2392 editor_data->editor_attr.font = font; |
2398 | 2393 |
2399 return; | 2394 return; |
2400 } | 2395 } |
2401 | 2396 |
2402 /******************************************************************************* | 2397 /******************************************************************************* |
2403 | 2398 |
2404 $Function: AUI_edit_SetEvents | 2399 $Function: AUI_edit_SetEvents |
2405 | 2400 |
2406 $Description: Sets up standard editor attributes. | 2401 $Description: Sets up standard editor attributes. |
2407 | 2402 |
2408 $Returns: None. | 2403 $Returns: None. |
2409 | 2404 |
2410 $Arguments: editor_data - The MMI editor data that is to be modified. | 2405 $Arguments: editor_data - The MMI editor data that is to be modified. |
2411 | 2406 |
2412 *******************************************************************************/ | 2407 *******************************************************************************/ |
2413 | 2408 |
2414 void AUI_edit_SetEvents(T_AUI_EDITOR_DATA *editor_data, USHORT Identifier, BOOL destroyEditor, ULONG timeout, T_AUI_EDIT_CB Callback) | 2409 void AUI_edit_SetEvents(T_AUI_EDITOR_DATA *editor_data, USHORT Identifier, BOOL destroyEditor, ULONG timeout, T_AUI_EDIT_CB Callback) |
2415 { | 2410 { |
2416 if (editor_data) | 2411 if (editor_data) |
2417 { | 2412 { |
2418 editor_data->Identifier = Identifier; | 2413 editor_data->Identifier = Identifier; |
2419 editor_data->destroyEditor = destroyEditor; | 2414 editor_data->destroyEditor = destroyEditor; |
2420 editor_data->timeout = timeout; | 2415 editor_data->timeout = timeout; |
2421 editor_data->Callback = Callback; | 2416 editor_data->Callback = Callback; |
2422 } | 2417 } |
2423 return; | 2418 return; |
2424 } | 2419 } |
2425 | 2420 |
2426 | 2421 |
2427 /******************************************************************************* | 2422 /******************************************************************************* |
2428 | 2423 |
2429 $Function: AUI_edit_SetMode | 2424 $Function: AUI_edit_SetMode |
2430 | 2425 |
2431 $Description: Sets up standard editor attributes. | 2426 $Description: Sets up standard editor attributes. |
2432 | 2427 |
2433 $Returns: None. | 2428 $Returns: None. |
2434 | 2429 |
2435 $Arguments: editor_data - The MMI editor data that is to be modified. | 2430 $Arguments: editor_data - The MMI editor data that is to be modified. |
2436 mode - Editor mode (see header file for ED_MODE_...) | 2431 mode - Editor mode (see header file for ED_MODE_...) |
2437 cursor - Editor cursor (see header file for ED_CURSOR_...) | 2432 cursor - Editor cursor (see header file for ED_CURSOR_...) |
2438 | 2433 |
2439 *******************************************************************************/ | 2434 *******************************************************************************/ |
2440 | 2435 |
2441 void AUI_edit_SetMode(T_AUI_EDITOR_DATA *editor_data, USHORT mode, USHORT cursor ) | 2436 void AUI_edit_SetMode(T_AUI_EDITOR_DATA *editor_data, USHORT mode, USHORT cursor ) |
2442 { | 2437 { |
2443 if (editor_data) | 2438 if (editor_data) |
2444 { | 2439 { |
2445 editor_data->editor_attr.mode = mode; | 2440 editor_data->editor_attr.mode = mode; |
2446 editor_data->editor_attr.cursor = cursor; | 2441 editor_data->editor_attr.cursor = cursor; |
2447 } | 2442 } |
2448 | 2443 |
2449 return; | 2444 return; |
2450 } | 2445 } |
2451 | 2446 |
2452 /******************************************************************************* | 2447 /******************************************************************************* |
2453 | 2448 |
2454 $Function: AUI_edit_SetBuffer | 2449 $Function: AUI_edit_SetBuffer |
2455 | 2450 |
2456 $Description: Sets up standard editor attributes. | 2451 $Description: Sets up standard editor attributes. |
2457 | 2452 |
2458 $Returns: None. | 2453 $Returns: None. |
2459 | 2454 |
2460 $Arguments: editor_data - The MMI editor data that is to be modified. | 2455 $Arguments: editor_data - The MMI editor data that is to be modified. |
2461 dcs - Data coding scheme of text (see ATB_DCS_...) | 2456 dcs - Data coding scheme of text (see ATB_DCS_...) |
2462 text - The text in the appropriate coding scheme | 2457 text - The text in the appropriate coding scheme |
2463 size - Maximum size of the edit buffer in characters | 2458 size - Maximum size of the edit buffer in characters |
2464 | 2459 |
2465 *******************************************************************************/ | 2460 *******************************************************************************/ |
2466 | 2461 |
2467 void AUI_edit_SetBuffer(T_AUI_EDITOR_DATA *editor_data, UBYTE dcs, UBYTE *text, USHORT size) | 2462 void AUI_edit_SetBuffer(T_AUI_EDITOR_DATA *editor_data, UBYTE dcs, UBYTE *text, USHORT size) |
2468 { | 2463 { |
2469 if (editor_data) | 2464 if (editor_data) |
2470 { | 2465 { |
2471 editor_data->editor_attr.text.dcs = dcs; | 2466 editor_data->editor_attr.text.dcs = dcs; |
2472 editor_data->editor_attr.text.data = text; | 2467 editor_data->editor_attr.text.data = text; |
2473 editor_data->editor_attr.text.len = ATB_string_Length(&editor_data->editor_attr.text); | 2468 editor_data->editor_attr.text.len = ATB_string_Length(&editor_data->editor_attr.text); |
2474 editor_data->editor_attr.size = size; | 2469 editor_data->editor_attr.size = size; |
2475 } | 2470 } |
2476 | 2471 |
2477 return; | 2472 return; |
2478 } | 2473 } |
2479 | 2474 |
2480 /******************************************************************************* | 2475 /******************************************************************************* |
2481 | 2476 |
2482 $Function: AUI_edit_SetTextStr | 2477 $Function: AUI_edit_SetTextStr |
2483 | 2478 |
2484 $Description: Sets up standard editor attributes. | 2479 $Description: Sets up standard editor attributes. |
2485 | 2480 |
2486 $Returns: None. | 2481 $Returns: None. |
2487 | 2482 |
2488 $Arguments: editor_data - The MMI editor data that is to be modified. | 2483 $Arguments: editor_data - The MMI editor data that is to be modified. |
2489 LeftSoftKey, RightSoftKey - Text IDs of the softkeys | 2484 LeftSoftKey, RightSoftKey - Text IDs of the softkeys |
2490 TitleId - Text ID for the title | 2485 TitleId - Text ID for the title |
2491 TextString - Text string for the title, used if TitleId is 0 | 2486 TextString - Text string for the title, used if TitleId is 0 |
2492 | 2487 |
2493 *******************************************************************************/ | 2488 *******************************************************************************/ |
2494 | 2489 |
2495 void AUI_edit_SetTextStr(T_AUI_EDITOR_DATA *editor_data, USHORT LeftSoftKey, USHORT RightSoftKey, USHORT TitleId, UBYTE *TitleString) | 2490 void AUI_edit_SetTextStr(T_AUI_EDITOR_DATA *editor_data, USHORT LeftSoftKey, USHORT RightSoftKey, USHORT TitleId, UBYTE *TitleString) |
2496 { | 2491 { |
2497 if (editor_data) | 2492 if (editor_data) |
2498 { | 2493 { |
2499 editor_data->LeftSoftKey = LeftSoftKey; | 2494 editor_data->LeftSoftKey = LeftSoftKey; |
2500 editor_data->RightSoftKey = RightSoftKey; | 2495 editor_data->RightSoftKey = RightSoftKey; |
2501 editor_data->AltRightSoftKey = RightSoftKey; | 2496 editor_data->AltRightSoftKey = RightSoftKey; |
2502 editor_data->TitleId = TitleId; | 2497 editor_data->TitleId = TitleId; |
2503 editor_data->TitleString = TitleString; | 2498 editor_data->TitleString = TitleString; |
2504 } | 2499 } |
2505 | 2500 |
2506 return; | 2501 return; |
2507 } | 2502 } |
2508 | 2503 |
2509 /******************************************************************************* | 2504 /******************************************************************************* |
2510 | 2505 |
2511 $Function: AUI_edit_SetAltTextStr | 2506 $Function: AUI_edit_SetAltTextStr |
2512 | 2507 |
2513 $Description: Sets up standard editor attributes. | 2508 $Description: Sets up standard editor attributes. |
2514 | 2509 |
2515 $Returns: None. | 2510 $Returns: None. |
2516 | 2511 |
2517 $Arguments: editor_data - The MMI editor data that is to be modified. | 2512 $Arguments: editor_data - The MMI editor data that is to be modified. |
2518 min_enter - No of characters needed to be entered | 2513 min_enter - No of characters needed to be entered |
2519 AltLeftSoftKey - Text ID of alternate left softkey | 2514 AltLeftSoftKey - Text ID of alternate left softkey |
2520 change_rsk_on_empty - TRUE if alternative right soft key is used for | 2515 change_rsk_on_empty - TRUE if alternative right soft key is used for |
2521 empty buffer | 2516 empty buffer |
2522 AltRightSoftKey - Text ID of alternative right softkey | 2517 AltRightSoftKey - Text ID of alternative right softkey |
2523 | 2518 |
2524 *******************************************************************************/ | 2519 *******************************************************************************/ |
2525 | 2520 |
2526 void AUI_edit_SetAltTextStr(T_AUI_EDITOR_DATA *editor_data, UBYTE min_enter, USHORT AltLeftSoftKey, BOOL change_rsk_on_empty, USHORT AltRightSoftKey) | 2521 void AUI_edit_SetAltTextStr(T_AUI_EDITOR_DATA *editor_data, UBYTE min_enter, USHORT AltLeftSoftKey, BOOL change_rsk_on_empty, USHORT AltRightSoftKey) |
2527 { | 2522 { |
2528 if (editor_data) | 2523 if (editor_data) |
2529 { | 2524 { |
2530 editor_data->AltLeftSoftKey = AltLeftSoftKey; | 2525 editor_data->AltLeftSoftKey = AltLeftSoftKey; |
2531 editor_data->min_enter = min_enter; | 2526 editor_data->min_enter = min_enter; |
2532 editor_data->AltRightSoftKey = AltRightSoftKey; | 2527 editor_data->AltRightSoftKey = AltRightSoftKey; |
2533 editor_data->change_rsk_on_empty = change_rsk_on_empty; | 2528 editor_data->change_rsk_on_empty = change_rsk_on_empty; |
2534 } | 2529 } |
2535 | 2530 |
2536 return; | 2531 return; |
2537 } | 2532 } |
2538 | 2533 |
2539 /******************************************************************************* | 2534 /******************************************************************************* |
2540 | 2535 |
2541 $Function: AUI_edit_SetFormatStr | 2536 $Function: AUI_edit_SetFormatStr |
2542 | 2537 |
2543 $Description: Sets up standard editor attributes. | 2538 $Description: Sets up standard editor attributes. |
2544 | 2539 |
2545 $Returns: None. | 2540 $Returns: None. |
2546 | 2541 |
2547 $Arguments: editor_data - The MMI editor data that is to be modified. | 2542 $Arguments: editor_data - The MMI editor data that is to be modified. |
2548 formatstr - The formatted input string | 2543 formatstr - The formatted input string |
2549 preformat - TRUE if format codes are to be inserted into text | 2544 preformat - TRUE if format codes are to be inserted into text |
2550 before editing | 2545 before editing |
2551 filler - If preformat is true, this character will be used to | 2546 filler - If preformat is true, this character will be used to |
2552 pad out the provided string | 2547 pad out the provided string |
2553 | 2548 |
2554 *******************************************************************************/ | 2549 *******************************************************************************/ |
2555 | 2550 |
2556 void AUI_edit_SetFormatStr(T_AUI_EDITOR_DATA *editor_data, char *formatstr, BOOL preformat, char filler) | 2551 void AUI_edit_SetFormatStr(T_AUI_EDITOR_DATA *editor_data, char *formatstr, BOOL preformat, char filler) |
2557 { | 2552 { |
2558 USHORT textIndex; | 2553 USHORT textIndex; |
2559 USHORT formatIndex; | 2554 USHORT formatIndex; |
2560 // USHORT character; // RAVI | 2555 // USHORT character; // RAVI |
2561 | 2556 |
2562 TRACE_FUNCTION("AUI_edit_SetFormatStr()"); | 2557 TRACE_FUNCTION("AUI_edit_SetFormatStr()"); |
2563 | 2558 |
2564 if (editor_data) | 2559 if (editor_data) |
2565 { | 2560 { |
2566 editor_data->editor_attr.FormatString = formatstr; | 2561 editor_data->editor_attr.FormatString = formatstr; |
2567 | 2562 |
2568 /* SPR#1983 - SH - *m and *M strings are freeform, no preformatting required */ | 2563 /* SPR#1983 - SH - *m and *M strings are freeform, no preformatting required */ |
2569 if (preformat && strcmp(formatstr, "*m")!=0 && strcmp(formatstr, "*M")!=0) | 2564 if (preformat && strcmp(formatstr, "*m")!=0 && strcmp(formatstr, "*M")!=0) |
2570 { | 2565 { |
2571 formatIndex = 0; | 2566 formatIndex = 0; |
2572 textIndex = 0; | 2567 textIndex = 0; |
2573 | 2568 |
2574 /* SPR#1983 - SH - Ensure formatting doesn't write over null terminator */ | 2569 /* SPR#1983 - SH - Ensure formatting doesn't write over null terminator */ |
2575 while (formatstr[formatIndex]!=0 && | 2570 while (formatstr[formatIndex]!=0 && |
2576 !strchr("123456789*", formatstr[formatIndex]) && /* Exit at delimited field */ | 2571 !strchr("123456789*", formatstr[formatIndex]) && /* Exit at delimited field */ |
2577 textIndex<(editor_data->editor_attr.size-1)) | 2572 textIndex<(editor_data->editor_attr.size-1)) |
2578 { | 2573 { |
2579 /* Encountered fixed character */ | 2574 /* Encountered fixed character */ |
2580 if (formatstr[formatIndex]=='\\') | 2575 if (formatstr[formatIndex]=='\\') |
2581 { | 2576 { |
2582 formatIndex++; | 2577 formatIndex++; |
2583 ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(formatstr[formatIndex])); | 2578 ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(formatstr[formatIndex])); |
2584 } | 2579 } |
2585 /* If editor text has run out, fill the rest with our filler character */ | 2580 /* If editor text has run out, fill the rest with our filler character */ |
2586 else if (textIndex>editor_data->editor_attr.text.len) | 2581 else if (textIndex>editor_data->editor_attr.text.len) |
2587 { | 2582 { |
2588 ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(filler)); | 2583 ATB_string_SetChar(&editor_data->editor_attr.text, textIndex, ATB_char_Unicode(filler)); |
2589 } | 2584 } |
2590 if(formatstr[formatIndex]!=0) /*a0393213 lint warnings removal - 'Possible access of out-of-bounds pointer'*/ | 2585 if(formatstr[formatIndex]!=0) /*a0393213 lint warnings removal - 'Possible access of out-of-bounds pointer'*/ |
2591 { | 2586 { |
2592 formatIndex++; | 2587 formatIndex++; |
2593 textIndex++; | 2588 textIndex++; |
2594 } | 2589 } |
2595 } | 2590 } |
2596 } | 2591 } |
2597 } | 2592 } |
2598 | 2593 |
2599 return; | 2594 return; |
2600 } | 2595 } |
2601 | 2596 |
2602 /******************************************************************************* | 2597 /******************************************************************************* |
2603 | 2598 |
2604 $Function: AUI_edit_SetFormatAttr | 2599 $Function: AUI_edit_SetFormatAttr |
2605 | 2600 |
2606 $Description: Sets up standard editor attributes. | 2601 $Description: Sets up standard editor attributes. |
2607 | 2602 |
2608 $Returns: None. | 2603 $Returns: None. |
2609 | 2604 |
2610 $Arguments: editor_data - The MMI editor data that is to be modified. | 2605 $Arguments: editor_data - The MMI editor data that is to be modified. |
2611 startFormat - Pointer to text formatting data structure | 2606 startFormat - Pointer to text formatting data structure |
2612 | 2607 |
2613 *******************************************************************************/ | 2608 *******************************************************************************/ |
2614 | 2609 |
2615 void AUI_edit_SetFormatAttr(T_AUI_EDITOR_DATA *editor_data, UBYTE attr) | 2610 void AUI_edit_SetFormatAttr(T_AUI_EDITOR_DATA *editor_data, UBYTE attr) |
2616 { | 2611 { |
2617 if (editor_data) | 2612 if (editor_data) |
2618 { | 2613 { |
2619 editor_data->editor_attr.startFormat.attr = attr; | 2614 editor_data->editor_attr.startFormat.attr = attr; |
2620 } | 2615 } |
2621 | 2616 |
2622 return; | 2617 return; |
2623 } | 2618 } |
2624 | 2619 |
2625 /******************************************************************************* | 2620 /******************************************************************************* |
2626 | 2621 |
2627 $Function: AUI_edit_SetAttr | 2622 $Function: AUI_edit_SetAttr |
2628 | 2623 |
2629 $Description: Set some standard editor attributes | 2624 $Description: Set some standard editor attributes |
2630 | 2625 |
2631 $Returns: None. | 2626 $Returns: None. |
2632 | 2627 |
2633 $Arguments: attr - The editor attr | 2628 $Arguments: attr - The editor attr |
2634 | 2629 |
2635 *******************************************************************************/ | 2630 *******************************************************************************/ |
2636 void AUI_edit_SetAttr(T_ED_ATTR *attr, int zone_id, ULONG colour, UBYTE font, USHORT mode, USHORT cursor, T_ATB_DCS dcs, UBYTE *text, USHORT size) | 2631 void AUI_edit_SetAttr(T_ED_ATTR *attr, int zone_id, ULONG colour, UBYTE font, USHORT mode, USHORT cursor, T_ATB_DCS dcs, UBYTE *text, USHORT size) |
2637 { | 2632 { |
2638 /* Populate the structure with the parameters | 2633 /* Populate the structure with the parameters |
2639 */ | 2634 */ |
2640 /* SPR#1559 - SH - Use pointer to zone_id */ | 2635 /* SPR#1559 - SH - Use pointer to zone_id */ |
2641 AUI_edit_CalculateWindow(attr, &zone_id ); | 2636 AUI_edit_CalculateWindow(attr, &zone_id ); |
2642 attr->colour = colour; | 2637 attr->colour = colour; |
2643 attr->font = font; | 2638 attr->font = font; |
2644 attr->mode = mode; | 2639 attr->mode = mode; |
2645 attr->cursor = cursor; | 2640 attr->cursor = cursor; |
2646 attr->text.dcs = dcs; | 2641 attr->text.dcs = dcs; |
2647 attr->text.data = text; | 2642 attr->text.data = text; |
2648 attr->text.len = ATB_string_Length(&attr->text); | 2643 attr->text.len = ATB_string_Length(&attr->text); |
2649 attr->size = size; | 2644 attr->size = size; |
2650 | 2645 |
2651 return; | 2646 return; |
2652 } | 2647 } |
2653 | 2648 |
2654 /* API - 08/07/03 - CQ10728 - Query your own number with a D1 SIM*/ | 2649 /* API - 08/07/03 - CQ10728 - Query your own number with a D1 SIM*/ |
2655 /******************************************************************************* | 2650 /******************************************************************************* |
2656 | 2651 |
2657 $Function: AUI_Edit_Display_Only | 2652 $Function: AUI_Edit_Display_Only |
2658 | 2653 |
2659 $Description: Sets up the display requirements for the Editor & also shows it | 2654 $Description: Sets up the display requirements for the Editor & also shows it |
2660 | 2655 |
2661 $Returns: None. | 2656 $Returns: None. |
2662 | 2657 |
2663 $Arguments: win - parent window, LSK - Left Soft Key, RSK - Right Soft Key | 2658 $Arguments: win - parent window, LSK - Left Soft Key, RSK - Right Soft Key |
2664 string1 - String details, string2 - String details, Title - Editor title string | 2659 string1 - String details, string2 - String details, Title - Editor title string |
2665 | 2660 |
2666 *******************************************************************************/ | 2661 *******************************************************************************/ |
2667 void AUI_Edit_Display_Only(T_MFW_HND win, int LSK, int RSK, char *string1, char *string2, int Title) | 2662 void AUI_Edit_Display_Only(T_MFW_HND win, int LSK, int RSK, char *string1, char *string2, int Title) |
2668 { | 2663 { |
2669 | 2664 |
2670 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; | 2665 T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data; |
2671 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; | 2666 T_AUI_EDITOR_INFO *data = (T_AUI_EDITOR_INFO *)win_data->user; |
2672 | 2667 |
2673 T_AUI_EDITOR_DATA display_editor_info; | 2668 T_AUI_EDITOR_DATA display_editor_info; |
2674 | 2669 |
2675 int size = MAX_RO_EDITOR_LEN; | 2670 int size = MAX_RO_EDITOR_LEN; |
2676 | 2671 |
2677 AUI_edit_SetDefault(&display_editor_info); | 2672 AUI_edit_SetDefault(&display_editor_info); |
2678 | 2673 |
2679 /* Include title for colour display */ | 2674 /* Include title for colour display */ |
2680 #ifdef COLOURDISPLAY | 2675 #ifdef COLOURDISPLAY |
2681 AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_TITLE_SCROLL, COLOUR_EDITOR, EDITOR_FONT); | 2676 AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_TITLE_SCROLL, COLOUR_EDITOR, EDITOR_FONT); |
2682 #else /* COLOURDISPLAY */ | 2677 #else /* COLOURDISPLAY */ |
2683 AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_SCROLL, COLOUR_EDITOR, EDITOR_FONT); | 2678 AUI_edit_SetDisplay(&display_editor_info, ZONE_FULL_SK_SCROLL, COLOUR_EDITOR, EDITOR_FONT); |
2684 #endif /* COLOURDISPLAY */ | 2679 #endif /* COLOURDISPLAY */ |
2685 AUI_edit_SetMode(&display_editor_info, ED_MODE_ALPHA | ED_MODE_READONLY, ED_CURSOR_NONE); | 2680 AUI_edit_SetMode(&display_editor_info, ED_MODE_ALPHA | ED_MODE_READONLY, ED_CURSOR_NONE); |
2686 AUI_edit_SetEvents(&display_editor_info, 0, FALSE, FOREVER, (T_AUI_EDIT_CB) AUI_Edit_Display_Only_CB); | 2681 AUI_edit_SetEvents(&display_editor_info, 0, FALSE, FOREVER, (T_AUI_EDIT_CB) AUI_Edit_Display_Only_CB); |
2687 AUI_edit_SetTextStr(&display_editor_info, LSK, RSK, Title, NULL); | 2682 AUI_edit_SetTextStr(&display_editor_info, LSK, RSK, Title, NULL); |
2688 | 2683 |
2689 /* SPR#2672 - SH - Allocate buffer dynamically */ | 2684 /* SPR#2672 - SH - Allocate buffer dynamically */ |
2690 | 2685 |
2691 data->displayBuffer = (char *)ALLOC_MEMORY(size); | 2686 data->displayBuffer = (char *)ALLOC_MEMORY(size); |
2692 | 2687 |
2693 strcpy(data->displayBuffer, string1); | 2688 strcpy(data->displayBuffer, string1); |
2694 | 2689 |
2695 if(string2 != NULL) | 2690 if(string2 != NULL) |
2696 { | 2691 { |
2697 strcat(data->displayBuffer, "\n"); | 2692 strcat(data->displayBuffer, "\n"); |
2698 strcat(data->displayBuffer, string2); | 2693 strcat(data->displayBuffer, string2); |
2699 } | 2694 } |
2700 | 2695 |
2701 if (data->displayBuffer[0]==(char)0x80) | 2696 if (data->displayBuffer[0]==(char)0x80) |
2702 { | 2697 { |
2703 AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_UNICODE, (UBYTE *)&data->displayBuffer[2], size/2); | 2698 AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_UNICODE, (UBYTE *)&data->displayBuffer[2], size/2); |
2704 } | 2699 } |
2705 else | 2700 else |
2706 { | 2701 { |
2707 AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_ASCII, (UBYTE *)&data->displayBuffer[0], size); | 2702 AUI_edit_SetBuffer(&display_editor_info, ATB_DCS_ASCII, (UBYTE *)&data->displayBuffer[0], size); |
2708 } | 2703 } |
2709 | 2704 |
2710 data->win = AUI_edit_Start(win,&display_editor_info); /* start the editor */ | 2705 data->win = AUI_edit_Start(win,&display_editor_info); /* start the editor */ |
2711 | 2706 |
2712 } | 2707 } |
2713 | 2708 |
2714 /******************************************************************************* | 2709 /******************************************************************************* |
2715 | 2710 |
2716 $Function: AUI_Edit_Display_Only_CB | 2711 $Function: AUI_Edit_Display_Only_CB |
2717 | 2712 |
2718 $Description: Handles the key call back from the Read only Editor | 2713 $Description: Handles the key call back from the Read only Editor |
2719 | 2714 |
2720 $Returns: None. | 2715 $Returns: None. |
2721 | 2716 |
2722 $Arguments: | 2717 $Arguments: |
2723 | 2718 |
2724 *******************************************************************************/ | 2719 *******************************************************************************/ |
2725 static void AUI_Edit_Display_Only_CB(T_MFW_HND win, USHORT Identifier, SHORT reason) | 2720 static void AUI_Edit_Display_Only_CB(T_MFW_HND win, USHORT Identifier, SHORT reason) |
2726 { | 2721 { |
2727 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 2722 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
2728 T_AUI_EDITOR_INFO * data = (T_AUI_EDITOR_INFO *)win_data->user; | 2723 T_AUI_EDITOR_INFO * data = (T_AUI_EDITOR_INFO *)win_data->user; |
2729 | 2724 |
2730 TRACE_EVENT("AUI_Edit_Display_Only_CB"); | 2725 TRACE_EVENT("AUI_Edit_Display_Only_CB"); |
2731 | 2726 |
2732 switch(reason) | 2727 switch(reason) |
2733 { | 2728 { |
2734 case INFO_KCD_RIGHT: | 2729 case INFO_KCD_RIGHT: |
2735 case INFO_KCD_HUP: | 2730 case INFO_KCD_HUP: |
2736 TRACE_EVENT("INFO_KCD_RIGHT/HUP"); | 2731 TRACE_EVENT("INFO_KCD_RIGHT/HUP"); |
2737 AUI_Edit_Display_Only_Destroy(data->win); | 2732 AUI_Edit_Display_Only_Destroy(data->win); |
2738 break; | 2733 break; |
2739 | 2734 |
2740 default: | 2735 default: |
2741 TRACE_EVENT("Err: Default"); | 2736 TRACE_EVENT("Err: Default"); |
2742 break; | 2737 break; |
2743 | 2738 |
2744 } | 2739 } |
2745 } | 2740 } |
2746 | 2741 |
2747 /******************************************************************************* | 2742 /******************************************************************************* |
2748 | 2743 |
2749 $Function: AUI_Edit_Display_Only_Destroy | 2744 $Function: AUI_Edit_Display_Only_Destroy |
2750 | 2745 |
2751 $Description: Destroy the Read only information Editor | 2746 $Description: Destroy the Read only information Editor |
2752 | 2747 |
2753 $Returns: none | 2748 $Returns: none |
2754 | 2749 |
2755 $Arguments: own_window - current window handler | 2750 $Arguments: own_window - current window handler |
2756 | 2751 |
2757 *******************************************************************************/ | 2752 *******************************************************************************/ |
2758 | 2753 |
2759 static void AUI_Edit_Display_Only_Destroy(MfwHnd own_window) | 2754 static void AUI_Edit_Display_Only_Destroy(MfwHnd own_window) |
2760 { | 2755 { |
2761 T_MFW_WIN * win_data; | 2756 T_MFW_WIN * win_data; |
2762 T_AUI_EDITOR_INFO * data; | 2757 T_AUI_EDITOR_INFO * data; |
2763 | 2758 |
2764 // USHORT i; // RAVI | 2759 // USHORT i; // RAVI |
2765 | 2760 |
2766 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); | 2761 TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_destroy()"); |
2767 | 2762 |
2768 if (own_window) | 2763 if (own_window) |
2769 { | 2764 { |
2770 win_data = ((T_MFW_HDR *)own_window)->data; | 2765 win_data = ((T_MFW_HDR *)own_window)->data; |
2771 data = (T_AUI_EDITOR_INFO *)win_data->user; | 2766 data = (T_AUI_EDITOR_INFO *)win_data->user; |
2772 | 2767 |
2773 if (data) | 2768 if (data) |
2774 { | 2769 { |
2775 /* | 2770 /* |
2776 * Delete WIN handler | 2771 * Delete WIN handler |
2777 */ | 2772 */ |
2778 | 2773 |
2779 /* SPR#2672 - SH - Delete buffer */ | 2774 /* SPR#2672 - SH - Delete buffer */ |
2780 | 2775 |
2781 if (data->displayBuffer!=NULL) | 2776 if (data->displayBuffer!=NULL) |
2782 { | 2777 { |
2783 FREE_MEMORY((void *)data->displayBuffer, MAX_RO_EDITOR_LEN); | 2778 FREE_MEMORY((void *)data->displayBuffer, MAX_RO_EDITOR_LEN); |
2784 } | 2779 } |
2785 | 2780 |
2786 /* SPR#1428 - SH - New Editor changes */ | 2781 /* SPR#1428 - SH - New Editor changes */ |
2787 #ifdef NEW_EDITOR | 2782 #ifdef NEW_EDITOR |
2788 AUI_edit_Destroy(data->win); | 2783 AUI_edit_Destroy(data->win); |
2789 #else /* NEW_EDITOR */ | 2784 #else /* NEW_EDITOR */ |
2790 editor_destroy(data->win); | 2785 editor_destroy(data->win); |
2791 #endif /* NEW_EDITOR */ | 2786 #endif /* NEW_EDITOR */ |
2792 | 2787 |
2793 win_delete (data->win); | 2788 win_delete (data->win); |
2794 | 2789 |
2795 FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); | 2790 FREE_MEMORY ((void *)data, sizeof (T_AUI_EDITOR_INFO)); |
2796 | 2791 |
2797 | 2792 |
2798 } | 2793 } |
2799 else | 2794 else |
2800 { | 2795 { |
2801 TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); | 2796 TRACE_EVENT ("SmsRead_R_TEXTEDT2_destroy() called twice"); |
2802 } | 2797 } |
2803 } | 2798 } |
2804 } | 2799 } |
2805 /* API - 08/07/03 - CQ10728 END*/ | 2800 /* API - 08/07/03 - CQ10728 END*/ |