X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FLink.h;h=aa8727faec7eb3f15cbba32494f365c44b884923;hb=a2f683fe644fded868c536909907282555b1b777;hp=e19c3c035b1764843318bab06bf7e2e3170b862b;hpb=64676031423465996e83c4a685290f0c3d97a249;p=evince.git diff --git a/pdf/xpdf/Link.h b/pdf/xpdf/Link.h index e19c3c03..aa8727fa 100644 --- a/pdf/xpdf/Link.h +++ b/pdf/xpdf/Link.h @@ -2,7 +2,7 @@ // // Link.h // -// Copyright 1996-2002 Glyph & Cog, LLC +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== @@ -301,6 +301,42 @@ private: GString *action; // action subtype }; +//------------------------------------------------------------------------ +// LinkBorderStyle +//------------------------------------------------------------------------ + +enum LinkBorderType { + linkBorderSolid, + linkBorderDashed, + linkBorderEmbossed, + linkBorderEngraved, + linkBorderUnderlined +}; + +class LinkBorderStyle { +public: + + LinkBorderStyle(LinkBorderType typeA, double widthA, + double *dashA, int dashLengthA, + double rA, double gA, double bA); + ~LinkBorderStyle(); + + LinkBorderType getType() { return type; } + double getWidth() { return width; } + void getDash(double **dashA, int *dashLengthA) + { *dashA = dash; *dashLengthA = dashLength; } + void getColor(double *rA, double *gA, double *bA) + { *rA = r; *gA = g; *bA = b; } + +private: + + LinkBorderType type; + double width; + double *dash; + int dashLength; + double r, g, b; +}; + //------------------------------------------------------------------------ // Link //------------------------------------------------------------------------ @@ -315,25 +351,27 @@ public: ~Link(); // Was the link created successfully? - GBool isOk() const { return ok; } + GBool isOk() { return ok; } // Check if point is inside the link rectangle. - GBool inRect(double x, double y) const + GBool inRect(double x, double y) { return x1 <= x && x <= x2 && y1 <= y && y <= y2; } // Get action. - LinkAction *getAction() const { return action; } + LinkAction *getAction() { return action; } + + // Get the link rectangle. + void getRect(double *xa1, double *ya1, double *xa2, double *ya2) + { *xa1 = x1; *ya1 = y1; *xa2 = x2; *ya2 = y2; } - // Get border corners and width. - void getBorder(double *xa1, double *ya1, double *xa2, double *ya2, - double *wa) const - { *xa1 = x1; *ya1 = y1; *xa2 = x2; *ya2 = y2; *wa = borderW; } + // Get the border style info. + LinkBorderStyle *getBorderStyle() { return borderStyle; } private: double x1, y1; // lower left corner double x2, y2; // upper right corner - double borderW; // border width + LinkBorderStyle *borderStyle; // border style LinkAction *action; // action GBool ok; // is link valid? };