//===============================================================================
// Xe UI toolkit
//
// XePushButton
//  Public header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Apr-25 21:21:41
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XePushButton_h
#define _XePushButton_h

#include <Xe/Label.h>

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

extern XeWidgetClass*                  XePushButton_class;
typedef struct _XePushButtonClassRec*  XePushButtonClass;
typedef struct _XePushButtonRec*       XePushButton;

typedef struct
{
	XeCallbackStructCore;

	int           ClickCount;
	unsigned int  State;    // Modifier keys
} XePushButtonCallbackStruct;

extern void  XePushButton_Arm(XeWidget PW);
extern void  XePushButton_ArmSubButton(XeWidget PW);
extern void  XePushButton_Disarm(XeWidget PW);


extern int  Xe_PushButtonMarginTop;

extern XeDWidgetClass  XeDPushButton_class;


#define XePushButton_AddImg3(pDst, pNameP, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip,  pCallback, pClientData) do\
{\
	pDst = XePushButton_AddImg(Xe_App, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip,  pCallback, pClientData,  _Image_##pNameP, _Image_##pNameP##_Active, _Image_##pNameP##_Armed,  EpSRC_plus_DSTxONE_MINUS_ALPHA);\
} while(0)

#define XePushButton_AddImg3_shadow(pApp, pDst, pNameP, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip,  pCallback, pClientData) do\
{\
	pDst = XePushButton_AddImg(pApp, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip, pCallback, pClientData,  _Image_##pNameP, _Image_##pNameP##_Active, _Image_##pNameP##_Armed,  EpSRC_plus_DSTxALPHA);\
} while(0)


//
// Original CImages are structs, targets are pointers
//
#define XePushButton_AddImg2_sp(pDst, pNameP, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip, pCallback, pClientData) do\
{\
	EpM_CreateIconStates2_sp(pNameP);\
	pDst = XePushButton_AddImg(Xe_App, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip, pCallback, pClientData,  _Image_##pNameP, _Image_##pNameP##_Active, _Image_##pNameP,  EpSRC_plus_DSTxONE_MINUS_ALPHA);\
} while(0)

#define XePushButton_AddImg3_sp(pDst, pNameP, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip, pCallback, pClientData) do\
{\
	EpM_CreateIconStates3_sp(pNameP);\
	pDst = XePushButton_AddImg(Xe_App, pLocation, pName, pMnemonic, pAccel, pAccelText, pCreateOptionsButton, pToolTip, pCallback, pClientData,  _Image_##pNameP, _Image_##pNameP##_Active, _Image_##pNameP##_Armed,  EpSRC_plus_DSTxONE_MINUS_ALPHA);\
} while(0)



extern ECoreClass  XePushButtonCallbackStruct_class[];

extern void  _XeCB_PushButton(XeWidget PW, EPointer PClientData, EPointer PCallData);

extern XeDWidget  XePushButton_Add(XeApp PApp, const char* PLocation, const char* PName, const char PMnemonic, const char* PAccel, const char* PAccelText, const EBool PCreateOptionsButton, const char* PToolTip,  XeCallbackFunc PCallback, EPointer PClientData);
extern XeDWidget  XePushButton_AddImg(XeApp PApp, const char* PLocation, const char* PName, const char PMnemonic, const char* PAccel, const char* PAccelText, const EBool PCreateOptionsButton, const char* PToolTip,  const XeCallbackFunc PCallback, const EPointer PClientData,  const EpImage* PLabelImage, const EpImage* PActiveImage, const EpImage* PArmImage,  const int PImageAlphaBlendMode);

extern void    XeStdSetPushButtonArgs(const int PMarginLeft, const int PMarginRight,  const int PMarginTop, const int PMarginBottom,  EArg* PArgs, int* PArgCnt);

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

#endif // _XePushButton_h
