#ifndef _SGIAPIP_H
#define _SGIAPIP_H

#if defined(_SGIMOTIF) && defined(_SGIMOTIFAPI)

#ifdef __cplusplus
extern "C" {
#endif

/* DrawP.h */
extern void ParentShaderInvertedFrame(Widget w,Display* dpy,Drawable d,
				shaderptr shader, Position x,Position y,
				Dimension width,Dimension height,
				int* state_array,
				int shadow_thickness,
				unsigned int shadow_style);

extern void DrawCascadeShadows(Widget w,Display* dpy,Drawable d,
			       shaderptr shader, Position x,Position y,
			       Dimension width,Dimension height,
			       int* state_array,
			       int shadow_thickness,
			       unsigned int shadow_style);

extern void TwoShaderShadows(Widget w,Display* dpy,Drawable d,
			     shaderptr shader, Position x,Position y,
			     Dimension width,Dimension height,
			     int* state_array,
			     int shadow_thickness,
			     unsigned int shadow_style);

extern void RenderShadowsDefault(Widget w,Display* dpy,Drawable d,
				 shaderptr shader, Position x,Position y,
				 Dimension width,Dimension height,
				 int* state_array,
				 int shadow_thickness,
				 unsigned int shadow_style);

extern void _RenderShadowsDefault(Widget w,Display* dpy,Drawable d,
				 shaderptr shader, Position x,Position y,
				 Dimension width,Dimension height,
				 int* state_array,
				 int shadow_thickness,
				 unsigned int shadow_style);

extern void DrawDitch(Widget w,Display* dpy,Drawable d,
		      shaderptr shader, Position x,Position y,
		      Dimension width,Dimension height,
		      int* state_array,
		      int shadow_thickness,
		      unsigned int shadow_style);


extern void _XmGetBackgroundFromParent(Widget wid,
				       int offset, XrmValue* value);


extern void DrawArrowFace(Widget wid,GC gc,
			  Position xAbs, Position yAbs,
			  Dimension width, Dimension height,
			  unsigned int direction);

extern void _SGI_RenderShadows(Widget w ,Display* dpy,Drawable d,
			       shaderptr shader,Position x, Position y,
			       Dimension width,Dimension height,
			       int* state_array,
			       int shadow_thickness,
			       unsigned int shadow_style);

void SgDrawPolygonShadow(Widget w,
		      shaderptr shader,
		      int* state_array,
		      XPoint *points,
		      int n_points,
		      Dimension shadowThickness,
		      unsigned char shadowType);

/* DrTog.c */
extern void _SgDrawDiamond(
		Widget w, 
		Display* dpy, 
		Drawable d,
		shaderptr shader, 
		Position x, 
		Position y,
		Dimension width, 
		Dimension height, 
		int* state_array);

extern void _SgDrawLamp(
		Widget w, 
		Display* dpy, 
		Drawable d,
		shaderptr shader, 
		Position x, 
		Position y,
		Dimension width, 
		Dimension height, 
		int* state_array);

extern void _SgDrawCircle(
		Widget w, 
		Display* dpy, 
		Drawable d,
		shaderptr shader, 
		Position x, 
		Position y,
		Dimension width, 
		Dimension height, 
		int* state_array,
		Dimension shadow_thickness,
		int margin);

extern void _SgDrawBox(Widget w, 
		Display* dpy, 
		Drawable d, 
		shaderptr shader,
		Position x, 
		Position y, 
		Dimension width, 
		Dimension height, 
		int* state_array,
		Boolean armed);





/* XmP.h */

typedef void (*SgRenderShadowsProc)(Widget,Display*,Drawable, shaderptr,Position,Position,Dimension,Dimension, int*,int,unsigned int);

typedef void (*SgRenderIndicatorProc)(Widget,Display*,Drawable, shaderptr,Position,Position,Dimension,Dimension, int*);

#define primitiveVisualStates 5
#define primitiveNumSegments 10

#define quietState 0
#define locatedState 2
#define locAndSelState 4
#define SelState 3
#define disabledState 1
#define indentedFrame 0
#define raisedFrame 2
#define ditchFrame 3

extern int backgroundShade;
extern int darkScheme;
extern int SGImode;

#ifdef SPEEDSHOP_CALIPER_SUPPORT
extern void * SGIenableSpeedshopCaliperSupport;
#endif

typedef int (*visual_state_array)[primitiveVisualStates][primitiveNumSegments];

extern int _sgArrowData[primitiveVisualStates][primitiveNumSegments];
extern int _sgArrowGData[primitiveVisualStates][primitiveNumSegments];
extern int _sgMenuBarCascadeData[primitiveVisualStates][primitiveNumSegments];
extern int _sgPulldownMenuCascadeData[primitiveVisualStates][primitiveNumSegments];
extern int _sgOptionMenuCascadeData[primitiveVisualStates][primitiveNumSegments]; 
extern int _sgCascadeData[primitiveVisualStates][primitiveNumSegments];
extern int _sgGadgetData[primitiveVisualStates][primitiveNumSegments];
extern int _sgMenuData[primitiveVisualStates][primitiveNumSegments];
extern int _sgManagerData[primitiveVisualStates][primitiveNumSegments];
extern int _sgPrimitiveData[primitiveVisualStates][primitiveNumSegments];
extern int _sgTroughData[primitiveVisualStates][primitiveNumSegments];
extern int _sgThumbData[primitiveVisualStates][primitiveNumSegments];
extern int _sgArrData[primitiveVisualStates][primitiveNumSegments];
extern int _sgToggleData[primitiveVisualStates][primitiveNumSegments];
extern int _sgIndicatorData[primitiveVisualStates][primitiveNumSegments];
extern int _sgRadioData[primitiveVisualStates][primitiveNumSegments];

#define SgInheritShadowRenderer ((SgRenderShadowsProc)_XtInherit)
#define SgInheritIndicatorProc ((SgRenderIndicatorProc)_XtInherit)
#define SgInheritRenderer ((XtWidgetProc) _XtInherit)
#define SgInheritStateArray (visual_state_array)NULL

/* Obsolete Symbols */

#ifdef _SGIMOTIF_OBSOLETE_API

#define XmRenderShadowsProc SgRenderShadowsProc
#define XmRenderIndicatorProc SgRenderIndicatorProc

#define XmInheritShadowRenderer SgInheritShadowRenderer
#define XmInheritIndicatorProc SgInheritIndicatorProc
#define XmInheritRenderer SgInheritRenderer
#define XmInheritStateArray SgInheritStateArray

#endif /* _SGIMOTIF_OBSOLETE_API */


#ifdef __cplusplus
}
#endif

#endif /* _SGIMOTIF */
#endif
