From a21ad39a2c576cc29e899d45df17b56ca82b7269 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 17 Feb 2015 20:32:56 -0500 Subject: [PATCH] Split the public API of wintable into a file includethis.h for package ui. --- wintable/includethis.h | 53 ++++++++++++++++++++++++++++++++++++++++++ wintable/main.h | 49 +------------------------------------- 2 files changed, 54 insertions(+), 48 deletions(-) create mode 100644 wintable/includethis.h diff --git a/wintable/includethis.h b/wintable/includethis.h new file mode 100644 index 0000000..5f1bf93 --- /dev/null +++ b/wintable/includethis.h @@ -0,0 +1,53 @@ +// 17 february 2015 + +#define tableWindowClass L"gouitable" + +// start at WM_USER + 20 just in case for whatever reason we ever get the various dialog manager messages (see also http://blogs.msdn.com/b/oldnewthing/archive/2003/10/21/55384.aspx) +// each of these returns nothing unless otherwise indicated +enum { + // wParam - one of the type constants + // lParam - column name as a Unicode string + tableAddColumn = WM_USER + 20, + // wParam - 0 + // lParam - pointer to intptr_t containing new count + tableSetRowCount, +}; + +enum { + tableColumnText, + tableColumnImage, + tableColumnCheckbox, + nTableColumnTypes, +}; + +// notification codes +// note that these are positive; see http://blogs.msdn.com/b/oldnewthing/archive/2009/08/21/9877791.aspx +// each of these is of type tableNM +// all fields except data will always be set +enum { + // data parameter is always 0 + // for tableColumnText return should be WCHAR * + // for tableColumnImage return should be HBITMAP + // for tableColumnCheckbox return is nonzero for checked, zero for unchecked + tableNotificationGetCellData, + // data parameter is pointer, same as tableNotificationGetCellData + // not sent for checkboxes + // no return + tableNotificationFinishedWithCellData, + // data is zero + // no return + tableNotificationCellCheckboxToggled, +}; + +typedef struct tableNM tableNM; + +struct tableNM { + NMHDR nmhdr; + intptr_t row; + intptr_t column; + int columnType; + uintptr_t data; +}; + +// TODO have hInstance passed in +extern void initTable(void (*panicfunc)(const char *msg, DWORD lastError), BOOL (*WINAPI tme)(LPTRACKMOUSEEVENT)); diff --git a/wintable/main.h b/wintable/main.h index 02134d7..f5fc4c4 100644 --- a/wintable/main.h +++ b/wintable/main.h @@ -17,54 +17,7 @@ // - send standard notification codes // - seriously figure out how we're going to update everything about the table in one place -#define tableWindowClass L"gouitable" - -// start at WM_USER + 20 just in case for whatever reason we ever get the various dialog manager messages (see also http://blogs.msdn.com/b/oldnewthing/archive/2003/10/21/55384.aspx) -// each of these returns nothing unless otherwise indicated -enum { - // wParam - one of the type constants - // lParam - column name as a Unicode string - tableAddColumn = WM_USER + 20, - // wParam - 0 - // lParam - pointer to intptr_t containing new count - tableSetRowCount, -}; - -enum { - tableColumnText, - tableColumnImage, - tableColumnCheckbox, - nTableColumnTypes, -}; - -// notification codes -// note that these are positive; see http://blogs.msdn.com/b/oldnewthing/archive/2009/08/21/9877791.aspx -// each of these is of type tableNM -// all fields except data will always be set -enum { - // data parameter is always 0 - // for tableColumnText return should be WCHAR * - // for tableColumnImage return should be HBITMAP - // for tableColumnCheckbox return is nonzero for checked, zero for unchecked - tableNotificationGetCellData, - // data parameter is pointer, same as tableNotificationGetCellData - // not sent for checkboxes - // no return - tableNotificationFinishedWithCellData, - // data is zero - // no return - tableNotificationCellCheckboxToggled, -}; - -typedef struct tableNM tableNM; - -struct tableNM { - NMHDR nmhdr; - intptr_t row; - intptr_t column; - int columnType; - uintptr_t data; -}; +#include "includethis.h" static void (*tablePanic)(const char *, DWORD) = NULL; #define panic(...) (*tablePanic)(__VA_ARGS__, GetLastError())