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