[MPlayer-cvslog] r33856 - in trunk/gui: cfg.c interface.c interface.h ui/actions.c ui/main.c ui/playbar.c ui/sub.c wm/ws.c

ib subversion at mplayerhq.hu
Sat Jul 9 12:23:48 CEST 2011


Author: ib
Date: Sat Jul  9 12:23:47 2011
New Revision: 33856

Log:
Remove guiExit().

Integrate it into mplayer().

Modified:
   trunk/gui/cfg.c
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/ui/main.c
   trunk/gui/ui/playbar.c
   trunk/gui/ui/sub.c
   trunk/gui/wm/ws.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/cfg.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -31,6 +31,7 @@
 #include "libvo/video_out.h"
 #include "libvo/x11_common.h"
 #include "mixer.h"
+#include "mp_core.h"
 #include "mp_msg.h"
 #include "mpcommon.h"
 #include "mplayer.h"
@@ -279,14 +280,14 @@ int cfg_read(void)
 
     if (!gui_conf) {
         gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
     }
 
     m_config_register_options(gui_conf, gui_opts);
 
     if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg) < 0)) {
         gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_ConfigFileError);
-// guiExit(1);
+// mplayer(MPLAYER_EXIT_GUI, 1, 0);
     }
 
     free(cfg);

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/interface.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -45,6 +45,7 @@
 #include "libvo/video_out.h"
 #include "libvo/x11_common.h"
 #include "mixer.h"
+#include "mp_core.h"
 #include "mp_msg.h"
 #include "mpcommon.h"
 #include "mplayer.h"
@@ -123,11 +124,11 @@ void guiInit(void)
     switch (i) {
     case -1:
         gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SKINCFG_SkinNotFound, skinName);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
 
     case -2:
         gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SKINCFG_SkinCfgError, skinName);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
     }
 
     // initialize windows
@@ -136,7 +137,7 @@ void guiInit(void)
 
     if (!mainDrawBuffer) {
         gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
     }
 
     if (gui_save_pos) {
@@ -491,7 +492,7 @@ int gui(int what, void *arg)
 
         if (!video_driver_list && !video_driver_list[0]) {
             gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_IDFGCVD);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         {
@@ -1080,6 +1081,10 @@ void mplayer(int what, float fparam, voi
 
         break;
     }
+
+    case MPLAYER_EXIT_GUI:
+        exit_player_with_rc((enum exit_reason)fparam, (enum exit_reason)fparam >= EXIT_ERROR);
+        break;
     }
 }
 
@@ -1181,11 +1186,6 @@ void mplayerLoadSubtitle(char *name)
     update_set_of_subtitles();
 }
 
-void guiExit(enum exit_reason how)
-{
-    exit_player_with_rc(how, how >= EXIT_ERROR);
-}
-
 // NOTE TO MYSELF: This function is nonsense.
 //                 MPlayer should pass messages to the GUI
 //                 which must decide then which message has

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/interface.h	Sat Jul  9 12:23:47 2011	(r33856)
@@ -21,7 +21,6 @@
 
 #include "config.h"
 #include "m_config.h"
-#include "mp_core.h"
 #include "playtree.h"
 #include "stream/stream.h"
 
@@ -65,6 +64,7 @@ enum {
 #define gtkClearStruct 99
 
 enum {
+    MPLAYER_EXIT_GUI,
     MPLAYER_SET_AUTO_QUALITY,
     MPLAYER_SET_BRIGHTNESS,
     MPLAYER_SET_CONTRAST,
@@ -192,6 +192,5 @@ void mplayer(int what, float fparam, voi
 void mplayerLoadFont(void);
 void mplayerLoadSubtitle(char *name);
 void gmp_msg(int mod, int lev, const char *format, ...);
-void guiExit(enum exit_reason how);
 
 #endif /* MPLAYER_GUI_INTERFACE_H */

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/ui/actions.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -176,7 +176,7 @@ void uiChangeSkin(char *name)
 
         if (!menuDrawBuffer) {
             gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         wsResizeWindow(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height);
@@ -220,7 +220,7 @@ void uiChangeSkin(char *name)
 
     if (!mainDrawBuffer) {
         gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
     }
 
     wsDestroyWindow(&guiApp.mainWindow);

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/ui/main.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -79,7 +79,7 @@ int             i,pot = 0;
 void uiMainDraw( void )
 {
 
- if ( guiApp.mainWindow.State == wsWindowClosed ) guiExit( EXIT_QUIT );
+ if ( guiApp.mainWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
 
  if ( guiApp.mainWindow.Visible == wsWindowNotVisible ||
       !mainVisible ) return;
@@ -109,7 +109,7 @@ void uiEventHandling( int msg,float para
   {
 // --- user events
    case evExit:
-        guiExit( EXIT_QUIT );
+        mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
         break;
 
    case evPlayNetwork:

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/ui/playbar.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -249,7 +249,7 @@ void uiPlaybarInit( void )
  if ( ( playbarDrawBuffer = malloc( guiApp.playbar.Bitmap.ImageSize ) ) == NULL )
   {
    gmp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
-   guiExit( EXIT_ERROR );
+   mplayer( MPLAYER_EXIT_GUI, EXIT_ERROR, 0 );
   }
 
  guiApp.playbarWindow.Parent=guiApp.subWindow.WindowID;

Modified: trunk/gui/ui/sub.c
==============================================================================
--- trunk/gui/ui/sub.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/ui/sub.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -35,7 +35,7 @@ int             subVisible = 0;
 
 void uiSubDraw( void )
 {
- if ( guiApp.subWindow.State == wsWindowClosed ) guiExit( EXIT_QUIT );
+ if ( guiApp.subWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
 
  if ( guiApp.subWindow.State == wsWindowFocusIn ) subVisible++;
  if ( guiApp.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) subVisible--;

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Fri Jul  8 23:57:18 2011	(r33855)
+++ trunk/gui/wm/ws.c	Sat Jul  9 12:23:47 2011	(r33856)
@@ -424,7 +424,7 @@ void wsCreateWindow(wsTWindow *win, int 
 
     if (depth < 15) {
         mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ColorDepthTooLow);
-        guiExit(EXIT_ERROR);
+        mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
     }
 
     XMatchVisualInfo(wsDisplay, wsScreen, depth, TrueColor, &win->VisualInfo);
@@ -550,7 +550,7 @@ void wsCreateWindow(wsTWindow *win, int 
 
         if (i == wsWLCount) {
             mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_TooManyOpenWindows);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         wsWindowList[i] = win;
@@ -1358,7 +1358,7 @@ void wsCreateImage(wsTWindow *win, int W
 
         if (win->xImage == NULL) {
             mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         win->Shminfo.shmid = shmget(IPC_PRIVATE, win->xImage->bytes_per_line * win->xImage->height, IPC_CREAT | 0777);
@@ -1366,7 +1366,7 @@ void wsCreateImage(wsTWindow *win, int W
         if (win->Shminfo.shmid < 0) {
             XDestroyImage(win->xImage);
             mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         win->Shminfo.shmaddr = (char *)shmat(win->Shminfo.shmid, 0, 0);
@@ -1378,7 +1378,7 @@ void wsCreateImage(wsTWindow *win, int W
                 shmdt(win->Shminfo.shmaddr);
 
             mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_ShmError);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
 
         win->xImage->data     = win->Shminfo.shmaddr;
@@ -1394,7 +1394,7 @@ void wsCreateImage(wsTWindow *win, int W
 
         if ((win->xImage->data = malloc(win->xImage->bytes_per_line * win->xImage->height)) == NULL) {
             mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_WS_NotEnoughMemoryDrawBuffer);
-            guiExit(EXIT_ERROR);
+            mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
         }
     }
 


More information about the MPlayer-cvslog mailing list