vfs: check userland buffers before reading them.
[haiku.git] / src / servers / app / Screen.h
blob9dd4e542a8f7a5ced53fe0d3635812169fbcc43e
1 /*
2 * Copyright 2001-2009, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Adi Oanca <adioanca@myrealbox.com>
7 * Axel Dörfler, axeld@pinc-software.de
8 * Stephan Aßmus, <superstippi@gmx.de>
9 */
10 #ifndef SCREEN_H
11 #define SCREEN_H
14 #include <Accelerant.h>
15 #include <GraphicsDefs.h>
16 #include <Point.h>
19 class DrawingEngine;
20 class HWInterface;
22 class Screen {
23 public:
24 Screen(::HWInterface *interface, int32 id);
25 Screen();
26 virtual ~Screen();
28 status_t Initialize();
29 void Shutdown();
31 int32 ID() const { return fID; }
32 status_t GetMonitorInfo(monitor_info& info) const;
34 status_t SetMode(const display_mode& mode);
35 status_t SetMode(uint16 width, uint16 height,
36 uint32 colorspace,
37 const display_timing& timing);
38 status_t SetPreferredMode();
39 status_t SetBestMode(uint16 width, uint16 height,
40 uint32 colorspace, float frequency,
41 bool strict = true);
43 void GetMode(display_mode& mode) const;
44 void GetMode(uint16 &width, uint16 &height,
45 uint32 &colorspace, float &frequency) const;
47 void SetFrame(const BRect& rect);
49 BRect Frame() const;
50 color_space ColorSpace() const;
52 inline DrawingEngine* GetDrawingEngine() const
53 { return fDriver; }
54 inline ::HWInterface* HWInterface() const
55 { return fHWInterface; }
57 private:
58 int32 _FindBestMode(const display_mode* modeList,
59 uint32 count, uint16 width, uint16 height,
60 uint32 colorspace, float frequency) const;
62 int32 fID;
63 DrawingEngine* fDriver;
64 ::HWInterface* fHWInterface;
67 #endif /* SCREEN_H */