From 823397cf5526a61d6b3a19bb16ab0b2c3da7f95e Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 15 Apr 2015 18:51:04 -0400 Subject: Moved the uipriv_*.h files to the respective folders. The ui_*.h files stay up here; they'll be moved to IDLs later. --- new/darwin/uipriv_darwin.h | 40 +++++++++++++++++++++++++ new/uipriv_darwin.h | 40 ------------------------- new/uipriv_unix.h | 11 ------- new/uipriv_windows.h | 69 -------------------------------------------- new/unix/uipriv_unix.h | 11 +++++++ new/windows/uipriv_windows.h | 69 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 120 insertions(+), 120 deletions(-) create mode 100644 new/darwin/uipriv_darwin.h delete mode 100644 new/uipriv_darwin.h delete mode 100644 new/uipriv_unix.h delete mode 100644 new/uipriv_windows.h create mode 100644 new/unix/uipriv_unix.h create mode 100644 new/windows/uipriv_windows.h (limited to 'new') diff --git a/new/darwin/uipriv_darwin.h b/new/darwin/uipriv_darwin.h new file mode 100644 index 0000000..36de1f1 --- /dev/null +++ b/new/darwin/uipriv_darwin.h @@ -0,0 +1,40 @@ +// 6 january 2015 +#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" +#import "../ui_darwin.h" + +#define toNSString(str) [NSString stringWithUTF8String:(str)] +#define fromNSString(str) [(str) UTF8String] + +#define uiLogObjCClassAllocations \ ++ (id)alloc \ +{ \ + id thing; \ + thing = [super alloc]; \ + if (options.debugLogAllocations) \ + fprintf(stderr, "%p alloc %s\n", thing, [[self className] UTF8String]); \ + return thing; \ +} \ +- (void)dealloc \ +{ \ + [super dealloc]; \ + if (options.debugLogAllocations) \ + fprintf(stderr, "%p free\n", self); \ +} + +// init_darwin.m +extern NSView *destroyedControlsView; + +// util_darwin.m +extern void setStandardControlFont(NSControl *); +extern void disableAutocorrect(NSTextView *); + +// These are based on measurements from Interface Builder. +// These seem to be based on Auto Layout constants, but I don't see an API that exposes these... +#define macXMargin 20 +#define macYMargin 20 + +// entry_darwin.m +extern void finishNewTextField(NSTextField *, BOOL); diff --git a/new/uipriv_darwin.h b/new/uipriv_darwin.h deleted file mode 100644 index 8516e9a..0000000 --- a/new/uipriv_darwin.h +++ /dev/null @@ -1,40 +0,0 @@ -// 6 january 2015 -#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" -#import "ui_darwin.h" - -#define toNSString(str) [NSString stringWithUTF8String:(str)] -#define fromNSString(str) [(str) UTF8String] - -#define uiLogObjCClassAllocations \ -+ (id)alloc \ -{ \ - id thing; \ - thing = [super alloc]; \ - if (options.debugLogAllocations) \ - fprintf(stderr, "%p alloc %s\n", thing, [[self className] UTF8String]); \ - return thing; \ -} \ -- (void)dealloc \ -{ \ - [super dealloc]; \ - if (options.debugLogAllocations) \ - fprintf(stderr, "%p free\n", self); \ -} - -// init_darwin.m -extern NSView *destroyedControlsView; - -// util_darwin.m -extern void setStandardControlFont(NSControl *); -extern void disableAutocorrect(NSTextView *); - -// These are based on measurements from Interface Builder. -// These seem to be based on Auto Layout constants, but I don't see an API that exposes these... -#define macXMargin 20 -#define macYMargin 20 - -// entry_darwin.m -extern void finishNewTextField(NSTextField *, BOOL); diff --git a/new/uipriv_unix.h b/new/uipriv_unix.h deleted file mode 100644 index 1af388b..0000000 --- a/new/uipriv_unix.h +++ /dev/null @@ -1,11 +0,0 @@ -// 6 april 2015 -#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" -#include "ui_unix.h" - -#define gtkXMargin 12 -#define gtkYMargin 12 diff --git a/new/uipriv_windows.h b/new/uipriv_windows.h deleted file mode 100644 index 9d3d276..0000000 --- a/new/uipriv_windows.h +++ /dev/null @@ -1,69 +0,0 @@ -// 6 january 2015 -#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" -#include "ui_windows.h" - -// ui internal window messages -enum { - // redirected WM_COMMAND and WM_NOTIFY - msgCOMMAND = WM_APP + 0x40, // start offset just to be safe - msgNOTIFY, - msgUpdateChild, // fake because Windows seems to SWP_NOSIZE MoveWindow()s and SetWindowPos()s that don't change the window size (even if SWP_NOSIZE isn't specified) -}; - -// 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 HBRUSH hollowBrush; - -// util_windows.c -extern int windowClassOf(HWND, ...); - -// text_windows.c -extern WCHAR *toUTF16(const char *); -extern char *toUTF8(const WCHAR *); -extern WCHAR *windowText(HWND); - -// comctl32_windows.c -extern BOOL (*WINAPI fv_SetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); -extern BOOL (*WINAPI fv_RemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); -extern LRESULT (*WINAPI fv_DefSubclassProc)(HWND, UINT, WPARAM, LPARAM); -extern const char *initCommonControls(void); - -// window_windows.c -extern ATOM registerWindowClass(HICON, HCURSOR); - -// parent_windows.c -extern HWND initialParent; -extern const char *initParent(HICON, HCURSOR); diff --git a/new/unix/uipriv_unix.h b/new/unix/uipriv_unix.h new file mode 100644 index 0000000..2178ab0 --- /dev/null +++ b/new/unix/uipriv_unix.h @@ -0,0 +1,11 @@ +// 6 april 2015 +#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" +#include "../ui_unix.h" + +#define gtkXMargin 12 +#define gtkYMargin 12 diff --git a/new/windows/uipriv_windows.h b/new/windows/uipriv_windows.h new file mode 100644 index 0000000..4ba0f5a --- /dev/null +++ b/new/windows/uipriv_windows.h @@ -0,0 +1,69 @@ +// 6 january 2015 +#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" +#include "../ui_windows.h" + +// ui internal window messages +enum { + // redirected WM_COMMAND and WM_NOTIFY + msgCOMMAND = WM_APP + 0x40, // start offset just to be safe + msgNOTIFY, + msgUpdateChild, // fake because Windows seems to SWP_NOSIZE MoveWindow()s and SetWindowPos()s that don't change the window size (even if SWP_NOSIZE isn't specified) +}; + +// 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 HBRUSH hollowBrush; + +// util_windows.c +extern int windowClassOf(HWND, ...); + +// text_windows.c +extern WCHAR *toUTF16(const char *); +extern char *toUTF8(const WCHAR *); +extern WCHAR *windowText(HWND); + +// comctl32_windows.c +extern BOOL (*WINAPI fv_SetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); +extern BOOL (*WINAPI fv_RemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); +extern LRESULT (*WINAPI fv_DefSubclassProc)(HWND, UINT, WPARAM, LPARAM); +extern const char *initCommonControls(void); + +// window_windows.c +extern ATOM registerWindowClass(HICON, HCURSOR); + +// parent_windows.c +extern HWND initialParent; +extern const char *initParent(HICON, HCURSOR); -- cgit v1.2.3