andlabs-ui/winapi_windows.h

140 lines
4.5 KiB
C
Raw Normal View History

// 17 july 2014
// cgo will include this file multiple times
#ifndef __GO_UI_WINAPI_WINDOWS_H__
#define __GO_UI_WINAPI_WINDOWS_H__
#include "wininclude_windows.h"
// if by some stroke of luck Go ever supports compiling with MSVC, this will need to change
2014-11-06 09:44:17 -06:00
// noe that this has to come after the headers above because it's not predefined
#ifndef __MINGW64_VERSION_MAJOR
#error Sorry, you must use MinGW-w64 (http://mingw-w64.sourceforge.net/) to build package ui, as vanilla MinGW does not support Windows XP features (in 2014!).
#endif
// 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
msgNOTIFY, // WM_NOTIFY proxy
msgAreaSizeChanged,
2014-08-21 12:01:50 -05:00
msgAreaGetScroll,
msgAreaRepaint,
msgAreaRepaintAll,
msgTabCurrentTabHasChildren,
msgAreaKeyDown,
msgAreaKeyUp,
2014-08-25 15:53:47 -05:00
msgLoadImageList,
msgTableMakeInitialCheckboxImageList,
msgOpenFileDone,
};
// 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(char **);
// 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);
2015-02-17 19:39:13 -06:00
// these are listed as WINAPI on MSDN
extern BOOL (*WINAPI fv__TrackMouseEvent)(LPTRACKMOUSEEVENT);
2014-07-17 21:16:32 -05:00
// control_windows.c
extern HWND newControl(LPWSTR, DWORD, DWORD);
2014-07-17 21:16:32 -05:00
extern void controlSetParent(HWND, HWND);
extern void controlSetControlFont(HWND);
extern void moveWindow(HWND, int, int, int, int);
extern LONG controlTextLength(HWND, LPWSTR);
// basicctrls_windows.c
2014-07-17 21:16:32 -05:00
extern void setButtonSubclass(HWND, void *);
extern void setCheckboxSubclass(HWND, void *);
extern BOOL checkboxChecked(HWND);
extern void checkboxSetChecked(HWND, BOOL);
#define textfieldStyle (ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP)
#define textfieldExtStyle (WS_EX_CLIENTEDGE)
extern void setTextFieldSubclass(HWND, void *);
extern void textfieldSetAndShowInvalidBalloonTip(HWND, WCHAR *);
extern void textfieldHideInvalidBalloonTip(HWND);
extern int textfieldReadOnly(HWND);
extern void textfieldSetReadOnly(HWND, BOOL);
extern void setGroupSubclass(HWND, void *);
extern HWND newUpDown(HWND, void *);
extern void setSpinboxEditSubclass(HWND, void *);
extern LPWSTR xPROGRESS_CLASS;
2014-07-17 21:33:03 -05:00
// init_windows.c
extern HINSTANCE hInstance;
2014-07-17 21:33:03 -05:00
extern int nCmdShow;
extern HICON hDefaultIcon;
extern HCURSOR hArrowCursor;
extern HFONT controlFont;
extern HFONT titleFont;
extern HFONT smallTitleFont;
extern HFONT menubarFont;
extern HFONT statusbarFont;
extern HBRUSH hollowBrush;
2014-07-17 21:33:03 -05:00
extern DWORD initWindows(char **);
2014-07-17 21:47:04 -05:00
// window_windows.c
2014-07-17 22:11:16 -05:00
extern DWORD makeWindowWindowClass(char **);
extern HWND newWindow(LPWSTR, int, int, void *);
2014-07-17 22:11:16 -05:00
extern void windowClose(HWND);
// common_windows.c
extern LRESULT getWindowTextLen(HWND);
extern void getWindowText(HWND, WPARAM, LPWSTR);
extern void setWindowText(HWND, LPWSTR);
extern void updateWindow(HWND);
2014-10-18 16:03:07 -05:00
extern void *getWindowData(HWND, UINT, WPARAM, LPARAM, LRESULT *);
extern int windowClassOf(HWND, ...);
extern BOOL sharedWndProc(HWND, UINT, WPARAM, LPARAM, LRESULT *);
extern void paintControlBackground(HWND, HDC);
// tab_windows.go
extern LPWSTR xWC_TABCONTROL;
2014-07-25 14:58:24 -05:00
extern void setTabSubclass(HWND, void *);
extern void tabAppend(HWND, LPWSTR);
2014-07-25 14:58:24 -05:00
extern void tabGetContentRect(HWND, RECT *);
extern LONG tabGetTabHeight(HWND);
extern void tabEnterChildren(HWND);
extern void tabLeaveChildren(HWND);
2014-07-25 14:58:24 -05:00
// table_windows.go
2015-02-17 19:39:13 -06:00
#include "wintable/includethis.h"
2015-02-17 19:46:10 -06:00
extern LPWSTR xtableWindowClass;
extern void doInitTable(void);
extern void setTableSubclass(HWND, void *);
2015-02-17 19:46:10 -06:00
/* TODO
extern void tableAutosizeColumns(HWND, int);
extern intptr_t tableSelectedItem(HWND);
extern void tableSelectItem(HWND, intptr_t);
2015-02-17 19:46:10 -06:00
*/
// container_windows.c
2014-10-18 16:03:07 -05:00
extern RECT containerBounds(HWND);
extern void calculateBaseUnits(HWND, int *, int *, LONG *);
// area_windows.c
#define areaWindowClass L"gouiarea"
2014-08-21 12:01:50 -05:00
extern void repaintArea(HWND, RECT *);
extern DWORD makeAreaWindowClass(char **);
extern HWND newArea(void *);
extern HWND newAreaTextField(HWND, void *);
extern void areaOpenTextField(HWND, HWND, int, int, int, int);
extern void areaMarkTextFieldDone(HWND);
// image_windows.c
extern HBITMAP toBitmap(void *, intptr_t, intptr_t);
extern void freeBitmap(void *);
// dialog_windows.c
extern void openFile(HWND, void *);
#endif