//================================================================================
// Xe UI toolkit
//
// Shell Widgets public header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2023-Aug-18 14:30:03
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XeShell_h
#define _XeShell_h

#include <Xe/Xe.h>

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif

// Window manager hints flags
//

// Bit definitions for XeWMHints.flags. Compatible with MWM.
//
#define XeWMHintsFUNCTIONS    0x01
#define XeWMHintsDECORATIONS  0x02
#define XeWMHintsINPUT_MODE   0x04
#define XeWMHintsSTATUS       0x08

// Bit definitions for wmHints.functions
//
#define XeWMFuncALL          (1L << 0)
#define XeWMFuncRESIZE       (1L << 1)
#define XeWMFuncMOVE         (1L << 2)
#define XeWMFuncMINIMIZE     (1L << 3)
#define XeWMFuncMAXIMIZE     (1L << 4)
#define XeWMFuncCLOSE        (1L << 5)
#define XeWMFuncQUIT_APP     (1L << 23)  // For 4Dwm

// Bit definitions for wmHints.decorations
//
#define XeWMDecorALL       (1L << 0)
#define XeWMDecorBORDER    (1L << 1)
#define XeWMDecorRESIZEH   (1L << 2)
#define XeWMDecorTITLE     (1L << 3)
#define XeWMDecorMENU      (1L << 4)
#define XeWMDecorMINIMIZE  (1L << 5)
#define XeWMDecorMAXIMIZE  (1L << 6)

#ifdef sgi
#define XeWMDecorCLOSE     XeWMDecorMENU  // On SGI, we need to enable the menu in the window decorations, to have a close button
#else
#define XeWMDecorCLOSE     0
#endif

// Values for XeWMHints.input_mode
#define XeWMInputMODELESS                   0
#define XeWMInputPRIMARY_APPLICATION_MODAL  1
#define XeWMInputSYSTEM_MODAL               2
#define XeWMInputFULL_APPLICATION_MODAL     3

// Values for XeWMHints.input_mode
#define XeWMInputMODELESS                   0
#define XeWMInputPRIMARY_APPLICATION_MODAL  1
#define XeWMInputSYSTEM_MODAL               2
#define XeWMInputFULL_APPLICATION_MODAL     3

// Bit definitions for XeWMHints.status
#define XeWM_TEAROFF_WINDOW  (1L << 0)


// Number of elements of size 32 in _MWM_HINTS
#define XePROP_WM_HINTS_ELEMENTS       5


enum
{
	XeNOT_DISPLAYED = 0,
	XeICONIZED,
	XeDISPLAYED
};


enum
{
	XeSTACKING_ANY = 0,
	XeSTACKING_PRIORITY1,
	XeSTACKING_PRIORITY2,
	XeSTACKING_PRIORITY3
};


typedef struct _XeShellClassRec*             XeShellWidgetClass;
typedef struct _XeOverrideShellClassRec*     XeOverrideShellWidgetClass;
typedef struct _XeWMShellClass*              XeWMShellWidgetClass;
typedef struct _VendorShellClassRec*         XeVendorShellWidgetClass;
typedef struct _XeTransientShellClass*       XeTransientShellWidgetClass;
typedef struct _XeTopLevelShellClass*        XeTopLevelShellWidgetClass;
typedef struct _XeApplicationShellClassRec*  XeApplicationShellWidgetClass;

extern XeWidgetClass*  XeShellWidget_class;
extern XeWidgetClass*  XeOverrideShellWidget_class;
extern XeWidgetClass*  XeWMShellWidget_class;
extern XeWidgetClass*  XeVendorShellWidget_class;
extern XeWidgetClass*  XeTransientShellWidget_class;
extern XeWidgetClass*  XeTopLevelShellWidget_class;
extern XeWidgetClass*  XeApplicationShellWidget_class;


extern XeWidget  XeShell_New(XeApp PApp, const char* PName, XeWidget PParentW,  const EArg* PArgList, const int PArgN);
extern XeWidget  XeAppShell_New(XeApp PApp, const char* PAppName, const char* PAppClass, XeWidgetClass* PWidgetClass, XeDisplay* PDisplay,  EArg* PArgs, Cardinal PNArgs);
extern void      XeShellDisplay_Iconified(XeWidget PShellW);

extern XeWidget  XePopupShell_New(const char* PName, XeWidgetClass* PWidgetClass, XeWidget PParentW,  EArg* PArgs, Cardinal PNArgs);
extern XeWidget  XePopupShell_NewVa(const char* PName, XeWidgetClass* PWidgetClass, XeWidget PParentW, ...);

extern void    XeShell_CenterToWidget(XeWidget PShellW, XeWidget PCenterToWidget);

extern void    XeShell_Realize(XeWidget PShellW);
extern void    XeShell_Display(XeWidget PShellW);
extern void    XeShell_Raise(XeWidget PShellW);
extern void    XeShell_Minimize(XeWidget PShellW);
extern int     XeShell_DisplayStatus(XeWidget PShellW);

extern void    XeShell_Move(XeWidget PShellW,  const int PX, const int PY);
extern void    XeShell_Resize(XeWidget PShellW,  const int PSizeX, const int PSizeY);
extern void    XeShell_Configure(XeWidget PShellW,  const int PX, const int PY,  const int PSizeX, const int PSizeY);
extern EBool   XeShell_GetGeometry(XeWidget PShellW,  int* PXRet, int* PYRet,  int* PSizeXRet, int* PSizeYRet);
extern void    XeShell_SetStackingPriority(XeWidget PW, const int PPri);

extern int     XeShell_FullScreenMode(XeWidget PW, const EBool PFullScreenMode);

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}  // Close scope of 'extern "C"' declaration
#endif


#endif  // _XeShell_h
