Mercurial > mplayer.hg
comparison gui/ui/main.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 | 8ad72f9cf697 |
children | 9fdc3e22063f |
comparison
equal
deleted
inserted
replaced
35779:8ad72f9cf697 | 35780:4073fff5efc7 |
---|---|
62 int sx = 0,sy = 0; | 62 int sx = 0,sy = 0; |
63 int i,pot = 0; | 63 int i,pot = 0; |
64 | 64 |
65 #include "render.h" | 65 #include "render.h" |
66 | 66 |
67 void uiMainDraw( void ) | 67 static void uiMainDraw( void ) |
68 { | 68 { |
69 | 69 |
70 if ( guiApp.mainWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); | 70 if ( guiApp.mainWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 ); |
71 | 71 |
72 if ( guiApp.mainWindow.Visible == wsWindowNotVisible || | 72 if ( guiApp.mainWindow.Visible == wsWindowNotVisible || |
85 // NOTE TO MYSELF: probably not, if uiMainRender is False | 85 // NOTE TO MYSELF: probably not, if uiMainRender is False |
86 wsImageDraw( &guiApp.mainWindow ); | 86 wsImageDraw( &guiApp.mainWindow ); |
87 // XFlush( wsDisplay ); | 87 // XFlush( wsDisplay ); |
88 } | 88 } |
89 | 89 |
90 void uiMainMouse( int Button,int X,int Y,int RX,int RY ) | 90 static void uiMainMouse( int Button,int X,int Y,int RX,int RY ) |
91 { | 91 { |
92 static int itemtype = 0; | 92 static int itemtype = 0; |
93 int i; | 93 int i; |
94 guiItem * item = NULL; | 94 guiItem * item = NULL; |
95 float value = 0.0f; | 95 float value = 0.0f; |
207 } | 207 } |
208 break; | 208 break; |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 void uiMainKey( int KeyCode,int Type,int Key ) | 212 static void uiMainKey( int KeyCode,int Type,int Key ) |
213 { | 213 { |
214 int msg = evNone; | 214 int msg = evNone; |
215 | 215 |
216 if ( Type != wsKeyPressed ) return; | 216 if ( Type != wsKeyPressed ) return; |
217 | 217 |
254 } | 254 } |
255 if ( msg != evNone ) uiEvent( msg,0 ); | 255 if ( msg != evNone ) uiEvent( msg,0 ); |
256 } | 256 } |
257 | 257 |
258 /* this will be used to handle drag & drop files */ | 258 /* this will be used to handle drag & drop files */ |
259 void uiMainDND(int num,char** files) | 259 static void uiMainDND(int num,char** files) |
260 { | 260 { |
261 struct stat buf; | 261 struct stat buf; |
262 int f = 0; | 262 int f = 0; |
263 | 263 |
264 char* subtitles = NULL; | 264 char* subtitles = NULL; |
334 nfree(guiInfo.SubtitleFilename); | 334 nfree(guiInfo.SubtitleFilename); |
335 guiInfo.SubtitleFilename = subtitles; | 335 guiInfo.SubtitleFilename = subtitles; |
336 mplayerLoadSubtitle(guiInfo.SubtitleFilename); | 336 mplayerLoadSubtitle(guiInfo.SubtitleFilename); |
337 } | 337 } |
338 } | 338 } |
339 | |
340 void uiMainInit (void) | |
341 { | |
342 guiApp.mainWindow.DrawHandler = uiMainDraw; | |
343 guiApp.mainWindow.MouseHandler = uiMainMouse; | |
344 guiApp.mainWindow.KeyHandler = uiMainKey; | |
345 guiApp.mainWindow.DNDHandler = uiMainDND; | |
346 } |