* 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:
Axel Dörfler
2008-02-04 15:01:34 +00:00
parent 4d67ea42f3
commit 7cb9337835
3 changed files with 265 additions and 375 deletions
+37 -37
View File
@@ -1,9 +1,9 @@
/* /*
* Copyright 2001-2007, Haiku. * Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Stefano Ceccherini <[email protected]> * Stefano Ceccherini <[email protected]>
*/ */
#ifndef _DIRECT_WINDOW_H #ifndef _DIRECT_WINDOW_H
#define _DIRECT_WINDOW_H #define _DIRECT_WINDOW_H
@@ -55,24 +55,26 @@ typedef struct {
class BDirectWindow : public BWindow { class BDirectWindow : public BWindow {
public: public:
BDirectWindow(BRect frame, const char *title, window_type type, BDirectWindow(BRect frame, const char *title, window_type type,
uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE); uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE);
BDirectWindow(BRect frame, const char *title, window_look look, BDirectWindow(BRect frame, const char *title, window_look look,
window_feel feel, uint32 flags, window_feel feel, uint32 flags,
uint32 workspace = B_CURRENT_WORKSPACE); uint32 workspace = B_CURRENT_WORKSPACE);
virtual ~BDirectWindow(); virtual ~BDirectWindow();
static BArchivable* Instantiate(BMessage *data); static BArchivable* Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const; 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 DispatchMessage(BMessage *message, BHandler *handler);
virtual void MessageReceived(BMessage *message); virtual void MessageReceived(BMessage *message);
virtual void FrameMoved(BPoint newPosition); 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 WorkspaceActivated(int32 workspaceIndex, bool state);
virtual void FrameResized(float newWidth, float newHeight); virtual void FrameResized(float newWidth, float newHeight);
virtual void Minimize(bool minimize); 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 ScreenChanged(BRect screenFrame, color_space depth);
virtual void MenusBeginning(); virtual void MenusBeginning();
virtual void MenusEnded(); virtual void MenusEnded();
@@ -89,30 +91,28 @@ class BDirectWindow : public BWindow {
virtual void task_looper(); virtual void task_looper();
virtual BMessage* ConvertToMessage(void *raw, int32 code); virtual BMessage* ConvertToMessage(void *raw, int32 code);
public: public:
virtual void DirectConnected(direct_buffer_info *info); virtual void DirectConnected(direct_buffer_info *info);
status_t GetClippingRegion(BRegion *region, BPoint *origin = NULL) const; status_t GetClippingRegion(BRegion *region,
status_t SetFullScreen(bool enable); BPoint *origin = NULL) const;
bool IsFullScreen() const; status_t SetFullScreen(bool enable);
bool IsFullScreen() const;
static bool SupportsWindowMode(screen_id id = B_MAIN_SCREEN_ID); static bool SupportsWindowMode(screen_id id = B_MAIN_SCREEN_ID);
private: private:
typedef BWindow inherited; typedef BWindow inherited;
virtual void _ReservedDirectWindow1(); virtual void _ReservedDirectWindow1();
virtual void _ReservedDirectWindow2(); virtual void _ReservedDirectWindow2();
virtual void _ReservedDirectWindow3(); virtual void _ReservedDirectWindow3();
virtual void _ReservedDirectWindow4(); virtual void _ReservedDirectWindow4();
BDirectWindow();
BDirectWindow(BDirectWindow &);
BDirectWindow &operator=(BDirectWindow &);
static int32 _daemon_thread(void *arg); BDirectWindow();
BDirectWindow(BDirectWindow& other);
BDirectWindow& operator=(BDirectWindow& other);
static int32 _daemon_thread(void* arg);
int32 _DirectDaemon(); int32 _DirectDaemon();
bool _LockDirect() const; bool _LockDirect() const;
void _UnlockDirect() const; void _UnlockDirect() const;
@@ -125,27 +125,27 @@ class BDirectWindow : public BWindow {
bool fIsFullScreen; bool fIsFullScreen;
bool _unused; bool _unused;
bool fInDirectConnect; bool fInDirectConnect;
int32 fDirectLock; int32 fDirectLock;
sem_id fDirectSem; sem_id fDirectSem;
uint32 fDirectLockCount; uint32 fDirectLockCount;
thread_id fDirectLockOwner; thread_id fDirectLockOwner;
char *fDirectLockStack; char* fDirectLockStack;
sem_id fDisableSem; sem_id fDisableSem;
sem_id fDisableSemAck; sem_id fDisableSemAck;
uint32 fInitStatus; uint32 fInitStatus;
uint32 fInfoAreaSize; uint32 fInfoAreaSize;
uint32 _reserved[2]; uint32 _reserved[2];
area_id fClonedClippingArea; area_id fClonedClippingArea;
area_id fSourceClippingArea; area_id fSourceClippingArea;
thread_id fDirectDaemonId; thread_id fDirectDaemonId;
direct_buffer_info *fBufferDesc; direct_buffer_info* fBufferDesc;
uint32 _more_reserved_[17]; uint32 _more_reserved_[17];
}; };
#endif #endif // _DIRECT_WINDOW_H
+207 -228
View File
@@ -92,177 +92,165 @@ enum {
class BWindow : public BLooper { class BWindow : public BLooper {
public: public:
BWindow(BRect frame, const char* title, BWindow(BRect frame, const char* title,
window_type type, uint32 flags, window_type type, uint32 flags,
uint32 workspace = B_CURRENT_WORKSPACE); uint32 workspace = B_CURRENT_WORKSPACE);
BWindow(BRect frame, const char* title, BWindow(BRect frame, const char* title,
window_look look, window_feel feel, window_look look, window_feel feel, uint32 flags,
uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE);
uint32 workspace = B_CURRENT_WORKSPACE); virtual ~BWindow();
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 void Quit();
virtual status_t Archive(BMessage* data, bool deep = true) const; void Close() { Quit(); }
virtual void Quit(); void AddChild(BView* child, BView* before = NULL);
void Close() { Quit(); } bool RemoveChild(BView* child);
int32 CountChildren() const;
BView* ChildAt(int32 index) const;
void AddChild(BView* child, BView* before = NULL); virtual void DispatchMessage(BMessage* message,
bool RemoveChild(BView* child); BHandler* handler);
int32 CountChildren() const; virtual void MessageReceived(BMessage* message);
BView* ChildAt(int32 index) const; 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, void SetPulseRate(bigtime_t rate);
BHandler* handler); bigtime_t PulseRate() const;
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); void AddShortcut(uint32 key, uint32 modifiers,
bigtime_t PulseRate() const; BMessage* message);
void AddShortcut(uint32 key, uint32 modifiers,
BMessage* message, BHandler* target);
void RemoveShortcut(uint32 key, uint32 modifiers);
void AddShortcut(uint32 key, uint32 modifiers, void SetDefaultButton(BButton* button);
BMessage *message); BButton* DefaultButton() const;
void AddShortcut(uint32 key, uint32 modifiers,
BMessage *message,
BHandler *target);
void RemoveShortcut(uint32 key, uint32 modifiers);
void SetDefaultButton(BButton* button); virtual void MenusBeginning();
BButton* DefaultButton() const; virtual void MenusEnded();
virtual void MenusBeginning(); bool NeedsUpdate() const;
virtual void MenusEnded(); void UpdateIfNeeded();
bool NeedsUpdate() const; BView* FindView(const char* viewName) const;
void UpdateIfNeeded(); BView* FindView(BPoint) const;
BView* CurrentFocus() const;
BView* FindView(const char* viewName) const; void Activate(bool = true);
BView* FindView(BPoint) const; virtual void WindowActivated(bool state);
BView* CurrentFocus() const;
void Activate(bool = true); void ConvertToScreen(BPoint* point) const;
virtual void WindowActivated(bool state); 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; void MoveBy(float dx, float dy);
BPoint ConvertToScreen(BPoint point) const; void MoveTo(BPoint);
void ConvertFromScreen(BPoint* point) const; void MoveTo(float x, float y);
BPoint ConvertFromScreen(BPoint point) const; void ResizeBy(float dx, float dy);
void ConvertToScreen(BRect* rect) const; void ResizeTo(float width, float height);
BRect ConvertToScreen(BRect rect) const;
void ConvertFromScreen(BRect* rect) const;
BRect ConvertFromScreen(BRect rect) const;
void MoveBy(float dx, float dy); virtual void Show();
void MoveTo(BPoint); virtual void Hide();
void MoveTo(float x, float y); bool IsHidden() const;
void ResizeBy(float dx, float dy); bool IsMinimized() const;
void ResizeTo(float width, float height);
virtual void Show(); void Flush() const;
virtual void Hide(); void Sync() const;
bool IsHidden() const;
bool IsMinimized() const;
void Flush() const; status_t SendBehind(const BWindow* window);
void Sync() const;
status_t SendBehind(const BWindow* window); void DisableUpdates();
void EnableUpdates();
void DisableUpdates(); void BeginViewTransaction();
void EnableUpdates();
void BeginViewTransaction();
// referred as OpenViewTransaction() in BeBook // referred as OpenViewTransaction() in BeBook
void EndViewTransaction(); void EndViewTransaction();
// referred as CommitViewTransaction() in BeBook // referred as CommitViewTransaction() in BeBook
BRect Bounds() const; BRect Bounds() const;
BRect Frame() const; BRect Frame() const;
const char* Title() const; const char* Title() const;
void SetTitle(const char* title); void SetTitle(const char* title);
bool IsFront() const; bool IsFront() const;
bool IsActive() const; bool IsActive() const;
void SetKeyMenuBar(BMenuBar* bar); void SetKeyMenuBar(BMenuBar* bar);
BMenuBar* KeyMenuBar() const; BMenuBar* KeyMenuBar() const;
void SetSizeLimits(float minWidth, float maxWidth, void SetSizeLimits(float minWidth, float maxWidth,
float minHeight, float maxHeight); float minHeight, float maxHeight);
void GetSizeLimits(float* minWidth, float* maxWidth, void GetSizeLimits(float* minWidth, float* maxWidth,
float* minHeight, float* maxHeight); float* minHeight, float* maxHeight);
status_t SetDecoratorSettings(const BMessage& settings); status_t SetDecoratorSettings(const BMessage& settings);
status_t GetDecoratorSettings(BMessage* settings) const; status_t GetDecoratorSettings(BMessage* settings) const;
uint32 Workspaces() const; uint32 Workspaces() const;
void SetWorkspaces(uint32); void SetWorkspaces(uint32);
BView* LastMouseMovedView() const; BView* LastMouseMovedView() const;
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index, virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
BMessage* specifier, int32 form, BMessage* specifier, int32 form,
const char* property); const char* property);
virtual status_t GetSupportedSuites(BMessage* data); virtual status_t GetSupportedSuites(BMessage* data);
status_t AddToSubset(BWindow* window); status_t AddToSubset(BWindow* window);
status_t RemoveFromSubset(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); status_t SetType(window_type type);
window_type Type() const; window_type Type() const;
status_t SetLook(window_look look); status_t SetLook(window_look look);
window_look Look() const; window_look Look() const;
status_t SetFeel(window_feel feel); status_t SetFeel(window_feel feel);
window_feel Feel() const; window_feel Feel() const;
status_t SetFlags(uint32); status_t SetFlags(uint32);
uint32 Flags() const; uint32 Flags() const;
bool IsModal() const; bool IsModal() const;
bool IsFloating() const; bool IsFloating() const;
status_t SetWindowAlignment(window_alignment mode, status_t SetWindowAlignment(window_alignment mode, int32 h,
int32 h, int32 hOffset = 0, int32 width = 0,
int32 hOffset = 0, int32 widthOffset = 0, int32 v = 0,
int32 width = 0, int32 vOffset = 0, int32 height = 0,
int32 widthOffset = 0, int32 heightOffset = 0);
int32 v = 0, status_t GetWindowAlignment(window_alignment* mode = NULL,
int32 vOffset = 0, int32* h = NULL, int32* hOffset = NULL,
int32 height = 0, int32* width = NULL, int32* widthOffset = NULL,
int32 heightOffset = 0); int32* v = NULL, int32* vOffset = NULL,
status_t GetWindowAlignment(window_alignment* mode = NULL, int32* height = NULL,
int32* h = NULL, int32* heightOffset = NULL) const;
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 bool QuitRequested();
virtual thread_id Run(); virtual thread_id Run();
virtual void SetLayout(BLayout* layout); virtual void SetLayout(BLayout* layout);
BLayout* GetLayout() const; BLayout* GetLayout() const;
void InvalidateLayout(bool descendants = false); void InvalidateLayout(bool descendants = false);
private: private:
typedef BLooper inherited; typedef BLooper inherited;
@@ -282,116 +270,107 @@ private:
friend void _set_menu_sem_(BWindow* w, sem_id sem); friend void _set_menu_sem_(BWindow* w, sem_id sem);
friend status_t _safe_get_server_token_(const BLooper*, int32*); friend status_t _safe_get_server_token_(const BLooper*, int32*);
virtual void _ReservedWindow1(); virtual void _ReservedWindow2();
virtual void _ReservedWindow2(); virtual void _ReservedWindow3();
virtual void _ReservedWindow3(); virtual void _ReservedWindow4();
virtual void _ReservedWindow4(); virtual void _ReservedWindow5();
virtual void _ReservedWindow5(); virtual void _ReservedWindow6();
virtual void _ReservedWindow6(); virtual void _ReservedWindow7();
virtual void _ReservedWindow7(); virtual void _ReservedWindow8();
virtual void _ReservedWindow8();
BWindow(); BWindow();
BWindow(BWindow&); BWindow(BWindow&);
BWindow& operator=(BWindow&); BWindow& operator=(BWindow&);
BWindow(BRect frame, int32 bitmapToken); BWindow(BRect frame, int32 bitmapToken);
void _InitData(BRect frame, const char* title, void _InitData(BRect frame, const char* title,
window_look look, window_feel feel, window_look look, window_feel feel,
uint32 flags, uint32 workspace, uint32 flags, uint32 workspace,
int32 bitmapToken = -1); 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, void AddShortcut(uint32 key, uint32 modifiers,
BMenuItem* item); BMenuItem* item);
BHandler* _DetermineTarget(BMessage* message, BHandler* _DetermineTarget(BMessage* message,
BHandler* target); BHandler* target);
bool _UnpackMessage(unpack_cookie& state, bool _UnpackMessage(unpack_cookie& state,
BMessage** _message, BMessage** _message, BHandler** _target,
BHandler** _target, bool* _usePreferred);
bool* _usePreferred); void _SanitizeMessage(BMessage* message,
void _SanitizeMessage(BMessage* message, BHandler* target, bool usePreferred);
BHandler* target, bool _StealMouseMessage(BMessage* message,
bool usePreferred); bool& deleteMessage);
bool _StealMouseMessage(BMessage* message,
bool& deleteMessage);
bool InUpdate(); bool InUpdate();
void _DequeueAll(); void _DequeueAll();
window_type _ComposeType(window_look look, window_type _ComposeType(window_look look,
window_feel feel) const; window_feel feel) const;
void _DecomposeType(window_type type, void _DecomposeType(window_type type, window_look* look,
window_look* look, window_feel* feel) const;
window_feel* feel) const;
void SetIsFilePanel(bool yes); void SetIsFilePanel(bool yes);
bool IsFilePanel() const; bool IsFilePanel() const;
void _CreateTopView(); void _CreateTopView();
void _AdoptResize(); void _AdoptResize();
void _SetFocus(BView* focusView, void _SetFocus(BView* focusView,
bool notifyIputServer = false); bool notifyIputServer = false);
void _SetName(const char* title); void _SetName(const char* title);
Shortcut* _FindShortcut(uint32 key, uint32 modifiers); Shortcut* _FindShortcut(uint32 key, uint32 modifiers);
BView* _FindView(BView* view, BPoint point) const; BView* _FindView(BView* view, BPoint point) const;
BView* _FindView(int32 token); BView* _FindView(int32 token);
BView* _LastViewChild(BView* parent); BView* _LastViewChild(BView* parent);
BView* _FindNextNavigable(BView *focus, uint32 flags); BView* _FindNextNavigable(BView *focus, uint32 flags);
BView* _FindPreviousNavigable(BView *focus, BView* _FindPreviousNavigable(BView *focus, uint32 flags);
uint32 flags); bool _HandleKeyDown(BMessage* event);
bool _HandleKeyDown(BMessage* event); void _KeyboardNavigation();
void _KeyboardNavigation();
// Debug (TODO: to be removed)
void PrintToStream() const;
private: private:
char* fTitle; char* fTitle;
int32 server_token; // not yet used int32 _unused0;
bool fInTransaction; bool fInTransaction;
bool fActive; bool fActive;
short fShowLevel; short fShowLevel;
uint32 fFlags; uint32 fFlags;
BView* fTopView; BView* fTopView;
BView* fFocus; BView* fFocus;
BView* fLastMouseMovedView; BView* fLastMouseMovedView;
uint32 _unused1; uint32 _unused1;
BMenuBar* fKeyMenuBar; BMenuBar* fKeyMenuBar;
BButton* fDefaultButton; BButton* fDefaultButton;
BList fShortcuts; BList fShortcuts;
int32 fTopViewToken; int32 fTopViewToken;
bool _unused2; // was fPulseEnabled bool _unused2;
bool fViewsNeedPulse; // not yet used bool _unused3;
bool fIsFilePanel; bool fIsFilePanel;
bool fMaskActivated; bool _unused4;
bigtime_t fPulseRate; bigtime_t fPulseRate;
bool fWaitingForMenu; bool _unused5;
bool fMinimized; bool fMinimized;
bool fNoQuitShortcut; bool fNoQuitShortcut;
bool _unused3; bool _unused6;
sem_id fMenuSem; sem_id fMenuSem;
float fMaxZoomHeight; float fMaxZoomHeight;
float fMaxZoomWidth; float fMaxZoomWidth;
float fMinHeight; float fMinHeight;
float fMinWidth; float fMinWidth;
float fMaxHeight; float fMaxHeight;
float fMaxWidth; float fMaxWidth;
BRect fFrame; BRect fFrame;
window_look fLook; window_look fLook;
window_feel fFeel; window_feel fFeel;
int32 fLastViewToken; int32 fLastViewToken;
BPrivate::PortLink* fLink; BPrivate::PortLink* fLink;
BMessageRunner* fPulseRunner; BMessageRunner* fPulseRunner;
BRect fPreviousFrame; BRect fPreviousFrame;
uint32 _reserved[9]; uint32 _reserved[9];
}; };
#endif // _WINDOW_H #endif // _WINDOW_H
+21 -110
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2007, Haiku. * Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -9,6 +9,12 @@
*/ */
#include <Window.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <Application.h> #include <Application.h>
#include <Autolock.h> #include <Autolock.h>
#include <Button.h> #include <Button.h>
@@ -20,13 +26,12 @@
#include <Roster.h> #include <Roster.h>
#include <Screen.h> #include <Screen.h>
#include <String.h> #include <String.h>
#include <Window.h>
#include <input_globals.h>
#include <AppMisc.h> #include <AppMisc.h>
#include <ApplicationPrivate.h>
#include <AppServerLink.h> #include <AppServerLink.h>
#include <ApplicationPrivate.h>
#include <DirectMessageTarget.h> #include <DirectMessageTarget.h>
#include <input_globals.h>
#include <InputServerTypes.h> #include <InputServerTypes.h>
#include <MenuPrivate.h> #include <MenuPrivate.h>
#include <MessagePrivate.h> #include <MessagePrivate.h>
@@ -36,10 +41,6 @@
#include <tracker_private.h> #include <tracker_private.h>
#include <WindowPrivate.h> #include <WindowPrivate.h>
#include <ctype.h>
#include <stdio.h>
#include <math.h>
//#define DEBUG_WIN //#define DEBUG_WIN
#ifdef DEBUG_WIN #ifdef DEBUG_WIN
@@ -69,7 +70,8 @@ struct BWindow::unpack_cookie {
class BWindow::Shortcut { class BWindow::Shortcut {
public: public:
Shortcut(uint32 key, uint32 modifiers, BMenuItem* item); 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(); ~Shortcut();
bool Matches(uint32 key, uint32 modifiers) const; bool Matches(uint32 key, uint32 modifiers) const;
@@ -2480,15 +2482,8 @@ BWindow::_InitData(BRect frame, const char* title, window_look look,
fPulseRate = 500000; fPulseRate = 500000;
fPulseRunner = NULL; fPulseRunner = NULL;
// TODO: see if you can use 'fViewsNeedPulse'
fIsFilePanel = false; fIsFilePanel = false;
// TODO: see WHEN is this used!
fMaskActivated = false;
// TODO: see WHEN is this used!
fWaitingForMenu = false;
fMenuSem = -1; fMenuSem = -1;
fMinimized = false; fMinimized = false;
@@ -3213,11 +3208,7 @@ BWindow::_HandleKeyDown(BMessage* event)
modifiers = 0; modifiers = 0;
// handle BMenuBar key // handle BMenuBar key
if (key == B_ESCAPE && (modifiers & B_COMMAND_KEY) != 0 if (key == B_ESCAPE && (modifiers & B_COMMAND_KEY) != 0 && fKeyMenuBar) {
&& fKeyMenuBar) {
// TODO: ask Marc about 'fWaitingForMenu' member!
// fWaitingForMenu = true;
fKeyMenuBar->StartMenuBar(0, true, false, NULL); fKeyMenuBar->StartMenuBar(0, true, false, NULL);
return true; return true;
} }
@@ -3513,10 +3504,16 @@ BWindow::IsFilePanel() const
} }
//------------------------------------------------------------------------------ // #pragma mark - C++ binary compatibility kludge
// Virtual reserved Functions
extern "C" void
_ReservedWindow1__7BWindow()
{
// SetLayout()
}
void BWindow::_ReservedWindow1() {}
void BWindow::_ReservedWindow2() {} void BWindow::_ReservedWindow2() {}
void BWindow::_ReservedWindow3() {} void BWindow::_ReservedWindow3() {}
void BWindow::_ReservedWindow4() {} void BWindow::_ReservedWindow4() {}
@@ -3525,89 +3522,3 @@ void BWindow::_ReservedWindow6() {}
void BWindow::_ReservedWindow7() {} void BWindow::_ReservedWindow7() {}
void BWindow::_ReservedWindow8() {} 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.
*/