home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / igbundle.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  7.9 KB  |  333 lines

  1. #ifndef _IGBUNDLE_
  2. #define _IGBUNDLE_
  3. /*******************************************************************************
  4. * FILE NAME: igbundle.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IGraphicBundle                                                           *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18.  
  19. #include <ibase.hpp>
  20. #include <ipoint.hpp>
  21. #include <icolor.hpp>
  22.  
  23.  
  24. class IGraphicContext;
  25.  
  26. #pragma pack(4)
  27.  
  28. class IGraphicBundle : public IBase {
  29. typedef IBase
  30.   Inherited;
  31.  
  32. public:
  33. /*------------------------------- Constructors -------------------------------*/
  34.   IGraphicBundle  ( );
  35.  
  36.   IGraphicBundle  ( const IGraphicBundle&  graphicBundle  );
  37.  
  38.   IGraphicBundle  ( const IGraphicContext& graphicContext );
  39.  
  40. IGraphicBundle
  41.   &operator=      ( const IGraphicBundle&  graphicBundle  );
  42.  
  43.   ~IGraphicBundle ( );
  44.  
  45. /*---------------------------- Draw Operation --------------------------------*/
  46. enum DrawOperation {
  47.   fill,
  48.   frame,
  49.   fillAndFrame
  50.   };
  51.  
  52. IGraphicBundle
  53.   &setDrawOperation   ( DrawOperation drawOperation = fillAndFrame );
  54.  
  55. DrawOperation
  56.   drawOperation       ( ) const;
  57.  
  58. IGraphicBundle
  59.  &resetDrawOperation  ( );
  60.  
  61. IBase::Boolean
  62.   hasDrawOperation    ( ) const;
  63.  
  64. /*---------------------------- Color Attributes ------------------------------*/
  65. IGraphicBundle
  66.   &setPenColor          ( const IColor& penColor  ),
  67.   &setFillColor         ( const IColor& fillColor ),
  68.   &setBackgroundColor   ( const IColor& backColor );
  69.  
  70. IColor
  71.   penColor              ( ) const,
  72.   fillColor             ( ) const,
  73.   backgroundColor       ( ) const;
  74.  
  75. IGraphicBundle
  76.   &resetPenColor        ( ),
  77.   &resetFillColor       ( ),
  78.   &resetBackgroundColor ( );
  79.  
  80. IBase::Boolean
  81.   hasPenColor           ( ) const,
  82.   hasFillColor          ( ) const,
  83.   hasBackgroundColor    ( ) const;
  84.  
  85. /*---------------------------------- MixMode ---------------------------------*/
  86. enum MixMode {
  87.   bitOr,
  88.   overPaint,
  89.   bitExclusiveOr,
  90.   leaveAlone,
  91.   bitAnd,
  92.   subtract,
  93.   maskSourceNot,
  94.   black,
  95.   notMergeSource,
  96.   notXorSource,
  97.   invert,
  98.   mergeSourceNot,
  99.   notCopySource,
  100.   mergeNotSource,
  101.   notMaskSource,
  102.   white
  103. #if ( IC_OBSOLETE <= IC_OBSOLETE_2 )
  104. #ifndef __DIGRAPHS__
  105.   ,
  106.   or  = bitOr,
  107.   xor = bitExclusiveOr,
  108.   and = bitAnd
  109. #endif
  110. #endif
  111.   };
  112.  
  113. IGraphicBundle
  114.  &setMixMode           ( MixMode mixMode = overPaint );
  115.  
  116. MixMode
  117.   mixMode              ( ) const;
  118.  
  119. IGraphicBundle
  120.  &resetMixMode         ( );
  121.  
  122. IBase::Boolean
  123.   hasMixMode           ( ) const;
  124.  
  125. /*---------------------------- BackgroundMixMode -----------------------------*/
  126. enum BackgroundMixMode {
  127.   backLeaveAlone,
  128.   backOverPaint,
  129.   backOr,
  130.   backXor
  131.   };
  132.  
  133. IGraphicBundle
  134.  &setBackgroundMixMode   ( BackgroundMixMode backgroundMixMode =
  135.                                                                backLeaveAlone );
  136. BackgroundMixMode
  137.   backgroundMixMode      ( ) const;
  138.  
  139. IGraphicBundle
  140.  &resetBackgroundMixMode ( );
  141.  
  142. IBase::Boolean
  143.   hasBackgroundMixMode   ( ) const;
  144.  
  145. /*----------------------------- Pen Width ------------------------------------*/
  146. IGraphicBundle
  147.  &setPenWidth            ( unsigned long lineWidth = 1 );
  148.  
  149. unsigned long
  150.   penWidth               ( ) const;
  151.  
  152. IGraphicBundle
  153.  &resetPenWidth          ( );
  154.  
  155. IBase::Boolean
  156.   hasPenWidth            ( ) const;
  157.  
  158. /*------------------------------ Pen Type ------------------------------------*/
  159. enum PenType {
  160.   solid,
  161.   dot,
  162.   shortDash,
  163.   dashDot,
  164.   doubleDot,
  165.   longDash,
  166.   dashDoubleDot,
  167.   alternate,
  168.   invisible
  169.   };
  170.  
  171. IGraphicBundle
  172.   &setPenType              ( PenType penType = solid );
  173.  
  174. PenType
  175.   penType                  ( ) const;
  176.  
  177. IGraphicBundle
  178.  &resetPenType             ( );
  179.  
  180. IBase::Boolean
  181.   hasPenType               ( ) const;
  182.  
  183. /*------------------------------ PenEndingStyle ------------------------------*/
  184. enum PenEndingStyle {
  185.   flat,
  186.   square,
  187.   rounded
  188.   };
  189.  
  190. IGraphicBundle
  191.  &setPenEndingStyle        ( PenEndingStyle penEndingStyle = flat );
  192.  
  193. PenEndingStyle
  194.   penEndingStyle           ( ) const;
  195.  
  196. IGraphicBundle
  197.  &resetPenEndingStyle      ( );
  198.  
  199. IBase::Boolean
  200.   hasPenEndingStyle        ( ) const;
  201.  
  202.  
  203. /*------------------------------ PenJoiningStyle -----------------------------*/
  204. enum PenJoiningStyle {
  205.   bevel,
  206.   round,
  207.   miter
  208.   };
  209.  
  210. IGraphicBundle
  211.   &setPenJoiningStyle      ( PenJoiningStyle penJoiningStyle = bevel );
  212.  
  213. PenJoiningStyle
  214.   penJoiningStyle          ( ) const;
  215.  
  216. IGraphicBundle
  217.  &resetPenJoiningStyle     ( );
  218.  
  219. IBase::Boolean
  220.   hasPenJoiningStyle       ( ) const;
  221.  
  222. /*--------------------------- Pen and Fill Patterns --------------------------*/
  223. static const unsigned long
  224.   IC_IMPORTU dense1,
  225.   IC_IMPORTU dense2,
  226.   IC_IMPORTU dense3,
  227.   IC_IMPORTU dense4,
  228.   IC_IMPORTU dense5,
  229.   IC_IMPORTU dense6,
  230.   IC_IMPORTU dense7,
  231.   IC_IMPORTU dense8,
  232.   IC_IMPORTU vertical,
  233.   IC_IMPORTU horizontal,
  234.   IC_IMPORTU forewardDiag1,
  235.   IC_IMPORTU forewardDiag2,
  236.   IC_IMPORTU backwardDiag1,
  237.   IC_IMPORTU backwardDiag2,
  238.   IC_IMPORTU hollow,
  239.   IC_IMPORTU filled,
  240.   IC_IMPORTU halftone,
  241.   IC_IMPORTU hatched,
  242.   IC_IMPORTU hatchedDiag;
  243.  
  244. IGraphicBundle
  245.   &setPenPattern           ( unsigned long penPattern  = filled ),
  246.   &setFillPattern          ( unsigned long fillPattern = filled );
  247.  
  248. //  &setPattern            ( const IBitmapHandle& handle       );
  249.  
  250. unsigned long
  251.   penPattern               ( ) const,
  252.   fillPattern              ( ) const;
  253.  
  254. IGraphicBundle
  255.  &resetPenPattern          ( ),
  256.  &resetFillPattern         ( );
  257.  
  258. IBase::Boolean
  259.   hasPenPattern            ( ) const,
  260.   hasFillPattern           ( ) const;
  261.  
  262. /*--------------------------- Pattern Origin ---------------------------------*/
  263. IGraphicBundle
  264.  &setPatternOrigin        ( const IPoint& point = IPoint(0,0) );
  265.  
  266. IPoint
  267.   patternOrigin           ( ) const;
  268.  
  269. IGraphicBundle
  270.  &resetPatternOrigin      ( );
  271.  
  272. IBase::Boolean
  273.   hasPatternOrigin        ( ) const;
  274.  
  275. /*------------------------------ Comparison ----------------------------------*/
  276. IBase::Boolean
  277.   operator== ( const IGraphicBundle& graphicBundle ),
  278.   operator!= ( const IGraphicBundle& graphicBundle );
  279.  
  280. private:
  281. /*--------------------------------- Private ----------------------------------*/
  282. enum Attribute {
  283.   pColor = 0x0001,
  284.   fColor = 0x0002,
  285.   bColor = 0x0004,
  286.   pMix   = 0x0008,
  287.   bMix   = 0x0010,
  288.   pWidth = 0x0020,
  289.   pType  = 0x0040,
  290.   pEnd   = 0x0080,
  291.   pJoin  = 0x0100,
  292.   pPat   = 0x0200,
  293.   fPat   = 0x0400,
  294.   pOrg   = 0x0800,
  295.   drawOp = 0x1000,
  296.   All    = 0x1fff
  297.   };
  298.  
  299. IColor
  300.   fPen,
  301.   fFill,
  302.   fBack;
  303. DrawOperation
  304.   fDrawOp;
  305. MixMode
  306.   fPmix;
  307. BackgroundMixMode
  308.   fBmix;
  309. unsigned long
  310.   fPpat,
  311.   fFpat;
  312. PenType
  313.   fPtype;
  314. PenEndingStyle
  315.   fPend;
  316. PenJoiningStyle
  317.   fPjoin;
  318. unsigned long
  319.   fWidth;
  320. IPoint
  321.   fOrg;
  322. unsigned long
  323.   fMask;
  324.  
  325. }; // IGraphicBundle
  326.  
  327. #pragma pack()
  328.  
  329. /*--------------------------------- INLINES ----------------------------------*/
  330.   #include <igbundle.inl>
  331.  
  332. #endif // _IGBUNDLE_
  333.