summaryrefslogtreecommitdiffstats
path: root/osdep/macosx_application.h
Commit message (Collapse)AuthorAgeFilesLines
* osx: move menu bar creation into its own fileAkemi2017-08-181-8/+1
|
* osx: change license of OSX and cocoa files to LGPLwm42017-06-241-7/+7
| | | | All authors of the current code have agreed.
* build: move main-fn files to osdepwm42015-05-021-3/+1
| | | | | | And split the Cocoa and Unix cases. Simplify the Cocoa case slightly by calling mpv_main directly, instead of passing a function pointer. Also add a comment explaining why Cocoa needs a special case at all.
* cocoa: always compile OSX application code with cocoawm42015-05-021-1/+0
| | | | | | | | | | | | | | This unbreaks compiling command line player and libmpv at the same time. The problem was that doing so silently disabled the OSX application thing - but the command line player can not use the vo_opengl Cocoa backend without it. The OSX application code is basically dead in libmpv, but it's not that much code anyway. If you want a mpv binary that does not create an OSX application singleton (and creates a menu etc.), you must disable cocoa completely, as cocoa can't be used anyway in this case.
* Update license headersMarcin Kurczewski2015-04-131-2/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* cocoa: use --idle when running inside bundleStefano Pigozzi2014-12-061-11/+0
| | | | | Previously when using the bundle we used a custom bizarro thing to wait for events. Just use `--idle` and greatly simplify the code.
* cocoa: move set_input_context to macosx_eventsFRAU KOUJIRO2014-08-061-4/+0
|
* cocoa: remove usage of mp_fifoStefano Pigozzi2013-07-031-2/+0
| | | | | | Update Cocoa parts to remove usage of the mp_fifo internal API to send events to the core and use the input context directly. This is to follow commits the work in commits 70a8079c and d603e73c.
* osx: create macosx_events to deal with keyDown eventsStefano Pigozzi2013-06-031-0/+1
| | | | | | On OSX with Cocoa enabled keyDown events are now handled with addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to events even when there is no VO initialized but the GUI is focused.
* macosx_application: use @autoreleasepoolStefano Pigozzi2013-05-301-2/+0
| | | | I don't even want to know how this worked. It scares me a lot.
* macosx_application: implement "Quit & remember position"Stefano Pigozzi2013-05-231-1/+1
| | | | | | | Add a menu item to quit and save the current playback position using the code added with commit ce9a854. Fixes #85
* OSX: run native event loop in a separate threadStefano Pigozzi2013-05-121-9/+8
| | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* OSX: use native Cocoa's event loopStefano Pigozzi2013-05-121-0/+57
Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.