vfs: check userland buffers before reading them.
[haiku.git] / src / servers / app / DirectWindowInfo.h
blob4a26ac98d081fce21ce847992e25f76c17fd1d57
1 /*
2 * Copyright 2008-2009, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 */
6 #ifndef DIRECT_WINDOW_INFO_H
7 #define DIRECT_WINDOW_INFO_H
10 #include <Autolock.h>
11 #include <DirectWindow.h>
13 #include <DirectWindowPrivate.h>
15 class RenderingBuffer;
18 class DirectWindowInfo {
19 public:
20 DirectWindowInfo();
21 ~DirectWindowInfo();
23 status_t InitCheck() const;
25 status_t GetSyncData(
26 direct_window_sync_data& data) const;
28 status_t SetState(direct_buffer_state bufferState,
29 direct_driver_state driverState,
30 RenderingBuffer* renderingBuffer,
31 const BRect& windowFrame,
32 const BRegion& clipRegion);
34 void EnableFullScreen(const BRect& frame,
35 window_feel feel);
36 void DisableFullScreen();
38 bool IsFullScreen() const { return fFullScreen; }
39 const BRect& OriginalFrame() const { return fOriginalFrame; }
40 window_feel OriginalFeel() const { return fOriginalFeel; }
42 private:
43 status_t _SyncronizeWithClient();
45 direct_buffer_info* fBufferInfo;
46 sem_id fSem;
47 sem_id fAcknowledgeSem;
48 area_id fBufferArea;
50 BRect fOriginalFrame;
51 window_feel fOriginalFeel;
52 bool fFullScreen;
56 #endif // DIRECT_WINDOW_INFO_H