home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-17 | 4.3 KB | 185 lines | [TEXT/R*ch] |
- // DRichStyle.h
- // d.g.gilbert
-
- #ifndef _DRICHSTYLE_
- #define _DRICHSTYLE_
-
- #include "Dvibrant.h"
- #include "DObject.h"
-
-
-
- struct PictLinkIndex {
- short fKind;
- short fLinkid; // gopher/html link id
- Nlm_RecT fLoc;
- };
-
-
- class DPictStyle : public DObject
- {
- public:
- // this is a quick fix to having DPictStyle & others subclassing DRichStyle
- // -- before the DRichStyle subclasses, must extensively revise DRS handling
- // so that statically allocated (fixed size) DRS classes are gone & a DRS::Clone
- // works -- this is tied to problem of bad DObject::objSize for static alloc
-
- enum kinds {
- kPictOther= 0,
- kPictMac,
- kPictWinMeta,
- kPictPMMeta,
- kPictDIBits,
- kPictWinBits,
- kPictGIF,
- kPictNetPic,
- kPictNetLink,
- kPictMapLink
- };
-
- short fKind;
- ulong fSize;
- char* fData;
- PictLinkIndex* fLinks;
- short fNumLinks;
-
- DPictStyle();
- DPictStyle( short kind, void* data, ulong dsize, Boolean owndata= false);
- virtual Boolean suicide(void); // prefered to delete
- virtual Boolean suicide(short ownercount);
- virtual ~DPictStyle();
- virtual void SetData( short kind, void* data, ulong dsize, Boolean owndata= false);
- virtual void AddLink( short kind, short linkid, Nlm_RecT loc);
- virtual short GetLink( Nlm_PoinT atp, short& kind);
- virtual short GetLink( short index, short& kind, Nlm_RecT& loc);
- virtual void Draw(Nlm_RecT area);
- virtual Boolean HasNetPict();
- virtual Boolean CanDraw();
- virtual Boolean IsNotEqual( DPictStyle* other);
- };
-
-
-
-
- class DRichStyle : public DObject
- {
- public:
- enum ulines {
- kNoUnderline= 0,
- kUnderline= 1,
- kDotuline=2,
- kDbluline=3,
- kWorduline=4
- };
-
- DPictStyle* fPict;
- short nextofs;
- short pixheight, pixwidth, pixleft;
- short linkid; // gopher/html link id
-
- Nlm_Uint4 color;
- Nlm_FonT font; // includes fnt,size,bld/ital/uline
- short superSub; //point offset +/-, +=superscript
- unsigned int underline : 3; // 0,1=uline,2=dotuline,3=dbluline,4=worduline
- unsigned int bold : 1;
- unsigned int italic : 1;
- unsigned int outline : 1;
- unsigned int shadow : 1;
- unsigned int strikeout : 1;
- unsigned int smallcaps : 1;
- unsigned int allcaps : 1;
- unsigned int boxed : 1;
- unsigned int hidden : 1;
-
- unsigned int ispict : 1;
- unsigned int ownpict : 1;
- unsigned int ismap : 1;
- unsigned int last : 1;
-
- DRichStyle();
- virtual ~DRichStyle();
- virtual Boolean suicide(void); // prefered to delete
- virtual Boolean suicide(short ownercount);
- virtual Boolean IsNotEqual(DRichStyle* other);
- //virtual DObject* Clone();
- //virtual DRichStyle& operator=( DRichStyle& ast);
- };
-
-
- struct StyleIndex {
- short styleid;
- short nextofs;
- };
-
-
- class DParagraph : public DObject
- {
- public:
- enum borders {
- kNoBorder = 0,
- kBorderSingle = 1,
- kBorderThick = 2,
- kBorderShadow = 3,
- kBorderDouble = 4,
- kBorderDot = 5,
- kBorderDash = 6,
- kBorderHair = 7
- };
-
- enum tabs {
- kTabLeft = 0,
- kTabCenter= 1,
- kTabRight= 2,
- kTabDecimal = 3,
- kTabBar = 4
- };
-
- char just, tablead;
- short deftabstop, numstops;
- short * tabstops;
- char * tabkinds;
- short firstInset,leftInset,rightInset;
- short spaceBefore,spaceAfter, spaceBetween;
- short minLines, minHeight;
- short startsAt, numRows;
- short lineHeight, leadHeight;
-
- char * fDataPtr;
- char * fText;
- StyleIndex* fStyleIndex;
- short fNumStyles;
-
- unsigned int borderstyle : 4;
- unsigned int bordertop : 1;
- unsigned int borderbottom : 1;
- unsigned int borderleft : 1;
- unsigned int borderright : 1;
- unsigned int borderbetween : 1;
- unsigned int borderbar : 1;
- unsigned int borderbox : 1;
- unsigned int openSpace : 1;
- unsigned int keepWithNext : 1;
- unsigned int keepTogether : 1;
- unsigned int newPage : 1;
- unsigned int wrap : 1;
- unsigned int fDocOwnsData : 1;
- unsigned int fDocOwnsStyles : 1;
- unsigned int notCached : 1;
- unsigned int neverCached : 1;
- unsigned int spaceMultiply: 1;
-
- DParagraph();
- DParagraph( char* data, Boolean docOwnsData, short lines, DParagraph* parFmt,
- StyleIndex* styles, short numstyle, Boolean docOwnsStyles = true);
- virtual ~DParagraph();
- virtual Boolean suicide(void); // prefered to delete
- virtual Boolean suicide(short ownercount);
- void Initialize();
- void Copy(DParagraph* it);
- //virtual DObject* Clone();
- };
-
-
- #endif
-
-