Some cleanup:
* look/feel are now window_look/window_feel instead of int32. * removed the level stuff, I don't think this is needed. * some other minor stuff. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15261 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -43,8 +43,7 @@ OffscreenServerWindow::SendMessageToClient(const BMessage* msg, int32 target,
|
||||
|
||||
WindowLayer*
|
||||
OffscreenServerWindow::MakeWindowLayer(BRect frame, const char* name,
|
||||
uint32 look, uint32 feel, uint32 flags,
|
||||
uint32 workspace)
|
||||
window_look look, window_feel feel, uint32 flags, uint32 workspace)
|
||||
{
|
||||
return new OffscreenWindowLayer(fBitmap, name, this);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class OffscreenServerWindow : public ServerWindow {
|
||||
bool usePreferred = false) const;
|
||||
|
||||
virtual WindowLayer* MakeWindowLayer(BRect frame, const char* name,
|
||||
uint32 look, uint32 feel, uint32 flags,
|
||||
window_look look, window_feel feel, uint32 flags,
|
||||
uint32 workspace);
|
||||
|
||||
private:
|
||||
|
||||
@@ -479,15 +479,17 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
||||
}
|
||||
} else {
|
||||
window = new ServerWindow(title, this, clientReplyPort, looperPort, token);
|
||||
STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
fSignature(), title, frame.left, frame.top, frame.right, frame.bottom));
|
||||
STRACE(("\nServerApp %s: New Window %s (%g:%g, %g:%g)\n",
|
||||
fSignature(), title, frame.left, frame.top,
|
||||
frame.right, frame.bottom));
|
||||
}
|
||||
|
||||
free(title);
|
||||
|
||||
// NOTE: the reply to the client is handled in ServerWindow::Run()
|
||||
if (window != NULL) {
|
||||
status = window->Init(frame, look, feel, flags, workspaces);
|
||||
status = window->Init(frame, (window_look)look, (window_feel)feel,
|
||||
flags, workspaces);
|
||||
if (status == B_OK && !window->Run())
|
||||
status = B_ERROR;
|
||||
|
||||
|
||||
@@ -198,7 +198,8 @@ ServerWindow::~ServerWindow()
|
||||
|
||||
|
||||
status_t
|
||||
ServerWindow::Init(BRect frame, uint32 look, uint32 feel, uint32 flags, uint32 workspace)
|
||||
ServerWindow::Init(BRect frame, window_look look, window_feel feel,
|
||||
uint32 flags, uint32 workspace)
|
||||
{
|
||||
if (fTitle == NULL)
|
||||
return B_NO_MEMORY;
|
||||
@@ -2175,10 +2176,10 @@ ServerWindow::SendMessageToClient(const BMessage* msg, int32 target) const
|
||||
|
||||
WindowLayer*
|
||||
ServerWindow::MakeWindowLayer(BRect frame, const char* name,
|
||||
uint32 look, uint32 feel, uint32 flags, uint32 workspace)
|
||||
window_look look, window_feel feel, uint32 flags, uint32 workspace)
|
||||
{
|
||||
// The non-offscreen ServerWindow uses the DrawingEngine instance from the desktop.
|
||||
return new(nothrow) WindowLayer(frame, name, look, feel, flags,
|
||||
return new (nothrow) WindowLayer(frame, name, look, feel, flags,
|
||||
workspace, this, fDesktop->GetDrawingEngine());
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
int32 clientToken);
|
||||
virtual ~ServerWindow();
|
||||
|
||||
status_t Init(BRect frame, uint32 look,
|
||||
uint32 feel, uint32 flags,
|
||||
uint32 workspace);
|
||||
status_t Init(BRect frame, window_look look,
|
||||
window_feel feel, uint32 flags,
|
||||
uint32 workspace);
|
||||
virtual bool Run();
|
||||
virtual port_id MessagePort() const { return fMessagePort; }
|
||||
|
||||
@@ -76,12 +76,12 @@ public:
|
||||
const BMessenger& HandlerMessenger() const { return fHandlerMessenger; }
|
||||
|
||||
status_t SendMessageToClient(const BMessage* msg,
|
||||
int32 target = B_NULL_TOKEN) const;
|
||||
int32 target = B_NULL_TOKEN) const;
|
||||
|
||||
virtual WindowLayer* MakeWindowLayer(BRect frame, const char* name,
|
||||
uint32 look, uint32 feel, uint32 flags,
|
||||
window_look look, window_feel feel, uint32 flags,
|
||||
uint32 workspace);
|
||||
|
||||
|
||||
// TODO: Ouch, that's not exactly a nice name
|
||||
inline BMessage &ClientViewsWithInvalidCoords()
|
||||
{ return fClientViewsWithInvalidCoords; };
|
||||
|
||||
@@ -50,13 +50,9 @@
|
||||
|
||||
|
||||
WindowLayer::WindowLayer(const BRect &frame,
|
||||
const char *name,
|
||||
const uint32 look,
|
||||
const uint32 feel,
|
||||
const uint32 flags,
|
||||
const uint32 workspaces,
|
||||
ServerWindow *window,
|
||||
DrawingEngine *driver)
|
||||
const char *name, window_look look, window_feel feel,
|
||||
uint32 flags, uint32 workspaces,
|
||||
ServerWindow *window, DrawingEngine *driver)
|
||||
: Layer(frame, name, B_NULL_TOKEN, B_FOLLOW_NONE, 0UL, driver),
|
||||
fDecorator(NULL),
|
||||
fTopLayer(NULL),
|
||||
@@ -84,7 +80,7 @@ WindowLayer::WindowLayer(const BRect &frame,
|
||||
fRequestSent(false),
|
||||
|
||||
fLook(look),
|
||||
fLevel(-100),
|
||||
fFeel(feel),
|
||||
fWindowFlags(flags),
|
||||
fWorkspaces(workspaces),
|
||||
|
||||
@@ -98,9 +94,7 @@ WindowLayer::WindowLayer(const BRect &frame,
|
||||
fWindow = window;
|
||||
fFlags = B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE;
|
||||
|
||||
QuietlySetFeel(feel);
|
||||
|
||||
if (fFeel != B_NO_BORDER_WINDOW_LOOK) {
|
||||
if (fLook != B_NO_BORDER_WINDOW_LOOK) {
|
||||
fDecorator = gDecorManager.AllocateDecorator(window->App()->GetDesktop(), frame,
|
||||
name, fLook, fFeel, fWindowFlags);
|
||||
if (fDecorator)
|
||||
@@ -673,48 +667,11 @@ WindowLayer::SupportsFront()
|
||||
|
||||
|
||||
void
|
||||
WindowLayer::QuietlySetFeel(int32 feel)
|
||||
WindowLayer::SetFeel(window_feel feel)
|
||||
{
|
||||
fFeel = feel;
|
||||
|
||||
switch (fFeel) {
|
||||
case B_FLOATING_SUBSET_WINDOW_FEEL:
|
||||
case B_FLOATING_APP_WINDOW_FEEL:
|
||||
fLevel = B_FLOATING_APP;
|
||||
break;
|
||||
|
||||
case B_MODAL_SUBSET_WINDOW_FEEL:
|
||||
case B_MODAL_APP_WINDOW_FEEL:
|
||||
fLevel = B_MODAL_APP;
|
||||
break;
|
||||
|
||||
case B_NORMAL_WINDOW_FEEL:
|
||||
fLevel = B_NORMAL;
|
||||
break;
|
||||
|
||||
case B_FLOATING_ALL_WINDOW_FEEL:
|
||||
fLevel = B_FLOATING_ALL;
|
||||
break;
|
||||
|
||||
case B_MODAL_ALL_WINDOW_FEEL:
|
||||
fLevel = B_MODAL_ALL;
|
||||
break;
|
||||
|
||||
// TODO: This case is bogus, since I'm sure "feel"
|
||||
// is being represented by uint32 somewhere before
|
||||
// this function is used. And B_SYSTEM_LAST is defined -10. -Stephan
|
||||
case B_SYSTEM_LAST:
|
||||
case kDesktopWindowFeel:
|
||||
fLevel = B_SYSTEM_LAST;
|
||||
break;
|
||||
|
||||
case B_SYSTEM_FIRST:
|
||||
fLevel = B_SYSTEM_FIRST;
|
||||
break;
|
||||
|
||||
default:
|
||||
fLevel = B_NORMAL;
|
||||
}
|
||||
// TODO: this shouldn't be necessary, but we'll see :)
|
||||
|
||||
// floating and modal windows must appear in every workspace where
|
||||
// their main window is present. Thus their fWorkspaces will be set to
|
||||
@@ -729,8 +686,6 @@ WindowLayer::QuietlySetFeel(int32 feel)
|
||||
break;
|
||||
case B_MODAL_ALL_WINDOW_FEEL:
|
||||
case B_FLOATING_ALL_WINDOW_FEEL:
|
||||
case B_SYSTEM_LAST:
|
||||
case B_SYSTEM_FIRST:
|
||||
fWorkspaces = 0xffffffffUL;
|
||||
break;
|
||||
case B_NORMAL_WINDOW_FEEL:
|
||||
|
||||
@@ -18,19 +18,6 @@
|
||||
#include <String.h>
|
||||
|
||||
|
||||
// these are used by window manager to properly place window.
|
||||
enum {
|
||||
B_SYSTEM_LAST = -10L,
|
||||
|
||||
B_FLOATING_APP = 0L,
|
||||
B_MODAL_APP = 1L,
|
||||
B_NORMAL = 2L,
|
||||
B_FLOATING_ALL = 3L,
|
||||
B_MODAL_ALL = 4L,
|
||||
|
||||
B_SYSTEM_FIRST = 10L,
|
||||
};
|
||||
|
||||
class ServerWindow;
|
||||
class Decorator;
|
||||
class DrawingEngine;
|
||||
@@ -39,17 +26,14 @@ class Desktop;
|
||||
class WindowLayer : public Layer {
|
||||
public:
|
||||
WindowLayer(const BRect &frame,
|
||||
const char *name,
|
||||
const uint32 look,
|
||||
const uint32 feel,
|
||||
const uint32 flags,
|
||||
const uint32 workspaces,
|
||||
ServerWindow *window,
|
||||
DrawingEngine *driver);
|
||||
const char *name, window_look look,
|
||||
window_feel feel, uint32 flags,
|
||||
uint32 workspaces, ServerWindow *window,
|
||||
DrawingEngine *driver);
|
||||
virtual ~WindowLayer();
|
||||
|
||||
|
||||
virtual void Draw(const BRect &r);
|
||||
|
||||
|
||||
virtual void MoveBy(float x, float y);
|
||||
virtual void ResizeBy(float x, float y);
|
||||
virtual void ScrollBy(float x, float y)
|
||||
@@ -84,9 +68,9 @@ class WindowLayer : public Layer {
|
||||
float* minHeight,
|
||||
float* maxHeight) const;
|
||||
|
||||
virtual void MouseDown(BMessage *msg, BPoint where, int32* _viewToken);
|
||||
virtual void MouseUp(BMessage *msg, BPoint where, int32* _viewToken);
|
||||
virtual void MouseMoved(BMessage *msg, BPoint where, int32* _viewToken);
|
||||
virtual void MouseDown(BMessage* message, BPoint where, int32* _viewToken);
|
||||
virtual void MouseUp(BMessage* message, BPoint where, int32* _viewToken);
|
||||
virtual void MouseMoved(BMessage* message, BPoint where, int32* _viewToken);
|
||||
|
||||
// click_type ActionFor(const BMessage *msg)
|
||||
// { return _ActionFor(evt); }
|
||||
@@ -105,10 +89,9 @@ class WindowLayer : public Layer {
|
||||
|
||||
inline Decorator* GetDecorator() const { return fDecorator; }
|
||||
|
||||
inline int32 Look() const { return fLook; }
|
||||
inline int32 Feel() const { return fFeel; }
|
||||
inline int32 Level() const { return fLevel; }
|
||||
inline uint32 WindowFlags() const { return fWindowFlags; }
|
||||
window_look Look() const { return fLook; }
|
||||
window_feel Feel() const { return fFeel; }
|
||||
uint32 WindowFlags() const { return fWindowFlags; }
|
||||
|
||||
uint32 Workspaces() const { return fWorkspaces; }
|
||||
void SetWorkspaces(uint32 workspaces)
|
||||
@@ -124,18 +107,20 @@ class WindowLayer : public Layer {
|
||||
|
||||
void HighlightDecorator(bool active);
|
||||
|
||||
inline void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
|
||||
void QuietlySetFeel(int32 feel);
|
||||
void SetFeel(window_feel feel);
|
||||
void SetLook(window_look look);
|
||||
|
||||
SubWindowList fSubWindowList;
|
||||
|
||||
void RequestClientRedraw(const BRegion& invalid);
|
||||
virtual void _AllRedraw(const BRegion& invalid);
|
||||
|
||||
void SetTopLayer(Layer* layer);
|
||||
inline Layer* TopLayer() const
|
||||
{ return fTopLayer; }
|
||||
|
||||
protected:
|
||||
virtual void _AllRedraw(const BRegion& invalid);
|
||||
|
||||
private:
|
||||
void set_decorator_region(BRect frame);
|
||||
virtual void _ReserveRegions(BRegion ®);
|
||||
@@ -172,10 +157,9 @@ class WindowLayer : public Layer {
|
||||
bool fInUpdate;
|
||||
bool fRequestSent;
|
||||
|
||||
int32 fLook;
|
||||
int32 fFeel;
|
||||
int32 fLevel;
|
||||
int32 fWindowFlags;
|
||||
window_look fLook;
|
||||
window_feel fFeel;
|
||||
uint32 fWindowFlags;
|
||||
uint32 fWorkspaces;
|
||||
|
||||
float fMinWidth;
|
||||
|
||||
Reference in New Issue
Block a user