/* Generated by wbuild from "Label.w"
** (generator version $Revision: 2.0 $ of $Date: 93/07/06 16:08:04 $)
*/
#ifndef _XfwfLabelP_H_
#define _XfwfLabelP_H_
#include "BoardP.h"
#include "Label.h"
typedef void (*set_label_Proc)(
#if NeedFunctionPrototypes
Widget,String 
#endif
);
#define XtInherit_set_label ((set_label_Proc) _XtInherit)
typedef struct {
/* methods */
set_label_Proc set_label;
#define draw_line(dpy, win, from, to) do {\
        if (((XfwfLabelWidget)self)->xfwfLabel.rvStart >= to) rstart = to;\
	else rstart = max(((XfwfLabelWidget)self)->xfwfLabel.rvStart, from);\
	if (((XfwfLabelWidget)self)->xfwfLabel.rvStart + ((XfwfLabelWidget)self)->xfwfLabel.rvLength <= from) rend = rstart;\
	else rend = min(((XfwfLabelWidget)self)->xfwfLabel.rvStart + ((XfwfLabelWidget)self)->xfwfLabel.rvLength, to);\
	w1 = XfwfTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + from, rstart - from, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
	w2 = XfwfTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + rstart, rend - rstart, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
	w3 = XfwfTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + rend, to - rend, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
	if (((XfwfLabelWidget)self)->xfwfLabel.alignment & XfwfLeft)\
	    x = rect.x;\
	else if (((XfwfLabelWidget)self)->xfwfLabel.alignment & XfwfRight)\
	    x = rect.x + rect.width - w1 - w2 - w3;\
	else\
	    x = rect.x + (rect.width - w1 - w2 - w3)/2;\
	if (w1)\
	    XfwfDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.gc, x, y, ((XfwfLabelWidget)self)->xfwfLabel.label + from,\
			     rstart - from, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
	if (w2)\
	    XfwfDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.rv_gc, x + w1, y, ((XfwfLabelWidget)self)->xfwfLabel.label\
			     + rstart, rend - rstart, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
	if (w3)\
	    XfwfDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.gc, x + w1 + w2, y, ((XfwfLabelWidget)self)->xfwfLabel.label +\
			     rend, to - rend, ((XfwfLabelWidget)self)->xfwfLabel.tabs);\
    }while (0 )


/* class variables */
} XfwfLabelClassPart;
typedef struct _XfwfLabelClassRec {
CoreClassPart core_class;
CompositeClassPart composite_class;
XfwfCommonClassPart xfwfCommon_class;
XfwfFrameClassPart xfwfFrame_class;
XfwfBoardClassPart xfwfBoard_class;
XfwfLabelClassPart xfwfLabel_class;
} XfwfLabelClassRec;

typedef struct {
/* resources */
String  label;
String  tablist;
XFontStruct * font;
Pixel  foreground;
Alignment  alignment;
Dimension  topMargin;
Dimension  bottomMargin;
Dimension  leftMargin;
Dimension  rightMargin;
Boolean  shrinkToFit;
int  rvStart;
int  rvLength;
/* private state */
int  nlines;
int * tabs;
GC  gc;
GC  rv_gc;
GC  graygc;
Dimension  label_width;
Dimension  label_height;
} XfwfLabelPart;

typedef struct _XfwfLabelRec {
CorePart core;
CompositePart composite;
XfwfCommonPart xfwfCommon;
XfwfFramePart xfwfFrame;
XfwfBoardPart xfwfBoard;
XfwfLabelPart xfwfLabel;
} XfwfLabelRec;

externalref XfwfLabelClassRec xfwfLabelClassRec;

#endif /* _XfwfLabelP_H_ */
