00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #ifndef INC_MI32_MATTE_H
00074 #define INC_MI32_MATTE_H
00075
00076 #ifndef INC_MI32_COLOR_H
00077 #include <mi32/color.h>
00078 #endif
00079
00080 #ifndef INC_MI32_SERIALIZ_H
00081 #include <mi32/serializ.h>
00082 #endif
00083
00084 #ifndef INC_MI32_SCRNUNIT_H
00085 #include <mi32/scrnunit.h>
00086 #endif
00087
00088 #ifndef INC_MI32_MCB_H
00089 #include <mi32/mcb.h>
00090 #endif
00091
00092 #ifndef INC_MI32_MGD2_H
00093 #include <mi32/mgd2.h>
00094 #endif
00095
00096
00097 class MATTE;
00098
00099
00100
00101
00102
00103 class MATTE_CONTROLPANEL {
00104 public:
00105
00106 void AddChangeCallback (
00107 McbCallbackFunc func,
00108 void* cbdata
00109 ) {
00110 McbAddCallback(&m_cblist, func, cbdata, 1);
00111 return;
00112 }
00113
00114 void RemoveChangeCallabck (
00115 McbCallbackFunc func,
00116 void* cbdata
00117 ) {
00118 McbRemoveCallback(&m_cblist, func, cbdata, 1);
00119 return;
00120 }
00121
00122 virtual void ChangeMatte (
00123 MATTE& matte
00124 ) = 0;
00125
00126 protected:
00127 MATTE* m_matte;
00128
00129 MATTE_CONTROLPANEL (
00130 MATTE* matte
00131 ) :
00132 m_matte(matte)
00133 {
00134 }
00135
00136 virtual ~MATTE_CONTROLPANEL () {}
00137
00138 void CallChangeCallbacks (
00139 );
00140
00141 private:
00142 #ifndef GENERATING_DOXYGEN_OUTPUT
00143 McbLIST m_cblist;
00144 friend class MATTE;
00145 #endif // GENERATING_DOXYGEN_OUTPUT
00146 };
00147
00148 class MATTE : public SERIALIZABLE {
00149 public:
00150
00151 enum DRAWFLAGS {
00152 DRAWFLAG_None = 0,
00153 DRAWFLAG_DrawInsideExtents = 0x00000001
00154 };
00155
00156 enum FILLMODE {
00157 FILLMODE_None = 0,
00158 FILLMODE_Solid = 1,
00159 FILLMODE_Gradient,
00160 FILLMODE_Radial
00161 };
00162
00163 enum SPREADMODE {
00164 SPREADMODE_RGB = 0,
00165 SPREADMODE_HISCW,
00166 SPREADMODE_HISCCW,
00167 SPREADMODE_HBSCW,
00168 SPREADMODE_HBSCCW
00169 };
00170
00171 enum BORDER {
00172 BORDER_None = 0,
00173 BORDER_Solid = 1,
00174 BORDER_Double = 2,
00175 BORDER_Inset = 3,
00176 BORDER_Outset = 4,
00177 BORDER_Groove = 5,
00178 BORDER_Ridge = 6,
00179 BORDER_EtchedIn = 7,
00180 BORDER_EtchedOut = 8,
00181 BORDER_Rounded = 9,
00182 BORDER_CartoScript = 10
00183 };
00184
00185
00186 MATTE();
00187
00188
00189 MATTE(const MATTE&);
00190
00191
00192 virtual ~MATTE();
00193
00194
00195
00196
00197 MATTE& operator= (
00198 const MATTE& rhs
00199 );
00200
00201
00202 virtual ERRVALUE SerialRead (
00203 SERIALIZER& serializer
00204 );
00205
00206 virtual ERRVALUE SerialWrite (
00207 SERIALIZER& serializer,
00208 const char* tagname
00209 ) const;
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 MATTE_CONTROLPANEL* CreateControlPanel (
00221 MDLGPARENT form
00222 );
00223
00224
00225
00226
00227
00228 ERRVALUE Draw (
00229 MGD::CONTEXT& gc,
00230 const LRECT2D& rect,
00231 double MapScale = 1.0,
00232 DRAWFLAGS flags = DRAWFLAG_None
00233 );
00234
00235
00236
00237
00238
00239 ERRVALUE DrawBackground (
00240 MGD::CONTEXT& gc,
00241 const LRECT2D& rect,
00242 double MapScale = 1.0,
00243 DRAWFLAGS flags = DRAWFLAG_None
00244 );
00245
00246
00247
00248
00249
00250 ERRVALUE DrawBorder (
00251 MGD::CONTEXT& gc,
00252 const LRECT2D& rect,
00253 double MapScale = 1.0,
00254 DRAWFLAGS flags = DRAWFLAG_None
00255 );
00256
00257
00258
00259
00260
00261 ERRVALUE DrawDropShadow (
00262 MGD::CONTEXT& gc,
00263 const LRECT2D& rect,
00264 double MapScale = 1.0,
00265 DRAWFLAGS flags = DRAWFLAG_None
00266 );
00267
00268
00269
00270
00271
00272 const COLOR& GetBackgroundColor (
00273 ) const {
00274 return m_BGColor1;
00275 }
00276
00277
00278 const COLOR& GetBackgroundColor2 (
00279 ) const {
00280 return m_BGColor2;
00281 }
00282
00283
00284 FILLMODE GetBackgroundFillMode (
00285 ) const {
00286 return m_BGFillMode;
00287 }
00288
00289 double GetBackgroundGradientAngle (
00290 ) const {
00291 return m_BGGradientAngle;
00292 }
00293
00294 SPREADMODE GetBackgroundGradientSpreadMode (
00295 ) const {
00296 return m_BGSpreadMode;
00297 }
00298
00299 const MISTRING& GetBorderCartoScript (
00300 ) const {
00301 return m_BorderCartoScript;
00302 }
00303
00304
00305 const COLOR& GetBorderColor (
00306 ) const {
00307 return m_BorderColor;
00308 }
00309
00310
00311
00312 double GetBorderSize (
00313 ) const {
00314 return m_BorderSize;
00315 }
00316
00317
00318 BORDER GetBorderStyle (
00319 ) const {
00320 return m_BorderStyle;
00321 }
00322
00323
00324 bool GetDropShadowBlend (
00325 ) const {
00326 return (m_DSBlend);
00327 }
00328
00329
00330 const COLOR& GetDropShadowColor (
00331 ) const {
00332 return m_DSColor;
00333 }
00334
00335
00336
00337
00338
00339 void GetExtraExtents (
00340 double& x1,
00341 double& y1,
00342 double& x2,
00343 double& y2
00344 ) const;
00345
00346
00347 double GetDropShadowDirection (
00348 ) const {
00349 return m_DSDirection;
00350 }
00351
00352
00353 double GetDropShadowSize (
00354 ) const {
00355 return m_DSSize;
00356 }
00357
00358
00359 double GetMarginBottom (
00360 ) const {
00361 return m_MarginBottom;
00362 }
00363
00364
00365 double GetMarginLeft (
00366 ) const {
00367 return m_MarginLeft;
00368 }
00369
00370
00371 double GetMarginRight (
00372 ) const {
00373 return m_MarginRight;
00374 }
00375
00376
00377 double GetMarginTop (
00378 ) const {
00379 return m_MarginTop;
00380 }
00381
00382
00383
00384 SCREENUNIT GetDisplayUnits (
00385 ) const {
00386 return m_SizeUnits;
00387 }
00388
00389 bool IsBorderRoundedRect (
00390 ) const {
00391 return m_BorderRoundRect;
00392 }
00393
00394
00395
00396 bool NeedsTransparency (
00397 ) const;
00398
00399
00400
00401
00402 void SetBackgroundColor (
00403 const COLOR& color
00404 ) {
00405 m_BGColor1 = color;
00406 }
00407
00408
00409 void SetBackgroundColor2 (
00410 const COLOR& color
00411 ) {
00412 m_BGColor2 = color;
00413 }
00414
00415
00416 void SetBackgroundFillMode (
00417 FILLMODE mode
00418 ) {
00419 m_BGFillMode = mode;
00420 }
00421
00422 void SetBackgroundGradientAngle (
00423 double angle
00424 ) {
00425 m_BGGradientAngle = angle;
00426 }
00427
00428 void SetBackgroundGradientSpreadMode (
00429 SPREADMODE mode
00430 ) {
00431 m_BGSpreadMode = mode;
00432 }
00433
00434 void SetBorderCartoScript (
00435 const MISTRING& script
00436 ) {
00437 m_BorderCartoScript = script;
00438 }
00439
00440
00441 void SetBorderColor (
00442 const COLOR& color
00443 ) {
00444 m_BorderColor = color;
00445 }
00446
00447
00448
00449
00450 void SetBorderIsRoundedRect (
00451 bool bRound
00452 ) {
00453 m_BorderRoundRect = bRound;
00454 }
00455
00456
00457 void SetBorderSize (
00458 double size
00459 ) {
00460 m_BorderSize = size;
00461 }
00462
00463
00464 void SetBorderStyle (
00465 BORDER style
00466 ) {
00467 m_BorderStyle = style;
00468 }
00469
00470
00471 void SetDropShadowBlend (
00472 bool blend
00473 ) {
00474 m_DSBlend = blend;
00475 }
00476
00477
00478 void SetDropShadowColor (
00479 const COLOR& color
00480 ) {
00481 m_DSColor = color;
00482 }
00483
00484
00485 void SetDropShadowDirection (
00486 double dir
00487 ) {
00488 m_DSDirection = dir;
00489 }
00490
00491
00492 void SetDropShadowSize (
00493 double size
00494 ) {
00495 m_DSSize = size;
00496 }
00497
00498
00499 void SetMarginBottom (
00500 double dist
00501 ) {
00502 m_MarginBottom = dist;
00503 }
00504
00505
00506 void SetMarginLeft (
00507 double dist
00508 ) {
00509 m_MarginLeft = dist;
00510 }
00511
00512
00513 void SetMarginRight (
00514 double dist
00515 ) {
00516 m_MarginRight = dist;
00517 }
00518
00519
00520 void SetMarginTop (
00521 double dist
00522 ) {
00523 m_MarginTop = dist;
00524 }
00525
00526
00527
00528 void SetDisplayUnits (
00529 SCREENUNIT units
00530 ) {
00531 m_SizeUnits = units;
00532 }
00533
00534
00535
00536
00537
00538
00539
00540 void SetSolidBackground (
00541 const COLOR& color
00542 ) {
00543 m_bSolidBackground = true;
00544 m_PageColor = color;
00545 return;
00546 }
00547
00548
00549 void SetDirtyBackground (
00550 ) {
00551 m_bSolidBackground = false;
00552 return;
00553 }
00554
00555 void SetMarginsInset (
00556 bool inset
00557 ) {
00558 m_bMarginsInset = inset;
00559 }
00560
00561 private:
00562 #ifndef GENERATING_DOXYGEN_OUTPUT
00563 COLOR m_BGColor1;
00564 COLOR m_BGColor2;
00565 FILLMODE m_BGFillMode;
00566 double m_BGGradientAngle;
00567 SPREADMODE m_BGSpreadMode;
00568
00569 double m_MarginLeft;
00570 double m_MarginRight;
00571 double m_MarginTop;
00572 double m_MarginBottom;
00573
00574 SCREENUNIT m_SizeUnits;
00575
00576 COLOR m_DSColor;
00577 double m_DSDirection;
00578 double m_DSSize;
00579 bool m_DSBlend;
00580
00581 COLOR m_BorderColor;
00582 double m_BorderSize;
00583 BORDER m_BorderStyle;
00584 bool m_BorderRoundRect;
00585 MISTRING m_BorderCartoScript;
00586
00587 bool m_bMarginsInset;
00588 COLOR m_PageColor;
00589 bool m_bSolidBackground;
00590
00591
00592 static const SERIALIZER::ITEMDEF* SerialGetItemDef (
00593 SERIALIZER& serializer
00594 );
00595
00596 friend class MATTEPRIV;
00597 #endif // GENERATING_DOXYGEN_OUTPUT
00598 };
00599
00600
00601
00602 #endif
00603