summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/uiinput.h
Commit message (Collapse)AuthorAgeFilesLines
* Initial touch input support: Vas Crabb2024-04-121-47/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-1/+1
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* -A few incremental UI code improvements: Vas Crabb2021-03-121-14/+15
| | | | | | | | | * Simplified message when toggling UI controls. * Show actual configured UI toggle key, not misleading hard-coded text. * Push window activated/deactivated events to UI manager. * Simplified SDL window event handling code - events are pretty precise. -Miscellaneous code cleanup.
* Miscellaneous cleanup: Vas Crabb2020-10-101-14/+13
| | | | | * osd/windows: Use steady clock for timing double-clicks. * emu/uiinput.cpp: Made the event type a scoped enum.
* emu: correct some file headers (nw) hap2020-06-191-0/+1
|
* srcclean (nw) Vas Crabb2019-07-281-1/+1
|
* Added ui_input_manager::[set_]presses_enabled() and exposed to LUA npwoods2019-07-211-0/+5
|
* Don't process every character individually when searching - this reduces Vas Crabb2017-08-101-15/+18
| | | | | | lag if you keep typing while a big list is searched. (nw) patch up German translation
* general cleanup: Vas Crabb2017-05-231-3/+1
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-18/+18
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-2/+2
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-13/+13
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-2/+2
| | | | utf16_char, unicode_char (nw)
* Ioport refactoring and cleanups (nw) AJR2016-05-181-3/+5
| | | | | | - Completely move mouse hit testing down into the UI input module. This reduces some dependencies. - Never return a null pointer from ioport_field::name() to prevent potential crashes. All anonymous inputs are classified as INPUT_CLASS_INTERNAL, so several frontend functions now check type_class instead. - Correct a couple of typos.
* ui: Re-enabled configuration menu for single-machine and added some options. dankan18902016-04-151-0/+4
| | | | Adding handler for the right mouse button in the main menu, calls the machine configuration.
* Initial import of MEWUI to MAME [Dankan1890] Dankan18902016-02-041-0/+4
|
* Do not handle any UI inputs immediately after state load/save Victor Vasiliev2016-02-021-0/+2
| | | | | | | | Before this change, if you try to save state to a bound which already does something as a UI button, it will save state there and then immediately execute the bound action (sometimes it would not happen). So, if you have state to P, with default button it would pause the game immediately after saving state (except sometimes it would not).
* Cleanups and version bumpmame0170 Miodrag Milanovic2016-01-271-1/+1
|
* fix clang build (nw) Miodrag Milanovic2016-01-111-2/+0
|
* modernized ui_input_manager (nw) Miodrag Milanovic2016-01-101-124/+51
|
* macro removal INLINE -> static inline (nw) Miodrag Milanovic2015-12-121-6/+6
|
* Added some for Nathan and some more for Nicola (nw) Miodrag Milanovic2015-05-111-6/+2
|
* Added dummy license headers for EMU section (nw) Miodrag Milanovic2015-05-071-0/+2
|
* reverting to classic ui due to lot of issues, as much as I hate reverting ↵ Miodrag Milanovic2014-04-171-0/+1
| | | | some else code (nw)
* Merge of new menubar code Nathan Woods2014-04-121-1/+0
|
* Moved src/emu/uigfx.? ==> src/emu/ui/viewgfx.?, move C++-ifications Nathan Woods2014-01-251-2/+2
|
* Unglamorous changes from my UI rewrite Jürgen Buchmüller2014-01-171-3/+3
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-7/+7
|
* First pass at modernizing struct definitions. Aaron Giles2012-09-151-4/+2
|
* BIG update. Aaron Giles2011-03-291-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove redundant machine items from address_space and device_t. Neither machine nor m_machine are directly accessible anymore. Instead a new getter machine() is available which returns a machine reference. So: space->machine->xxx ==> space->machine().xxx device->machine->yyy ==> device->machine().yyy Globally changed all running_machine pointers to running_machine references. Any function/method that takes a running_machine takes it as a required parameter (1 or 2 exceptions). Being consistent here gets rid of a lot of odd &machine or *machine, but it does mean a very large bulk change across the project. Structs which have a running_machine * now have that variable renamed to m_machine, and now have a shiny new machine() method that works like the space and device methods above. Since most of these are things that should eventually be devices anyway, consider this a step in that direction. 98% of the update was done with regex searches. The changes are architected such that the compiler will catch the remaining errors: // find things that use an embedded machine directly and replace // with a machine() getter call S: ->machine-> R: ->machine\(\)\. // do the same if via a reference S: \.machine-> R: \.machine\(\)\. // convert function parameters to running_machine & S: running_machine \*machine([^;]) R: running_machine \&machine\1 // replace machine-> with machine. S: machine-> R: machine\. // replace &machine() with machine() S: \&([()->a-z0-9_]+machine\(\)) R: \1 // sanity check: look for this used as a cast (running_machine &) // and change to this: *(running_machine *)
* Split mame.c into mame.c and machine.c, the latter containing the Aaron Giles2010-06-301-1/+1
| | | | | | | | | | | | | | | | | | | running_machine definition and implementation. Moved global machine-level operations and accessors into methods on the running_machine class. For the most part, this doesn't affect drivers except for a few occasional bits: mame_get_phase() == machine->phase() add_reset_callback() == machine->add_notifier(MACHINE_NOTIFY_RESET, ...) add_exit_callback() == machine->add_notifier(MACHINE_NOTIFY_EXIT, ...) mame_get_base_datetime() == machine->base_datetime() mame_get_current_datetime() == machine->current_datetime() Cleaned up the region_info class, removing most global region accessors except for memory_region() and memory_region_length(). Again, this doesn't generally affect drivers.
* Minor changes for internal render debugger Couriersud2010-02-051-0/+2
| | | | | | | - ui_input_frame_update is now global - moved element_component from rendlay.c to rendlay.h - added ability to rendlay.c to define "container" components. These simply provide a render_container. I plan to remove the above again and simply use one container covering the whole render_target. This container will be rendered after the artwork and before the ui. For this to work, DViews need move and resize support. Render_targets will than be equivalent to virtual desktops.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Created new central header "emu.h"; this should be included by pretty much any driver or device as the first include. This file in turn includes pretty much everything a driver or device will need, minus any other devices it references. Note that emu.h should *never* be included by another header file. - Updated all files in the core (src/emu) to use emu.h. - Removed a ton of redundant and poorly-tracked header includes from within other header files. - Temporarily changed driver.h to map to emu.h until we update files outside of the core. Added class wrapper around tagmap so it can be directly included and accessed within objects that need it. Updated all users to embed tagmap objects and changed them to call through the class. Added nicer functions for finding devices, ports, and regions in a machine: machine->device("tag") -- return the named device, or NULL machine->port("tag") -- return the named port, or NULL machine->region("tag"[, &length[, &flags]]) -- return the named region and optionally its length and flags Made the device tag an astring. This required touching a lot of code that printed the device to explicitly fetch the C-string from it. (Thank you gcc for flagging that issue!)
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd_free(). They take the same parameters as malloc() and free(). Renamed mamecore.h -> emucore.h. New C++-aware memory manager, implemented in emualloc.*. This is a simple manager that allows you to add any type of object to a resource pool. Most commonly, allocated objects are added, and so a set of allocation macros is provided to allow you to manage objects in a particular pool: pool_alloc(p, t) = allocate object of type 't' and add to pool 'p' pool_alloc_clear(p, t) = same as above, but clear the memory first pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type 't' and add to pool 'p' pool_alloc_array_clear(p, t, c) = same, but with clearing pool_free(p, v) = free object 'v' and remove it from the pool Note that pool_alloc[_clear] is roughly equivalent to "new t" and pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also note that pool_free works for single objects and arrays. There is a single global_resource_pool defined which should be used for any global allocations. It has equivalent macros to the pool_* macros above that automatically target the global pool. In addition, the memory module defines global new/delete overrides that access file and line number parameters so that allocations can be tracked. Currently this tracking is only done if MAME_DEBUG is enabled. In debug builds, any unfreed memory will be printed at the end of the session. emualloc.h also has #defines to disable malloc/free/realloc/calloc. Since emualloc.h is included by emucore.h, this means pretty much all code within the emulator is forced to use the new allocators. Although straight new/delete do work, their use is discouraged, as any allocations made with them will not be tracked. Changed the familar auto_alloc_* macros to map to the resource pool model described above. The running_machine is now a class and contains a resource pool which is automatically destructed upon deletion. If you are a driver writer, all your allocations should be done with auto_alloc_*. Changed all drivers and files in the core using malloc/realloc or the old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros instead, or the global_alloc_* macros if necessary. Added simple C++ wrappers for astring and bitmap_t, as these need proper constructors/destructors to be used for auto_alloc_astring and auto_alloc_bitmap. Removed references to the winalloc prefix file. Most of its functionality has moved into the core, save for the guard page allocations, which are now implemented in osd_alloc and osd_free.
* Results of running the latest srcclean. Aaron Giles2009-12-281-5/+5
|
* OSD notice: you now need to report separate mouse up/mouse down events Aaron Giles2008-09-091-6/+23
| | | | | | | | | | | | | | | | | | for this new support to work. Clickable input support. Mostly by Nathan. A few changes from the proposal: * as far as the layout is concerned, states are 0 (off) or 1 (on) and aren't impacted by the port's ACTIVE_HIGH or ACTIVE_LOW * instead of checking each individual field for a hit, we look to see what is hit once per frame and then just check against that; this is faster, but does limit us to a single hit item * added function input_field_by_tag_and_mask() to look up a particular input_field_config by tag and mask; this makes it possible to easily get the port default value or other information as necessary
* Cleanups. Aaron Giles2008-07-171-6/+6
|
* Note: I have done some testing, but there are probably more bugs Aaron Giles2008-07-121-0/+172
lurking. If you run into anything odd, please let me know. Added new module uiinput.c which manages input for the user interface. The OSD is responsible for pushing mouse events and character events to this interface in order to support mouse movement and text-based input (currently only used for the select game menu). Added support for navigating through the menus using the mouse. [Nathan Woods, Aaron Giles] Redesigned the UI menus so that they can maintain a richer state. Now the menus can be generated once and reused, rather than requiring them to be regenerated on each frame. All menus also share a comment eventing system and navigation through them is managed centrally. Rewrote all the menus to use the new system, apart from the cheat menus, which are now disabled. Reorganized the video menu to make it easier to understand. [Aaron Giles]