diff --git a/src/preferences/appearance/APRWindow.h b/src/preferences/appearance/APRWindow.h deleted file mode 100644 index 1907fc4964..0000000000 --- a/src/preferences/appearance/APRWindow.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2002-2012, Haiku. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * DarkWyrm (darkwyrm@earthlink.net) - * Alexander von Gluck, kallisti5@unixzen.com - * Stephan Aßmus - */ -#ifndef APR_WINDOW_H -#define APR_WINDOW_H - - -#include -#include -#include -#include -#include - -class APRView; -class AntialiasingSettingsView; -class FontView; -class LookAndFeelSettingsView; - - -class APRWindow : public BWindow { -public: - APRWindow(BRect frame); - void MessageReceived(BMessage *message); - -private: - void _UpdateButtons(); - bool _IsDefaultable() const; - bool _IsRevertable() const; - - APRView* fColorsView; - BButton* fDefaultsButton; - BButton* fRevertButton; - - AntialiasingSettingsView* fAntialiasingSettings; - FontView* fFontSettings; - LookAndFeelSettingsView* fLookAndFeelSettings; -}; - - -static const int32 kMsgUpdate = 'updt'; - - -#endif diff --git a/src/preferences/appearance/AntialiasingSettingsView.cpp b/src/preferences/appearance/AntialiasingSettingsView.cpp index b3b4f881c6..375026c840 100644 --- a/src/preferences/appearance/AntialiasingSettingsView.cpp +++ b/src/preferences/appearance/AntialiasingSettingsView.cpp @@ -23,7 +23,7 @@ #include -#include "APRWindow.h" +#include "AppearanceWindow.h" #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "AntialiasingSettingsView" diff --git a/src/preferences/appearance/APRMain.cpp b/src/preferences/appearance/Appearance.cpp similarity index 64% rename from src/preferences/appearance/APRMain.cpp rename to src/preferences/appearance/Appearance.cpp index 1b6dd0668e..8890c9a8b2 100644 --- a/src/preferences/appearance/APRMain.cpp +++ b/src/preferences/appearance/Appearance.cpp @@ -5,24 +5,24 @@ * Authors: * DarkWyrm (darkwyrm@earthlink.net) */ -#include "APRMain.h" -#include "APRWindow.h" +#include "Appearance.h" +#include "AppearanceWindow.h" #include #include #include -APRApplication::APRApplication(void) +AppearanceApplication::AppearanceApplication(void) : BApplication("application/x-vnd.Haiku-Appearance") { - fWindow = new APRWindow(BRect(100, 100, 550, 420)); + fWindow = new AppearanceWindow(BRect(100, 100, 550, 420)); fWindow->Show(); } int main(int, char**) { - APRApplication myApplication; + AppearanceApplication myApplication; myApplication.Run(); return(0); diff --git a/src/preferences/appearance/APRMain.h b/src/preferences/appearance/Appearance.h similarity index 54% rename from src/preferences/appearance/APRMain.h rename to src/preferences/appearance/Appearance.h index 951f91f4cd..f208d96632 100644 --- a/src/preferences/appearance/APRMain.h +++ b/src/preferences/appearance/Appearance.h @@ -5,22 +5,22 @@ * Authors: * DarkWyrm (darkwyrm@earthlink.net) */ -#ifndef APR_MAIN_H -#define APR_MAIN_H +#ifndef APPEARANCE_H +#define APPEARANCE_H #include #include -class APRWindow; +class AppearanceWindow; -class APRApplication : public BApplication +class AppearanceApplication : public BApplication { public: - APRApplication(void); + AppearanceApplication(void); private: - APRWindow *fWindow; + AppearanceWindow *fWindow; }; -#endif +#endif /* APPEARANCE_H */ diff --git a/src/preferences/appearance/APRWindow.cpp b/src/preferences/appearance/AppearanceWindow.cpp similarity index 88% rename from src/preferences/appearance/APRWindow.cpp rename to src/preferences/appearance/AppearanceWindow.cpp index 6da09152d9..9675c47bc8 100644 --- a/src/preferences/appearance/APRWindow.cpp +++ b/src/preferences/appearance/AppearanceWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011, Haiku. All rights reserved. + * Copyright 2002-2025, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -9,7 +9,7 @@ */ -#include "APRWindow.h" +#include "AppearanceWindow.h" #include #include @@ -20,11 +20,12 @@ #include #include "AntialiasingSettingsView.h" -#include "APRView.h" +#include "ColorsView.h" #include "FontView.h" #include "LookAndFeelSettingsView.h" +// This file used to be called APRWindow, left this to avoid retranslating everything #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "APRWindow" @@ -33,7 +34,7 @@ static const uint32 kMsgSetDefaults = 'dflt'; static const uint32 kMsgRevert = 'rvrt'; -APRWindow::APRWindow(BRect frame) +AppearanceWindow::AppearanceWindow(BRect frame) : BWindow(frame, B_TRANSLATE_SYSTEM_NAME("Appearance"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS @@ -49,7 +50,7 @@ APRWindow::APRWindow(BRect frame) fFontSettings = new FontView(B_TRANSLATE("Fonts")); - fColorsView = new APRView(B_TRANSLATE("Colors")); + fColorsView = new ColorsView(B_TRANSLATE("Colors")); fLookAndFeelSettings = new LookAndFeelSettingsView( B_TRANSLATE("Look and feel")); @@ -79,7 +80,7 @@ APRWindow::APRWindow(BRect frame) void -APRWindow::MessageReceived(BMessage *message) +AppearanceWindow::MessageReceived(BMessage *message) { switch (message->what) { case kMsgUpdate: @@ -112,7 +113,7 @@ APRWindow::MessageReceived(BMessage *message) void -APRWindow::_UpdateButtons() +AppearanceWindow::_UpdateButtons() { fDefaultsButton->SetEnabled(_IsDefaultable()); fRevertButton->SetEnabled(_IsRevertable()); @@ -120,7 +121,7 @@ APRWindow::_UpdateButtons() bool -APRWindow::_IsDefaultable() const +AppearanceWindow::_IsDefaultable() const { // printf("fonts defaultable: %d\n", fFontSettings->IsDefaultable()); // printf("colors defaultable: %d\n", fColorsView->IsDefaultable()); @@ -134,7 +135,7 @@ APRWindow::_IsDefaultable() const bool -APRWindow::_IsRevertable() const +AppearanceWindow::_IsRevertable() const { // printf("fonts revertable: %d\n", fFontSettings->IsRevertable()); // printf("colors revertable: %d\n", fColorsView->IsRevertable()); diff --git a/src/preferences/appearance/AppearanceWindow.h b/src/preferences/appearance/AppearanceWindow.h new file mode 100644 index 0000000000..91d60acf30 --- /dev/null +++ b/src/preferences/appearance/AppearanceWindow.h @@ -0,0 +1,49 @@ +/* + * Copyright 2002-2025, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * DarkWyrm (darkwyrm@earthlink.net) + * Alexander von Gluck, kallisti5@unixzen.com + * Stephan Aßmus + */ +#ifndef APPEARANCE_WINDOW_H +#define APPEARANCE_WINDOW_H + + +#include +#include +#include +#include +#include + +class ColorsView; +class AntialiasingSettingsView; +class FontView; +class LookAndFeelSettingsView; + + +class AppearanceWindow : public BWindow { +public: + AppearanceWindow(BRect frame); + void MessageReceived(BMessage *message); + +private: + void _UpdateButtons(); + bool _IsDefaultable() const; + bool _IsRevertable() const; + + ColorsView* fColorsView; + BButton* fDefaultsButton; + BButton* fRevertButton; + + AntialiasingSettingsView* fAntialiasingSettings; + FontView* fFontSettings; + LookAndFeelSettingsView* fLookAndFeelSettings; +}; + + +static const int32 kMsgUpdate = 'updt'; + + +#endif /* APPEARANCE_WINDOW_H */ diff --git a/src/preferences/appearance/APRView.cpp b/src/preferences/appearance/ColorsView.cpp similarity index 94% rename from src/preferences/appearance/APRView.cpp rename to src/preferences/appearance/ColorsView.cpp index f07190bba4..0d8d2ada85 100644 --- a/src/preferences/appearance/APRView.cpp +++ b/src/preferences/appearance/ColorsView.cpp @@ -10,7 +10,6 @@ */ -#include "APRView.h" #include @@ -29,8 +28,9 @@ #include #include -#include "APRWindow.h" +#include "AppearanceWindow.h" #include "Colors.h" +#include "ColorsView.h" #undef B_TRANSLATION_CONTEXT @@ -47,7 +47,7 @@ using BPrivate::BColorListView; using BPrivate::BColorPreview; -APRView::APRView(const char* name) +ColorsView::ColorsView(const char* name) : BView(name, B_WILL_DRAW) { @@ -87,13 +87,13 @@ APRView::APRView(const char* name) } -APRView::~APRView() +ColorsView::~ColorsView() { } void -APRView::AttachedToWindow() +ColorsView::AttachedToWindow() { fAutoSelectCheckBox->SetTarget(this); fPicker->SetTarget(this); @@ -106,7 +106,7 @@ APRView::AttachedToWindow() void -APRView::MessageReceived(BMessage* message) +ColorsView::MessageReceived(BMessage* message) { if (message->WasDropped()) { // Received from color preview when dropped on @@ -194,7 +194,7 @@ APRView::MessageReceived(BMessage* message) void -APRView::LoadSettings() +ColorsView::LoadSettings() { get_default_colors(&fDefaultColors); get_current_colors(&fCurrentColors); @@ -203,7 +203,7 @@ APRView::LoadSettings() void -APRView::SetDefaults() +ColorsView::SetDefaults() { _SetUIColors(fDefaultColors); _UpdatePreviews(fDefaultColors); @@ -221,7 +221,7 @@ APRView::SetDefaults() void -APRView::Revert() +ColorsView::Revert() { _SetUIColors(fPrevColors); _UpdatePreviews(fPrevColors); @@ -236,21 +236,21 @@ APRView::Revert() bool -APRView::IsDefaultable() +ColorsView::IsDefaultable() { return !fDefaultColors.HasSameData(fCurrentColors); } bool -APRView::IsRevertable() +ColorsView::IsRevertable() { return !fPrevColors.HasSameData(fCurrentColors); } void -APRView::_CreateItems() +ColorsView::_CreateItems() { while (fAttrList->CountItems() > 0) delete fAttrList->RemoveItem((int32)0); @@ -278,7 +278,7 @@ APRView::_CreateItems() void -APRView::_UpdatePreviews(const BMessage& colors) +ColorsView::_UpdatePreviews(const BMessage& colors) { rgb_color color; for (int32 i = color_description_count() - 1; i >= 0; i--) { @@ -296,7 +296,7 @@ APRView::_UpdatePreviews(const BMessage& colors) void -APRView::_SetUIColors(const BMessage& colors) +ColorsView::_SetUIColors(const BMessage& colors) { set_ui_colors(&colors); fCurrentColors = colors; @@ -304,7 +304,7 @@ APRView::_SetUIColors(const BMessage& colors) void -APRView::_SetCurrentColor(rgb_color color) +ColorsView::_SetCurrentColor(rgb_color color) { _SetColor(fWhich, color); @@ -321,7 +321,7 @@ APRView::_SetCurrentColor(rgb_color color) void -APRView::_SetColor(color_which which, rgb_color color) +ColorsView::_SetColor(color_which which, rgb_color color) { _SetOneColor(which, color); @@ -437,7 +437,7 @@ APRView::_SetColor(color_which which, rgb_color color) void -APRView::_SetOneColor(color_which which, rgb_color color) +ColorsView::_SetOneColor(color_which which, rgb_color color) { if (ui_color(which) == color) return; diff --git a/src/preferences/appearance/APRView.h b/src/preferences/appearance/ColorsView.h similarity index 86% rename from src/preferences/appearance/APRView.h rename to src/preferences/appearance/ColorsView.h index a1a5c66c2e..f89f06d18e 100644 --- a/src/preferences/appearance/APRView.h +++ b/src/preferences/appearance/ColorsView.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015, Haiku. All rights reserved. + * Copyright 2002-2025, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -8,8 +8,8 @@ * Stephan Aßmus * Joseph Groover */ -#ifndef APR_VIEW_H_ -#define APR_VIEW_H_ +#ifndef COLORS_VIEW_H_ +#define COLORS_VIEW_H_ #include @@ -38,10 +38,10 @@ class APRWindow; using BPrivate::BColorPreview; -class APRView : public BView { +class ColorsView : public BView { public: - APRView(const char *name); - virtual ~APRView(); + ColorsView(const char *name); + virtual ~ColorsView(); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage *msg); @@ -80,4 +80,4 @@ private: BMessage fCurrentColors; }; -#endif // APR_VIEW_H_ +#endif // COLORS_VIEW_H_ diff --git a/src/preferences/appearance/FontView.cpp b/src/preferences/appearance/FontView.cpp index 1f57116a44..b9b97bf950 100644 --- a/src/preferences/appearance/FontView.cpp +++ b/src/preferences/appearance/FontView.cpp @@ -25,7 +25,7 @@ #include #include -#include "APRWindow.h" +#include "AppearanceWindow.h" #include "FontSelectionView.h" #undef B_TRANSLATION_CONTEXT diff --git a/src/preferences/appearance/Jamfile b/src/preferences/appearance/Jamfile index e69d2e57c5..210ed0b11f 100644 --- a/src/preferences/appearance/Jamfile +++ b/src/preferences/appearance/Jamfile @@ -5,20 +5,15 @@ AddSubDirSupportedPlatforms libbe_test ; UsePrivateHeaders shared app interface [ FDirName servers app ] ; Preference Appearance : - APRMain.cpp AntialiasingSettingsView.cpp - LookAndFeelSettingsView.cpp + Appearance.cpp + AppearanceWindow.cpp + Colors.cpp + ColorsView.cpp FakeScrollBar.cpp FontSelectionView.cpp FontView.cpp - APRView.cpp - APRWindow.cpp - Colors.cpp - - # These are currently disabled while everything else is being worked on - #CurView.cpp - #CursorWhichItem.cpp - #SysCursorAPI.cpp + LookAndFeelSettingsView.cpp : be [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub shared : Appearance.rdef @@ -28,8 +23,8 @@ DoCatalogs Appearance : x-vnd.Haiku-Appearance : AntialiasingSettingsView.cpp - APRView.cpp - APRWindow.cpp + ColorsView.cpp + AppearanceWindow.cpp Colors.cpp LookAndFeelSettingsView.cpp FontView.cpp diff --git a/src/preferences/appearance/LookAndFeelSettingsView.cpp b/src/preferences/appearance/LookAndFeelSettingsView.cpp index 1017445ba7..fd574637df 100644 --- a/src/preferences/appearance/LookAndFeelSettingsView.cpp +++ b/src/preferences/appearance/LookAndFeelSettingsView.cpp @@ -40,7 +40,7 @@ #include #include -#include "APRWindow.h" +#include "AppearanceWindow.h" #include "FakeScrollBar.h"