⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 widget_paint.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
        case WIDGET_PAINTBOX_TYPE:
            /*
             * Note that we do not clear background since that text is drawn with HDIa_widgetDrawXXX
             * * If returned from another MMI screen, widget_paintbox_redraw() in wap_entry_widget_screen
             */
            WIDGET_LOG("Paint paintbox");
            WGUI_CTX->in_form = 0;
            /*
             * We need to disable source key before browsing the page, 
             * or the text will be transparent (can't be watched)
             */
            gdi_layer_set_source_key(FALSE, GDI_COLOR_TRANSPARENT);
            break;
        case WIDGET_FORM_TYPE:
            WIDGET_LOG("Paint form");
            widget_clear(&WGUI_CTX->display_size, &WGUI_CTX->display_pos);
    #ifdef WIDGET_SLIDING_SMIL_SUPPORT
            {
                widget_sliding_info_struct *sliding_info = _FORM(handle)->sliding_info;

                if (sliding_info)
                {
                    if (sliding_info->restore_scroll_offset_before_paint)
                    {
                        pos->y = WGUI_CTX->current_pos.y = sliding_info->scroll_offset_backup;
                        sliding_info->restore_scroll_offset_before_paint = 0;
                        sliding_info->scroll_offset_backup = 0;
                    }

                    if (sliding_info->first_paint_in_SMIL)
                    {
                        /*
                         * Issue: MMS_contents(image+text) display abnormal when press down key [215786]
                         *
                         * MMS need to check when to set HDIa_widgetHandleMsfEvt()
                         * the acceptable user events aren't correct in some situations.
                         * Here is the temp solution.
                         */
                        widget_enqueue_keypad_event(KEY_UP_ARROW, KEY_EVENT_UP);
                        sliding_info->first_paint_in_SMIL = 0;
                    }
                }
            }
    #endif /* WIDGET_SLIDING_SMIL_SUPPORT */ 
            /*
             * We need to disable source key in play MMS SMIL because if the
             * number in MMS, applications can foucus them
             */
            gdi_layer_set_source_key(FALSE, GDI_COLOR_TRANSPARENT);

            widget_paint_form(_FORM(handle), size, pos);
            break;
        case WIDGET_EDITOR_TYPE:
            /* Enter another MMI screen, unnecessary to clear screen */
            WIDGET_LOG("Paint editor");
        #ifdef __MMI_WALLPAPER_ON_BOTTOM__
            widget_paint_wallpaper();
        #endif 
            widget_paint_editor(_EDITOR(handle), size, pos);
            break;
        case WIDGET_DIALOG_TYPE:
            /* Do not clear screen to retain the previous display content unless status icons are displayed */
            WIDGET_LOG("Paint dialog");
            if (_W(handle)->property_mask & MSF_WINDOW_PROPERTY_EXT_STATUS_ICON)
            {
                clear_screen();
            }
            else if (_DIALOG(handle)->dialog_type == MsfPrompt &&
                     (WEDITOR_CTX->current_state == FULLSCREEN_EDITOR_RETURN_DONE ||
                      WEDITOR_CTX->current_state == FULLSCREEN_EDITOR_RETURN_CANCEL))
            {
                /* Back to MsfDialog and send the action event */
                break;
            }
            else    /* if (_DIALOG(handle)->dialog_type == MsfConfirmation) */
            {
                /* Reference: RedrawCategory164Screen */
                WGUI_CTX->last_screen_is_dialog = 1;
                gui_push_clip();
                gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
                gui_greyscale_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, MMI_BG_GREYSCALE_VALUE, MMI_BG_GREYSCALE_BLACK_VALUE); /* 102605 greyscale Calvin modified */
                gui_pop_clip();
            #ifdef WIDGET_RESIDENT_STATUS_ICON
                /* Otherwise, animated status icons will redraw status icon pane again */
                if (!WGUI_CTX->dialog_with_hatch_background)
                {
                    WGUI_CTX->dialog_with_hatch_background = 1;
                    close_title_status_icon();
                }
            #endif /* WIDGET_RESIDENT_STATUS_ICON */ 
            }
            widget_paint_dialog(_DIALOG(handle), size, pos);
            break;
        case WIDGET_MENU_TYPE:
            WIDGET_LOG("Paint menu");
        #ifdef __MMI_WALLPAPER_ON_BOTTOM__
            widget_paint_wallpaper();
        #endif 
            widget_clear(&WGUI_CTX->default_display_size, &WGUI_CTX->display_pos);
            widget_paint_menu(_M(handle), size, pos);
            is_draw_child = 0;
            break;
        case WIDGET_CTK_TYPE:
            /* Enter another MMI screen , unnecessary to clear screen */
            WIDGET_LOG("Paint CTK");
            gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
            widget_paint_ctk(_CTK(handle));
            break;
        case WIDGET_GADGET_IMAGE_TYPE:
            widget_paint_gadget_image(_GIMG(handle), size, pos);
            is_draw_child = 0;
            break;
        case WIDGET_GADGET_SELECT_GROUP_TYPE:
            widget_paint_menu(_M(handle), size, pos);
            is_draw_child = 0;
            break;
        case WIDGET_GADGET_BAR_TYPE:
            /*
             * In direct_paint_mode, delay the painting of scrollbar to widget_paint_outside_look 
             */
            widget_paint_gadget_bar(_GBAR(handle), size, pos, WGUI_CTX->in_paintbox ? KAL_FALSE : KAL_TRUE);
            is_draw_child = 0;
            break;
        case WIDGET_GADGET_STRING_TYPE:
            widget_paint_gadget_string(_GSTR(handle), size, pos);
            is_draw_child = 0;
            break;
        case WIDGET_GADGET_INPUT_TYPE:
            widget_paint_gadget_input(_GINP(handle), size, pos);
            is_draw_child = 0;
            break;
    }

    /* widget_paint_editor, widget_paint_ctk, ... might leave widget screen */
    if (WGUI_CTX->is_widget_screen)
    {
        /* Paint softkeys */
        if (IS_SCREEN_TYPE(handle) || (_H(handle)->flag & WIDGET_FLAG_WINDOW))  // TODO: should not include gadget
            if (_W(handle)->total_action_mask)
            {
                widget_paint_action(handle);
            }

        /* Draw childs */
        if (is_draw_child)
        {
            widget_header_struct *node;

            if (IS_SCREEN_TYPE(handle)) /* currently, one screen only show one window */
            {
                widget_get_active_childs(node, handle);
                WGUI_CTX->current_screen = _SCREEN(handle);
                if (node)
                {
                    if (WGUI_CTX->current_window != _W(node))
                    {
                        WGUI_CTX->current_window = _W(node);
                        *pos = WGUI_CTX->current_pos = WGUI_CTX->display_pos;
                        *size = WGUI_CTX->display_size;
                        WGUI_CTX->in_form = 1;
                    }
                }
                else    /* no windows in this screen */
                {
                    /* Should not happen. Already checked in widget_paint_hdlr() */
                    WAP_DBG_ASSERT(0);
                }
                /* When painting the screen, we reset last_screen_is_dialog to 0 */
                WGUI_CTX->last_screen_is_dialog = 0;

                widget_paint_object(node, size, pos);
            }
            else
            {
                foreach_childs(handle, node,
                               {
                               if (!IS_FLAG_STATIC(node)
                                   && (node->flag & WIDGET_FLAG_WINDOW)) widget_paint_object(node, size, pos);}
                );
            }
        }
    }
    paint_level--;
}


/*****************************************************************************
 * FUNCTION
 *  widget_paint_scrollbar
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void widget_paint_scrollbar(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* In direct paint mode, we need to paint the scrollbar after something is drawed on the paintbox */

    if (WGUI_CTX->in_paintbox)
    {
        MsfSize size;
        MsfPosition pos;

        size = WGUI_CTX->display_size;
        pos = WGUI_CTX->display_pos;

        if (WGUI_CTX->current_vertical_scrollbar)
        {
            widget_paint_gadget_bar(WGUI_CTX->current_vertical_scrollbar, &size, &pos, KAL_TRUE);
        }

        size = WGUI_CTX->display_size;
        pos = WGUI_CTX->display_pos;

        if (WGUI_CTX->current_horizontal_scrollbar)
        {
            widget_paint_gadget_bar(WGUI_CTX->current_horizontal_scrollbar, &size, &pos, KAL_TRUE);
        }
    }

}


/*****************************************************************************
 * FUNCTION
 *  widget_get_title_icon
 * DESCRIPTION
 *  
 * PARAMETERS
 *  imageid     [IN]        
 * RETURNS
 *  
 *****************************************************************************/
ctk_image_id widget_get_title_icon(ctk_image_id imageid)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (imageid != 0)
    {
        return imageid;
    }

#ifdef MMS_SUPPORT
    if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_SOUND_IND && widget_is_current_window_type(WIDGET_FORM_TYPE))
    {
        imageid = MEA_IMG_TITLE_RING;
    }
#ifdef __UNIFIED_MSG_SUPPORT__
    /*
     * Because MSF_MODID_MEA is always running in unified message supported,
     *  we change the condition to check the current active application.
     */
    else if (!MSF_moduleIsRunning(MSF_MODID_BRS) && WGUI_CTX->MMS_screen_is_active)
#else
    else if (MSF_moduleIsRunning(MSF_MODID_MEA) || WGUI_CTX->MMS_screen_is_active)      /* else if (WGUI_CTX->MMS_screen_is_active) */
#endif
    {
        imageid = MEA_IMG_TITLE_NORMAL;
    }
    else
#endif /* MMS_SUPPORT */ 
    {
        if (WGUI_CTX->in_paintbox)
        {
            imageid = 0;    /* Default no icon. If it is connecting, widget will draw animation */
        }
        else
        {
            imageid = WAP_IMAGE_WAP_LOGO;
        }

        switch (WGUI_CTX->bearer_type)
        {
            case WIDGET_CSD:
                if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_BUSY)
                {
                    imageid = WAP_IMAGE_CSD_CONNECTING; /* animation on title icon */
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_CSD)
                {
                    imageid = WAP_IMAGE_CSD_CONNECTED;
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_DISCONNECT)
                {
                    imageid = WAP_IMAGE_CSD_DISCONNECT;
                }
                break;
            case WIDGET_GPRS:
                if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_BUSY)
                {
                    imageid = WAP_IMAGE_GPRS_CONNECTING;    /* animation on title icon */
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_GPRS)
                {
                    imageid = WAP_IMAGE_GPRS_CONNECTED;
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_DISCONNECT)
                {
                    imageid = WAP_IMAGE_GPRS_DISCONNECT;
                }
                break;
        #ifdef __WIFI_SUPPORT__
            case WIDGET_WIFI:
                if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_BUSY)
                {
                    imageid = WAP_IMAGE_WIFI_CONNECTING;    /* animation on title icon */
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_WIFI)
                {
                    imageid = WAP_IMAGE_WIFI_CONNECTED;
                }
                else if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_DISCONNECT)
                {
                    imageid = WAP_IMAGE_WIFI_DISCONNECT;
                }
                break;
        #endif /* __WIFI_SUPPORT__ */
        }
    }

    return imageid;
}


/*****************************************************************************
 * FUNCTION
 *  widget_setup_security_icon
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void widget_setup_security_icon(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (WGUI_CTX->status_bar_flags & WIDGET_STATUS_BAR_SECURITY)
    {
        MMI_title_icon2 = get_image(WAP_IMAGE_SECURITY);
    }
    else
    {
        MMI_title_icon2 = NULL;
    }
}


/*****************************************************************************
 * FUNCTION
 *  widget_reset_security_icon
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void widget_reset_security_icon(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_title_icon2 = NULL;
}

static const UI_filled_area widget_title_count_down_filler =
    {UI_FILLED_AREA_TYPE_CROSS_HATCH_COLOR | UI_FILLED_AREA_SINGLE_BORDER | UI_FILLED_AREA_ROUNDED_BORDER,
    NULL,
    NULL,
    {120, 120, 120, 100},
    {0, 0, 0, 0},
    {100, 100, 100, 100},
    {0, 0, 0, 0},
    0
};

#ifdef WIDGET_SMIL_SLIDING_BAR


/*****************************************************************************
 * FUNCTION
 *  widget_paint_smil_sliding_bar
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void widget_paint_smil_sliding_bar(void)
{
    /*----------------------------------------------------------------*/
    /* Local Vari

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -