00001 /** 00002 * \file rvcstyle.h <mi32/rvcstyle.h> 00003 * \brief Definitions for Style objects 00004 * 00005 * \if NODOC 00006 * $Id: rvcstyle.h_v 1.92 2006/12/06 17:26:02 scowan Exp $ 00007 * 00008 * $Log: rvcstyle.h_v $ 00009 * Revision 1.92 2006/12/06 17:26:02 scowan 00010 * Made const the added credentials. 00011 * 00012 * Revision 1.91 2006/12/06 17:21:21 scowan 00013 * Hacked in credentials for legacy open and make. 00014 * 00015 * Revision 1.90 2005/12/21 00:09:22 scowan 00016 * Removed unused exported function. 00017 * 00018 * Revision 1.89 2005/03/31 16:57:20 fileserver!dwilliss 00019 * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define 00020 * 00021 * Revision 1.88 2004/09/03 16:02:07 scowan 00022 * Removed unused items. 00023 * 00024 * Revision 1.87 2004/04/03 00:00:12 scowan 00025 * Moved unused prototypes to private include file. 00026 * 00027 * Revision 1.86 2004/04/02 23:28:49 scowan 00028 * Fixed deprecation. 00029 * 00030 * Revision 1.85 2004/04/02 22:14:34 scowan 00031 * Removed unused prototypes and make more functions deprecated. 00032 * 00033 * Revision 1.84 2004/04/02 16:59:21 scowan 00034 * Added more thingsd to be deprecated. 00035 * 00036 * Revision 1.83 2004/04/02 16:51:03 scowan 00037 * Removed unused prototype for combine styles. 00038 * 00039 * Revision 1.82 2004/03/31 18:35:01 dwilliss 00040 * Added versions of functions that take MISTRING instead of text font name, 00041 * which I'm about to deprecate 00042 * 00043 * Revision 1.81 2004/03/11 16:57:47 mju 00044 * Eliminate old obj selection dialogs as no longer used. 00045 * 00046 * Revision 1.80 2004/03/10 17:08:43 dwilliss 00047 * Added a polygons member to SYMBOLDATA 00048 * 00049 * Revision 1.79 2004/03/10 15:45:17 dwilliss 00050 * Added some new point symbol element types 00051 * 00052 * Revision 1.78 2003/10/15 17:39:35 mju 00053 * Deprecate groupkey. 00054 * 00055 * Revision 1.77 2003/09/25 21:29:07 dwilliss 00056 * Don't capitalize enum any more. Genitor needed it, doxygen doesn't like it. 00057 * 00058 * Revision 1.76 2003/09/15 13:49:56 fileserver!dwilliss 00059 * Doxygen 00060 * 00061 * Revision 1.75 2003/03/03 15:28:33 mju 00062 * Add variants on MfImportPointSymbol... using RVC::STYLE. 00063 * 00064 * Revision 1.74 2003/01/31 18:41:05 scowan 00065 * nc. 00066 * 00067 * Revision 1.73 2002/11/21 20:31:37 dwilliss 00068 * Added new HATCHPATTELEM constant 00069 * 00070 * Revision 1.72 2002/10/16 19:22:57 dwilliss 00071 * Prototype for new function 00072 * 00073 * Revision 1.71 2002/09/09 13:59:02 mju 00074 * Always prevent_memfunc. 00075 * Retire previously deprecated stuff. 00076 * 00077 * Revision 1.70 2002/08/22 16:20:35 scowan 00078 * More functions. 00079 * 00080 * Revision 1.69 2002/08/22 14:51:55 scowan 00081 * Added object name versions of style functions. 00082 * 00083 * Revision 1.68 2002/08/21 22:40:16 dwilliss 00084 * Correction to previous revision. Needed to take a TEXTFONTNAME, not 00085 * RVC::OBJECTNAME 00086 * 00087 * Revision 1.67 2002/08/21 22:31:54 dwilliss 00088 * MfFontTransIndexToName() -- Made a version that takes RVC::OBJECTNAME to 00089 * fill in and deprecated the one that filled in a MIUNICODE* 00090 * 00091 * Revision 1.66 2002/08/21 20:38:57 scowan 00092 * Deprecate old object name define. 00093 * 00094 * Revision 1.65 2002/08/20 15:18:50 mju 00095 * Use prevent_memfunc macro, still checks no_deprecated. 00096 * 00097 * Revision 1.64 2002/05/23 20:04:45 scowan 00098 * Added add pattern function. 00099 * 00100 * Revision 1.63 2002/05/23 19:52:15 scowan 00101 * Added read pattern ext function. 00102 * 00103 * Revision 1.62 2002/04/16 19:12:56 dwilliss 00104 * Never mind... 00105 * 00106 * Revision 1.61 2002/03/08 23:16:17 scowan 00107 * Added fields to texzt style. 00108 * 00109 * Revision 1.60 2002/03/08 23:03:32 scowan 00110 * Added more ctors and other methods. 00111 * 00112 * Revision 1.59 2002/03/08 18:56:46 scowan 00113 * Added clear method. 00114 * delrecate mem... for struct info's. 00115 * 00116 * Revision 1.58 2001/12/20 21:48:30 mju 00117 * Enum docs. 00118 * 00119 * Revision 1.57 2001/09/14 14:58:36 mju 00120 * No Mdlg in win32native. 00121 * 00122 * Revision 1.56 2001/08/31 20:01:38 scowan 00123 * Added write style name function. 00124 * 00125 * Revision 1.55 2001/08/28 15:22:10 mju 00126 * Fix search/replace goof. 00127 * 00128 * Revision 1.54 2001/08/28 14:56:26 mju 00129 * Add MfStyleAdd() functions. 00130 * 00131 * Revision 1.53 2001/08/28 14:29:43 mju 00132 * Change RVCPOLYSTYLE to RVCPOLYGONSTYLE with typedef for old name. 00133 * 00134 * Revision 1.52 2001/08/15 16:09:11 mju 00135 * Change STYLETYPE and PATTERNTYPE to enums. 00136 * 00137 * Revision 1.51 2001/03/06 22:55:57 vdronov 00138 * added STYLETYPE_Empty = 0xFFFF 00139 * 00140 * Revision 1.50 2000/11/06 18:51:34 msmith 00141 * Genitor documentation. 00142 * 00143 * Revision 1.49 2000/07/07 20:53:11 scowan 00144 * Create filepath version of get style. 00145 * 00146 * Revision 1.48 2000/05/24 22:30:01 dwilliss 00147 * Added 2 new prototypes 00148 * 00149 * Revision 1.47 2000/04/27 17:18:38 mju 00150 * Define RVCPATTHDR struct and have other pattern headers inherit from it. 00151 * 00152 * Revision 1.46 2000/04/14 14:54:31 scowan 00153 * *** empty log message *** 00154 * 00155 * Revision 1.45 1999/11/19 14:30:27 mju 00156 * MdlgGet... prompt const. 00157 * 00158 * Revision 1.44 1999/10/18 21:06:27 mju 00159 * Remove RVCANYSTYLE union. 00160 * 00161 * Revision 1.43 1999/10/18 17:07:46 mju 00162 * Make MfStyleRead/WriteXxxx inline so they are typesafe. 00163 * Add MfStyleRead() and MfStyleWrite() inlines. 00164 * 00165 * Revision 1.42 1999/10/05 22:48:35 scowan 00166 * Changed headers to use inheritance. 00167 * 00168 * Revision 1.41 1999/08/05 21:16:35 mju 00169 * Use const for FindPattern and StyleLocate. 00170 * 00171 * Revision 1.40 1999/06/29 21:31:48 mju 00172 * Add CopyStyleRVCtoMem for text style. 00173 * 00174 * Revision 1.39 1999/06/11 14:46:29 mju 00175 * Obj sel dlg. 00176 * 00177 * Revision 1.38 1999/06/10 22:11:23 mju 00178 * Object selection dialog update. 00179 * 00180 * Revision 1.37 1999/05/07 21:23:41 mju 00181 * Hdr restruct. 00182 * 00183 * Revision 1.36 1999/02/17 18:47:59 mju 00184 * Add CopyStyle prototypes. 00185 * 00186 * Revision 1.35 1999/01/05 19:13:20 scowan 00187 * Swapped multiple keywords 00188 * 00189 * Revision 1.34 1998/11/06 22:11:44 dfrolov 00190 * rearange fields in HATCHPATTELEMENT structure 00191 * 00192 * Revision 1.33 1998/10/28 22:44:03 dfrolov 00193 * some changes in hatch patterns 00194 * 00195 * Revision 1.32 1998/10/23 19:07:41 dfrolov 00196 * add support for hatch patterns 00197 * 00198 * Revision 1.31 1998/09/30 21:54:41 scowan 00199 * Setup DLL. 00200 * 00201 * Revision 1.30 1998/09/25 22:46:20 scowan 00202 * Fixed for DLL. 00203 * 00204 * Revision 1.29 1998/09/23 23:12:31 scowan 00205 * *** empty log message *** 00206 * 00207 * Revision 1.28 1998/08/03 13:47:34 dwilliss 00208 * Changed a UINT8 spare[4] to FLOAT width 00209 * 00210 * Revision 1.27 1997/10/31 17:26:16 dfrolov 00211 * attempted to add new elements for symbols 00212 * 00213 * Revision 1.26 1997/06/20 19:56:53 scowan 00214 * Added Predefined. 00215 * 00216 * Revision 1.25 1996/12/20 16:37:34 coffee!dwilliss 00217 * Added __cplusplus things 00218 * 00219 * Revision 1.24 1996/07/13 00:18:12 mju 00220 * Remove MxFillPolygonBitmap prototypes as obsolete. 00221 * 00222 * Revision 1.23 1996/03/07 21:53:22 scowan 00223 * Added _MfWriteStyleRaw(). 00224 * 00225 * Revision 1.22 1996/02/22 22:33:44 scowan 00226 * Added MfDeleteStyleType(). 00227 * 00228 * Revision 1.21 1996/01/23 05:28:34 scowan 00229 * Added MfReplaceStyle(). 00230 * 00231 * Revision 1.20 1996/01/17 16:59:24 coffee!dwilliss 00232 * Prototyped MfReadStyleName() 00233 * 00234 * Revision 1.19 1995/12/13 23:10:21 mju 00235 * Remove MfMakeDftStyleTable() prototype. 00236 * 00237 * Revision 1.18 1995/12/05 22:44:19 coffee!dwilliss 00238 * *** empty log message *** 00239 * 00240 * Revision 1.17 1995/10/25 17:22:07 mju 00241 * Move FONTSTYLE flags to stddefns.h. 00242 * 00243 * Revision 1.16 1995/08/28 16:59:06 scowan 00244 * Changed MfReadTextStyle() API. 00245 * 00246 * Revision 1.15 1995/08/28 16:33:32 scowan 00247 * Prototyped new MfFontTrans...() functions. 00248 * 00249 * Revision 1.14 1995/08/25 20:12:40 scowan 00250 * Added prototype for MfReadTextStyleExt(). 00251 * 00252 * Revision 1.13 1995/07/26 13:24:58 mju 00253 * Add FontTrans... prototypes. 00254 * 00255 * Revision 1.12 1995/01/30 20:49:00 scowan 00256 * Added prototypes for MfDeleteStyle() and MfDeletePattern(). 00257 * 00258 * Revision 1.11 1995/01/12 00:30:37 scowan 00259 * Added HeightUnits and LineSpaceUnits fields to RVCTEXTSTYLE. 00260 * 00261 * Revision 1.10 1994/06/30 14:07:36 coffee!dwilliss 00262 * Added PATTCOLOR_Variable. Same as UserDefined, but more intuitively named. 00263 * 00264 * Revision 1.9 1994/05/06 21:54:54 scowan 00265 * Changed int to UINT32 in MfCombineStyles(). 00266 * 00267 * Revision 1.8 1994/05/06 15:06:57 scowan 00268 * Changed long to INT32. 00269 * Changed flag parms to UINT32. 00270 * 00271 * Revision 1.7 1993/12/27 15:07:33 coffee!dwilliss 00272 * Added MapScale to RVCxxxxSTYLE structures 00273 * 00274 * Revision 1.6 1993/11/12 20:56:24 coffee!dwilliss 00275 * *** empty log message *** 00276 * 00277 * Revision 1.5 1993/08/06 19:43:16 shovland 00278 * added prototype for MfCombineStyles() 00279 * 00280 * Revision 1.4 1993/05/17 20:31:25 coffee!harrison 00281 * Added prototype for MfMakeDftStyleTable... 00282 * 00283 * Revision 1.3 1993/04/14 16:31:12 mju 00284 * Add MxFillPolygonBitmapW() prototype. 00285 * 00286 * Revision 1.2 1993/01/06 18:14:24 mju 00287 * Change API for MxFillPolygonsBitmap() 00288 * 00289 * \endif 00290 **/ 00291 00292 #ifndef INC_MI32_RVCSTYLE_H 00293 #define INC_MI32_RVCSTYLE_H 00294 00295 #ifndef INC_MI32_RVCDEFNS_H 00296 #include <mi32/rvcdefns.h> 00297 #endif 00298 00299 #ifndef INC_MI32_ELEMSTYL_H 00300 #include <mi32/elemstyl.h> 00301 #endif 00302 00303 #ifndef INC_MI32_COLOR_H 00304 #include <mi32/color.h> 00305 #endif 00306 00307 //! Forward declarations 00308 00309 struct POINTSTYLE; 00310 struct LINESTYLE; 00311 struct POLYSTYLE; 00312 struct TEXTSTYLE; 00313 namespace RVC { 00314 class STYLE; 00315 class CREDENTIALS; 00316 } 00317 00318 /* 00319 * The following is so that I can add MapScale to the style objects, 00320 * but not until after 4.5. 4.4 programs will croke if the 00321 * RVCXXXXXSTYLE structures grow. 4.5 can handle it. 00322 * As soon as we want to add the MapScale stuff again, delete the 00323 * following #define 00324 */ 00325 00326 //! Definition for style object header. 00327 struct RVCSTYLEINFO : public RVCGENINFO { 00328 UINT16 PointStyleSize; //!< Point style size 00329 UINT16 LineStyleSize; //!< Line style size 00330 UINT16 PolyStyleSize; //!< Polygon style size 00331 UINT16 TextStyleSize; //!< Text style size 00332 UINT16 BitmapPattSize; //!< Bitmap pattern size 00333 UINT16 HatchPattSize; //!< Hatch pattern size 00334 UINT16 LinePattSize; //!< Line pattern size 00335 UINT16 SymbolSize; //!< Symbol size 00336 00337 RVCSTYLEINFO ( 00338 ) {Clear();} 00339 00340 RVCSTYLEINFO ( 00341 const RVCGENINFO& ginfo 00342 ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;} 00343 00344 RVCSTYLEINFO& operator= ( 00345 const RVCGENINFO& ginfo //!< RVCSTYLEINFO to copy 00346 ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);} 00347 00348 void Clear ( 00349 ) {memset(static_cast<void*>(this), 0, sizeof(*this));} 00350 00351 }; 00352 00353 //! Disallow memset/memcpy. 00354 PREVENT_MEMFUNC(RVCSTYLEINFO) 00355 00356 00357 /*----------------------------------------------------------------------------*/ 00358 /* Definitions for style structures as stored in file */ 00359 /*----------------------------------------------------------------------------*/ 00360 00361 //! Structure for point drawing style. 00362 struct RVCPOINTSTYLE { 00363 RVC::OBJECTNAME name; //!< Name 00364 UINT32 StyleFlags; //!< Flags 00365 INT32 SymbolNum; //!< Symbol number 00366 DOUBLE ScaleX; //!< Size in mm 00367 DOUBLE ScaleY; //!< Size in mm 00368 DOUBLE Angle; //!< Angle in radians (?) 00369 COLOR DrawColor; //!< Color 00370 DOUBLE MapScale; //!< MapScale to use given scales at 00371 }; 00372 00373 //! Structure for line drawing style. 00374 struct RVCLINESTYLE { 00375 RVC::OBJECTNAME name; //!< Name 00376 UINT32 StyleFlags; //!< Flags 00377 INT32 PatternNum; //!< Pattern number 00378 DOUBLE Scale; //!< Actually line width in mm 00379 COLOR DrawColor; //!< Color 00380 DOUBLE MapScale; //!< MapScale to use given scales at 00381 }; 00382 00383 //! Structure for polygon drawing style. 00384 struct RVCPOLYGONSTYLE { 00385 RVC::OBJECTNAME name; //!< Name 00386 UINT32 StyleFlags; //!< Flags 00387 INT32 FillPatternNum; //!< Fill pattern number 00388 INT32 BorderPatternNum; //!< Border pattern number 00389 UINT8 space[4]; //!< Spacing 00390 DOUBLE BorderScale; //!< Actually line width in mm 00391 COLOR BorderColor; //!< Border color 00392 COLOR FillColor; //!< Fill color 00393 DOUBLE MapScale; //!< MapScale to use given scales at 00394 }; 00395 typedef RVCPOLYGONSTYLE RVCPOLYSTYLE; 00396 00397 //! Structure for text drawing style. 00398 struct RVCTEXTSTYLE { 00399 RVC::OBJECTNAME name; //!< Name 00400 UINT32 StyleFlags; //!< Flags 00401 INT32 font; //!< Font 00402 COLOR fgcolor; //!< Foreground color 00403 COLOR bgcolor; //!< Background color 00404 FLOAT glyphrot; //!< Glyph rotation 00405 FLOAT glyphaspect; //!< Glyph aspect 00406 FLOAT shear; //!< Shear 00407 FLOAT height; //!< Height 00408 FLOAT linespace; //!< Line spacing 00409 UINT32 FontFlags; //!< Font flags 00410 DOUBLE MapScale; //!< MapScale to use given scales at 00411 UINT8 HeightUnits; //!< Defined in SCREENUNITS_... 00412 UINT8 LineSpaceUnits; //!< Line spacing units 00413 UINT16 Predefined; //!< ??? 00414 FLOAT width; //!< Only used for HTML layout 00415 FLOAT StrokeWidth; //!< Stroke width in % of glyph height (1.0 = 100%) 00416 FLOAT EnhanceWidth; //!< Enhanced width in % of glyph height (1.0 = 100%) 00417 FLOAT BoldnessWidth; //!< Boldness width in % of glyph height (1.0 = 100%) Ignored unless FONTSTYLE_Bold is set 00418 FLOAT UnderlineWidth; //!< Underline with in % of glyph height (1.0 = 100%) 00419 FLOAT UnderlineOffset; //!< Underline Offset from baseline in % (1.0 = 100%) 00420 FLOAT ShadowOffset; //!< Drop shadow offset in % (1.0 = 100%) Ignored unless FONTSTYLE_Shadow is set 00421 FLOAT ShadowAngle; //!< Drop shadow angle in radians 00422 FLOAT ClipWidth; //!< Clip extended area around text in TextAddToClip() 00423 UINT8 ShadowRelative; //!< true if shadow angle relative to baseline angle 00424 UINT8 WidthUnits; 00425 UINT8 space[6]; 00426 }; 00427 00428 //! Enumeration for style types. 00429 enum STYLETYPE { 00430 STYLETYPE_Point = 0, 00431 STYLETYPE_Line = 1, 00432 STYLETYPE_Polygon = 2, 00433 STYLETYPE_Text = 3, 00434 STYLETYPE_COUNT = 4, 00435 STYLETYPE_Empty = 0xFFFF, 00436 }; 00437 #define STYLETYPE_Poly STYLETYPE_Polygon 00438 #define NUMSTYLETYPES STYLETYPE_COUNT 00439 00440 //! Enumeration for pattern types. 00441 enum PATTERNTYPE { 00442 PATTERNTYPE_Symbol = 0, 00443 PATTERNTYPE_Line = 1, 00444 PATTERNTYPE_Bitmap = 2, 00445 PATTERNTYPE_Hatch = 3, 00446 PATTERNTYPE_COUNT = 4, 00447 }; 00448 #define NUMPATTTYPES PATTERNTYPE_COUNT 00449 00450 /* 00451 ** "UserDefined" is ambiguious, but in this case, it means the "variable" 00452 ** color (which is what it's labeled on the symbol/pattern editor dialogs) 00453 ** Use PATTCOLOR_Variable. 00454 */ 00455 #define PATTCOLOR_Transparent 255 00456 #define PATTCOLOR_UserDefined 254 00457 #define PATTCOLOR_Variable PATTCOLOR_UserDefined 00458 00459 //! Information common to all patterns / symbols. 00460 struct RVCPATTHDR { 00461 RVC::OBJECTNAME name; //!< Name 00462 INT16 numelements; //!< Number of elements used to define pattern 00463 INT16 numcolors; //!< Number of colors used in pattern 00464 }; 00465 00466 00467 /*----------------------------------------------------------------------------*/ 00468 /* Definitions for bitmap pattern description structure */ 00469 /* */ 00470 /* Each pattern entry consists of a header (BITMAPPATTHDR), followed by */ 00471 /* the color map (array of COLORs with "numcolors" entries), followed */ 00472 /* by the pattern (array of UBYTES with "xsize" * "ysize" elements. */ 00473 /*----------------------------------------------------------------------------*/ 00474 00475 //! Bitmap pattern header. 00476 struct BITMAPPATTHDR : public RVCPATTHDR { 00477 INT16 xsize; //!< X size 00478 INT16 ysize; //!< Y size 00479 INT16 xhot; //!< X hot 00480 INT16 yhot; //!< Y hot 00481 INT16 xspace; //!< X space 00482 INT16 yspace; //!< Y space 00483 }; 00484 00485 00486 /*----------------------------------------------------------------------------*/ 00487 /* Definitions for line pattern description structure */ 00488 /* */ 00489 /* Each pattern entry consists of a header (LINEPATTHDR), followed by */ 00490 /* the color map (array of COLORs with "numcolors" entries), followed */ 00491 /* by the pattern elements. */ 00492 /* All position and size values are in units of 1/100 millimeter. */ 00493 /*----------------------------------------------------------------------------*/ 00494 00495 //! Line pattern header. 00496 struct LINEPATTHDR : public RVCPATTHDR { 00497 INT16 extentsa; //!< Maximum extents of element "above" line (drawn left to right) 00498 INT16 extentsb; //!< Maximum extents of element "below" line (drawn left to right) 00499 }; 00500 00501 struct LINEPATTELEM { 00502 INT16 extrabytes; //!< Number of bytes in element not including header 00503 UINT8 type; //!< Pattern element type 00504 UINT8 colornum; //!< Color index in pattern-specific color map 00505 UINT16 flags; //!< Flags 00506 INT16 xoffset; //!< Offset along line from start 00507 INT16 xspacing; //!< Spacing between instances of element 00508 INT16 yoffset; //!< Offset above(-) or below(+) line 00509 INT16 xsize; //!< Size/Length of element 00510 INT16 thickness; //!< Thickness of element lines (if not filled) 00511 }; 00512 00513 #define LINEPATTELEM_Line 0 //!< Line parallel to drawing direction, xsize=0 indicates continuous 00514 #define LINEPATTELEM_CrossLine 1 //!< Line perpendicular to drawing direction 00515 #define LINEPATTELEM_Circle 2 //!< Circle - xsize = radius 00516 #define LINEPATTELEM_PolyLine 3 //!< PolyLine 00517 #define LINEPATTELEM_Polygon 4 //!< Polygon 00518 00519 #define LINEPATTELEM_Last 4 //!< Last defined type 00520 00521 #define LINEPATTFLAG_Filled 0x0001//!< Fill (circle and polygon elements) 00522 #define LINEPATTFLAG_JoinMiter 0x0002//!< Join "bent" segment mitered (extended) 00523 #define LINEPATTFLAG_JoinBevel 0x0004//!< Join "bent" segment beveled 00524 #define LINEPATTFLAG_CapRound 0x0008//!< Use rounded ends on line segments 00525 00526 00527 /*----------------------------------------------------------------------------*/ 00528 /* Definitions for hatch pattern description structure */ 00529 /* */ 00530 /* Each pattern entry consists of a header (HATCHPATTHDR), followed by */ 00531 /* the color map (array of COLORs with "numcolors" entries), followed */ 00532 /* by the pattern elements. */ 00533 /* All position and size values are in units of 1/100 millimeter. */ 00534 /*----------------------------------------------------------------------------*/ 00535 00536 //! Hatch pattern header. 00537 struct HATCHPATTHDR : public RVCPATTHDR { 00538 UINT8 spare[4]; //!< Double alignment 00539 }; 00540 00541 //! Hatch pattern element structure. 00542 struct HATCHPATTELEM { 00543 UINT8 type; //!< Pattern element type: simple or line pattern 00544 UINT8 colornum; //!< Color index in pattern-specific color map 00545 UINT8 isvisible; //!< Flag for turning element on/off 00546 UINT8 space; //!< Space 00547 UINT32 linedatasize; //!< Size of the line pattern data attached 00548 UINT32 flags; //!< Flags 00549 UINT8 spare[4]; //!< Double alignment 00550 DOUBLE xoffset; //!< Origin offset 00551 DOUBLE yoffset; //!< Origin offset 00552 DOUBLE spacing; //!< Spacing between instances of element 00553 DOUBLE angle; //!< Angle of element 00554 DOUBLE thickness; //!< Thickness of element lines 00555 }; 00556 00557 #define HATCHPATTELEM_Simple 0 //!< Simple solid lines 00558 #define HATCHPATTELEM_LinePattern 1 //!< Line pattern 00559 #define HATCHPATTELEM_SolidFill 2 //!< Fill with solid color 00560 #define HATCHPATTELEM_Last 2 //!< Last defined type 00561 00562 /*----------------------------------------------------------------------------*/ 00563 /* Definitions for symbol description structure */ 00564 /* */ 00565 /* Each pattern entry consists of a header (SYMBOLHDR), followed by */ 00566 /* the color map (array of COLORs with "numcolors" entries), followed */ 00567 /* by the symbol elements. */ 00568 /* All position and size values are in units of 1/100 millimeter. */ 00569 /*----------------------------------------------------------------------------*/ 00570 00571 //! Symbol header. 00572 struct SYMBOLHDR : public RVCPATTHDR { 00573 INT16 xsize; //!< X size 00574 INT16 ysize; //!< Y size 00575 INT16 xhot; //!< X hot 00576 INT16 yhot; //!< Y hot 00577 UINT16 flags; //!< Flags 00578 UINT8 spare[2]; //!< Double alignment 00579 }; 00580 00581 #define SYMBOLHDRFLAG_OldSymbol (0x8000) 00582 00583 /* rotation and angles are in 1/64th of a degree */ 00584 00585 union SYMBOLDATA { 00586 struct { INT16 x, y, radius; } circle; 00587 struct { INT16 x, y, radius, sangle, eangle; } arc; 00588 struct { INT16 x, y, xsize, ysize, rotate; } ellipse; 00589 struct { INT16 x, y, xsize, ysize, sangle, eangle, rotate; } earc; 00590 struct { INT16 x, y; } point; 00591 struct { INT16 x1, y1, x2, y2; UINT16 capstyle; } segment; 00592 struct { INT16 x, y, xsize, ysize, rotate, shear; UINT16 joinstyle; } rectangle; 00593 struct { UINT16 numpoints, joinstyle, capstyle; } line; 00594 struct { UINT16 numpoints, joinstyle; } polygon; 00595 struct { UINT16 numchars, fontnum, fontstyle, flags; 00596 INT16 x, y, height, rotate, shear, textrot, xscale; } text; 00597 struct { UINT16 numpoints, joinstyle, capstyle; } spline; 00598 struct { UINT16 numpoints, joinstyle, capstyle; } ttfsymbol; 00599 struct { UINT16 numpoints, joinstyle, numpolys; } polygons; 00600 INT16 spare[12]; 00601 }; 00602 00603 //! Symbol element structure. 00604 struct SYMBOLELEM { 00605 SYMBOLDATA data; //!< Union of element structures 00606 UINT32 numbytes; //!< Number of bytes 00607 INT16 thickness; //!< Thickness of element lines (if not filled) 00608 UINT16 flags; //!< Flags 00609 UINT8 type; //!< Type of element stored 00610 UINT8 colornum; //!< Color index in pattern-specific color map 00611 UINT8 spare[2]; //!< Double alignment 00612 }; 00613 00614 /* Extra bytes for lines, text, and polygons */ 00615 00616 /* Defined types */ 00617 #define PTSYM_NULL 0 //!< Empty element, maybe for deletes? 00618 #define PTSYM_Circle 1 00619 #define PTSYM_Arc 2 00620 #define PTSYM_ArcWedge 3 00621 #define PTSYM_ArcChord 4 00622 #define PTSYM_Ellipse 5 00623 #define PTSYM_EArc 6 00624 #define PTSYM_EArcWedge 7 00625 #define PTSYM_EArcChord 8 00626 #define PTSYM_Line 9 00627 #define PTSYM_Polygon 10 00628 #define PTSYM_Point 11 00629 #define PTSYM_Text 12 00630 #define PTSYM_Segment 13 00631 #define PTSYM_Rectangle 14 00632 #define PTSYM_Polygons 15 //!< Multiple polygons with islands 00633 #define PTSYM_Splines 16 //!< Splines of the type used in TrueType 00634 00635 #define PTSYM_Last 16 //!< Last element type defined 00636 00637 #define SYMBOLFLAG_Filled 0x0001 //!< Fill polygonal elements 00638 00639 /*----------------------------------------------------------------------------*/ 00640 /* Function prototypes */ 00641 /*----------------------------------------------------------------------------*/ 00642 00643 #if defined(__cplusplus) 00644 extern "C" { 00645 #endif 00646 00647 #ifndef GENERATING_DOXYGEN_OUTPUT 00648 00649 RVCAPPLIBEXPORT int _MfStyleClose (int, RVCSTYLEINFO*, int); 00650 RVCAPPLIBEXPORT int _MfStyleMake (int, RVCSTYLEINFO*, int, UINT32); 00651 RVCAPPLIBEXPORT int _MfStyleMakeEx (int, RVCSTYLEINFO*, int, UINT32, const RVC::CREDENTIALS*); 00652 RVCAPPLIBEXPORT int _MfStyleOpen (int, INT32, RVCSTYLEINFO*, int, UINT32); 00653 RVCAPPLIBEXPORT int _MfStyleOpenEx (int, INT32, RVCSTYLEINFO*, int, UINT32, const RVC::CREDENTIALS*); 00654 RVCAPPLIBEXPORT int _MfStyleRead (int, int type, INT32, void*, int); 00655 RVCAPPLIBEXPORT ERRVALUE _MfStyleWrite (int, int type, INT32, void*, int); 00656 00657 #endif //!< GENERATING_DOXYGEN_OUTPUT 00658 00659 #if !defined(NO_DEPRECATED) || defined(RVCAPPDLL) // DEPRECATED 00660 //! Convert an RVC point style structure to a point style structure. 00661 //! \deprecated - Replaced by RVC::STYLE::Read() 00662 RVCAPPLIBEXPORT int MfConvertRVCPOINTSTYLEtoPOINTSTYLE ( 00663 int id, //!< Style object 00664 RVCPOINTSTYLE *rvcstyle, //!< RVC style structure 00665 POINTSTYLE *style, //!< Non-RVC style structure 00666 UINT32 flags //!< Flags (none defined) 00667 ); 00668 00669 //! Convert an RVC line style structure to a line style structure. 00670 //! \deprecated - Replaced by RVC::STYLE::Read() 00671 RVCAPPLIBEXPORT int MfConvertRVCLINESTYLEtoLINESTYLE ( 00672 int id, //!< Style object 00673 RVCLINESTYLE *rvcstyle, //!< RVC style structure 00674 LINESTYLE *style, //!< Non-RVC style structure 00675 UINT32 flags //!< Flags (none defined) 00676 ); 00677 00678 //! Convert an RVC polygon style structure to a polygon style structure. 00679 //! \deprecated - Replaced by RVC::STYLE::Read() 00680 RVCAPPLIBEXPORT int MfConvertRVCPOLYSTYLEtoPOLYSTYLE ( 00681 int id, //!< Style object 00682 RVCPOLYGONSTYLE *rvcstyle, //!< RVC style structure 00683 POLYSTYLE *style, //!< Non-RVC style structure 00684 UINT32 flags //!< Flags (none defined) 00685 ); 00686 #endif 00687 00688 //! Replace a opened style object with a new style object. 00689 RVCAPPLIBEXPORT int MfReplaceStyle ( 00690 int sfindex, //!< Open RVC file handle of source style object 00691 INT32 sinode, //!< Inode of source style object (may be opened) 00692 int dfindex, //!< Open RVC file handle of destination style object 00693 INT32 dinode //!< Inode of destination style object (may be opened) 00694 ); 00695 00696 //! Delete a style entry from a style object. 00697 //! 00698 //! @returns error code if < 0 or the style swapped for the style to be deleted 00699 //! Permitted style types: 00700 //! STYLETYPE_Point 00701 //! STYLETYPE_Line 00702 //! STYLETYPE_Polygon 00703 //! STYLETYPE_Text 00704 //! This routine works by swapping the end style with the style to 00705 //! delete and then shrinking the object to number of original styles - 1 00706 //! This value is what is returned so that any references to that style 00707 //! can now be changed. 00708 RVCAPPLIBEXPORT INT32 MfDeleteStyle ( 00709 int id, //!< Open style object handle 00710 int type, //!< Type of style to delete, see below 00711 INT32 num //!< The style entry to delete 00712 ); 00713 00714 //! Delete all of the styles of a specific type from a style object. 00715 //! 00716 //! Permitted style types: 00717 //! STYLETYPE_Point 00718 //! STYLETYPE_Line 00719 //! STYLETYPE_Polygon 00720 //! STYLETYPE_Text 00721 RVCAPPLIBEXPORT int MfDeleteStyleType ( 00722 int id, //!< Open style object handle 00723 int type //!< Type of style to delete, see below 00724 ); 00725 00726 //! Return the number of a particular style. 00727 //! 00728 //! @return number of styles if >= 0 or error code if < 0. 00729 //! Types of styles: 00730 //! STYLETYPE_Point Point styles 00731 //! STYLETYPE_Line Line styles 00732 //! STYLETYPE_Polygon Polygon styles 00733 //! STYLETYPE_Text Text styles 00734 RVCAPPLIBEXPORT INT32 MfGetStyleCount ( 00735 int id, //!< Handle to open style object 00736 int type //!< Type of style (STYLETYPE_...) 00737 ); 00738 00739 //! Search the style element for a specific name, checking specified position first. 00740 //! 00741 //! @return style entry number if >= 0, -1 if not found, < -1 error. 00742 //! Permitted style types: 00743 //! STYLETYPE_Point 00744 //! STYLETYPE_Line 00745 //! STYLETYPE_Polygon 00746 //! STYLETYPE_Text 00747 RVCAPPLIBEXPORT INT32 MfStyleLocate ( 00748 int id, //!< Open style object handle 00749 int type,