/* Generated by wbuild from "Label.w"
** (generator version $Revision: 1.17 $ of $Date: 92/12/07 19:32:00 $)
*/
#ifndef _XfwfLabelP_H_
#define _XfwfLabelP_H_
#include <Xfwf/BoardP.h>
#include <Xfwf/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 = XTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + from, rstart - from);\
	w2 = XTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + rstart, rend - rstart);\
	w3 = XTextWidth(((XfwfLabelWidget)self)->xfwfLabel.font, ((XfwfLabelWidget)self)->xfwfLabel.label + rend, to - rend);\
	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)\
	    XDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.gc, x, y, ((XfwfLabelWidget)self)->xfwfLabel.label + from,\
			     rstart - from);\
	if (w2)\
	    XDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.rv_gc, x + w1, y, ((XfwfLabelWidget)self)->xfwfLabel.label\
			     + rstart, rend - rstart);\
	if (w3)\
	    XDrawImageString(dpy, win, ((XfwfLabelWidget)self)->xfwfLabel.gc, x + w1 + w2, y, ((XfwfLabelWidget)self)->xfwfLabel.label +\
			     rend, to - rend);\
    }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;
XFontStruct * font;
Pixel  foreground;
Alignment  alignment;
int  margin;
Boolean  shrinkToFit;
int  rvStart;
int  rvLength;
/* private state */
int  nlines;
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_ */
