Mercurial > mplayer.hg
comparison gui/ui/main.c @ 35493:411875efca3f
Introduce boolean symbolic constants.
Use them wherever suitable and useful to make code easier to read.
author | ib |
---|---|
date | Tue, 04 Dec 2012 18:36:14 +0000 |
parents | a5f5f61a7a35 |
children | a25b8f9d44e0 |
comparison
equal
deleted
inserted
replaced
35492:5cbbd9ca4010 | 35493:411875efca3f |
---|---|
63 #include "widgets.h" | 63 #include "widgets.h" |
64 | 64 |
65 unsigned int GetTimerMS( void ); | 65 unsigned int GetTimerMS( void ); |
66 | 66 |
67 unsigned char * mainDrawBuffer = NULL; | 67 unsigned char * mainDrawBuffer = NULL; |
68 int uiMainRender = 1; | 68 int uiMainRender = True; |
69 | 69 |
70 int uiMainAutoPlay = 0; | 70 int uiMainAutoPlay = False; |
71 int uiMiddleMenu = 0; | 71 int uiMiddleMenu = 0; |
72 | 72 |
73 int mainVisible = 1; | 73 int mainVisible = True; |
74 | 74 |
75 int boxMoved = 0; | 75 int boxMoved = False; |
76 int sx = 0,sy = 0; | 76 int sx = 0,sy = 0; |
77 int i,pot = 0; | 77 int i,pot = 0; |
78 | 78 |
79 #include "render.h" | 79 #include "render.h" |
80 | 80 |
92 btnModify( evSetMoviePosition,guiInfo.Position ); | 92 btnModify( evSetMoviePosition,guiInfo.Position ); |
93 btnModify( evSetVolume,guiInfo.Volume ); | 93 btnModify( evSetVolume,guiInfo.Volume ); |
94 | 94 |
95 fast_memcpy( mainDrawBuffer,guiApp.main.Bitmap.Image,guiApp.main.Bitmap.ImageSize ); | 95 fast_memcpy( mainDrawBuffer,guiApp.main.Bitmap.Image,guiApp.main.Bitmap.ImageSize ); |
96 RenderAll( &guiApp.mainWindow,guiApp.mainItems,guiApp.IndexOfMainItems,mainDrawBuffer ); | 96 RenderAll( &guiApp.mainWindow,guiApp.mainItems,guiApp.IndexOfMainItems,mainDrawBuffer ); |
97 uiMainRender=0; | 97 uiMainRender=False; |
98 } | 98 } |
99 wsPutImage( &guiApp.mainWindow ); | 99 wsPutImage( &guiApp.mainWindow ); |
100 // XFlush( wsDisplay ); | 100 // XFlush( wsDisplay ); |
101 } | 101 } |
102 | 102 |
252 guiInfo.Playing=GUI_STOP; | 252 guiInfo.Playing=GUI_STOP; |
253 uiState(); | 253 uiState(); |
254 break; | 254 break; |
255 | 255 |
256 case evLoadPlay: | 256 case evLoadPlay: |
257 uiMainAutoPlay=1; | 257 uiMainAutoPlay=True; |
258 // guiInfo.StreamType=STREAMTYPE_FILE; | 258 // guiInfo.StreamType=STREAMTYPE_FILE; |
259 case evLoad: | 259 case evLoad: |
260 gtkShow( evLoad,NULL ); | 260 gtkShow( evLoad,NULL ); |
261 break; | 261 break; |
262 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; | 262 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; |
400 (now < last_redraw_time + GUI_REDRAW_WAIT) && | 400 (now < last_redraw_time + GUI_REDRAW_WAIT) && |
401 !uiPlaybarFade && (iparam == 0)) | 401 !uiPlaybarFade && (iparam == 0)) |
402 break; | 402 break; |
403 last_redraw_time = now; | 403 last_redraw_time = now; |
404 } | 404 } |
405 uiMainRender=1; | 405 uiMainRender=True; |
406 wsPostRedisplay( &guiApp.mainWindow ); | 406 wsPostRedisplay( &guiApp.mainWindow ); |
407 wsPostRedisplay( &guiApp.playbarWindow ); | 407 wsPostRedisplay( &guiApp.playbarWindow ); |
408 break; | 408 break; |
409 /* system events */ | 409 /* system events */ |
410 case evNone: | 410 case evNone: |
442 uiHideMenu( RX,RY,0 ); | 442 uiHideMenu( RX,RY,0 ); |
443 break; | 443 break; |
444 | 444 |
445 case wsPLMouseButton: | 445 case wsPLMouseButton: |
446 gtkShow( ivHidePopUpMenu,NULL ); | 446 gtkShow( ivHidePopUpMenu,NULL ); |
447 sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton; | 447 sx=X; sy=Y; boxMoved=True; itemtype=itPLMButton; |
448 SelectedItem=currentselected; | 448 SelectedItem=currentselected; |
449 if ( SelectedItem == -1 ) break; | 449 if ( SelectedItem == -1 ) break; |
450 boxMoved=0; | 450 boxMoved=False; |
451 item=&guiApp.mainItems[SelectedItem]; | 451 item=&guiApp.mainItems[SelectedItem]; |
452 itemtype=item->type; | 452 itemtype=item->type; |
453 item->pressed=btnPressed; | 453 item->pressed=btnPressed; |
454 switch( item->type ) | 454 switch( item->type ) |
455 { | 455 { |
460 { item->pressed=btnDisabled; } | 460 { item->pressed=btnDisabled; } |
461 break; | 461 break; |
462 } | 462 } |
463 break; | 463 break; |
464 case wsRLMouseButton: | 464 case wsRLMouseButton: |
465 boxMoved=0; | 465 boxMoved=False; |
466 if ( SelectedItem != -1 ) // NOTE TO MYSELF: only if itButton, itHPotmeter or itVPotmeter | 466 if ( SelectedItem != -1 ) // NOTE TO MYSELF: only if itButton, itHPotmeter or itVPotmeter |
467 { | 467 { |
468 item=&guiApp.mainItems[SelectedItem]; | 468 item=&guiApp.mainItems[SelectedItem]; |
469 item->pressed=btnReleased; | 469 item->pressed=btnReleased; |
470 } | 470 } |
514 item=&guiApp.mainItems[SelectedItem]; | 514 item=&guiApp.mainItems[SelectedItem]; |
515 switch ( itemtype ) | 515 switch ( itemtype ) |
516 { | 516 { |
517 case itPLMButton: | 517 case itPLMButton: |
518 wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); | 518 wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) ); |
519 uiMainRender=0; | 519 uiMainRender=False; |
520 break; | 520 break; |
521 case itPRMButton: | 521 case itPRMButton: |
522 uiMenuMouseHandle( RX,RY ); | 522 uiMenuMouseHandle( RX,RY ); |
523 break; | 523 break; |
524 case itPotmeter: | 524 case itPotmeter: |