From d603e73c24d6d7ad08a54c10d16c83d93b01a007 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Jul 2013 14:04:36 +0200 Subject: core: cleanup more mp_fifo leftovers Now only the OSX and Wayland parts are using this. --- core/command.c | 1 - core/input/input.c | 1 - core/mplayer.c | 1 - osdep/getch2-win.c | 5 ++--- osdep/getch2.c | 5 ++--- osdep/getch2.h | 4 ++-- video/out/vo.c | 1 - video/out/vo_caca.c | 12 ++++++------ video/out/vo_sdl.c | 12 ++++++------ video/out/w32_common.c | 12 ++++++------ video/out/x11_common.c | 30 +++++++++++++++--------------- 11 files changed, 39 insertions(+), 45 deletions(-) diff --git a/core/command.c b/core/command.c index 46e747cf2b..80f6f5d9d2 100644 --- a/core/command.c +++ b/core/command.c @@ -68,7 +68,6 @@ #include "screenshot.h" #include "core/mp_core.h" -#include "mp_fifo.h" static void change_video_filters(MPContext *mpctx, const char *cmd, const char *arg); diff --git a/core/input/input.c b/core/input/input.c index 278793100d..4a52b3f9c9 100644 --- a/core/input/input.c +++ b/core/input/input.c @@ -38,7 +38,6 @@ #include "osdep/getch2.h" #include "input.h" -#include "core/mp_fifo.h" #include "keycodes.h" #include "osdep/timer.h" #include "core/mp_msg.h" diff --git a/core/mplayer.c b/core/mplayer.c index bf284551a1..01923dc041 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -185,7 +185,6 @@ static const char av_desync_help_text[] = _( //**************************************************************************// //**************************************************************************// -#include "core/mp_fifo.h" #include "sub/ass_mp.h" diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c index 2edb537076..3cafcbeb7e 100644 --- a/osdep/getch2-win.c +++ b/osdep/getch2-win.c @@ -30,7 +30,6 @@ #include #include "core/input/keycodes.h" #include "core/input/input.h" -#include "core/mp_fifo.h" #include "getch2.h" int mp_input_slave_cmd_func(int fd,char* dest,int size){ @@ -158,11 +157,11 @@ static int getch2_internal(void) return -1; } -bool getch2(struct mp_fifo *fifo) +bool getch2(struct input_ctx *ctx) { int r = getch2_internal(); if (r >= 0) - mplayer_put_key(fifo, r); + mp_input_put_key(ctx, r); return true; } diff --git a/osdep/getch2.c b/osdep/getch2.c index ae6a04f389..0e58b53a4d 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -54,7 +54,6 @@ #include #include "core/bstr.h" -#include "core/mp_fifo.h" #include "core/input/input.h" #include "core/input/keycodes.h" #include "getch2.h" @@ -156,7 +155,7 @@ void get_screen_size(void){ #endif } -bool getch2(struct mp_fifo *fifo) +bool getch2(struct input_ctx *input_ctx) { int retval = read(0, &getch2_buf[getch2_len], BUF_LEN-getch2_len); /* Return false on EOF to stop running select() on the FD, as it'd @@ -281,7 +280,7 @@ bool getch2(struct mp_fifo *fifo) getch2_len -= len; for (i = 0; i < getch2_len; i++) getch2_buf[i] = getch2_buf[len+i]; - mplayer_put_key(fifo, code); + mp_input_put_key(input_ctx, code); } return true; } diff --git a/osdep/getch2.h b/osdep/getch2.h index 5a04c4228e..4dc3b29dce 100644 --- a/osdep/getch2.h +++ b/osdep/getch2.h @@ -49,8 +49,8 @@ void getch2_disable(void); void getch2_poll(void); /* Read a character or a special key code (see keycodes.h) */ -struct mp_fifo; -bool getch2(struct mp_fifo *fifo); +struct input_ctx; +bool getch2(struct input_ctx *ictx); #if defined(__MINGW32__) // slave cmd function for Windows diff --git a/video/out/vo.c b/video/out/vo.c index b2bf8765a8..44e963984c 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -37,7 +37,6 @@ #include "vo.h" #include "aspect.h" #include "core/input/input.h" -#include "core/mp_fifo.h" #include "core/m_config.h" #include "core/mp_msg.h" #include "video/mp_image.h" diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c index 78eaf2b395..dd6d76f311 100644 --- a/video/out/vo_caca.c +++ b/video/out/vo_caca.c @@ -43,7 +43,7 @@ #include "core/input/keycodes.h" #include "core/input/input.h" #include "core/mp_msg.h" -#include "core/mp_fifo.h" +#include "core/input/input.h" /* caca stuff */ static caca_canvas_t *canvas; @@ -169,19 +169,19 @@ static void check_events(struct vo *vo) resize(); break; case CACA_EVENT_QUIT: - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case CACA_EVENT_MOUSE_MOTION: vo_mouse_movement(vo, cev.data.mouse.x, cev.data.mouse.y); break; case CACA_EVENT_MOUSE_PRESS: if (!vo->opts->nomouse_input) - mplayer_put_key(vo->key_fifo, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + cev.data.mouse.button - 1) | MP_KEY_STATE_DOWN); break; case CACA_EVENT_MOUSE_RELEASE: if (!vo->opts->nomouse_input) - mplayer_put_key(vo->key_fifo, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + cev.data.mouse.button - 1) | MP_KEY_STATE_UP); break; case CACA_EVENT_KEY_PRESS: @@ -191,7 +191,7 @@ static void check_events(struct vo *vo) const char *msg_name; if (mpkey) - mplayer_put_key(vo->key_fifo, mpkey); + mp_input_put_key(vo->input_ctx, mpkey); else switch (key) { case 'd': @@ -228,7 +228,7 @@ static void check_events(struct vo *vo) default: if (key <= 255) - mplayer_put_key(vo->key_fifo, key); + mp_input_put_key(vo->input_ctx, key); break; } } diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c index dd1e4a5053..5ab62cb78e 100644 --- a/video/out/vo_sdl.c +++ b/video/out/vo_sdl.c @@ -32,7 +32,7 @@ #include "core/input/input.h" #include "core/input/keycodes.h" -#include "core/mp_fifo.h" +#include "core/input/input.h" #include "core/mp_msg.h" #include "core/options.h" @@ -484,7 +484,7 @@ static void check_events(struct vo *vo) } break; case SDL_QUIT: - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case SDL_TEXTINPUT: { int sdl_mod = SDL_GetModState(); @@ -500,7 +500,7 @@ static void check_events(struct vo *vo) struct bstr t = { ev.text.text, strlen(ev.text.text) }; - mplayer_put_key_utf8(vo->key_fifo, mpv_mod, t); + mp_input_put_key_utf8(vo->input_ctx, mpv_mod, t); break; } case SDL_KEYDOWN: { @@ -528,7 +528,7 @@ static void check_events(struct vo *vo) keycode |= MP_KEY_MODIFIER_ALT; if (ev.key.keysym.mod & (KMOD_LGUI | KMOD_RGUI)) keycode |= MP_KEY_MODIFIER_META; - mplayer_put_key(vo->key_fifo, keycode); + mp_input_put_key(vo->input_ctx, keycode); } break; } @@ -536,11 +536,11 @@ static void check_events(struct vo *vo) vo_mouse_movement(vo, ev.motion.x, ev.motion.y); break; case SDL_MOUSEBUTTONDOWN: - mplayer_put_key(vo->key_fifo, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + ev.button.button - 1) | MP_KEY_STATE_DOWN); break; case SDL_MOUSEBUTTONUP: - mplayer_put_key(vo->key_fifo, + mp_input_put_key(vo->input_ctx, (MP_MOUSE_BTN0 + ev.button.button - 1) | MP_KEY_STATE_UP); break; case SDL_MOUSEWHEEL: diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 13ec8e7053..9ce0174320 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -29,7 +29,7 @@ #include "vo.h" #include "aspect.h" #include "w32_common.h" -#include "core/mp_fifo.h" +#include "core/input/input.h" #include "osdep/io.h" #include "talloc.h" @@ -171,7 +171,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, } break; case WM_CLOSE: - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case WM_SYSCOMMAND: switch (wParam) { @@ -188,7 +188,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, case WM_SYSKEYDOWN: { int mpkey = lookup_keymap_table(vk_map, wParam); if (mpkey) - mplayer_put_key(vo->key_fifo, mpkey | mod_state(vo)); + mp_input_put_key(vo->input_ctx, mpkey | mod_state(vo)); if (wParam == VK_F10) return 0; break; @@ -211,7 +211,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, && !key_state(vo, VK_RETURN)) code = code - 1 + (mods & MP_KEY_MODIFIER_SHIFT ? 'A' : 'a'); if (code >= 32 && code < (1<<21)) { - mplayer_put_key(vo->key_fifo, code | mods); + mp_input_put_key(vo->input_ctx, code | mods); // At least with Alt+char, not calling DefWindowProcW stops // Windows from emitting a beep. return 0; @@ -266,7 +266,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); return 0; } - mplayer_put_key(vo->key_fifo, mouse_button); + mp_input_put_key(vo->input_ctx, mouse_button); } return DefWindowProcW(hWnd, message, wParam, lParam); @@ -313,7 +313,7 @@ int vo_w32_check_events(struct vo *vo) MoveWindow(w32->window, 0, 0, r.right, r.bottom, FALSE); if (!IsWindow(WIN_ID_TO_HWND(vo->opts->WinID))) // Window has probably been closed, e.g. due to program crash - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); } return w32->event_flags; diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 648f1d57eb..05d6af41cb 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -26,7 +26,7 @@ #include "core/bstr.h" #include "core/options.h" #include "core/mp_msg.h" -#include "core/mp_fifo.h" +#include "core/input/input.h" #include "libavutil/common.h" #include "x11_common.h" #include "talloc.h" @@ -639,7 +639,7 @@ void vo_x11_uninit(struct vo *vo) struct vo_x11_state *x11 = vo->x11; assert(x11); - mplayer_put_key(vo->key_fifo, MP_INPUT_RELEASE_ALL); + mp_input_put_key(vo->input_ctx, MP_INPUT_RELEASE_ALL); saver_on(x11); if (x11->window != None) @@ -730,17 +730,17 @@ int vo_x11_check_events(struct vo *vo) sizeof(buf), &keySym, &status); int mpkey = vo_x11_lookupkey(keySym); if (mpkey) { - mplayer_put_key(vo->key_fifo, mpkey | modifiers); + mp_input_put_key(vo->input_ctx, mpkey | modifiers); } else if (status == XLookupChars || status == XLookupBoth) { struct bstr t = { buf, len }; - mplayer_put_key_utf8(vo->key_fifo, modifiers, t); + mp_input_put_key_utf8(vo->input_ctx, modifiers, t); } } else { XLookupString(&Event.xkey, buf, sizeof(buf), &keySym, &x11->compose_status); int mpkey = vo_x11_lookupkey(keySym); if (mpkey) - mplayer_put_key(vo->key_fifo, mpkey | modifiers); + mp_input_put_key(vo->input_ctx, mpkey | modifiers); } break; } @@ -750,24 +750,24 @@ int vo_x11_check_events(struct vo *vo) case KeyRelease: { if (x11->no_autorepeat) - mplayer_put_key(vo->key_fifo, MP_INPUT_RELEASE_ALL); + mp_input_put_key(vo->input_ctx, MP_INPUT_RELEASE_ALL); break; } case MotionNotify: vo_mouse_movement(vo, Event.xmotion.x, Event.xmotion.y); break; case LeaveNotify: - mplayer_put_key(vo->key_fifo, MP_KEY_MOUSE_LEAVE); + mp_input_put_key(vo->input_ctx, MP_KEY_MOUSE_LEAVE); break; case ButtonPress: - mplayer_put_key(vo->key_fifo, - (MP_MOUSE_BTN0 + Event.xbutton.button - 1) - | MP_KEY_STATE_DOWN); + mp_input_put_key(vo->input_ctx, + (MP_MOUSE_BTN0 + Event.xbutton.button - 1) + | MP_KEY_STATE_DOWN); break; case ButtonRelease: - mplayer_put_key(vo->key_fifo, - (MP_MOUSE_BTN0 + Event.xbutton.button - 1) - | MP_KEY_STATE_UP); + mp_input_put_key(vo->input_ctx, + (MP_MOUSE_BTN0 + Event.xbutton.button - 1) + | MP_KEY_STATE_UP); break; case PropertyNotify: { char *name = XGetAtomName(display, Event.xproperty.atom); @@ -783,12 +783,12 @@ int vo_x11_check_events(struct vo *vo) break; case DestroyNotify: mp_msg(MSGT_VO, MSGL_WARN, "Our window was destroyed, exiting\n"); - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case ClientMessage: if (Event.xclient.message_type == x11->XAWM_PROTOCOLS && Event.xclient.data.l[0] == x11->XAWM_DELETE_WINDOW) - mplayer_put_key(vo->key_fifo, MP_KEY_CLOSE_WIN); + mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; default: if (Event.type == x11->ShmCompletionEvent) { -- cgit v1.2.3