very small changes: ordered code and liminated error because of the change if Decorator.h
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5363 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -477,10 +477,11 @@ void Screen::SetActiveWindow(ServerWindow *win)
|
|||||||
Workspace *wksp=win->GetWorkspace();
|
Workspace *wksp=win->GetWorkspace();
|
||||||
if(wksp->GetScreen()!=this)
|
if(wksp->GetScreen()!=this)
|
||||||
return;
|
return;
|
||||||
set_active_winborder(win->_winborder);
|
// set_active_winborder(win->_winborder);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// set_active_winborder(NULL);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
set_active_winborder(NULL);
|
|
||||||
_activewin=win;
|
_activewin=win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,8 +279,7 @@ STRACE(("ServerWindow %s: Show\n",_title->String()));
|
|||||||
if(_winborder)
|
if(_winborder)
|
||||||
{
|
{
|
||||||
_winborder->Show();
|
_winborder->Show();
|
||||||
_winborder->SetFocus(true);
|
// _winborder->SetFocus(true);
|
||||||
// _winborder->UpdateRegions(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,6 +302,38 @@ bool ServerWindow::IsHidden(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ServerWindow::Minimize(bool status){
|
||||||
|
bool sendMessages = false;
|
||||||
|
|
||||||
|
if (status){
|
||||||
|
if ( !IsHidden() ){
|
||||||
|
Hide();
|
||||||
|
sendMessages = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ( IsHidden() ){
|
||||||
|
Show();
|
||||||
|
sendMessages = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( sendMessages ){
|
||||||
|
BMessage msg;
|
||||||
|
msg.what = B_MINIMIZE;
|
||||||
|
msg.AddInt64("when", real_time_clock_usecs());
|
||||||
|
msg.AddBool("minimize", status );
|
||||||
|
|
||||||
|
SendMessageToClient( &msg );
|
||||||
|
|
||||||
|
// TODO: notify tracker! how???
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerWindow::Zoom(){
|
||||||
|
// TODO: implement;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Handles focus and redrawing when changing focus states
|
\brief Handles focus and redrawing when changing focus states
|
||||||
|
|
||||||
@@ -2029,10 +2060,10 @@ void ServerWindow::HandleMouseEvent(PortMessage *msg)
|
|||||||
msg->Read(&y);
|
msg->Read(&y);
|
||||||
BPoint pt(x,y);
|
BPoint pt(x,y);
|
||||||
|
|
||||||
set_is_sliding_tab(false);
|
/* set_is_sliding_tab(false);
|
||||||
set_is_moving_window(false);
|
set_is_moving_window(false);
|
||||||
set_is_resizing_window(false);
|
set_is_resizing_window(false);
|
||||||
_winborder = WindowContainsPoint(pt);
|
*/ _winborder = WindowContainsPoint(pt);
|
||||||
active_winborder=NULL;
|
active_winborder=NULL;
|
||||||
if(_winborder)
|
if(_winborder)
|
||||||
{
|
{
|
||||||
@@ -2061,7 +2092,7 @@ void ServerWindow::HandleMouseEvent(PortMessage *msg)
|
|||||||
msg->Read(&dummy);
|
msg->Read(&dummy);
|
||||||
msg->Read(&x);
|
msg->Read(&x);
|
||||||
msg->Read(&y);
|
msg->Read(&y);
|
||||||
BPoint pt(x,y);
|
/* BPoint pt(x,y);
|
||||||
|
|
||||||
if(is_moving_window() || is_resizing_window() || is_sliding_tab())
|
if(is_moving_window() || is_resizing_window() || is_sliding_tab())
|
||||||
{
|
{
|
||||||
@@ -2076,7 +2107,7 @@ void ServerWindow::HandleMouseEvent(PortMessage *msg)
|
|||||||
_winborder->MouseMoved((int8*)msg->Buffer());
|
_winborder->MouseMoved((int8*)msg->Buffer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
*/ break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,80 +64,87 @@ class Layer;
|
|||||||
class ServerWindow
|
class ServerWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServerWindow(BRect rect, const char *string, uint32 wlook, uint32 wfeel,
|
ServerWindow(BRect rect, const char *string,
|
||||||
uint32 wflags, ServerApp *winapp, port_id winport,
|
uint32 wlook, uint32 wfeel, uint32 wflags,
|
||||||
port_id looperPort, uint32 index, int32 handlerID);
|
ServerApp *winapp, port_id winport,
|
||||||
~ServerWindow(void);
|
port_id looperPort, uint32 index,
|
||||||
|
int32 handlerID);
|
||||||
|
~ServerWindow(void);
|
||||||
|
|
||||||
void ReplaceDecorator(void);
|
void ReplaceDecorator(void);
|
||||||
void Quit(void);
|
void Quit(void);
|
||||||
const char *GetTitle(void);
|
const char* GetTitle(void);
|
||||||
ServerApp *GetApp(void);
|
ServerApp* GetApp(void);
|
||||||
void Show(void);
|
void Show(void);
|
||||||
void Hide(void);
|
void Hide(void);
|
||||||
bool IsHidden(void);
|
bool IsHidden(void);
|
||||||
void SetFocus(bool value);
|
void Minimize(bool status);
|
||||||
bool HasFocus(void);
|
void Zoom(void);
|
||||||
void RequestDraw(BRect rect);
|
void SetFocus(bool value);
|
||||||
void RequestDraw(void);
|
bool HasFocus(void);
|
||||||
|
void RequestDraw(BRect rect);
|
||||||
|
void RequestDraw(void);
|
||||||
|
|
||||||
void WorkspaceActivated(int32 workspace, bool active);
|
void WorkspaceActivated(int32 workspace, bool active);
|
||||||
void WorkspacesChanged(int32 oldone,int32 newone);
|
void WorkspacesChanged(int32 oldone,int32 newone);
|
||||||
void WindowActivated(bool active);
|
void WindowActivated(bool active);
|
||||||
void ScreenModeChanged(const BRect frame, const color_space cspace);
|
void ScreenModeChanged(const BRect frame, const color_space cspace);
|
||||||
|
|
||||||
void SetFrame(const BRect &rect);
|
void SetFrame(const BRect &rect);
|
||||||
BRect Frame(void);
|
BRect Frame(void);
|
||||||
|
|
||||||
status_t Lock(void);
|
status_t Lock(void);
|
||||||
void Unlock(void);
|
void Unlock(void);
|
||||||
bool IsLocked(void);
|
bool IsLocked(void);
|
||||||
|
|
||||||
void DispatchMessage( int32 code );
|
void DispatchMessage( int32 code );
|
||||||
void DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer);
|
void DispatchGraphicsMessage(int32 msgsize, int8 *msgbuffer);
|
||||||
static int32 MonitorWin(void *data);
|
static int32 MonitorWin(void *data);
|
||||||
static void HandleMouseEvent(PortMessage *msg);
|
static void HandleMouseEvent(PortMessage *msg);
|
||||||
static void HandleKeyEvent(int32 code, int8 *buffer);
|
static void HandleKeyEvent(int32 code, int8 *buffer);
|
||||||
|
|
||||||
//! Returns the index of the workspaces to which it belongs
|
//! Returns the index of the workspaces to which it belongs
|
||||||
int32 GetWorkspaceIndex(void) { return _workspace_index; }
|
int32 GetWorkspaceIndex(void) { return _workspace_index; }
|
||||||
Workspace *GetWorkspace(void);
|
Workspace* GetWorkspace(void);
|
||||||
void SetWorkspace(Workspace *wkspc);
|
void SetWorkspace(Workspace *wkspc);
|
||||||
|
|
||||||
//! Returns the window's title
|
//! Returns the window's title
|
||||||
const char *Title(void) { return _title->String(); }
|
const char* Title(void) { return _title->String(); }
|
||||||
|
|
||||||
Layer* FindLayer(const Layer* start, int32 token) const;
|
Layer* FindLayer(const Layer* start, int32 token) const;
|
||||||
void SendMessageToClient( const BMessage* msg ) const;
|
void SendMessageToClient( const BMessage* msg ) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class ServerApp;
|
friend class ServerApp;
|
||||||
friend class WinBorder;
|
friend class WinBorder;
|
||||||
friend class Screen;
|
friend class Screen;
|
||||||
friend class Layer;
|
friend class Layer;
|
||||||
|
|
||||||
BString *_title;
|
BString *_title;
|
||||||
int32 _look, _feel, _flags;
|
int32 _look,
|
||||||
uint32 _workspace_index;
|
_feel,
|
||||||
Workspace *_workspace;
|
_flags;
|
||||||
bool _active;
|
uint32 _workspace_index;
|
||||||
|
Workspace *_workspace;
|
||||||
|
bool _active;
|
||||||
|
|
||||||
ServerApp *_app;
|
ServerApp *_app;
|
||||||
WinBorder *_winborder;
|
WinBorder *_winborder;
|
||||||
|
|
||||||
thread_id _monitorthread;
|
thread_id _monitorthread;
|
||||||
port_id _receiver; // Messages from window
|
port_id _receiver; // Messages from window
|
||||||
port_id _sender; // Messages to window
|
port_id _sender; // Messages to window
|
||||||
PortLink *_winlink,*_applink;
|
PortLink *_winlink,
|
||||||
BLocker _locker;
|
*_applink;
|
||||||
BRect _frame;
|
BLocker _locker;
|
||||||
uint32 _token;
|
BRect _frame;
|
||||||
int32 _handlertoken;
|
uint32 _token;
|
||||||
|
int32 _handlertoken;
|
||||||
|
|
||||||
// ADI:
|
BSession *ses;
|
||||||
BSession* ses;
|
port_id winLooperPort;
|
||||||
port_id winLooperPort;
|
Layer *top_layer;
|
||||||
Layer* top_layer;
|
Layer *cl; // short for currentLayer. We'll use it a lot, that's why it's short :-)
|
||||||
Layer* cl; // short for currentLayer. We'll use it a lot, that's why it's short :-)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ActivateWindow(ServerWindow *oldwin,ServerWindow *newwin);
|
void ActivateWindow(ServerWindow *oldwin,ServerWindow *newwin);
|
||||||
|
|||||||
Reference in New Issue
Block a user