* cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28235 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cde552bdcb
commit
a02979bb3f
@ -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:
|
||||||
@ -42,14 +42,14 @@ enum window_type {
|
|||||||
enum window_look {
|
enum window_look {
|
||||||
B_BORDERED_WINDOW_LOOK = 20,
|
B_BORDERED_WINDOW_LOOK = 20,
|
||||||
B_NO_BORDER_WINDOW_LOOK = 19,
|
B_NO_BORDER_WINDOW_LOOK = 19,
|
||||||
B_TITLED_WINDOW_LOOK = 1,
|
B_TITLED_WINDOW_LOOK = 1,
|
||||||
B_DOCUMENT_WINDOW_LOOK = 11,
|
B_DOCUMENT_WINDOW_LOOK = 11,
|
||||||
B_MODAL_WINDOW_LOOK = 3,
|
B_MODAL_WINDOW_LOOK = 3,
|
||||||
B_FLOATING_WINDOW_LOOK = 7
|
B_FLOATING_WINDOW_LOOK = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
enum window_feel {
|
enum window_feel {
|
||||||
B_NORMAL_WINDOW_FEEL = 0,
|
B_NORMAL_WINDOW_FEEL = 0,
|
||||||
B_MODAL_SUBSET_WINDOW_FEEL = 2,
|
B_MODAL_SUBSET_WINDOW_FEEL = 2,
|
||||||
B_MODAL_APP_WINDOW_FEEL = 1,
|
B_MODAL_APP_WINDOW_FEEL = 1,
|
||||||
B_MODAL_ALL_WINDOW_FEEL = 3,
|
B_MODAL_ALL_WINDOW_FEEL = 3,
|
||||||
@ -92,10 +92,10 @@ 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, uint32 flags,
|
window_look look, window_feel feel, uint32 flags,
|
||||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||||
virtual ~BWindow();
|
virtual ~BWindow();
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
virtual void Minimize(bool minimize);
|
virtual void Minimize(bool minimize);
|
||||||
virtual void Zoom(BPoint origin, float width, float height);
|
virtual void Zoom(BPoint origin, float width, float height);
|
||||||
void Zoom();
|
void Zoom();
|
||||||
void SetZoomLimits(float maxWidth, float maxHeight);
|
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);
|
void SetPulseRate(bigtime_t rate);
|
||||||
@ -144,7 +144,7 @@ public:
|
|||||||
bool NeedsUpdate() const;
|
bool NeedsUpdate() const;
|
||||||
void UpdateIfNeeded();
|
void UpdateIfNeeded();
|
||||||
|
|
||||||
BView* FindView(const char* viewName) const;
|
BView* FindView(const char* viewName) const;
|
||||||
BView* FindView(BPoint) const;
|
BView* FindView(BPoint) const;
|
||||||
BView* CurrentFocus() const;
|
BView* CurrentFocus() const;
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ public:
|
|||||||
|
|
||||||
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);
|
||||||
@ -264,7 +264,7 @@ private:
|
|||||||
friend class BWindowScreen;
|
friend class BWindowScreen;
|
||||||
friend class BDirectWindow;
|
friend class BDirectWindow;
|
||||||
friend class BFilePanel;
|
friend class BFilePanel;
|
||||||
|
|
||||||
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*);
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ private:
|
|||||||
bool fActive;
|
bool fActive;
|
||||||
short fShowLevel;
|
short fShowLevel;
|
||||||
uint32 fFlags;
|
uint32 fFlags;
|
||||||
|
|
||||||
BView* fTopView;
|
BView* fTopView;
|
||||||
BView* fFocus;
|
BView* fFocus;
|
||||||
BView* fLastMouseMovedView;
|
BView* fLastMouseMovedView;
|
||||||
@ -348,7 +348,7 @@ private:
|
|||||||
int32 fTopViewToken;
|
int32 fTopViewToken;
|
||||||
bool fUpdateRequested;
|
bool fUpdateRequested;
|
||||||
bool _unused3;
|
bool _unused3;
|
||||||
bool fIsFilePanel;
|
bool fIsFilePanel;
|
||||||
bool _unused4;
|
bool _unused4;
|
||||||
bigtime_t fPulseRate;
|
bigtime_t fPulseRate;
|
||||||
bool _unused5;
|
bool _unused5;
|
||||||
@ -369,8 +369,8 @@ private:
|
|||||||
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
|
||||||
|
@ -200,7 +200,7 @@ BApplication::BApplication(BMessage *data)
|
|||||||
// constructor here, test if it's needed
|
// constructor here, test if it's needed
|
||||||
: BLooper(looper_name_for(NULL))
|
: BLooper(looper_name_for(NULL))
|
||||||
{
|
{
|
||||||
const char *signature = NULL;
|
const char *signature = NULL;
|
||||||
data->FindString("mime_sig", &signature);
|
data->FindString("mime_sig", &signature);
|
||||||
|
|
||||||
_InitData(signature, true, NULL);
|
_InitData(signature, true, NULL);
|
||||||
@ -456,7 +456,7 @@ BApplication::Instantiate(BMessage *data)
|
|||||||
if (validate_instantiation(data, "BApplication"))
|
if (validate_instantiation(data, "BApplication"))
|
||||||
return new BApplication(data);
|
return new BApplication(data);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ BApplication::Run()
|
|||||||
|
|
||||||
AssertLocked();
|
AssertLocked();
|
||||||
|
|
||||||
if (fRunCalled)
|
if (fRunCalled)
|
||||||
debugger("BApplication::Run was already called. Can only be called once.");
|
debugger("BApplication::Run was already called. Can only be called once.");
|
||||||
|
|
||||||
fThread = find_thread(NULL);
|
fThread = find_thread(NULL);
|
||||||
@ -746,7 +746,7 @@ BApplication::ResolveSpecifier(BMessage *message, int32 index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ BResources *
|
|||||||
BApplication::AppResources()
|
BApplication::AppResources()
|
||||||
{
|
{
|
||||||
AutoLocker<BLocker> lock(sAppResourcesLock);
|
AutoLocker<BLocker> lock(sAppResourcesLock);
|
||||||
|
|
||||||
// BApplication caches its resources, so check
|
// BApplication caches its resources, so check
|
||||||
// if it already happened.
|
// if it already happened.
|
||||||
if (sAppResources != NULL)
|
if (sAppResources != NULL)
|
||||||
@ -884,7 +884,7 @@ BApplication::AppResources()
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
// App is already running. Get its entry ref with
|
// App is already running. Get its entry ref with
|
||||||
// GetAppInfo()
|
// GetAppInfo()
|
||||||
app_info appInfo;
|
app_info appInfo;
|
||||||
if (be_app && be_app->GetAppInfo(&appInfo) == B_OK) {
|
if (be_app && be_app->GetAppInfo(&appInfo) == B_OK) {
|
||||||
ref = appInfo.ref;
|
ref = appInfo.ref;
|
||||||
@ -896,7 +896,7 @@ BApplication::AppResources()
|
|||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
BFile file(&ref, B_READ_ONLY);
|
BFile file(&ref, B_READ_ONLY);
|
||||||
if (file.InitCheck() == B_OK) {
|
if (file.InitCheck() == B_OK) {
|
||||||
sAppResources = new (std::nothrow) BResources(&file, false);
|
sAppResources = new (std::nothrow) BResources(&file, false);
|
||||||
@ -969,7 +969,7 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
|
|||||||
case B_PULSE:
|
case B_PULSE:
|
||||||
Pulse();
|
Pulse();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_APP_ACTIVATED:
|
case B_APP_ACTIVATED:
|
||||||
{
|
{
|
||||||
bool active = false;
|
bool active = false;
|
||||||
@ -977,7 +977,7 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
|
|||||||
AppActivated(active);
|
AppActivated(active);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case _SHOW_DRAG_HANDLES_:
|
case _SHOW_DRAG_HANDLES_:
|
||||||
{
|
{
|
||||||
bool show;
|
bool show;
|
||||||
@ -989,12 +989,12 @@ BApplication::DispatchMessage(BMessage *message, BHandler *handler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Handle these as well
|
// TODO: Handle these as well
|
||||||
case _DISPOSE_DRAG_:
|
case _DISPOSE_DRAG_:
|
||||||
case _PING_:
|
case _PING_:
|
||||||
puts("not yet handled message:");
|
puts("not yet handled message:");
|
||||||
DBG(message->PrintToStream());
|
DBG(message->PrintToStream());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BLooper::DispatchMessage(message, handler);
|
BLooper::DispatchMessage(message, handler);
|
||||||
break;
|
break;
|
||||||
@ -1082,7 +1082,7 @@ BApplication::ScriptReceived(BMessage *message, int32 index,
|
|||||||
for (int32 i=0; err == B_OK && i<count; i++) {
|
for (int32 i=0; err == B_OK && i<count; i++) {
|
||||||
BMessenger messenger(LooperAt(i));
|
BMessenger messenger(LooperAt(i));
|
||||||
err = reply.AddMessenger("result", messenger);
|
err = reply.AddMessenger("result", messenger);
|
||||||
}
|
}
|
||||||
} else if (strcmp("Windows", property) == 0) {
|
} else if (strcmp("Windows", property) == 0) {
|
||||||
int32 count = CountWindows();
|
int32 count = CountWindows();
|
||||||
err = B_OK;
|
err = B_OK;
|
||||||
@ -1173,7 +1173,7 @@ BApplication::ScriptReceived(BMessage *message, int32 index,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (strcmp("Name", property) == 0) {
|
} else if (strcmp("Name", property) == 0) {
|
||||||
err = reply.AddString("result", Name());
|
err = reply.AddString("result", Name());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case B_COUNT_PROPERTIES:
|
case B_COUNT_PROPERTIES:
|
||||||
@ -1246,7 +1246,7 @@ BApplication::_InitGUIContext()
|
|||||||
// create global system cursors
|
// create global system cursors
|
||||||
B_CURSOR_SYSTEM_DEFAULT = new BCursor(B_HAND_CURSOR);
|
B_CURSOR_SYSTEM_DEFAULT = new BCursor(B_HAND_CURSOR);
|
||||||
B_CURSOR_I_BEAM = new BCursor(B_I_BEAM_CURSOR);
|
B_CURSOR_I_BEAM = new BCursor(B_I_BEAM_CURSOR);
|
||||||
|
|
||||||
// TODO: would be nice to get the workspace at launch time from the registrar
|
// TODO: would be nice to get the workspace at launch time from the registrar
|
||||||
fInitialWorkspace = current_workspace();
|
fInitialWorkspace = current_workspace();
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2007, Haiku Inc.
|
* Copyright 2001-2008, Haiku Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@ -323,7 +323,7 @@ BBitmap::Instantiate(BMessage *data)
|
|||||||
{
|
{
|
||||||
if (validate_instantiation(data, "BBitmap"))
|
if (validate_instantiation(data, "BBitmap"))
|
||||||
return new BBitmap(data);
|
return new BBitmap(data);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ BBitmap::Archive(BMessage *data, bool deep) const
|
|||||||
|
|
||||||
if (ret == B_OK)
|
if (ret == B_OK)
|
||||||
ret = data->AddInt32("_rowbytes", fBytesPerRow);
|
ret = data->AddInt32("_rowbytes", fBytesPerRow);
|
||||||
|
|
||||||
if (ret == B_OK && deep) {
|
if (ret == B_OK && deep) {
|
||||||
if (fFlags & B_BITMAP_ACCEPTS_VIEWS) {
|
if (fFlags & B_BITMAP_ACCEPTS_VIEWS) {
|
||||||
BMessage views;
|
BMessage views;
|
||||||
@ -470,7 +470,7 @@ void *
|
|||||||
BBitmap::Bits() const
|
BBitmap::Bits() const
|
||||||
{
|
{
|
||||||
const_cast<BBitmap *>(this)->_AssertPointer();
|
const_cast<BBitmap *>(this)->_AssertPointer();
|
||||||
|
|
||||||
if (fFlags & B_BITMAP_WILL_OVERLAY) {
|
if (fFlags & B_BITMAP_WILL_OVERLAY) {
|
||||||
overlay_client_data* data = (overlay_client_data*)fBasePointer;
|
overlay_client_data* data = (overlay_client_data*)fBasePointer;
|
||||||
return data->buffer;
|
return data->buffer;
|
||||||
@ -996,7 +996,7 @@ BBitmap::_InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
// Ask the server (via our owning application) to create a bitmap.
|
// Ask the server (via our owning application) to create a bitmap.
|
||||||
BPrivate::AppServerLink link;
|
BPrivate::AppServerLink link;
|
||||||
|
|
||||||
// Attach Data:
|
// Attach Data:
|
||||||
// 1) BRect bounds
|
// 1) BRect bounds
|
||||||
// 2) color_space space
|
// 2) color_space space
|
||||||
// 3) int32 bitmap_flags
|
// 3) int32 bitmap_flags
|
||||||
@ -1077,7 +1077,7 @@ BBitmap::_InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
// TODO: Creating an offscreen window with a non32 bit bitmap
|
// TODO: Creating an offscreen window with a non32 bit bitmap
|
||||||
// copies the current content of the bitmap to a back buffer.
|
// copies the current content of the bitmap to a back buffer.
|
||||||
// So at this point the bitmap has to be already cleared to white.
|
// So at this point the bitmap has to be already cleared to white.
|
||||||
// Better move the above code to the server so the problem looks more clear.
|
// Better move the above code to the server so the problem looks more clear.
|
||||||
if (flags & B_BITMAP_ACCEPTS_VIEWS) {
|
if (flags & B_BITMAP_ACCEPTS_VIEWS) {
|
||||||
fWindow = new(std::nothrow) BWindow(Bounds(), fServerToken);
|
fWindow = new(std::nothrow) BWindow(Bounds(), fServerToken);
|
||||||
if (fWindow) {
|
if (fWindow) {
|
||||||
@ -1107,7 +1107,7 @@ BBitmap::_CleanUp()
|
|||||||
} else {
|
} else {
|
||||||
BPrivate::AppServerLink link;
|
BPrivate::AppServerLink link;
|
||||||
// AS_DELETE_BITMAP:
|
// AS_DELETE_BITMAP:
|
||||||
// Attached Data:
|
// Attached Data:
|
||||||
// 1) int32 server token
|
// 1) int32 server token
|
||||||
link.StartMessage(AS_DELETE_BITMAP);
|
link.StartMessage(AS_DELETE_BITMAP);
|
||||||
link.Attach<int32>(fServerToken);
|
link.Attach<int32>(fServerToken);
|
||||||
|
Loading…
Reference in New Issue
Block a user