From d1dea8508349895813942d693b8d0016a342c861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 26 Jan 2008 19:18:10 +0000 Subject: [PATCH] This should fix R5 build. Won't change color (and misses fonts yet) but the rest should work mostly (even setting one of the 4 decors). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23752 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- 3rdparty/mmu_man/themes/Jamfile | 2 +- 3rdparty/mmu_man/themes/ThemeManager.cpp | 2 ++ 3rdparty/mmu_man/themes/UITheme.h | 22 ++++++++++++++++--- ...ecorAddon.cpp => BeOSWindowDecorAddon.cpp} | 4 ++-- .../mmu_man/themes/addons/SoundsAddon.cpp | 4 ++++ 5 files changed, 28 insertions(+), 6 deletions(-) rename 3rdparty/mmu_man/themes/addons/{DanoWindowDecorAddon.cpp => BeOSWindowDecorAddon.cpp} (97%) diff --git a/3rdparty/mmu_man/themes/Jamfile b/3rdparty/mmu_man/themes/Jamfile index 5a1fae6dec..668241dc4b 100644 --- a/3rdparty/mmu_man/themes/Jamfile +++ b/3rdparty/mmu_man/themes/Jamfile @@ -11,8 +11,8 @@ local addonSources ; addonSources = BackgroundsAddon.cpp BeIDEAddon.cpp + BeOSWindowDecorAddon.cpp DanoUISettingsAddon.cpp - DanoWindowDecorAddon.cpp DeskbarAddon.cpp EddieAddon.cpp HaikuUISettingsAddon.cpp diff --git a/3rdparty/mmu_man/themes/ThemeManager.cpp b/3rdparty/mmu_man/themes/ThemeManager.cpp index a7d6efa4a7..66bf7e0696 100644 --- a/3rdparty/mmu_man/themes/ThemeManager.cpp +++ b/3rdparty/mmu_man/themes/ThemeManager.cpp @@ -192,8 +192,10 @@ status_t ThemeManager::LoadAddons() ta = instanciate_themes_addon_sounds(); ta = instanciate_themes_addon_terminal(); ADDA(ta); +#if defined(__HAIKU__) || defined(B_BEOS_VERSION_DANO) ta = instanciate_themes_addon_ui_settings(); ADDA(ta); +#endif #ifndef ZETA_ADDONS ta = instanciate_themes_addon_winamp_skin(); ADDA(ta); diff --git a/3rdparty/mmu_man/themes/UITheme.h b/3rdparty/mmu_man/themes/UITheme.h index b4d5cf053b..21c5f48e67 100644 --- a/3rdparty/mmu_man/themes/UITheme.h +++ b/3rdparty/mmu_man/themes/UITheme.h @@ -47,12 +47,11 @@ // do read settings from native storage #define UI_THEME_SETTINGS_RETRIEVE 0x00000004 - - - #define Z_THEMES_FOLDER_NAME "UIThemes" #define Z_THEME_FILE_NAME "Theme" +/* compatibility stuff ahead */ + /* some field names not always defined */ #ifndef B_BEOS_VERSION_DANO #define B_UI_PANEL_BACKGROUND_COLOR "be:c:PanBg" @@ -82,4 +81,21 @@ #define B_UI_SETTINGS_CHANGED '_UIC' #endif +#ifndef __HAIKU__ +#ifndef B_BEOS_VERSION_DANO +// R5 compatibility +#define B_PANEL_TEXT_COLOR B_MENU_ITEM_TEXT_COLOR +inline rgb_color make_color(uint8 red, uint8 green, uint8 blue, uint8 alpha=255) +{ + rgb_color c; + c.red = red; + c.green = green; + c.blue = blue; + c.alpha = alpha; + return c; +} +#endif +#endif + + #endif /* _Z_UI_THEME_H */ diff --git a/3rdparty/mmu_man/themes/addons/DanoWindowDecorAddon.cpp b/3rdparty/mmu_man/themes/addons/BeOSWindowDecorAddon.cpp similarity index 97% rename from 3rdparty/mmu_man/themes/addons/DanoWindowDecorAddon.cpp rename to 3rdparty/mmu_man/themes/addons/BeOSWindowDecorAddon.cpp index 63b5886fe3..2e9a02ba2a 100644 --- a/3rdparty/mmu_man/themes/addons/DanoWindowDecorAddon.cpp +++ b/3rdparty/mmu_man/themes/addons/BeOSWindowDecorAddon.cpp @@ -3,7 +3,7 @@ */ #include -#ifdef B_BEOS_VERSION_DANO +#if defined(B_BEOS_VERSION) && !defined(__HAIKU__) #include #include @@ -161,4 +161,4 @@ ThemesAddon *instanciate_themes_addon() return (ThemesAddon *) new DecorThemesAddon; } -#endif /* B_BEOS_VERSION_DANO */ +#endif /* B_BEOS_VERSION && !__HAIKU__ */ diff --git a/3rdparty/mmu_man/themes/addons/SoundsAddon.cpp b/3rdparty/mmu_man/themes/addons/SoundsAddon.cpp index 1518df4b37..14446b2df0 100644 --- a/3rdparty/mmu_man/themes/addons/SoundsAddon.cpp +++ b/3rdparty/mmu_man/themes/addons/SoundsAddon.cpp @@ -143,8 +143,10 @@ status_t SoundsThemesAddon::ApplyTheme(BMessage &theme, uint32 flags) continue; if (msg.FindFloat("sounds:volume", &gain) < B_OK) continue; +#if defined(__HAIKU__) || defined(B_BEOS_VERSION_DANO) if (bmfs.SetAudioGainFor(BMediaFiles::B_SOUNDS, field_name, gain) < B_OK) continue; +#endif } return B_OK; @@ -175,8 +177,10 @@ status_t SoundsThemesAddon::MakeTheme(BMessage &theme, uint32 flags) //printf("\t%s: %s\n", item.String(), path.Path()); if (path.Path()) { msg.AddString("sounds:file", path.Path()); +#if defined(__HAIKU__) || defined(B_BEOS_VERSION_DANO) if (bmfs.GetAudioGainFor(BMediaFiles::B_SOUNDS, item.String(), &gain) >= B_OK) msg.AddFloat("sounds:volume", gain); +#endif } sounds.AddMessage(item.String(), &msg); }