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__
2015-01-06 21:02:04 -06:00
# include "wininclude_windows.h"
2014-07-17 18:36:24 -05:00
2014-11-06 09:43:21 -06:00
// 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
2014-11-06 09:43:21 -06:00
# 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
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 ,
2014-08-21 12:01:50 -05:00
msgAreaGetScroll ,
msgAreaRepaint ,
2014-08-05 11:05:43 -05:00
msgAreaRepaintAll ,
2014-08-14 12:05:31 -05:00
msgTabCurrentTabHasChildren ,
2014-08-21 04:37:24 -05:00
msgAreaKeyDown ,
msgAreaKeyUp ,
2014-08-26 11:52:32 -05:00
msgOpenFileDone ,
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 ) ;
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
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-08-22 12:57:32 -05:00
# define textfieldStyle (ES_AUTOHSCROLL | ES_LEFT | ES_NOHIDESEL | WS_TABSTOP)
# define textfieldExtStyle (WS_EX_CLIENTEDGE)
2014-08-20 11:04:36 -05:00
extern void setTextFieldSubclass ( HWND , void * ) ;
2014-08-20 13:17:00 -05:00
extern void textfieldSetAndShowInvalidBalloonTip ( HWND , WCHAR * ) ;
extern void textfieldHideInvalidBalloonTip ( HWND ) ;
2014-11-05 11:59:44 -06:00
extern int textfieldReadOnly ( HWND ) ;
extern void textfieldSetReadOnly ( HWND , BOOL ) ;
2014-10-27 09:41:10 -05:00
extern void setGroupSubclass ( HWND , void * ) ;
2014-11-01 07:35:21 -05:00
extern HWND newUpDown ( HWND , void * ) ;
2014-11-02 19:49:39 -06:00
extern void setSpinboxEditSubclass ( HWND , void * ) ;
2014-11-04 08:18:57 -06:00
extern LPWSTR xPROGRESS_CLASS ;
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-10-18 16:03:07 -05:00
extern void * getWindowData ( HWND , UINT , WPARAM , LPARAM , LRESULT * ) ;
2014-11-05 13:12:57 -06:00
extern int windowClassOf ( HWND , . . . ) ;
2014-08-14 15:00:31 -05:00
extern BOOL sharedWndProc ( HWND , UINT , WPARAM , LPARAM , LRESULT * ) ;
2014-08-28 09:30:53 -05:00
extern void paintControlBackground ( HWND , HDC ) ;
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
2015-02-17 19:39:13 -06:00
# include "wintable/includethis.h"
2015-02-17 19:46:10 -06:00
extern LPWSTR xtableWindowClass ;
2015-02-17 20:43:32 -06:00
extern void doInitTable ( void ) ;
2014-07-28 19:52:32 -05:00
extern void setTableSubclass ( HWND , void * ) ;
2015-02-18 00:51:57 -06:00
extern void gotableSetRowCount ( HWND , intptr_t ) ;
2015-02-17 19:46:10 -06:00
/* TODO
2014-08-14 08:20:20 -05:00
extern void tableAutosizeColumns ( HWND , int ) ;
2015-02-19 21:58:17 -06:00
*/
2014-08-18 01:22:27 -05:00
extern intptr_t tableSelectedItem ( HWND ) ;
extern void tableSelectItem ( HWND , intptr_t ) ;
2014-07-28 19:52:32 -05:00
2014-08-14 09:42:10 -05:00
// container_windows.c
2014-10-18 16:03:07 -05:00
extern RECT containerBounds ( HWND ) ;
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-23 19:39:47 -05:00
// area_windows.c
2014-08-13 09:41:27 -05:00
# define areaWindowClass L"gouiarea"
2014-08-21 12:01:50 -05:00
extern void repaintArea ( HWND , RECT * ) ;
2014-08-05 11:05:43 -05:00
extern DWORD makeAreaWindowClass ( char * * ) ;
2014-08-05 11:17:44 -05:00
extern HWND newArea ( void * ) ;
2014-08-23 19:39:47 -05:00
extern HWND newAreaTextField ( HWND , void * ) ;
extern void areaOpenTextField ( HWND , HWND , int , int , int , int ) ;
extern void areaMarkTextFieldDone ( HWND ) ;
2014-08-05 11:05:43 -05:00
2015-02-17 20:35:03 -06:00
// image_windows.c
extern HBITMAP toBitmap ( void * , intptr_t , intptr_t ) ;
2015-02-17 21:17:58 -06:00
extern void freeBitmap ( uintptr_t ) ;
2014-08-16 13:02:00 -05:00
2014-08-18 18:01:56 -05:00
// dialog_windows.c
2014-08-26 11:52:32 -05:00
extern void openFile ( HWND , void * ) ;
2014-08-18 18:01:56 -05:00
2014-07-17 22:52:07 -05:00
# endif