* 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
+10 -10
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2007, Haiku.
* Copyright 2001-2008, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -68,11 +68,13 @@ class BDirectWindow : public BWindow {
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,18 +91,16 @@ 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 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();
@@ -109,8 +109,8 @@ class BDirectWindow : public BWindow {
virtual void _ReservedDirectWindow4();
BDirectWindow();
BDirectWindow(BDirectWindow &);
BDirectWindow &operator=(BDirectWindow &);
BDirectWindow(BDirectWindow& other);
BDirectWindow& operator=(BDirectWindow& other);
static int32 _daemon_thread(void* arg);
int32 _DirectDaemon();
@@ -148,4 +148,4 @@ class BDirectWindow : public BWindow {
uint32 _more_reserved_[17];
};
#endif
#endif // _DIRECT_WINDOW_H
+22 -43
View File
@@ -96,13 +96,11 @@ public:
window_type type, uint32 flags,
uint32 workspace = B_CURRENT_WORKSPACE);
BWindow(BRect frame, const char* title,
window_look look, window_feel feel,
uint32 flags,
window_look look, window_feel feel, uint32 flags,
uint32 workspace = B_CURRENT_WORKSPACE);
virtual ~BWindow();
BWindow(BMessage* data);
static BArchivable* Instantiate(BMessage* data);
virtual status_t Archive(BMessage* data, bool deep = true) const;
@@ -117,18 +115,16 @@ public:
virtual void DispatchMessage(BMessage* message,
BHandler* handler);
virtual void MessageReceived(BMessage* message);
virtual void FrameMoved(BPoint new_position);
virtual void FrameMoved(BPoint newPosition);
virtual void WorkspacesChanged(uint32 oldWorkspaces,
uint32 newWorkspaces);
virtual void WorkspaceActivated(int32 workspace,
bool state);
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 ScreenChanged(BRect screenSize, color_space format);
void SetPulseRate(bigtime_t rate);
bigtime_t PulseRate() const;
@@ -136,8 +132,7 @@ public:
void AddShortcut(uint32 key, uint32 modifiers,
BMessage* message);
void AddShortcut(uint32 key, uint32 modifiers,
BMessage *message,
BHandler *target);
BMessage* message, BHandler* target);
void RemoveShortcut(uint32 key, uint32 modifiers);
void SetDefaultButton(BButton* button);
@@ -237,22 +232,15 @@ public:
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,
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* h = NULL, int32* hOffset = NULL,
int32* width = NULL, int32* widthOffset = NULL,
int32* v = NULL, int32* vOffset = NULL,
int32* height = NULL,
int32* heightOffset = NULL) const;
@@ -282,7 +270,6 @@ 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();
@@ -301,7 +288,6 @@ private:
uint32 flags, uint32 workspace,
int32 bitmapToken = -1);
void BitmapClose(); // to be implemented
virtual void task_looper();
virtual BMessage* ConvertToMessage(void* raw, int32 code);
@@ -311,12 +297,10 @@ private:
BHandler* _DetermineTarget(BMessage* message,
BHandler* target);
bool _UnpackMessage(unpack_cookie& state,
BMessage** _message,
BHandler** _target,
BMessage** _message, BHandler** _target,
bool* _usePreferred);
void _SanitizeMessage(BMessage* message,
BHandler* target,
bool usePreferred);
BHandler* target, bool usePreferred);
bool _StealMouseMessage(BMessage* message,
bool& deleteMessage);
@@ -324,8 +308,7 @@ private:
void _DequeueAll();
window_type _ComposeType(window_look look,
window_feel feel) const;
void _DecomposeType(window_type type,
window_look* look,
void _DecomposeType(window_type type, window_look* look,
window_feel* feel) const;
void SetIsFilePanel(bool yes);
@@ -343,17 +326,13 @@ private:
BView* _LastViewChild(BView* parent);
BView* _FindNextNavigable(BView *focus, uint32 flags);
BView* _FindPreviousNavigable(BView *focus,
uint32 flags);
BView* _FindPreviousNavigable(BView *focus, uint32 flags);
bool _HandleKeyDown(BMessage* event);
void _KeyboardNavigation();
// Debug (TODO: to be removed)
void PrintToStream() const;
private:
char* fTitle;
int32 server_token; // not yet used
int32 _unused0;
bool fInTransaction;
bool fActive;
short fShowLevel;
@@ -367,15 +346,15 @@ private:
BButton* fDefaultButton;
BList fShortcuts;
int32 fTopViewToken;
bool _unused2; // was fPulseEnabled
bool fViewsNeedPulse; // not yet used
bool _unused2;
bool _unused3;
bool fIsFilePanel;
bool fMaskActivated;
bool _unused4;
bigtime_t fPulseRate;
bool fWaitingForMenu;
bool _unused5;
bool fMinimized;
bool fNoQuitShortcut;
bool _unused3;
bool _unused6;
sem_id fMenuSem;
float fMaxZoomHeight;
float fMaxZoomWidth;
+21 -110
View File
@@ -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.
*/