From 4fc8dcde2ae1525c8ea52d04ed0e7768decf901a Mon Sep 17 00:00:00 2001 From: FRAU KOUJIRO Date: Tue, 15 Apr 2014 19:33:58 -0700 Subject: cocoa: move set_input_context to macosx_events --- osdep/macosx_application.h | 4 ---- osdep/macosx_application.m | 5 ----- osdep/macosx_events.h | 4 ++++ osdep/macosx_events.m | 5 +++++ player/main.c | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/osdep/macosx_application.h b/osdep/macosx_application.h index f9fca4b334..23c5838a3b 100644 --- a/osdep/macosx_application.h +++ b/osdep/macosx_application.h @@ -19,8 +19,6 @@ #ifndef MPV_MACOSX_APPLICATION #define MPV_MACOSX_APPLICATION -struct input_ctx; - typedef int (*mpv_main_fn)(int, char**); // Menu Keys identifing menu items @@ -46,8 +44,6 @@ void cocoa_run_runloop(void); void cocoa_stop_runloop(void); void cocoa_post_fake_event(void); -void cocoa_set_input_context(struct input_ctx *input_context); - void macosx_finder_args_preinit(int *argc, char ***argv); #endif /* MPV_MACOSX_APPLICATION */ diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 9aff6e814b..18c47f4bea 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -373,11 +373,6 @@ void cocoa_stop_runloop(void) cocoa_post_fake_event(); } -void cocoa_set_input_context(struct input_ctx *input_context) -{ - [EventsResponder sharedInstance].inputContext = input_context; -} - void cocoa_post_fake_event(void) { NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined diff --git a/osdep/macosx_events.h b/osdep/macosx_events.h index a4b122f534..f3dfbdfea4 100644 --- a/osdep/macosx_events.h +++ b/osdep/macosx_events.h @@ -21,6 +21,8 @@ #define MACOSX_EVENTS_H #include "input/keycodes.h" +struct input_ctx; + void cocoa_put_key(int keycode); void cocoa_put_key_with_modifiers(int keycode, int modifiers); @@ -30,4 +32,6 @@ void cocoa_uninit_apple_remote(void); void cocoa_init_media_keys(void); void cocoa_uninit_media_keys(void); +void cocoa_set_input_context(struct input_ctx *input_context); + #endif diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index c8da555fa1..0b3eeb1d48 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -188,6 +188,11 @@ void cocoa_put_key_with_modifiers(int keycode, int modifiers) cocoa_put_key(keycode); } +void cocoa_set_input_context(struct input_ctx *input_context) +{ + [EventsResponder sharedInstance].inputContext = input_context; +} + @implementation EventsResponder + (EventsResponder *)sharedInstance diff --git a/player/main.c b/player/main.c index 13ecff9f9e..288dbbd89e 100644 --- a/player/main.c +++ b/player/main.c @@ -73,6 +73,7 @@ #if HAVE_COCOA #include "osdep/macosx_application.h" +#include "osdep/macosx_events.h" #endif #ifdef PTW32_STATIC_LIB -- cgit v1.2.3