2014-08-14 09:42:10 -05:00
|
|
|
// 17 july 2014
|
2014-07-17 18:36:24 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// cgo will include this file multiple times
|
2014-07-17 22:52:07 -05:00
|
|
|
#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
|
2014-08-14 09:42:10 -05:00
|
|
|
// get Windows version right; right now Windows XP
|
2014-07-17 18:36:24 -05:00
|
|
|
#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>
|
2014-07-25 14:58:24 -05:00
|
|
|
#include <uxtheme.h>
|
2014-08-01 18:15:03 -05:00
|
|
|
#include <string.h>
|
|
|
|
#include <wchar.h>
|
2014-08-05 11:49:08 -05:00
|
|
|
#include <windowsx.h>
|
2014-07-17 18:36:24 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// global messages unique to everything
|
2014-07-17 18:36:24 -05:00
|
|
|
enum {
|
2014-08-14 09:42:10 -05:00
|
|
|
msgRequest = WM_APP + 1, // + 1 just to be safe
|
|
|
|
msgCOMMAND, // WM_COMMAND proxy; see forwardCommand() in controls_windows.go
|
|
|
|
msgNOTIFY, // WM_NOTIFY proxy
|
2014-08-05 11:05:43 -05:00
|
|
|
msgAreaSizeChanged,
|
|
|
|
msgAreaRepaintAll,
|
2014-08-14 12:05:31 -05:00
|
|
|
msgTabCurrentTabHasChildren,
|
2014-07-17 18:36:24 -05:00
|
|
|
};
|
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// uitask_windows.c
|
2014-07-17 18:36:24 -05:00
|
|
|
extern void uimsgloop(void);
|
|
|
|
extern void issue(void *);
|
|
|
|
extern HWND msgwin;
|
|
|
|
extern DWORD makemsgwin(char **);
|
2014-07-17 19:05:47 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// comctl32_windows.c
|
2014-08-12 11:05:23 -05:00
|
|
|
extern DWORD initCommonControls(char **);
|
2014-08-14 09:42:10 -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-08-16 13:02:00 -05:00
|
|
|
extern HIMAGELIST (*WINAPI fv_ImageList_Create)(int, int, UINT, int, int);
|
|
|
|
extern int (*WINAPI fv_ImageList_Add)(HIMAGELIST, HBITMAP, HBITMAP);
|
2014-07-17 21:16:32 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// control_windows.c
|
2014-08-03 20:52:21 -05:00
|
|
|
extern HWND newControl(LPWSTR, DWORD, DWORD);
|
2014-07-17 21:16:32 -05:00
|
|
|
extern void controlSetParent(HWND, HWND);
|
2014-07-18 10:20:18 -05:00
|
|
|
extern void controlSetControlFont(HWND);
|
2014-08-09 09:26:42 -05:00
|
|
|
extern void moveWindow(HWND, int, int, int, int);
|
|
|
|
extern LONG controlTextLength(HWND, LPWSTR);
|
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// basicctrls_windows.c
|
2014-07-17 21:16:32 -05:00
|
|
|
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
|
|
|
|
2014-08-14 09:42:10 -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-08-05 15:30:12 -05:00
|
|
|
extern HBRUSH hollowBrush;
|
2014-07-17 21:33:03 -05:00
|
|
|
extern DWORD initWindows(char **);
|
2014-07-17 21:47:04 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// window_windows.c
|
2014-07-17 22:11:16 -05:00
|
|
|
extern DWORD makeWindowWindowClass(char **);
|
2014-08-04 18:46:49 -05:00
|
|
|
extern HWND newWindow(LPWSTR, int, int, void *);
|
2014-07-17 22:11:16 -05:00
|
|
|
extern void windowClose(HWND);
|
2014-07-17 22:45:12 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// common_windows.c
|
2014-07-17 22:45:12 -05:00
|
|
|
extern LRESULT getWindowTextLen(HWND);
|
2014-08-01 17:25:59 -05:00
|
|
|
extern void getWindowText(HWND, WPARAM, LPWSTR);
|
|
|
|
extern void setWindowText(HWND, LPWSTR);
|
2014-07-17 22:45:12 -05:00
|
|
|
extern void updateWindow(HWND);
|
2014-08-14 15:12:43 -05:00
|
|
|
extern void *getWindowData(HWND, UINT, WPARAM, LPARAM, LRESULT *, void (*)(void *, HWND));
|
2014-08-14 15:00:31 -05:00
|
|
|
extern BOOL sharedWndProc(HWND, UINT, WPARAM, LPARAM, LRESULT *);
|
2014-07-17 22:52:07 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// tab_windows.go
|
2014-08-01 17:25:59 -05:00
|
|
|
extern LPWSTR xWC_TABCONTROL;
|
2014-07-25 14:58:24 -05:00
|
|
|
extern void setTabSubclass(HWND, void *);
|
2014-08-01 17:25:59 -05:00
|
|
|
extern void tabAppend(HWND, LPWSTR);
|
2014-07-25 14:58:24 -05:00
|
|
|
extern void tabGetContentRect(HWND, RECT *);
|
2014-08-02 10:05:18 -05:00
|
|
|
extern LONG tabGetTabHeight(HWND);
|
2014-08-14 10:30:48 -05:00
|
|
|
extern void tabEnterChildren(HWND);
|
|
|
|
extern void tabLeaveChildren(HWND);
|
2014-07-25 14:58:24 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// table_windows.go
|
2014-08-01 17:25:59 -05:00
|
|
|
extern LPWSTR xWC_LISTVIEW;
|
2014-07-28 19:52:32 -05:00
|
|
|
extern void setTableSubclass(HWND, void *);
|
2014-08-01 17:25:59 -05:00
|
|
|
extern void tableAppendColumn(HWND, int, LPWSTR);
|
2014-07-28 19:52:32 -05:00
|
|
|
extern void tableUpdate(HWND, int);
|
2014-07-28 22:47:45 -05:00
|
|
|
extern void tableAddExtendedStyles(HWND, LPARAM);
|
2014-08-14 08:20:20 -05:00
|
|
|
extern void tableAutosizeColumns(HWND, int);
|
2014-07-28 19:52:32 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// container_windows.c
|
2014-08-04 18:46:49 -05:00
|
|
|
extern DWORD makeContainerWindowClass(char **);
|
|
|
|
extern HWND newContainer(void *);
|
2014-08-09 09:26:42 -05:00
|
|
|
extern void calculateBaseUnits(HWND, int *, int *, LONG *);
|
2014-08-04 18:46:49 -05:00
|
|
|
|
2014-08-14 09:42:10 -05:00
|
|
|
// area_window.c
|
2014-08-13 09:41:27 -05:00
|
|
|
#define areaWindowClass L"gouiarea"
|
2014-08-05 11:05:43 -05:00
|
|
|
extern void repaintArea(HWND);
|
|
|
|
extern DWORD makeAreaWindowClass(char **);
|
2014-08-05 11:17:44 -05:00
|
|
|
extern HWND newArea(void *);
|
2014-08-05 11:05:43 -05:00
|
|
|
|
2014-08-16 13:02:00 -05:00
|
|
|
// imagelist_windows.c
|
|
|
|
extern HBITMAP unscaledBitmap(void *, intptr_t, intptr_t);
|
|
|
|
extern HIMAGELIST newImageList(int, int);
|
|
|
|
extern void addImage(HIMAGELIST, HBITMAP, int, int, int, int);
|
|
|
|
|
2014-07-17 22:52:07 -05:00
|
|
|
#endif
|