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

#if !defined(M_NOTEBK_HPP)
#define M_NOTEBK_HPP
#include <z_button.hpp>
#include <z_notebk.hpp>
#include "m_utils.hpp"

extern "C"
{
#include _keysymdef_
#include _DrawP_
#include _DrawnBP_
#include _TranslateP_
#include _ManagerP_
}

// ----- MtfNotebook widget definition --------------------------------------

#define MtfNotebook OSNotebook
#define MtfNotebookIndex (XmManagerIndex + 1)

struct MtfNotebookClassPart
{
	XtPointer reserved;
};

struct MtfNotebookClassRec
{
	CoreClassPart coreClassPart;
	CompositeClassPart compositeClassPart;
	ConstraintClassPart constraintClassPart;
	XmManagerClassPart managerClassPart;
	MtfNotebookClassPart mtfNotebookClassPart;
};

struct MtfNotebookPart
{
};

struct MtfNotebook
{
	CorePart core;
	CompositePart composite;
	ConstraintPart constraint;
	XmManagerPart manager;
	MtfNotebookPart mtfNotebookPart;

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

	// Actions that map to Zinc functionality.
	static void activate(MtfNotebook *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void arm(MtfNotebook *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void call_default(MtfNotebook *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->RootObject()->Event(L_SELECT); }
	static void classInitialize();
	static void drag_drop(MtfNotebook *mtfObject, XEvent *xEvent, String *params, Cardinal *nparams);
	static void enter(MtfNotebook *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void expose(MtfNotebook *mtfObject, XEvent *xEvent, Region xRegion);
	static XtGeometryResult gmgr(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply);
	static void help(MtfNotebook *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_HELP); }
	static void leave(MtfNotebook *mtfObject, XEvent *xEvent, String *, Cardinal *);
	static void next_page(MtfNotebook *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_PGUP); }
	static void previous_page(MtfNotebook *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_PGDN); }
	static void resize(MtfNotebook *mtfObject)
		{ GetZincObject(mtfObject)->Event(N_SIZE); }

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

#endif

