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

📄 editorpen.c

📁 The font library converting tool MCT mainly introduces the process of the font formats to give us a
💻 C
📖 第 1 页 / 共 5 页
字号:
    }
    gdi_layer_unlock_frame_buffer();
    pixtel_UI_BLT_double_buffer(
        0,
        gPenEditorCandidateInputBox.y,
        UI_device_width - 1,
        gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1);
}   /* end of mmi_pen_editor_hide_candidate_area */


/*****************************************************************************
 * FUNCTION
 *  mmi_pen_editor_draw_arrow
 * DESCRIPTION
 *  
 * PARAMETERS
 *  arrow_direction     [IN]        
 *  arrow_state         [IN]        
 *  arrow_type          [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pen_editor_draw_arrow(
        mmi_pen_editor_arrow_direction_enum arrow_direction,
        mmi_pen_editor_arrow_state_enum arrow_state,
        mmi_pen_editor_arrow_type_enum arrow_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    color arrow_color;
    S32 x = 0, y = 0, width = 0, height = 0;
    S32 input_box_x = 0, input_box_width = 0, input_box_grid_width = 0;
    U8 direction = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (PEN_EDITOR_ARROW_FOR_CANDIDATE == arrow_type)
    {
        input_box_x = gPenEditorCandidateInputBox.x;
        input_box_width = gPenEditorCandidateInputBox.width;
        input_box_grid_width = gPenEditorCandidateInputBox.grid_width;
        y = gPenEditorCandidateInputBox.y + (gPenEditorCandidateInputBox.height >> 3) + 1;
        width = gPenEditorCandidateInputBox.grid_width >> 1;
        height = ((gPenEditorCandidateInputBox.height << 1) + gPenEditorCandidateInputBox.height) >> 2;
    }
    else if (PEN_EDITOR_ARROW_FOR_COMPOSITION == arrow_type)
    {
        input_box_x = g_pen_editor_composition_input_box.x;
        input_box_width = g_pen_editor_composition_input_box.width;
        input_box_grid_width = g_pen_editor_composition_input_box.grid_width;
        y = g_pen_editor_composition_input_box.y + (g_pen_editor_composition_input_box.height >> 3) + 1;
        width = g_pen_editor_composition_input_box.grid_width >> 1;
        height = ((g_pen_editor_composition_input_box.height << 1) + g_pen_editor_composition_input_box.height) >> 2;
    }
    if (PEN_EDITOR_ARROW_DISABLE == arrow_state)
    {
        arrow_color = pixtel_UI_color(200, 200, 200);
    }
    else
    {
        arrow_color = pixtel_UI_color(0, 102, 204);
    }

    if (PEN_EDITOR_ARROW_DIRECTION_RIGHT == arrow_direction)
    {
        x = input_box_x + input_box_width + (input_box_grid_width >> 2);
        direction = 1;
        if (PEN_EDITOR_ARROW_DISABLE == arrow_state || PEN_EDITOR_ARROW_PRESS_UP == arrow_state)
        {
        }
        else if (PEN_EDITOR_ARROW_PRESS_DOWN == arrow_state)
        {
            x++;
            y++;
        }
    }
    else if (PEN_EDITOR_ARROW_DIRECTION_LEFT == arrow_direction)
    {
        x = input_box_x - (((input_box_grid_width << 1) + input_box_grid_width) >> 2) - 2;
        direction = 0;
        if (PEN_EDITOR_ARROW_DISABLE == arrow_state || PEN_EDITOR_ARROW_PRESS_UP == arrow_state)
        {
        }
        else if (PEN_EDITOR_ARROW_PRESS_DOWN == arrow_state)
        {
            x--;
            y++;
        }
    }
    draw_resizeable_arrow(x, y, direction, arrow_color, width, height);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_pen_editor_candidate_is_able_to_next_page
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
MMI_BOOL mmi_pen_editor_candidate_is_able_to_next_page(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
    int num = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* W05.37 To Fix Candidates Lsit Issue Because of Font Type */
    gPenEditorCandidatePage++;
    num = mmi_ime_get_candidates_by_page(gPenEditorCandidatePage, candidate_buffer);
    if (!num)
    {
        gPenEditorCandidatePage--;
        return MMI_FALSE;
    }
    else
    {
        gPenEditorCandidatePage--;
        return MMI_TRUE;
    }
}   /* end of mmi_pen_editor_candidate_is_able_to_next_page */


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

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (gPenEditorCandidatePage)
    {
        return MMI_TRUE;
    }
    return MMI_FALSE;
}   /* end of mmi_pen_editor_candidate_is_able_to_prev_page */


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

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if ((g_pen_editor_composition_index < PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1) &&
        g_pen_editor_syllable_table[g_pen_editor_composition_index + 1][0] != '\0')
    {
        return MMI_TRUE;
    }
    else if (g_pen_editor_composition_index == PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1)
    {
        S32 num = 0;

        g_pen_editor_composition_index = 0;
        g_pen_editor_composition_page++;
        num = mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE);
        g_pen_editor_composition_index = PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
        g_pen_editor_composition_page--;
        if (num)
        {
            return MMI_TRUE;
        }
        else
        {
            return MMI_FALSE;
        }
    }
    else
    {
        return MMI_FALSE;
    }
}   /* end of mmi_pen_editor_composition_is_able_to_next */


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

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_pen_editor_composition_index || g_pen_editor_composition_page)
    {
        return MMI_TRUE;
    }
    else
    {
        return MMI_FALSE;
    }
}   /* end of mmi_pen_editor_composition_is_able_to_prev */


/*****************************************************************************
 * FUNCTION
 *  mmi_pen_editor_show_candidate_area
 * DESCRIPTION
 *  
 * PARAMETERS
 *  arrow_enable        [IN]        
 *  candiate_state      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pen_editor_show_candidate_area(MMI_BOOL arrow_enable, mmi_pen_editor_candidate_state_enum candiate_state)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_pen_editor_hide_candidate_area();
    if (PEN_EDITOR_CANDIDATE_ON_AND_FOCUS == candiate_state)
    {
        gPenEditorCandidateInputBox.flags &= ~UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
    }
    else if (PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS == candiate_state)
    {
        gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
    }

    gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP;
    gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
    gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_CHARACTER_HIGHLIGHT;

    if (!arrow_enable)
    {
        pixtel_UI_resize_single_line_input_box(
            &gPenEditorCandidateInputBox,
            gPenEditorCandidateInputBox.grid_width * PEN_EDITOR_CANDIDATE_SIZE,
            gPenEditorCandidateInputBox.height);
        pixtel_UI_move_single_line_input_box(
            &gPenEditorCandidateInputBox,
            MMI_multitap_x,
            gPenEditorCandidateInputBox.y);
        g_pen_editor_candidate_state.arrow_enable = MMI_FALSE;
        g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
        g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
    }
    else
    {
        g_pen_editor_candidate_state.arrow_enable = MMI_TRUE;
        g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_DISABLE;
        g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_DISABLE;
        if (mmi_pen_editor_candidate_is_able_to_next_page() &&
            !(UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW & gPenEditorCandidateInputBox.flags))
        {
            g_pen_editor_candidate_state.right_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
        }
        if (mmi_pen_editor_candidate_is_able_to_prev_page() &&
            !(UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW & gPenEditorCandidateInputBox.flags))
        {
            g_pen_editor_candidate_state.left_arrow_state = PEN_EDITOR_ARROW_PRESS_UP;
        }
        pixtel_UI_resize_single_line_input_box(
            &gPenEditorCandidateInputBox,
            gPenEditorCandidateInputBox.grid_width * PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS,
            gPenEditorCandidateInputBox.height);
        pixtel_UI_move_single_line_input_box(
            &gPenEditorCandidateInputBox,
            MMI_multitap_x + gPenEditorCandidateInputBox.grid_width,
            gPenEditorCandidateInputBox.y);
        mmi_pen_editor_draw_arrow(
            PEN_EDITOR_ARROW_DIRECTION_RIGHT,
            g_pen_editor_candidate_state.right_arrow_state,
            PEN_EDITOR_ARROW_FOR_CANDIDATE);
        mmi_pen_editor_draw_arrow(
            PEN_EDITOR_ARROW_DIRECTION_LEFT,
            g_pen_editor_candidate_state.left_arrow_state,
            PEN_EDITOR_ARROW_FOR_CANDIDATE);
    }
    pixtel_UI_show_single_line_input_box(&gPenEditorCandidateInputBox);
}   /* end of mmi_pen_editor_show_candidate_area */


/*****************************************************************************
 * FUNCTION
 *  mmi_pen_editor_hide_composition_area
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_pen_editor_hide_composition_area(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    color c;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    c.r = 255;
    c.g = 255;
    c.b = 255;
    c.alpha = 100;

    pixtel_UI_reset_clip();
    gdi_layer_lock_frame_buffer();
    if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
    {
        gdi_draw_solid_rect(
            0,
            g_pen_editor_composition_input_box.y,
            UI_device_width,
            g_pen_editor_composition_input_box.y + g_pen_editor_composition_input_box.height - 1,
            GDI_COLOR_TRANSPARENT);
    }
    else
    {
        pixtel_UI_fill_rectangle(
            0,
            g_pen_editor_composition_input_box.y,
            UI_device_width,
            g_pen_editor_composition_input_box.y + g_pen_editor_composition_input_box.height - 1,
            c);
    }
   

⌨️ 快捷键说明

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