//===============================================================================
// Xe UI toolkit
//
// XeMatrix
//  Public header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2026-Jun-11 17:10:05
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//===============================================================================
#ifndef _Xe_ColumnList_h
#define _Xe_ColumnList_h

#include <Xe/Manager.h>

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


#define XeColumnListEntryCore\
	EIndex    OrigIndex

typedef struct
{
	XeColumnListEntryCore;
} XeColumnListEntry;


#define XeColumnListEntryGUICore

typedef struct
{
	XeColumnListEntryGUICore;
} XeColumnListEntryGUI;


typedef struct
{
	XeWidget        HeaderW;
	EBool           ResizableX;
	XeCallbackFunc  CallbackFunc;
} XeColumn, *XeColumnPtr;
EList_t(XeColumnPtr);

typedef struct XeColumnList_S  XeColumnList;

typedef void (*XeColumnListUpdateFunc)(XeColumnList* PInputList, const EIndex PNEntries, EPointer PCallbackClientData);

#define XeColumnListCore\
	XeWidget  ScrolledWindowW, VScrollbarW, ClipWindowW, ListMatrixW;\
	EList_s(, XeColumnPtr, Columns);\
\
	int16_t   SortByColumn;\
	int8_t    SortDirection;\
\
	EListA(, XeColumnListEntry*, Entries);\
	XeColumnListEntry**  SortedEntries;\
	EListA(, XeColumnListEntryGUI*, EntriesGUI);\
\
	XeColumnListUpdateFunc  UpdateFunc;EPointer  UpdateFuncClientData

struct XeColumnList_S
{
	XeColumnListCore;
};


extern void  XeColumnList_Init(XeColumnList* PList);
extern void  XeColumnList_Create(XeColumnList* PInputList, XeWidget PParentW,  XeColumnListUpdateFunc PUpdateFunc, EPointer PUpdateFuncClientData,  ...);
extern void  XeColumnList_FreeContents(XeColumnList* PList);
extern void  XeColumnList_UpdateHeader(XeColumnList* PList);


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

#endif // _Xe_ColumnList_h
