moved more old stuff which isn't used anymore
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12439 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, Haiku, Inc.
|
||||
//
|
||||
// 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: CursorHandler.h
|
||||
// Author: DarkWyrm <[email protected]>
|
||||
// Description: class for handling cursor display for DisplayDriver
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef CURSORHANDLER_H
|
||||
#define CURSORHANDLER_H
|
||||
|
||||
#include "GraphicsBuffer.h"
|
||||
#include "LayerData.h"
|
||||
#include "ServerCursor.h"
|
||||
#include "ServerBitmap.h"
|
||||
|
||||
class DisplayDriver;
|
||||
|
||||
/*!
|
||||
\class CursorHandler CursorHandler.h
|
||||
\brief Object used by DisplayDriver to handle all the messiness of displaying the cursor
|
||||
*/
|
||||
class CursorHandler
|
||||
{
|
||||
public:
|
||||
CursorHandler(DisplayDriver *driver);
|
||||
~CursorHandler(void);
|
||||
|
||||
bool IntersectsCursor(const BRect &r);
|
||||
|
||||
void SetCursor(ServerCursor *cursor);
|
||||
ServerCursor *GetCursor(void) const { return fCursor; }
|
||||
|
||||
void MoveTo(BPoint pt);
|
||||
BPoint GetPosition(void) const { return fPosition.LeftTop(); }
|
||||
|
||||
void Hide(void);
|
||||
void Show(void);
|
||||
void Obscure(void);
|
||||
bool IsHidden(void) const { return (fHideLevel>0); }
|
||||
bool IsObscured(void) const { return fIsObscured; }
|
||||
|
||||
void DriverHide(void);
|
||||
void DriverShow(void);
|
||||
private:
|
||||
|
||||
DisplayDriver *fDriver;
|
||||
|
||||
BRect fOldPosition;
|
||||
BRect fPosition;
|
||||
BPoint fCursorPos;
|
||||
|
||||
UtilityBitmap *fSavedData;
|
||||
ServerCursor *fCursor;
|
||||
int8 fHideLevel;
|
||||
DrawData fDrawData;
|
||||
|
||||
bool fDriverHidden;
|
||||
bool fIsObscured;
|
||||
bool fValidSaveData;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -35,8 +35,6 @@
|
||||
#include <Font.h>
|
||||
#include <Locker.h>
|
||||
|
||||
#include "CursorHandler.h"
|
||||
|
||||
class BPoint;
|
||||
class BRect;
|
||||
class BRegion;
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, Haiku, Inc.
|
||||
//
|
||||
// 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: GraphicsBuffer.h
|
||||
// Author: DarkWyrm <[email protected]>
|
||||
//
|
||||
// Description: Convenience class for working with graphics buffers
|
||||
// Based on concepts from the Anti-Grain Geometry vector gfx library
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef GFX_BUFFER_H
|
||||
#define GFX_BUFFER_H
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class GraphicsBuffer
|
||||
{
|
||||
public:
|
||||
GraphicsBuffer(uint8 *buffer, uint32 width, uint32 height, uint32 rowbytes);
|
||||
GraphicsBuffer(const GraphicsBuffer &buffer);
|
||||
~GraphicsBuffer();
|
||||
|
||||
void SetTo(uint8 *buffer, uint32 width, uint32 height, uint32 rowbytes);
|
||||
void Unset(void);
|
||||
|
||||
uint8 *Bits(void) const { return fBuffer; }
|
||||
uint8 *RowAt(uint32 row) { return fRowList[row]; }
|
||||
|
||||
uint32 Width(void) const { return fWidth; }
|
||||
uint32 Height(void) const { return fHeight; }
|
||||
|
||||
uint32 BytesPerRow(void) const { return fBytesPerRow; }
|
||||
GraphicsBuffer &operator=(const GraphicsBuffer &buf);
|
||||
|
||||
private:
|
||||
|
||||
uint32 fWidth;
|
||||
uint32 fHeight;
|
||||
uint8 *fBuffer;
|
||||
uint8 **fRowList;
|
||||
uint32 fBytesPerRow;
|
||||
uint32 fMaxHeight;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,125 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, Haiku, Inc.
|
||||
//
|
||||
// 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: PixelRenderer.cpp
|
||||
// Author: DarkWyrm <[email protected]>
|
||||
//
|
||||
// Description: Base class for pixel plotting renderers
|
||||
// Based on concepts from the Anti-Grain Geometry vector gfx library
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef PIXEL_RENDERER
|
||||
#define PIXEL_RENDERER
|
||||
|
||||
#include "GraphicsBuffer.h"
|
||||
#include "GraphicsDefs.h"
|
||||
#include "RGBColor.h"
|
||||
|
||||
class IPoint;
|
||||
|
||||
class PixelRenderer
|
||||
{
|
||||
public:
|
||||
PixelRenderer(GraphicsBuffer &buffer);
|
||||
virtual ~PixelRenderer(void);
|
||||
|
||||
virtual color_space ColorSpace(void) { return B_NO_COLOR_SPACE; }
|
||||
|
||||
virtual RGBColor GetPixel(const IPoint &pt);
|
||||
virtual void PutPixel(const IPoint &pt, RGBColor &c);
|
||||
virtual void PutHLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
virtual void PutVLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
|
||||
virtual void SetBuffer(GraphicsBuffer &buffer) { fBuffer=&buffer; }
|
||||
GraphicsBuffer *GetBuffer(void) const { return fBuffer; }
|
||||
|
||||
private:
|
||||
GraphicsBuffer *fBuffer;
|
||||
};
|
||||
|
||||
class PixelRendererRGBA32 : public PixelRenderer
|
||||
{
|
||||
public:
|
||||
PixelRendererRGBA32(GraphicsBuffer &buffer);
|
||||
virtual ~PixelRendererRGBA32(void);
|
||||
|
||||
virtual color_space ColorSpace(void) { return B_RGBA32; }
|
||||
|
||||
virtual RGBColor GetPixel(const IPoint &pt);
|
||||
virtual void PutPixel(const IPoint &pt, RGBColor &c);
|
||||
virtual void PutHLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
virtual void PutVLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
};
|
||||
|
||||
class PixelRendererRGB16 : public PixelRenderer
|
||||
{
|
||||
public:
|
||||
PixelRendererRGB16(GraphicsBuffer &buffer);
|
||||
virtual ~PixelRendererRGB16(void);
|
||||
|
||||
virtual color_space ColorSpace(void) { return B_RGB16; }
|
||||
|
||||
virtual RGBColor GetPixel(const IPoint &pt);
|
||||
virtual void PutPixel(const IPoint &pt, RGBColor &c);
|
||||
virtual void PutHLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
virtual void PutVLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
};
|
||||
|
||||
class PixelRendererRGBA15 : public PixelRenderer
|
||||
{
|
||||
public:
|
||||
PixelRendererRGBA15(GraphicsBuffer &buffer);
|
||||
virtual ~PixelRendererRGBA15(void);
|
||||
|
||||
virtual color_space ColorSpace(void) { return B_RGBA15; }
|
||||
|
||||
virtual RGBColor GetPixel(const IPoint &pt);
|
||||
virtual void PutPixel(const IPoint &pt, RGBColor &c);
|
||||
virtual void PutHLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
virtual void PutVLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
};
|
||||
|
||||
class PixelRendererCMAP8 : public PixelRenderer
|
||||
{
|
||||
public:
|
||||
PixelRendererCMAP8(GraphicsBuffer &buffer);
|
||||
virtual ~PixelRendererCMAP8(void);
|
||||
|
||||
virtual color_space ColorSpace(void) { return B_CMAP8; }
|
||||
|
||||
virtual RGBColor GetPixel(const IPoint &pt);
|
||||
virtual void PutPixel(const IPoint &pt, RGBColor &c);
|
||||
virtual void PutHLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
virtual void PutVLine(const IPoint &pt, const uint32 length, RGBColor &c);
|
||||
};
|
||||
|
||||
// TODO: These inlines probably should go in ColorUtils
|
||||
inline uint16 MakeRGB16Color(uint8 r, uint8 g, uint8 b)
|
||||
{
|
||||
return (uint16)(((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3));
|
||||
}
|
||||
|
||||
// TODO: Doublecheck to make sure the shifting is correct in MakeRGBA15Color
|
||||
inline uint16 MakeRGBA15Color(uint8 r, uint8 g, uint8 b, bool visible=true)
|
||||
{
|
||||
return (uint16)(((r & 0xF8) << 7) | ((g & 0xF8) << 2) | (b >> 3));
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,38 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Copyright (c) 2001-2002, Haiku, Inc.
|
||||
//
|
||||
// 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: RectUtils.h
|
||||
// Author: DarkWyrm <[email protected]>
|
||||
// Description: Utilities for work around R5 Interface Kit bugs
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef RECTUTILS_H_
|
||||
#define RECTUTILS_H_
|
||||
|
||||
#include <Rect.h>
|
||||
#include <Region.h>
|
||||
|
||||
bool TestLineIntersection(const BRect&r, float x1, float y1, float x2, float y2,bool vertical=true);
|
||||
bool TestRectIntersection(const BRect &r,const BRect &r2);
|
||||
bool TestRegionIntersection(BRegion *r,const BRect &r2);
|
||||
void IntersectRegionWith(BRegion *r,const BRect &r2);
|
||||
void ValidateRect(BRect *r);
|
||||
#endif
|
||||
Reference in New Issue
Block a user