#ifndef __OLINEDOC_H
#define __OLINEDOC_H

#include <stdio.h>
#include <X11/Xlib.h>

#include "OViewDoc.h"
#include "OGC.h"

#define MAXLINESIZE 8000
#define MARGIN 3

class OXTextFrame;

class OLineDoc : public OViewDoc {

protected:
  OXTextFrame * _style_server;
  OGC * _gc;
  int ll;

public:
  OLineDoc();
  ~OLineDoc();

  void SetCanvas(OXTextFrame * c);
  void SetColor(char * c);

  OLineDoc *next, *prev;
  OLineDoc * InsertBefore(OLineDoc * l);
  OLineDoc * InsertAfter(OLineDoc * l);

  void Clear();
  int  Fill(char * buf);
  int  LoadFile(FILE *file);

  void Layout();

  void DrawRegion(Display *dpy, Drawable d, int x, int y, XRectangle *rect);

protected:

  char *chars;   // line of text
  int lnlen;     // length of line
};

#endif
