From 1d76d53593de0c6bd4faf8c47bb525977a33b178 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 00:26:27 -0400 Subject: Changed ui_*.h to uipriv_*.h pending a public non-portable API. --- new/alloc_darwin.m | 2 +- new/alloc_windows.c | 2 +- new/debug_windows.c | 2 +- new/init_darwin.m | 2 +- new/init_unix.c | 2 +- new/init_windows.c | 2 +- new/main_darwin.m | 2 +- new/main_unix.c | 2 +- new/main_windows.c | 2 +- new/singlehandle_windows.c | 2 +- new/ui_darwin.h | 18 ------------ new/ui_unix.h | 13 --------- new/ui_windows.h | 68 ---------------------------------------------- new/uipriv_darwin.h | 18 ++++++++++++ new/uipriv_unix.h | 13 +++++++++ new/uipriv_windows.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++ new/util_windows.c | 2 +- new/window_darwin.m | 2 +- new/window_unix.c | 2 +- new/window_windows.c | 2 +- 20 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 new/ui_darwin.h delete mode 100644 new/ui_unix.h delete mode 100644 new/ui_windows.h create mode 100644 new/uipriv_darwin.h create mode 100644 new/uipriv_unix.h create mode 100644 new/uipriv_windows.h diff --git a/new/alloc_darwin.m b/new/alloc_darwin.m index 059152a..4b768b6 100644 --- a/new/alloc_darwin.m +++ b/new/alloc_darwin.m @@ -1,5 +1,5 @@ // 4 december 2014 -#include "ui_darwin.h" +#import "uipriv_darwin.h" // TODO is there a better alternative to NSCAssert()? preferably a built-in allocator that panics on out of memory for us? diff --git a/new/alloc_windows.c b/new/alloc_windows.c index 049e909..7922d5d 100644 --- a/new/alloc_windows.c +++ b/new/alloc_windows.c @@ -1,5 +1,5 @@ // 4 december 2014 -#include "ui_windows.h" +#include "uipriv_windows.h" // wrappers for allocator of choice // panics on memory exhausted, undefined on heap corruption or other unreliably-detected malady (see http://stackoverflow.com/questions/28761680/is-there-a-windows-api-memory-allocator-deallocator-i-can-use-that-will-just-giv) diff --git a/new/debug_windows.c b/new/debug_windows.c index d044f33..ddda738 100644 --- a/new/debug_windows.c +++ b/new/debug_windows.c @@ -1,5 +1,5 @@ // 25 february 2015 -#include "ui_windows.h" +#include "uipriv_windows.h" // uncomment the following line to enable debug messages #define tableDebug diff --git a/new/init_darwin.m b/new/init_darwin.m index 6d71152..b251b47 100644 --- a/new/init_darwin.m +++ b/new/init_darwin.m @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_darwin.h" +#import "uipriv_darwin.h" @interface uiApplication : NSApplication @end diff --git a/new/init_unix.c b/new/init_unix.c index bda6481..48d4366 100644 --- a/new/init_unix.c +++ b/new/init_unix.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_unix.h" +#include "uipriv_unix.h" struct uiInitError { GError *err; diff --git a/new/init_windows.c b/new/init_windows.c index 07031aa..f2c687d 100644 --- a/new/init_windows.c +++ b/new/init_windows.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_windows.h" +#include "uipriv_windows.h" HINSTANCE hInstance; int nCmdShow; diff --git a/new/main_darwin.m b/new/main_darwin.m index be9b599..d19af08 100644 --- a/new/main_darwin.m +++ b/new/main_darwin.m @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_darwin.h" +#import "uipriv_darwin.h" // TODO merge with init_darwin.m? diff --git a/new/main_unix.c b/new/main_unix.c index b95e99e..90374c7 100644 --- a/new/main_unix.c +++ b/new/main_unix.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_unix.h" +#include "uipriv_unix.h" // #qo pkg-config: gtk+-3.0 diff --git a/new/main_windows.c b/new/main_windows.c index 43e6b5c..bd973b7 100644 --- a/new/main_windows.c +++ b/new/main_windows.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_windows.h" +#include "uipriv_windows.h" // #qo LDFLAGS: -luser32 -lkernel32 -lgdi32 -luxtheme -lmsimg32 -lcomdlg32 -lole32 -loleaut32 -loleacc -luuid diff --git a/new/singlehandle_windows.c b/new/singlehandle_windows.c index 74dee5f..b55a8b9 100644 --- a/new/singlehandle_windows.c +++ b/new/singlehandle_windows.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "tablepriv.h" +#include "uipriv_windows.h" // Common code for controls with a single window handle. // The only method NOT defined is preferredSize(); this differs between controls. diff --git a/new/ui_darwin.h b/new/ui_darwin.h deleted file mode 100644 index 64b01db..0000000 --- a/new/ui_darwin.h +++ /dev/null @@ -1,18 +0,0 @@ -// 6 january 2015 - -#ifndef __UI_UI_DARWIN_H__ -#define __UI_UI_DARWIN_H__ - -#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7 -#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7 -#import -#import "uipriv.h" - -#define toNSString(str) [NSString stringWithUTF8String:(str)] - -// alloc_darwin.m -extern void *uiAlloc(size_t); -extern void *uiRealloc(void *, size_t); -extern void uiFree(void *); - -#endif diff --git a/new/ui_unix.h b/new/ui_unix.h deleted file mode 100644 index 642dd49..0000000 --- a/new/ui_unix.h +++ /dev/null @@ -1,13 +0,0 @@ -// 6 april 2015 - -#ifndef __UI_UI_UNIX_H__ -#define __UI_UI_UNIX_H__ - -#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_32 -#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_32 -#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_4 -#define GDK_VERSION_MAX_ALLOWED GDK_VERSION_3_4 -#include -#include "uipriv.h" - -#endif diff --git a/new/ui_windows.h b/new/ui_windows.h deleted file mode 100644 index 896762f..0000000 --- a/new/ui_windows.h +++ /dev/null @@ -1,68 +0,0 @@ -// 6 january 2015 - -#ifndef __UI_UI_WINDOWS_H__ -#define __UI_UI_WINDOWS_H__ - -#define UNICODE -#define _UNICODE -#define STRICT -#define STRICT_TYPED_ITEMIDS -#define CINTERFACE -#define COBJMACROS -// see https://github.com/golang/go/issues/9916#issuecomment-74812211 -#define INITGUID -// get Windows version right; right now Windows XP -#define WINVER 0x0501 -#define _WIN32_WINNT 0x0501 -#define _WIN32_WINDOWS 0x0501 /* according to Microsoft's winperf.h */ -#define _WIN32_IE 0x0600 /* according to Microsoft's sdkddkver.h */ -#define NTDDI_VERSION 0x05010000 /* according to Microsoft's sdkddkver.h */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "uipriv.h" - -// alloc_windows.c -extern void *uiAlloc(size_t); -// TODO use this in existing files -#define uiNew(T) ((T *) uiAlloc(sizeof (T))) -extern void *uiRealloc(void *, size_t); -extern void uiFree(void *); - -// debug_windows.c -extern HRESULT logLastError(const char *); -extern HRESULT logHRESULT(const char *, HRESULT); -extern HRESULT logMemoryExhausted(const char *); - -// init_windows.c -extern HINSTANCE hInstance; -extern int nCmdShow; -extern HFONT hMessageFont; -extern HWND initialParent; - -// util_windows.c -extern WCHAR *toUTF16(const char *); - -// window_windows.c -extern ATOM registerWindowClass(HICON, HCURSOR); - -// singlehandle_windows.c -typedef struct uiSingleHWNDControl uiSingleHWNDControl; -struct uiSingleHWNDControl { - uiControl control; - HWND hwnd; - void (*voidEvent)(uiControl *, void *); - void *voidEventData; -}; -extern uiSingleHWNDControl *newSingleHWNDControl(DWORD, const WCHAR *, DWORD, HINSTANCE); - -#endif diff --git a/new/uipriv_darwin.h b/new/uipriv_darwin.h new file mode 100644 index 0000000..64b01db --- /dev/null +++ b/new/uipriv_darwin.h @@ -0,0 +1,18 @@ +// 6 january 2015 + +#ifndef __UI_UI_DARWIN_H__ +#define __UI_UI_DARWIN_H__ + +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_7 +#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_7 +#import +#import "uipriv.h" + +#define toNSString(str) [NSString stringWithUTF8String:(str)] + +// alloc_darwin.m +extern void *uiAlloc(size_t); +extern void *uiRealloc(void *, size_t); +extern void uiFree(void *); + +#endif diff --git a/new/uipriv_unix.h b/new/uipriv_unix.h new file mode 100644 index 0000000..642dd49 --- /dev/null +++ b/new/uipriv_unix.h @@ -0,0 +1,13 @@ +// 6 april 2015 + +#ifndef __UI_UI_UNIX_H__ +#define __UI_UI_UNIX_H__ + +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_32 +#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_32 +#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_4 +#define GDK_VERSION_MAX_ALLOWED GDK_VERSION_3_4 +#include +#include "uipriv.h" + +#endif diff --git a/new/uipriv_windows.h b/new/uipriv_windows.h new file mode 100644 index 0000000..896762f --- /dev/null +++ b/new/uipriv_windows.h @@ -0,0 +1,68 @@ +// 6 january 2015 + +#ifndef __UI_UI_WINDOWS_H__ +#define __UI_UI_WINDOWS_H__ + +#define UNICODE +#define _UNICODE +#define STRICT +#define STRICT_TYPED_ITEMIDS +#define CINTERFACE +#define COBJMACROS +// see https://github.com/golang/go/issues/9916#issuecomment-74812211 +#define INITGUID +// get Windows version right; right now Windows XP +#define WINVER 0x0501 +#define _WIN32_WINNT 0x0501 +#define _WIN32_WINDOWS 0x0501 /* according to Microsoft's winperf.h */ +#define _WIN32_IE 0x0600 /* according to Microsoft's sdkddkver.h */ +#define NTDDI_VERSION 0x05010000 /* according to Microsoft's sdkddkver.h */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "uipriv.h" + +// alloc_windows.c +extern void *uiAlloc(size_t); +// TODO use this in existing files +#define uiNew(T) ((T *) uiAlloc(sizeof (T))) +extern void *uiRealloc(void *, size_t); +extern void uiFree(void *); + +// debug_windows.c +extern HRESULT logLastError(const char *); +extern HRESULT logHRESULT(const char *, HRESULT); +extern HRESULT logMemoryExhausted(const char *); + +// init_windows.c +extern HINSTANCE hInstance; +extern int nCmdShow; +extern HFONT hMessageFont; +extern HWND initialParent; + +// util_windows.c +extern WCHAR *toUTF16(const char *); + +// window_windows.c +extern ATOM registerWindowClass(HICON, HCURSOR); + +// singlehandle_windows.c +typedef struct uiSingleHWNDControl uiSingleHWNDControl; +struct uiSingleHWNDControl { + uiControl control; + HWND hwnd; + void (*voidEvent)(uiControl *, void *); + void *voidEventData; +}; +extern uiSingleHWNDControl *newSingleHWNDControl(DWORD, const WCHAR *, DWORD, HINSTANCE); + +#endif diff --git a/new/util_windows.c b/new/util_windows.c index c3f8971..0bd76a0 100644 --- a/new/util_windows.c +++ b/new/util_windows.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_windows.h" +#include "uipriv_windows.h" #define MBTWC(str, wstr, bufsiz) MultiByteToWideChar(CP_UTF8, 0, str, -1, wstr, bufsiz) diff --git a/new/window_darwin.m b/new/window_darwin.m index 1a60f8b..30c3a1a 100644 --- a/new/window_darwin.m +++ b/new/window_darwin.m @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_darwin.h" +#import "uipriv_darwin.h" @interface uiWindowDelegate : NSObject @property uiWindow *w; diff --git a/new/window_unix.c b/new/window_unix.c index f3d4ec3..3a145ac 100644 --- a/new/window_unix.c +++ b/new/window_unix.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_unix.h" +#include "uipriv_unix.h" struct uiWindow { GtkWidget *widget; diff --git a/new/window_windows.c b/new/window_windows.c index 0452161..12655b9 100644 --- a/new/window_windows.c +++ b/new/window_windows.c @@ -1,5 +1,5 @@ // 6 april 2015 -#include "ui_windows.h" +#include "uipriv_windows.h" struct uiWindow { HWND hwnd; -- cgit v1.2.3