diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-04-11 17:05:01 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-04-11 17:05:01 +0000 |
commit | d6f8420f16b7b504c2064d6476cd180d9a719b7a (patch) | |
tree | 8ddffee8fbb9e8588f48035e20358c4b37d3a2ff /vcl/inc | |
parent | 6841308ade811d29f26ad60510ac90a73d0a766c (diff) |
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2007/02/09 16:11:03 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to vcl/inc/vcl and correspondent necessary changes
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/vcl/ptrstyle.hxx | 152 | ||||
-rw-r--r-- | vcl/inc/vcl/regband.hxx | 138 | ||||
-rw-r--r-- | vcl/inc/vcl/region.hxx | 163 | ||||
-rw-r--r-- | vcl/inc/vcl/salatype.hxx | 57 |
4 files changed, 510 insertions, 0 deletions
diff --git a/vcl/inc/vcl/ptrstyle.hxx b/vcl/inc/vcl/ptrstyle.hxx new file mode 100644 index 000000000000..d4ce3f5638e0 --- /dev/null +++ b/vcl/inc/vcl/ptrstyle.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ptrstyle.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 18:04:16 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _VCL_PTRSTYLE_HXX +#define _VCL_PTRSTYLE_HXX + +#ifndef _SV_SV_H +#include <vcl/sv.h> +#endif + +// ----------------- +// - Pointer-Types - +// ----------------- + +typedef USHORT PointerStyle; + +#define POINTER_ARROW ((PointerStyle)0) +#define POINTER_NULL ((PointerStyle)1) +#define POINTER_WAIT ((PointerStyle)2) +#define POINTER_TEXT ((PointerStyle)3) +#define POINTER_HELP ((PointerStyle)4) +#define POINTER_CROSS ((PointerStyle)5) +#define POINTER_MOVE ((PointerStyle)6) +#define POINTER_NSIZE ((PointerStyle)7) +#define POINTER_SSIZE ((PointerStyle)8) +#define POINTER_WSIZE ((PointerStyle)9) +#define POINTER_ESIZE ((PointerStyle)10) +#define POINTER_NWSIZE ((PointerStyle)11) +#define POINTER_NESIZE ((PointerStyle)12) +#define POINTER_SWSIZE ((PointerStyle)13) +#define POINTER_SESIZE ((PointerStyle)14) +#define POINTER_WINDOW_NSIZE ((PointerStyle)15) +#define POINTER_WINDOW_SSIZE ((PointerStyle)16) +#define POINTER_WINDOW_WSIZE ((PointerStyle)17) +#define POINTER_WINDOW_ESIZE ((PointerStyle)18) +#define POINTER_WINDOW_NWSIZE ((PointerStyle)19) +#define POINTER_WINDOW_NESIZE ((PointerStyle)20) +#define POINTER_WINDOW_SWSIZE ((PointerStyle)21) +#define POINTER_WINDOW_SESIZE ((PointerStyle)22) +#define POINTER_HSPLIT ((PointerStyle)23) +#define POINTER_VSPLIT ((PointerStyle)24) +#define POINTER_HSIZEBAR ((PointerStyle)25) +#define POINTER_VSIZEBAR ((PointerStyle)26) +#define POINTER_HAND ((PointerStyle)27) +#define POINTER_REFHAND ((PointerStyle)28) +#define POINTER_PEN ((PointerStyle)29) +#define POINTER_MAGNIFY ((PointerStyle)30) +#define POINTER_FILL ((PointerStyle)31) +#define POINTER_ROTATE ((PointerStyle)32) +#define POINTER_HSHEAR ((PointerStyle)33) +#define POINTER_VSHEAR ((PointerStyle)34) +#define POINTER_MIRROR ((PointerStyle)35) +#define POINTER_CROOK ((PointerStyle)36) +#define POINTER_CROP ((PointerStyle)37) +#define POINTER_MOVEPOINT ((PointerStyle)38) +#define POINTER_MOVEBEZIERWEIGHT ((PointerStyle)39) +#define POINTER_MOVEDATA ((PointerStyle)40) +#define POINTER_COPYDATA ((PointerStyle)41) +#define POINTER_LINKDATA ((PointerStyle)42) +#define POINTER_MOVEDATALINK ((PointerStyle)43) +#define POINTER_COPYDATALINK ((PointerStyle)44) +#define POINTER_MOVEFILE ((PointerStyle)45) +#define POINTER_COPYFILE ((PointerStyle)46) +#define POINTER_LINKFILE ((PointerStyle)47) +#define POINTER_MOVEFILELINK ((PointerStyle)48) +#define POINTER_COPYFILELINK ((PointerStyle)49) +#define POINTER_MOVEFILES ((PointerStyle)50) +#define POINTER_COPYFILES ((PointerStyle)51) +#define POINTER_NOTALLOWED ((PointerStyle)52) +#define POINTER_DRAW_LINE ((PointerStyle)53) +#define POINTER_DRAW_RECT ((PointerStyle)54) +#define POINTER_DRAW_POLYGON ((PointerStyle)55) +#define POINTER_DRAW_BEZIER ((PointerStyle)56) +#define POINTER_DRAW_ARC ((PointerStyle)57) +#define POINTER_DRAW_PIE ((PointerStyle)58) +#define POINTER_DRAW_CIRCLECUT ((PointerStyle)59) +#define POINTER_DRAW_ELLIPSE ((PointerStyle)60) +#define POINTER_DRAW_FREEHAND ((PointerStyle)61) +#define POINTER_DRAW_CONNECT ((PointerStyle)62) +#define POINTER_DRAW_TEXT ((PointerStyle)63) +#define POINTER_DRAW_CAPTION ((PointerStyle)64) +#define POINTER_CHART ((PointerStyle)65) +#define POINTER_DETECTIVE ((PointerStyle)66) +#define POINTER_PIVOT_COL ((PointerStyle)67) +#define POINTER_PIVOT_ROW ((PointerStyle)68) +#define POINTER_PIVOT_FIELD ((PointerStyle)69) +#define POINTER_CHAIN ((PointerStyle)70) +#define POINTER_CHAIN_NOTALLOWED ((PointerStyle)71) +#define POINTER_TIMEEVENT_MOVE ((PointerStyle)72) +#define POINTER_TIMEEVENT_SIZE ((PointerStyle)73) +#define POINTER_AUTOSCROLL_N ((PointerStyle)74) +#define POINTER_AUTOSCROLL_S ((PointerStyle)75) +#define POINTER_AUTOSCROLL_W ((PointerStyle)76) +#define POINTER_AUTOSCROLL_E ((PointerStyle)77) +#define POINTER_AUTOSCROLL_NW ((PointerStyle)78) +#define POINTER_AUTOSCROLL_NE ((PointerStyle)79) +#define POINTER_AUTOSCROLL_SW ((PointerStyle)80) +#define POINTER_AUTOSCROLL_SE ((PointerStyle)81) +#define POINTER_AUTOSCROLL_NS ((PointerStyle)82) +#define POINTER_AUTOSCROLL_WE ((PointerStyle)83) +#define POINTER_AUTOSCROLL_NSWE ((PointerStyle)84) +#define POINTER_AIRBRUSH ((PointerStyle)85) +#define POINTER_TEXT_VERTICAL ((PointerStyle)86) +#define POINTER_PIVOT_DELETE ((PointerStyle)87) + +// --> FME 2004-07-30 #i32329# Enhanced table selection +#define POINTER_TAB_SELECT_S ((PointerStyle)88) +#define POINTER_TAB_SELECT_E ((PointerStyle)89) +#define POINTER_TAB_SELECT_SE ((PointerStyle)90) +#define POINTER_TAB_SELECT_W ((PointerStyle)91) +#define POINTER_TAB_SELECT_SW ((PointerStyle)92) +// <-- + +// --> FME 2004-08-16 #i20119# Paintbrush tool +#define POINTER_PAINTBRUSH ((PointerStyle)93) +// <-- + +#define POINTER_COUNT 94 + +#endif // _VCL_PTRSTYLE_HXX diff --git a/vcl/inc/vcl/regband.hxx b/vcl/inc/vcl/regband.hxx new file mode 100644 index 000000000000..406862289b98 --- /dev/null +++ b/vcl/inc/vcl/regband.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: regband.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 18:04:26 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _SV_REGBAND_HXX +#define _SV_REGBAND_HXX + +#ifndef _SV_SV_H +#include <vcl/sv.h> +#endif +#ifndef _TL_POLY_HXX +#include <tools/poly.hxx> +#endif + +/* ======================================================================= + +class ImplRegionBand + +This class handles one y-band of the region. In this band may contain one +or more seprarations in x-direction. The y-Band do not contain any +separation after creation. + +The separations are modified with basic clipping functions like Union and +Intersection - the Class will process the clipping for the actual band. + +The actual separations may be checked by functions like IsInside or +IsOver. + +======================================================================= */ + +// ------------------------ +// - ImplRegionBand-Types - +// ------------------------ + +// element for the list with x-separations +struct ImplRegionBandSep +{ + ImplRegionBandSep* mpNextSep; + long mnXLeft; + long mnXRight; + BOOL mbRemoved; +}; + +enum LineType { LINE_ASCENDING, LINE_DESCENDING, LINE_HORIZONTAL }; + +// element for the list with x-separations +struct ImplRegionBandPoint +{ + ImplRegionBandPoint* mpNextBandPoint; + long mnX; + long mnLineId; + BOOL mbEndPoint; + LineType meLineType; +}; + +// ------------------ +// - ImplRegionBand - +// ------------------ + +class ImplRegionBand +{ +public: + ImplRegionBand* mpNextBand; // pointer to the next element of the list + ImplRegionBand* mpPrevBand; // pointer to the previous element of the list (only used temporaery) + ImplRegionBandSep* mpFirstSep; // root of the list with x-separations + ImplRegionBandPoint* mpFirstBandPoint; // root of the list with lines + long mnYTop; // actual boundary of the band + long mnYBottom; + BOOL mbTouched; + + // create y-band with boundaries + ImplRegionBand( long nYTop, long nYBottom ); + // copy y-band with with all data + ImplRegionBand( const ImplRegionBand & theSourceBand ); + ~ImplRegionBand(); + + long GetXLeftBoundary() const; + long GetXRightBoundary() const; + + // combine overlapping bands + BOOL OptimizeBand(); + + // generate separations from lines and process + // union with existing separations + void ProcessPoints(); + // insert point in the list for later processing + BOOL InsertPoint( long nX, long nLineID, + BOOL bEndPoint, LineType eLineType ); + + void Union( long nXLeft, long nXRight ); + void Intersect( long nXLeft, long nXRight ); + void Exclude( long nXLeft, long nXRight ); + void XOr( long nXLeft, long nXRight ); + + void MoveX( long nHorzMove ); + void ScaleX( double fHorzScale ); + + BOOL IsInside( long nX ); + BOOL IsInside( long nLeft, long nRight ); + BOOL IsOver( long nLeft, long nRight ); + + BOOL IsEmpty() const { return ((!mpFirstSep) && (!mpFirstBandPoint)); } + + BOOL operator==( const ImplRegionBand& rRegionBand ) const; +}; + +#endif // _SV_REGBAND_HXX diff --git a/vcl/inc/vcl/region.hxx b/vcl/inc/vcl/region.hxx new file mode 100644 index 000000000000..b7daac5394eb --- /dev/null +++ b/vcl/inc/vcl/region.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: region.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 18:04:49 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _SV_REGION_HXX +#define _SV_REGION_HXX + +#ifndef _GEN_HXX +#include <tools/gen.hxx> +#endif + +#ifndef _SV_SV_H +#include <vcl/sv.h> +#endif + +#ifndef _VCL_DLLAPI_H +#include <vcl/dllapi.h> +#endif + +class ImplRegion; +class ImplRegionBand; +class Polygon; +class PolyPolygon; +struct ImplRegionInfo; + +// -------------- +// - RegionType - +// -------------- + +enum RegionType { REGION_NULL, REGION_EMPTY, REGION_RECTANGLE, REGION_COMPLEX }; +enum RegionOverlapType { REGION_INSIDE, REGION_OVER, REGION_OUTSIDE }; + +typedef long RegionHandle; + +// ---------- +// - Region - +// ---------- + +class VCL_DLLPUBLIC Region +{ + friend class OutputDevice; + friend class Window; + friend class Bitmap; + +private: + ImplRegion* mpImplRegion; + + SAL_DLLPRIVATE void ImplCopyData(); + SAL_DLLPRIVATE void ImplCreateRectRegion( const Rectangle& rRect ); + SAL_DLLPRIVATE void ImplCreatePolyPolyRegion( const PolyPolygon& rPolyPoly ); + SAL_DLLPRIVATE void ImplPolyPolyRegionToBandRegionFunc(); + SAL_DLLPRIVATE inline void ImplPolyPolyRegionToBandRegion(); + SAL_DLLPRIVATE const ImplRegion* ImplGetImplRegion() const { return mpImplRegion; } + SAL_DLLPRIVATE ImplRegion* ImplGetImplRegion() { return mpImplRegion; } + SAL_DLLPRIVATE BOOL ImplGetFirstRect( ImplRegionInfo& rImplRegionInfo, + long& nX, long& nY, long& nWidth, long& nHeight ) const; + SAL_DLLPRIVATE BOOL ImplGetNextRect( ImplRegionInfo& rImplRegionInfo, + long& nX, long& nY, long& nWidth, long& nHeight ) const; + SAL_DLLPRIVATE void ImplBeginAddRect( ); + SAL_DLLPRIVATE BOOL ImplAddRect( const Rectangle& rRect ); + SAL_DLLPRIVATE void ImplEndAddRect( ); + +#ifdef DBG_UTIL + friend const char* ImplDbgTestRegion( const void* pObj ); +#endif + +public: + Region(); + Region( RegionType eType ); + Region( const Rectangle& rRect ); + Region( const Polygon& rPolygon ); + Region( const PolyPolygon& rPolyPoly ); + Region( const Region& rRegion ); + ~Region(); + + void Move( long nHorzMove, long nVertMove ); + void Scale( double fScaleX, double fScaleY ); + BOOL Union( const Rectangle& rRegion ); + BOOL Intersect( const Rectangle& rRegion ); + BOOL Exclude( const Rectangle& rRegion ); + BOOL XOr( const Rectangle& rRegion ); + BOOL Union( const Region& rRegion ); + BOOL Intersect( const Region& rRegion ); + BOOL Exclude( const Region& rRegion ); + BOOL XOr( const Region& rRegion ); + + RegionType GetType() const; + BOOL IsEmpty() const { return GetType() == REGION_EMPTY; }; + BOOL IsNull() const { return GetType() == REGION_NULL; }; + + void SetEmpty(); + void SetNull(); + + Rectangle GetBoundRect() const; + + BOOL HasPolyPolygon() const; + PolyPolygon GetPolyPolygon() const; + + ULONG GetRectCount() const; + RegionHandle BeginEnumRects(); + BOOL GetEnumRects( RegionHandle hRegionHandle, Rectangle& rRect ); + BOOL GetNextEnumRect( RegionHandle hRegionHandle, Rectangle& rRect ) + { return GetEnumRects( hRegionHandle, rRect ); } + void EndEnumRects( RegionHandle hRegionHandle ); + + BOOL IsInside( const Point& rPoint ) const; + BOOL IsInside( const Rectangle& rRect ) const; + BOOL IsOver( const Rectangle& rRect ) const; + + Region& operator=( const Region& rRegion ); + Region& operator=( const Rectangle& rRect ); + + BOOL operator==( const Region& rRegion ) const; + BOOL operator!=( const Region& rRegion ) const + { return !(Region::operator==( rRegion )); } + + friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Region& rRegion ); + friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Region& rRegion ); + + /* workaround: faster conversion for PolyPolygons + * if half of the Polygons contained in rPolyPoly are actually + * rectangles, then the returned Region will be constructed by + * XOr'ing the contained Polygons together; in the case of + * only Rectangles this can be up to eight times faster than + * Region( const PolyPolygon& ). + * Caution: this is only useful if the Region is known to be + * changed to rectangles; e.g. if being set as clip region + */ + static Region GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly ); +}; + +#endif // _SV_REGION_HXX diff --git a/vcl/inc/vcl/salatype.hxx b/vcl/inc/vcl/salatype.hxx new file mode 100644 index 000000000000..7b2e91cdc684 --- /dev/null +++ b/vcl/inc/vcl/salatype.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: salatype.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: vg $ $Date: 2007-04-11 18:05:01 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _SV_SALATYPE_HXX +#define _SV_SALATYPE_HXX + +#ifndef _SV_SV_H +#include <vcl/sv.h> +#endif + +// --------------------- +// - Application-Types - +// --------------------- + +// Derzeit doppelt und in apptypes.hxx auch vorhanden + +#define INPUT_MOUSE 0x0001 +#define INPUT_KEYBOARD 0x0002 +#define INPUT_PAINT 0x0004 +#define INPUT_TIMER 0x0008 +#define INPUT_OTHER 0x0010 +#define INPUT_MOUSEANDKEYBOARD (INPUT_MOUSE | INPUT_KEYBOARD) +#define INPUT_ANY (INPUT_MOUSEANDKEYBOARD | INPUT_PAINT | INPUT_TIMER | INPUT_OTHER) + +#endif // _SV_SALATYPE_HXX |