// --------------------------------------------------------------------------
// --
// -- WINDOWS -- All the window handlers.
// --
// --
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// -- Definitions
// --------------------------------------------------------------------------

// -- Basic types ----



// -- Absolutes ------


// -- Frame display format strings --
#define WIN_F_COLOR		'&'


// -- Errors ---------


// --------------------------------------------------------------------------
// -- Classes
// --------------------------------------------------------------------------

// --- Status window -------------------------------------------------------
class  WinStatus {

   ConFreeWindow  *view;

   LogFileName    *rxLogName;
   LogFileName    *txLogName;
   LogFileName    *frameLogName;

   LoggingStyle   rxStyle;
   LoggingStyle   txStyle;
   LoggingStyle   frameStyle;

   unsigned long  rxCount;
   unsigned long  txCount;
   unsigned long  frameRXCount;
   unsigned long  frameTXCount;

   Boolean		  go;

   char			  *alarmText;

 public:

   WinStatus( int yStart);
  ~WinStatus();

   void reset(void);
   void refresh(void);
   void moveTo( int yStart );

   void setLogRX(   LogFileName *rx   );
   void setLogTX(   LogFileName *tx   );
   void setLogFRAME(LogFileName *frame);

   void showGo(   void );  // Indicator
   void showStop( void );

   void incRX(void);       // Counts
   void incTX(void);
   void incRXFrame( void);
   void incTXFrame( void);
   void clearAll(   void);
   void clearChars( void);
   void clearFrames(void);

   void showRXStyle(   LoggingStyle rx   );
   void showTXStyle(   LoggingStyle tx   );
   void showFrameStyle(LoggingStyle frame);

   void portAlarm( char *text );

};


// --- Frame window ---------------------------------------------------
class  WinFrame {

   int    ySize;

   char	 *lines;               // line buffer
   int    startLine;
   int    firstVisibleLine;
   int    nextLine;

   ConLBSWindow  *view;

 public:

   WinFrame(int  startY, int  sizeY, int  lineBuffers );
  ~WinFrame();

   void flush(void);
   void refresh(void);
   void moveTo(int startY, int  sizeY);

   void post( char  *line);

   void scrollUp(  void);
   void scrollDown(void);

};