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

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.         gdi_layer_get_base_handle(&dm_layers[dm_layers_count++]);
  1799.     gdi_layer_restore_base_active();
  1800.     /* not to set source key when sublcd is b/w */
  1801. #if (defined __MMI_SUBLCD__) && (!defined __MMI_SUBLCD_COLOR__)
  1802.     if ( act_lcd_handle == GDI_LCD_SUB_LCD_HANDLE )
  1803.     {
  1804.         gdi_layer_set_source_key(FALSE,0);
  1805.     }
  1806.     else
  1807.     {
  1808.         gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  1809.     }
  1810. #else
  1811.     gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
  1812. #endif
  1813. #ifndef __GDI_MEMORY_PROFILE_2__
  1814.     new_layer_x = 0;
  1815.     new_layer_y = 0;
  1816. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1817.     return 1;
  1818. }
  1819. /*****************************************************************************
  1820.  * FUNCTION
  1821.  *  dm_setup_new_layer
  1822.  * DESCRIPTION
  1823.  *  This function is used setup a new layer
  1824.  * PARAMETERS
  1825.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1826.  *  *(?)
  1827.  * RETURNS
  1828.  *  void
  1829.  *****************************************************************************/
  1830. S32 dm_setup_new_layer(S16 **UICtrlAccessPtr_p)
  1831. {
  1832.     /*----------------------------------------------------------------*/
  1833.     /* Local Variables                                                */
  1834.     /*----------------------------------------------------------------*/
  1835.     dm_coordinates dm_layer_info;
  1836.     gdi_result ret;
  1837.     /*----------------------------------------------------------------*/
  1838.     /* Code Body                                                      */
  1839.     /*----------------------------------------------------------------*/
  1840. #ifdef __GDI_MEMORY_PROFILE_2__
  1841.     gdi_layer_multi_layer_enable();
  1842. #endif 
  1843.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_layer_info);
  1844.     /* need to take care in REDRAW_2_REDRAW */
  1845.     if (g_dm_cntx.redraw_screen_main == REDRAW_2_REDRAW)
  1846.     {
  1847.         return 1;
  1848.     }
  1849.     if (dm_layer_info.s16X == -1 && dm_layer_info.s16Y == -1 && dm_layer_info.s16Width == -1 &&
  1850.         dm_layer_info.s16Height == -1)
  1851.     {
  1852.         return 1;
  1853.     }
  1854. #ifdef __GDI_MEMORY_PROFILE_2__ /* Multi-layer enable */
  1855. #ifdef __MMI_SUBLCD__
  1856.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  1857.     {
  1858.         ret = gdi_layer_create(
  1859.                 dm_layer_info.s16X,
  1860.                 dm_layer_info.s16Y,
  1861.                 dm_layer_info.s16Width,
  1862.                 dm_layer_info.s16Height,
  1863.                 &dm_layers_sub[dm_layers_count_sub]);
  1864.         MMI_ASSERT(ret >= 0);
  1865.         gdi_layer_set_active(dm_layers_sub[dm_layers_count_sub]);
  1866.         dm_layers_count_sub++;
  1867.     }
  1868.     else
  1869. #endif /* __MMI_SUBLCD__ */ 
  1870.     {
  1871.         ret = gdi_layer_create(
  1872.                 dm_layer_info.s16X,
  1873.                 dm_layer_info.s16Y,
  1874.                 dm_layer_info.s16Width,
  1875.                 dm_layer_info.s16Height,
  1876.                 &dm_layers[dm_layers_count]);
  1877.         MMI_ASSERT(ret >= 0);
  1878.         gdi_layer_set_active(dm_layers[dm_layers_count]);
  1879.         dm_layers_count++;
  1880.     }
  1881.     /* 072706 source key Start */
  1882.     gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT); /* source key color could be customized later */
  1883.     gdi_layer_clear(GDI_COLOR_TRANSPARENT);
  1884.     /* 072706 source key End */
  1885. #else /* __GDI_MEMORY_PROFILE_2__ */ 
  1886.     new_layer_x = (U16) dm_layer_info.s16X;
  1887.     new_layer_y = (U16) dm_layer_info.s16Y;
  1888. #endif /* __GDI_MEMORY_PROFILE_2__ */ 
  1889.     return 1;
  1890. }
  1891. /*****************************************************************************
  1892.  * FUNCTION
  1893.  *  dm_setup_and_draw_circular_menu
  1894.  * DESCRIPTION
  1895.  *  This function is used setup the circular menu based on the coordinate set and
  1896.  *  then draw it
  1897.  * PARAMETERS
  1898.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1899.  *  *(?)
  1900.  * RETURNS
  1901.  *  void
  1902.  *****************************************************************************/
  1903. S32 dm_setup_and_draw_circular_menu(S16 **UICtrlAccessPtr_p)
  1904. {
  1905.     /*----------------------------------------------------------------*/
  1906.     /* Local Variables                                                */
  1907.     /*----------------------------------------------------------------*/
  1908.     dm_coordinates dm_3D_circular_menu_info;
  1909.     /*----------------------------------------------------------------*/
  1910.     /* Code Body                                                      */
  1911.     /*----------------------------------------------------------------*/
  1912.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_3D_circular_menu_info);
  1913.     if (dm_3D_circular_menu_info.s16X == -1 || dm_3D_circular_menu_info.s16Y == -1 ||
  1914.         dm_3D_circular_menu_info.s16Width == -1 || dm_3D_circular_menu_info.s16Height == -1)
  1915.     {
  1916.         return 0;
  1917.     }
  1918.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  1919.     {
  1920.         move_circular_3d_menu(dm_3D_circular_menu_info.s16X, dm_3D_circular_menu_info.s16Y);
  1921.         resize_circular_3d_menu(dm_3D_circular_menu_info.s16Width, dm_3D_circular_menu_info.s16Height);
  1922.     }
  1923.     show_circular_3d_menu();
  1924.     return 1;
  1925. }
  1926. /*****************************************************************************
  1927.  * FUNCTION
  1928.  *  dm_setup_and_draw_fixed_list
  1929.  * DESCRIPTION
  1930.  *  This function is used setup the fixed list based on the coordinate set and
  1931.  *  then draw it
  1932.  * PARAMETERS
  1933.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  1934.  *  *(?)
  1935.  * RETURNS
  1936.  *  void
  1937.  *****************************************************************************/
  1938. S32 dm_setup_and_draw_fixed_list(S16 **UICtrlAccessPtr_p)
  1939. {
  1940.     /*----------------------------------------------------------------*/
  1941.     /* Local Variables                                                */
  1942.     /*----------------------------------------------------------------*/
  1943.     dm_coordinates dm_fixed_list_info;
  1944.     MMI_BOOL resized = MMI_FALSE;
  1945.     /*----------------------------------------------------------------*/
  1946.     /* Code Body                                                      */
  1947.     /*----------------------------------------------------------------*/
  1948.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_fixed_list_info);
  1949.     if (dm_fixed_list_info.s16X == -1 || dm_fixed_list_info.s16Y == -1 ||
  1950.         dm_fixed_list_info.s16Width == -1 || dm_fixed_list_info.s16Height == -1)
  1951.     {
  1952.         return 0;
  1953.     }
  1954.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  1955.     {
  1956.         if (dm_fixed_list_info.Flags & DM_CATEGORY_CONTROL_COORDINATES)
  1957.         {
  1958.             show_fixed_list();
  1959.         }
  1960.         else
  1961.         {
  1962.             move_fixed_list(dm_fixed_list_info.s16X, dm_fixed_list_info.s16Y);
  1963.             if (dm_fixed_list_info.s16Width != MMI_fixed_list_menu.width ||
  1964.                 dm_fixed_list_info.s16Height != MMI_fixed_list_menu.height)
  1965.             {
  1966.                 resized = MMI_TRUE;
  1967.             }
  1968.             resize_fixed_list(dm_fixed_list_info.s16Width, dm_fixed_list_info.s16Height);
  1969.             if (resized == MMI_TRUE)
  1970.             {
  1971.                 fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1972.             }
  1973.             show_fixed_list();
  1974.         }
  1975.     }
  1976.     else
  1977.     {
  1978.         show_fixed_list();
  1979.     }
  1980.     return 1;
  1981. }
  1982. /*****************************************************************************
  1983. * FUNCTION
  1984. *  dm_setup_and_draw_circular_menu
  1985. *
  1986. * DESCRIPTION
  1987. *   This function is used setup the dynamic list based on the coordinate set and
  1988. *  then draw it
  1989. *
  1990. * PARAMETERS
  1991. *  UICtrlAccessPtr_p IN/OUT   It specifies the start position to take out the coordinates.
  1992. *  *
  1993. * RETURNS                 
  1994. *  void
  1995. *
  1996. * GLOBALS AFFECTED        
  1997. *   
  1998. *****************************************************************************/
  1999. /*****************************************************************************
  2000.  * FUNCTION
  2001.  *  dm_setup_and_draw_dynamic_list
  2002.  * DESCRIPTION
  2003.  *  This function is used setup the dynamic list based on the coordinate set and
  2004.  *  then draw it
  2005.  * PARAMETERS
  2006.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2007.  *  *(?)
  2008.  * RETURNS
  2009.  *  void
  2010.  *****************************************************************************/
  2011. S32 dm_setup_and_draw_dynamic_list(S16 **UICtrlAccessPtr_p)
  2012. {
  2013.     /*----------------------------------------------------------------*/
  2014.     /* Local Variables                                                */
  2015.     /*----------------------------------------------------------------*/
  2016.     dm_coordinates dm_dynamic_list_info;
  2017.     fixed_icontext_menuitem *menuitem_p;
  2018.     /* Leo change 0705 start */
  2019.     MMI_BOOL resized = MMI_FALSE;
  2020.     /*----------------------------------------------------------------*/
  2021.     /* Code Body                                                      */
  2022.     /*----------------------------------------------------------------*/
  2023.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dynamic_list_info);
  2024.     if (dm_dynamic_list_info.s16X == -1 || dm_dynamic_list_info.s16Y == -1 ||
  2025.         dm_dynamic_list_info.s16Width == -1 || dm_dynamic_list_info.s16Height == -1)
  2026.     {
  2027.         return 0;
  2028.     }
  2029.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2030.     {
  2031.         move_fixed_list(dm_dynamic_list_info.s16X, dm_dynamic_list_info.s16Y);
  2032.         if (dm_dynamic_list_info.s16Width != MMI_fixed_list_menu.width ||
  2033.             dm_dynamic_list_info.s16Height != MMI_fixed_list_menu.height)
  2034.         {
  2035.             resized = MMI_TRUE;
  2036.         }
  2037.         resize_fixed_list(dm_dynamic_list_info.s16Width, dm_dynamic_list_info.s16Height);
  2038.         menuitem_p = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
  2039.         gui_set_fixed_list_menu_common_item_data(&MMI_fixed_list_menu, menuitem_p);
  2040.         if (resized == MMI_TRUE)
  2041.         {
  2042.             dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2043.         }
  2044.         /* Leo change 0705 end */
  2045.     }
  2046.     show_dynamic_list();
  2047.     return 1;
  2048. }
  2049. /*****************************************************************************
  2050.  * FUNCTION
  2051.  *  dm_setup_and_draw_asyncdynamic_list
  2052.  * DESCRIPTION
  2053.  *  This function is used setup the asyncdynamic list based on the coordinate set and
  2054.  *  then draw it
  2055.  * PARAMETERS
  2056.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2057.  *  *(?)
  2058.  * RETURNS
  2059.  *  void
  2060.  *****************************************************************************/
  2061. S32 dm_setup_and_draw_asyncdynamic_list(S16 **UICtrlAccessPtr_p)
  2062. {
  2063.     /*----------------------------------------------------------------*/
  2064.     /* Local Variables                                                */
  2065.     /*----------------------------------------------------------------*/
  2066.     dm_coordinates dm_dynamic_list_info;
  2067.     fixed_icontext_menuitem *menuitem_p;
  2068.     /* Leo change 0705 start */
  2069.     MMI_BOOL resized = MMI_FALSE;
  2070.     /*----------------------------------------------------------------*/
  2071.     /* Code Body                                                      */
  2072.     /*----------------------------------------------------------------*/
  2073.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dynamic_list_info);
  2074.     if (dm_dynamic_list_info.s16X == -1 || dm_dynamic_list_info.s16Y == -1 ||
  2075.         dm_dynamic_list_info.s16Width == -1 || dm_dynamic_list_info.s16Height == -1)
  2076.     {
  2077.         return 0;
  2078.     }
  2079.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2080.     {
  2081.         move_fixed_list(dm_dynamic_list_info.s16X, dm_dynamic_list_info.s16Y);
  2082.         if (dm_dynamic_list_info.s16Width != MMI_fixed_list_menu.width ||
  2083.             dm_dynamic_list_info.s16Height != MMI_fixed_list_menu.height)
  2084.         {
  2085.             resized = MMI_TRUE;
  2086.         }
  2087.         resize_fixed_list(dm_dynamic_list_info.s16Width, dm_dynamic_list_info.s16Height);
  2088.         menuitem_p = (fixed_icontext_menuitem*) MMI_fixed_list_menu.common_item_data;
  2089.         gui_set_fixed_list_menu_common_item_data(&MMI_fixed_list_menu, menuitem_p);
  2090.         if (resized == MMI_TRUE)
  2091.         {
  2092.             asyncdynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2093.         }
  2094.         /* Leo change 0705 end */
  2095.     }
  2096.     show_asyncdynamic_list();
  2097.     return 1;
  2098. }
  2099. /*****************************************************************************
  2100.  * FUNCTION
  2101.  *  dm_setup_and_draw_matrix_menu
  2102.  * DESCRIPTION
  2103.  *  This function is used setup the matrix menu based on the coordinate set and
  2104.  *  then draw it
  2105.  * PARAMETERS
  2106.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2107.  *  *(?)
  2108.  * RETURNS
  2109.  *  void
  2110.  *****************************************************************************/
  2111. S32 dm_setup_and_draw_matrix_menu(S16 **UICtrlAccessPtr_p)
  2112. {
  2113.     /*----------------------------------------------------------------*/
  2114.     /* Local Variables                                                */
  2115.     /*----------------------------------------------------------------*/
  2116.     dm_coordinates dm_matrix_menu_info;
  2117.     /*----------------------------------------------------------------*/
  2118.     /* Code Body                                                      */
  2119.     /*----------------------------------------------------------------*/
  2120.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_matrix_menu_info);
  2121.     if (dm_matrix_menu_info.s16X == -1 || dm_matrix_menu_info.s16Y == -1 ||
  2122.         dm_matrix_menu_info.s16Width == -1 || dm_matrix_menu_info.s16Height == -1)
  2123.     {
  2124.         return 0;
  2125.     }
  2126.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2127.     {
  2128.         move_fixed_matrix(dm_matrix_menu_info.s16X, dm_matrix_menu_info.s16Y);
  2129.         if (fixed_matrix_auto_disable_scrollbar())
  2130.         {
  2131.             reset_fixed_matrix_col_rows();
  2132.         }
  2133.         resize_fixed_matrix(dm_matrix_menu_info.s16Width, dm_matrix_menu_info.s16Height);
  2134.     }
  2135.     show_fixed_matrix();
  2136.     return 1;
  2137. }
  2138. /*****************************************************************************
  2139.  * FUNCTION
  2140.  *  dm_setup_and_draw_multiline_inputbox
  2141.  * DESCRIPTION
  2142.  *  This function is used setup the multiline inputbox based on the coordinate set and
  2143.  *  then draw it
  2144.  * PARAMETERS
  2145.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2146.  *  dm_cat_scr_info         [?]             
  2147.  *  *(?)
  2148.  * RETURNS
  2149.  *  void
  2150.  *****************************************************************************/
  2151. S32 dm_setup_and_draw_multiline_inputbox(S16 **UICtrlAccessPtr_p, dm_cat_scr_info_struct *dm_cat_scr_info)
  2152. {
  2153.     /*----------------------------------------------------------------*/
  2154.     /* Local Variables                                                */
  2155.     /*----------------------------------------------------------------*/
  2156.     dm_coordinates dm_multiline_inputbox_info;
  2157.     /*----------------------------------------------------------------*/
  2158.     /* Code Body                                                      */
  2159.     /*----------------------------------------------------------------*/
  2160.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_multiline_inputbox_info);
  2161.     if (!get_multiline_inputbox_display_status())
  2162.     {
  2163.         return 0;
  2164.     }
  2165.     if (dm_multiline_inputbox_info.s16X == -1 || dm_multiline_inputbox_info.s16Y == -1 ||
  2166.         dm_multiline_inputbox_info.s16Width == -1 || dm_multiline_inputbox_info.s16Height == -1)
  2167.     {
  2168.         return 0;
  2169.     }
  2170.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2171.     {
  2172.         if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2173.         {
  2174.             S32 w = 0, h = 0;
  2175.             resize_multiline_inputbox_fit(
  2176.                 dm_multiline_inputbox_info.s16Width,
  2177.                 dm_multiline_inputbox_info.s16Height,
  2178.                 &w,
  2179.                 &h);
  2180.         }
  2181.         if (!dm_aligned_area_data.is_in_aligned_area)
  2182.         {
  2183.             if (wgui_inputbox_information_flag)
  2184.             {
  2185.             #ifdef UI_SMALL_CATEGORY_EDITOR
  2186.                 /* START VIJAY PMT 20051202 */
  2187.                 if (whether_no_small_screen())
  2188.                 {
  2189.                     wgui_setup_input_information(
  2190.                         dm_multiline_inputbox_info.s16X + 1,
  2191.                         dm_multiline_inputbox_info.s16Y,
  2192.                         dm_multiline_inputbox_info.s16Width - 2,
  2193.                         wgui_inputbox_information_bar_height);
  2194.                 }
  2195.                 else
  2196.             #endif /* UI_SMALL_CATEGORY_EDITOR */ 
  2197.                     /* END VIJAY PMT 20051202 */
  2198.                     wgui_setup_input_information(
  2199.                         dm_multiline_inputbox_info.s16X,
  2200.                         dm_multiline_inputbox_info.s16Y,
  2201.                         dm_multiline_inputbox_info.s16Width,
  2202.                         wgui_inputbox_information_bar_height);
  2203.                 move_multiline_inputbox(
  2204.                     dm_multiline_inputbox_info.s16X,
  2205.                     dm_multiline_inputbox_info.s16Y + wgui_inputbox_information_bar_height);
  2206.                 //Currently this is assuming that Multitap is always being shown whenever multiline
  2207.                 //inputbox is shown, so this needs to be FIXED and appropriates condition needs to be checked here.
  2208.                 if (!is_multiline_inputbox_in_view_mode())
  2209.                 {
  2210.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2211.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2212.                     {
  2213.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2214.                     }
  2215.                     resize_multiline_inputbox(
  2216.                         dm_multiline_inputbox_info.s16Width,
  2217.                         dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2218.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2219.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2220.                     {
  2221.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2222.                     }
  2223.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT_NO_MULTITAP)
  2224.                     {
  2225.                         resize_multiline_inputbox(
  2226.                             dm_multiline_inputbox_info.s16Width,
  2227.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2228.                     }
  2229.                     else
  2230.                     {
  2231.                         resize_multiline_inputbox(
  2232.                             dm_multiline_inputbox_info.s16Width,
  2233.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2234.                     }
  2235.                     if (hide_multitap)
  2236.                     {
  2237.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2238.                     }
  2239.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2240.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2241.                 }
  2242.                 else
  2243.                 {
  2244.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2245.                     {
  2246.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2247.                     }
  2248.                     resize_multiline_inputbox(
  2249.                         dm_multiline_inputbox_info.s16Width,
  2250.                         dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2251.                 }
  2252.             }
  2253.             else
  2254.             {
  2255.                 move_multiline_inputbox(dm_multiline_inputbox_info.s16X, dm_multiline_inputbox_info.s16Y);
  2256.                 if (!is_multiline_inputbox_in_view_mode())
  2257.                 {
  2258.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2259.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2260.                     {
  2261.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2262.                     }
  2263.                     resize_multiline_inputbox(
  2264.                         dm_multiline_inputbox_info.s16Width,
  2265.                         dm_multiline_inputbox_info.s16Height);
  2266.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2267.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2268.                     {
  2269.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2270.                     }
  2271.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT_NO_MULTITAP)
  2272.                     {
  2273.                         resize_multiline_inputbox(
  2274.                             dm_multiline_inputbox_info.s16Width,
  2275.                             dm_multiline_inputbox_info.s16Height);
  2276.                     }
  2277.                     else
  2278.                     {
  2279.                         resize_multiline_inputbox(
  2280.                             dm_multiline_inputbox_info.s16Width,
  2281.                             dm_multiline_inputbox_info.s16Height - MMI_multitap_height);
  2282.                     }
  2283.                     if (hide_multitap)
  2284.                     {
  2285.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2286.                     }
  2287.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2288.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2289.                 }
  2290.                 else
  2291.                 {
  2292.                     if (dm_multiline_inputbox_info.Flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2293.                     {
  2294.                         dm_multiline_inputbox_info.s16Height = get_multiline_inputbox_height();
  2295.                     }
  2296.                     resize_multiline_inputbox(
  2297.                         dm_multiline_inputbox_info.s16Width,
  2298.                         dm_multiline_inputbox_info.s16Height);
  2299.                 }
  2300.             }
  2301.             setup_previous_control(&dm_multiline_inputbox_info);
  2302.         }       /* ( ! dm_aligned_area_data.is_in_aligned_area ) */
  2303.         else    /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2304.         {
  2305.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2306.             move_multiline_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2307.             dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2308.         }   /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2309.     }
  2310.     else if (dm_aligned_area_data.is_in_aligned_area)
  2311.     {
  2312.         dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2313.         dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2314.     }
  2315.     wgui_show_inputbox();
  2316.     return 1;
  2317. }
  2318. /*****************************************************************************
  2319.  * FUNCTION
  2320.  *  dm_setup_and_draw_ems_inputbox
  2321.  * DESCRIPTION
  2322.  *  This function is used setup the EMS inputbox based on the coordinate set and
  2323.  *  then draw it
  2324.  * PARAMETERS
  2325.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2326.  *  dm_cat_scr_info         [?]             
  2327.  *  *(?)
  2328.  * RETURNS
  2329.  *  void
  2330.  *****************************************************************************/
  2331. S32 dm_setup_and_draw_ems_inputbox(S16 **UICtrlAccessPtr_p, dm_cat_scr_info_struct *dm_cat_scr_info)
  2332. {
  2333.     /*----------------------------------------------------------------*/
  2334.     /* Local Variables                                                */
  2335.     /*----------------------------------------------------------------*/
  2336.     dm_coordinates dm_multiline_inputbox_info;
  2337.     /*----------------------------------------------------------------*/
  2338.     /* Code Body                                                      */
  2339.     /*----------------------------------------------------------------*/
  2340.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_multiline_inputbox_info);
  2341.     if (!get_multiline_inputbox_display_status())
  2342.     {
  2343.         return 0;
  2344.     }
  2345.     if (dm_multiline_inputbox_info.s16X == -1 || dm_multiline_inputbox_info.s16Y == -1 ||
  2346.         dm_multiline_inputbox_info.s16Width == -1 || dm_multiline_inputbox_info.s16Height == -1)
  2347.     {
  2348.         return 0;
  2349.     }
  2350.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2351.     {
  2352.         if (!dm_aligned_area_data.is_in_aligned_area)
  2353.         {
  2354.             if (wgui_inputbox_information_flag)
  2355.             {
  2356.                 wgui_EMS_setup_input_information(
  2357.                     dm_multiline_inputbox_info.s16X,
  2358.                     dm_multiline_inputbox_info.s16Y,
  2359.                     dm_multiline_inputbox_info.s16Width,
  2360.                     wgui_EMS_inputbox_information_bar_height);
  2361.                 move_EMS_inputbox(
  2362.                     dm_multiline_inputbox_info.s16X,
  2363.                     dm_multiline_inputbox_info.s16Y + wgui_EMS_inputbox_information_bar_height);
  2364.                 //Currently this is assuming that Multitap is always being shown whenever multiline
  2365.                 //inputbox is shown, so this needs to be FIXED and appropriates condition needs to be checked here.
  2366.                 if (!is_EMS_inputbox_in_view_mode())
  2367.                 {
  2368.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2369.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2370.                     {
  2371.                         resize_EMS_inputbox(
  2372.                             dm_multiline_inputbox_info.s16Width,
  2373.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height);
  2374.                     }
  2375.                     else
  2376.                     {
  2377.                         resize_EMS_inputbox(
  2378.                             dm_multiline_inputbox_info.s16Width,
  2379.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2380.                     }
  2381.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2382.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2383.                     {
  2384.                         resize_EMS_inputbox(
  2385.                             dm_multiline_inputbox_info.s16Width,
  2386.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2387.                     }
  2388.                     else
  2389.                     {
  2390.                         resize_EMS_inputbox(
  2391.                             dm_multiline_inputbox_info.s16Width,
  2392.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height - MMI_multitap_height);
  2393.                     }
  2394.                     if (hide_multitap)
  2395.                     {
  2396.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2397.                     }
  2398.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2399.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2400.                 }
  2401.                 else
  2402.                 {
  2403.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2404.                     {
  2405.                         resize_EMS_inputbox(
  2406.                             dm_multiline_inputbox_info.s16Width,
  2407.                             get_multiline_inputbox_height() - wgui_inputbox_information_bar_height);
  2408.                     }
  2409.                     else
  2410.                     {
  2411.                         resize_EMS_inputbox(
  2412.                             dm_multiline_inputbox_info.s16Width,
  2413.                             dm_multiline_inputbox_info.s16Height - wgui_inputbox_information_bar_height);
  2414.                     }
  2415.                 }
  2416.             }
  2417.             else
  2418.             {
  2419.                 move_EMS_inputbox(dm_multiline_inputbox_info.s16X, dm_multiline_inputbox_info.s16Y);
  2420.                 if (!is_EMS_inputbox_in_view_mode())
  2421.                 {
  2422.                 #if defined(__MMI_FULL_SCREEN_EDITOR__)
  2423.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2424.                     {
  2425.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, get_multiline_inputbox_height());
  2426.                     }
  2427.                     else
  2428.                     {
  2429.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, dm_multiline_inputbox_info.s16Height);
  2430.                     }
  2431.                 #else /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2432.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2433.                     {
  2434.                         resize_EMS_inputbox(
  2435.                             dm_multiline_inputbox_info.s16Width,
  2436.                             get_multiline_inputbox_height() - MMI_multitap_height);
  2437.                     }
  2438.                     else
  2439.                     {
  2440.                         resize_EMS_inputbox(
  2441.                             dm_multiline_inputbox_info.s16Width,
  2442.                             dm_multiline_inputbox_info.s16Height - MMI_multitap_height);
  2443.                     }
  2444.                     if (hide_multitap)
  2445.                     {
  2446.                         hide_multitap();    /* This is registered by Category to draw the area when multitap is now being shown. */
  2447.                     }
  2448.                 #endif /* defined(__MMI_FULL_SCREEN_EDITOR__) */ 
  2449.                     dm_update_multitap_coordinates(&dm_multiline_inputbox_info, dm_cat_scr_info);
  2450.                 }
  2451.                 else
  2452.                 {
  2453.                     if (g_dm_data.s32flags & DM_FIXED_MULTILINE_INPUTBOX_HEIGHT)
  2454.                     {
  2455.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, get_multiline_inputbox_height());
  2456.                     }
  2457.                     else
  2458.                     {
  2459.                         resize_EMS_inputbox(dm_multiline_inputbox_info.s16Width, dm_multiline_inputbox_info.s16Height);
  2460.                     }
  2461.                 }
  2462.             }
  2463.         }       /* ( ! dm_aligned_area_data.is_in_aligned_area ) */
  2464.         else    /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2465.         {
  2466.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2467.             move_EMS_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2468.             dm_aligned_area_data.s16Y += get_multiline_inputbox_height();
  2469.         }   /* ( dm_aligned_area_data.is_in_aligned_area ) */
  2470.     }
  2471.     /* category5_hide_multitap(); */
  2472.     /* W05.38 Display Information Bar no matter REDRAW_2_REDRAW or not */
  2473.     if (wgui_inputbox_information_flag)
  2474.     {
  2475.         wgui_EMS_redraw_input_information_bar();
  2476.     }
  2477.     show_EMS_inputbox();
  2478.     return 1;
  2479. }
  2480. /*****************************************************************************
  2481.  * FUNCTION
  2482.  *  dm_setup_and_draw_dialer_inputbox
  2483.  * DESCRIPTION
  2484.  *  This function is used setup the dialer inputbox based on the coordinate set and
  2485.  *  then draw it
  2486.  * PARAMETERS
  2487.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2488.  *  *(?)
  2489.  * RETURNS
  2490.  *  void
  2491.  *****************************************************************************/
  2492. S32 dm_setup_and_draw_dialer_inputbox(S16 **UICtrlAccessPtr_p)
  2493. {
  2494.     /*----------------------------------------------------------------*/
  2495.     /* Local Variables                                                */
  2496.     /*----------------------------------------------------------------*/
  2497.     dm_coordinates dm_dialer_inputbox_info;
  2498.     /*----------------------------------------------------------------*/
  2499.     /* Code Body                                                      */
  2500.     /*----------------------------------------------------------------*/
  2501.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_dialer_inputbox_info);
  2502.     if (dm_dialer_inputbox_info.s16X == -1 || dm_dialer_inputbox_info.s16Y == -1 ||
  2503.         dm_dialer_inputbox_info.s16Width == -1 || dm_dialer_inputbox_info.s16Height == -1)
  2504.     {
  2505.         return 0;
  2506.     }
  2507.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2508.     {
  2509.         move_dialer_inputbox(dm_dialer_inputbox_info.s16X, dm_dialer_inputbox_info.s16Y);
  2510.         resize_dialer_inputbox(dm_dialer_inputbox_info.s16Width, dm_dialer_inputbox_info.s16Height);
  2511.     }
  2512.     show_dialer_inputbox();
  2513.     return 1;
  2514. }
  2515. /*****************************************************************************
  2516.  * FUNCTION
  2517.  *  dm_setup_and_draw_singleline_inputbox
  2518.  * DESCRIPTION
  2519.  *  This function is used setup the singleline inputbox based on the coordinate set and
  2520.  *  then draw it
  2521.  * PARAMETERS
  2522.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2523.  *  *(?)
  2524.  * RETURNS
  2525.  *  void
  2526.  *****************************************************************************/
  2527. S32 dm_setup_and_draw_singleline_inputbox(S16 **UICtrlAccessPtr_p)
  2528. {
  2529.     /*----------------------------------------------------------------*/
  2530.     /* Local Variables                                                */
  2531.     /*----------------------------------------------------------------*/
  2532.     dm_coordinates dm_singleline_inputbox_info;
  2533.     /*----------------------------------------------------------------*/
  2534.     /* Code Body                                                      */
  2535.     /*----------------------------------------------------------------*/
  2536.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_singleline_inputbox_info);
  2537.     if (dm_singleline_inputbox_info.s16X == -1 || dm_singleline_inputbox_info.s16Y == -1 ||
  2538.         dm_singleline_inputbox_info.s16Width == -1 || dm_singleline_inputbox_info.s16Height == -1)
  2539.     {
  2540.         return 0;
  2541.     }
  2542.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2543.     {
  2544.         if (!dm_aligned_area_data.is_in_aligned_area)
  2545.         {
  2546.             move_singleline_inputbox(dm_singleline_inputbox_info.s16X, dm_singleline_inputbox_info.s16Y);
  2547.             if (dm_singleline_inputbox_info.Flags & DM_SINGLE_LINE_INPUTBOX_SPECIFIC_HEIGHT)
  2548.             {
  2549.                 resize_singleline_inputbox(dm_singleline_inputbox_info.s16Width, dm_singleline_inputbox_info.s16Height);
  2550.             }
  2551.         }
  2552.         else
  2553.         {
  2554.             dm_aligned_area_data.s16Y += dm_aligned_area_data.y_space;
  2555.             move_singleline_inputbox(dm_aligned_area_data.s16X, dm_aligned_area_data.s16Y);
  2556.             dm_aligned_area_data.s16Y += MMI_singleline_inputbox_height;
  2557.         }
  2558.     }
  2559.     show_singleline_inputbox();
  2560.     return 1;
  2561. }
  2562. /*****************************************************************************
  2563.  * FUNCTION
  2564.  *  dm_setup_and_draw_left_softkey
  2565.  * DESCRIPTION
  2566.  *  This function is used setup the left softkey based on the coordinate set and
  2567.  *  then draw it
  2568.  * PARAMETERS
  2569.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2570.  *  *(?)
  2571.  * RETURNS
  2572.  *  void
  2573.  *****************************************************************************/
  2574. S32 dm_setup_and_draw_left_softkey(S16 **UICtrlAccessPtr_p)
  2575. {
  2576.     /*----------------------------------------------------------------*/
  2577.     /* Local Variables                                                */
  2578.     /*----------------------------------------------------------------*/
  2579.     dm_coordinates dm_icontext_button_info;
  2580.     /*----------------------------------------------------------------*/
  2581.     /* Code Body                                                      */
  2582.     /*----------------------------------------------------------------*/
  2583.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_icontext_button_info);
  2584.     if (dm_icontext_button_info.s16X == -1 || dm_icontext_button_info.s16Y == -1 ||
  2585.         dm_icontext_button_info.s16Width == -1 || dm_icontext_button_info.s16Height == -1)
  2586.     {
  2587.         return 0;
  2588.     }
  2589.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2590.     {
  2591.         move_softkey(dm_icontext_button_info.s16X, dm_icontext_button_info.s16Y, MMI_LEFT_SOFTKEY);
  2592.         resize_left_softkey(dm_icontext_button_info.s16Width, dm_icontext_button_info.s16Height);
  2593.     }
  2594.     show_left_softkey();
  2595.     return 1;
  2596. }
  2597. /*****************************************************************************
  2598.  * FUNCTION
  2599.  *  dm_setup_and_draw_right_softkey
  2600.  * DESCRIPTION
  2601.  *  This function is used setup the right softkey based on the coordinate set and
  2602.  *  then draw it
  2603.  * PARAMETERS
  2604.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2605.  *  *(?)
  2606.  * RETURNS
  2607.  *  void
  2608.  *****************************************************************************/
  2609. S32 dm_setup_and_draw_right_softkey(S16 **UICtrlAccessPtr_p)
  2610. {
  2611.     /*----------------------------------------------------------------*/
  2612.     /* Local Variables                                                */
  2613.     /*----------------------------------------------------------------*/
  2614.     dm_coordinates dm_icontext_button_info;
  2615.     /*----------------------------------------------------------------*/
  2616.     /* Code Body                                                      */
  2617.     /*----------------------------------------------------------------*/
  2618.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_icontext_button_info);
  2619.     if (dm_icontext_button_info.s16X == -1 || dm_icontext_button_info.s16Y == -1 ||
  2620.         dm_icontext_button_info.s16Width == -1 || dm_icontext_button_info.s16Height == -1)
  2621.     {
  2622.         return 0;
  2623.     }
  2624.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2625.     {
  2626.         move_softkey(dm_icontext_button_info.s16X, dm_icontext_button_info.s16Y, MMI_RIGHT_SOFTKEY);
  2627.         resize_right_softkey(dm_icontext_button_info.s16Width, dm_icontext_button_info.s16Height);
  2628.     }
  2629.     show_right_softkey();
  2630.     return 1;
  2631. }
  2632. /*****************************************************************************
  2633.  * FUNCTION
  2634.  *  dm_setup_and_draw_title
  2635.  * DESCRIPTION
  2636.  *  This function is used setup the title bar  based on the coordinate set and
  2637.  *  then draw it
  2638.  * PARAMETERS
  2639.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2640.  *  *(?)
  2641.  * RETURNS
  2642.  *  void
  2643.  *****************************************************************************/
  2644. S32 dm_setup_and_draw_title(S16 **UICtrlAccessPtr_p)
  2645. {
  2646.     /*----------------------------------------------------------------*/
  2647.     /* Local Variables                                                */
  2648.     /*----------------------------------------------------------------*/
  2649.     dm_coordinates dm_title_info;
  2650.     /*----------------------------------------------------------------*/
  2651.     /* Code Body                                                      */
  2652.     /*----------------------------------------------------------------*/
  2653.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_title_info);
  2654.     if (dm_title_info.s16X == -1 || dm_title_info.s16Y == -1 ||
  2655.         dm_title_info.s16Width == -1 || dm_title_info.s16Height == -1)
  2656.     {
  2657.         menu_shortcut_handler_display = 1;
  2658.         //MMI_title_string = NULL;
  2659.         //MMI_title_icon = NULL;
  2660.         return 0;
  2661.     }
  2662.     if ((g_dm_data.s32flags & DM_NO_TITLE))
  2663.     {
  2664.         return 0;
  2665.     }
  2666.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2667.     {
  2668.         move_title(dm_title_info.s16X, dm_title_info.s16Y);
  2669.         resize_title(dm_title_info.s16Width, dm_title_info.s16Height);
  2670.         /* START VIJAY PMT 20050930 */
  2671.         move_menu_shortcut_handler(MMI_title_x + MMI_title_width - MMI_menu_shortcut_box.width, MMI_title_y);   /* PMT MANISH 20050707 */
  2672.         /* END VIJAY PMT 20050930 */
  2673.     }
  2674.     if (g_dm_data.s32flags & DM_LEFT_ALIGN_TITLE)
  2675.     {
  2676.         draw_title_left_align();
  2677.     }
  2678.     else if (g_dm_data.s32flags & DM_SCROLL_TITLE)
  2679.     {
  2680.         draw_scrolling_title();
  2681.     }
  2682.     else
  2683.     {
  2684.         draw_title();
  2685.     }
  2686.     return 1;
  2687. }
  2688. /*****************************************************************************
  2689.  * FUNCTION
  2690.  *  dm_setup_and_draw_horizontal_tab_bar
  2691.  * DESCRIPTION
  2692.  *  This function is used setup the horizontal tab bar based on the coordinate set and
  2693.  *  then draw it
  2694.  * PARAMETERS
  2695.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2696.  *  *(?)
  2697.  * RETURNS
  2698.  *  void
  2699.  *****************************************************************************/
  2700. S32 dm_setup_and_draw_horizontal_tab_bar(S16 **UICtrlAccessPtr_p)
  2701. {
  2702.     /*----------------------------------------------------------------*/
  2703.     /* Local Variables                                                */
  2704.     /*----------------------------------------------------------------*/
  2705.     dm_coordinates dm_htab_info;
  2706.     /*----------------------------------------------------------------*/
  2707.     /* Code Body                                                      */
  2708.     /*----------------------------------------------------------------*/
  2709.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_htab_info);
  2710.     if (g_dm_cntx.redraw_screen_main != REDRAW_2_REDRAW)
  2711.     {
  2712.         wgui_move_horizontal_tab_bar(dm_htab_info.s16X, dm_htab_info.s16Y);
  2713.         move_title(dm_htab_info.s16X, dm_htab_info.s16Y + MMI_HORIZONTAL_TAB_BAR_TAB_AREA_HEIGHT);
  2714.         resize_title(dm_htab_info.s16Width, MMI_HORIZONTAL_TAB_BAR_HINT_AREA_HEIGHT);
  2715.     }
  2716.     wgui_show_horizontal_tab_bar();
  2717.     return 1;
  2718. }
  2719. /*****************************************************************************
  2720.  * FUNCTION
  2721.  *  dm_setup_and_draw_category_controlled_area
  2722.  * DESCRIPTION
  2723.  *  This function is used setup the category controlled area based on the coordinate set and
  2724.  *  then draw it
  2725.  * PARAMETERS
  2726.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2727.  *  *(?)
  2728.  * RETURNS
  2729.  *  void
  2730.  *****************************************************************************/
  2731. S32 dm_setup_and_draw_category_controlled_area(S16 **UICtrlAccessPtr_p)
  2732. {
  2733.     /*----------------------------------------------------------------*/
  2734.     /* Local Variables                                                */
  2735.     /*----------------------------------------------------------------*/
  2736.     dm_coordinates dm_category_controlled_area_info;
  2737.     /*----------------------------------------------------------------*/
  2738.     /* Code Body                                                      */
  2739.     /*----------------------------------------------------------------*/
  2740.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_category_controlled_area_info);
  2741.     if (dm_category_controlled_area_info.s16X == -1 || dm_category_controlled_area_info.s16Y == -1 ||
  2742.         dm_category_controlled_area_info.s16Width == -1 || dm_category_controlled_area_info.s16Height == -1)
  2743.     {
  2744.         return 0;
  2745.     }
  2746. #ifdef __MMI_SUBLCD__
  2747.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  2748.     {
  2749.         if (dm_sub_category_controlled_area_callback)
  2750.         {
  2751.             (*dm_sub_category_controlled_area_callback) (&dm_category_controlled_area_info);
  2752.         }
  2753.     }
  2754.     else
  2755. #endif /* __MMI_SUBLCD__ */ 
  2756.     {
  2757.         if (dm_category_controlled_area_callback)
  2758.         {
  2759.             (*dm_category_controlled_area_callback) (&dm_category_controlled_area_info);
  2760.         }
  2761.     }
  2762.     setup_previous_control(&dm_category_controlled_area_info);
  2763.     return 1;
  2764. }
  2765. /*****************************************************************************
  2766.  * FUNCTION
  2767.  *  dm_setup_and_draw_category_controlled_area2
  2768.  * DESCRIPTION
  2769.  *  This function is used setup the category controlled area2 based on the coordinate set and
  2770.  *  then draw it
  2771.  * PARAMETERS
  2772.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2773.  *  *(?)
  2774.  * RETURNS
  2775.  *  void
  2776.  *****************************************************************************/
  2777. S32 dm_setup_and_draw_category_controlled_area2(S16 **UICtrlAccessPtr_p)
  2778. {
  2779.     /*----------------------------------------------------------------*/
  2780.     /* Local Variables                                                */
  2781.     /*----------------------------------------------------------------*/
  2782.     dm_coordinates dm_category_controlled_area_info;
  2783.     /*----------------------------------------------------------------*/
  2784.     /* Code Body                                                      */
  2785.     /*----------------------------------------------------------------*/
  2786.     *UICtrlAccessPtr_p = dm_get_coordinates(*UICtrlAccessPtr_p, &dm_category_controlled_area_info);
  2787.     if (dm_category_controlled_area_info.s16X == -1 || dm_category_controlled_area_info.s16Y == -1 ||
  2788.         dm_category_controlled_area_info.s16Width == -1 || dm_category_controlled_area_info.s16Height == -1)
  2789.     {
  2790.         return 0;
  2791.     }
  2792.     if (dm_category_controlled_area2_callback)
  2793.     {
  2794.         (*dm_category_controlled_area2_callback) (&dm_category_controlled_area_info);
  2795.     }
  2796.     setup_previous_control(&dm_category_controlled_area_info);
  2797.     return 1;
  2798. }
  2799. /*****************************************************************************
  2800.  * FUNCTION
  2801.  *  dm_setup_and_draw_status_icons
  2802.  * DESCRIPTION
  2803.  *  This function is used setup the status icons based on the coordinate set and
  2804.  *  then draw it
  2805.  * PARAMETERS
  2806.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2807.  *  *(?)
  2808.  * RETURNS
  2809.  *  void
  2810.  *****************************************************************************/
  2811. S32 dm_setup_and_draw_status_icons(S16 **UICtrlAccessPtr_p)
  2812. {
  2813.     /*----------------------------------------------------------------*/
  2814.     /* Local Variables                                                */
  2815.     /*----------------------------------------------------------------*/
  2816.     dm_status_info_struct dm_status_info;
  2817.     /*----------------------------------------------------------------*/
  2818.     /* Code Body                                                      */
  2819.     /*----------------------------------------------------------------*/
  2820.     *UICtrlAccessPtr_p = dm_get_status_icon_bar_coordinates(*UICtrlAccessPtr_p, &dm_status_info);
  2821.     if (dm_status_info.x == -1 || dm_status_info.y == -1 ||
  2822.         dm_status_info.x1 == -1 || dm_status_info.y1 == -1 || dm_status_info.x2 == -1 || dm_status_info.y2 == -1)
  2823.     {
  2824.         return 0;
  2825.     }
  2826.     if ((g_dm_data.s32flags & DM_NO_STATUS_BAR))
  2827.     {
  2828.         return 0;
  2829.     }
  2830. #ifdef __MMI_SUBLCD__
  2831.     if (g_dm_data.s32flags & DM_SUB_LCD_CONTEXT)
  2832.     {
  2833.         SUBLCD_screens_show_status_icons();
  2834.     }
  2835.     else
  2836. #endif /* __MMI_SUBLCD__ */ 
  2837.     {
  2838.     #if defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__)       /* 041205 Calvin modieid */
  2839.         if ((g_dm_data.s32flags & DM_SPECIFIC_HIDE_STATUS_BAR))
  2840.         {
  2841.             show_status_icons();
  2842.         }
  2843.         else
  2844.         {
  2845.             show_title_status_icon();
  2846.         }
  2847.     #else /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  2848.         show_status_icons();
  2849.     #endif /* defined(__MMI_MAINLCD_176X220__) || defined (__MMI_MAINLCD_240X320__) */ 
  2850.     }
  2851.     return 1;
  2852. }
  2853. /*****************************************************************************
  2854.  * FUNCTION
  2855.  *  dm_setup_and_draw_button_bar
  2856.  * DESCRIPTION
  2857.  *  This function is used setup the button bar based on the coordinate set and
  2858.  *  then draw it
  2859.  * PARAMETERS
  2860.  *  UICtrlAccessPtr_p       [IN/OUT]        It specifies the start position to take out the coordinates.
  2861.  *  *(?)
  2862.  * RETURNS
  2863.  *  void
  2864.  *****************************************************************************/
  2865. S32 dm_setup_and_draw_button_bar(S16 **UICtrlAccessPtr_p)
  2866. {
  2867.     /*----------------------------------------------------------------*/
  2868.     /* Local Variables                                                */
  2869.     /*----------------------------------------------------------------*/
  2870.     dm_buttonbar_info_struct dm_buttonbar_info;
  2871.     /*----------------------------------------------------------------*/
  2872.     /* Code Body                                                      */
  2873.     /*----------------------------------------------------------------*/
  2874.     *UICtrlAccessPtr_p = dm_get_button_bar_coordinates(*UICtrlAccessPtr_p, &dm_buttonbar_info);
  2875.     if (dm_buttonbar_info.coordinate.s16X == -1 || dm_buttonbar_info.coordinate.s16Y == -1 ||
  2876.         dm_buttonbar_info.coordinate.s16Width == -1 || dm_buttonbar_info.coordinate.s16Height == -1 ||
  2877.         dm_buttonbar_info.button_width == -1)
  2878.     {
  2879.         return 0;
  2880.     }
  2881.     if (g_dm_data.s32flags & DM_NO_SOFTKEY)
  2882.     {
  2883.         return 0;
  2884.     }
  2885.     if (g_dm_cntx.redraw_screen_main == REDRAW_2_REDRAW)