diff gui/interface.c @ 35780:4073fff5efc7

Add new functions uiMainInit() and uiVideoInit(). Relocate handler initialization stuff there and reorder the windows init calls. As a result, all handler functions can be static now.
author ib
date Fri, 25 Jan 2013 12:26:31 +0000
parents c688b0dcbe66
children 454b0d784d95
line wrap: on
line diff
--- a/gui/interface.c	Fri Jan 25 11:57:24 2013 +0000
+++ b/gui/interface.c	Fri Jan 25 12:26:31 2013 +0000
@@ -180,9 +180,6 @@
 
     WinID = guiApp.videoWindow.WindowID;
 
-    uiMenuInit();
-    uiPlaybarInit();
-
 // i=wsHideFrame|wsMaxSize|wsHideWindow;
 // if ( guiApp.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
     i = (guiApp.mainDecoration ? wsShowFrame : 0) | wsMinSize | wsMaxSize | wsHideWindow;
@@ -193,15 +190,10 @@
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] mainWindow ID: 0x%x\n", (int)guiApp.mainWindow.WindowID);
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] videoWindow ID: 0x%x\n", (int)guiApp.videoWindow.WindowID);
 
-    guiApp.mainWindow.DrawHandler  = uiMainDraw;
-    guiApp.mainWindow.MouseHandler = uiMainMouse;
-    guiApp.mainWindow.KeyHandler   = uiMainKey;
-    guiApp.mainWindow.DNDHandler   = uiMainDND;
-
-    guiApp.videoWindow.DrawHandler  = uiVideoDraw;
-    guiApp.videoWindow.MouseHandler = uiVideoMouse;
-    guiApp.videoWindow.KeyHandler   = uiMainKey;
-    guiApp.videoWindow.DNDHandler   = uiMainDND;
+    uiMainInit();      // main window must be first!
+    uiVideoInit();
+    uiPlaybarInit();
+    uiMenuInit();
 
     if (guiApp.video.Bitmap.Image)
         wsImageRender(&guiApp.videoWindow, guiApp.video.Bitmap.Image);