* Ingo broke binary compatibility of Window.h in r18649, thanks to Stefano
for finding this. This should fix bug #1734. * Removed unused BWindow members and the temporary PrintToStream() method. * Indentation cleanup (DirectWindow.h had some spaces instead of tabs). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23863 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright 2001-2007, Haiku.
|
||||
* Copyright 2001-2008, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Stefano Ceccherini <[email protected]>
|
||||
* Stefano Ceccherini <[email protected]>
|
||||
*/
|
||||
#ifndef _DIRECT_WINDOW_H
|
||||
#define _DIRECT_WINDOW_H
|
||||
@@ -55,24 +55,26 @@ typedef struct {
|
||||
class BDirectWindow : public BWindow {
|
||||
public:
|
||||
BDirectWindow(BRect frame, const char *title, window_type type,
|
||||
uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
BDirectWindow(BRect frame, const char *title, window_look look,
|
||||
window_feel feel, uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
BDirectWindow(BRect frame, const char *title, window_look look,
|
||||
window_feel feel, uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
virtual ~BDirectWindow();
|
||||
|
||||
static BArchivable* Instantiate(BMessage *data);
|
||||
|
||||
static BArchivable* Instantiate(BMessage *data);
|
||||
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
||||
|
||||
virtual void Quit();
|
||||
virtual void Quit();
|
||||
virtual void DispatchMessage(BMessage *message, BHandler *handler);
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
virtual void FrameMoved(BPoint newPosition);
|
||||
virtual void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces);
|
||||
virtual void WorkspacesChanged(uint32 oldWorkspaces,
|
||||
uint32 newWorkspaces);
|
||||
virtual void WorkspaceActivated(int32 workspaceIndex, bool state);
|
||||
virtual void FrameResized(float newWidth, float newHeight);
|
||||
virtual void Minimize(bool minimize);
|
||||
virtual void Zoom(BPoint recPosition, float recWidth, float recHeight);
|
||||
virtual void Zoom(BPoint recPosition, float recWidth,
|
||||
float recHeight);
|
||||
virtual void ScreenChanged(BRect screenFrame, color_space depth);
|
||||
virtual void MenusBeginning();
|
||||
virtual void MenusEnded();
|
||||
@@ -89,30 +91,28 @@ class BDirectWindow : public BWindow {
|
||||
virtual void task_looper();
|
||||
virtual BMessage* ConvertToMessage(void *raw, int32 code);
|
||||
|
||||
|
||||
public:
|
||||
virtual void DirectConnected(direct_buffer_info *info);
|
||||
status_t GetClippingRegion(BRegion *region, BPoint *origin = NULL) const;
|
||||
status_t SetFullScreen(bool enable);
|
||||
bool IsFullScreen() const;
|
||||
|
||||
virtual void DirectConnected(direct_buffer_info *info);
|
||||
status_t GetClippingRegion(BRegion *region,
|
||||
BPoint *origin = NULL) const;
|
||||
status_t SetFullScreen(bool enable);
|
||||
bool IsFullScreen() const;
|
||||
|
||||
static bool SupportsWindowMode(screen_id id = B_MAIN_SCREEN_ID);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
typedef BWindow inherited;
|
||||
|
||||
virtual void _ReservedDirectWindow1();
|
||||
virtual void _ReservedDirectWindow2();
|
||||
virtual void _ReservedDirectWindow3();
|
||||
virtual void _ReservedDirectWindow4();
|
||||
|
||||
BDirectWindow();
|
||||
BDirectWindow(BDirectWindow &);
|
||||
BDirectWindow &operator=(BDirectWindow &);
|
||||
virtual void _ReservedDirectWindow1();
|
||||
virtual void _ReservedDirectWindow2();
|
||||
virtual void _ReservedDirectWindow3();
|
||||
virtual void _ReservedDirectWindow4();
|
||||
|
||||
static int32 _daemon_thread(void *arg);
|
||||
BDirectWindow();
|
||||
BDirectWindow(BDirectWindow& other);
|
||||
BDirectWindow& operator=(BDirectWindow& other);
|
||||
|
||||
static int32 _daemon_thread(void* arg);
|
||||
int32 _DirectDaemon();
|
||||
bool _LockDirect() const;
|
||||
void _UnlockDirect() const;
|
||||
@@ -125,27 +125,27 @@ class BDirectWindow : public BWindow {
|
||||
bool fIsFullScreen;
|
||||
bool _unused;
|
||||
bool fInDirectConnect;
|
||||
|
||||
|
||||
int32 fDirectLock;
|
||||
sem_id fDirectSem;
|
||||
uint32 fDirectLockCount;
|
||||
thread_id fDirectLockOwner;
|
||||
char *fDirectLockStack;
|
||||
|
||||
char* fDirectLockStack;
|
||||
|
||||
sem_id fDisableSem;
|
||||
sem_id fDisableSemAck;
|
||||
|
||||
|
||||
uint32 fInitStatus;
|
||||
uint32 fInfoAreaSize;
|
||||
|
||||
|
||||
uint32 _reserved[2];
|
||||
|
||||
|
||||
area_id fClonedClippingArea;
|
||||
area_id fSourceClippingArea;
|
||||
thread_id fDirectDaemonId;
|
||||
direct_buffer_info *fBufferDesc;
|
||||
|
||||
direct_buffer_info* fBufferDesc;
|
||||
|
||||
uint32 _more_reserved_[17];
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _DIRECT_WINDOW_H
|
||||
|
||||
+207
-228
@@ -92,177 +92,165 @@ enum {
|
||||
|
||||
class BWindow : public BLooper {
|
||||
public:
|
||||
BWindow(BRect frame, const char* title,
|
||||
window_type type, uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
BWindow(BRect frame, const char* title,
|
||||
window_look look, window_feel feel,
|
||||
uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
virtual ~BWindow();
|
||||
BWindow(BRect frame, const char* title,
|
||||
window_type type, uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
BWindow(BRect frame, const char* title,
|
||||
window_look look, window_feel feel, uint32 flags,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
virtual ~BWindow();
|
||||
|
||||
BWindow(BMessage* data);
|
||||
BWindow(BMessage* data);
|
||||
static BArchivable* Instantiate(BMessage* data);
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
|
||||
static BArchivable* Instantiate(BMessage* data);
|
||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||
virtual void Quit();
|
||||
void Close() { Quit(); }
|
||||
|
||||
virtual void Quit();
|
||||
void Close() { Quit(); }
|
||||
void AddChild(BView* child, BView* before = NULL);
|
||||
bool RemoveChild(BView* child);
|
||||
int32 CountChildren() const;
|
||||
BView* ChildAt(int32 index) const;
|
||||
|
||||
void AddChild(BView* child, BView* before = NULL);
|
||||
bool RemoveChild(BView* child);
|
||||
int32 CountChildren() const;
|
||||
BView* ChildAt(int32 index) const;
|
||||
virtual void DispatchMessage(BMessage* message,
|
||||
BHandler* handler);
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void FrameMoved(BPoint newPosition);
|
||||
virtual void WorkspacesChanged(uint32 oldWorkspaces,
|
||||
uint32 newWorkspaces);
|
||||
virtual void WorkspaceActivated(int32 workspace, bool state);
|
||||
virtual void FrameResized(float newWidth, float newHeight);
|
||||
virtual void Minimize(bool minimize);
|
||||
virtual void Zoom(BPoint origin, float width, float height);
|
||||
void Zoom();
|
||||
void SetZoomLimits(float maxWidth, float maxHeight);
|
||||
virtual void ScreenChanged(BRect screenSize, color_space format);
|
||||
|
||||
virtual void DispatchMessage(BMessage* message,
|
||||
BHandler* handler);
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void FrameMoved(BPoint new_position);
|
||||
virtual void WorkspacesChanged(uint32 oldWorkspaces,
|
||||
uint32 newWorkspaces);
|
||||
virtual void WorkspaceActivated(int32 workspace,
|
||||
bool state);
|
||||
virtual void FrameResized(float newWidth, float newHeight);
|
||||
virtual void Minimize(bool minimize);
|
||||
virtual void Zoom(BPoint origin, float width, float height);
|
||||
void Zoom();
|
||||
void SetZoomLimits(float maxWidth, float maxHeight);
|
||||
virtual void ScreenChanged(BRect screenSize,
|
||||
color_space format);
|
||||
void SetPulseRate(bigtime_t rate);
|
||||
bigtime_t PulseRate() const;
|
||||
|
||||
void SetPulseRate(bigtime_t rate);
|
||||
bigtime_t PulseRate() const;
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMessage* message);
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMessage* message, BHandler* target);
|
||||
void RemoveShortcut(uint32 key, uint32 modifiers);
|
||||
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMessage *message);
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMessage *message,
|
||||
BHandler *target);
|
||||
void RemoveShortcut(uint32 key, uint32 modifiers);
|
||||
void SetDefaultButton(BButton* button);
|
||||
BButton* DefaultButton() const;
|
||||
|
||||
void SetDefaultButton(BButton* button);
|
||||
BButton* DefaultButton() const;
|
||||
virtual void MenusBeginning();
|
||||
virtual void MenusEnded();
|
||||
|
||||
virtual void MenusBeginning();
|
||||
virtual void MenusEnded();
|
||||
bool NeedsUpdate() const;
|
||||
void UpdateIfNeeded();
|
||||
|
||||
bool NeedsUpdate() const;
|
||||
void UpdateIfNeeded();
|
||||
BView* FindView(const char* viewName) const;
|
||||
BView* FindView(BPoint) const;
|
||||
BView* CurrentFocus() const;
|
||||
|
||||
BView* FindView(const char* viewName) const;
|
||||
BView* FindView(BPoint) const;
|
||||
BView* CurrentFocus() const;
|
||||
void Activate(bool = true);
|
||||
virtual void WindowActivated(bool state);
|
||||
|
||||
void Activate(bool = true);
|
||||
virtual void WindowActivated(bool state);
|
||||
void ConvertToScreen(BPoint* point) const;
|
||||
BPoint ConvertToScreen(BPoint point) const;
|
||||
void ConvertFromScreen(BPoint* point) const;
|
||||
BPoint ConvertFromScreen(BPoint point) const;
|
||||
void ConvertToScreen(BRect* rect) const;
|
||||
BRect ConvertToScreen(BRect rect) const;
|
||||
void ConvertFromScreen(BRect* rect) const;
|
||||
BRect ConvertFromScreen(BRect rect) const;
|
||||
|
||||
void ConvertToScreen(BPoint* point) const;
|
||||
BPoint ConvertToScreen(BPoint point) const;
|
||||
void ConvertFromScreen(BPoint* point) const;
|
||||
BPoint ConvertFromScreen(BPoint point) const;
|
||||
void ConvertToScreen(BRect* rect) const;
|
||||
BRect ConvertToScreen(BRect rect) const;
|
||||
void ConvertFromScreen(BRect* rect) const;
|
||||
BRect ConvertFromScreen(BRect rect) const;
|
||||
void MoveBy(float dx, float dy);
|
||||
void MoveTo(BPoint);
|
||||
void MoveTo(float x, float y);
|
||||
void ResizeBy(float dx, float dy);
|
||||
void ResizeTo(float width, float height);
|
||||
|
||||
void MoveBy(float dx, float dy);
|
||||
void MoveTo(BPoint);
|
||||
void MoveTo(float x, float y);
|
||||
void ResizeBy(float dx, float dy);
|
||||
void ResizeTo(float width, float height);
|
||||
virtual void Show();
|
||||
virtual void Hide();
|
||||
bool IsHidden() const;
|
||||
bool IsMinimized() const;
|
||||
|
||||
virtual void Show();
|
||||
virtual void Hide();
|
||||
bool IsHidden() const;
|
||||
bool IsMinimized() const;
|
||||
void Flush() const;
|
||||
void Sync() const;
|
||||
|
||||
void Flush() const;
|
||||
void Sync() const;
|
||||
status_t SendBehind(const BWindow* window);
|
||||
|
||||
status_t SendBehind(const BWindow* window);
|
||||
void DisableUpdates();
|
||||
void EnableUpdates();
|
||||
|
||||
void DisableUpdates();
|
||||
void EnableUpdates();
|
||||
|
||||
void BeginViewTransaction();
|
||||
void BeginViewTransaction();
|
||||
// referred as OpenViewTransaction() in BeBook
|
||||
void EndViewTransaction();
|
||||
void EndViewTransaction();
|
||||
// referred as CommitViewTransaction() in BeBook
|
||||
|
||||
BRect Bounds() const;
|
||||
BRect Frame() const;
|
||||
const char* Title() const;
|
||||
void SetTitle(const char* title);
|
||||
bool IsFront() const;
|
||||
bool IsActive() const;
|
||||
BRect Bounds() const;
|
||||
BRect Frame() const;
|
||||
const char* Title() const;
|
||||
void SetTitle(const char* title);
|
||||
bool IsFront() const;
|
||||
bool IsActive() const;
|
||||
|
||||
void SetKeyMenuBar(BMenuBar* bar);
|
||||
BMenuBar* KeyMenuBar() const;
|
||||
void SetKeyMenuBar(BMenuBar* bar);
|
||||
BMenuBar* KeyMenuBar() const;
|
||||
|
||||
void SetSizeLimits(float minWidth, float maxWidth,
|
||||
float minHeight, float maxHeight);
|
||||
void GetSizeLimits(float* minWidth, float* maxWidth,
|
||||
float* minHeight, float* maxHeight);
|
||||
void SetSizeLimits(float minWidth, float maxWidth,
|
||||
float minHeight, float maxHeight);
|
||||
void GetSizeLimits(float* minWidth, float* maxWidth,
|
||||
float* minHeight, float* maxHeight);
|
||||
|
||||
status_t SetDecoratorSettings(const BMessage& settings);
|
||||
status_t GetDecoratorSettings(BMessage* settings) const;
|
||||
status_t SetDecoratorSettings(const BMessage& settings);
|
||||
status_t GetDecoratorSettings(BMessage* settings) const;
|
||||
|
||||
uint32 Workspaces() const;
|
||||
void SetWorkspaces(uint32);
|
||||
uint32 Workspaces() const;
|
||||
void SetWorkspaces(uint32);
|
||||
|
||||
BView* LastMouseMovedView() const;
|
||||
BView* LastMouseMovedView() const;
|
||||
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 form,
|
||||
const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 form,
|
||||
const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
|
||||
status_t AddToSubset(BWindow* window);
|
||||
status_t RemoveFromSubset(BWindow* window);
|
||||
status_t AddToSubset(BWindow* window);
|
||||
status_t RemoveFromSubset(BWindow* window);
|
||||
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
|
||||
status_t SetType(window_type type);
|
||||
window_type Type() const;
|
||||
status_t SetType(window_type type);
|
||||
window_type Type() const;
|
||||
|
||||
status_t SetLook(window_look look);
|
||||
window_look Look() const;
|
||||
status_t SetLook(window_look look);
|
||||
window_look Look() const;
|
||||
|
||||
status_t SetFeel(window_feel feel);
|
||||
window_feel Feel() const;
|
||||
status_t SetFeel(window_feel feel);
|
||||
window_feel Feel() const;
|
||||
|
||||
status_t SetFlags(uint32);
|
||||
uint32 Flags() const;
|
||||
status_t SetFlags(uint32);
|
||||
uint32 Flags() const;
|
||||
|
||||
bool IsModal() const;
|
||||
bool IsFloating() const;
|
||||
bool IsModal() const;
|
||||
bool IsFloating() const;
|
||||
|
||||
status_t SetWindowAlignment(window_alignment mode,
|
||||
int32 h,
|
||||
int32 hOffset = 0,
|
||||
int32 width = 0,
|
||||
int32 widthOffset = 0,
|
||||
int32 v = 0,
|
||||
int32 vOffset = 0,
|
||||
int32 height = 0,
|
||||
int32 heightOffset = 0);
|
||||
status_t GetWindowAlignment(window_alignment* mode = NULL,
|
||||
int32* h = NULL,
|
||||
int32* hOffset = NULL,
|
||||
int32* width = NULL,
|
||||
int32* widthOffset = NULL,
|
||||
int32* v = NULL,
|
||||
int32* vOffset = NULL,
|
||||
int32* height = NULL,
|
||||
int32* heightOffset = NULL) const;
|
||||
status_t SetWindowAlignment(window_alignment mode, int32 h,
|
||||
int32 hOffset = 0, int32 width = 0,
|
||||
int32 widthOffset = 0, int32 v = 0,
|
||||
int32 vOffset = 0, int32 height = 0,
|
||||
int32 heightOffset = 0);
|
||||
status_t GetWindowAlignment(window_alignment* mode = NULL,
|
||||
int32* h = NULL, int32* hOffset = NULL,
|
||||
int32* width = NULL, int32* widthOffset = NULL,
|
||||
int32* v = NULL, int32* vOffset = NULL,
|
||||
int32* height = NULL,
|
||||
int32* heightOffset = NULL) const;
|
||||
|
||||
virtual bool QuitRequested();
|
||||
virtual thread_id Run();
|
||||
virtual bool QuitRequested();
|
||||
virtual thread_id Run();
|
||||
|
||||
virtual void SetLayout(BLayout* layout);
|
||||
BLayout* GetLayout() const;
|
||||
virtual void SetLayout(BLayout* layout);
|
||||
BLayout* GetLayout() const;
|
||||
|
||||
void InvalidateLayout(bool descendants = false);
|
||||
void InvalidateLayout(bool descendants = false);
|
||||
|
||||
private:
|
||||
typedef BLooper inherited;
|
||||
@@ -282,116 +270,107 @@ private:
|
||||
friend void _set_menu_sem_(BWindow* w, sem_id sem);
|
||||
friend status_t _safe_get_server_token_(const BLooper*, int32*);
|
||||
|
||||
virtual void _ReservedWindow1();
|
||||
virtual void _ReservedWindow2();
|
||||
virtual void _ReservedWindow3();
|
||||
virtual void _ReservedWindow4();
|
||||
virtual void _ReservedWindow5();
|
||||
virtual void _ReservedWindow6();
|
||||
virtual void _ReservedWindow7();
|
||||
virtual void _ReservedWindow8();
|
||||
virtual void _ReservedWindow2();
|
||||
virtual void _ReservedWindow3();
|
||||
virtual void _ReservedWindow4();
|
||||
virtual void _ReservedWindow5();
|
||||
virtual void _ReservedWindow6();
|
||||
virtual void _ReservedWindow7();
|
||||
virtual void _ReservedWindow8();
|
||||
|
||||
BWindow();
|
||||
BWindow(BWindow&);
|
||||
BWindow& operator=(BWindow&);
|
||||
BWindow();
|
||||
BWindow(BWindow&);
|
||||
BWindow& operator=(BWindow&);
|
||||
|
||||
BWindow(BRect frame, int32 bitmapToken);
|
||||
void _InitData(BRect frame, const char* title,
|
||||
window_look look, window_feel feel,
|
||||
uint32 flags, uint32 workspace,
|
||||
int32 bitmapToken = -1);
|
||||
BWindow(BRect frame, int32 bitmapToken);
|
||||
void _InitData(BRect frame, const char* title,
|
||||
window_look look, window_feel feel,
|
||||
uint32 flags, uint32 workspace,
|
||||
int32 bitmapToken = -1);
|
||||
|
||||
void BitmapClose(); // to be implemented
|
||||
virtual void task_looper();
|
||||
virtual void task_looper();
|
||||
|
||||
virtual BMessage* ConvertToMessage(void* raw, int32 code);
|
||||
virtual BMessage* ConvertToMessage(void* raw, int32 code);
|
||||
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMenuItem* item);
|
||||
BHandler* _DetermineTarget(BMessage* message,
|
||||
BHandler* target);
|
||||
bool _UnpackMessage(unpack_cookie& state,
|
||||
BMessage** _message,
|
||||
BHandler** _target,
|
||||
bool* _usePreferred);
|
||||
void _SanitizeMessage(BMessage* message,
|
||||
BHandler* target,
|
||||
bool usePreferred);
|
||||
bool _StealMouseMessage(BMessage* message,
|
||||
bool& deleteMessage);
|
||||
void AddShortcut(uint32 key, uint32 modifiers,
|
||||
BMenuItem* item);
|
||||
BHandler* _DetermineTarget(BMessage* message,
|
||||
BHandler* target);
|
||||
bool _UnpackMessage(unpack_cookie& state,
|
||||
BMessage** _message, BHandler** _target,
|
||||
bool* _usePreferred);
|
||||
void _SanitizeMessage(BMessage* message,
|
||||
BHandler* target, bool usePreferred);
|
||||
bool _StealMouseMessage(BMessage* message,
|
||||
bool& deleteMessage);
|
||||
|
||||
bool InUpdate();
|
||||
void _DequeueAll();
|
||||
window_type _ComposeType(window_look look,
|
||||
window_feel feel) const;
|
||||
void _DecomposeType(window_type type,
|
||||
window_look* look,
|
||||
window_feel* feel) const;
|
||||
bool InUpdate();
|
||||
void _DequeueAll();
|
||||
window_type _ComposeType(window_look look,
|
||||
window_feel feel) const;
|
||||
void _DecomposeType(window_type type, window_look* look,
|
||||
window_feel* feel) const;
|
||||
|
||||
void SetIsFilePanel(bool yes);
|
||||
bool IsFilePanel() const;
|
||||
void SetIsFilePanel(bool yes);
|
||||
bool IsFilePanel() const;
|
||||
|
||||
void _CreateTopView();
|
||||
void _AdoptResize();
|
||||
void _SetFocus(BView* focusView,
|
||||
bool notifyIputServer = false);
|
||||
void _SetName(const char* title);
|
||||
void _CreateTopView();
|
||||
void _AdoptResize();
|
||||
void _SetFocus(BView* focusView,
|
||||
bool notifyIputServer = false);
|
||||
void _SetName(const char* title);
|
||||
|
||||
Shortcut* _FindShortcut(uint32 key, uint32 modifiers);
|
||||
BView* _FindView(BView* view, BPoint point) const;
|
||||
BView* _FindView(int32 token);
|
||||
BView* _LastViewChild(BView* parent);
|
||||
Shortcut* _FindShortcut(uint32 key, uint32 modifiers);
|
||||
BView* _FindView(BView* view, BPoint point) const;
|
||||
BView* _FindView(int32 token);
|
||||
BView* _LastViewChild(BView* parent);
|
||||
|
||||
BView* _FindNextNavigable(BView *focus, uint32 flags);
|
||||
BView* _FindPreviousNavigable(BView *focus,
|
||||
uint32 flags);
|
||||
bool _HandleKeyDown(BMessage* event);
|
||||
void _KeyboardNavigation();
|
||||
|
||||
// Debug (TODO: to be removed)
|
||||
void PrintToStream() const;
|
||||
BView* _FindNextNavigable(BView *focus, uint32 flags);
|
||||
BView* _FindPreviousNavigable(BView *focus, uint32 flags);
|
||||
bool _HandleKeyDown(BMessage* event);
|
||||
void _KeyboardNavigation();
|
||||
|
||||
private:
|
||||
char* fTitle;
|
||||
int32 server_token; // not yet used
|
||||
bool fInTransaction;
|
||||
bool fActive;
|
||||
short fShowLevel;
|
||||
uint32 fFlags;
|
||||
char* fTitle;
|
||||
int32 _unused0;
|
||||
bool fInTransaction;
|
||||
bool fActive;
|
||||
short fShowLevel;
|
||||
uint32 fFlags;
|
||||
|
||||
BView* fTopView;
|
||||
BView* fFocus;
|
||||
BView* fLastMouseMovedView;
|
||||
uint32 _unused1;
|
||||
BMenuBar* fKeyMenuBar;
|
||||
BButton* fDefaultButton;
|
||||
BList fShortcuts;
|
||||
int32 fTopViewToken;
|
||||
bool _unused2; // was fPulseEnabled
|
||||
bool fViewsNeedPulse; // not yet used
|
||||
bool fIsFilePanel;
|
||||
bool fMaskActivated;
|
||||
bigtime_t fPulseRate;
|
||||
bool fWaitingForMenu;
|
||||
bool fMinimized;
|
||||
bool fNoQuitShortcut;
|
||||
bool _unused3;
|
||||
sem_id fMenuSem;
|
||||
float fMaxZoomHeight;
|
||||
float fMaxZoomWidth;
|
||||
float fMinHeight;
|
||||
float fMinWidth;
|
||||
float fMaxHeight;
|
||||
float fMaxWidth;
|
||||
BRect fFrame;
|
||||
window_look fLook;
|
||||
window_feel fFeel;
|
||||
int32 fLastViewToken;
|
||||
BView* fTopView;
|
||||
BView* fFocus;
|
||||
BView* fLastMouseMovedView;
|
||||
uint32 _unused1;
|
||||
BMenuBar* fKeyMenuBar;
|
||||
BButton* fDefaultButton;
|
||||
BList fShortcuts;
|
||||
int32 fTopViewToken;
|
||||
bool _unused2;
|
||||
bool _unused3;
|
||||
bool fIsFilePanel;
|
||||
bool _unused4;
|
||||
bigtime_t fPulseRate;
|
||||
bool _unused5;
|
||||
bool fMinimized;
|
||||
bool fNoQuitShortcut;
|
||||
bool _unused6;
|
||||
sem_id fMenuSem;
|
||||
float fMaxZoomHeight;
|
||||
float fMaxZoomWidth;
|
||||
float fMinHeight;
|
||||
float fMinWidth;
|
||||
float fMaxHeight;
|
||||
float fMaxWidth;
|
||||
BRect fFrame;
|
||||
window_look fLook;
|
||||
window_feel fFeel;
|
||||
int32 fLastViewToken;
|
||||
BPrivate::PortLink* fLink;
|
||||
BMessageRunner* fPulseRunner;
|
||||
BRect fPreviousFrame;
|
||||
BMessageRunner* fPulseRunner;
|
||||
BRect fPreviousFrame;
|
||||
|
||||
uint32 _reserved[9];
|
||||
uint32 _reserved[9];
|
||||
};
|
||||
|
||||
#endif // _WINDOW_H
|
||||
|
||||
+21
-110
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2007, Haiku.
|
||||
* Copyright 2001-2008, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -9,6 +9,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <Window.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Application.h>
|
||||
#include <Autolock.h>
|
||||
#include <Button.h>
|
||||
@@ -20,13 +26,12 @@
|
||||
#include <Roster.h>
|
||||
#include <Screen.h>
|
||||
#include <String.h>
|
||||
#include <Window.h>
|
||||
|
||||
#include <input_globals.h>
|
||||
#include <AppMisc.h>
|
||||
#include <ApplicationPrivate.h>
|
||||
#include <AppServerLink.h>
|
||||
#include <ApplicationPrivate.h>
|
||||
#include <DirectMessageTarget.h>
|
||||
#include <input_globals.h>
|
||||
#include <InputServerTypes.h>
|
||||
#include <MenuPrivate.h>
|
||||
#include <MessagePrivate.h>
|
||||
@@ -36,10 +41,6 @@
|
||||
#include <tracker_private.h>
|
||||
#include <WindowPrivate.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
//#define DEBUG_WIN
|
||||
#ifdef DEBUG_WIN
|
||||
@@ -69,7 +70,8 @@ struct BWindow::unpack_cookie {
|
||||
class BWindow::Shortcut {
|
||||
public:
|
||||
Shortcut(uint32 key, uint32 modifiers, BMenuItem* item);
|
||||
Shortcut(uint32 key, uint32 modifiers, BMessage* message, BHandler* target);
|
||||
Shortcut(uint32 key, uint32 modifiers, BMessage* message,
|
||||
BHandler* target);
|
||||
~Shortcut();
|
||||
|
||||
bool Matches(uint32 key, uint32 modifiers) const;
|
||||
@@ -2480,15 +2482,8 @@ BWindow::_InitData(BRect frame, const char* title, window_look look,
|
||||
fPulseRate = 500000;
|
||||
fPulseRunner = NULL;
|
||||
|
||||
// TODO: see if you can use 'fViewsNeedPulse'
|
||||
|
||||
fIsFilePanel = false;
|
||||
|
||||
// TODO: see WHEN is this used!
|
||||
fMaskActivated = false;
|
||||
|
||||
// TODO: see WHEN is this used!
|
||||
fWaitingForMenu = false;
|
||||
fMenuSem = -1;
|
||||
|
||||
fMinimized = false;
|
||||
@@ -3213,11 +3208,7 @@ BWindow::_HandleKeyDown(BMessage* event)
|
||||
modifiers = 0;
|
||||
|
||||
// handle BMenuBar key
|
||||
if (key == B_ESCAPE && (modifiers & B_COMMAND_KEY) != 0
|
||||
&& fKeyMenuBar) {
|
||||
// TODO: ask Marc about 'fWaitingForMenu' member!
|
||||
|
||||
// fWaitingForMenu = true;
|
||||
if (key == B_ESCAPE && (modifiers & B_COMMAND_KEY) != 0 && fKeyMenuBar) {
|
||||
fKeyMenuBar->StartMenuBar(0, true, false, NULL);
|
||||
return true;
|
||||
}
|
||||
@@ -3513,10 +3504,16 @@ BWindow::IsFilePanel() const
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Virtual reserved Functions
|
||||
// #pragma mark - C++ binary compatibility kludge
|
||||
|
||||
|
||||
extern "C" void
|
||||
_ReservedWindow1__7BWindow()
|
||||
{
|
||||
// SetLayout()
|
||||
}
|
||||
|
||||
|
||||
void BWindow::_ReservedWindow1() {}
|
||||
void BWindow::_ReservedWindow2() {}
|
||||
void BWindow::_ReservedWindow3() {}
|
||||
void BWindow::_ReservedWindow4() {}
|
||||
@@ -3525,89 +3522,3 @@ void BWindow::_ReservedWindow6() {}
|
||||
void BWindow::_ReservedWindow7() {}
|
||||
void BWindow::_ReservedWindow8() {}
|
||||
|
||||
void
|
||||
BWindow::PrintToStream() const
|
||||
{
|
||||
printf("BWindow '%s' data:\
|
||||
Title = %s\
|
||||
Token = %ld\
|
||||
InTransaction = %s\
|
||||
Active = %s\
|
||||
fShowLevel = %d\
|
||||
Flags = %lx\
|
||||
send_port = %ld\
|
||||
receive_port = %ld\
|
||||
fTopView name = %s\
|
||||
focus view name = %s\
|
||||
lastMouseMoved = %s\
|
||||
fLink = %p\
|
||||
KeyMenuBar name = %s\
|
||||
DefaultButton = %s\
|
||||
# of shortcuts = %ld",
|
||||
Name(), fTitle,
|
||||
_get_object_token_(this),
|
||||
fInTransaction == true ? "yes" : "no",
|
||||
fActive == true ? "yes" : "no",
|
||||
fShowLevel,
|
||||
fFlags,
|
||||
fLink->SenderPort(),
|
||||
fLink->ReceiverPort(),
|
||||
fTopView != NULL ? fTopView->Name() : "NULL",
|
||||
fFocus != NULL ? fFocus->Name() : "NULL",
|
||||
fLastMouseMovedView != NULL ? fLastMouseMovedView->Name() : "NULL",
|
||||
fLink,
|
||||
fKeyMenuBar != NULL ? fKeyMenuBar->Name() : "NULL",
|
||||
fDefaultButton != NULL ? fDefaultButton->Name() : "NULL",
|
||||
fShortcuts.CountItems());
|
||||
/*
|
||||
for( int32 i=0; i<accelList.CountItems(); i++){
|
||||
_BCmdKey *key = (_BCmdKey*)accelList.ItemAt(i);
|
||||
printf("\tShortCut %ld: char %s\n\t\t message: \n", i, (key->key > 127)?"ASCII":"UNICODE");
|
||||
key->message->PrintToStream();
|
||||
}
|
||||
*/
|
||||
printf("\
|
||||
topViewToken = %ld\
|
||||
isFilePanel = %s\
|
||||
MaskActivated = %s\
|
||||
pulseRate = %lld\
|
||||
waitingForMenu = %s\
|
||||
minimized = %s\
|
||||
Menu semaphore = %ld\
|
||||
maxZoomHeight = %f\
|
||||
maxZoomWidth = %f\
|
||||
minWindHeight = %f\
|
||||
minWindWidth = %f\
|
||||
maxWindHeight = %f\
|
||||
maxWindWidth = %f\
|
||||
frame = ( %f, %f, %f, %f )\
|
||||
look = %d\
|
||||
feel = %d\
|
||||
lastViewToken = %ld\
|
||||
pulseRunner = %s\n",
|
||||
fTopViewToken,
|
||||
fIsFilePanel==true?"Yes":"No",
|
||||
fMaskActivated==true?"Yes":"No",
|
||||
fPulseRate,
|
||||
fWaitingForMenu==true?"Yes":"No",
|
||||
fMinimized==true?"Yes":"No",
|
||||
fMenuSem,
|
||||
fMaxZoomHeight,
|
||||
fMaxZoomWidth,
|
||||
fMinHeight,
|
||||
fMinWidth,
|
||||
fMaxHeight,
|
||||
fMaxWidth,
|
||||
fFrame.left, fFrame.top, fFrame.right, fFrame.bottom,
|
||||
(int16)fLook,
|
||||
(int16)fFeel,
|
||||
fLastViewToken,
|
||||
fPulseRunner != NULL ? "In place" : "NULL");
|
||||
}
|
||||
|
||||
/*
|
||||
TODO list:
|
||||
*) test arguments for SetWindowAligment
|
||||
*) call hook functions: MenusBeginning, MenusEnded. Add menu activation code.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user