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>
|
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
|
|
|
|
|
|
|
/* 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 */
|
2014-07-25 14:58:24 -05:00
|
|
|
msgNOTIFY, /* WM_NOTIFY proxy */
|
2014-08-05 11:05:43 -05:00
|
|
|
msgAreaSizeChanged,
|
|
|
|
msgAreaRepaintAll,
|
2014-07-17 18:36:24 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/* 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 */
|
2014-08-01 17:25:59 -05:00
|
|
|
extern DWORD initCommonControls(LPWSTR, 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
|
|
|
|
2014-08-03 20:52:21 -05:00
|
|
|
/* [TODO rename] controls_windows.c */
|
|
|
|
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-07-17 21:16:32 -05:00
|
|
|
extern LRESULT forwardCommand(HWND, UINT, WPARAM, LPARAM);
|
2014-07-25 14:58:24 -05:00
|
|
|
extern LRESULT forwardNotify(HWND, UINT, WPARAM, LPARAM);
|
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
|
|
|
|
|
|
|
/* 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 */
|
2014-08-04 19:10:23 -05:00
|
|
|
extern void calculateBaseUnits(HWND, int *, int *);
|
2014-07-17 21:47:04 -05:00
|
|
|
extern void moveWindow(HWND, int, int, int, int);
|
2014-08-01 18:15:03 -05:00
|
|
|
extern LONG controlTextLength(HWND, LPWSTR);
|
2014-07-17 22:11:16 -05:00
|
|
|
|
|
|
|
/* window_windows.c */
|
|
|
|
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
|
|
|
|
|
|
|
/* common_windows.c */
|
|
|
|
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);
|
|
|
|
extern void storelpParam(HWND, LPARAM);
|
2014-07-17 22:52:07 -05:00
|
|
|
|
2014-07-25 14:58:24 -05:00
|
|
|
/* containers_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-07-25 14:58:24 -05:00
|
|
|
|
2014-07-28 19:52:32 -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-07-28 19:52:32 -05:00
|
|
|
|
2014-08-04 18:46:49 -05:00
|
|
|
/* container_windows.c */
|
|
|
|
extern DWORD makeContainerWindowClass(char **);
|
|
|
|
extern HWND newContainer(void *);
|
|
|
|
|
2014-08-05 11:05:43 -05:00
|
|
|
/* area_window.c */
|
|
|
|
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-07-17 22:52:07 -05:00
|
|
|
#endif
|