cocoa: remove usage of mp_fifo

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.
This commit is contained in:
Stefano Pigozzi 2013-07-03 22:19:26 +02:00
parent 56b9dcaabb
commit 8af51bd3fe
5 changed files with 2 additions and 12 deletions

View File

@ -3857,7 +3857,6 @@ static void init_input(struct MPContext *mpctx)
#ifdef CONFIG_COCOA #ifdef CONFIG_COCOA
cocoa_set_input_context(mpctx->input); cocoa_set_input_context(mpctx->input);
cocoa_set_key_fifo((struct mp_fifo *)mpctx->input);
#endif #endif
} }

View File

@ -20,7 +20,6 @@
#define MPV_MACOSX_APPLICATION #define MPV_MACOSX_APPLICATION
struct input_ctx; struct input_ctx;
struct mp_fifo;
typedef int (*mpv_main_fn)(int, char**); typedef int (*mpv_main_fn)(int, char**);
@ -48,7 +47,6 @@ void cocoa_stop_runloop(void);
void cocoa_post_fake_event(void); void cocoa_post_fake_event(void);
void cocoa_set_input_context(struct input_ctx *input_context); void cocoa_set_input_context(struct input_ctx *input_context);
void cocoa_set_key_fifo(struct mp_fifo *key_fifo);
void macosx_finder_args_preinit(int *argc, char ***argv); void macosx_finder_args_preinit(int *argc, char ***argv);

View File

@ -114,7 +114,6 @@ static NSString *escape_loadfile_name(NSString *input)
@synthesize willStopOnOpenEvent = _will_stop_on_open_event; @synthesize willStopOnOpenEvent = _will_stop_on_open_event;
@synthesize inputContext = _input_context; @synthesize inputContext = _input_context;
@synthesize keyFIFO = _key_fifo;
@synthesize iqueue = _iqueue; @synthesize iqueue = _iqueue;
@synthesize eventsResponder = _events_responder; @synthesize eventsResponder = _events_responder;
@synthesize menuItems = _menu_items; @synthesize menuItems = _menu_items;
@ -391,11 +390,6 @@ void cocoa_set_input_context(struct input_ctx *input_context)
mpv_shared_app().inputContext = input_context; mpv_shared_app().inputContext = input_context;
} }
void cocoa_set_key_fifo(struct mp_fifo *key_fifo)
{
mpv_shared_app().keyFIFO = key_fifo;
}
void cocoa_post_fake_event(void) void cocoa_post_fake_event(void)
{ {
NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined

View File

@ -43,7 +43,6 @@ struct cocoa_input_queue;
- (void)stopPlayback; - (void)stopPlayback;
@property(nonatomic, assign) struct input_ctx *inputContext; @property(nonatomic, assign) struct input_ctx *inputContext;
@property(nonatomic, assign) struct mp_fifo *keyFIFO;
@property(nonatomic, retain) InputQueue *iqueue; @property(nonatomic, retain) InputQueue *iqueue;
@property(nonatomic, retain) EventsResponder *eventsResponder; @property(nonatomic, retain) EventsResponder *eventsResponder;
@property(nonatomic, retain) NSMutableDictionary *menuItems; @property(nonatomic, retain) NSMutableDictionary *menuItems;

View File

@ -27,7 +27,6 @@
#include "talloc.h" #include "talloc.h"
#include "core/input/input.h" #include "core/input/input.h"
#include "core/mp_fifo.h"
// doesn't make much sense, but needed to access keymap functionality // doesn't make much sense, but needed to access keymap functionality
#include "video/out/vo.h" #include "video/out/vo.h"
@ -167,7 +166,7 @@ void cocoa_check_events(void)
Application *app = mpv_shared_app(); Application *app = mpv_shared_app();
int key; int key;
while ((key = [app.iqueue pop]) >= 0) while ((key = [app.iqueue pop]) >= 0)
mplayer_put_key(app.keyFIFO, key); mp_input_put_key(app.inputContext, key);
} }
void cocoa_put_key(int keycode) void cocoa_put_key(int keycode)
@ -179,6 +178,7 @@ void cocoa_put_key(int keycode)
CFMachPortRef _mk_tap_port; CFMachPortRef _mk_tap_port;
HIDRemote *_remote; HIDRemote *_remote;
} }
- (void)startAppleRemote - (void)startAppleRemote
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{