1 /* 2 * Copyright 2001-2009, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Rafael Romo 7 * Stefano Ceccherini (burton666@libero.it) 8 * Thomas Kurschel 9 * Axel Dörfler, axeld@pinc-software.de 10 */ 11 #ifndef SCREEN_WINDOW_H 12 #define SCREEN_WINDOW_H 13 14 15 #include <Window.h> 16 17 #include "ScreenMode.h" 18 19 20 class BBox; 21 class BPopUpMenu; 22 class BMenuField; 23 class BStringView; 24 class BTextControl; 25 26 class RefreshWindow; 27 class MonitorView; 28 class ScreenSettings; 29 30 31 class ScreenWindow : public BWindow { 32 public: 33 ScreenWindow(ScreenSettings *settings); 34 virtual ~ScreenWindow(); 35 36 virtual bool QuitRequested(); 37 virtual void MessageReceived(BMessage *message); 38 virtual void WorkspaceActivated(int32 ws, bool state); 39 virtual void ScreenChanged(BRect frame, color_space mode); 40 41 private: 42 BButton* _CreateColumnRowButton(bool columns, bool plus); 43 BButton* _GetColumnRowButton(bool columns, bool plus); 44 45 void _BuildSupportedColorSpaces(); 46 47 void _CheckApplyEnabled(); 48 void _CheckResolutionMenu(); 49 void _CheckColorMenu(); 50 void _CheckRefreshMenu(); 51 52 void _UpdateActiveMode(); 53 void _UpdateActiveMode(int32 workspace); 54 void _UpdateWorkspaceButtons(); 55 void _UpdateRefreshControl(); 56 void _UpdateMonitorView(); 57 void _UpdateControls(); 58 void _UpdateOriginal(); 59 void _UpdateMonitor(); 60 void _UpdateColorLabel(); 61 62 void _Apply(); 63 64 status_t _WriteVesaModeFile(const screen_mode& mode) const; 65 bool _IsVesa() const { return fIsVesa; } 66 67 private: 68 ScreenSettings* fSettings; 69 bool fIsVesa; 70 bool fBootWorkspaceApplied; 71 72 BStringView* fMonitorInfo; 73 BStringView* fDeviceInfo; 74 MonitorView* fMonitorView; 75 BMenuItem* fAllWorkspacesItem; 76 77 BTextControl* fColumnsControl; 78 BTextControl* fRowsControl; 79 BButton* fWorkspacesButtons[4]; 80 81 uint32 fSupportedColorSpaces; 82 BMenuItem* fUserSelectedColorSpace; 83 84 BPopUpMenu* fResolutionMenu; 85 BMenuField* fResolutionField; 86 BPopUpMenu* fColorsMenu; 87 BMenuField* fColorsField; 88 BPopUpMenu* fRefreshMenu; 89 BMenuField* fRefreshField; 90 BMenuItem* fOtherRefresh; 91 92 BPopUpMenu* fCombineMenu; 93 BMenuField* fCombineField; 94 BPopUpMenu* fSwapDisplaysMenu; 95 BMenuField* fSwapDisplaysField; 96 BPopUpMenu* fUseLaptopPanelMenu; 97 BMenuField* fUseLaptopPanelField; 98 BPopUpMenu* fTVStandardMenu; 99 BMenuField* fTVStandardField; 100 101 BButton* fDefaultsButton; 102 BButton* fApplyButton; 103 BButton* fRevertButton; 104 105 BButton* fBackgroundsButton; 106 107 ScreenMode fScreenMode; 108 ScreenMode fUndoScreenMode; 109 // screen modes for all workspaces 110 111 screen_mode fActive, fSelected, fOriginal; 112 // screen modes for the current workspace 113 114 uint32 fOriginalWorkspacesColumns; 115 uint32 fOriginalWorkspacesRows; 116 bool fModified; 117 }; 118 119 #endif /* SCREEN_WINDOW_H */ 120