//================================================================
// E3D library
//
// - Renderer settings panel
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Jan-07 21:46:57
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//================================================================
#ifndef _E3D_RendererSettings_h
#define _E3D_RendererSettings_h

#include <Xe/DropDownPanel.h>
#include <Xe/FSBox.h>

#ifdef __cplusplus
extern "C" {
#endif


#define	E3dRendererSetupRENDERER_SELECTOR  0x00000001
#define	E3dRendererSetupFILE_INFO          0x00000002
#define	E3dRendererSetupIMAGE_RESOLUTION   0x00000004
#define	E3dRendererSetupAREA_LIGHTS        0x00000100

typedef struct
{
	XeWidget  GridXYBW, GridXZBW, GridYZBW, GridBW, AxisBW, Blank00W, Blank01W;
} E3dWindowGridSettingsPanel;

typedef struct
{
	XeWidget  MatrixW;
	void*     ResourcesGUI;
} E3dAntiAliasingPanel;

typedef struct
{
	XeWidget  RMatrixW;
	E3dWindowGridSettingsPanel  Grid;
	XeWidget  HiddenObjectWireframeW, SelectedObjectWireframeW, UnselectedObjectWireframeW,  SplinesW, FacesW,
	          MeshVerticesW,
	          SplineCVsW, SplineTangentsW, SplineNormalsW,
	          NodeOriginsW, SkeletonsW, BBoxesW;
} E3dShowGUI;

typedef struct
{
	XeWidget  MatrixW;
	XeWidget  RGBW, Spectral16W, Spectral32W;
	XeWidget  KeepHyperSpectralImageW;
} E3dColorModelGUI;

typedef struct
{
	XeInfoPanelCore;

	E3dpWindow*           E3DWindow;

	XeFileSelectionPanel  FileSelectionPanel;

	XeDrawer              OverlaysDrawer, StereoSettingsDrawer, ImageSettingsDrawer, BackgroundColorDrawer, ImageStatsDrawer,
	                      AdvancedOptionsDrawer;

	XeWidget              TopMatrixW,
	                      FileNameTextW,
	                      StartFrameW, EndFrameW, FrameStepW, SaveDepthImageW, SaveShadowImageW,
	                      SizeXW, SizeYW, KeepRatioW,
	                      StereoModeW, StereoEyeDistanceW, StereoEye2DOffsetW,
	                      LensCorrectionW, LensCorrectionRW, LensCorrectionBW, MagnificationW,
	                      OrientNormalW, OrientRotateRightW, OrientVisoR1W,
	                      ProgressiveLabelW, ProgressiveMatrixW, Progressive1x1W, Progressive2x2W, Progressive4x4W, Progressive8x8W, Progressive16x16W, Progressive32x32W,
	                      HDRImageBW, ToneMapMatrixW, AdaptiveExposureW, AutoExposureSpotMeteringBW, GainW, GammaW,
	                      BackgroundColorSwatchW;

	E3dShowGUI            Show;

	XeWidget              AntiAliasingLabelW;
	EList(, E3dAntiAliasingPanel, AntiAliasingMatrixWs);

	EcColorPanel*         ColorPanel;
	XeWidget              CaptureNoneW, CaptureAABufferW, CaptureFinalW;

	E3dRendererSet*       RendererSet;
	float                 ImageAspectRatio;
	EBool                 KeepRatio;

	EBool                 HasFileSelectionPanel;
	EBool                 ApplyChangesToAllWindows, CenterTo3DWindow;

	E3dColorModelGUI      ColorModelGUI;
} E3dRendererSettingsPanel;


//--------------------------------
// Panel/3DWindowSettings.c
//--------------------------------
extern E3dRendererSettingsPanel*  E3dp_RendererSettingsPanel;
extern E3dRendererSettingsPanel*  E3dpRendererSet_GetSettingsPanel(E3dRendererSet* PRendererSet);

extern E3dRendererSettingsPanel*  (*E3dpRendererSettingsPanel_CreateFunc)(XeWidget PTopMatrixW, E3dWindow* P3DWindow, E3dRendererSet* PRendererSet, const unsigned int PComponents);
extern void    (*E3dpRendererSettingsPanel_UpdateFunc)(E3dRendererSettingsPanel* PSettingsPanel, E3dWindow* P3DWindow, E3dRendererSet*);
extern void    (*E3dpRendererSettingsPanel_CloseFunc)(E3dRendererSettingsPanel* PSettingsPanel);
extern void    (*E3dpRendererSettingsPanel_FreeFunc)(E3dRendererSettingsPanel* PSettingsPanel);


//--------------------------------
// Plugins/Renderer/Settings.c
//--------------------------------
extern E3dRendererSettingsPanel*  E3dpRendererSettingsPanel_New(XeWidget PTopMatrixW, E3dWindow* P3DWindow, E3dRendererSet* PRendererSet, const unsigned int PComponents);
extern void    E3dpRendererSettingsPanel_Update(E3dRendererSettingsPanel* PSettingsPanel, E3dWindow* P3DWindow, E3dRendererSet* PRendererSet);
extern void    E3dpRendererSettingsPanel_Close(E3dRendererSettingsPanel* PSettingsPanel);
extern void    E3dpRendererSettingsPanel_Free(E3dRendererSettingsPanel* PSettingsPanel);


extern E3dAntiAliasingPanel*  E3dRendererSettingsPanel_GetAAPanel(E3dRendererSettingsPanel* PPanel, const EPointer PUserData);
extern void                   E3dRendererSettingsPanel_SwitchAAMatrix(E3dRendererSettingsPanel* PPanel, const EPointer PUserData);

extern XeWidget  E3dColorModelGUI_New(E3dColorModelGUI* PGUI,  XeWidget PParentW, XeCoordinate PSpacingLeft,  const int PColorModel, const int PNSpectralSamples,  const EBool PKeepHyperSpectralImage,  XeCallbackFunc PCallback, EPointer PClientData);
extern void      E3dColorModelGUI_Update(E3dColorModelGUI* PGUI,  const int PColorModel, const int PNSpectralSamples,  const EBool PKeepHyperSpectralImage);
extern void      _E3dDCB_ColorModel(XeWidget PW, EPointer PClientData, EPointer PCallData);

extern void  _E3dDCB_AntiAliasing_NAnisotropicTextureSamples(XeWidget PW, EPointer PClientData, EPointer PCallData);
extern void  _E3dDCB_NumOfSubFrames(XeWidget PW, EPointer PClientData, EPointer PCallData);

extern void  E3dGPURenderer_AntiAliasing_GUI(E3dRendererSettingsPanel* PPanel, XeComponentClassDrawer* PDrawer, E3dGPURenderer* PRenderer, const int PAction);

typedef struct
{
	XeWidget  RadiusW, StrengthW, PowerW;
} E3dBloomGUI;


extern void  E3dRenderer_BloomGUI(E3dRendererSettingsPanel* PPanel, E3dBloom* PBloom, E3dBloomGUI* PBloomGUI, XeWidget PParentW,  XeWidget* PTraverseWs, int* PTraverseN,  const int PAction);


#ifdef __cplusplus
}	// Close scope of 'extern "C"' declaration
#endif

#endif	// _E3D_RendererSettings_h
