| 1 | #include "DST_Window.h" |
|---|
| 2 | #include "DST_WinManager.h" |
|---|
| 3 | #include "DST_CommonAPI.h" |
|---|
| 4 | #include "DST_UserInterface.h" |
|---|
| 5 | #include "DST_DataStrings.h" |
|---|
| 6 | #include "DST_ISDBT_ChannelTask.h" |
|---|
| 7 | #include "DST_DB.h" |
|---|
| 8 | #include "DST_ChannelTune.h" |
|---|
| 9 | #include "DST_OSDImage.h" |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | char* DST_GetAppShortVersion(); |
|---|
| 13 | void CSTBInfo_SetSize(CWindow *this); |
|---|
| 14 | |
|---|
| 15 | //class CSTBInfo: public CWindow |
|---|
| 16 | //{ |
|---|
| 17 | //private: |
|---|
| 18 | //public: |
|---|
| 19 | // CSTBInfo(SWinEventMsg event):CWindow(event) |
|---|
| 20 | void CSTBInfo_Constructor(CWindow *this, SWinEventMsg event) |
|---|
| 21 | { |
|---|
| 22 | CSTBInfo_SetSize(this); |
|---|
| 23 | this->SetTimeOut(this, 100); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | void CSTBInfo_Destructor(CWindow *this) |
|---|
| 27 | { |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | void CSTBInfo_SetSize(CWindow *this) |
|---|
| 32 | { |
|---|
| 33 | this->rect.w = DST_GetImageWidth(pin_back); |
|---|
| 34 | this->rect.h = DST_GetImageHeight(pin_back); |
|---|
| 35 | this->rect.x = (DST_GetScreenWidth() - this->rect.w)/2; |
|---|
| 36 | this->rect.y = (DST_GetScreenHeight() - this->rect.h)/2; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | void CSTBInfo_DrawGuide(CWindow *this) |
|---|
| 40 | { |
|---|
| 41 | this->setFontStyle(this, 22,0xFFE1E1E1,ALIGN_MIDDLE,ALIGN_CENTER); |
|---|
| 42 | |
|---|
| 43 | this->DrawTextUni(this, 0, 77/3, this->rect.w, DST_GetFontHeight(this->FontGetSize(this)), pz_Sub_STB_Info[OSD_Lang], &(this->font)); |
|---|
| 44 | |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | void CSTBInfo_DrawItems(CWindow *this, int xPos, int yPos) |
|---|
| 48 | { |
|---|
| 49 | char strHW[5] = {0,0,0,0,0}; |
|---|
| 50 | sprintf(strHW, "0.%d", 1); |
|---|
| 51 | |
|---|
| 52 | this->setFontStyle(this,19,0xFFFF4B1E,ALIGN_MIDDLE,ALIGN_CENTER); |
|---|
| 53 | int w1 = DST_GetTextWidth((char*)"S/W :", this->FontGetSize(this)); |
|---|
| 54 | int w2 = DST_GetTextWidth(DST_GetAppShortVersion(), this->FontGetSize(this)); |
|---|
| 55 | int w3 = DST_GetTextWidth((char*)"H/W :", this->FontGetSize(this)); |
|---|
| 56 | int w4 = DST_GetTextWidth(strHW, this->FontGetSize(this)); |
|---|
| 57 | |
|---|
| 58 | int x1 = (this->rect.w - (w1 + w2))/2; |
|---|
| 59 | int x2 = x1 + w1; |
|---|
| 60 | int x3 = x2 - w3; |
|---|
| 61 | int x4 = x2; |
|---|
| 62 | |
|---|
| 63 | int y1 = 75; |
|---|
| 64 | int h1 = 30; |
|---|
| 65 | int y3 = y1 + h1; |
|---|
| 66 | |
|---|
| 67 | this->setFontStyle(this,19,0xFFFF4B1E,ALIGN_MIDDLE,ALIGN_CENTER); |
|---|
| 68 | this->DrawText(this,x1, y1, w1, h1, (char*)"S/W :", &(this->font)); |
|---|
| 69 | this->DrawText(this,x2, y1, w2, h1, DST_GetAppShortVersion(), &(this->font)); |
|---|
| 70 | this->DrawText(this,x3, y3, w3, h1, (char*)"H/W :", &(this->font)); |
|---|
| 71 | this->DrawText(this,x4, y3, w4, h1, strHW, &(this->font)); |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | void CSTBInfo_Draw(CWindow *this) |
|---|
| 77 | { |
|---|
| 78 | this->DrawImage(this,0,0,pin_back,false); |
|---|
| 79 | CSTBInfo_DrawGuide(this); |
|---|
| 80 | CSTBInfo_DrawItems(this, 20, 77/3 + DST_GetFontHeight(20) + 77/3 ); |
|---|
| 81 | } |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | // virtual void Focus(bool bVal) |
|---|
| 86 | void CSTBInfo_Focus(CWindow *this, bool bVal) |
|---|
| 87 | { |
|---|
| 88 | this->RegisterKey(this, VK_CANCEL, bVal, 0, 0); |
|---|
| 89 | this->RegisterKey(this, VK_MENU, bVal, 0, 0); |
|---|
| 90 | this->RegisterKey(this, VK_OK, bVal, 0, 0); |
|---|
| 91 | this->RegisterKey(this, VK_UP, bVal, 0, 0); |
|---|
| 92 | this->RegisterKey(this, VK_DN, bVal, 0, 0); |
|---|
| 93 | this->RegisterKey(this, VK_RIGHT, bVal, 0, 0); |
|---|
| 94 | this->RegisterKey(this, VK_LEFT, bVal, 0, 0); |
|---|
| 95 | this->RegisterKey(this, VK_PREV, bVal, 0, 0); |
|---|
| 96 | this->RegisterKey(this, VK_PREV_CH, bVal, 0, 0); |
|---|
| 97 | this->RegisterKey(this, VK_PREV_MENU, bVal, 0, 0); |
|---|
| 98 | } |
|---|
| 99 | |
|---|
| 100 | // virtual void Show(WinID id) |
|---|
| 101 | void CSTBInfo_ShowWindow(CWindow *this, WinID id) |
|---|
| 102 | { |
|---|
| 103 | switch(id) |
|---|
| 104 | { |
|---|
| 105 | case WIN_DEBUG_SQL: |
|---|
| 106 | case WIN_DEBUG_SQL_SUB: |
|---|
| 107 | case WIN_ENGINEER_MODE: |
|---|
| 108 | case WIN_FREQUENCY_SETTING: |
|---|
| 109 | case WIN_EWS: |
|---|
| 110 | case WIN_DIRECT_TUNE: |
|---|
| 111 | case WIN_VOLUME: |
|---|
| 112 | case WIN_VOLUME_MUTE: |
|---|
| 113 | case WIN_SIGNAL_METER: |
|---|
| 114 | case WIN_CLOSED_CAPTION_HOT: |
|---|
| 115 | case WIN_AUDIO_HOT: |
|---|
| 116 | case WIN_DISPLAY_MODE_HOT: |
|---|
| 117 | case WIN_FACTORY_RESET: |
|---|
| 118 | case WIN_FACTORY_RESET_ASK: |
|---|
| 119 | case WIN_INFOR_BANNER: |
|---|
| 120 | case WIN_POWER_DOWN_CAUTION: |
|---|
| 121 | case WIN_AUTO_SEARCH: |
|---|
| 122 | case WIN_MANUAL_SEARCH: |
|---|
| 123 | case WIN_CHANNEL_LIST: |
|---|
| 124 | case WIN_PROGRAM_GUIDE: |
|---|
| 125 | this->Close(this); |
|---|
| 126 | break; |
|---|
| 127 | default: |
|---|
| 128 | break; |
|---|
| 129 | } |
|---|
| 130 | |
|---|
| 131 | } |
|---|
| 132 | |
|---|
| 133 | // virtual void Show(void) |
|---|
| 134 | void CSTBInfo_Show(CWindow *this) |
|---|
| 135 | { |
|---|
| 136 | CSTBInfo_Draw(this); |
|---|
| 137 | this->DoFocus(this, true); |
|---|
| 138 | } |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | // virtual void KeyInput(DS_U8 key, bool /*bRepeat*/) |
|---|
| 142 | void CSTBInfo_KeyInput(CWindow *this, DS_U8 key, bool bRepeat) |
|---|
| 143 | { |
|---|
| 144 | switch (key) |
|---|
| 145 | { |
|---|
| 146 | case VK_MENU: |
|---|
| 147 | case VK_CANCEL: |
|---|
| 148 | case VK_PREV_MENU: |
|---|
| 149 | this->Close(this); |
|---|
| 150 | if(DST_UI_GetMute() && DST_GetWin(WIN_VOLUME_MUTE)==0) DST_CreateWin(WIN_VOLUME_MUTE, 0, 0, 0, 0, 0); |
|---|
| 151 | if(DST_GetWin(WIN_MAIN_MENU)) DST_CloseWin(WIN_MAIN_MENU); |
|---|
| 152 | break; |
|---|
| 153 | |
|---|
| 154 | case VK_OK: |
|---|
| 155 | case VK_PREV: |
|---|
| 156 | case VK_PREV_CH: |
|---|
| 157 | this->Close(this); |
|---|
| 158 | break; |
|---|
| 159 | |
|---|
| 160 | default: |
|---|
| 161 | break; |
|---|
| 162 | } |
|---|
| 163 | } |
|---|
| 164 | |
|---|
| 165 | //}; |
|---|
| 166 | |
|---|
| 167 | void DST_CreateSTBInfo(SWinEventMsg event) |
|---|
| 168 | { |
|---|
| 169 | CWindow*pWin = NewCWindow(event); |
|---|
| 170 | pWin->Destructor = CSTBInfo_Destructor; |
|---|
| 171 | pWin->KeyInput = CSTBInfo_KeyInput; |
|---|
| 172 | pWin->Focus = CSTBInfo_Focus; |
|---|
| 173 | pWin->ShowWindow = CSTBInfo_ShowWindow; |
|---|
| 174 | pWin->Show = CSTBInfo_Show; |
|---|
| 175 | // »ý¼ºÀÚ È£Ãâ |
|---|
| 176 | CSTBInfo_Constructor(pWin, event); |
|---|
| 177 | // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï |
|---|
| 178 | DST_AddWin((WinID)(event.data[0]), pWin); |
|---|
| 179 | |
|---|
| 180 | } |
|---|
| 181 | |
|---|
| 182 | |
|---|
| 183 | |
|---|