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

#if !defined(M_POPUP_HPP)
#define M_POPUP_HPP
#include <z_popup.hpp>
#include "m_utils.hpp"

extern "C"
{
#include _MenuShell_
#include _RowColumnP_
#include _TranslateP_
#include _Separator_
#include _CascadeBP_
#include _ToggleBP_
}

// ----- MtfCascadeItem & MtfToggleItem widget definitions ------------------

#define MtfCascadeItemIndex (XmCascadeButtonIndex + 1)

struct MtfCascadeItemClassPart
{
	XtPointer reserved;
};

struct MtfCascadeItemClassRec
{
	CoreClassPart coreClassPart;
	XmPrimitiveClassPart primitiveClassPart;
	XmLabelClassPart labelClassPart;
	XmCascadeButtonClassPart cascadeClassPart;
	MtfCascadeItemClassPart mtfCascadeItemClassPart;
};

struct MtfCascadeItemPart
{
};

struct MtfCascadeItem
{
	CorePart core;
	XmPrimitivePart primitive;
	XmLabelPart label;
	XmCascadeButtonPart cascade;
	MtfCascadeItemPart mtfCascadeItemPart;

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

	// Actions that map to Zinc functionality.
	static void activate(MtfCascadeItem *, ZafPopUpItem *object, XmAnyCallbackStruct *callback);
	static void classInitialize();
	static void expose(MtfCascadeItem *mtfObject, XEvent *xEvent, Region xRegion);
	static void help(MtfCascadeItem *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_HELP); }
	static void highlight(MtfCascadeItem *mtfObject);
	static void unhighlight(MtfCascadeItem *mtfObject);

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


#define MtfToggleItemIndex (XmToggleButtonIndex + 1)

struct MtfToggleItemClassPart
{
	XtPointer reserved;
};

struct MtfToggleItemClassRec
{
	CoreClassPart coreClassPart;
	XmPrimitiveClassPart primitiveClassPart;
	XmLabelClassPart labelClassPart;
	XmToggleButtonClassPart toggleClassPart;
	MtfToggleItemClassPart mtfToggleItemClassPart;
};

struct MtfToggleItemPart
{
};

struct MtfToggleItem
{
	CorePart core;
	XmPrimitivePart primitive;
	XmLabelPart label;
	XmToggleButtonPart toggle;
	MtfToggleItemPart mtfToggleItemPart;

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

	// Actions that map to Zinc functionality.
	static void changed(MtfToggleItem *, ZafPopUpItem *object, XmToggleButtonCallbackStruct *callback);
	static void classInitialize();
	static void expose(MtfToggleItem *mtfObject, XEvent *xEvent, Region xRegion);
	static void help(MtfToggleItem *mtfObject, XEvent *, String *, Cardinal *)
		{ GetZincObject(mtfObject)->Event(L_HELP); }
	static void highlight(MtfToggleItem *mtfObject);
	static void unhighlight(MtfToggleItem *mtfObject);

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

#endif
