2014-07-17 18:36:24 -05:00
|
|
|
/* 17 july 2014 */
|
|
|
|
|
2014-07-17 22:52:07 -05:00
|
|
|
/* cgo will include this file multiple times */
|
|
|
|
#ifndef __GO_UI_WINAPI_WINDOWS_H__
|
|
|
|
#define __GO_UI_WINAPI_WINDOWS_H__
|
|
|
|
|
2014-07-17 18:36:24 -05:00
|
|
|
#define UNICODE
|
|
|
|
#define _UNICODE
|
|
|
|
#define STRICT
|
|
|
|
#define STRICT_TYPED_ITEMIDS
|
|
|
|
/* 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 <windows.h>
|
|
|
|
#include <commctrl.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* global messages unique to everything */
|
|
|
|
enum {
|
|
|
|
msgRequest = WM_APP + 1, /* + 1 just to be safe */
|
|
|
|
msgCOMMAND, /* WM_COMMAND proxy; see forwardCommand() in controls_windows.go */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* uitask_windows.c */
|
|
|
|
extern void uimsgloop(void);
|
|
|
|
extern void issue(void *);
|
|
|
|
extern HWND msgwin;
|
|
|
|
extern DWORD makemsgwin(char **);
|
2014-07-17 19:05:47 -05:00
|
|
|
|
|
|
|
/* comctl32_windows.c */
|
|
|
|
extern DWORD initCommonControls(LPCWSTR, char **);
|
2014-07-21 08:43:37 -05:00
|
|
|
/* these are listed as WINAPI in both Microsoft's and MinGW's headers, but not on MSDN for some reason */
|
2014-07-17 19:05:47 -05:00
|
|
|
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);
|
2014-07-17 21:16:32 -05:00
|
|
|
|
|
|
|
/* controls_windows.c */
|
|
|
|
extern HWND newWidget(LPCWSTR, DWORD, DWORD);
|
|
|
|
extern void controlSetParent(HWND, HWND);
|
2014-07-18 10:20:18 -05:00
|
|
|
extern void controlSetControlFont(HWND);
|
2014-07-17 21:16:32 -05:00
|
|
|
extern LRESULT forwardCommand(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
extern void setButtonSubclass(HWND, void *);
|
2014-07-21 20:34:52 -05:00
|
|
|
extern void setCheckboxSubclass(HWND, void *);
|
|
|
|
extern BOOL checkboxChecked(HWND);
|
|
|
|
extern void checkboxSetChecked(HWND, BOOL);
|
2014-07-17 21:33:03 -05:00
|
|
|
|
|
|
|
/* init_windows.c */
|
2014-07-17 22:56:16 -05:00
|
|
|
extern HINSTANCE hInstance;
|
2014-07-17 21:33:03 -05:00
|
|
|
extern int nCmdShow;
|
|
|
|
extern HICON hDefaultIcon;
|
|
|
|
extern HCURSOR hArrowCursor;
|
2014-07-18 10:20:18 -05:00
|
|
|
extern HFONT controlFont;
|
|
|
|
extern HFONT titleFont;
|
|
|
|
extern HFONT smallTitleFont;
|
|
|
|
extern HFONT menubarFont;
|
|
|
|
extern HFONT statusbarFont;
|
2014-07-17 21:33:03 -05:00
|
|
|
extern DWORD initWindows(char **);
|
2014-07-17 21:47:04 -05:00
|
|
|
|
|
|
|
/* sizing_windows.c */
|
|
|
|
extern HDC getDC(HWND);
|
|
|
|
extern void releaseDC(HWND, HDC);
|
|
|
|
extern void getTextMetricsW(HDC, TEXTMETRICW *);
|
|
|
|
extern void moveWindow(HWND, int, int, int, int);
|
2014-07-17 22:11:16 -05:00
|
|
|
|
|
|
|
/* window_windows.c */
|
|
|
|
extern DWORD makeWindowWindowClass(char **);
|
|
|
|
extern HWND newWindow(LPCWSTR, int, int, void *);
|
|
|
|
extern void windowClose(HWND);
|
2014-07-17 22:45:12 -05:00
|
|
|
|
|
|
|
/* common_windows.c */
|
|
|
|
extern LRESULT getWindowTextLen(HWND);
|
|
|
|
extern void getWindowText(HWND, WPARAM, LPCWSTR);
|
|
|
|
extern void setWindowText(HWND, LPCWSTR);
|
|
|
|
extern void updateWindow(HWND);
|
|
|
|
extern void storelpParam(HWND, LPARAM);
|
2014-07-17 22:52:07 -05:00
|
|
|
|
|
|
|
#endif
|