/* $Id: TERMINAL.H 2.4 1995/07/20 11:24:33 leon Exp $
 *
 *      GISEL - G-CODE ISEL CNC driver
 *
 *      Copyright (c) 1994 LECAD
 *      All Rights Reserved.
 *
 */

#ifndef TERMINAL_H_INCLUDED

#define TERMINAL_H_INCLUDED


#define Uses_TTerminal

#define Uses_TWindow


#include <tvision/tv.h>


class Comm;
extern Comm *comm;

/**
 ** Terminal view class. This is line based dumb terminal
 ** for immediate communication with controller.
 **/
class TTermView : public TTerminal {

public:

    TTermView( const TRect& bounds,
               TScrollBar *aHScrollBar,
               TScrollBar *aVScrollBar);
    ~TTermView();
    virtual void handleEvent( TEvent& event );
    virtual void draw(void);
    virtual int do_sputn( const char *s, int count );
    virtual void do_sputc( const char c );

    void update();

protected:
    char *prompt;

};


/**
 ** Streamable wrapper class for Terminal window
 **/
class TTermWindow : public TWindow
{
public:
    TTermWindow(const TRect& bounds, const char *aTitle, 
                short aNumber);
    TTermWindow( StreamableInit ) : TWindow(streamableInit),
                                    TWindowInit( initFrame ) {}
private:

    virtual const char *streamableName() const
        { return name; }


protected:

    virtual void write( opstream& );
    virtual void *read( ipstream& );

public:

    static const char * const name;
    static TStreamable *build();

};


#endif /* TERMINAL_H_INCLUDED */



syntax highlighted by Code2HTML, v. 0.9.1