//===============================================================================
// Xe UI toolkit
//
// XeScale
//  Public header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2025-Jun-17 02:34:41
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _XeScaleWidget_h
#define _XeScaleWidget_h

#include <Xe/Manager.h>

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

extern XeWidgetClass*             XeScaleWidget_class;
typedef struct _XeScaleClassRec*  XeScaleWidgetClass;
typedef struct _XeScaleRec*       XeScaleWidget;

#define  XeRulerLEVEL1   0x0001
#define  XeRulerLEVEL2   0x0002
#define  XeRulerLEVEL3   0x0004

typedef struct
{
	int    TopValue;
	Pixel  Color;
} XeThermometerRange;


typedef struct
{
	XeCallbackStructCore;

	XeValue   Value;int  Index;
	char      Decimals;
	EBool     ValueChanged;               // Activate callbacks may be called when the value did not change (e.g. the user pressed enter). This flag indicates whether the value changed.

	EBool     CallValueChangedCallbacks;  // Set to TRUE by Xe. Should be set to FALSE by app if the app doesn't want the ValueChanged callbacks to be called

// For DrawBackgroundCallback
//
	EpImage*  BackgroundImage;
	XeCoord2  ActiveAreaOrigin, ActiveAreaSize;
	int       SliderLengthInPixels;
} XeScaleCallbackStruct;


typedef struct
{
	XeValue  Value, Minimum, Maximum, ScaleMinimum, ScaleMaximum, ResetValue;
} XeValueAndRanges;

extern EBool	XeTextF;

extern void		XeScale_SetValue(XeWidget PWidget, const int PValue, const EBool PNotify);
extern int		XeScale_GetValue(XeWidget PWidget);
extern void		XeScale_SetValueAndRange(XeWidget PWidget, const int PValue,  const int PMinimum, const int PMaximum,  const EBool PNotify);
extern void		XeScale_SetValueAndRanges(XeWidget PWidget, const int PValue,  const int PMinimum, const int PMaximum,  const int PScaleMinimum, const int PScaleMaximum,  const EBool PNotify);

extern void		    XeScale_SetValue_i64(XeWidget PWidget, const long long PValue, const EBool PNotify);
extern long long	XeScale_GetValue_i64(XeWidget PWidget);
extern void		    XeScale_SetValueAndRange_i64(XeWidget PWidget, const long long PValue,  const long long PMinimum, const long long PMaximum,  const EBool PNotify);
extern void		    XeScale_SetValueAndRanges_i64(XeWidget PWidget, const long long PValue,  const long long PMinimum, const long long PMaximum,  const long long PScaleMinimum, const long long PScaleMaximum,  const EBool PNotify);

extern float		XeScale_SetValue_f32(XeWidget PWidget, const float PValue, const EBool PNotify);
extern float		XeScale_GetValue_f32(XeWidget PWidget);
extern void		  XeScale_SetValueAndRange_f32(XeWidget PWidget, const float PValue, const float PMinimum, const float PMaximum, const EBool PNotify);
extern void	  	XeScale_SetValueAndRanges_f32(XeWidget PWidget, const float PValue, const float PMinimum, const float PMaximum, const float PScaleMinimum, const float PScaleMaximum, const EBool PNotify);

extern double		XeScale_SetValue_f64(XeWidget PWidget, const double PValue, const EBool PNotify);
extern double		XeScale_GetValue_f64(XeWidget PWidget);
extern void		  XeScale_SetValueAndRange_f64(XeWidget PWidget, const double PValue, const double PMinimum, const double PMaximum, const EBool PNotify);
extern void	  	XeScale_SetValueAndRanges_f64(XeWidget PWidget, const double PValue, const double PMinimum, const double PMaximum, const double PScaleMinimum, const double PScaleMaximum, const EBool PNotify);

extern XeWidget		XeScale_New_i32(XeWidget PParentW, const char* PName, EArg* Args, int ArgCnt);
extern XeWidget		XeScale_New_i64(XeWidget PParentW, const char* PName, EArg* Args, int ArgCnt);

extern XeWidget   XeScale_New_f32(XeWidget PParentW, const char* PName,  EArg* Args, int ArgCnt);
extern XeWidget		XeScale_ManagedNew_f32(XeWidget PParentW, const char* PName, EArg* Args, int ArgCnt);

extern XeWidget		XeScale_New_f64(XeWidget PParentW, const char* PName, EArg* Args, int ArgCnt);

extern void     XeScale_SetIncrement_f32(XeWidget PW,  const float PIncrement);
extern void     XeScale_SetIncrement_f64(XeWidget PW,  const double PIncrement);

extern void     XeScale_Redraw(XeWidget PW);

extern int      XeScale_SetLabelString(XeWidget PW, XeString PString, const EBool PRedraw);

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

#endif // _XeScaleWidget_h
