/*
* $XConsortium: TextSinkP.h,v 1.3 89/10/04 13:56:59 kit Exp $
*/


/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/* 
 * TextSinkP.h - Private definitions for TextSink object
 * 
 */

#ifndef _XawTextSinkP_h
#define _XawTextSinkP_h

/***********************************************************************
 *
 * TextSink Object Private Data
 *
 ***********************************************************************/

#ifndef _XtObjectP_h
#include "../ObjectP.h"
#endif
#ifndef _XawTextSink_h
#include "TextSink.h"
#endif
#ifndef _XawTextP_h
#include "TextP.h"	/* This source works with the Text widget. */
#endif
#ifndef _XawTextSrcP_h
#include "TextSrcP.h"	/* This source works with the Text Source. */
#endif

/************************************************************
 *
 * New fields for the TextSink object class record.
 *
 ************************************************************/

/*
 * Types added to simplify declarations.
 */
typedef void (*_XawSinkDisplayTextF)(Widget, int, int, XawTextPosition, XawTextPosition, int);
typedef void (*_XawSinkInsertCursorF)(Widget, int, int, XawTextInsertState);
typedef void (*_XawSinkClearToBackgroundF)(Widget, int, int, int, int);
typedef void (*_XawSinkFindPositionF)(
			Widget, XawTextPosition, int, int, int, XawTextPosition*, int*, int*);
typedef void (*_XawSinkFindDistanceF)(
			Widget, XawTextPosition, int, XawTextPosition,
			int*, XawTextPosition*, int*);
typedef void (*_XawSinkResolveF)(Widget, XawTextPosition, int, int, XawTextPosition*);
typedef int  (*_XawSinkMaxLinesF)(Widget, int);
typedef int  (*_XawSinkMaxHeightF)(Widget, int);
typedef void (*_XawSinkSetTabsF)(Widget, int, int*);
typedef void (*_XawSinkGetCursorBoundsF)(Widget, XRectangle*);

typedef struct _TextSinkClassPart {
    _XawSinkDisplayTextF	DisplayText;
    _XawSinkInsertCursorF	InsertCursor;
    _XawSinkClearToBackgroundF	ClearToBackground;
    _XawSinkFindPositionF	FindPosition;
    _XawSinkFindDistanceF	FindDistance;
    _XawSinkResolveF		Resolve;
    _XawSinkMaxLinesF		MaxLines;
    _XawSinkMaxHeightF		MaxHeight;
    _XawSinkSetTabsF		SetTabs;
    _XawSinkGetCursorBoundsF	GetCursorBounds;
} TextSinkClassPart;

/* Full class record declaration */
typedef struct _TextSinkClassRec {
    ObjectClassPart     object_class;
    TextSinkClassPart	text_sink_class;
} TextSinkClassRec;

extern TextSinkClassRec textSinkClassRec;

/* New fields for the TextSink object record */
typedef struct {
    /* resources */
    XFontStruct	*font;		/* Font to draw in. */
    Pixel foreground;		/* Foreground color. */
    Pixel background;		/* Background color. */

    /* private state. */
    Position *tabs;		/* The tab stops as pixel values. */
    int      *char_tabs;	/* The tabs stops as character values. */
    int      tab_count;		/* number of items in tabs */

} TextSinkPart;

/****************************************************************
 *
 * Full instance record declaration
 *
 ****************************************************************/

typedef struct _TextSinkRec {
  ObjectPart    object;
  TextSinkPart	text_sink;
} TextSinkRec;

/************************************************************
 *
 * Private declarations.
 *
 ************************************************************/

#define XtInheritDisplayText		((_XawSinkDisplayTextF) _XtInherit)
#define XtInheritInsertCursor		((_XawSinkInsertCursorF) _XtInherit)
#define XtInheritClearToBackground	((_XawSinkClearToBackgroundF) _XtInherit)
#define XtInheritFindPosition		((_XawSinkFindPositionF) _XtInherit)
#define XtInheritFindDistance		((_XawSinkFindDistanceF) _XtInherit)
#define XtInheritResolve		((_XawSinkResolveF) _XtInherit)
#define XtInheritMaxLines		((_XawSinkMaxLinesF) _XtInherit)
#define XtInheritMaxHeight		((_XawSinkMaxHeightF) _XtInherit)
#define XtInheritSetTabs		((_XawSinkSetTabsF) _XtInherit)
#define XtInheritGetCursorBounds	((_XawSinkGetCursorBoundsF) _XtInherit)

#endif /* _XawTextSinkP_h */
