home *** CD-ROM | disk | FTP | other *** search
- /*
- File: GraphicsRun.h
-
- Contains: xxx put contents here xxx
-
- Written by: Essam Zaky
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 1/4/94 EZ clean up
- <1> 1/4/94 EZ first checked in
-
- */
-
- #ifndef _GraphicsRun_
- #define _GraphicsRun_
-
- #ifndef _ToolBoxDump_
- #include "ToolBoxDump.h"
- #endif
-
- #ifndef _TextensionCommon_
- #include "TextensionCommon.h"
- #endif
-
- #ifndef _RunObject_
- #include "RunObject.h"
- #endif
-
- //***************************************************************************************************
-
-
- class CGraphicsRun : public CRunObject {
- public:
- //-------
- CGraphicsRun();
-
- inline void IGraphicsRun() {this->IRunObject();}
-
- //•override
- virtual CAttrObject* CreateNew() const = 0;
-
- virtual ClassId GetClassId() const = 0;
-
- Boolean IsTextRun() const;
-
- virtual TObjFlags GetObjFlags();
-
- //DoPixel2Char and DoChar2Pixel will never be called since kIndivisibleRun is returned, but they are pure virtual fns
- virtual void DoPixel2Char(Pixel2CharPb* paramPb);
- virtual short DoChar2Pixel(Char2PixelPb* paramPb);
-
- virtual Fixed DoMeasure(MeasurePb* paramPb);
- virtual StyledLineBreakCode DoBreak(LineBreakPb* paramPb);
- virtual void DoDrawJust(DrawJustPb* paramPb);
-
- virtual void SetHilite(char oldHilite, char newHilite, const RunPositionPB* paramPb, Boolean doDraw = true);
- //paramPb is defined <==> doDraw == true
-
- virtual void DrawSelection(char hiliteStat, const RunPositionPB* paramPb);
-
- virtual void SetCursor(Point, const RunPositionPB*) const; //set it to arrow
-
- protected:
- //----------
- //•override
- virtual void CalcHiteInfo(short* ascent, short* descent, short* leading);
-
- //•own
- virtual Boolean GetDimensions(short* hite, short* width) = 0;
- //returns the non scaled dimensions
-
- #ifdef txtnScal
- void GetScaledDimensions(short* hite, short* width
- , const Point* numer=nil, const Point* denom=nil);
- #else
- void GetScaledDimensions(short* hite, short* width);
- #endif
-
- virtual void Draw(const Rect* theRect) = 0;
-
- void GetObjectRect(const RunPositionPB* paramPb, Rect* objRect);
-
- private:
- //--------
- short fExtraWidth;
-
- #ifdef txtnScal
- void AdjustObjRect(Rect* objRect, Point numer, Point denom);
- #else
- void AdjustObjRect(Rect* objRect);
- #endif
- };
- //***************************************************************************************************
-
- #endif
-