#ifndef __WList__H
#define __WList__H

#include "WimpLib:std.h"
#include "WimpLib:WListCore.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef const char* (*FWList_GetItemText)(void* pHandle, const void* pItemData);

typedef struct WList
{
	WListCore          m_Core;
	FWList_GetItemText m_pGetItemText;
	void*              m_pHandle;
} WList;

void throw_WList_WList(WList*, unsigned int flags, CTemplate* t, void* pHandle, FWList_GetItemText pGetItemText);
void throw_WList_WListEx(WList*, unsigned int flags, CTemplate* t, void* pHandle, WListCore_FWList* pFWList);
void WList_NotWList(WList*);

#define WList_Count(pList) WListCore_Count(&(pList)->m_Core)
#define throw_WList_Insert(pList, ...) throw_WListCore_Insert(&(pList)->m_Core, __VA_ARGS__)
#define WList_Get(pList, ...) WListCore_Get(&(pList)->m_Core, __VA_ARGS__)
#define WList_Set(pList, ...) WListCore_Set(&(pList)->m_Core, __VA_ARGS__)
#define WList_Find(pList, ...) WListCore_Find(&(pList)->m_Core, __VA_ARGS__)
#define WList_Del(pList, ...) WListCore_Del(&(pList)->m_Core, __VA_ARGS__)
#define WList_Clear(pList) WListCore_Clear(&(pList)->m_Core)

#define WList_GetWindow(pList) WListCore_GetWindow(&(pList)->m_Core)
#define WList_SubMenu(pList) WListCore_SubMenu(&(pList)->m_Core)
#define WList_Popup(pList, ...) WListCore_Popup(&(pList)->m_Core, __VA_ARGS__)

#define WList_RowColsToPixels(pList, ...) WListCore_RowColsToPixels(&(pList)->m_Core, __VA_ARGS__)
#define WList_PixelsToRowCols(pList, ...) WListCore_PixelsToRowCols(&(pList)->m_Core, __VA_ARGS__)
#define WList_ItemRect(pList, ...) WListCore_ItemRect(&(pList)->m_Core, __VA_ARGS__)

#define WList_SetExtent(pList) WListCore_SetExtent(&(pList)->m_Core)
#define WList_ForceRedraw(pList, ...) WListCore_ForceRedraw(&(pList)->m_Core, __VA_ARGS__)
#define WList_AllowRefresh(pList, ...) WListCore_AllowRefresh(&(pList)->m_Core, __VA_ARGS__)
#define WList_Refresh(pList, ...) WListCore_Refresh(&(pList)->m_Core, __VA_ARGS__)
#define WList_RecalcSize(pList) WListCore_RecalcSize(&(pList)->m_Core)
#define WList_ShowItem(pList, ...) WListCore_ShowItem(&(pList)->m_Core, __VA_ARGS__)

#define WList_GetFocus(pList) WListCore_GetFocus(&(pList)->m_Core)
#define WList_SetFocus(pList, ...) WListCore_SetFocus(&(pList)->m_Core, __VA_ARGS__)
#define WList_MoveFocus(pList, ...) WListCore_MoveFocus(&(pList)->m_Core, __VA_ARGS__)

#define WList_PlotGhostCaret(pList, ...) WListCore_PlotGhostCaret(&(pList)->m_Core, __VA_ARGS__)
#define WList_ShowGhostCaret(pList, ...) WListCore_ShowGhostCaret(&(pList)->m_Core, __VA_ARGS__)
#define WList_HideGhostCaret(pList) WListCore_HideGhostCaret(&(pList)->m_Core)
#define WList_GetGhostCaretIndex(pList, ...) WListCore_GetGhostCaretIndex(&(pList)->m_Core, __VA_ARGS__);

#define WList_GetFlags(pList) WListCore_GetFlags(&(pList)->m_Core)
#define WList_SetFlags(pList, ...) WListCore_SetFlags(&(pList)->m_Core, __VA_ARGS__)
#define WList_SetParent(pList, ...) WListCore_SetParent(&(pList)->m_Core, __VA_ARGS__)
#define throw_WList_SetPane(pList, ...) throw_WListCore_SetPane(&(pList)->m_Core, __VA_ARGS__)

#define WList_GetItemState(pList, ...) WListCore_GetItemState(&(pList)->m_Core, __VA_ARGS__)
#define WList_SetItemState(pList, ...) WListCore_SetItemState(&(pList)->m_Core, __VA_ARGS__)
#define WList_InvertItemState(pList, ...) WListCore_InvertItemState(&(pList)->m_Core, __VA_ARGS__)
#define WList_SetItemsState(pList, ...) WListCore_SetItemsState(&(pList)->m_Core, __VA_ARGS__)
#define WList_FindItemState(pList, ...) WListCore_FindItemState(&(pList)->m_Core, __VA_ARGS__)

#define WList_ItemFromScreenPt(pList, ...) WListCore_ItemFromScreenPt(&(pList)->m_Core, __VA_ARGS__)
#define WList_ItemAreaFromScreenPt(pList, ...) WListCore_ItemAreaFromScreenPt(&(pList)->m_Core, __VA_ARGS__)
#define WList_ItemArea(pList, ...) WListCore_ItemArea(&(pList)->m_Core, __VA_ARGS__)

#define WList_ItemGetSizes(pList, ...) WListCore_ItemGetSizes(&(pList)->m_Core, __VA_ARGS__)
#define WList_GetSizes(pList) WListCore_GetSizes(&(pList)->m_Core)

#ifdef __cplusplus
}
#endif

#endif
