//================================================================
// EQUINOX-3D
//
// - types
//
// AUTHOR:  Gabor Nagy
// DATE:    2025-Feb-18 18:03:47
//
// Copyright (C) 1996-2026 By Gabor Nagy. All rights reserved.
//================================================================
#include <E3D/IO.h>


// File content types
//
#define EqxMODEL      0x00000001
#define EqxHIERARCHY  0x00000002
#define EqxSCENE      0x00000004


// EQUINOX-3D built-in function codes
//
enum
{
	EqxCR_NEW_WINDOW,
	EqxCR_NEW_SCENE,
	EqxCR_OPEN_FILE,
	EqxCR_SAVE_MODEL_OR_HIERARCHY,
	EqxCR_QUIT,
	EqxCR_ABOUT,
	EqxCR_TOGGLE_3DWINDOW_HEADERS,
	EqxCR_TOGGLE_MENUBAR,
	EqxCR_TOGGLE_TRANSFORM_PANEL,
	EqxCR_TOGGLE_TOOL_PANEL,
	EqxCR_TOGGLE_STATUS_PANEL,
	EqxCR_TOGGLE_TIME_PANEL,
	EqxCR_EDIT_PREFERENCES,
	EqxCR_SAVE_PREFERENCES,
	EqxCR_UNDO,
	EqxCR_REDO,
	EqxCR_UNDO_SETTINGS,
	EqxCR_PERFORMANCE,
	EqxCR_RESET_MEMORY_TRACKER,
	EqxCR_SHOW_UNFREED_MEMORY,
	EqxCR_SAVE_WINDOW,
	EqxCR_SAVE_SHADOWMAP
};


typedef struct
{
// Resources
//
	int8_t  BuildMap, ShowMap;
	float   SamplingRadius;
} E3dPhotonMapParams;


typedef struct
{
	char*         ModelFilterList;
	E3dIOModule*  ModelSaveFormat;
	E3dIOModule*  HierarchySaveFormat;
	E3dIOModule*  SceneSaveFormat;

	int           WindowSize[2];

	int           WelcomePicTime_ms;

// User interface
//
#ifdef __APPLE__
	EBool         CocoaMenuBar;  // Create native menubar on Mac OS
#else
	EBool         OldMenuShadows;
#endif
	EBool         SelectAndFocusOnName;

	EBool         MenuBarOn,
	              ModelPanelOn, PicturePanelOn;
	EBool         KeepFileOpenDialogAfterOK;
	EBool         AskBeforeExit,
	              SelectHierarchyAfterLoading,
	              ReadSessionFromScene, DeleteAllBeforeReadingScene,
	              ModelFormatFromExtension,
	              HierarchyFormatFromExtension,
	              SceneFormatFromExtension;

	char*         RenderToFileName;
	char*         RendererName;
	int32_t       NSubPixels,         // Anti-aliasing
	              NumOfPathSamples, MaxIndirectRayDepth;
	int8_t        DirectLight;
	EBool         PrintCLIHelp, Minimize, Quit;

	int32_t       PhotonBounces;
	int64_t       NumOfPhotons;
	E3dPhotonMapParams   Caustics, Global;

	EBool         DefaultBRDFSampling_Force;
	int8_t        DefaultBRDFSampling_IS;
} EqxPrefs;


//----------------------------------------
// Plugins.c
//----------------------------------------
extern void  E3dp_SavePluginSettings(void);


//----------------------------------------
// Prefs.c
//----------------------------------------
extern void  E3dp_PreferencesInit(const int PArgc, const char* const* PArgv);


//----------------------------------------
// menu.c
//----------------------------------------
extern void  Eqx_CreateMenu(void);


//----------------------------------------
// GUI.c
//----------------------------------------
extern int  Eqx_GUIItemAddFunction(XeDWidget PItem);


//----------------------------------------
// menuf.c
//----------------------------------------
extern E3dPanel*  Eqx_3DPanel;

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

extern int    Eqx_Read3DFile(const char* PFileName, int* PContentTypePtr, const EBool PDeleteAllBeforeReadingScene, const EBool PReadSessionFromScene);
extern int    Eqx_Set3DPanel(const EBool PSwitch);
