//	Zinc Application Framework - M_SCRLL.HPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#if !defined(M_SCRLL_HPP)
#define M_SCRLL_HPP
#include <z_scrll2.hpp>
#include "m_utils.hpp"

extern "C"
{
#include _ScrollBP_
#include _ScaleP_
}

// ----- MtfSlider widget definition ----------------------------------------

#define MtfSlider OSSlider
#define MtfSliderIndex (XmScaleIndex + 1)

struct MtfSliderClassPart
{
	XtPointer reserved;
};

struct MtfSliderClassRec
{
	CoreClassPart coreClassPart;
	CompositeClassPart compositeClassPart;
	ConstraintClassPart constraintClassPart;
	XmManagerClassPart managerClassPart;
	XmScaleClassPart scaleClassPart;
	MtfSliderClassPart mtfSliderClassPart;
};

struct MtfSliderPart
{
};

struct MtfSlider
{
	CorePart core;
	CompositePart composite;
	ConstraintPart constraint;
	XmManagerPart manager;
	XmScalePart scale;
	MtfSliderPart mtfSliderPart;

	static MtfSliderClassRec classRecord;
	static XmOffsetPtr offsets;
	static XtActionsRec action[];
	static char translations[];

	// Actions that map to Zinc functionality.
	static void call_default(MtfSlider *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->RootObject()->Event(L_SELECT); }
	static void classInitialize();
	static void drag_drop(MtfSlider *mtfObject, XEvent *xEvent, String *params, Cardinal *nparams);
	static void enter(MtfSlider *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void expose(MtfSlider *mtfObject, XEvent *xEvent, Region xRegion);
	static void focus_in(MtfSlider *mtfObject, XEvent *xEvent, String *params, Cardinal *nparams);
	static void help(MtfSlider *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_HELP); }
	static void leave(MtfSlider *mtfObject, XEvent *xEvent, String *, Cardinal *);

	// General purpose functions.
	static ZafScrollBar *GetZincObject(MtfSlider *mtfObject)
		{ return ((ZafScrollBar *)mtfObject->manager.user_data); }
	static MtfSlider *GetMotifWidget(OSWindowID screenID)
		{ return ((MtfSlider *)screenID); }
};

// ----- MtfScrollBar widget definition -------------------------------------

#define MtfScrollBar OSScrollBar
#define MtfScrollBarIndex (XmScrollBarIndex + 1)

struct MtfScrollBarClassPart
{
	XtPointer reserved;
};

struct MtfScrollBarClassRec
{
	CoreClassPart coreClassPart;
	XmPrimitiveClassPart primitiveClassPart;
	XmScrollBarClassPart scrollBarClassPart;
	MtfScrollBarClassPart mtfScrollBarClassPart;
};

struct MtfScrollBarPart
{
};

struct MtfScrollBar
{
	CorePart core;
	XmPrimitivePart primitive;
	XmScrollBarPart scrollBar;
	MtfScrollBarPart mtfScrollBarPart;

	static MtfScrollBarClassRec classRecord;
	static XmOffsetPtr offsets;
	static XtActionsRec action[];
	static char translations[];

	// Actions that map to Zinc functionality.
	static void call_default(MtfScrollBar *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->RootObject()->Event(L_SELECT); }
	static void classInitialize();
	static void drag_drop(MtfScrollBar *mtfObject, XEvent *xEvent, String *params, Cardinal *nparams);
	static void enter(MtfScrollBar *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void expose(MtfScrollBar *mtfObject, XEvent *xEvent, Region xRegion);
	static void focus_in(MtfScrollBar *mtfObject, XEvent *xEvent, String *params, Cardinal *nparams);
	static void help(MtfScrollBar *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_HELP); }
	static void leave(MtfScrollBar *mtfObject, XEvent *xEvent, String *, Cardinal *);

	// General purpose functions.
	static ZafScrollBar *GetZincObject(MtfScrollBar *mtfObject)
		{ return ((ZafScrollBar *)mtfObject->primitive.user_data); }
	static MtfScrollBar *GetMotifWidget(OSWindowID screenID)
		{ return ((MtfScrollBar *)screenID); }
};

#endif
