[MPlayer-cvslog] r35890 - in trunk/gui: interface.c ui/actions.c ui/main.c ui/menu.c ui/playbar.c ui/ui.h ui/video.c

ib subversion at mplayerhq.hu
Sat Jan 26 00:47:34 CET 2013


Author: ib
Date: Sat Jan 26 00:47:34 2013
New Revision: 35890

Log:
Add uiMainDone(), uiVideoDone(), uiPlaybarDone() and uiMenuDone().

These are the counterparts to the Init functions and they free and
release everything associated with the respective window. (Something
that hasn't been done so far.)

Modified:
   trunk/gui/interface.c
   trunk/gui/ui/actions.c
   trunk/gui/ui/main.c
   trunk/gui/ui/menu.c
   trunk/gui/ui/playbar.c
   trunk/gui/ui/ui.h
   trunk/gui/ui/video.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/interface.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -231,7 +231,13 @@ void guiDone(void)
 
         cfg_write();
 
-        // NOTE TO MYSELF: destroy the windows
+        if (guiApp.menuIsPresent)
+            uiMenuDone();
+        if (guiApp.playbarIsPresent)
+            uiPlaybarDone();
+
+        uiVideoDone();
+        uiMainDone();
 
         wsDone();
     }

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/actions.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -639,14 +639,13 @@ void uiChangeSkin(char *name)
     /* reload playbar */
 
     if (bprev)
-        wsWindowDestroy(&guiApp.playbarWindow);
+        uiPlaybarDone();
 
     uiPlaybarInit();
 
     /* reload main window */
 
-    wsWindowDestroy(&guiApp.mainWindow);
-
+    uiMainDone();
     uiMainInit();
 
     wsWindowVisibility(&guiApp.mainWindow, wsShowWindow);

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/main.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -361,3 +361,9 @@ void uiMainInit (void)
   guiApp.mainWindow.KeyHandler = uiMainKey;
   guiApp.mainWindow.DNDHandler = uiMainDND;
 }
+
+void uiMainDone (void)
+{
+  nfree(mainDrawBuffer);
+  wsWindowDestroy(&guiApp.mainWindow);
+}

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/menu.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -29,6 +29,7 @@
 #include "gui/app/gui.h"
 #include "actions.h"
 #include "ui.h"
+#include "gui/util/mem.h"
 
 #include "gui/dialog/dialog.h"
 
@@ -125,6 +126,12 @@ void uiMenuInit( void )
  uiMenuRender=True; wsWindowRedraw( &guiApp.menuWindow );
 }
 
+void uiMenuDone( void )
+{
+  nfree(menuDrawBuffer);
+  wsWindowDestroy(&guiApp.menuWindow);
+}
+
 void uiMenuShow( int mx,int my )
 {
  int x,y;

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/playbar.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -260,6 +260,12 @@ void uiPlaybarInit( void )
  playbarLength=guiApp.videoWindow.Height;
 }
 
+void uiPlaybarDone( void )
+{
+  nfree(playbarDrawBuffer);
+  wsWindowDestroy(&guiApp.playbarWindow);
+}
+
 void uiPlaybarShow( int y )
 {
  if ( !guiApp.playbarIsPresent || !gtkEnablePlayBar ) return;

Modified: trunk/gui/ui/ui.h
==============================================================================
--- trunk/gui/ui/ui.h	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/ui.h	Sat Jan 26 00:47:34 2013	(r35890)
@@ -28,14 +28,18 @@ extern int             uiPlaybarFade;
 extern int             sx, sy;
 
 void uiMainInit( void );
+void uiMainDone( void );
 
 void uiVideoInit( void );
+void uiVideoDone( void );
 
 void uiMenuInit( void );
+void uiMenuDone( void );
 void uiMenuHide( int mx, int my, int w );
 void uiMenuShow( int mx, int my );
 
 void uiPlaybarInit( void );
+void uiPlaybarDone( void );
 void uiPlaybarShow( int y );
 
 #endif /* MPLAYER_GUI_UI_H */

Modified: trunk/gui/ui/video.c
==============================================================================
--- trunk/gui/ui/video.c	Fri Jan 25 23:31:37 2013	(r35889)
+++ trunk/gui/ui/video.c	Sat Jan 26 00:47:34 2013	(r35890)
@@ -126,3 +126,8 @@ void uiVideoInit (void)
   guiApp.videoWindow.KeyHandler = guiApp.mainWindow.KeyHandler;
   guiApp.videoWindow.DNDHandler = guiApp.mainWindow.DNDHandler;
 }
+
+void uiVideoDone (void)
+{
+  wsWindowDestroy(&guiApp.videoWindow);
+}


More information about the MPlayer-cvslog mailing list