00001 // BGUI.h (this is -*- C++ -*-) 00002 // 00003 // \author: Bjoern Giesler <bjoern@giesler.de> 00004 // 00005 // 00006 // 00007 // $Author: giesler $ 00008 // $Locker$ 00009 // $Revision$ 00010 // $Date: 2002-08-19 10:41:28 +0200 (Mon, 19 Aug 2002) $ 00011 00012 #ifndef BGUI_H 00013 #define BGUI_H 00014 00015 /* system includes */ 00016 /* (none) */ 00017 00018 /* my includes */ 00019 #include "BScreen.h" 00020 #include "BRunLoop.h" 00021 00028 class BGUI { 00029 public: 00030 00032 static BGUI* get(); 00033 00035 void addScreen(BScreen* screen); 00036 00038 void run(); 00039 00048 void repaint(bool force = false); 00049 00051 void disableRedraws(); 00053 void enableRedraws(); 00055 bool redrawsDisabled() { return _redrawsDisabled; } 00056 00058 BWidget* selectedWidget() { return _selectedWidget; } 00060 void selectWidget(BWidget* widget); 00061 00069 bool backlight(bool& top, bool& bottom); 00070 00077 bool switchBacklight(bool top, bool bottom); 00078 00086 bool backlightBrightness(u8& brightness); 00087 00094 bool setBacklightBrightness(u8 brightness); 00095 00102 bool powerOff(); 00103 00105 const std::vector<BScreen*>& screens() { return _screens; } 00106 00107 protected: 00108 u32 sendFIFO(u32 command); 00109 00110 private: 00111 BGUI(); 00112 static BGUI *_gui; 00113 00114 BRunLoop* _runloop; 00115 00116 BWidget *_selectedWidget; 00117 00118 std::vector<BScreen*> _screens; 00119 00120 bool _redrawsDisabled; 00121 }; 00122 00123 #endif /* BGUI_H */
1.3-rc3