hrev53701 adds 1 changeset to branch 'master'
old head: ef046e3b1426334ad8b2b0a3b9e97e78e6fd4a0a
new head: e8faedae5770a87aacd3af0f1035501c437bbbb4
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=e8faedae5770+%5Eef046e3b1426
----------------------------------------------------------------------------
e8faedae5770: Game Kit: rewrite PushGameSound and WindowScreen headers
Part of #1576
Change-Id: Iafdc88bcf13e9c07fa148cb7980b54f5ee98be50
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2086
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>
[ Raheem Idowu <abdurraheemidowu@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev53701
Commit: e8faedae5770a87aacd3af0f1035501c437bbbb4
URL: https://git.haiku-os.org/haiku/commit/?id=e8faedae5770
Author: Raheem Idowu <abdurraheemidowu@xxxxxxxxx>
Date: Wed Jan 8 07:48:00 2020 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Jan 11 02:26:06 2020 UTC
Ticket: https://dev.haiku-os.org/ticket/1576
----------------------------------------------------------------------------
2 files changed, 159 insertions(+), 185 deletions(-)
headers/os/game/PushGameSound.h | 147 +++++++++++++--------------
headers/os/game/WindowScreen.h | 197 ++++++++++++++++--------------------
----------------------------------------------------------------------------
diff --git a/headers/os/game/PushGameSound.h b/headers/os/game/PushGameSound.h
index 51e559ea87..565956e164 100644
--- a/headers/os/game/PushGameSound.h
+++ b/headers/os/game/PushGameSound.h
@@ -1,9 +1,6 @@
/*
- * Copyright 2001-2002, Haiku Inc. All Rights Reserved.
+ * Copyright 2020, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
- *
- * Author:
- * Christopher ML Zumwalt May (zummy@xxxxxxxxxxxx)
*/
#ifndef _PUSHGAMESOUND_H
#define _PUSHGAMESOUND_H
@@ -11,96 +8,92 @@
#include <StreamingGameSound.h>
+
class BList;
class BPushGameSound : public BStreamingGameSound {
public:
-
BPushGameSound(size_t inBufferFrameCount,
- const
gs_audio_format* format,
- size_t
inBufferCount = 2,
-
BGameSoundDevice* device = NULL);
-
- virtual ~BPushGameSound();
+ BPushGameSound(size_t
inBufferFrameCount,
+ const gs_audio_format*
format,
+ size_t inBufferCount =
2,
+ BGameSoundDevice*
device = NULL);
+ virtual ~BPushGameSound();
- enum lock_status {
- lock_failed = -1, // not yet
time to do more
- lock_ok = 0, // do more
- lock_ok_frames_dropped // you may have
missed some buffers
- };
+ enum lock_status {
+ lock_failed = -1,
+ lock_ok = 0,
+ lock_ok_frames_dropped
+ };
- virtual lock_status LockNextPage(void** _pagePtr,
- size_t*
_pageSize);
- virtual status_t UnlockPage(void* pagePtr);
+ virtual lock_status LockNextPage(void** _pagePtr, size_t*
_pageSize);
+ virtual status_t UnlockPage(void* pagePtr);
- virtual lock_status LockForCyclic(void** _basePtr,
size_t* _size);
- virtual status_t UnlockCyclic();
- virtual size_t CurrentPosition();
+ virtual lock_status LockForCyclic(void** _basePtr, size_t* _size);
+ virtual status_t UnlockCyclic();
+ virtual size_t CurrentPosition();
- virtual BGameSound* Clone() const;
+ virtual BGameSound* Clone() const;
- virtual status_t Perform(int32 selector, void*
data);
+ virtual status_t Perform(int32 selector, void* data);
protected:
-
BPushGameSound(BGameSoundDevice* device);
+
BPushGameSound(BGameSoundDevice* device);
- virtual status_t SetParameters(size_t
bufferFrameCount,
- const
gs_audio_format* format,
- size_t
bufferCount);
+ virtual status_t SetParameters(size_t bufferFrameCount,
+ const gs_audio_format*
format, size_t bufferCount);
- virtual status_t SetStreamHook(void
(*hook)(void* inCookie,
-
void* buffer, size_t byteCount,
-
BStreamingGameSound* me),
- void*
cookie);
+ virtual status_t SetStreamHook(void (*hook)(void* inCookie,
+ void* buffer,
size_t byteCount,
+
BStreamingGameSound* me),
+ void* cookie);
- virtual void FillBuffer(void* buffer, size_t
byteCount);
+ virtual void FillBuffer(void* buffer, size_t byteCount);
private:
-
BPushGameSound();
-
BPushGameSound(const BPushGameSound& other);
- BPushGameSound& operator=(const BPushGameSound&
other);
- // not
implemented
-
- bool BytesReady(size_t*
bytes);
-
- virtual status_t
_Reserved_BPushGameSound_0(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_1(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_2(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_3(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_4(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_5(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_6(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_7(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_8(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_9(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_10(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_11(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_12(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_13(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_14(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_15(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_16(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_17(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_18(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_19(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_20(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_21(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_22(int32 arg, ...);
- virtual status_t
_Reserved_BPushGameSound_23(int32 arg, ...);
+ BPushGameSound();
+ BPushGameSound(const
BPushGameSound& other);
+ BPushGameSound& operator=(const BPushGameSound& other);
+
+ bool BytesReady(size_t* bytes);
+
+ virtual status_t _Reserved_BPushGameSound_0(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_1(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_2(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_3(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_4(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_5(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_6(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_7(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_8(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_9(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_10(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_11(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_12(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_13(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_14(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_15(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_16(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_17(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_18(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_19(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_20(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_21(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_22(int32 arg, ...);
+ virtual status_t _Reserved_BPushGameSound_23(int32 arg, ...);
private:
- sem_id fLock;
- BList* fPageLocked;
-
- size_t fLockPos;
- size_t fPlayPos;
-
- char* fBuffer;
- size_t fPageSize;
- int32 fPageCount;
- size_t fBufferSize;
-
- uint32 _reserved[12];
-};
+ sem_id fLock;
+ BList* fPageLocked;
+ size_t fLockPos;
+ size_t fPlayPos;
+ char* fBuffer;
+
+ size_t fPageSize;
+ int32 fPageCount;
+ size_t fBufferSize;
+
+ uint32 _reserved[12];
+};
-#endif // _PUSH_GAME_SOUND_H
+#endif
\ No newline at end of file
diff --git a/headers/os/game/WindowScreen.h b/headers/os/game/WindowScreen.h
index 662b0a22b1..29336704fe 100644
--- a/headers/os/game/WindowScreen.h
+++ b/headers/os/game/WindowScreen.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
- * Distributed under the terms of the MIT License.
+ * Copyright 2020, Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
*/
#ifndef _WINDOW_SCREEN_H
#define _WINDOW_SCREEN_H
@@ -15,8 +15,6 @@
void set_mouse_position(int32 x, int32 y);
- // Controls the mouse cursor position on screen
-
enum {
B_ENABLE_VIEW_DRAWING = 0x0001,
@@ -24,109 +22,92 @@ enum {
};
class BWindowScreen : public BWindow {
- public:
- BWindowScreen(const
char* title, uint32 space,
- status_t*
_error, bool debugMode = false);
- BWindowScreen(const char*
title, uint32 space,
- uint32 attributes,
status_t* _error);
- virtual ~BWindowScreen();
-
- virtual void Quit();
- virtual void ScreenConnected(bool active);
- void Disconnect();
-
- virtual void WindowActivated(bool active);
- virtual void WorkspaceActivated(int32 workspace,
bool active);
- virtual void ScreenChanged(BRect screenSize,
color_space depth);
-
- virtual void Hide();
- virtual void Show();
-
- void SetColorList(rgb_color* list,
int32 firstIndex = 0,
- int32 lastIndex
= 255);
- status_t SetSpace(uint32 space);
-
- bool CanControlFrameBuffer();
- status_t SetFrameBuffer(int32 width,
int32 height);
- status_t MoveDisplayArea(int32 x, int32
y);
-
- rgb_color* ColorList();
- frame_buffer_info* FrameBufferInfo();
- graphics_card_hook CardHookAt(int32 index);
- graphics_card_info* CardInfo();
-
- void RegisterThread(thread_id
thread);
- virtual void SuspensionHook(bool active);
- void Suspend(char* label);
-
- private:
- virtual status_t Perform(perform_code d, void* arg);
-
-#if 0
- void* IOBase();
- // deprecated API, always returns NULL
-#endif
-
- virtual void _ReservedWindowScreen1();
- virtual void _ReservedWindowScreen2();
- virtual void _ReservedWindowScreen3();
- virtual void _ReservedWindowScreen4();
-
- // not implemented:
- BWindowScreen();
-
BWindowScreen(BWindowScreen& other);
- BWindowScreen
&operator=(BWindowScreen& other);
-
- status_t _InitData(uint32 space, uint32
attributes);
- void _DisposeData();
-
- status_t _LockScreen(bool lock);
- status_t _Activate();
- status_t _Deactivate();
-
- status_t _SetupAccelerantHooks();
- void _ResetAccelerantHooks();
-
- status_t _GetCardInfo();
- void _Suspend();
- void _Resume();
- status_t _GetModeFromSpace(uint32 space,
display_mode* mode);
- status_t _InitClone();
- status_t
_AssertDisplayMode(display_mode* mode);
-
- uint16 _reserved0;
- bool _reserved1;
- bool fWorkState;
- bool fWindowState;
- bool fActivateState;
- int32 fLockState;
- int32 fWorkspaceIndex;
-
- display_mode* fOriginalDisplayMode;
- display_mode* fDisplayMode;
- sem_id fDebugSem;
- image_id fAddonImage;
- uint32 fAttributes;
-
- rgb_color fPalette[256];
-
- graphics_card_info fCardInfo;
- frame_buffer_info fFrameBufferInfo;
-
- char* fDebugFrameBuffer;
- bool fDebugState;
- bool fDebugFirst;
- int32 fDebugWorkspace;
- int32 fDebugThreadCount;
- thread_id* fDebugThreads;
-
- uint32 fModeCount;
- display_mode* fModeList;
-
- GetAccelerantHook fGetAccelerantHook;
- wait_engine_idle fWaitEngineIdle;
-
- uint32 _reserved[163];
+public:
+ BWindowScreen(const char*
title, uint32 space,
+ status_t* _error, bool
debugMode = false);
+ BWindowScreen(const char* title, uint32
space,
+ uint32 attributes, status_t*
_error);
+ virtual ~BWindowScreen();
+
+ virtual void Quit();
+ virtual void ScreenConnected(bool active);
+ void Disconnect();
+
+ virtual void WindowActivated(bool active);
+ virtual void WorkspaceActivated(int32 workspace, bool
active);
+ virtual void ScreenChanged(BRect screenSize, color_space
depth);
+
+ virtual void Hide();
+ virtual void Show();
+
+ void SetColorList(rgb_color* list, int32
firstIndex = 0,
+ int32 lastIndex = 255);
+ status_t SetSpace(uint32 space);
+
+ bool CanControlFrameBuffer();
+ status_t SetFrameBuffer(int32 width, int32
height);
+ status_t MoveDisplayArea(int32 x, int32 y);
+ rgb_color* ColorList();
+ frame_buffer_info* FrameBufferInfo();
+ graphics_card_hook CardHookAt(int32 index);
+ graphics_card_info* CardInfo();
+ void RegisterThread(thread_id thread);
+ virtual void SuspensionHook(bool active);
+ void Suspend(char* label);
+
+private:
+ virtual status_t Perform(perform_code d, void* arg);
+ virtual void _ReservedWindowScreen1();
+ virtual void _ReservedWindowScreen2();
+ virtual void _ReservedWindowScreen3();
+ virtual void _ReservedWindowScreen4();
+ status_t _InitData(uint32 space, uint32
attributes);
+ void _DisposeData();
+ status_t _LockScreen(bool lock);
+ status_t _Activate();
+ status_t _Deactivate();
+ status_t _SetupAccelerantHooks();
+ void _ResetAccelerantHooks();
+ status_t _GetCardInfo();
+ void _Suspend();
+ void _Resume();
+ status_t _GetModeFromSpace(uint32 space,
display_mode* mode);
+ status_t _InitClone();
+ status_t _AssertDisplayMode(display_mode* mode);
+
+private:
+ uint16 _reserved0;
+ bool _reserved1;
+ bool fWorkState;
+ bool fWindowState;
+ bool fActivateState;
+ int32 fLockState;
+ int32 fWorkspaceIndex;
+
+ display_mode* fOriginalDisplayMode;
+ display_mode* fDisplayMode;
+ sem_id fDebugSem;
+ image_id fAddonImage;
+ uint32 fAttributes;
+
+ rgb_color fPalette[256];
+
+ graphics_card_info fCardInfo;
+ frame_buffer_info fFrameBufferInfo;
+
+ char* fDebugFrameBuffer;
+ bool fDebugState;
+ bool fDebugFirst;
+ int32 fDebugWorkspace;
+ int32 fDebugThreadCount;
+ thread_id* fDebugThreads;
+ uint32 fModeCount;
+ display_mode* fModeList;
+
+ GetAccelerantHook fGetAccelerantHook;
+ wait_engine_idle fWaitEngineIdle;
+
+ uint32 _reserved[163];
};
-#endif // _WINDOW_SCREEN_H
+#endif
\ No newline at end of file