Removed RootLayer::EnqueueMessage(). Added support for BWindow's EnableUpdates(), DisableUpdates(), NeedsUpdate() and SendBehind(). The last one does not work as expected, for the moment it sends the window to back, just as Activate(false) does.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2005-10-30 11:33:31 +00:00
parent 9783d238c2
commit ac89958f6e
6 changed files with 40 additions and 32 deletions
+1 -1
View File
@@ -1609,7 +1609,7 @@ if (fOwner->cnt != 1)
if (updateReg.CountRects() > 0) { if (updateReg.CountRects() > 0) {
fOwner->fCumulativeRegion.Include(&updateReg); fOwner->fCumulativeRegion.Include(&updateReg);
if (!fOwner->InUpdate() && !fOwner->fRequestSent) { if (fOwner->fUpdateRequestsEnabled && !fOwner->InUpdate() && !fOwner->fRequestSent) {
fOwner->fInUpdateRegion = fOwner->fCumulativeRegion; fOwner->fInUpdateRegion = fOwner->fCumulativeRegion;
fOwner->cnt++; fOwner->cnt++;
if (fOwner->cnt != 1) if (fOwner->cnt != 1)
-14
View File
@@ -309,15 +309,6 @@ RootLayer::GoInvalidate(Layer *layer, const BRegion &region)
Unlock(); Unlock();
} }
status_t
RootLayer::EnqueueMessage(BPrivate::PortLink &message)
{
message.SetSenderPort(fListenPort);
message.Flush();
return B_OK;
}
void void
RootLayer::GoRedraw(Layer *layer, const BRegion &region) RootLayer::GoRedraw(Layer *layer, const BRegion &region)
{ {
@@ -1137,11 +1128,6 @@ RootLayer::MouseEventHandler(BMessage *msg)
} }
case B_MOUSE_MOVED: { case B_MOUSE_MOVED: {
//printf("RootLayer::MouseEventHandler(B_MOUSE_MOVED)\n"); //printf("RootLayer::MouseEventHandler(B_MOUSE_MOVED)\n");
// Attached data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - buttons down
BPoint where(0,0); BPoint where(0,0);
-1
View File
@@ -130,7 +130,6 @@ public:
void Unlock() { fAllRegionsLock.Unlock(); } void Unlock() { fAllRegionsLock.Unlock(); }
bool IsLocked() { return fAllRegionsLock.IsLocked(); } bool IsLocked() { return fAllRegionsLock.IsLocked(); }
void RunThread(); void RunThread();
status_t EnqueueMessage(BPrivate::PortLink &message);
void GoInvalidate(Layer *layer, const BRegion &region); void GoInvalidate(Layer *layer, const BRegion &region);
void GoRedraw(Layer *layer, const BRegion &region); void GoRedraw(Layer *layer, const BRegion &region);
void GoChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel); void GoChangeWinBorderFeel(WinBorder *winBorder, int32 newFeel);
+29 -6
View File
@@ -1268,32 +1268,55 @@ myRootLayer->Unlock();
Hide(); Hide();
break; break;
} }
#if 0
case AS_SEND_BEHIND: case AS_SEND_BEHIND:
{ {
// TODO: Implement AS_SEND_BEHIND
STRACE(("ServerWindow %s: Message Send_Behind unimplemented\n", Title())); STRACE(("ServerWindow %s: Message Send_Behind unimplemented\n", Title()));
int32 token;
team_id teamID;
WinBorder *behindOf;
status_t status = B_NAME_NOT_FOUND;
link.Read<int32>(&token);
link.Read<team_id>(&teamID);
if ((behindOf = gDesktop->FindWinBorderByClientToken(token, teamID))) {
fWinBorder->GetRootLayer()->Lock();
// TODO: move to back ATM. Fix this later!
fWinBorder->GetRootLayer()->SetActive(fWinBorder, false);
fWinBorder->GetRootLayer()->Unlock();
status = B_OK;
}
fLink.StartMessage(status);
fLink.Flush();
break; break;
} }
case AS_ENABLE_UPDATES: case AS_ENABLE_UPDATES:
{ {
// TODO: Implement AS_ENABLE_UPDATES
STRACE(("ServerWindow %s: Message Enable_Updates unimplemented\n", Title())); STRACE(("ServerWindow %s: Message Enable_Updates unimplemented\n", Title()));
fWinBorder->EnableUpdateRequests();
if (fWinBorder->CulmulatedUpdateRegion().Frame().IsValid()) {
BRegion reg(fWinBorder->CulmulatedUpdateRegion());
fWinBorder->RequestDraw(reg, NULL);
}
break; break;
} }
case AS_DISABLE_UPDATES: case AS_DISABLE_UPDATES:
{ {
// TODO: Implement AS_DISABLE_UPDATES
STRACE(("ServerWindow %s: Message Disable_Updates unimplemented\n", Title())); STRACE(("ServerWindow %s: Message Disable_Updates unimplemented\n", Title()));
fWinBorder->DisableUpdateRequests();
break; break;
} }
case AS_NEEDS_UPDATE: case AS_NEEDS_UPDATE:
{ {
// TODO: Implement AS_NEEDS_UPDATE
STRACE(("ServerWindow %s: Message Needs_Update unimplemented\n", Title())); STRACE(("ServerWindow %s: Message Needs_Update unimplemented\n", Title()));
if (fWinBorder->CulmulatedUpdateRegion().Frame().IsValid())
fLink.StartMessage(B_OK);
else
fLink.StartMessage(B_ERROR);
fLink.Flush();
break; break;
} }
#endif
case AS_SET_WINDOW_TITLE: case AS_SET_WINDOW_TITLE:
{ {
char* newTitle; char* newTitle;
+2 -5
View File
@@ -79,14 +79,11 @@ WinBorder::WinBorder(const BRect &frame,
fIsClosing(false), fIsClosing(false),
fIsMinimizing(false), fIsMinimizing(false),
fIsZooming(false), fIsZooming(false),
fIsDragging(false),
fBringToFrontOnRelease(false),
fIsResizing(false), fIsResizing(false),
fIsSlidingTab(false), fIsSlidingTab(false),
fIsDragging(false),
fUpdateRequestsEnabled(true),
fInUpdate(false), fInUpdate(false),
fRequestSent(false), fRequestSent(false),
+8 -5
View File
@@ -70,6 +70,10 @@ class WinBorder : public Layer {
{ return fInUpdateRegion; } { return fInUpdateRegion; }
inline const BRegion& CulmulatedUpdateRegion() const inline const BRegion& CulmulatedUpdateRegion() const
{ return fCumulativeRegion; } { return fCumulativeRegion; }
inline void EnableUpdateRequests()
{ fUpdateRequestsEnabled = true; }
inline void DisableUpdateRequests()
{ fUpdateRequestsEnabled = false; }
void SetSizeLimits(float minWidth, void SetSizeLimits(float minWidth,
float maxWidth, float maxWidth,
@@ -157,14 +161,13 @@ class WinBorder : public Layer {
bool fIsClosing; bool fIsClosing;
bool fIsMinimizing; bool fIsMinimizing;
bool fIsZooming; bool fIsZooming;
bool fIsResizing;
bool fIsSlidingTab;
bool fIsDragging; bool fIsDragging;
bool fBringToFrontOnRelease; bool fBringToFrontOnRelease;
bool fIsResizing; bool fUpdateRequestsEnabled;
bool fIsSlidingTab;
bool fInUpdate; bool fInUpdate;
bool fRequestSent; bool fRequestSent;