RDA GUI

建立服務:「sysapp_table.h」 / "dvb_guiobj_table.h" / "atv_guiobj_table.h"數組

  「服務」與「回調」app

        

一、不一樣服務的「共享菜單」ide

  

二、切換到不一樣的服務,動態加載對應的UI:如「多媒體服務」工具

  

三、窗口「句柄」與「回調」管理:「app_guimgr.c」  ui

  先聲明句柄spa

  

  再關聯資源:3d

  

  注意枚舉與回調數組的對應關係:code

    如:DVB的窗口枚舉與 公共+DVB回調的對應blog

   

四、具體到某一個窗口的回調實例(主菜單窗口):資源

const GUI_Object_Definition_t stAPPGuiObjMainMenu =
{
    GUI_OBJ_CAN_BE_FOCUSED,
    GUI_OBJ_UPDATE_PERIOD * 10,  
    _APP_GUIOBJ_MainMenu_OnCreate,
    _APP_GUIOBJ_MainMenu_OnRelease,
    _APP_GUIOBJ_MainMenu_OnFocused,
    _APP_GUIOBJ_MainMenu_OnLoseFocus,
    _APP_GUIOBJ_MainMenu_OnTimerUpdate,
    _APP_GUIOBJ_MainMenu_OnEvent,
};

 

五、建立/顯示窗口的6個步驟:

  最經常使用的爲步驟三、4。

  步驟3:獲取部件句柄。    步驟4:動態設置部件參數

  

   刷新部件的兩種方式:

  

 

 六、主菜單繪製

  

/*主要參數*/
static MenuPage_Handle_t g_stMenuPage_Handle;            //主菜單窗口句柄
APP_Mainmenu_SubItemParam_t g_stMainMenuParam;            //標籤頁內容
APP_Mainmenu_SubItemParam_t g_stMenuParam;                //ListView內容
static INT32 g_arTextItemString[MAINMENU_MAX_ITEM+1][2];//ComboBox內容

// g_stMainMenuParam  對應
static APP_Mainmenu_SubItemEx_t g_stMainmenuItem_Ex[] =
{
    {TV_IDS_String_Channel,             MAIN_CHANNEL_ITEM,            FALSE},
    {TV_IDS_String_Picture,                MAIN_PICTURE_ITEM,            FALSE},
    {TV_IDS_String_Sound,                 MAIN_SOUND_ITEM,            FALSE},
    {TV_IDS_String_Time,                 MAIN_FEATURE_ITEM,            FALSE},
    {TV_IDS_String_Lock,                 MAIN_LOCK_ITEM,                FALSE},
    {TV_IDS_String_Option,                 MAIN_SETUP_ITEM,            FALSE},
    {TV_IDS_String_SCREEN,                 MAIN_SCREEN_ITEM,            FALSE},
};

// g_stMenuParam  對應
static APP_Mainmenu_SubItemEx_t g_stMainmenuItem_PictureEx[] =
{
    {TV_IDS_String_PictureMode,            PICTURE_MODE_ITEM,            FALSE},
    {TV_IDS_String_Contrast,             CONTRAST_ITEM,                FALSE},
    {TV_IDS_String_Brightness,             BRIGHTNESS_ITEM,            FALSE},
    {TV_IDS_String_Colour,                 COLOUR_ITEM,                FALSE},
    {TV_IDS_String_3D_Steup,             PICTURE_3D_SETUP_ITEM,        FALSE},
};

主菜單窗口類型定義:

/*Handle*/
typedef struct{
    HWND h_MainMenu_TitleBitmap[MAINMENU_PAGE_MAX];            //主菜單擡頭ICON
    HWND h_MainMenu_Icon_Handle;                            //標籤頁ICON
    HWND h_MainMenu_Title_Handle;                            //標籤頁title
    HWND h_MenuLayer_Listview_Handle;                        //ListView
    HWND h_MainMenu_TextItem_Handle[MAINMENU_MAX_ITEM];        //ComboBox
}MenuPage_Handle_t;

對應資源獲取窗口句柄:

void APP_GUIOBJ_MainMenu_SetHandle(void)
{
    INT32 i32Count = 0;

    GUI_FUNC_CALL(GEL_GetHandle(IDM_MainPage_control,TV_E_IDC_BTN_Button_MainPage_Title,&(g_stMenuPage_Handle.h_MainMenu_Title_Handle)));
    GUI_FUNC_CALL(GEL_GetHandle(IDM_MainPage_control,TV_E_IDC_BTN_Button_MainPage_LeftIcon,&(g_stMenuPage_Handle.h_MainMenu_Icon_Handle)));
    GUI_FUNC_CALL(GEL_GetHandle(IDM_MenuLayer_control,TV_E_IDC_LIST_ListView_MenuLayerText,&(g_stMenuPage_Handle.h_MenuLayer_Listview_Handle)));

    for (i32Count = 0; i32Count < MAINMENU_PAGE_MAX; i32Count++)    //MAINMENU_PAGE_MAX=6        TABLE
    {
        GUI_FUNC_CALL(GEL_GetHandle(IDM_MainPage_control,TV_E_IDC_BTN_Button_MainPage_Picture+i32Count,
            &(g_stMenuPage_Handle.h_MainMenu_TitleBitmap[i32Count])));
    }
    for (i32Count = 0; i32Count < MAINMENU_MAX_ITEM; i32Count++)    //MAINMENU_MAX_ITEM=13        ITEM
    {
        GUI_FUNC_CALL(GEL_GetHandle(IDM_MenuLayer_control,TV_E_IDC_COMBO_ComboBox_MenuLayer_Item0+i32Count,
            &(g_stMenuPage_Handle.h_MainMenu_TextItem_Handle[i32Count])));
    }
}

標籤頁內容獲取「g_stMainMenuParam」:

static void _APP_GUIOBJ_MainMenu_GetItemParam(void)
{
    UINT8 SupportDTV;
    UINT8 SupportATV;
    UINT16 i;
    UINT16 u16Count;
    al_uint32 Support_Input_Source_temp = 0;/*Clear item*/
    memset(&g_stMainMenuParam,0x0,sizeof(APP_Mainmenu_SubItemParam_t));for(i = 0;i < MAIN_MAX_ITEM;i ++)
    {
        u16Count = 0;
        for(i = 0;i < g_u16MainmenuItem_Size;i++)
        {
            if(g_stMainmenuItem_Ex[i].HideFlag)
            {
                continue;
            }
            g_stMainMenuParam.ItemListStr[u16Count] = g_stMainmenuItem_Ex[i].dStrID;
            g_stMainMenuParam.ItemType[u16Count] = g_stMainmenuItem_Ex[i].Type;
            u16Count ++;
        }
        g_stMainMenuParam.ItemListStr[u16Count] = STRING_LAST;
        g_stMainMenuParam.ItemTotalNum = u16Count;
    }
}

 ListView內容獲取g_stMenuParam

static void _APP_GUIOBJ_MainMenu_GetSubItemParam(MainMenuItem_t Item)
{
    UINT16 i = 0;
    UINT16 u16Count = 0;
    memset(&g_stMenuParam,0x0,sizeof(APP_Mainmenu_SubItemParam_t));
    for(i = 0;i<MAINMENU_TOTALITEM_MAX;i++)
    {
        g_stMenuParam.ItemListStr[i] = STRING_ID_INVALID;
        g_stMenuParam.ItemType[i] = 0;
    }
    g_stMenuParam.ItemListStr[MAINMENU_TOTALITEM_MAX] = STRING_LAST;
    g_stMenuParam.ItemType[MAINMENU_TOTALITEM_MAX] = 0;
    g_stMenuParam.ItemTotalNum = 0;
    switch(Item)
    {
        case MAIN_PICTURE_ITEM:
            u16Count = 0;
            for(i = 0;i<g_u16MainmenuItem_PictureEx_Size;i++)
            {
                if(g_stMainmenuItem_PictureEx[i].HideFlag)
                {
                    continue;
                }
                g_stMenuParam.ItemListStr[u16Count] = g_stMainmenuItem_PictureEx[i].dStrID;
                g_stMenuParam.ItemType[u16Count] = g_stMainmenuItem_PictureEx[i].Type;
                u16Count ++;
            }
            g_stMenuParam.ItemListStr[u16Count] = STRING_LAST;
            g_stMenuParam.ItemType[u16Count] = PICTURE_MAX_ITEM;
            g_stMenuParam.ItemTotalNum = u16Count;
            break;
        default:
            break;
    }
}

Layer層ComboBox內容獲取:

繪製PICTURE菜單:

void _APP_GUIOBJ_MainMenu_SetPicture(UINT8 u8PageNum)
{
    INT32 i32Count = 0;
    UINT32 enString_Id = 0;
    UINT32 u32PictureMode;
    UINT8 index = 0;
    bool u8DisableFlag = FALSE;
    APP_Video_ImageSharpnessAction_t ePictureSharpnessState;
    APP_Video_ImageTintAction_t ePictureTintState;
    APP_Video_ImageNRAction_t ePictureNRState;    
    Picture_Data_t stUIPictureData;

    /*清除菜單*/
    _APP_GUIOBJ_MainMenu_ClearSubItem();

    /*動態更改或隱藏ITEM*/
    _APP_GUIOBJ_MainMenu_InitSubItemParam(MAIN_PICTURE_ITEM);

    /*獲取ListView字串g_stMenuParam*/
    _APP_GUIOBJ_MainMenu_GetSubItemParam(MAIN_PICTURE_ITEM);

    /*重繪ListView*/
    GUI_FUNC_CALL(GEL_SetParam(g_stMenuPage_Handle.h_MenuLayer_Listview_Handle,PARAM_STATIC_STRING, g_stMenuParam.ItemListStr));

    for (i32Count = 0; i32Count < g_stMenuParam.ItemTotalNum; i32Count++)
    {
        index = i32Count%MAINMENU_MAX_ITEM;
        switch(g_stMenuParam.ItemType[i32Count])
        {
            case PICTURE_MODE_ITEM:
                APP_GUIOBJ_Picture_GetPictureMode(&u32PictureMode);
                g_arTextItemString[index][0] = u32PictureMode;
                g_arTextItemString[index][1] = STRING_LAST;
                /*重繪ComboBox*/
                GUI_FUNC_CALL(GEL_SetParam(g_stMenuPage_Handle.h_MainMenu_TextItem_Handle[index],PARAM_STATIC_STRING, &g_arTextItemString[index]));
                break;
            case BRIGHTNESS_ITEM:
                /*Set brightness*/
                sprintf(stUIPictureData.pBrightness[0],"%d",stUIPictureData.Brightness);
                GUI_FUNC_CALL(GEL_SetParam(g_stMenuPage_Handle.h_MainMenu_TextItem_Handle[index],
                    PARAM_DYNAMIC_STRING, stUIPictureData.pBrightness));
                break;
            default:
                break;
        }
    }

    APP_GUIOBJ_Picture_SetPictureData(&stUIPictureData);

    /*設置DISABLE狀態*/
    for (i32Count = 0; i32Count < g_stMenuParam.ItemTotalNum; i32Count++)
    {
        /*init disable state*/
        index = i32Count%MAINMENU_MAX_ITEM;
        APP_GUIOBJ_MainMenu_SwitchItemEnorDisable(u8PageNum,i32Count,TRUE);
        u8DisableFlag = FALSE;
        /*Get disabled item*/
        switch(g_stMenuParam.ItemType[i32Count])
        {
            case SHARPNESS_ITEM:
                APP_Video_CheckSharpnessState(&ePictureSharpnessState);
                g_ePictureSharpnessState = ePictureSharpnessState;
                if (ePictureSharpnessState == APP_VIDEO_IMAGE_SHARPNESS_DISABLED)
                {
                    u8DisableFlag = TRUE;
                }
                break;
                break;
            default:
                break;
        }
        if(u8DisableFlag)    /*Set diabled item as disable*/
        {
            APP_GUIOBJ_MainMenu_SwitchItemEnorDisable(u8PageNum,i32Count,FALSE);
        }
    }

}

七、增長/刪除窗口

  修改「application\radisson\mstar 」 對應UI 目錄 atv/dvb 下的makefile文件,如:「SRCS_LIST += app_guiobj_dtv_xxx.c」

  application\radisson\mstar\resources\menu  目錄下的  TV_IDM_xxx.c   TV_IDM_xxx.h,有時須要修改「menu.in」

  增長/刪除「application\radisson\mstar\UI_Project\TV_UIProject\Menus」 目錄下的 「uim」 文件,注意使用「uiDesign」工具處理

  增長對應窗口API   app_guiobj_dtv_xxx.c,以及修改Makefile

  app_menumgr.c   //銷燬資源

  sysapp_table.h 增長窗口回調

  新建窗口,完成功能示例以下:

  

 

八、經常使用API相關

  //刷新一個部件
    GUI_FUNC_CALL(GEL_RGNBUF_RenderControl(h_List_BinName));

  //刷新一組部件
    APP_GuiMgr_RegionBufferControl(hRegionBuf, u32RegionBufCnt);

  app_menumgr.c

  g_stUserInfoData.AutoInstalled

相關文章
相關標籤/搜索