Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleanup: Got rid of a bunch of DWORD/WORD stuff in guilib primarily -…

… colors, alignment, fonts, labels, keys and actions all purged.

cleanup: Removed <windows.h> from StdString.h, and removed system.h from a bunch of headers in guilib.

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC@23060 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
commit 1a029e2387194c7b27591bdc35b8cbe4103e4dc5 1 parent 7a769a1
jmarshallnz authored
Showing with 1,302 additions and 1,269 deletions.
  1. +13 −13 guilib/GUIAudioManager.cpp
  2. +4 −4 guilib/GUIAudioManager.h
  3. +9 −9 guilib/GUIBaseContainer.cpp
  4. +12 −12 guilib/GUIButtonControl.cpp
  5. +4 −4 guilib/GUIButtonControl.h
  6. +11 −11 guilib/GUIButtonScroller.cpp
  7. +8 −8 guilib/GUICheckMarkControl.cpp
  8. +2 −2 guilib/GUICheckMarkControl.h
  9. +3 −3 guilib/GUIColorManager.cpp
  10. +4 −5 guilib/GUIColorManager.h
  11. +1 −1  guilib/GUIControl.cpp
  12. +1 −1  guilib/GUIControl.h
  13. +14 −18 guilib/GUIControlFactory.cpp
  14. +3 −3 guilib/GUIControlFactory.h
  15. +1 −1  guilib/GUIDialog.cpp
  16. +10 −10 guilib/GUIEditControl.cpp
  17. +1 −1  guilib/GUIFadeLabelControl.cpp
  18. +3 −3 guilib/GUIFixedListContainer.cpp
  19. +16 −16 guilib/GUIFont.cpp
  20. +22 −21 guilib/GUIFont.h
  21. +3 −3 guilib/GUIFontManager.cpp
  22. +1 −1  guilib/GUIFontManager.h
  23. +29 −29 guilib/GUIFontTTF.cpp
  24. +18 −14 guilib/GUIFontTTF.h
  25. +36 −36 guilib/GUIFontTTFDX.cpp
  26. +0 −2  guilib/GUIFontTTFDX.h
  27. +4 −4 guilib/GUIFontTTFGL.cpp
  28. +3 −3 guilib/GUIInfoColor.cpp
  29. +7 −8 guilib/GUIInfoColor.h
  30. +3 −3 guilib/GUILabelControl.cpp
  31. +2 −2 guilib/GUILabelControl.h
  32. +3 −3 guilib/GUIListContainer.cpp
  33. +2 −2 guilib/GUIListLabel.cpp
  34. +5 −5 guilib/GUIMoverControl.cpp
  35. +2 −2 guilib/GUIMultiSelectText.cpp
  36. +3 −3 guilib/GUIPanelContainer.cpp
  37. +3 −2 guilib/GUIRSSControl.cpp
  38. +17 −3 guilib/GUIRSSControl.h
  39. +1 −1  guilib/GUIRadioButtonControl.cpp
  40. +3 −3 guilib/GUIResizeControl.cpp
  41. +1 −1  guilib/GUIScrollBarControl.cpp
  42. +5 −5 guilib/GUISelectButtonControl.cpp
  43. +1 −1  guilib/GUISliderControl.cpp
  44. +4 −4 guilib/GUISpinControl.cpp
  45. +1 −1  guilib/GUISpinControl.h
  46. +2 −2 guilib/GUIStandardWindow.cpp
  47. +1 −1  guilib/GUITextBox.cpp
  48. +40 −40 guilib/GUITextLayout.cpp
  49. +25 −21 guilib/GUITextLayout.h
  50. +2 −2 guilib/GUITexture.cpp
  51. +6 −4 guilib/GUITexture.h
  52. +2 −2 guilib/GUITextureD3D.cpp
  53. +2 −2 guilib/GUITextureD3D.h
  54. +2 −2 guilib/GUITextureGL.cpp
  55. +2 −2 guilib/GUITextureGL.h
  56. +2 −2 guilib/GUITextureSDL.cpp
  57. +4 −4 guilib/GUITextureSDL.h
  58. +1 −1  guilib/GUIToggleButtonControl.cpp
  59. +1 −1  guilib/GUIVideoControl.cpp
  60. +7 −7 guilib/GUIVisualisationControl.cpp
  61. +2 −2 guilib/GUIWindow.cpp
  62. +1 −1  guilib/GUIWindowManager.cpp
  63. +3 −3 guilib/GUIWrappingListContainer.cpp
  64. +2 −2 guilib/GraphicContext.h
  65. +38 −38 guilib/Key.cpp
  66. +23 −23 guilib/Key.h
  67. +8 −8 guilib/LocalizeStrings.cpp
  68. +11 −12 guilib/LocalizeStrings.h
  69. +1 −2  guilib/StdString.h
  70. +5 −2 guilib/TransformMatrix.h
  71. +2 −2 guilib/VisibleEffect.cpp
  72. +2 −3 guilib/VisibleEffect.h
  73. +5 −5 guilib/XMLUtils.cpp
  74. +3 −4 guilib/XMLUtils.h
  75. +1 −1  guilib/common/IRServerSuite/IRServerSuite.cpp
  76. +0 −1  guilib/common/IRServerSuite/IrssMessage.h
  77. +1 −1  guilib/common/SDLJoystick.h
  78. +72 −72 xbmc/Application.cpp
  79. +1 −0  xbmc/ApplicationMessenger.cpp
  80. +1 −0  xbmc/ApplicationRenderer.cpp
  81. +495 −494 xbmc/ButtonTranslator.cpp
  82. +19 −19 xbmc/ButtonTranslator.h
  83. +1 −0  xbmc/FileSystem/SAPDirectory.cpp
  84. +2 −2 xbmc/GUIDialogFileBrowser.cpp
  85. +8 −8 xbmc/GUIDialogGamepad.cpp
  86. +1 −0  xbmc/GUIDialogKaiToast.cpp
  87. +18 −18 xbmc/GUIDialogKeyboard.cpp
  88. +1 −1  xbmc/GUIDialogMediaSource.cpp
  89. +3 −3 xbmc/GUIDialogMusicOSD.cpp
  90. +1 −0  xbmc/GUIDialogMusicScan.cpp
  91. +1 −1  xbmc/GUIDialogNetworkSetup.cpp
  92. +10 −10 xbmc/GUIDialogNumeric.cpp
  93. +1 −1  xbmc/GUIDialogPictureInfo.cpp
  94. +2 −1  xbmc/GUIDialogProgress.cpp
  95. +6 −6 xbmc/GUIDialogSeekBar.cpp
  96. +1 −1  xbmc/GUIDialogSettings.cpp
  97. +1 −1  xbmc/GUIDialogSlider.cpp
  98. +1 −1  xbmc/GUIDialogSmartPlaylistEditor.cpp
  99. +1 −1  xbmc/GUIDialogSmartPlaylistRule.cpp
  100. +3 −3 xbmc/GUIDialogSongInfo.cpp
  101. +1 −0  xbmc/GUIDialogVideoBookmarks.cpp
  102. +1 −1  xbmc/GUIDialogVolumeBar.cpp
  103. +1 −1  xbmc/GUIDialogYesNo.cpp
  104. +7 −7 xbmc/GUIMediaWindow.cpp
  105. +8 −8 xbmc/GUIWindowFileManager.cpp
  106. +12 −11 xbmc/GUIWindowFullScreen.cpp
  107. +1 −1  xbmc/GUIWindowLoginScreen.cpp
  108. +2 −2 xbmc/GUIWindowMusicBase.cpp
  109. +2 −2 xbmc/GUIWindowMusicNav.cpp
  110. +4 −4 xbmc/GUIWindowMusicPlaylist.cpp
  111. +2 −2 xbmc/GUIWindowMusicPlaylistEditor.cpp
  112. +1 −1  xbmc/GUIWindowMusicSongs.cpp
  113. +5 −5 xbmc/GUIWindowOSD.cpp
  114. +1 −0  xbmc/GUIWindowScreensaver.cpp
  115. +1 −1  xbmc/GUIWindowScripts.cpp
  116. +1 −1  xbmc/GUIWindowScriptsInfo.cpp
  117. +1 −1  xbmc/GUIWindowSettings.cpp
  118. +1 −1  xbmc/GUIWindowSettingsCategory.cpp
  119. +1 −1  xbmc/GUIWindowSettingsProfile.cpp
  120. +1 −1  xbmc/GUIWindowSettingsScreenCalibration.cpp
  121. +4 −3 xbmc/GUIWindowSlideShow.cpp
  122. +1 −1  xbmc/GUIWindowSystemInfo.cpp
  123. +1 −1  xbmc/GUIWindowTestPattern.cpp
  124. +2 −2 xbmc/GUIWindowVideoBase.cpp
  125. +2 −2 xbmc/GUIWindowVideoNav.cpp
  126. +4 −4 xbmc/GUIWindowVideoPlaylist.cpp
  127. +5 −5 xbmc/GUIWindowVisualisation.cpp
  128. +1 −1  xbmc/GUIWindowWeather.cpp
  129. +1 −0  xbmc/MediaManager.cpp
  130. +9 −9 xbmc/Util.cpp
  131. +2 −2 xbmc/WinEventsSDL.cpp
  132. +1 −1  xbmc/WinEventsWin32.cpp
  133. +1 −0  xbmc/cores/VideoRenderers/RenderManager.cpp
  134. +1 −0  xbmc/cores/dlgcache.cpp
  135. +14 −14 xbmc/cores/dvdplayer/DVDPlayer.cpp
  136. +1 −0  xbmc/karaoke/Cdg.cpp
  137. +3 −3 xbmc/karaoke/GUIDialogKaraokeSongSelector.cpp
  138. +3 −2 xbmc/karaoke/GUIWindowKaraokeLyrics.cpp
  139. +1 −0  xbmc/karaoke/karaokelyricsmanager.cpp
  140. +1 −1  xbmc/karaoke/karaokelyricstext.cpp
  141. +1 −0  xbmc/karaoke/karaokewindowbackground.cpp
  142. +11 −11 xbmc/lib/libGoAhead/XBMChttp.cpp
  143. +1 −1  xbmc/lib/libPython/xbmcmodule/GUIPythonWindow.cpp
  144. +1 −1  xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp
  145. +5 −5 xbmc/lib/libPython/xbmcmodule/action.cpp
  146. +1 −0  xbmc/utils/AlarmClock.cpp
  147. +4 −4 xbmc/utils/EventServer.cpp
  148. +4 −3 xbmc/utils/RssReader.cpp
  149. +6 −9 xbmc/utils/RssReader.h
View
26 guilib/GUIAudioManager.cpp
@@ -174,7 +174,7 @@ void CGUIAudioManager::PlayActionSound(const CAction& action)
CSingleLock lock(m_cs);
- actionSoundMap::iterator it=m_actionSoundMap.find(action.wID);
+ actionSoundMap::iterator it=m_actionSoundMap.find(action.id);
if (it==m_actionSoundMap.end())
return;
@@ -197,7 +197,7 @@ void CGUIAudioManager::PlayActionSound(const CAction& action)
// \brief Play a sound associated with a window and its event
// Events: SOUND_INIT, SOUND_DEINIT
-void CGUIAudioManager::PlayWindowSound(DWORD dwID, WINDOW_SOUND event)
+void CGUIAudioManager::PlayWindowSound(int id, WINDOW_SOUND event)
{
// it's not possible to play gui sounds when passthrough is active
if (!m_bInitialized || !m_bEnabled || g_audioContext.IsPassthroughActive())
@@ -205,7 +205,7 @@ void CGUIAudioManager::PlayWindowSound(DWORD dwID, WINDOW_SOUND event)
CSingleLock lock(m_cs);
- windowSoundMap::iterator it=m_windowSoundMap.find((WORD)(dwID & 0xffff));
+ windowSoundMap::iterator it=m_windowSoundMap.find(id);
if (it==m_windowSoundMap.end())
return;
@@ -225,7 +225,7 @@ void CGUIAudioManager::PlayWindowSound(DWORD dwID, WINDOW_SOUND event)
return;
// One sound buffer for each window
- windowSoundsMap::iterator itsb=m_windowSounds.find(dwID);
+ windowSoundsMap::iterator itsb=m_windowSounds.find(id);
if (itsb!=m_windowSounds.end())
{
CGUISound* sound=itsb->second;
@@ -242,7 +242,7 @@ void CGUIAudioManager::PlayWindowSound(DWORD dwID, WINDOW_SOUND event)
return;
}
- m_windowSounds.insert(pair<DWORD, CGUISound*>(dwID, sound));
+ m_windowSounds.insert(pair<int, CGUISound*>(id, sound));
sound->Play();
}
@@ -336,10 +336,10 @@ bool CGUIAudioManager::Load()
while (pAction)
{
TiXmlNode* pIdNode = pAction->FirstChild("name");
- WORD wID = 0; // action identity
+ int id = 0; // action identity
if (pIdNode && pIdNode->FirstChild())
{
- CButtonTranslator::TranslateActionString(pIdNode->FirstChild()->Value(), wID);
+ CButtonTranslator::TranslateActionString(pIdNode->FirstChild()->Value(), id);
}
TiXmlNode* pFileNode = pAction->FirstChild("file");
@@ -347,8 +347,8 @@ bool CGUIAudioManager::Load()
if (pFileNode && pFileNode->FirstChild())
strFile+=pFileNode->FirstChild()->Value();
- if (wID > 0 && !strFile.IsEmpty())
- m_actionSoundMap.insert(pair<WORD, CStdString>(wID, strFile));
+ if (id > 0 && !strFile.IsEmpty())
+ m_actionSoundMap.insert(pair<int, CStdString>(id, strFile));
pAction = pAction->NextSibling();
}
@@ -362,21 +362,21 @@ bool CGUIAudioManager::Load()
while (pWindow)
{
- WORD wID = 0;
+ int id = 0;
TiXmlNode* pIdNode = pWindow->FirstChild("name");
if (pIdNode)
{
if (pIdNode->FirstChild())
- wID = CButtonTranslator::TranslateWindowString(pIdNode->FirstChild()->Value());
+ id = CButtonTranslator::TranslateWindowString(pIdNode->FirstChild()->Value());
}
CWindowSounds sounds;
LoadWindowSound(pWindow, "activate", sounds.strInitFile);
LoadWindowSound(pWindow, "deactivate", sounds.strDeInitFile);
- if (wID > 0)
- m_windowSoundMap.insert(pair<WORD, CWindowSounds>(wID, sounds));
+ if (id > 0)
+ m_windowSoundMap.insert(pair<int, CWindowSounds>(id, sounds));
pWindow = pWindow->NextSibling();
}
View
8 guilib/GUIAudioManager.h
@@ -54,7 +54,7 @@ class CGUIAudioManager : public IAudioDeviceChangedCallback
bool Load();
void PlayActionSound(const CAction& action);
- void PlayWindowSound(DWORD dwID, WINDOW_SOUND event);
+ void PlayWindowSound(int id, WINDOW_SOUND event);
void PlayPythonSound(const CStdString& strFileName);
void FreeUnused();
@@ -65,11 +65,11 @@ class CGUIAudioManager : public IAudioDeviceChangedCallback
private:
bool LoadWindowSound(TiXmlNode* pWindowNode, const CStdString& strIdentifier, CStdString& strFile);
- typedef std::map<WORD, CStdString> actionSoundMap;
- typedef std::map<WORD, CWindowSounds> windowSoundMap;
+ typedef std::map<int, CStdString> actionSoundMap;
+ typedef std::map<int, CWindowSounds> windowSoundMap;
typedef std::map<CStdString, CGUISound*> pythonSoundsMap;
- typedef std::map<DWORD, CGUISound*> windowSoundsMap;
+ typedef std::map<int, CGUISound*> windowSoundsMap;
actionSoundMap m_actionSoundMap;
windowSoundMap m_windowSoundMap;
View
18 guilib/GUIBaseContainer.cpp
@@ -197,13 +197,13 @@ void CGUIBaseContainer::RenderItem(float posX, float posY, CGUIListItem *item, b
bool CGUIBaseContainer::OnAction(const CAction &action)
{
- if (action.wID >= KEY_ASCII)
+ if (action.id >= KEY_ASCII)
{
- OnJumpLetter((char)(action.wID & 0xff));
+ OnJumpLetter((char)(action.id & 0xff));
return true;
}
- switch (action.wID)
+ switch (action.id)
{
case ACTION_MOVE_LEFT:
case ACTION_MOVE_RIGHT:
@@ -212,15 +212,15 @@ bool CGUIBaseContainer::OnAction(const CAction &action)
{
if (!HasFocus()) return false;
if (action.holdTime > HOLD_TIME_START &&
- ((m_orientation == VERTICAL && (action.wID == ACTION_MOVE_UP || action.wID == ACTION_MOVE_DOWN)) ||
- (m_orientation == HORIZONTAL && (action.wID == ACTION_MOVE_LEFT || action.wID == ACTION_MOVE_RIGHT))))
+ ((m_orientation == VERTICAL && (action.id == ACTION_MOVE_UP || action.id == ACTION_MOVE_DOWN)) ||
+ (m_orientation == HORIZONTAL && (action.id == ACTION_MOVE_LEFT || action.id == ACTION_MOVE_RIGHT))))
{ // action is held down - repeat a number of times
float speed = std::min(1.0f, (float)(action.holdTime - HOLD_TIME_START) / (HOLD_TIME_END - HOLD_TIME_START));
unsigned int itemsPerFrame = 1;
if (m_lastHoldTime) // number of rows/10 items/second max speed
itemsPerFrame = std::max((unsigned int)1, (unsigned int)(speed * 0.0001f * GetRows() * (timeGetTime() - m_lastHoldTime)));
m_lastHoldTime = timeGetTime();
- if (action.wID == ACTION_MOVE_LEFT || action.wID == ACTION_MOVE_UP)
+ if (action.id == ACTION_MOVE_LEFT || action.id == ACTION_MOVE_UP)
while (itemsPerFrame--) MoveUp(false);
else
while (itemsPerFrame--) MoveDown(false);
@@ -264,15 +264,15 @@ bool CGUIBaseContainer::OnAction(const CAction &action)
case ACTION_JUMP_SMS8:
case ACTION_JUMP_SMS9:
{
- OnJumpSMS(action.wID - ACTION_JUMP_SMS2 + 2);
+ OnJumpSMS(action.id - ACTION_JUMP_SMS2 + 2);
return true;
}
break;
default:
- if (action.wID)
+ if (action.id)
{
- return OnClick(action.wID);
+ return OnClick(action.id);
}
}
return false;
View
24 guilib/GUIButtonControl.cpp
@@ -135,7 +135,7 @@ void CGUIButtonControl::RenderText()
bool CGUIButtonControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
OnClick();
return true;
@@ -237,7 +237,7 @@ bool CGUIButtonControl::OnMouseClick(DWORD dwButton, const CPoint &point)
{
g_Mouse.SetState(MOUSE_STATE_CLICK);
CAction action;
- action.wID = ACTION_SELECT_ITEM;
+ action.id = ACTION_SELECT_ITEM;
OnAction(action);
return true;
}
@@ -256,28 +256,28 @@ CStdString CGUIButtonControl::GetLabel2() const
return strLabel;
}
-void CGUIButtonControl::PythonSetLabel(const CStdString &strFont, const string &strText, DWORD dwTextColor, DWORD dwShadowColor, DWORD dwFocusedColor)
+void CGUIButtonControl::PythonSetLabel(const CStdString &strFont, const string &strText, color_t textColor, color_t shadowColor, color_t focusedColor)
{
m_label.font = g_fontManager.GetFont(strFont);
- m_label.textColor = dwTextColor;
- m_label.focusedColor = dwFocusedColor;
- m_label.shadowColor = dwShadowColor;
+ m_label.textColor = textColor;
+ m_label.focusedColor = focusedColor;
+ m_label.shadowColor = shadowColor;
SetLabel(strText);
}
-void CGUIButtonControl::PythonSetDisabledColor(DWORD dwDisabledColor)
+void CGUIButtonControl::PythonSetDisabledColor(color_t disabledColor)
{
- m_label.disabledColor = dwDisabledColor;
+ m_label.disabledColor = disabledColor;
}
-void CGUIButtonControl::RAMSetTextColor(DWORD dwTextColor)
+void CGUIButtonControl::RAMSetTextColor(color_t textColor)
{
- m_label.textColor = dwTextColor;
+ m_label.textColor = textColor;
}
-void CGUIButtonControl::SettingsCategorySetTextAlign(DWORD dwAlign)
+void CGUIButtonControl::SettingsCategorySetTextAlign(uint32_t align)
{
- m_label.align = dwAlign;
+ m_label.align = align;
}
void CGUIButtonControl::OnClick()
View
8 guilib/GUIButtonControl.h
@@ -68,11 +68,11 @@ class CGUIButtonControl : public CGUIControl
virtual CStdString GetDescription() const;
void SetAlpha(unsigned char alpha);
- void PythonSetLabel(const CStdString &strFont, const std::string &strText, DWORD dwTextColor, DWORD dwShadowColor, DWORD dwFocusedColor);
- void PythonSetDisabledColor(DWORD dwDisabledColor);
+ void PythonSetLabel(const CStdString &strFont, const std::string &strText, color_t textColor, color_t shadowColor, color_t focusedColor);
+ void PythonSetDisabledColor(color_t disabledColor);
- void RAMSetTextColor(DWORD dwTextColor);
- void SettingsCategorySetTextAlign(DWORD dwAlign);
+ void RAMSetTextColor(color_t textColor);
+ void SettingsCategorySetTextAlign(uint32_t align);
virtual void OnClick();
bool HasClickActions() { return m_clickActions.size() > 0; };
View
22 guilib/GUIButtonScroller.cpp
@@ -115,7 +115,7 @@ CGUIButtonScroller::~CGUIButtonScroller(void)
bool CGUIButtonScroller::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
// send the appropriate message to the parent window
vector<CGUIActionDescriptor> actions = m_vecButtons[GetActiveButton()]->clickActions;
@@ -128,15 +128,15 @@ bool CGUIButtonScroller::OnAction(const CAction &action)
}
return true;
}
- if (action.wID == ACTION_CONTEXT_MENU)
+ if (action.id == ACTION_CONTEXT_MENU)
{ // send a click message to our parent
- SEND_CLICK_MESSAGE(GetID(), GetParentID(), action.wID);
+ SEND_CLICK_MESSAGE(GetID(), GetParentID(), action.id);
return true;
}
// smooth scrolling (for analog controls)
- if (action.wID == ACTION_SCROLL_UP)
+ if (action.id == ACTION_SCROLL_UP)
{
- m_fAnalogScrollSpeed += action.fAmount1 * action.fAmount1;
+ m_fAnalogScrollSpeed += action.amount1 * action.amount1;
bool handled = false;
while (m_fAnalogScrollSpeed > ANALOG_SCROLL_START)
{
@@ -148,9 +148,9 @@ bool CGUIButtonScroller::OnAction(const CAction &action)
}
return handled;
}
- if (action.wID == ACTION_SCROLL_DOWN)
+ if (action.id == ACTION_SCROLL_DOWN)
{
- m_fAnalogScrollSpeed += action.fAmount1 * action.fAmount1;
+ m_fAnalogScrollSpeed += action.amount1 * action.amount1;
bool handled = false;
while (m_fAnalogScrollSpeed > ANALOG_SCROLL_START)
{
@@ -893,9 +893,9 @@ bool CGUIButtonScroller::OnMouseClick(DWORD dwButton, const CPoint &point)
m_iCurrentSlot = (int)((point.x - m_posX) / (m_imgFocus.GetWidth() + m_buttonGap));
CAction action;
if (dwButton == MOUSE_LEFT_BUTTON)
- action.wID = ACTION_SELECT_ITEM;
+ action.id = ACTION_SELECT_ITEM;
if (dwButton == MOUSE_RIGHT_BUTTON)
- action.wID = ACTION_CONTEXT_MENU;
+ action.id = ACTION_CONTEXT_MENU;
OnAction(action);
return true;
}
@@ -907,9 +907,9 @@ bool CGUIButtonScroller::OnMouseClick(DWORD dwButton, const CPoint &point)
m_iCurrentSlot = (int)((point.y - m_posY) / (m_imgFocus.GetHeight() + m_buttonGap));
CAction action;
if (dwButton == MOUSE_LEFT_BUTTON)
- action.wID = ACTION_SELECT_ITEM;
+ action.id = ACTION_SELECT_ITEM;
if (dwButton == MOUSE_RIGHT_BUTTON)
- action.wID = ACTION_CONTEXT_MENU;
+ action.id = ACTION_CONTEXT_MENU;
OnAction(action);
return true;
}
View
16 guilib/GUICheckMarkControl.cpp
@@ -82,10 +82,10 @@ void CGUICheckMarkControl::Render()
bool CGUICheckMarkControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
m_bSelected = !m_bSelected;
- CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), action.wID);
+ CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), action.id);
SendWindowMessage(msg);
return true;
}
@@ -142,7 +142,7 @@ bool CGUICheckMarkControl::OnMouseClick(DWORD dwButton, const CPoint &point)
if (dwButton != MOUSE_LEFT_BUTTON) return false;
g_Mouse.SetState(MOUSE_STATE_CLICK);
CAction action;
- action.wID = ACTION_SELECT_ITEM;
+ action.id = ACTION_SELECT_ITEM;
OnAction(action);
return true;
}
@@ -152,17 +152,17 @@ void CGUICheckMarkControl::SetLabel(const string &label)
m_strLabel = label;
}
-void CGUICheckMarkControl::PythonSetLabel(const CStdString &strFont, const string &strText, DWORD dwTextColor)
+void CGUICheckMarkControl::PythonSetLabel(const CStdString &strFont, const string &strText, color_t textColor)
{
m_label.font = g_fontManager.GetFont(strFont);
- m_label.textColor = dwTextColor;
- m_label.focusedColor = dwTextColor;
+ m_label.textColor = textColor;
+ m_label.focusedColor = textColor;
m_strLabel = strText;
}
-void CGUICheckMarkControl::PythonSetDisabledColor(DWORD dwDisabledColor)
+void CGUICheckMarkControl::PythonSetDisabledColor(color_t disabledColor)
{
- m_label.disabledColor = dwDisabledColor;
+ m_label.disabledColor = disabledColor;
}
void CGUICheckMarkControl::UpdateColors()
View
4 guilib/GUICheckMarkControl.h
@@ -58,8 +58,8 @@ class CGUICheckMarkControl: public CGUIControl
bool GetSelected() const;
bool OnMouseClick(DWORD dwButton, const CPoint &point);
- void PythonSetLabel(const CStdString &strFont, const std::string &strText, DWORD dwTextColor);
- void PythonSetDisabledColor(DWORD dwDisabledColor);
+ void PythonSetLabel(const CStdString &strFont, const std::string &strText, color_t textColor);
+ void PythonSetDisabledColor(color_t disabledColor);
protected:
virtual void UpdateColors();
View
6 guilib/GUIColorManager.cpp
@@ -84,7 +84,7 @@ bool CGUIColorManager::LoadXML(TiXmlDocument &xmlDoc)
{
if (color->FirstChild() && color->Attribute("name"))
{
- DWORD value = 0xffffffff;
+ color_t value = 0xffffffff;
sscanf(color->FirstChild()->Value(), "%x", (unsigned int*) &value);
CStdString name = color->Attribute("name");
iColor it = m_colors.find(name);
@@ -99,7 +99,7 @@ bool CGUIColorManager::LoadXML(TiXmlDocument &xmlDoc)
}
// lookup a color and return it's hex value
-DWORD CGUIColorManager::GetColor(const CStdString &color) const
+uint32_t CGUIColorManager::GetColor(const CStdString &color) const
{
// look in our color map
CStdString trimmed(color);
@@ -109,7 +109,7 @@ DWORD CGUIColorManager::GetColor(const CStdString &color) const
return (*it).second;
// try converting hex directly
- DWORD value = 0;
+ uint32_t value = 0;
sscanf(trimmed.c_str(), "%x", &value);
return value;
}
View
9 guilib/GUIColorManager.h
@@ -35,7 +35,6 @@
*/
#include "StdString.h"
-#include "system.h"
#include <map>
@@ -49,16 +48,16 @@ class CGUIColorManager
void Load(const CStdString &colorFile);
- DWORD GetColor(const CStdString &color) const;
+ uint32_t GetColor(const CStdString &color) const;
void Clear();
protected:
bool LoadXML(TiXmlDocument &xmlDoc);
- std::map<CStdString, DWORD> m_colors;
- typedef std::map<CStdString, DWORD>::iterator iColor;
- typedef std::map<CStdString, DWORD>::const_iterator icColor;
+ std::map<CStdString, uint32_t> m_colors;
+ typedef std::map<CStdString, uint32_t>::iterator iColor;
+ typedef std::map<CStdString, uint32_t>::const_iterator icColor;
};
/*!
View
2  guilib/GUIControl.cpp
@@ -160,7 +160,7 @@ void CGUIControl::Render()
bool CGUIControl::OnAction(const CAction &action)
{
- switch (action.wID)
+ switch (action.id)
{
case ACTION_MOVE_DOWN:
if (!HasFocus()) return false;
View
2  guilib/GUIControl.h
@@ -65,7 +65,7 @@ class CLabelInfo
CGUIInfoColor selectedColor;
CGUIInfoColor disabledColor;
CGUIInfoColor focusedColor;
- DWORD align;
+ uint32_t align;
float offsetX;
float offsetY;
float width;
View
32 guilib/GUIControlFactory.cpp
@@ -260,20 +260,20 @@ void CGUIControlFactory::GetRectFromString(const CStdString &string, FRECT &rect
}
}
-bool CGUIControlFactory::GetAlignment(const TiXmlNode* pRootNode, const char* strTag, DWORD& dwAlignment)
+bool CGUIControlFactory::GetAlignment(const TiXmlNode* pRootNode, const char* strTag, uint32_t& alignment)
{
const TiXmlNode* pNode = pRootNode->FirstChild(strTag);
if (!pNode || !pNode->FirstChild()) return false;
CStdString strAlign = pNode->FirstChild()->Value();
- if (strAlign == "right" || strAlign == "bottom") dwAlignment = XBFONT_RIGHT;
- else if (strAlign == "center") dwAlignment = XBFONT_CENTER_X;
- else if (strAlign == "justify") dwAlignment = XBFONT_JUSTIFIED;
- else dwAlignment = XBFONT_LEFT;
+ if (strAlign == "right" || strAlign == "bottom") alignment = XBFONT_RIGHT;
+ else if (strAlign == "center") alignment = XBFONT_CENTER_X;
+ else if (strAlign == "justify") alignment = XBFONT_JUSTIFIED;
+ else alignment = XBFONT_LEFT;
return true;
}
-bool CGUIControlFactory::GetAlignmentY(const TiXmlNode* pRootNode, const char* strTag, DWORD& dwAlignment)
+bool CGUIControlFactory::GetAlignmentY(const TiXmlNode* pRootNode, const char* strTag, uint32_t& alignment)
{
const TiXmlNode* pNode = pRootNode->FirstChild(strTag );
if (!pNode || !pNode->FirstChild())
@@ -283,10 +283,10 @@ bool CGUIControlFactory::GetAlignmentY(const TiXmlNode* pRootNode, const char* s
CStdString strAlign = pNode->FirstChild()->Value();
- dwAlignment = 0;
+ alignment = 0;
if (strAlign == "center")
{
- dwAlignment = XBFONT_CENTER_Y;
+ alignment = XBFONT_CENTER_Y;
}
return true;
@@ -401,7 +401,7 @@ bool CGUIControlFactory::GetHitRect(const TiXmlNode *control, CRect &rect)
return false;
}
-bool CGUIControlFactory::GetColor(const TiXmlNode *control, const char *strTag, DWORD &value)
+bool CGUIControlFactory::GetColor(const TiXmlNode *control, const char *strTag, color_t &value)
{
const TiXmlElement* node = control->FirstChildElement(strTag);
if (node && node->FirstChild())
@@ -555,9 +555,9 @@ CGUIControl* CGUIControlFactory::Create(DWORD dwParentId, const FRECT &rect, TiX
DWORD left = 0, right = 0, up = 0, down = 0, next = 0, prev = 0;
vector<CGUIActionDescriptor> leftActions, rightActions, upActions, downActions, nextActions, prevActions;
- DWORD pageControl = 0;
+ int pageControl = 0;
CGUIInfoColor colorDiffuse(0xFFFFFFFF);
- DWORD defaultControl = 0;
+ int defaultControl = 0;
bool defaultAlways = false;
CStdString strTmp;
int singleInfo = 0;
@@ -615,8 +615,6 @@ CGUIControl* CGUIControlFactory::Create(DWORD dwParentId, const FRECT &rect, TiX
CStdString strTitle = "";
CStdString strRSSTags = "";
- DWORD dwThumbAlign = 0;
-
float thumbXPos = 4;
float thumbYPos = 10;
float thumbWidth = 64;
@@ -729,13 +727,13 @@ CGUIControl* CGUIControlFactory::Create(DWORD dwParentId, const FRECT &rect, TiX
if (!GetNavigation(pControlNode, "onnext", next, nextActions)) next = id;
if (!GetNavigation(pControlNode, "onprev", prev, prevActions)) prev = id;
- if (XMLUtils::GetDWORD(pControlNode, "defaultcontrol", defaultControl))
+ if (XMLUtils::GetInt(pControlNode, "defaultcontrol", defaultControl))
{
const char *always = pControlNode->FirstChildElement("defaultcontrol")->Attribute("always");
if (always && strnicmp(always, "true", 4) == 0)
defaultAlways = true;
}
- XMLUtils::GetDWORD(pControlNode, "pagecontrol", pageControl);
+ XMLUtils::GetInt(pControlNode, "pagecontrol", pageControl);
GetInfoColor(pControlNode, "colordiffuse", colorDiffuse);
@@ -763,7 +761,7 @@ CGUIControl* CGUIControlFactory::Create(DWORD dwParentId, const FRECT &rect, TiX
if (XMLUtils::GetString(pControlNode, "font", strFont))
labelInfo.font = g_fontManager.GetFont(strFont);
GetAlignment(pControlNode, "align", labelInfo.align);
- DWORD alignY = 0;
+ uint32_t alignY = 0;
if (GetAlignmentY(pControlNode, "aligny", alignY))
labelInfo.align |= alignY;
if (GetFloat(pControlNode, "textwidth", labelInfo.width))
@@ -888,8 +886,6 @@ CGUIControl* CGUIControlFactory::Create(DWORD dwParentId, const FRECT &rect, TiX
GetFloat(pControlNode, "thumbposx", thumbXPos);
GetFloat(pControlNode, "thumbposy", thumbYPos);
- GetAlignment(pControlNode, "thumbalign", dwThumbAlign);
-
GetFloat(pControlNode, "thumbwidthbig", thumbWidthBig);
GetFloat(pControlNode, "thumbheightbig", thumbHeightBig);
GetFloat(pControlNode, "thumbposxbig", thumbXPosBig);
View
6 guilib/GUIControlFactory.h
@@ -53,12 +53,12 @@ class CGUIControlFactory
static bool GetAspectRatio(const TiXmlNode* pRootNode, const char* strTag, CAspectRatio &aspectRatio);
static bool GetInfoTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image, CGUIInfoLabel &info);
static bool GetTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image);
- static bool GetAlignment(const TiXmlNode* pRootNode, const char* strTag, DWORD& dwAlignment);
- static bool GetAlignmentY(const TiXmlNode* pRootNode, const char* strTag, DWORD& dwAlignment);
+ static bool GetAlignment(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwAlignment);
+ static bool GetAlignmentY(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwAlignment);
static bool GetAnimations(const TiXmlNode *control, const FRECT &rect, std::vector<CAnimation> &animation);
static void GetInfoLabel(const TiXmlNode *pControlNode, const CStdString &labelTag, CGUIInfoLabel &infoLabel);
static void GetInfoLabels(const TiXmlNode *pControlNode, const CStdString &labelTag, std::vector<CGUIInfoLabel> &infoLabels);
- static bool GetColor(const TiXmlNode* pRootNode, const char* strTag, DWORD &value);
+ static bool GetColor(const TiXmlNode* pRootNode, const char* strTag, color_t &value);
static bool GetInfoColor(const TiXmlNode* pRootNode, const char* strTag, CGUIInfoColor &value);
static CStdString FilterLabel(const CStdString &label);
static bool GetConditionalVisibility(const TiXmlNode* control, int &condition);
View
2  guilib/GUIDialog.cpp
@@ -67,7 +67,7 @@ void CGUIDialog::OnWindowLoaded()
bool CGUIDialog::OnAction(const CAction &action)
{
- if (action.wID == ACTION_CLOSE_DIALOG || action.wID == ACTION_PREVIOUS_MENU)
+ if (action.id == ACTION_CLOSE_DIALOG || action.id == ACTION_PREVIOUS_MENU)
{
Close();
return true;
View
20 guilib/GUIEditControl.cpp
@@ -88,7 +88,7 @@ bool CGUIEditControl::OnAction(const CAction &action)
// TODO: We shouldn't really need to test for ACTION_PARENT_DIR here
// but it may currently be useful as we can't map specific to an
// edit control other than the keyboard (which doesn't use this block)
- if (action.wID == ACTION_BACKSPACE || action.wID == ACTION_PARENT_DIR)
+ if (action.id == ACTION_BACKSPACE || action.id == ACTION_PARENT_DIR)
{
// backspace
if (m_cursorPos)
@@ -98,7 +98,7 @@ bool CGUIEditControl::OnAction(const CAction &action)
}
return true;
}
- else if (action.wID == ACTION_MOVE_LEFT)
+ else if (action.id == ACTION_MOVE_LEFT)
{
if (m_cursorPos > 0)
{
@@ -107,7 +107,7 @@ bool CGUIEditControl::OnAction(const CAction &action)
return true;
}
}
- else if (action.wID == ACTION_MOVE_RIGHT)
+ else if (action.id == ACTION_MOVE_RIGHT)
{
if ((unsigned int) m_cursorPos < m_text2.size())
{
@@ -116,7 +116,7 @@ bool CGUIEditControl::OnAction(const CAction &action)
return true;
}
}
- else if (action.wID == ACTION_PASTE)
+ else if (action.id == ACTION_PASTE)
{
#ifdef __APPLE__
const char *szStr = Cocoa_Paste();
@@ -146,10 +146,10 @@ bool CGUIEditControl::OnAction(const CAction &action)
}
#endif
}
- else if (action.wID >= KEY_VKEY && action.wID < KEY_ASCII)
+ else if (action.id >= KEY_VKEY && action.id < KEY_ASCII)
{
// input from the keyboard (vkey, not ascii)
- BYTE b = action.wID & 0xFF;
+ BYTE b = action.id & 0xFF;
if (b == 0x25 && m_cursorPos > 0)
{ // left
m_cursorPos--;
@@ -181,7 +181,7 @@ bool CGUIEditControl::OnAction(const CAction &action)
return true;
}
}
- else if (action.wID >= KEY_ASCII)
+ else if (action.id >= KEY_ASCII)
{
// input from the keyboard
switch (action.unicode)
@@ -220,11 +220,11 @@ bool CGUIEditControl::OnAction(const CAction &action)
OnTextChanged();
return true;
}
- else if (action.wID >= REMOTE_2 && action.wID <= REMOTE_9)
+ else if (action.id >= REMOTE_2 && action.id <= REMOTE_9)
{ // input from the remote
if (m_inputType == INPUT_TYPE_FILTER)
{ // filtering - use single number presses
- m_text2.insert(m_text2.begin() + m_cursorPos, L'0' + (action.wID - REMOTE_0));
+ m_text2.insert(m_text2.begin() + m_cursorPos, L'0' + (action.id - REMOTE_0));
m_cursorPos++;
OnTextChanged();
return true;
@@ -351,7 +351,7 @@ void CGUIEditControl::RenderText()
// start by rendering the normal text
float posX = m_posX + m_label.offsetX;
float posY = m_posY;
- DWORD align = m_label.align & XBFONT_CENTER_Y;
+ uint32_t align = m_label.align & XBFONT_CENTER_Y;
if (m_label.align & XBFONT_CENTER_Y)
posY += m_height*0.5f;
View
2  guilib/GUIFadeLabelControl.cpp
@@ -135,7 +135,7 @@ void CGUIFadeLabelControl::Render()
bool moveToNextLabel = false;
if (!m_scrollOut)
{
- vector<DWORD> text;
+ vector<uint32_t> text;
m_textLayout.GetFirstText(text);
if (m_scrollInfo.characterPos && m_scrollInfo.characterPos < text.size())
text.erase(text.begin(), text.begin() + min((int)m_scrollInfo.characterPos - 1, (int)text.size()));
View
6 guilib/GUIFixedListContainer.cpp
@@ -38,7 +38,7 @@ CGUIFixedListContainer::~CGUIFixedListContainer(void)
bool CGUIFixedListContainer::OnAction(const CAction &action)
{
- switch (action.wID)
+ switch (action.id)
{
case ACTION_PAGE_UP:
{
@@ -69,7 +69,7 @@ bool CGUIFixedListContainer::OnAction(const CAction &action)
// smooth scrolling (for analog controls)
case ACTION_SCROLL_UP:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > 0.4)
{
@@ -83,7 +83,7 @@ bool CGUIFixedListContainer::OnAction(const CAction &action)
break;
case ACTION_SCROLL_DOWN:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > 0.4)
{
View
32 guilib/GUIFont.cpp
@@ -45,7 +45,7 @@ float CScrollInfo::GetPixelsPerFrame()
return pixelSpeed * m_averageFrameTime;
}
-CGUIFont::CGUIFont(const CStdString& strFontName, DWORD style, DWORD textColor, DWORD shadowColor, float lineSpacing, CGUIFontTTFBase *font)
+CGUIFont::CGUIFont(const CStdString& strFontName, uint32_t style, color_t textColor, color_t shadowColor, float lineSpacing, CGUIFontTTFBase *font)
{
m_strFontName = strFontName;
m_style = style & 3;
@@ -69,8 +69,8 @@ CStdString& CGUIFont::GetFontName()
return m_strFontName;
}
-void CGUIFont::DrawText( float x, float y, const std::vector<DWORD> &colors, DWORD shadowColor,
- const std::vector<DWORD> &text, DWORD alignment, float maxPixelWidth)
+void CGUIFont::DrawText( float x, float y, const vecColors &colors, color_t shadowColor,
+ const vecText &text, uint32_t alignment, float maxPixelWidth)
{
if (!m_font) return;
@@ -79,7 +79,7 @@ void CGUIFont::DrawText( float x, float y, const std::vector<DWORD> &colors, DWO
return;
maxPixelWidth = ROUND(maxPixelWidth / g_graphicsContext.GetGUIScaleX());
- std::vector<DWORD> renderColors;
+ vecColors renderColors;
for (unsigned int i = 0; i < colors.size(); i++)
renderColors.push_back(g_graphicsContext.MergeAlpha(colors[i] ? colors[i] : m_textColor));
if (!shadowColor) shadowColor = m_shadowColor;
@@ -91,18 +91,18 @@ void CGUIFont::DrawText( float x, float y, const std::vector<DWORD> &colors, DWO
g_graphicsContext.RestoreClipRegion();
}
-void CGUIFont::DrawScrollingText(float x, float y, const std::vector<DWORD> &colors, DWORD shadowColor,
- const std::vector<DWORD> &text, DWORD alignment, float maxWidth, CScrollInfo &scrollInfo)
+void CGUIFont::DrawScrollingText(float x, float y, const vecColors &colors, color_t shadowColor,
+ const vecText &text, uint32_t alignment, float maxWidth, CScrollInfo &scrollInfo)
{
if (!m_font) return;
if (!shadowColor) shadowColor = m_shadowColor;
float spaceWidth = GetCharWidth(L' ');
// max chars on screen + extra margin chars
- std::vector<DWORD>::size_type maxChars =
+ vecText::size_type maxChars =
std::min<std::vector<DWORD>::size_type>(
- (text.size() + (std::vector<DWORD>::size_type)scrollInfo.suffix.size()),
- (std::vector<DWORD>::size_type)((maxWidth * 1.05f) / spaceWidth));
+ (text.size() + (vecText::size_type)scrollInfo.suffix.size()),
+ (vecText::size_type)((maxWidth * 1.05f) / spaceWidth));
if (!text.size() || ClippedRegionIsEmpty(x, y, maxWidth, alignment))
return; // nothing to render
@@ -176,9 +176,9 @@ void CGUIFont::DrawScrollingText(float x, float y, const std::vector<DWORD> &col
// Now rotate our string as needed, only take a slightly larger then visible part of the text.
unsigned int pos = scrollInfo.characterPos;
- std::vector<DWORD> renderText;
+ vecText renderText;
renderText.reserve(maxChars);
- for (std::vector<DWORD>::size_type i = 0; i < maxChars; i++)
+ for (vecText::size_type i = 0; i < maxChars; i++)
{
if (pos >= text.size() + scrollInfo.suffix.size())
pos = 0;
@@ -189,7 +189,7 @@ void CGUIFont::DrawScrollingText(float x, float y, const std::vector<DWORD> &col
pos++;
}
- std::vector<DWORD> renderColors;
+ vecColors renderColors;
for (unsigned int i = 0; i < colors.size(); i++)
renderColors.push_back(g_graphicsContext.MergeAlpha(colors[i] ? colors[i] : m_textColor));
@@ -203,14 +203,14 @@ void CGUIFont::DrawScrollingText(float x, float y, const std::vector<DWORD> &col
}
// remaps unsupported font glpyhs to other suitable ones
-SHORT CGUIFont::RemapGlyph(SHORT letter)
+uint16_t CGUIFont::RemapGlyph(uint16_t letter)
{
if (letter == 0x2019 || letter == 0x2018) return 0x0027; // single quotes
else if (letter == 0x201c || letter == 0x201d) return 0x0022;
return 0; // no decent character map
}
-bool CGUIFont::ClippedRegionIsEmpty(float x, float y, float width, DWORD alignment) const
+bool CGUIFont::ClippedRegionIsEmpty(float x, float y, float width, uint32_t alignment) const
{
if (alignment & XBFONT_CENTER_X)
x -= width * 0.5f;
@@ -222,14 +222,14 @@ bool CGUIFont::ClippedRegionIsEmpty(float x, float y, float width, DWORD alignme
return !g_graphicsContext.SetClipRegion(x, y, width, m_font->GetLineHeight(2.0f) * g_graphicsContext.GetGUIScaleY());
}
-float CGUIFont::GetTextWidth( const std::vector<DWORD> &text )
+float CGUIFont::GetTextWidth( const vecText &text )
{
if (!m_font) return 0;
CSingleLock lock(g_graphicsContext);
return m_font->GetTextWidthInternal(text.begin(), text.end()) * g_graphicsContext.GetGUIScaleX();
}
-float CGUIFont::GetCharWidth( DWORD ch )
+float CGUIFont::GetCharWidth( character_t ch )
{
if (!m_font) return 0;
CSingleLock lock(g_graphicsContext);
View
43 guilib/GUIFont.h
@@ -7,10 +7,12 @@
#define CGUILIB_GUIFONT_H
#pragma once
-#include "GraphicContext.h"
-#include "utils/SingleLock.h"
#include "StdString.h"
+typedef uint32_t character_t;
+typedef uint32_t color_t;
+typedef std::vector<character_t> vecText;
+typedef std::vector<color_t> vecColors;
class CGUIFontTTFBase;
@@ -27,7 +29,6 @@ class CGUIFontTTFBase;
#define FONT_STYLE_ITALICS 2
#define FONT_STYLE_BOLD_ITALICS 3
-
class CScrollInfo
{
public:
@@ -55,7 +56,7 @@ class CScrollInfo
m_averageFrameTime = 1000.f / abs(defaultSpeed);
m_lastFrameTime = 0;
}
- DWORD GetCurrentChar(const std::vector<DWORD> &text) const
+ uint32_t GetCurrentChar(const vecText &text) const
{
assert(text.size());
if (characterPos < text.size())
@@ -77,7 +78,7 @@ class CScrollInfo
static const int defaultSpeed = 60;
private:
float m_averageFrameTime;
- DWORD m_lastFrameTime;
+ uint32_t m_lastFrameTime;
};
/*!
@@ -87,36 +88,36 @@ class CScrollInfo
class CGUIFont
{
public:
- CGUIFont(const CStdString& strFontName, DWORD style, DWORD textColor, DWORD shadowColor, float lineSpacing, CGUIFontTTFBase *font);
+ CGUIFont(const CStdString& strFontName, uint32_t style, color_t textColor, color_t shadowColor, float lineSpacing, CGUIFontTTFBase *font);
virtual ~CGUIFont();
CStdString& GetFontName();
- void DrawText( float x, float y, DWORD color, DWORD shadowColor,
- const std::vector<DWORD> &text, DWORD alignment, float maxPixelWidth)
+ void DrawText( float x, float y, color_t color, color_t shadowColor,
+ const vecText &text, uint32_t alignment, float maxPixelWidth)
{
- std::vector<DWORD> colors;
+ vecColors colors;
colors.push_back(color);
DrawText(x, y, colors, shadowColor, text, alignment, maxPixelWidth);
};
- void DrawText( float x, float y, const std::vector<DWORD> &colors, DWORD shadowColor,
- const std::vector<DWORD> &text, DWORD alignment, float maxPixelWidth);
+ void DrawText( float x, float y, const vecColors &colors, color_t shadowColor,
+ const vecText &text, uint32_t alignment, float maxPixelWidth);
- void DrawScrollingText( float x, float y, const std::vector<DWORD> &colors, DWORD shadowColor,
- const std::vector<DWORD> &text, DWORD alignment, float maxPixelWidth, CScrollInfo &scrollInfo);
+ void DrawScrollingText( float x, float y, const vecColors &colors, color_t shadowColor,
+ const vecText &text, uint32_t alignment, float maxPixelWidth, CScrollInfo &scrollInfo);
- float GetTextWidth( const std::vector<DWORD> &text );
- float GetCharWidth( DWORD ch );
+ float GetTextWidth( const vecText &text );
+ float GetCharWidth( character_t ch );
float GetTextHeight(int numLines) const;
float GetLineHeight() const;
void Begin();
void End();
- DWORD GetStyle() const { return m_style; };
+ uint32_t GetStyle() const { return m_style; };
- static SHORT RemapGlyph(SHORT letter);
+ static uint16_t RemapGlyph(uint16_t letter);
CGUIFontTTFBase* GetFont() const
{
@@ -127,14 +128,14 @@ class CGUIFont
protected:
CStdString m_strFontName;
- DWORD m_style;
- DWORD m_shadowColor;
- DWORD m_textColor;
+ uint32_t m_style;
+ color_t m_shadowColor;
+ color_t m_textColor;
float m_lineSpacing;
CGUIFontTTFBase *m_font; // the font object has the size information
private:
- bool ClippedRegionIsEmpty(float x, float y, float width, DWORD alignment) const;
+ bool ClippedRegionIsEmpty(float x, float y, float width, uint32_t alignment) const;
};
#endif
View
6 guilib/GUIFontManager.cpp
@@ -49,7 +49,7 @@ GUIFontManager::~GUIFontManager(void)
Clear();
}
-CGUIFont* GUIFontManager::LoadTTF(const CStdString& strFontName, const CStdString& strFilename, DWORD textColor, DWORD shadowColor, const int iSize, const int iStyle, float lineSpacing, float aspect, RESOLUTION sourceRes)
+CGUIFont* GUIFontManager::LoadTTF(const CStdString& strFontName, const CStdString& strFilename, color_t textColor, color_t shadowColor, const int iSize, const int iStyle, float lineSpacing, float aspect, RESOLUTION sourceRes)
{
float originalAspect = aspect;
@@ -333,8 +333,8 @@ void GUIFontManager::LoadFonts(const TiXmlNode* fontNode)
if (pNode)
{
CStdString strFontName = pNode->FirstChild()->Value();
- DWORD shadowColor = 0;
- DWORD textColor = 0;
+ color_t shadowColor = 0;
+ color_t textColor = 0;
CGUIControlFactory::GetColor(fontNode, "shadow", shadowColor);
CGUIControlFactory::GetColor(fontNode, "color", textColor);
const TiXmlNode *pNode = fontNode->FirstChild("filename");
View
2  guilib/GUIFontManager.h
@@ -56,7 +56,7 @@ class GUIFontManager
virtual ~GUIFontManager(void);
void Unload(const CStdString& strFontName);
void LoadFonts(const CStdString& strFontSet);
- CGUIFont* LoadTTF(const CStdString& strFontName, const CStdString& strFilename, DWORD textColor, DWORD shadowColor, const int iSize, const int iStyle, float lineSpacing = 1.0f, float aspect = 1.0f, RESOLUTION res = RES_INVALID);
+ CGUIFont* LoadTTF(const CStdString& strFontName, const CStdString& strFilename, color_t textColor, color_t shadowColor, const int iSize, const int iStyle, float lineSpacing = 1.0f, float aspect = 1.0f, RESOLUTION res = RES_INVALID);
CGUIFont* GetFont(const CStdString& strFontName, bool fallback = true);
void Clear();
void FreeFontFile(CGUIFontTTFBase *pFont);
View
58 guilib/GUIFontTTF.cpp
@@ -132,7 +132,7 @@ CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName)
m_texture = NULL;
m_char = NULL;
m_maxChars = 0;
- m_dwNestedBeginCount = 0;
+ m_nestedBeginCount = 0;
m_bTextureLoaded = false;
m_vertex_size = 4*1024;
@@ -149,7 +149,7 @@ CGUIFontTTFBase::CGUIFontTTFBase(const CStdString& strFileName)
m_textureHeight = m_textureWidth = 0;
m_textureScaleX = m_textureScaleY = 0.0;
m_ellipsesWidth = m_height = 0.0f;
- m_dwColor = 0;
+ m_color = 0;
m_vertex_count = 0;
m_nTexture = 0;
}
@@ -208,7 +208,7 @@ void CGUIFontTTFBase::Clear()
m_numChars = 0;
m_posX = 0;
m_posY = 0;
- m_dwNestedBeginCount = 0;
+ m_nestedBeginCount = 0;
if (m_face)
g_freeTypeLibrary.ReleaseFont(m_face);
@@ -286,7 +286,7 @@ bool CGUIFontTTFBase::Load(const CStdString& strFilename, float height, float as
return true;
}
-void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vector<DWORD> &colors, const vector<DWORD> &text, DWORD alignment, float maxPixelWidth, bool scrolling)
+void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors, const vecText &text, uint32_t alignment, float maxPixelWidth, bool scrolling)
{
Begin();
@@ -330,7 +330,7 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vector<DWORD> &co
// first compute the size of the text to render in both characters and pixels
unsigned int lineChars = 0;
float linePixels = 0;
- for (vector<DWORD>::const_iterator pos = text.begin(); pos != text.end(); pos++)
+ for (vecText::const_iterator pos = text.begin(); pos != text.end(); pos++)
{
Character *ch = GetCharacter(*pos);
if (ch)
@@ -344,11 +344,11 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vector<DWORD> &co
}
float cursorX = 0; // current position along the line
- for (vector<DWORD>::const_iterator pos = text.begin(); pos != text.end(); pos++)
+ for (vecText::const_iterator pos = text.begin(); pos != text.end(); pos++)
{
// If starting text on a new line, determine justification effects
// Get the current letter in the CStdString
- DWORD color = (*pos & 0xff0000) >> 16;
+ color_t color = (*pos & 0xff0000) >> 16;
if (color >= colors.size())
color = 0;
color = colors[color];
@@ -395,7 +395,7 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vector<DWORD> &co
}
// this routine assumes a single line (i.e. it was called from GUITextLayout)
-float CGUIFontTTFBase::GetTextWidthInternal(vector<DWORD>::const_iterator start, vector<DWORD>::const_iterator end)
+float CGUIFontTTFBase::GetTextWidthInternal(vecText::const_iterator start, vecText::const_iterator end)
{
float width = 0;
while (start != end)
@@ -406,7 +406,7 @@ float CGUIFontTTFBase::GetTextWidthInternal(vector<DWORD>::const_iterator start,
return width;
}
-float CGUIFontTTFBase::GetCharWidthInternal(DWORD ch)
+float CGUIFontTTFBase::GetCharWidthInternal(character_t ch)
{
Character *c = GetCharacter(ch);
if (c) return c->advance;
@@ -425,10 +425,10 @@ float CGUIFontTTFBase::GetLineHeight(float lineSpacing) const
return 0.0f;
}
-CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
+CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(character_t chr)
{
- WCHAR letter = (WCHAR)(chr & 0xffff);
- DWORD style = (chr & 0x3000000) >> 24;
+ wchar_t letter = (wchar_t)(chr & 0xffff);
+ character_t style = (chr & 0x3000000) >> 24;
// ignore linebreaks
if (letter == L'\r')
@@ -437,13 +437,13 @@ CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
// quick access to ascii chars
if (letter < 255)
{
- DWORD ch = (style << 8) | letter;
+ character_t ch = (style << 8) | letter;
if (m_charquick[ch])
return m_charquick[ch];
}
// letters are stored based on style and letter
- DWORD ch = (style << 16) | letter;
+ character_t ch = (style << 16) | letter;
int low = 0;
int high = m_numChars - 1;
@@ -480,9 +480,9 @@ CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
}
// render the character to our texture
// must End() as we can't render text to our texture during a Begin(), End() block
- DWORD dwNestedBeginCount = m_dwNestedBeginCount;
- m_dwNestedBeginCount = 1;
- if (dwNestedBeginCount) End();
+ unsigned int nestedBeginCount = m_nestedBeginCount;
+ m_nestedBeginCount = 1;
+ if (nestedBeginCount) End();
if (!CacheCharacter(letter, style, m_char + low))
{ // unable to cache character - try clearing them all out and starting over
CLog::Log(LOGDEBUG, "GUIFontTTF::GetCharacter: Unable to cache character. Clearing character cache of %i characters", m_numChars);
@@ -491,13 +491,13 @@ CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
if (!CacheCharacter(letter, style, m_char + low))
{
CLog::Log(LOGERROR, "GUIFontTTF::GetCharacter: Unable to cache character (out of memory?)");
- if (dwNestedBeginCount) Begin();
- m_dwNestedBeginCount = dwNestedBeginCount;
+ if (nestedBeginCount) Begin();
+ m_nestedBeginCount = nestedBeginCount;
return NULL;
}
}
- if (dwNestedBeginCount) Begin();
- m_dwNestedBeginCount = dwNestedBeginCount;
+ if (nestedBeginCount) Begin();
+ m_nestedBeginCount = nestedBeginCount;
// fixup quick access
memset(m_charquick, 0, sizeof(m_charquick));
@@ -505,7 +505,7 @@ CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
{
if ((m_char[i].letterAndStyle & 0xffff) < 255)
{
- DWORD ch = ((m_char[i].letterAndStyle & 0xffff0000) >> 8) | (m_char[i].letterAndStyle & 0xff);
+ character_t ch = ((m_char[i].letterAndStyle & 0xffff0000) >> 8) | (m_char[i].letterAndStyle & 0xff);
m_charquick[ch] = m_char+i;
}
}
@@ -513,7 +513,7 @@ CGUIFontTTFBase::Character* CGUIFontTTFBase::GetCharacter(DWORD chr)
return m_char + low;
}
-bool CGUIFontTTFBase::CacheCharacter(WCHAR letter, DWORD style, Character *ch)
+bool CGUIFontTTFBase::CacheCharacter(wchar_t letter, uint32_t style, Character *ch)
{
int glyph_index = FT_Get_Char_Index( m_face, letter );
@@ -604,7 +604,7 @@ bool CGUIFontTTFBase::CacheCharacter(WCHAR letter, DWORD style, Character *ch)
return true;
}
-void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *ch, D3DCOLOR dwColor, bool roundX)
+void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX)
{
// actual image width isn't same as the character width as that is
// just baseline width and height should include the descent
@@ -673,15 +673,15 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c
m_vertex = (SVertex*)realloc(m_vertex, m_vertex_size * sizeof(SVertex));
}
- m_dwColor = dwColor;
+ m_color = color;
SVertex* v = m_vertex + m_vertex_count;
for(int i = 0; i < 4; i++)
{
- v[i].r = GET_R(dwColor);
- v[i].g = GET_G(dwColor);
- v[i].b = GET_B(dwColor);
- v[i].a = GET_A(dwColor);
+ v[i].r = GET_R(color);
+ v[i].g = GET_G(color);
+ v[i].b = GET_B(color);
+ v[i].a = GET_A(color);
}
v[0].u = tl;
View
32 guilib/GUIFontTTF.h
@@ -40,7 +40,11 @@ typedef struct FT_FaceRec_ *FT_Face;
typedef struct FT_LibraryRec_ *FT_Library;
typedef struct FT_GlyphSlotRec_ *FT_GlyphSlot;
typedef struct FT_BitmapGlyphRec_ *FT_BitmapGlyph;
-
+
+typedef uint32_t character_t;
+typedef uint32_t color_t;
+typedef std::vector<character_t> vecText;
+typedef std::vector<color_t> vecColors;
/*!
\ingroup textures
@@ -79,23 +83,23 @@ class CGUIFontTTFBase
short offsetX, offsetY;
float left, top, right, bottom;
float advance;
- DWORD letterAndStyle;
+ character_t letterAndStyle;
};
void AddReference();
void RemoveReference();
- float GetTextWidthInternal(std::vector<DWORD>::const_iterator start, std::vector<DWORD>::const_iterator end);
- float GetCharWidthInternal(DWORD ch);
+ float GetTextWidthInternal(vecText::const_iterator start, vecText::const_iterator end);
+ float GetCharWidthInternal(character_t ch);
float GetTextHeight(float lineSpacing, int numLines) const;
float GetLineHeight(float lineSpacing) const;
- void DrawTextInternal(float x, float y, const std::vector<DWORD> &colors, const std::vector<DWORD> &text,
- DWORD alignment, float maxPixelWidth, bool scrolling);
+ void DrawTextInternal(float x, float y, const vecColors &colors, const vecText &text,
+ uint32_t alignment, float maxPixelWidth, bool scrolling);
- void DrawTextInternal(float x, float y, DWORD color, const std::vector<DWORD> &text,
- DWORD alignment, float maxPixelWidth, bool scrolling)
+ void DrawTextInternal(float x, float y, color_t color, const vecText &text,
+ uint32_t alignment, float maxPixelWidth, bool scrolling)
{
- std::vector<DWORD> colors;
+ vecColors colors;
colors.push_back(color);
DrawTextInternal(x, y, colors, text, alignment, maxPixelWidth, scrolling);
}
@@ -104,9 +108,9 @@ class CGUIFontTTFBase
CStdString m_strFilename;
// Stuff for pre-rendering for speed
- inline Character *GetCharacter(DWORD letter);
- bool CacheCharacter(WCHAR letter, DWORD style, Character *ch);
- void RenderCharacter(float posX, float posY, const Character *ch, D3DCOLOR dwColor, bool roundX);
+ inline Character *GetCharacter(character_t letter);
+ bool CacheCharacter(wchar_t letter, uint32_t style, Character *ch);
+ void RenderCharacter(float posX, float posY, const Character *ch, color_t color, bool roundX);
void ClearCharacterCache();
virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0;
@@ -125,7 +129,7 @@ class CGUIFontTTFBase
int m_posX; // current position in the texture
int m_posY;
- DWORD m_dwColor;
+ color_t m_color;
Character *m_char; // our characters
Character *m_charquick[256*4]; // ascii chars (4 styles) here
@@ -137,7 +141,7 @@ class CGUIFontTTFBase
unsigned int m_cellBaseLine;
unsigned int m_cellHeight;
- DWORD m_dwNestedBeginCount; // speedups
+ unsigned int m_nestedBeginCount; // speedups
// freetype stuff
FT_Face m_face;
View
72 guilib/GUIFontTTFDX.cpp
@@ -59,65 +59,65 @@ CGUIFontTTFDX::~CGUIFontTTFDX(void)
void CGUIFontTTFDX::RenderInternal(SVertex* v)
{
CUSTOMVERTEX verts[4] = {
- { v[0].x-0.5f, v[0].y-0.5f, v[0].z, m_dwColor, v[0].u, v[0].v},
- { v[1].x-0.5f, v[1].y-0.5f, v[1].z, m_dwColor, v[1].u, v[1].v},
- { v[2].x-0.5f, v[2].y-0.5f, v[2].z, m_dwColor, v[2].u, v[2].v},
- { v[3].x-0.5f, v[3].y-0.5f, v[3].z, m_dwColor, v[3].u, v[3].v}
+ { v[0].x-0.5f, v[0].y-0.5f, v[0].z, m_color, v[0].u, v[0].v},
+ { v[1].x-0.5f, v[1].y-0.5f, v[1].z, m_color, v[1].u, v[1].v},
+ { v[2].x-0.5f, v[2].y-0.5f, v[2].z, m_color, v[2].u, v[2].v},
+ { v[3].x-0.5f, v[3].y-0.5f, v[3].z, m_color, v[3].u, v[3].v}
};
- m_pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(CUSTOMVERTEX));
+ g_Windowing.Get3DDevice()->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(CUSTOMVERTEX));
}
void CGUIFontTTFDX::Begin()
{
- m_pD3DDevice = g_Windowing.Get3DDevice();
+ LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice();
- if (m_dwNestedBeginCount == 0)
+ if (m_nestedBeginCount == 0)
{
// just have to blit from our texture.
- m_pD3DDevice->SetTexture( 0, m_texture->GetTextureObject() );
-
- m_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
- m_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );
- m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
- m_pD3DDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); // only use diffuse
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
+ pD3DDevice->SetTexture( 0, m_texture->GetTextureObject() );
+
+ pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
+ pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );
+ pD3DDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
+ pD3DDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); // only use diffuse
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
// no other texture stages needed
- m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
-
- m_pD3DDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
- m_pD3DDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
- m_pD3DDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
- m_pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
- m_pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
- m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
- m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
- m_pD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
-
- m_pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
+ pD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE);
+
+ pD3DDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
+ pD3DDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
+ pD3DDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
+ pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
+ pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
+ pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
+ pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
+ pD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
+
+ pD3DDevice->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
}
// Keep track of the nested begin/end calls.
m_vertex_count = 0;
- m_dwNestedBeginCount++;
+ m_nestedBeginCount++;
}
void CGUIFontTTFDX::End()
{
- m_pD3DDevice = g_Windowing.Get3DDevice();
+ LPDIRECT3DDEVICE9 pD3DDevice = g_Windowing.Get3DDevice();
- if (m_dwNestedBeginCount == 0)
+ if (m_nestedBeginCount == 0)
return;
- if (--m_dwNestedBeginCount > 0)
+ if (--m_nestedBeginCount > 0)
return;
- m_pD3DDevice->SetTexture(0, NULL);
- m_pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
+ pD3DDevice->SetTexture(0, NULL);
+ pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
}
CBaseTexture* CGUIFontTTFDX::ReallocTexture(unsigned int& newHeight)
View
2  guilib/GUIFontTTFDX.h
@@ -50,8 +50,6 @@ class CGUIFontTTFDX : public CGUIFontTTFBase
virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character *ch);
virtual void DeleteHardwareTexture();
virtual void RenderInternal(SVertex* v);
-
- LPDIRECT3DDEVICE9 m_pD3DDevice;
};
#endif
View
8 guilib/GUIFontTTFGL.cpp
@@ -56,7 +56,7 @@ CGUIFontTTFGL::~CGUIFontTTFGL(void)
void CGUIFontTTFGL::Begin()
{
- if (m_dwNestedBeginCount == 0)
+ if (m_nestedBeginCount == 0)
{
if (!m_bTextureLoaded)
{
@@ -99,15 +99,15 @@ void CGUIFontTTFGL::Begin()
m_vertex_count = 0;
}
// Keep track of the nested begin/end calls.
- m_dwNestedBeginCount++;
+ m_nestedBeginCount++;
}
void CGUIFontTTFGL::End()
{
- if (m_dwNestedBeginCount == 0)
+ if (m_nestedBeginCount == 0)
return;
- if (--m_dwNestedBeginCount > 0)
+ if (--m_nestedBeginCount > 0)
return;
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
View
6 guilib/GUIInfoColor.cpp
@@ -50,20 +50,20 @@ void CGUIInfoBool::Parse(const CStdString &info)
m_info = g_infoManager.GetBool(m_info);
}
-void CGUIInfoBool::Update(DWORD parentID, const CGUIListItem *item)
+void CGUIInfoBool::Update(int parentID, const CGUIListItem *item)
{
if (m_info)
m_value = g_infoManager.GetBool(m_info, parentID, item);
}
-CGUIInfoColor::CGUIInfoColor(DWORD color)
+CGUIInfoColor::CGUIInfoColor(uint32_t color)
{
m_color = color;
m_info = 0;
}
-const CGUIInfoColor &CGUIInfoColor::operator=(DWORD color)
+const CGUIInfoColor &CGUIInfoColor::operator=(uint32_t color)
{
m_color = color;
m_info = 0;
View
15 guilib/GUIInfoColor.h
@@ -30,7 +30,6 @@
*/
#include "StdString.h"
-#include "system.h"
class CGUIListItem;
@@ -40,7 +39,7 @@ class CGUIInfoBool
CGUIInfoBool(bool value = false);
operator bool() const { return m_value; };
- void Update(DWORD parentID = 0, const CGUIListItem *item = NULL);
+ void Update(int parentID = 0, const CGUIListItem *item = NULL);
void Parse(const CStdString &info);
private:
int m_info;
@@ -50,19 +49,19 @@ class CGUIInfoBool
class CGUIInfoColor
{
public:
- CGUIInfoColor(DWORD color = 0);
+ CGUIInfoColor(uint32_t color = 0);
const CGUIInfoColor &operator=(const CGUIInfoColor &color);
- const CGUIInfoColor &operator=(DWORD color);
- operator DWORD() const { return m_color; };
+ const CGUIInfoColor &operator=(uint32_t color);
+ operator uint32_t() const { return m_color; };
void Update();
void Parse(const CStdString &label);
private:
- DWORD GetColor() const;
- int m_info;
- DWORD m_color;
+ uint32_t GetColor() const;
+ int m_info;
+ uint32_t m_color;
};
#endif
View
6 guilib/GUILabelControl.cpp
@@ -258,8 +258,8 @@ void CGUILabelControl::UpdateInfo(const CGUIListItem *item)
else if (m_startHighlight || m_endHighlight)
{ // this is only used for times/dates, so working in ascii (utf8) is fine
CStdString colorLabel;
- colorLabel.Format("[COLOR %x]%s[/COLOR]%s[COLOR %x]%s[/COLOR]", (DWORD)m_label.disabledColor, label.Left(m_startHighlight),
- label.Mid(m_startHighlight, m_endHighlight - m_startHighlight), (DWORD)m_label.disabledColor, label.Mid(m_endHighlight));
+ colorLabel.Format("[COLOR %x]%s[/COLOR]%s[COLOR %x]%s[/COLOR]", (color_t)m_label.disabledColor, label.Left(m_startHighlight),
+ label.Mid(m_startHighlight, m_endHighlight - m_startHighlight), (color_t)m_label.disabledColor, label.Mid(m_endHighlight));
label = colorLabel;
}
@@ -333,7 +333,7 @@ void CGUILabelControl::SetWidthControl(bool bScroll, int scrollSpeed)
m_ScrollInfo.Reset();
}
-void CGUILabelControl::SetAlignment(DWORD align)
+void CGUILabelControl::SetAlignment(uint32_t align)
{
m_label.align = align;
}
View
4 guilib/GUILabelControl.h
@@ -91,7 +91,7 @@ class CGUILabelControl :
void SetInfo(const CGUIInfoLabel&labelInfo);
void SetWidthControl(bool bScroll, int scrollSpeed);
void SetTruncate(bool bTruncate);
- void SetAlignment(DWORD align);
+ void SetAlignment(uint32_t align);
void SetHighlight(unsigned int start, unsigned int end);
protected:
@@ -104,7 +104,7 @@ class CGUILabelControl :
bool m_bHasPath;
bool m_bShowCursor;
int m_iCursorPos;
- DWORD m_dwCounter;
+ unsigned int m_dwCounter;
// stuff for scrolling
bool m_ScrollInsteadOfTruncate;
CScrollInfo m_ScrollInfo;
View
6 guilib/GUIListContainer.cpp
@@ -37,7 +37,7 @@ CGUIListContainer::~CGUIListContainer(void)
bool CGUIListContainer::OnAction(const CAction &action)
{
- switch (action.wID)
+ switch (action.id)
{
case ACTION_PAGE_UP:
{
@@ -68,7 +68,7 @@ bool CGUIListContainer::OnAction(const CAction &action)
// smooth scrolling (for analog controls)
case ACTION_SCROLL_UP:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > 0.4)
{
@@ -88,7 +88,7 @@ bool CGUIListContainer::OnAction(const CAction &action)
break;
case ACTION_SCROLL_DOWN:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > 0.4)
{
View
4 guilib/GUIListLabel.cpp
@@ -70,14 +70,14 @@ void CGUIListLabel::UpdateColors()
void CGUIListLabel::Render()
{
- DWORD color = m_selected ? m_label.selectedColor : m_label.textColor;
+ color_t color = m_selected ? m_label.selectedColor : m_label.textColor;
bool needsToScroll = (m_renderRect.Width() + 0.5f < m_textWidth); // 0.5f to deal with floating point rounding issues
if (m_scrolling && needsToScroll)
m_textLayout.RenderScrolling(m_renderRect.x1, m_renderRect.y1, m_label.angle, color, m_label.shadowColor, 0, m_renderRect.Width(), m_scrollInfo);
else
{
float posX = m_renderRect.x1;
- DWORD align = 0;
+ uint32_t align = 0;
if (!needsToScroll)
{ // hack for right and centered multiline text, as GUITextLayout::Render() treats posX as the right hand
// or center edge of the text (see GUIFontTTF::DrawTextInternal), and this has already been taken care of
View
10 guilib/GUIMoverControl.cpp
@@ -85,21 +85,21 @@ void CGUIMoverControl::Render()
bool CGUIMoverControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
// button selected - send message to parent
CGUIMessage message(GUI_MSG_CLICKED, GetID(), GetParentID());
SendWindowMessage(message);
return true;
}
- if (action.wID == ACTION_ANALOG_MOVE)
+ if (action.id == ACTION_ANALOG_MOVE)
{
// if (m_dwAllowedDirections == ALLOWED_DIRECTIONS_UPDOWN)
- // Move(0, (int)(-m_fAnalogSpeed*action.fAmount2));
+ // Move(0, (int)(-m_fAnalogSpeed*action.amount2));
// else if (m_dwAllowedDirections == ALLOWED_DIRECTIONS_LEFTRIGHT)
- // Move((int)(m_fAnalogSpeed*action.fAmount1), 0);
+ // Move((int)(m_fAnalogSpeed*action.amount1), 0);
// else // ALLOWED_DIRECTIONS_ALL
- Move((int)(m_fAnalogSpeed*action.fAmount1), (int)( -m_fAnalogSpeed*action.fAmount2));
+ Move((int)(m_fAnalogSpeed*action.amount1), (int)( -m_fAnalogSpeed*action.amount2));
return true;
}
// base class
View
4 guilib/GUIMultiSelectText.cpp
@@ -156,7 +156,7 @@ void CGUIMultiSelectTextControl::UpdateInfo(const CGUIListItem *item)
bool CGUIMultiSelectTextControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
// item is clicked - see if we have a clickaction
CStdString clickAction;
@@ -253,7 +253,7 @@ bool CGUIMultiSelectTextControl::OnMouseClick(DWORD dwButton, const CPoint &poin
m_selectedItem = GetItemFromPoint(point);
g_Mouse.SetState(MOUSE_STATE_CLICK);
CAction action;
- action.wID = ACTION_SELECT_ITEM;
+ action.id = ACTION_SELECT_ITEM;
OnAction(action);
return true;
}
View
6 guilib/GUIPanelContainer.cpp
@@ -119,7 +119,7 @@ void CGUIPanelContainer::Render()
bool CGUIPanelContainer::OnAction(const CAction &action)
{
- switch (action.wID)
+ switch (action.id)
{
case ACTION_PAGE_UP:
{
@@ -150,7 +150,7 @@ bool CGUIPanelContainer::OnAction(const CAction &action)
// smooth scrolling (for analog controls)
case ACTION_SCROLL_UP:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > AnalogScrollSpeed())
{
@@ -170,7 +170,7 @@ bool CGUIPanelContainer::OnAction(const CAction &action)
break;
case ACTION_SCROLL_DOWN:
{
- m_analogScrollCount += action.fAmount1 * action.fAmount1;
+ m_analogScrollCount += action.amount1 * action.amount1;
bool handled = false;
while (m_analogScrollCount > AnalogScrollSpeed())
{
View
5 guilib/GUIRSSControl.cpp
@@ -24,6 +24,7 @@
#include "GUISettings.h"
#include "utils/CriticalSection.h"
#include "utils/SingleLock.h"
+#include "utils/RssReader.h"
#include "StringUtils.h"
using namespace std;
@@ -114,7 +115,7 @@ void CGUIRSSControl::Render()
if (m_label.font)
{
- vector<DWORD> colors;
+ vecColors colors;
colors.push_back(m_label.textColor);
colors.push_back(m_headlineColor);
colors.push_back(m_channelColor);
@@ -130,7 +131,7 @@ void CGUIRSSControl::Render()
CGUIControl::Render();
}
-void CGUIRSSControl::OnFeedUpdate(const vector<DWORD> &feed)
+void CGUIRSSControl::OnFeedUpdate(const vecText &feed)
{
CSingleLock lock(m_criticalSection);
m_feed = feed;
View
20 guilib/GUIRSSControl.h
@@ -30,7 +30,21 @@
*/
#include "GUIControl.h"
-#include "utils/RssReader.h"
+
+typedef uint32_t character_t;
+typedef uint32_t color_t;
+typedef std::vector<character_t> vecText;
+typedef std::vector<color_t> vecColors;
+
+class CRssReader;
+
+class IRssObserver
+{
+public:
+ virtual void OnFeedUpdate(const vecText &feed) = 0;
+ virtual void OnFeedRelease() = 0;
+ virtual ~IRssObserver() {}
+};
/*!
\ingroup controls
@@ -45,7 +59,7 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
virtual CGUIRSSControl *Clone() const { return new CGUIRSSControl(*this); };
virtual void Render();
- virtual void OnFeedUpdate(const std::vector<DWORD> &feed);
+ virtual void OnFeedUpdate(const vecText &feed);
virtual void OnFeedRelease();
virtual bool CanFocus() const { return false; };
@@ -58,7 +72,7 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
CCriticalSection m_criticalSection;
CRssReader* m_pReader;
- std::vector<DWORD> m_feed;
+ vecText m_feed;
CStdString m_strRSSTags;
View
2  guilib/GUIRadioButtonControl.cpp
@@ -60,7 +60,7 @@ void CGUIRadioButtonControl::Render()
bool CGUIRadioButtonControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
m_bSelected = !m_bSelected;
}
View
6 guilib/GUIResizeControl.cpp
@@ -84,16 +84,16 @@ void CGUIResizeControl::Render()
bool CGUIResizeControl::OnAction(const CAction &action)
{
- if (action.wID == ACTION_SELECT_ITEM)
+ if (action.id == ACTION_SELECT_ITEM)
{
// button selected - send message to parent
CGUIMessage message(GUI_MSG_CLICKED, GetID(), GetParentID());
SendWindowMessage(message);
return true;
}
- if (action.wID == ACTION_ANALOG_MOVE)
+ if (action.id == ACTION_ANALOG_MOVE)
{
- Resize(m_fAnalogSpeed*action.fAmount1, -m_fAnalogSpeed*action.fAmount2);
+ Resize(m_fAnalogSpeed*action.amount1, -m_fAnalogSpeed*action.amount2);