src/osd/windows/winmenu.c
| r0 | r10285 | |
| 1 | //============================================================ |
| 2 | // |
| 3 | // winmenu.c - Win32 OSD core dummy menu implementation |
| 4 | // |
| 5 | //============================================================ |
| 6 | // |
| 7 | // Copyright Aaron Giles |
| 8 | // All rights reserved. |
| 9 | // |
| 10 | // Redistribution and use in source and binary forms, with or |
| 11 | // without modification, are permitted provided that the |
| 12 | // following conditions are met: |
| 13 | // |
| 14 | // * Redistributions of source code must retain the above |
| 15 | // copyright notice, this list of conditions and the |
| 16 | // following disclaimer. |
| 17 | // * Redistributions in binary form must reproduce the |
| 18 | // above copyright notice, this list of conditions and |
| 19 | // the following disclaimer in the documentation and/or |
| 20 | // other materials provided with the distribution. |
| 21 | // * Neither the name 'MAME' nor the names of its |
| 22 | // contributors may be used to endorse or promote |
| 23 | // products derived from this software without specific |
| 24 | // prior written permission. |
| 25 | // |
| 26 | // THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND |
| 27 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 28 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 29 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
| 30 | // EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, |
| 31 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 32 | // DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 33 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 34 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 35 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 36 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 37 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 38 | // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 39 | // |
| 40 | //============================================================ |
| 41 | |
| 42 | // standard windows headers |
| 43 | #define WIN32_LEAN_AND_MEAN |
| 44 | #include <windows.h> |
| 45 | |
| 46 | #include "window.h" |
| 47 | |
| 48 | //============================================================ |
| 49 | // winwindow_video_window_proc_ui |
| 50 | // (window thread) |
| 51 | //============================================================ |
| 52 | |
| 53 | LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) |
| 54 | { |
| 55 | return winwindow_video_window_proc(wnd, message, wparam, lparam); |
| 56 | } |
| 57 | |
| 58 | //============================================================ |
| 59 | // win_create_menu |
| 60 | //============================================================ |
| 61 | |
| 62 | int win_create_menu(running_machine *machine, HMENU *menus) |
| 63 | { |
| 64 | return 0; |
| 65 | } |
| | No newline at end of file |
src/osd/windows/input.c
| r10284 | r10285 | |
| 1486 | 1486 | |
| 1487 | 1487 | static BOOL CALLBACK dinput_joystick_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref) |
| 1488 | 1488 | { |
| 1489 | | DWORD cooperative_level = (HAS_WINDOW_MENU ? DISCL_BACKGROUND : DISCL_FOREGROUND) | DISCL_EXCLUSIVE; |
| 1489 | DWORD cooperative_level = DISCL_FOREGROUND | DISCL_EXCLUSIVE; |
| 1490 | 1490 | int axisnum, axiscount, povnum, butnum; |
| 1491 | 1491 | running_machine *machine = (running_machine *)ref; |
| 1492 | 1492 | device_info *devinfo; |
| 1493 | 1493 | HRESULT result; |
| 1494 | 1494 | |
| 1495 | if (win_window_list != NULL && win_has_menu(win_window_list)) { |
| 1496 | cooperative_level = DISCL_BACKGROUND | DISCL_EXCLUSIVE; |
| 1497 | } |
| 1495 | 1498 | // allocate and link in a new device |
| 1496 | 1499 | devinfo = dinput_device_create(machine, &joystick_list, instance, &c_dfDIJoystick, NULL, cooperative_level); |
| 1497 | 1500 | if (devinfo == NULL) |
src/osd/windows/winmain.c
| r10284 | r10285 | |
| 312 | 312 | { "prescale", "1", 0, "scale screen rendering by this amount in software" }, |
| 313 | 313 | { "waitvsync", "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" }, |
| 314 | 314 | { "syncrefresh", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" }, |
| 315 | { "menu", "0", OPTION_BOOLEAN, "enable menu bar if available by UI implementation" }, |
| 315 | 316 | |
| 316 | 317 | // DirectDraw-specific options |
| 317 | 318 | { NULL, NULL, OPTION_HEADER, "DIRECTDRAW-SPECIFIC OPTIONS" }, |
src/osd/windows/window.c
| r10284 | r10285 | |
| 830 | 830 | // initialize the description of the window class |
| 831 | 831 | wc.lpszClassName = TEXT("MAME"); |
| 832 | 832 | wc.hInstance = GetModuleHandle(NULL); |
| 833 | | #ifdef MENU_BAR |
| 834 | | LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 835 | 833 | wc.lpfnWndProc = winwindow_video_window_proc_ui; |
| 836 | | #else |
| 837 | | wc.lpfnWndProc = winwindow_video_window_proc; |
| 838 | | #endif |
| 839 | 834 | wc.hCursor = LoadCursor(NULL, IDC_ARROW); |
| 840 | 835 | wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); |
| 841 | 836 | |
| r10284 | r10285 | |
| 1126 | 1121 | monitorbounds = window->monitor->info.rcMonitor; |
| 1127 | 1122 | |
| 1128 | 1123 | // create the window menu if needed |
| 1129 | | #if HAS_WINDOW_MENU |
| 1130 | | if (win_create_menu(window->machine, &menu)) |
| 1131 | | return 1; |
| 1132 | | #endif |
| 1124 | if (options_get_bool(mame_options(), "menu")) { |
| 1125 | if (win_create_menu(window->machine, &menu)) |
| 1126 | return 1; |
| 1127 | } |
| 1133 | 1128 | |
| 1134 | 1129 | // create the window, but don't show it yet |
| 1135 | 1130 | window->hwnd = win_create_window_ex_utf8( |
| r10284 | r10285 | |
| 1221 | 1216 | |
| 1222 | 1217 | // non-client paint: punt if full screen |
| 1223 | 1218 | case WM_NCPAINT: |
| 1224 | | if (!window->fullscreen || HAS_WINDOW_MENU) |
| 1219 | if (!window->fullscreen || win_has_menu(window)) |
| 1225 | 1220 | return DefWindowProc(wnd, message, wparam, lparam); |
| 1226 | 1221 | break; |
| 1227 | 1222 | |
src/osd/windows/window.h
| r10284 | r10285 | |
| 50 | 50 | // PARAMETERS |
| 51 | 51 | //============================================================ |
| 52 | 52 | |
| 53 | | #ifndef MENU_BAR |
| 54 | | #define HAS_WINDOW_MENU FALSE |
| 55 | | #else |
| 56 | | #define HAS_WINDOW_MENU TRUE |
| 57 | | #endif |
| 58 | 53 | |
| 59 | | |
| 60 | | |
| 61 | 54 | //============================================================ |
| 62 | 55 | // CONSTANTS |
| 63 | 56 | //============================================================ |
| r10284 | r10285 | |
| 153 | 146 | win_monitor_info *winwindow_video_window_monitor(win_window_info *window, const RECT *proposed); |
| 154 | 147 | |
| 155 | 148 | LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 149 | extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 150 | |
| 156 | 151 | void winwindow_toggle_full_screen(void); |
| 157 | 152 | |
| 158 | 153 | void winwindow_process_events_periodic(running_machine *machine); |
src/osd/winui/mameui.rc
| r10284 | r10285 | |
| 1027 | 1027 | PUSHBUTTON "Reset",IDC_PROP_RESET,4,222,97,14,0,0,HIDC_PROP_RESET |
| 1028 | 1028 | PUSHBUTTON "Restore Default Settings",IDC_USE_DEFAULT,118,222,97,14, |
| 1029 | 1029 | 0,0,HIDC_USE_DEFAULT |
| 1030 | CONTROL "Show Menu",IDC_SHOW_MENU,"Button", |
| 1031 | BS_AUTOCHECKBOX | WS_TABSTOP,119,134,86,10,0 |
| 1032 | |
| 1030 | 1033 | END |
| 1031 | 1034 | |
| 1032 | 1035 | IDD_PROP_VECTOR DIALOGEX 0, 0, 220, 240 |