Commit Graph

56 Commits

Author SHA1 Message Date
der richter 6846338cf2 mac/touchbar: use EventHelper for event handling
also remove remaining old event handling.
2024-03-24 23:03:48 +01:00
der richter f9618ea487 mac/touchbar: move touch bar into AppHub 2024-03-24 23:03:48 +01:00
der richter 3e6c931d90 mac/remote: use EventHelper for event handling 2024-03-24 23:03:48 +01:00
der richter 4107d29c90 mac/touchbar: fix devision by 0 2024-03-24 23:03:48 +01:00
der richter 6d767537d4 mac/remote: fix devision by 0 2024-03-24 23:03:48 +01:00
der richter 5ab3060961 cocoa-cb: use EventHelper for event handling 2024-03-24 23:03:48 +01:00
der richter 2a4bf7ca22 cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdown 2024-03-24 23:03:48 +01:00
der richter 7e07e1a087 mac/apphub: migrate remaining events functionality to new AppHub
add new app_bridge objc file for bridging between mpv core and app
functionality. replace old EventsResponder singleton with AppHub.

another step to clean up all App functionality and have one central
place for it.
2024-03-24 23:03:48 +01:00
der richter deb9d30e90 mac/event: add helper to subscribe to mpv events and property changes
preparation to remove duplicate code from all classes that implement
their own observer loops.
2024-03-24 23:03:48 +01:00
der richter 9cee44147a mac/libmpv: remove unused functions 2024-03-21 18:33:15 +01:00
der richter 9e03ab5e1e mac/option: remove now unused computed option variables 2024-03-21 18:33:15 +01:00
der richter 204e3f0df6 mac/option: rename option structs to properly represent their content
also optimise option cache setup.
2024-03-21 18:33:15 +01:00
der richter f72dfd48d0 mac/libmpv: remove mac option handling in favour of option handler
since the option handler is not optional anymore and available on init
in cocoa-cb we don't need to duplicate this functionality in libmpv
anymore.
2024-03-21 18:33:15 +01:00
der richter b480daad88 mac/option: make option helper none optional
gets rid of some unwrapping boilerplate and nil coalescing operators.
2024-03-21 18:33:15 +01:00
der richter 6defd49aa1 mac/option: make option helper vo struct independent 2024-03-21 18:33:15 +01:00
der richter 90c534a821 mac/option: optimise option pointer access 2024-03-21 18:33:15 +01:00
der richter 2d9be04c00 mac/option: remove unused and obsolete variables 2024-03-21 18:33:15 +01:00
der richter dc5059d027 mac/option: move option functionality from mpv helper to option helper
delete now empty mpv helper
2024-03-21 18:33:15 +01:00
der richter 283d0877c4 mac/type: move c<>swift type bridging into a dedicated type helper 2024-03-21 18:33:15 +01:00
der richter bf1c8acdac mac/touchbar: simplify item and view creation 2024-03-18 20:29:27 +01:00
der richter 9f68214a06 mac/touchbar: optimise time item update 2024-03-18 20:29:27 +01:00
der richter d7cc5cdec1 mac/touchbar: optimise constraint calculation 2024-03-18 20:29:27 +01:00
der richter ef82ef0bb5 mac/touchbar: use DateComponentsFormatter for time formatting 2024-03-18 20:29:27 +01:00
der richter be49f4fe20 mac/touchbar: simplify update items logic 2024-03-18 20:29:27 +01:00
der richter 647bf5d0ba mac/touchbar: take playback speed into account for rate limiting 2024-03-18 20:29:27 +01:00
der richter c8088d801a mac/touchbar: rewrite touch bar in swift 2024-03-18 20:29:27 +01:00
der richter 2a36ed9abd mac/input: optimise scroll wheel event handling 2024-03-16 15:29:27 +01:00
der richter a4eddf742d mac/input: move scroll wheel event handling into input helper 2024-03-16 15:29:27 +01:00
der richter 9a4c673dd7 mac/input: optimise mouse movement enabled check 2024-03-16 15:29:27 +01:00
der richter 53722a4082 mac/input: fix switched mouse forward and back button 2024-03-16 15:29:27 +01:00
der richter db4eac140d mac/input: move mouse event handling into input helper 2024-03-16 15:29:27 +01:00
der richter 474e213f52 mac/input: add missing special keys 2024-03-14 23:33:15 +01:00
der richter 556cb7d6a4 mac/input: add simplified mp_keymap init 2024-03-14 23:33:15 +01:00
der richter 4d8ea338de mac/input: remove wrongly mapped modifier keys 2024-03-14 23:33:15 +01:00
der richter 3ef3bbf93d mac/event: move key event handling to input helper and optimise it 2024-03-14 23:33:15 +01:00
der richter 5482eecb8a mac/input: define AltGr mask as static NSEvent.ModifierFlags variable
this makes it possible to properly test for those modifiers in a proper
swift like way.
2024-03-14 23:33:15 +01:00
der richter 18fb71498b mac/events: remove redundant functions and optimise input helper usage
some redundant functions that jump through hoops.
2024-03-14 23:33:15 +01:00
der richter 055e9cd93e mac/helper: move input ctx related functionality into new input helper
also make functions thread safe.
2024-03-14 23:33:15 +01:00
der richter f3e5fea4f5 mac/events: move input ctx related functionality into new input helper
preparation for mac/events cleanup and single responsibility principle.
all functions are thread safe.
2024-03-14 23:33:15 +01:00
der richter 8a37f0f693 mac/menu: add explicit menu type instead of an inferred type
with the use of an explicit type we can removed inferred type checks
like separators/services menu by name or menus by sub configs.
2024-03-07 01:03:52 +01:00
der richter 16ea688115 mac/menu: make menu creation recursive to allow nested submenus
also makes menu creation cleaner and more obvious.
2024-03-07 01:03:52 +01:00
der richter 4eb58f6ea7 mac/menu: move conditional Bundle menu items into config
only add the "Show log File…" menu item config when invoked from the
bundle, instead of testing on menu item creation. this is similar to the
touch bar menu items now.
2024-03-07 01:03:52 +01:00
der richter 73e494a237 mac/menu: keep track of menu items with dynamic actions
keeping track of the dynamic menu items lets us directly access them by
key. we don't need to search in the config array for the right config
and menu item.
2024-03-07 01:03:52 +01:00
der richter 8d4329a710 mac/menu: merge file and url config properties
a file path is basically an URL. both are also handled as URL objects
in our code.
2024-03-07 01:03:52 +01:00
der richter 46a9e8c130 mac/menu: properly guard playlist array access 2024-03-07 01:03:52 +01:00
der richter 30eab4b933 mac/menu: attach menu config to menu item for direct access
add a config property to the menu items, so we don't need to search in
the config array for the right config.
2024-03-07 01:03:52 +01:00
der richter 95d08df7a7 mac/menu: replace app.command usage with event.command 2024-03-07 01:03:52 +01:00
der richter 37990597c7 mac/menu: fix touch bar menu item
the check broke when the runtime check was removed, eg the menu item was
never added to the menu. since we only add the menu item to the config
when touch bar support is available the check is completely unnecessary.
2024-03-07 01:03:52 +01:00
der richter 035906dad5 mac/menu: rename Preferences to Settings for consistency with macOS 2024-03-07 01:03:52 +01:00
der richter ad0573ff8e mac/menu: remove duplicate key assignment Undo/Zoom
this key is already assigned to Undo.
2024-03-07 01:03:52 +01:00