changeset 33732:90c992ac5011

Make guiEventHandling() a gui() call. The new parameter to use is GUI_HANDLE_EVENTS.
author ib
date Tue, 05 Jul 2011 13:48:55 +0000
parents 81f71d910333
children 7458d793b38b
files gui/interface.c gui/interface.h gui/win32/interface.c mplayer.c
diffstat 4 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Tue Jul 05 12:05:06 2011 +0000
+++ b/gui/interface.c	Tue Jul 05 13:48:55 2011 +0000
@@ -598,6 +598,12 @@
 
         break;
 
+    case GUI_HANDLE_EVENTS:
+        if (!guiInfo.Playing || !guiInfo.MovieWindow)
+            wsHandleEvents();
+        gtkEventHandling();
+        break;
+
     case GUI_RUN_COMMAND:
 
         mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)arg);
@@ -1026,14 +1032,6 @@
     return True;
 }
 
-void guiEventHandling(void)
-{
-    if (!guiInfo.Playing || !guiInfo.MovieWindow)
-        wsHandleEvents();
-
-    gtkEventHandling();
-}
-
 // ---
 #if defined(MP_DEBUG) && 0
 void list(void)
--- a/gui/interface.h	Tue Jul 05 12:05:06 2011 +0000
+++ b/gui/interface.h	Tue Jul 05 13:48:55 2011 +0000
@@ -49,6 +49,7 @@
 #define GUI_SET_AFILTER        17
 #define GUI_SET_CONTEXT        18
 #define GUI_END_FILE           19
+#define GUI_HANDLE_EVENTS      20
 
 #define GUI_STOP  0
 #define GUI_PLAY  1
@@ -231,7 +232,6 @@
 char *gstrdup(const char *str);
 void *gtkSet(int cmd, float fparam, void *vparam);
 void guiDone(void);
-void guiEventHandling(void);
 void guiExit(enum exit_reason how);
 int gui(int what, void *arg);
 void guiInit(void);
--- a/gui/win32/interface.c	Tue Jul 05 12:05:06 2011 +0000
+++ b/gui/win32/interface.c	Tue Jul 05 13:48:55 2011 +0000
@@ -680,6 +680,8 @@
             if(gtkAutoSyncOn) autosync = gtkAutoSync;
             break;
         }
+        case GUI_HANDLE_EVENTS:
+          break;
         case GUI_SET_MIXER:
         {
             if(audio_out)
@@ -911,5 +913,3 @@
     SendMessage(mygui->subwindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
     return 0;
 }
-
-void guiEventHandling(void) {}
--- a/mplayer.c	Tue Jul 05 12:05:06 2011 +0000
+++ b/mplayer.c	Tue Jul 05 13:48:55 2011 +0000
@@ -2556,7 +2556,7 @@
             mpctx->video_out->check_events();
 #ifdef CONFIG_GUI
         if (use_gui) {
-            guiEventHandling();
+            gui(GUI_HANDLE_EVENTS, 0);
             gui(GUI_REDRAW, 0);
             if (guiInfo.Playing != GUI_PAUSE || (rel_seek_secs || abs_seek_pos))
                 break;
@@ -3094,7 +3094,7 @@
         while (guiInfo.Playing != GUI_PLAY) {
             mp_cmd_t *cmd;
             usec_sleep(20000);
-            guiEventHandling();
+            gui(GUI_HANDLE_EVENTS, 0);
             gui(GUI_REDRAW, 0);
             if ((cmd = mp_input_get_cmd(0, 0, 0)) != NULL) {
                 gui(GUI_RUN_COMMAND, (void *)cmd->id);
@@ -3812,7 +3812,7 @@
 
 #ifdef CONFIG_GUI
                 if (use_gui)
-                    guiEventHandling();
+                    gui(GUI_HANDLE_EVENTS, 0);
 #endif
 
                 current_module = "vo_check_events";
@@ -3983,7 +3983,7 @@
 
 #ifdef CONFIG_GUI
             if (use_gui) {
-                guiEventHandling();
+                gui(GUI_HANDLE_EVENTS, 0);
                 if (mpctx->demuxer->file_format == DEMUXER_TYPE_AVI && mpctx->sh_video && mpctx->sh_video->video.dwLength > 2) {
                     // get pos from frame number / total frames
                     guiInfo.Position = (float)mpctx->d_video->pack_no * 100.0f / mpctx->sh_video->video.dwLength;