wgui_draw_manager.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:345k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /* **** Copy Right Note ********* 
  36.  * Copyright Notice
  37.  * (c) PMT.
  38.  * All Rights Reserved.
  39.  *  (It is illegal to remove this copyright notice from this software or any
  40.  *  portion of it)
  41.  *******************************************************************************
  42.  * Filename:
  43.  * ---------
  44.  * wgui_draw_manager.c
  45.  *
  46.  * Project:
  47.  * --------
  48.  * PDG2
  49.  *
  50.  * Description:
  51.  * ------------
  52.  * Draws the category screens on the basis of the static coordinates specified
  53.  * at Complile Time.
  54.  * Author:
  55.  * -------
  56.  * -------
  57.  *==============================================================================
  58.  * HISTORY
  59.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  60.  *------------------------------------------------------------------------------
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * removed!
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * removed!
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * removed!
  134.  *
  135.  * removed!
  136.  * removed!
  137.  * removed!
  138.  *
  139.  * removed!
  140.  * removed!
  141.  * removed!
  142.  *
  143.  * removed!
  144.  * removed!
  145.  * removed!
  146.  *
  147.  * removed!
  148.  * removed!
  149.  * removed!
  150.  *
  151.  * removed!
  152.  * removed!
  153.  * removed!
  154.  *
  155.  * removed!
  156.  * removed!
  157.  * removed!
  158.  *
  159.  * removed!
  160.  * removed!
  161.  * removed!
  162.  *
  163.  * removed!
  164.  * removed!
  165.  * removed!
  166.  *
  167.  * removed!
  168.  * removed!
  169.  * removed!
  170.  *
  171.  * removed!
  172.  * removed!
  173.  * removed!
  174.  *
  175.  * removed!
  176.  * removed!
  177.  * removed!
  178.  *
  179.  * removed!
  180.  * removed!
  181.  * removed!
  182.  *
  183.  * removed!
  184.  * removed!
  185.  * removed!
  186.  *
  187.  * removed!
  188.  * removed!
  189.  * removed!
  190.  *
  191.  * removed!
  192.  * removed!
  193.  * removed!
  194.  *
  195.  * removed!
  196.  * removed!
  197.  * removed!
  198.  *
  199.  * removed!
  200.  * removed!
  201.  * removed!
  202.  *
  203.  * removed!
  204.  * removed!
  205.  * removed!
  206.  *
  207.  * removed!
  208.  * removed!
  209.  * removed!
  210.  *
  211.  * removed!
  212.  * removed!
  213.  * removed!
  214.  *
  215.  * removed!
  216.  * removed!
  217.  * removed!
  218.  *
  219.  * removed!
  220.  * removed!
  221.  * removed!
  222.  *
  223.  * removed!
  224.  * removed!
  225.  * removed!
  226.  *
  227.  * removed!
  228.  * removed!
  229.  * removed!
  230.  *
  231.  * removed!
  232.  * removed!
  233.  * removed!
  234.  *
  235.  * removed!
  236.  * removed!
  237.  * removed!
  238.  *
  239.  * removed!
  240.  * removed!
  241.  * removed!
  242.  *
  243.  * removed!
  244.  * removed!
  245.  * removed!
  246.  *
  247.  * removed!
  248.  * removed!
  249.  * removed!
  250.  *
  251.  * removed!
  252.  * removed!
  253.  * removed!
  254.  *
  255.  * removed!
  256.  * removed!
  257.  * removed!
  258.  *
  259.  * removed!
  260.  * removed!
  261.  * removed!
  262.  *
  263.  * removed!
  264.  * removed!
  265.  * removed!
  266.  *
  267.  * removed!
  268.  * removed!
  269.  * removed!
  270.  *
  271.  * removed!
  272.  * removed!
  273.  * removed!
  274.  *
  275.  * removed!
  276.  * removed!
  277.  * removed!
  278.  *
  279.  * removed!
  280.  * removed!
  281.  * removed!
  282.  *
  283.  * removed!
  284.  * removed!
  285.  * removed!
  286.  *
  287.  * removed!
  288.  * removed!
  289.  * removed!
  290.  *
  291.  * removed!
  292.  * removed!
  293.  * removed!
  294.  *
  295.  * removed!
  296.  * removed!
  297.  * removed!
  298.  *
  299.  * removed!
  300.  * removed!
  301.  * removed!
  302.  *
  303.  * removed!
  304.  * removed!
  305.  * removed!
  306.  *
  307.  * removed!
  308.  * removed!
  309.  * removed!
  310.  *
  311.  * removed!
  312.  * removed!
  313.  * removed!
  314.  *
  315.  * removed!
  316.  * removed!
  317.  * removed!
  318.  *
  319.  * removed!
  320.  * removed!
  321.  * removed!
  322.  *
  323.  * removed!
  324.  * removed!
  325.  * removed!
  326.  *
  327.  * removed!
  328.  * removed!
  329.  * removed!
  330.  *
  331.  * removed!
  332.  * removed!
  333.  * removed!
  334.  *
  335.  * removed!
  336.  * removed!
  337.  * removed!
  338.  *
  339.  * removed!
  340.  * removed!
  341.  * removed!
  342.  *
  343.  * removed!
  344.  * removed!
  345.  * removed!
  346.  *
  347.  * removed!
  348.  * removed!
  349.  * removed!
  350.  *
  351.  * removed!
  352.  * removed!
  353.  * removed!
  354.  *
  355.  * removed!
  356.  * removed!
  357.  * removed!
  358.  *
  359.  * removed!
  360.  * removed!
  361.  * removed!
  362.  *
  363.  * removed!
  364.  * removed!
  365.  * removed!
  366.  *
  367.  * removed!
  368.  * removed!
  369.  * removed!
  370.  *
  371.  * removed!
  372.  * removed!
  373.  * removed!
  374.  *
  375.  * removed!
  376.  * removed!
  377.  * removed!
  378.  *
  379.  * removed!
  380.  * removed!
  381.  * removed!
  382.  *
  383.  * removed!
  384.  * removed!
  385.  * removed!
  386.  *
  387.  * removed!
  388.  * removed!
  389.  * removed!
  390.  *
  391.  * removed!
  392.  * removed!
  393.  * removed!
  394.  *
  395.  * removed!
  396.  * removed!
  397.  * removed!
  398.  *
  399.  * removed!
  400.  * removed!
  401.  * removed!
  402.  *
  403.  * removed!
  404.  * removed!
  405.  * removed!
  406.  *
  407.  * removed!
  408.  * removed!
  409.  * removed!
  410.  *
  411.  * removed!
  412.  * removed!
  413.  * removed!
  414.  *
  415.  * removed!
  416.  * removed!
  417.  * removed!
  418.  *
  419.  * removed!
  420.  * removed!
  421.  * removed!
  422.  *
  423.  * removed!
  424.  * removed!
  425.  * removed!
  426.  *
  427.  * removed!
  428.  * removed!
  429.  * removed!
  430.  *
  431.  * removed!
  432.  * removed!
  433.  * removed!
  434.  *
  435.  * removed!
  436.  * removed!
  437.  * removed!
  438.  *
  439.  * removed!
  440.  * removed!
  441.  * removed!
  442.  *
  443.  * removed!
  444.  * removed!
  445.  * removed!
  446.  *
  447.  * removed!
  448.  * removed!
  449.  * removed!
  450.  *
  451.  * removed!
  452.  * removed!
  453.  * removed!
  454.  *
  455.  * removed!
  456.  * removed!
  457.  * removed!
  458.  *
  459.  * removed!
  460.  * removed!
  461.  * removed!
  462.  *
  463.  * removed!
  464.  * removed!
  465.  * removed!
  466.  *
  467.  * removed!
  468.  * removed!
  469.  * removed!
  470.  *
  471.  * removed!
  472.  * removed!
  473.  * removed!
  474.  *
  475.  * removed!
  476.  * removed!
  477.  * removed!
  478.  *
  479.  * removed!
  480.  * removed!
  481.  * removed!
  482.  *
  483.  * removed!
  484.  * removed!
  485.  * removed!
  486.  *
  487.  * removed!
  488.  * removed!
  489.  * removed!
  490.  *
  491.  * removed!
  492.  * removed!
  493.  * removed!
  494.  *
  495.  * removed!
  496.  * removed!
  497.  * removed!
  498.  *
  499.  * removed!
  500.  * removed!
  501.  * removed!
  502.  *
  503.  * removed!
  504.  * removed!
  505.  * removed!
  506.  *
  507.  * removed!
  508.  * removed!
  509.  * removed!
  510.  *
  511.  * removed!
  512.  * removed!
  513.  * removed!
  514.  *
  515.  * removed!
  516.  * removed!
  517.  * removed!
  518.  *
  519.  * removed!
  520.  * removed!
  521.  * removed!
  522.  *
  523.  * removed!
  524.  * removed!
  525.  * removed!
  526.  *
  527.  * removed!
  528.  * removed!
  529.  * removed!
  530.  *
  531.  * removed!
  532.  * removed!
  533.  * removed!
  534.  *
  535.  * removed!
  536.  * removed!
  537.  * removed!
  538.  *
  539.  * removed!
  540.  * removed!
  541.  * removed!
  542.  *
  543.  * removed!
  544.  * removed!
  545.  * removed!
  546.  *
  547.  * removed!
  548.  * removed!
  549.  * removed!
  550.  *
  551.  * removed!
  552.  * removed!
  553.  * removed!
  554.  *
  555.  * removed!
  556.  * removed!
  557.  * removed!
  558.  *
  559.  * removed!
  560.  * removed!
  561.  * removed!
  562.  *
  563.  * removed!
  564.  * removed!
  565.  * removed!
  566.  *
  567.  * removed!
  568.  * removed!
  569.  * removed!
  570.  *
  571.  * removed!
  572.  * removed!
  573.  * removed!
  574.  *
  575.  *------------------------------------------------------------------------------
  576.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  577.  *==============================================================================
  578.  *******************************************************************************/
  579.  /*  Include: MMI header file */
  580. #include "MMI_features.h"
  581. #ifdef __MMI_DRAW_MANAGER__
  582. #include "FrameworkStruct.h"
  583. #include "CustDataRes.h"
  584. #include "wgui_draw_manager.h"
  585. #include "wgui_fixed_menus.h"
  586. #include "wgui_status_icons.h"
  587. #include "wgui_categories_mm.h"
  588. #include "wgui_categories_inputs.h"
  589. #include "wgui_ems.h"
  590. #include "wgui_categories_popup.h"
  591. #include "wgui_categories_sublcd.h"
  592. #include "wgui_categories_idlescreen.h"
  593. #include "wgui_fixed_menus.h"
  594. #include "wgui_softkeys.h"
  595. #include "DebugInitDef.h"
  596. #include "gui_fixed_menuitems.h"
  597. #include "lcd_sw.h"
  598. #include "gdi_include.h"
  599. #include "wgui_categories_util.h"
  600. #include "wgui_calendar.h"
  601. #include "wgui_tab_bars.h"
  602. #include "wgui_virtual_keyboard.h"
  603. #include "gui_setting.h"
  604. #ifdef __MMI_TOUCH_SCREEN__
  605. #include "wgui_touch_screen.h"
  606. #endif 
  607. #if defined(__MMI_TOUCH_SCREEN__)
  608. #include "EditorPen.h"
  609. #endif 
  610. #ifdef __MMI_STOPWATCH__
  611. #include "StopwatchDef.h"
  612. #include "wgui_categories_stopwatch.h"
  613. #include "StopwatchStruct.h"
  614. #endif /* __MMI_STOPWATCH__ */ 
  615. #ifdef __MMI_SCREEN_ROTATE__
  616. #include "ScreenRotationGprot.h"
  617. #endif 
  618. /* START VIJAY PMT 20051202 */
  619. #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
  620. #include "HistoryGprot.h"
  621. #endif 
  622. #include "ProfilingEngine.h"
  623. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 start
  624. #ifdef __MMI_KP_STYLE_MAIN_MENU_MATRIX__
  625. #include "MainMenuDef.h"
  626. #endif
  627. //KP Jerry add for KP-Style 12-Matrix mainmenu on 2007-3-19 end
  628. /* END VIJAY PMT 20051202 */
  629. /***************************************************************************** 
  630. * Local Variable
  631. *****************************************************************************/
  632. /**************************************************/
  633. /* Currently, we keep two context for MainLCD and SubLCD */
  634. /* In the future, we may have more than 2 LCDs                 */
  635. /* More context data would be needed in the future              */
  636. /**************************************************/
  637. /* Start of Draw Manager MainLCD Context */
  638. /* DM internal context */
  639. static dm_cntx_struct g_dm_cntx;
  640. static dm_scr_bg_cntx_struct g_dm_scr_bg_cntx;
  641. /* DM components */
  642. /* -Layers */
  643. #ifndef __GDI_MEMORY_PROFILE_2__
  644. static U16 new_layer_x = 0;
  645. static U16 new_layer_y = 0;
  646. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  647. /* Currently used layers in Draw Manager */
  648. static GDI_HANDLE dm_layers[GDI_LAYER_TOTAL_LAYER_COUNT];
  649. /* Total currently used layers in Draw Manager */
  650. static U16 dm_layers_count = 0;
  651. static GDI_HANDLE dm_wallpaper_layer = GDI_ERROR_HANDLE;
  652. /* -Strings */
  653. static dm_string_data_struct dm_string_array[DM_MAX_STRINGS];
  654. static S32 dm_string_count = 0;
  655. /* -Images */
  656. static dm_image_data_struct dm_image_array[DM_MAX_IMAGES];
  657. static S32 dm_image_count = 0;
  658. /* -Background fillers */
  659. static UI_filled_area *dm_back_fill_array[DM_MAX_FILL_AREAS];
  660. static S32 dm_back_fill_count = 0;
  661. /* -Rectangles */
  662. static dm_rectangle_data_struct dm_rectangle_array[DM_MAX_RECTANGLES];
  663. static S32 dm_rectangle_count = 0;
  664. /* -Lines */
  665. static color dm_line_array[DM_MAX_LINES];
  666. static S32 dm_line_count = 0;
  667. /* -Scrolling Text objects */
  668. static scrolling_text dm_scroll_text[DM_MAX_SCROLL_TEXT];
  669. static U8 dm_scroll_text_buf[DM_MAX_SCROLL_TEXT][MAX_SUBMENU_CHARACTERS];
  670. static S32 dm_scroll_text_count = 0;
  671. static scrolling_text *dm_current_scroll_text = NULL;
  672. /* slide controls */
  673. S32 dm_slide_control_count = 0;
  674. /* buttons */
  675. static icontext_button dm_button_array[DM_MAX_BUTTONS];
  676. static S32 dm_button_count = 0;
  677. #ifdef __MMI_DRAW_MANAGER__
  678. static FuncPtr dm_button_func_ptrs[DM_MAX_BUTTONS][MAX_KEY_TYPE];
  679. #endif 
  680. /* percentage bar */
  681. static dm_percentage_bar_struct dm_percentage_bar_array[DM_MAX_PERCENTAGE_BAR];
  682. static S32 dm_percentage_bar_count = 0;
  683. /* others */
  684. static dm_previous_control_coordinates_struct prev_control_coordinates;
  685. static dm_aligned_area_data_struct dm_aligned_area_data;
  686. static FuncPtr dm_show_vkpad_callback = UI_dummy_function;
  687. /* End of MainLCD context */
  688. /* DM SubLCD context stat */
  689. #ifdef __MMI_SUBLCD__
  690. /* -Layers */
  691. static GDI_HANDLE dm_layers_sub[GDI_LAYER_TOTAL_LAYER_COUNT];
  692. static U16 dm_layers_count_sub = 0;
  693. /* -Strings */
  694. static dm_string_data_struct dm_string_array_sub[DM_MAX_SUBLCD_STRINGS];
  695. static S32 dm_string_count_sub = 0;
  696. /* -Images */
  697. static dm_image_data_struct dm_image_array_sub[DM_MAX_SUBLCD_IMAGES];
  698. static S32 dm_image_count_sub = 0;
  699. #if (0) /* Currently Not used */
  700. /* under construction !*/
  701. /* under construction !*/
  702. /* under construction !*/
  703. /* under construction !*/
  704. /* under construction !*/
  705. /* under construction !*/
  706. /* under construction !*/
  707. /* under construction !*/
  708. /* under construction !*/
  709. /* under construction !*/
  710. /* under construction !*/
  711. /* under construction !*/
  712. /* under construction !*/
  713. /* under construction !*/
  714. /* under construction !*/
  715. /* under construction !*/
  716. /* under construction !*/
  717. #endif /* (0) */ 
  718. #endif /* __MMI_SUBLCD__ */ 
  719. /* End of SubLCD context */
  720. /***************************************************************************** 
  721. * Global Variable
  722. *****************************************************************************/
  723. dm_data_struct g_dm_data;
  724. dm_data_struct g_dm_sublcd_data;
  725. void (*dm_backup_exit_category_function) (void);
  726. #ifdef __MMI_SUBLCD__
  727. void (*dm_sub_backup_exit_category_function) (void);
  728. #endif 
  729. void (*dm_category_controlled_area_callback) (dm_coordinates *coordinate);
  730. void (*dm_category_controlled_area2_callback) (dm_coordinates *coordinate);
  731. #ifdef __MMI_SUBLCD__
  732. void (*dm_sub_category_controlled_area_callback) (dm_coordinates *coordinate);
  733. #endif 
  734. /***************************************************************************** 
  735. * Global Function
  736. *****************************************************************************/
  737. S16 *dm_get_coordinates(S16 *UICtrlAccessPtr_p, dm_coordinates *dm_coordinate_info);
  738. /***************************************************************************** 
  739. * Extern Global Variable
  740. *****************************************************************************/
  741. #ifdef __MMI_STOPWATCH__
  742. extern wtchSkinResStruct wtch_pos;
  743. extern S32 stop_watch_x, stop_watch_y, stop_watch_width;
  744. #endif /* __MMI_STOPWATCH__ */ 
  745. extern S32 wgui_EMS_inputbox_information_bar_height;
  746. extern U8 matrix_main_menu_highlight_bitmap_data[];
  747. extern const U8 dm_base_control_set[];
  748. extern const S16 dm_base_control_set_coordinates[];
  749. extern icontext_button MMI_softkeys[];
  750. extern BOOL r2lMMIFlag;
  751. //extern MMI_ID_TYPE idle_screen_wallpaper_ID;    /* 061705 Calvin added */
  752. //extern S8 *idle_screen_wallpaper_name;
  753. extern MMI_ID_TYPE idle_screen_cache_id;    /* 073106 cache wallpaper */
  754. extern S8 *idle_screen_cache_name;
  755. /* Calendar Extern Variables */
  756. extern S32 cat82_title1_x1;
  757. extern S32 cat82_title1_y1;
  758. extern S32 cat82_title1_x2;
  759. extern S32 cat82_title1_y2;
  760. extern S32 cat82_title2_x1;
  761. extern S32 cat82_title2_y1;
  762. extern S32 cat82_title2_x2;
  763. extern S32 cat82_title2_y2;
  764. extern S32 cat82_title3_x1;
  765. extern S32 cat82_title3_y1;
  766. extern S32 cat82_title3_x2;
  767. extern S32 cat82_title3_y2;
  768. extern pBOOL calendar_show_title2;
  769. extern pBOOL calendar_show_title3;
  770. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  771. extern S32 cat82_title1_month_x1;
  772. extern S32 cat82_title1_month_y1;
  773. extern S32 cat82_title1_month_x2;
  774. extern S32 cat82_title1_month_y2;
  775. extern pBOOL calendar_show_title_month;
  776. extern BOOL lunar_calendar_present;
  777. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  778. extern U8 *Cat82_title1;
  779. extern U8 *Cat82_title2;
  780. extern U8 *Cat82_title3;
  781. extern stFontAttribute wgui_dialer_box_f1;
  782. extern UI_font_type calendar_title_font;
  783. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  784. extern U8 *Cat82_title1_month;
  785. extern UI_font_type calendar_title_month_font;
  786. #endif /* __MMI_UI_CALENDAR_WITH_INFO_BOX__ */ 
  787. extern UI_filled_area wgui_pop_up_dialog_background;
  788. extern gdi_handle wgui_layer_1;
  789. extern multitap_input MMI_uppercase_multitaps[MAX_MULTITAPS];
  790. extern multitap_input MMI_lowercase_multitaps[MAX_MULTITAPS];
  791. extern multitap_input MMI_bpmf_multitaps[MAX_MULTITAPS];
  792. #if defined(__MMI_MULTITAP_SPANISH__)
  793. extern multitap_input MMI_spanish_uppercase_multitaps[MAX_MULTITAPS];
  794. extern multitap_input MMI_spanish_lowercase_multitaps[MAX_MULTITAPS];
  795. #endif /* defined(__MMI_MULTITAP_SPANISH__) */ 
  796. #if defined(__MMI_MULTITAP_FRENCH__)
  797. extern multitap_input MMI_french_uppercase_multitaps[MAX_MULTITAPS];
  798. extern multitap_input MMI_french_lowercase_multitaps[MAX_MULTITAPS];
  799. #endif /* defined(__MMI_MULTITAP_FRENCH__) */ 
  800. #if defined(__MMI_MULTITAP_GERMAN__)
  801. extern multitap_input MMI_german_uppercase_multitaps[MAX_MULTITAPS];
  802. extern multitap_input MMI_german_lowercase_multitaps[MAX_MULTITAPS];
  803. #endif /* defined(__MMI_MULTITAP_GERMAN__) */ 
  804. #if defined(__MMI_MULTITAP_ITALIAN__)
  805. extern multitap_input MMI_italian_uppercase_multitaps[MAX_MULTITAPS];
  806. extern multitap_input MMI_italian_lowercase_multitaps[MAX_MULTITAPS];
  807. #endif /* defined(__MMI_MULTITAP_ITALIAN__) */ 
  808. /* PMT CZ_PO_TU START 20050812 */
  809. #if defined(__MMI_MULTITAP_POLISH__)
  810. extern multitap_input MMI_polish_uppercase_multitaps[MAX_MULTITAPS];
  811. extern multitap_input MMI_polish_lowercase_multitaps[MAX_MULTITAPS];
  812. #endif /* defined(__MMI_MULTITAP_POLISH__) */ 
  813. //PMT CZ_PO_TU END 20050812     
  814. //PMT CZ_PO_TU START 20050812   
  815. #if defined(__MMI_MULTITAP_CZECH__)
  816. extern multitap_input MMI_czech_uppercase_multitaps[MAX_MULTITAPS];
  817. extern multitap_input MMI_czech_lowercase_multitaps[MAX_MULTITAPS];
  818. #endif /* defined(__MMI_MULTITAP_CZECH__) */ 
  819. //PMT CZ_PO_TU END 20050812     
  820. //PMT CZ_PO_TU START 20050812   
  821. #if defined(__MMI_MULTITAP_TURKISH__)
  822. extern multitap_input MMI_turkish_uppercase_multitaps[MAX_MULTITAPS];
  823. extern multitap_input MMI_turkish_lowercase_multitaps[MAX_MULTITAPS];
  824. #endif /* defined(__MMI_MULTITAP_TURKISH__) */ 
  825. //PMT CZ_PO_TU END 20050812     
  826. // PMT BHASKAR START 20052907
  827. #if defined(__MMI_MULTITAP_VIETNAMESE__)
  828. extern multitap_input MMI_vietnamese_uppercase_multitaps[MAX_MULTITAPS];
  829. extern multitap_input MMI_vietnamese_lowercase_multitaps[MAX_MULTITAPS];
  830. #endif /* defined(__MMI_MULTITAP_VIETNAMESE__) */ 
  831. #if defined(__MMI_MULTITAP_INDONESIAN__)
  832. extern multitap_input MMI_indonesian_uppercase_multitaps[MAX_MULTITAPS];
  833. extern multitap_input MMI_indonesian_lowercase_multitaps[MAX_MULTITAPS];
  834. #endif /* defined(__MMI_MULTITAP_INDONESIAN__) */ 
  835. #if defined(__MMI_MULTITAP_DANISH__)
  836. extern multitap_input MMI_danish_uppercase_multitaps[MAX_MULTITAPS];
  837. extern multitap_input MMI_danish_lowercase_multitaps[MAX_MULTITAPS];
  838. #endif /* defined(__MMI_MULTITAP_DANISH__) */ 
  839. #if defined(__MMI_MULTITAP_PORTUGUESE__)
  840. extern multitap_input MMI_portuguese_uppercase_multitaps[MAX_MULTITAPS];
  841. extern multitap_input MMI_portuguese_lowercase_multitaps[MAX_MULTITAPS];
  842. #endif /* defined(__MMI_MULTITAP_PORTUGUESE__) */ 
  843. /* PMT START HU_FI 20050825 */
  844. #if defined(__MMI_MULTITAP_FINNISH__)
  845. extern multitap_input MMI_finnish_uppercase_multitaps[MAX_MULTITAPS];
  846. extern multitap_input MMI_finnish_lowercase_multitaps[MAX_MULTITAPS];
  847. #endif /* defined(__MMI_MULTITAP_FINNISH__) */ 
  848. //PMT END HU_FI 20050825
  849. //PMT NO_AR_SL_DU START 20050909
  850. #if defined(__MMI_MULTITAP_SLOVAK__)
  851. extern multitap_input MMI_slovak_uppercase_multitaps[MAX_MULTITAPS];
  852. extern multitap_input MMI_slovak_lowercase_multitaps[MAX_MULTITAPS];
  853. #endif /* defined(__MMI_MULTITAP_SLOVAK__) */ 
  854. /* START DUTCH_T9 20051021 */
  855. #if defined(__MMI_MULTITAP_DUTCH__)
  856. extern multitap_input MMI_dutch_uppercase_multitaps[MAX_MULTITAPS];
  857. extern multitap_input MMI_dutch_lowercase_multitaps[MAX_MULTITAPS];
  858. #endif /* defined(__MMI_MULTITAP_DUTCH__) */ 
  859. //END DUTCH_T9 20051021
  860. //PMT BULGARIAN START 20051201
  861. #if defined(__MMI_MULTITAP_BULGARIAN__)
  862. extern multitap_input MMI_bulgarian_uppercase_multitaps[MAX_MULTITAPS];
  863. extern multitap_input MMI_bulgarian_lowercase_multitaps[MAX_MULTITAPS];
  864. #endif /* defined(__MMI_MULTITAP_BULGARIAN__) */ 
  865. /* PMT BULGARIAN END 20051201 */
  866. #if defined(__MMI_MULTITAP_ARABIC__)
  867. extern multitap_input MMI_arabic_multitaps[MAX_MULTITAPS];
  868. #endif 
  869. /* PMT START PERSIAN */
  870. #if defined(__MMI_MULTITAP_PERSIAN__)
  871. extern multitap_input MMI_persian_multitaps[MAX_MULTITAPS];
  872. #endif 
  873. //PMT END PERSIAN
  874. /* Norwegian start */
  875. #if defined(__MMI_MULTITAP_NORWEGIAN__)
  876. extern multitap_input MMI_norwegian_uppercase_multitaps[MAX_MULTITAPS];
  877. extern multitap_input MMI_norwegian_lowercase_multitaps[MAX_MULTITAPS];
  878. #endif /* defined(__MMI_MULTITAP_NORWEGIAN__) */ 
  879. //Norwegian end
  880. //PMT NO_AR_SL_DU END 20050909
  881. //PMT START SWEDISH 20050916
  882. #if defined(__MMI_MULTITAP_SWEDISH__)
  883. extern multitap_input MMI_swedish_uppercase_multitaps[MAX_MULTITAPS];
  884. extern multitap_input MMI_swedish_lowercase_multitaps[MAX_MULTITAPS];
  885. #endif /* defined(__MMI_MULTITAP_SWEDISH__) */ 
  886. //PMT END SWEDISH 20050916
  887. //PMT START CR_ROM_SLO 20050923
  888. #if defined(__MMI_MULTITAP_CROATIAN__)
  889. extern multitap_input MMI_croatian_uppercase_multitaps[MAX_MULTITAPS];
  890. extern multitap_input MMI_croatian_lowercase_multitaps[MAX_MULTITAPS];
  891. #endif /* defined(__MMI_MULTITAP_CROATIAN__) */ 
  892. #if defined(__MMI_MULTITAP_ROMANIAN__)
  893. extern multitap_input MMI_romanian_uppercase_multitaps[MAX_MULTITAPS];
  894. extern multitap_input MMI_romanian_lowercase_multitaps[MAX_MULTITAPS];
  895. #endif /* defined(__MMI_MULTITAP_ROMANIAN__) */ 
  896. #if defined(__MMI_MULTITAP_SLOVENIAN__)
  897. extern multitap_input MMI_slovenian_uppercase_multitaps[MAX_MULTITAPS];
  898. extern multitap_input MMI_slovenian_lowercase_multitaps[MAX_MULTITAPS];
  899. #endif /* defined(__MMI_MULTITAP_SLOVENIAN__) */ 
  900. //PMT END CR_ROM_SLO 20050923
  901. //PMT START GR_HE_CZ_FI_DA_HU 20051007
  902. #if defined(__MMI_MULTITAP_GREEK__)
  903. extern multitap_input MMI_greek_uppercase_multitaps[MAX_MULTITAPS];
  904. extern multitap_input MMI_greek_lowercase_multitaps[MAX_MULTITAPS];
  905. #endif /* defined(__MMI_MULTITAP_GREEK__) */ 
  906. #if defined(__MMI_MULTITAP_HUNGARIAN__)
  907. extern multitap_input MMI_hungarian_uppercase_multitaps[MAX_MULTITAPS];
  908. extern multitap_input MMI_hungarian_lowercase_multitaps[MAX_MULTITAPS];
  909. #endif /* defined(__MMI_MULTITAP_HUNGARIAN__) */ 
  910. /* PMT END GR_HE_CZ_FI_DA_HU 20051007 */
  911. #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
  912. extern multitap_input MMI_uppercase_numberless_multitaps[MAX_MULTITAPS];
  913. extern multitap_input MMI_lowercase_numberless_multitaps[MAX_MULTITAPS];
  914. #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */ 
  915. /***************************************************************************** 
  916. * Extern Global Function
  917. *****************************************************************************/
  918. extern void (*redraw_current_inline_item) (void);
  919. extern S32 dm_get_coordinate_sets_count(void);
  920. extern S32 dm_get_control_sets_count(void);
  921. extern U8 *dm_get_base_control_set(void);
  922. extern S16 *dm_get_base_coordinate_set(void);
  923. extern U8 *dm_get_base_control_set2(void);
  924. extern S16 *dm_get_base_coordinate_set2(void);
  925. extern void set_calendar_control_background_limits(S32 y1, S32 y2);
  926. extern void set_button_bar_height(S32 height);
  927. extern void wgui_reset_calendar_params(S32 x, S32 y, S32 n_columns, S32 n_rows, S32 cell_width, S32 cell_height);
  928. extern void wgui_show_calendar(void);
  929. extern void ChangeCategory82Title1(U8 *title);
  930. extern void ChangeCategory82Title2(U8 *title);
  931. extern void ChangeCategory82Title3(U8 *title);
  932. extern void category151_keyboard_handler(S32 vkey_code, S32 key_state);
  933. extern void UI_cross_hatch_fill_rectangle(S32 x1, S32 y1, S32 x2, S32 y2, color c);
  934. extern MMI_BOOL get_singleline_inputbox_display_status(void);
  935. extern MMI_BOOL is_multiline_inputbox_in_view_mode(void);
  936. extern MMI_BOOL is_EMS_inputbox_in_view_mode(void);
  937. #ifdef __MMI_UI_CALENDAR_WITH_INFO_BOX__
  938. extern void ChangeCategory82Title1Month(U8 *title);
  939. #endif 
  940. #ifdef __MMI_STOPWATCH__
  941. extern void get_stop_watch_history(U16 history_ID, U8 *history_buffer);
  942. #endif 
  943. /*****************************************************************************
  944.  * FUNCTION
  945.  *  dm_init
  946.  * DESCRIPTION
  947.  *  initialize variables used in draw manager.
  948.  * PARAMETERS
  949.  *  void
  950.  * RETURNS
  951.  *  void
  952.  *****************************************************************************/
  953. void dm_init(void)
  954. {
  955.     /*----------------------------------------------------------------*/
  956.     /* Local Variables                                                */
  957.     /*----------------------------------------------------------------*/
  958.     U8 idx = 0;
  959.     /*----------------------------------------------------------------*/
  960.     /* Code Body                                                      */
  961.     /*----------------------------------------------------------------*/
  962.     for (idx = 0; idx < GDI_LAYER_TOTAL_LAYER_COUNT; idx++)
  963.     {
  964.         dm_layers[idx] = GDI_ERROR_HANDLE;
  965.     }
  966.     /* Draw Manager context */
  967.     g_dm_cntx.redraw_screen_main = NORMAL_EXIT;
  968.     g_dm_cntx.redraw_scr_bg_flag = 1;
  969.     g_dm_cntx.lock_redraw_main = 0;
  970.     g_dm_cntx.exit_full_screen_on_exit = 0;
  971.     g_dm_cntx.is_context_reset = 1;
  972. #ifdef __MMI_SUBLCD__
  973.     g_dm_cntx.redraw_screen_sub = NORMAL_EXIT;
  974.     g_dm_cntx.lock_redraw_sub = 0;
  975. #endif /* __MMI_SUBLCD__ */ 
  976.     /* Draw Manager Screen Background Layer Context */
  977.     g_dm_scr_bg_cntx.layer_handle = GDI_ERROR_HANDLE;
  978.     /* g_dm_scr_bg_cntx.animation_handle=GDI_ERROR_HANDLE; */
  979.     g_dm_scr_bg_cntx.image_id = 0;
  980.     g_dm_scr_bg_cntx.image_name = NULL;
  981.     g_dm_scr_bg_cntx.offset_x = -1;
  982.     g_dm_scr_bg_cntx.offset_y = -1;
  983.     g_dm_scr_bg_cntx.layer_opacity = 150;
  984.     g_dm_scr_bg_cntx.flags = 0;//082906 scr_bg
  985.     /* Reset all images */
  986.     for (idx = 0; idx < dm_image_count; idx++)
  987.     {
  988.         dm_image_array[idx].back_fill = NULL;
  989.         dm_image_array[idx].image = NULL;
  990.         dm_image_array[idx].name = NULL;
  991.         if (dm_image_array[idx].image_handle != GDI_ERROR_HANDLE)
  992.         {
  993.             gdi_image_stop_animation(dm_image_array[idx].image_handle);
  994.             dm_image_array[idx].image_handle = GDI_ERROR_HANDLE;
  995.         }
  996.     }
  997.     dm_image_count = 0;
  998.     dm_string_count = 0;
  999.     dm_back_fill_count = 0;
  1000.     dm_rectangle_count = 0;
  1001.     dm_line_count = 0;
  1002.     dm_slide_control_count = 0;
  1003.     dm_scroll_text_count = 0;
  1004.     dm_current_scroll_text = NULL;
  1005.     dm_button_count = 0;
  1006. #ifdef __MMI_SUBLCD__
  1007.     /* Reset all images */
  1008.     for (idx = 0; idx < dm_image_count_sub; idx++)
  1009.     {
  1010.         dm_image_array_sub[idx].back_fill = NULL;
  1011.         dm_image_array_sub[idx].image = NULL;
  1012.         dm_image_array_sub[idx].name = NULL;
  1013.         if (dm_image_array_sub[idx].image_handle != GDI_ERROR_HANDLE)
  1014.         {
  1015.             gdi_image_stop_animation(dm_image_array_sub[idx].image_handle);
  1016.             dm_image_array_sub[idx].image_handle = GDI_ERROR_HANDLE;
  1017.         }
  1018.     }
  1019.     dm_image_count_sub = 0;
  1020.     dm_string_count_sub = 0;
  1021. #endif /* __MMI_SUBLCD__ */ 
  1022. }
  1023. /*****************************************************************************
  1024.  * FUNCTION
  1025.  *  dm_reset_context
  1026.  * DESCRIPTION
  1027.  *  reset variables used in draw manager.
  1028.  * PARAMETERS
  1029.  *  void
  1030.  * RETURNS
  1031.  *  void
  1032.  *****************************************************************************/
  1033. void dm_reset_context(void)
  1034. {
  1035.     /*----------------------------------------------------------------*/
  1036.     /* Local Variables                                                */
  1037.     /*----------------------------------------------------------------*/
  1038.     /*----------------------------------------------------------------*/
  1039.     /* Code Body                                                      */
  1040.     /*----------------------------------------------------------------*/
  1041.     if (g_dm_cntx.is_context_reset == MMI_FALSE)
  1042.     {
  1043.         U8 idx = 0;
  1044.         /* Reset screen background layer */
  1045.         dm_set_scr_bg_redraw(MMI_TRUE);
  1046.         g_dm_scr_bg_cntx.layer_handle = GDI_ERROR_HANDLE;
  1047.         /* Reset Layer information */
  1048.         /* MainLCD */
  1049.         if (!(g_dm_data.s32flags & DM_SUB_LCD_CONTEXT))
  1050.         {
  1051.             for (idx = 0; idx < dm_layers_count; idx++)
  1052.             {
  1053.                 if (dm_layers[idx] != GDI_LAYER_MAIN_BASE_LAYER_HANDLE && dm_layers[idx] != wgui_layer_1
  1054.                     && dm_layers[idx] != GDI_ERROR_HANDLE && dm_layers[idx] != GDI_LAYER_EMPTY_HANDLE)
  1055.                 {
  1056.                     gdi_layer_free(dm_layers[idx]);
  1057.                 }
  1058.                 dm_layers[idx] = GDI_ERROR_HANDLE;
  1059.             }
  1060.             dm_layers_count = 0;
  1061.         }
  1062.         dm_wallpaper_layer = GDI_ERROR_HANDLE;
  1063.         /* can be removed */
  1064.         gdi_layer_push_and_set_active(GDI_LAYER_MAIN_BASE_LAYER_HANDLE);
  1065.         /* gdi_layer_set_source_key(FALSE,GDI_COLOR_TRANSPARENT); */
  1066.         gdi_layer_pop_and_restore_active();
  1067.         if (g_dm_cntx.redraw_screen_main == REDRAW_2_SHOW)
  1068.         {
  1069.             return;
  1070.         }
  1071.         /* Reset all images */
  1072.         for (idx = 0; idx < dm_image_count; idx++)
  1073.         {
  1074.             dm_image_array[idx].back_fill = NULL;
  1075.             dm_image_array[idx].image = NULL;
  1076.             dm_image_array[idx].name = NULL;
  1077.             if (dm_image_array[idx].image_handle != GDI_ERROR_HANDLE)
  1078.             {
  1079.                 gdi_image_stop_animation(dm_image_array[idx].image_handle);
  1080.                 dm_image_array[idx].image_handle = GDI_ERROR_HANDLE;
  1081.             }
  1082.         }
  1083.         for (idx = 0; idx < dm_scroll_text_count; idx++)
  1084.         {
  1085.             gui_scrolling_text_stop(&(dm_scroll_text[idx]));
  1086.         }
  1087.         dm_image_count = 0;
  1088.         dm_string_count = 0;
  1089.         dm_back_fill_count = 0;
  1090.         dm_rectangle_count = 0;
  1091.         dm_line_count = 0;
  1092.         dm_slide_control_count = 0;
  1093.         dm_scroll_text_count = 0;
  1094.         dm_current_scroll_text = NULL;
  1095.         dm_button_count = 0;
  1096.         dm_percentage_bar_count = 0;
  1097.         /* Reset default pen handlers */
  1098.     #ifdef __MMI_TOUCH_SCREEN__
  1099.         wgui_reset_category_screen_control_pen_handler();
  1100.         wgui_reset_image_control_pen_handler();
  1101.     #endif /* __MMI_TOUCH_SCREEN__ */ 
  1102.         dm_reset_category_controlled_callback();
  1103.         dm_reset_button_functions();
  1104.         /* Can be removed -start */
  1105.         dm_reset_title_coordinates();
  1106.         dm_reset_fixed_list_coordinates();
  1107.         dm_reset_inline_fixed_list_coordinates();
  1108.         dm_reset_lsk_coordinates();
  1109.         dm_reset_rsk_coordinates();
  1110.         dm_reset_button_bar_coordinates();
  1111.         /* Can be removed -end */
  1112.         dm_show_vkpad_callback = NULL;
  1113.     #ifdef __MMI_SCREEN_ROTATE__
  1114.         /* Reset the background image set by rotated screen */
  1115.         if (mmi_frm_is_screen_width_height_swapped())
  1116.         {
  1117.             g_dm_scr_bg_cntx.image_id = 0;
  1118.             g_dm_scr_bg_cntx.image_name = NULL;
  1119.             //g_dm_scr_bg_cntx.flags = 0;//082906 scr_bg
  1120.         }
  1121.     #endif /* __MMI_SCREEN_ROTATE__ */ 
  1122.         g_dm_data.s32CatId = 0;
  1123.         g_dm_data.s32flags = 0;
  1124.         g_dm_data.s32ScrId = 0;
  1125.         /* Leo start 20050830 */
  1126.         ExitCategoryFunction = MMI_dummy_function;
  1127.         RedrawCategoryFunction = MMI_dummy_function;
  1128.         GetCategoryHistory = dummy_get_history;
  1129.         GetCategoryHistorySize = dummy_get_history_size;
  1130.         /* Leo end 20050830 */
  1131.         g_dm_cntx.is_context_reset = MMI_TRUE;
  1132.     }
  1133. }
  1134. /*****************************************************************************
  1135.  * FUNCTION
  1136.  *  dm_reset_context_ext
  1137.  * DESCRIPTION
  1138.  *  reset variables used in draw manager.
  1139.  * PARAMETERS
  1140.  *  void
  1141.  * RETURNS
  1142.  *  void
  1143.  *****************************************************************************/
  1144. void dm_reset_context_ext(void)
  1145. {
  1146.     /*----------------------------------------------------------------*/
  1147.     /* Local Variables                                                */
  1148.     /*----------------------------------------------------------------*/
  1149.     /*----------------------------------------------------------------*/
  1150.     /* Code Body                                                      */
  1151.     /*----------------------------------------------------------------*/
  1152. }
  1153. #ifdef __MMI_SUBLCD__
  1154. /*****************************************************************************
  1155.  * FUNCTION
  1156.  *  dm_reset_sublcd_context
  1157.  * DESCRIPTION
  1158.  *  reset variables used in draw manager for sublcd.
  1159.  * PARAMETERS
  1160.  *  void
  1161.  * RETURNS
  1162.  *  void
  1163.  *****************************************************************************/
  1164. void dm_reset_sublcd_context(void)
  1165. {
  1166.     /*----------------------------------------------------------------*/
  1167.     /* Local Variables                                                */
  1168.     /*----------------------------------------------------------------*/
  1169.     U16 idx = 0;
  1170.     /*----------------------------------------------------------------*/
  1171.     /* Code Body                                                      */
  1172.     /*----------------------------------------------------------------*/
  1173.     for (idx = 0; idx < dm_layers_count_sub; idx++)
  1174.     {
  1175.         if (dm_layers_sub[idx] != GDI_LAYER_SUB_BASE_LAYER_HANDLE)
  1176.         {
  1177.             gdi_layer_free(dm_layers_sub[idx]);
  1178.         }
  1179.         dm_layers_sub[idx] = GDI_ERROR_HANDLE;
  1180.     }
  1181.     dm_layers_count_sub = 0;
  1182.     /* Reset all images */
  1183.     for (idx = 0; idx < dm_image_count_sub; idx++)
  1184.     {
  1185.         dm_image_array_sub[idx].back_fill = NULL;
  1186.         dm_image_array_sub[idx].image = NULL;
  1187.         dm_image_array_sub[idx].name = NULL;
  1188.         if (dm_image_array_sub[idx].image_handle != GDI_ERROR_HANDLE)
  1189.         {
  1190.             gdi_image_stop_animation(dm_image_array_sub[idx].image_handle);
  1191.             dm_image_array_sub[idx].image_handle = GDI_ERROR_HANDLE;
  1192.         }
  1193.     }
  1194.     dm_image_count_sub = 0;
  1195.     dm_string_count_sub = 0;
  1196.     dm_reset_sub_category_controlled_callback();
  1197. }
  1198. #endif /* __MMI_SUBLCD__ */ 
  1199. /*****************************************************************************
  1200.  * FUNCTION
  1201.  *  dm_get_image_count
  1202.  * DESCRIPTION
  1203.  *  Used to get currently used image controls
  1204.  * PARAMETERS
  1205.  *  void
  1206.  * RETURNS
  1207.  *  U16      number of image countrol used currently
  1208.  *****************************************************************************/
  1209. U16 dm_get_image_count(void)
  1210. {
  1211.     /*----------------------------------------------------------------*/
  1212.     /* Local Variables                                                */
  1213.     /*----------------------------------------------------------------*/
  1214.     /*----------------------------------------------------------------*/
  1215.     /* Code Body                                                      */
  1216.     /*----------------------------------------------------------------*/
  1217.     return dm_image_count;
  1218. }
  1219. /*****************************************************************************
  1220.  * FUNCTION
  1221.  *  dm_get_button_count
  1222.  * DESCRIPTION
  1223.  *  Used to get currently used button controls
  1224.  * PARAMETERS
  1225.  *  void
  1226.  * RETURNS
  1227.  *  U16      number of button countrol used currently
  1228.  *****************************************************************************/
  1229. U16 dm_get_button_count(void)
  1230. {
  1231.     /*----------------------------------------------------------------*/
  1232.     /* Local Variables                                                */
  1233.     /*----------------------------------------------------------------*/
  1234.     /*----------------------------------------------------------------*/
  1235.     /* Code Body                                                      */
  1236.     /*----------------------------------------------------------------*/
  1237.     return dm_button_count;
  1238. }
  1239. /*****************************************************************************
  1240.  * FUNCTION
  1241.  *  dm_get_button
  1242.  * DESCRIPTION
  1243.  *  
  1244.  * PARAMETERS
  1245.  *  index       [IN]        
  1246.  * RETURNS
  1247.  *  
  1248.  *****************************************************************************/
  1249. icontext_button *dm_get_button(U16 index)
  1250. {
  1251.     /*----------------------------------------------------------------*/
  1252.     /* Local Variables                                                */
  1253.     /*----------------------------------------------------------------*/
  1254.     /*----------------------------------------------------------------*/
  1255.     /* Code Body                                                      */
  1256.     /*----------------------------------------------------------------*/
  1257.     MMI_ASSERT(index < DM_MAX_BUTTONS);
  1258.     return &dm_button_array[index];
  1259. }
  1260. /* Leo end 20050722 */
  1261. /*****************************************************************************
  1262.  * FUNCTION
  1263.  *  dm_get_font
  1264.  * DESCRIPTION
  1265.  *  Used to return the font poointer depending on the font enum value read from
  1266.  *  coordinate set
  1267.  * PARAMETERS
  1268.  *  font        [IN]        Font enum value
  1269.  * RETURNS
  1270.  *  returns font pointer
  1271.  *****************************************************************************/
  1272. UI_font_type dm_get_font(S16 font)
  1273. {
  1274.     /*----------------------------------------------------------------*/
  1275.     /* Local Variables                                                */
  1276.     /*----------------------------------------------------------------*/
  1277.     /*----------------------------------------------------------------*/
  1278.     /* Code Body                                                      */
  1279.     /*----------------------------------------------------------------*/
  1280.     switch (font)
  1281.     {
  1282.         case SMALL_FONT:
  1283.             return (&MMI_small_font);
  1284.             break;
  1285.         case MEDIUM_FONT:
  1286.             return (&MMI_medium_font);
  1287.             break;
  1288.         case LARGE_FONT:
  1289.             return (&MMI_large_font);
  1290.         case SUBLCD_FONT:
  1291.             return (&MMI_sublcd_font);
  1292.         case DIALER_FONT:
  1293.             return (&wgui_dialer_box_f1);
  1294.         default:
  1295.             return (&MMI_default_font);
  1296.             break;
  1297.     }
  1298. }
  1299. /*****************************************************************************
  1300.  * FUNCTION
  1301.  *  setup_previous_control
  1302.  * DESCRIPTION
  1303.  *  Set ups the coordinates for previous control.
  1304.  * PARAMETERS
  1305.  *  dm_coordinate_info      [?]     
  1306.  * RETURNS
  1307.  *  void
  1308.  *****************************************************************************/
  1309. void setup_previous_control(dm_coordinates *dm_coordinate_info)
  1310. {
  1311.     /*----------------------------------------------------------------*/
  1312.     /* Local Variables                                                */
  1313.     /*----------------------------------------------------------------*/
  1314.     /*----------------------------------------------------------------*/
  1315.     /* Code Body                                                      */
  1316.     /*----------------------------------------------------------------*/
  1317.     prev_control_coordinates.coordinate.s16X = dm_coordinate_info->s16X;
  1318.     prev_control_coordinates.coordinate.s16Y = dm_coordinate_info->s16Y;
  1319.     prev_control_coordinates.coordinate.s16Height = dm_coordinate_info->s16Height;
  1320.     prev_control_coordinates.coordinate.s16Width = dm_coordinate_info->s16Width;
  1321.     prev_control_coordinates.s16X2 =
  1322.         prev_control_coordinates.coordinate.s16X + prev_control_coordinates.coordinate.s16Width - 1;
  1323.     prev_control_coordinates.s16Y2 =
  1324.         prev_control_coordinates.coordinate.s16Y + prev_control_coordinates.coordinate.s16Height - 1;
  1325. }
  1326. /*****************************************************************************
  1327.  * FUNCTION
  1328.  *  dm_exit_category_function
  1329.  * DESCRIPTION
  1330.  *  Common exit function for draw manager.
  1331.  * PARAMETERS
  1332.  *  void
  1333.  * RETURNS
  1334.  *  void
  1335.  *****************************************************************************/
  1336. void dm_exit_category_function(void)
  1337. {
  1338.     /*----------------------------------------------------------------*/
  1339.     /* Local Variables                                                */
  1340.     /*----------------------------------------------------------------*/
  1341.     /*----------------------------------------------------------------*/
  1342.     /* Code Body                                                      */
  1343.     /*----------------------------------------------------------------*/
  1344.     switch (g_dm_cntx.redraw_screen_main)
  1345.     {
  1346.             /* normal case */
  1347.         case NORMAL_REDRAW:
  1348.         case REDRAW_2_REDRAW:
  1349.             if (dm_backup_exit_category_function)
  1350.             {
  1351.                 dm_backup_exit_category_function();
  1352.             }
  1353.             g_dm_cntx.redraw_screen_main = NORMAL_EXIT;
  1354.             break;
  1355.         case REDRAW_2_SHOW:
  1356.             break;
  1357.         default:
  1358.             MMI_ASSERT(0);
  1359.     }
  1360. #ifdef GDI_USING_LAYER_ROTATE
  1361.     //W06.04 Replace functions for GDI LCD Rotate
  1362.     //if ( gdi_layer_get_base_layer_rotation() == GDI_LCD_LAYER_ROTATE_0)
  1363.     if (gdi_lcd_get_rotate() == GDI_LCD_LAYER_ROTATE_0)
  1364. #endif /* GDI_USING_LAYER_ROTATE */ 
  1365.     {
  1366.         if (dm_layers[0] != GDI_ERROR_HANDLE || dm_layers[1] != GDI_ERROR_HANDLE || dm_layers[2] != GDI_ERROR_HANDLE ||
  1367.             dm_layers[3] != GDI_ERROR_HANDLE)
  1368.         {
  1369.             gdi_layer_flatten_to_base(dm_layers[0], dm_layers[1], dm_layers[2], dm_layers[3]);
  1370.         }
  1371.     }
  1372.     dm_reset_context();
  1373.     if (g_dm_cntx.exit_full_screen_on_exit)
  1374.     {
  1375.         g_dm_cntx.exit_full_screen_on_exit = MMI_FALSE;
  1376.         leave_full_screen();
  1377.     }
  1378.     /* 092005 redraw status Calvin Start */
  1379.     if (wgui_is_wallpaper_on_bottom())
  1380.     {
  1381.         gOnFullScreen = MMI_LEAVE_BG_ON_BOTTOM_SCREEN;
  1382.         wgui_reset_wallpaper_on_bottom();   /* 041205 Calvin added to support wallpaper on bottom */
  1383.     }
  1384.     /* 092005 redraw status Calvin End */
  1385. }   /* end of dm_exit_category_function */
  1386. #ifdef __MMI_SUBLCD__
  1387. /*****************************************************************************
  1388.  * FUNCTION
  1389.  *  dm_sub_exit_category_function
  1390.  * DESCRIPTION
  1391.  *  Common exit function for draw manager.
  1392.  * PARAMETERS
  1393.  *  void
  1394.  * RETURNS
  1395.  *  void
  1396.  *****************************************************************************/
  1397. void dm_sub_exit_category_function(void)
  1398. {
  1399.     /*----------------------------------------------------------------*/
  1400.     /* Local Variables                                                */
  1401.     /*----------------------------------------------------------------*/
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Code Body                                                      */
  1404.     /*----------------------------------------------------------------*/
  1405.     if (g_dm_sublcd_data.s32flags & DM_SUB_LCD_CONTEXT)
  1406.     {
  1407.         switch (g_dm_cntx.redraw_screen_sub)
  1408.         {
  1409.                 /* normal case */
  1410.             case NORMAL_REDRAW:
  1411.             case REDRAW_2_REDRAW:
  1412.                 if (dm_sub_backup_exit_category_function)
  1413.                 {
  1414.                     dm_sub_backup_exit_category_function();
  1415.                 }
  1416.                 g_dm_cntx.redraw_screen_sub = NORMAL_EXIT;
  1417.                 break;
  1418.             case REDRAW_2_SHOW:
  1419.                 break;
  1420.             default:
  1421.                 MMI_ASSERT(0);
  1422.         }
  1423.     }
  1424.     dm_reset_sublcd_context();
  1425.     SUBLCD_ExitCategoryFunction = MMI_dummy_function;
  1426.     SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
  1427.     SUBLCD_GetCategoryHistory = dummy_get_history;
  1428.     SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
  1429. }
  1430. #endif /* __MMI_SUBLCD__ */ 
  1431. /*****************************************************************************
  1432.  * FUNCTION
  1433.  *  dm_backup_current_category_exit_function
  1434.  * DESCRIPTION
  1435.  *  Save current exit function and set ExitCategoryFunction to dm_exit_category_function
  1436.  * PARAMETERS
  1437.  *  void
  1438.  * RETURNS
  1439.  *  void
  1440.  *****************************************************************************/
  1441. void dm_backup_current_category_exit_function(void)
  1442. {
  1443.     /*----------------------------------------------------------------*/
  1444.     /* Local Variables                                                */
  1445.     /*----------------------------------------------------------------*/
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/
  1449.     dm_backup_exit_category_function = ExitCategoryFunction;
  1450.     ExitCategoryFunction = dm_exit_category_function;
  1451. }   /* end of dm_backup_current_category_exit_function */
  1452. #ifdef __MMI_SUBLCD__
  1453. /*****************************************************************************
  1454.  * FUNCTION
  1455.  *  dm_sub_backup_current_category_exit_function
  1456.  * DESCRIPTION
  1457.  *  Save current exit function and set ExitCategoryFunction to dm_exit_category_function
  1458.  * PARAMETERS
  1459.  *  void
  1460.  * RETURNS
  1461.  *  void
  1462.  *****************************************************************************/
  1463. void dm_sub_backup_current_category_exit_function(void)
  1464. {
  1465.     /*----------------------------------------------------------------*/
  1466.     /* Local Variables                                                */
  1467.     /*----------------------------------------------------------------*/
  1468.     /*----------------------------------------------------------------*/
  1469.     /* Code Body                                                      */
  1470.     /*----------------------------------------------------------------*/
  1471.     dm_sub_backup_exit_category_function = SUBLCD_ExitCategoryFunction;
  1472.     SUBLCD_ExitCategoryFunction = dm_sub_exit_category_function;
  1473. }   /* end of dm_backup_current_category_exit_function */
  1474. #endif /* __MMI_SUBLCD__ */ 
  1475. /*****************************************************************************
  1476.  * FUNCTION
  1477.  *  dm_setup_category_functions
  1478.  * DESCRIPTION
  1479.  *  This function sets up the common-used functions for the Draw Manager
  1480.  * PARAMETERS
  1481.  *  redraw_function                 [IN]        
  1482.  *  get_history_function            [IN]        
  1483.  *  get_history_size_function       [IN]        
  1484.  *  dm_data(?)                      [IN]        Which contains the Draw Manager Information
  1485.  * RETURNS
  1486.  *  void
  1487.  *****************************************************************************/
  1488. void dm_setup_category_functions(
  1489.         FuncPtr redraw_function,
  1490.         U8 *(*get_history_function) (U8 *buffer),
  1491.         S32(*get_history_size_function) (void))
  1492. {
  1493.     /*----------------------------------------------------------------*/
  1494.     /* Local Variables                                                */
  1495.     /*----------------------------------------------------------------*/
  1496.     /*----------------------------------------------------------------*/
  1497.     /* Code Body                                                      */
  1498.     /*----------------------------------------------------------------*/
  1499.     RedrawCategoryFunction = redraw_function;
  1500.     GetCategoryHistory = get_history_function;
  1501.     GetCategoryHistorySize = get_history_size_function;
  1502. }
  1503. #ifdef __MMI_SUBLCD__
  1504. /*****************************************************************************
  1505.  * FUNCTION
  1506.  *  dm_sublcd_setup_data
  1507.  * DESCRIPTION
  1508.  *  This function sets up the information for the Sublcd Draw Manager
  1509.  * PARAMETERS
  1510.  *  dm_data     [IN]        Which contains the Draw Manager Information
  1511.  * RETURNS
  1512.  *  void
  1513.  *****************************************************************************/
  1514. void dm_sublcd_setup_data(dm_data_struct *dm_data)
  1515. {
  1516.     /*----------------------------------------------------------------*/
  1517.     /* Local Variables                                                */
  1518.     /*----------------------------------------------------------------*/
  1519.     /*----------------------------------------------------------------*/
  1520.     /* Code Body                                                      */
  1521.     /*----------------------------------------------------------------*/
  1522.     g_dm_sublcd_data.s32CatId = dm_data->s32CatId;
  1523.     g_dm_sublcd_data.s32ScrId = dm_data->s32ScrId;
  1524.     g_dm_sublcd_data.s32flags = dm_data->s32flags;
  1525.     dm_sub_backup_current_category_exit_function();
  1526.     if (g_dm_sublcd_data.s32CatId == 0 && g_dm_sublcd_data.s32ScrId == 0 && g_dm_sublcd_data.s32flags == 0)
  1527.     {
  1528.         return;
  1529.     }
  1530.     if (g_dm_sublcd_data.s32flags & DM_SUB_LCD_CONTEXT)
  1531.     {
  1532.         /* Normal procedure */
  1533.         if (g_dm_cntx.redraw_screen_sub == NORMAL_EXIT)
  1534.         {
  1535.             g_dm_cntx.redraw_screen_sub = NORMAL_SHOW;
  1536.         }
  1537.         /* from redraw screen */
  1538.         else if (g_dm_cntx.redraw_screen_sub == NORMAL_REDRAW)
  1539.         {
  1540.             g_dm_cntx.redraw_screen_sub = NORMAL_REDRAW;
  1541.             /* MMI_ASSERT (0); */
  1542.         }
  1543.         /* from show screen */
  1544.         //              else if ( g_dm_cntx.redraw_screen_sub == NORMAL_SHOW )
  1545.         //                      MMI_ASSERT (0);
  1546.     }
  1547. }   /* end of dm_setup_data */
  1548. /*****************************************************************************
  1549.  * FUNCTION
  1550.  *  dm_sublcd_redraw_category_screen
  1551.  * DESCRIPTION
  1552.  *  This function redraws the Sublcd.
  1553.  * PARAMETERS
  1554.  *  void
  1555.  * RETURNS
  1556.  *  void
  1557.  *****************************************************************************/
  1558. void dm_sublcd_redraw_category_screen(void)
  1559. {
  1560.     /*----------------------------------------------------------------*/
  1561.     /* Local Variables                                                */
  1562.     /*----------------------------------------------------------------*/
  1563.     dm_data_struct g_dm_data_temp_struct;
  1564.     /*----------------------------------------------------------------*/
  1565.     /* Code Body                                                      */
  1566.     /*----------------------------------------------------------------*/
  1567.     UI_set_sub_LCD_graphics_context();
  1568.     g_dm_data_temp_struct = g_dm_data;
  1569.     g_dm_data = g_dm_sublcd_data;
  1570.     g_dm_data.s32flags |= DM_SUB_LCD_CONTEXT;
  1571.     dm_redraw_category_screen();
  1572.     g_dm_data = g_dm_data_temp_struct;
  1573.     UI_set_main_LCD_graphics_context();
  1574. }   /* end of dm_setup_data */
  1575. #endif /* __MMI_SUBLCD__ */ 
  1576. /*****************************************************************************
  1577.  * FUNCTION
  1578.  *  dm_is_activated
  1579.  * DESCRIPTION
  1580.  *  Check whether the current
  1581.  * PARAMETERS
  1582.  *  void
  1583.  * RETURNS
  1584.  *  void
  1585.  *****************************************************************************/
  1586. MMI_BOOL dm_is_activated(void)
  1587. {
  1588.     /*----------------------------------------------------------------*/
  1589.     /* Local Variables                                                */
  1590.     /*----------------------------------------------------------------*/
  1591.     /*----------------------------------------------------------------*/
  1592.     /* Code Body                                                      */
  1593.     /*----------------------------------------------------------------*/
  1594.     if (g_dm_data.s32CatId == 0)
  1595.     {
  1596.         return MMI_FALSE;
  1597.     }
  1598.     else
  1599.     {
  1600.         return MMI_TRUE;
  1601.     }
  1602. }
  1603. /*****************************************************************************
  1604.  * FUNCTION
  1605.  *  dm_setup_data
  1606.  * DESCRIPTION
  1607.  *  This function sets up the information for the Draw Manager
  1608.  * PARAMETERS
  1609.  *  dm_data     [IN]        Which contains the Draw Manager Information
  1610.  * RETURNS
  1611.  *  void
  1612.  *****************************************************************************/
  1613. void dm_setup_data(dm_data_struct *dm_data)
  1614. {
  1615.     /*----------------------------------------------------------------*/
  1616.     /* Local Variables                                                */
  1617.     /*----------------------------------------------------------------*/
  1618.     /*----------------------------------------------------------------*/
  1619.     /* Code Body                                                      */
  1620.     /*----------------------------------------------------------------*/
  1621.     g_dm_data.s32CatId = dm_data->s32CatId;
  1622.     g_dm_data.s32ScrId = dm_data->s32ScrId;
  1623.     g_dm_data.s32flags = dm_data->s32flags;
  1624.     dm_backup_current_category_exit_function();
  1625.     if (g_dm_data.s32CatId == 0 && g_dm_data.s32ScrId == 0 && g_dm_data.s32flags == 0)
  1626.     {
  1627.         return;
  1628.     }
  1629.     /* Normal procedure */
  1630.     if (g_dm_cntx.redraw_screen_main == NORMAL_EXIT)
  1631.     {
  1632.         g_dm_cntx.redraw_screen_main = NORMAL_SHOW;
  1633.     }
  1634.     /* from redraw screen */
  1635.     else if (g_dm_cntx.redraw_screen_main == NORMAL_REDRAW)
  1636.     {
  1637.         g_dm_cntx.redraw_screen_main = REDRAW_2_SHOW;
  1638.         dm_reset_context();
  1639.         g_dm_cntx.redraw_screen_main = NORMAL_SHOW;
  1640.         /* MMI_ASSERT (0); */
  1641.     }
  1642.     /* from show screen */
  1643.     else if (g_dm_cntx.redraw_screen_main == NORMAL_SHOW)
  1644.     {
  1645.         ;
  1646.     }
  1647.     /* MMI_ASSERT (0); */
  1648. #ifdef __MMI_SCREEN_ROTATE__
  1649.     if (mmi_frm_is_screen_width_height_swapped())
  1650.     {
  1651.         /* Close status icon (but not entry_full_screen()) */
  1652.         close_title_status_icon();
  1653.         g_dm_cntx.exit_full_screen_on_exit = MMI_TRUE;
  1654.         /* Set screen background */
  1655.         g_dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  1656.     #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1657.         /* Keep opacity unchanged */
  1658.         dm_set_scr_bg_image(IMG_SCREEN_ROTATE_BACKGROUND, NULL, -1, -1, g_dm_scr_bg_cntx.layer_opacity);
  1659.     #else /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1660.         dm_set_scr_bg_image(IMG_SCREEN_ROTATE_BACKGROUND, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  1661.     #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1662.     }
  1663. #endif /* __MMI_SCREEN_ROTATE__ */ 
  1664. }   /* end of dm_setup_data */
  1665. /*****************************************************************************
  1666.  * FUNCTION
  1667.  *  dm_search_coordinate_set
  1668.  * DESCRIPTION
  1669.  *  This function is used to search (binary search) the coordinate set corresponding to the passed Screen Id.
  1670.  * PARAMETERS
  1671.  *  ScrId           [IN]        
  1672.  *  s32ScrId(?)     [IN]        Screen Id corresponding to which coordinate set is to be obtained.
  1673.  * RETURNS
  1674.  *  void
  1675.  *****************************************************************************/
  1676. S16 *dm_search_coordinate_set(S32 ScrId)
  1677. {
  1678.     /*----------------------------------------------------------------*/
  1679.     /* Local Variables                                                */
  1680.     /*----------------------------------------------------------------*/
  1681.     S32 StartIndex = 0;
  1682.     S32 EndIndex = dm_get_coordinate_sets_count();
  1683.     /*----------------------------------------------------------------*/
  1684.     /* Code Body                                                      */
  1685.     /*----------------------------------------------------------------*/
  1686.     while (EndIndex >= StartIndex)
  1687.     {
  1688.         S32 MiddleIndex = (EndIndex + StartIndex) >> 1;
  1689.         if (g_screenid_coordinate_sets_map[MiddleIndex].screen_id == ScrId)
  1690.         {
  1691.             return g_screenid_coordinate_sets_map[MiddleIndex].coordinate_set_p;
  1692.         }
  1693.         else if (g_screenid_coordinate_sets_map[MiddleIndex].screen_id > ScrId)
  1694.         {
  1695.             EndIndex = MiddleIndex - 1;
  1696.         }
  1697.         else
  1698.         {
  1699.             StartIndex = MiddleIndex + 1;
  1700.         }
  1701.     }
  1702.     return NULL;
  1703. }   /* end of dm_search_coordinate_set */
  1704. /*****************************************************************************
  1705.  * FUNCTION
  1706.  *  dm_search_control_set
  1707.  * DESCRIPTION
  1708.  *  get control set address by category id
  1709.  * PARAMETERS
  1710.  *  category_id                     [IN]        Id of category screen
  1711.  *  default_coordinate_set_p        [IN]        
  1712.  * RETURNS
  1713.  *  U8 address of corresponding control set
  1714.  *****************************************************************************/
  1715. U8 *dm_search_control_set(S32 category_id, S16 **default_coordinate_set_p)
  1716. {
  1717.     /*----------------------------------------------------------------*/
  1718.     /* Local Variables                                                */
  1719.     /*----------------------------------------------------------------*/
  1720.     U8 min = 0, max = 0, mid = 0;
  1721.     /*----------------------------------------------------------------*/
  1722.     /* Code Body                                                      */
  1723.     /*----------------------------------------------------------------*/
  1724.     /* MMI_ASSERT(category_id); */
  1725.     if (category_id == 0)
  1726.     {
  1727.         return NULL;
  1728.     }
  1729.     max = dm_get_control_sets_count();
  1730.     /* set max as max number of records */
  1731.     min = 0;
  1732.     *default_coordinate_set_p = NULL;
  1733.     while (min <= max)
  1734.     {
  1735.         mid = (max + min) >> 1;
  1736.         if (g_categories_controls_map[mid].category_id == (U16) category_id)
  1737.         {
  1738.         #ifdef __MMI_SCREEN_ROTATE__
  1739.             MMI_DBG_ASSERT(!mmi_frm_is_screen_width_height_swapped() ||
  1740.                            g_categories_controls_map[mid].rotated_coordinate_set_p);
  1741.             if (mmi_frm_is_screen_width_height_swapped() && g_categories_controls_map[mid].rotated_coordinate_set_p)
  1742.             {
  1743.                 *default_coordinate_set_p = g_categories_controls_map[mid].rotated_coordinate_set_p;
  1744.             }
  1745.             else
  1746.             {
  1747.                 *default_coordinate_set_p = g_categories_controls_map[mid].default_coordinate_set_p;
  1748.             }
  1749.         #else /* __MMI_SCREEN_ROTATE__ */ 
  1750.             *default_coordinate_set_p = g_categories_controls_map[mid].default_coordinate_set_p;
  1751.         #endif /* __MMI_SCREEN_ROTATE__ */ 
  1752.             return g_categories_controls_map[mid].control_set_p;
  1753.         }
  1754.         else if (g_categories_controls_map[mid].category_id > (U16) category_id)
  1755.         {
  1756.             max = mid - 1;
  1757.         }
  1758.         else
  1759.         {
  1760.             min = mid + 1;
  1761.         }
  1762.     }
  1763.     MMI_ASSERT(0);
  1764.     return NULL;
  1765. }   /* end of dm_search_control_set */
  1766. /*****************************************************************************
  1767.  * FUNCTION
  1768.  *  dm_setup_base_layer
  1769.  * DESCRIPTION
  1770.  *  This function is used setup the base layer
  1771.  * PARAMETERS
  1772.  *  void
  1773.  *  *(?)
  1774.  * RETURNS
  1775.  *  void
  1776.  *****************************************************************************/
  1777. S32 dm_setup_base_layer(void)
  1778. {
  1779.     /*----------------------------------------------------------------*/
  1780.     /* Local Variables                                                */
  1781.     /*----------------------------------------------------------------*/
  1782.     GDI_HANDLE act_lcd_handle;
  1783.     /*----------------------------------------------------------------*/
  1784.     /* Code Body                                                      */
  1785.     /*----------------------------------------------------------------*/
  1786.     gdi_lcd_get_active(&act_lcd_handle);
  1787.     if (act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE && !(g_dm_data.s32flags & DM_SUB_LCD_CONTEXT))
  1788.     {
  1789.         MMI_ASSERT(0);
  1790.     }
  1791. #ifdef __MMI_SUBLCD__
  1792.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  1793.     {
  1794.         gdi_layer_get_base_handle(&dm_layers_sub[dm_layers_count_sub++]);
  1795.     }
  1796.     else
  1797. #endif /* __MMI_SUBLCD__ */ 
  1798.     
  1799. gdi_layer_get_base_handle(&dm_layers[dm_layers_count++]);
  1800.     gdi_layer_restore_base_active();
  1801.     /* not to set source key when sublcd is b/w */
  1802. #if (defined __MMI_SUBLCD__) && (!defined __MMI_SUBLCD_COLOR__)
  1803.     if ( act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE )
  1804.     {
  1805.         gdi_layer_set_source_key(FALSE,0);
  1806.     }
  1807.     else
  1808.     {
  1809.         gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  1810.     }
  1811. #else
  1812.     gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  1813. #endif
  1814. #ifndef __GDI_MEMORY_PROFILE_2__
  1815.     new_layer_x = 0;
  1816.     new_layer_y = 0;
  1817. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1818.     return 1;
  1819. }
  1820. /*****************************************************************************
  1821.  * FUNCTION
  1822.  *  dm_setup_new_layer
  1823.  * DESCRIPTION
  1824.  *  This function is used setup a new layer
  1825.  * PARAMETERS
  1826.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1827.  *  *(?)
  1828.  * RETURNS
  1829.  *  void
  1830.  *****************************************************************************/
  1831. S32 dm_setup_new_layer(S16 **UICtrlAccessPtr_p)
  1832. {
  1833.     /*----------------------------------------------------------------*/
  1834.     /* Local Variables                                                */
  1835.     /*----------------------------------------------------------------*/
  1836.     dm_coordinates dm_layer_info;
  1837.     gdi_result ret;
  1838.     /*----------------------------------------------------------------*/
  1839.     /* Code Body                                                      */
  1840.     /*----------------------------------------------------------------*/
  1841. #ifdef __GDI_MEMORY_PROFILE_2__
  1842.     gdi_layer_multi_layer_enable();
  1843. #endif 
  1844.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_layer_info);
  1845.     /* need to take care in REDRAW_2_REDRAW */
  1846.     if (g_dm_cntx.redraw_screen_main == REDRAW_2_REDRAW)
  1847.     {
  1848.         return 1;
  1849.     }
  1850.     if (dm_layer_info.s16X == -1 && dm_layer_info.s16Y == -1 && dm_layer_info.s16Width == -1 &&
  1851.         dm_layer_info.s16Height == -1)
  1852.     {
  1853.         return 1;
  1854.     }
  1855. #ifdef __GDI_MEMORY_PROFILE_2__ /* Multi-layer enable */
  1856. #ifdef __MMI_SUBLCD__
  1857.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  1858.     {
  1859.         ret = gdi_layer_create(
  1860.                 dm_layer_info.s16X,
  1861.                 dm_layer_info.s16Y,
  1862.                 dm_layer_info.s16Width,
  1863.                 dm_layer_info.s16Height,
  1864.                 &dm_layers_sub[dm_layers_count_sub]);
  1865.         MMI_ASSERT(ret >= 0);
  1866.         gdi_layer_set_active(dm_layers_sub[dm_layers_count_sub]);
  1867.         dm_layers_count_sub++;
  1868.     }
  1869.     else
  1870. #endif /* __MMI_SUBLCD__ */ 
  1871.     {
  1872.         ret = gdi_layer_create(
  1873.                 dm_layer_info.s16X,
  1874.                 dm_layer_info.s16Y,
  1875.                 dm_layer_info.s16Width,
  1876.                 dm_layer_info.s16Height,
  1877.                 &dm_layers[dm_layers_count]);
  1878.         MMI_ASSERT(ret >= 0);
  1879.         gdi_layer_set_active(dm_layers[dm_layers_count]);
  1880.         dm_layers_count++;
  1881.     }
  1882.     /* 072706 source key Start */
  1883.     gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT); /* source key color could be customized later */
  1884.     gdi_layer_clear(GDI_COLOR_TRANSPARENT);
  1885.     /* 072706 source key End */
  1886. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1887.     new_layer_x = (U16) dm_layer_info.s16X;
  1888.     new_layer_y = (U16) dm_layer_info.s16Y;
  1889. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1890.     return 1;
  1891. }
  1892. /*****************************************************************************
  1893.  * FUNCTION
  1894.  *  dm_setup_and_draw_circular_menu
  1895.  * DESCRIPTION
  1896.  *  This function is used setup the circular menu based on the coordinate set and
  1897.  *  then draw it
  1898.  * PARAMETERS
  1899.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1900.  *  *(?)
  1901.  * RETURNS
  1902.  *  void
  1903.  *****************************************************************************/
  1904. S32 dm_setup_and_draw_circular_menu(S16 **UICtrlAccessPtr_p)
  1905. {
  1906.     /*----------------------------------------------------------------*/
  1907.     /* Local Variables                                                */
  1908.     /*----------------------------------------------------------------*/
  1909.     dm_coordinates dm_3D_circular_menu_info;
  1910.     /*----------------------------------------------------------------*/
  1911.     /* Code Body                                                      */
  1912.     /*----------------------------------------------------------------*/
  1913.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_3D_circular_menu_info);
  1914.     if (dm_3D_circular_menu_info.s16X == -1 || dm_3D_circular_menu_info.s16Y == -1 ||
  1915.         dm_3D_circular_menu_info.s16Width == -1 || dm_3D_circular_menu_info.s16Height == -1)
  1916.     {
  1917.         return 0;
  1918.     }
  1919.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  1920.     {
  1921.         move_circular_3d_menu(dm_3D_circular_menu_info.s16X, dm_3D_circular_menu_info.s16Y);
  1922.         resize_circular_3d_menu(dm_3D_circular_menu_info.s16Width, dm_3D_circular_menu_info.s16Height);
  1923.     }
  1924.     show_circular_3d_menu();
  1925.     return 1;
  1926. }
  1927. /*****************************************************************************
  1928.  * FUNCTION
  1929.  *  dm_setup_and_draw_fixed_list
  1930.  * DESCRIPTION
  1931.  *  This function is used setup the fixed list based on the coordinate set and
  1932.  *  then draw it
  1933.  * PARAMETERS
  1934.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1935.  *  *(?)
  1936.  * RETURNS
  1937.  *  void
  1938.  *****************************************************************************/
  1939. S32 dm_setup_and_draw_fixed_list(S16 **UICtrlAccessPtr_p)
  1940. {
  1941.     /*----------------------------------------------------------------*/
  1942.     /* Local Variables                                                */
  1943.     /*----------------------------------------------------------------*/
  1944.     dm_coordinates dm_fixed_list_info;
  1945.     MMI_BOOL resized = MMI_FALSE;
  1946.     /*----------------------------------------------------------------*/
  1947.     /* Code Body                                                      */
  1948.     /*----------------------------------------------------------------*/
  1949.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_fixed_list_info);
  1950.     if (dm_fixed_list_info.s16X == -1 || dm_fixed_list_info.s16Y == -1 ||
  1951.         dm_fixed_list_info.s16Width == -1 || dm_fixed_list_info.s16Height == -1)
  1952.     {
  1953.         return 0;
  1954.     }
  1955.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  1956.     {
  1957.         if (dm_fixed_list_info.Flags & DM_CATEGORY_CONTROL_COORDINATES)
  1958.         {
  1959.             show_fixed_list();
  1960.         }
  1961.         else
  1962.         {
  1963.             move_fixed_list(dm_fixed_list_info.s16X, dm_fixed_list_info.s16Y);
  1964.             if (dm_fixed_list_info.s16Width != MMI_fixed_list_menu.width ||
  1965.                 dm_fixed_list_info.s16Height != MMI_fixed_list_menu.height)
  1966.             {
  1967.                 resized = MMI_TRUE;
  1968.             }
  1969.             resize_fixed_list(dm_fixed_list_info.s16Width, dm_fixed_list_info.s16Height);
  1970.             if (resized == MMI_TRUE)
  1971.             {
  1972.                 fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1973.             }
  1974.             show_fixed_list();
  1975.         }
  1976.     }
  1977.     else
  1978.     {
  1979.         show_fixed_list();
  1980.     }
  1981.     return 1;
  1982. }
  1983. /*****************************************************************************
  1984. * FUNCTION
  1985. *  dm_setup_and_draw_circular_menu
  1986. *
  1987. * DESCRIPTION
  1988. *   This function is used setup the dynamic list based on the coordinate set and
  1989. *  then draw it
  1990. *
  1991. * PARAMETERS
  1992. *  UICtrlAccessPtr_p IN/OUT   It specifies the start position to take out the coordinates.
  1993. *  *
  1994. * RETURNS                 
  1995. *  void
  1996. *
  1997. * GLOBALS AFFECTED        
  1998. *   
  1999. *****************************************************************************/
  2000. /*****************************************************************************
  2001.  * FUNCTION
  2002.  *  dm_setup_and_draw_dynamic_list
  2003.  * DESCRIPTION
  2004.  *  This function is used setup the dynamic list based on the coordinate set and
  2005.  *  then draw it
  2006.  * PARAMETERS
  2007.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2008.  *  *(?)
  2009.  * RETURNS
  2010.  *  void
  2011.  *****************************************************************************/
  2012. S32 dm_setup_and_draw_dynamic_list(S16 **UICtrlAccessPtr_p)
  2013. {
  2014.     /*----------------------------------------------------------------*/
  2015.     /* Local Variables                                                */
  2016.     /*----------------------------------------------------------------*/
  2017.     dm_coordinates dm_dynamic_list_info;
  2018.     fixed_icontext_menuitem *menuitem_p;
  2019.     /* Leo change 0705 start */
  2020.     MMI_BOOL resized = MMI_FALSE;
  2021.     /*----------------------------------------------------------------*/
  2022.     /* Code Body                                                      */
  2023.     /*----------------------------------------------------------------*/
  2024.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dynamic_list_info);
  2025.     if (dm_dynamic_list_info.s16X == -1 || dm_dynamic_list_info.s16Y == -1 ||
  2026.         dm_dynamic_list_info.s16Width == -1 || dm_dynamic_list_info.s16Height == -1)
  2027.     {
  2028.         return 0;
  2029.     }
  2030.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2031.     {
  2032.         move_fixed_list(dm_dynamic_list_info.s16X, dm_dynamic_list_info.s16Y);
  2033.         if (dm_dynamic_list_info.s16Width != MMI_fixed_list_menu.width ||
  2034.             dm_dynamic_list_info.s16Height != MMI_fixed_list_menu.height)
  2035.         {
  2036.             resized = MMI_TRUE;
  2037.         }
  2038.         resize_fixed_list(dm_dynamic_list_info.s16Width, dm_dynamic_list_info.s16Height);
  2039.         menuitem_p = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
  2040.         gui_set_fixed_list_menu_common_item_data(&MMI_fixed_list_menu, menuitem_p);
  2041.         if (resized == MMI_TRUE)
  2042.         {
  2043.             dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2044.         }
  2045.         /* Leo change 0705 end */
  2046.     }
  2047.     show_dynamic_list();
  2048.     return 1;
  2049. }
  2050. /*****************************************************************************
  2051.  * FUNCTION
  2052.  *  dm_setup_and_draw_asyncdynamic_list
  2053.  * DESCRIPTION
  2054.  *  This function is used setup the asyncdynamic list based on the coordinate set and
  2055.  *  then draw it
  2056.  * PARAMETERS
  2057.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2058.  *  *(?)
  2059.  * RETURNS
  2060.  *  void
  2061.  *****************************************************************************/
  2062. S32 dm_setup_and_draw_asyncdynamic_list(S16 **UICtrlAccessPtr_p)
  2063. {
  2064.     /*----------------------------------------------------------------*/
  2065.     /* Local Variables                                                */
  2066.     /*----------------------------------------------------------------*/
  2067.     dm_coordinates dm_dynamic_list_info;
  2068.     fixed_icontext_menuitem *menuitem_p;
  2069.     /* Leo change 0705 start */
  2070.     MMI_BOOL resized = MMI_FALSE;
  2071.     /*----------------------------------------------------------------*/
  2072.     /* Code Body                                                      */
  2073.     /*----------------------------------------------------------------*/
  2074.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dynamic_list_info);
  2075.     if (dm_dynamic_list_info.s16X == -1 || dm_dynamic_list_info.s16Y == -1 ||
  2076.         dm_dynamic_list_info.s16Width == -1 || dm_dynamic_list_info.s16Height == -1)
  2077.     {
  2078.         return 0;
  2079.     }
  2080.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2081.     {
  2082.         move_fixed_list(dm_dynamic_list_info.s16X, dm_dynamic_list_info.s16Y);
  2083.         if (dm_dynamic_list_info.s16Width != MMI_fixed_list_menu.width ||
  2084.             dm_dynamic_list_info.s16Height != MMI_fixed_list_menu.height)
  2085.         {
  2086.             resized = MMI_TRUE;
  2087.         }
  2088.         resize_fixed_list(dm_dynamic_list_info.s16Width, dm_dynamic_list_info.s16Height);
  2089.         menuitem_p = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
  2090.         gui_set_fixed_list_menu_common_item_data(&MMI_fixed_list_menu, menuitem_p);
  2091.         if (resized == MMI_TRUE)
  2092.         {
  2093.             asyncdynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2094.         }
  2095.         /* Leo change 0705 end */
  2096.     }
  2097.     show_asyncdynamic_list();
  2098.     return 1;
  2099. }
  2100. /*****************************************************************************
  2101.  * FUNCTION
  2102.  *  dm_setup_and_draw_matrix_menu
  2103.  * DESCRIPTION
  2104.  *  This function is used setup the matrix menu based on the coordinate set and
  2105.  *  then draw it
  2106.  * PARAMETERS
  2107.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2108.  *  *(?)
  2109.  * RETURNS
  2110.  *  void
  2111.  *****************************************************************************/
  2112. S32 dm_setup_and_draw_matrix_menu(S16 **UICtrlAccessPtr_p)
  2113. {
  2114.     /*----------------------------------------------------------------*/
  2115.     /* Local Variables                                                */
  2116.     /*----------------------------------------------------------------*/
  2117.     dm_coordinates dm_matrix_menu_info;
  2118.     /*----------------------------------------------------------------*/
  2119.     /* Code Body                                                      */
  2120.     /*----------------------------------------------------------------*/
  2121.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_matrix_menu_info);
  2122.     if (dm_matrix_menu_info.s16X == -1 || dm_matrix_menu_info.s16Y == -1 ||
  2123.         dm_matrix_menu_info.s16Width == -1 || dm_matrix_menu_info.s16Height == -1)
  2124.     {
  2125.         return 0;
  2126.     }
  2127.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2128.     {
  2129.         move_fixed_matrix(dm_matrix_menu_info.s16X, dm_matrix_menu_info.s16Y);
  2130.         if (fixed_matrix_auto_disable_scrollbar())
  2131.         {
  2132.             reset_fixed_matrix_col_rows();
  2133.         }
  2134.         resize_fixed_matrix(dm_matrix_menu_info.s16Width, dm_matrix_menu_info.s16Height);
  2135.     }
  2136.     show_fixed_matrix();
  2137.     return 1;
  2138. }
  2139. /*****************************************************************************
  2140.  * FUNCTION
  2141.  *  dm_setup_and_draw_multiline_inputbox
  2142.  * DESCRIPTION
  2143.  *  This function is used setup the multiline inputbox based on the coordinate set and
  2144.  *  then draw it
  2145.  * PARAMETERS
  2146.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2147.  *  dm_cat_scr_info         [?]             
  2148.  *  *(?)
  2149.  * RETURNS
  2150.  *  void
  2151.  *****************************************************************************/
  2152. S32 dm_setup_and_draw_multiline_inputbox(S16 **UICtrlAccessPtr_p, dm_cat_scr_info_struct *dm_cat_scr_info)
  2153. {
  2154.     /*----------------------------------------------------------------*/
  2155.     /* Local Variables                                                */
  2156.     /*----------------------------------------------------------------*/
  2157.     dm_coordinates dm_multiline_inputbox_info;
  2158.     /*----------------------------------------------------------------*/
  2159.     /* Code Body                                                      */
  2160.     /*----------------------------------------------------------------*/
  2161.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_multiline_inputbox_info);
  2162.     if (!get_multiline_inputbox_display_status())
  2163.     {
  2164.         return 0;
  2165.     }
  2166.     if (dm_multiline_inputbox_info.s16X == -1 || dm_multiline_inputbox_info.s16Y == -1 ||
  2167.         dm_multiline_inputbox_info.s16Width == -1 || dm_multiline_inputbox_info.s16Height == -1)
  2168.     {
  2169.         return 0;
  2170.     }
  2171.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2172.     {
  2173.         if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2174.         {
  2175.             S32 w = 0, h = 0;
  2176.             resize_multiline_inputbox_fit(
  2177.                 dm_multiline_inputbox_info.s16Width,
  2178.                 dm_multiline_inputbox_info.s16Height,
  2179.                 &w,
  2180.                 &h);
  2181.         }
  2182.         if (!dm_aligned_area_data.is_in_aligned_area)
  2183.         {
  2184.             if (wgui_inputbox_information_flag)
  2185.             {
  2186.             #ifdef UI_SMALL_CATEGORY_EDITOR
  2187.                 /* START VIJAY PMT 20051202 */
  2188.                 if (whether_no_small_screen())
  2189.                 {
  2190.                     wgui_setup_input_information(
  2191.                         dm_multiline_inputbox_info.s16X + 1,
  2192.                         dm_multiline_inputbox_info.s16Y,
  2193.                         dm_multiline_inputbox_info.s16Width - 2,
  2194.                         wgui_inputbox_information_bar_height);
  2195.                 }
  2196.                 else
  2197.             #endif /* UI_SMALL_CATEGORY_EDITOR */ 
  2198.                     /* END VIJAY PMT 20051202 */
  2199.                     wgui_setup_input_information(
  2200.                         dm_multiline_inputbox_info.s16X,
  2201.                         dm_multiline_inputbox_info.s16Y,
  2202.                         dm_multiline_inputbox_info.s16Width,
  2203.                         wgui_inputbox_information_bar_height);
  2204.                 move_multiline_inputbox(
  2205.                     dm_multiline_inputbox_info.s16X,
  2206.                     dm_multiline_inputbox_info.s16Y + wgui_inputbox_information_bar_height);
  2207.                 //Currently this is assuming that Multitap is always being shown whenever multiline
  2208.                 //inputbox is shown, so this needs to be FIXED and appropriates condition needs to be checked here.
  2209.                 if (!is_multiline_inputbox_in_view_mode())
  2210.                 {
  2211.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2212.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2213.                     {
  2214.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2215.                     }
  2216.                     resize_multiline_inputbox(
  2217.                         dm_multiline_inputbox_info.s16Width,
  2218.                         dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2219.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2220.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2221.                     {
  2222.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2223.                     }
  2224.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT_NO_MULTITAP)
  2225.                     {
  2226.                         resize_multiline_inputbox(
  2227.                             dm_multiline_inputbox_info.s16Width,
  2228.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2229.                     }
  2230.                     else
  2231.                     {
  2232.                         resize_multiline_inputbox(
  2233.                             dm_multiline_inputbox_info.s16Width,
  2234.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2235.                     }
  2236.                     if (hide_multitap)
  2237.                     {
  2238.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2239.                     }
  2240.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2241.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2242.                 }
  2243.                 else
  2244.                 {
  2245.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2246.                     {
  2247.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2248.                     }
  2249.                     resize_multiline_inputbox(
  2250.                         dm_multiline_inputbox_info.s16Width,
  2251.                         dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2252.                 }
  2253.             }
  2254.             else
  2255.             {
  2256.                 move_multiline_inputbox(dm_multiline_inputbox_info.s16X, dm_multiline_inputbox_info.s16Y);
  2257.                 if (!is_multiline_inputbox_in_view_mode())
  2258.                 {
  2259.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2260.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2261.                     {
  2262.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2263.                     }
  2264.                     resize_multiline_inputbox(
  2265.                         dm_multiline_inputbox_info.s16Width,
  2266.                         dm_multiline_inputbox_info.s16Height);
  2267.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2268.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2269.                     {
  2270.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2271.                     }
  2272.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT_NO_MULTITAP)
  2273.                     {
  2274.                         resize_multiline_inputbox(
  2275.                             dm_multiline_inputbox_info.s16Width,
  2276.                             dm_multiline_inputbox_info.s16Height);
  2277.                     }
  2278.                     else
  2279.                     {
  2280.                         resize_multiline_inputbox(
  2281.                             dm_multiline_inputbox_info.s16Width,
  2282.                             dm_multiline_inputbox_info.s16Height - MMI_multitap_height);
  2283.                     }
  2284.                     if (hide_multitap)
  2285.                     {
  2286.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2287.                     }
  2288.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2289.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2290.                 }
  2291.                 else
  2292.                 {
  2293.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2294.                     {
  2295.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2296.                     }
  2297.                     resize_multiline_inputbox(
  2298.                         dm_multiline_inputbox_info.s16Width,
  2299.                         dm_multiline_inputbox_info.s16Height);
  2300.                 }
  2301.             }
  2302.             setup_previous_control(&dm_multiline_inputbox_info);
  2303.         }       /* ( ! dm_aligned_area_data.is_in_aligned_area ) */
  2304.         else    /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2305.         {
  2306.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2307.             move_multiline_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2308.             dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2309.         }   /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2310.     }
  2311.     else if (dm_aligned_area_data.is_in_aligned_area)
  2312.     {
  2313.         dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2314.         dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2315.     }
  2316.     wgui_show_inputbox();
  2317.     return 1;
  2318. }
  2319. /*****************************************************************************
  2320.  * FUNCTION
  2321.  *  dm_setup_and_draw_ems_inputbox
  2322.  * DESCRIPTION
  2323.  *  This function is used setup the EMS inputbox based on the coordinate set and
  2324.  *  then draw it
  2325.  * PARAMETERS
  2326.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2327.  *  dm_cat_scr_info         [?]             
  2328.  *  *(?)
  2329.  * RETURNS
  2330.  *  void
  2331.  *****************************************************************************/
  2332. S32 dm_setup_and_draw_ems_inputbox(S16 **UICtrlAccessPtr_p, dm_cat_scr_info_struct *dm_cat_scr_info)
  2333. {
  2334.     /*----------------------------------------------------------------*/
  2335.     /* Local Variables                                                */
  2336.     /*----------------------------------------------------------------*/
  2337.     dm_coordinates dm_multiline_inputbox_info;
  2338.     /*----------------------------------------------------------------*/
  2339.     /* Code Body                                                      */
  2340.     /*----------------------------------------------------------------*/
  2341.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_multiline_inputbox_info);
  2342.     if (!get_multiline_inputbox_display_status())
  2343.     {
  2344.         return 0;
  2345.     }
  2346.     if (dm_multiline_inputbox_info.s16X == -1 || dm_multiline_inputbox_info.s16Y == -1 ||
  2347.         dm_multiline_inputbox_info.s16Width == -1 || dm_multiline_inputbox_info.s16Height == -1)
  2348.     {
  2349.         return 0;
  2350.     }
  2351.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2352.     {
  2353.         if (!dm_aligned_area_data.is_in_aligned_area)
  2354.         {
  2355.             if (wgui_inputbox_information_flag)
  2356.             {
  2357.                 wgui_EMS_setup_input_information(
  2358.                     dm_multiline_inputbox_info.s16X,
  2359.                     dm_multiline_inputbox_info.s16Y,
  2360.                     dm_multiline_inputbox_info.s16Width,
  2361.                     wgui_EMS_inputbox_information_bar_height);
  2362.                 move_EMS_inputbox(
  2363.                     dm_multiline_inputbox_info.s16X,
  2364.                     dm_multiline_inputbox_info.s16Y + wgui_EMS_inputbox_information_bar_height);
  2365.                 //Currently this is assuming that Multitap is always being shown whenever multiline
  2366.                 //inputbox is shown, so this needs to be FIXED and appropriates condition needs to be checked here.
  2367.                 if (!is_EMS_inputbox_in_view_mode())
  2368.                 {
  2369.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2370.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2371.                     {
  2372.                         resize_EMS_inputbox(
  2373.                             dm_multiline_inputbox_info.s16Width,
  2374.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height);
  2375.                     }
  2376.                     else
  2377.                     {
  2378.                         resize_EMS_inputbox(
  2379.                             dm_multiline_inputbox_info.s16Width,
  2380.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2381.                     }
  2382.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2383.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2384.                     {
  2385.                         resize_EMS_inputbox(
  2386.                             dm_multiline_inputbox_info.s16Width,
  2387.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2388.                     }
  2389.                     else
  2390.                     {
  2391.                         resize_EMS_inputbox(
  2392.                             dm_multiline_inputbox_info.s16Width,
  2393.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2394.                     }
  2395.                     if (hide_multitap)
  2396.                     {
  2397.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2398.                     }
  2399.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2400.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2401.                 }
  2402.                 else
  2403.                 {
  2404.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2405.                     {
  2406.                         resize_EMS_inputbox(
  2407.                             dm_multiline_inputbox_info.s16Width,
  2408.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height);
  2409.                     }
  2410.                     else
  2411.                     {
  2412.                         resize_EMS_inputbox(
  2413.                             dm_multiline_inputbox_info.s16Width,
  2414.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2415.                     }
  2416.                 }
  2417.             }
  2418.             else
  2419.             {
  2420.                 move_EMS_inputbox(dm_multiline_inputbox_info.s16X, dm_multiline_inputbox_info.s16Y);
  2421.                 if (!is_EMS_inputbox_in_view_mode())
  2422.                 {
  2423.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2424.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2425.                     {
  2426.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, get_multiline_inputbox_height());
  2427.                     }
  2428.                     else
  2429.                     {
  2430.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, dm_multiline_inputbox_info.s16Height);
  2431.                     }
  2432.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2433.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2434.                     {
  2435.                         resize_EMS_inputbox(
  2436.                             dm_multiline_inputbox_info.s16Width,
  2437.                             get_multiline_inputbox_height() - MMI_multitap_height);
  2438.                     }
  2439.                     else
  2440.                     {
  2441.                         resize_EMS_inputbox(
  2442.                             dm_multiline_inputbox_info.s16Width,
  2443.                             dm_multiline_inputbox_info.s16Height - MMI_multitap_height);
  2444.                     }
  2445.                     if (hide_multitap)
  2446.                     {
  2447.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2448.                     }
  2449.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2450.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2451.                 }
  2452.                 else
  2453.                 {
  2454.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2455.                     {
  2456.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, get_multiline_inputbox_height());
  2457.                     }
  2458.                     else
  2459.                     {
  2460.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, dm_multiline_inputbox_info.s16Height);
  2461.                     }
  2462.                 }
  2463.             }
  2464.         }       /* ( ! dm_aligned_area_data.is_in_aligned_area ) */
  2465.         else    /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2466.         {
  2467.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2468.             move_EMS_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2469.             dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2470.         }   /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2471.     }
  2472.     /* category5_hide_multitap(); */
  2473.     /* W05.38 Display Information Bar no matter REDRAW_2_REDRAW or not */
  2474.     if (wgui_inputbox_information_flag)
  2475.     {
  2476.         wgui_EMS_redraw_input_information_bar();
  2477.     }
  2478.     show_EMS_inputbox();
  2479.     return 1;
  2480. }
  2481. /*****************************************************************************
  2482.  * FUNCTION
  2483.  *  dm_setup_and_draw_dialer_inputbox
  2484.  * DESCRIPTION
  2485.  *  This function is used setup the dialer inputbox based on the coordinate set and
  2486.  *  then draw it
  2487.  * PARAMETERS
  2488.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2489.  *  *(?)
  2490.  * RETURNS
  2491.  *  void
  2492.  *****************************************************************************/
  2493. S32 dm_setup_and_draw_dialer_inputbox(S16 **UICtrlAccessPtr_p)
  2494. {
  2495.     /*----------------------------------------------------------------*/
  2496.     /* Local Variables                                                */
  2497.     /*----------------------------------------------------------------*/
  2498.     dm_coordinates dm_dialer_inputbox_info;
  2499.     /*----------------------------------------------------------------*/
  2500.     /* Code Body                                                      */
  2501.     /*----------------------------------------------------------------*/
  2502.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dialer_inputbox_info);
  2503.     if (dm_dialer_inputbox_info.s16X == -1 || dm_dialer_inputbox_info.s16Y == -1 ||
  2504.         dm_dialer_inputbox_info.s16Width == -1 || dm_dialer_inputbox_info.s16Height == -1)
  2505.     {
  2506.         return 0;
  2507.     }
  2508.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2509.     {
  2510.         move_dialer_inputbox(dm_dialer_inputbox_info.s16X, dm_dialer_inputbox_info.s16Y);
  2511.         resize_dialer_inputbox(dm_dialer_inputbox_info.s16Width, dm_dialer_inputbox_info.s16Height);
  2512.     }
  2513.     show_dialer_inputbox();
  2514.     return 1;
  2515. }
  2516. /*****************************************************************************
  2517.  * FUNCTION
  2518.  *  dm_setup_and_draw_singleline_inputbox
  2519.  * DESCRIPTION
  2520.  *  This function is used setup the singleline inputbox based on the coordinate set and
  2521.  *  then draw it
  2522.  * PARAMETERS
  2523.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2524.  *  *(?)
  2525.  * RETURNS
  2526.  *  void
  2527.  *****************************************************************************/
  2528. S32 dm_setup_and_draw_singleline_inputbox(S16 **UICtrlAccessPtr_p)
  2529. {
  2530.     /*----------------------------------------------------------------*/
  2531.     /* Local Variables                                                */
  2532.     /*----------------------------------------------------------------*/
  2533.     dm_coordinates dm_singleline_inputbox_info;
  2534.     /*----------------------------------------------------------------*/
  2535.     /* Code Body                                                      */
  2536.     /*----------------------------------------------------------------*/
  2537.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_singleline_inputbox_info);
  2538.     if (dm_singleline_inputbox_info.s16X == -1 || dm_singleline_inputbox_info.s16Y == -1 ||
  2539.         dm_singleline_inputbox_info.s16Width == -1 || dm_singleline_inputbox_info.s16Height == -1)
  2540.     {
  2541.         return 0;
  2542.     }
  2543.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2544.     {
  2545.         if (!dm_aligned_area_data.is_in_aligned_area)
  2546.         {
  2547.             move_singleline_inputbox(dm_singleline_inputbox_info.s16X, dm_singleline_inputbox_info.s16Y);
  2548.             if (dm_singleline_inputbox_info.Flags & DM_SINGLE_LINE_INPUTBOX_SPECIFIC_HEIGHT)
  2549.             {
  2550.                 resize_singleline_inputbox(dm_singleline_inputbox_info.s16Width, dm_singleline_inputbox_info.s16Height);
  2551.             }
  2552.         }
  2553.         else
  2554.         {
  2555.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2556.             move_singleline_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2557.             dm_aligned_area_data.s16Y += MMI_singleline_inputbox_height;
  2558.         }
  2559.     }
  2560.     show_singleline_inputbox();
  2561.     return 1;
  2562. }
  2563. /*****************************************************************************
  2564.  * FUNCTION
  2565.  *  dm_setup_and_draw_left_softkey
  2566.  * DESCRIPTION
  2567.  *  This function is used setup the left softkey based on the coordinate set and
  2568.  *  then draw it
  2569.  * PARAMETERS
  2570.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2571.  *  *(?)
  2572.  * RETURNS
  2573.  *  void
  2574.  *****************************************************************************/
  2575. S32 dm_setup_and_draw_left_softkey(S16 **UICtrlAccessPtr_p)
  2576. {
  2577.     /*----------------------------------------------------------------*/
  2578.     /* Local Variables                                                */
  2579.     /*----------------------------------------------------------------*/
  2580.     dm_coordinates dm_icontext_button_info;
  2581.     /*----------------------------------------------------------------*/
  2582.     /* Code Body                                                      */
  2583.     /*----------------------------------------------------------------*/
  2584.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_icontext_button_info);
  2585.     if (dm_icontext_button_info.s16X == -1 || dm_icontext_button_info.s16Y == -1 ||
  2586.         dm_icontext_button_info.s16Width == -1 || dm_icontext_button_info.s16Height == -1)
  2587.     {
  2588.         return 0;
  2589.     }
  2590.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2591.     {
  2592.         move_softkey(dm_icontext_button_info.s16X, dm_icontext_button_info.s16Y, MMI_LEFT_SOFTKEY);
  2593.         resize_left_softkey(dm_icontext_button_info.s16Width, dm_icontext_button_info.s16Height);
  2594.     }
  2595.     show_left_softkey();
  2596.     return 1;
  2597. }
  2598. /*****************************************************************************
  2599.  * FUNCTION
  2600.  *  dm_setup_and_draw_right_softkey
  2601.  * DESCRIPTION
  2602.  *  This function is used setup the right softkey based on the coordinate set and
  2603.  *  then draw it
  2604.  * PARAMETERS
  2605.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2606.  *  *(?)
  2607.  * RETURNS
  2608.  *  void
  2609.  *****************************************************************************/
  2610. S32 dm_setup_and_draw_right_softkey(S16 **UICtrlAccessPtr_p)
  2611. {
  2612.     /*----------------------------------------------------------------*/
  2613.     /* Local Variables                                                */
  2614.     /*----------------------------------------------------------------*/
  2615.     dm_coordinates dm_icontext_button_info;
  2616.     /*----------------------------------------------------------------*/
  2617.     /* Code Body                                                      */
  2618.     /*----------------------------------------------------------------*/
  2619.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_icontext_button_info);
  2620.     if (dm_icontext_button_info.s16X == -1 || dm_icontext_button_info.s16Y == -1 ||
  2621.         dm_icontext_button_info.s16Width == -1 || dm_icontext_button_info.s16Height == -1)
  2622.     {
  2623.         return 0;
  2624.     }
  2625.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2626.     {
  2627.         move_softkey(dm_icontext_button_info.s16X, dm_icontext_button_info.s16Y, MMI_RIGHT_SOFTKEY);
  2628.         resize_right_softkey(dm_icontext_button_info.s16Width, dm_icontext_button_info.s16Height);
  2629.     }
  2630.     show_right_softkey();
  2631.     return 1;
  2632. }
  2633. /*****************************************************************************
  2634.  * FUNCTION
  2635.  *  dm_setup_and_draw_title
  2636.  * DESCRIPTION
  2637.  *  This function is used setup the title bar  based on the coordinate set and
  2638.  *  then draw it
  2639.  * PARAMETERS
  2640.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2641.  *  *(?)
  2642.  * RETURNS
  2643.  *  void
  2644.  *****************************************************************************/
  2645. S32 dm_setup_and_draw_title(S16 **UICtrlAccessPtr_p)
  2646. {
  2647.     /*----------------------------------------------------------------*/
  2648.     /* Local Variables                                                */
  2649.     /*----------------------------------------------------------------*/
  2650.     dm_coordinates dm_title_info;
  2651.     /*----------------------------------------------------------------*/
  2652.     /* Code Body                                                      */
  2653.     /*----------------------------------------------------------------*/
  2654.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_title_info);
  2655.     if (dm_title_info.s16X == -1 || dm_title_info.s16Y == -1 ||
  2656.         dm_title_info.s16Width == -1 || dm_title_info.s16Height == -1)
  2657.     {
  2658.         menu_shortcut_handler_display = 1;
  2659.         //MMI_title_string = NULL;
  2660.         //MMI_title_icon = NULL;
  2661.         return 0;
  2662.     }
  2663.     if ((g_dm_data.s32flags & DM_NO_TITLE))
  2664.     {
  2665.         return 0;
  2666.     }
  2667.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2668.     {
  2669.         move_title(dm_title_info.s16X, dm_title_info.s16Y);
  2670.         resize_title(dm_title_info.s16Width, dm_title_info.s16Height);
  2671.         /* START VIJAY PMT 20050930 */
  2672.         move_menu_shortcut_handler(MMI_title_x + MMI_title_width - MMI_menu_shortcut_box.width, MMI_title_y);   /* PMT MANISH 20050707 */
  2673.         /* END VIJAY PMT 20050930 */
  2674.     }
  2675.     if (g_dm_data.s32flags & DM_LEFT_ALIGN_TITLE)
  2676.     {
  2677.         draw_title_left_align();
  2678.     }
  2679.     else if (g_dm_data.s32flags & DM_SCROLL_TITLE)
  2680.     {
  2681.         draw_scrolling_title();
  2682.     }
  2683.     else
  2684.     {
  2685.         draw_title();
  2686.     }
  2687.     return 1;
  2688. }
  2689. /*****************************************************************************
  2690.  * FUNCTION
  2691.  *  dm_setup_and_draw_horizontal_tab_bar
  2692.  * DESCRIPTION
  2693.  *  This function is used setup the horizontal tab bar based on the coordinate set and
  2694.  *  then draw it
  2695.  * PARAMETERS
  2696.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2697.  *  *(?)
  2698.  * RETURNS
  2699.  *  void
  2700.  *****************************************************************************/
  2701. S32 dm_setup_and_draw_horizontal_tab_bar(S16 **UICtrlAccessPtr_p)
  2702. {
  2703.     /*----------------------------------------------------------------*/
  2704.     /* Local Variables                                                */
  2705.     /*----------------------------------------------------------------*/
  2706.     dm_coordinates dm_htab_info;
  2707.     /*----------------------------------------------------------------*/
  2708.     /* Code Body                                                      */
  2709.     /*----------------------------------------------------------------*/
  2710.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_htab_info);
  2711.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2712.     {
  2713.         wgui_move_horizontal_tab_bar(dm_htab_info.s16X, dm_htab_info.s16Y);
  2714.         move_title(dm_htab_info.s16X, dm_htab_info.s16Y + MMI_HORIZONTAL_TAB_BAR_TAB_AREA_HEIGHT);
  2715.         resize_title(dm_htab_info.s16Width, MMI_HORIZONTAL_TAB_BAR_HINT_AREA_HEIGHT);
  2716.     }
  2717.     wgui_show_horizontal_tab_bar();
  2718.     return 1;
  2719. }
  2720. /*****************************************************************************
  2721.  * FUNCTION
  2722.  *  dm_setup_and_draw_category_controlled_area
  2723.  * DESCRIPTION
  2724.  *  This function is used setup the category controlled area based on the coordinate set and
  2725.  *  then draw it
  2726.  * PARAMETERS
  2727.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2728.  *  *(?)
  2729.  * RETURNS
  2730.  *  void
  2731.  *****************************************************************************/
  2732. S32 dm_setup_and_draw_category_controlled_area(S16 **UICtrlAccessPtr_p)
  2733. {
  2734.     /*----------------------------------------------------------------*/
  2735.     /* Local Variables                                                */
  2736.     /*----------------------------------------------------------------*/
  2737.     dm_coordinates dm_category_controlled_area_info;
  2738.     /*----------------------------------------------------------------*/
  2739.     /* Code Body                                                      */
  2740.     /*----------------------------------------------------------------*/
  2741.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_category_controlled_area_info);
  2742.     if (dm_category_controlled_area_info.s16X == -1 || dm_category_controlled_area_info.s16Y == -1 ||
  2743.         dm_category_controlled_area_info.s16Width == -1 || dm_category_controlled_area_info.s16Height == -1)
  2744.     {
  2745.         return 0;
  2746.     }
  2747. #ifdef __MMI_SUBLCD__
  2748.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  2749.     {
  2750.         if (dm_sub_category_controlled_area_callback)
  2751.         {
  2752.             (*dm_sub_category_controlled_area_callback) (&dm_category_controlled_area_info);
  2753.         }
  2754.     }
  2755.     else
  2756. #endif /* __MMI_SUBLCD__ */ 
  2757.     {
  2758.         if (dm_category_controlled_area_callback)
  2759.         {
  2760.             (*dm_category_controlled_area_callback) (&dm_category_controlled_area_info);
  2761.         }
  2762.     }
  2763.     setup_previous_control(&dm_category_controlled_area_info);
  2764.     return 1;
  2765. }
  2766. /*****************************************************************************
  2767.  * FUNCTION
  2768.  *  dm_setup_and_draw_category_controlled_area2
  2769.  * DESCRIPTION
  2770.  *  This function is used setup the category controlled area2 based on the coordinate set and
  2771.  *  then draw it
  2772.  * PARAMETERS
  2773.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2774.  *  *(?)
  2775.  * RETURNS
  2776.  *  void
  2777.  *****************************************************************************/
  2778. S32 dm_setup_and_draw_category_controlled_area2(S16 **UICtrlAccessPtr_p)
  2779. {
  2780.     /*----------------------------------------------------------------*/
  2781.     /* Local Variables                                                */
  2782.     /*----------------------------------------------------------------*/
  2783.     dm_coordinates dm_category_controlled_area_info;
  2784.     /*----------------------------------------------------------------*/
  2785.     /* Code Body                                                      */
  2786.     /*----------------------------------------------------------------*/
  2787.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_category_controlled_area_info);
  2788.     if (dm_category_controlled_area_info.s16X == -1 || dm_category_controlled_area_info.s16Y == -1 ||
  2789.         dm_category_controlled_area_info.s16Width == -1 || dm_category_controlled_area_info.s16Height == -1)
  2790.     {
  2791.         return 0;
  2792.     }
  2793.     if (dm_category_controlled_area2_callback)
  2794.     {
  2795.         (*dm_category_controlled_area2_callback) (&dm_category_controlled_area_info);
  2796.     }
  2797.     setup_previous_control(&dm_category_controlled_area_info);
  2798.     return 1;
  2799. }
  2800. /*****************************************************************************
  2801.  * FUNCTION
  2802.  *  dm_setup_and_draw_status_icons
  2803.  * DESCRIPTION
  2804.  *  This function is used setup the status icons based on the coordinate set and
  2805.  *  then draw it
  2806.  * PARAMETERS
  2807.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2808.  *  *(?)
  2809.  * RETURNS
  2810.  *  void
  2811.  *****************************************************************************/
  2812. S32 dm_setup_and_draw_status_icons(S16 **UICtrlAccessPtr_p)
  2813. {
  2814.     /*----------------------------------------------------------------*/
  2815.     /* Local Variables                                                */
  2816.     /*----------------------------------------------------------------*/
  2817.     dm_status_info_struct dm_status_info;
  2818.     /*----------------------------------------------------------------*/
  2819.     /* Code Body                                                      */
  2820.     /*----------------------------------------------------------------*/
  2821.     *UICtrlAccessPtr_p = dm_get_status_icon_bar_coordinates(*UICtrlAccessPtr_p, &dm_status_info);
  2822.     if (dm_status_info.x == -1 || dm_status_info.y == -1 ||
  2823.         dm_status_info.x1 == -1 || dm_status_info.y1 == -1 || dm_status_info.x2 == -1 || dm_status_info.y2 == -1)
  2824.     {
  2825.         return 0;
  2826.     }
  2827.     if ((g_dm_data.s32flags & DM_NO_STATUS_BAR))
  2828.     {
  2829.         return 0;
  2830.     }
  2831. #ifdef __MMI_SUBLCD__
  2832.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  2833.     {
  2834.         SUBLCD_screens_show_status_icons();
  2835.     }
  2836.     else
  2837. #endif /* __MMI_SUBLCD__ */ 
  2838.     {
  2839.     #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)       /* 041205 Calvin modieid */
  2840.         if ((g_dm_data.s32flags & DM_SPECIFIC_HIDE_STATUS_BAR))
  2841.         {
  2842.             show_status_icons();
  2843.         }
  2844.         else
  2845.         {
  2846.             show_title_status_icon();
  2847.         }
  2848.     #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  2849.         show_status_icons();
  2850.     #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  2851.     }
  2852.     return 1;
  2853. }
  2854. /*****************************************************************************
  2855.  * FUNCTION
  2856.  *  dm_setup_and_draw_button_bar
  2857.  * DESCRIPTION
  2858.  *  This function is used setup the button bar based on the coordinate set and
  2859.  *  then draw it
  2860.  * PARAMETERS
  2861.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2862.  *  *(?)
  2863.  * RETURNS
  2864.  *  void
  2865.  *****************************************************************************/
  2866. S32 dm_setup_and_draw_button_bar(S16 **UICtrlAccessPtr_p)
  2867. {
  2868.     /*----------------------------------------------------------------*/
  2869.     /* Local Variables                                                */
  2870.     /*----------------------------------------------------------------*/
  2871.     dm_buttonbar_info_struct dm_buttonbar_info;
  2872.     /*----------------------------------------------------------------*/
  2873.     /* Code Body                                                      */
  2874.     /*----------------------------------------------------------------*/
  2875.     *UICtrlAccessPtr_p = dm_get_button_bar_coordinates(*UICtrlAccessPtr_p, &dm_buttonbar_info);
  2876.     if (dm_buttonbar_info.coordinate.s16X == -1 || dm_buttonbar_info.coordinate.s16Y == -1 ||
  2877.         dm_buttonbar_info.coordinate.s16Width == -1 || dm_buttonbar_info.coordinate.s16Height == -1 ||
  2878.         dm_buttonbar_info.button_width == -1)
  2879.     {
  2880.         return 0;
  2881.     }
  2882.     if (g_dm_data.s32flags & DM_NO_SOFTKEY)
  2883.     {
  2884.         return 0;