// This may look like C code, but it is really -*- C++ -*-

/***********************************************************
Copyright 1991 by the Massachusetts Institute of Technology

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of M.I.T. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission.  M.I.T. makes no representations about the
suitability of this software for any purpose.  It is provided "as is"
without express or implied warranty.

Original idea : Charles Haynes - DEC
Author: Roman J. Budzianowski - Project Athena MIT

******************************************************************/

#ifndef _XtShell_h
#define _XtShell_h

//#include <xt++/Intrinsic.h>
//#include <xt++/Composite.h>

/***********************************************************************
 *
 * Shell Widget
 *
 ***********************************************************************/
/*
 * Shell specific atoms
 */
#define XtNiconName	"iconName"
#define XtCIconName	"IconName"
#define XtNiconPixmap	"iconPixmap"
#define XtCIconPixmap	"IconPixmap"
#define XtNiconWindow	"iconWindow"
#define XtCIconWindow	"IconWindow"
#define XtNiconMask	"iconMask"
#define XtCIconMask	"IconMask"
#define XtNwindowGroup	"windowGroup"
#define XtCWindowGroup	"WindowGroup"
 
#define XtNsaveUnder		"saveUnder"
#define XtCSaveUnder		"SaveUnder"
#define XtNtransient		"transient"
#define XtCTransient		"Transient"
#define XtNoverrideRedirect	"overrideRedirect"
#define XtCOverrideRedirect	"OverrideRedirect"

#define XtNallowShellResize	"allowShellResize"
#define XtCAllowShellResize	"AllowShellResize"
#define XtNcreatePopupChildProc	"createPopupChildProc"
#define XtCCreatePopupChildProc	"CreatePopupChildProc"

#define XtNtitle	"title"
#define XtCTitle	"Title"

/* 
 * The following are only used at creation and can not be changed via 
 * SetValues.
 */

#define XtNargc		"argc"
#define XtCArgc		"Argc"
#define XtNargv		"argv"
#define XtCArgv		"Argv"
#define XtNiconX	"iconX"
#define XtCIconX	"IconX"
#define XtNiconY	"iconY"
#define XtCIconY	"IconY"
#define XtNinput	"input"
#define XtCInput	"Input"
#define XtNiconic	"iconic"
#define XtCIconic	"Iconic"
#define XtNinitialState	"initialState"
#define XtCInitialState	"InitialState"
#define XtNgeometry	"geometry"
#define XtCGeometry	"Geometry"
#define XtNminWidth	"minWidth"
#define XtCMinWidth	"MinWidth"
#define XtNminHeight	"minHeight"
#define XtCMinHeight	"MinHeight"
#define XtNmaxWidth	"maxWidth"
#define XtCMaxWidth	"MaxWidth"
#define XtNmaxHeight	"maxHeight"
#define XtCMaxHeight	"MaxHeight"
#define XtNwidthInc	"widthInc"
#define XtCWidthInc	"WidthInc"
#define XtNheightInc	"heightInc"
#define XtCHeightInc	"HeightInc"
#define XtNminAspectY	"minAspectY"
#define XtCMinAspectY	"MinAspectY"
#define XtNmaxAspectY	"maxAspectY"
#define XtCMaxAspectY	"MaxAspectY"
#define XtNminAspectX		"minAspectX"
#define XtCMinAspectX		"MinAspectX"
#define XtNmaxAspectX		"maxAspectX"
#define XtCMaxAspectX		"MaxAspectX"
#define XtNwmTimeout		"wmTimeout"
#define XtCWmTimeout		"WmTimeout"
#define XtNwaitForWm		"waitforwm"
#define XtCWaitForWm		"Waitforwm"

/* *****
 * ***** Vendor.h is included later on; it needs fields defined in the first
 * ***** part of this header file
 * *****
 */

/***********************************************************************
 *
 * Shell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass shellWidgetClass;


typedef void (*XtCreatePopupChildProc)(  Widget	/* shell */ );

/* New fields for the shell widget */
class ShellWidget : public CompositeWidget {
 private:
	char       *geometry;
	XtCreatePopupChildProc	create_popup_child_proc;
	XtGrabKind	grab_kind;
	Boolean	    spring_loaded;
	Boolean	    popped_up;
	Boolean	    allow_shell_resize;
	Boolean	    client_specified;
	Boolean	    save_under;
	Boolean	    override_redirect;

	XtCallbackList popup_callback;
	XtCallbackList popdown_callback;
	Visual*     visual;
};

/***********************************************************************
 *
 * OverrideShell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass overrideShellWidgetClass;

/* No new fields for the override shell widget */

class OverrideShellWidget : public ShellWidget {int frabjous;};

/***********************************************************************
 *
 * WMShell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass wmShellWidgetClass;


struct _OldXSizeHints {	/* pre-R4 Xlib structure */
   long flags;
   int x, y;
   int width, height;
   int min_width, min_height;
   int max_width, max_height;
   int width_inc, height_inc;
   struct {
      int x;
      int y;
   } min_aspect, max_aspect;
};

/* New fields for the WM shell widget */
class WMShellWidget : public ShellWidget {
	char	   *title;
	int 	    wm_timeout;
	Boolean	    wait_for_wm;
	Boolean	    transient;
	Atom	    wm_configure_denied;
	Atom        wm_moved;
	_OldXSizeHints  size_hints;
	XWMHints    wm_hints;
	int         base_width;
	int         base_height;
	int         win_gravity;
	Atom        title_encoding;
      public:
	WMShellWidget(){}
};

#include <xt++/Vendor.h>

/***********************************************************************
 *
 * TransientShell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass transientShellWidgetClass;

/* New fields for the transient shell widget */
class TransientShellWidget : public VendorShellWidget 
{
   Widget transient_for;
 public:
//   TransientShellWidget() {}
   Constructors(TransientShell,transientShell){}
};

/***********************************************************************
 *
 * TopLevelShell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass topLevelShellWidgetClass;

/* New fields for the top level shell widget */
class TopLevelShellWidget : public VendorShellWidget {
	char	   *icon_name;
	Boolean	    iconic;
	Atom        icon_name_encoding;
      public:
	Constructors(TopLevelShell,topLevelShell) {}
};

/***********************************************************************
 *
 * ApplicationShell Widget Private Data
 *
 ***********************************************************************/

externalref WidgetClass applicationShellWidgetClass;

/* New fields for the application shell widget */
class ApplicationShellWidget : public TopLevelShellWidget {
	char *appshell_class;
	XrmClass xrm_class;
	int argc;
	char **argv;
      public:
	ApplicationShellWidget(String appName,
			String appClass,
			Display *dpy,
			ArgList args=NULL,
			Cardinal numArgs=0)
	  {
	     XtAppCreateShellP(
			       (caddr_t)this,
			       appName, appClass, 
			       applicationShellWidgetClass ,
			       dpy,
			       args,
			       numArgs
			       );
	  }

};

#endif _XtShell_h
/* DON'T ADD STUFF AFTER THIS #endif */
