//================================================================
// EQUINOX-3D plugin
//
// Type definitions for merging tools
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Apr-25 21:44:44
//
// Copyright (C) 1996-2026 By Gabor Nagy. All rights reserved.
//================================================================
#ifndef _E3D_MergeTypes_h
#define _E3D_MergeTypes_h


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

enum
{
	E3dMpgOFF = 1,
	E3dMpgON,
	E3dMpgLAYOUT, E3dMpgSPACING
};

enum
{
	E3dMpgNone,
	E3dMpgTileX,
	E3dMpgTileY,
	E3dMpgPack,
	E3dMpgSpacing,
};


typedef struct
{
	ECallbackStructCore;

	int  FieldOffset;
	union
	{
		int    i32;
		float  f32;
	} Value;
} E3dMergePolyGroupsCallbackStruct;

extern ECoreClass  E3dMergePolyGroupsCallbackStruct_class[];

typedef void (*E3dMergePolyGroupCallbackFunc)(EPointer PClientData, E3dMergePolyGroupsCallbackStruct* PCBS);

typedef struct
{
	XeWidget  ActiveW;
	XeWidget  LayoutST0RadioMatrixW, LayoutST0_NoneW, LayoutST0_TileXW, LayoutST0_TileYW, LayoutST0_PackW, LayoutST0_SpacingW, LayoutST0_ScalingLabelW,
	          LayoutST1RadioMatrixW, LayoutST1_NoneW, LayoutST1_TileXW, LayoutST1_TileYW, LayoutST1_PackW, LayoutST1_SpacingW, LayoutST1_ScalingLabelW,
	          LayoutUVRadioMatrixW,  LayoutUV_NoneW,  LayoutUV_TileXW,  LayoutUV_TileYW,  LayoutUV_PackW,  LayoutUV_SpacingW,  LayoutUV_ScalingLabelW;

	E3dMergePolyGroupCallbackFunc  CallbackFunc;
	EPointer                       CallbackClientData;
} E3dMergePolyGroupsGUI;


#define E3dMergePolyGroups_GUIOnOff(mMPG, mMPGGUI) do\
{\
	const EBool  lActive = mMPG->Active;\
	LChild->W = mMPGGUI->LayoutST0RadioMatrixW;LChild->Manage = lActive;LChild++;\
	LChild->W = mMPGGUI->LayoutST1RadioMatrixW;LChild->Manage = lActive;LChild++;\
	LChild->W = mMPGGUI->LayoutUVRadioMatrixW; LChild->Manage = lActive;LChild++;\
\
	LChild->W = mMPGGUI->LayoutST0_SpacingW;     LChild->Manage = mMPG->LayoutST0.Mode != 0;LChild++;\
	LChild->W = mMPGGUI->LayoutST0_ScalingLabelW;LChild->Manage = mMPG->LayoutST0.Mode == (E3dDoX|E3dDoY);LChild++;\
\
	LChild->W = mMPGGUI->LayoutST1_SpacingW;     LChild->Manage = mMPG->LayoutST1.Mode != 0;LChild++;\
	LChild->W = mMPGGUI->LayoutST1_ScalingLabelW;LChild->Manage = mMPG->LayoutST1.Mode == (E3dDoX|E3dDoY);LChild++;\
\
	LChild->W = mMPGGUI->LayoutUV_SpacingW;      LChild->Manage = mMPG->LayoutUV.Mode  != 0;LChild++;\
	LChild->W = mMPGGUI->LayoutUV_ScalingLabelW; LChild->Manage = mMPG->LayoutUV.Mode  == (E3dDoX|E3dDoY);LChild++;\
} while(0)

extern void  E3dMergePolyGroups_Init(E3dMergePolyGroups* PThis);
extern void  E3dMergePolyGroups_GUICreate(E3dMergePolyGroupsGUI* PGUI, XeWidget PParentW, const int PTopSpacing, const E3dMergePolyGroups* PSettings, E3dMergePolyGroupCallbackFunc PCallbackFunc, EPointer PCallbackClientData);
extern void  E3dMergePolyGroups_GUIUpdate(E3dMergePolyGroupsGUI* PGUI, const E3dMergePolyGroups* PSettings, const EBool PManageUnmanageWidgets);

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

#endif  // _E3D_MergeTypes_h
