comparison gui/ui/playbar.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 31a5320909f7
children e27855a45128
comparison
equal deleted inserted replaced
35492:5cbbd9ca4010 35493:411875efca3f
23 #include <sys/stat.h> 23 #include <sys/stat.h>
24 #include <unistd.h> 24 #include <unistd.h>
25 #include <string.h> 25 #include <string.h>
26 26
27 #include "gui/app.h" 27 #include "gui/app.h"
28 #include "gui/gui.h"
28 #include "gui/interface.h" 29 #include "gui/interface.h"
29 #include "gui/skin/font.h" 30 #include "gui/skin/font.h"
30 #include "gui/skin/skin.h" 31 #include "gui/skin/skin.h"
31 #include "gui/util/mem.h" 32 #include "gui/util/mem.h"
32 #include "gui/wm/ws.h" 33 #include "gui/wm/ws.h"
51 52
52 unsigned int GetTimerMS( void ); 53 unsigned int GetTimerMS( void );
53 unsigned int GetTimer( void ); 54 unsigned int GetTimer( void );
54 55
55 unsigned char * playbarDrawBuffer = NULL; 56 unsigned char * playbarDrawBuffer = NULL;
56 int playbarVisible = 0; 57 int playbarVisible = False;
57 int playbarLength = 0; 58 int playbarLength = 0;
58 int uiPlaybarFade = 0; 59 int uiPlaybarFade = 0;
59 60
60 static void uiPlaybarDraw( void ) 61 static void uiPlaybarDraw( void )
61 { 62 {
78 playbarLength--; 79 playbarLength--;
79 if ( guiApp.videoWindow.Height - guiApp.playbar.height >= playbarLength ) 80 if ( guiApp.videoWindow.Height - guiApp.playbar.height >= playbarLength )
80 { 81 {
81 playbarLength=guiApp.videoWindow.Height - guiApp.playbar.height; 82 playbarLength=guiApp.videoWindow.Height - guiApp.playbar.height;
82 uiPlaybarFade=0; 83 uiPlaybarFade=0;
83 vo_mouse_autohide=0; 84 vo_mouse_autohide=False;
84 } 85 }
85 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); 86 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength );
86 break; 87 break;
87 case 2: // fade out 88 case 2: // fade out
88 playbarLength+=10; 89 playbarLength+=10;
89 if ( playbarLength > guiApp.videoWindow.Height ) 90 if ( playbarLength > guiApp.videoWindow.Height )
90 { 91 {
91 playbarLength=guiApp.videoWindow.Height; 92 playbarLength=guiApp.videoWindow.Height;
92 uiPlaybarFade=playbarVisible=0; 93 uiPlaybarFade=0;
93 vo_mouse_autohide=1; 94 playbarVisible=False;
95 vo_mouse_autohide=True;
94 wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow ); 96 wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow );
95 return; 97 return;
96 } 98 }
97 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength ); 99 wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength );
98 break; 100 break;
102 if ( guiApp.playbarWindow.State == wsWindowExpose ) 104 if ( guiApp.playbarWindow.State == wsWindowExpose )
103 { 105 {
104 btnModify( evSetMoviePosition,guiInfo.Position ); 106 btnModify( evSetMoviePosition,guiInfo.Position );
105 btnModify( evSetVolume,guiInfo.Volume ); 107 btnModify( evSetVolume,guiInfo.Volume );
106 108
107 vo_mouse_autohide=0; 109 vo_mouse_autohide=False;
108 110
109 fast_memcpy( playbarDrawBuffer,guiApp.playbar.Bitmap.Image,guiApp.playbar.Bitmap.ImageSize ); 111 fast_memcpy( playbarDrawBuffer,guiApp.playbar.Bitmap.Image,guiApp.playbar.Bitmap.ImageSize );
110 RenderAll( &guiApp.playbarWindow,guiApp.playbarItems,guiApp.IndexOfPlaybarItems,playbarDrawBuffer ); 112 RenderAll( &guiApp.playbarWindow,guiApp.playbarItems,guiApp.IndexOfPlaybarItems,playbarDrawBuffer );
111 wsConvert( &guiApp.playbarWindow,playbarDrawBuffer ); 113 wsConvert( &guiApp.playbarWindow,playbarDrawBuffer );
112 } 114 }
235 if ( !guiApp.videoWindow.isFullScreen ) return; 237 if ( !guiApp.videoWindow.isFullScreen ) return;
236 238
237 if ( y > guiApp.videoWindow.Height - guiApp.playbar.height ) 239 if ( y > guiApp.videoWindow.Height - guiApp.playbar.height )
238 { 240 {
239 if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow ); 241 if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow );
240 uiPlaybarFade=1; playbarVisible=1; wsPostRedisplay( &guiApp.playbarWindow ); 242 uiPlaybarFade=1; playbarVisible=True; wsPostRedisplay( &guiApp.playbarWindow );
241 } 243 }
242 else if ( !uiPlaybarFade ) uiPlaybarFade=2; 244 else if ( !uiPlaybarFade ) uiPlaybarFade=2;
243 } 245 }
244 246
245 void uiPlaybarInit( void ) 247 void uiPlaybarInit( void )