2017-05-30 03:38:38 +02:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
2017-10-19 04:27:04 -04:00
|
|
|
* Platform support defintions for Win32.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-10-07 00:46:54 -04:00
|
|
|
*
|
|
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-10-08 19:14:46 -04:00
|
|
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
|
|
|
|
*
|
2019-11-01 03:08:58 +01:00
|
|
|
* Copyright 2008-2019 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2019 Miran Grca.
|
|
|
|
|
* Copyright 2017-2019 Fred N. van Kempen.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2017-10-19 04:27:04 -04:00
|
|
|
#ifndef PLAT_WIN_H
|
|
|
|
|
# define PLAT_WIN_H
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
# define UNICODE
|
2017-05-22 00:21:22 -04:00
|
|
|
# define BITMAP WINDOWS_BITMAP
|
2017-10-07 00:46:54 -04:00
|
|
|
# if 0
|
|
|
|
|
# ifdef _WIN32_WINNT
|
|
|
|
|
# undef _WIN32_WINNT
|
|
|
|
|
# define _WIN32_WINNT 0x0501
|
|
|
|
|
# endif
|
|
|
|
|
# endif
|
2017-05-22 00:21:22 -04:00
|
|
|
# include <windows.h>
|
2017-05-29 21:57:31 -04:00
|
|
|
# include "resource.h"
|
2017-05-22 00:21:22 -04:00
|
|
|
# undef BITMAP
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2020-09-02 11:03:14 +08:00
|
|
|
/* DPI Awareness Context, copied from MinGW-w64 windef.h */
|
|
|
|
|
#ifndef _DPI_AWARENESS_CONTEXTS_
|
|
|
|
|
DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
|
|
|
|
|
#define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
|
|
|
|
|
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
|
|
|
|
|
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
|
|
|
|
|
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
|
|
|
|
|
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef WM_DPICHANGED_AFTERPARENT
|
|
|
|
|
#define WM_DPICHANGED_AFTERPARENT 0x02E3
|
|
|
|
|
#endif
|
2017-05-22 00:21:22 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Class names and such. */
|
|
|
|
|
#define CLASS_NAME L"86BoxMainWnd"
|
|
|
|
|
#define MENU_NAME L"MainMenu"
|
|
|
|
|
#define ACCEL_NAME L"MainAccel"
|
|
|
|
|
#define SUB_CLASS_NAME L"86BoxSubWnd"
|
|
|
|
|
#define SB_CLASS_NAME L"86BoxStatusBar"
|
|
|
|
|
#define SB_MENU_NAME L"StatusBarMenu"
|
2018-07-15 01:41:53 +02:00
|
|
|
#define FS_CLASS_NAME L"86BoxFullScreen"
|
2020-11-28 07:04:40 +01:00
|
|
|
#define SDL_CLASS_NAME L"86BoxSDLWnd"
|
|
|
|
|
#define SDL_SUB_CLASS_NAME L"86BoxSDLSubWnd"
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2020-04-24 21:24:32 +02:00
|
|
|
#define FLOPPY_SUBMENU_NAME L"FloppySubmenu"
|
|
|
|
|
#define CDROM_SUBMENU_NAME L"CdromSubmenu"
|
|
|
|
|
#define ZIP_SUBMENU_NAME L"ZIPSubmenu"
|
|
|
|
|
#define MO_SUBMENU_NAME L"MOSubmenu"
|
|
|
|
|
|
2019-11-03 03:18:30 +01:00
|
|
|
/* Application-specific window messages.
|
|
|
|
|
|
|
|
|
|
A dialog sends 0x8895 with WPARAM = 1 followed by 0x8896 with WPARAM = 1 on open,
|
|
|
|
|
and 0x8895 with WPARAM = <previous pause status> followed by 0x8896 with WPARAM = 0.
|
|
|
|
|
|
|
|
|
|
All shutdowns will send an 0x8897. */
|
2019-12-05 00:51:07 +01:00
|
|
|
#define WM_LEAVEFULLSCREEN WM_USER
|
2017-10-07 00:46:54 -04:00
|
|
|
#define WM_SAVESETTINGS 0x8888
|
2018-01-19 15:39:13 +01:00
|
|
|
#define WM_SHOWSETTINGS 0x8889
|
|
|
|
|
#define WM_PAUSE 0x8890
|
|
|
|
|
#define WM_SENDHWND 0x8891
|
2018-10-10 22:33:24 +02:00
|
|
|
#define WM_HARDRESET 0x8892
|
|
|
|
|
#define WM_SHUTDOWN 0x8893
|
2018-10-12 16:27:47 +02:00
|
|
|
#define WM_CTRLALTDEL 0x8894
|
2018-10-23 19:45:05 +02:00
|
|
|
/* Pause/resume status: WPARAM = 1 for paused, 0 for resumed. */
|
2018-10-23 19:41:17 +02:00
|
|
|
#define WM_SENDSTATUS 0x8895
|
2019-11-03 03:18:30 +01:00
|
|
|
/* Dialog (Settings or message box) status: WPARAM = 1 for open, 0 for closed. */
|
|
|
|
|
#define WM_SENDDLGSTATUS 0x8896
|
|
|
|
|
/* The emulator has shut down. */
|
|
|
|
|
#define WM_HAS_SHUTDOWN 0x8897
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2020-04-18 11:51:54 +02:00
|
|
|
#ifdef USE_VNC
|
2020-11-26 18:20:24 +01:00
|
|
|
#define RENDERERS_NUM 4
|
2020-04-18 11:51:54 +02:00
|
|
|
#else
|
2020-11-26 18:20:24 +01:00
|
|
|
#define RENDERERS_NUM 3
|
2020-04-18 11:51:54 +02:00
|
|
|
#endif
|
2018-07-15 01:41:53 +02:00
|
|
|
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2020-04-04 12:45:47 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
extern HINSTANCE hinstance;
|
2017-10-19 04:27:04 -04:00
|
|
|
extern HWND hwndMain,
|
|
|
|
|
hwndRender;
|
|
|
|
|
extern HANDLE ghMutex;
|
|
|
|
|
extern LCID lang_id;
|
2018-07-15 01:41:53 +02:00
|
|
|
extern HICON hIcon[256];
|
2020-11-16 22:09:13 +05:00
|
|
|
extern RECT oldclip;
|
2020-12-26 17:21:38 +01:00
|
|
|
extern int sbar_height, user_resize;
|
2017-10-10 03:07:29 -04:00
|
|
|
|
2018-04-26 13:33:29 +02:00
|
|
|
// extern int status_is_open;
|
2017-10-19 04:27:04 -04:00
|
|
|
|
2020-01-15 04:58:28 +01:00
|
|
|
extern char openfilestring[512];
|
|
|
|
|
extern WCHAR wopenfilestring[512];
|
2017-05-22 00:21:22 -04:00
|
|
|
|
2018-01-21 21:39:52 +01:00
|
|
|
extern uint8_t filterindex;
|
|
|
|
|
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2020-12-02 06:11:27 +01:00
|
|
|
extern void ResizeWindowByClientArea(HWND hwnd, int width, int height);
|
2017-11-13 02:06:00 -05:00
|
|
|
extern void InitCrashDump(void);
|
|
|
|
|
|
2017-10-08 19:14:46 -04:00
|
|
|
extern HICON LoadIconEx(PCTSTR pszIconName);
|
|
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
/* Emulator start/stop support functions. */
|
|
|
|
|
extern void do_start(void);
|
|
|
|
|
extern void do_stop(void);
|
|
|
|
|
|
|
|
|
|
/* Internal platform support functions. */
|
|
|
|
|
extern void set_language(int id);
|
|
|
|
|
extern int get_vidpause(void);
|
2017-12-15 00:42:10 -05:00
|
|
|
extern void show_cursor(int);
|
2017-10-08 19:14:46 -04:00
|
|
|
|
2017-10-24 22:10:21 -04:00
|
|
|
extern void keyboard_getkeymap(void);
|
2020-02-04 22:29:01 +08:00
|
|
|
extern void keyboard_handle(PRAWINPUT raw);
|
2017-10-24 22:10:21 -04:00
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
extern void win_mouse_init(void);
|
|
|
|
|
extern void win_mouse_close(void);
|
2020-02-04 22:29:01 +08:00
|
|
|
extern void win_mouse_handle(PRAWINPUT raw);
|
|
|
|
|
|
|
|
|
|
extern void win_joystick_handle(PRAWINPUT raw);
|
2017-12-04 11:59:26 -05:00
|
|
|
|
2019-11-03 03:18:30 +01:00
|
|
|
extern void win_notify_dlg_open(void);
|
|
|
|
|
extern void win_notify_dlg_closed(void);
|
2020-09-02 11:03:14 +08:00
|
|
|
extern int win_get_dpi(HWND hwnd);
|
|
|
|
|
extern int win_get_system_metrics(int i, int dpi);
|
2019-11-03 03:18:30 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
extern LPARAM win_get_string(int id);
|
|
|
|
|
|
2017-12-13 22:39:41 +01:00
|
|
|
extern intptr_t fdd_type_to_icon(int type);
|
2017-10-24 22:10:21 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
extern uint8_t deviceconfig_open(HWND hwnd, const device_t *device);
|
2018-10-23 21:14:41 +02:00
|
|
|
extern uint8_t deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst);
|
2017-10-07 00:46:54 -04:00
|
|
|
#endif
|
2018-01-21 21:39:52 +01:00
|
|
|
extern uint8_t joystickconfig_open(HWND hwnd, int joy_nr, int type);
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-05-22 00:21:22 -04:00
|
|
|
extern int getfile(HWND hwnd, char *f, char *fn);
|
|
|
|
|
extern int getsfile(HWND hwnd, char *f, char *fn);
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-05-22 00:21:22 -04:00
|
|
|
extern void hard_disk_add_open(HWND hwnd, int is_existing);
|
2017-05-27 03:53:32 +02:00
|
|
|
extern int hard_disk_was_added(void);
|
|
|
|
|
|
2017-07-16 17:28:30 +02:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
/* Platform UI support functions. */
|
2017-11-23 17:42:00 -05:00
|
|
|
extern int ui_init(int nCmdShow);
|
2017-11-19 03:15:29 -05:00
|
|
|
|
|
|
|
|
|
2017-10-08 19:14:46 -04:00
|
|
|
/* Functions in win_about.c: */
|
2017-10-07 04:34:04 -04:00
|
|
|
extern void AboutDialogCreate(HWND hwnd);
|
|
|
|
|
|
2017-10-08 19:14:46 -04:00
|
|
|
|
2018-01-17 18:43:36 +01:00
|
|
|
/* Functions in win_snd_gain.c: */
|
|
|
|
|
extern void SoundGainDialogCreate(HWND hwnd);
|
|
|
|
|
|
|
|
|
|
|
2018-01-19 15:39:13 +01:00
|
|
|
/* Functions in win_new_floppy.c: */
|
|
|
|
|
extern void NewFloppyDialogCreate(HWND hwnd, int id, int part);
|
|
|
|
|
|
|
|
|
|
|
2019-02-11 01:54:00 +01:00
|
|
|
/* Functions in win_settings.c: */
|
|
|
|
|
#define SETTINGS_PAGE_MACHINE 0
|
|
|
|
|
#define SETTINGS_PAGE_VIDEO 1
|
|
|
|
|
#define SETTINGS_PAGE_INPUT 2
|
|
|
|
|
#define SETTINGS_PAGE_SOUND 3
|
|
|
|
|
#define SETTINGS_PAGE_NETWORK 4
|
|
|
|
|
#define SETTINGS_PAGE_PORTS 5
|
2020-11-20 05:42:47 +01:00
|
|
|
#define SETTINGS_PAGE_STORAGE 6
|
2019-02-11 01:54:00 +01:00
|
|
|
#define SETTINGS_PAGE_HARD_DISKS 7
|
2020-07-19 06:07:58 +02:00
|
|
|
#define SETTINGS_PAGE_FLOPPY_AND_CDROM_DRIVES 8
|
|
|
|
|
#define SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES 9
|
2020-11-20 05:42:47 +01:00
|
|
|
#define SETTINGS_PAGE_PERIPHERALS 10
|
2019-02-11 01:54:00 +01:00
|
|
|
|
|
|
|
|
extern void win_settings_open(HWND hwnd);
|
|
|
|
|
extern void win_settings_open_ex(HWND hwnd, int category);
|
|
|
|
|
|
|
|
|
|
|
2017-10-08 19:14:46 -04:00
|
|
|
/* Functions in win_stbar.c: */
|
2017-10-07 04:34:04 -04:00
|
|
|
extern HWND hwndSBAR;
|
2017-12-13 22:39:41 +01:00
|
|
|
extern void StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst);
|
2020-04-23 01:24:01 +02:00
|
|
|
extern int MediaMenuHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-10-08 19:14:46 -04:00
|
|
|
|
|
|
|
|
/* Functions in win_dialog.c: */
|
2020-11-17 23:31:38 -06:00
|
|
|
/* Pass NULL in the title param to use the default title. */
|
|
|
|
|
extern int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, WCHAR *title, int save);
|
|
|
|
|
extern int file_dlg(HWND hwnd, WCHAR *f, char *fn, char *title, int save);
|
|
|
|
|
extern int file_dlg_mb(HWND hwnd, char *f, char *fn, char *title, int save);
|
|
|
|
|
extern int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, char *title, int save);
|
|
|
|
|
extern int file_dlg_st(HWND hwnd, int i, char *fn, char *title, int save);
|
2017-10-08 19:14:46 -04:00
|
|
|
|
|
|
|
|
extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
|
|
|
|
|
|
|
|
|
|
|
2020-04-26 15:43:33 +02:00
|
|
|
/* Functions in win_media_menu.c */
|
|
|
|
|
extern void media_menu_init();
|
|
|
|
|
extern void media_menu_reset();
|
2020-04-26 17:00:45 +02:00
|
|
|
extern int media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
2020-04-26 17:59:17 +02:00
|
|
|
extern HMENU media_menu_get_floppy(int id);
|
|
|
|
|
extern HMENU media_menu_get_cdrom(int id);
|
|
|
|
|
extern HMENU media_menu_get_zip(int id);
|
|
|
|
|
extern HMENU media_menu_get_mo(int id);
|
2020-04-26 15:43:33 +02:00
|
|
|
extern void media_menu_update_floppy(int id);
|
|
|
|
|
extern void media_menu_update_cdrom(int id);
|
|
|
|
|
extern void media_menu_update_zip(int id);
|
|
|
|
|
extern void media_menu_update_mo(int id);
|
|
|
|
|
|
|
|
|
|
|
2017-05-22 00:21:22 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-05-19 04:35:59 +02:00
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
#endif /*PLAT_WIN_H*/
|