2005-06-17 23:10:15 +04:00
|
|
|
/*
|
2006-02-09 21:28:29 +03:00
|
|
|
* Copyright (c) 2001-2006, Haiku, Inc.
|
2005-06-17 23:10:15 +04:00
|
|
|
* Distributed under the terms of the MIT license.
|
|
|
|
*
|
|
|
|
* Author: DarkWyrm <bpmagic@columbus.rr.com>
|
2005-11-07 22:01:12 +03:00
|
|
|
* Adi Oanca <adioanca@gmail.com>
|
2005-06-17 23:10:15 +04:00
|
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
2005-12-02 18:06:14 +03:00
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
2005-06-17 23:10:15 +04:00
|
|
|
*/
|
2005-11-24 20:45:26 +03:00
|
|
|
#ifndef WINDOW_LAYER_H
|
|
|
|
#define WINDOW_LAYER_H
|
2003-02-14 04:53:53 +03:00
|
|
|
|
2005-11-24 20:45:26 +03:00
|
|
|
|
|
|
|
#include "Decorator.h"
|
2005-12-08 15:41:19 +03:00
|
|
|
#include "ViewLayer.h"
|
2006-04-07 23:14:25 +04:00
|
|
|
#include "RegionPool.h"
|
2005-12-08 15:41:19 +03:00
|
|
|
#include "ServerWindow.h"
|
|
|
|
#include "WindowList.h"
|
2005-11-24 20:45:26 +03:00
|
|
|
|
2005-12-02 18:06:14 +03:00
|
|
|
#include <ObjectList.h>
|
2005-12-08 15:41:19 +03:00
|
|
|
#include <Region.h>
|
2005-11-24 20:45:26 +03:00
|
|
|
#include <String.h>
|
|
|
|
|
2006-02-06 13:28:30 +03:00
|
|
|
namespace BPrivate {
|
|
|
|
class PortLink;
|
|
|
|
};
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
class ClientLooper;
|
2003-02-14 04:53:53 +03:00
|
|
|
class Decorator;
|
2004-06-21 00:02:32 +04:00
|
|
|
class Desktop;
|
2005-12-08 15:41:19 +03:00
|
|
|
class DrawingEngine;
|
|
|
|
class EventDispatcher;
|
|
|
|
class WindowLayer;
|
|
|
|
|
|
|
|
// TODO: move this into a proper place
|
|
|
|
#define AS_REDRAW 'rdrw'
|
|
|
|
|
2006-04-19 18:12:57 +04:00
|
|
|
enum {
|
|
|
|
UPDATE_REQUEST = 0x01,
|
|
|
|
UPDATE_EXPOSE = 0x02,
|
|
|
|
};
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
class WindowLayer {
|
2005-06-03 23:50:30 +04:00
|
|
|
public:
|
2005-12-08 15:41:19 +03:00
|
|
|
WindowLayer(const BRect& frame,
|
|
|
|
const char *name, window_look look,
|
|
|
|
window_feel feel, uint32 flags,
|
|
|
|
uint32 workspaces,
|
|
|
|
::ServerWindow* window,
|
|
|
|
DrawingEngine* drawingEngine);
|
2005-11-24 20:45:26 +03:00
|
|
|
virtual ~WindowLayer();
|
2005-12-01 15:07:28 +03:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
BRect Frame() const { return fFrame; }
|
|
|
|
const char* Title() const { return fTitle.String(); }
|
|
|
|
|
|
|
|
window_anchor& Anchor(int32 index);
|
2006-04-13 17:56:01 +04:00
|
|
|
WindowLayer* NextWindow(int32 index) const;
|
|
|
|
WindowLayer* PreviousWindow(int32 index) const;
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
::Desktop* Desktop() const { return fDesktop; }
|
|
|
|
::Decorator* Decorator() const { return fDecorator; }
|
|
|
|
::ServerWindow* ServerWindow() const { return fWindow; }
|
|
|
|
::EventTarget& EventTarget() const { return fWindow->EventTarget(); }
|
|
|
|
|
|
|
|
// setting and getting the "hard" clipping, you need to have
|
|
|
|
// WriteLock()ed the clipping!
|
|
|
|
void SetClipping(BRegion* stillAvailableOnScreen);
|
|
|
|
// you need to have ReadLock()ed the clipping!
|
|
|
|
inline BRegion& VisibleRegion() { return fVisibleRegion; }
|
|
|
|
BRegion& VisibleContentRegion();
|
|
|
|
|
|
|
|
// TODO: not protected by a lock, but noone should need this anyways
|
|
|
|
// make private? when used inside WindowLayer, it has the ReadLock()
|
|
|
|
void GetFullRegion(BRegion* region);
|
|
|
|
void GetBorderRegion(BRegion* region);
|
|
|
|
void GetContentRegion(BRegion* region);
|
|
|
|
|
|
|
|
void MoveBy(int32 x, int32 y);
|
|
|
|
void ResizeBy(int32 x, int32 y, BRegion* dirtyRegion);
|
|
|
|
|
|
|
|
void ScrollViewBy(ViewLayer* view, int32 dx, int32 dy);
|
|
|
|
|
|
|
|
void SetTopLayer(ViewLayer* topLayer);
|
2005-12-09 19:20:01 +03:00
|
|
|
ViewLayer* TopLayer() const { return fTopLayer; }
|
|
|
|
// TODO: only used for WorkspacesLayer, can go away if we do
|
|
|
|
// this differently one day
|
2005-12-08 15:41:19 +03:00
|
|
|
ViewLayer* ViewAt(const BPoint& where);
|
2005-12-01 15:07:28 +03:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
virtual bool IsOffscreenWindow() const { return false; }
|
offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 20:17:16 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void GetEffectiveDrawingRegion(ViewLayer* layer, BRegion& region);
|
|
|
|
bool DrawingRegionChanged(ViewLayer* layer) const;
|
offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 20:17:16 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// generic version, used by the Desktop
|
|
|
|
void ProcessDirtyRegion(BRegion& regionOnScreen);
|
|
|
|
void RedrawDirtyRegion();
|
offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 20:17:16 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// can be used from inside classes that don't
|
|
|
|
// need to know about Desktop (first version uses Desktop)
|
|
|
|
void MarkDirty(BRegion& regionOnScreen);
|
2006-05-19 13:53:01 +04:00
|
|
|
// these versions do not use the Desktop
|
2005-12-08 15:41:19 +03:00
|
|
|
void MarkContentDirty(BRegion& regionOnScreen);
|
2006-05-19 13:53:01 +04:00
|
|
|
void MarkContentDirtyAsync(BRegion& regionOnScreen);
|
2005-12-08 15:41:19 +03:00
|
|
|
// shortcut for invalidating just one view
|
|
|
|
void InvalidateView(ViewLayer* view, BRegion& layerRegion);
|
2005-11-07 22:01:12 +03:00
|
|
|
|
2005-11-08 00:24:53 +03:00
|
|
|
void EnableUpdateRequests();
|
2005-12-08 15:41:19 +03:00
|
|
|
void DisableUpdateRequests();
|
2005-06-25 17:09:19 +04:00
|
|
|
|
2006-02-06 13:28:30 +03:00
|
|
|
void BeginUpdate(BPrivate::PortLink& link);
|
2005-12-08 15:41:19 +03:00
|
|
|
void EndUpdate();
|
2005-12-21 01:35:36 +03:00
|
|
|
bool InUpdate() const
|
|
|
|
{ return fInUpdate; }
|
2004-03-28 18:58:19 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
bool NeedsUpdate() const
|
|
|
|
{ return fUpdateRequested; }
|
2004-08-08 00:30:58 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
DrawingEngine* GetDrawingEngine() const
|
|
|
|
{ return fDrawingEngine; }
|
2005-10-25 22:42:10 +04:00
|
|
|
|
2006-04-07 23:14:25 +04:00
|
|
|
// managing a region pool
|
|
|
|
::RegionPool* RegionPool()
|
|
|
|
{ return &fRegionPool; }
|
|
|
|
inline BRegion* GetRegion()
|
|
|
|
{ return fRegionPool.GetRegion(); }
|
|
|
|
inline BRegion* GetRegion(const BRegion& copy)
|
|
|
|
{ return fRegionPool.GetRegion(copy); }
|
|
|
|
inline void RecycleRegion(BRegion* region)
|
|
|
|
{ fRegionPool.Recycle(region); }
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void CopyContents(BRegion* region,
|
|
|
|
int32 xOffset, int32 yOffset);
|
2005-10-25 22:42:10 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void MouseDown(BMessage* message, BPoint where, int32* _viewToken);
|
|
|
|
void MouseUp(BMessage* message, BPoint where, int32* _viewToken);
|
2006-01-11 15:25:06 +03:00
|
|
|
void MouseMoved(BMessage* message, BPoint where, int32* _viewToken,
|
|
|
|
bool isLatestMouseMoved);
|
2005-10-11 22:11:25 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// some hooks to inform the client window
|
|
|
|
// TODO: move this to ServerWindow maybe?
|
|
|
|
void WorkspaceActivated(int32 index, bool active);
|
|
|
|
void WorkspacesChanged(uint32 oldWorkspaces, uint32 newWorkspaces);
|
|
|
|
void Activated(bool active);
|
2005-06-16 16:32:42 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// changing some properties
|
2005-12-09 01:15:12 +03:00
|
|
|
void SetTitle(const char* name, BRegion& dirty);
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
void SetFocus(bool focus);
|
Have I said input event handling is done?
* didn't realize that mouse events always go to the view under the mouse, not
only if its the focus window (FFM can really do harm, after all :-)).
* removed a TODO from the list: EventDispatcher::Target is now a public
class EventTarget, and every ServerWindow has one.
* as a result, EventDispatcher no longer manages targets itself, it
just maintains a list of them. You no longer set messengers, you
only set targets.
* customization of the message filters, they no longer inherit from
BMessageFilter (but EventFilter).
* a message target is no longer set explicetly anywhere, it's only
changed in the message filters if needed.
* therefore, no more locking mess in the EventDispatcher needed.
* this also made the EventDispatcher::fLastFocus stuff superfluous.
* moved the RootLayer::MouseEventHandler() into the message filter.
* Replaced RootLayer::_ChildAt() with WindowAt().
* WindowLayer now has an idea if it has focus or not, it no longer needs
to query the RootLayer for this - maybe we should rename "focus" to
"active", though (as far as layers are concerned).
* the "_view_token" data is now added from the EventDispatcher, not
the (Window)Layer class anymore.
* removed Layer::MouseWheelChanged() as we currently don't need it
(if the need arises, we can add it back later again)
* there is still no mouse moved message sent when opening a window
under the cursor, though...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-29 19:01:41 +03:00
|
|
|
bool IsFocus() const { return fIsFocus; }
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void SetHidden(bool hidden);
|
|
|
|
inline bool IsHidden() const { return fHidden; }
|
2005-03-21 23:29:24 +03:00
|
|
|
|
2006-02-09 21:28:29 +03:00
|
|
|
void SetMinimized(bool minimized);
|
|
|
|
inline bool IsMinimized() const { return fMinimized; }
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void SetCurrentWorkspace(int32 index)
|
|
|
|
{ fCurrentWorkspace = index; }
|
|
|
|
bool IsVisible() const;
|
|
|
|
|
2006-03-12 19:59:15 +03:00
|
|
|
bool IsDragging() const { return fIsDragging; }
|
|
|
|
bool IsResizing() const { return fIsResizing; }
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void SetSizeLimits(int32 minWidth, int32 maxWidth,
|
|
|
|
int32 minHeight, int32 maxHeight);
|
|
|
|
|
|
|
|
void GetSizeLimits(int32* minWidth, int32* maxWidth,
|
|
|
|
int32* minHeight, int32* maxHeight) const;
|
|
|
|
|
|
|
|
// 0.0 -> left .... 1.0 -> right
|
2006-05-24 04:42:34 +04:00
|
|
|
bool SetTabLocation(float location, BRegion& dirty);
|
2005-12-08 15:41:19 +03:00
|
|
|
float TabLocation() const;
|
|
|
|
|
2006-05-25 16:01:28 +04:00
|
|
|
bool SetDecoratorSettings(const BMessage& settings,
|
|
|
|
BRegion& dirty);
|
|
|
|
bool GetDecoratorSettings(BMessage* settings);
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
void HighlightDecorator(bool active);
|
2005-11-30 18:47:01 +03:00
|
|
|
|
2005-12-01 16:59:04 +03:00
|
|
|
void SetLook(window_look look, BRegion* updateRegion);
|
|
|
|
void SetFeel(window_feel feel);
|
2005-12-08 15:41:19 +03:00
|
|
|
void SetFlags(uint32 flags, BRegion* updateRegion);
|
|
|
|
|
|
|
|
window_look Look() const { return fLook; }
|
|
|
|
window_feel Feel() const { return fFeel; }
|
|
|
|
uint32 Flags() const { return fFlags; }
|
2005-12-01 16:59:04 +03:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// window manager stuff
|
2005-11-30 18:47:01 +03:00
|
|
|
uint32 Workspaces() const { return fWorkspaces; }
|
2005-11-29 02:36:59 +03:00
|
|
|
void SetWorkspaces(uint32 workspaces)
|
|
|
|
{ fWorkspaces = workspaces; }
|
2005-12-09 16:17:43 +03:00
|
|
|
bool InWorkspace(int32 index) const;
|
2005-11-29 02:36:59 +03:00
|
|
|
|
|
|
|
bool SupportsFront();
|
2005-04-16 17:30:49 +04:00
|
|
|
|
2005-12-02 13:35:01 +03:00
|
|
|
bool IsModal() const;
|
|
|
|
bool IsFloating() const;
|
2005-12-08 15:41:19 +03:00
|
|
|
bool IsNormal() const;
|
2005-02-28 23:23:51 +03:00
|
|
|
|
2006-04-13 17:56:01 +04:00
|
|
|
bool HasModal() const;
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
WindowLayer* Frontmost(WindowLayer* first = NULL, int32 workspace = -1);
|
|
|
|
WindowLayer* Backmost(WindowLayer* first = NULL, int32 workspace = -1);
|
2005-12-02 18:06:14 +03:00
|
|
|
|
|
|
|
bool AddToSubset(WindowLayer* window);
|
|
|
|
void RemoveFromSubset(WindowLayer* window);
|
2006-04-13 17:56:01 +04:00
|
|
|
bool HasInSubset(const WindowLayer* window) const;
|
2005-12-08 15:41:19 +03:00
|
|
|
bool SameSubset(WindowLayer* window);
|
2005-12-09 16:17:43 +03:00
|
|
|
uint32 SubsetWorkspaces() const;
|
offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 20:17:16 +04:00
|
|
|
|
2005-12-01 18:58:04 +03:00
|
|
|
static bool IsValidLook(window_look look);
|
|
|
|
static bool IsValidFeel(window_feel feel);
|
2005-12-02 13:35:01 +03:00
|
|
|
static bool IsModalFeel(window_feel feel);
|
|
|
|
static bool IsFloatingFeel(window_feel feel);
|
|
|
|
|
2005-12-01 18:58:04 +03:00
|
|
|
static uint32 ValidWindowFlags();
|
2005-12-02 13:35:01 +03:00
|
|
|
static uint32 ValidWindowFlags(window_feel feel);
|
2005-12-01 18:58:04 +03:00
|
|
|
|
2005-12-01 15:07:28 +03:00
|
|
|
protected:
|
2005-12-08 15:41:19 +03:00
|
|
|
friend class Desktop;
|
|
|
|
// TODO: for now (list management)
|
|
|
|
|
|
|
|
void _ShiftPartOfRegion(BRegion* region, BRegion* regionToShift,
|
|
|
|
int32 xOffset, int32 yOffset);
|
|
|
|
|
|
|
|
// different types of drawing
|
2005-12-20 00:16:23 +03:00
|
|
|
void _TriggerContentRedraw(BRegion& dirty);
|
2005-12-08 15:41:19 +03:00
|
|
|
void _DrawBorder();
|
|
|
|
|
|
|
|
// handling update sessions
|
2005-12-10 11:05:25 +03:00
|
|
|
void _TransferToUpdateSession(BRegion* contentDirtyRegion);
|
2005-12-08 15:41:19 +03:00
|
|
|
void _SendUpdateMessage();
|
|
|
|
|
|
|
|
void _UpdateContentRegion();
|
|
|
|
|
|
|
|
click_type _ActionFor(const BMessage* msg) const;
|
|
|
|
|
|
|
|
void _ObeySizeLimits();
|
2005-12-09 17:06:30 +03:00
|
|
|
void _PropagatePosition();
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
BString fTitle;
|
|
|
|
// TODO: no fp rects anywhere
|
|
|
|
BRect fFrame;
|
|
|
|
|
2005-12-09 17:06:30 +03:00
|
|
|
window_anchor fAnchor[kListCount];
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
// the visible region is only recalculated from the
|
|
|
|
// Desktop thread, when using it, Desktop::ReadLockClipping()
|
|
|
|
// has to be called
|
|
|
|
|
|
|
|
BRegion fVisibleRegion;
|
|
|
|
BRegion fVisibleContentRegion;
|
|
|
|
// our part of the "global" dirty region
|
|
|
|
// it is calculated from the desktop thread,
|
|
|
|
// but we can write to it when we read locked
|
|
|
|
// the clipping, since it is local and the desktop
|
|
|
|
// thread is blocked
|
|
|
|
BRegion fDirtyRegion;
|
2006-04-19 18:12:57 +04:00
|
|
|
uint32 fDirtyCause;
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
// caching local regions
|
|
|
|
BRegion fBorderRegion;
|
|
|
|
BRegion fContentRegion;
|
|
|
|
BRegion fEffectiveDrawingRegion;
|
2008-01-06 23:09:55 +03:00
|
|
|
|
|
|
|
bool fVisibleContentRegionValid : 1;
|
|
|
|
bool fBorderRegionValid : 1;
|
|
|
|
bool fContentRegionValid : 1;
|
|
|
|
bool fEffectiveDrawingRegionValid : 1;
|
Have I said input event handling is done?
* didn't realize that mouse events always go to the view under the mouse, not
only if its the focus window (FFM can really do harm, after all :-)).
* removed a TODO from the list: EventDispatcher::Target is now a public
class EventTarget, and every ServerWindow has one.
* as a result, EventDispatcher no longer manages targets itself, it
just maintains a list of them. You no longer set messengers, you
only set targets.
* customization of the message filters, they no longer inherit from
BMessageFilter (but EventFilter).
* a message target is no longer set explicetly anywhere, it's only
changed in the message filters if needed.
* therefore, no more locking mess in the EventDispatcher needed.
* this also made the EventDispatcher::fLastFocus stuff superfluous.
* moved the RootLayer::MouseEventHandler() into the message filter.
* Replaced RootLayer::_ChildAt() with WindowAt().
* WindowLayer now has an idea if it has focus or not, it no longer needs
to query the RootLayer for this - maybe we should rename "focus" to
"active", though (as far as layers are concerned).
* the "_view_token" data is now added from the EventDispatcher, not
the (Window)Layer class anymore.
* removed Layer::MouseWheelChanged() as we currently don't need it
(if the need arises, we can add it back later again)
* there is still no mouse moved message sent when opening a window
under the cursor, though...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-29 19:01:41 +03:00
|
|
|
|
2006-04-07 23:14:25 +04:00
|
|
|
::RegionPool fRegionPool;
|
|
|
|
|
2005-12-02 18:06:14 +03:00
|
|
|
BObjectList<WindowLayer> fSubsets;
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
// TODO: remove those some day (let the decorator handle that stuff)
|
2008-01-06 23:09:55 +03:00
|
|
|
bool fIsClosing : 1;
|
|
|
|
bool fIsMinimizing : 1;
|
|
|
|
bool fIsZooming : 1;
|
|
|
|
bool fIsResizing : 1;
|
|
|
|
bool fIsSlidingTab : 1;
|
|
|
|
bool fIsDragging : 1;
|
|
|
|
bool fActivateOnMouseUp : 1;
|
2005-10-30 14:33:31 +03:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
::Decorator* fDecorator;
|
|
|
|
ViewLayer* fTopLayer;
|
|
|
|
::ServerWindow* fWindow;
|
|
|
|
DrawingEngine* fDrawingEngine;
|
|
|
|
::Desktop* fDesktop;
|
2005-06-16 16:32:42 +04:00
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
BPoint fLastMousePosition;
|
2006-02-26 20:56:59 +03:00
|
|
|
bigtime_t fLastMoveTime;
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
// The synchronization, which client drawing commands
|
|
|
|
// belong to the redraw of which dirty region is handled
|
|
|
|
// through an UpdateSession. When the client has
|
|
|
|
// been informed that it should redraw stuff, then
|
|
|
|
// this is the current update session. All new
|
|
|
|
// redraw requests from the Desktop will go
|
|
|
|
// into the pending update session.
|
|
|
|
class UpdateSession {
|
|
|
|
public:
|
|
|
|
UpdateSession();
|
|
|
|
virtual ~UpdateSession();
|
|
|
|
|
|
|
|
void Include(BRegion* additionalDirty);
|
|
|
|
void Exclude(BRegion* dirtyInNextSession);
|
|
|
|
|
|
|
|
inline BRegion& DirtyRegion()
|
|
|
|
{ return fDirtyRegion; }
|
|
|
|
|
|
|
|
void MoveBy(int32 x, int32 y);
|
|
|
|
|
|
|
|
void SetUsed(bool used);
|
|
|
|
inline bool IsUsed() const
|
|
|
|
{ return fInUse; }
|
2006-04-19 18:12:57 +04:00
|
|
|
|
|
|
|
void AddCause(uint8 cause);
|
|
|
|
inline bool IsExpose() const
|
|
|
|
{ return fCause & UPDATE_EXPOSE; }
|
|
|
|
inline bool IsRequest() const
|
|
|
|
{ return fCause & UPDATE_REQUEST; }
|
2005-12-08 15:41:19 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
BRegion fDirtyRegion;
|
|
|
|
bool fInUse;
|
2006-04-19 18:12:57 +04:00
|
|
|
uint8 fCause;
|
2005-12-08 15:41:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
BRegion fDecoratorRegion;
|
|
|
|
|
2008-01-06 23:20:37 +03:00
|
|
|
UpdateSession fUpdateSessions[2];
|
|
|
|
UpdateSession* fCurrentUpdateSession;
|
|
|
|
UpdateSession* fPendingUpdateSession;
|
2005-12-08 15:41:19 +03:00
|
|
|
// these two flags are supposed to ensure a sane
|
|
|
|
// and consistent update session
|
2007-08-17 16:56:20 +04:00
|
|
|
bool fUpdateRequested : 1;
|
|
|
|
bool fInUpdate : 1;
|
2005-12-08 15:41:19 +03:00
|
|
|
|
2007-08-17 16:56:20 +04:00
|
|
|
bool fHidden : 1;
|
|
|
|
bool fMinimized : 1;
|
|
|
|
bool fIsFocus : 1;
|
2005-04-06 00:03:07 +04:00
|
|
|
|
2005-12-01 15:07:28 +03:00
|
|
|
window_look fLook;
|
|
|
|
window_feel fFeel;
|
2005-12-09 17:06:30 +03:00
|
|
|
uint32 fOriginalFlags;
|
2005-12-08 15:41:19 +03:00
|
|
|
uint32 fFlags;
|
2005-04-16 17:30:49 +04:00
|
|
|
uint32 fWorkspaces;
|
2005-12-08 15:41:19 +03:00
|
|
|
int32 fCurrentWorkspace;
|
|
|
|
|
|
|
|
int32 fMinWidth;
|
|
|
|
int32 fMaxWidth;
|
|
|
|
int32 fMinHeight;
|
|
|
|
int32 fMaxHeight;
|
2003-02-14 04:53:53 +03:00
|
|
|
};
|
|
|
|
|
2005-12-08 15:41:19 +03:00
|
|
|
#endif // WINDOW_LAYER_H
|