# HG changeset patch # User ib # Date 1309858389 0 # Node ID c919fb3d253144efa4d2125577874693d5ba3a54 # Parent 6c8743e5fa3019ab4089dfb788e06d336acf5859 Rename guiGetEvent() gui(). This function is the interface between MPlayer and the GUI. It doesn't have much to do with events and doesn't merely get things. diff -r 6c8743e5fa30 -r c919fb3d2531 command.c --- a/command.c Mon Jul 04 22:24:52 2011 +0000 +++ b/command.c Tue Jul 05 09:33:09 2011 +0000 @@ -1075,7 +1075,7 @@ case M_PROPERTY_STEP_DOWN: #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiRunCommand, (void *) MP_CMD_VO_FULLSCREEN); + gui(guiRunCommand, (void *) MP_CMD_VO_FULLSCREEN); else #endif if (vo_config_count) @@ -2801,10 +2801,10 @@ int i = 0; if (n > 0) for (i = 0; i < n; i++) - guiGetEvent(guiRunCommand, (void *)MP_CMD_PLAY_TREE_STEP); + gui(guiRunCommand, (void *)MP_CMD_PLAY_TREE_STEP); else for (i = 0; i < -1 * n; i++) - guiGetEvent(guiRunCommand, (void *)-MP_CMD_PLAY_TREE_STEP); + gui(guiRunCommand, (void *)-MP_CMD_PLAY_TREE_STEP); } else #endif { @@ -2966,7 +2966,7 @@ #ifdef CONFIG_GUI // playtree_iter isn't used by the GUI if (use_gui) - guiGetEvent(guiRunCommand, (void *)MP_CMD_STOP); + gui(guiRunCommand, (void *)MP_CMD_STOP); else #endif // Go back to the starting point. diff -r 6c8743e5fa30 -r c919fb3d2531 gui/interface.c --- a/gui/interface.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/interface.c Tue Jul 05 09:33:09 2011 +0000 @@ -548,7 +548,7 @@ mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str); } -int guiGetEvent(int type, void *arg) +int gui(int type, void *arg) { mixer_t *mixer = NULL; stream_t *stream; @@ -628,7 +628,7 @@ case guiPreparation: - guiGetEvent(guiNewFile, NULL); + gui(guiNewFile, NULL); switch (guiInfo.StreamType) { case STREAMTYPE_PLAYLIST: @@ -847,7 +847,7 @@ switch (guiInfo.StreamType) { #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: - guiGetEvent(guiSetDVD, stream->priv); + gui(guiSetDVD, stream->priv); break; #endif @@ -917,7 +917,7 @@ if (arg && !guiInfo.sh_video) guiInfo.MovieWindow = False; - guiGetEvent(guiSetMixer, NULL); + gui(guiSetMixer, NULL); if (gtkEnableAudioEqualizer) { equalizer_t eq; @@ -1019,7 +1019,7 @@ } else wsVisibleWindow(&guiApp.subWindow, wsHideWindow); - guiGetEvent(guiSetState, (void *)GUI_STOP); + gui(guiSetState, (void *)GUI_STOP); uiSubRender = 1; wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B); wsClearWindow(guiApp.subWindow); diff -r 6c8743e5fa30 -r c919fb3d2531 gui/interface.h --- a/gui/interface.h Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/interface.h Tue Jul 05 09:33:09 2011 +0000 @@ -235,7 +235,7 @@ void guiDone(void); void guiEventHandling(void); void guiExit(enum exit_reason how); -int guiGetEvent(int type, void *arg); +int gui(int type, void *arg); void guiInit(void); void guiLoadFont(void); void guiLoadSubtitle(char *name); diff -r 6c8743e5fa30 -r c919fb3d2531 gui/ui/actions.c --- a/gui/ui/actions.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/ui/actions.c Tue Jul 05 09:33:09 2011 +0000 @@ -103,7 +103,7 @@ return; } - guiGetEvent(guiSetState, (void *)GUI_PLAY); + gui(guiSetState, (void *)GUI_PLAY); uiSubRender = 0; wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0); wsClearWindow(guiApp.subWindow); diff -r 6c8743e5fa30 -r c919fb3d2531 gui/ui/gtk/fileselect.c --- a/gui/ui/gtk/fileselect.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/ui/gtk/fileselect.c Tue Jul 05 09:33:09 2011 +0000 @@ -510,7 +510,7 @@ } if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name_utf8() ); if ( uiMainAutoPlay ) { uiMainAutoPlay=0; uiEventHandling( evPlay,0 ); } - else guiGetEvent( guiSetState,(void *) GUI_STOP ); + else gui( guiSetState,(void *) GUI_STOP ); } static void fs_Cancel_released( GtkButton * button,gpointer user_data ) diff -r 6c8743e5fa30 -r c919fb3d2531 gui/win32/dialogs.c --- a/gui/win32/dialogs.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/win32/dialogs.c Tue Jul 05 09:33:09 2011 +0000 @@ -708,7 +708,7 @@ int len = SendMessage(listbox, LB_GETTEXTLEN, index, 0); if (len) { - if (guiInfo.Playing) guiGetEvent(guiSetState, (void *) GUI_STOP); + if (guiInfo.Playing) gui(guiSetState, (void *) GUI_STOP); free(skinName); skinName = malloc(len + 1); SendMessage(listbox, LB_GETTEXT, (WPARAM) index, (LPARAM) skinName); diff -r 6c8743e5fa30 -r c919fb3d2531 gui/win32/interface.c --- a/gui/win32/interface.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/win32/interface.c Tue Jul 05 09:33:09 2011 +0000 @@ -174,7 +174,7 @@ GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0); capitalize(dvdname); mp_msg(MSGT_GPLAYER, MSGL_V, "Opening DVD %s -> %s\n", dvd_device, dvdname); - guiGetEvent(guiPreparation, (void *) STREAMTYPE_DVD); + gui(guiPreparation, (void *) STREAMTYPE_DVD); mygui->playlist->clear_playlist(mygui->playlist); mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0); mygui->startplay(mygui); @@ -218,7 +218,7 @@ } case evStop: if(guiInfo.Playing) - guiGetEvent(guiSetState, (void *) GUI_STOP); + gui(guiSetState, (void *) GUI_STOP); break; case evSetMoviePosition: { @@ -288,7 +288,7 @@ guiInfo.Chapter = guiInfo.DVD.current_chapter; guiInfo.Angle = guiInfo.DVD.current_angle; guiInfo.DiskChanged = 1; - guiGetEvent(guiSetState, (void *) GUI_PLAY); + gui(guiSetState, (void *) GUI_PLAY); break; } #endif @@ -297,8 +297,8 @@ guiInfo.FilenameChanged = guiInfo.NewPlay = 1; update_playlistwindow(); uiGotoTheNext = guiInfo.Playing? 0 : 1; - guiGetEvent(guiSetState, (void *) GUI_STOP); - guiGetEvent(guiSetState, (void *) GUI_PLAY); + gui(guiSetState, (void *) GUI_STOP); + gui(guiSetState, (void *) GUI_PLAY); break; } } @@ -324,7 +324,7 @@ return; } guiInfo.NewPlay = 1; - guiGetEvent(guiSetState, (void *) GUI_PLAY); + gui(guiSetState, (void *) GUI_PLAY); } void uiPause( void ) @@ -481,7 +481,7 @@ } /* this function gets called by mplayer to update the gui */ -int guiGetEvent(int type, void *arg) +int gui(int type, void *arg) { stream_t *stream = arg; #ifdef CONFIG_DVDREAD @@ -501,7 +501,7 @@ { case guiPreparation: { - guiGetEvent(guiNewFile, NULL); + gui(guiNewFile, NULL); guiInfo.DiskChanged = 0; guiInfo.FilenameChanged = 0; guiInfo.NewPlay = 0; @@ -576,7 +576,7 @@ { #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: - guiGetEvent(guiSetDVD, stream->priv); + gui(guiSetDVD, stream->priv); break; #endif } @@ -746,7 +746,7 @@ style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX; SetWindowLong(mygui->subwindow, GWL_STYLE, style); } - guiGetEvent(guiSetState, (void *) GUI_STOP); + gui(guiSetState, (void *) GUI_STOP); break; } default: diff -r 6c8743e5fa30 -r c919fb3d2531 gui/win32/preferences.c --- a/gui/win32/preferences.c Mon Jul 04 22:24:52 2011 +0000 +++ b/gui/win32/preferences.c Tue Jul 05 09:33:09 2011 +0000 @@ -575,7 +575,7 @@ case ID_APPLY: { int strl; - if(guiInfo.Playing) guiGetEvent(guiSetState, (void *)GUI_STOP); + if(guiInfo.Playing) gui(guiSetState, (void *)GUI_STOP); /* Set the video driver */ free(video_driver_list[0]); diff -r 6c8743e5fa30 -r c919fb3d2531 libvo/video_out.c --- a/libvo/video_out.c Mon Jul 04 22:24:52 2011 +0000 +++ b/libvo/video_out.c Tue Jul 05 09:33:09 2011 +0000 @@ -372,7 +372,7 @@ #ifdef CONFIG_GUI if (use_gui) { // GUI creates and manages window for us - guiGetEvent(guiSetVideoWindow, 0); + gui(guiSetVideoWindow, 0); } #endif } diff -r 6c8743e5fa30 -r c919fb3d2531 libvo/vo_dxr3.c --- a/libvo/vo_dxr3.c Mon Jul 04 22:24:52 2011 +0000 +++ b/libvo/vo_dxr3.c Tue Jul 05 09:33:09 2011 +0000 @@ -491,7 +491,7 @@ vo_dheight = d_height; #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetVideoWindow, 0); + gui(guiSetVideoWindow, 0); #endif XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &xwin_attribs); depth = xwin_attribs.depth; diff -r 6c8743e5fa30 -r c919fb3d2531 libvo/vo_xover.c --- a/libvo/vo_xover.c Mon Jul 04 22:24:52 2011 +0000 +++ b/libvo/vo_xover.c Tue Jul 05 09:33:09 2011 +0000 @@ -269,7 +269,7 @@ vo_dwidth=d_width; vo_dheight=d_height; #ifdef CONFIG_GUI - if(use_gui) guiGetEvent( guiSetVideoWindow,0 ); // the GUI will set up / resize the window + if(use_gui) gui( guiSetVideoWindow,0 ); // the GUI will set up / resize the window else { #endif diff -r 6c8743e5fa30 -r c919fb3d2531 libvo/x11_common.c --- a/libvo/x11_common.c Mon Jul 04 22:24:52 2011 +0000 +++ b/libvo/x11_common.c Tue Jul 05 09:33:09 2011 +0000 @@ -821,7 +821,7 @@ #ifdef CONFIG_GUI if (use_gui) { - guiGetEvent(guiXEvent, &Event); + gui(guiXEvent, &Event); if (vo_window != Event.xany.window) continue; } diff -r 6c8743e5fa30 -r c919fb3d2531 mplayer.c --- a/mplayer.c Mon Jul 04 22:24:52 2011 +0000 +++ b/mplayer.c Tue Jul 05 09:33:09 2011 +0000 @@ -584,7 +584,7 @@ uninit_audio(mpctx->sh_audio); #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetAfilter, NULL); + gui(guiSetAfilter, NULL); #endif mpctx->sh_audio = NULL; mpctx->mixer.afilter = NULL; @@ -1334,7 +1334,7 @@ if (!sh_audio) { #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetAfilter, NULL); + gui(guiSetAfilter, NULL); #endif mpctx->mixer.afilter = NULL; return 0; @@ -1359,7 +1359,7 @@ mpctx->mixer.afilter = sh_audio->afilter; #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetAfilter, sh_audio->afilter); + gui(guiSetAfilter, sh_audio->afilter); #endif return result; } @@ -2537,7 +2537,7 @@ } #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetState, (void *)GUI_PAUSE); + gui(guiSetState, (void *)GUI_PAUSE); #endif if (mpctx->video_out && mpctx->sh_video && vo_config_count) mpctx->video_out->control(VOCTRL_PAUSE, NULL); @@ -2557,7 +2557,7 @@ #ifdef CONFIG_GUI if (use_gui) { guiEventHandling(); - guiGetEvent(guiReDraw, NULL); + gui(guiReDraw, NULL); if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos)) break; } @@ -2604,7 +2604,7 @@ if (guiInfo.Playing == GUI_STOP) mpctx->eof = 1; else - guiGetEvent(guiSetState, (void *)GUI_PLAY); + gui(guiSetState, (void *)GUI_PLAY); } #endif } @@ -3051,8 +3051,8 @@ #ifdef CONFIG_GUI if (use_gui) { guiInit(); - guiGetEvent(guiSetContext, mpctx); - guiGetEvent(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); + gui(guiSetContext, mpctx); + gui(guiSetState, (void *)(gui_no_filename ? GUI_STOP : GUI_PLAY)); } #endif @@ -3090,18 +3090,18 @@ #ifdef CONFIG_GUI if (use_gui) { mpctx->file_format = DEMUXER_TYPE_UNKNOWN; - guiGetEvent(guiNewFile, 0); + gui(guiNewFile, 0); while (guiInfo.Playing != GUI_PLAY) { mp_cmd_t *cmd; usec_sleep(20000); guiEventHandling(); - guiGetEvent(guiReDraw, NULL); + gui(guiReDraw, NULL); if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) { - guiGetEvent(guiRunCommand, (void *)cmd->id); + gui(guiRunCommand, (void *)cmd->id); mp_cmd_free(cmd); } } - guiGetEvent(guiPreparation, NULL); + gui(guiPreparation, NULL); if (guiInfo.StreamType == STREAMTYPE_STREAM) { play_tree_t *entry = play_tree_new(); play_tree_add_file(entry, guiInfo.Filename); @@ -3244,7 +3244,7 @@ #ifdef CONFIG_GUI if (use_gui) - guiGetEvent(guiSetStream, mpctx->stream); + gui(guiSetStream, mpctx->stream); #endif if (mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { @@ -3677,9 +3677,9 @@ #ifdef CONFIG_GUI if (use_gui) { - if (!guiGetEvent(guiSetVideo, mpctx->sh_video)) + if (!gui(guiSetVideo, mpctx->sh_video)) goto goto_next_file; - guiGetEvent(guiSetAudio, mpctx->sh_audio); + gui(guiSetAudio, mpctx->sh_audio); } #endif @@ -3995,8 +3995,8 @@ else if (mpctx->sh_audio) guiInfo.TimeSec = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio, mpctx->audio_out); guiInfo.LengthInSec = demuxer_get_time_length(mpctx->demuxer); - guiGetEvent(guiSetMixer, NULL); - guiGetEvent(guiReDraw, NULL); + gui(guiSetMixer, NULL); + gui(guiReDraw, NULL); if (guiInfo.Playing == GUI_STOP) break; // STOP if (guiInfo.Playing == GUI_PAUSE) @@ -4103,7 +4103,7 @@ #ifdef CONFIG_DVDREAD if (!guiInfo.DiskChanged) #endif - guiGetEvent(guiEndFile, NULL); + gui(guiEndFile, NULL); } #endif