home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / MTHREAD.PAK / ARTYPRIV.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.5 KB  |  74 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1991, 1995 by Borland International, All Rights Reserved
  4. //
  5. // Classes used internally by the multi-thread TArtyWindow
  6. //----------------------------------------------------------------------------
  7. #if !defined(ARTYPRIV_H)
  8. #define ARTYPRIV_H
  9.  
  10. #include <winsys/color.h>
  11.  
  12. class _EXPCLASS TDC;
  13. class _EXPCLASS TPen;
  14.  
  15. //
  16. // Arty demo constants
  17. //
  18. const int   MaxLineCount      =  100;
  19. const int   MaxIconicLineCount=  5;
  20. const int   MaxColorDuration  =  10;
  21.  
  22. struct TLineRec {
  23.   int    LX1,LY1, LX2,LY2;
  24.   TColor Color;
  25. };
  26.  
  27. //
  28. //
  29. //
  30. class TList {
  31.   public:
  32.     TList(int _max);
  33.     void Redraw(TDC&);
  34.     void ResetLines();
  35.     void ScaleTo(int, int);
  36.     void LineTick(TDC&);
  37.  
  38.   protected:
  39.     TLineRec  Line[MaxLineCount];
  40.     int       Xmax, Ymax;
  41.  
  42.     void AdjustX(int&, int&);
  43.     void AdjustY(int&, int&);
  44.  
  45.     virtual void DrawLine(TDC&, int);
  46.     virtual void EraseLine(TDC&, int);
  47.  
  48.     void SelectNewColor();
  49.     void SelectNewDeltaValues();
  50.  
  51.   private:
  52.     int  MaxLines;
  53.     int  X1, Y1, X2, Y2;
  54.     int  MaxDelta;
  55.     int  ColorDuration;
  56.     int  IncrementCount;
  57.     int  DeltaX1, DeltaY1, DeltaX2, DeltaY2;
  58.     int  CurrentLine;
  59.     long PenColor;
  60. };
  61.  
  62. //
  63. // Quads draw 4 reflections of each line
  64. //
  65. class TQuadList : public TList {
  66.   public:
  67.     TQuadList(int _max) : TList(_max) {}
  68.  
  69.     void DrawLine(TDC&, int);
  70.     void EraseLine(TDC&, int);
  71. };
  72.  
  73. #endif  // ARTYPRIV_H
  74.