Big cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12424 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
af1a2a015b
commit
d7c2c05061
@ -253,7 +253,7 @@ void Desktop::AddWinBorder(WinBorder *winBorder)
|
||||
// R2: how to determine the RootLayer to which this window should be added???
|
||||
// for now, use ActiveRootLayer() because we only have one instance.
|
||||
|
||||
int32 feel = winBorder->Window()->Feel();
|
||||
int32 feel = winBorder->Feel();
|
||||
|
||||
// we are ServerApp thread, we need to lock RootLayer here.
|
||||
ActiveRootLayer()->Lock();
|
||||
@ -287,7 +287,7 @@ void Desktop::AddWinBorder(WinBorder *winBorder)
|
||||
{
|
||||
wb = (WinBorder*)fWinBorderList.ItemAt(i);
|
||||
if (wb->App()->ClientTeamID() == winBorder->App()->ClientTeamID()
|
||||
&& wb->Window()->Feel() == feelToLookFor)
|
||||
&& wb->Feel() == feelToLookFor)
|
||||
// R2: RootLayer comparison is needed.
|
||||
{
|
||||
feel == B_NORMAL_WINDOW_FEEL ?
|
||||
@ -326,7 +326,7 @@ void Desktop::RemoveWinBorder(WinBorder *winBorder)
|
||||
// remove from main WinBorder list.
|
||||
if (fWinBorderList.RemoveItem(winBorder))
|
||||
{
|
||||
int32 feel = winBorder->Window()->Feel();
|
||||
int32 feel = winBorder->Feel();
|
||||
|
||||
// floating app/subset and modal_subset windows require special atention because
|
||||
// they are/may_be added to the list of a lot normal windows.
|
||||
@ -341,7 +341,7 @@ void Desktop::RemoveWinBorder(WinBorder *winBorder)
|
||||
{
|
||||
wb = (WinBorder*)fWinBorderList.ItemAt(i);
|
||||
|
||||
if (wb->Window()->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
if (wb->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
&& wb->App()->ClientTeamID() == winBorder->App()->ClientTeamID())
|
||||
// R2: RootLayer comparison is needed. We'll see.
|
||||
{
|
||||
@ -389,9 +389,9 @@ void Desktop::AddWinBorderToSubset(WinBorder *winBorder, WinBorder *toWinBorder)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (winBorder->Window()->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL
|
||||
|| winBorder->Window()->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
&& toWinBorder->Window()->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
if ( (winBorder->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL
|
||||
|| winBorder->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
&& toWinBorder->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
&& toWinBorder->App()->ClientTeamID() == winBorder->App()->ClientTeamID()
|
||||
&& !toWinBorder->fFMWList.HasItem(winBorder))
|
||||
{
|
||||
@ -431,7 +431,7 @@ void Desktop::RemoveWinBorderFromSubset(WinBorder *winBorder, WinBorder *fromWin
|
||||
// remove WinBorder from workspace, if needed - some other windows may still have it in their subset
|
||||
ActiveRootLayer()->RemoveSubsetWinBorder(winBorder, fromWinBorder);
|
||||
|
||||
if (fromWinBorder->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
if (fromWinBorder->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
{
|
||||
//remove from this normal_window's subset.
|
||||
fromWinBorder->fFMWList.RemoveItem(winBorder);
|
||||
|
@ -45,14 +45,14 @@ void FMWList::AddWinBorder(void *item)
|
||||
if(HasItem(item))
|
||||
return;
|
||||
|
||||
int32 feelItem = ((WinBorder*)item)->Window()->Feel();;
|
||||
int32 feelItem = ((WinBorder*)item)->Feel();;
|
||||
int32 feelTemp = 0;
|
||||
int32 location = 0;
|
||||
|
||||
for(int32 i=0; i<CountItems(); i++)
|
||||
{
|
||||
location = i + 1;
|
||||
feelTemp = ((WinBorder*)ItemAt(i))->Window()->Feel();
|
||||
feelTemp = ((WinBorder*)ItemAt(i))->Feel();
|
||||
|
||||
// in short: if 'item' is a floating window
|
||||
if( (feelItem == B_FLOATING_SUBSET_WINDOW_FEEL ||
|
||||
@ -77,7 +77,7 @@ void FMWList::AddFMWList(FMWList *list)
|
||||
int32 i=0;
|
||||
for(i=0; i<CountItems(); i++)
|
||||
{
|
||||
int32 feel = ((WinBorder*)ItemAt(i))->Window()->Feel();
|
||||
int32 feel = ((WinBorder*)ItemAt(i))->Feel();
|
||||
if(feel == B_MODAL_SUBSET_WINDOW_FEEL ||
|
||||
feel == B_MODAL_APP_WINDOW_FEEL ||
|
||||
feel == B_MODAL_ALL_WINDOW_FEEL)
|
||||
@ -90,7 +90,7 @@ void FMWList::AddFMWList(FMWList *list)
|
||||
for(j=0; j<list->CountItems(); j++)
|
||||
{
|
||||
void *item = list->ItemAt(j);
|
||||
int32 feel = ((WinBorder*)item)->Window()->Feel();
|
||||
int32 feel = ((WinBorder*)item)->Feel();
|
||||
if(feel == B_MODAL_SUBSET_WINDOW_FEEL ||
|
||||
feel == B_MODAL_APP_WINDOW_FEEL ||
|
||||
feel == B_MODAL_ALL_WINDOW_FEEL)
|
||||
@ -115,26 +115,26 @@ void FMWList::PrintToStream() const
|
||||
|
||||
printf("\t%s", wb->GetName());
|
||||
|
||||
if (wb->Window()->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL");
|
||||
|
||||
if (wb->Window()->Feel() == B_FLOATING_APP_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_FLOATING_APP_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_APP_WINDOW_FEEL");
|
||||
|
||||
if (wb->Window()->Feel() == B_FLOATING_ALL_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_FLOATING_ALL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_ALL_WINDOW_FEEL");
|
||||
|
||||
if (wb->Window()->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_SUBSET_WINDOW_FEEL");
|
||||
|
||||
if (wb->Window()->Feel() == B_MODAL_APP_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_MODAL_APP_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_APP_WINDOW_FEEL");
|
||||
|
||||
if (wb->Window()->Feel() == B_MODAL_ALL_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_MODAL_ALL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_ALL_WINDOW_FEEL");
|
||||
|
||||
// this should NOT happen
|
||||
if (wb->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
if (wb->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_NORMAL_WINDOW_FEEL");
|
||||
}
|
||||
}
|
||||
|
@ -406,10 +406,10 @@ void RootLayer::AddWinBorder(WinBorder* winBorder)
|
||||
}
|
||||
|
||||
// Subset modals also need to have a main window before appearing in workspace list.
|
||||
int32 feel = winBorder->Window()->Feel();
|
||||
int32 feel = winBorder->Feel();
|
||||
if (feel != B_FLOATING_SUBSET_WINDOW_FEEL && feel != B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
{
|
||||
uint32 wks = winBorder->Window()->Workspaces();
|
||||
uint32 wks = winBorder->Workspaces();
|
||||
|
||||
// add to current workspace
|
||||
if (wks == 0)
|
||||
@ -461,7 +461,7 @@ void RootLayer::RemoveWinBorder(WinBorder* winBorder)
|
||||
void RootLayer::AddSubsetWinBorder(WinBorder *winBorder, WinBorder *toWinBorder)
|
||||
{
|
||||
// SUBSET windows _must_ have their workspaceIndex set to 0x0
|
||||
if (winBorder->Window()->Workspaces() != 0UL)
|
||||
if (winBorder->Workspaces() != 0UL)
|
||||
{
|
||||
debugger("SUBSET windows _must_ have their workspaceIndex set to 0x0\n");
|
||||
return;
|
||||
@ -552,7 +552,7 @@ bool RootLayer::SetActiveWorkspace(int32 index)
|
||||
|
||||
for (int32 i = 0; i < ptrCount; i++)
|
||||
{
|
||||
if (ptrWin[i]->Window()->Workspaces() & (0x00000001UL << index))
|
||||
if (ptrWin[i]->Workspaces() & (0x00000001UL << index))
|
||||
{
|
||||
fWorkspace[index]->AddWinBorder(ptrWin[i]);
|
||||
if (!ptrWin[i]->IsHidden())
|
||||
@ -589,7 +589,7 @@ bool RootLayer::SetActiveWorkspace(int32 index)
|
||||
fResizingWindow = false;
|
||||
|
||||
// only normal windows can change workspaces
|
||||
if (movingWinBorder->Window()->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
if (movingWinBorder->Feel() == B_NORMAL_WINDOW_FEEL
|
||||
&& !ActiveWorkspace()->HasWinBorder(movingWinBorder))
|
||||
{
|
||||
// Workspace class expects a window to be hidden when it's about to be removed.
|
||||
@ -604,14 +604,14 @@ bool RootLayer::SetActiveWorkspace(int32 index)
|
||||
ActiveWorkspace()->ShowWinBorder(movingWinBorder);
|
||||
|
||||
// TODO: can you call SetWinBorderWorskpaces() instead of this?
|
||||
uint32 wks = movingWinBorder->Window()->Workspaces();
|
||||
uint32 wks = movingWinBorder->Workspaces();
|
||||
BMessage changedMsg(B_WORKSPACES_CHANGED);
|
||||
changedMsg.AddInt64("when", real_time_clock_usecs());
|
||||
changedMsg.AddInt32("old", wks);
|
||||
wks &= ~(0x00000001 << exIndex);
|
||||
wks |= (0x00000001 << fActiveWksIndex);
|
||||
changedMsg.AddInt32("new", wks);
|
||||
movingWinBorder->Window()->QuietlySetWorkspaces(wks);
|
||||
movingWinBorder->QuietlySetWorkspaces(wks);
|
||||
movingWinBorder->Window()->SendMessageToClient(&changedMsg, B_NULL_TOKEN, false);
|
||||
}
|
||||
}
|
||||
@ -650,7 +650,7 @@ void RootLayer::SetWinBorderWorskpaces(WinBorder *winBorder, uint32 oldWksIndex,
|
||||
{
|
||||
// you *cannot* set workspaces index for a window other than a normal one!
|
||||
// Note: See ServerWindow class.
|
||||
if (winBorder->Window()->Feel() != B_NORMAL_WINDOW_FEEL)
|
||||
if (winBorder->Feel() != B_NORMAL_WINDOW_FEEL)
|
||||
return;
|
||||
|
||||
bool invalidate = false;
|
||||
@ -716,6 +716,7 @@ void RootLayer::SetWinBorderWorskpaces(WinBorder *winBorder, uint32 oldWksIndex,
|
||||
changedMsg.AddInt64("when", real_time_clock_usecs());
|
||||
changedMsg.AddInt32("old", oldWksIndex);
|
||||
changedMsg.AddInt32("new", newWksIndex);
|
||||
winBorder->QuietlySetWorkspaces(newWksIndex);
|
||||
winBorder->Window()->SendMessageToClient(&changedMsg, B_NULL_TOKEN, false);
|
||||
|
||||
if (invalidate)
|
||||
@ -1012,7 +1013,7 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
||||
if (target != FocusWinBorder())
|
||||
sendMessage = false;
|
||||
else if (exFocus != FocusWinBorder()
|
||||
&& !(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK))
|
||||
&& !(target->WindowFlags() & B_WILL_ACCEPT_FIRST_CLICK))
|
||||
sendMessage = false;
|
||||
|
||||
if (sendMessage && fLastMouseMoved != target->fTopLayer)
|
||||
|
@ -341,7 +341,6 @@ int32 ServerApp::MonitorApp(void *data)
|
||||
port_id sendPort = -1;
|
||||
port_id looperPort = -1;
|
||||
char *title = NULL;
|
||||
port_id replyport = -1;
|
||||
|
||||
msgqueue.Read<BRect>(&frame);
|
||||
msgqueue.Read<uint32>(&look);
|
||||
@ -357,9 +356,8 @@ int32 ServerApp::MonitorApp(void *data)
|
||||
|
||||
// ServerWindow constructor will reply with port_id of a newly created port
|
||||
ServerWindow *sw = NULL;
|
||||
sw = new ServerWindow(frame, title, look, feel, flags, app,
|
||||
sendPort, looperPort, replyport, wkspaces, token);
|
||||
sw->Init();
|
||||
sw = new ServerWindow(title, app, sendPort, looperPort, token);
|
||||
sw->Init(frame, look, feel, flags, wkspaces);
|
||||
|
||||
STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
app->fSignature.String(),title,frame.left,frame.top,frame.right,frame.bottom));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -66,74 +66,60 @@ class Layer;
|
||||
class ServerWindow
|
||||
{
|
||||
public:
|
||||
ServerWindow(BRect rect, const char *string, uint32 wlook, uint32 wfeel, uint32 wflags,
|
||||
ServerApp *winapp, port_id winport, port_id looperPort, port_id replyport,
|
||||
uint32 index,int32 handlerID);
|
||||
virtual ~ServerWindow(void);
|
||||
ServerWindow( const char *string,
|
||||
ServerApp *winapp,
|
||||
port_id winport,
|
||||
port_id looperPort,
|
||||
int32 handlerID);
|
||||
virtual ~ServerWindow(void);
|
||||
|
||||
void Init();
|
||||
void Init( BRect frame,
|
||||
uint32 wlook, uint32 wfeel, uint32 wflags,
|
||||
uint32 wwksindex);
|
||||
|
||||
// ServerWindow must be locked for these ones.
|
||||
void ReplaceDecorator(void);
|
||||
void Quit(void);
|
||||
void Show(void);
|
||||
void Hide(void);
|
||||
void ReplaceDecorator(void);
|
||||
void Show(void);
|
||||
void Hide(void);
|
||||
|
||||
// methods for sending various messages to client.
|
||||
bool IsHidden(void) const;
|
||||
void Minimize(bool status);
|
||||
void Zoom(void);
|
||||
void WorkspaceActivated(int32 workspace, bool active);
|
||||
void WorkspacesChanged(int32 oldone,int32 newone);
|
||||
void WindowActivated(bool active);
|
||||
void ScreenModeChanged(const BRect frame, const color_space cspace);
|
||||
status_t Lock(void);
|
||||
void Unlock(void);
|
||||
bool IsLocked(void) const;
|
||||
|
||||
// methods for sending various messages to client.
|
||||
void Quit(void);
|
||||
void Minimize(bool status);
|
||||
void Zoom(void);
|
||||
void ScreenModeChanged(const BRect frame, const color_space cspace);
|
||||
|
||||
status_t Lock(void);
|
||||
void Unlock(void);
|
||||
bool IsLocked(void) const;
|
||||
// util methods.
|
||||
void SendMessageToClient(const BMessage* msg,
|
||||
int32 target = B_NULL_TOKEN,
|
||||
bool usePreferred = false) const;
|
||||
|
||||
// to who we belong. who do we own. our title.
|
||||
inline ServerApp* App(void) const { return fServerApp; }
|
||||
inline const WinBorder* GetWinBorder(void) const { return fWinBorder; }
|
||||
inline const char* Title(void) const { return fName; }
|
||||
|
||||
// related thread/team_id(s).
|
||||
inline team_id ClientTeamID(void) const { return fClientTeamID; }
|
||||
inline thread_id ThreadID(void) const { return fMonitorThreadID;}
|
||||
|
||||
// server "private" - try not to use.
|
||||
inline int32 ClientToken(void) const { return fHandlerToken; }
|
||||
|
||||
//! Returns the index of the workspaces to which it belongs
|
||||
int32 GetWorkspaceIndex(void) { return fWorkspaces; }
|
||||
|
||||
// util methods.
|
||||
Layer *FindLayer(const Layer *start, int32 token) const;
|
||||
void SendMessageToClient(const BMessage* msg,
|
||||
int32 target = B_NULL_TOKEN,
|
||||
bool usePreferred = false) const;
|
||||
|
||||
// a few, not that important methods returning some internal settings.
|
||||
int32 Look(void) const { return fLook; }
|
||||
int32 Feel(void) const { return fFeel; }
|
||||
uint32 Flags(void) const { return fFlags; }
|
||||
uint32 Workspaces(void) const { return fWorkspaces; }
|
||||
|
||||
// to who we belong. who do we own. our title.
|
||||
ServerApp *App(void) const { return fServerApp; }
|
||||
const WinBorder *GetWinBorder(void) const { return fWinBorder; }
|
||||
const char *Title(void) const { return fTitle.String(); }
|
||||
|
||||
// related thread/team_id(s).
|
||||
team_id ClientTeamID(void) const { return fClientTeamID; }
|
||||
thread_id ThreadID(void) const { return fMonitorThreadID;}
|
||||
|
||||
// server "private" - try not to use.
|
||||
void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
|
||||
void QuietlySetFeel(int32 feel) { fFeel = feel; }
|
||||
int32 ClientToken(void) const { return fHandlerToken; }
|
||||
|
||||
FMWList fWinFMWList;
|
||||
FMWList fWinFMWList;
|
||||
|
||||
private:
|
||||
// methods for retrieving and creating a tree strcture of Layers.
|
||||
Layer *CreateLayerTree(Layer *localRoot, LinkMsgReader &link);
|
||||
void SetLayerState(Layer *layer, LinkMsgReader &link);
|
||||
void SetLayerFontState(Layer *layer, LinkMsgReader &link);
|
||||
|
||||
// message handle methods.
|
||||
void DispatchMessage(int32 code, LinkMsgReader &link);
|
||||
void DispatchGraphicsMessage(int32 code, LinkMsgReader &link);
|
||||
static int32 MonitorWin(void *data);
|
||||
// methods for retrieving and creating a tree strcture of Layers.
|
||||
Layer* CreateLayerTree(Layer *localRoot, LinkMsgReader &link);
|
||||
void SetLayerState(Layer *layer, LinkMsgReader &link);
|
||||
void SetLayerFontState(Layer *layer, LinkMsgReader &link);
|
||||
|
||||
// message handle methods.
|
||||
void DispatchMessage(int32 code, LinkMsgReader &link);
|
||||
void DispatchGraphicsMessage(int32 code, LinkMsgReader &link);
|
||||
static int32 MonitorWin(void *data);
|
||||
|
||||
protected:
|
||||
friend class ServerApp;
|
||||
@ -141,32 +127,27 @@ protected:
|
||||
friend class Screen;
|
||||
friend class Layer;
|
||||
|
||||
BString fTitle;
|
||||
int32 fLook;
|
||||
int32 fFeel;
|
||||
int32 fFlags;
|
||||
uint32 fWorkspaces;
|
||||
char fName[50];
|
||||
|
||||
ServerApp *fServerApp;
|
||||
WinBorder *fWinBorder;
|
||||
ServerApp* fServerApp;
|
||||
WinBorder* fWinBorder;
|
||||
|
||||
team_id fClientTeamID;
|
||||
thread_id fMonitorThreadID;
|
||||
team_id fClientTeamID;
|
||||
thread_id fMonitorThreadID;
|
||||
|
||||
port_id fMessagePort;
|
||||
port_id fClientWinPort;
|
||||
port_id fClientLooperPort;
|
||||
port_id fMessagePort;
|
||||
port_id fClientWinPort;
|
||||
port_id fClientLooperPort;
|
||||
|
||||
BLocker fLocker;
|
||||
BRect fFrame;
|
||||
uint32 fToken;
|
||||
int32 fHandlerToken;
|
||||
|
||||
LinkMsgReader *fMsgReader;
|
||||
LinkMsgSender *fMsgSender;
|
||||
LinkMsgReader* fMsgReader;
|
||||
LinkMsgSender* fMsgSender;
|
||||
|
||||
// cl is short for currentLayer. We'll use it a lot, that's why it's short :-)
|
||||
Layer *cl;
|
||||
BLocker fLocker;
|
||||
|
||||
int32 fHandlerToken;
|
||||
|
||||
// cl is short for currentLayer. We'll use it a lot, that's why it's short :-)
|
||||
Layer* cl;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -77,9 +77,19 @@ TokenHandler border_token_handler;
|
||||
bool gMouseDown = false;
|
||||
|
||||
|
||||
WinBorder::WinBorder(const BRect &r, const char *name, const int32 look, const int32 feel,
|
||||
const int32 flags, ServerWindow *win, DisplayDriver *driver)
|
||||
: Layer(r, name, B_NULL_TOKEN, B_FOLLOW_NONE, flags, driver)
|
||||
WinBorder::WinBorder( const BRect &r,
|
||||
const char *name,
|
||||
const uint32 wlook,
|
||||
const uint32 wfeel,
|
||||
const uint32 wflags,
|
||||
const uint32 wwksindex,
|
||||
ServerWindow *win,
|
||||
DisplayDriver *driver)
|
||||
: Layer(r, name, B_NULL_TOKEN, B_FOLLOW_NONE, 0UL, driver),
|
||||
fLook(wlook),
|
||||
fFeel(wfeel),
|
||||
fWindowFlags(wflags),
|
||||
fWorkspaces(wwksindex)
|
||||
{
|
||||
// unlike BViews, windows start off as hidden
|
||||
fHidden = true;
|
||||
@ -100,11 +110,33 @@ cnt = 0; // for debugging
|
||||
fIsMinimizing = false;
|
||||
fIsZooming = false;
|
||||
|
||||
// floating and modal windows must appear in every workspace where
|
||||
// their main window is present. Thus their wksIndex will be set to
|
||||
// '0x0' and they will be made visible when needed.
|
||||
switch (fFeel)
|
||||
{
|
||||
case B_MODAL_APP_WINDOW_FEEL:
|
||||
case B_MODAL_SUBSET_WINDOW_FEEL:
|
||||
case B_FLOATING_APP_WINDOW_FEEL:
|
||||
case B_FLOATING_SUBSET_WINDOW_FEEL:
|
||||
fWorkspaces = 0x0UL;
|
||||
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:
|
||||
if (fWorkspaces == 0x0UL)
|
||||
;
|
||||
}
|
||||
|
||||
fLastMousePosition.Set(-1,-1);
|
||||
SetLevel();
|
||||
|
||||
if (feel!= B_NO_BORDER_WINDOW_LOOK)
|
||||
fDecorator = new_decorator(r, name, look, feel, flags, fDriver);
|
||||
if (fFeel != B_NO_BORDER_WINDOW_LOOK)
|
||||
fDecorator = new_decorator(r, name, fLook, fFeel, fWindowFlags, fDriver);
|
||||
|
||||
RebuildFullRegion();
|
||||
|
||||
@ -269,12 +301,6 @@ void WinBorder::MouseUp(click_type action)
|
||||
}
|
||||
}
|
||||
|
||||
void WinBorder::MouseWheel(PointerEvent& evt, BPoint& ptWhere)
|
||||
{
|
||||
// what should decorator do with mouse wheel message.
|
||||
// maybe decorator should have some hook functions for mouse messages.
|
||||
}
|
||||
|
||||
//! Sets the decorator focus to active or inactive colors
|
||||
void WinBorder::HighlightDecorator(const bool &active)
|
||||
{
|
||||
@ -378,7 +404,7 @@ void WinBorder::UpdateScreen(void)
|
||||
//--------------------- P R I V A T E -------------------
|
||||
void WinBorder::SetLevel()
|
||||
{
|
||||
switch(fServerWin->Feel())
|
||||
switch(fFeel)
|
||||
{
|
||||
case B_FLOATING_SUBSET_WINDOW_FEEL:
|
||||
case B_FLOATING_APP_WINDOW_FEEL:
|
||||
|
@ -68,69 +68,91 @@ class PointerEvent
|
||||
class WinBorder : public Layer
|
||||
{
|
||||
public:
|
||||
WinBorder(const BRect &r, const char *name, const int32 look,const int32 feel,
|
||||
const int32 flags, ServerWindow *win, DisplayDriver *driver);
|
||||
virtual ~WinBorder(void);
|
||||
WinBorder( const BRect &r,
|
||||
const char *name,
|
||||
const uint32 wlook,
|
||||
const uint32 wfeel,
|
||||
const uint32 wflags,
|
||||
const uint32 wwksindex,
|
||||
ServerWindow *win,
|
||||
DisplayDriver *driver);
|
||||
virtual ~WinBorder(void);
|
||||
|
||||
virtual void Draw(const BRect &r);
|
||||
virtual void Draw(const BRect &r);
|
||||
|
||||
virtual void MoveBy(float x, float y);
|
||||
virtual void ResizeBy(float x, float y);
|
||||
virtual void MoveBy(float x, float y);
|
||||
virtual void ResizeBy(float x, float y);
|
||||
|
||||
virtual void RebuildFullRegion(void);
|
||||
virtual void RebuildFullRegion(void);
|
||||
|
||||
void SetSizeLimits(float minwidth, float maxwidth, float minheight, float maxheight);
|
||||
void SetSizeLimits( float minwidth,
|
||||
float maxwidth,
|
||||
float minheight,
|
||||
float maxheight);
|
||||
|
||||
click_type TellWhat(PointerEvent& evt) const;
|
||||
void MouseDown(click_type action);
|
||||
void MouseMoved(click_type action);
|
||||
void MouseUp(click_type action);
|
||||
void MouseWheel(PointerEvent& evt, BPoint& ptWhere);
|
||||
click_type TellWhat(PointerEvent& evt) const;
|
||||
void MouseDown(click_type action);
|
||||
void MouseMoved(click_type action);
|
||||
void MouseUp(click_type action);
|
||||
|
||||
void UpdateColors(void);
|
||||
void UpdateDecorator(void);
|
||||
void UpdateFont(void);
|
||||
void UpdateScreen(void);
|
||||
void UpdateColors(void);
|
||||
void UpdateDecorator(void);
|
||||
void UpdateFont(void);
|
||||
void UpdateScreen(void);
|
||||
|
||||
virtual bool HasClient(void) { return false; }
|
||||
Decorator *GetDecorator(void) const { return fDecorator; }
|
||||
virtual bool HasClient(void) { return false; }
|
||||
inline Decorator* GetDecorator(void) const { return fDecorator; }
|
||||
|
||||
void HighlightDecorator(const bool &active);
|
||||
inline int32 Look(void) const { return fLook; }
|
||||
inline int32 Feel(void) const { return fFeel; }
|
||||
inline uint32 WindowFlags(void) const { return fWindowFlags; }
|
||||
inline uint32 Workspaces(void) const { return fWorkspaces; }
|
||||
|
||||
void HighlightDecorator(const bool &active);
|
||||
|
||||
bool HasPoint(const BPoint &pt) const;
|
||||
|
||||
FMWList fFMWList;
|
||||
bool HasPoint(const BPoint &pt) const;
|
||||
|
||||
inline void QuietlySetWorkspaces(uint32 wks) { fWorkspaces = wks; }
|
||||
|
||||
FMWList fFMWList;
|
||||
|
||||
private:
|
||||
void SetLevel();
|
||||
void SetLevel();
|
||||
|
||||
protected:
|
||||
friend class Layer;
|
||||
friend class ServerWindow;
|
||||
friend class RootLayer;
|
||||
|
||||
Decorator *fDecorator;
|
||||
Layer *fTopLayer;
|
||||
Decorator* fDecorator;
|
||||
Layer* fTopLayer;
|
||||
|
||||
BRegion zUpdateReg;
|
||||
BRegion yUpdateReg;
|
||||
BRegion fUpdateReg;
|
||||
BRegion zUpdateReg;
|
||||
BRegion yUpdateReg;
|
||||
BRegion fUpdateReg;
|
||||
|
||||
int32 fMouseButtons;
|
||||
int32 fKeyModifiers;
|
||||
BPoint fLastMousePosition;
|
||||
int32 fMouseButtons;
|
||||
int32 fKeyModifiers;
|
||||
BPoint fLastMousePosition;
|
||||
|
||||
bool fIsClosing;
|
||||
bool fIsMinimizing;
|
||||
bool fIsZooming;
|
||||
bool fIsClosing;
|
||||
bool fIsMinimizing;
|
||||
bool fIsZooming;
|
||||
|
||||
bool fInUpdate;
|
||||
bool fRequestSent;
|
||||
bool fInUpdate;
|
||||
bool fRequestSent;
|
||||
|
||||
float fMinWidth, fMaxWidth;
|
||||
float fMinHeight, fMaxHeight;
|
||||
int32 fLook;
|
||||
int32 fFeel;
|
||||
int32 fWindowFlags;
|
||||
uint32 fWorkspaces;
|
||||
|
||||
int cnt; // for debugging
|
||||
float fMinWidth,
|
||||
fMaxWidth;
|
||||
float fMinHeight,
|
||||
fMaxHeight;
|
||||
|
||||
int cnt; // for debugging
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -284,7 +284,7 @@ STRACE(("\nWks(%ld)::MoveToFront ~%s~ \n", fID, newFront?newFront->GetName():"NU
|
||||
// BUT it does not have focus.
|
||||
ListData *newFocusItem = HasItem(newFront);
|
||||
if (newFocusItem && fFocusItem != newFocusItem
|
||||
&& !(newFront->Window()->Flags() & B_AVOID_FOCUS))
|
||||
&& !(newFront->WindowFlags() & B_AVOID_FOCUS))
|
||||
{
|
||||
fFocusItem = newFocusItem;
|
||||
}
|
||||
@ -605,7 +605,7 @@ STRACE(("W(%ld)::HideWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
|
||||
|
||||
while(cursor)
|
||||
{
|
||||
if (!cursor->layerPtr->IsHidden() && !(cursor->layerPtr->Window()->Flags() & B_AVOID_FOCUS))
|
||||
if (!cursor->layerPtr->IsHidden() && !(cursor->layerPtr->WindowFlags() & B_AVOID_FOCUS))
|
||||
break;
|
||||
else
|
||||
cursor = cursor->upperItem;
|
||||
@ -906,7 +906,7 @@ STRACE(("W(%ld)::ShowWinBorder(%s) \n", fID, winBorder? winBorder->GetName(): "N
|
||||
fFocusItem = NULL;
|
||||
while(cursor)
|
||||
{
|
||||
if (!cursor->layerPtr->IsHidden() && !(cursor->layerPtr->Window()->Flags() & B_AVOID_FOCUS))
|
||||
if (!cursor->layerPtr->IsHidden() && !(cursor->layerPtr->WindowFlags() & B_AVOID_FOCUS))
|
||||
{
|
||||
if (cursor->layerPtr->Level() == B_FLOATING_APP || cursor->layerPtr->Level() == B_FLOATING_ALL)
|
||||
{
|
||||
@ -1025,23 +1025,23 @@ void Workspace::PrintToStream() const
|
||||
{
|
||||
WinBorder *wb = (WinBorder*)item->layerPtr;
|
||||
printf("\tName: %s\t%s", wb->GetName(), wb->IsHidden()?"Hidden\t": "Visible\t");
|
||||
if(wb->Window()->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_FLOATING_SUBSET_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_SUBSET_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_FLOATING_APP_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_FLOATING_APP_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_APP_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_FLOATING_ALL_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_FLOATING_ALL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_FLOATING_ALL_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_MODAL_SUBSET_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_SUBSET_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_MODAL_APP_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_MODAL_APP_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_APP_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_MODAL_ALL_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_MODAL_ALL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_MODAL_ALL_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
if(wb->Feel() == B_NORMAL_WINDOW_FEEL)
|
||||
printf("\t%s\n", "B_NORMAL_WINDOW_FEEL");
|
||||
if(wb->Window()->Feel() == B_SYSTEM_LAST)
|
||||
if(wb->Feel() == B_SYSTEM_LAST)
|
||||
printf("\t%s\n", "B_SYSTEM_LAST");
|
||||
if(wb->Window()->Feel() >= B_SYSTEM_FIRST)
|
||||
if(wb->Feel() >= B_SYSTEM_FIRST)
|
||||
printf("\t%s\n", "B_SYSTEM_FIRST");
|
||||
|
||||
}
|
||||
@ -1224,7 +1224,7 @@ bool Workspace::placeToBack(ListData *newLast)
|
||||
ListData *cursor = newLast->upperItem;
|
||||
while ( cursor
|
||||
&& ( cursor->layerPtr->IsHidden()
|
||||
|| cursor->layerPtr->Window()->Flags() & B_AVOID_FOCUS)
|
||||
|| cursor->layerPtr->WindowFlags() & B_AVOID_FOCUS)
|
||||
&& cursor->layerPtr->Level() == level)
|
||||
{
|
||||
cursor = cursor->upperItem;
|
||||
@ -1534,7 +1534,7 @@ ListData* Workspace::findNextFront() const
|
||||
if (!item->layerPtr->IsHidden()
|
||||
&& item->layerPtr->Level() != B_FLOATING_ALL
|
||||
&& item->layerPtr->Level() != B_FLOATING_APP
|
||||
&& !(item->layerPtr->Window()->Flags() & B_AVOID_FRONT))
|
||||
&& !(item->layerPtr->WindowFlags() & B_AVOID_FRONT))
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user