2004-08-03 19:17:44 +04:00
|
|
|
//------------------------------------------------------------------------------
|
2004-09-21 02:50:02 +04:00
|
|
|
// Copyright (c) 2001-2002, Haiku, Inc.
|
2004-08-03 19:17:44 +04:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
//
|
|
|
|
// File Name: Layer.h
|
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
2005-01-17 00:35:02 +03:00
|
|
|
// Adi Oanca <adioanca@cotty.iren.com>
|
2005-04-27 21:26:57 +04:00
|
|
|
// Stephan Aßmus <superstippi@gmx.de>
|
2004-08-03 19:17:44 +04:00
|
|
|
// Description: Class used for rendering to the frame buffer. One layer per
|
|
|
|
// view on screen and also for window decorators
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2003-01-24 18:19:27 +03:00
|
|
|
#ifndef _LAYER_H_
|
|
|
|
#define _LAYER_H_
|
|
|
|
|
|
|
|
#include <GraphicsDefs.h>
|
|
|
|
#include <List.h>
|
2003-02-07 20:30:17 +03:00
|
|
|
#include <Locker.h>
|
2005-04-27 21:26:57 +04:00
|
|
|
#include <OS.h>
|
|
|
|
#include <String.h>
|
|
|
|
#include <Rect.h>
|
|
|
|
#include <Region.h>
|
|
|
|
|
2004-02-24 15:02:47 +03:00
|
|
|
#include "RGBColor.h"
|
2005-04-27 21:26:57 +04:00
|
|
|
#include "ServerWindow.h"
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2005-06-28 19:34:54 +04:00
|
|
|
//#define NEW_CLIPPING 1
|
2005-06-16 00:36:43 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
enum {
|
2004-07-09 01:12:53 +04:00
|
|
|
B_LAYER_NONE = 1,
|
|
|
|
B_LAYER_MOVE = 2,
|
|
|
|
B_LAYER_SIMPLE_MOVE = 3,
|
|
|
|
B_LAYER_RESIZE = 4,
|
|
|
|
B_LAYER_MASK_RESIZE = 5,
|
2004-06-18 15:50:17 +04:00
|
|
|
};
|
2004-06-16 10:40:26 +04:00
|
|
|
|
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
|
|
|
enum {
|
|
|
|
B_LAYER_ACTION_NONE = 0,
|
|
|
|
B_LAYER_ACTION_MOVE,
|
|
|
|
B_LAYER_ACTION_RESIZE
|
|
|
|
};
|
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
enum {
|
2004-06-18 15:50:17 +04:00
|
|
|
B_LAYER_CHILDREN_DEPENDANT = 0x1000U,
|
2004-06-16 10:40:26 +04:00
|
|
|
};
|
|
|
|
|
2004-07-05 19:23:29 +04:00
|
|
|
// easy way to determine class type
|
2005-04-27 21:26:57 +04:00
|
|
|
enum {
|
2004-07-05 19:23:29 +04:00
|
|
|
AS_LAYER_CLASS = 1,
|
|
|
|
AS_WINBORDER_CLASS = 2,
|
|
|
|
AS_ROOTLAYER_CLASS = 3,
|
|
|
|
};
|
|
|
|
|
2005-02-28 23:23:51 +03:00
|
|
|
class ServerApp;
|
2003-02-12 14:24:26 +03:00
|
|
|
class RootLayer;
|
2003-11-14 03:15:29 +03:00
|
|
|
class DisplayDriver;
|
2004-02-24 15:02:47 +03:00
|
|
|
class LayerData;
|
2005-06-10 20:20:38 +04:00
|
|
|
class ServerBitmap;
|
2003-01-24 18:19:27 +03:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
class Layer {
|
|
|
|
public:
|
|
|
|
Layer(BRect frame, const char* name,
|
|
|
|
int32 token, uint32 resize,
|
|
|
|
uint32 flags, DisplayDriver* driver);
|
|
|
|
virtual ~Layer();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
void AddChild(Layer* child, ServerWindow* serverWin);
|
|
|
|
void RemoveChild(Layer* child);
|
|
|
|
void RemoveSelf();
|
|
|
|
bool HasChild(Layer* layer);
|
|
|
|
|
|
|
|
RootLayer* GetRootLayer() const
|
|
|
|
{ return fRootLayer; }
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
uint32 CountChildren() const;
|
|
|
|
Layer* FindLayer(const int32 token);
|
|
|
|
Layer* LayerAt(const BPoint &pt);
|
|
|
|
|
2005-06-15 23:01:43 +04:00
|
|
|
virtual Layer* TopChild() const;
|
|
|
|
virtual Layer* LowerSibling() const;
|
|
|
|
virtual Layer* UpperSibling() const;
|
|
|
|
virtual Layer* BottomChild() 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
|
|
|
|
|
|
|
virtual void SetName(const char* name);
|
|
|
|
inline const char* Name() const
|
2005-06-23 22:48:10 +04:00
|
|
|
{ return fName.String(); }
|
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-07-02 14:36:24 +04:00
|
|
|
inline uint32 ResizeMode() const
|
|
|
|
{ return fResizeMode; }
|
2005-06-23 22:48:10 +04:00
|
|
|
|
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
|
|
|
virtual void SetFlags(uint32 flags);
|
|
|
|
inline uint32 Flags() const
|
|
|
|
{ return fFlags; }
|
|
|
|
|
2005-06-16 22:58:14 +04:00
|
|
|
#ifndef NEW_CLIPPING
|
2005-04-27 21:26:57 +04:00
|
|
|
virtual void RebuildFullRegion();
|
|
|
|
void StartRebuildRegions(const BRegion& reg,
|
|
|
|
Layer* target,
|
|
|
|
uint32 action,
|
|
|
|
BPoint& pt);
|
|
|
|
|
|
|
|
void RebuildRegions(const BRegion& reg,
|
|
|
|
uint32 action,
|
|
|
|
BPoint pt,
|
|
|
|
BPoint ptOffset);
|
|
|
|
|
|
|
|
uint32 ResizeOthers(float x, float y,
|
|
|
|
BPoint coords[],
|
|
|
|
BPoint* ptOffset);
|
2005-06-28 16:25:32 +04:00
|
|
|
|
|
|
|
void EmptyGlobals();
|
|
|
|
|
2005-06-16 22:58:14 +04:00
|
|
|
#endif
|
2005-04-27 21:26:57 +04:00
|
|
|
void Redraw(const BRegion& reg,
|
|
|
|
Layer* startFrom = NULL);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
virtual void Draw(const BRect& r);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
void Show(bool invalidate = true);
|
|
|
|
void Hide(bool invalidate = true);
|
|
|
|
bool IsHidden() const;
|
2005-06-10 19:28:34 +04:00
|
|
|
|
|
|
|
// graphic state
|
|
|
|
void PushState();
|
|
|
|
void PopState();
|
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
// coordinate system
|
|
|
|
BRect Bounds() const;
|
|
|
|
BRect Frame() const;
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
virtual void MoveBy(float x, float y);
|
|
|
|
virtual void ResizeBy(float x, float y);
|
2005-06-28 16:25:32 +04:00
|
|
|
virtual void ScrollBy(float x, float y);
|
2005-04-27 21:26:57 +04:00
|
|
|
|
|
|
|
BPoint BoundsOrigin() const; // BoundsFrameDiff()?
|
2005-06-15 22:47:41 +04:00
|
|
|
float Scale() const;
|
2005-04-27 21:26:57 +04:00
|
|
|
|
|
|
|
BPoint ConvertToParent(BPoint pt);
|
|
|
|
BRect ConvertToParent(BRect rect);
|
|
|
|
BRegion ConvertToParent(BRegion* reg);
|
|
|
|
|
|
|
|
BPoint ConvertFromParent(BPoint pt);
|
|
|
|
BRect ConvertFromParent(BRect rect);
|
|
|
|
BRegion ConvertFromParent(BRegion* reg);
|
2004-09-14 04:51:51 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
BPoint ConvertToTop(BPoint pt);
|
|
|
|
BRect ConvertToTop(BRect rect);
|
|
|
|
BRegion ConvertToTop(BRegion* reg);
|
2004-09-14 04:51:51 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
BPoint ConvertFromTop(BPoint pt);
|
|
|
|
BRect ConvertFromTop(BRect rect);
|
|
|
|
BRegion ConvertFromTop(BRegion *reg);
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2004-06-16 10:40:26 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
DisplayDriver* GetDisplayDriver() const
|
|
|
|
{ return fDriver; }
|
|
|
|
|
|
|
|
ServerWindow* Window() const
|
|
|
|
{ return fServerWin; }
|
|
|
|
|
|
|
|
ServerApp* App() const
|
|
|
|
{ return fServerWin? fServerWin->App(): NULL; }
|
|
|
|
|
|
|
|
virtual bool HasClient()
|
|
|
|
{ return true; }
|
|
|
|
// bool IsServerLayer() const;
|
|
|
|
|
|
|
|
uint32 EventMask() const
|
|
|
|
{ return fEventMask; }
|
|
|
|
|
|
|
|
uint32 EventOptions() const
|
|
|
|
{ return fEventOptions; }
|
|
|
|
|
|
|
|
void PruneTree();
|
2004-06-11 22:21:57 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
// debugging
|
|
|
|
void PrintToStream();
|
|
|
|
void PrintNode();
|
|
|
|
void PrintTree();
|
2004-01-12 01:12:55 +03:00
|
|
|
|
2004-01-13 03:56:36 +03:00
|
|
|
// server "private" - should not be used
|
2005-04-27 21:26:57 +04:00
|
|
|
void SetRootLayer(RootLayer* rl)
|
|
|
|
{ fRootLayer = rl; }
|
|
|
|
|
|
|
|
void SetAsTopLayer(bool option)
|
|
|
|
{ fIsTopLayer = option; }
|
|
|
|
|
2005-07-02 14:36:24 +04:00
|
|
|
inline bool IsTopLayer() const
|
2005-04-27 21:26:57 +04:00
|
|
|
{ return fIsTopLayer; }
|
|
|
|
|
|
|
|
BRegion* ClippingRegion() const
|
|
|
|
{ return fClipReg; }
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2005-06-10 20:20:38 +04:00
|
|
|
// automatic background blanking by app_server
|
|
|
|
void SetViewColor(const RGBColor& color);
|
|
|
|
inline const RGBColor& ViewColor() const
|
|
|
|
{ return fViewColor; }
|
|
|
|
|
|
|
|
void SetBackgroundBitmap(const ServerBitmap* bitmap);
|
|
|
|
inline const ServerBitmap* BackgroundBitmap() const
|
|
|
|
{ return fBackgroundBitmap; }
|
|
|
|
|
|
|
|
// overlay support
|
|
|
|
// TODO: This can't be all, what about color key?
|
|
|
|
void SetOverlayBitmap(const ServerBitmap* bitmap);
|
|
|
|
inline const ServerBitmap* OverlayBitmap() const
|
|
|
|
{ return fOverlayBitmap; }
|
2005-06-28 19:34:54 +04:00
|
|
|
|
|
|
|
void CopyBits(BRect& src, BRect& dst,
|
|
|
|
int32 xOffset, int32 yOffset);
|
|
|
|
|
2005-06-15 23:01:43 +04:00
|
|
|
#ifdef NEW_CLIPPING
|
2005-06-22 00:11:44 +04:00
|
|
|
inline const BRegion& VisibleRegion() const { return fVisible2; }
|
|
|
|
inline const BRegion& FullVisible() const { return fFullVisible2; }
|
|
|
|
|
2005-06-28 18:57:16 +04:00
|
|
|
virtual void GetWantedRegion(BRegion& reg) const;
|
|
|
|
|
2005-07-02 14:36:24 +04:00
|
|
|
virtual void MovedByHook(float dx, float dy);
|
|
|
|
virtual void ResizedByHook(float dx, float dy, bool automatic);
|
|
|
|
virtual void ScrolledByHook(float dx, float dy);
|
2005-06-16 00:36:43 +04:00
|
|
|
|
2005-06-25 19:45:58 +04:00
|
|
|
void ConvertToParent2(BPoint* pt) const;
|
|
|
|
void ConvertToParent2(BRect* rect) const;
|
|
|
|
void ConvertToParent2(BRegion* reg) const;
|
|
|
|
void ConvertFromParent2(BPoint* pt) const;
|
|
|
|
void ConvertFromParent2(BRect* rect) const;
|
|
|
|
void ConvertFromParent2(BRegion* reg) const;
|
|
|
|
|
|
|
|
void ConvertToScreen2(BPoint* pt) const;
|
2005-06-15 23:01:43 +04:00
|
|
|
void ConvertToScreen2(BRect* rect) const;
|
|
|
|
void ConvertToScreen2(BRegion* reg) const;
|
2005-06-25 19:45:58 +04:00
|
|
|
void ConvertFromScreen2(BPoint* pt) const;
|
|
|
|
void ConvertFromScreen2(BRect* rect) const;
|
|
|
|
void ConvertFromScreen2(BRegion* reg) const;
|
2005-06-16 00:36:43 +04:00
|
|
|
bool IsVisuallyHidden() const;
|
|
|
|
private:
|
|
|
|
void do_Hide();
|
|
|
|
void do_Show();
|
|
|
|
void do_RebuildVisibleRegions(const BRegion &invalid,
|
|
|
|
const Layer *startFrom);
|
|
|
|
void do_MoveBy(float dx, float dy);
|
|
|
|
void do_ResizeBy(float dx, float dy);
|
|
|
|
void do_ScrollBy(float dx, float dy);
|
|
|
|
|
|
|
|
void do_Invalidate( const BRegion &invalid,
|
|
|
|
const Layer *startFrom = NULL);
|
|
|
|
|
2005-06-22 00:11:44 +04:00
|
|
|
void do_Redraw( const BRegion &invalid,
|
|
|
|
const Layer *startFrom = NULL);
|
|
|
|
|
2005-06-28 19:34:54 +04:00
|
|
|
void rebuild_visible_regions(const BRegion &invalid,
|
2005-06-16 00:36:43 +04:00
|
|
|
const BRegion &parentLocalVisible,
|
|
|
|
const Layer *startFrom);
|
|
|
|
|
2005-06-28 19:34:54 +04:00
|
|
|
virtual bool alter_visible_for_children(BRegion ®ion);
|
|
|
|
virtual void get_user_regions(BRegion ®);
|
2005-06-16 00:36:43 +04:00
|
|
|
|
2005-06-28 19:34:54 +04:00
|
|
|
void clear_visible_regions();
|
|
|
|
void resize_layer_frame_by(float x, float y);
|
|
|
|
void rezize_layer_redraw_more(BRegion ®, float dx, float dy);
|
|
|
|
void resize_layer_full_update_on_resize(BRegion ®, float dx, float dy);
|
2005-06-16 00:36:43 +04:00
|
|
|
|
2005-06-15 23:01:43 +04:00
|
|
|
#endif
|
2005-06-28 19:34:54 +04:00
|
|
|
private:
|
|
|
|
void do_CopyBits(BRect& src, BRect& dst,
|
|
|
|
int32 xOffset, int32 yOffset);
|
2005-06-10 20:20:38 +04:00
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
protected:
|
2003-06-23 06:54:52 +04:00
|
|
|
friend class RootLayer;
|
|
|
|
friend class WinBorder;
|
2003-09-09 01:18:39 +04:00
|
|
|
friend class ServerWindow;
|
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
|
|
|
// TODO: remove, is here for debugging purposes only
|
|
|
|
friend class OffscreenWinBorder;
|
2004-02-24 15:02:47 +03:00
|
|
|
|
2005-06-22 00:11:44 +04:00
|
|
|
#ifndef NEW_CLIPPING
|
2005-01-23 02:25:41 +03:00
|
|
|
void move_layer(float x, float y);
|
|
|
|
void resize_layer(float x, float y);
|
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
void FullInvalidate(const BRect& rect);
|
|
|
|
void FullInvalidate(const BRegion& region);
|
|
|
|
void Invalidate(const BRegion& region);
|
2005-06-22 00:11:44 +04:00
|
|
|
#endif
|
2005-04-27 21:26:57 +04:00
|
|
|
|
|
|
|
BRect fFrame;
|
2005-04-29 03:56:40 +04:00
|
|
|
// TODO: should be removed or reused in a similar fashion
|
|
|
|
// to hold the accumulated origins from the graphics state stack.
|
|
|
|
// The same needs to be done for "scale". (Keeping an accumulated
|
|
|
|
// value.)
|
2005-04-27 21:26:57 +04:00
|
|
|
// BPoint fBoundsLeftTop;
|
|
|
|
WinBorder* fOwner;
|
|
|
|
Layer* fParent;
|
|
|
|
Layer* fUpperSibling;
|
|
|
|
Layer* fLowerSibling;
|
|
|
|
Layer* fTopChild;
|
|
|
|
Layer* fBottomChild;
|
|
|
|
|
|
|
|
mutable Layer* fCurrent;
|
2005-06-17 00:43:53 +04:00
|
|
|
|
|
|
|
#ifndef NEW_CLIPPING
|
2005-04-27 21:26:57 +04:00
|
|
|
BRegion fVisible;
|
|
|
|
BRegion fFullVisible;
|
2005-06-22 00:11:44 +04:00
|
|
|
BRegion fFull;
|
|
|
|
int8 fFrameAction;
|
2005-06-17 00:43:53 +04:00
|
|
|
#else
|
|
|
|
private:
|
|
|
|
BRegion fVisible2;
|
|
|
|
BRegion fFullVisible2;
|
|
|
|
protected:
|
2005-06-16 23:44:55 +04:00
|
|
|
#endif
|
2005-04-27 21:26:57 +04:00
|
|
|
BRegion* fClipReg;
|
|
|
|
|
|
|
|
ServerWindow* fServerWin;
|
2005-06-23 22:48:10 +04:00
|
|
|
BString fName;
|
2005-04-27 21:26:57 +04:00
|
|
|
int32 fViewToken;
|
|
|
|
uint32 fFlags;
|
|
|
|
uint32 fResizeMode;
|
|
|
|
uint32 fEventMask;
|
|
|
|
uint32 fEventOptions;
|
|
|
|
bool fHidden;
|
|
|
|
bool fIsTopLayer;
|
|
|
|
uint16 fAdFlags;
|
|
|
|
int8 fClassID;
|
|
|
|
|
|
|
|
DisplayDriver* fDriver;
|
|
|
|
LayerData* fLayerData;
|
|
|
|
|
|
|
|
RootLayer* fRootLayer;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void RequestDraw(const BRegion& reg,
|
|
|
|
Layer* startFrom);
|
|
|
|
ServerWindow* SearchForServerWindow();
|
|
|
|
|
|
|
|
void SendUpdateMsg(BRegion& reg);
|
2005-05-16 19:39:58 +04:00
|
|
|
void AddToViewsWithInvalidCoords() const;
|
|
|
|
void SendViewCoordUpdateMsg() const;
|
2004-07-05 19:23:29 +04:00
|
|
|
|
2005-06-10 20:20:38 +04:00
|
|
|
RGBColor fViewColor;
|
|
|
|
|
|
|
|
const ServerBitmap* fBackgroundBitmap;
|
|
|
|
const ServerBitmap* fOverlayBitmap;
|
|
|
|
|
2003-01-24 18:19:27 +03:00
|
|
|
};
|
|
|
|
|
2005-04-27 21:26:57 +04:00
|
|
|
#endif // _LAYER_H_
|