diff --git a/src/Makefile.local b/src/Makefile.local index 7fdea7d..2490e20 100644 --- a/src/Makefile.local +++ b/src/Makefile.local @@ -10,7 +10,7 @@ # settings, so we can avoid changing the main one for all of # our local setups. # -# Version: @(#)Makefile.local 1.0.7 2018/04/18 +# Version: @(#)Makefile.local 1.0.8 2018/04/23 # # Author: Fred N. van Kempen, # @@ -65,7 +65,6 @@ STUFF := # Add feature selections here. # -DANSI_CFG forces the config file to ANSI encoding -# -DENABLE_LOG_BREAKPOINT enables setting of breakpoints in the logfile # -DENABLE_PCI_LOG=n enables logging for that module, sets level n # -DENABLE_KEYBOARD_LOG=n enables logging for that module, sets level n # -DENABLE_SERIAL_LOG=n enables logging for that module, sets level n diff --git a/src/config.c b/src/config.c index 80bdbda..5f18d1d 100644 --- a/src/config.c +++ b/src/config.c @@ -12,11 +12,11 @@ * it on Windows XP, and possibly also Vista. Use the * -DANSI_CFG for use on these systems. * - * Version: @(#)config.c 1.0.24 2018/05/09 + * Version: @(#)config.c 1.0.28 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, - * Overdoze, + * David Simunic, * Sarah Walker, * * Copyright 2017,2018 Fred N. van Kempen. @@ -290,13 +290,7 @@ load_general(const char *cat) sound_gain = config_get_int(cat, "sound_gain", 0); -#ifdef USE_LANGUAGE - /* - * Currently, we use English (US) only, but - * in the future other languages will be added. - */ - plat_langid = config_get_hex16(cat, "language", 0x0409); -#endif + lang_id = config_get_hex16(cat, "language", lang_id); } @@ -388,12 +382,10 @@ save_general(const char *cat) else config_delete_var(cat, "sound_gain"); -#ifdef USE_LANGUAGE - if (plat_langid == 0x0409) + if (lang_id == 0x0409) config_delete_var(cat, "language"); else - config_set_hex16(cat, "language", plat_langid); -#endif + config_set_hex16(cat, "language", lang_id); delete_section_if_empty(cat); } @@ -725,9 +717,9 @@ load_network(const char *cat) if (p != NULL) { if ((network_dev_to_id(p) == -1) || (network_ndev == 1)) { if ((network_ndev == 1) && strcmp(network_host, "none")) { - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2140); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_PCAP_NO); } else if (network_dev_to_id(p) == -1) { - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2141); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_PCAP_DEV); } strcpy(network_host, "none"); @@ -1543,9 +1535,6 @@ config_default(void) int i; cpu = 0; -#ifdef USE_LANGUAGE - plat_langid = 0x0409; -#endif scale = 1; video_card = VID_CGA; vid_api = vidapi_from_internal_name("default");; @@ -1664,12 +1653,13 @@ config_read(const wchar_t *fn) list_add(&ne->list, &sec->entry_head); } + c = !ferror(f); (void)fclose(f); if (do_dump_config) config_dump(); - return(1); + return(c); } @@ -1730,28 +1720,28 @@ config_write(const wchar_t *fn) /* Load the specified or a default configuration file. */ -void +int config_load(void) { - int i; + int i = 0; - pclog("CONFIG: loading file '%ls'..\n", cfg_path); - if (! config_read(cfg_path)) { + if (config_read(cfg_path)) { + /* Load all the categories. */ + for (i = 0; categories[i].name != NULL; i++) + categories[i].load(categories[i].name); + + /* Mark the configuration as changed. */ + config_changed = 1; + } else { pclog("CONFIG: file not present or invalid, using defaults!\n"); config_default(); - return; + /* Flag this as an invalid configuration. */ + machine = -1; } - /* Load all the categories. */ - for (i = 0; categories[i].name != NULL; i++) - categories[i].load(categories[i].name); - - /* Mark the configuration as changed. */ - config_changed = 1; - - pclog("CONFIG: file loaded.\n\n"); + return(i); } diff --git a/src/config.h b/src/config.h index 8440651..ccb53c2 100644 --- a/src/config.h +++ b/src/config.h @@ -8,7 +8,7 @@ * * Configuration file handler header. * - * Version: @(#)config.h 1.0.2 2018/04/10 + * Version: @(#)config.h 1.0.3 2018/05/16 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -44,7 +44,7 @@ extern "C" { #endif -extern void config_load(void); +extern int config_load(void); extern void config_save(void); extern void config_write(const wchar_t *fn); extern void config_dump(void); diff --git a/src/device.c b/src/device.c index 935bfc5..cf6fe52 100644 --- a/src/device.c +++ b/src/device.c @@ -9,7 +9,7 @@ * Implementation of the generic device interface to handle * all devices attached to the emulator. * - * Version: @(#)device.c 1.0.10 2018/05/09 + * Version: @(#)device.c 1.0.11 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -93,7 +93,7 @@ device_add(const device_t *d) */ if (d->flags & DEVICE_UNSTABLE) { mbstowcs(devname, d->name, sizeof_w(devname)); - swprintf(temp, sizeof_w(temp), get_string(IDS_2144), devname); + swprintf(temp, sizeof_w(temp), get_string(IDS_MSG_UNSTABL), devname); /* Show the messagebox, and abort if 'No' was selected. */ if (ui_msgbox(MBX_WARNING, temp) == 1) return(0); diff --git a/src/devices/disk/hdd.c b/src/devices/disk/hdd.c index 279a085..c1b9b90 100644 --- a/src/devices/disk/hdd.c +++ b/src/devices/disk/hdd.c @@ -8,7 +8,7 @@ * * Common code to handle all sorts of hard disk images. * - * Version: @(#)hdd.c 1.0.6 2018/05/06 + * Version: @(#)hdd.c 1.0.7 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -101,7 +101,7 @@ hdd_string_to_bus(char *str, int cdrom) if (!strcmp(str, "st506") || !strcmp(str, "mfm")) { if (cdrom) { no_cdrom: - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_4114); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_NOCDROM); return(0); } @@ -154,7 +154,7 @@ no_cdrom: } if (! strcmp(str, "usb")) - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_4110); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_NO_USB); return(0); } diff --git a/src/devices/network/network.c b/src/devices/network/network.c index 0f666d6..e5d2785 100644 --- a/src/devices/network/network.c +++ b/src/devices/network/network.c @@ -12,7 +12,7 @@ * it should be malloc'ed and then linked to the NETCARD def. * Will be done later. * - * Version: @(#)network.c 1.0.9 2018/05/06 + * Version: @(#)network.c 1.0.10 2018/05/24 * * Author: Fred N. van Kempen, * @@ -372,7 +372,7 @@ network_reset(void) if (i < 0) { /* Tell user we can't do this (at the moment.) */ - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2139); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_PCAP); // FIXME: we should ask in the dialog if they want to // reconfigure or quit, and throw them into the diff --git a/src/devices/sound/midi_fluidsynth.c b/src/devices/sound/midi_fluidsynth.c index 2dd6e54..a9ba901 100644 --- a/src/devices/sound/midi_fluidsynth.c +++ b/src/devices/sound/midi_fluidsynth.c @@ -17,7 +17,7 @@ * website (for 32bit and 64bit Windows) are working, and * need no additional support files other than sound fonts. * - * Version: @(#)midi_fluidsynth.c 1.0.9 2018/05/06 + * Version: @(#)midi_fluidsynth.c 1.0.11 2018/05/24 * * Code borrowed from scummvm. * @@ -380,7 +380,7 @@ fluidsynth_close(void* priv) if (priv == NULL) return; if (fluidsynth_handle == NULL) { - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2171); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_FSYNTH); return; } @@ -426,6 +426,10 @@ fluidsynth_global_init(void) { /* Try loading the DLL. */ fluidsynth_handle = dynld_module(PATH_FS_DLL, fluidsynth_imports); + if (fluidsynth_handle == NULL) { + pclog("SOUND: unable to load '%s', FluidSynth not available!\n", + PATH_FS_DLL); + } } diff --git a/src/devices/sound/openal.c b/src/devices/sound/openal.c index 0806f12..d9e348e 100644 --- a/src/devices/sound/openal.c +++ b/src/devices/sound/openal.c @@ -8,7 +8,7 @@ * * Interface to the OpenAL sound processing library. * - * Version: @(#)openal.c 1.0.12 2018/05/09 + * Version: @(#)openal.c 1.0.14 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -209,11 +209,15 @@ initalmain(int argc, char *argv[]) if (openal_handle == NULL) { openal_handle = dynld_module(PATH_AL_DLL, openal_imports); if (openal_handle == NULL) { - pclog("SOUND: unable to load module '%s' !\n", PATH_AL_DLL); - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2178); + pclog("SOUND: unable to load '%s' - sound disabled!\n", + PATH_AL_DLL); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_OPENAL); return; - } else + } else { +#ifdef _DEBUG pclog("SOUND: module '%s' loaded.\n", PATH_AL_DLL); +#endif + } } alutInit(NULL, NULL); diff --git a/src/devices/video/vid_voodoo.c b/src/devices/video/vid_voodoo.c index c9548c9..efdc9cc 100644 --- a/src/devices/video/vid_voodoo.c +++ b/src/devices/video/vid_voodoo.c @@ -2701,14 +2701,19 @@ static inline void voodoo_tmu_fetch_and_blend(voodoo_t *voodoo, voodoo_params_t state->tex_a[0] ^= 0xff; } -#if ((defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _WIN32) && !(defined __amd64__) && (defined USE_DYNAREC)) +#ifdef _WIN32 +#if ((defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_) || defined(_WIN32)) && !(defined(__amd64__)) && (defined(USE_DYNAREC))) #include "vid_voodoo_codegen_x86.h" -#elif ((defined __amd64__) && (defined USE_DYNAREC)) +#elif ((defined(__amd64__)) && (defined(USE_DYNAREC))) #include "vid_voodoo_codegen_x86-64.h" #else #define NO_CODEGEN static int voodoo_recomp = 0; #endif +#else +#define NO_CODEGEN +static int voodoo_recomp = 0; +#endif static void voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *state, int ystart, int yend, int odd_even) { diff --git a/src/devices/video/vid_voodoo_codegen_x86.h b/src/devices/video/vid_voodoo_codegen_x86.h index 1350e1f..d7c1810 100644 --- a/src/devices/video/vid_voodoo_codegen_x86.h +++ b/src/devices/video/vid_voodoo_codegen_x86.h @@ -8,7 +8,7 @@ * * Implementation of the Voodoo Recompiler (32bit.) * - * Version: @(#)vid_voodoo_codegen_x86.h 1.0.3 2018/05/04 + * Version: @(#)vid_voodoo_codegen_x86.h 1.0.4 2018/05/16 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -47,17 +47,18 @@ fbzColorPath */ -#ifdef __linux__ -# include -# include -#endif -#if defined WIN32 || defined _WIN32 || defined _WIN32 +#if defined(WIN32) || defined(_WIN32) # include +# ifdef _MSC_VER +# include +# endif +#else +# ifdef __linux__ +# include +# include +# endif #endif -#ifdef _MSC_VER -# include -#endif #include #define BLOCK_NUM 8 diff --git a/src/emu.h b/src/emu.h index a57d8d7..623f272 100644 --- a/src/emu.h +++ b/src/emu.h @@ -8,7 +8,7 @@ * * Main include file for the application. * - * Version: @(#)emu.h 1.0.22 2018/05/09 + * Version: @(#)emu.h 1.0.25 2018/06/02 * * Author: Fred N. van Kempen, * @@ -53,6 +53,7 @@ #define SCREEN_RES_Y 480 /* Pre-defined directory names. */ +#define LANGUAGE_PATH L"lang" #define MACHINES_PATH L"machines" #define NVR_PATH L"nvr" #define ROMS_PATH L"roms" @@ -60,10 +61,15 @@ #define VIDEO_PATH L"video" /* Pre-defined file names and extensions. */ +#define LANG_FILE L"VARCem-" #define BIOS_FILE L"bios.txt" #define CONFIG_FILE L"config.varc" #define CONFIG_FILE_EXT L".varc" +/* Pre-defined URLs to websites. */ +#define URL_VARCEM L"https://www.VARCem.com/" +#define URL_PAYPAL L"https://www.paypal.me/VARCem" + #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define ABS(x) ((x) > 0 ? (x) : -(x)) @@ -89,6 +95,7 @@ extern wchar_t log_path[1024]; /* (O) full path of logfile */ /* Configuration variables. */ +extern int lang_id; /* (C) language ID */ extern int window_w, window_h, /* (C) window size and */ window_x, window_y, /* position info */ window_remember; diff --git a/src/pc.c b/src/pc.c index e4372f3..b579c1f 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Main emulator module where most things are controlled. * - * Version: @(#)pc.c 1.0.42 2018/05/11 + * Version: @(#)pc.c 1.0.46 2018/05/26 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -104,6 +104,7 @@ int config_ro = 0; /* (O) dont modify cfg file */ wchar_t log_path[1024] = { L'\0'}; /* (O) full path of logfile */ /* Configuration values. */ +int lang_id = 0; /* (C) language ID */ int window_w, window_h, /* (C) window size and */ window_x, window_y, /* position info */ window_remember; @@ -400,7 +401,7 @@ pc_setup(int argc, wchar_t *argv[]) char temp[128]; struct tm *info; time_t now; - int c; + int c, ret = 0; /* Grab the executable's full path. */ plat_get_exe_name(emu_path, sizeof(emu_path)-1); @@ -442,7 +443,7 @@ pc_setup(int argc, wchar_t *argv[]) plat_getcwd(usr_path, sizeof_w(usr_path)-1); memset(path, 0x00, sizeof(path)); - for (c=1; cexit(i); floppy_close(); @@ -941,6 +961,9 @@ pc_reset_hard_init(void) if (bugger_enabled) device_add(&bugger_device); + /* Needs the status bar initialized. */ + plat_mouse_capture(-1); + /* Reset the CPU module. */ cpu_set(); resetx86(); @@ -1112,15 +1135,6 @@ pc_thread(void *param) #endif EMU_NAME,emu_version,fps,machine_getname(), machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].name); - if (mouse_type != MOUSE_NONE) { - wcscat(temp, L" - "); - if (!mouse_capture) { - wcscat(temp, get_string(IDS_2077)); - } else { - wcscat(temp, (mouse_get_buttons() > 2) ? get_string(IDS_2078) : get_string(IDS_2079)); - } - } - ui_window_title(temp); title_update = 0; diff --git a/src/plat.h b/src/plat.h index 67beb87..fd062f8 100644 --- a/src/plat.h +++ b/src/plat.h @@ -8,7 +8,7 @@ * * Define the various platform support functions. * - * Version: @(#)plat.h 1.0.14 2018/05/09 + * Version: @(#)plat.h 1.0.16 2018/05/18 * * Author: Fred N. van Kempen, * @@ -124,8 +124,9 @@ extern const string_t *plat_strings; #ifdef _WIN32 extern void plat_console(int on); #endif +extern void plat_set_language(int id); extern wchar_t *fix_emu_path(const wchar_t *str); -extern FILE *plat_fopen(const wchar_t *path, wchar_t *mode); +extern FILE *plat_fopen(const wchar_t *path, const wchar_t *mode); extern void plat_remove(const wchar_t *path); extern int plat_getcwd(wchar_t *bufp, int max); extern int plat_chdir(const wchar_t *path); diff --git a/src/rom_load.c b/src/rom_load.c index 3685cb5..8b1e91e 100644 --- a/src/rom_load.c +++ b/src/rom_load.c @@ -17,7 +17,7 @@ * or to use a generic handler, and then pass it a pointer * to a command table. For now, we don't. * - * Version: @(#)rom_load.c 1.0.10 2018/05/09 + * Version: @(#)rom_load.c 1.0.11 2018/05/27 * * Author: Fred N. van Kempen, * @@ -129,6 +129,8 @@ again: /* Load a video controller font. */ r->fontnum = atoi(argv[1]); mbstowcs(r->fontfn, argv[2], sizeof_w(r->fontfn)); + } else if (! strcmp(argv[0], "md5sum")) { + /* Skip for now. */ } else if (! strcmp(argv[0], "video")) { /* Load a video controller BIOS. */ mbstowcs(r->vidfn, argv[1], sizeof_w(r->vidfn)); diff --git a/src/ui/lang/VARCem-CZ.str b/src/ui/lang/VARCem-CZ.str new file mode 100644 index 0000000..7d326e2 Binary files /dev/null and b/src/ui/lang/VARCem-CZ.str differ diff --git a/src/ui/lang/VARCem-DE.str b/src/ui/lang/VARCem-DE.str new file mode 100644 index 0000000..dff0878 Binary files /dev/null and b/src/ui/lang/VARCem-DE.str differ diff --git a/src/ui/lang/VARCem-DU.str b/src/ui/lang/VARCem-DU.str new file mode 100644 index 0000000..79e2c6c Binary files /dev/null and b/src/ui/lang/VARCem-DU.str differ diff --git a/src/ui/lang/VARCem-EN.str b/src/ui/lang/VARCem-EN.str new file mode 100644 index 0000000..8b70168 --- /dev/null +++ b/src/ui/lang/VARCem-EN.str @@ -0,0 +1,402 @@ +/* + * VARCem Virtual ARchaeological Computer EMulator. + * An emulator of (mostly) x86-based PC systems and devices, + * using the ISA,EISA,VLB,MCA and PCI system buses, roughly + * spanning the era between 1981 and 1995. + * + * This file is part of the VARCem Project. + * + * String definitions for "English (United States) language. + * + * TRANSLATION: The application uses English as its primary language, and + * this file is the "Master" for all translations. Please use + * it as the line-by-line base for the translated version, and + * update fields as needed. + * + * Version: @(#)VARCem-EN.str 1.0.5 2018/06/02 + * + * Author: Fred N. van Kempen, + * + * Copyright 2017,2018 Fred N. van Kempen. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Do not translate! */ +#define TAG_VERSION 1,0,1 +#define TAG_AUTHOR "Your Name" +#define TAG_EMAIL "your@email.address" + +/* Messagebox classes (2100.) */ +#define STR_2100 "Error" +#define STR_2101 "Fatal Error" +#define STR_2102 "Configuration Error" +#define STR_2103 "Warning" + + +/* System errors (2200.) */ +#define STR_2200 "Unable to load Keyboard Accelerators!" +#define STR_2201 "Unable to register Raw Input!" +#define STR_2202 "PCap failed to set up because it may not be initialized" +#define STR_2203 "No PCap devices found" +#define STR_2204 "Invalid PCap device" +#define STR_2205 "Unable to initialize OpenAL, make sure you have the following library\nin your program folder:\n\nlibopenal-1.dll" +#define STR_2206 "Unable to initialize FluidSynth, make sure you have the following library\nin your program folder:\n\nlibfluidsynth.dll" + + +/* Application error messages (2300.) */ +#define STR_2300 "Unable to create bitmap file: %s" +#define STR_2301 "No usable ROM images found!" +#define STR_2302 "No valid configuration found.\n\nWould you like to enter the Settings dialog to create one?" +#define STR_2303 "The configured machine:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?" +#define STR_2304 "Configured video card:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?" +#define STR_2305 "Selected renderer '%S' not available. Reset to default?" +#define STR_2306 "ST506 or ESDI CD-ROM drives never existed" +#define STR_2307 "USB is not yet supported" + + +/* Application messages (2400.) */ +#define STR_2400 "Are you sure you want to save these settings?\n\n(A restart may be needed...)" +#define STR_2401 "Changes saved, please restart the emulator!" +#define STR_2402 "The requested device '%ls' is currently considered to be `Under Development` and might cause problems.\n\nAre you sure you want to enable it?" +#define STR_2403 "Click to capture mouse" +#define STR_2404 "Press F8+F12 to release mouse" +#define STR_2405 "Press F8+F12 or middle button to release mouse" +#define STR_2406 "Use CTRL+ALT+PAGE DOWN to return to windowed mode" + + +/* Misc application strings (2500.) */ +#define STR_2500 "Configuration files\0*.varc\0All files\0*.*\0" + + +/* UI: common elements (3000.) */ +#define STR_OK "OK" +#define STR_CANCEL "Cancel" +#define STR_CONFIGURE "Configure" +#define STR_BROWSE "Browse" + +/* UI: dialog shared strings (3100.) */ +#define STR_NONE "None" +#define STR_DISABLED "Disabled" +#define STR_ENABLED "Enabled" +#define STR_OFF "Off" +#define STR_ON "On" +#define STR_TYPE "Type" +#define STR_FILENAME "File name:" +#define STR_PROGRESS "Progress:" +#define STR_BUS "Bus:" +#define STR_CHANNEL "Channel:" +#define STR_ID "ID:" +#define STR_LUN "LUN:" +#define STR_INV_NAME "Please enter a valid file name" +#define STR_IMG_EXIST "This image exists and will be overwritten.\nAre you sure you want to use it?" +#define STR_OPEN_READ "Unable to open the file for read" +#define STR_OPEN_WRITE "Unable to open the file for write" +#define STR_DEVCONF_1 "Configuration" +#define STR_DEVCONF_2 "Device:" + + +/* UI: dialog: About (3200.) */ +#define STR_ABOUT "About VARCem.." +#define STR_3201 "Authors:" +#define STR_3202 "Fred N. van Kempen, Miran Grca, Sarah Walker and others.\nBased on earlier works like 86Box, PCem, MAME, DOSbox and Qemu." +#define STR_3203 "Released under the BSD 3-Clause License, and the GNU General Public License (version 2 or up) for existing, imported code from other projects." +#define STR_3204 "See LICENSE.txt for more information." + +/* UI: dialog: Localization (3210.) */ +#define STR_LOCALIZE "Localization" +#define STR_3211 "Translations from English to these other languages contributed by:" + +/* UI dialog: Status (3225.) */ +#define STR_STATUS "Status" + +/* UI dialog: Sound Gain (3250.) */ +#define STR_SNDGAIN "Sound Gain" +#define STR_3251 "Gain" + +/* UI dialog: New Image (3275.) */ +#define STR_NEWIMG "New Floppy Image" +#define STR_3276 "Disk size:" +#define STR_3277 "RPM mode:" +#define STR_3278 "Perfect RPM" +#define STR_3279 "1% below perfect RPM" +#define STR_3280 "1.5% below perfect RPM" +#define STR_3281 "2% below perfect RPM" +#define STR_3282 "160 KB" +#define STR_3283 "180 KB" +#define STR_3284 "320 KB" +#define STR_3285 "360 KB" +#define STR_3286 "640 KB" +#define STR_3287 "720 KB" +#define STR_3288 "1.2 MB" +#define STR_3289 "1.25 MB" +#define STR_3290 "1.44 MB" +#define STR_3291 "DMF (cluster 1024)" +#define STR_3292 "DMF (cluster 2048)" +#define STR_3293 "2.88 MB" +#define STR_3294 "ZIP 100" +#define STR_3295 "ZIP 250" + +/* UI dialog: Settings (3300.) */ +#define STR_SETTINGS "Settings" +#define STR_3310 "Machine" +#define STR_3311 "Display" +#define STR_3312 "Input devices" +#define STR_3313 "Sound" +#define STR_3314 "Network" +#define STR_3315 "Ports (COM & LPT)" +#define STR_3316 "Other peripherals" +#define STR_3317 "Hard disks" +#define STR_3318 "Floppy drives" +#define STR_3319 "Other removable devices" + +/* UI dialog: Settings (Machine, 3325.) */ +#define STR_3325 "Machine:" +#define STR_3326 "CPU type:" +#define STR_3327 "CPU:" +#define STR_3328 "Wait states:" +#define STR_3329 "Memory:" +#define STR_3330 "MB" +#define STR_3331 "Enable time sync" +#define STR_3332 "Enable FPU" +#define STR_3333 "Dynamic Recompiler" +#define STR_3334 "KB" +#define STR_3335 "Default" + +/* UI dialog: Settings (Video, 3350.) */ +#define STR_3350 "Video:" +#define STR_3351 "Video speed:" +#define STR_3352 "Voodoo Graphics" +#define STR_3353 "Default" +#define STR_3354 "8-bit" +#define STR_3355 "Slow 16-bit" +#define STR_3356 "Fast 16-bit" +#define STR_3357 "Slow VLB/PCI" +#define STR_3358 "Mid VLB/PCI" +#define STR_3359 "Fast VLB/PCI" + +/* UI dialog: Settings (Input, 3375.) */ +#define STR_3375 "Mouse:" +#define STR_3376 "Joystick:" +#define STR_3377 "Joystick 1" +#define STR_3378 "Joystick 2" +#define STR_3379 "Joystick 3" +#define STR_3380 "Joystick 4" + +/* UI dialog: Settings (Sound, 3400.) */ +#define STR_3400 "Sound card:" +#define STR_3401 "MIDI Out Device:" +#define STR_3402 "Standalone MPU-401" +#define STR_3403 "Use Nuked OPL" +#define STR_3404 "Use FLOAT32 sound" + +/* UI dialog: Settings (Network, 3425.) */ +#define STR_3425 "Network type:" +#define STR_3426 "PCap device:" +#define STR_3427 "Network adapter:" + +/* UI dialog: Settings (Ports, 3450.) */ +#define STR_3450 "Game port" +#define STR_3451 "Parallel port 1" +#define STR_3452 "Parallel port 2" +#define STR_3453 "Parallel port 3" +#define STR_3454 "Serial port 1" +#define STR_3455 "Serial port 2" + +/* UI dialog: Settings (Other Devices, 3475.) */ +#define STR_3475 "SCSI Controller:" +#define STR_3476 "HD Controller:" +#define STR_3477 "Tertiary IDE:" +#define STR_3478 "Quaternary IDE:" +#define STR_3479 "ISABugger device:" + +/* UI dialog: Settings (Hard Disks, 3500.) */ +#define STR_3500 "Hard disks:" +#define STR_3501 "&New.." +#define STR_3502 "&Existing.." +#define STR_3503 "&Remove" +#define STR_3504 "Bus" +#define STR_3505 "File" +#define STR_3506 "C" +#define STR_3507 "H" +#define STR_3508 "S" +#define STR_3509 "MB" +#define STR_3510 "MB (CHS: %u, %u, %u)" +#define STR_3511 "Custom..." +#define STR_3512 "Custom (large)..." +#define STR_3515 "ST506" +#define STR_3516 "ESDI" +#define STR_3517 "IDE (PIO-only)" +#define STR_3518 "IDE (PIO+DMA)" +#define STR_3519 "SCSI" +#define STR_3520 "SCSI (removable)" +#define STR_3521 "USB" + +/* UI dialog: Settings (Add Hard Disk, 3525.) */ +#define STR_3525 "Add Hard Disk" +#define STR_3526 "Add New Hard Disk" +#define STR_3527 "Add Existing Hard Disk" +#define STR_3528 "Cylinders:" +#define STR_3529 "Heads:" +#define STR_3530 "Sectors:" +#define STR_3531 "Size (MB):" +#define STR_3532 "Type:" +#define STR_3533 "Attempting to create a HDI image larger than 4 GB" +#define STR_3534 "Attempting to create a spuriously large hard disk image" +#define STR_3535 "HDI or HDX image with a sector size that is not 512 are not supported" +#define STR_3536 "Hard disk images\0*.hd?;*.im?;*.vhd\0All files\0*.*\0" +#define STR_3537 "Remember to partition and format the new drive" + +/* UI dialog: Settings (Floppy Drives, 3550.) */ +#define STR_3550 "Floppy drives:" +#define STR_3551 "Type:" +#define STR_3552 "Turbo timings" +#define STR_3553 "Check BPB" +#define STR_3554 "Turbo" +#define STR_3555 "Check BPB" + +/* UI dialog: Settings (Removable Devices, 3575.) */ +#define STR_3575 "CD-ROM drives:" +#define STR_3576 "Speed:" +#define STR_3577 "ZIP drives:" +#define STR_3578 "ZIP 250" +#define STR_3579 "Speed" +#define STR_3580 "" +#define STR_3581 "" +#define STR_3582 "ATAPI (PIO-only)" +#define STR_3583 "ATAPI (PIO+DMA)" +#define STR_3584 "SCSI" +#define STR_3585 "USB" + +/* UI dialog: status bar (3900.) */ +#define STR_3900 "(empty)" +#define STR_3901 "(host drive %c:)" +#define STR_3902 " [Write Protected]" +#define STR_3903 "&New image.." +#define STR_3904 "&Load image.." +#define STR_3905 "&Reload previous image" +#define STR_3906 "&Unload" + +#define STR_3910 "Floppy %i (%s): %ls" +#define STR_3911 "All images\0*.0??;*.1??;*.360;*.720;*.86f;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.json;*.td0;*.*fd?;*.xdf\0Advanced sector images\0*.imd;*.json;*.td0\0Basic sector images\0*.0??;*.1??;*.360;*.720;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.xdf;*.*fd?\0Flux images\0*.fdi\0Surface images\0*.86f\0All files\0*.*\0" +#define STR_3912 "All images\0*.86f;*.dsk;*.flp;*.im?;*.*fd?\0Basic sector images\0*.dsk;*.flp;*.im?;*.img;*.*fd?\0Surface images\0*.86f\0" +#define STR_3913 "Surface images\0*.86f\0" +#define STR_3914 "E&xport to 86F..." + +#define STR_3920 "CD-ROM %i (%s): %s" +#define STR_3921 "Host CD/DVD Drive (%c:)" +#define STR_3922 "CD-ROM images\0*.iso;*.cue\0All files (*.*)\0*.*\0" +#define STR_3923 "&Mute" + +#define STR_3930 "Hard disk (%s)" + +#define STR_3940 "Removable disk %i: %ls" +#define STR_3941 "&Notify disk change" + +#define STR_3950 "ZIP %i (%03i): %ls" +#define STR_3951 "ZIP images\0*.im?;*.zdi\0All files\0*.*\0" +#define STR_3952 "ZIP images\0*.im?;*.zdi\0" +#define STR_3960 "Network" +#define STR_3970 "Sound" + + +/* Menu: Action (4000.) */ +#define STR_ACTION "&Action" +#define STR_4001 "&Hard Reset" +#define STR_4002 "&Ctrl+Alt+Del" +#define STR_4003 "Send Ctrl+Alt+&Esc" +#define STR_4004 "Send Ctrl+Alt+&Break" +#define STR_4005 "&Pause" +#define STR_4006 "E&xit" + +/* Menu: View (4010.) */ +#define STR_VIEW "&View" +#define STR_4011 "&Resizeable window" +#define STR_4012 "R&emember size && position" +#define STR_4013 "&Fullscreen\tCtrl+Alt+PageUP" +#define STR_4014 "R&ight CTRL is left ALT" +#define STR_4015 "&Update status bar icons" + +/* Menu: View > Renderer */ +#define STR_4020 "Re&nderer" + +/* Menu: View > Window Scale Factor */ +#define STR_4030 "&Window scale factor" +#define STR_4031 "&0.5x" +#define STR_4032 "&1x" +#define STR_4033 "1.&5x" +#define STR_4034 "&2x" + +/* Menu: View > Fullscreen Stretch Mode */ +#define STR_4040 "Fullscreen &stretch mode" +#define STR_4041 "&Full screen stretch" +#define STR_4042 "&4:3" +#define STR_4043 "&Square pixels" +#define STR_4044 "&Integer scale" +#define STR_4045 "&Keep size" + +/* Menu: Display (4050.) */ +#define STR_DISPLAY "&Display" +#define STR_4051 "&Inverted display" +#define STR_4052 "Enable &overscan" +#define STR_4053 "F&orce 4:3 display ratio" +#define STR_4054 "Change &contrast for monochrome display" + +/* Menu: Display > Display Type */ +#define STR_DISPTYPE "Display &type" +#define STR_4061 "RGB &Color monitor" +#define STR_4062 "&Grayscale monitor" +#define STR_4063 "&Amber monitor" +#define STR_4064 "&Green monitor" +#define STR_4065 "&White monitor" + +/* Menu: Display > Grayscale Conversion Type */ +#define STR_GRAYSCALE "&Grayscale conversion type" +#define STR_4071 "BT&601 (NTSC/PAL)" +#define STR_4072 "BT&709 (HDTV)" +#define STR_4073 "&Average" + +/* Menu: Tools (4080.) */ +#define STR_TOOLS "&Tools" +#define STR_4081 "&Settings" +#define STR_4082 "&Language" +#define STR_4083 "L&ogging" +#define STR_4084 "Load &configuration" +#define STR_4085 "S&ave configuration" +#define STR_4086 "Stat&us" +#define STR_4087 "&Take screenshot\tCtrl+Home" + +/* Menu: Help (4090.) */ +#define STR_HELP "&Help" +#define STR_4091 "&About VARCem" + + +/* End of file. */ diff --git a/src/ui/lang/VARCem-ES.str b/src/ui/lang/VARCem-ES.str new file mode 100644 index 0000000..b3a7bd4 Binary files /dev/null and b/src/ui/lang/VARCem-ES.str differ diff --git a/src/ui/lang/VARCem-FI.str b/src/ui/lang/VARCem-FI.str new file mode 100644 index 0000000..328edb2 Binary files /dev/null and b/src/ui/lang/VARCem-FI.str differ diff --git a/src/ui/lang/VARCem-FR.str b/src/ui/lang/VARCem-FR.str new file mode 100644 index 0000000..3c5b688 Binary files /dev/null and b/src/ui/lang/VARCem-FR.str differ diff --git a/src/ui/lang/VARCem-IT.str b/src/ui/lang/VARCem-IT.str new file mode 100644 index 0000000..a353302 Binary files /dev/null and b/src/ui/lang/VARCem-IT.str differ diff --git a/src/ui/lang/VARCem-JP.str b/src/ui/lang/VARCem-JP.str new file mode 100644 index 0000000..bb24726 Binary files /dev/null and b/src/ui/lang/VARCem-JP.str differ diff --git a/src/ui/lang/VARCem-KR.str b/src/ui/lang/VARCem-KR.str new file mode 100644 index 0000000..4c557e6 Binary files /dev/null and b/src/ui/lang/VARCem-KR.str differ diff --git a/src/ui/lang/VARCem-RU.str b/src/ui/lang/VARCem-RU.str new file mode 100644 index 0000000..670efa9 Binary files /dev/null and b/src/ui/lang/VARCem-RU.str differ diff --git a/src/ui/lang/VARCem-SL.str b/src/ui/lang/VARCem-SL.str new file mode 100644 index 0000000..2c4474a Binary files /dev/null and b/src/ui/lang/VARCem-SL.str differ diff --git a/src/ui/lang/VARCem-UA.str b/src/ui/lang/VARCem-UA.str new file mode 100644 index 0000000..1d3c4be Binary files /dev/null and b/src/ui/lang/VARCem-UA.str differ diff --git a/src/ui/ui.h b/src/ui/ui.h index 19a234e..8a9bf3e 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -8,7 +8,7 @@ * * Define the various UI functions. * - * Version: @(#)ui.h 1.0.10 2018/05/13 + * Version: @(#)ui.h 1.0.13 2018/05/23 * * Author: Fred N. van Kempen, * @@ -97,11 +97,7 @@ defined(ENABLE_SCSI_BUS_LOG) || defined(ENABLE_SCSI_DISK_LOG) || \ defined(ENABLE_SCSI_DEV_LOG) || \ defined(ENABLE_VOODOO_LOG) -# define ENABLE_LOG_TOGGLES 1 -#endif - -#if defined(ENABLE_LOG_BREAKPOINT) -# define ENABLE_LOG_COMMANDS 1 +# define ENABLE_LOGGING #endif @@ -109,7 +105,7 @@ extern "C" { #endif -#ifdef ENABLE_LOG_TOGGLES +#ifdef ENABLE_LOGGING extern int pci_do_log; extern int keyboard_do_log; extern int mouse_do_log; @@ -140,13 +136,15 @@ extern int voodoo_do_log; extern void ui_show_cursor(int on); extern void ui_show_render(int on); extern void ui_resize(int x, int y); -extern int ui_msgbox(int type, void *arg); +extern int ui_msgbox(int type, const void *arg); +extern void ui_update(void); extern void ui_menu_reset_all(void); extern int ui_menu_command(int idm); extern void ui_menu_set_logging_item(int idm, int val); extern void ui_menu_toggle_video_item(int idm, int *val); /* Main GUI helper functions. */ +extern void menu_add_item(int idm, int id, const wchar_t *str); extern void menu_enable_item(int idm, int val); extern void menu_set_item(int idm, int val); extern void menu_set_radio_item(int idm, int num, int val); diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 332cb8a..15d7b31 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -11,7 +11,7 @@ * This code is called by the UI frontend modules, and, also, * depends on those same modules for lower-level functions. * - * Version: @(#)ui_main.c 1.0.15 2018/05/11 + * Version: @(#)ui_main.c 1.0.17 2018/05/24 * * Author: Fred N. van Kempen, * @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "../emu.h" #include "../config.h" @@ -60,165 +61,192 @@ #include "ui.h" -#if defined(ENABLE_LOG_TOGGLES) || defined(ENABLE_LOG_COMMANDS) +#ifdef ENABLE_LOGGING /* Simplest way to handle all these, for now.. */ void ui_menu_set_logging_item(int idm, int val) { - int *ptr = NULL; + char temp[128]; + wchar_t tmpw[128]; + void *ptr = NULL; + int *iptr, i; switch(idm) { #ifdef ENABLE_BUS_LOG case IDM_LOG_BUS: - ptr = &pci_do_log; + ptr = (val != -3) ? &pci_do_log : (void *)"Bus"; break; #endif #ifdef ENABLE_KEYBOARD_LOG case IDM_LOG_KEYBOARD: - ptr = &keyboard_do_log; + ptr = (val != -3) ? &keyboard_do_log : (void *)"Keyboard"; break; #endif #ifdef ENABLE_MOUSE_LOG case IDM_LOG_MOUSE: - ptr = &mouse_do_log; + ptr = (val != -3) ? &mouse_do_log : (void *)"Mouse"; break; #endif #ifdef ENABLE_GAME_LOG case IDM_LOG_GAME: - ptr = &game_do_log; + ptr = (val != -3) ? &game_do_log : (void *)"Game Port"; break; #endif #ifdef ENABLE_PARALLEL_LOG case IDM_LOG_PARALLEL: - ptr = ¶llel_do_log; + ptr = (val != -3) ? ¶llel_do_log : (void *)"Parallel Port"; + break; +#endif + +#ifdef ENABLE_SERIAL_LOG + case IDM_LOG_SERIAL: + ptr = (val != -3) ? &serial_do_log : (void *)"Serial Port"; break; #endif #ifdef ENABLE_FDC_LOG case IDM_LOG_FDC: - ptr = &fdc_do_log; + ptr = (val != -3) ? &fdc_do_log : (void *)"FDC"; break; #endif #ifdef ENABLE_FDD_LOG case IDM_LOG_FDD: - ptr = &fdd_do_log; + ptr = (val != -3) ? &fdd_do_log : (void *)"FDD (image)"; break; #endif #ifdef ENABLE_D86F_LOG case IDM_LOG_D86F: - ptr = &d86f_do_log; + ptr = (val != -3) ? &d86f_do_log : (void *)"D86F"; break; #endif #ifdef ENABLE_HDC_LOG case IDM_LOG_HDC: - ptr = &hdc_do_log; + ptr = (val != -3) ? &hdc_do_log : (void *)"HDC"; break; #endif #ifdef ENABLE_HDD_LOG case IDM_LOG_HDD: - ptr = &hdd_do_log; + ptr = (val != -3) ? &hdd_do_log : (void *)"HDD (image)"; break; #endif #ifdef ENABLE_ZIP_LOG case IDM_LOG_ZIP: - ptr = &zip_do_log; + ptr = (val != -3) ? &zip_do_log : (void *)"ZIP"; break; #endif #ifdef ENABLE_CDROM_LOG case IDM_LOG_CDROM: - ptr = &cdrom_do_log; + ptr = (val != -3) ? &cdrom_do_log : (void *)"CD-ROM"; break; #endif #ifdef ENABLE_CDROM_IMAGE_LOG case IDM_LOG_CDROM_IMAGE: - ptr = &cdrom_image_do_log; + ptr = (val != -3) ? &cdrom_image_do_log : (void *)"CD-ROM (image)"; break; #endif -#ifdef ENABLE_CDROM_IOCTL_LOG -# ifdef USE_CDROM_IOCTL +#ifdef USE_CDROM_IOCTL +# ifdef ENABLE_CDROM_IOCTL_LOG case IDM_LOG_CDROM_IOCTL: - ptr = &cdrom_ioctl_do_log; -# endif + ptr = (val != -3) ? &cdrom_ioctl_do_log : (void *)"CD-ROM (ioctl)"; break; +# endif #endif #ifdef ENABLE_NETWORK_LOG case IDM_LOG_NETWORK: - ptr = &network_do_log; + ptr = (val != -3) ? &network_do_log : (void *)"Network"; break; #endif #ifdef ENABLE_NETWORK_DEV_LOG case IDM_LOG_NETWORK_DEV: - ptr = &network_dev_do_log; + ptr = (val != -3) ? &network_dev_do_log : (void *)"Network Device"; break; #endif #ifdef ENABLE_SOUND_EMU8K_LOG case IDM_LOG_SOUND_EMU8K: - ptr = &sound_emu8k_do_log; + ptr = (val != -3) ? &sound_emu8k_do_log : (void *)"Sound (EMU8K)"; break; #endif #ifdef ENABLE_SOUND_MPU401_LOG case IDM_LOG_SOUND_MPU401: - ptr = &sound_mpu401_do_log; + ptr = (val != -3) ? &sound_mpu401_do_log : (void *)"Sound (MPU401)"; break; #endif #ifdef ENABLE_SOUND_DEV_LOG case IDM_LOG_SOUND_DEV: - ptr = &sound_dev_do_log; + ptr = (val != -3) ? &sound_dev_do_log : (void *)"Sound Device"; break; #endif #ifdef ENABLE_SCSI_BUS_LOG case IDM_LOG_SCSI_BUS: - ptr = &scsi_bus_do_log; + ptr = (val != -3) ? &scsi_bus_do_log : (void *)"SCSI (Bus)"; break; #endif #ifdef ENABLE_SCSI_DISK_LOG case IDM_LOG_SCSI_DISK: - ptr = &scsi_hd_do_log; + ptr = (val != -3) ? &scsi_hd_do_log : (void *)"SCSI (Disk)"; break; #endif #ifdef ENABLE_SCSI_DEV_LOG case IDM_LOG_SCSI_DEV: - ptr = &scsi_dev_do_log; + ptr = (val != -3) ? &scsi_dev_do_log : (void *)"SCSI Device"; break; #endif #ifdef ENABLE_VOODOO_LOG case IDM_LOG_VOODOO: - ptr = &voodoo_do_log; + ptr = (val != -3) ? &voodoo_do_log : (void *)"Video (Voodoo)"; break; #endif } - if (ptr != NULL) { - /* Set the desired value. */ - if (val != 0xff) { - /* Initialize the logging value. */ - if (val < 0) *ptr ^= 1; - else *ptr = val; - } + if (ptr == NULL) return; - /* And update its menu entry. */ - menu_set_item(idm, *ptr); + iptr = ptr; + switch(val) { + case -3: /* create menu item */ + /* Add a menu item. */ + i = (idm - IDM_LOG_BEGIN); + sprintf(temp, "Toggle %s logging\tCtrl%s+F%d", + (const char *)ptr, + (i >= 12) ? "+Alt" : "", + ((i >= 12) ? i - 12 : i) + 1); + mbstowcs(tmpw, temp, sizeof_w(tmpw)); + menu_add_item(IDM_LOGGING, IDM_LOG_BEGIN + i, tmpw); + break; + + case -2: /* set current value */ + menu_set_item(idm, *iptr); + break; + + case -1: /* toggle */ + *iptr ^= 1; + menu_set_item(idm, *iptr); + break; + + default: /* 0 ... n */ + *iptr = val; + menu_set_item(idm, *iptr); + break; } } #endif @@ -245,27 +273,19 @@ ui_menu_toggle_video_item(int idm, int *val) void ui_menu_reset_all(void) { + wchar_t temp[128]; int i; -#ifndef DEV_BRANCH - /* FIXME: until we fix these.. --FvK */ - menu_enable_item(IDM_LOAD, 0); - menu_enable_item(IDM_SAVE, 0); -#endif - menu_set_item(IDM_RESIZE, vid_resize); menu_set_item(IDM_REMEMBER, window_remember); - /* - * The Renderer menu is more complicated. - * - * We first hide all items, and then we show only - * items that are configured in the code. We then - * disable items that are currently unavailable. - */ + /* Add all renderers to the Renderer menu. */ for (i = 0; i < vidapi_count(); i++) { - if (! vidapi_available(i)) - menu_enable_item(IDM_RENDER_1 + i, 0); + if (vidapi_available(i)) { + /* Get name of the renderer and add a menu item. */ + mbstowcs(temp, vidapi_internal_name(i), sizeof_w(temp)); + menu_add_item(IDM_RENDER, IDM_RENDER_1 + i, temp); + } } menu_set_radio_item(IDM_RENDER_1, vidapi_count(), vid_api); @@ -290,9 +310,18 @@ ui_menu_reset_all(void) menu_set_item(IDM_CGA_CONTR, vid_cga_contrast); -#ifdef ENABLE_LOG_TOGGLES - for (i = IDM_LOG_BEGIN; i < IDM_LOG_END; i++) - ui_menu_set_logging_item(i, 0xff); +#ifdef ENABLE_LOGGING + for (i = IDM_LOG_BEGIN; i < IDM_LOG_END; i++) { + ui_menu_set_logging_item(i, -3); + + ui_menu_set_logging_item(i, -2); + } +#endif + +#ifndef DEV_BRANCH + /* FIXME: until we fix these.. --FvK */ + menu_enable_item(IDM_LOAD, 0); + menu_enable_item(IDM_SAVE, 0); #endif } @@ -459,7 +488,35 @@ ui_menu_command(int idm) plat_pause(0); break; -#ifdef ENABLE_LOG_TOGGLES + case IDM_LANGUAGE+1: /* select language */ + case IDM_LANGUAGE+2: + case IDM_LANGUAGE+3: + case IDM_LANGUAGE+4: + case IDM_LANGUAGE+5: + case IDM_LANGUAGE+6: + case IDM_LANGUAGE+7: + case IDM_LANGUAGE+8: + case IDM_LANGUAGE+9: + case IDM_LANGUAGE+10: + case IDM_LANGUAGE+11: + case IDM_LANGUAGE+12: + case IDM_LANGUAGE+13: + case IDM_LANGUAGE+14: + case IDM_LANGUAGE+15: + case IDM_LANGUAGE+16: + case IDM_LANGUAGE+17: + case IDM_LANGUAGE+18: + case IDM_LANGUAGE+19: + case IDM_LANGUAGE+20: + plat_set_language(idm - IDM_LANGUAGE - 1); + ui_update(); + break; + +#ifdef ENABLE_LOGGING + case IDM_LOG_BREAKPOINT: /* TOOLS menu */ + pclog("---- LOG BREAKPOINT ----\n"); + break; + case IDM_LOG_BUS: /* TOOLS menu */ case IDM_LOG_KEYBOARD: case IDM_LOG_MOUSE: @@ -488,17 +545,11 @@ ui_menu_command(int idm) break; #endif -#ifdef ENABLE_LOG_BREAKPOINT - case IDM_LOG_BREAKPOINT: /* TOOLS menu */ - pclog("---- LOG BREAKPOINT ----\n"); - break; -#endif - /* FIXME: need to fix these.. */ case IDM_LOAD: /* TOOLS menu */ plat_pause(1); - i = dlg_file(get_string(IDS_2160), NULL, temp, DLG_FILE_LOAD); - if (i && (ui_msgbox(MBX_QUESTION, (wchar_t *)IDS_2051) == 0)) { + i = dlg_file(get_string(IDS_2500), NULL, temp, DLG_FILE_LOAD); + if (i && (ui_msgbox(MBX_QUESTION, (wchar_t *)IDS_WARNING) == 0)) { pc_reload(temp); ui_menu_reset_all(); config_ro = !!(i & DLG_FILE_RO); @@ -508,7 +559,7 @@ ui_menu_command(int idm) case IDM_SAVE: /* TOOLS menu */ plat_pause(1); - if (dlg_file(get_string(IDS_2160), NULL, temp, DLG_FILE_SAVE)) { + if (dlg_file(get_string(IDS_2500), NULL, temp, DLG_FILE_SAVE)) { config_write(temp); } plat_pause(0); diff --git a/src/ui/ui_resource.h b/src/ui/ui_resource.h index c6c8cb3..0044041 100644 --- a/src/ui/ui_resource.h +++ b/src/ui/ui_resource.h @@ -8,7 +8,11 @@ * * Platform-independent resource identifiers. * - * Version: @(#)ui_resource.h 1.0.8 2018/05/11 + * NOTE: Many entries in the strings table do not have an IDS, as + * they are not referenced outside of the platform UI. This + * may change at some point. + * + * Version: @(#)ui_resource.h 1.0.14 2018/05/29 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -116,39 +120,40 @@ /* TOOLS menu. */ #define IDM_TOOLS (IDM_BASE+300) #define IDM_SETTINGS (IDM_TOOLS+1) +#define IDM_LANGUAGE (IDM_TOOLS+10) #define IDM_LOAD (IDM_TOOLS+2) #define IDM_SAVE (IDM_TOOLS+3) -#define IDM_LOGGING (IDM_TOOLS+10) -# define IDM_LOG_BEGIN (IDM_LOGGING+1) -# define IDM_LOG_BUS (IDM_LOG_BEGIN+0) -# define IDM_LOG_KEYBOARD (IDM_LOG_BEGIN+1) -# define IDM_LOG_MOUSE (IDM_LOG_BEGIN+2) -# define IDM_LOG_GAME (IDM_LOG_BEGIN+3) -# define IDM_LOG_PARALLEL (IDM_LOG_BEGIN+4) -# define IDM_LOG_SERIAL (IDM_LOG_BEGIN+5) -# define IDM_LOG_FDC (IDM_LOG_BEGIN+6) -# define IDM_LOG_FDD (IDM_LOG_BEGIN+7) -# define IDM_LOG_D86F (IDM_LOG_BEGIN+8) -# define IDM_LOG_HDC (IDM_LOG_BEGIN+9) -# define IDM_LOG_HDD (IDM_LOG_BEGIN+10) -# define IDM_LOG_ZIP (IDM_LOG_BEGIN+11) -# define IDM_LOG_CDROM (IDM_LOG_BEGIN+12) -# define IDM_LOG_CDROM_IMAGE (IDM_LOG_BEGIN+13) -# define IDM_LOG_CDROM_IOCTL (IDM_LOG_BEGIN+14) -# define IDM_LOG_NETWORK (IDM_LOG_BEGIN+15) -# define IDM_LOG_NETWORK_DEV (IDM_LOG_BEGIN+16) -# define IDM_LOG_SOUND_EMU8K (IDM_LOG_BEGIN+17) -# define IDM_LOG_SOUND_MPU401 (IDM_LOG_BEGIN+18) -# define IDM_LOG_SOUND_DEV (IDM_LOG_BEGIN+19) -# define IDM_LOG_SCSI_BUS (IDM_LOG_BEGIN+20) -# define IDM_LOG_SCSI_DISK (IDM_LOG_BEGIN+21) -# define IDM_LOG_SCSI_DEV (IDM_LOG_BEGIN+22) -# define IDM_LOG_VOODOO (IDM_LOG_BEGIN+23) -# define IDM_LOG_END (IDM_LOG_BEGIN+24) -# define IDM_LOG_BREAKPOINT (IDM_LOGGING+99) +#define IDM_LOGGING (IDM_TOOLS+50) +# define IDM_LOG_BREAKPOINT (IDM_LOGGING+49) +# define IDM_LOG_BEGIN (IDM_LOGGING+1) +# define IDM_LOG_BUS (IDM_LOG_BEGIN+0) +# define IDM_LOG_KEYBOARD (IDM_LOG_BEGIN+1) +# define IDM_LOG_MOUSE (IDM_LOG_BEGIN+2) +# define IDM_LOG_GAME (IDM_LOG_BEGIN+3) +# define IDM_LOG_PARALLEL (IDM_LOG_BEGIN+4) +# define IDM_LOG_SERIAL (IDM_LOG_BEGIN+5) +# define IDM_LOG_FDC (IDM_LOG_BEGIN+6) +# define IDM_LOG_FDD (IDM_LOG_BEGIN+7) +# define IDM_LOG_D86F (IDM_LOG_BEGIN+8) +# define IDM_LOG_HDC (IDM_LOG_BEGIN+9) +# define IDM_LOG_HDD (IDM_LOG_BEGIN+10) +# define IDM_LOG_ZIP (IDM_LOG_BEGIN+11) +# define IDM_LOG_CDROM (IDM_LOG_BEGIN+12) +# define IDM_LOG_CDROM_IMAGE (IDM_LOG_BEGIN+13) +# define IDM_LOG_CDROM_IOCTL (IDM_LOG_BEGIN+14) +# define IDM_LOG_NETWORK (IDM_LOG_BEGIN+15) +# define IDM_LOG_NETWORK_DEV (IDM_LOG_BEGIN+16) +# define IDM_LOG_SOUND_EMU8K (IDM_LOG_BEGIN+17) +# define IDM_LOG_SOUND_MPU401 (IDM_LOG_BEGIN+18) +# define IDM_LOG_SOUND_DEV (IDM_LOG_BEGIN+19) +# define IDM_LOG_SCSI_BUS (IDM_LOG_BEGIN+20) +# define IDM_LOG_SCSI_DISK (IDM_LOG_BEGIN+21) +# define IDM_LOG_SCSI_DEV (IDM_LOG_BEGIN+22) +# define IDM_LOG_VOODOO (IDM_LOG_BEGIN+23) +# define IDM_LOG_END (IDM_LOG_BEGIN+24) #define IDM_STATUS (IDM_TOOLS+4) #define IDM_SCREENSHOT (IDM_TOOLS+5) -#define IDM_TOOLS_END (IDM_SCREENSHOT+1) +#define IDM_TOOLS_END (IDM_LOG_BREAKPOINT+1) /* HELP menu. */ #define IDM_HELP (IDM_BASE+400) @@ -190,210 +195,194 @@ /* String IDs. */ -#define IDS_BEGIN 2048 // start of string IDs +#define IDS_BEGIN 2000 // start of accesible string IDs -#define IDS_2048 2048 // "Error" -#define IDS_2049 2049 // "Fatal Error" -#define IDS_2050 2050 // "Configuration Error" -#define IDS_2051 2051 // "Warning" -#define IDS_2052 2052 // "This will reset the emulator.." -#define IDS_2053 2053 // "Invalid number of sectors.." -#define IDS_2054 2054 // "Invalid number of heads.." -#define IDS_2055 2055 // "Invalid number of cylinders.." -#define IDS_2056 2056 // "No usable ROM images found!" -#define IDS_2057 2057 // "(empty)" -#define IDS_2058 2058 // "(host drive %c:)" -#define IDS_2059 2059 // "(Turbo)" -#define IDS_2060 2060 // "On" -#define IDS_2061 2061 // "Off" -#define IDS_2062 2062 // "Changes saved, please restart.." -#define IDS_2063 2063 // "Configured ROM set not avai.." -#define IDS_2064 2064 // "Configured video BIOS not.." -#define IDS_2065 2065 // "Machine" -#define IDS_2066 2066 // "Display" -#define IDS_2067 2067 // "Input devices" -#define IDS_2068 2068 // "Sound" -#define IDS_2069 2069 // "Network" -#define IDS_2070 2070 // "Ports (COM & LPT)" -#define IDS_2071 2071 // "Other peripherals" -#define IDS_2072 2072 // "Hard disks" -#define IDS_2073 2073 // "Floppy drives" -#define IDS_2074 2074 // "Other removable devices" -#define IDS_2075 2075 // "CD-ROM images (*.ISO;*.CU.." -#define IDS_2076 2076 // "Host CD/DVD Drive (%c:)" -#define IDS_2077 2077 // "Click to capture mouse" -#define IDS_2078 2078 // "Press F12-F8 to release mouse" -#define IDS_2079 2079 // "Press F12-F8 or middle button.." -#define IDS_2080 2080 // "Drive" -#define IDS_2081 2081 // "Location" -#define IDS_2082 2082 // "Bus" -#define IDS_2083 2083 // "File" -#define IDS_2084 2084 // "C" -#define IDS_2085 2085 // "H" -#define IDS_2086 2086 // "S" -#define IDS_2087 2087 // "MB" -#define IDS_2088 2088 // "Unable to create bitmap file: %s" -#define IDS_2089 2089 // "Enabled" -#define IDS_2090 2090 // "Mute" -#define IDS_2091 2091 // "Type" -#define IDS_2092 2092 // "Bus" -#define IDS_2093 2093 // "DMA" -#define IDS_2094 2094 // "KB" -#define IDS_2095 2095 // "Selected renderer not avai.." -#define IDS_2096 2096 // "Slave" -#define IDS_2097 2097 // "SCSI (ID %s, LUN %s)" -#define IDS_2098 2098 // "Adapter Type" -#define IDS_2099 2099 // "Base Address" -#define IDS_2100 2100 // "IRQ" -#define IDS_2101 2101 // "8-bit DMA" -#define IDS_2102 2102 // "16-bit DMA" -#define IDS_2103 2103 // "BIOS" -#define IDS_2104 2104 // "Network Type" -#define IDS_2105 2105 // "Surround Module" -#define IDS_2106 2106 // "MPU-401 Base Address" -#define IDS_2107 2107 // "Use CTRL+ALT+PAGE DOWN.." -#define IDS_2108 2108 // "On-board RAM" -#define IDS_2109 2109 // "Memory Size" -#define IDS_2110 2110 // "Display Type" -#define IDS_2111 2111 // "RGB" -#define IDS_2112 2112 // "Composite" -#define IDS_2113 2113 // "Composite Type" -#define IDS_2114 2114 // "Old" -#define IDS_2115 2115 // "New" -#define IDS_2116 2116 // "RGB Type" -#define IDS_2117 2117 // "Color" -#define IDS_2118 2118 // "Monochrome (Green)" -#define IDS_2119 2119 // "Monochrome (Amber)" -#define IDS_2120 2120 // "Monochrome (Gray)" -#define IDS_2121 2121 // "Color (no brown)" -#define IDS_2122 2122 // "Monochrome (Default)" -#define IDS_2123 2123 // "Snow Emulation" -#define IDS_2124 2124 // "Bilinear Filtering" -#define IDS_2125 2125 // "Dithering" -#define IDS_2126 2126 // "Framebuffer Memory Size" -#define IDS_2127 2127 // "Texture Memory Size" -#define IDS_2128 2128 // "Screen Filter" -#define IDS_2129 2129 // "Render Threads" -#define IDS_2130 2130 // "Recompiler" -#define IDS_2131 2131 // "System Default" -#define IDS_2132 2132 // "%i Wait state(s)" -#define IDS_2133 2133 // "8-bit" -#define IDS_2134 2134 // "Slow 16-bit" -#define IDS_2135 2135 // "Fast 16-bit" -#define IDS_2136 2136 // "Slow VLB/PCI" -#define IDS_2137 2137 // "Mid VLB/PCI" -#define IDS_2138 2138 // "Fast VLB/PCI" -#define IDS_2139 2139 // "PCap failed to set up.." -#define IDS_2140 2140 // "No PCap devices found" -#define IDS_2141 2141 // "Invalid PCap device" -#define IDS_2142 2142 // "&Notify disk change" -#define IDS_2143 2143 // "Type" -#define IDS_2144 2144 // "The requested device '%ls'.." -/* IDS_2145-51 available */ -#define IDS_2152 2152 // "None" -#define IDS_2153 2153 // "Unable to load Accelerators" -#define IDS_2154 2154 // "Unable to register Raw Input" -#define IDS_2155 2155 // "IRQ %i" -#define IDS_2156 2156 // "%" PRIu64 -#define IDS_2157 2157 // "%" PRIu64 " MB (CHS: %".." -#define IDS_2158 2158 // "Floppy %i (%s): %ls" -#define IDS_2159 2159 // "All floppy images (*.0??;*.." -#define IDS_2160 2160 // "Configuration files (*.CF.." -#define IDS_2161 2161 // "&New image..." -#define IDS_2162 2162 // "&Existing image..." -#define IDS_2163 2163 // "[WP]" -#define IDS_2164 2164 // "E&ject" -#define IDS_2165 2165 // "&Mute" -#define IDS_2166 2166 // "E&mpty" -#define IDS_2167 2167 // "&Reload previous image" -#define IDS_2168 2168 // "&Image..." -/* IDS_2169 available */ -#define IDS_2170 2170 // "Check BPB" -#define IDS_2171 2171 // "Unable to initialize Flui.." -#define IDS_2172 2172 // "E&xport to 86F..." -#define IDS_2173 2173 // "Surface-based images (*.8.." -#define IDS_2174 2174 // "All floppy images (*.DSK..." -#define IDS_2175 2175 // "ZIP images (*.IM?)\0*.IM..." -#define IDS_2176 2176 // "ZIP images (*.IM?)\0*.IM..." -#define IDS_2177 2177 // "ZIP %i (%03i): %ls" -#define IDS_2178 2178 // "Unable to initialize OpenAL.." -#define IDS_2179 2179 // "Speed" +/* Unused block (2000.) */ -#define IDS_4096 4096 // "Hard disk (%s)" -#define IDS_4097 4097 // "%01i:%01i" -#define IDS_4098 4098 // "%i" -#define IDS_4099 4099 // "Disabled" -#define IDS_4100 4100 // "Custom..." -#define IDS_4101 4101 // "Custom (large)..." -#define IDS_4102 4102 // "Add New Hard Disk" -#define IDS_4103 4103 // "Add Existing Hard Disk" -#define IDS_4104 4104 // "Attempting to create a HDI ima.." -#define IDS_4105 4105 // "Attempting to create a spurio.." -#define IDS_4106 4106 // "Hard disk images (*.HDI;*.HD.." -#define IDS_4107 4107 // "Unable to open the file for read" -#define IDS_4108 4108 // "Unable to open the file for write" -#define IDS_4109 4109 // "HDI or HDX image with a sect.." -#define IDS_4110 4110 // "USB is not yet supported" -#define IDS_4111 4111 // "This image exists and will be.." -#define IDS_4112 4112 // "Please enter a valid file name" -#define IDS_4113 4113 // "Remember to partition and fo.." -#define IDS_4114 4114 // "ST506 or ESDI CD-ROM driv.." -#define IDS_4115 4115 // "Removable disk %i (SCSI): %ls" +/* Messagebox classes (2100.) */ +#define IDS_ERROR 2100 // "Error" +#define IDS_FATAL_ERROR 2101 // "Fatal Error" +#define IDS_CONFIG_ERROR 2102 // "Configuration Error" +#define IDS_WARNING 2103 // "Warning" -#define IDS_4352 4352 // "ST506" -#define IDS_4353 4353 // "ESDI" -#define IDS_4354 4354 // "IDE (PIO-only)" -#define IDS_4355 4355 // "IDE (PIO+DMA)" -#define IDS_4356 4356 // "SCSI" -#define IDS_4357 4357 // "SCSI (removable)" +/* System errors (2200.) */ +#define IDS_ERR_ACCEL 2200 // "Unable to load Accelerators" +#define IDS_ERR_INPUT 2201 // "Unable to register Raw Input" +#define IDS_ERR_PCAP 2202 // "PCap failed to set up.." +#define IDS_ERR_PCAP_NO 2203 // "No PCap devices found" +#define IDS_ERR_PCAP_DEV 2204 // "Invalid PCap device" +#define IDS_ERR_OPENAL 2205 // "Unable to initialize OpenAL.." +#define IDS_ERR_FSYNTH 2206 // "Unable to initialize Flui.." -#define IDS_4608 4608 // "ST506 (%01i:%01i)" -#define IDS_4609 4609 // "ESDI (%01i:%01i)" -#define IDS_4610 4610 // "IDE (PIO-only) (%01i:%01i)" -#define IDS_4611 4611 // "IDE (PIO+DMA) (%01i:%01i)" -#define IDS_4612 4612 // "SCSI (%02i:%02i)" -#define IDS_4613 4613 // "SCSI (removable) (%02i:%02i)" +/* Application error messages (2300.) */ +#define IDS_ERR_SCRSHOT 2300 // "Unable to create bitmap file: %s" +#define IDS_ERR_NOROMS 2301 // "No usable ROM images found!" +#define IDS_ERR_NOCONF 2302 // "No valid configuration.." +#define IDS_ERR_NOMACH 2303 // "Configured machine not avai.." +#define IDS_ERR_NOVIDEO 2304 // "Configured video card not.." +#define IDS_ERR_NORENDR 2305 // "Selected renderer not avai.." +#define IDS_ERR_NOCDROM 2306 // "ST506 or ESDI CD-ROM driv.." +#define IDS_ERR_NO_USB 2307 // "USB is not yet supported" -#define IDS_5120 5120 // "CD-ROM %i (%s): %s" +/* Application messages (2400.) */ +#define IDS_MSG_SAVE 2400 // "Are you sure you want to save.." +#define IDS_MSG_RESTART 2401 // "Changes saved, please restart.." +#define IDS_MSG_UNSTABL 2402 // "The requested device '%ls'.." +#define IDS_MSG_CAPTURE 2403 // "Click to capture mouse" +#define IDS_MSG_MRLS_1 2404 // "Press F12-F8 to release mouse" +#define IDS_MSG_MRLS_2 2405 // "Press F12-F8 or middle button.." +#define IDS_MSG_WINDOW 2406 // "Use CTRL+ALT+PAGE DOWN.." -#define IDS_5376 5376 // "Disabled" -#define IDS_5377 5377 // "" -#define IDS_5378 5378 // "" -#define IDS_5379 5379 // "ATAPI (PIO-only)" -#define IDS_5380 5380 // "ATAPI (PIO and DMA)" -#define IDS_5381 5381 // "SCSI" +/* Misc application strings (2500.) */ +#define IDS_2500 2500 // "Configuration files (*.CF.." -#define IDS_5632 5632 // "Disabled" -#define IDS_5633 5633 // "" -#define IDS_5634 5634 // "" -#define IDS_5635 5635 // "ATAPI (PIO-only) (%01i:%01i)" -#define IDS_5636 5636 // "ATAPI (PIO and DMA) (%01i:%01i)" -#define IDS_5637 5637 // "SCSI (%02i:%02i)" -#define IDS_5888 5888 // "160 kB" -#define IDS_5889 5889 // "180 kB" -#define IDS_5890 5890 // "320 kB" -#define IDS_5891 5891 // "360 kB" -#define IDS_5892 5892 // "640 kB" -#define IDS_5893 5893 // "720 kB" -#define IDS_5894 5894 // "1.2 MB" -#define IDS_5895 5895 // "1.25 MB" -#define IDS_5896 5896 // "1.44 MB" -#define IDS_5897 5897 // "DMF (cluster 1024)" -#define IDS_5898 5898 // "DMF (cluster 2048)" -#define IDS_5899 5899 // "2.88 MB" -#define IDS_5900 5900 // "ZIP 100" -#define IDS_5901 5901 // "ZIP 250" +/* UI: common elements (3000.) */ +#define IDS_OK 3000 // "OK" +#define IDS_CANCEL 3001 // "Cancel" +#define IDS_CONFIGURE 3002 // "Configure" +#define IDS_BROWSE 3003 // "Browse" -#define IDS_6144 6144 // "Perfect RPM" -#define IDS_6145 6145 // "1%% below perfect RPM" -#define IDS_6146 6146 // "1.5%% below perfect RPM" -#define IDS_6147 6147 // "2%% below perfect RPM" -#define IDS_7168 7168 // "English (United States)" -#define IDS_LANG_ENUS IDS_7168 +/* UI: dialog shared strings (3100.) */ +#define IDS_NONE 3100 // "None" +#define IDS_DISABLED 3101 // "Disabled" +#define IDS_ENABLED 3102 // "Enabled" +#define IDS_OFF 3103 // "Off" +#define IDS_ON 3104 // "On" +#define IDS_TYPE 3105 // "Type" +#define IDS_FILENAME 3106 // "File name:" +#define IDS_PROGRESS 3107 // "Progress:" +#define IDS_BUS 3108 // "Bus:" +#define IDS_CHANNEL 3109 // "Channel:" +#define IDS_ID 3110 // "ID:" +#define IDS_LUN 3111 // "LUN:" +#define IDS_INV_NAME 3112 // "Please enter a valid file name" +#define IDS_IMG_EXIST 3113 // "This image exists and will be.." +#define IDS_OPEN_READ 3114 // "Unable to open the file for read" +#define IDS_OPEN_WRITE 3115 // "Unable to open the file for write" +#define IDS_DEVCONF_1 3116 // "Configuration" +#define IDS_DEVCONF_2 3117 // "Device:" -#define IDS_END 8191 // end of string IDs + +/* UI: dialog: About (3200.) */ + +/* UI dialog: Status (3225.) */ + +/* UI dialog: Sound Gain (3250.) */ + +/* UI dialog: New Image (3275.) */ +#define IDS_3278 3278 // "Perfect RPM" +#define IDS_3279 3279 // "1% below perfect RPM" +#define IDS_3280 3280 // "1.5% below perfect RPM" +#define IDS_3281 3281 // "2% below perfect RPM" +#define IDS_3282 3282 // "160 KB" +#define IDS_3283 3283 // "180 KB" +#define IDS_3284 3284 // "320 KB" +#define IDS_3285 3285 // "360 KB" +#define IDS_3286 3286 // "640 KB" +#define IDS_3287 3287 // "720 KB" +#define IDS_3288 3288 // "1.2 MB" +#define IDS_3289 3289 // "1.25 MB" +#define IDS_3290 3290 // "1.44 MB" +#define IDS_3291 3291 // "DMF (cluster 1024)" +#define IDS_3292 3292 // "DMF (cluster 2048)" +#define IDS_3293 3293 // "2.88 MB" +#define IDS_3294 3294 // "ZIP 100" +#define IDS_3295 3295 // "ZIP 250" + +/* UI dialog: Settings (3300.) */ +#define IDS_3310 3310 // "Machine" +#define IDS_3311 3311 // "Display" +#define IDS_3312 3312 // "Input devices" +#define IDS_3313 3313 // "Sound" +#define IDS_3314 3314 // "Network" +#define IDS_3315 3315 // "Ports (COM & LPT)" +#define IDS_3316 3316 // "Other peripherals" +#define IDS_3317 3317 // "Hard disks" +#define IDS_3318 3318 // "Floppy drives" +#define IDS_3319 3319 // "Other removable devices" + +/* UI dialog: Settings (Machine, 3325.) */ +#define IDS_3330 3330 // "MB" +#define IDS_3334 3334 // "KB" +#define IDS_3335 3335 // "Default" + +/* UI dialog: Settings (Video, 3350.) */ +#define IDS_3353 3353 // "Default" +#define IDS_3354 3354 // "8-bit" +#define IDS_3355 3355 // "Slow 16-bit" +#define IDS_3356 3356 // "Fast 16-bit" +#define IDS_3357 3357 // "Slow VLB/PCI" +#define IDS_3358 3358 // "Mid VLB/PCI" +#define IDS_3359 3359 // "Fast VLB/PCI" + +/* UI dialog: Settings (Other Peripherals, 3475.) */ + +/* UI dialog: Settings (Hard Disks, 3500.) */ +#define IDS_3504 3504 // "Bus" +#define IDS_3505 3505 // "File" +#define IDS_3506 3506 // "C" +#define IDS_3507 3507 // "H" +#define IDS_3508 3508 // "S" +#define IDS_3509 3509 // "MB" +#define IDS_3510 3510 // "MB (CHS: %".." +#define IDS_3511 3511 // "Custom..." +#define IDS_3512 3512 // "Custom (large)..." +#define IDS_3515 3515 // "ST506" +#define IDS_3516 3516 // "ESDI" +#define IDS_3517 3517 // "IDE (PIO-only)" +#define IDS_3518 3518 // "IDE (PIO+DMA)" +#define IDS_3519 3519 // "SCSI" +#define IDS_3520 3520 // "SCSI (removable)" +#define IDS_3526 3526 // "Add New Hard Disk" +#define IDS_3527 3527 // "Add Existing Hard Disk" +#define IDS_3533 3533 // "Attempting to create a HDI ima.." +#define IDS_3534 3534 // "Attempting to create a spurio.." +#define IDS_3535 3535 // "HDI or HDX image with a sect.." +#define IDS_3536 3536 // "Hard disk images (*.HDI;*.HD.." +#define IDS_3537 3537 // "Remember to partition and fo.." + +/* UI dialog: Settings (Floppy Drives, 3550.) */ +#define IDS_3554 3554 // "Turbo" +#define IDS_3555 3555 // "Check BPB" + +/* UI dialog: Settings (Removable Devices, 3575) */ +#define IDS_3579 3579 // "Speed" +#define IDS_3580 3580 // "" +#define IDS_3581 3581 // "" +#define IDS_3582 3582 // "ATAPI (PIO-only)" +#define IDS_3583 3583 // "ATAPI (PIO and DMA)" +#define IDS_3584 3584 // "SCSI" + +/* UI dialog: Status Bar (3900.) */ +#define IDS_3900 3900 // "(empty)" +#define IDS_3901 3901 // "(host drive %c:)" +#define IDS_3902 3902 // "[WP]" +#define IDS_3903 3903 // "&New image..." +#define IDS_3904 3904 // "&Load image..." +#define IDS_3905 3905 // "&Reload previous image" +#define IDS_3906 3906 // "&Unload" +#define IDS_3910 3910 // "Floppy %i (%s): %ls" +#define IDS_3911 3911 // "All floppy images (*.0??;*.." +#define IDS_3912 3912 // "All floppy images (*.DSK..." +#define IDS_3913 3913 // "Surface-based images (*.8.." +#define IDS_3914 3914 // "E&xport to 86F..." +#define IDS_3920 3920 // "CD-ROM %i (%s): %s" +#define IDS_3921 3921 // "Host CD/DVD Drive (%c:)" +#define IDS_3922 3922 // "CD-ROM images (*.ISO;*.CU.." +#define IDS_3923 3923 // "&Mute" +#define IDS_3930 3930 // "Hard disk (%s)" +#define IDS_3940 3940 // "Removable disk %i: %ls" +#define IDS_3941 3941 // "&Notify disk change" +#define IDS_3950 3950 // "ZIP %i (%03i): %ls" +#define IDS_3951 3951 // "ZIP images (*.IM?)\0*.IM..." +#define IDS_3952 3952 // "ZIP images (*.IM?)\0*.IM..." +#define IDS_3960 3960 // "Network (%s) +#define IDS_3970 3970 // "Sound (%s) + + +#define IDS_END 4000 // end of accesible string IDs #endif /*EMU_UI_RESOURCE_H*/ diff --git a/src/ui/ui_stbar.c b/src/ui/ui_stbar.c index 8718ac0..dd9889b 100644 --- a/src/ui/ui_stbar.c +++ b/src/ui/ui_stbar.c @@ -8,7 +8,7 @@ * * Common UI support functions for the Status Bar module. * - * Version: @(#)ui_stbar.c 1.0.8 2018/05/13 + * Version: @(#)ui_stbar.c 1.0.9 2018/05/27 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -66,6 +66,7 @@ static int *sb_flags; static int *sb_tags; static int *sb_icons; static wchar_t **sb_tips; +static wchar_t *sb_text; static int sb_parts = 0; static int sb_ready = 0; @@ -174,6 +175,11 @@ ui_sb_text_set_w(const wchar_t *str) if ((part = find_tag(SB_TEXT)) == -1) return; sb_set_text(part, str); + + if (sb_text != NULL) + free(sb_text); + sb_text = (wchar_t *)malloc(sizeof(wchar_t) * (wcslen(str) + 1)); + wcscpy(sb_text, str); } @@ -181,7 +187,7 @@ ui_sb_text_set_w(const wchar_t *str) void ui_sb_text_set(const char *str) { - static wchar_t temp[512]; + wchar_t temp[512]; mbstowcs(temp, str, sizeof_w(temp)); @@ -212,37 +218,35 @@ ui_sb_tip_update(int tag) mbstowcs(temp, stransi, sizeof_w(temp)); str = floppyfns[drive]; if (*str == L'\0') - str = get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_3900); /*"(empty)"*/ swprintf(tip, sizeof_w(tip), - get_string(IDS_2158), drive+1, temp, str); + get_string(IDS_3910), drive+1, temp, str); if (ui_writeprot[drive]) - wcscat(tip, get_string(IDS_2163)); + wcscat(tip, get_string(IDS_3902)); /*"[WP]"*/ break; case SB_CDROM: drive = sb_tags[part] & 0x0f; bus = cdrom_drives[drive].bus_type; - id = IDS_4352 + (bus - 1); + id = IDS_3515 + (bus - 1); wcscpy(temp, get_string(id)); str = cdrom_image[drive].image_path; if (*str == L'\0') - str = get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_3900); /*"(empty)"*/ if (cdrom_drives[drive].host_drive == 200) { swprintf(tip, sizeof_w(tip), - get_string(IDS_5120), - drive+1, temp, str); + get_string(IDS_3920), drive+1, temp, str); } else if ((cdrom_drives[drive].host_drive >= 'A') && (cdrom_drives[drive].host_drive <= 'Z')) { swprintf(temp, sizeof_w(temp), - get_string(IDS_2058), + get_string(IDS_3901), cdrom_drives[drive].host_drive & ~0x20); swprintf(tip, sizeof_w(tip), - get_string(IDS_5120), + get_string(IDS_3920), drive+1, get_string(id), temp); } else { swprintf(tip, sizeof_w(tip), - get_string(IDS_5120), - drive+1, temp, str); + get_string(IDS_3920), drive+1, temp, str); } break; @@ -251,40 +255,40 @@ ui_sb_tip_update(int tag) type = zip_drives[drive].is_250 ? 250 : 100; str = zip_drives[drive].image_path; if (*str == L'\0') - str = get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_3900); /*"(empty)"*/ swprintf(tip, sizeof_w(tip), - get_string(IDS_2177), drive+1, type, str); + get_string(IDS_3950), drive+1, type, str); if (zip_drives[drive].ui_writeprot) - wcscat(tip, get_string(IDS_2163)); + wcscat(tip, get_string(IDS_3902)); /*"[WP]"*/ break; case SB_RDISK: drive = sb_tags[part] & 0x1f; str = hdd[drive].fn; if (*str == L'\0') - str = get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_3900); /*"(empty)"*/ swprintf(tip, sizeof_w(tip), - get_string(IDS_4115), drive, str); + get_string(IDS_3940), drive, str); if (0) - wcscat(tip, get_string(IDS_2163)); + wcscat(tip, get_string(IDS_3902)); /*"[WP]"*/ break; case SB_HDD: bus = sb_tags[part] & 0x0f; - id = IDS_4352 + (bus - 1); + id = IDS_3515 + (bus - 1); str = get_string(id); swprintf(tip, sizeof_w(tip), - get_string(IDS_4096), str); + get_string(IDS_3930), str); if (0) - wcscat(tip, get_string(IDS_2163)); + wcscat(tip, get_string(IDS_3902)); /*"[WP]"*/ break; case SB_NETWORK: - swprintf(tip, sizeof_w(tip), get_string(IDS_2069)); + swprintf(tip, sizeof_w(tip), get_string(IDS_3960)); break; case SB_SOUND: - swprintf(tip, sizeof_w(tip), get_string(IDS_2068)); + swprintf(tip, sizeof_w(tip), get_string(IDS_3970)); break; default: @@ -323,17 +327,14 @@ ui_sb_tip_destroy(void) static void menu_floppy(int part, int drive) { - sb_menu_add_item(part, IDM_FLOPPY_IMAGE_NEW | drive, - get_string(IDS_2161)); + sb_menu_add_item(part, IDM_FLOPPY_IMAGE_NEW|drive, get_string(IDS_3903)); + sb_menu_add_item(part, IDM_FLOPPY_IMAGE_EXISTING|drive, + get_string(IDS_3904)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_FLOPPY_IMAGE_EXISTING | drive, - get_string(IDS_2162)); + sb_menu_add_item(part, IDM_FLOPPY_EJECT|drive, get_string(IDS_3906)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_FLOPPY_EXPORT_TO_86F | drive, - get_string(IDS_2172)); - sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_FLOPPY_EJECT | drive, - get_string(IDS_2164)); + sb_menu_add_item(part, IDM_FLOPPY_EXPORT_TO_86F|drive, + get_string(IDS_3914)); if (floppyfns[drive][0] == L'\0') { sb_menu_enable_item(part, IDM_FLOPPY_EJECT | drive, 0); @@ -349,16 +350,12 @@ menu_cdrom(int part, int drive) wchar_t temp[64]; int i; - sb_menu_add_item(part, IDM_CDROM_MUTE | drive, - get_string(IDS_2165)); + sb_menu_add_item(part, IDM_CDROM_MUTE | drive, get_string(IDS_3923)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_CDROM_EMPTY | drive, - get_string(IDS_2166)); - sb_menu_add_item(part, IDM_CDROM_RELOAD | drive, - get_string(IDS_2167)); + sb_menu_add_item(part, IDM_CDROM_IMAGE | drive, get_string(IDS_3904)); + sb_menu_add_item(part, IDM_CDROM_RELOAD | drive, get_string(IDS_3905)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_CDROM_IMAGE | drive, - get_string(IDS_2168)); + sb_menu_add_item(part, IDM_CDROM_EMPTY | drive, get_string(IDS_3906)); if (host_cdrom_drive_available_num == 0) { if ((cdrom_drives[drive].host_drive >= 'A') && @@ -379,7 +376,7 @@ menu_cdrom(int part, int drive) sb_menu_add_item(part, -1, NULL); for (i = 3; i < 26; i++) { - swprintf(temp, sizeof_w(temp), L"Host CD/DVD Drive (%c:)", i+'A'); + swprintf(temp, sizeof_w(temp), get_string(IDS_3921), i+'A'); if (host_cdrom_drive_available[i]) sb_menu_add_item(part, IDM_CDROM_HOST_DRIVE | (i << 3)|drive, temp); } @@ -406,14 +403,11 @@ check_menu_items: static void menu_zip(int part, int drive) { - sb_menu_add_item(part, IDM_ZIP_IMAGE_NEW | drive, - get_string(IDS_2161)); + sb_menu_add_item(part, IDM_ZIP_IMAGE_NEW|drive, get_string(IDS_3903)); + sb_menu_add_item(part, IDM_ZIP_IMAGE_EXISTING|drive, get_string(IDS_3904)); + sb_menu_add_item(part, IDM_ZIP_RELOAD|drive, get_string(IDS_3905)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_ZIP_IMAGE_EXISTING | drive, - get_string(IDS_2162)); - sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_ZIP_EJECT | drive, get_string(IDS_2164)); - sb_menu_add_item(part, IDM_ZIP_RELOAD | drive, get_string(IDS_2167)); + sb_menu_add_item(part, IDM_ZIP_EJECT|drive, get_string(IDS_3906)); if (zip_drives[drive].image_path[0] == L'\0') { sb_menu_enable_item(part, IDM_ZIP_EJECT | drive, 0); @@ -429,16 +423,12 @@ menu_zip(int part, int drive) static void menu_remov(int part, int drive) { - sb_menu_add_item(part, IDM_RDISK_EJECT | drive, - get_string(IDS_2164)); - sb_menu_add_item(part, IDM_RDISK_RELOAD | drive, - get_string(IDS_2167)); + sb_menu_add_item(part, IDM_RDISK_SEND_CHANGE|drive, get_string(IDS_3941)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_RDISK_SEND_CHANGE | drive, - get_string(IDS_2142)); + sb_menu_add_item(part, IDM_RDISK_IMAGE|drive, get_string(IDS_3904)); + sb_menu_add_item(part, IDM_RDISK_RELOAD|drive, get_string(IDS_3905)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_RDISK_IMAGE | drive, - get_string(IDS_2168)); + sb_menu_add_item(part, IDM_RDISK_EJECT|drive, get_string(IDS_3906)); } @@ -770,7 +760,10 @@ ui_sb_update(void) case SB_TEXT: /* Status text */ sb_icons[part] = -1; - sb_set_text(part, L""); + if (sb_text != NULL) + sb_set_text(part, sb_text); + else + sb_set_text(part, L""); break; } @@ -813,7 +806,7 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; str = floppyfns[drive]; - i = dlg_file(get_string(IDS_2159), str, temp, DLG_FILE_LOAD); + i = dlg_file(get_string(IDS_3911), str, temp, DLG_FILE_LOAD); if (i) { ui_sb_mount_floppy(drive, part, !!(i & DLG_FILE_RO), temp); @@ -839,10 +832,10 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; str = floppyfns[drive]; - if (dlg_file(get_string(IDS_2173), str, temp, DLG_FILE_SAVE)) { + if (dlg_file(get_string(IDS_3913), str, temp, DLG_FILE_SAVE)) { plat_pause(1); if (! d86f_export(drive, temp)) - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_4108); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_OPEN_WRITE); plat_pause(0); } break; @@ -875,7 +868,7 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; str = cdrom_image[drive].image_path; - if (! dlg_file(get_string(IDS_2075), str, temp, + if (! dlg_file(get_string(IDS_3922), str, temp, DLG_FILE_LOAD|DLG_FILE_RO)) break; cdrom_drives[drive].prev_host_drive = cdrom_drives[drive].host_drive; @@ -957,7 +950,7 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; str = zip_drives[drive].image_path; - i = dlg_file(get_string(IDS_2175), str, temp, DLG_FILE_LOAD); + i = dlg_file(get_string(IDS_3951), str, temp, DLG_FILE_LOAD); if (i) { ui_sb_mount_zip(drive, part, !!(i & DLG_FILE_RO), temp); @@ -994,7 +987,7 @@ ui_sb_menu_command(int idm, int tag) part = find_tag(idm | drive); str = hdd[drive].fn; - i = dlg_file(get_string(IDS_4106), str, temp, DLG_FILE_LOAD); + i = dlg_file(get_string(IDS_3536), str, temp, DLG_FILE_LOAD); if (! i) break; removable_disk_unload(drive); diff --git a/src/version.h b/src/version.h index 3bd69dc..8f3e44b 100644 --- a/src/version.h +++ b/src/version.h @@ -8,7 +8,7 @@ * * Define application version and build info. * - * Version: @(#)version.h 1.0.13 2018/05/11 + * Version: @(#)version.h 1.0.15 2018/05/29 * * Author: Fred N. van Kempen, * @@ -59,8 +59,9 @@ /* Standard C preprocessor macros. */ -#define STR_HLP(x) #x -#define STR(x) STR_HLP(x) +#define STR_STRING(x) #x +#define STR(x) STR_STRING(x) +#define STR_RC(a,e) a ## , ## e /* These are used in the application. */ diff --git a/src/win/VARCem-common.rc b/src/win/VARCem-common.rc new file mode 100644 index 0000000..8e74def --- /dev/null +++ b/src/win/VARCem-common.rc @@ -0,0 +1,850 @@ +/* + * VARCem Virtual ARchaeological Computer EMulator. + * An emulator of (mostly) x86-based PC systems and devices, + * using the ISA,EISA,VLB,MCA and PCI system buses, roughly + * spanning the era between 1981 and 1995. + * + * This file is part of the VARCem Project. + * + * Common resources for the application. + * + * Version: @(#)VARCem-common.rc 1.0.5 2018/06/02 + * + * Author: Fred N. van Kempen, + * + * Copyright 2017,2018 Fred N. van Kempen. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef _MSC_VER +# define MENUSEPARATOR MENUITEM "" , , MFT_SEPARATOR +#else +# define MENUSEPARATOR MENUITEM SEPARATOR +#endif + +#define FONT_NAME "Segoe UI" + + +MainMenu MENUEX +BEGIN + POPUP STR_ACTION + BEGIN + MENUITEM STR_4001,IDM_RESET_HARD + MENUITEM STR_4002,IDM_RESET + MENUSEPARATOR + MENUITEM STR_4003,IDM_CAE + MENUITEM STR_4004,IDM_CAB + MENUSEPARATOR + MENUITEM STR_4005,IDM_PAUSE + MENUSEPARATOR + MENUITEM STR_4014,IDM_RCTRL_IS_LALT + MENUSEPARATOR + MENUITEM STR_4006,IDM_EXIT + END + + POPUP STR_VIEW + BEGIN + MENUITEM STR_4011,IDM_RESIZE + MENUITEM STR_4012,IDM_REMEMBER + MENUSEPARATOR + POPUP STR_4020,IDM_RENDER + BEGIN + MENUSEPARATOR + END + MENUSEPARATOR + POPUP STR_4030 + BEGIN + MENUITEM STR_4031,IDM_SCALE_1 + MENUITEM STR_4032,IDM_SCALE_2 + MENUITEM STR_4033,IDM_SCALE_3 + MENUITEM STR_4034,IDM_SCALE_4 + END + MENUSEPARATOR + MENUITEM STR_4013,IDM_FULLSCREEN + POPUP STR_4040 + BEGIN + MENUITEM STR_4041,IDM_STRETCH + MENUITEM STR_4042,IDM_STRETCH_43 + MENUITEM STR_4043,IDM_STRETCH_SQ + MENUITEM STR_4044,IDM_STRETCH_INT + MENUITEM STR_4045,IDM_STRETCH_KEEP + END + MENUSEPARATOR + MENUITEM STR_4015,IDM_UPDATE_ICONS + END + + POPUP STR_DISPLAY + BEGIN + MENUITEM STR_4051,IDM_INVERT + MENUITEM STR_4052,IDM_OVERSCAN + POPUP STR_DISPTYPE + BEGIN + MENUITEM STR_4061,IDM_SCREEN_RGB + MENUITEM STR_4062,IDM_SCREEN_GRAYSCALE + MENUITEM STR_4063,IDM_SCREEN_AMBER + MENUITEM STR_4064,IDM_SCREEN_GREEN + MENUITEM STR_4065,IDM_SCREEN_WHITE + END + POPUP STR_GRAYSCALE + BEGIN + MENUITEM STR_4071,IDM_GRAY_601 + MENUITEM STR_4072,IDM_GRAY_709 + MENUITEM STR_4073,IDM_GRAY_AVE + END + MENUSEPARATOR + MENUITEM STR_4053,IDM_FORCE_43 + MENUITEM STR_4054,IDM_CGA_CONTR + END + + POPUP STR_TOOLS + BEGIN + MENUITEM STR_4081,IDM_SETTINGS + POPUP STR_4082,IDM_LANGUAGE + BEGIN + MENUSEPARATOR + END + MENUSEPARATOR +#ifdef ENABLE_LOGGING + POPUP STR_4083,IDM_LOGGING + BEGIN + MENUITEM "&Log breakpoint\tCtrl+Insert", IDM_LOG_BREAKPOINT + MENUSEPARATOR + END +#endif + MENUITEM STR_4084,IDM_LOAD + MENUITEM STR_4085,IDM_SAVE + MENUSEPARATOR + MENUITEM STR_4086,IDM_STATUS + MENUSEPARATOR + MENUITEM STR_4087,IDM_SCREENSHOT + END + + POPUP STR_HELP + BEGIN + MENUITEM STR_4091,IDM_ABOUT + END +END + +StatusBarMenu MENU +BEGIN + MENUITEM SEPARATOR +END + + +DLG_LOCALIZE DIALOG 0, 0, 200, 130 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION STR_LOCALIZE +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3211,IDT_LOCALIZE,10,10,125,36 + + LISTBOX IDC_LOCALIZE,10,40,125,70, + WS_BORDER | WS_VSCROLL | LBS_SORT + + ICON 100,IDC_ABOUT_ICON,150,30,65,65 + + DEFPUSHBUTTON STR_OK,IDOK,145,90,50,14 + + LTEXT "",IDT_LOCALIZE+1,10,110,20,12 + LTEXT "",IDT_LOCALIZE+2,35,110,160,12 +END + + +DLG_ABOUT DIALOG 0, 0, 250, 160 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION STR_ABOUT +FONT 9, FONT_NAME +BEGIN + ICON 100,IDC_ABOUT_ICON,5,5,20,20 + + CTEXT "",IDT_TITLE,55,5,195,20 + + CTEXT "Virtual ARchaeological Computer EMulator", + IDC_ABOUT_ICON,55,22,195,10 + CTEXT "",IDT_VERSION,55,33,195,10 + + CONTROL "",IDC_ABOUT_ICON,"Static", + SS_BLACKFRAME | SS_SUNKEN,10,45,230,1 + + LTEXT STR_3201,IDC_ABOUT_ICON,5,55,40,10 + LTEXT STR_3202,IDC_ABOUT_ICON,50,55,195,30 + LTEXT STR_3203,IDC_ABOUT_ICON,5,85,240,20 + + LTEXT STR_3204,IDC_ABOUT_ICON,5,110,240,10 + + PUSHBUTTON STR_LOCALIZE,IDC_LOCALIZE,5,140,60,14 + + DEFPUSHBUTTON STR_OK,IDOK,75,140,60,14 + + CONTROL "",IDC_DONATE,"Static",SS_BITMAP|SS_NOTIFY,175,130,105,50 +END + +DLG_STATUS DIALOG 0, 0, 186, 386 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION STR_STATUS +FONT 9, FONT_NAME +BEGIN + LTEXT "1",IDT_SDEVICE,16,16,180,1000 + LTEXT "1",IDT_STEXT,16,186,180,1000 +END + +DLG_SND_GAIN DIALOG 0, 0, 113, 136 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION STR_SNDGAIN +FONT 9, FONT_NAME +BEGIN + CTEXT STR_3251,IDT_1746,16,7,32,9,SS_CENTERIMAGE + + CONTROL "Gain",IDC_SLIDER_GAIN,"msctls_trackbar32", + TBS_VERT | TBS_BOTH | TBS_AUTOTICKS | WS_TABSTOP, + 15,20,30,109 + + DEFPUSHBUTTON STR_OK,IDOK,57,7,50,14 + PUSHBUTTON STR_CANCEL,IDCANCEL,57,24,50,14 +END + +DLG_NEW_FLOPPY DIALOG 0, 0, 226, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION STR_NEWIMG +FONT 9, FONT_NAME +BEGIN + LTEXT STR_FILENAME,IDT_1749,7,6,90,12,SS_CENTERIMAGE + EDITTEXT IDC_EDIT_FILE_NAME,7,20,150,14, + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON STR_BROWSE,IDC_CFILE,160,19,60,14 + + LTEXT STR_3276,IDT_1750,7,38,70,12,SS_CENTERIMAGE + COMBOBOX IDC_COMBO_DISK_SIZE,7,52,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3277,IDT_1751,110,38,70,12,SS_CENTERIMAGE + COMBOBOX IDC_COMBO_RPM_MODE,110,52,110,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_PROGRESS,IDT_1757,7,6,70,12,SS_CENTERIMAGE + CONTROL "CreateProgress",IDC_PBAR_IMG_CREATE,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,7,20,166,14 + + DEFPUSHBUTTON STR_OK,IDOK,55,75,50,14 + PUSHBUTTON STR_CANCEL,IDCANCEL,130,75,50,14 +END + +DLG_CONFIG DIALOG 0, 0, 366, 251 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION STR_SETTINGS +FONT 9, FONT_NAME +BEGIN + CONTROL "List",IDC_SETTINGSCATLIST,"SysListView32", + LVS_LIST | LVS_SHOWSELALWAYS | LVS_SINGLESEL | + WS_BORDER | WS_TABSTOP,7,7,90,207 + + CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,221,363,1 + + DEFPUSHBUTTON STR_OK,IDOK,246,230,50,14 + PUSHBUTTON STR_CANCEL,IDCANCEL,307,230,50,14 +END + +DLG_CFG_MACHINE DIALOG 97, 0, 267, 114 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3325,IDT_1701,7,8,60,10 + COMBOBOX IDC_COMBO_MACHINE,71,7,138,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_MACHINE,214,7,46,12 + + LTEXT STR_3326,IDT_1702,7,26,59,10 + COMBOBOX IDC_COMBO_CPU_TYPE,71,25,45,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3327,IDT_1704,124,26,40,10 + COMBOBOX IDC_COMBO_CPU,170,25,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3328,IDT_1703,7,45,60,10 + COMBOBOX IDC_COMBO_WS,71,44,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3329,IDT_1706,7,64,30,10 + EDITTEXT IDC_MEMTEXT,70,63,45,12,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_MEMSPIN,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | + UDS_NOTHOUSANDS, + 113,63,12,12 + LTEXT STR_3330,IDT_1705,123,64,10,10 + + CONTROL STR_3331,IDC_CHECK_SYNC,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,81,102,10 + + CONTROL STR_3332,IDC_CHECK_FPU,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,147,81,113,10 + +#ifdef USE_DYNAREC + CONTROL STR_3333,IDC_CHECK_DYNAREC,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,96,120,10 +#endif +END + +DLG_CFG_VIDEO DIALOG 97, 0, 267, 63 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3350,IDT_1707,7,8,55,10 + COMBOBOX IDC_COMBO_VIDEO,71,7,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_VID,214,7,46,12 + + LTEXT STR_3351,IDT_1708,7,26,58,10 + COMBOBOX IDC_COMBO_VIDEO_SPEED,71,25,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3352,IDC_CHECK_VOODOO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,45,199,10 + PUSHBUTTON STR_CONFIGURE,IDC_BUTTON_VOODOO,214,44,46,12 +END + +DLG_CFG_INPUT DIALOG 97, 0, 267, 65 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3375,IDT_1709,7,8,57,10 + COMBOBOX IDC_COMBO_MOUSE,71,7,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_MOUSE,214,7,46,12 + + LTEXT STR_3376,IDT_1710,7,26,58,10 + COMBOBOX IDC_COMBO_JOYSTICK,71,25,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + PUSHBUTTON STR_3377,IDC_JOY1,7,44,60,14 + PUSHBUTTON STR_3378,IDC_JOY2,72,44,60,14 + PUSHBUTTON STR_3379,IDC_JOY3,137,44,60,14 + PUSHBUTTON STR_3380,IDC_JOY4,202,44,60,14 +END + +DLG_CFG_SOUND DIALOG 97, 0, 267, 116 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3400,IDT_1711,7,8,59,10 + COMBOBOX IDC_COMBO_SOUND,71,7,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_SND,214,7,46,12 + + LTEXT STR_3401,IDT_1712,7,26,59,10 + COMBOBOX IDC_COMBO_MIDI,71,25,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_MIDI,214,25,46,12 + + CONTROL STR_3402,IDC_CHECK_MPU401,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,45,199,10 + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_MPU401,214,44,46,12 + + CONTROL STR_3403,IDC_CHECK_NUKEDOPL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,63,120,10 + + CONTROL STR_3404,IDC_CHECK_FLOAT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,81,120,10 +END + +DLG_CFG_NETWORK DIALOG 97, 0, 267, 63 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3425,IDT_1713,7,8,59,10 + COMBOBOX IDC_COMBO_NET_TYPE,71,7,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3426,IDT_1714,7,26,59,10 + COMBOBOX IDC_COMBO_PCAP,71,25,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3427,IDT_1715,7,44,59,10 + COMBOBOX IDC_COMBO_NET,71,43,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_NET,214,43,46,14 +END + +DLG_CFG_PORTS DIALOG 97, 0, 267, 120 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + CONTROL STR_3450,IDC_CHECK_GAME,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,8,110,10 + + CONTROL STR_3451,IDC_CHECK_PARALLEL1,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,27,110,10 + COMBOBOX IDC_COMBO_PARALLEL1,120,26,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3452,IDC_CHECK_PARALLEL2,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,46,110,10 + COMBOBOX IDC_COMBO_PARALLEL2,120,45,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3453,IDC_CHECK_PARALLEL3,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,65,110,10 + COMBOBOX IDC_COMBO_PARALLEL3,120,64,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3454,IDC_CHECK_SERIAL1,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,88,110,10 + + CONTROL STR_3455,IDC_CHECK_SERIAL2,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,107,110,10 +END + +DLG_CFG_PERIPHERALS DIALOG 97, 0, 267, 97 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3475,IDT_1716,7,8,59,10 + COMBOBOX IDC_COMBO_SCSI,71,7,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_SCSI,214,7,46,12 + + LTEXT STR_3476,IDT_1717,7,26,61,10 + COMBOBOX IDC_COMBO_HDC,71,25,140,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_HDC,214,25,46,12 + + LTEXT STR_3477,IDT_1718,7,44,61,10 + COMBOBOX IDC_COMBO_IDE_TER,71,43,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3478,IDT_1719,7,62,61,10 + COMBOBOX IDC_COMBO_IDE_QUA,71,61,189,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3479,IDC_CHECK_BUGGER,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,80,94,10 +END + +DLG_CFG_DISK DIALOG 97, 0, 267, 154 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3500,IDT_1720,7,7,80,8 + + CONTROL "List1",IDC_LIST_HARD_DISKS,"SysListView32", + LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | + WS_BORDER | WS_TABSTOP,7,18,253,92 + + LTEXT STR_BUS,IDT_1721,7,119,24,8 + COMBOBOX IDC_COMBO_HD_BUS,33,117,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_CHANNEL,IDT_1722,131,119,38,8 + COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,170,117,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_HD_CHANNEL,170,117,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT STR_ID,IDT_1723,131,119,38,8 + COMBOBOX IDC_COMBO_HD_ID,170,117,22,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT STR_LUN,IDT_1724,200,119,38,8 + COMBOBOX IDC_COMBO_HD_LUN,239,117,22,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + PUSHBUTTON STR_3501,IDC_BUTTON_HDD_ADD_NEW,32,137,70,12 + PUSHBUTTON STR_3502,IDC_BUTTON_HDD_ADD,110,137,70,12 + PUSHBUTTON STR_3503,IDC_BUTTON_HDD_REMOVE,190,137,70,12 +END + +DLG_CFG_DISK_ADD DIALOG 0, 0, 219, 111 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION STR_3525 +FONT 9, FONT_NAME +BEGIN + LTEXT STR_FILENAME,IDT_1731,7,7,204,9 + EDITTEXT IDC_EDIT_HD_FILE_NAME,7,16,148,12 + PUSHBUTTON STR_BROWSE,IDC_CFILE,162,16,50,12 + + LTEXT STR_3528,IDT_1728,7,35,32,12 + EDITTEXT IDC_EDIT_HD_CYL,42,34,28,12 + LTEXT STR_3529,IDT_1727,81,35,29,8 + EDITTEXT IDC_EDIT_HD_HPC,112,34,28,12 + LTEXT STR_3530,IDT_1726,154,35,27,10 + EDITTEXT IDC_EDIT_HD_SPT,183,34,28,12 + + LTEXT STR_3531,IDT_1729,7,54,33,8 + EDITTEXT IDC_EDIT_HD_SIZE,42,52,28,12 + + LTEXT STR_3532,IDT_1730,86,54,24,8 + COMBOBOX IDC_COMBO_HD_TYPE,113,52,98,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_BUS,IDT_1721,7,73,24,8 + COMBOBOX IDC_COMBO_HD_BUS,33,71,58,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_CHANNEL,IDT_1722,99,73,34,8 + COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_ID,IDT_1723,117,73,15,8 + COMBOBOX IDC_COMBO_HD_ID,133,71,26,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT STR_LUN,IDT_1724,168,73,15,8 + COMBOBOX IDC_COMBO_HD_LUN,185,71,26,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT STR_PROGRESS,IDT_1752,7,7,204,9 + COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,134,71,77,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL "CreateProgress",IDC_PBAR_IMG_CREATE,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,7,16,204,12 + + DEFPUSHBUTTON STR_OK,IDOK,55,89,50,14 + PUSHBUTTON STR_CANCEL,IDCANCEL,112,89,50,14 +END + +DLG_CFG_FLOPPY DIALOG 97, 0, 267, 103 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3550,IDT_1737,7,7,80,8 + CONTROL "List1",IDC_LIST_FLOPPY_DRIVES,"SysListView32", + LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | + WS_BORDER | WS_TABSTOP,7,18,253,60 + + LTEXT STR_3551,IDT_1738,7,87,70,8 + COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + CONTROL STR_3552,IDC_CHECKTURBO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,131,86,64,10 + + CONTROL STR_3553,IDC_CHECKBPB,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,196,86,64,10 +END + +DLG_CFG_RMV_DEVICES DIALOG 97, 0, 267, 221 +STYLE DS_CONTROL | WS_CHILD +FONT 9, FONT_NAME +BEGIN + LTEXT STR_3575,IDT_1739,7,7,80,8 + CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32", + LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | + WS_BORDER | WS_TABSTOP,7,18,253,60 + + LTEXT STR_BUS,IDT_1740,7,87,34,8 + COMBOBOX IDC_COMBO_CD_BUS,43,85,80,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_CHANNEL,IDT_1743,141,87,20,8 + COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,180,85,80,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_ID,IDT_1741,141,87,20,8 + COMBOBOX IDC_COMBO_CD_ID,165,85,22,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_LUN,IDT_1742,200,87,20,8 + COMBOBOX IDC_COMBO_CD_LUN,235,85,22,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3576,IDT_1761,7,107,34,8 + COMBOBOX IDC_COMBO_CD_SPEED,43,105,80,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_3577,IDT_1762,7,127,80,8 + CONTROL "List2",IDC_LIST_ZIP_DRIVES,"SysListView32", + LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | + WS_BORDER | WS_TABSTOP,7,137,253,60 + + CONTROL STR_3578,IDC_CHECK250,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,204,34,10 + + LTEXT STR_BUS,IDT_1753,50,206,25,8 + COMBOBOX IDC_COMBO_ZIP_BUS,80,204,70,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_CHANNEL,IDT_1756,170,206,30,8 + COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,210,204,50,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_ID,IDT_1754,165,206,20,8 + COMBOBOX IDC_COMBO_ZIP_ID,185,204,20,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + + LTEXT STR_LUN,IDT_1755,210,206,20,8 + COMBOBOX IDC_COMBO_ZIP_LUN,235,204,20,120, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END + + +/* Common strings (2000.) */ +#ifdef STR_VERSION +STRINGTABLE +BEGIN + IDS_VERSION STR_VERSION + IDS_AUTHOR STR_AUTHOR + IDS_EMAIL STR_EMAIL +END +#endif + +/* Messagebox classes (2100.) */ +STRINGTABLE +BEGIN + IDS_ERROR STR_2100 + IDS_FATAL_ERROR STR_2101 + IDS_CONFIG_ERROR STR_2102 + IDS_WARNING STR_2103 +END + +/* System errors (2200.) */ +STRINGTABLE +BEGIN + IDS_ERR_ACCEL STR_2200 + IDS_ERR_INPUT STR_2201 + IDS_ERR_PCAP STR_2202 + IDS_ERR_PCAP_NO STR_2203 + IDS_ERR_PCAP_DEV STR_2204 + IDS_ERR_OPENAL STR_2205 + IDS_ERR_FSYNTH STR_2206 +END + +/* Application error messages (2300.) */ +STRINGTABLE +BEGIN + IDS_ERR_SCRSHOT STR_2300 + IDS_ERR_NOROMS STR_2301 + IDS_ERR_NOCONF STR_2302 + IDS_ERR_NOMACH STR_2303 + IDS_ERR_NOVIDEO STR_2304 + IDS_ERR_NORENDR STR_2305 + IDS_ERR_NOCDROM STR_2306 + IDS_ERR_NO_USB STR_2307 +END + +/* Application messages (2400.) */ +STRINGTABLE +BEGIN + IDS_MSG_SAVE STR_2400 + IDS_MSG_RESTART STR_2401 + IDS_MSG_UNSTABL STR_2402 + IDS_MSG_CAPTURE STR_2403 + IDS_MSG_MRLS_1 STR_2404 + IDS_MSG_MRLS_2 STR_2405 + IDS_MSG_WINDOW STR_2406 +END + +/* Misc application strings (2500.) */ +STRINGTABLE +BEGIN + IDS_2500 STR_2500 +END + + +/* UI: common elements (3000.) */ +STRINGTABLE +BEGIN + IDS_OK STR_OK + IDS_CANCEL STR_CANCEL + IDS_CONFIGURE STR_CONFIGURE + IDS_BROWSE STR_BROWSE +END + +/* UI: dialog shared strings (3100.) */ +STRINGTABLE +BEGIN + IDS_NONE STR_NONE + IDS_DISABLED STR_DISABLED + IDS_ENABLED STR_ENABLED + IDS_OFF STR_OFF + IDS_ON STR_ON + IDS_TYPE STR_TYPE + IDS_FILENAME STR_FILENAME + IDS_PROGRESS STR_PROGRESS + IDS_BUS STR_BUS + IDS_CHANNEL STR_CHANNEL + IDS_ID STR_ID + IDS_LUN STR_LUN + IDS_INV_NAME STR_INV_NAME + IDS_IMG_EXIST STR_IMG_EXIST + IDS_OPEN_READ STR_OPEN_READ + IDS_OPEN_WRITE STR_OPEN_WRITE +END + +/* UI: dialog: About (3200.) */ + +/* UI dialog: Status (3225.) */ + +/* UI dialog: Sound Gain (3250.) */ + +/* UI dialog: New Image (3275.) */ +STRINGTABLE +BEGIN + IDS_3278 STR_3278 + IDS_3279 STR_3279 + IDS_3280 STR_3280 + IDS_3281 STR_3281 + IDS_3282 STR_3282 + IDS_3283 STR_3283 + IDS_3284 STR_3284 + IDS_3285 STR_3285 + IDS_3286 STR_3286 + IDS_3287 STR_3287 + IDS_3288 STR_3288 + IDS_3289 STR_3289 + IDS_3290 STR_3290 + IDS_3291 STR_3291 + IDS_3292 STR_3292 + IDS_3293 STR_3293 + IDS_3294 STR_3294 + IDS_3295 STR_3295 +END + +/* UI dialog: Settings (3300.) */ +STRINGTABLE +BEGIN + IDS_3310 STR_3310 + IDS_3311 STR_3311 + IDS_3312 STR_3312 + IDS_3313 STR_3313 + IDS_3314 STR_3314 + IDS_3315 STR_3315 + IDS_3316 STR_3316 + IDS_3317 STR_3317 + IDS_3318 STR_3318 + IDS_3319 STR_3319 +END + +/* UI dialog: Settings (Machine, 3325.) */ +STRINGTABLE +BEGIN + IDS_3330 STR_3330 + IDS_3334 STR_3334 + IDS_3335 STR_3335 +END + +/* UI dialog: Settings (Video, 3350.) */ +STRINGTABLE +BEGIN + IDS_3353 STR_3353 + IDS_3354 STR_3354 + IDS_3355 STR_3355 + IDS_3356 STR_3356 + IDS_3357 STR_3357 + IDS_3358 STR_3358 + IDS_3359 STR_3359 +END + +/* UI dialog: Settings (Input, 3375.) */ + +/* UI dialog: Settings (Sound, 3400.) */ + +/* UI dialog: Settings (Network, 3425.) */ + +/* UI dialog: Settings (Ports, 3450.) */ + +/* UI dialog: Settings (Other Devices, 3475.) */ + +/* UI dialog: Settings (Hard Disks, 3500.) */ +STRINGTABLE +BEGIN + IDS_3504 STR_3504 + IDS_3505 STR_3505 + IDS_3506 STR_3506 + IDS_3507 STR_3507 + IDS_3508 STR_3508 + IDS_3509 STR_3509 + IDS_3510 STR_3510 + IDS_3511 STR_3511 + IDS_3512 STR_3512 + IDS_3515 STR_3515 + IDS_3516 STR_3516 + IDS_3517 STR_3517 + IDS_3518 STR_3518 + IDS_3519 STR_3519 + IDS_3520 STR_3520 +END + +/* UI dialog: Settings (Add Hard Disk, 3525.) */ +STRINGTABLE +BEGIN + IDS_3526 STR_3526 + IDS_3527 STR_3527 + IDS_3533 STR_3533 + IDS_3534 STR_3534 + IDS_3535 STR_3535 + IDS_3536 STR_3536 + IDS_3537 STR_3537 +END + +/* UI dialog: Settings (Floppy Drives, 3550.) */ +STRINGTABLE +BEGIN + IDS_3554 STR_3554 + IDS_3555 STR_3555 +END + +/* UI dialog: Settings (Removable Devices, 3575.) */ +STRINGTABLE +BEGIN + IDS_3579 STR_3579 + IDS_3580 STR_3580 + IDS_3581 STR_3581 + IDS_3582 STR_3582 + IDS_3583 STR_3583 + IDS_3584 STR_3584 +END + +/* UI dialog: status bar (3900.) */ +STRINGTABLE +BEGIN + IDS_3900 STR_3900 + IDS_3901 STR_3901 + IDS_3902 STR_3902 + IDS_3903 STR_3903 + IDS_3904 STR_3904 + IDS_3905 STR_3905 + IDS_3906 STR_3906 + IDS_3910 STR_3910 + IDS_3911 STR_3911 + IDS_3912 STR_3912 + IDS_3913 STR_3913 + IDS_3914 STR_3914 + IDS_3920 STR_3920 + IDS_3921 STR_3921 + IDS_3922 STR_3922 + IDS_3923 STR_3923 + IDS_3930 STR_3930 + IDS_3940 STR_3940 + IDS_3941 STR_3941 + IDS_3950 STR_3950 + IDS_3951 STR_3951 + IDS_3952 STR_3952 + IDS_3960 STR_3960 + IDS_3970 STR_3970 +END diff --git a/src/win/VARCem.rc b/src/win/VARCem.rc index 2130511..bfc542f 100644 --- a/src/win/VARCem.rc +++ b/src/win/VARCem.rc @@ -8,31 +8,41 @@ * * Application resource script for Windows. * - * Version: @(#)VARCem.rc 1.0.29 2018/05/13 + * Version: @(#)VARCem.rc 1.0.32 2018/06/02 * - * Authors: Fred N. van Kempen, - * Miran Grca, + * Author: Fred N. van Kempen, * * Copyright 2017,2018 Fred N. van Kempen. - * Copyright 2016-2018 Miran Grca. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the: + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. * - * Free Software Foundation, Inc. - * 59 Temple Place - Suite 330 - * Boston, MA 02111-1307 - * USA. + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include @@ -43,220 +53,14 @@ #include "resource.h" -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 -///////////////////////////////////////////////////////////////////////////// -// Menu -///////////////////////////////////////////////////////////////////////////// +#include "../ui/lang/VARCem-EN.str" -MainMenu MENU DISCARDABLE -BEGIN - POPUP "&Action" - BEGIN - MENUITEM "&Hard Reset", IDM_RESET_HARD - MENUITEM "&Ctrl+Alt+Del", IDM_RESET - MENUITEM SEPARATOR - MENUITEM "Send Ctrl+Alt+&Esc", IDM_CAE - MENUITEM "Send Ctrl+Alt+&Break", IDM_CAB - MENUITEM SEPARATOR - MENUITEM "&Pause", IDM_PAUSE - MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_EXIT - END - POPUP "&View" - BEGIN - MENUITEM "&Resizeable window", IDM_RESIZE - MENUITEM "R&emember size && position", IDM_REMEMBER - MENUITEM SEPARATOR - POPUP "Re&nderer" - BEGIN - MENUITEM "DirectDraw", IDM_RENDER_1 - MENUITEM "Direct3D", IDM_RENDER_2 -#ifdef USE_SDL -# define IDM_RENDER_SDL IDM_RENDER_2+1 - MENUITEM "SDL", IDM_RENDER_SDL -#else -# define IDM_RENDER_SDL IDM_RENDER_2 -#endif -#ifdef USE_VNC -# define IDM_RENDER_VNC IDM_RENDER_SDL+1 - MENUITEM "VNC Remote", IDM_RENDER_VNC -#else -# define IDM_RENDER_VNC IDM_RENDER_SDL -#endif -#ifdef USE_RDP -# define IDM_RENDER_RDP IDM_RENDER_VNC+1 - MENUITEM "RDP Remote", IDM_RENDER_RDP -#else -# define IDM_RENDER_RDP IDM_RENDER_VNC -#endif - END - MENUITEM SEPARATOR - POPUP "&Window scale factor" - BEGIN - MENUITEM "&0.5x", IDM_SCALE_1 - MENUITEM "&1x", IDM_SCALE_2 - MENUITEM "1.&5x", IDM_SCALE_3 - MENUITEM "&2x", IDM_SCALE_4 - END - MENUITEM SEPARATOR - MENUITEM "&Fullscreen\tCtrl+Alt+PageUP",IDM_FULLSCREEN - POPUP "Fullscreen &stretch mode" - BEGIN - MENUITEM "&Full screen stretch", IDM_STRETCH - MENUITEM "&4:3", IDM_STRETCH_43 - MENUITEM "&Square pixels", IDM_STRETCH_SQ - MENUITEM "&Integer scale", IDM_STRETCH_INT - MENUITEM "&Keep size", IDM_STRETCH_KEEP - END - MENUITEM SEPARATOR - MENUITEM "R&ight CTRL is left ALT", IDM_RCTRL_IS_LALT - MENUITEM SEPARATOR - MENUITEM "&Update status bar icons", IDM_UPDATE_ICONS - END - POPUP "&Display" - BEGIN - MENUITEM "&Inverted display", IDM_INVERT - MENUITEM "Enable &overscan", IDM_OVERSCAN - POPUP "Display &type" - BEGIN - MENUITEM "RGB &Color monitor", IDM_SCREEN_RGB - MENUITEM "&Grayscale monitor", IDM_SCREEN_GRAYSCALE - MENUITEM "&Amber monitor", IDM_SCREEN_AMBER - MENUITEM "&Green monitor", IDM_SCREEN_GREEN - MENUITEM "&White monitor", IDM_SCREEN_WHITE - END - POPUP "&Grayscale conversion type" - BEGIN - MENUITEM "BT&601 (NTSC/PAL)", IDM_GRAY_601 - MENUITEM "BT&709 (HDTV)", IDM_GRAY_709 - MENUITEM "&Average", IDM_GRAY_AVE - END - MENUITEM SEPARATOR - MENUITEM "F&orce 4:3 display ratio", IDM_FORCE_43 - MENUITEM "Change &contrast for monochrome display", IDM_CGA_CONTR - END - POPUP "&Tools" - BEGIN - MENUITEM "&Settings...", IDM_SETTINGS - MENUITEM SEPARATOR -#if defined(ENABLE_LOG_TOGGLES) || defined(ENABLE_LOG_COMMANDS) - POPUP "&Logging" - BEGIN -# ifdef ENABLE_BUS_LOG - MENUITEM "Enable system bus logging\tCtrl+F1", IDM_LOG_BUS -# endif -# ifdef ENABLE_KEYBOARD_LOG - MENUITEM "Enable keyboard logging\tCtrl+F2", IDM_LOG_KEYBOARD -# endif -# ifdef ENABLE_MOUSE_LOG - MENUITEM "Enable mouse logging\tCtrl+F3", IDM_LOG_MOUSE -# endif -# ifdef ENABLE_GAME_LOG - MENUITEM "Enable game port logging\tCtrl+F4", IDM_LOG_GAME -# endif -# ifdef ENABLE_PARALLEL_LOG - MENUITEM "Enable parallel port logging\tCtrl+F5", IDM_LOG_PARALLEL -# endif -# ifdef ENABLE_SERIAL_LOG - MENUITEM "Enable serial port logging\tCtrl+F6", IDM_LOG_SERIAL -# endif -# ifdef ENABLE_FDC_LOG - MENUITEM "Enable FDC logging\tCtrl+F7", IDM_LOG_FDC -# endif -# ifdef ENABLE_FDD_LOG - MENUITEM "Enable floppy (image) logging\tCtrl+F8", IDM_LOG_FDD -# endif -# ifdef ENABLE_D86F_LOG - MENUITEM "Enable floppy (D86F) logging\tCtrl+F9", IDM_LOG_D86F -# endif -# ifdef ENABLE_HDC_LOG - MENUITEM "Enable HDC logging\tCtrl+F10", IDM_LOG_HDC -# endif -# ifdef ENABLE_HDD_LOG - MENUITEM "Enable disk (image) logging\tCtrl+F11", IDM_LOG_HDD -# endif -# ifdef ENABLE_ZIP_LOG - MENUITEM "Enable ZIP drive logging\tCtrl+F12", IDM_LOG_ZIP -# endif -# ifdef ENABLE_CDROM_LOG - MENUITEM "Enable CD-ROM drive logging\tCtrl+Alt+F1", IDM_LOG_CDROM -# endif -# ifdef ENABLE_CDROM_IMAGE_LOG - MENUITEM "Enable CD-ROM (image) logging\tCtrl+Alt+F2", IDM_LOG_CDROM_IMAGE -# endif -# ifdef ENABLE_CDROM_IOCTL_LOG - MENUITEM "Enable CD-ROM (ioctl) logging\tCtrl+Alt+F3", IDM_LOG_CDROM_IOCTL -# endif -# ifdef ENABLE_NETWORK_LOG - MENUITEM "Enable network logging\tCtrl+Alt+F4", IDM_LOG_NETWORK -# endif -# ifdef ENABLE_NETWORK_LOG_DEV - MENUITEM "Enable network device logging\tCtrl+Alt+F5", IDM_LOG_NETWORK_DEV -# endif -# ifdef ENABLE_SOUND_EMU8K_LOG - MENUITEM "Enable sound (EMU8K) logging\tCtrl+Alt+F6", IDM_LOG_SOUND_EMU8K -# endif -# ifdef ENABLE_SOUND_MPU401_LOG - MENUITEM "Enable sound (MPU401) logging\tCtrl+Alt+F7", IDM_LOG_SOUND_MPU401 -# endif -# ifdef ENABLE_SOUND_DEV_LOG - MENUITEM "Enable sound device logging\tCtrl+Alt+F8", IDM_LOG_SOUND_DEV -# endif -# ifdef ENABLE_SCSI_BUS_LOG - MENUITEM "Enable SCSI bus logging\tCtrl+Alt+F9", IDM_LOG_SCSI_BUS -# endif -# ifdef ENABLE_SCSI_DISK_LOG - MENUITEM "Enable SCSI disk logging\tCtrl+Alt+F10", IDM_LOG_SCSI_DISK -# endif -# ifdef ENABLE_SCSI_DEV_LOG - MENUITEM "Enable SCSI controller logging\tCtrl+Alt+F11", IDM_LOG_SCSI_DEV -# endif -# ifdef ENABLE_VOODOO_LOG - MENUITEM "Enable Voodoo logging\tCtrl+Alt+F12", IDM_LOG_VOODOO -# endif +#include "VARCem-common.rc" -# if defined(ENABLE_LOG_COMMANDS) && defined(ENABLE_LOG_TOGGLES) - MENUITEM SEPARATOR -# endif -# ifdef ENABLE_LOG_BREAKPOINT - MENUITEM "&Log breakpoint\tCtrl+Insert", IDM_LOG_BREAKPOINT -# endif - MENUITEM SEPARATOR - END -#endif - MENUITEM "L&oad configuration", IDM_LOAD - MENUITEM "S&ave configuration", IDM_SAVE - MENUITEM SEPARATOR - MENUITEM "S&tatus", IDM_STATUS - MENUITEM SEPARATOR - MENUITEM "Take s&creenshot\tCtrl+Home", IDM_SCREENSHOT - END - POPUP "&Help" - BEGIN - MENUITEM "&About VARCem...", IDM_ABOUT - END -END - -StatusBarMenu MENU DISCARDABLE -BEGIN - MENUITEM SEPARATOR -END - -///////////////////////////////////////////////////////////////////////////// -// Accelerator -///////////////////////////////////////////////////////////////////////////// - -MainAccel ACCELERATORS MOVEABLE PURE +MainAccel ACCELERATORS BEGIN #ifdef ENABLE_BUS_LOG VK_F1, IDM_LOG_BUS, VIRTKEY, CONTROL @@ -340,827 +144,61 @@ BEGIN END -///////////////////////////////////////////////////////////////////////////// -// Dialog -///////////////////////////////////////////////////////////////////////////// - -DLG_ABOUT DIALOG DISCARDABLE 0, 0, 250, 170 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About VARCem" -FONT 9, "Segoe UI" -BEGIN - ICON 100,IDC_ABOUT_ICON,5,5,20,20 - CTEXT "",IDT_TITLE,55,10,195,20 - CTEXT "Virtual ARchaeological Computer EMulator", - IDC_ABOUT_ICON,55,30,195,10 - CTEXT "",IDT_VERSION,55,40,195,10 - CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN, - 57,52,190,1 - LTEXT "Authors:", IDC_ABOUT_ICON,5,60,40,10 - LTEXT "Fred N. van Kempen, Miran Grca, Sarah Walker, TheCollector1995, reenigne, John Elliott, greatpsycho, and others.", - IDC_ABOUT_ICON,5,70,240,30 - LTEXT "Based on earlier works like 86Box, PCem, MAME, DOSbox and Qemu.", - IDC_ABOUT_ICON,5,100,240,20 - LTEXT "Released under the BSD 3-Clause License, and the GNU General Public License (version 2 or up) for existing, imported code from other projects. See LICENSE.txt for more information.", - IDC_ABOUT_ICON,5,120,240,30 - DEFPUSHBUTTON "OK",IDOK,169,150,71,12 -END - -DLG_STATUS DIALOG DISCARDABLE 0, 0, 186, 386 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Status" -FONT 9, "Segoe UI" -BEGIN - LTEXT "1",IDT_SDEVICE,16,16,180,1000 - LTEXT "1",IDT_STEXT,16,186,180,1000 -END - -DLG_SND_GAIN DIALOG DISCARDABLE 0, 0, 113, 136 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Sound Gain" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,57,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,57,24,50,14 - CONTROL "Gain",IDC_SLIDER_GAIN,"msctls_trackbar32",TBS_VERT | - TBS_BOTH | TBS_AUTOTICKS | WS_TABSTOP,15,20,20,109 - CTEXT "Gain",IDT_1746,16,7,32,9,SS_CENTERIMAGE -END - -DLG_NEW_FLOPPY DIALOG DISCARDABLE 0, 0, 226, 86 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "New Floppy Image" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,74,65,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,65,50,14 - LTEXT "File name:",IDT_1749,7,6,44,12,SS_CENTERIMAGE - LTEXT "Disk size:",IDT_1750,7,25,44,12,SS_CENTERIMAGE - LTEXT "RPM mode:",IDT_1751,7,45,44,12,SS_CENTERIMAGE - EDITTEXT IDC_EDIT_FILE_NAME,53,5,154,14,ES_AUTOHSCROLL | ES_READONLY - COMBOBOX IDC_COMBO_DISK_SIZE,53,25,166,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_RPM_MODE,53,45,166,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "...",IDC_CFILE,206,5,13,14 - LTEXT "Progress:",IDT_1757,7,45,44,12,SS_CENTERIMAGE - CONTROL "IMGCreateProgress",IDC_PBAR_IMG_CREATE,"msctls_progress32",PBS_SMOOTH | - WS_BORDER,53,45,166,14 -END - -DLG_CONFIG DIALOG DISCARDABLE 0, 0, 366, 251 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Settings" -FONT 9, "Segoe UI" -BEGIN - DEFPUSHBUTTON "OK",IDOK,246,230,50,14 - PUSHBUTTON "Cancel",IDCANCEL,307,230,50,14 - CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_LIST | - LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,90,207 - CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,221,363,1 -/* Leave this commented out until we get into localization. */ -#if 0 - LTEXT "Language:",IDT_1700,7,232,41,10 - COMBOBOX IDC_COMBO_LANG,48,231,108,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP -#endif -END - -#ifdef USE_DYNAREC -DLG_CFG_MACHINE DIALOG DISCARDABLE 97, 0, 267, 114 +100 ICON "icons/varcem.ico" +#if 1 +101 BITMAP "icons/donate-button-blue-128x55.bmp" #else -DLG_CFG_MACHINE DIALOG DISCARDABLE 97, 0, 267, 99 -#endif -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - COMBOBOX IDC_COMBO_MACHINE,71,7,138,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Machine:",IDT_1701,7,8,60,10 - PUSHBUTTON "Configure",IDC_CONFIGURE_MACHINE,214,7,46,12 - COMBOBOX IDC_COMBO_CPU_TYPE,71,25,45,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "CPU type:",IDT_1702,7,26,59,10 - COMBOBOX IDC_COMBO_CPU,145,25,115,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "CPU:",IDT_1704,124,26,18,10 - COMBOBOX IDC_COMBO_WS,71,44,189,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "Wait states:",IDT_1703,7,45,60,10 - EDITTEXT IDC_MEMTEXT,70,63,45,12,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_MEMSPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,113,63, - 12,12 - LTEXT "MB",IDT_1705,123,64,10,10 - LTEXT "Memory:",IDT_1706,7,64,30,10 - CONTROL "Enable time sync",IDC_CHECK_SYNC,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,81,102,10 - CONTROL "Enable FPU",IDC_CHECK_FPU,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,147,81,113,10 -#ifdef USE_DYNAREC - CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,96,94,10 -#endif -END - -DLG_CFG_VIDEO DIALOG DISCARDABLE 97, 0, 267, 63 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - LTEXT "Video:",IDT_1707,7,8,55,10 - COMBOBOX IDC_COMBO_VIDEO,71,7,140,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_VID,214,7,46,12 - COMBOBOX IDC_COMBO_VIDEO_SPEED,71,25,189,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Video speed:",IDT_1708,7,26,58,10 - CONTROL "Voodoo Graphics",IDC_CHECK_VOODOO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,45,199,10 - PUSHBUTTON "Configure",IDC_BUTTON_VOODOO,214,44,46,12 -END - -DLG_CFG_INPUT DIALOG DISCARDABLE 97, 0, 267, 65 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - LTEXT "Mouse:",IDT_1709,7,8,57,10 - COMBOBOX IDC_COMBO_MOUSE,71,7,140,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_MOUSE,214,7,46,12 - LTEXT "Joystick:",IDT_1710,7,26,58,10 - COMBOBOX IDC_COMBO_JOYSTICK,71,25,189,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Joystick 1...",IDC_JOY1,7,44,50,14 - PUSHBUTTON "Joystick 2...",IDC_JOY2,74,44,50,14 - PUSHBUTTON "Joystick 3...",IDC_JOY3,141,44,50,14 - PUSHBUTTON "Joystick 4...",IDC_JOY4,209,44,50,14 -END - -DLG_CFG_SOUND DIALOG DISCARDABLE 97, 0, 267, 116 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - COMBOBOX IDC_COMBO_SOUND,71,7,140,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "Sound card:",IDT_1711,7,8,59,10 - PUSHBUTTON "Configure",IDC_CONFIGURE_SND,214,7,46,12 - - COMBOBOX IDC_COMBO_MIDI,71,25,140,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "MIDI Out Device:",IDT_1712,7,26,59,10 - PUSHBUTTON "Configure",IDC_CONFIGURE_MIDI,214,25,46,12 - - CONTROL "Standalone MPU-401",IDC_CHECK_MPU401,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,45,199,10 - PUSHBUTTON "Configure",IDC_CONFIGURE_MPU401,214,44,46,12 - - CONTROL "Use Nuked OPL",IDC_CHECK_NUKEDOPL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,63,94,10 - - CONTROL "Use FLOAT32 sound",IDC_CHECK_FLOAT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,81,94,10 -END - -DLG_CFG_NETWORK DIALOG DISCARDABLE 97, 0, 267, 63 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - LTEXT "Network type:",IDT_1713,7,8,59,10 - COMBOBOX IDC_COMBO_NET_TYPE,71,7,189,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - - LTEXT "PCap device:",IDT_1714,7,26,59,10 - COMBOBOX IDC_COMBO_PCAP,71,25,189,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - - LTEXT "Network adapter:",IDT_1715,7,44,59,10 - COMBOBOX IDC_COMBO_NET,71,43,140,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_NET,214,43,46,12 -END - -DLG_CFG_PORTS DIALOG DISCARDABLE 97, 0, 267, 120 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - CONTROL "Game port",IDC_CHECK_GAME,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,8,70,10 - - CONTROL "Parallel port 1",IDC_CHECK_PARALLEL1,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,27,70,10 - COMBOBOX IDC_COMBO_PARALLEL1,80,26,159,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - - CONTROL "Parallel port 2",IDC_CHECK_PARALLEL2,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,46,70,10 - COMBOBOX IDC_COMBO_PARALLEL2,80,45,159,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - - CONTROL "Parallel port 3",IDC_CHECK_PARALLEL3,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,65,70,10 - COMBOBOX IDC_COMBO_PARALLEL3,80,64,159,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - - CONTROL "Serial port 1",IDC_CHECK_SERIAL1,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,88,94,10 - - CONTROL "Serial port 2",IDC_CHECK_SERIAL2,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,107,94,10 -END - -DLG_CFG_PERIPHERALS DIALOG DISCARDABLE 97, 0, 267, 97 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - LTEXT "SCSI Controller:",IDT_1716,7,8,59,10 - COMBOBOX IDC_COMBO_SCSI,71,7,140,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI,214,7,46,12 - - LTEXT "HD Controller:",IDT_1717,7,26,61,10 - COMBOBOX IDC_COMBO_HDC,71,25,140,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Configure",IDC_CONFIGURE_HDC,214,25,46,12 - - LTEXT "Tertiary IDE:",IDT_1718,7,44,61,10 - COMBOBOX IDC_COMBO_IDE_TER,71,43,189,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - - LTEXT "Quaternary IDE:",IDT_1719,7,62,61,10 - COMBOBOX IDC_COMBO_IDE_QUA,71,61,189,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - - CONTROL "ISABugger device",IDC_CHECK_BUGGER,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,80,94,10 -END - -DLG_CFG_DISK DIALOG DISCARDABLE 97, 0, 267, 154 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - CONTROL "List1",IDC_LIST_HARD_DISKS,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | - WS_TABSTOP,7,18,253,92 - LTEXT "Hard disks:",IDT_1720,7,7,34,8 - PUSHBUTTON "&New...",IDC_BUTTON_HDD_ADD_NEW,60,137,62,10 - PUSHBUTTON "&Existing...",IDC_BUTTON_HDD_ADD,129,137,62,10 - PUSHBUTTON "&Remove",IDC_BUTTON_HDD_REMOVE,198,137,62,10 - COMBOBOX IDC_COMBO_HD_BUS,33,117,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Bus:",IDT_1721,7,119,24,8 - COMBOBOX IDC_COMBO_HD_CHANNEL,170,117,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Channel:",IDT_1722,131,119,38,8 - COMBOBOX IDC_COMBO_HD_ID,170,117,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ID:",IDT_1723,131,119,38,8 - COMBOBOX IDC_COMBO_HD_LUN,239,117,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "LUN:",IDT_1724,200,119,38,8 - COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,170,117,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP -END - -DLG_CFG_DISK_ADD DIALOG DISCARDABLE 0, 0, 219, 111 -STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add Hard Disk" -FONT 9, "Segoe UI" -BEGIN - DEFPUSHBUTTON "OK",IDOK,55,89,50,14 - PUSHBUTTON "Cancel",IDCANCEL,112,89,50,14 - EDITTEXT IDC_EDIT_HD_FILE_NAME,7,16,153,12 - PUSHBUTTON "&Specify...",IDC_CFILE,167,16,44,12 - EDITTEXT IDC_EDIT_HD_SPT,183,34,28,12 - EDITTEXT IDC_EDIT_HD_HPC,112,34,28,12 - EDITTEXT IDC_EDIT_HD_CYL,42,34,28,12 - EDITTEXT IDC_EDIT_HD_SIZE,42,52,28,12 - COMBOBOX IDC_COMBO_HD_TYPE,113,52,98,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Sectors:",IDT_1726,154,35,27,10 - LTEXT "Heads:",IDT_1727,81,35,29,8 - LTEXT "Cylinders:",IDT_1728,7,35,32,12 - LTEXT "Size (MB):",IDT_1729,7,54,33,8 - LTEXT "Type:",IDT_1730,86,54,24,8 - LTEXT "File name:",IDT_1731,7,7,204,9 - COMBOBOX IDC_COMBO_HD_BUS,33,71,58,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Bus:",IDT_1721,7,73,24,8 - COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Channel:",IDT_1722,99,73,34,8 - COMBOBOX IDC_COMBO_HD_ID,133,71,26,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ID:",IDT_1723,117,73,15,8 - COMBOBOX IDC_COMBO_HD_LUN,185,71,26,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "LUN:",IDT_1724,168,73,15,8 - COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,134,71,77,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Progress:",IDT_1752,7,7,204,9 - CONTROL "IMGCreateProgress",IDC_PBAR_IMG_CREATE,"msctls_progress32",PBS_SMOOTH | - WS_BORDER,7,16,204,12 -END - -DLG_CFG_FLOPPY DIALOG DISCARDABLE 97, 0, 267, 103 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - CONTROL "List1",IDC_LIST_FLOPPY_DRIVES,"SysListView32", - LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | - WS_TABSTOP,7,18,253,60 - LTEXT "Floppy drives:",IDT_1737,7,7,43,8 - COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Type:",IDT_1738,7,87,24,8 - CONTROL "Turbo timings",IDC_CHECKTURBO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,131,86,64,10 - CONTROL "Check BPB",IDC_CHECKBPB,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,196,86,64,10 -END - -DLG_CFG_RMV_DEVICES DIALOG DISCARDABLE 97, 0, 267, 221 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "Segoe UI" -BEGIN - CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | - WS_TABSTOP,7,18,253,60 - LTEXT "CD-ROM drives:",IDT_1739,7,7,50,8 - COMBOBOX IDC_COMBO_CD_BUS,33,85,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Bus:",IDT_1740,7,87,24,8 - COMBOBOX IDC_COMBO_CD_ID,170,85,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ID:",IDT_1741,131,87,38,8 - COMBOBOX IDC_COMBO_CD_LUN,239,85,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "LUN:",IDT_1742,200,87,38,8 - COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,170,85,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Channel:",IDT_1743,131,87,38,8 - COMBOBOX IDC_COMBO_CD_SPEED,33,105,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Speed:",IDT_1761,7,107,24,8 - CONTROL "List1",IDC_LIST_ZIP_DRIVES,"SysListView32",LVS_REPORT | - LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | - WS_TABSTOP,7,137,253,60 - LTEXT "ZIP drives:",IDT_1762,7,127,50,8 - COMBOBOX IDC_COMBO_ZIP_BUS,73,204,90,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Bus:",IDT_1753,57,206,14,8 - COMBOBOX IDC_COMBO_ZIP_ID,190,204,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ID:",IDT_1754,171,206,18,8 - COMBOBOX IDC_COMBO_ZIP_LUN,239,204,22,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "LUN:",IDT_1755,220,206,18,8 - COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,200,204,60,120,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Channel:",IDT_1756,171,206,28,8 - CONTROL "ZIP 250",IDC_CHECK250,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,204,44,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// Manifest -///////////////////////////////////////////////////////////////////////////// - -#ifndef SKIP_MANIFEST -1 24 MOVEABLE PURE "VARCem.manifest" +101 ICON "icons/paypal.ico" #endif -///////////////////////////////////////////////////////////////////////////// -// Icon -///////////////////////////////////////////////////////////////////////////// +128 ICON "icons/floppy_525.ico" +384 ICON "icons/floppy_525_empty.ico" +129 ICON "icons/floppy_525_active.ico" +385 ICON "icons/floppy_525_empty_active.ico" +144 ICON "icons/floppy_35.ico" +145 ICON "icons/floppy_35_active.ico" +400 ICON "icons/floppy_35_empty.ico" +401 ICON "icons/floppy_35_empty_active.ico" -100 ICON DISCARDABLE "icons/varcem.ico" -128 ICON DISCARDABLE "icons/floppy_525.ico" -129 ICON DISCARDABLE "icons/floppy_525_active.ico" -144 ICON DISCARDABLE "icons/floppy_35.ico" -145 ICON DISCARDABLE "icons/floppy_35_active.ico" -160 ICON DISCARDABLE "icons/cdrom.ico" -161 ICON DISCARDABLE "icons/cdrom_active.ico" -176 ICON DISCARDABLE "icons/zip.ico" -177 ICON DISCARDABLE "icons/zip_active.ico" -192 ICON DISCARDABLE "icons/removable_disk.ico" -193 ICON DISCARDABLE "icons/removable_disk_active.ico" -208 ICON DISCARDABLE "icons/hard_disk.ico" -209 ICON DISCARDABLE "icons/hard_disk_active.ico" -224 ICON DISCARDABLE "icons/network.ico" -225 ICON DISCARDABLE "icons/network_active.ico" -256 ICON DISCARDABLE "icons/machine.ico" -257 ICON DISCARDABLE "icons/display.ico" -258 ICON DISCARDABLE "icons/input_devices.ico" -259 ICON DISCARDABLE "icons/sound.ico" -260 ICON DISCARDABLE "icons/network.ico" -261 ICON DISCARDABLE "icons/ports.ico" -262 ICON DISCARDABLE "icons/other_peripherals.ico" -263 ICON DISCARDABLE "icons/hard_disk.ico" -264 ICON DISCARDABLE "icons/floppy_drives.ico" -265 ICON DISCARDABLE "icons/other_removable_devices.ico" -384 ICON DISCARDABLE "icons/floppy_525_empty.ico" -385 ICON DISCARDABLE "icons/floppy_525_empty_active.ico" -400 ICON DISCARDABLE "icons/floppy_35_empty.ico" -401 ICON DISCARDABLE "icons/floppy_35_empty_active.ico" -416 ICON DISCARDABLE "icons/cdrom_empty.ico" -417 ICON DISCARDABLE "icons/cdrom_empty_active.ico" -432 ICON DISCARDABLE "icons/zip_empty.ico" -433 ICON DISCARDABLE "icons/zip_empty_active.ico" -448 ICON DISCARDABLE "icons/removable_disk_empty.ico" -449 ICON DISCARDABLE "icons/removable_disk_empty_active.ico" -512 ICON DISCARDABLE "icons/floppy_disabled.ico" -514 ICON DISCARDABLE "icons/cdrom_disabled.ico" -515 ICON DISCARDABLE "icons/zip_disabled.ico" +160 ICON "icons/cdrom.ico" +161 ICON "icons/cdrom_active.ico" +416 ICON "icons/cdrom_empty.ico" +417 ICON "icons/cdrom_empty_active.ico" -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// TEXTINCLUDE -///////////////////////////////////////////////////////////////////////////// +176 ICON "icons/zip.ico" +177 ICON "icons/zip_active.ico" +432 ICON "icons/zip_empty.ico" +433 ICON "icons/zip_empty_active.ico" -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h" -END +192 ICON "icons/removable_disk.ico" +193 ICON "icons/removable_disk_active.ico" +448 ICON "icons/removable_disk_empty.ico" +449 ICON "icons/removable_disk_empty_active.ico" -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""resources.h""\r\n" - "" -END +208 ICON "icons/hard_disk.ico" +209 ICON "icons/hard_disk_active.ico" -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "" -END +224 ICON "icons/network.ico" +225 ICON "icons/network_active.ico" -#endif // APSTUDIO_INVOKED +256 ICON "icons/machine.ico" +257 ICON "icons/display.ico" +258 ICON "icons/input_devices.ico" +259 ICON "icons/sound.ico" +260 ICON "icons/network.ico" +261 ICON "icons/ports.ico" +262 ICON "icons/other_peripherals.ico" +263 ICON "icons/hard_disk.ico" +264 ICON "icons/floppy_drives.ico" +265 ICON "icons/other_removable_devices.ico" + +512 ICON "icons/floppy_disabled.ico" +514 ICON "icons/cdrom_disabled.ico" +515 ICON "icons/zip_disabled.ico" -///////////////////////////////////////////////////////////////////////////// -// DESIGNINFO -///////////////////////////////////////////////////////////////////////////// +1 RT_MANIFEST "VARCem.manifest" -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - DLG_SND_GAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 167 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - DLG_NEW_FLOPPY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 219 - TOPMARGIN, 7 - BOTTOMMARGIN, 79 - END - - DLG_CFG_MAIN, DIALOG - BEGIN - RIGHTMARGIN, 365 - END - - ABOUTDLG, DIALOG - BEGIN - RIGHTMARGIN, 208 - END - - DLG_CFG_MACHINE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 -#ifdef USE_DYNAREC - BOTTOMMARGIN, 87 -#else - BOTTOMMARGIN, 72 -#endif - END - - DLG_CFG_VIDEO, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 56 - END - - DLG_CFG_INPUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 58 - END - - DLG_CFG_SOUND, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 109 - END - - DLG_CFG_NETWORK, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 56 - END - - DLG_CFG_PORTS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 48 - END - - DLG_CFG_PERIPHERALS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 85 - END - - DLG_CFG_HARD_DISKS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 137 - END - - DLG_CFG_FLOPPY_DRIVES, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 96 - END - - DLG_CFG_OTHER_REMOVABLE_DEVICES, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 214 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// String Table -///////////////////////////////////////////////////////////////////////////// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_2048 "Error" - IDS_2049 "Fatal Error" - IDS_2050 "Configuration Error" - IDS_2051 "Warning" - IDS_2052 "Are you sure you want to save these settings?\n\n(A restart may be needed...)" - IDS_2053 "Invalid number of sectors (valid values are between 1 and 63)" - IDS_2054 "Invalid number of heads (valid values are between 1 and 16)" - IDS_2055 "Invalid number of cylinders (valid values are between 1 and 266305)" - IDS_2056 "No usable ROM images found!" - IDS_2057 "(empty)" - IDS_2058 "(host drive %c:)" - IDS_2059 "Turbo" - IDS_2060 "On" - IDS_2061 "Off" - IDS_2062 "Changes saved, please restart the emulator!" - IDS_2063 "The configured machine:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings menu?" - IDS_2064 "Configured video card:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings menu?" - IDS_2065 "Machine" - IDS_2066 "Display" - IDS_2067 "Input devices" - IDS_2068 "Sound" - IDS_2069 "Network" - IDS_2070 "Ports (COM & LPT)" - IDS_2071 "Other peripherals" - IDS_2072 "Hard disks" - IDS_2073 "Floppy drives" - IDS_2074 "Other removable devices" - IDS_2075 "CD-ROM images\0*.iso;*.cue\0All files (*.*)\0*.*\0" - IDS_2076 "Host CD/DVD Drive (%c:)" - IDS_2077 "Click to capture mouse" - IDS_2078 "Press F8+F12 to release mouse" - IDS_2079 "Press F8+F12 or middle button to release mouse" - IDS_2080 "Drive" - IDS_2081 "Location" - IDS_2082 "Bus" - IDS_2083 "File" - IDS_2084 "C" - IDS_2085 "H" - IDS_2086 "S" - IDS_2087 "MB" - IDS_2088 "Unable to create bitmap file: %s" - IDS_2089 "Enabled" - IDS_2090 "Mute" - IDS_2091 "Type" - IDS_2092 "Bus" - IDS_2093 "DMA" - IDS_2094 "KB" - IDS_2095 "Selected renderer '%S' not available. Reset to default?" - IDS_2096 "Slave" - IDS_2097 "SCSI (ID %s, LUN %s)" - IDS_2098 "Adapter Type" - IDS_2099 "Base Address" - IDS_2100 "IRQ" - IDS_2101 "8-bit DMA" - IDS_2102 "16-bit DMA" - IDS_2103 "BIOS" - IDS_2104 "Network Type" - IDS_2105 "Surround Module" - IDS_2106 "MPU-401 Base Address" - IDS_2107 "Use CTRL+ALT+PAGE DOWN to return to windowed mode" - IDS_2108 "On-board RAM" - IDS_2109 "Memory Size" - IDS_2110 "Display Type" - IDS_2111 "RGB" - IDS_2112 "Composite" - IDS_2113 "Composite Type" - IDS_2114 "Old" - IDS_2115 "New" - IDS_2116 "RGB Type" - IDS_2117 "Color" - IDS_2118 "Monochrome (Green)" - IDS_2119 "Monochrome (Amber)" - IDS_2120 "Monochrome (Gray)" - IDS_2121 "Color (no brown)" - IDS_2122 "Monochrome (Default)" - IDS_2123 "Snow Emulation" - IDS_2124 "Bilinear Filtering" - IDS_2125 "Dithering" - IDS_2126 "Framebuffer Memory Size" - IDS_2127 "Texture Memory Size" - IDS_2128 "Screen Filter" - IDS_2129 "Render Threads" - IDS_2130 "Recompiler" - IDS_2131 "Default" - IDS_2132 "%i Wait state(s)" - IDS_2133 "8-bit" - IDS_2134 "Slow 16-bit" - IDS_2135 "Fast 16-bit" - IDS_2136 "Slow VLB/PCI" - IDS_2137 "Mid VLB/PCI" - IDS_2138 "Fast VLB/PCI" - IDS_2139 "PCap failed to set up because it may not be initialized" - IDS_2140 "No PCap devices found" - IDS_2141 "Invalid PCap device" - IDS_2142 "&Notify disk change" - IDS_2143 "Type" - IDS_2144 "The requested device '%ls' is currently considered to be `Under Development` and might cause problems.\n\nAre you sure you want to enable it?" - /* IDS_2145-51 available */ - IDS_2152 "None" - IDS_2153 "Unable to load Keyboard Accelerators!" - IDS_2154 "Unable to register Raw Input!" - IDS_2155 "IRQ %i" - IDS_2156 "%" PRIu64 - IDS_2157 "%" PRIu64 " MB (CHS: %u, %u, %u)" - IDS_2158 "Floppy %i (%s): %ls" - IDS_2159 "All images\0*.0??;*.1??;*.360;*.720;*.86f;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.json;*.td0;*.*fd?;*.xdf\0Advanced sector images\0*.imd;*.json;*.td0\0Basic sector images\0*.0??;*.1??;*.360;*.720;*.bin;*.cq?;*.dsk;*.flp;*.hdm;*.im?;*.xdf;*.*fd?\0Flux images\0*.fdi\0Surface images\0*.86f\0All files\0*.*\0" - IDS_2160 "Configuration files\0*.varc\0All files\0*.*\0" - IDS_2161 "&New image..." - IDS_2162 "&Existing image..." - IDS_2163 " [Write Protected]" - IDS_2164 "E&ject" - IDS_2165 "&Mute" - IDS_2166 "E&mpty" - IDS_2167 "&Reload previous image" - IDS_2168 "&Image..." - /* 2169 available */ - IDS_2170 "Check BPB" - IDS_2171 "Unable to initialize FluidSynth, make sure you have the following library\nin your program folder:\n\nlibfluidsynth.dll" - IDS_2172 "E&xport to 86F..." - IDS_2173 "Surface images\0*.86f\0" - IDS_2174 "All images\0*.86f;*.dsk;*.flp;*.im?;*.*fd?\0Basic sector images\0*.dsk;*.flp;*.im?;*.img;*.*fd?\0Surface images\0*.86f\0" - IDS_2175 "ZIP images\0*.im?;*.zdi\0All files\0*.*\0" - IDS_2176 "ZIP images\0*.im?;*.zdi\0" - IDS_2177 "ZIP %i (%03i): %ls" - IDS_2178 "Unable to initialize OpenAL, make sure you have the following library\nin your program folder:\n\nlibopenal-1.dll" - IDS_2179 "Speed:" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_4096 "Hard disk (%s)" - IDS_4097 "%01i:%01i" - IDS_4098 "%i" - IDS_4099 "Disabled" - IDS_4100 "Custom..." - IDS_4101 "Custom (large)..." - IDS_4102 "Add New Hard Disk" - IDS_4103 "Add Existing Hard Disk" - IDS_4104 "Attempting to create a HDI image larger than 4 GB" - IDS_4105 "Attempting to create a spuriously large hard disk image" - IDS_4106 "Hard disk images\0*.hd?;*.im?;*.vhd\0All files\0*.*\0" - IDS_4107 "Unable to open the file for read" - IDS_4108 "Unable to open the file for write" - IDS_4109 "HDI or HDX image with a sector size that is not 512 are not supported" - IDS_4110 "USB is not yet supported" - IDS_4111 "This image exists and will be overwritten.\nAre you sure you want to use it?" - IDS_4112 "Please enter a valid file name" - IDS_4113 "Remember to partition and format the new drive" - IDS_4114 "MFM/RLL or ESDI CD-ROM drives never existed" - IDS_4115 "Removable disk %i (SCSI): %ls" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_4352 "ST506" - IDS_4353 "ESDI" - IDS_4354 "IDE (PIO-only)" - IDS_4355 "IDE (PIO+DMA)" - IDS_4356 "SCSI" - IDS_4357 "SCSI (removable)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_4608 "ST506 (%01i:%01i)" - IDS_4609 "ESDI (%01i:%01i)" - IDS_4610 "IDE (PIO-only) (%01i:%01i)" - IDS_4611 "IDE (PIO+DMA) (%01i:%01i)" - IDS_4612 "SCSI (%02i:%02i)" - IDS_4613 "SCSI (removable) (%02i:%02i)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_5120 "CD-ROM %i (%s): %s" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_5376 "Disabled" - IDS_5377 "" - IDS_5378 "" - IDS_5379 "ATAPI (PIO-only)" - IDS_5380 "ATAPI (PIO and DMA)" - IDS_5381 "SCSI" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_5632 "Disabled" - IDS_5633 "" - IDS_5634 "" - IDS_5635 "ATAPI (PIO-only) (%01i:%01i)" - IDS_5636 "ATAPI (PIO and DMA) (%01i:%01i)" - IDS_5637 "SCSI (%02i:%02i)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_5888 "160 kB" - IDS_5889 "180 kB" - IDS_5890 "320 kB" - IDS_5891 "360 kB" - IDS_5892 "640 kB" - IDS_5893 "720 kB" - IDS_5894 "1.2 MB" - IDS_5895 "1.25 MB" - IDS_5896 "1.44 MB" - IDS_5897 "DMF (cluster 1024)" - IDS_5898 "DMF (cluster 2048)" - IDS_5899 "2.88 MB" - IDS_5900 "ZIP 100" - IDS_5901 "ZIP 250" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_6144 "Perfect RPM" - IDS_6145 "1%% below perfect RPM" - IDS_6146 "1.5%% below perfect RPM" - IDS_6147 "2%% below perfect RPM" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_7168 "English (United States)" -END -#define IDS_LANG_ENUS IDS_7168 - - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// Version -///////////////////////////////////////////////////////////////////////////// VS_VERSION_INFO VERSIONINFO #ifdef EMU_VER_PATCH @@ -1190,7 +228,7 @@ VS_VERSION_INFO VERSIONINFO BEGIN BLOCK "StringFileInfo" BEGIN - BLOCK "040904e4" + BLOCK "040904b0" BEGIN VALUE "CompanyName", "IRC #VARCem on FreeNode" VALUE "FileDescription", "Virtual ARchaeological Computer EMulator" @@ -1210,7 +248,3 @@ VS_VERSION_INFO VERSIONINFO VALUE "Translation", 0x409, 1200 END END - -#endif // !_MAC - -#endif // English (U.S.) resources diff --git a/src/win/icons/donate-button-blue-128x55.bmp b/src/win/icons/donate-button-blue-128x55.bmp new file mode 100644 index 0000000..fe163cf Binary files /dev/null and b/src/win/icons/donate-button-blue-128x55.bmp differ diff --git a/src/win/icons/varcem.ico b/src/win/icons/varcem.ico index 8d179fe..97f7f17 100644 Binary files a/src/win/icons/varcem.ico and b/src/win/icons/varcem.ico differ diff --git a/src/win/mingw/Makefile.MinGW b/src/win/mingw/Makefile.MinGW index 6226e19..e16b090 100644 --- a/src/win/mingw/Makefile.MinGW +++ b/src/win/mingw/Makefile.MinGW @@ -8,7 +8,7 @@ # # Makefile for Windows systems using the MinGW32 environment. # -# Version: @(#)Makefile.mingw 1.0.45 2018/05/13 +# Version: @(#)Makefile.mingw 1.0.48 2018/05/26 # # Author: Fred N. van Kempen, # @@ -240,7 +240,7 @@ ifneq ($(CROSS), n) CC := /usr/bin/$(MINGW)-gcc -m32 endif PREPROC := /usr/bin/$(MINGW)-cpp - WINDRES := /usr/bin/$(MINGW)-windres + WINDRES := /usr/bin/$(MINGW)-windres -c 1200 SYSINC := -I/usr/$(MINGW)/include -Iwin/mingw/include SYSLIB := -L/usr/$(MINGW)/lib @@ -347,7 +347,7 @@ else endif LIBS := -mwindows \ -lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 \ - -lcomctl32 -lwinmm + -lversion -lcomctl32 -lwinmm LIBS += -lkernel32 -lwsock32 -liphlpapi -lpsapi LIBS += -lpthread -static -lstdc++ -lgcc ifneq ($(X64), y) @@ -442,10 +442,14 @@ endif # N=no, Y=yes,linked, D=yes,dynamic, S=yes,static ifneq ($(PNG), n) - OPTS += -DUSE_PNG + ifeq ($(PNG), d) + OPTS += -DUSE_LIBPNG=2 + else + OPTS += -DUSE_LIBPNG=1 + endif RFLAGS += -DUSE_PNG ifneq ($(PNG_PATH), ) - OPTS += -I$(PNG_PATH)/include + OPTS += -I$(PNG_PATH)/include/mingw -I$(PNG_PATH)/include ifeq ($(X64), y) LIBS += -L$(PNG_PATH)/lib/x64 else @@ -676,7 +680,7 @@ VIDOBJ := video.o \ vid_voodoo.o PLATOBJ := win.o \ - win_dynld.o win_thread.o \ + win_lang.o win_dynld.o win_opendir.o win_thread.o \ win_cdrom.o win_cdrom_ioctl.o win_keyboard.o \ win_mouse.o win_joystick.o win_midi.o ifeq ($(CRASHDUMP), y) @@ -757,9 +761,6 @@ ifneq ($(DEBUG), y) @strip hello.exe endif -foo.exe: foo.o - @$(CC) $(LDFLAGS) -o foo.exe \ - foo.o $(LIBS) clean: @echo Cleaning objects.. diff --git a/src/win/mingw/include/rfb_mingw/default8x16.h b/src/win/mingw/include/rfb_mingw/default8x16.h new file mode 100644 index 0000000..d557d47 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/default8x16.h @@ -0,0 +1,261 @@ +unsigned char default8x16FontData[4096+1]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, +0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, +0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, +0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, +0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, +0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, +0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, +0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, +0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xff,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00, +0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00, +0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00, +0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, +0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00, +0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, +0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, +0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0xe7,0xff,0xff,0xdb,0xc3,0xc3,0xc3,0xc3,0xc3,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00, +0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, +0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xff,0xdb,0x99,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0xc3,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x3c,0x66,0xc3,0xc3,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0xff,0xc3,0x86,0x0c,0x18,0x30,0x60,0xc1,0xc3,0xff,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00, +0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00, +0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00, +0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00, +0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xe6,0xff,0xdb,0xdb,0xdb,0xdb,0xdb,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00, +0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xc3,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xc3,0xc3,0xc3,0xdb,0xdb,0xff,0x66,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xc3,0x66,0x3c,0x18,0x3c,0x66,0xc3,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00, +0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00, +0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, +0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00, +0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00, +0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x6e,0x3b,0x1b,0x7e,0xd8,0xdc,0x77,0x00,0x00,0x00,0x00, +0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00, +0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00, +0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x18,0x18,0x7e,0xc3,0xc0,0xc0,0xc0,0xc3,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00, +0x00,0x00,0xc3,0x66,0x3c,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0xfc,0x66,0x66,0x7c,0x62,0x66,0x6f,0x66,0x66,0x66,0xf3,0x00,0x00,0x00,0x00, +0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00, +0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, +0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, +0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, +0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xce,0x9b,0x06,0x0c,0x1f,0x00,0x00, +0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x96,0x3e,0x06,0x06,0x00,0x00, +0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00, +0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, +0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, +0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, +0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, +0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, +0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00, +0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00, +0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, +0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00, +0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00, +0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00, +0x00,0x00,0x0e,0x1b,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00, +0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; +int default8x16FontMetaData[256*5+1]={ +0,8,16,0,0,16,8,16,0,0,32,8,16,0,0,48,8,16,0,0,64,8,16,0,0,80,8,16,0,0,96,8,16,0,0,112,8,16,0,0,128,8,16,0,0,144,8,16,0,0,160,8,16,0,0,176,8,16,0,0,192,8,16,0,0,208,8,16,0,0,224,8,16,0,0,240,8,16,0,0,256,8,16,0,0,272,8,16,0,0,288,8,16,0,0,304,8,16,0,0,320,8,16,0,0,336,8,16,0,0,352,8,16,0,0,368,8,16,0,0,384,8,16,0,0,400,8,16,0,0,416,8,16,0,0,432,8,16,0,0,448,8,16,0,0,464,8,16,0,0,480,8,16,0,0,496,8,16,0,0,512,8,16,0,0,528,8,16,0,0,544,8,16,0,0,560,8,16,0,0,576,8,16,0,0,592,8,16,0,0,608,8,16,0,0,624,8,16,0,0,640,8,16,0,0,656,8,16,0,0,672,8,16,0,0,688,8,16,0,0,704,8,16,0,0,720,8,16,0,0,736,8,16,0,0,752,8,16,0,0,768,8,16,0,0,784,8,16,0,0,800,8,16,0,0,816,8,16,0,0,832,8,16,0,0,848,8,16,0,0,864,8,16,0,0,880,8,16,0,0,896,8,16,0,0,912,8,16,0,0,928,8,16,0,0,944,8,16,0,0,960,8,16,0,0,976,8,16,0,0,992,8,16,0,0,1008,8,16,0,0,1024,8,16,0,0,1040,8,16,0,0,1056,8,16,0,0,1072,8,16,0,0,1088,8,16,0,0,1104,8,16,0,0,1120,8,16,0,0,1136,8,16,0,0,1152,8,16,0,0,1168,8,16,0,0,1184,8,16,0,0,1200,8,16,0,0,1216,8,16,0,0,1232,8,16,0,0,1248,8,16,0,0,1264,8,16,0,0,1280,8,16,0,0,1296,8,16,0,0,1312,8,16,0,0,1328,8,16,0,0,1344,8,16,0,0,1360,8,16,0,0,1376,8,16,0,0,1392,8,16,0,0,1408,8,16,0,0,1424,8,16,0,0,1440,8,16,0,0,1456,8,16,0,0,1472,8,16,0,0,1488,8,16,0,0,1504,8,16,0,0,1520,8,16,0,0,1536,8,16,0,0,1552,8,16,0,0,1568,8,16,0,0,1584,8,16,0,0,1600,8,16,0,0,1616,8,16,0,0,1632,8,16,0,0,1648,8,16,0,0,1664,8,16,0,0,1680,8,16,0,0,1696,8,16,0,0,1712,8,16,0,0,1728,8,16,0,0,1744,8,16,0,0,1760,8,16,0,0,1776,8,16,0,0,1792,8,16,0,0,1808,8,16,0,0,1824,8,16,0,0,1840,8,16,0,0,1856,8,16,0,0,1872,8,16,0,0,1888,8,16,0,0,1904,8,16,0,0,1920,8,16,0,0,1936,8,16,0,0,1952,8,16,0,0,1968,8,16,0,0,1984,8,16,0,0,2000,8,16,0,0,2016,8,16,0,0,2032,8,16,0,0,2048,8,16,0,0,2064,8,16,0,0,2080,8,16,0,0,2096,8,16,0,0,2112,8,16,0,0,2128,8,16,0,0,2144,8,16,0,0,2160,8,16,0,0,2176,8,16,0,0,2192,8,16,0,0,2208,8,16,0,0,2224,8,16,0,0,2240,8,16,0,0,2256,8,16,0,0,2272,8,16,0,0,2288,8,16,0,0,2304,8,16,0,0,2320,8,16,0,0,2336,8,16,0,0,2352,8,16,0,0,2368,8,16,0,0,2384,8,16,0,0,2400,8,16,0,0,2416,8,16,0,0,2432,8,16,0,0,2448,8,16,0,0,2464,8,16,0,0,2480,8,16,0,0,2496,8,16,0,0,2512,8,16,0,0,2528,8,16,0,0,2544,8,16,0,0,2560,8,16,0,0,2576,8,16,0,0,2592,8,16,0,0,2608,8,16,0,0,2624,8,16,0,0,2640,8,16,0,0,2656,8,16,0,0,2672,8,16,0,0,2688,8,16,0,0,2704,8,16,0,0,2720,8,16,0,0,2736,8,16,0,0,2752,8,16,0,0,2768,8,16,0,0,2784,8,16,0,0,2800,8,16,0,0,2816,8,16,0,0,2832,8,16,0,0,2848,8,16,0,0,2864,8,16,0,0,2880,8,16,0,0,2896,8,16,0,0,2912,8,16,0,0,2928,8,16,0,0,2944,8,16,0,0,2960,8,16,0,0,2976,8,16,0,0,2992,8,16,0,0,3008,8,16,0,0,3024,8,16,0,0,3040,8,16,0,0,3056,8,16,0,0,3072,8,16,0,0,3088,8,16,0,0,3104,8,16,0,0,3120,8,16,0,0,3136,8,16,0,0,3152,8,16,0,0,3168,8,16,0,0,3184,8,16,0,0,3200,8,16,0,0,3216,8,16,0,0,3232,8,16,0,0,3248,8,16,0,0,3264,8,16,0,0,3280,8,16,0,0,3296,8,16,0,0,3312,8,16,0,0,3328,8,16,0,0,3344,8,16,0,0,3360,8,16,0,0,3376,8,16,0,0,3392,8,16,0,0,3408,8,16,0,0,3424,8,16,0,0,3440,8,16,0,0,3456,8,16,0,0,3472,8,16,0,0,3488,8,16,0,0,3504,8,16,0,0,3520,8,16,0,0,3536,8,16,0,0,3552,8,16,0,0,3568,8,16,0,0,3584,8,16,0,0,3600,8,16,0,0,3616,8,16,0,0,3632,8,16,0,0,3648,8,16,0,0,3664,8,16,0,0,3680,8,16,0,0,3696,8,16,0,0,3712,8,16,0,0,3728,8,16,0,0,3744,8,16,0,0,3760,8,16,0,0,3776,8,16,0,0,3792,8,16,0,0,3808,8,16,0,0,3824,8,16,0,0,3840,8,16,0,0,3856,8,16,0,0,3872,8,16,0,0,3888,8,16,0,0,3904,8,16,0,0,3920,8,16,0,0,3936,8,16,0,0,3952,8,16,0,0,3968,8,16,0,0,3984,8,16,0,0,4000,8,16,0,0,4016,8,16,0,0,4032,8,16,0,0,4048,8,16,0,0,4064,8,16,0,0,4080,8,16,0,0,}; +rfbFontData default8x16Font = { default8x16FontData, default8x16FontMetaData }; diff --git a/src/win/mingw/include/rfb_mingw/keysym.h b/src/win/mingw/include/rfb_mingw/keysym.h new file mode 100644 index 0000000..282d818 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/keysym.h @@ -0,0 +1,1639 @@ +#ifndef KEYSYM_H +#define KEYSYM_H + +/* $XConsortium: keysym.h,v 1.15 94/04/17 20:10:55 rws Exp $ */ + +/*********************************************************** + +Copyright (c) 1987 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* default keysyms */ +#define XK_MISCELLANY +#define XK_XKB_KEYS +#define XK_LATIN1 +#define XK_LATIN2 +#define XK_LATIN3 +#define XK_LATIN4 +#define XK_GREEK + +/* $TOG: keysymdef.h /main/25 1997/06/21 10:54:51 kaleb $ */ + +/*********************************************************** +Copyright (c) 1987, 1994 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#define XK_VoidSymbol 0xFFFFFF /* void symbol */ + +#ifdef XK_MISCELLANY +/* + * TTY Functions, cleverly chosen to map to ascii, for convenience of + * programming, but could have been arbitrary (at the cost of lookup + * tables in client code. + */ + +#define XK_BackSpace 0xFF08 /* back space, back char */ +#define XK_Tab 0xFF09 +#define XK_Linefeed 0xFF0A /* Linefeed, LF */ +#define XK_Clear 0xFF0B +#define XK_Return 0xFF0D /* Return, enter */ +#define XK_Pause 0xFF13 /* Pause, hold */ +#define XK_Scroll_Lock 0xFF14 +#define XK_Sys_Req 0xFF15 +#define XK_Escape 0xFF1B +#define XK_Delete 0xFFFF /* Delete, rubout */ + + + +/* International & multi-key character composition */ + +#define XK_Multi_key 0xFF20 /* Multi-key character compose */ +#define XK_SingleCandidate 0xFF3C +#define XK_MultipleCandidate 0xFF3D +#define XK_PreviousCandidate 0xFF3E + +/* Japanese keyboard support */ + +#define XK_Kanji 0xFF21 /* Kanji, Kanji convert */ +#define XK_Muhenkan 0xFF22 /* Cancel Conversion */ +#define XK_Henkan_Mode 0xFF23 /* Start/Stop Conversion */ +#define XK_Henkan 0xFF23 /* Alias for Henkan_Mode */ +#define XK_Romaji 0xFF24 /* to Romaji */ +#define XK_Hiragana 0xFF25 /* to Hiragana */ +#define XK_Katakana 0xFF26 /* to Katakana */ +#define XK_Hiragana_Katakana 0xFF27 /* Hiragana/Katakana toggle */ +#define XK_Zenkaku 0xFF28 /* to Zenkaku */ +#define XK_Hankaku 0xFF29 /* to Hankaku */ +#define XK_Zenkaku_Hankaku 0xFF2A /* Zenkaku/Hankaku toggle */ +#define XK_Touroku 0xFF2B /* Add to Dictionary */ +#define XK_Massyo 0xFF2C /* Delete from Dictionary */ +#define XK_Kana_Lock 0xFF2D /* Kana Lock */ +#define XK_Kana_Shift 0xFF2E /* Kana Shift */ +#define XK_Eisu_Shift 0xFF2F /* Alphanumeric Shift */ +#define XK_Eisu_toggle 0xFF30 /* Alphanumeric toggle */ +#define XK_Zen_Koho 0xFF3D /* Multiple/All Candidate(s) */ +#define XK_Mae_Koho 0xFF3E /* Previous Candidate */ + +/* 0xFF31 thru 0xFF3F are under XK_KOREAN */ + +/* Cursor control & motion */ + +#define XK_Home 0xFF50 +#define XK_Left 0xFF51 /* Move left, left arrow */ +#define XK_Up 0xFF52 /* Move up, up arrow */ +#define XK_Right 0xFF53 /* Move right, right arrow */ +#define XK_Down 0xFF54 /* Move down, down arrow */ +#define XK_Prior 0xFF55 /* Prior, previous */ +#define XK_Page_Up 0xFF55 +#define XK_Next 0xFF56 /* Next */ +#define XK_Page_Down 0xFF56 +#define XK_End 0xFF57 /* EOL */ +#define XK_Begin 0xFF58 /* BOL */ + + +/* Misc Functions */ + +#define XK_Select 0xFF60 /* Select, mark */ +#define XK_Print 0xFF61 +#define XK_Execute 0xFF62 /* Execute, run, do */ +#define XK_Insert 0xFF63 /* Insert, insert here */ +#define XK_Undo 0xFF65 /* Undo, oops */ +#define XK_Redo 0xFF66 /* redo, again */ +#define XK_Menu 0xFF67 +#define XK_Find 0xFF68 /* Find, search */ +#define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */ +#define XK_Help 0xFF6A /* Help */ +#define XK_Break 0xFF6B +#define XK_Mode_switch 0xFF7E /* Character set switch */ +#define XK_script_switch 0xFF7E /* Alias for mode_switch */ +#define XK_Num_Lock 0xFF7F + +/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */ + +#define XK_KP_Space 0xFF80 /* space */ +#define XK_KP_Tab 0xFF89 +#define XK_KP_Enter 0xFF8D /* enter */ +#define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */ +#define XK_KP_F2 0xFF92 +#define XK_KP_F3 0xFF93 +#define XK_KP_F4 0xFF94 +#define XK_KP_Home 0xFF95 +#define XK_KP_Left 0xFF96 +#define XK_KP_Up 0xFF97 +#define XK_KP_Right 0xFF98 +#define XK_KP_Down 0xFF99 +#define XK_KP_Prior 0xFF9A +#define XK_KP_Page_Up 0xFF9A +#define XK_KP_Next 0xFF9B +#define XK_KP_Page_Down 0xFF9B +#define XK_KP_End 0xFF9C +#define XK_KP_Begin 0xFF9D +#define XK_KP_Insert 0xFF9E +#define XK_KP_Delete 0xFF9F +#define XK_KP_Equal 0xFFBD /* equals */ +#define XK_KP_Multiply 0xFFAA +#define XK_KP_Add 0xFFAB +#define XK_KP_Separator 0xFFAC /* separator, often comma */ +#define XK_KP_Subtract 0xFFAD +#define XK_KP_Decimal 0xFFAE +#define XK_KP_Divide 0xFFAF + +#define XK_KP_0 0xFFB0 +#define XK_KP_1 0xFFB1 +#define XK_KP_2 0xFFB2 +#define XK_KP_3 0xFFB3 +#define XK_KP_4 0xFFB4 +#define XK_KP_5 0xFFB5 +#define XK_KP_6 0xFFB6 +#define XK_KP_7 0xFFB7 +#define XK_KP_8 0xFFB8 +#define XK_KP_9 0xFFB9 + + + +/* + * Auxilliary Functions; note the duplicate definitions for left and right + * function keys; Sun keyboards and a few other manufactures have such + * function key groups on the left and/or right sides of the keyboard. + * We've not found a keyboard with more than 35 function keys total. + */ + +#define XK_F1 0xFFBE +#define XK_F2 0xFFBF +#define XK_F3 0xFFC0 +#define XK_F4 0xFFC1 +#define XK_F5 0xFFC2 +#define XK_F6 0xFFC3 +#define XK_F7 0xFFC4 +#define XK_F8 0xFFC5 +#define XK_F9 0xFFC6 +#define XK_F10 0xFFC7 +#define XK_F11 0xFFC8 +#define XK_L1 0xFFC8 +#define XK_F12 0xFFC9 +#define XK_L2 0xFFC9 +#define XK_F13 0xFFCA +#define XK_L3 0xFFCA +#define XK_F14 0xFFCB +#define XK_L4 0xFFCB +#define XK_F15 0xFFCC +#define XK_L5 0xFFCC +#define XK_F16 0xFFCD +#define XK_L6 0xFFCD +#define XK_F17 0xFFCE +#define XK_L7 0xFFCE +#define XK_F18 0xFFCF +#define XK_L8 0xFFCF +#define XK_F19 0xFFD0 +#define XK_L9 0xFFD0 +#define XK_F20 0xFFD1 +#define XK_L10 0xFFD1 +#define XK_F21 0xFFD2 +#define XK_R1 0xFFD2 +#define XK_F22 0xFFD3 +#define XK_R2 0xFFD3 +#define XK_F23 0xFFD4 +#define XK_R3 0xFFD4 +#define XK_F24 0xFFD5 +#define XK_R4 0xFFD5 +#define XK_F25 0xFFD6 +#define XK_R5 0xFFD6 +#define XK_F26 0xFFD7 +#define XK_R6 0xFFD7 +#define XK_F27 0xFFD8 +#define XK_R7 0xFFD8 +#define XK_F28 0xFFD9 +#define XK_R8 0xFFD9 +#define XK_F29 0xFFDA +#define XK_R9 0xFFDA +#define XK_F30 0xFFDB +#define XK_R10 0xFFDB +#define XK_F31 0xFFDC +#define XK_R11 0xFFDC +#define XK_F32 0xFFDD +#define XK_R12 0xFFDD +#define XK_F33 0xFFDE +#define XK_R13 0xFFDE +#define XK_F34 0xFFDF +#define XK_R14 0xFFDF +#define XK_F35 0xFFE0 +#define XK_R15 0xFFE0 + +/* Modifiers */ + +#define XK_Shift_L 0xFFE1 /* Left shift */ +#define XK_Shift_R 0xFFE2 /* Right shift */ +#define XK_Control_L 0xFFE3 /* Left control */ +#define XK_Control_R 0xFFE4 /* Right control */ +#define XK_Caps_Lock 0xFFE5 /* Caps lock */ +#define XK_Shift_Lock 0xFFE6 /* Shift lock */ + +#define XK_Meta_L 0xFFE7 /* Left meta */ +#define XK_Meta_R 0xFFE8 /* Right meta */ +#define XK_Alt_L 0xFFE9 /* Left alt */ +#define XK_Alt_R 0xFFEA /* Right alt */ +#define XK_Super_L 0xFFEB /* Left super */ +#define XK_Super_R 0xFFEC /* Right super */ +#define XK_Hyper_L 0xFFED /* Left hyper */ +#define XK_Hyper_R 0xFFEE /* Right hyper */ +#endif /* XK_MISCELLANY */ + +/* + * ISO 9995 Function and Modifier Keys + * Byte 3 = 0xFE + */ + +#ifdef XK_XKB_KEYS +#define XK_ISO_Lock 0xFE01 +#define XK_ISO_Level2_Latch 0xFE02 +#define XK_ISO_Level3_Shift 0xFE03 +#define XK_ISO_Level3_Latch 0xFE04 +#define XK_ISO_Level3_Lock 0xFE05 +#define XK_ISO_Group_Shift 0xFF7E /* Alias for mode_switch */ +#define XK_ISO_Group_Latch 0xFE06 +#define XK_ISO_Group_Lock 0xFE07 +#define XK_ISO_Next_Group 0xFE08 +#define XK_ISO_Next_Group_Lock 0xFE09 +#define XK_ISO_Prev_Group 0xFE0A +#define XK_ISO_Prev_Group_Lock 0xFE0B +#define XK_ISO_First_Group 0xFE0C +#define XK_ISO_First_Group_Lock 0xFE0D +#define XK_ISO_Last_Group 0xFE0E +#define XK_ISO_Last_Group_Lock 0xFE0F + +#define XK_ISO_Left_Tab 0xFE20 +#define XK_ISO_Move_Line_Up 0xFE21 +#define XK_ISO_Move_Line_Down 0xFE22 +#define XK_ISO_Partial_Line_Up 0xFE23 +#define XK_ISO_Partial_Line_Down 0xFE24 +#define XK_ISO_Partial_Space_Left 0xFE25 +#define XK_ISO_Partial_Space_Right 0xFE26 +#define XK_ISO_Set_Margin_Left 0xFE27 +#define XK_ISO_Set_Margin_Right 0xFE28 +#define XK_ISO_Release_Margin_Left 0xFE29 +#define XK_ISO_Release_Margin_Right 0xFE2A +#define XK_ISO_Release_Both_Margins 0xFE2B +#define XK_ISO_Fast_Cursor_Left 0xFE2C +#define XK_ISO_Fast_Cursor_Right 0xFE2D +#define XK_ISO_Fast_Cursor_Up 0xFE2E +#define XK_ISO_Fast_Cursor_Down 0xFE2F +#define XK_ISO_Continuous_Underline 0xFE30 +#define XK_ISO_Discontinuous_Underline 0xFE31 +#define XK_ISO_Emphasize 0xFE32 +#define XK_ISO_Center_Object 0xFE33 +#define XK_ISO_Enter 0xFE34 + +#define XK_dead_grave 0xFE50 +#define XK_dead_acute 0xFE51 +#define XK_dead_circumflex 0xFE52 +#define XK_dead_tilde 0xFE53 +#define XK_dead_macron 0xFE54 +#define XK_dead_breve 0xFE55 +#define XK_dead_abovedot 0xFE56 +#define XK_dead_diaeresis 0xFE57 +#define XK_dead_abovering 0xFE58 +#define XK_dead_doubleacute 0xFE59 +#define XK_dead_caron 0xFE5A +#define XK_dead_cedilla 0xFE5B +#define XK_dead_ogonek 0xFE5C +#define XK_dead_iota 0xFE5D +#define XK_dead_voiced_sound 0xFE5E +#define XK_dead_semivoiced_sound 0xFE5F +#define XK_dead_belowdot 0xFE60 + +#define XK_First_Virtual_Screen 0xFED0 +#define XK_Prev_Virtual_Screen 0xFED1 +#define XK_Next_Virtual_Screen 0xFED2 +#define XK_Last_Virtual_Screen 0xFED4 +#define XK_Terminate_Server 0xFED5 + +#define XK_AccessX_Enable 0xFE70 +#define XK_AccessX_Feedback_Enable 0xFE71 +#define XK_RepeatKeys_Enable 0xFE72 +#define XK_SlowKeys_Enable 0xFE73 +#define XK_BounceKeys_Enable 0xFE74 +#define XK_StickyKeys_Enable 0xFE75 +#define XK_MouseKeys_Enable 0xFE76 +#define XK_MouseKeys_Accel_Enable 0xFE77 +#define XK_Overlay1_Enable 0xFE78 +#define XK_Overlay2_Enable 0xFE79 +#define XK_AudibleBell_Enable 0xFE7A + +#define XK_Pointer_Left 0xFEE0 +#define XK_Pointer_Right 0xFEE1 +#define XK_Pointer_Up 0xFEE2 +#define XK_Pointer_Down 0xFEE3 +#define XK_Pointer_UpLeft 0xFEE4 +#define XK_Pointer_UpRight 0xFEE5 +#define XK_Pointer_DownLeft 0xFEE6 +#define XK_Pointer_DownRight 0xFEE7 +#define XK_Pointer_Button_Dflt 0xFEE8 +#define XK_Pointer_Button1 0xFEE9 +#define XK_Pointer_Button2 0xFEEA +#define XK_Pointer_Button3 0xFEEB +#define XK_Pointer_Button4 0xFEEC +#define XK_Pointer_Button5 0xFEED +#define XK_Pointer_DblClick_Dflt 0xFEEE +#define XK_Pointer_DblClick1 0xFEEF +#define XK_Pointer_DblClick2 0xFEF0 +#define XK_Pointer_DblClick3 0xFEF1 +#define XK_Pointer_DblClick4 0xFEF2 +#define XK_Pointer_DblClick5 0xFEF3 +#define XK_Pointer_Drag_Dflt 0xFEF4 +#define XK_Pointer_Drag1 0xFEF5 +#define XK_Pointer_Drag2 0xFEF6 +#define XK_Pointer_Drag3 0xFEF7 +#define XK_Pointer_Drag4 0xFEF8 +#define XK_Pointer_Drag5 0xFEFD + +#define XK_Pointer_EnableKeys 0xFEF9 +#define XK_Pointer_Accelerate 0xFEFA +#define XK_Pointer_DfltBtnNext 0xFEFB +#define XK_Pointer_DfltBtnPrev 0xFEFC + +#endif + +/* + * 3270 Terminal Keys + * Byte 3 = 0xFD + */ + +#ifdef XK_3270 +#define XK_3270_Duplicate 0xFD01 +#define XK_3270_FieldMark 0xFD02 +#define XK_3270_Right2 0xFD03 +#define XK_3270_Left2 0xFD04 +#define XK_3270_BackTab 0xFD05 +#define XK_3270_EraseEOF 0xFD06 +#define XK_3270_EraseInput 0xFD07 +#define XK_3270_Reset 0xFD08 +#define XK_3270_Quit 0xFD09 +#define XK_3270_PA1 0xFD0A +#define XK_3270_PA2 0xFD0B +#define XK_3270_PA3 0xFD0C +#define XK_3270_Test 0xFD0D +#define XK_3270_Attn 0xFD0E +#define XK_3270_CursorBlink 0xFD0F +#define XK_3270_AltCursor 0xFD10 +#define XK_3270_KeyClick 0xFD11 +#define XK_3270_Jump 0xFD12 +#define XK_3270_Ident 0xFD13 +#define XK_3270_Rule 0xFD14 +#define XK_3270_Copy 0xFD15 +#define XK_3270_Play 0xFD16 +#define XK_3270_Setup 0xFD17 +#define XK_3270_Record 0xFD18 +#define XK_3270_ChangeScreen 0xFD19 +#define XK_3270_DeleteWord 0xFD1A +#define XK_3270_ExSelect 0xFD1B +#define XK_3270_CursorSelect 0xFD1C +#define XK_3270_PrintScreen 0xFD1D +#define XK_3270_Enter 0xFD1E +#endif + +/* + * Latin 1 + * Byte 3 = 0 + */ +#ifdef XK_LATIN1 +#define XK_space 0x020 +#define XK_exclam 0x021 +#define XK_quotedbl 0x022 +#define XK_numbersign 0x023 +#define XK_dollar 0x024 +#define XK_percent 0x025 +#define XK_ampersand 0x026 +#define XK_apostrophe 0x027 +#define XK_quoteright 0x027 /* deprecated */ +#define XK_parenleft 0x028 +#define XK_parenright 0x029 +#define XK_asterisk 0x02a +#define XK_plus 0x02b +#define XK_comma 0x02c +#define XK_minus 0x02d +#define XK_period 0x02e +#define XK_slash 0x02f +#define XK_0 0x030 +#define XK_1 0x031 +#define XK_2 0x032 +#define XK_3 0x033 +#define XK_4 0x034 +#define XK_5 0x035 +#define XK_6 0x036 +#define XK_7 0x037 +#define XK_8 0x038 +#define XK_9 0x039 +#define XK_colon 0x03a +#define XK_semicolon 0x03b +#define XK_less 0x03c +#define XK_equal 0x03d +#define XK_greater 0x03e +#define XK_question 0x03f +#define XK_at 0x040 +#define XK_A 0x041 +#define XK_B 0x042 +#define XK_C 0x043 +#define XK_D 0x044 +#define XK_E 0x045 +#define XK_F 0x046 +#define XK_G 0x047 +#define XK_H 0x048 +#define XK_I 0x049 +#define XK_J 0x04a +#define XK_K 0x04b +#define XK_L 0x04c +#define XK_M 0x04d +#define XK_N 0x04e +#define XK_O 0x04f +#define XK_P 0x050 +#define XK_Q 0x051 +#define XK_R 0x052 +#define XK_S 0x053 +#define XK_T 0x054 +#define XK_U 0x055 +#define XK_V 0x056 +#define XK_W 0x057 +#define XK_X 0x058 +#define XK_Y 0x059 +#define XK_Z 0x05a +#define XK_bracketleft 0x05b +#define XK_backslash 0x05c +#define XK_bracketright 0x05d +#define XK_asciicircum 0x05e +#define XK_underscore 0x05f +#define XK_grave 0x060 +#define XK_quoteleft 0x060 /* deprecated */ +#define XK_a 0x061 +#define XK_b 0x062 +#define XK_c 0x063 +#define XK_d 0x064 +#define XK_e 0x065 +#define XK_f 0x066 +#define XK_g 0x067 +#define XK_h 0x068 +#define XK_i 0x069 +#define XK_j 0x06a +#define XK_k 0x06b +#define XK_l 0x06c +#define XK_m 0x06d +#define XK_n 0x06e +#define XK_o 0x06f +#define XK_p 0x070 +#define XK_q 0x071 +#define XK_r 0x072 +#define XK_s 0x073 +#define XK_t 0x074 +#define XK_u 0x075 +#define XK_v 0x076 +#define XK_w 0x077 +#define XK_x 0x078 +#define XK_y 0x079 +#define XK_z 0x07a +#define XK_braceleft 0x07b +#define XK_bar 0x07c +#define XK_braceright 0x07d +#define XK_asciitilde 0x07e + +#define XK_nobreakspace 0x0a0 +#define XK_exclamdown 0x0a1 +#define XK_cent 0x0a2 +#define XK_sterling 0x0a3 +#define XK_currency 0x0a4 +#define XK_yen 0x0a5 +#define XK_brokenbar 0x0a6 +#define XK_section 0x0a7 +#define XK_diaeresis 0x0a8 +#define XK_copyright 0x0a9 +#define XK_ordfeminine 0x0aa +#define XK_guillemotleft 0x0ab /* left angle quotation mark */ +#define XK_notsign 0x0ac +#define XK_hyphen 0x0ad +#define XK_registered 0x0ae +#define XK_macron 0x0af +#define XK_degree 0x0b0 +#define XK_plusminus 0x0b1 +#define XK_twosuperior 0x0b2 +#define XK_threesuperior 0x0b3 +#define XK_acute 0x0b4 +#define XK_mu 0x0b5 +#define XK_paragraph 0x0b6 +#define XK_periodcentered 0x0b7 +#define XK_cedilla 0x0b8 +#define XK_onesuperior 0x0b9 +#define XK_masculine 0x0ba +#define XK_guillemotright 0x0bb /* right angle quotation mark */ +#define XK_onequarter 0x0bc +#define XK_onehalf 0x0bd +#define XK_threequarters 0x0be +#define XK_questiondown 0x0bf +#define XK_Agrave 0x0c0 +#define XK_Aacute 0x0c1 +#define XK_Acircumflex 0x0c2 +#define XK_Atilde 0x0c3 +#define XK_Adiaeresis 0x0c4 +#define XK_Aring 0x0c5 +#define XK_AE 0x0c6 +#define XK_Ccedilla 0x0c7 +#define XK_Egrave 0x0c8 +#define XK_Eacute 0x0c9 +#define XK_Ecircumflex 0x0ca +#define XK_Ediaeresis 0x0cb +#define XK_Igrave 0x0cc +#define XK_Iacute 0x0cd +#define XK_Icircumflex 0x0ce +#define XK_Idiaeresis 0x0cf +#define XK_ETH 0x0d0 +#define XK_Eth 0x0d0 /* deprecated */ +#define XK_Ntilde 0x0d1 +#define XK_Ograve 0x0d2 +#define XK_Oacute 0x0d3 +#define XK_Ocircumflex 0x0d4 +#define XK_Otilde 0x0d5 +#define XK_Odiaeresis 0x0d6 +#define XK_multiply 0x0d7 +#define XK_Ooblique 0x0d8 +#define XK_Ugrave 0x0d9 +#define XK_Uacute 0x0da +#define XK_Ucircumflex 0x0db +#define XK_Udiaeresis 0x0dc +#define XK_Yacute 0x0dd +#define XK_THORN 0x0de +#define XK_Thorn 0x0de /* deprecated */ +#define XK_ssharp 0x0df +#define XK_agrave 0x0e0 +#define XK_aacute 0x0e1 +#define XK_acircumflex 0x0e2 +#define XK_atilde 0x0e3 +#define XK_adiaeresis 0x0e4 +#define XK_aring 0x0e5 +#define XK_ae 0x0e6 +#define XK_ccedilla 0x0e7 +#define XK_egrave 0x0e8 +#define XK_eacute 0x0e9 +#define XK_ecircumflex 0x0ea +#define XK_ediaeresis 0x0eb +#define XK_igrave 0x0ec +#define XK_iacute 0x0ed +#define XK_icircumflex 0x0ee +#define XK_idiaeresis 0x0ef +#define XK_eth 0x0f0 +#define XK_ntilde 0x0f1 +#define XK_ograve 0x0f2 +#define XK_oacute 0x0f3 +#define XK_ocircumflex 0x0f4 +#define XK_otilde 0x0f5 +#define XK_odiaeresis 0x0f6 +#define XK_division 0x0f7 +#define XK_oslash 0x0f8 +#define XK_ugrave 0x0f9 +#define XK_uacute 0x0fa +#define XK_ucircumflex 0x0fb +#define XK_udiaeresis 0x0fc +#define XK_yacute 0x0fd +#define XK_thorn 0x0fe +#define XK_ydiaeresis 0x0ff +#endif /* XK_LATIN1 */ + +/* + * Latin 2 + * Byte 3 = 1 + */ + +#ifdef XK_LATIN2 +#define XK_Aogonek 0x1a1 +#define XK_breve 0x1a2 +#define XK_Lstroke 0x1a3 +#define XK_Lcaron 0x1a5 +#define XK_Sacute 0x1a6 +#define XK_Scaron 0x1a9 +#define XK_Scedilla 0x1aa +#define XK_Tcaron 0x1ab +#define XK_Zacute 0x1ac +#define XK_Zcaron 0x1ae +#define XK_Zabovedot 0x1af +#define XK_aogonek 0x1b1 +#define XK_ogonek 0x1b2 +#define XK_lstroke 0x1b3 +#define XK_lcaron 0x1b5 +#define XK_sacute 0x1b6 +#define XK_caron 0x1b7 +#define XK_scaron 0x1b9 +#define XK_scedilla 0x1ba +#define XK_tcaron 0x1bb +#define XK_zacute 0x1bc +#define XK_doubleacute 0x1bd +#define XK_zcaron 0x1be +#define XK_zabovedot 0x1bf +#define XK_Racute 0x1c0 +#define XK_Abreve 0x1c3 +#define XK_Lacute 0x1c5 +#define XK_Cacute 0x1c6 +#define XK_Ccaron 0x1c8 +#define XK_Eogonek 0x1ca +#define XK_Ecaron 0x1cc +#define XK_Dcaron 0x1cf +#define XK_Dstroke 0x1d0 +#define XK_Nacute 0x1d1 +#define XK_Ncaron 0x1d2 +#define XK_Odoubleacute 0x1d5 +#define XK_Rcaron 0x1d8 +#define XK_Uring 0x1d9 +#define XK_Udoubleacute 0x1db +#define XK_Tcedilla 0x1de +#define XK_racute 0x1e0 +#define XK_abreve 0x1e3 +#define XK_lacute 0x1e5 +#define XK_cacute 0x1e6 +#define XK_ccaron 0x1e8 +#define XK_eogonek 0x1ea +#define XK_ecaron 0x1ec +#define XK_dcaron 0x1ef +#define XK_dstroke 0x1f0 +#define XK_nacute 0x1f1 +#define XK_ncaron 0x1f2 +#define XK_odoubleacute 0x1f5 +#define XK_udoubleacute 0x1fb +#define XK_rcaron 0x1f8 +#define XK_uring 0x1f9 +#define XK_tcedilla 0x1fe +#define XK_abovedot 0x1ff +#endif /* XK_LATIN2 */ + +/* + * Latin 3 + * Byte 3 = 2 + */ + +#ifdef XK_LATIN3 +#define XK_Hstroke 0x2a1 +#define XK_Hcircumflex 0x2a6 +#define XK_Iabovedot 0x2a9 +#define XK_Gbreve 0x2ab +#define XK_Jcircumflex 0x2ac +#define XK_hstroke 0x2b1 +#define XK_hcircumflex 0x2b6 +#define XK_idotless 0x2b9 +#define XK_gbreve 0x2bb +#define XK_jcircumflex 0x2bc +#define XK_Cabovedot 0x2c5 +#define XK_Ccircumflex 0x2c6 +#define XK_Gabovedot 0x2d5 +#define XK_Gcircumflex 0x2d8 +#define XK_Ubreve 0x2dd +#define XK_Scircumflex 0x2de +#define XK_cabovedot 0x2e5 +#define XK_ccircumflex 0x2e6 +#define XK_gabovedot 0x2f5 +#define XK_gcircumflex 0x2f8 +#define XK_ubreve 0x2fd +#define XK_scircumflex 0x2fe +#endif /* XK_LATIN3 */ + + +/* + * Latin 4 + * Byte 3 = 3 + */ + +#ifdef XK_LATIN4 +#define XK_kra 0x3a2 +#define XK_kappa 0x3a2 /* deprecated */ +#define XK_Rcedilla 0x3a3 +#define XK_Itilde 0x3a5 +#define XK_Lcedilla 0x3a6 +#define XK_Emacron 0x3aa +#define XK_Gcedilla 0x3ab +#define XK_Tslash 0x3ac +#define XK_rcedilla 0x3b3 +#define XK_itilde 0x3b5 +#define XK_lcedilla 0x3b6 +#define XK_emacron 0x3ba +#define XK_gcedilla 0x3bb +#define XK_tslash 0x3bc +#define XK_ENG 0x3bd +#define XK_eng 0x3bf +#define XK_Amacron 0x3c0 +#define XK_Iogonek 0x3c7 +#define XK_Eabovedot 0x3cc +#define XK_Imacron 0x3cf +#define XK_Ncedilla 0x3d1 +#define XK_Omacron 0x3d2 +#define XK_Kcedilla 0x3d3 +#define XK_Uogonek 0x3d9 +#define XK_Utilde 0x3dd +#define XK_Umacron 0x3de +#define XK_amacron 0x3e0 +#define XK_iogonek 0x3e7 +#define XK_eabovedot 0x3ec +#define XK_imacron 0x3ef +#define XK_ncedilla 0x3f1 +#define XK_omacron 0x3f2 +#define XK_kcedilla 0x3f3 +#define XK_uogonek 0x3f9 +#define XK_utilde 0x3fd +#define XK_umacron 0x3fe +#endif /* XK_LATIN4 */ + +/* + * Katakana + * Byte 3 = 4 + */ + +#ifdef XK_KATAKANA +#define XK_overline 0x47e +#define XK_kana_fullstop 0x4a1 +#define XK_kana_openingbracket 0x4a2 +#define XK_kana_closingbracket 0x4a3 +#define XK_kana_comma 0x4a4 +#define XK_kana_conjunctive 0x4a5 +#define XK_kana_middledot 0x4a5 /* deprecated */ +#define XK_kana_WO 0x4a6 +#define XK_kana_a 0x4a7 +#define XK_kana_i 0x4a8 +#define XK_kana_u 0x4a9 +#define XK_kana_e 0x4aa +#define XK_kana_o 0x4ab +#define XK_kana_ya 0x4ac +#define XK_kana_yu 0x4ad +#define XK_kana_yo 0x4ae +#define XK_kana_tsu 0x4af +#define XK_kana_tu 0x4af /* deprecated */ +#define XK_prolongedsound 0x4b0 +#define XK_kana_A 0x4b1 +#define XK_kana_I 0x4b2 +#define XK_kana_U 0x4b3 +#define XK_kana_E 0x4b4 +#define XK_kana_O 0x4b5 +#define XK_kana_KA 0x4b6 +#define XK_kana_KI 0x4b7 +#define XK_kana_KU 0x4b8 +#define XK_kana_KE 0x4b9 +#define XK_kana_KO 0x4ba +#define XK_kana_SA 0x4bb +#define XK_kana_SHI 0x4bc +#define XK_kana_SU 0x4bd +#define XK_kana_SE 0x4be +#define XK_kana_SO 0x4bf +#define XK_kana_TA 0x4c0 +#define XK_kana_CHI 0x4c1 +#define XK_kana_TI 0x4c1 /* deprecated */ +#define XK_kana_TSU 0x4c2 +#define XK_kana_TU 0x4c2 /* deprecated */ +#define XK_kana_TE 0x4c3 +#define XK_kana_TO 0x4c4 +#define XK_kana_NA 0x4c5 +#define XK_kana_NI 0x4c6 +#define XK_kana_NU 0x4c7 +#define XK_kana_NE 0x4c8 +#define XK_kana_NO 0x4c9 +#define XK_kana_HA 0x4ca +#define XK_kana_HI 0x4cb +#define XK_kana_FU 0x4cc +#define XK_kana_HU 0x4cc /* deprecated */ +#define XK_kana_HE 0x4cd +#define XK_kana_HO 0x4ce +#define XK_kana_MA 0x4cf +#define XK_kana_MI 0x4d0 +#define XK_kana_MU 0x4d1 +#define XK_kana_ME 0x4d2 +#define XK_kana_MO 0x4d3 +#define XK_kana_YA 0x4d4 +#define XK_kana_YU 0x4d5 +#define XK_kana_YO 0x4d6 +#define XK_kana_RA 0x4d7 +#define XK_kana_RI 0x4d8 +#define XK_kana_RU 0x4d9 +#define XK_kana_RE 0x4da +#define XK_kana_RO 0x4db +#define XK_kana_WA 0x4dc +#define XK_kana_N 0x4dd +#define XK_voicedsound 0x4de +#define XK_semivoicedsound 0x4df +#define XK_kana_switch 0xFF7E /* Alias for mode_switch */ +#endif /* XK_KATAKANA */ + +/* + * Arabic + * Byte 3 = 5 + */ + +#ifdef XK_ARABIC +#define XK_Arabic_comma 0x5ac +#define XK_Arabic_semicolon 0x5bb +#define XK_Arabic_question_mark 0x5bf +#define XK_Arabic_hamza 0x5c1 +#define XK_Arabic_maddaonalef 0x5c2 +#define XK_Arabic_hamzaonalef 0x5c3 +#define XK_Arabic_hamzaonwaw 0x5c4 +#define XK_Arabic_hamzaunderalef 0x5c5 +#define XK_Arabic_hamzaonyeh 0x5c6 +#define XK_Arabic_alef 0x5c7 +#define XK_Arabic_beh 0x5c8 +#define XK_Arabic_tehmarbuta 0x5c9 +#define XK_Arabic_teh 0x5ca +#define XK_Arabic_theh 0x5cb +#define XK_Arabic_jeem 0x5cc +#define XK_Arabic_hah 0x5cd +#define XK_Arabic_khah 0x5ce +#define XK_Arabic_dal 0x5cf +#define XK_Arabic_thal 0x5d0 +#define XK_Arabic_ra 0x5d1 +#define XK_Arabic_zain 0x5d2 +#define XK_Arabic_seen 0x5d3 +#define XK_Arabic_sheen 0x5d4 +#define XK_Arabic_sad 0x5d5 +#define XK_Arabic_dad 0x5d6 +#define XK_Arabic_tah 0x5d7 +#define XK_Arabic_zah 0x5d8 +#define XK_Arabic_ain 0x5d9 +#define XK_Arabic_ghain 0x5da +#define XK_Arabic_tatweel 0x5e0 +#define XK_Arabic_feh 0x5e1 +#define XK_Arabic_qaf 0x5e2 +#define XK_Arabic_kaf 0x5e3 +#define XK_Arabic_lam 0x5e4 +#define XK_Arabic_meem 0x5e5 +#define XK_Arabic_noon 0x5e6 +#define XK_Arabic_ha 0x5e7 +#define XK_Arabic_heh 0x5e7 /* deprecated */ +#define XK_Arabic_waw 0x5e8 +#define XK_Arabic_alefmaksura 0x5e9 +#define XK_Arabic_yeh 0x5ea +#define XK_Arabic_fathatan 0x5eb +#define XK_Arabic_dammatan 0x5ec +#define XK_Arabic_kasratan 0x5ed +#define XK_Arabic_fatha 0x5ee +#define XK_Arabic_damma 0x5ef +#define XK_Arabic_kasra 0x5f0 +#define XK_Arabic_shadda 0x5f1 +#define XK_Arabic_sukun 0x5f2 +#define XK_Arabic_switch 0xFF7E /* Alias for mode_switch */ +#endif /* XK_ARABIC */ + +/* + * Cyrillic + * Byte 3 = 6 + */ +#ifdef XK_CYRILLIC +#define XK_Serbian_dje 0x6a1 +#define XK_Macedonia_gje 0x6a2 +#define XK_Cyrillic_io 0x6a3 +#define XK_Ukrainian_ie 0x6a4 +#define XK_Ukranian_je 0x6a4 /* deprecated */ +#define XK_Macedonia_dse 0x6a5 +#define XK_Ukrainian_i 0x6a6 +#define XK_Ukranian_i 0x6a6 /* deprecated */ +#define XK_Ukrainian_yi 0x6a7 +#define XK_Ukranian_yi 0x6a7 /* deprecated */ +#define XK_Cyrillic_je 0x6a8 +#define XK_Serbian_je 0x6a8 /* deprecated */ +#define XK_Cyrillic_lje 0x6a9 +#define XK_Serbian_lje 0x6a9 /* deprecated */ +#define XK_Cyrillic_nje 0x6aa +#define XK_Serbian_nje 0x6aa /* deprecated */ +#define XK_Serbian_tshe 0x6ab +#define XK_Macedonia_kje 0x6ac +#define XK_Byelorussian_shortu 0x6ae +#define XK_Cyrillic_dzhe 0x6af +#define XK_Serbian_dze 0x6af /* deprecated */ +#define XK_numerosign 0x6b0 +#define XK_Serbian_DJE 0x6b1 +#define XK_Macedonia_GJE 0x6b2 +#define XK_Cyrillic_IO 0x6b3 +#define XK_Ukrainian_IE 0x6b4 +#define XK_Ukranian_JE 0x6b4 /* deprecated */ +#define XK_Macedonia_DSE 0x6b5 +#define XK_Ukrainian_I 0x6b6 +#define XK_Ukranian_I 0x6b6 /* deprecated */ +#define XK_Ukrainian_YI 0x6b7 +#define XK_Ukranian_YI 0x6b7 /* deprecated */ +#define XK_Cyrillic_JE 0x6b8 +#define XK_Serbian_JE 0x6b8 /* deprecated */ +#define XK_Cyrillic_LJE 0x6b9 +#define XK_Serbian_LJE 0x6b9 /* deprecated */ +#define XK_Cyrillic_NJE 0x6ba +#define XK_Serbian_NJE 0x6ba /* deprecated */ +#define XK_Serbian_TSHE 0x6bb +#define XK_Macedonia_KJE 0x6bc +#define XK_Byelorussian_SHORTU 0x6be +#define XK_Cyrillic_DZHE 0x6bf +#define XK_Serbian_DZE 0x6bf /* deprecated */ +#define XK_Cyrillic_yu 0x6c0 +#define XK_Cyrillic_a 0x6c1 +#define XK_Cyrillic_be 0x6c2 +#define XK_Cyrillic_tse 0x6c3 +#define XK_Cyrillic_de 0x6c4 +#define XK_Cyrillic_ie 0x6c5 +#define XK_Cyrillic_ef 0x6c6 +#define XK_Cyrillic_ghe 0x6c7 +#define XK_Cyrillic_ha 0x6c8 +#define XK_Cyrillic_i 0x6c9 +#define XK_Cyrillic_shorti 0x6ca +#define XK_Cyrillic_ka 0x6cb +#define XK_Cyrillic_el 0x6cc +#define XK_Cyrillic_em 0x6cd +#define XK_Cyrillic_en 0x6ce +#define XK_Cyrillic_o 0x6cf +#define XK_Cyrillic_pe 0x6d0 +#define XK_Cyrillic_ya 0x6d1 +#define XK_Cyrillic_er 0x6d2 +#define XK_Cyrillic_es 0x6d3 +#define XK_Cyrillic_te 0x6d4 +#define XK_Cyrillic_u 0x6d5 +#define XK_Cyrillic_zhe 0x6d6 +#define XK_Cyrillic_ve 0x6d7 +#define XK_Cyrillic_softsign 0x6d8 +#define XK_Cyrillic_yeru 0x6d9 +#define XK_Cyrillic_ze 0x6da +#define XK_Cyrillic_sha 0x6db +#define XK_Cyrillic_e 0x6dc +#define XK_Cyrillic_shcha 0x6dd +#define XK_Cyrillic_che 0x6de +#define XK_Cyrillic_hardsign 0x6df +#define XK_Cyrillic_YU 0x6e0 +#define XK_Cyrillic_A 0x6e1 +#define XK_Cyrillic_BE 0x6e2 +#define XK_Cyrillic_TSE 0x6e3 +#define XK_Cyrillic_DE 0x6e4 +#define XK_Cyrillic_IE 0x6e5 +#define XK_Cyrillic_EF 0x6e6 +#define XK_Cyrillic_GHE 0x6e7 +#define XK_Cyrillic_HA 0x6e8 +#define XK_Cyrillic_I 0x6e9 +#define XK_Cyrillic_SHORTI 0x6ea +#define XK_Cyrillic_KA 0x6eb +#define XK_Cyrillic_EL 0x6ec +#define XK_Cyrillic_EM 0x6ed +#define XK_Cyrillic_EN 0x6ee +#define XK_Cyrillic_O 0x6ef +#define XK_Cyrillic_PE 0x6f0 +#define XK_Cyrillic_YA 0x6f1 +#define XK_Cyrillic_ER 0x6f2 +#define XK_Cyrillic_ES 0x6f3 +#define XK_Cyrillic_TE 0x6f4 +#define XK_Cyrillic_U 0x6f5 +#define XK_Cyrillic_ZHE 0x6f6 +#define XK_Cyrillic_VE 0x6f7 +#define XK_Cyrillic_SOFTSIGN 0x6f8 +#define XK_Cyrillic_YERU 0x6f9 +#define XK_Cyrillic_ZE 0x6fa +#define XK_Cyrillic_SHA 0x6fb +#define XK_Cyrillic_E 0x6fc +#define XK_Cyrillic_SHCHA 0x6fd +#define XK_Cyrillic_CHE 0x6fe +#define XK_Cyrillic_HARDSIGN 0x6ff +#endif /* XK_CYRILLIC */ + +/* + * Greek + * Byte 3 = 7 + */ + +#ifdef XK_GREEK +#define XK_Greek_ALPHAaccent 0x7a1 +#define XK_Greek_EPSILONaccent 0x7a2 +#define XK_Greek_ETAaccent 0x7a3 +#define XK_Greek_IOTAaccent 0x7a4 +#define XK_Greek_IOTAdieresis 0x7a5 +#define XK_Greek_OMICRONaccent 0x7a7 +#define XK_Greek_UPSILONaccent 0x7a8 +#define XK_Greek_UPSILONdieresis 0x7a9 +#define XK_Greek_OMEGAaccent 0x7ab +#define XK_Greek_accentdieresis 0x7ae +#define XK_Greek_horizbar 0x7af +#define XK_Greek_alphaaccent 0x7b1 +#define XK_Greek_epsilonaccent 0x7b2 +#define XK_Greek_etaaccent 0x7b3 +#define XK_Greek_iotaaccent 0x7b4 +#define XK_Greek_iotadieresis 0x7b5 +#define XK_Greek_iotaaccentdieresis 0x7b6 +#define XK_Greek_omicronaccent 0x7b7 +#define XK_Greek_upsilonaccent 0x7b8 +#define XK_Greek_upsilondieresis 0x7b9 +#define XK_Greek_upsilonaccentdieresis 0x7ba +#define XK_Greek_omegaaccent 0x7bb +#define XK_Greek_ALPHA 0x7c1 +#define XK_Greek_BETA 0x7c2 +#define XK_Greek_GAMMA 0x7c3 +#define XK_Greek_DELTA 0x7c4 +#define XK_Greek_EPSILON 0x7c5 +#define XK_Greek_ZETA 0x7c6 +#define XK_Greek_ETA 0x7c7 +#define XK_Greek_THETA 0x7c8 +#define XK_Greek_IOTA 0x7c9 +#define XK_Greek_KAPPA 0x7ca +#define XK_Greek_LAMDA 0x7cb +#define XK_Greek_LAMBDA 0x7cb +#define XK_Greek_MU 0x7cc +#define XK_Greek_NU 0x7cd +#define XK_Greek_XI 0x7ce +#define XK_Greek_OMICRON 0x7cf +#define XK_Greek_PI 0x7d0 +#define XK_Greek_RHO 0x7d1 +#define XK_Greek_SIGMA 0x7d2 +#define XK_Greek_TAU 0x7d4 +#define XK_Greek_UPSILON 0x7d5 +#define XK_Greek_PHI 0x7d6 +#define XK_Greek_CHI 0x7d7 +#define XK_Greek_PSI 0x7d8 +#define XK_Greek_OMEGA 0x7d9 +#define XK_Greek_alpha 0x7e1 +#define XK_Greek_beta 0x7e2 +#define XK_Greek_gamma 0x7e3 +#define XK_Greek_delta 0x7e4 +#define XK_Greek_epsilon 0x7e5 +#define XK_Greek_zeta 0x7e6 +#define XK_Greek_eta 0x7e7 +#define XK_Greek_theta 0x7e8 +#define XK_Greek_iota 0x7e9 +#define XK_Greek_kappa 0x7ea +#define XK_Greek_lamda 0x7eb +#define XK_Greek_lambda 0x7eb +#define XK_Greek_mu 0x7ec +#define XK_Greek_nu 0x7ed +#define XK_Greek_xi 0x7ee +#define XK_Greek_omicron 0x7ef +#define XK_Greek_pi 0x7f0 +#define XK_Greek_rho 0x7f1 +#define XK_Greek_sigma 0x7f2 +#define XK_Greek_finalsmallsigma 0x7f3 +#define XK_Greek_tau 0x7f4 +#define XK_Greek_upsilon 0x7f5 +#define XK_Greek_phi 0x7f6 +#define XK_Greek_chi 0x7f7 +#define XK_Greek_psi 0x7f8 +#define XK_Greek_omega 0x7f9 +#define XK_Greek_switch 0xFF7E /* Alias for mode_switch */ +#endif /* XK_GREEK */ + +/* + * Technical + * Byte 3 = 8 + */ + +#ifdef XK_TECHNICAL +#define XK_leftradical 0x8a1 +#define XK_topleftradical 0x8a2 +#define XK_horizconnector 0x8a3 +#define XK_topintegral 0x8a4 +#define XK_botintegral 0x8a5 +#define XK_vertconnector 0x8a6 +#define XK_topleftsqbracket 0x8a7 +#define XK_botleftsqbracket 0x8a8 +#define XK_toprightsqbracket 0x8a9 +#define XK_botrightsqbracket 0x8aa +#define XK_topleftparens 0x8ab +#define XK_botleftparens 0x8ac +#define XK_toprightparens 0x8ad +#define XK_botrightparens 0x8ae +#define XK_leftmiddlecurlybrace 0x8af +#define XK_rightmiddlecurlybrace 0x8b0 +#define XK_topleftsummation 0x8b1 +#define XK_botleftsummation 0x8b2 +#define XK_topvertsummationconnector 0x8b3 +#define XK_botvertsummationconnector 0x8b4 +#define XK_toprightsummation 0x8b5 +#define XK_botrightsummation 0x8b6 +#define XK_rightmiddlesummation 0x8b7 +#define XK_lessthanequal 0x8bc +#define XK_notequal 0x8bd +#define XK_greaterthanequal 0x8be +#define XK_integral 0x8bf +#define XK_therefore 0x8c0 +#define XK_variation 0x8c1 +#define XK_infinity 0x8c2 +#define XK_nabla 0x8c5 +#define XK_approximate 0x8c8 +#define XK_similarequal 0x8c9 +#define XK_ifonlyif 0x8cd +#define XK_implies 0x8ce +#define XK_identical 0x8cf +#define XK_radical 0x8d6 +#define XK_includedin 0x8da +#define XK_includes 0x8db +#define XK_intersection 0x8dc +#define XK_union 0x8dd +#define XK_logicaland 0x8de +#define XK_logicalor 0x8df +#define XK_partialderivative 0x8ef +#define XK_function 0x8f6 +#define XK_leftarrow 0x8fb +#define XK_uparrow 0x8fc +#define XK_rightarrow 0x8fd +#define XK_downarrow 0x8fe +#endif /* XK_TECHNICAL */ + +/* + * Special + * Byte 3 = 9 + */ + +#ifdef XK_SPECIAL +#define XK_blank 0x9df +#define XK_soliddiamond 0x9e0 +#define XK_checkerboard 0x9e1 +#define XK_ht 0x9e2 +#define XK_ff 0x9e3 +#define XK_cr 0x9e4 +#define XK_lf 0x9e5 +#define XK_nl 0x9e8 +#define XK_vt 0x9e9 +#define XK_lowrightcorner 0x9ea +#define XK_uprightcorner 0x9eb +#define XK_upleftcorner 0x9ec +#define XK_lowleftcorner 0x9ed +#define XK_crossinglines 0x9ee +#define XK_horizlinescan1 0x9ef +#define XK_horizlinescan3 0x9f0 +#define XK_horizlinescan5 0x9f1 +#define XK_horizlinescan7 0x9f2 +#define XK_horizlinescan9 0x9f3 +#define XK_leftt 0x9f4 +#define XK_rightt 0x9f5 +#define XK_bott 0x9f6 +#define XK_topt 0x9f7 +#define XK_vertbar 0x9f8 +#endif /* XK_SPECIAL */ + +/* + * Publishing + * Byte 3 = a + */ + +#ifdef XK_PUBLISHING +#define XK_emspace 0xaa1 +#define XK_enspace 0xaa2 +#define XK_em3space 0xaa3 +#define XK_em4space 0xaa4 +#define XK_digitspace 0xaa5 +#define XK_punctspace 0xaa6 +#define XK_thinspace 0xaa7 +#define XK_hairspace 0xaa8 +#define XK_emdash 0xaa9 +#define XK_endash 0xaaa +#define XK_signifblank 0xaac +#define XK_ellipsis 0xaae +#define XK_doubbaselinedot 0xaaf +#define XK_onethird 0xab0 +#define XK_twothirds 0xab1 +#define XK_onefifth 0xab2 +#define XK_twofifths 0xab3 +#define XK_threefifths 0xab4 +#define XK_fourfifths 0xab5 +#define XK_onesixth 0xab6 +#define XK_fivesixths 0xab7 +#define XK_careof 0xab8 +#define XK_figdash 0xabb +#define XK_leftanglebracket 0xabc +#define XK_decimalpoint 0xabd +#define XK_rightanglebracket 0xabe +#define XK_marker 0xabf +#define XK_oneeighth 0xac3 +#define XK_threeeighths 0xac4 +#define XK_fiveeighths 0xac5 +#define XK_seveneighths 0xac6 +#define XK_trademark 0xac9 +#define XK_signaturemark 0xaca +#define XK_trademarkincircle 0xacb +#define XK_leftopentriangle 0xacc +#define XK_rightopentriangle 0xacd +#define XK_emopencircle 0xace +#define XK_emopenrectangle 0xacf +#define XK_leftsinglequotemark 0xad0 +#define XK_rightsinglequotemark 0xad1 +#define XK_leftdoublequotemark 0xad2 +#define XK_rightdoublequotemark 0xad3 +#define XK_prescription 0xad4 +#define XK_minutes 0xad6 +#define XK_seconds 0xad7 +#define XK_latincross 0xad9 +#define XK_hexagram 0xada +#define XK_filledrectbullet 0xadb +#define XK_filledlefttribullet 0xadc +#define XK_filledrighttribullet 0xadd +#define XK_emfilledcircle 0xade +#define XK_emfilledrect 0xadf +#define XK_enopencircbullet 0xae0 +#define XK_enopensquarebullet 0xae1 +#define XK_openrectbullet 0xae2 +#define XK_opentribulletup 0xae3 +#define XK_opentribulletdown 0xae4 +#define XK_openstar 0xae5 +#define XK_enfilledcircbullet 0xae6 +#define XK_enfilledsqbullet 0xae7 +#define XK_filledtribulletup 0xae8 +#define XK_filledtribulletdown 0xae9 +#define XK_leftpointer 0xaea +#define XK_rightpointer 0xaeb +#define XK_club 0xaec +#define XK_diamond 0xaed +#define XK_heart 0xaee +#define XK_maltesecross 0xaf0 +#define XK_dagger 0xaf1 +#define XK_doubledagger 0xaf2 +#define XK_checkmark 0xaf3 +#define XK_ballotcross 0xaf4 +#define XK_musicalsharp 0xaf5 +#define XK_musicalflat 0xaf6 +#define XK_malesymbol 0xaf7 +#define XK_femalesymbol 0xaf8 +#define XK_telephone 0xaf9 +#define XK_telephonerecorder 0xafa +#define XK_phonographcopyright 0xafb +#define XK_caret 0xafc +#define XK_singlelowquotemark 0xafd +#define XK_doublelowquotemark 0xafe +#define XK_cursor 0xaff +#endif /* XK_PUBLISHING */ + +/* + * APL + * Byte 3 = b + */ + +#ifdef XK_APL +#define XK_leftcaret 0xba3 +#define XK_rightcaret 0xba6 +#define XK_downcaret 0xba8 +#define XK_upcaret 0xba9 +#define XK_overbar 0xbc0 +#define XK_downtack 0xbc2 +#define XK_upshoe 0xbc3 +#define XK_downstile 0xbc4 +#define XK_underbar 0xbc6 +#define XK_jot 0xbca +#define XK_quad 0xbcc +#define XK_uptack 0xbce +#define XK_circle 0xbcf +#define XK_upstile 0xbd3 +#define XK_downshoe 0xbd6 +#define XK_rightshoe 0xbd8 +#define XK_leftshoe 0xbda +#define XK_lefttack 0xbdc +#define XK_righttack 0xbfc +#endif /* XK_APL */ + +/* + * Hebrew + * Byte 3 = c + */ + +#ifdef XK_HEBREW +#define XK_hebrew_doublelowline 0xcdf +#define XK_hebrew_aleph 0xce0 +#define XK_hebrew_bet 0xce1 +#define XK_hebrew_beth 0xce1 /* deprecated */ +#define XK_hebrew_gimel 0xce2 +#define XK_hebrew_gimmel 0xce2 /* deprecated */ +#define XK_hebrew_dalet 0xce3 +#define XK_hebrew_daleth 0xce3 /* deprecated */ +#define XK_hebrew_he 0xce4 +#define XK_hebrew_waw 0xce5 +#define XK_hebrew_zain 0xce6 +#define XK_hebrew_zayin 0xce6 /* deprecated */ +#define XK_hebrew_chet 0xce7 +#define XK_hebrew_het 0xce7 /* deprecated */ +#define XK_hebrew_tet 0xce8 +#define XK_hebrew_teth 0xce8 /* deprecated */ +#define XK_hebrew_yod 0xce9 +#define XK_hebrew_finalkaph 0xcea +#define XK_hebrew_kaph 0xceb +#define XK_hebrew_lamed 0xcec +#define XK_hebrew_finalmem 0xced +#define XK_hebrew_mem 0xcee +#define XK_hebrew_finalnun 0xcef +#define XK_hebrew_nun 0xcf0 +#define XK_hebrew_samech 0xcf1 +#define XK_hebrew_samekh 0xcf1 /* deprecated */ +#define XK_hebrew_ayin 0xcf2 +#define XK_hebrew_finalpe 0xcf3 +#define XK_hebrew_pe 0xcf4 +#define XK_hebrew_finalzade 0xcf5 +#define XK_hebrew_finalzadi 0xcf5 /* deprecated */ +#define XK_hebrew_zade 0xcf6 +#define XK_hebrew_zadi 0xcf6 /* deprecated */ +#define XK_hebrew_qoph 0xcf7 +#define XK_hebrew_kuf 0xcf7 /* deprecated */ +#define XK_hebrew_resh 0xcf8 +#define XK_hebrew_shin 0xcf9 +#define XK_hebrew_taw 0xcfa +#define XK_hebrew_taf 0xcfa /* deprecated */ +#define XK_Hebrew_switch 0xFF7E /* Alias for mode_switch */ +#endif /* XK_HEBREW */ + +/* + * Thai + * Byte 3 = d + */ + +#ifdef XK_THAI +#define XK_Thai_kokai 0xda1 +#define XK_Thai_khokhai 0xda2 +#define XK_Thai_khokhuat 0xda3 +#define XK_Thai_khokhwai 0xda4 +#define XK_Thai_khokhon 0xda5 +#define XK_Thai_khorakhang 0xda6 +#define XK_Thai_ngongu 0xda7 +#define XK_Thai_chochan 0xda8 +#define XK_Thai_choching 0xda9 +#define XK_Thai_chochang 0xdaa +#define XK_Thai_soso 0xdab +#define XK_Thai_chochoe 0xdac +#define XK_Thai_yoying 0xdad +#define XK_Thai_dochada 0xdae +#define XK_Thai_topatak 0xdaf +#define XK_Thai_thothan 0xdb0 +#define XK_Thai_thonangmontho 0xdb1 +#define XK_Thai_thophuthao 0xdb2 +#define XK_Thai_nonen 0xdb3 +#define XK_Thai_dodek 0xdb4 +#define XK_Thai_totao 0xdb5 +#define XK_Thai_thothung 0xdb6 +#define XK_Thai_thothahan 0xdb7 +#define XK_Thai_thothong 0xdb8 +#define XK_Thai_nonu 0xdb9 +#define XK_Thai_bobaimai 0xdba +#define XK_Thai_popla 0xdbb +#define XK_Thai_phophung 0xdbc +#define XK_Thai_fofa 0xdbd +#define XK_Thai_phophan 0xdbe +#define XK_Thai_fofan 0xdbf +#define XK_Thai_phosamphao 0xdc0 +#define XK_Thai_moma 0xdc1 +#define XK_Thai_yoyak 0xdc2 +#define XK_Thai_rorua 0xdc3 +#define XK_Thai_ru 0xdc4 +#define XK_Thai_loling 0xdc5 +#define XK_Thai_lu 0xdc6 +#define XK_Thai_wowaen 0xdc7 +#define XK_Thai_sosala 0xdc8 +#define XK_Thai_sorusi 0xdc9 +#define XK_Thai_sosua 0xdca +#define XK_Thai_hohip 0xdcb +#define XK_Thai_lochula 0xdcc +#define XK_Thai_oang 0xdcd +#define XK_Thai_honokhuk 0xdce +#define XK_Thai_paiyannoi 0xdcf +#define XK_Thai_saraa 0xdd0 +#define XK_Thai_maihanakat 0xdd1 +#define XK_Thai_saraaa 0xdd2 +#define XK_Thai_saraam 0xdd3 +#define XK_Thai_sarai 0xdd4 +#define XK_Thai_saraii 0xdd5 +#define XK_Thai_saraue 0xdd6 +#define XK_Thai_sarauee 0xdd7 +#define XK_Thai_sarau 0xdd8 +#define XK_Thai_sarauu 0xdd9 +#define XK_Thai_phinthu 0xdda +#define XK_Thai_maihanakat_maitho 0xdde +#define XK_Thai_baht 0xddf +#define XK_Thai_sarae 0xde0 +#define XK_Thai_saraae 0xde1 +#define XK_Thai_sarao 0xde2 +#define XK_Thai_saraaimaimuan 0xde3 +#define XK_Thai_saraaimaimalai 0xde4 +#define XK_Thai_lakkhangyao 0xde5 +#define XK_Thai_maiyamok 0xde6 +#define XK_Thai_maitaikhu 0xde7 +#define XK_Thai_maiek 0xde8 +#define XK_Thai_maitho 0xde9 +#define XK_Thai_maitri 0xdea +#define XK_Thai_maichattawa 0xdeb +#define XK_Thai_thanthakhat 0xdec +#define XK_Thai_nikhahit 0xded +#define XK_Thai_leksun 0xdf0 +#define XK_Thai_leknung 0xdf1 +#define XK_Thai_leksong 0xdf2 +#define XK_Thai_leksam 0xdf3 +#define XK_Thai_leksi 0xdf4 +#define XK_Thai_lekha 0xdf5 +#define XK_Thai_lekhok 0xdf6 +#define XK_Thai_lekchet 0xdf7 +#define XK_Thai_lekpaet 0xdf8 +#define XK_Thai_lekkao 0xdf9 +#endif /* XK_THAI */ + +/* + * Korean + * Byte 3 = e + */ + +#ifdef XK_KOREAN + +#define XK_Hangul 0xff31 /* Hangul start/stop(toggle) */ +#define XK_Hangul_Start 0xff32 /* Hangul start */ +#define XK_Hangul_End 0xff33 /* Hangul end, English start */ +#define XK_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */ +#define XK_Hangul_Jamo 0xff35 /* Hangul Jamo mode */ +#define XK_Hangul_Romaja 0xff36 /* Hangul Romaja mode */ +#define XK_Hangul_Codeinput 0xff37 /* Hangul code input mode */ +#define XK_Hangul_Jeonja 0xff38 /* Jeonja mode */ +#define XK_Hangul_Banja 0xff39 /* Banja mode */ +#define XK_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */ +#define XK_Hangul_PostHanja 0xff3b /* Post Hanja conversion */ +#define XK_Hangul_SingleCandidate 0xff3c /* Single candidate */ +#define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */ +#define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */ +#define XK_Hangul_Special 0xff3f /* Special symbols */ +#define XK_Hangul_switch 0xFF7E /* Alias for mode_switch */ + +/* Hangul Consonant Characters */ +#define XK_Hangul_Kiyeog 0xea1 +#define XK_Hangul_SsangKiyeog 0xea2 +#define XK_Hangul_KiyeogSios 0xea3 +#define XK_Hangul_Nieun 0xea4 +#define XK_Hangul_NieunJieuj 0xea5 +#define XK_Hangul_NieunHieuh 0xea6 +#define XK_Hangul_Dikeud 0xea7 +#define XK_Hangul_SsangDikeud 0xea8 +#define XK_Hangul_Rieul 0xea9 +#define XK_Hangul_RieulKiyeog 0xeaa +#define XK_Hangul_RieulMieum 0xeab +#define XK_Hangul_RieulPieub 0xeac +#define XK_Hangul_RieulSios 0xead +#define XK_Hangul_RieulTieut 0xeae +#define XK_Hangul_RieulPhieuf 0xeaf +#define XK_Hangul_RieulHieuh 0xeb0 +#define XK_Hangul_Mieum 0xeb1 +#define XK_Hangul_Pieub 0xeb2 +#define XK_Hangul_SsangPieub 0xeb3 +#define XK_Hangul_PieubSios 0xeb4 +#define XK_Hangul_Sios 0xeb5 +#define XK_Hangul_SsangSios 0xeb6 +#define XK_Hangul_Ieung 0xeb7 +#define XK_Hangul_Jieuj 0xeb8 +#define XK_Hangul_SsangJieuj 0xeb9 +#define XK_Hangul_Cieuc 0xeba +#define XK_Hangul_Khieuq 0xebb +#define XK_Hangul_Tieut 0xebc +#define XK_Hangul_Phieuf 0xebd +#define XK_Hangul_Hieuh 0xebe + +/* Hangul Vowel Characters */ +#define XK_Hangul_A 0xebf +#define XK_Hangul_AE 0xec0 +#define XK_Hangul_YA 0xec1 +#define XK_Hangul_YAE 0xec2 +#define XK_Hangul_EO 0xec3 +#define XK_Hangul_E 0xec4 +#define XK_Hangul_YEO 0xec5 +#define XK_Hangul_YE 0xec6 +#define XK_Hangul_O 0xec7 +#define XK_Hangul_WA 0xec8 +#define XK_Hangul_WAE 0xec9 +#define XK_Hangul_OE 0xeca +#define XK_Hangul_YO 0xecb +#define XK_Hangul_U 0xecc +#define XK_Hangul_WEO 0xecd +#define XK_Hangul_WE 0xece +#define XK_Hangul_WI 0xecf +#define XK_Hangul_YU 0xed0 +#define XK_Hangul_EU 0xed1 +#define XK_Hangul_YI 0xed2 +#define XK_Hangul_I 0xed3 + +/* Hangul syllable-final (JongSeong) Characters */ +#define XK_Hangul_J_Kiyeog 0xed4 +#define XK_Hangul_J_SsangKiyeog 0xed5 +#define XK_Hangul_J_KiyeogSios 0xed6 +#define XK_Hangul_J_Nieun 0xed7 +#define XK_Hangul_J_NieunJieuj 0xed8 +#define XK_Hangul_J_NieunHieuh 0xed9 +#define XK_Hangul_J_Dikeud 0xeda +#define XK_Hangul_J_Rieul 0xedb +#define XK_Hangul_J_RieulKiyeog 0xedc +#define XK_Hangul_J_RieulMieum 0xedd +#define XK_Hangul_J_RieulPieub 0xede +#define XK_Hangul_J_RieulSios 0xedf +#define XK_Hangul_J_RieulTieut 0xee0 +#define XK_Hangul_J_RieulPhieuf 0xee1 +#define XK_Hangul_J_RieulHieuh 0xee2 +#define XK_Hangul_J_Mieum 0xee3 +#define XK_Hangul_J_Pieub 0xee4 +#define XK_Hangul_J_PieubSios 0xee5 +#define XK_Hangul_J_Sios 0xee6 +#define XK_Hangul_J_SsangSios 0xee7 +#define XK_Hangul_J_Ieung 0xee8 +#define XK_Hangul_J_Jieuj 0xee9 +#define XK_Hangul_J_Cieuc 0xeea +#define XK_Hangul_J_Khieuq 0xeeb +#define XK_Hangul_J_Tieut 0xeec +#define XK_Hangul_J_Phieuf 0xeed +#define XK_Hangul_J_Hieuh 0xeee + +/* Ancient Hangul Consonant Characters */ +#define XK_Hangul_RieulYeorinHieuh 0xeef +#define XK_Hangul_SunkyeongeumMieum 0xef0 +#define XK_Hangul_SunkyeongeumPieub 0xef1 +#define XK_Hangul_PanSios 0xef2 +#define XK_Hangul_KkogjiDalrinIeung 0xef3 +#define XK_Hangul_SunkyeongeumPhieuf 0xef4 +#define XK_Hangul_YeorinHieuh 0xef5 + +/* Ancient Hangul Vowel Characters */ +#define XK_Hangul_AraeA 0xef6 +#define XK_Hangul_AraeAE 0xef7 + +/* Ancient Hangul syllable-final (JongSeong) Characters */ +#define XK_Hangul_J_PanSios 0xef8 +#define XK_Hangul_J_KkogjiDalrinIeung 0xef9 +#define XK_Hangul_J_YeorinHieuh 0xefa + +/* Korean currency symbol */ +#define XK_Korean_Won 0xeff + +#endif /* XK_KOREAN */ + +/* Euro currency symbol */ +#define XK_EuroSign 0x20ac + +#endif diff --git a/src/win/mingw/include/rfb_mingw/rfb.h b/src/win/mingw/include/rfb_mingw/rfb.h new file mode 100644 index 0000000..d97cd19 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfb.h @@ -0,0 +1,796 @@ +#ifndef RFB_H +#define RFB_H + +/* + * rfb.h - header file for RFB DDX implementation. + */ + +/* + * Copyright (C) 2002 RealVNC Ltd. + * OSXvnc Copyright (C) 2001 Dan McGuirk . + * Original Xvnc code Copyright (C) 1999 AT&T Laboratories Cambridge. + * All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +#if(defined __cplusplus) +extern "C" +{ +#endif + +#include +#include +#include +#include + +#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H +#include +#endif + +#ifdef __MINGW32__ +#include +#endif + +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD +#include +#if 0 /* debugging */ +#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex))) +#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex))) +#define MUTEX(mutex) pthread_mutex_t (mutex) +#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL)) +#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex))) +#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond))) +#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex))) +#define COND(cond) pthread_cond_t (cond) +#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL)) +#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond))) +#define IF_PTHREADS(x) x +#else +#define LOCK(mutex) pthread_mutex_lock(&(mutex)); +#define UNLOCK(mutex) pthread_mutex_unlock(&(mutex)); +#define MUTEX(mutex) pthread_mutex_t (mutex) +#define INIT_MUTEX(mutex) pthread_mutex_init(&(mutex),NULL) +#define TINI_MUTEX(mutex) pthread_mutex_destroy(&(mutex)) +#define TSIGNAL(cond) pthread_cond_signal(&(cond)) +#define WAIT(cond,mutex) pthread_cond_wait(&(cond),&(mutex)) +#define COND(cond) pthread_cond_t (cond) +#define INIT_COND(cond) pthread_cond_init(&(cond),NULL) +#define TINI_COND(cond) pthread_cond_destroy(&(cond)) +#define IF_PTHREADS(x) x +#endif +#else +#define LOCK(mutex) +#define UNLOCK(mutex) +#define MUTEX(mutex) +#define INIT_MUTEX(mutex) +#define TINI_MUTEX(mutex) +#define TSIGNAL(cond) +#define WAIT(cond,mutex) this_is_unsupported +#define COND(cond) +#define INIT_COND(cond) +#define TINI_COND(cond) +#define IF_PTHREADS(x) +#endif + +/* end of stuff for autoconf */ + +/* if you use pthreads, but don't define LIBVNCSERVER_HAVE_LIBPTHREAD, the structs + get all mixed up. So this gives a linker error reminding you to compile + the library and your application (at least the parts including rfb.h) + with the same support for pthreads. */ +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD +#ifdef LIBVNCSERVER_HAVE_LIBZ +#define rfbInitServer rfbInitServerWithPthreadsAndZRLE +#else +#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE +#endif +#else +#ifdef LIBVNCSERVER_HAVE_LIBZ +#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE +#else +#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE +#endif +#endif + +struct _rfbClientRec; +struct _rfbScreenInfo; +struct rfbCursor; + +enum rfbNewClientAction { + RFB_CLIENT_ACCEPT, + RFB_CLIENT_ON_HOLD, + RFB_CLIENT_REFUSE +}; + +typedef void (*rfbKbdAddEventProcPtr) (rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl); +typedef void (*rfbKbdReleaseAllKeysProcPtr) (struct _rfbClientRec* cl); +typedef void (*rfbPtrAddEventProcPtr) (int buttonMask, int x, int y, struct _rfbClientRec* cl); +typedef void (*rfbSetXCutTextProcPtr) (char* str,int len, struct _rfbClientRec* cl); +typedef struct rfbCursor* (*rfbGetCursorProcPtr) (struct _rfbClientRec* pScreen); +typedef rfbBool (*rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec* cl); +typedef rfbBool (*rfbPasswordCheckProcPtr)(struct _rfbClientRec* cl,const char* encryptedPassWord,int len); +typedef enum rfbNewClientAction (*rfbNewClientHookPtr)(struct _rfbClientRec* cl); +typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl); + +typedef struct { + uint32_t count; + rfbBool is16; /* is the data format short? */ + union { + uint8_t* bytes; + uint16_t* shorts; + } data; /* there have to be count*3 entries */ +} rfbColourMap; + +/* + * Per-screen (framebuffer) structure. There can be as many as you wish, + * each serving different clients. However, you have to call + * rfbProcessEvents for each of these. + */ + +typedef struct _rfbScreenInfo +{ + int width; + int paddedWidthInBytes; + int height; + int depth; + int bitsPerPixel; + int sizeInBytes; + + rfbPixel blackPixel; + rfbPixel whitePixel; + + /* some screen specific data can be put into a struct where screenData + * points to. You need this if you have more than one screen at the + * same time while using the same functions. + */ + void* screenData; + + /* The following two members are used to minimise the amount of unnecessary + drawing caused by cursor movement. Whenever any drawing affects the + part of the screen where the cursor is, the cursor is removed first and + then the drawing is done (this is what the sprite routines test for). + Afterwards, however, we do not replace the cursor, even when the cursor + is logically being moved across the screen. We only draw the cursor + again just as we are about to send the client a framebuffer update. + + We need to be careful when removing and drawing the cursor because of + their relationship with the normal drawing routines. The drawing + routines can invoke the cursor routines, but also the cursor routines + themselves end up invoking drawing routines. + + Removing the cursor (rfbUndrawCursor) is eventually achieved by + doing a CopyArea from a pixmap to the screen, where the pixmap contains + the saved contents of the screen under the cursor. Before doing this, + however, we set cursorIsDrawn to FALSE. Then, when CopyArea is called, + it sees that cursorIsDrawn is FALSE and so doesn't feel the need to + (recursively!) remove the cursor before doing it. + + Putting up the cursor (rfbDrawCursor) involves a call to + PushPixels. While this is happening, cursorIsDrawn must be FALSE so + that PushPixels doesn't think it has to remove the cursor first. + Obviously cursorIsDrawn is set to TRUE afterwards. + + Another problem we face is that drawing routines sometimes cause a + framebuffer update to be sent to the RFB client. When the RFB client is + already waiting for a framebuffer update and some drawing to the + framebuffer then happens, the drawing routine sees that the client is + ready, so it calls rfbSendFramebufferUpdate. If the cursor is not drawn + at this stage, it must be put up, and so rfbSpriteRestoreCursor is + called. However, if the original drawing routine was actually called + from within rfbSpriteRestoreCursor or rfbSpriteRemoveCursor we don't + want this to happen. So both the cursor routines set + dontSendFramebufferUpdate to TRUE, and all the drawing routines check + this before calling rfbSendFramebufferUpdate. */ + + rfbBool cursorIsDrawn; /* TRUE if the cursor is currently drawn */ + rfbBool dontSendFramebufferUpdate; /* TRUE while removing or drawing the + cursor */ + + /* additions by libvncserver */ + + rfbPixelFormat serverFormat; + rfbColourMap colourMap; /* set this if rfbServerFormat.trueColour==FALSE */ + const char* desktopName; + char thisHost[255]; + + rfbBool autoPort; + int port; + SOCKET listenSock; + int maxSock; + int maxFd; +#ifdef __MINGW32__ + struct fd_set allFds; +#else + fd_set allFds; +#endif + + rfbBool socketInitDone; + SOCKET inetdSock; + rfbBool inetdInitDone; + + int udpPort; + SOCKET udpSock; + struct _rfbClientRec* udpClient; + rfbBool udpSockConnected; + struct sockaddr_in udpRemoteAddr; + + int maxClientWait; + + /* http stuff */ + rfbBool httpInitDone; + rfbBool httpEnableProxyConnect; + int httpPort; + char* httpDir; + SOCKET httpListenSock; + SOCKET httpSock; + + rfbPasswordCheckProcPtr passwordCheck; + void* authPasswdData; + /* If rfbAuthPasswdData is given a list, this is the first + view only password. */ + int authPasswdFirstViewOnly; + + /* send only this many rectangles in one update */ + int maxRectsPerUpdate; + /* this is the amount of milliseconds to wait at least before sending + * an update. */ + int deferUpdateTime; +#ifdef TODELETE + char* screen; +#endif + rfbBool alwaysShared; + rfbBool neverShared; + rfbBool dontDisconnect; + struct _rfbClientRec* clientHead; + + /* cursor */ + int cursorX, cursorY,oldCursorX,oldCursorY,underCursorBufferLen; + char* underCursorBuffer; + rfbBool dontConvertRichCursorToXCursor; + struct rfbCursor* cursor; + + /* the frameBufferhas to be supplied by the serving process. + * The buffer will not be freed by + */ + char* frameBuffer; + rfbKbdAddEventProcPtr kbdAddEvent; + rfbKbdReleaseAllKeysProcPtr kbdReleaseAllKeys; + rfbPtrAddEventProcPtr ptrAddEvent; + rfbSetXCutTextProcPtr setXCutText; + rfbGetCursorProcPtr getCursorPtr; + rfbSetTranslateFunctionProcPtr setTranslateFunction; + + /* newClientHook is called just after a new client is created */ + rfbNewClientHookPtr newClientHook; + /* displayHook is called just before a frame buffer update */ + rfbDisplayHookPtr displayHook; + +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD + MUTEX(cursorMutex); + rfbBool backgroundLoop; +#endif + + /* if TRUE, an ignoring signal handler is installed for SIGPIPE */ + rfbBool ignoreSIGPIPE; + + /* if not zero, only a slice of this height is processed every time + * an update should be sent. This should make working on a slow + * link more interactive. */ + int progressiveSliceHeight; +} rfbScreenInfo, *rfbScreenInfoPtr; + + +/* + * rfbTranslateFnType is the type of translation functions. + */ + +typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in, + rfbPixelFormat *out, + char *iptr, char *optr, + int bytesBetweenInputLines, + int width, int height); + + +/* region stuff */ + +struct sraRegion; +typedef struct sraRegion* sraRegionPtr; + +/* + * Per-client structure. + */ + +typedef void (*ClientGoneHookPtr)(struct _rfbClientRec* cl); + +typedef struct _rfbClientRec { + + /* back pointer to the screen */ + rfbScreenInfoPtr screen; + + /* private data. You should put any application client specific data + * into a struct and let clientData point to it. Don't forget to + * free the struct via clientGoneHook! + * + * This is useful if the IO functions have to behave client specific. + */ + void* clientData; + ClientGoneHookPtr clientGoneHook; + + SOCKET sock; + char *host; + +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD + pthread_t client_thread; +#endif + /* Possible client states: */ + enum { + RFB_PROTOCOL_VERSION, /* establishing protocol version */ + RFB_AUTHENTICATION, /* authenticating */ + RFB_INITIALISATION, /* sending initialisation messages */ + RFB_NORMAL /* normal protocol messages */ + } state; + + rfbBool reverseConnection; + rfbBool onHold; + rfbBool readyForSetColourMapEntries; + rfbBool useCopyRect; + int preferredEncoding; + int correMaxWidth, correMaxHeight; + + rfbBool viewOnly; + + /* The following member is only used during VNC authentication */ + uint8_t authChallenge[CHALLENGESIZE]; + + /* The following members represent the update needed to get the client's + framebuffer from its present state to the current state of our + framebuffer. + + If the client does not accept CopyRect encoding then the update is + simply represented as the region of the screen which has been modified + (modifiedRegion). + + If the client does accept CopyRect encoding, then the update consists of + two parts. First we have a single copy from one region of the screen to + another (the destination of the copy is copyRegion), and second we have + the region of the screen which has been modified in some other way + (modifiedRegion). + + Although the copy is of a single region, this region may have many + rectangles. When sending an update, the copyRegion is always sent + before the modifiedRegion. This is because the modifiedRegion may + overlap parts of the screen which are in the source of the copy. + + In fact during normal processing, the modifiedRegion may even overlap + the destination copyRegion. Just before an update is sent we remove + from the copyRegion anything in the modifiedRegion. */ + + sraRegionPtr copyRegion; /* the destination region of the copy */ + int copyDX, copyDY; /* the translation by which the copy happens */ + + sraRegionPtr modifiedRegion; + + /* As part of the FramebufferUpdateRequest, a client can express interest + in a subrectangle of the whole framebuffer. This is stored in the + requestedRegion member. In the normal case this is the whole + framebuffer if the client is ready, empty if it's not. */ + + sraRegionPtr requestedRegion; + + /* The following member represents the state of the "deferred update" timer + - when the framebuffer is modified and the client is ready, in most + cases it is more efficient to defer sending the update by a few + milliseconds so that several changes to the framebuffer can be combined + into a single update. */ + + struct timeval startDeferring; + + /* translateFn points to the translation function which is used to copy + and translate a rectangle from the framebuffer to an output buffer. */ + + rfbTranslateFnType translateFn; + char *translateLookupTable; + rfbPixelFormat format; + + /* + * UPDATE_BUF_SIZE must be big enough to send at least one whole line of the + * framebuffer. So for a max screen width of say 2K with 32-bit pixels this + * means 8K minimum. + */ + +#define UPDATE_BUF_SIZE 30000 + + char updateBuf[UPDATE_BUF_SIZE]; + int ublen; + + /* statistics */ + + int bytesSent[MAX_ENCODINGS]; + int rectanglesSent[MAX_ENCODINGS]; + int lastRectMarkersSent; + int lastRectBytesSent; + int cursorShapeBytesSent; + int cursorShapeUpdatesSent; + int cursorPosBytesSent; + int cursorPosUpdatesSent; + int framebufferUpdateMessagesSent; + int rawBytesEquivalent; + int keyEventsRcvd; + int pointerEventsRcvd; + +#ifdef LIBVNCSERVER_HAVE_LIBZ + /* zlib encoding -- necessary compression state info per client */ + + struct z_stream_s compStream; + rfbBool compStreamInited; + uint32_t zlibCompressLevel; + +#ifdef LIBVNCSERVER_HAVE_LIBJPEG + /* tight encoding -- preserve zlib streams' state for each client */ + z_stream zsStruct[4]; + rfbBool zsActive[4]; + int zsLevel[4]; + int tightCompressLevel; + int tightQualityLevel; +#endif +#endif + + rfbBool enableLastRectEncoding; /* client supports LastRect encoding */ + rfbBool enableCursorShapeUpdates; /* client supports cursor shape updates */ + rfbBool enableCursorPosUpdates; /* client supports cursor position updates */ + rfbBool useRichCursorEncoding; /* rfbEncodingRichCursor is preferred */ + rfbBool cursorWasChanged; /* cursor shape update should be sent */ + rfbBool cursorWasMoved; /* cursor position update should be sent */ + + rfbBool useNewFBSize; /* client supports NewFBSize encoding */ + rfbBool newFBSizePending; /* framebuffer size was changed */ + +#ifdef LIBVNCSERVER_BACKCHANNEL + rfbBool enableBackChannel; /* custom channel for special clients */ +#endif + + struct _rfbClientRec *prev; + struct _rfbClientRec *next; + +#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD + /* whenever a client is referenced, the refCount has to be incremented + and afterwards decremented, so that the client is not cleaned up + while being referenced. + Use the functions rfbIncrClientRef(cl) and rfbDecrClientRef(cl); + */ + int refCount; + MUTEX(refCountMutex); + COND(deleteCond); + + MUTEX(outputMutex); + MUTEX(updateMutex); + COND(updateCond); +#endif + +#ifdef LIBVNCSERVER_HAVE_LIBZ + void* zrleData; +#endif + + /* if progressive updating is on, this variable holds the current + * y coordinate of the progressive slice. */ + int progressiveSliceY; +} rfbClientRec, *rfbClientPtr; + +/* + * This macro is used to test whether there is a framebuffer update needing to + * be sent to the client. + */ + +#define FB_UPDATE_PENDING(cl) \ + ((!(cl)->enableCursorShapeUpdates && !(cl)->screen->cursorIsDrawn) || \ + ((cl)->enableCursorShapeUpdates && (cl)->cursorWasChanged) || \ + ((cl)->useNewFBSize && (cl)->newFBSizePending) || \ + ((cl)->enableCursorPosUpdates && (cl)->cursorWasMoved) || \ + !sraRgnEmpty((cl)->copyRegion) || !sraRgnEmpty((cl)->modifiedRegion)) + +/* + * Macros for endian swapping. + */ + +#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) + +#define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \ + (((l) & 0x00ff00))) + +#define Swap32(l) (((l) >> 24) | \ + (((l) & 0x00ff0000) >> 8) | \ + (((l) & 0x0000ff00) << 8) | \ + ((l) << 24)) + + +extern char rfbEndianTest; + +#define Swap16IfLE(s) (rfbEndianTest ? Swap16(s) : (s)) +#define Swap24IfLE(l) (rfbEndianTest ? Swap24(l) : (l)) +#define Swap32IfLE(l) (rfbEndianTest ? Swap32(l) : (l)) + +/* sockets.c */ + +extern int rfbMaxClientWait; + +extern void rfbInitSockets(rfbScreenInfoPtr rfbScreen); +extern void rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen); +extern void rfbCloseClient(rfbClientPtr cl); +extern int rfbReadExact(rfbClientPtr cl, char *buf, int len); +extern int rfbReadExactTimeout(rfbClientPtr cl, char *buf, int len,int timeout); +extern int rfbWriteExact(rfbClientPtr cl, const char *buf, int len); +extern void rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec); +extern int rfbConnect(rfbScreenInfoPtr rfbScreen, char* host, int port); +extern int rfbConnectToTcpAddr(char* host, int port); +extern int rfbListenOnTCPPort(int port); +extern int rfbListenOnUDPPort(int port); + +/* rfbserver.c */ + +/* Routines to iterate over the client list in a thread-safe way. + Only a single iterator can be in use at a time process-wide. */ +typedef struct rfbClientIterator *rfbClientIteratorPtr; + +extern void rfbClientListInit(rfbScreenInfoPtr rfbScreen); +extern rfbClientIteratorPtr rfbGetClientIterator(rfbScreenInfoPtr rfbScreen); +extern rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator); +extern void rfbReleaseClientIterator(rfbClientIteratorPtr iterator); + +extern void rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,int sock); +extern rfbClientPtr rfbNewClient(rfbScreenInfoPtr rfbScreen,int sock); +extern rfbClientPtr rfbNewUDPClient(rfbScreenInfoPtr rfbScreen); +extern rfbClientPtr rfbReverseConnection(rfbScreenInfoPtr rfbScreen,char *host, int port); +extern void rfbClientConnectionGone(rfbClientPtr cl); +extern void rfbProcessClientMessage(rfbClientPtr cl); +extern void rfbClientConnFailed(rfbClientPtr cl, char *reason); +extern void rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,int sock); +extern void rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen); +extern rfbBool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion); +extern rfbBool rfbSendRectEncodingRaw(rfbClientPtr cl, int x,int y,int w,int h); +extern rfbBool rfbSendUpdateBuf(rfbClientPtr cl); +extern void rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len); +extern rfbBool rfbSendCopyRegion(rfbClientPtr cl,sraRegionPtr reg,int dx,int dy); +extern rfbBool rfbSendLastRectMarker(rfbClientPtr cl); +extern rfbBool rfbSendNewFBSize(rfbClientPtr cl, int w, int h); +extern rfbBool rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, int nColours); +extern void rfbSendBell(rfbScreenInfoPtr rfbScreen); + +void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len); + +#ifdef LIBVNCSERVER_BACKCHANNEL +extern void rfbSendBackChannel(rfbScreenInfoPtr s,char* message,int len); +#endif + +/* translate.c */ + +extern rfbBool rfbEconomicTranslate; + +extern void rfbTranslateNone(char *table, rfbPixelFormat *in, + rfbPixelFormat *out, + char *iptr, char *optr, + int bytesBetweenInputLines, + int width, int height); +extern rfbBool rfbSetTranslateFunction(rfbClientPtr cl); +extern rfbBool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours); +extern void rfbSetClientColourMaps(rfbScreenInfoPtr rfbScreen, int firstColour, int nColours); + +/* httpd.c */ + +extern void rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen); +extern void rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen); + + + +/* auth.c */ + +extern void rfbAuthNewClient(rfbClientPtr cl); +extern void rfbAuthProcessClientMessage(rfbClientPtr cl); + + +/* rre.c */ + +extern rfbBool rfbSendRectEncodingRRE(rfbClientPtr cl, int x,int y,int w,int h); + + +/* corre.c */ + +extern rfbBool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x,int y,int w,int h); + + +/* hextile.c */ + +extern rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w, + int h); + + +#ifdef LIBVNCSERVER_HAVE_LIBZ +/* zlib.c */ + +/* Minimum zlib rectangle size in bytes. Anything smaller will + * not compress well due to overhead. + */ +#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17) + +/* Set maximum zlib rectangle size in pixels. Always allow at least + * two scan lines. + */ +#define ZLIB_MAX_RECT_SIZE (128*256) +#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \ + ( min * 2 ) : ZLIB_MAX_RECT_SIZE ) + +extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl, int x, int y, int w, + int h); + +#ifdef LIBVNCSERVER_HAVE_LIBJPEG +/* tight.c */ + +#define TIGHT_DEFAULT_COMPRESSION 6 + +extern rfbBool rfbTightDisableGradient; + +extern int rfbNumCodedRectsTight(rfbClientPtr cl, int x,int y,int w,int h); +extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl, int x,int y,int w,int h); +#endif +#endif + + +/* cursor.c */ + +typedef struct rfbCursor { + /* set this to true if LibVNCServer has to free this cursor */ + rfbBool cleanup, cleanupSource, cleanupMask, cleanupRichSource; + unsigned char *source; /* points to bits */ + unsigned char *mask; /* points to bits */ + unsigned short width, height, xhot, yhot; /* metrics */ + unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */ + unsigned short backRed, backGreen, backBlue; /* device-independent colour */ + unsigned char *richSource; /* source bytes for a rich cursor */ +} rfbCursor, *rfbCursorPtr; +extern unsigned char rfbReverseByte[0x100]; + +extern rfbBool rfbSendCursorShape(rfbClientPtr cl/*, rfbScreenInfoPtr pScreen*/); +extern rfbBool rfbSendCursorPos(rfbClientPtr cl); +extern void rfbConvertLSBCursorBitmapOrMask(int width,int height,unsigned char* bitmap); +extern rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskString); +extern char* rfbMakeMaskForXCursor(int width,int height,char* cursorString); +extern void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor); +extern void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor); +extern void rfbFreeCursor(rfbCursorPtr cursor); +extern void rfbDrawCursor(rfbScreenInfoPtr rfbScreen); +extern void rfbUndrawCursor(rfbScreenInfoPtr rfbScreen); +extern void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c,rfbBool freeOld); + +/* cursor handling for the pointer */ +extern void rfbDefaultPtrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl); + +/* zrle.c */ +#ifdef LIBVNCSERVER_HAVE_LIBZ +extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w,int h); +extern void rfbFreeZrleData(rfbClientPtr cl); +#endif + +/* stats.c */ + +extern void rfbResetStats(rfbClientPtr cl); +extern void rfbPrintStats(rfbClientPtr cl); + +/* font.c */ + +typedef struct rfbFontData { + unsigned char* data; + /* + metaData is a 256*5 array: + for each character + (offset,width,height,x,y) + */ + int* metaData; +} rfbFontData,* rfbFontDataPtr; + +int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,rfbPixel colour); +void rfbDrawString(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,rfbPixel colour); +/* if colour==backColour, background is transparent */ +int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,unsigned char c,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour); +void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,int x,int y,const char* string,int x1,int y1,int x2,int y2,rfbPixel colour,rfbPixel backColour); +int rfbWidthOfString(rfbFontDataPtr font,const char* string); +int rfbWidthOfChar(rfbFontDataPtr font,unsigned char c); +void rfbFontBBox(rfbFontDataPtr font,unsigned char c,int* x1,int* y1,int* x2,int* y2); +/* this returns the smallest box enclosing any character of font. */ +void rfbWholeFontBBox(rfbFontDataPtr font,int *x1, int *y1, int *x2, int *y2); + +/* dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16 */ +rfbFontDataPtr rfbLoadConsoleFont(char *filename); +/* free a dynamically loaded font */ +void rfbFreeFont(rfbFontDataPtr font); + +/* draw.c */ + +/* You have to call rfbUndrawCursor before using these functions */ +void rfbFillRect(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col); +void rfbDrawPixel(rfbScreenInfoPtr s,int x,int y,rfbPixel col); +void rfbDrawLine(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2,rfbPixel col); + +/* selbox.c */ + +/* this opens a modal select box. list is an array of strings, the end marked + with a NULL. + It returns the index in the list or -1 if cancelled or something else + wasn't kosher. */ +typedef void (*SelectionChangedHookPtr)(int _index); +extern int rfbSelectBox(rfbScreenInfoPtr rfbScreen, + rfbFontDataPtr font, char** list, + int x1, int y1, int x2, int y2, + rfbPixel foreColour, rfbPixel backColour, + int border,SelectionChangedHookPtr selChangedHook); + +/* cargs.c */ + +extern void rfbUsage(void); +extern void rfbPurgeArguments(int* argc,int* position,int count,char *argv[]); +extern rfbBool rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]); +extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[]); + +/* main.c */ + +extern void rfbLogEnable(int enabled); +typedef void (*rfbLogProc)(const char *format, ...); +extern rfbLogProc rfbLog, rfbErr; +extern void rfbLogPerror(const char *str); + +void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy); +void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy); + +void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy); +void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy); + +void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2); +void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion); +void rfbDoNothingWithClient(rfbClientPtr cl); +enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl); + +/* to check against plain passwords */ +rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len); + +/* functions to make a vnc server */ +extern rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, + int width,int height,int bitsPerSample,int samplesPerPixel, + int bytesPerPixel); +extern void rfbInitServer(rfbScreenInfoPtr rfbScreen); +extern void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen,char *framebuffer, + int width,int height, int bitsPerSample,int samplesPerPixel, + int bytesPerPixel); + +extern void rfbScreenCleanup(rfbScreenInfoPtr screenInfo); + +/* functions to accept/refuse a client that has been put on hold + by a NewClientHookPtr function. Must not be called in other + situations. */ +extern void rfbStartOnHoldClient(rfbClientPtr cl); +extern void rfbRefuseOnHoldClient(rfbClientPtr cl); + +/* call one of these two functions to service the vnc clients. + usec are the microseconds the select on the fds waits. + if you are using the event loop, set this to some value > 0, so the + server doesn't get a high load just by listening. */ + +extern void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground); +extern void rfbProcessEvents(rfbScreenInfoPtr screenInfo,long usec); + +#endif + +#if(defined __cplusplus) +} +#endif diff --git a/src/win/mingw/include/rfb_mingw/rfbclient.h b/src/win/mingw/include/rfb_mingw/rfbclient.h new file mode 100644 index 0000000..b094ce2 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfbclient.h @@ -0,0 +1,204 @@ +#ifndef RFBCLIENT_H +#define RFBCLIENT_H + +/* + * Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved. + * Copyright (C) 2000 Tridia Corporation. All Rights Reserved. + * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +/* + * vncviewer.h + */ + +#include +#include +#include +#include +#include +#include +#include + +#define rfbClientSwap16IfLE(s) \ + (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) + +#define rfbClientSwap32IfLE(l) \ + (*(char *)&client->endianTest ? ((((l) & 0xff000000) >> 24) | \ + (((l) & 0x00ff0000) >> 8) | \ + (((l) & 0x0000ff00) << 8) | \ + (((l) & 0x000000ff) << 24)) : (l)) + +#define FLASH_PORT_OFFSET 5400 +#define LISTEN_PORT_OFFSET 5500 +#define TUNNEL_PORT_OFFSET 5500 +#define SERVER_PORT_OFFSET 5900 + +#define DEFAULT_SSH_CMD "/usr/bin/ssh" +#define DEFAULT_TUNNEL_CMD \ + (DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20") +#define DEFAULT_VIA_CMD \ + (DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20") + +/* vncrec */ + +typedef struct { + FILE* file; + struct timeval tv; + rfbBool readTimestamp; + rfbBool doNotSleep; +} rfbVNCRec; + + +typedef struct { + rfbBool shareDesktop; + rfbBool viewOnly; + + const char* encodingsString; + + rfbBool useBGR233; + int nColours; + rfbBool forceOwnCmap; + rfbBool forceTrueColour; + int requestedDepth; + + int compressLevel; + int qualityLevel; + rfbBool enableJPEG; + rfbBool useRemoteCursor; +} AppData; + + +struct _rfbClient; + +typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y); +typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h); +typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client); +typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h); +typedef char* (*GetPasswordProc)(struct _rfbClient* client); +typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client); +typedef void (*BellProc)(struct _rfbClient* client); + +typedef struct _rfbClient { + uint8_t* frameBuffer; + int width, height; + + int endianTest; + + AppData appData; + + const char* programName; + char* serverHost; + int serverPort; /* if -1, then use file recorded by vncrec */ + rfbBool listenSpecified; + int listenPort, flashPort; + + /* Note that the CoRRE encoding uses this buffer and assumes it is big enough + to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes. + Hextile also assumes it is big enough to hold 16 * 16 * 32 bits. + Tight encoding assumes BUFFER_SIZE is at least 16384 bytes. */ + +#define RFB_BUFFER_SIZE (640*480) + char buffer[RFB_BUFFER_SIZE]; + + /* rfbproto.c */ + + int sock; + rfbBool canUseCoRRE; + rfbBool canUseHextile; + char *desktopName; + rfbPixelFormat format; + rfbServerInitMsg si; + char *serverCutText; + rfbBool newServerCutText; + + /* sockets.c */ +#define RFB_BUF_SIZE 8192 + char buf[RFB_BUF_SIZE]; + char *bufoutptr; + int buffered; + + + /* cursor.c */ + uint8_t *rcSource, *rcMask; + + /* private data pointer */ + void* clientData; + + rfbVNCRec* vncRec; + + /* hooks */ + HandleCursorPosProc HandleCursorPos; + SoftCursorLockAreaProc SoftCursorLockArea; + SoftCursorUnlockScreenProc SoftCursorUnlockScreen; + GotFrameBufferUpdateProc GotFrameBufferUpdate; + /* the pointer returned by GetPassword will be freed after use! */ + GetPasswordProc GetPassword; + MallocFrameBufferProc MallocFrameBuffer; + BellProc Bell; +} rfbClient; + +/* cursor.c */ + +extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc); + +/* listen.c */ + +extern void listenForIncomingConnections(rfbClient* viewer); + +/* rfbproto.c */ + +extern rfbBool rfbEnableClientLogging; +typedef void (*rfbClientLogProc)(const char *format, ...); +extern rfbClientLogProc rfbClientLog,rfbClientErr; +extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port); +extern rfbBool InitialiseRFBConnection(rfbClient* client); +extern rfbBool SetFormatAndEncodings(rfbClient* client); +extern rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient* client); +extern rfbBool SendFramebufferUpdateRequest(rfbClient* client, + int x, int y, int w, int h, + rfbBool incremental); +extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask); +extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down); +extern rfbBool SendClientCutText(rfbClient* client,char *str, int len); +extern rfbBool HandleRFBServerMessage(rfbClient* client); + +extern void PrintPixelFormat(rfbPixelFormat *format); + +/* sockets.c */ + +extern rfbBool errorMessageOnReadFailure; + +extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n); +extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n); +extern int FindFreeTcpPort(void); +extern int ListenAtTcpPort(int port); +extern int ConnectClientToTcpAddr(unsigned int host, int port); +extern int AcceptTcpConnection(int listenSock); +extern rfbBool SetNonBlocking(int sock); + +extern rfbBool StringToIPAddr(const char *str, unsigned int *addr); +extern rfbBool SameMachine(int sock); +extern int WaitForMessage(rfbClient* client,unsigned int usecs); + +/* vncviewer.c */ +rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel); +rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv); +void rfbClientCleanup(rfbClient* client); + +#endif + diff --git a/src/win/mingw/include/rfb_mingw/rfbconfig.h b/src/win/mingw/include/rfb_mingw/rfbconfig.h new file mode 100644 index 0000000..434de60 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfbconfig.h @@ -0,0 +1,344 @@ +#ifndef _RFB_RFBCONFIG_H +# define _RFB_RFBCONFIG_H + + +/* Enable 24 bit per pixel in native framebuffer */ +#ifndef LIBVNCSERVER_ALLOW24BPP +# define LIBVNCSERVER_ALLOW24BPP 1 +#endif + +/* Enable BackChannel communication */ +#ifndef LIBVNCSERVER_BACKCHANNEL +# define LIBVNCSERVER_BACKCHANNEL 1 +#endif + +/* Use ffmpeg (for vnc2mpg) */ +/* #undef LIBVNCSERVER_FFMPEG */ + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_ARPA_INET_H +# define LIBVNCSERVER_HAVE_ARPA_INET_H 1 +#endif + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef LIBVNCSERVER_HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_FCNTL_H +# define LIBVNCSERVER_HAVE_FCNTL_H 1 +#endif + +/* Define to 1 if you have the `fork' function. */ +/* #undef LIBVNCSERVER_HAVE_FORK */ + +/* Define to 1 if you have the `ftime' function. */ +#ifndef LIBVNCSERVER_HAVE_FTIME +#define LIBVNCSERVER_HAVE_FTIME 1 +#endif + +/* Define to 1 if you have the `gethostbyname' function. */ +#ifndef LIBVNCSERVER_HAVE_GETHOSTBYNAME +#define LIBVNCSERVER_HAVE_GETHOSTBYNAME 1 +#endif + +/* Define to 1 if you have the `gethostname' function. */ +#ifndef LIBVNCSERVER_HAVE_GETHOSTNAME +#define LIBVNCSERVER_HAVE_GETHOSTNAME 1 +#endif + +/* Define to 1 if you have the `gettimeofday' function. */ +#ifndef LIBVNCSERVER_HAVE_GETTIMEOFDAY +#define LIBVNCSERVER_HAVE_GETTIMEOFDAY 1 +#endif + +/* Define to 1 if you have the `inet_ntoa' function. */ +#ifndef LIBVNCSERVER_HAVE_INET_NTOA +#define LIBVNCSERVER_HAVE_INET_NTOA 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_INTTYPES_H +#define LIBVNCSERVER_HAVE_INTTYPES_H 1 +#endif + +/* Define to 1 if you have the `jpeg' library (-ljpeg). */ +/* #undef LIBVNCSERVER_HAVE_LIBJPEG */ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef LIBVNCSERVER_HAVE_LIBNSL */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#ifndef LIBVNCSERVER_HAVE_LIBPTHREAD +#ifndef _WIN32 +# define LIBVNCSERVER_HAVE_LIBPTHREAD 1 +#endif +#endif + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef LIBVNCSERVER_HAVE_LIBSOCKET */ + +/* Define to 1 if you have the `z' library (-lz). */ +#ifndef LIBVNCSERVER_HAVE_LIBZ +#define LIBVNCSERVER_HAVE_LIBZ 1 +#endif + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#ifndef LIBVNCSERVER_HAVE_MALLOC +#define LIBVNCSERVER_HAVE_MALLOC 1 +#endif + +/* Define to 1 if you have the `memmove' function. */ +#ifndef LIBVNCSERVER_HAVE_MEMMOVE +#define LIBVNCSERVER_HAVE_MEMMOVE 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_MEMORY_H +#define LIBVNCSERVER_HAVE_MEMORY_H 1 +#endif + +/* Define to 1 if you have the `memset' function. */ +#ifndef LIBVNCSERVER_HAVE_MEMSET +#define LIBVNCSERVER_HAVE_MEMSET 1 +#endif + +/* Define to 1 if you have the `mkfifo' function. */ +/* #unndef LIBVNCSERVER_HAVE_MKFIFO */ + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_NETDB_H +#define LIBVNCSERVER_HAVE_NETDB_H 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef LIBVNCSERVER_HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the `select' function. */ +#ifndef LIBVNCSERVER_HAVE_SELECT +#define LIBVNCSERVER_HAVE_SELECT 1 +#endif + +/* Define to 1 if you have the `setsid' function. */ +/* #undef LIBVNCSERVER_HAVE_SETSID */ + +/* Define to 1 if you have the `socket' function. */ +#ifndef LIBVNCSERVER_HAVE_SOCKET +#define LIBVNCSERVER_HAVE_SOCKET 1 +#endif + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +/* #undef LIBVNCSERVER_HAVE_STAT_EMPTY_STRING_BUG */ + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_STDINT_H +#define LIBVNCSERVER_HAVE_STDINT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_STDLIB_H +#define LIBVNCSERVER_HAVE_STDLIB_H 1 +#endif + +/* Define to 1 if you have the `strchr' function. */ +#ifndef LIBVNCSERVER_HAVE_STRCHR +#define LIBVNCSERVER_HAVE_STRCHR 1 +#endif + +/* Define to 1 if you have the `strcspn' function. */ +#ifndef LIBVNCSERVER_HAVE_STRCSPN +#define LIBVNCSERVER_HAVE_STRCSPN 1 +#endif + +/* Define to 1 if you have the `strdup' function. */ +#ifndef LIBVNCSERVER_HAVE_STRDUP +#define LIBVNCSERVER_HAVE_STRDUP 1 +#endif + +/* Define to 1 if you have the `strerror' function. */ +#ifndef LIBVNCSERVER_HAVE_STRERROR +#define LIBVNCSERVER_HAVE_STRERROR 1 +#endif + +/* Define to 1 if you have the `strftime' function. */ +#ifndef LIBVNCSERVER_HAVE_STRFTIME +#define LIBVNCSERVER_HAVE_STRFTIME 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_STRINGS_H +#define LIBVNCSERVER_HAVE_STRINGS_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_STRING_H +#define LIBVNCSERVER_HAVE_STRING_H 1 +#endif + +/* Define to 1 if you have the `strstr' function. */ +#ifndef LIBVNCSERVER_HAVE_STRSTR +#define LIBVNCSERVER_HAVE_STRSTR 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef LIBVNCSERVER_HAVE_SYSLOG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef LIBVNCSERVER_HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_SYS_STAT_H +#define LIBVNCSERVER_HAVE_SYS_STAT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_SYS_TIMEB_H +#define LIBVNCSERVER_HAVE_SYS_TIMEB_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_SYS_TIME_H +#define LIBVNCSERVER_HAVE_SYS_TIME_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_SYS_TYPES_H +#define LIBVNCSERVER_HAVE_SYS_TYPES_H 1 +#endif + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#ifndef LIBVNCSERVER_HAVE_SYS_WAIT_H +#define LIBVNCSERVER_HAVE_SYS_WAIT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef LIBVNCSERVER_HAVE_UNISTD_H +#define LIBVNCSERVER_HAVE_UNISTD_H 1 +#endif + +/* Define to 1 if you have the `vfork' function. */ +/* #undef LIBVNCSERVER_HAVE_VFORK */ + +/* Define to 1 if you have the header file. */ +/* #undef LIBVNCSERVER_HAVE_VFORK_H */ + +/* Define to 1 if you have the `vprintf' function. */ +#ifndef LIBVNCSERVER_HAVE_VPRINTF +#define LIBVNCSERVER_HAVE_VPRINTF 1 +#endif + +/* Define to 1 if `fork' works. */ +/* #undef LIBVNCSERVER_HAVE_WORKING_FORK */ + +/* Define to 1 if `vfork' works. */ +/* #undef LIBVNCSERVER_HAVE_WORKING_VFORK */ + +/* XKEYBOARD extension build environment present */ +/* #undef LIBVNCSERVER_HAVE_XKEYBOARD */ + +/* MIT-SHM extension build environment present */ +/* #undef LIBVNCSERVER_HAVE_XSHM */ + +/* XTEST extension build environment present */ +/* #undef LIBVNCSERVER_HAVE_XTEST */ + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +/* #undef LIBVNCSERVER_LSTAT_FOLLOWS_SLASHED_SYMLINK */ + +/* Name of package */ +#ifndef LIBVNCSERVER_PACKAGE +#define LIBVNCSERVER_PACKAGE "LibVNCServer" +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#ifndef LIBVNCSERVER_PACKAGE_BUGREPORT +#define LIBVNCSERVER_PACKAGE_BUGREPORT "http://sourceforge.net/projects/libvncserver" +#endif + +/* Define to the full name of this package. */ +#ifndef LIBVNCSERVER_PACKAGE_NAME +#define LIBVNCSERVER_PACKAGE_NAME "LibVNCServer" +#endif + +/* Define to the full name and version of this package. */ +#ifndef LIBVNCSERVER_PACKAGE_STRING +#define LIBVNCSERVER_PACKAGE_STRING "LibVNCServer 0.7" +#endif + +/* Define to the one symbol short name of this package. */ +#ifndef LIBVNCSERVER_PACKAGE_TARNAME +#define LIBVNCSERVER_PACKAGE_TARNAME "libvncserver" +#endif + +/* Define to the version of this package. */ +#ifndef LIBVNCSERVER_PACKAGE_VERSION +#define LIBVNCSERVER_PACKAGE_VERSION "0.7" +#endif + +/* The number of bytes in type char */ +/* #undef LIBVNCSERVER_SIZEOF_CHAR */ + +/* The number of bytes in type int */ +/* #undef LIBVNCSERVER_SIZEOF_INT */ + +/* The number of bytes in type long */ +/* #undef LIBVNCSERVER_SIZEOF_LONG */ + +/* The number of bytes in type short */ +/* #undef LIBVNCSERVER_SIZEOF_SHORT */ + +/* The number of bytes in type void* */ +/* #undef LIBVNCSERVER_SIZEOF_VOIDP */ + +/* Define to 1 if you have the ANSI C header files. */ +#ifndef LIBVNCSERVER_STDC_HEADERS +#define LIBVNCSERVER_STDC_HEADERS 1 +#endif + +/* Define to 1 if you can safely include both and . */ +#ifndef LIBVNCSERVER_TIME_WITH_SYS_TIME +#define LIBVNCSERVER_TIME_WITH_SYS_TIME 1 +#endif + +/* Version number of package */ +#ifndef LIBVNCSERVER_VERSION +#define LIBVNCSERVER_VERSION "0.7" +#endif + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef LIBVNCSERVER_WORDS_BIGENDIAN */ + +/* Define to 1 if the X Window System is missing or not being used. */ +#ifndef LIBVNCSERVER_X_DISPLAY_MISSING +#define LIBVNCSERVER_X_DISPLAY_MISSING 1 +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef _libvncserver_const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef _libvncserver_inline */ +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef _libvncserver_malloc */ + +/* Define to `int' if does not define. */ +/* #undef _libvncserver_pid_t */ + +/* Define to `unsigned' if does not define. */ +/* #undef _libvncserver_size_t */ + +/* The type for socklen */ +/* #undef _libvncserver_socklen_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef _libvncserver_vfork */ + +/* once: _RFB_RFBCONFIG_H */ +#endif diff --git a/src/win/mingw/include/rfb_mingw/rfbint.h b/src/win/mingw/include/rfb_mingw/rfbint.h new file mode 100644 index 0000000..05c9c01 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfbint.h @@ -0,0 +1,17 @@ +#ifndef _RFB_RFBINT_H +#define _RFB_RFBINT_H 1 +#ifndef _GENERATED_STDINT_H +#define _GENERATED_STDINT_H "LibVNCServer 0.7" +/* generated using a gnu compiler version gcc (Debian 4.9.2-10) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ + +#include + + +/* system headers have good uint64_t */ +#ifndef _HAVE_UINT64_T +#define _HAVE_UINT64_T +#endif + + /* once */ +#endif +#endif diff --git a/src/win/mingw/include/rfb_mingw/rfbproto.h b/src/win/mingw/include/rfb_mingw/rfbproto.h new file mode 100644 index 0000000..57a663f --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfbproto.h @@ -0,0 +1,1002 @@ +#ifndef RFBPROTO_H +#define RFBPROTO_H + +/* + * Copyright (C) 2000-2002 Constantin Kaplinsky. All Rights Reserved. + * Copyright (C) 2000 Tridia Corporation. All Rights Reserved. + * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +/* + * rfbproto.h - header file for the RFB protocol version 3.3 + * + * Uses types CARD for an n-bit unsigned integer, INT for an n-bit signed + * integer (for n = 8, 16 and 32). + * + * All multiple byte integers are in big endian (network) order (most + * significant byte first). Unless noted otherwise there is no special + * alignment of protocol structures. + * + * + * Once the initial handshaking is done, all messages start with a type byte, + * (usually) followed by message-specific data. The order of definitions in + * this file is as follows: + * + * (1) Structures used in several types of message. + * (2) Structures used in the initial handshaking. + * (3) Message types. + * (4) Encoding types. + * (5) For each message type, the form of the data following the type byte. + * Sometimes this is defined by a single structure but the more complex + * messages have to be explained by comments. + */ + + +#if defined(WIN32) && !defined(__MINGW32__) +#define LIBVNCSERVER_WORDS_BIGENDIAN +#define rfbBool int +#include +#include +#undef SOCKET +#define SOCKET int +#else +#include +#include +#endif +#include + +#ifdef LIBVNCSERVER_HAVE_LIBZ +#include +#endif + + +#if !defined(WIN32) || defined(__MINGW32__) +#define max(a,b) (((a)>(b))?(a):(b)) +#ifdef LIBVNCSERVER_HAVE_SYS_TIME_H +#include +#endif +#ifdef LIBVNCSERVER_HAVE_NETINET_IN_H +#include +#endif +//#undef SOCKET +//#define SOCKET int +typedef int8_t rfbBool; +#undef FALSE +#define FALSE 0 +#undef TRUE +#define TRUE -1 +#endif + +typedef uint32_t rfbKeySym; +typedef uint32_t rfbPixel; + +#ifndef INADDR_NONE +#define INADDR_NONE ((in_addr_t) 0xffffffff) +#endif + +#define MAX_ENCODINGS 20 + +/***************************************************************************** + * + * Structures used in several messages + * + *****************************************************************************/ + +/*----------------------------------------------------------------------------- + * Structure used to specify a rectangle. This structure is a multiple of 4 + * bytes so that it can be interspersed with 32-bit pixel data without + * affecting alignment. + */ + +typedef struct { + uint16_t x; + uint16_t y; + uint16_t w; + uint16_t h; +} rfbRectangle; + +#define sz_rfbRectangle 8 + + +/*----------------------------------------------------------------------------- + * Structure used to specify pixel format. + */ + +typedef struct { + + uint8_t bitsPerPixel; /* 8,16,32 only */ + + uint8_t depth; /* 8 to 32 */ + + uint8_t bigEndian; /* True if multi-byte pixels are interpreted + as big endian, or if single-bit-per-pixel + has most significant bit of the byte + corresponding to first (leftmost) pixel. Of + course this is meaningless for 8 bits/pix */ + + uint8_t trueColour; /* If false then we need a "colour map" to + convert pixels to RGB. If true, xxxMax and + xxxShift specify bits used for red, green + and blue */ + + /* the following fields are only meaningful if trueColour is true */ + + uint16_t redMax; /* maximum red value (= 2^n - 1 where n is the + number of bits used for red). Note this + value is always in big endian order. */ + + uint16_t greenMax; /* similar for green */ + + uint16_t blueMax; /* and blue */ + + uint8_t redShift; /* number of shifts needed to get the red + value in a pixel to the least significant + bit. To find the red value from a given + pixel, do the following: + 1) Swap pixel value according to bigEndian + (e.g. if bigEndian is false and host byte + order is big endian, then swap). + 2) Shift right by redShift. + 3) AND with redMax (in host byte order). + 4) You now have the red value between 0 and + redMax. */ + + uint8_t greenShift; /* similar for green */ + + uint8_t blueShift; /* and blue */ + + uint8_t pad1; + uint16_t pad2; + +} rfbPixelFormat; + +#define sz_rfbPixelFormat 16 + + + +/***************************************************************************** + * + * Initial handshaking messages + * + *****************************************************************************/ + +/*----------------------------------------------------------------------------- + * Protocol Version + * + * The server always sends 12 bytes to start which identifies the latest RFB + * protocol version number which it supports. These bytes are interpreted + * as a string of 12 ASCII characters in the format "RFB xxx.yyy\n" where + * xxx and yyy are the major and minor version numbers (for version 3.3 + * this is "RFB 003.003\n"). + * + * The client then replies with a similar 12-byte message giving the version + * number of the protocol which should actually be used (which may be different + * to that quoted by the server). + * + * It is intended that both clients and servers may provide some level of + * backwards compatibility by this mechanism. Servers in particular should + * attempt to provide backwards compatibility, and even forwards compatibility + * to some extent. For example if a client demands version 3.1 of the + * protocol, a 3.0 server can probably assume that by ignoring requests for + * encoding types it doesn't understand, everything will still work OK. This + * will probably not be the case for changes in the major version number. + * + * The format string below can be used in sprintf or sscanf to generate or + * decode the version string respectively. + */ + +#define rfbProtocolVersionFormat "RFB %03d.%03d\n" +#define rfbProtocolMajorVersion 3 +#define rfbProtocolMinorVersion 3 + +typedef char rfbProtocolVersionMsg[13]; /* allow extra byte for null */ + +#define sz_rfbProtocolVersionMsg 12 + + +/*----------------------------------------------------------------------------- + * Authentication + * + * Once the protocol version has been decided, the server then sends a 32-bit + * word indicating whether any authentication is needed on the connection. + * The value of this word determines the authentication scheme in use. For + * version 3.0 of the protocol this may have one of the following values: + */ + +#define rfbConnFailed 0 +#define rfbNoAuth 1 +#define rfbVncAuth 2 + +/* + * rfbConnFailed: For some reason the connection failed (e.g. the server + * cannot support the desired protocol version). This is + * followed by a string describing the reason (where a + * string is specified as a 32-bit length followed by that + * many ASCII characters). + * + * rfbNoAuth: No authentication is needed. + * + * rfbVncAuth: The VNC authentication scheme is to be used. A 16-byte + * challenge follows, which the client encrypts as + * appropriate using the password and sends the resulting + * 16-byte response. If the response is correct, the + * server sends the 32-bit word rfbVncAuthOK. If a simple + * failure happens, the server sends rfbVncAuthFailed and + * closes the connection. If the server decides that too + * many failures have occurred, it sends rfbVncAuthTooMany + * and closes the connection. In the latter case, the + * server should not allow an immediate reconnection by + * the client. + */ + +#define rfbVncAuthOK 0 +#define rfbVncAuthFailed 1 +#define rfbVncAuthTooMany 2 + + +/*----------------------------------------------------------------------------- + * Client Initialisation Message + * + * Once the client and server are sure that they're happy to talk to one + * another, the client sends an initialisation message. At present this + * message only consists of a boolean indicating whether the server should try + * to share the desktop by leaving other clients connected, or give exclusive + * access to this client by disconnecting all other clients. + */ + +typedef struct { + uint8_t shared; +} rfbClientInitMsg; + +#define sz_rfbClientInitMsg 1 + + +/*----------------------------------------------------------------------------- + * Server Initialisation Message + * + * After the client initialisation message, the server sends one of its own. + * This tells the client the width and height of the server's framebuffer, + * its pixel format and the name associated with the desktop. + */ + +typedef struct { + uint16_t framebufferWidth; + uint16_t framebufferHeight; + rfbPixelFormat format; /* the server's preferred pixel format */ + uint32_t nameLength; + /* followed by char name[nameLength] */ +} rfbServerInitMsg; + +#define sz_rfbServerInitMsg (8 + sz_rfbPixelFormat) + + +/* + * Following the server initialisation message it's up to the client to send + * whichever protocol messages it wants. Typically it will send a + * SetPixelFormat message and a SetEncodings message, followed by a + * FramebufferUpdateRequest. From then on the server will send + * FramebufferUpdate messages in response to the client's + * FramebufferUpdateRequest messages. The client should send + * FramebufferUpdateRequest messages with incremental set to true when it has + * finished processing one FramebufferUpdate and is ready to process another. + * With a fast client, the rate at which FramebufferUpdateRequests are sent + * should be regulated to avoid hogging the network. + */ + + + +/***************************************************************************** + * + * Message types + * + *****************************************************************************/ + +/* server -> client */ + +#define rfbFramebufferUpdate 0 +#define rfbSetColourMapEntries 1 +#define rfbBell 2 +#define rfbServerCutText 3 +#ifdef LIBVNCSERVER_BACKCHANNEL +#define rfbBackChannel 15 +#endif + +/* client -> server */ + +#define rfbSetPixelFormat 0 +#define rfbFixColourMapEntries 1 /* not currently supported */ +#define rfbSetEncodings 2 +#define rfbFramebufferUpdateRequest 3 +#define rfbKeyEvent 4 +#define rfbPointerEvent 5 +#define rfbClientCutText 6 + + + + +/***************************************************************************** + * + * Encoding types + * + *****************************************************************************/ + +#define rfbEncodingRaw 0 +#define rfbEncodingCopyRect 1 +#define rfbEncodingRRE 2 +#define rfbEncodingCoRRE 4 +#define rfbEncodingHextile 5 +#ifdef LIBVNCSERVER_HAVE_LIBZ +#define rfbEncodingZlib 6 +#define rfbEncodingTight 7 +#define rfbEncodingZlibHex 8 +#define rfbEncodingUltra 9 +#endif +#ifdef LIBVNCSERVER_BACKCHANNEL +#define rfbEncodingBackChannel 15 +#endif +#ifdef LIBVNCSERVER_HAVE_LIBZ +#define rfbEncodingZRLE 16 +#endif + +/* + * Special encoding numbers: + * 0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels; + * 0xFFFFFF10 .. 0xFFFFFF1F -- mouse cursor shape data; + * 0xFFFFFF20 .. 0xFFFFFF2F -- various protocol extensions; + * 0xFFFFFF30 .. 0xFFFFFFDF -- not allocated yet; + * 0xFFFFFFE0 .. 0xFFFFFFEF -- quality level for JPEG compressor; + * 0xFFFFFFF0 .. 0xFFFFFFFF -- cross-encoding compression levels. + */ + +#define rfbEncodingCompressLevel0 0xFFFFFF00 +#define rfbEncodingCompressLevel1 0xFFFFFF01 +#define rfbEncodingCompressLevel2 0xFFFFFF02 +#define rfbEncodingCompressLevel3 0xFFFFFF03 +#define rfbEncodingCompressLevel4 0xFFFFFF04 +#define rfbEncodingCompressLevel5 0xFFFFFF05 +#define rfbEncodingCompressLevel6 0xFFFFFF06 +#define rfbEncodingCompressLevel7 0xFFFFFF07 +#define rfbEncodingCompressLevel8 0xFFFFFF08 +#define rfbEncodingCompressLevel9 0xFFFFFF09 + +#define rfbEncodingXCursor 0xFFFFFF10 +#define rfbEncodingRichCursor 0xFFFFFF11 +#define rfbEncodingPointerPos 0xFFFFFF18 + +#define rfbEncodingLastRect 0xFFFFFF20 +#define rfbEncodingNewFBSize 0xFFFFFF21 + +#define rfbEncodingQualityLevel0 0xFFFFFFE0 +#define rfbEncodingQualityLevel1 0xFFFFFFE1 +#define rfbEncodingQualityLevel2 0xFFFFFFE2 +#define rfbEncodingQualityLevel3 0xFFFFFFE3 +#define rfbEncodingQualityLevel4 0xFFFFFFE4 +#define rfbEncodingQualityLevel5 0xFFFFFFE5 +#define rfbEncodingQualityLevel6 0xFFFFFFE6 +#define rfbEncodingQualityLevel7 0xFFFFFFE7 +#define rfbEncodingQualityLevel8 0xFFFFFFE8 +#define rfbEncodingQualityLevel9 0xFFFFFFE9 + + +/***************************************************************************** + * + * Server -> client message definitions + * + *****************************************************************************/ + + +/*----------------------------------------------------------------------------- + * FramebufferUpdate - a block of rectangles to be copied to the framebuffer. + * + * This message consists of a header giving the number of rectangles of pixel + * data followed by the rectangles themselves. The header is padded so that + * together with the type byte it is an exact multiple of 4 bytes (to help + * with alignment of 32-bit pixels): + */ + +typedef struct { + uint8_t type; /* always rfbFramebufferUpdate */ + uint8_t pad; + uint16_t nRects; + /* followed by nRects rectangles */ +} rfbFramebufferUpdateMsg; + +#define sz_rfbFramebufferUpdateMsg 4 + +/* + * Each rectangle of pixel data consists of a header describing the position + * and size of the rectangle and a type word describing the encoding of the + * pixel data, followed finally by the pixel data. Note that if the client has + * not sent a SetEncodings message then it will only receive raw pixel data. + * Also note again that this structure is a multiple of 4 bytes. + */ + +typedef struct { + rfbRectangle r; + uint32_t encoding; /* one of the encoding types rfbEncoding... */ +} rfbFramebufferUpdateRectHeader; + +#define sz_rfbFramebufferUpdateRectHeader (sz_rfbRectangle + 4) + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * Raw Encoding. Pixels are sent in top-to-bottom scanline order, + * left-to-right within a scanline with no padding in between. + */ + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * CopyRect Encoding. The pixels are specified simply by the x and y position + * of the source rectangle. + */ + +typedef struct { + uint16_t srcX; + uint16_t srcY; +} rfbCopyRect; + +#define sz_rfbCopyRect 4 + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RRE - Rise-and-Run-length Encoding. We have an rfbRREHeader structure + * giving the number of subrectangles following. Finally the data follows in + * the form [...] where each is + * []. + */ + +typedef struct { + uint32_t nSubrects; +} rfbRREHeader; + +#define sz_rfbRREHeader 4 + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * CoRRE - Compact RRE Encoding. We have an rfbRREHeader structure giving + * the number of subrectangles following. Finally the data follows in the form + * [...] where each is + * []. This means that + * the whole rectangle must be at most 255x255 pixels. + */ + +typedef struct { + uint8_t x; + uint8_t y; + uint8_t w; + uint8_t h; +} rfbCoRRERectangle; + +#define sz_rfbCoRRERectangle 4 + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * Hextile Encoding. The rectangle is divided up into "tiles" of 16x16 pixels, + * starting at the top left going in left-to-right, top-to-bottom order. If + * the width of the rectangle is not an exact multiple of 16 then the width of + * the last tile in each row will be correspondingly smaller. Similarly if the + * height is not an exact multiple of 16 then the height of each tile in the + * final row will also be smaller. Each tile begins with a "subencoding" type + * byte, which is a mask made up of a number of bits. If the Raw bit is set + * then the other bits are irrelevant; w*h pixel values follow (where w and h + * are the width and height of the tile). Otherwise the tile is encoded in a + * similar way to RRE, except that the position and size of each subrectangle + * can be specified in just two bytes. The other bits in the mask are as + * follows: + * + * BackgroundSpecified - if set, a pixel value follows which specifies + * the background colour for this tile. The first non-raw tile in a + * rectangle must have this bit set. If this bit isn't set then the + * background is the same as the last tile. + * + * ForegroundSpecified - if set, a pixel value follows which specifies + * the foreground colour to be used for all subrectangles in this tile. + * If this bit is set then the SubrectsColoured bit must be zero. + * + * AnySubrects - if set, a single byte follows giving the number of + * subrectangles following. If not set, there are no subrectangles (i.e. + * the whole tile is just solid background colour). + * + * SubrectsColoured - if set then each subrectangle is preceded by a pixel + * value giving the colour of that subrectangle. If not set, all + * subrectangles are the same colour, the foreground colour; if the + * ForegroundSpecified bit wasn't set then the foreground is the same as + * the last tile. + * + * The position and size of each subrectangle is specified in two bytes. The + * Pack macros below can be used to generate the two bytes from x, y, w, h, + * and the Extract macros can be used to extract the x, y, w, h values from + * the two bytes. + */ + +#define rfbHextileRaw (1 << 0) +#define rfbHextileBackgroundSpecified (1 << 1) +#define rfbHextileForegroundSpecified (1 << 2) +#define rfbHextileAnySubrects (1 << 3) +#define rfbHextileSubrectsColoured (1 << 4) + +#define rfbHextilePackXY(x,y) (((x) << 4) | (y)) +#define rfbHextilePackWH(w,h) ((((w)-1) << 4) | ((h)-1)) +#define rfbHextileExtractX(byte) ((byte) >> 4) +#define rfbHextileExtractY(byte) ((byte) & 0xf) +#define rfbHextileExtractW(byte) (((byte) >> 4) + 1) +#define rfbHextileExtractH(byte) (((byte) & 0xf) + 1) + +#ifdef LIBVNCSERVER_HAVE_LIBZ +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * zlib - zlib compressed Encoding. We have an rfbZlibHeader structure + * giving the number of bytes following. Finally the data follows is + * zlib compressed version of the raw pixel data as negotiated. + */ + +typedef struct { + uint32_t nBytes; +} rfbZlibHeader; + +#define sz_rfbZlibHeader 4 + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * Tight Encoding. + * + *-- The first byte of each Tight-encoded rectangle is a "compression control + * byte". Its format is as follows (bit 0 is the least significant one): + * + * bit 0: if 1, then compression stream 0 should be reset; + * bit 1: if 1, then compression stream 1 should be reset; + * bit 2: if 1, then compression stream 2 should be reset; + * bit 3: if 1, then compression stream 3 should be reset; + * bits 7-4: if 1000 (0x08), then the compression type is "fill", + * if 1001 (0x09), then the compression type is "jpeg", + * if 0xxx, then the compression type is "basic", + * values greater than 1001 are not valid. + * + * If the compression type is "basic", then bits 6..4 of the + * compression control byte (those xxx in 0xxx) specify the following: + * + * bits 5-4: decimal representation is the index of a particular zlib + * stream which should be used for decompressing the data; + * bit 6: if 1, then a "filter id" byte is following this byte. + * + *-- The data that follows after the compression control byte described + * above depends on the compression type ("fill", "jpeg" or "basic"). + * + *-- If the compression type is "fill", then the only pixel value follows, in + * client pixel format (see NOTE 1). This value applies to all pixels of the + * rectangle. + * + *-- If the compression type is "jpeg", the following data stream looks like + * this: + * + * 1..3 bytes: data size (N) in compact representation; + * N bytes: JPEG image. + * + * Data size is compactly represented in one, two or three bytes, according + * to the following scheme: + * + * 0xxxxxxx (for values 0..127) + * 1xxxxxxx 0yyyyyyy (for values 128..16383) + * 1xxxxxxx 1yyyyyyy zzzzzzzz (for values 16384..4194303) + * + * Here each character denotes one bit, xxxxxxx are the least significant 7 + * bits of the value (bits 0-6), yyyyyyy are bits 7-13, and zzzzzzzz are the + * most significant 8 bits (bits 14-21). For example, decimal value 10000 + * should be represented as two bytes: binary 10010000 01001110, or + * hexadecimal 90 4E. + * + *-- If the compression type is "basic" and bit 6 of the compression control + * byte was set to 1, then the next (second) byte specifies "filter id" which + * tells the decoder what filter type was used by the encoder to pre-process + * pixel data before the compression. The "filter id" byte can be one of the + * following: + * + * 0: no filter ("copy" filter); + * 1: "palette" filter; + * 2: "gradient" filter. + * + *-- If bit 6 of the compression control byte is set to 0 (no "filter id" + * byte), or if the filter id is 0, then raw pixel values in the client + * format (see NOTE 1) will be compressed. See below details on the + * compression. + * + *-- The "gradient" filter pre-processes pixel data with a simple algorithm + * which converts each color component to a difference between a "predicted" + * intensity and the actual intensity. Such a technique does not affect + * uncompressed data size, but helps to compress photo-like images better. + * Pseudo-code for converting intensities to differences is the following: + * + * P[i,j] := V[i-1,j] + V[i,j-1] - V[i-1,j-1]; + * if (P[i,j] < 0) then P[i,j] := 0; + * if (P[i,j] > MAX) then P[i,j] := MAX; + * D[i,j] := V[i,j] - P[i,j]; + * + * Here V[i,j] is the intensity of a color component for a pixel at + * coordinates (i,j). MAX is the maximum value of intensity for a color + * component. + * + *-- The "palette" filter converts true-color pixel data to indexed colors + * and a palette which can consist of 2..256 colors. If the number of colors + * is 2, then each pixel is encoded in 1 bit, otherwise 8 bits is used to + * encode one pixel. 1-bit encoding is performed such way that the most + * significant bits correspond to the leftmost pixels, and each raw of pixels + * is aligned to the byte boundary. When "palette" filter is used, the + * palette is sent before the pixel data. The palette begins with an unsigned + * byte which value is the number of colors in the palette minus 1 (i.e. 1 + * means 2 colors, 255 means 256 colors in the palette). Then follows the + * palette itself which consist of pixel values in client pixel format (see + * NOTE 1). + * + *-- The pixel data is compressed using the zlib library. But if the data + * size after applying the filter but before the compression is less then 12, + * then the data is sent as is, uncompressed. Four separate zlib streams + * (0..3) can be used and the decoder should read the actual stream id from + * the compression control byte (see NOTE 2). + * + * If the compression is not used, then the pixel data is sent as is, + * otherwise the data stream looks like this: + * + * 1..3 bytes: data size (N) in compact representation; + * N bytes: zlib-compressed data. + * + * Data size is compactly represented in one, two or three bytes, just like + * in the "jpeg" compression method (see above). + * + *-- NOTE 1. If the color depth is 24, and all three color components are + * 8-bit wide, then one pixel in Tight encoding is always represented by + * three bytes, where the first byte is red component, the second byte is + * green component, and the third byte is blue component of the pixel color + * value. This applies to colors in palettes as well. + * + *-- NOTE 2. The decoder must reset compression streams' states before + * decoding the rectangle, if some of bits 0,1,2,3 in the compression control + * byte are set to 1. Note that the decoder must reset zlib streams even if + * the compression type is "fill" or "jpeg". + * + *-- NOTE 3. The "gradient" filter and "jpeg" compression may be used only + * when bits-per-pixel value is either 16 or 32, not 8. + * + *-- NOTE 4. The width of any Tight-encoded rectangle cannot exceed 2048 + * pixels. If a rectangle is wider, it must be split into several rectangles + * and each one should be encoded separately. + * + */ + +#define rfbTightExplicitFilter 0x04 +#define rfbTightFill 0x08 +#define rfbTightJpeg 0x09 +#define rfbTightMaxSubencoding 0x09 + +/* Filters to improve compression efficiency */ +#define rfbTightFilterCopy 0x00 +#define rfbTightFilterPalette 0x01 +#define rfbTightFilterGradient 0x02 + +#endif + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * XCursor encoding. This is a special encoding used to transmit X-style + * cursor shapes from server to clients. Note that for this encoding, + * coordinates in rfbFramebufferUpdateRectHeader structure hold hotspot + * position (r.x, r.y) and cursor size (r.w, r.h). If (w * h != 0), two RGB + * samples are sent after header in the rfbXCursorColors structure. They + * denote foreground and background colors of the cursor. If a client + * supports only black-and-white cursors, it should ignore these colors and + * assume that foreground is black and background is white. Next, two bitmaps + * (1 bits per pixel) follow: first one with actual data (value 0 denotes + * background color, value 1 denotes foreground color), second one with + * transparency data (bits with zero value mean that these pixels are + * transparent). Both bitmaps represent cursor data in a byte stream, from + * left to right, from top to bottom, and each row is byte-aligned. Most + * significant bits correspond to leftmost pixels. The number of bytes in + * each row can be calculated as ((w + 7) / 8). If (w * h == 0), cursor + * should be hidden (or default local cursor should be set by the client). + */ + +typedef struct { + uint8_t foreRed; + uint8_t foreGreen; + uint8_t foreBlue; + uint8_t backRed; + uint8_t backGreen; + uint8_t backBlue; +} rfbXCursorColors; + +#define sz_rfbXCursorColors 6 + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * RichCursor encoding. This is a special encoding used to transmit cursor + * shapes from server to clients. It is similar to the XCursor encoding but + * uses client pixel format instead of two RGB colors to represent cursor + * image. For this encoding, coordinates in rfbFramebufferUpdateRectHeader + * structure hold hotspot position (r.x, r.y) and cursor size (r.w, r.h). + * After header, two pixmaps follow: first one with cursor image in current + * client pixel format (like in raw encoding), second with transparency data + * (1 bit per pixel, exactly the same format as used for transparency bitmap + * in the XCursor encoding). If (w * h == 0), cursor should be hidden (or + * default local cursor should be set by the client). + */ + + +/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * ZRLE - encoding combining Zlib compression, tiling, palettisation and + * run-length encoding. + */ + +typedef struct { + uint32_t length; +} rfbZRLEHeader; + +#define sz_rfbZRLEHeader 4 + +#define rfbZRLETileWidth 64 +#define rfbZRLETileHeight 64 + + +/*----------------------------------------------------------------------------- + * SetColourMapEntries - these messages are only sent if the pixel + * format uses a "colour map" (i.e. trueColour false) and the client has not + * fixed the entire colour map using FixColourMapEntries. In addition they + * will only start being sent after the client has sent its first + * FramebufferUpdateRequest. So if the client always tells the server to use + * trueColour then it never needs to process this type of message. + */ + +typedef struct { + uint8_t type; /* always rfbSetColourMapEntries */ + uint8_t pad; + uint16_t firstColour; + uint16_t nColours; + + /* Followed by nColours * 3 * uint16_t + r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */ + +} rfbSetColourMapEntriesMsg; + +#define sz_rfbSetColourMapEntriesMsg 6 + + + +/*----------------------------------------------------------------------------- + * Bell - ring a bell on the client if it has one. + */ + +typedef struct { + uint8_t type; /* always rfbBell */ +} rfbBellMsg; + +#define sz_rfbBellMsg 1 + + + +/*----------------------------------------------------------------------------- + * ServerCutText - the server has new text in its cut buffer. + */ + +typedef struct { + uint8_t type; /* always rfbServerCutText */ + uint8_t pad1; + uint16_t pad2; + uint32_t length; + /* followed by char text[length] */ +} rfbServerCutTextMsg; + +#define sz_rfbServerCutTextMsg 8 + +#ifdef LIBVNCSERVER_BACKCHANNEL +typedef rfbServerCutTextMsg rfbBackChannelMsg; +#define sz_rfbBackChannelMsg 8 +#endif + + +/*----------------------------------------------------------------------------- + * Union of all server->client messages. + */ + +typedef union { + uint8_t type; + rfbFramebufferUpdateMsg fu; + rfbSetColourMapEntriesMsg scme; + rfbBellMsg b; + rfbServerCutTextMsg sct; +} rfbServerToClientMsg; + + + +/***************************************************************************** + * + * Message definitions (client -> server) + * + *****************************************************************************/ + + +/*----------------------------------------------------------------------------- + * SetPixelFormat - tell the RFB server the format in which the client wants + * pixels sent. + */ + +typedef struct { + uint8_t type; /* always rfbSetPixelFormat */ + uint8_t pad1; + uint16_t pad2; + rfbPixelFormat format; +} rfbSetPixelFormatMsg; + +#define sz_rfbSetPixelFormatMsg (sz_rfbPixelFormat + 4) + + +/*----------------------------------------------------------------------------- + * FixColourMapEntries - when the pixel format uses a "colour map", fix + * read-only colour map entries. + * + * ***************** NOT CURRENTLY SUPPORTED ***************** + */ + +typedef struct { + uint8_t type; /* always rfbFixColourMapEntries */ + uint8_t pad; + uint16_t firstColour; + uint16_t nColours; + + /* Followed by nColours * 3 * uint16_t + r1, g1, b1, r2, g2, b2, r3, g3, b3, ..., rn, bn, gn */ + +} rfbFixColourMapEntriesMsg; + +#define sz_rfbFixColourMapEntriesMsg 6 + + +/*----------------------------------------------------------------------------- + * SetEncodings - tell the RFB server which encoding types we accept. Put them + * in order of preference, if we have any. We may always receive raw + * encoding, even if we don't specify it here. + */ + +typedef struct { + uint8_t type; /* always rfbSetEncodings */ + uint8_t pad; + uint16_t nEncodings; + /* followed by nEncodings * uint32_t encoding types */ +} rfbSetEncodingsMsg; + +#define sz_rfbSetEncodingsMsg 4 + + +/*----------------------------------------------------------------------------- + * FramebufferUpdateRequest - request for a framebuffer update. If incremental + * is true then the client just wants the changes since the last update. If + * false then it wants the whole of the specified rectangle. + */ + +typedef struct { + uint8_t type; /* always rfbFramebufferUpdateRequest */ + uint8_t incremental; + uint16_t x; + uint16_t y; + uint16_t w; + uint16_t h; +} rfbFramebufferUpdateRequestMsg; + +#define sz_rfbFramebufferUpdateRequestMsg 10 + + +/*----------------------------------------------------------------------------- + * KeyEvent - key press or release + * + * Keys are specified using the "keysym" values defined by the X Window System. + * For most ordinary keys, the keysym is the same as the corresponding ASCII + * value. Other common keys are: + * + * BackSpace 0xff08 + * Tab 0xff09 + * Return or Enter 0xff0d + * Escape 0xff1b + * Insert 0xff63 + * Delete 0xffff + * Home 0xff50 + * End 0xff57 + * Page Up 0xff55 + * Page Down 0xff56 + * Left 0xff51 + * Up 0xff52 + * Right 0xff53 + * Down 0xff54 + * F1 0xffbe + * F2 0xffbf + * ... ... + * F12 0xffc9 + * Shift 0xffe1 + * Control 0xffe3 + * Meta 0xffe7 + * Alt 0xffe9 + */ + +typedef struct { + uint8_t type; /* always rfbKeyEvent */ + uint8_t down; /* true if down (press), false if up */ + uint16_t pad; + uint32_t key; /* key is specified as an X keysym */ +} rfbKeyEventMsg; + +#define sz_rfbKeyEventMsg 8 + + +/*----------------------------------------------------------------------------- + * PointerEvent - mouse/pen move and/or button press. + */ + +typedef struct { + uint8_t type; /* always rfbPointerEvent */ + uint8_t buttonMask; /* bits 0-7 are buttons 1-8, 0=up, 1=down */ + uint16_t x; + uint16_t y; +} rfbPointerEventMsg; + +#define rfbButton1Mask 1 +#define rfbButton2Mask 2 +#define rfbButton3Mask 4 + +#define sz_rfbPointerEventMsg 6 + + + +/*----------------------------------------------------------------------------- + * ClientCutText - the client has new text in its cut buffer. + */ + +typedef struct { + uint8_t type; /* always rfbClientCutText */ + uint8_t pad1; + uint16_t pad2; + uint32_t length; + /* followed by char text[length] */ +} rfbClientCutTextMsg; + +#define sz_rfbClientCutTextMsg 8 + + + +/*----------------------------------------------------------------------------- + * Union of all client->server messages. + */ + +typedef union { + uint8_t type; + rfbSetPixelFormatMsg spf; + rfbFixColourMapEntriesMsg fcme; + rfbSetEncodingsMsg se; + rfbFramebufferUpdateRequestMsg fur; + rfbKeyEventMsg ke; + rfbPointerEventMsg pe; + rfbClientCutTextMsg cct; +} rfbClientToServerMsg; + +/* + * vncauth.h - describes the functions provided by the vncauth library. + */ + +#define MAXPWLEN 8 +#define CHALLENGESIZE 16 + +extern int rfbEncryptAndStorePasswd(char *passwd, char *fname); +extern char *rfbDecryptPasswdFromFile(char *fname); +extern void rfbRandomBytes(unsigned char *bytes); +extern void rfbEncryptBytes(unsigned char *bytes, char *passwd); + + +#endif diff --git a/src/win/mingw/include/rfb_mingw/rfbregion.h b/src/win/mingw/include/rfb_mingw/rfbregion.h new file mode 100644 index 0000000..8c07054 --- /dev/null +++ b/src/win/mingw/include/rfb_mingw/rfbregion.h @@ -0,0 +1,62 @@ +#ifndef SRAREGION_H +#define SRAREGION_H + +/* -=- SRA - Simple Region Algorithm + * A simple rectangular region implementation. + * Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin + */ + +/* -=- sraRect */ + +typedef struct _rect { + int x1; + int y1; + int x2; + int y2; +} sraRect; + +typedef struct sraRegion sraRegion; + +/* -=- Region manipulation functions */ + +extern sraRegion *sraRgnCreate(); +extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2); +extern sraRegion *sraRgnCreateRgn(const sraRegion *src); + +extern void sraRgnDestroy(sraRegion *rgn); +extern void sraRgnMakeEmpty(sraRegion *rgn); +extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src); +extern void sraRgnOr(sraRegion *dst, const sraRegion *src); +extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src); + +extern void sraRgnOffset(sraRegion *dst, int dx, int dy); + +extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect, + unsigned long flags); + +extern unsigned long sraRgnCountRects(const sraRegion *rgn); +extern rfbBool sraRgnEmpty(const sraRegion *rgn); + +extern sraRegion *sraRgnBBox(const sraRegion *src); + +/* -=- rectangle iterator */ + +typedef struct sraRectangleIterator { + rfbBool reverseX,reverseY; + int ptrSize,ptrPos; + struct sraSpan** sPtrs; +} sraRectangleIterator; + +extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s); +extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY); +extern rfbBool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r); +extern void sraRgnReleaseIterator(sraRectangleIterator *i); + +void sraRgnPrint(const sraRegion *s); + +/* -=- Rectangle clipper (for speed) */ + +extern rfbBool sraClipRect(int *x, int *y, int *w, int *h, + int cx, int cy, int cw, int ch); + +#endif diff --git a/src/win/msvc/Makefile.VC b/src/win/msvc/Makefile.VC index 9c73714..9518440 100644 --- a/src/win/msvc/Makefile.VC +++ b/src/win/msvc/Makefile.VC @@ -8,7 +8,7 @@ # # Makefile for Windows using Visual Studio 2015. # -# Version: @(#)Makefile.VC 1.0.32 2018/05/13 +# Version: @(#)Makefile.VC 1.0.34 2018/06/02 # # Author: Fred N. van Kempen, # @@ -55,6 +55,7 @@ ifndef EXTRAS EXTRAS := endif + # Defaults for several build options (possibly defined in a chained file.) ifndef AUTODEP AUTODEP := n @@ -207,6 +208,7 @@ endif ######################################################################### # Nothing should need changing from here on.. # ######################################################################### + VPATH := $(EXPATH) . cpu \ devices \ devices/cdrom devices/disk devices/floppy \ @@ -237,7 +239,7 @@ endif PREPROC := cl -nologo -EP MCPP := mcpp.exe LINK := link -nologo -WINDRES := rc -nologo -r +WINDRES := rc -nologo -r -d_MSC_VER SYSINC := -Iwin/msvc/Include -Iwin/mingw/include SYSLIB := @@ -318,9 +320,9 @@ else VCG := vid_voodoo_codegen_x86.h endif LIBS := ddraw.lib dinput8.lib dxguid.lib d3d9.lib d3dx9.lib \ - comctl32.lib winmm.lib comdlg32.lib advapi32.lib \ - gdi32.lib shell32.lib user32.lib kernel32.lib \ - wsock32.lib iphlpapi.lib psapi.lib + version.lib comctl32.lib winmm.lib comdlg32.lib \ + advapi32.lib gdi32.lib shell32.lib user32.lib \ + kernel32.lib wsock32.lib iphlpapi.lib psapi.lib ifeq ($(DEBUG), y) LIBS += libcmtd.lib libvcruntimed.lib libucrtd.lib endif @@ -414,7 +416,11 @@ endif # N=no, Y=yes,linked, D=yes,dynamic, S=yes,static ifneq ($(PNG), n) - OPTS += -DUSE_LIBPNG + ifeq ($(PNG), d) + OPTS += -DUSE_LIBPNG=2 + else + OPTS += -DUSE_LIBPNG=1 + endif RFLAGS += -DUSE_LIBPNG ifneq ($(PNG_PATH), ) OPTS += -I$(PNG_PATH)/include/msvc -I$(PNG_PATH)/include @@ -643,7 +649,7 @@ VIDOBJ := video.obj \ vid_voodoo.obj PLATOBJ := win.obj \ - win_dynld.obj win_thread.obj \ + win_lang.obj win_opendir.obj win_dynld.obj win_thread.obj \ win_cdrom.obj win_cdrom_ioctl.obj win_keyboard.obj \ win_mouse.obj win_joystick.obj win_midi.obj ifeq ($(CRASHDUMP), y) @@ -687,6 +693,18 @@ endif all: $(PREBUILD) $(PROG).exe pcap_if.exe $(POSTBUILD) +Mklang.cmd: + @echo @SET PATH=$(PATH) >Mklang.cmd + @echo @cd win\lang >>Mklang.cmd + @echo @$(MAKE) -fMakefile.VC "RFLAGS=$(RFLAGS) $(EXTRAS)" %%1% >>Mklang.cmd + @echo @cd ..\.. >>Mklang.cmd + + +lang: Mklang.cmd win/VARCem-common.rc + @echo Generating localizations.. + @Mklang.cmd all + @-del Mklang.cmd + VARCem.res: win/VARCem.rc win/VARCem.mpp @echo Generating Manifest file.. @del win\VARCem.manifest 2>NUL @@ -718,7 +736,7 @@ clean: @del *.obj 2>NUL @del *.res 2>NUL -clobber: clean +clobber: Mklang.cmd clean @echo Cleaning executables.. @del *.d 2>NUL @del *.exe 2>NUL @@ -730,6 +748,8 @@ ifeq ($(PROFILER), y) @del *.map 2>NUL endif @del win\*.manifest 2>NUL + @Mklang.cmd clobber + @-del Mklang.cmd # @del $(DEPFILE) 2>NUL ifneq ($(AUTODEP), y) diff --git a/src/win/msvc/vc14/VARCem.vcxproj b/src/win/msvc/vc14/VARCem.vcxproj index 4ec69c9..2f3cb36 100644 --- a/src/win/msvc/vc14/VARCem.vcxproj +++ b/src/win/msvc/vc14/VARCem.vcxproj @@ -20,10 +20,10 @@ - - - - + + + + @@ -42,8 +42,6 @@ - - @@ -319,10 +317,10 @@ - - - - + + + + @@ -391,177 +389,176 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -658,6 +655,7 @@ Windows Debug winmm.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;iphlpapi.lib;psapi.lib;Comctl32.lib;DInput8.lib;d3d9.lib;d3dx9.lib;ddraw.lib;dxguid.lib;%(AdditionalDependencies) + 5.01 $(ProjectDir)\..\..\..\..\src;%(AdditionalIncludeDirectories) @@ -677,6 +675,7 @@ Windows Debug winmm.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;iphlpapi.lib;psapi.lib;Comctl32.lib;DInput8.lib;d3d9.lib;d3dx9.lib;ddraw.lib;dxguid.lib;%(AdditionalDependencies) + 5.01 $(ProjectDir)\..\..\..\..\src;%(AdditionalIncludeDirectories) @@ -699,6 +698,7 @@ true Debug winmm.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;iphlpapi.lib;psapi.lib;Comctl32.lib;DInput8.lib;d3d9.lib;d3dx9.lib;ddraw.lib;dxguid.lib;%(AdditionalDependencies) + 5.01 $(ProjectDir)\..\..\..\..\src;%(AdditionalIncludeDirectories) @@ -722,6 +722,7 @@ true Debug winmm.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;iphlpapi.lib;psapi.lib;Comctl32.lib;DInput8.lib;d3d9.lib;d3dx9.lib;ddraw.lib;dxguid.lib;%(AdditionalDependencies) + 5.01 $(ProjectDir)\..\..\..\..\src;%(AdditionalIncludeDirectories) diff --git a/src/win/msvc/vc14/VARCem.vcxproj.filters b/src/win/msvc/vc14/VARCem.vcxproj.filters index 736dc77..22bc89c 100644 --- a/src/win/msvc/vc14/VARCem.vcxproj.filters +++ b/src/win/msvc/vc14/VARCem.vcxproj.filters @@ -92,12 +92,6 @@ cpu - - crcspeed - - - crcspeed - disk @@ -1077,12 +1071,6 @@ cpu - - crcspeed - - - crcspeed - disk @@ -1541,9 +1529,6 @@ {7a5514af-a83b-483a-bfac-af1e20215c22} - - {1e841add-1ce9-42dd-aaf8-c0ed686448a4} - {0eb40b0a-0704-4966-b094-dc23e7fb1224} diff --git a/src/win/pcap_if.rc b/src/win/pcap_if.rc index 6d83bb5..99aedad 100644 --- a/src/win/pcap_if.rc +++ b/src/win/pcap_if.rc @@ -10,7 +10,7 @@ * * NOTE: Will be moved to the tools/ folder soon. * - * Version: @(#)pcap_if.rc 1.0.3 2018/03/30 + * Version: @(#)pcap_if.rc 1.0.4 2018/05/28 * * Author: Fred N. van Kempen, * @@ -46,14 +46,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef _WIN32 #include -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 -100 ICON DISCARDABLE "win/icons/varcem.ico" +100 ICON DISCARDABLE "win/icons/varcem.ico" VS_VERSION_INFO VERSIONINFO @@ -85,6 +81,6 @@ BEGIN END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x0409, 1200 END END diff --git a/src/win/resource.h b/src/win/resource.h index 67d1ece..b26b190 100644 --- a/src/win/resource.h +++ b/src/win/resource.h @@ -8,7 +8,7 @@ * * Windows resource defines. * - * Version: @(#)resource.h 1.0.14 2018/05/03 + * Version: @(#)resource.h 1.0.16 2018/05/28 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -41,22 +41,23 @@ /* Dialog IDs. */ -#define DLG_ABOUT 101 /* top-level dialog */ -#define DLG_STATUS 102 /* top-level dialog */ -#define DLG_SND_GAIN 103 /* top-level dialog */ -#define DLG_NEW_FLOPPY 104 /* top-level dialog */ -#define DLG_CONFIG 110 /* top-level dialog */ -#define DLG_CFG_MACHINE 111 /* sub-dialog of config */ -#define DLG_CFG_VIDEO 112 /* sub-dialog of config */ -#define DLG_CFG_INPUT 113 /* sub-dialog of config */ -#define DLG_CFG_SOUND 114 /* sub-dialog of config */ -#define DLG_CFG_NETWORK 115 /* sub-dialog of config */ -#define DLG_CFG_PORTS 116 /* sub-dialog of config */ -#define DLG_CFG_PERIPHERALS 117 /* sub-dialog of config */ -#define DLG_CFG_DISK 118 /* sub-dialog of config */ -#define DLG_CFG_DISK_ADD 119 /* sub-dialog of config */ -#define DLG_CFG_FLOPPY 120 /* sub-dialog of config */ -#define DLG_CFG_RMV_DEVICES 121 /* sub-dialog of config */ +#define DLG_ABOUT 1000 /* top-level dialog */ +# define DLG_LOCALIZE 1001 +#define DLG_STATUS 1010 /* top-level dialog */ +#define DLG_SND_GAIN 1020 /* top-level dialog */ +#define DLG_NEW_FLOPPY 1030 /* top-level dialog */ +#define DLG_CONFIG 1040 /* top-level dialog */ +#define DLG_CFG_MACHINE 1041 /* sub-dialog of config */ +#define DLG_CFG_VIDEO 1042 /* sub-dialog of config */ +#define DLG_CFG_INPUT 1043 /* sub-dialog of config */ +#define DLG_CFG_SOUND 1044 /* sub-dialog of config */ +#define DLG_CFG_NETWORK 1045 /* sub-dialog of config */ +#define DLG_CFG_PORTS 1046 /* sub-dialog of config */ +#define DLG_CFG_PERIPHERALS 1047 /* sub-dialog of config */ +#define DLG_CFG_DISK 1048 /* sub-dialog of config */ +#define DLG_CFG_DISK_ADD 1049 /* sub-dialog of config */ +#define DLG_CFG_FLOPPY 1050 /* sub-dialog of config */ +#define DLG_CFG_RMV_DEVICES 1051 /* sub-dialog of config */ /* Static text label IDs. */ #define IDT_1700 1700 /* Language: */ @@ -110,11 +111,14 @@ #define IDT_1756 1756 /* Channel: */ #define IDT_1757 1757 /* Progress: */ #define IDT_1758 1758 /* ZIP drives: */ -#define IDT_TITLE 1759 /* "VARCem for Plaform" */ -#define IDT_VERSION 1760 /* "version.." */ #define IDT_1761 1761 /* Speed: */ #define IDT_1762 1762 /* ZIP drives: */ +#define IDT_TITLE 1790 /* "VARCem for Plaform" */ +#define IDT_VERSION 1791 /* "version.." */ +#define IDT_LOCALIZE 1795 /* "Localization done by.." */ + + /* * To try to keep these organized, we now group the * constants per dialog, as this allows easy adding @@ -123,10 +127,6 @@ #define IDC_SETTINGSCATLIST 1001 /* generic config */ #define IDC_CFILE 1002 /* Select File dialog */ #define IDC_CHECK_SYNC 1008 -/* Leave this as is until we finally get into localization in. */ -#if 0 -# define IDC_COMBO_LANG 1009 -#endif #define IDC_COMBO_MACHINE 1010 /* machine/cpu config */ #define IDC_CONFIGURE_MACHINE 1011 @@ -252,6 +252,9 @@ /* HELP menu. */ +#define IDC_LOCALIZE 1290 +#define IDC_DONATE 1291 +#define IDC_SUPPORT 1292 #define IDC_ABOUT_ICON 65535 diff --git a/src/win/win.c b/src/win/win.c index 0ab9789..41b346c 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -8,7 +8,7 @@ * * Platform main support module for Windows. * - * Version: @(#)win.c 1.0.13 2018/05/11 + * Version: @(#)win.c 1.0.16 2018/05/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -74,9 +74,6 @@ /* Platform Public data, specific. */ HINSTANCE hInstance; /* application instance */ -LCID lang_id; /* current language ID used */ -DWORD dwSubLangID; -const string_t *plat_strings; /* Local data. */ @@ -107,53 +104,6 @@ const vidapi_t *plat_vidapis[] = { }; -/* Pre-load the strings from our resource file. */ -static void -LoadCommonStrings(void) -{ - wchar_t temp[512], *str; - string_t *array, *tbl; - int c = 0, i; - - /* - * First, we need to know how many strings are in the table. - * Sadly, there is no other way to determine this but to try - * to load all possible ID's... - */ - for (i = IDS_BEGIN; i < IDS_END; i++) - if (LoadString(hInstance, i, temp, sizeof_w(temp)) > 0) c++; - - /* - * Now that we know how many strings exist, we can allocate - * our string_table array. - */ - i = (c + 1) * sizeof(string_t); - array = (string_t *)malloc(i); - memset(array, 0x00, i); - - /* Now load the actual strings into our string table. */ - tbl = array; - for (i = IDS_BEGIN; i < IDS_END; i++) { - c = LoadString(hInstance, i, temp, sizeof_w(temp)); - if (c == 0) continue; - - tbl->id = i; - str = (wchar_t *)malloc((c + 1) * sizeof(wchar_t)); - memset(str, 0x00, (c + 1) * sizeof(wchar_t)); - memcpy(str, temp, c * sizeof(wchar_t)); - tbl->str = str; - - tbl++; - } - - /* Terminate the table. */ - tbl->str = NULL; - - /* Consider this table const. */ - plat_strings = array; -} - - /* Process the commandline, and create standard argc/argv array. */ static int ProcessCommandLine(wchar_t ***argw) @@ -240,6 +190,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) /* We need this later. */ hInstance = hInst; + /* First, set our (default) language. */ + lang_id = (int)GetUserDefaultUILanguage(); + /* Initialize the version data. CrashDump needs it early. */ pc_version("Windows"); @@ -248,9 +201,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) InitCrashDump(); #endif - /* First, set our (default) language. */ - plat_set_language(0x0409); - /* Create console window. */ if (force_debug) plat_console(1); @@ -259,8 +209,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) argc = ProcessCommandLine(&argw); /* Pre-initialize the system, this loads the config file. */ - if (! pc_setup(argc, argw)) { - /* Detach from console. */ + if (pc_setup(argc, argw) <= 0) { + /* Error, detach from console and abort. */ plat_console(0); return(1); } @@ -269,6 +219,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) if (! force_debug) plat_console(0); + /* Set the active language for this application. */ + plat_set_language(lang_id); + /* Create a mutex for the video handler. */ hBlitMutex = CreateMutex(NULL, FALSE, MUTEX_NAME); @@ -318,29 +271,6 @@ plat_stop(void) } -/* Set (or re-set) the language for the application. */ -void -plat_set_language(int id) -{ - LCID lcidNew = MAKELCID(id, dwSubLangID); - - if (lang_id != lcidNew) { - /* Set our new language ID. */ - lang_id = lcidNew; - - SetThreadLocale(lang_id); - - /* Load the strings table for this ID. */ - LoadCommonStrings(); - -#if 0 - /* Update the menus for this ID. */ - MenuUpdate(); -#endif - } -} - - #ifndef USE_WX /* Create a console if we don't already have one. */ void @@ -448,7 +378,7 @@ plat_chdir(const wchar_t *path) FILE * -plat_fopen(const wchar_t *path, wchar_t *mode) +plat_fopen(const wchar_t *path, const wchar_t *mode) { return(_wfopen(path, mode)); } diff --git a/src/win/win.h b/src/win/win.h index ce87a7b..ef63e64 100644 --- a/src/win/win.h +++ b/src/win/win.h @@ -8,39 +8,49 @@ * * Platform support defintions for Win32. * - * Version: @(#)win.h 1.0.14 2018/05/10 + * Version: @(#)win.h 1.0.17 2018/05/28 * * Authors: Fred N. van Kempen, * Miran Grca, - * Sarah Walker, * * Copyright 2017,2018 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. - * Copyright 2008-2018 Sarah Walker. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the: + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. * - * Free Software Foundation, Inc. - * 59 Temple Place - Suite 330 - * Boston, MA 02111-1307 - * USA. + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PLAT_WIN_H # define PLAT_WIN_H -#include "resource.h" /* local resources */ +#include "resource.h" /* platform resources */ #include "../ui/ui_resource.h" /* common resources */ @@ -69,11 +79,24 @@ extern "C" { #endif +/* Define an in-memory language entry. */ +typedef struct _lang_ { + const wchar_t *name; + const wchar_t *dll; + + const wchar_t *author; + const wchar_t *email; + const wchar_t *version; + + int id; + struct _lang_ *next; +} lang_t; + + extern HINSTANCE hInstance; extern HICON hIcon[512]; extern HWND hwndMain, hwndRender; -extern LCID lang_id; extern DWORD filterindex; extern int status_is_open; @@ -81,6 +104,9 @@ extern int status_is_open; extern const vidapi_t ddraw_vidapi; extern const vidapi_t d3d_vidapi; +/* Languages. */ +extern lang_t *languages; + /* Internal platform support functions. */ #ifdef USE_CRASHDUMP @@ -101,14 +127,11 @@ extern uint8_t dlg_devconf(HWND hwnd, device_t *device); #endif extern uint8_t dlg_jsconf(HWND hwnd, int joy_nr, int type); -/* Platform support functions. */ -extern void plat_set_language(int id); -extern int fdd_type_icon(int type); - /* Platform UI support functions. */ extern int ui_init(int nCmdShow); -extern void ui_menu_update(void); extern void plat_set_input(HWND h); +extern HMODULE plat_lang_dll(void); +extern void plat_lang_menu(void); #ifdef __cplusplus } diff --git a/src/win/win_about.c b/src/win/win_about.c index 8e302f8..0887867 100644 --- a/src/win/win_about.c +++ b/src/win/win_about.c @@ -8,7 +8,11 @@ * * Handle the About dialog. * - * Version: @(#)win_about.c 1.0.7 2018/05/02 + * NOTE: Not quite happy with the Donate button workings, a full + * 24bit image would be preferred, but we cant use LoadImage + * for those (and keep transparency...) + * + * Version: @(#)win_about.c 1.0.9 2018/06/02 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -34,8 +38,11 @@ * Boston, MA 02111-1307 * USA. */ +#define UNICODE #define WIN32_LEAN_AND_MEAN #include +#include +#include #include #include #include @@ -48,6 +55,15 @@ #include "win.h" +static void +donate_handle(HWND hdlg) +{ + pclog("UI: DONATE button clicked, opening browser to PayPal\n"); + + ShellExecute(NULL, L"open", URL_PAYPAL, NULL, NULL , SW_SHOW); +} + + static void set_font_bold(HWND hdlg, int item) { @@ -73,31 +89,54 @@ set_font_bold(HWND hdlg, int item) } +static void +localize_disp(HWND hdlg, int idx) +{ + WCHAR temp[128]; + lang_t *lang; + HWND h; + + /* Get the correct language for this index. */ + h = GetDlgItem(hdlg, IDC_LOCALIZE); + lang = (lang_t *)SendMessage(h, LB_GETITEMDATA, idx, 0); + + SetDlgItemText(hdlg, IDT_LOCALIZE+1, lang->version); + + swprintf(temp, sizeof_w(temp), L"%ls, <%ls>", lang->author, lang->email); + SetDlgItemText(hdlg, IDT_LOCALIZE+2, temp); +} + + #ifdef __amd64__ static LRESULT CALLBACK #else static BOOL CALLBACK #endif -dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) +localize_dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { - char temp[128]; + HBITMAP hBmp; + lang_t *lang; HWND h; + int c; switch (message) { case WM_INITDIALOG: /* Center in the main window. */ dialog_center(hdlg); + /* Load the main icon. */ + hBmp = LoadImage(hInstance,(PCTSTR)100, IMAGE_ICON, 64, 64, 0); h = GetDlgItem(hdlg, IDC_ABOUT_ICON); - SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON, - (LPARAM)LoadImage(hInstance,(PCTSTR)100,IMAGE_ICON,64,64,0)); - SendDlgItemMessage(hdlg, IDT_TITLE, WM_SETTEXT, - (WPARAM)NULL, (LPARAM)emu_title); - set_font_bold(hdlg, IDT_TITLE); + SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hBmp); - sprintf(temp, "%s", emu_fullversion); - SendDlgItemMessage(hdlg, IDT_VERSION, WM_SETTEXT, - (WPARAM)NULL, (LPARAM)temp); + /* Add the languages. */ + h = GetDlgItem(hdlg, IDC_LOCALIZE); + for (lang = languages->next; lang != NULL; lang = lang->next) { + c = SendMessage(h, LB_ADDSTRING, 0, (LPARAM)lang->name); + SendMessage(h, LB_SETITEMDATA, c, (LPARAM)lang); + } + SendMessage(h, LB_SETCURSEL, (WPARAM)0, (LPARAM)0); + localize_disp(hdlg, 0); break; case WM_COMMAND: @@ -106,6 +145,17 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) EndDialog(hdlg, 0); return TRUE; + case IDC_LOCALIZE: + switch (HIWORD(wParam)) { + case LBN_SELCHANGE: + h = GetDlgItem(hdlg, IDC_LOCALIZE); + c = (int)SendMessage(h, LB_GETCURSEL, 0, 0); + localize_disp(hdlg, c); + + return TRUE; + } + return TRUE; + default: break; } @@ -116,12 +166,104 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } +#ifdef __amd64__ +static LRESULT CALLBACK +#else +static BOOL CALLBACK +#endif +dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + wchar_t temp[128]; +static HBITMAP hBmp; + HWND h; + + switch (message) { + case WM_INITDIALOG: + /* Center in the main window. */ + dialog_center(hdlg); + + hBmp = LoadImage(hInstance, + MAKEINTRESOURCE(100), IMAGE_ICON, 64, 64, 0); + h = GetDlgItem(hdlg, IDC_ABOUT_ICON); + SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hBmp); + mbstowcs(temp, emu_title, sizeof_w(temp)); + SendDlgItemMessage(hdlg, IDT_TITLE, WM_SETTEXT, + (WPARAM)NULL, (LPARAM)temp); + set_font_bold(hdlg, IDT_TITLE); + + mbstowcs(temp, emu_fullversion, sizeof_w(temp)); + SendDlgItemMessage(hdlg, IDT_VERSION, WM_SETTEXT, + (WPARAM)NULL, (LPARAM)temp); + + /* Load the Paypal Donate icon. */ + h = GetDlgItem(hdlg, IDC_DONATE); +#if 1 + hBmp = LoadImage(hInstance, MAKEINTRESOURCE(101), + IMAGE_BITMAP, 105, 50, + LR_LOADTRANSPARENT|LR_LOADMAP3DCOLORS); + SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp); +#else + hBmp = LoadImage(hInstance, + MAKEINTRESOURCE(101), IMAGE_ICON, 128, 128, 0); + SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hBmp); +#endif + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + EndDialog(hdlg, 0); + return TRUE; + + case IDC_LOCALIZE: + DialogBox(plat_lang_dll(), + (LPCTSTR)DLG_LOCALIZE, + hdlg, localize_dlg_proc); + break; + + default: + switch (HIWORD(wParam)) { + case STN_CLICKED: + if ((HWND)lParam == GetDlgItem(hdlg, IDC_DONATE)) { + donate_handle(hdlg); + return TRUE; + } + break; + + default: + break; + } + break; + } + break; + + case WM_CTLCOLORSTATIC: + if ((HWND)lParam == GetDlgItem(hdlg, IDC_DONATE)) { + HDC hDC = GetDC(hdlg); + COLORREF col = GetBkColor(hDC); + + hDC = (HDC)wParam; + SetBkColor(hDC, col); + +#if 1 + return (LRESULT)CreateSolidBrush(col); +#else + return (LRESULT)CreateSolidBrush(RGB(0,255,0)); +#endif + } + return FALSE; + } + + return(FALSE); +} + + void dlg_about(void) { plat_pause(1); - DialogBox(hInstance, (LPCTSTR)DLG_ABOUT, hwndMain, dlg_proc); + DialogBox(plat_lang_dll(), (LPCTSTR)DLG_ABOUT, hwndMain, dlg_proc); plat_pause(0); } diff --git a/src/win/win_ddraw.cpp b/src/win/win_ddraw.cpp index cbbca21..a6f0bd3 100644 --- a/src/win/win_ddraw.cpp +++ b/src/win/win_ddraw.cpp @@ -8,7 +8,15 @@ * * Rendering module for Microsoft DirectDraw 9. * - * Version: @(#)win_ddraw.cpp 1.0.10 2018/05/13 + * NOTES: This code should be re-merged into a single init() with a + * 'fullscreen' argument, indicating FS mode is requested. + * + * If configured with USE_LIBPNG, we try to load the external + * PNG library and use that if found. Otherwise, we fall back + * the original mode, which uses the Windows/DDraw built-in BMP + * format. + * + * Version: @(#)win_ddraw.cpp 1.0.13 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -56,127 +64,87 @@ #include "win.h" -static LPDIRECTDRAW lpdd = NULL; -static LPDIRECTDRAW4 lpdd4 = NULL; -static LPDIRECTDRAWSURFACE4 dds_pri = NULL, - dds_back = NULL, - dds_back2 = NULL; -static LPDIRECTDRAWCLIPPER lpdd_clipper = NULL; -static DDSURFACEDESC2 ddsd; -static HWND ddraw_hwnd; -static HBITMAP hbitmap; -static int ddraw_w, ddraw_h, - xs, ys, ys2; #ifdef USE_LIBPNG -static png_structp png_ptr; -static png_infop png_info_ptr; +# define PATH_PNG_DLL "libpng16.dll" #endif -static const char * -GetError(HRESULT hr) -{ - const char *err = "Unknown"; - - switch(hr) { - case DDERR_INCOMPATIBLEPRIMARY: - err = "Incompatible Primary"; - break; - - case DDERR_INVALIDCAPS: - err = "Invalid Caps"; - break; - - case DDERR_INVALIDOBJECT: - err = "Invalid Object"; - break; - - case DDERR_INVALIDPARAMS: - err = "Invalid Parameters"; - break; - - case DDERR_INVALIDPIXELFORMAT: - err = "Invalid Pixel Format"; - break; - - case DDERR_NOALPHAHW: - err = "Hardware does not support Alpha"; - break; - - case DDERR_NOCOOPERATIVELEVELSET: - err = "No cooperative level set"; - break; - - case DDERR_NODIRECTDRAWHW: - err = "Hardware does not support DirectDraw"; - break; - - case DDERR_NOEMULATION: - err = "No emulation"; - break; - - case DDERR_NOEXCLUSIVEMODE: - err = "No exclusive mode available"; - break; - - case DDERR_NOFLIPHW: - err = "Hardware does not support flipping"; - break; - - case DDERR_NOMIPMAPHW: - err = "Hardware does not support MipMap"; - break; - - case DDERR_NOOVERLAYHW: - err = "Hardware does not support overlays"; - break; - - case DDERR_NOZBUFFERHW: - err = "Hardware does not support Z buffers"; - break; - - case DDERR_OUTOFMEMORY: - err = "Out of memory"; - break; - - case DDERR_OUTOFVIDEOMEMORY: - err = "Out of video memory"; - break; - - case DDERR_PRIMARYSURFACEALREADYEXISTS: - err = "Primary Surface already exists"; - break; - - case DDERR_UNSUPPORTEDMODE: - err = "Mode not supported"; - break; - - default: - break; - } - - return(err); -} +static LPDIRECTDRAW4 lpdd4 = NULL; +static LPDIRECTDRAWSURFACE4 lpdds_pri = NULL, + lpdds_back = NULL, + lpdds_back2 = NULL; +static LPDIRECTDRAWCLIPPER lpdd_clipper = NULL; +static HWND ddraw_hwnd; +static int ddraw_w, ddraw_h, + xs, ys, ys2; +#ifdef USE_LIBPNG +static void *png_handle = NULL; /* handle to DLL */ +# if USE_LIBPNG == 1 +# define PNGFUNC(x) png_ ## x +# else +# define PNGFUNC(x) PNG_ ## x -static void +/* Pointers to the real functions. */ +extern "C" { +png_structp (*PNG_create_write_struct)(png_const_charp user_png_ver, + png_voidp error_ptr, + png_error_ptr error_fn, + png_error_ptr warn_fn); +png_infop (*PNG_create_info_struct)(png_const_structrp png_ptr); +void (*PNG_init_io)(png_structrp png_ptr, png_FILE_p fp); +void (*PNG_set_IHDR)(png_const_structrp png_ptr, + png_inforp info_ptr, png_uint_32 width, + png_uint_32 height, int bit_depth, + int color_type, int interlace_method, + int compression_method, + int filter_method); +png_size_t (*PNG_get_rowbytes)(png_const_structrp png_ptr, + png_const_inforp info_ptr); +void (*PNG_write_info)(png_structrp png_ptr, + png_const_inforp info_ptr); +void (*PNG_write_image)(png_structrp png_ptr, + png_bytepp image); +void (*PNG_write_end)(png_structrp png_ptr, + png_inforp info_ptr); +}; + + +static const dllimp_t png_imports[] = { + { "png_create_write_struct", &PNG_create_write_struct }, + { "png_create_info_struct", &PNG_create_info_struct }, + { "png_init_io", &PNG_init_io }, + { "png_set_IHDR", &PNG_set_IHDR }, + { "png_get_rowbytes", &PNG_get_rowbytes }, + { "png_write_info", &PNG_write_info }, + { "png_write_image", &PNG_write_image }, + { "png_write_end", &PNG_write_end }, + { NULL, NULL } +}; +# endif +#endif + + +static HBITMAP CopySurface(IDirectDrawSurface4 *pDDSurface) { + HBITMAP hbmp, hbmprev; + DDSURFACEDESC2 ddsd; HDC hdc, hmemdc; - HBITMAP hprevbitmap; - DDSURFACEDESC2 ddsd2; pDDSurface->GetDC(&hdc); hmemdc = CreateCompatibleDC(hdc); - ZeroMemory(&ddsd2, sizeof(ddsd2)); - ddsd2.dwSize = sizeof(ddsd2); - pDDSurface->GetSurfaceDesc(&ddsd2); - hbitmap = CreateCompatibleBitmap(hdc, xs, ys); - hprevbitmap = (HBITMAP)SelectObject(hmemdc, hbitmap); + ZeroMemory(&ddsd, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + pDDSurface->GetSurfaceDesc(&ddsd); + hbmp = CreateCompatibleBitmap(hdc, xs, ys); + hbmprev = (HBITMAP)SelectObject(hmemdc, hbmp); BitBlt(hmemdc, 0, 0, xs, ys, hdc, 0, 0, SRCCOPY); - SelectObject(hmemdc, hprevbitmap); + SelectObject(hmemdc, hbmprev); DeleteDC(hmemdc); pDDSurface->ReleaseDC(hdc); + + return(hbmp); } @@ -196,8 +164,8 @@ DoubleLines(uint8_t *dst, uint8_t *src) static void bgra_to_rgb(png_bytep *b_rgb, uint8_t *bgra, int width, int height) { - uint8_t *r, *b; int i, j; + uint8_t *r, *b; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { @@ -211,15 +179,33 @@ bgra_to_rgb(png_bytep *b_rgb, uint8_t *bgra, int width, int height) } +/* Not strictly needed, but hey.. */ +static void +png_error_handler(UNUSED(png_structp arg), const char *str) +{ + pclog("DDraw: PNG error '%s'\n", str); +} + + +/* Not strictly needed, but hey.. */ +static void +png_warning_handler(UNUSED(png_structp arg), const char *str) +{ + pclog("DDraw: PNG warning '%s'\n", str); +} + + static void SavePNG(const wchar_t *fn, HBITMAP hBitmap) { - WCHAR temp[512]; + wchar_t temp[512]; BITMAPINFO bmpInfo; HDC hdc; LPVOID pBuf = NULL; LPVOID pBuf2 = NULL; png_bytep *b_rgb = NULL; + png_infop info_ptr; + png_structp png_ptr; FILE *fp; int i; @@ -227,31 +213,33 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) fp = plat_fopen(fn, L"wb"); if (fp == NULL) { pclog("[SavePNG] File %ls could not be opened for writing!\n", fn); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } /* Initialize PNG stuff. */ - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_ptr = PNGFUNC(create_write_struct)(PNG_LIBPNG_VER_STRING, NULL, + png_error_handler, png_warning_handler); if (png_ptr == NULL) { (void)fclose(fp); pclog("[SavePNG] png_create_write_struct failed!\n"); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } - png_info_ptr = png_create_info_struct(png_ptr); - if (png_info_ptr == NULL) { + info_ptr = PNGFUNC(create_info_struct)(png_ptr); + if (info_ptr == NULL) { +// PNGFUNC(destroy_write_struct)(&png_ptr, NULL, NULL); (void)fclose(fp); pclog("[SavePNG] png_create_info_struct failed!\n"); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } - png_init_io(png_ptr, fp); + PNGFUNC(init_io)(png_ptr, fp); hdc = GetDC(NULL); @@ -264,9 +252,10 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) bmpInfo.bmiHeader.biWidth*abs(bmpInfo.bmiHeader.biHeight)*(bmpInfo.bmiHeader.biBitCount+7)/8; if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) { +// PNGFUNC(destroy_write_struct)(&png_ptr, &info_ptr, NULL); (void)fclose(fp); pclog("[SavePNG] Unable to allocate bitmap memory!\n"); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -275,18 +264,18 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) bmpInfo.bmiHeader.biSizeImage <<= 1; if ((pBuf2 = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) { +// PNGFUNC(destroy_write_struct)(&png_ptr, &info_ptr, NULL); (void)fclose(fp); free(pBuf); pclog("[SavePNG] Unable to allocate secondary bitmap memory!\n"); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } bmpInfo.bmiHeader.biHeight <<= 1; } - -#if 0 +#if 1 pclog("save png w=%i h=%i\n", bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight); #endif @@ -296,24 +285,25 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS); - png_set_IHDR(png_ptr, png_info_ptr, - bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight, - 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + PNGFUNC(set_IHDR)(png_ptr, info_ptr, + bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight, + 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); b_rgb = (png_bytep *)malloc(sizeof(png_bytep)*bmpInfo.bmiHeader.biHeight); if (b_rgb == NULL) { +// PNGFUNC(destroy_write_struct)(&png_ptr, NULL, NULL); (void)fclose(fp); free(pBuf); free(pBuf2); pclog("[SavePNG] Unable to allocate RGB bitmap memory!\n"); - _swprintf(temp, get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); ui_msgbox(MBX_ERROR, temp); return; } for (i = 0; i < bmpInfo.bmiHeader.biHeight; i++) - b_rgb[i] = (png_byte *)malloc(png_get_rowbytes(png_ptr, png_info_ptr)); + b_rgb[i] = (png_byte *)malloc(PNGFUNC(get_rowbytes)(png_ptr, info_ptr)); if (pBuf2) { DoubleLines((uint8_t *)pBuf2, (uint8_t *)pBuf); @@ -323,31 +313,33 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) bgra_to_rgb(b_rgb, (uint8_t *)pBuf, bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight); - png_write_info(png_ptr, png_info_ptr); + PNGFUNC(write_info)(png_ptr, info_ptr); - png_write_image(png_ptr, b_rgb); + PNGFUNC(write_image)(png_ptr, b_rgb); - png_write_end(png_ptr, NULL); + PNGFUNC(write_end)(png_ptr, NULL); /* Clean up. */ - if (hdc) ReleaseDC(NULL,hdc); + if (fp != NULL) fclose(fp); +// PNGFUNC(destroy_write_struct)(&png_ptr, &info_ptr, NULL); + if (hdc) ReleaseDC(NULL, hdc); - if (b_rgb) { + if (b_rgb != NULL) { for (i = 0; i < bmpInfo.bmiHeader.biHeight; i++) free(b_rgb[i]); free(b_rgb); } - if (pBuf) free(pBuf); - if (pBuf2) free(pBuf2); - - if (fp != NULL) fclose(fp); + if (pBuf != NULL) free(pBuf); + if (pBuf2 != NULL) free(pBuf2); } -#else +#endif + + static void SaveBMP(const wchar_t *fn, HBITMAP hBitmap) { - WCHAR temp[512]; + wchar_t temp[512]; BITMAPFILEHEADER bmpFileHeader; BITMAPINFO bmpInfo; HDC hdc; @@ -355,69 +347,64 @@ SaveBMP(const wchar_t *fn, HBITMAP hBitmap) LPVOID pBuf = NULL; LPVOID pBuf2 = NULL; - do { - hdc = GetDC(NULL); + hdc = GetDC(NULL); - ZeroMemory(&bmpInfo, sizeof(BITMAPINFO)); - bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + ZeroMemory(&bmpInfo, sizeof(BITMAPINFO)); + bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - GetDIBits(hdc, hBitmap, 0, 0, NULL, &bmpInfo, DIB_RGB_COLORS); + GetDIBits(hdc, hBitmap, 0, 0, NULL, &bmpInfo, DIB_RGB_COLORS); - if (bmpInfo.bmiHeader.biSizeImage <= 0) - bmpInfo.bmiHeader.biSizeImage = - bmpInfo.bmiHeader.biWidth*abs(bmpInfo.bmiHeader.biHeight)*(bmpInfo.bmiHeader.biBitCount+7)/8; + if (bmpInfo.bmiHeader.biSizeImage <= 0) + bmpInfo.bmiHeader.biSizeImage = + bmpInfo.bmiHeader.biWidth*abs(bmpInfo.bmiHeader.biHeight)*(bmpInfo.bmiHeader.biBitCount+7)/8; - if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) { -// pclog("ERROR: Unable to Allocate Bitmap Memory"); - break; - } + if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) { + pclog("[SaveBMP] Unable to allocate bitmap memory!\n"); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); + ui_msgbox(MBX_ERROR, temp); + return; + } - if (ys2 <= 250) - pBuf2 = malloc(bmpInfo.bmiHeader.biSizeImage * 2); + if (ys2 <= 250) + pBuf2 = malloc(bmpInfo.bmiHeader.biSizeImage * 2); - bmpInfo.bmiHeader.biCompression = BI_RGB; + bmpInfo.bmiHeader.biCompression = BI_RGB; - GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS); + GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, + pBuf, &bmpInfo, DIB_RGB_COLORS); - if ((fp = _wfopen(fn, L"wb")) == NULL) { - pclog("[SaveBMP] File %ls could not be opened for writing!\n", fn); - _swprintf(temp, get_string(IDS_2088), fn); - ui_msgbox(MBX_ERROR, temp); - break; - } + if ((fp = plat_fopen(fn, L"wb")) == NULL) { + pclog("[SaveBMP] File %ls could not be opened for writing!\n", fn); + _swprintf(temp, get_string(IDS_ERR_SCRSHOT), fn); + ui_msgbox(MBX_ERROR, temp); + return; + } - bmpFileHeader.bfReserved1 = 0; - bmpFileHeader.bfReserved2 = 0; - if (pBuf2) { - bmpInfo.bmiHeader.biSizeImage <<= 1; - bmpInfo.bmiHeader.biHeight <<= 1; - } - bmpFileHeader.bfSize = sizeof(BITMAPFILEHEADER) + - sizeof(BITMAPINFOHEADER) + - bmpInfo.bmiHeader.biSizeImage; - bmpFileHeader.bfType = 0x4D42; - bmpFileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + - sizeof(BITMAPINFOHEADER); + bmpFileHeader.bfReserved1 = 0; + bmpFileHeader.bfReserved2 = 0; + if (pBuf2) { + bmpInfo.bmiHeader.biSizeImage <<= 1; + bmpInfo.bmiHeader.biHeight <<= 1; + } + bmpFileHeader.bfSize=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+bmpInfo.bmiHeader.biSizeImage; + bmpFileHeader.bfType=0x4D42; + bmpFileHeader.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); - (void)fwrite(&bmpFileHeader, sizeof(BITMAPFILEHEADER), 1, fp); - (void)fwrite(&bmpInfo.bmiHeader, sizeof(BITMAPINFOHEADER), 1, fp); - if (pBuf2) { - DoubleLines((uint8_t *)pBuf2, (uint8_t *)pBuf); - (void)fwrite(pBuf2, bmpInfo.bmiHeader.biSizeImage, 1, fp); - } else { - (void)fwrite(pBuf, bmpInfo.bmiHeader.biSizeImage, 1, fp); - } - } while(false); + (void)fwrite(&bmpFileHeader,sizeof(BITMAPFILEHEADER),1,fp); + (void)fwrite(&bmpInfo.bmiHeader,sizeof(BITMAPINFOHEADER),1,fp); + if (pBuf2) { + DoubleLines((uint8_t *) pBuf2, (uint8_t *) pBuf); + (void)fwrite(pBuf2,bmpInfo.bmiHeader.biSizeImage,1,fp); + } else { + (void)fwrite(pBuf,bmpInfo.bmiHeader.biSizeImage,1,fp); + } - if (hdc) ReleaseDC(NULL, hdc); - - if (pBuf2) free(pBuf2); - - if (pBuf) free(pBuf); - - if (fp) fclose(fp); + /* Clean up. */ + if (fp != NULL) fclose(fp); + if (hdc != NULL) ReleaseDC(NULL, hdc); + if (pBuf2 != NULL) free(pBuf2); + if (pBuf != NULL) free(pBuf); } -#endif static void @@ -436,8 +423,6 @@ ddraw_fs_size(RECT w_rect, RECT *r_dest, int w, int h) int ratio_w, ratio_h; double hsr, gsr, ra, d; - pclog("vid_fullscreen_scale = %i\n", vid_fullscreen_scale); - switch (vid_fullscreen_scale) { case FULLSCR_SCALE_FULL: ddraw_fs_size_default(w_rect, r_dest); @@ -518,13 +503,13 @@ ddraw_fs_size(RECT w_rect, RECT *r_dest, int w, int h) static void ddraw_blit_fs(int x, int y, int y1, int y2, int w, int h) { - RECT r_src, r_dest; - RECT w_rect; + DDSURFACEDESC2 ddsd; + RECT r_src, r_dest, w_rect; DDBLTFX ddbltfx; HRESULT hr; int yy; - if (dds_back == NULL) { + if (lpdds_back == NULL) { video_blit_complete(); return; /*Nothing to do*/ } @@ -537,11 +522,11 @@ ddraw_blit_fs(int x, int y, int y1, int y2, int w, int h) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - hr = dds_back->Lock(NULL, &ddsd, + hr = lpdds_back->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); if (hr == DDERR_SURFACELOST) { - dds_back->Restore(); - dds_back->Lock(NULL, &ddsd, + lpdds_back->Restore(); + lpdds_back->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); device_force_redraw(); } @@ -553,7 +538,7 @@ ddraw_blit_fs(int x, int y, int y1, int y2, int w, int h) for (yy = y1; yy < y2; yy++) if (buffer32) memcpy((void *)((uintptr_t)ddsd.lpSurface + (yy * ddsd.lPitch)), &(((uint32_t *)buffer32->line[y + yy])[x]), w * 4); video_blit_complete(); - dds_back->Unlock(NULL); + lpdds_back->Unlock(NULL); w_rect.left = 0; w_rect.top = 0; @@ -569,19 +554,19 @@ ddraw_blit_fs(int x, int y, int y1, int y2, int w, int h) ddbltfx.dwSize = sizeof(ddbltfx); ddbltfx.dwFillColor = 0; - dds_back2->Blt(&w_rect, NULL, NULL, + lpdds_back2->Blt(&w_rect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx); - hr = dds_back2->Blt(&r_dest, dds_back, &r_src, DDBLT_WAIT, NULL); + hr = lpdds_back2->Blt(&r_dest, lpdds_back, &r_src, DDBLT_WAIT, NULL); if (hr == DDERR_SURFACELOST) { - dds_back2->Restore(); - dds_back2->Blt(&r_dest, dds_back, &r_src, DDBLT_WAIT, NULL); + lpdds_back2->Restore(); + lpdds_back2->Blt(&r_dest, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - hr = dds_pri->Flip(NULL, DDFLIP_NOVSYNC); + hr = lpdds_pri->Flip(NULL, DDFLIP_NOVSYNC); if (hr == DDERR_SURFACELOST) { - dds_pri->Restore(); - dds_pri->Flip(NULL, DDFLIP_NOVSYNC); + lpdds_pri->Restore(); + lpdds_pri->Flip(NULL, DDFLIP_NOVSYNC); } } @@ -589,12 +574,13 @@ ddraw_blit_fs(int x, int y, int y1, int y2, int w, int h) static void ddraw_blit(int x, int y, int y1, int y2, int w, int h) { + DDSURFACEDESC2 ddsd; RECT r_src, r_dest; - POINT po; HRESULT hr; + POINT po; int yy; - if (dds_back == NULL) { + if (lpdds_back == NULL) { video_blit_complete(); return; /*Nothing to do*/ } @@ -607,11 +593,11 @@ ddraw_blit(int x, int y, int y1, int y2, int w, int h) memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - hr = dds_back->Lock(NULL, &ddsd, + hr = lpdds_back->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); if (hr == DDERR_SURFACELOST) { - dds_back->Restore(); - dds_back->Lock(NULL, &ddsd, + lpdds_back->Restore(); + lpdds_back->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); device_force_redraw(); } @@ -627,7 +613,7 @@ ddraw_blit(int x, int y, int y1, int y2, int w, int h) memcpy((uint32_t *) &(((uint8_t *) ddsd.lpSurface)[yy * ddsd.lPitch]), &(((uint32_t *)buffer32->line[y + yy])[x]), w * 4); } video_blit_complete(); - dds_back->Unlock(NULL); + lpdds_back->Unlock(NULL); po.x = po.y = 0; @@ -640,18 +626,18 @@ ddraw_blit(int x, int y, int y1, int y2, int w, int h) r_src.right = w; r_src.bottom = h; - hr = dds_back2->Blt(&r_src, dds_back, &r_src, DDBLT_WAIT, NULL); + hr = lpdds_back2->Blt(&r_src, lpdds_back, &r_src, DDBLT_WAIT, NULL); if (hr == DDERR_SURFACELOST) { - dds_back2->Restore(); - dds_back2->Blt(&r_src, dds_back, &r_src, DDBLT_WAIT, NULL); + lpdds_back2->Restore(); + lpdds_back2->Blt(&r_src, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - dds_back2->Unlock(NULL); + lpdds_back2->Unlock(NULL); - hr = dds_pri->Blt(&r_dest, dds_back2, &r_src, DDBLT_WAIT, NULL); + hr = lpdds_pri->Blt(&r_dest, lpdds_back2, &r_src, DDBLT_WAIT, NULL); if (hr == DDERR_SURFACELOST) { - dds_pri->Restore(); - dds_pri->Blt(&r_dest, dds_back2, &r_src, DDBLT_WAIT, NULL); + lpdds_pri->Restore(); + lpdds_pri->Blt(&r_dest, lpdds_back2, &r_src, DDBLT_WAIT, NULL); } } @@ -659,36 +645,257 @@ ddraw_blit(int x, int y, int y1, int y2, int w, int h) static void ddraw_close(void) { - pclog("DDRAW: close (fs=%d)\n", (dds_back2 != NULL)?1:0); + pclog("DDRAW: close (fs=%d)\n", (lpdds_back2 != NULL)?1:0); video_setblit(NULL); - if (dds_back2 != NULL) { - dds_back2->Release(); - dds_back2 = NULL; + if (lpdds_back2) { + lpdds_back2->Release(); + lpdds_back2 = NULL; } - if (dds_back != NULL) { - dds_back->Release(); - dds_back = NULL; + if (lpdds_back) { + lpdds_back->Release(); + lpdds_back = NULL; } - if (dds_pri != NULL) { - dds_pri->Release(); - dds_pri = NULL; + if (lpdds_pri) { + lpdds_pri->Release(); + lpdds_pri = NULL; } - if (lpdd_clipper != NULL) { + if (lpdd_clipper) { lpdd_clipper->Release(); lpdd_clipper = NULL; } - if (lpdd4 != NULL) { + if (lpdd4) { lpdd4->Release(); lpdd4 = NULL; } + +#if defined(USE_LIBPNG) && USE_LIBPNG == 2 + /* Unload the DLL if possible. */ + if (png_handle != NULL) { + dynld_close(png_handle); + png_handle = NULL; + } +#endif } +#if 0 +int +ddraw_init_fs(HWND h) +{ + ddraw_w = GetSystemMetrics(SM_CXSCREEN); + ddraw_h = GetSystemMetrics(SM_CYSCREEN); + + cgapal_rebuild(); + + if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) return 0; + + if (FAILED(lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *)&lpdd4))) return 0; + + lpdd->Release(); + lpdd = NULL; + + atexit(ddraw_close); + + if (FAILED(lpdd4->SetCooperativeLevel(h, + DDSCL_SETFOCUSWINDOW | \ + DDSCL_CREATEDEVICEWINDOW | \ + DDSCL_EXCLUSIVE | \ + DDSCL_FULLSCREEN | \ + DDSCL_ALLOWREBOOT))) return 0; + + if (FAILED(lpdd4->SetDisplayMode(ddraw_w, ddraw_h, 32, 0 ,0))) return 0; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; + ddsd.dwBackBufferCount = 1; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_pri, NULL))) return 0; + + ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; + if (FAILED(lpdds_pri->GetAttachedSurface(&ddsd.ddsCaps, &lpdds_back2))) return 0; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL))) { + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL))) return 0; + } + + ddraw_hwnd = h; + + video_setblit(ddraw_blit_fs); + + return(1); +} +#endif + + static int ddraw_init(int fs) { + DDSURFACEDESC2 ddsd; + LPDIRECTDRAW lpdd; + HWND h = hwndRender; + + pclog("DDraw: initializing (fs=%d)\n", fs); + + cgapal_rebuild(); + + if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) return(0); + + if (FAILED(lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *)&lpdd4))) + return(0); + lpdd->Release(); + + atexit(ddraw_close); + + if (FAILED(lpdd4->SetCooperativeLevel(h, DDSCL_NORMAL))) return(0); + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_pri, NULL))) return(0); + + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL))) { + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL))) + fatal("CreateSurface back failed\n"); + } + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back2, NULL))) { + ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 2048; + ddsd.dwHeight = 2048; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + if (FAILED(lpdd4->CreateSurface(&ddsd, &lpdds_back2, NULL))) + fatal("CreateSurface back failed\n"); + } + + if (FAILED(lpdd4->CreateClipper(0, &lpdd_clipper, NULL))) return(0); + + if (FAILED(lpdd_clipper->SetHWnd(0, h))) return(0); + + if (FAILED(lpdds_pri->SetClipper(lpdd_clipper))) return(0); + + ddraw_hwnd = h; + + video_setblit(ddraw_blit); + +#ifdef USE_LIBPNG +# if USE_LIBPNG == 2 + /* Try loading the DLL. */ + png_handle = dynld_module(PATH_PNG_DLL, png_imports); + if (png_handle == NULL) + pclog("DDraw: unable to load '%s', using BMP for screenshots.\n", + PATH_PNG_DLL); +# else + png_handle = (void *)1; /* just to indicate always therse */ +# endif +#endif + + return(1); +} + + +static void +ddraw_screenshot(const wchar_t *fn) +{ + wchar_t temp[512]; + HBITMAP hbmp; + +#if 0 + xs = xsize; + ys = ys2 = ysize; + + /* For EGA/(S)VGA, the size is NOT adjusted for overscan. */ + if ((overscan_y > 16) && enable_overscan) { + xs += overscan_x; + ys += overscan_y; + } + + /* For CGA, the width is adjusted for overscan, but the height is not. */ + if (overscan_y == 16) { + if (ys2 <= 250) + ys += (overscan_y >> 1); + else + ys += overscan_y; + } +#endif + + xs = get_actual_size_x(); + ys = ys2 = get_actual_size_y(); + + if (ysize <= 250) { + ys >>= 1; + ys2 >>= 1; + } + + hbmp = CopySurface(lpdds_back2); + +#ifdef USE_LIBPNG + /* Save the screenshot, using PNG if available. */ + if (png_handle != NULL) { + /* Use the PNG library. */ + SavePNG(fn, hbmp); + } else { +#endif + /* Use BMP, so fix the file name. */ + wcscpy(temp, fn); + temp[wcslen(temp)-3] = L'b'; + temp[wcslen(temp)-2] = L'm'; + temp[wcslen(temp)-1] = L'p'; + SaveBMP(temp, hbmp); +#ifdef USE_LIBPNG + } +#endif +} + + +const vidapi_t ddraw_vidapi = { + "DDraw", + 1, + ddraw_init, + ddraw_close, + NULL, + NULL, + NULL, + ddraw_screenshot, + NULL +}; + + +#if 0 +@@@@@ +static int +ddraw_init(int fs) +{ + DDSURFACEDESC2 ddsd; + LPDIRECTDRAW lpdd; HRESULT hr; HWND h; DWORD dw; @@ -702,13 +909,11 @@ ddraw_init(int fs) pclog("DDRAW: cannot create an instance (%s)\n", GetError(hr)); return(0); } - hr = lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *)&lpdd4); if (FAILED(hr)) { pclog("DDRAW: no interfaces found (%s)\n", GetError(hr)); return(0); } - lpdd->Release(); lpdd = NULL; @@ -740,7 +945,6 @@ ddraw_init(int fs) memset(&ddsd, 0x00, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; if (fs) { @@ -748,23 +952,23 @@ ddraw_init(int fs) ddsd.ddsCaps.dwCaps |= (DDSCAPS_COMPLEX | DDSCAPS_FLIP); ddsd.dwBackBufferCount = 1; } - hr = lpdd4->CreateSurface(&ddsd, &dds_pri, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_pri, NULL); if (FAILED(hr)) { pclog("DDRAW: CreateSurface failed (%s)\n", GetError(hr)); return(0); } ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.dwWidth = 2048; + ddsd.dwWidth = 2048; ddsd.dwHeight = 2048; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; - hr = lpdd4->CreateSurface(&ddsd, &dds_back, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL); if (FAILED(hr)) { ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.dwWidth = 2048; + ddsd.dwWidth = 2048; ddsd.dwHeight = 2048; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; - hr = lpdd4->CreateSurface(&ddsd, &dds_back, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL); if (FAILED(hr)) { pclog("DDRAW: CreateSurface back failed (%s)\n", GetError(hr)); return(0); @@ -773,7 +977,7 @@ ddraw_init(int fs) if (fs) { ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; - hr = dds_pri->GetAttachedSurface(&ddsd.ddsCaps, &dds_back2); + hr = lpdds_pri->GetAttachedSurface(&ddsd.ddsCaps, &lpdds_back2); if (FAILED(hr)) { pclog("DDRAW: GetAttachedSurface failed (%s)\n", GetError(hr)); return(0); @@ -783,22 +987,22 @@ ddraw_init(int fs) memset(&ddsd, 0x00, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.dwWidth = 2048; + ddsd.dwWidth = 2048; ddsd.dwHeight = 2048; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY; if (fs) - hr = lpdd4->CreateSurface(&ddsd, &dds_back, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL); else - hr = lpdd4->CreateSurface(&ddsd, &dds_back2, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back2, NULL); if (FAILED(hr)) { ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.dwWidth = 2048; + ddsd.dwWidth = 2048; ddsd.dwHeight = 2048; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; if (fs) - hr = lpdd4->CreateSurface(&ddsd, &dds_back, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back, NULL); else - hr = lpdd4->CreateSurface(&ddsd, &dds_back2, NULL); + hr = lpdd4->CreateSurface(&ddsd, &lpdds_back2, NULL); if (FAILED(hr)) { pclog("DDRAW: CreateSurface(back) failed (%s)\n", GetError(hr)); return(0); @@ -818,14 +1022,14 @@ ddraw_init(int fs) return(0); } - hr = dds_pri->SetClipper(lpdd_clipper); + hr = lpdds_pri->SetClipper(lpdd_clipper); if (FAILED(hr)) { pclog("DDRAW: SetClipper failed (%s)\n", GetError(hr)); return(0); } } - ddraw_hwnd = hwndRender; + ddraw_hwnd = h; if (fs) video_setblit(ddraw_blit_fs); @@ -834,56 +1038,4 @@ ddraw_init(int fs) return(1); } - - -static void -ddraw_screenshot(const wchar_t *fn) -{ -#if 0 - xs = xsize; - ys = ys2 = ysize; - - /* For EGA/(S)VGA, the size is NOT adjusted for overscan. */ - if ((overscan_y > 16) && enable_overscan) { - xs += overscan_x; - ys += overscan_y; - } - - /* For CGA, the width is adjusted for overscan, but the height is not. */ - if (overscan_y == 16) { - if (ys2 <= 250) - ys += (overscan_y >> 1); - else - ys += overscan_y; - } #endif - - xs = get_actual_size_x(); - ys = ys2 = get_actual_size_y(); - - if (ysize <= 250) { - ys >>= 1; - ys2 >>= 1; - } - - CopySurface(dds_back2); - -#ifdef USE_LIBPNG - SavePNG(fn, hbitmap); -#else - SaveBMP(fn, hbitmap); -#endif -} - - -const vidapi_t ddraw_vidapi = { - "DDraw", - 1, - ddraw_init, - ddraw_close, - NULL, - NULL, - NULL, - ddraw_screenshot, - NULL -}; diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index bd94b8e..45fd81a 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -12,7 +12,7 @@ * and builds a complete Win32 DIALOG resource block in a * buffer in memory, and then passes that to the API handler. * - * Version: @(#)win_devconf.c 1.0.17 2018/05/11 + * Version: @(#)win_devconf.c 1.0.20 2018/05/26 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -56,6 +56,9 @@ #include "win.h" +#define STR_FONTNAME "Segoe UI" + + static const device_t *devconf_device; static int8_t devconf_changed = 0; @@ -416,6 +419,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } c++; } +//FIXME: localize strcat(file_filter, "|All files (*.*)|*.*|"); mbstowcs(ws, file_filter, strlen(file_filter) + 1); d = strlen(file_filter); @@ -440,6 +444,24 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } +static uint16_t * +AddWideString(uint16_t *data, int ids) +{ + const wchar_t *str; + wchar_t *ptr; + + ptr = (wchar_t *)data; + str = get_string(ids); + if (str != NULL) { + while (*str != L'\0') + *ptr++ = *str++; + } + *ptr++ = L'\0'; + + return((uint16_t *)ptr); +} + + /* * Build the full dialog from the template in * memory, and data taken from the device config. @@ -475,12 +497,14 @@ dlg_devconf(HWND hwnd, device_t *device) data = (uint16_t *)(dlg + 1); *data++ = 0; /* no menu bar */ *data++ = 0; /* predefined dialog box class */ - sprintf(temp, "%s Configuration", device->name); + sprintf(temp, "%s ", device->name); data += MultiByteToWideChar(CP_ACP, 0, temp, -1, data, 120); + data--; /* back over the NUL */ + data = AddWideString(data, IDS_DEVCONF_1); /* Font style and size to use. */ *data++ = 9; /* point size */ - data += MultiByteToWideChar(CP_ACP, 0, "Segoe UI", -1, data, 120); + data += MultiByteToWideChar(CP_ACP, 0, STR_FONTNAME, -1, data, 120); if (((uintptr_t)data) & 2) data++; @@ -489,7 +513,6 @@ dlg_devconf(HWND hwnd, device_t *device) id = IDC_CONFIG_BASE; while (cfg->type != -1) { /* Align 'data' to DWORD */ -if (((uint32_t)data) & 3) pclog("DEVCONF: unaligned data %08lx !\n", data); itm = (DLGITEMTEMPLATE *)data; switch (cfg->type) { @@ -606,7 +629,7 @@ if (((uint32_t)data) & 3) pclog("DEVCONF: unaligned data %08lx !\n", data); itm->x = 70; itm->y = y; itm->id = id++; - itm->cx = 100; + itm->cx = 90; itm->cy = 14; data = (uint16_t *)(itm + 1); @@ -621,17 +644,16 @@ if (((uint32_t)data) & 3) pclog("DEVCONF: unaligned data %08lx !\n", data); /* Button */ itm = (DLGITEMTEMPLATE *)data; itm->style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON; - itm->x = 175; + itm->x = 165; itm->y = y; - itm->cx = 35; + itm->cx = 45; itm->cy = 14; itm->id = id++; data = (uint16_t *)(itm + 1); *data++ = 0xffff; *data++ = 0x0080; /* button class */ - data += MultiByteToWideChar(CP_ACP, 0, - "Browse", -1, data, 256); + data = AddWideString(data, IDS_BROWSE); *data++ = 0; /* no creation data */ if (((uintptr_t)data) & 2) data++; /* align */ @@ -680,7 +702,7 @@ if (((uint32_t)data) & 3) pclog("DEVCONF: unaligned data %08lx !\n", data); data = (uint16_t *)(itm + 1); *data++ = 0xffff; *data++ = 0x0080; /* button class */ - data += MultiByteToWideChar(CP_ACP, 0, "OK", -1, data, 50); + data = AddWideString(data, IDS_OK); *data++ = 0; /* no creation data */ if (((uintptr_t)data) & 2) data++; /* align */ @@ -695,7 +717,7 @@ if (((uint32_t)data) & 3) pclog("DEVCONF: unaligned data %08lx !\n", data); data = (uint16_t *)(itm + 1); *data++ = 0xffff; *data++ = 0x0080; /* button class */ - data += MultiByteToWideChar(CP_ACP, 0, "Cancel", -1, data, 50); + data = AddWideString(data, IDS_CANCEL); *data++ = 0; /* no creation data */ /* Set final height of dialog. */ diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index 15c9d37..55ce210 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -8,7 +8,7 @@ * * Implementation of server several dialogs. * - * Version: @(#)win_dialog.c 1.0.10 2018/05/11 + * Version: @(#)win_dialog.c 1.0.12 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -56,20 +56,20 @@ DWORD filterindex = 0; -/* Center a dialog window with respect to the main window. */ +/* Center a dialog window relative to its parent window. */ void dialog_center(HWND hdlg) { RECT r, r1, r2; - HWND owner; + HWND parent; - /* Get handle to owner window. Use desktop if needed. */ - if ((owner = GetParent(hdlg)) == NULL) - owner = GetDesktopWindow(); + /* Get handle to parent window. Use desktop if needed. */ + if ((parent = GetParent(hdlg)) == NULL) + parent = GetDesktopWindow(); /* Get owner and dialog rects. */ GetWindowRect(hdlg, &r1); - GetWindowRect(owner, &r2); + GetWindowRect(parent, &r2); CopyRect(&r, &r2); /* Center the dialog within the owner's space. */ @@ -84,10 +84,34 @@ dialog_center(HWND hdlg) } +/* WinHook to allow for centering the messagebox. */ +static LRESULT CALLBACK +CenterMsgBoxTextProc(int nCode, WPARAM wParam, LPARAM lParam) +{ + HWND hDlg = (HWND)wParam; + HWND hTxt; + + if (nCode == HCBT_ACTIVATE) { + /* Center dialog. */ + dialog_center(hDlg); + + /* Find the (STATIC) text label in the control. */ + hTxt = FindWindowEx(hDlg, NULL, TEXT("STATIC"), NULL); + + if (hTxt != NULL) + SetWindowLong(hTxt, GWL_STYLE, + GetWindowLong(hTxt, GWL_STYLE) | SS_CENTER); + } + + return(CallNextHookEx(NULL, nCode, wParam, lParam)); +} + + int -ui_msgbox(int flags, void *arg) +ui_msgbox(int flags, const void *arg) { WCHAR temp[512]; + HHOOK hHook; DWORD fl = 0; const WCHAR *str = NULL; const WCHAR *cap = NULL; @@ -100,16 +124,16 @@ ui_msgbox(int flags, void *arg) case MBX_WARNING: /* warning message */ fl = (MB_YESNO | MB_ICONWARNING); - cap = get_string(IDS_2051); /* "Warning" */ + cap = get_string(IDS_WARNING); break; case MBX_ERROR: /* error message */ if (flags & MBX_FATAL) { fl = (MB_OK | MB_ICONERROR); - cap = get_string(IDS_2049); /* "Fatal Error"*/ + cap = get_string(IDS_FATAL_ERROR); } else { fl = (MB_OK | MB_ICONWARNING); - cap = get_string(IDS_2048); /* "Error" */ + cap = get_string(IDS_ERROR); } break; @@ -120,7 +144,7 @@ ui_msgbox(int flags, void *arg) case MBX_CONFIG: /* configuration */ fl = (MB_YESNO | MB_ICONERROR); - cap = get_string(IDS_2050); /* "Configuration Error" */ + cap = get_string(IDS_CONFIG_ERROR); break; } @@ -148,12 +172,20 @@ ui_msgbox(int flags, void *arg) str = get_string((intptr_t)arg); } + /* Create a hook for the MessageBox dialog. */ + hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CenterMsgBoxTextProc, + NULL, GetCurrentThreadId()); + /* At any rate, we do have a valid (wide) string now. */ fl = MessageBox(hwndMain, /* our main window */ str, /* error message etc */ cap, /* window caption */ fl); + /* Remove the dialog hook. */ + if (hHook != NULL) + UnhookWindowsHookEx(hHook); + /* Convert return values to generic ones. */ switch(fl) { case IDNO: diff --git a/src/win/win_dynld.c b/src/win/win_dynld.c index 3dec4c5..8dda446 100644 --- a/src/win/win_dynld.c +++ b/src/win/win_dynld.c @@ -8,7 +8,7 @@ * * Try to load a support DLL. * - * Version: @(#)win_dynld.c 1.0.5 2018/05/07 + * Version: @(#)win_dynld.c 1.0.6 2018/05/14 * * Authors: Fred N. van Kempen, * @@ -64,23 +64,25 @@ dynld_module(const char *name, const dllimp_t *table) /* See if we can load the desired module. */ if ((h = LoadLibrary(name)) == NULL) { +#ifdef _DEBUG pclog("DynLd(\"%s\"): library not found!\n", name); +#endif return(NULL); } /* If no table was given, we just detect library presence. */ if (table == NULL) { - CloseHandle(h); + FreeLibrary(h); return((void *)h); } /* Now load the desired function pointers. */ - for (imp=table; imp->name!=NULL; imp++) { + for (imp = table; imp->name != NULL; imp++) { func = GetProcAddress(h, imp->name); if (func == NULL) { pclog("DynLd(\"%s\"): function '%s' not found!\n", name, imp->name); - CloseHandle(h); + FreeLibrary(h); return(NULL); } diff --git a/src/win/win_joystick.cpp b/src/win/win_joystick.cpp index b314c26..791b208 100644 --- a/src/win/win_joystick.cpp +++ b/src/win/win_joystick.cpp @@ -13,7 +13,7 @@ * NOTE: Hacks currently needed to compile with MSVC; DX needs to * be updated to 11 or 12 or so. --FvK * - * Version: @(#)win_joystick.cpp 1.0.14 2018/05/06 + * Version: @(#)win_joystick.cpp 1.0.17 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -67,6 +67,7 @@ #define MAX_PLAT_JOYSTICKS 8 +#define STR_FONTNAME "Segoe UI" typedef struct { @@ -630,6 +631,24 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, UNUSED(LPARAM lParam)) } +static uint16_t * +AddWideString(uint16_t *data, int ids) +{ + const wchar_t *str; + wchar_t *ptr; + + ptr = (wchar_t *)data; + str = get_string(ids); + if (str != NULL) { + while (*str != L'\0') + *ptr++ = *str++; + } + *ptr++ = L'\0'; + + return((uint16_t *)ptr); +} + + /* Create an in-memory dialog template for the Joystick Configuration. */ uint8_t dlg_jsconf(HWND hwnd, int joy_nr, int type) @@ -657,10 +676,11 @@ dlg_jsconf(HWND hwnd, int joy_nr, int type) data = (uint16_t *)(dlg + 1); *data++ = 0; /*no menu*/ *data++ = 0; /*predefined dialog box class*/ - data += MultiByteToWideChar(CP_ACP, 0, - "Device Configuration", -1, (wchar_t *)data, 128); + data = AddWideString(data, IDS_DEVCONF_1); + *data++ = 8; /*Point*/ - data += MultiByteToWideChar(CP_ACP, 0, "MS Sans Serif", -1, (wchar_t *)data, 128); + data += MultiByteToWideChar(CP_ACP, 0, STR_FONTNAME, -1, + (wchar_t *)data, 128); if (((uintptr_t)data) & 2) data++; @@ -691,7 +711,7 @@ dlg_jsconf(HWND hwnd, int joy_nr, int type) data = (uint16_t *)(item + 1); *data++ = 0xFFFF; *data++ = 0x0082; /* static class */ - data += MultiByteToWideChar(CP_ACP, 0, "Device:", -1, (wchar_t *)data, 256); + data = AddWideString(data, IDS_DEVCONF_2); *data++ = 0; /* no creation data */ if (((uintptr_t)data) & 2) data++; @@ -820,7 +840,7 @@ dlg_jsconf(HWND hwnd, int joy_nr, int type) item = (DLGITEMTEMPLATE *)data; item->style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON; - item->id = IDOK; /* OK button identifier */ + item->id = IDOK; item->x = 20; item->y = y; item->cx = 50; @@ -828,14 +848,14 @@ dlg_jsconf(HWND hwnd, int joy_nr, int type) data = (uint16_t *)(item + 1); *data++ = 0xFFFF; *data++ = 0x0080; /* button class */ - data += MultiByteToWideChar(CP_ACP, 0, "OK", -1, (wchar_t *)data, 50); + data = AddWideString(data, IDS_OK); *data++ = 0; /* no creation data */ if (((uintptr_t)data) & 2) data++; item = (DLGITEMTEMPLATE *)data; item->style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON; - item->id = IDCANCEL; /* OK button identifier */ + item->id = IDCANCEL; item->x = 80; item->y = y; item->cx = 50; @@ -843,7 +863,7 @@ dlg_jsconf(HWND hwnd, int joy_nr, int type) data = (uint16_t *)(item + 1); *data++ = 0xFFFF; *data++ = 0x0080; /* button class */ - data += MultiByteToWideChar(CP_ACP, 0, "Cancel", -1, (wchar_t *)data, 50); + data = AddWideString(data, IDS_CANCEL); *data++ = 0; /* no creation data */ dlg->cy = y + 20; diff --git a/src/win/win_lang.c b/src/win/win_lang.c new file mode 100644 index 0000000..8c52b47 --- /dev/null +++ b/src/win/win_lang.c @@ -0,0 +1,421 @@ +/* + * VARCem Virtual ARchaeological Computer EMulator. + * An emulator of (mostly) x86-based PC systems and devices, + * using the ISA,EISA,VLB,MCA and PCI system buses, roughly + * spanning the era between 1981 and 1995. + * + * This file is part of the VARCem Project. + * + * Handle language support for the platform. + * + * Version: @(#)win_lang.c 1.0.2 2018/05/29 + * + * Author: Fred N. van Kempen, + * + * Copyright 2018 Fred N. van Kempen. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#define UNICODE +#include +#include +#include +#include +#include +#include +#include "../emu.h" +#include "../ui/ui.h" +#include "../plat.h" +#include "win.h" +#include "win_opendir.h" + + +/* Define a translation entry in the file. */ +typedef struct { + WORD wLanguage; + WORD wCodePage; +} dll_lang_t; + + +/* Platform Public data, specific. */ +const string_t *plat_strings; +DWORD dwSubLangID; +lang_t *languages = NULL; + + +/* Local data. */ +static int languages_num = 0; +static HMODULE lang_handle = NULL; +static LANGID lang_curr = 0; + + +/* Set the localized language name. */ +static void +lang_setname(lang_t *ptr) +{ + wchar_t name[128]; + wchar_t *str; + LCID lcid; + + /* Convert the language ID to a (localized) name. */ + lcid = MAKELCID(ptr->id, SORT_DEFAULT); + if (! GetLocaleInfo(lcid, LOCALE_SLANGUAGE, name, sizeof_w(name))) { + pclog("UI: unable to get name for language ID 0x%04X\n", ptr->id); + return; + } + + /* Clean up any existing name. */ + if (ptr->name != NULL) free((void *)ptr->name); + + /* Set the (new) name. */ + str = (wchar_t *)malloc(sizeof(wchar_t) * (wcslen(name) + 1)); + memset(str, 0x00, sizeof(wchar_t) * (wcslen(name) + 1)); + wcscpy(str, name); + ptr->name = (const wchar_t *)str; +} + + +/* Add a language to the list of supported languages. */ +static void +lang_add(lang_t *ptr) +{ + lang_t *p, *pp; + + /* Create a copy of the entry data. */ + pp = (lang_t *)malloc(sizeof(lang_t)); + memcpy(pp, ptr, sizeof(lang_t)); + + /* Set the name of this language. */ + lang_setname(pp); + + /* Add this entry to the tail of the list. */ + if (languages == NULL) { + languages = pp; + } else { + p = languages; + while (p->next != NULL) + p = p->next; + p->next = pp; + } + + /* We got one more! */ + languages_num++; +} + + +/* + * Scan the LANG dir for any Language Modules we + * may have installed there. The main application + * only has English compiled in, any others are + * kept in separate language modules. + */ +static void +lang_scan(void) +{ + wchar_t path[512], temp[512]; + uint8_t buffer[8192]; + wchar_t *str, *ptr; + struct direct *de; + dll_lang_t *lptr; + lang_t lang; + DIR *dir; + int l; + + /* First, add our native language. */ + languages_num = 0; + memset(&lang, 0x00, sizeof(lang)); + lang.id = 0x0409; + lang_add(&lang); + + /* Open the "language modules" directory. */ + swprintf(path, sizeof_w(temp), L"%ls%ls", emu_path, LANGUAGE_PATH); + dir = opendir(path); + if (dir != NULL) { + /* Scan all files, and see if we find a usable one. */ + for (;;) { + /* Get an entry from the directory. */ + if ((de = readdir(dir)) == NULL) break; + + /* Is this a file we want? */ + l = wcslen(LANG_FILE); + if (de->d_reclen < l) continue; + if (wcsncmp(de->d_name, LANG_FILE, l)) continue; + str = wcschr(de->d_name, L'.'); + if (str == NULL) continue; + if (wcsncasecmp(str, L".dll", 4)) continue; + + /* Looks like we have one here.. */ + memset(temp, 0x00, sizeof(temp)); + de->d_name[de->d_reclen] = L'\0'; + swprintf(temp, sizeof_w(temp), L"%ls\\%ls", path, de->d_name); + + /* Create a buffer for the DLL file name. */ + memset(&lang, 0x00, sizeof(lang)); + str = (wchar_t *)malloc(sizeof(wchar_t) * (wcslen(temp) + 1)); + memset(str, 0x00, sizeof(wchar_t) * (wcslen(temp) + 1)); + wcscpy(str, temp); + lang.dll = (const wchar_t *)str; + + /* Grab the version info block from the DLL. */ + if (! GetFileVersionInfo(temp, 0, sizeof(buffer), buffer)) { + pclog("UI: unable to access '%ls', skipping!\n", temp); + free((void *)lang.dll); + continue; + } + + /* Extract the (first) "Translation" entry. */ + VerQueryValue(buffer, L"\\VarFileInfo\\Translation", + (LPVOID*)&lptr, (PUINT)&l); + lang.id = lptr->wLanguage; + + /* Get the various strings from the block. */ + swprintf(temp, sizeof_w(temp), + L"\\StringFileInfo\\%04x%04x\\%ls", + lptr->wLanguage, lptr->wCodePage, L"FileVersion"); + if (! VerQueryValue(buffer, temp, (LPVOID*)&str, (PUINT)&l)) { +#ifdef _DEBUG + pclog("UI: invalid data in DLL, skipping!\n"); +#endif + free((void *)lang.dll); + continue; + } + ptr = (wchar_t *)malloc(sizeof(wchar_t) * (l+1)); + lang.version = (const wchar_t *)ptr; + *ptr++ = L'v'; + do { + /* Copy string, replacing , with . on the fly. */ + if (*str == L',') + *ptr++ = L'.'; + else + *ptr++ = *str; + } while (*str++ != L'\0'); + + swprintf(temp, sizeof_w(temp), + L"\\StringFileInfo\\%04x%04x\\%ls", + lptr->wLanguage, lptr->wCodePage, L"Comments"); + if (! VerQueryValue(buffer, temp, (LPVOID*)&str, (PUINT)&l)) { +#ifdef _DEBUG + pclog("UI: invalid data in DLL, skipping!\n"); +#endif + free((void *)lang.version); + free((void *)lang.dll); + continue; + } + ptr = temp; + while (*str != L'\0') + *ptr++ = *str++; + *ptr++ = *str++; + l -= (ptr - temp); + ptr = (wchar_t *)malloc(sizeof(wchar_t) * (ptr-temp)); + wcscpy(ptr, temp); + lang.author = (const wchar_t *)ptr; + + ptr = (wchar_t *)malloc(sizeof(wchar_t) * l); + wcscpy(ptr, str); + lang.email = (const wchar_t *)ptr; + + /* Add this language. */ + lang_add(&lang); + } + (void)closedir(dir); + } +} + + +/* Pre-load the strings from our resource file. */ +static void +lang_strings(void) +{ + wchar_t temp[512], *str; + string_t *array, *tbl; + int c = 0, i; + + /* + * First, we need to know how many strings are in the table. + * Sadly, there is no other way to determine this but to try + * to load all possible ID's... + */ + for (i = IDS_BEGIN; i < IDS_END; i++) + if (LoadString(plat_lang_dll(), i, temp, sizeof_w(temp)) > 0) c++; + + /* + * Now that we know how many strings exist, we can allocate + * our string_table array. + */ + i = (c + 1) * sizeof(string_t); + array = (string_t *)malloc(i); + memset(array, 0x00, i); + + /* Now load the actual strings into our string table. */ + tbl = array; + for (i = IDS_BEGIN; i < IDS_END; i++) { + c = LoadString(plat_lang_dll(), i, temp, sizeof_w(temp)); + if (c == 0) continue; + + tbl->id = i; + str = (wchar_t *)malloc((c + 1) * sizeof(wchar_t)); + memset(str, 0x00, (c + 1) * sizeof(wchar_t)); + memcpy(str, temp, c * sizeof(wchar_t)); + tbl->str = str; + + tbl++; + } + + /* Terminate the table. */ + tbl->str = NULL; + + /* Consider this table const. */ + plat_strings = array; +} + + +/* Set the correct item in the Language menu. */ +static void +lang_check(int id) +{ + lang_t *ptr; + int i = 1; + + ptr = languages; + while (ptr != NULL) { + if (ptr->id == id) { + menu_set_radio_item(IDM_LANGUAGE, languages_num, i); + return; + } + i++; + ptr = ptr->next; + } +} + + +/* Get language from index number. */ +static lang_t * +lang_index(int id) +{ + lang_t *ptr; + int i = 0; + + for (ptr = languages; ptr != NULL; ptr = ptr->next) + if (i++ == id) return(ptr); + + return(NULL); +} + + +/* Set (or re-set) the language for the application. */ +void +plat_set_language(int id) +{ + LANGID lang; + lang_t *ptr; + LCID lcid; + + /* First, set up our language list if needed. */ + if (languages == NULL) lang_scan(); + + /* If a small value, this is a menu index, not an ID. */ + if (id < 200) { + ptr = lang_index(id); + id = ptr->id; + lang_id = id; + } + + /* Set new language ID if not already set. */ + lang = MAKELANGID(id, dwSubLangID); + if (lang_curr == lang) return; + + /* Find language in the table. */ + for (ptr = languages; ptr != NULL; ptr = ptr->next) + if (ptr->id == id) break; + if (ptr == NULL) { + pclog("UI: language not supported, not setting.\n"); + return; + } + + /* Do we need to unload a resource DLL? */ + if (lang_handle != NULL) { + FreeLibrary(lang_handle); + lang_handle = NULL; + } + + /* Do we need to load a resource DLL? */ + if (ptr->dll != NULL) { + lang_handle = LoadLibraryEx(ptr->dll, 0, + LOAD_LIBRARY_AS_IMAGE_RESOURCE | \ + LOAD_LIBRARY_AS_DATAFILE); + if (lang_handle == NULL) { + pclog("UI: unable to load resource DLL '%ls' !\n", ptr->dll); + return; + } + } + + /* We are good to go! */ + lang_curr = lang; + + /* Load the strings table for this ID. */ + lang_strings(); + + /* Activate the new language for the application. */ + SetThreadUILanguage(lang_curr); + + /* This can be removed, it no longer works since Vista+ */ + lcid = MAKELCID(id, SORT_DEFAULT); + SetThreadLocale(lcid); +} + + +void +plat_lang_menu(void) +{ + lang_t *ptr; + int i; + + i = IDM_LANGUAGE; + for (ptr = languages; ptr != NULL; ptr = ptr->next) { + i++; + + /* Add this language to the Languages menu. */ + menu_add_item(IDM_LANGUAGE, i, ptr->name); + } + + /* Set active language. */ + lang_check(lang_id); +} + + +HMODULE +plat_lang_dll(void) +{ + if (lang_handle == NULL) + return(hInstance); + + return(lang_handle); +} diff --git a/src/win/win_new_image.c b/src/win/win_new_image.c index 8483a89..0033ee1 100644 --- a/src/win/win_new_image.c +++ b/src/win/win_new_image.c @@ -8,7 +8,7 @@ * * Implementation of the New Floppy/ZIP Image dialog. * - * Version: @(#)win_new_image.c 1.0.16 2018/05/13 + * Version: @(#)win_new_image.c 1.0.18 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -85,18 +85,18 @@ dlg_init(HWND hdlg) zip_types = zip_drives[drive_id].is_250 ? 2 : 1; for (i = 0; i < zip_types; i++) SendMessage(h, CB_ADDSTRING, 0, - (LPARAM)get_string(IDS_5900 + i)); + (LPARAM)get_string(IDS_3282 + 12 + i)); } else { for (i = 0; i < 12; i++) SendMessage(h, CB_ADDSTRING, 0, - (LPARAM)get_string(IDS_5888 + i)); + (LPARAM)get_string(IDS_3282 + i)); } SendMessage(h, CB_SETCURSEL, 0, 0); EnableWindow(h, FALSE); h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE); for (i = 0; i < 4; i++) - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_6144 + i)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_3278 + i)); SendMessage(h, CB_SETCURSEL, 0, 0); EnableWindow(h, FALSE); ShowWindow(h, SW_HIDE); @@ -170,7 +170,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) else ui_sb_mount_floppy(drive_id, sb_part, 0, fd_file_name); } else { - msg_box(hdlg, MBX_ERROR, (wchar_t *)IDS_4108); + msg_box(hdlg, MBX_ERROR, (wchar_t *)IDS_OPEN_WRITE); plat_pause(0); return TRUE; } @@ -181,7 +181,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) return TRUE; case IDC_CFILE: - if (dlg_file_ex(hdlg, get_string(is_zip ? IDS_2176 : IDS_2174), NULL, temp_path, DLG_FILE_SAVE)) { + if (dlg_file_ex(hdlg, get_string(is_zip ? IDS_3952 : IDS_3912), NULL, temp_path, DLG_FILE_SAVE)) { if (! wcschr(temp_path, L'.')) { if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) { twcs = &temp_path[wcslen(temp_path)]; @@ -201,7 +201,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) f = _wfopen(temp_path, L"rb"); if (f != NULL) { fclose(f); - if (msg_box(hdlg, MBX_QUESTION, (wchar_t *)IDS_4111) != 0) /* yes */ { + if (msg_box(hdlg, MBX_QUESTION, (wchar_t *)IDS_IMG_EXIST) != 0) /* yes */ { pclog("SELECT: != 0 (NO)\n"); return FALSE; } @@ -269,5 +269,5 @@ dlg_new_image(int drive, int part, int zip) drive_id = drive; sb_part = part; - DialogBox(hInstance, (LPCTSTR)DLG_NEW_FLOPPY, hwndMain, dlg_proc); + DialogBox(plat_lang_dll(), (LPCTSTR)DLG_NEW_FLOPPY, hwndMain, dlg_proc); } diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index 833a94c..916f1d8 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -10,7 +10,7 @@ * * Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19 * - * Version: @(#)win_opendir.c 1.0.6 2018/05/09 + * Version: @(#)win_opendir.c 1.0.7 2018/05/18 * * Author: Fred N. van Kempen, * @@ -68,7 +68,7 @@ /* Open a directory. */ DIR * -opendirw(const wchar_t *name) +opendir(const wchar_t *name) { DIR *p; diff --git a/src/win/win_opendir.h b/src/win/win_opendir.h index 998bc3f..ed55aca 100644 --- a/src/win/win_opendir.h +++ b/src/win/win_opendir.h @@ -8,7 +8,7 @@ * * Definitions for the platform OpenDir module. * - * Version: @(#)win_opendir.h 1.0.2 2018/05/09 + * Version: @(#)win_opendir.h 1.0.3 2018/05/18 * * Author: Fred N. van Kempen, * @@ -83,7 +83,7 @@ typedef struct { /* Function prototypes. */ -extern DIR *opendirw(const wchar_t *); +extern DIR *opendir(const wchar_t *); extern struct direct *readdir(DIR *); extern long telldir(DIR *); extern void seekdir(DIR *, long); diff --git a/src/win/win_sdl.c b/src/win/win_sdl.c index 1bbf8ab..3213e54 100644 --- a/src/win/win_sdl.c +++ b/src/win/win_sdl.c @@ -12,7 +12,7 @@ * we will not use that, but, instead, use a new window which * coverrs the entire desktop. * - * Version: @(#)win_sdl.c 1.0.2 2018/05/10 + * Version: @(#)win_sdl.c 1.0.3 2018/05/26 * * Authors: Fred N. van Kempen, * Michael Drüing, @@ -53,6 +53,9 @@ #define UNICODE #define WIN32_LEAN_AND_MEAN #include +#ifdef _MSC_VER +# pragma warning(disable: 4005) +#endif #include #include #include diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 2220b31..ca050de 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings.c 1.0.29 2018/05/09 + * Version: @(#)win_settings.c 1.0.31 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -327,7 +327,7 @@ msgbox_reset(void) changed = settings_changed(); if (changed) { - i = settings_msgbox(MBX_QUESTION, (wchar_t *)IDS_2052); + i = settings_msgbox(MBX_QUESTION, (wchar_t *)IDS_MSG_SAVE); if (i == 1) return(1); /* no */ @@ -436,6 +436,7 @@ settings_save(void) #define PAGE_HARD_DISKS 7 #define PAGE_FLOPPY_DRIVES 8 #define PAGE_OTHER_REMOVABLE_DEVICES 9 +#define PAGE_MAX 10 static void @@ -451,61 +452,61 @@ show_child(HWND hwndParent, DWORD child_id) switch(child_id) { case PAGE_MACHINE: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_MACHINE, hwndParent, machine_proc); break; case PAGE_VIDEO: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_VIDEO, hwndParent, video_proc); break; case PAGE_INPUT: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_INPUT, hwndParent, input_proc); break; case PAGE_SOUND: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_SOUND, hwndParent, sound_proc); break; case PAGE_NETWORK: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_NETWORK, hwndParent, network_proc); break; case PAGE_PORTS: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_PORTS, hwndParent, ports_proc); break; case PAGE_PERIPHERALS: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_PERIPHERALS, hwndParent, peripherals_proc); break; case PAGE_HARD_DISKS: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_DISK, hwndParent, disk_proc); break; case PAGE_FLOPPY_DRIVES: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_FLOPPY, hwndParent, floppy_proc); break; case PAGE_OTHER_REMOVABLE_DEVICES: - hwndChildDialog = CreateDialog(hInstance, + hwndChildDialog = CreateDialog(plat_lang_dll(), (LPCWSTR)DLG_CFG_RMV_DEVICES, hwndParent, rmv_devices_proc); break; @@ -524,14 +525,14 @@ image_list_init(HWND hwndList) { HICON hiconItem; HIMAGELIST hSmall; - int i = 0; + int i; hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 1, 1); - for (i=0; i<10; i++) { - hiconItem = LoadIcon(hInstance, (LPCWSTR) (256 + (uintptr_t) i)); + for (i = 0; i < PAGE_MAX; i++) { + hiconItem = LoadIcon(hInstance, (LPCWSTR)(256 + i)); ImageList_AddIcon(hSmall, hiconItem); DestroyIcon(hiconItem); } @@ -551,8 +552,8 @@ insert_categories(HWND hwndList) lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvI.stateMask = lvI.iSubItem = lvI.state = 0; - for (i=0; i<10; i++) { - lvI.pszText = (LPTSTR)get_string(IDS_2065+i); + for (i = 0; i < PAGE_MAX; i++) { + lvI.pszText = (LPTSTR)get_string(IDS_3310+i); lvI.iItem = i; lvI.iImage = i; @@ -573,8 +574,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND h; int category; - int i = 0; - int j = 0; + int i, j; hwndParentDialog = hdlg; @@ -602,13 +602,12 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) ShowWindow(h, SW_HIDE); #endif -// dialog_center(hdlg); return(TRUE); case WM_NOTIFY: if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_SETTINGSCATLIST)) { category = -1; - for (i=0; i<10; i++) { + for (i = 0; i < PAGE_MAX; i++) { h = GetDlgItem(hdlg, IDC_SETTINGSCATLIST); j = ListView_GetItemState(h, i, LVIS_SELECTED); if (j) category = i; @@ -642,6 +641,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) return(TRUE); case IDCANCEL: + /* CANCEL, just kidding! */ DestroyWindow(hwndChildDialog); EndDialog(hdlg, 0); return(TRUE); @@ -668,13 +668,13 @@ dlg_settings(int ask) v = video_detect(); if (m == 0 || v == 0) { - ui_msgbox(MBX_ERROR|MBX_FATAL, (wchar_t *)IDS_2056); + ui_msgbox(MBX_ERROR|MBX_FATAL, (wchar_t *)IDS_ERR_NOROMS); return(0); } ask_sure = ask; - i = DialogBox(hInstance, (LPCWSTR)DLG_CONFIG, hwndMain, dlg_proc); + i = DialogBox(plat_lang_dll(), (LPCWSTR)DLG_CONFIG, hwndMain, dlg_proc); return(i); } diff --git a/src/win/win_settings_disk.h b/src/win/win_settings_disk.h index 31eb9a9..4ad1175 100644 --- a/src/win/win_settings_disk.h +++ b/src/win/win_settings_disk.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_disk.h 1.0.9 2018/05/11 + * Version: @(#)win_settings_disk.h 1.0.12 2018/05/27 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -64,6 +64,16 @@ static int hdlv_current_sel; static int next_free_id = 0; +static int +combo_to_ids(int id) +{ + if (id == 0) + return(IDS_DISABLED); + + return(IDS_3515 + id - 1); +} + + static void disk_track_init(void) { @@ -73,7 +83,7 @@ disk_track_init(void) for (i = 0; i < 16; i++) scsi_tracking[i] = 0; - for (i=0; i> 1, i & 1); + swprintf(temp, sizeof_w(temp), L"%01i:%01i", i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_ID); for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), L"%i", i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), L"%i", i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), L"%01i:%01i", i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } @@ -341,7 +352,7 @@ disk_recalc_location_controls(HWND hdlg, int is_add_dlg, int assign_id) SendMessage(h, CB_SETCURSEL, is_add_dlg ? new_hdd.id.ide_channel : temp_hdd[hdlv_current_sel].id.ide_channel, 0); break; - case HDD_BUS_SCSI: /* SCSI */ + case HDD_BUS_SCSI: /* SCSI */ case HDD_BUS_SCSI_REMOVABLE: /* SCSI (removable) */ h = GetDlgItem(hdlg, IDT_1723); ShowWindow(h, SW_SHOW); @@ -464,27 +475,33 @@ disk_update_item(HWND hwndList, int i, int column) if (column == 0) { switch(temp_hdd[i].bus) { case HDD_BUS_ST506: - swprintf(temp, sizeof_w(temp), get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.st506_channel >> 1, + temp_hdd[i].id.st506_channel & 1); break; case HDD_BUS_ESDI: - swprintf(temp, sizeof_w(temp), get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.esdi_channel >> 1, + temp_hdd[i].id.esdi_channel & 1); break; case HDD_BUS_IDE_PIO_ONLY: - swprintf(temp, sizeof_w(temp), get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); - break; - case HDD_BUS_IDE_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.ide_channel >> 1, + temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); - break; - case HDD_BUS_SCSI_REMOVABLE: - swprintf(temp, sizeof_w(temp), get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.scsi.id, + temp_hdd[i].id.scsi.lun); break; } @@ -494,19 +511,19 @@ disk_update_item(HWND hwndList, int i, int column) lvI.pszText = temp_hdd[i].fn; lvI.iImage = 0; } else if (column == 2) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].tracks); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].tracks); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 3) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].hpc); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].hpc); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 4) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].spt); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].spt); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 5) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); + swprintf(temp, sizeof_w(temp), L"%i", (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); lvI.pszText = temp; lvI.iImage = 0; } @@ -547,27 +564,33 @@ disk_recalc_list(HWND hwndList) switch(temp_hdd[i].bus) { case HDD_BUS_ST506: - swprintf(temp, sizeof_w(temp), get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.st506_channel >> 1, + temp_hdd[i].id.st506_channel & 1); break; case HDD_BUS_ESDI: - swprintf(temp, sizeof_w(temp), get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.esdi_channel >> 1, + temp_hdd[i].id.esdi_channel & 1); break; case HDD_BUS_IDE_PIO_ONLY: - swprintf(temp, sizeof_w(temp), get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); - break; - case HDD_BUS_IDE_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.ide_channel >> 1, + temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); - break; - case HDD_BUS_SCSI_REMOVABLE: - swprintf(temp, sizeof_w(temp), get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_ids(temp_hdd[i].bus)), + temp_hdd[i].id.scsi.id, + temp_hdd[i].id.scsi.lun); break; } @@ -583,28 +606,28 @@ disk_recalc_list(HWND hwndList) if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 2; - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].tracks); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].tracks); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 3; - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].hpc); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].hpc); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 4; - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].spt); + swprintf(temp, sizeof_w(temp), L"%i", temp_hdd[i].spt); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 5; - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); + swprintf(temp, sizeof_w(temp), L"%i", (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; @@ -631,31 +654,40 @@ disk_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = iCol; - lvc.pszText = (LPTSTR)get_string(2082 + iCol); switch(iCol) { case 0: /* Bus */ + lvc.pszText = (LPTSTR)get_string(IDS_3504); lvc.cx = 135; lvc.fmt = LVCFMT_LEFT; break; case 1: /* File */ + lvc.pszText = (LPTSTR)get_string(IDS_3505); lvc.cx = 150; lvc.fmt = LVCFMT_LEFT; break; case 2: /* Cylinders */ + lvc.pszText = (LPTSTR)get_string(IDS_3506); lvc.cx = 41; lvc.fmt = LVCFMT_RIGHT; break; case 3: /* Heads */ + lvc.pszText = (LPTSTR)get_string(IDS_3507); + lvc.cx = 25; + lvc.fmt = LVCFMT_RIGHT; + break; + case 4: /* Sectors */ + lvc.pszText = (LPTSTR)get_string(IDS_3508); lvc.cx = 25; lvc.fmt = LVCFMT_RIGHT; break; case 5: /* Size (MB) 8 */ + lvc.pszText = (LPTSTR)get_string(IDS_3509); lvc.cx = 41; lvc.fmt = LVCFMT_RIGHT; break; @@ -699,7 +731,7 @@ set_edit_box_contents(HWND hdlg, int id, uint64_t val) HWND h; h = GetDlgItem(hdlg, id); - swprintf(temp, sizeof_w(temp), get_string(IDS_2156), val); + swprintf(temp, sizeof_w(temp), L"%" PRIu64, val); SendMessage(h, WM_SETTEXT, (WPARAM)wcslen(temp), (LPARAM)temp); } @@ -707,7 +739,7 @@ set_edit_box_contents(HWND hdlg, int id, uint64_t val) static uint64_t disk_initialize_hdt(HWND hdlg) { - WCHAR temp[128]; + WCHAR temp[128], temp2[128]; uint64_t temp_size = 0; uint64_t size_mb = 0; HWND h; @@ -719,17 +751,23 @@ disk_initialize_hdt(HWND hdlg) for (i = 0; i < 127; i++) { temp_size = hdd_table[i].cyls * hdd_table[i].head * hdd_table[i].sect; size_mb = temp_size >> 11; - swprintf(temp, sizeof_w(temp), - get_string(IDS_2157), - size_mb, hdd_table[i].cyls, - hdd_table[i].head, hdd_table[i].sect); + swprintf(temp, sizeof_w(temp), L"%" PRIu64, size_mb); + swprintf(temp2, sizeof_w(temp2), get_string(IDS_3510), + hdd_table[i].cyls, hdd_table[i].head, hdd_table[i].sect); + wcscat(temp, L" "); + wcscat(temp, temp2); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); if ((tracks == hdd_table[i].cyls) && (hpc == hdd_table[i].head) && (spt == hdd_table[i].sect)) selection = i; } - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4100)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4101)); + /* + * Add the "Custom" and "Custom (large)" strings. + * Maybe we should have these first in the list? + */ + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_3511)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_3512)); + SendMessage(h, CB_SETCURSEL, selection & 0xffff, 0); return selection; @@ -745,7 +783,8 @@ disk_recalc_selection(HWND hdlg) selection = 127; h = GetDlgItem(hdlg, IDC_COMBO_HD_TYPE); for (i = 0; i < 127; i++) { - if ((tracks == hdd_table[i].cyls) && (hpc == hdd_table[i].head) && (spt == hdd_table[i].sect)) + if ((tracks == hdd_table[i].cyls) && + (hpc == hdd_table[i].head) && (spt == hdd_table[i].sect)) selection = i; } @@ -791,8 +830,9 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) hdd_ptr = &(temp_hdd[next_free_id]); } - SetWindowText(hdlg, get_string((existing & 1) ? IDS_4103 : IDS_4102)); - + /* Override the window title. */ + SetWindowText(hdlg, get_string((existing & 1) ? IDS_3527 + : IDS_3526)); no_update = 1; spt = (existing & 1) ? 0 : 17; set_edit_box_contents(hdlg, IDC_EDIT_HD_SPT, spt); @@ -838,13 +878,16 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) disk_recalc_location_controls(hdlg, 1, 0); if (existing & 2) { - /* We're functioning as a load image dialog for a removable SCSI hard disk, - called from win.c, so let's hide the bus selection as we should not - allow it at this point. */ + /* + * If we are being called as a "load image" dialog + * for a removable disk, disable the bus selection. + */ EnableWindow(h, FALSE); ShowWindow(h, SW_HIDE); - h = GetDlgItem(hdlg, 1798); + /* Disable and hide the IDE CHANNEL combo box. */ + h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL); + EnableWindow(h, FALSE); ShowWindow(h, SW_HIDE); /* Disable and hide the SCSI ID and LUN combo boxes. */ @@ -856,9 +899,10 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) EnableWindow(h, FALSE); ShowWindow(h, SW_HIDE); - /* Set the file name edit box contents to our existing parameters. */ + /* Set the file name edit box to current name. */ h = GetDlgItem(hdlg, IDC_EDIT_HD_FILE_NAME); - SendMessage(h, WM_SETTEXT, 0, (LPARAM) hdd[next_free_id].fn); + SendMessage(h, WM_SETTEXT, 0, + (LPARAM)hdd[next_free_id].fn); } else { channel = next_free_ide_channel(); next_free_scsi_id_and_lun(&id, &lun); @@ -902,7 +946,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) /* Make sure no file name is allowed with removable SCSI hard disks. */ if ((wcslen(hd_file_name) == 0) && (hdd_ptr->bus != HDD_BUS_SCSI_REMOVABLE)) { hdd_ptr->bus = HDD_BUS_DISABLED; - settings_msgbox(MBX_ERROR, (wchar_t *)IDS_4112); + settings_msgbox(MBX_ERROR, (wchar_t *)IDS_INV_NAME); return TRUE; } else if ((wcslen(hd_file_name) == 0) && (hdd_ptr->bus == HDD_BUS_SCSI_REMOVABLE)) { /* Mark hard disk added but return empty - it will signify the disk was ejected. */ @@ -967,7 +1011,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) if (image_is_hdi(hd_file_name)) { if (size >= 0x100000000ll) { fclose(f); - settings_msgbox(MBX_ERROR, (wchar_t *)IDS_4104); + settings_msgbox(MBX_ERROR, (wchar_t *)IDS_3536); return TRUE; } @@ -986,7 +1030,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } else if (image_is_hdx(hd_file_name, 0)) { if (size > 0xffffffffffffffffll) { fclose(f); - settings_msgbox(MBX_ERROR, (wchar_t *)IDS_4105); + settings_msgbox(MBX_ERROR, (wchar_t *)IDS_3537); return TRUE; } @@ -1048,7 +1092,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } fclose(f); - settings_msgbox(MBX_INFO, (wchar_t *)IDS_4113); + settings_msgbox(MBX_INFO, (wchar_t *)IDS_3537); } hd_add_ok_common: @@ -1065,107 +1109,109 @@ hd_add_ok_common: return TRUE; case IDC_CFILE: + memset(hd_file_name, 0x00, sizeof(hd_file_name)); b = (existing&1)?DLG_FILE_LOAD:DLG_FILE_SAVE; - if (dlg_file_ex(hdlg, get_string(IDS_4106), NULL, temp_path, b)) { - if (! wcschr(temp_path, L'.')) { - if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) { - twcs = &temp_path[wcslen(temp_path)]; - twcs[0] = L'.'; - twcs[1] = L'i'; - twcs[2] = L'm'; - twcs[3] = L'g'; - } + if (! dlg_file_ex(hdlg, get_string(IDS_3536), NULL, temp_path, b)) { + return TRUE; + } + + if (! wcschr(temp_path, L'.')) { + if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) { + twcs = &temp_path[wcslen(temp_path)]; + twcs[0] = L'.'; + twcs[1] = L'i'; + twcs[2] = L'm'; + twcs[3] = L'g'; } + } - if (! (existing & 1)) { - f = _wfopen(temp_path, L"rb"); - if (f != NULL) { - fclose(f); - if (settings_msgbox(MBX_QUESTION, (wchar_t *)IDS_4111) != 0) { /* yes */ - return FALSE; - } - } - } - - f = _wfopen(temp_path, (existing & 1) ? L"rb" : L"wb"); - if (f == NULL) { -hdd_add_file_open_error: - settings_msgbox(MBX_ERROR, (existing & 1) ? (wchar_t *)IDS_4107 : (wchar_t *)IDS_4108); - return TRUE; - } - if (existing & 1) { - if (image_is_hdi(temp_path) || image_is_hdx(temp_path, 1)) { - fseeko64(f, 0x10, SEEK_SET); - fread(§or_size, 1, 4, f); - if (sector_size != 512) { - settings_msgbox(MBX_ERROR, (wchar_t *)IDS_4109); - fclose(f); - return TRUE; - } - spt = hpc = tracks = 0; - fread(&spt, 1, 4, f); - fread(&hpc, 1, 4, f); - fread(&tracks, 1, 4, f); - } else { - fseeko64(f, 0, SEEK_END); - size = ftello64(f); - fclose(f); - if (((size % 17) == 0) && (size <= 142606336)) { - spt = 17; - if (size <= 26738688) { - hpc = 4; - } else if (((size % 3072) == 0) && (size <= 53477376)) { - hpc = 6; - } else { - for (i = 5; i < 16; i++) { - if (((size % (i << 9)) == 0) && (size <= ((i * 17) << 19))) - break; - if (i == 5) - i++; - } - hpc = i; - } - } else { - spt = 63; - hpc = 16; - } - - tracks = ((size >> 9) / hpc) / spt; - } - - if ((spt > max_spt) || (hpc > max_hpc) || (tracks > max_tracks)) { - goto hdd_add_file_open_error; - } - no_update = 1; - - set_edit_box_contents(hdlg, IDC_EDIT_HD_SPT, spt); - set_edit_box_contents(hdlg, IDC_EDIT_HD_HPC, hpc); - set_edit_box_contents(hdlg, IDC_EDIT_HD_CYL, tracks); - set_edit_box_contents(hdlg, IDC_EDIT_HD_SIZE, size >> 20); - disk_recalc_selection(hdlg); - - h = GetDlgItem(hdlg, IDC_EDIT_HD_SPT); - EnableWindow(h, TRUE); - h = GetDlgItem(hdlg, IDC_EDIT_HD_HPC); - EnableWindow(h, TRUE); - h = GetDlgItem(hdlg, IDC_EDIT_HD_CYL); - EnableWindow(h, TRUE); - h = GetDlgItem(hdlg, IDC_EDIT_HD_SIZE); - EnableWindow(h, TRUE); - h = GetDlgItem(hdlg, IDC_COMBO_HD_TYPE); - EnableWindow(h, TRUE); - - chs_enabled = 1; - - no_update = 0; - } else { + if (! (existing & 1)) { + f = _wfopen(temp_path, L"rb"); + if (f != NULL) { fclose(f); + if (settings_msgbox(MBX_QUESTION, (wchar_t *)IDS_IMG_EXIST) != 0) { /* yes */ + return FALSE; + } } } + f = _wfopen(temp_path, (existing & 1) ? L"rb" : L"wb"); + if (f == NULL) { +hdd_add_file_open_error: + settings_msgbox(MBX_ERROR, (existing & 1) ? (wchar_t *)IDS_OPEN_READ : (wchar_t *)IDS_OPEN_WRITE); + return TRUE; + } + if (existing & 1) { + if (image_is_hdi(temp_path) || image_is_hdx(temp_path, 1)) { + fseeko64(f, 0x10, SEEK_SET); + fread(§or_size, 1, 4, f); + if (sector_size != 512) { + settings_msgbox(MBX_ERROR, (wchar_t *)IDS_3535); + fclose(f); + return TRUE; + } + spt = hpc = tracks = 0; + fread(&spt, 1, 4, f); + fread(&hpc, 1, 4, f); + fread(&tracks, 1, 4, f); + } else { + fseeko64(f, 0, SEEK_END); + size = ftello64(f); + fclose(f); + if (((size % 17) == 0) && (size <= 142606336)) { + spt = 17; + if (size <= 26738688) { + hpc = 4; + } else if (((size % 3072) == 0) && (size <= 53477376)) { + hpc = 6; + } else { + for (i = 5; i < 16; i++) { + if (((size % (i << 9)) == 0) && (size <= ((i * 17) << 19))) + break; + if (i == 5) + i++; + } + hpc = i; + } + } else { + spt = 63; + hpc = 16; + } + + tracks = ((size >> 9) / hpc) / spt; + } + + if ((spt > max_spt) || (hpc > max_hpc) || (tracks > max_tracks)) { + goto hdd_add_file_open_error; + } + no_update = 1; + + set_edit_box_contents(hdlg, IDC_EDIT_HD_SPT, spt); + set_edit_box_contents(hdlg, IDC_EDIT_HD_HPC, hpc); + set_edit_box_contents(hdlg, IDC_EDIT_HD_CYL, tracks); + set_edit_box_contents(hdlg, IDC_EDIT_HD_SIZE, size >> 20); + disk_recalc_selection(hdlg); + + h = GetDlgItem(hdlg, IDC_EDIT_HD_SPT); + EnableWindow(h, TRUE); + h = GetDlgItem(hdlg, IDC_EDIT_HD_HPC); + EnableWindow(h, TRUE); + h = GetDlgItem(hdlg, IDC_EDIT_HD_CYL); + EnableWindow(h, TRUE); + h = GetDlgItem(hdlg, IDC_EDIT_HD_SIZE); + EnableWindow(h, TRUE); + h = GetDlgItem(hdlg, IDC_COMBO_HD_TYPE); + EnableWindow(h, TRUE); + + chs_enabled = 1; + + no_update = 0; + } else { + fclose(f); + } + h = GetDlgItem(hdlg, IDC_EDIT_HD_FILE_NAME); SendMessage(h, WM_SETTEXT, 0, (LPARAM)temp_path); - memset(hd_file_name, 0x00, sizeof(hd_file_name)); wcscpy(hd_file_name, temp_path); return TRUE; @@ -1453,7 +1499,7 @@ disk_add_open(HWND hwnd, int is_existing) hard_disk_added = 0; - DialogBox(hInstance, (LPCWSTR)DLG_CFG_DISK_ADD, hwnd, disk_add_proc); + DialogBox(plat_lang_dll(), (LPCWSTR)DLG_CFG_DISK_ADD, hwnd, disk_add_proc); } diff --git a/src/win/win_settings_floppy.h b/src/win/win_settings_floppy.h index b1c3ccf..04cc339 100644 --- a/src/win/win_settings_floppy.h +++ b/src/win/win_settings_floppy.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_floppy.h 1.0.5 2018/05/09 + * Version: @(#)win_settings_floppy.h 1.0.6 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -46,6 +46,7 @@ static int fd_ignore_change = 0; static int fdlv_current_sel; + static void floppy_image_list_init(HWND hwndList) { @@ -85,7 +86,7 @@ floppy_recalc_list(HWND hwndList) mbstowcs(temp, tempA, sizeof_w(temp)); lvI.pszText = temp; } else { - lvI.pszText = (LPTSTR)get_string(IDS_5376); + lvI.pszText = (LPTSTR)get_string(IDS_DISABLED); } lvI.iItem = i; lvI.iImage = temp_fdd_types[i]; @@ -93,14 +94,14 @@ floppy_recalc_list(HWND hwndList) return FALSE; lvI.iSubItem = 1; - lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_ON : IDS_OFF); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 2; - lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_ON : IDS_OFF); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -119,21 +120,21 @@ floppy_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = (LPTSTR)get_string(IDS_2143); + lvc.pszText = (LPTSTR)get_string(IDS_TYPE); // "Type" lvc.cx = 292; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = (LPTSTR)get_string(IDS_2059); + lvc.pszText = (LPTSTR)get_string(IDS_3554); // "Turbo" lvc.cx = 50; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) return FALSE; lvc.iSubItem = 2; - lvc.pszText = (LPTSTR)get_string(IDS_2170); + lvc.pszText = (LPTSTR)get_string(IDS_3555); // "bpb" lvc.cx = 75; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 2, &lvc) == -1) @@ -179,21 +180,21 @@ floppy_update_item(HWND hwndList, int i) mbstowcs(temp, tempA, sizeof_w(temp)); lvI.pszText = temp; } else { - lvI.pszText = (LPTSTR)get_string(IDS_5376); + lvI.pszText = (LPTSTR)get_string(IDS_DISABLED); } lvI.iImage = temp_fdd_types[i]; if (ListView_SetItem(hwndList, &lvI) == -1) return; lvI.iSubItem = 1; - lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_ON : IDS_OFF); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return; lvI.iSubItem = 2; - lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_ON : IDS_OFF); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -226,7 +227,8 @@ floppy_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) h = GetDlgItem(hdlg, IDC_COMBO_FD_TYPE); for (i = 0; i < 14; i++) { if (i == 0) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(IDS_DISABLED)); } else { mbstowcs(temp, fdd_getname(i), sizeof_w(temp)); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); diff --git a/src/win/win_settings_machine.h b/src/win/win_settings_machine.h index 152a850..4f677af 100644 --- a/src/win/win_settings_machine.h +++ b/src/win/win_settings_machine.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_machine.h 1.0.6 2018/05/09 + * Version: @(#)win_settings_machine.h 1.0.8 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -135,6 +135,7 @@ machine_recalc_machine(HWND hdlg) { WCHAR temp[128]; const char *stransi; + const device_t *dev; HWND h; int c = 0; int rs = 0; @@ -143,7 +144,8 @@ machine_recalc_machine(HWND hdlg) rs = machine_getromset_ex(temp_machine); h = GetDlgItem(hdlg, IDC_CONFIGURE_MACHINE); - if (machine_getdevice(temp_machine)) + dev = machine_getdevice(temp_machine); + if (dev != NULL && dev->config != NULL) EnableWindow(h, TRUE); else EnableWindow(h, FALSE); @@ -178,11 +180,11 @@ machine_recalc_machine(HWND hdlg) if (!(machines[romstomachine[rs]].flags & MACHINE_AT) || (machines[romstomachine[rs]].ram_granularity >= 128)) { SendMessage(h, UDM_SETPOS, 0, temp_mem_size); h = GetDlgItem(hdlg, IDC_TEXT_MB); - SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_2094)); + SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_3334)); } else { SendMessage(h, UDM_SETPOS, 0, temp_mem_size / 1024); h = GetDlgItem(hdlg, IDC_TEXT_MB); - SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_2087)); + SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_3330)); } } @@ -223,10 +225,10 @@ machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(h, CB_SETCURSEL, machinetolist[temp_machine], 0); h = GetDlgItem(hdlg, IDC_COMBO_WS); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2131)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_3335)); for (c = 0; c < 8; c++) { - swprintf(temp, sizeof_w(temp), get_string(2132), c); + swprintf(temp, sizeof_w(temp), L"%i", c); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } diff --git a/src/win/win_settings_periph.h b/src/win/win_settings_periph.h index 3a937d3..f91f91c 100644 --- a/src/win/win_settings_periph.h +++ b/src/win/win_settings_periph.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_periph.h 1.0.8 2018/05/09 + * Version: @(#)win_settings_periph.h 1.0.9 2018/05/29 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -150,7 +150,7 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) if (device_is_valid(dev, machines[temp_machine].flags)) { if (c == 0) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2152)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_NONE)); } else { mbstowcs(temp, stransi, sizeof_w(temp)); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); @@ -180,24 +180,30 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) recalc_hdc_list(hdlg, temp_machine, 0); h = GetDlgItem(hdlg, IDC_COMBO_IDE_TER); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(IDS_DISABLED)); for (c = 0; c < 11; c++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_2155), valid_ide_irqs[c]); + swprintf(temp, sizeof_w(temp), + L"IRQ %i", valid_ide_irqs[c]); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } if (temp_ide_ter) - SendMessage(h, CB_SETCURSEL, find_irq_in_array(temp_ide_ter_irq, 0), 0); + SendMessage(h, CB_SETCURSEL, + find_irq_in_array(temp_ide_ter_irq, 0), 0); else SendMessage(h, CB_SETCURSEL, 0, 0); h = GetDlgItem(hdlg, IDC_COMBO_IDE_QUA); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(IDS_DISABLED)); for (c = 0; c < 11; c++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_2155), valid_ide_irqs[c]); + swprintf(temp, sizeof_w(temp), + L"IRQ %i", valid_ide_irqs[c]); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } if (temp_ide_qua) - SendMessage(h, CB_SETCURSEL, find_irq_in_array(temp_ide_qua_irq, 1), 0); + SendMessage(h, CB_SETCURSEL, + find_irq_in_array(temp_ide_qua_irq, 1), 0); else SendMessage(h, CB_SETCURSEL, 0, 0); diff --git a/src/win/win_settings_remov.h b/src/win/win_settings_remov.h index fcc1426..7748294 100644 --- a/src/win/win_settings_remov.h +++ b/src/win/win_settings_remov.h @@ -8,7 +8,7 @@ * * Implementation of the "Removable Devices" dialog. * - * Version: @(#)win_settings_remov.h 1.0.6 2018/05/09 + * Version: @(#)win_settings_remov.h 1.0.7 2018/05/26 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -65,16 +65,25 @@ cdrom_track_init(void) static int -combo_to_string(int combo_id) +combo_to_string(int id) { - return IDS_5376 + combo_id; + if (id == 0) + return(IDS_DISABLED); + + return(IDS_3580 + id - 1); } -static int -combo_to_format(int combo_id) +static void +id_to_combo(HWND h, int num) { - return IDS_5632 + combo_id; + WCHAR temp[16]; + int i; + + for (i = 0; i < num; i++) { + swprintf(temp, sizeof_w(temp), L"%i", i); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); + } } @@ -111,30 +120,31 @@ cdrom_recalc_list(HWND hwndList) lvI.stateMask = lvI.iSubItem = lvI.state = 0; for (i = 0; i < 4; i++) { - fsid = combo_to_format(temp_cdrom_drives[i].bus_type); + fsid = temp_cdrom_drives[i].bus_type; lvI.iSubItem = 0; - switch (temp_cdrom_drives[i].bus_type) { + switch (fsid) { case CDROM_BUS_DISABLED: default: - lvI.pszText = (LPTSTR)get_string(fsid); + lvI.pszText = (LPTSTR)get_string(IDS_DISABLED); lvI.iImage = 0; break; case CDROM_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); - lvI.pszText = temp; - lvI.iImage = 1; - break; - case CDROM_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_string(fsid)), + temp_cdrom_drives[i].ide_channel >> 1, + temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_string(fsid)), + temp_cdrom_drives[i].scsi_device_id, + temp_cdrom_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -144,8 +154,8 @@ cdrom_recalc_list(HWND hwndList) return FALSE; lvI.iSubItem = 1; - if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) { - lvI.pszText = (LPTSTR)get_string(IDS_2152); + if (fsid == CDROM_BUS_DISABLED) { + lvI.pszText = (LPTSTR)get_string(IDS_NONE); // "None" } else { wsprintf(temp, L"%ix", cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed); @@ -169,15 +179,15 @@ cdrom_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = (LPTSTR)get_string(IDS_2082); + lvc.pszText = (LPTSTR)get_string(IDS_BUS); // "Bus" lvc.cx = 342; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = (LPTSTR)get_string(IDS_2179); - lvc.cx = 50; + lvc.pszText = (LPTSTR)get_string(IDS_3579); // "Speed" + lvc.cx = 80; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) return FALSE; @@ -217,29 +227,30 @@ cdrom_update_item(HWND hwndList, int i) lvI.iSubItem = 0; lvI.iItem = i; - fsid = combo_to_format(temp_cdrom_drives[i].bus_type); + fsid = temp_cdrom_drives[i].bus_type; - switch (temp_cdrom_drives[i].bus_type) { + switch (fsid) { case CDROM_BUS_DISABLED: default: - lvI.pszText = (LPTSTR)get_string(fsid); + lvI.pszText = (LPTSTR)get_string(IDS_DISABLED); lvI.iImage = 0; break; case CDROM_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); - lvI.pszText = temp; - lvI.iImage = 1; - break; - case CDROM_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_string(fsid)), + temp_cdrom_drives[i].ide_channel >> 1, + temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_string(fsid)), + temp_cdrom_drives[i].scsi_device_id, + temp_cdrom_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -248,8 +259,8 @@ cdrom_update_item(HWND hwndList, int i) return; lvI.iSubItem = 1; - if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) { - lvI.pszText = (LPTSTR)get_string(IDS_2152); + if (fsid == CDROM_BUS_DISABLED) { + lvI.pszText = (LPTSTR)get_string(IDS_NONE); } else { wsprintf(temp, L"%ix", cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed); @@ -272,32 +283,27 @@ cdrom_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS); for (i = CDROM_BUS_DISABLED; i <= CDROM_BUS_SCSI; i++) { if ((i == CDROM_BUS_DISABLED) || (i >= CDROM_BUS_ATAPI_PIO_ONLY)) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(combo_to_string(i))); + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(combo_to_string(i))); } } /* Create a list of usable CD-ROM speeds. */ h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED); for (i = 0; cdrom_speeds[i].speed > 0; i++) { - wsprintf(temp, L"%ix", cdrom_speeds[i]); + swprintf(temp, sizeof_w(temp), L"%ix", cdrom_speeds[i].speed); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_CD_ID); - for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); - } + id_to_combo(h, 16); h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN); - for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); - } + id_to_combo(h, 8); h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), L"%01i:%01i", i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } @@ -335,7 +341,8 @@ cdrom_recalc_location_controls(HWND hdlg, int assign_id) } else { ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_cdrom_drives[cdlv_current_sel].speed_idx, 0); + SendMessage(h, CB_SETCURSEL, + temp_cdrom_drives[cdlv_current_sel].speed_idx, 0); } switch(bus) { @@ -350,7 +357,8 @@ cdrom_recalc_location_controls(HWND hdlg, int assign_id) h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_cdrom_drives[cdlv_current_sel].ide_channel, 0); + SendMessage(h, CB_SETCURSEL, + temp_cdrom_drives[cdlv_current_sel].ide_channel, 0); break; case CDROM_BUS_SCSI: /* SCSI */ @@ -366,12 +374,14 @@ cdrom_recalc_location_controls(HWND hdlg, int assign_id) h = GetDlgItem(hdlg, IDC_COMBO_CD_ID); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_cdrom_drives[cdlv_current_sel].scsi_device_id, 0); + SendMessage(h, CB_SETCURSEL, + temp_cdrom_drives[cdlv_current_sel].scsi_device_id, 0); h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_cdrom_drives[cdlv_current_sel].scsi_device_lun, 0); + SendMessage(h, CB_SETCURSEL, + temp_cdrom_drives[cdlv_current_sel].scsi_device_lun, 0); break; } } @@ -414,7 +424,7 @@ zip_track_init(void) { int i; - for (i=0; i> 1, temp_zip_drives[i].ide_channel & 1); - lvI.pszText = temp; - lvI.iImage = 1; - break; - case ZIP_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_string(fsid)), + temp_zip_drives[i].ide_channel >> 1, + temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_string(fsid)), + temp_zip_drives[i].scsi_device_id, + temp_zip_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -491,7 +502,7 @@ zip_recalc_list(HWND hwndList) return FALSE; lvI.iSubItem = 1; - lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); + lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_3295 : IDS_3294); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -510,14 +521,14 @@ zip_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = (LPTSTR)get_string(IDS_2082); + lvc.pszText = (LPTSTR)get_string(IDS_BUS); // "Bus" lvc.cx = 342; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = (LPTSTR)get_string(IDS_2143); + lvc.pszText = (LPTSTR)get_string(IDS_TYPE); // "Type" lvc.cx = 50; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) @@ -558,29 +569,30 @@ zip_update_item(HWND hwndList, int i) lvI.iSubItem = 0; lvI.iItem = i; - fsid = combo_to_format(temp_zip_drives[i].bus_type); + fsid = temp_zip_drives[i].bus_type; - switch (temp_zip_drives[i].bus_type) { + switch (fsid) { case ZIP_BUS_DISABLED: default: - lvI.pszText = (LPTSTR)get_string(fsid); + lvI.pszText = (LPTSTR)get_string(IDS_DISABLED); lvI.iImage = 0; break; case ZIP_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); - lvI.pszText = temp; - lvI.iImage = 1; - break; - case ZIP_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), L"%ls (%01i:%01i)", + get_string(combo_to_string(fsid)), + temp_zip_drives[i].ide_channel >> 1, + temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_SCSI: - swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), L"%ls (%02i:%02i)", + get_string(combo_to_string(fsid)), + temp_zip_drives[i].scsi_device_id, + temp_zip_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -589,7 +601,7 @@ zip_update_item(HWND hwndList, int i) return; lvI.iSubItem = 1; - lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); + lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_3295 : IDS_3294); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -607,25 +619,20 @@ zip_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_ZIP_BUS); for (i = ZIP_BUS_DISABLED; i <= ZIP_BUS_SCSI; i++) { if ((i == ZIP_BUS_DISABLED) || (i >= ZIP_BUS_ATAPI_PIO_ONLY)) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(combo_to_string(i))); + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(combo_to_string(i))); } } h = GetDlgItem(hdlg, IDC_COMBO_ZIP_ID); - for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); - } + id_to_combo(h, 16); h = GetDlgItem(hdlg, IDC_COMBO_ZIP_LUN); - for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); - } + id_to_combo(h, 8); h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), L"%01i:%01i", i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } @@ -669,7 +676,8 @@ zip_recalc_location_controls(HWND hdlg, int assign_id) h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_zip_drives[zdlv_current_sel].ide_channel, 0); + SendMessage(h, CB_SETCURSEL, + temp_zip_drives[zdlv_current_sel].ide_channel, 0); break; case ZIP_BUS_SCSI: /* SCSI */ @@ -685,12 +693,14 @@ zip_recalc_location_controls(HWND hdlg, int assign_id) h = GetDlgItem(hdlg, IDC_COMBO_ZIP_ID); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_zip_drives[zdlv_current_sel].scsi_device_id, 0); + SendMessage(h, CB_SETCURSEL, + temp_zip_drives[zdlv_current_sel].scsi_device_id, 0); h = GetDlgItem(hdlg, IDC_COMBO_ZIP_LUN); ShowWindow(h, SW_SHOW); EnableWindow(h, TRUE); - SendMessage(h, CB_SETCURSEL, temp_zip_drives[zdlv_current_sel].scsi_device_lun, 0); + SendMessage(h, CB_SETCURSEL, + temp_zip_drives[zdlv_current_sel].scsi_device_lun, 0); break; } } @@ -802,7 +812,8 @@ rmv_devices_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(h, CB_SETCURSEL, b, 0); zip_recalc_location_controls(hdlg, 0); h = GetDlgItem(hdlg, IDC_CHECK250); - SendMessage(h, BM_SETCHECK, temp_zip_drives[zdlv_current_sel].is_250, 0); + SendMessage(h, BM_SETCHECK, + temp_zip_drives[zdlv_current_sel].is_250, 0); rd_ignore_change = 0; return TRUE; @@ -879,7 +890,8 @@ rmv_devices_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(h, CB_SETCURSEL, b, 0); zip_recalc_location_controls(hdlg, 0); h = GetDlgItem(hdlg, IDC_CHECK250); - SendMessage(h, BM_SETCHECK, temp_zip_drives[zdlv_current_sel].is_250, 0); + SendMessage(h, BM_SETCHECK, + temp_zip_drives[zdlv_current_sel].is_250, 0); } rd_ignore_change = 0; break; diff --git a/src/win/win_settings_sound.h b/src/win/win_settings_sound.h index 3c56311..f2a9fd1 100644 --- a/src/win/win_settings_sound.h +++ b/src/win/win_settings_sound.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_sound.h 1.0.8 2018/05/13 + * Version: @(#)win_settings_sound.h 1.0.9 2018/05/21 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -101,7 +101,6 @@ sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_INITDIALOG: -pclog("SND: temp_sound = %d\n", temp_sound_card); h = GetDlgItem(hdlg, IDC_COMBO_SOUND); c = d = 0; while (1) { @@ -118,7 +117,6 @@ pclog("SND: temp_sound = %d\n", temp_sound_card); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); list_to_sound[d] = c; d++; -pclog("SND: list[%d] = %d (%s)\n", d, c, stransi); } } diff --git a/src/win/win_settings_video.h b/src/win/win_settings_video.h index 37df562..59186fb 100644 --- a/src/win/win_settings_video.h +++ b/src/win/win_settings_video.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_video.h 1.0.5 2018/05/09 + * Version: @(#)win_settings_video.h 1.0.6 2018/05/24 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -101,7 +101,7 @@ video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { WCHAR temp[128]; char tempA[128]; - int vid; + int vid, i; HWND h; switch (message) { @@ -109,13 +109,10 @@ video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) recalc_vid_list(hdlg); h = GetDlgItem(hdlg, IDC_COMBO_VIDEO_SPEED); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2131)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2133)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2134)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2135)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2136)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2137)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2138)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_3353)); + for (i = 0; i < 6; i++) + SendMessage(h, CB_ADDSTRING, 0, + (LPARAM)get_string(IDS_3354 + i)); SendMessage(h, CB_SETCURSEL, temp_video_speed+1, 0); h = GetDlgItem(hdlg, IDC_CHECK_VOODOO); diff --git a/src/win/win_snd_gain.c b/src/win/win_snd_gain.c index 69c2e26..0f4170d 100644 --- a/src/win/win_snd_gain.c +++ b/src/win/win_snd_gain.c @@ -8,7 +8,7 @@ * * Implementation of the Sound Gain dialog. * - * Version: @(#)win_snd_gain.c 1.0.6 2018/05/06 + * Version: @(#)win_snd_gain.c 1.0.7 2018/05/19 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -108,5 +108,5 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) void dlg_sound_gain(void) { - DialogBox(hInstance, (LPCTSTR)DLG_SND_GAIN, hwndMain, dlg_proc); + DialogBox(plat_lang_dll(), (LPCTSTR)DLG_SND_GAIN, hwndMain, dlg_proc); } diff --git a/src/win/win_status.c b/src/win/win_status.c index e946087..ceaece3 100644 --- a/src/win/win_status.c +++ b/src/win/win_status.c @@ -8,7 +8,7 @@ * * Implementation of the Status Window dialog. * - * Version: @(#)win_status.c 1.0.6 2018/05/06 + * Version: @(#)win_status.c 1.0.7 2018/05/19 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -144,7 +144,7 @@ dlg_status(void) { HWND hwnd; - hwnd = CreateDialog(hInstance, (LPCSTR)DLG_STATUS, hwndMain, dlg_proc); + hwnd = CreateDialog(plat_lang_dll(), (LPCSTR)DLG_STATUS, hwndMain, dlg_proc); ShowWindow(hwnd, SW_SHOW); } diff --git a/src/win/win_ui.c b/src/win/win_ui.c index f924961..7fb19f5 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -8,7 +8,7 @@ * * Implement the user Interface module. * - * Version: @(#)win_ui.c 1.0.24 2018/05/12 + * Version: @(#)win_ui.c 1.0.25 2018/05/27 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -77,8 +77,10 @@ int infocus = 1; /* Local data. */ static wchar_t wTitle[512]; static HHOOK hKeyboardHook; -static LONG_PTR OriginalProcedure; -static HWND hwndSBAR = NULL; /* application status bar */ +static LONG_PTR input_orig_proc, + stbar_orig_proc; +static HWND input_orig_hwnd = NULL, + hwndSBAR = NULL; /* application status bar */ static HMENU menuMain = NULL, /* application menu bar */ menuSBAR = NULL, /* status bar menu bar */ *sb_menu = NULL; @@ -144,7 +146,7 @@ sb_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; default: - return(CallWindowProc((WNDPROC)OriginalProcedure, + return(CallWindowProc((WNDPROC)stbar_orig_proc, hwnd, message, wParam, lParam)); } @@ -215,7 +217,7 @@ StatusBarCreate(uintptr_t id) cruft_sb = SB_HEIGHT + (2 * borders[1]) + (2 * SB_PADDING); /* Replace the original procedure with ours. */ - OriginalProcedure = GetWindowLongPtr(hwndSBAR, GWLP_WNDPROC); + stbar_orig_proc = GetWindowLongPtr(hwndSBAR, GWLP_WNDPROC); SetWindowLongPtr(hwndSBAR, GWL_WNDPROC, (LONG_PTR)sb_dlg_proc); SendMessage(hwndSBAR, SB_SETMINHEIGHT, (WPARAM)SB_HEIGHT, (LPARAM)0); @@ -386,9 +388,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) window_w = rect.right - rect.left; window_h = rect.bottom - rect.top; save_window_pos = 1; - } - config_save(); + config_save(); + } break; case WM_MOVE: @@ -496,7 +498,7 @@ ui_init(int nCmdShow) if (settings_only) { if (! pc_init()) { /* Dang, no ROMs found at all! */ - ui_msgbox(MBX_ERROR, (wchar_t *)IDS_2056); + ui_msgbox(MBX_ERROR, (wchar_t *)IDS_ERR_NOROMS); return(6); } @@ -528,7 +530,10 @@ ui_init(int nCmdShow) return(2); /* Load the Window Menu(s) from the resources. */ - menuMain = LoadMenu(hInstance, MENU_NAME); + menuMain = LoadMenu(plat_lang_dll(), MENU_NAME); + + /* Load the Languages into the current menu. */ + plat_lang_menu(); /* Set up main window for resizing if configured. */ flags = WS_OVERLAPPEDWINDOW; @@ -575,7 +580,7 @@ ui_init(int nCmdShow) /* Load the accelerator table */ haccel = LoadAccelerators(hInstance, ACCEL_NAME); if (haccel == NULL) { - ui_msgbox(MBX_CONFIG, (wchar_t *)IDS_2153); + ui_msgbox(MBX_CONFIG, (wchar_t *)IDS_ERR_ACCEL); return(3); } @@ -589,7 +594,7 @@ ui_init(int nCmdShow) ridev.dwFlags = RIDEV_NOHOTKEYS; ridev.hwndTarget = NULL; /* current focus window */ if (! RegisterRawInputDevices(&ridev, 1, sizeof(ridev))) { - ui_msgbox(MBX_CONFIG, (wchar_t *)IDS_2154); + ui_msgbox(MBX_CONFIG, (wchar_t *)IDS_ERR_INPUT); return(4); } keyboard_getkeymap(); @@ -625,11 +630,18 @@ ui_init(int nCmdShow) config_save(); /* Remind them to restart. */ - ui_msgbox(MBX_INFO, (wchar_t *)IDS_2062); + ui_msgbox(MBX_INFO, (wchar_t *)IDS_MSG_RESTART); } return(0); } + /* Activate the render window, this will also set the screen size. */ + if (hwndRender != NULL) + MoveWindow(hwndRender, 0, 0, scrnsz_x, scrnsz_y, TRUE); + + /* Create the status bar window. */ + StatusBarCreate(IDC_STATBAR); + /* Initialize the configured Video API. */ again: if (! vidapi_set(vid_api)) { @@ -643,7 +655,8 @@ again: * Inform the user, and ask if they want to reset * to the system default one instead. */ - _swprintf(title, get_string(IDS_2095), vidapi_internal_name(vid_api)); + _swprintf(title, get_string(IDS_ERR_NORENDR), + vidapi_internal_name(vid_api)); if (ui_msgbox(MBX_CONFIG, title) != 0) { /* Nope, they don't, so just exit. */ return(5); @@ -658,13 +671,6 @@ again: if (start_in_fullscreen) plat_setfullscreen(1); - /* Activate the render window, this will also set the screen size. */ - if (hwndRender != NULL) - MoveWindow(hwndRender, 0, 0, scrnsz_x, scrnsz_y, TRUE); - - /* Create the status bar window. */ - StatusBarCreate(IDC_STATBAR); - /* Initialize the mouse module. */ win_mouse_init(); @@ -731,8 +737,6 @@ again: /* Catch WM_INPUT messages for 'current focus' window. */ -static LONG_PTR input_orig_proc; -static HWND input_orig_hwnd = NULL; #ifdef __amd64__ static LRESULT CALLBACK #else @@ -835,18 +839,35 @@ ui_resize(int x, int y) /* - * Re-load and reset all menus. + * Re-load and reset the entire UI. * - * We should have the language ID as a parameter. + * This is needed after we change the language. */ void -ui_menu_update(void) +ui_update(void) { - menuMain = LoadMenu(hInstance, MENU_NAME); + int i; + + /* Load the main menu from the appropriate DLL. */ + menuMain = LoadMenu(plat_lang_dll(), MENU_NAME); SetMenu(hwndMain, menuMain); + /* Load the statusbar menu. */ menuSBAR = LoadMenu(hInstance, SB_MENU_NAME); + + /* Reset all main menu items. */ ui_menu_reset_all(); + + /* Load the Languages into the current menu. */ + plat_lang_menu(); + + /* Update the statusbar menus. */ + ui_sb_update(); + + /* Reset the mouse-capture message. */ + i = mouse_capture; + mouse_capture = !mouse_capture; + plat_mouse_capture(i); } @@ -916,7 +937,7 @@ plat_setfullscreen(int on) if (on && vid_fullscreen_first) { vid_fullscreen_first = 0; - ui_msgbox(MBX_INFO, (wchar_t *)IDS_2107); + ui_msgbox(MBX_INFO, (wchar_t *)IDS_MSG_WINDOW); } /* OK, claim the video. */ @@ -979,12 +1000,26 @@ plat_pause(int p) void plat_mouse_capture(int on) { + const wchar_t *str = NULL; RECT rect; /* Do not try to capture the mouse if no mouse configured. */ if (mouse_type == MOUSE_NONE) return; - if (on && !mouse_capture) { + if ((on == -1) || (!on && mouse_capture)) { + /* Disable the in-app mouse. */ + if (on == -1) + GetClipCursor(&oldclip); + else + ClipCursor(&oldclip); + + ui_show_cursor(-1); + + str = get_string(IDS_MSG_CAPTURE); + + /* We no longer have the mouse. */ + mouse_capture = 0; + } else if (on && !mouse_capture) { /* Enable the in-app mouse. */ GetClipCursor(&oldclip); GetWindowRect(hwndRender, &rect); @@ -992,15 +1027,45 @@ plat_mouse_capture(int on) ui_show_cursor(0); + if (mouse_get_buttons() > 2) + str = get_string(IDS_MSG_MRLS_1); + else + str = get_string(IDS_MSG_MRLS_2); + + /* We got the mouse. */ mouse_capture = 1; - } else if (!on && mouse_capture) { - /* Disable the in-app mouse. */ - ClipCursor(&oldclip); - - ui_show_cursor(-1); - - mouse_capture = 0; } + + /* Set the correct message on the status bar. */ + if (str != NULL) + ui_sb_text_set_w(str); +} + + +/* Add an item to a menu. */ +void +menu_add_item(int idm, int new_id, const wchar_t *str) +{ + MENUITEMINFO info; + HMENU menu; + + /* Get the handle for the intended (sub)menu. */ + memset(&info, 0x00, sizeof(info)); + info.cbSize = sizeof(info); + info.fMask = MIIM_SUBMENU; + if (! GetMenuItemInfo(menuMain, idm, FALSE, &info)) { + pclog("UI: cannot find submenu %d\n", idm); + return; + } + menu = info.hSubMenu; + + if (new_id >= 0) + AppendMenu(menu, MF_STRING, new_id, str); + else + AppendMenu(menu, MF_SEPARATOR, 0, NULL); + + /* We changed the menu bar, so redraw it. */ + DrawMenuBar(hwndMain); }