?? guinavigation.cpp.svn-base
字號:
for (i = 0; i < m_osdPages[m_activePageId]->nbBitmaps; i++) { if (m_osdPages[m_activePageId]->bitmaps[i]->object.visible && (m_osdPages[m_activePageId]->bitmaps[i]->object.zIndex < zIndex)) { l2 = m_osdPages[m_activePageId]->bitmaps[i]->object.x; t2 = m_osdPages[m_activePageId]->bitmaps[i]->object.y; status = gfxGetBitmapDimensions(m_pRua, &m_osdPages[m_activePageId]->bitmaps[i]->object, &bmpwidth, &bmpheight); if (RMFAILED(status)) continue; r2 = l2 + bmpwidth; b2 = t2 + bmpheight; if (CheckRectsIntersect(l1, t1, r1, b1, l2, t2, r2, b2)) { RMMemcpy(&bitmaps[nbitmaps], &(m_osdPages[m_activePageId]->bitmaps[i]->object), sizeof(m_osdPages[m_activePageId]->bitmaps[i]->object)); nbitmaps++; } } } return gfxUpdateButton(m_pRua, &m_osdPages[m_activePageId]->object, bitmaps, nbitmaps, &m_osdPages[m_activePageId]->buttons[buttonIndex]->object);}RMstatus RMcuracaoGuiNavigation::DisplaySubMenuButton(RMuint8 menuIndex, RMuint8 menuItemId, RMuint8 buttonIndex){ if (buttonIndex > MAX_GUI_BUTTONS) return RM_ERROR; return gfxDrawButton(m_pRua, &m_osdPages[m_activePageId]->menus[menuIndex]->items[menuItemId]->buttons[buttonIndex]->object);}RMstatus RMcuracaoGuiNavigation::DisplayMenu(RMuint8 menuIndex, RMbool redraw, RMbool hasfocus){ RMMenuItemObject items[MAX_GUI_MENUITEMS]; RMstatus status; RMuint8 i; if (menuIndex > MAX_GUI_MENUS) return RM_ERROR; // pack menuitem drawing objects for (i = 0; i < m_osdPages[m_activePageId]->menus[menuIndex]->nbItems; i++) { RMMemcpy(&items[i], &m_osdPages[m_activePageId]->menus[menuIndex]->items[i]->object, sizeof(RMMenuItemObject)); } m_osdPages[m_activePageId]->menus[menuIndex]->object.hasfocus = hasfocus; m_osdPages[m_activePageId]->menus[menuIndex]->object.redraw = redraw; m_osdPages[m_activePageId]->menus[menuIndex]->object.visible = TRUE; status = gfxDrawMenu(m_pRua, &m_osdPages[m_activePageId]->menus[menuIndex]->object, items, m_osdPages[m_activePageId]->menus[menuIndex]->nbItems); m_activeMenuId = m_osdPages[m_activePageId]->menus[menuIndex]->id; //!!!!![RC] mark other menus in the page not visible to avoid repaint when removing popup // NEED TO CHANGE for (i = 0; i < m_osdPages[m_activePageId]->nbMenus; i++) { m_osdPages[m_activePageId]->menus[i]->object.visible = (i == menuIndex); } return status;}RMstatus RMcuracaoGuiNavigation::MorphLists(RMuint8 listindex, RMuint8 listindexto){ if (listindex > MAX_GUI_LISTS || listindexto > MAX_GUI_LISTS) return RM_ERROR; m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE); if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_STRING && m_osdPages[m_activePageId]->lists[listindexto]->type == LISTTYPE_STRING) return MorphStringList(listindex, TRUE, TRUE); if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_LIST) return MorphListList(listindex, listindexto, TRUE); if (m_osdPages[m_activePageId]->lists[listindexto]->type == LISTTYPE_LIST) return MorphListList(listindexto, listindex, FALSE); return RM_OK;}RMstatus RMcuracaoGuiNavigation::DisplayOSDList(RMbool show){ if(show) gfxDrawOSDMenu(m_pRua, &m_tvList); else gfxBlankRect(m_pRua, 400, 40, 250, 400); return RM_OK;}RMstatus RMcuracaoGuiNavigation::DisplayList(RMuint8 listindex, RMbool redraw, RMbool hasFocus){ if (listindex > MAX_GUI_LISTS) return RM_ERROR; if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_FILE) return DisplayFileList(listindex, redraw, hasFocus); if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_BILLING) return DisplayBillingList(listindex, redraw, hasFocus); if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_STRING) if (m_osdPages[m_activePageId]->lists[listindex]->object.hasInfo) return DisplayInfoList(listindex, redraw, hasFocus); else return DisplayStringList(listindex, redraw, hasFocus); if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_LIST) return DisplayListList(listindex, redraw, hasFocus); if (m_selectedObjectId & POPUP_IDMASK) { RMuint16 index; RMstatus status; status = GetObjectIndex(m_selectedObjectId, &index); if (RMFAILED(status)) return status; if (m_Popups[index]->lists[listindex]->type == LISTTYPE_STRING) return DisplayStringList(listindex, redraw, hasFocus); } return RM_ERROR;}RMstatus RMcuracaoGuiNavigation::DisplayPopupList(RMuint8 popupindex, RMuint8 listindex, RMbool redraw, RMbool hasFocus){ if (listindex > MAX_GUI_LISTS) return RM_ERROR; if (m_Popups[popupindex]->lists[listindex]->type == LISTTYPE_STRING) return DisplayPopupStringList(popupindex, listindex, redraw, hasFocus); return RM_ERROR;}RMstatus RMcuracaoGuiNavigation::DisplayFileList(RMuint8 listIndex, RMbool redraw, RMbool hasFocus){ RMuint32 count = 0; RMguiFileType ftype; RMuint32 i; if (listIndex > MAX_GUI_LISTS) return RM_ERROR; if (m_isoReset == TRUE) { if (m_isoData.isoStructure != 0) { // Allocate list -- gets cleared as well if previously allocated if (RMFAILED(AllocateIsoList(m_isoData.numItems))) { m_isoReset = FALSE; return RM_ERROR; } for (i = 0; i < m_isoData.numItems; i++) { if (m_isoData.isoStructure[i].isDirectory) { m_isoList.isoDataIndex[count] = i; m_isoList.fileType[count] = FILETYPE_DIRECTORY; } else { ftype = GetFileType(m_isoData.isoStructure[i].name); if ((ftype & m_isoList.displayfileType) == 0) continue; m_isoList.isoDataIndex[count] = i; m_isoList.fileType[count] = ftype; } count++; } } // get from gfx how many items we can display per page m_isoList.numitemsPerPage = gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object); if (!m_isoList.numitemsPerPage) return RM_ERROR;#ifdef GUI_REFID_2 if(m_gui->gui->GetPlayerMode() == PLAYER_MODE_PCLINK || m_gui->gui->GetPlayerMode() == PLAYER_MODE_MEDIA_CONNECT) { m_isoList.hasGoUp = (RMCompareAscii(m_isoData.directory, "") ? FALSE : TRUE); } else#endif m_isoList.hasGoUp = (RMCompareAscii(m_isoData.directory, MOUNT_POINT) ? FALSE : TRUE); if (m_isoList.hasGoUp) count += 1; m_isoList.numItems = count; m_isoList.numCurrentPage = 0; m_isoList.numPages = count / m_isoList.numitemsPerPage + (count % m_isoList.numitemsPerPage ? 1 : 0); // mark iso structure as already read m_isoReset = FALSE; } // display current page return DisplayFileListPage(listIndex, m_isoList.numCurrentPage, redraw, hasFocus);}RMstatus RMcuracaoGuiNavigation::DisplayFileListPage(RMuint8 listIndex, RMuint16 listPage, RMbool redraw, RMbool hasFocus){ // RMstatus status; // RMListItemObject *items[MAX_GUI_LISTITEMS]; // RMuint16 i; // RMuint32 isodataindex; // RMuint32 nbItems = 0; // RMuint32 firstitem=0, lastitem=0, totalitems=0; // // RMMemset(items, 0, sizeof(items)); // // // copy page to draw // firstitem = m_isoList.numCurrentPage;// * m_isoList.numitemsPerPage; // totalitems = ((RMuint32)(m_isoList.numCurrentPage + m_isoList.numitemsPerPage) <= (RMuint32) (m_isoList.numItems - 1) ? m_isoList.numitemsPerPage : m_isoList.numItems - m_isoList.numCurrentPage); // // if(m_isoList.hasGoUp){ // if(m_isoList.numCurrentPage == 0){ // RMCopyAscii(items[nbItems]->text, GOUP_DIRECTORY); // // // save text info in list struct as well // RMCopyAscii(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.text, GOUP_DIRECTORY); // nbItems++; // totalitems -= 1; // } // else // firstitem -= 1; // } // else{ // if(m_isoList.numItems == 0) // totalitems = 0; // } // // lastitem = firstitem + totalitems; // for(i = firstitem; i < lastitem; i++){ // isodataindex = m_isoList.isoDataIndex[i]; // RMCopyAscii((RMascii*)(items[nbItems]->text), (const RMascii*)(m_isoData.isoStructure[isodataindex].name)); // items[nbItems].icon = 0; //GetIsoIconType(m_isoList.fileType[i])); // items[nbItems].state = STATE_ENABLED; // // // save text/icon info in list struct as well // RMCopyAscii((RMascii*)(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.text), (const RMascii*)(items[nbItems].text)); // // RMCopyAscii((RMascii*)(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.icon), (const RMascii*)(items[nbItems].icon)); // m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.state = items[nbItems].state; // nbItems++; // } // // m_osdPages[m_activePageId]->lists[listIndex]->nbItemsDisplayed = nbItems; // // // ARM-elf-gcc generate an error at compilation if redraw is directly affected to m_osdPages structure // // this is a work around, but we need to upgrade to arm-elf-gcc 2.95.3 to get rid of this hack // if(hasFocus) // m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = TRUE; // else // m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = FALSE; // // // idem // if(redraw) // m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = TRUE; // else // m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = FALSE; // // m_osdPages[m_activePageId]->lists[listIndex]->object.visible = TRUE; // //#ifdef GUI_REFID_2 // gfxSetCodePageConvertion(FALSE); // since non UTF-8 // status = gfxDrawList(m_pRua, // &(m_osdPages[m_activePageId]->object), // &(m_osdPages[m_activePageId]->lists[listIndex]->object), // items, // nbItems); // gfxSetCodePageConvertion(TRUE); //#else // status = gfxDrawList(m_pRua, // &(m_osdPages[m_activePageId]->object), // &(m_osdPages[m_activePageId]->lists[listIndex]->object), // items,nbItems, m_List.numItems); //#endif return RM_OK;}RMstatus RMcuracaoGuiNavigation::ScrollBillingList(RMuint8 listIndex, RMGuiObjectSelectDirection direction){ RMListItemObject *items[MAX_GUI_LISTITEMS]; // RMTextItemObject txitems[MAX_GUI_TEXTITEMS]; RMuint16 firstitem = 0, lastitem = 0, totalitems = 0; RMuint16 count; if (listIndex > MAX_GUI_LISTS) return RM_ERROR; m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE); m_List.numItems = m_osdPages[m_activePageId]->lists[listIndex]->nbItems; // get from gfx how many items we can display per page m_List.numitemsPerPage = m_osdPages[m_activePageId]->lists[listIndex]->object.numitemsPerPage;//gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object); if (m_List.numitemsPerPage == 0) return RM_ERROR; m_List.numPages = m_List.numItems / m_List.numitemsPerPage + (m_List.numItems % m_List.numitemsPerPage ? 1 : 0); // display current pagem_List.numItems = m_osdPages[pageID]->lists[listIndex]->nbItems; RMMemset(items, 0, sizeof(items)); // copy page to draw if (m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible == m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible) { if (m_List.numitemsPerPage > 1) { m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible = 1; firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible; totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage : m_List.numItems - firstitem + 1; m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible = firstitem + totalitems - 1; lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible; } } else { firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible; totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage : m_List.numItems - firstitem; // if(firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) // totalitems --; lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible; //totalitems = lastitem - firstitem; } count = 0; items[count++] = &m_osdPages[m_activePageId]->lists[listIndex]->items[0]->object; for (RMuint16 i = firstitem; i < lastitem; i++) { items[count] = &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object; count++; } items[count - 1] = &m_osdPages[m_activePageId]->lists[listIndex]->items[m_osdPages[m_activePageId]->lists[listIndex]->nbItems - 1]->object; m_osdPages[m_activePageId]->lists[listIndex]->nbItemsDisplayed = totalitems; //bacmause of the header // ARM-elf-gcc generate an error at compilation if redraw is directly affected to m_osdPages structure // this is a work around, but we need to upgrade to arm-elf-gcc 2.95.3 to get rid of this hack m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = TRUE; m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = TRUE; m_osdPages[m_activePageId]->lists[listIndex]->object.visible = TRUE; gfxScrolBillingList(m_pRua, &(m_osdPages[m_activePageId]->object), &(m_osdPages[m_activePageId]->lists[listIndex]->object), items, totalitems + 1, m_List.numItems, direction); m_gui->gui->SetTimer(TIMER_WAIT_ANIMATION, 120); return RM_OK;}RMstatus RMcuracaoGuiNavigation::ScrollList(RMuint8 listIndex, RMGuiObjectSelectDirection direction){ RMListItemObject *items[MAX_GUI_LISTITEMS]; //RMTextItemObject txitems[MAX_GUI_TEXTITEMS]; RMuint16 firstitem = 0, lastitem = 0, totalitems = 0; RMuint16 count; m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE); if (listIndex > MAX_GUI_LISTS) return RM_ERROR; m_List.numItems = m_osdPages[m_activePageId]->lists[listIndex]->nbItems; // get from gfx how many items we can display per page m_List.numitemsPerPage = m_osdPages[m_activePageId]->lists[listIndex]->object.numitemsPerPage;//gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object); if (m_List.numitemsPerPage == 0) return RM_ERROR; m_List.numPages = m_List.numItems / m_List.numitemsPerPage + (m_List.numItems % m_List.numitemsPerPage ? 1 : 0); // display current pagem_List.numItems = m_osdPages[pageID]->lists[listIndex]->nbItems; RMMemset(items, 0, sizeof(items)); // copy page to draw if (m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible == m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible) { m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible = 0; firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible; totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage - 1 : m_List.numItems - firstitem; m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible = firstitem + totalitems - 1; lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible; } else { firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible; if (direction == SELECT_DOWN) totalitems = ((firstitem + m_List.numitemsPerPage) < (RMuint16) m_List.numItems) ? (firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) ? m_List.numitemsPerPage : m_List.numitemsPerPage + 1 : m_List.numItems - firstitem; else totalitems = ((firstitem + m_List.numitemsPerPage) < (RMuint16) m_List.numItems) ? (firstitem + 1 == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) ? m_List.numitemsPerPage : m_List.numitemsPerPage + 1 : m_List.numItems - firstitem; // if(firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) // totalitems --; lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible; //totalitems = lastitem - firstitem; } count = 0; for (RMuint16 i = firstitem; i <= lastitem; i++) { //RMMemcpy(&items[count], &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object, sizeof(RMListItemObject)); items[count] = &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object;// if(items[count] && items[count]->lang)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -