//===============================================================================
// Xe UI toolkit
//
// XePushButton
//  Private header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-May-18 16:48:41
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XePushButtonP_h
#define _XePushButtonP_h

#include <Xe/LabelP.h>
#include <Xe/MenuButtonP.h>
#include <Xe/PushButton.h>

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

//================================
// Class definition
//================================

#define XePushButtonClassCore\
	XeLabelClassCore

typedef struct _XePushButtonClassRec
{
	XePushButtonClassCore;
} XePushButtonClassRec;

extern XePushButtonClassRec  _XePushButton_class;


//================================
// Instance definition
//================================
// Instance part
//================================
typedef struct
{
// Resources
	XeColor         ArmColor;

	int             ModifiedImageSizeX, ModifiedImageSizeY;  // Image is resizable and a new size was computed

	EpImage*        ArmImage;
	EpImage*        ActiveImage;

	XeCallbackList  ArmCallback, DisarmCallback, ActivateCallback;
	int             DefaultButtonShadowThickness;
	XeString        AcceleratorText;
	char            Mnemonic;
	EBool           ShowAsDefault, CreateOptionsButton;

// Private variables
	int             SubButtonSizeX;
	int             DefShadowSpacing;
	uint8_t         DragMode;
	uint16_t        State;   // XeACTIVE | XeARMED | XeSUB_ARMED
} XePushButtonPart;


//================================
// Instance record
//================================
typedef struct _XePushButtonRec
{
	XeWidgetCore;
	XeBasePart        Base;
	XePrimitivePart   Primitive;
	XeLabelPart       Label;
	XeMenuButtonPart  MenuButton;
	XePushButtonPart  PushButton;
} XePushButtonRec;


//--------------------------------------------------------------------------------------------------------
// "Deferred" PushButton, added from plugins etc. e.g. before the app's top-level UI is created
//--------------------------------------------------------------------------------------------------------

//-----------------------------
// Class
//-----------------------------
typedef struct
{
	XeDWidgetClassCore;
// PushButtonClassRec is empty
} _XeDPushButtonClass;


//-----------------------------
// Instance
//-----------------------------
typedef struct
{
	EguiCallbackList  ActivateCallback;
	XeCallbackFunc    Callback;             // EFIXME For BEd only temporarily
	EPointer          ClientData;
	char              Mnemonic;
	char*             Accel;char*  AccelText;char*  ToolTip;
	EpImage*          LabelImage;           // Normal Image
	EpImage*          ActiveImage;          // Image used when the (mouse) pointer is above the PushButton
	EpImage*          ArmImage;             // Image used when the PushButton is armed
	EBool             CreateOptionsButton;  // For PushButtons in menus. A little button on the right for options related to the function
	int16_t           ImageBlendMode;
} _XeDPushButtonPart;


typedef struct
{
	XeDeferredWidget_Core;
	_XeDPushButtonPart  PushButton;
} XeDPushButton;



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

#endif // _XePushButtonP_h
