[MPlayer-cvslog] r35587 - in trunk/gui: app.c cfg.c gui.h interface.c skin/skin.c ui/actions.c ui/gtk/fileselect.c ui/gtk/menu.c ui/gtk/playlist.c ui/gtk/preferences.c ui/gtk/skinbrowser.c ui/main.c ui/menu.c ui/pl...

ib subversion at mplayerhq.hu
Tue Dec 4 19:36:15 CET 2012


Author: ib
Date: Tue Dec  4 19:36:14 2012
New Revision: 35587

Log:
Introduce boolean symbolic constants.

Use them wherever suitable and useful to make code easier to read.

Modified:
   trunk/gui/app.c
   trunk/gui/cfg.c
   trunk/gui/gui.h
   trunk/gui/interface.c
   trunk/gui/skin/skin.c
   trunk/gui/ui/actions.c
   trunk/gui/ui/gtk/fileselect.c
   trunk/gui/ui/gtk/menu.c
   trunk/gui/ui/gtk/playlist.c
   trunk/gui/ui/gtk/preferences.c
   trunk/gui/ui/gtk/skinbrowser.c
   trunk/gui/ui/main.c
   trunk/gui/ui/menu.c
   trunk/gui/ui/playbar.c
   trunk/gui/ui/video.c
   trunk/gui/ui/widgets.c
   trunk/gui/util/bitmap.c
   trunk/gui/util/list.c
   trunk/gui/util/string.c
   trunk/gui/wm/ws.c

Modified: trunk/gui/app.c
==============================================================================
--- trunk/gui/app.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/app.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -22,6 +22,7 @@
  */
 
 #include "app.h"
+#include "gui.h"
 #include "skin/font.h"
 
 #include "libavutil/common.h"
@@ -106,16 +107,16 @@ void appFreeStruct(void)
     int i;
 
     appClearItem(&guiApp.main);
-    guiApp.mainDecoration = 0;
+    guiApp.mainDecoration = False;
 
     appClearItem(&guiApp.video);
 
     appClearItem(&guiApp.playbar);
-    guiApp.playbarIsPresent = 0;
+    guiApp.playbarIsPresent = False;
 
     appClearItem(&guiApp.menu);
     appClearItem(&guiApp.menuSelected);
-    guiApp.menuIsPresent = 0;
+    guiApp.menuIsPresent = False;
 
     for (i = 0; i <= guiApp.IndexOfMainItems; i++)
         appClearItem(&guiApp.mainItems[i]);

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/cfg.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -21,6 +21,7 @@
 #include <string.h>
 
 #include "cfg.h"
+#include "gui.h"
 #include "interface.h"
 #include "util/list.h"
 #include "util/string.h"
@@ -82,11 +83,11 @@ int gtkSubDumpSrt;
 
 gtkASS_t gtkASS;
 
-int gtkEnablePlayBar = 1;
+int gtkEnablePlayBar = True;
 int gtkLoadFullscreen;
-int gtkShowVideoWindow = 1;
+int gtkShowVideoWindow = True;
 
-int gui_save_pos    = 1;
+int gui_save_pos    = True;
 int gui_main_pos_x  = -3;
 int gui_main_pos_y  = -3;
 int gui_video_pos_x = -3;
@@ -244,7 +245,7 @@ void cfg_read(void)
     char *fname, line[512];
     FILE *file;
 
-    player_idle_mode = 1;   // GUI is in idle mode by default
+    player_idle_mode = True;   // GUI is in idle mode by default
 
     /* configuration */
 

Modified: trunk/gui/gui.h
==============================================================================
--- trunk/gui/gui.h	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/gui.h	Tue Dec  4 19:36:14 2012	(r35587)
@@ -24,6 +24,14 @@
 #ifndef MPLAYER_GUI_GUI_H
 #define MPLAYER_GUI_GUI_H
 
+//@{
+/// boolean symbolic constant
+#if !defined(True) && !defined(False)
+#define True  1
+#define False 0
+#endif
+//@}
+
 /// a pseudo stream type indicating not to change the current one
 #define SAME_STREAMTYPE (STREAMTYPE_DUMMY - 1)
 

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/interface.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -61,7 +61,7 @@
 guiInterface_t guiInfo = {
     .StreamType   = STREAMTYPE_DUMMY,
     .Balance      = 50.0f,
-    .PlaylistNext = 1
+    .PlaylistNext = True
 };
 
 static int initialized;
@@ -83,13 +83,13 @@ void guiInit(void)
         gtkDXR3Device = strdup("/dev/em8300-0");
 
     if (stream_cache_size > 0) {
-        gtkCacheOn   = 1;
+        gtkCacheOn   = True;
         gtkCacheSize = stream_cache_size;
     } else if (stream_cache_size == 0)
-        gtkCacheOn = 0;
+        gtkCacheOn = False;
 
     if (autosync && (autosync != gtkAutoSync)) {
-        gtkAutoSyncOn = 1;
+        gtkAutoSyncOn = True;
         gtkAutoSync   = autosync;
     }
 
@@ -235,7 +235,7 @@ void guiInit(void)
 
     guiInfo.Playing = GUI_STOP;
 
-    uiVideoRender = 1;
+    uiVideoRender = True;
 
     playlist = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
 
@@ -251,13 +251,13 @@ void guiInit(void)
 
     mplayerLoadFont();
 
-    initialized = 1;
+    initialized = True;
 }
 
 void guiDone(void)
 {
     if (initialized) {
-        uiMainRender = 0;
+        uiMainRender = False;
 
         if (gui_save_pos) {
             gui_main_pos_x  = guiApp.mainWindow.X;
@@ -571,7 +571,7 @@ int gui(int what, void *data)
         if (gtkSubDumpSrt)
             stream_dump_type = 6;
 
-        gtkSubDumpMPSub = gtkSubDumpSrt = 0;
+        gtkSubDumpMPSub = gtkSubDumpSrt = False;
         mplayerLoadFont();
 
         /* misc */
@@ -781,7 +781,7 @@ int gui(int what, void *data)
         uiEventHandling(ivRedraw, 1);
 
         if (!guiInfo.PlaylistNext && guiInfo.Playing) {
-            guiInfo.PlaylistNext = 1;
+            guiInfo.PlaylistNext = True;
             break;
         }
 
@@ -840,7 +840,7 @@ int gui(int what, void *data)
             gui(GUI_SET_STATE, (void *)GUI_STOP);
 
             wsHandleEvents();
-            uiVideoRender = 1;
+            uiVideoRender = True;
             wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
             wsClearWindow(&guiApp.videoWindow);
             wsPostRedisplay(&guiApp.videoWindow);
@@ -860,7 +860,7 @@ int gui(int what, void *data)
 int guiPlaylistInitialize(play_tree_t *my_playtree, m_config_t *config, int enqueue)
 {
     play_tree_iter_t *my_pt_iter = NULL;
-    int result = 0;
+    int result = False;
 
     if (!enqueue)
         listMgr(PLAYLIST_DELETE, 0);             // delete playlist before "appending"
@@ -869,11 +869,11 @@ int guiPlaylistInitialize(play_tree_t *m
         while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
             /* add it to end of list */
             if (add_to_gui_playlist(filename, PLAYLIST_ITEM_APPEND))
-                result = 1;
+                result = True;
     }
 
     uiCurr();   // update filename
-    guiInfo.PlaylistNext = 1;
+    guiInfo.PlaylistNext = True;
 
     if (enqueue)
         filename = NULL;            // don't start playing
@@ -892,7 +892,7 @@ int guiPlaylistInitialize(play_tree_t *m
 int guiPlaylistAdd(play_tree_t *my_playtree, m_config_t *config)
 {
     play_tree_iter_t *my_pt_iter = NULL;
-    int result = 0;
+    int result = False;
     plItem *save;
 
     save = (plItem *)listMgr(PLAYLIST_ITEM_GET_CURR, 0);    // save current item
@@ -901,7 +901,7 @@ int guiPlaylistAdd(play_tree_t *my_playt
         while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
             /* insert it into the list and set plCurrent=new item */
             if (add_to_gui_playlist(filename, PLAYLIST_ITEM_INSERT))
-                result = 1;
+                result = True;
 
         pt_iter_destroy(&my_pt_iter);
     }

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/skin/skin.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -27,6 +27,7 @@
 #include "skin.h"
 #include "font.h"
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "gui/ui/widgets.h"
 #include "gui/util/cut.h"
@@ -78,16 +79,16 @@ static void skin_error(const char *forma
  *
  * @param item name of the item to be put in a message in case of an error
  *
- * @return 1 (ok) or 0 (error)
+ * @return #True (ok) or #False (error)
  */
 static int section_item(char *item)
 {
     if (!skin) {
         skin_error(MSGTR_SKIN_ERROR_SECTION, item);
-        return 0;
+        return False;
     }
 
-    return 1;
+    return True;
 }
 
 /**
@@ -95,16 +96,16 @@ static int section_item(char *item)
  *
  * @param item name of the item to be put in a message in case of an error
  *
- * @return 1 (ok) or 0 (error)
+ * @return #True (ok) or #False (error)
  */
 static int window_item(char *item)
 {
     if (!currWinName[0]) {
         skin_error(MSGTR_SKIN_ERROR_WINDOW, item);
-        return 0;
+        return False;
     }
 
-    return 1;
+    return True;
 }
 
 /**
@@ -364,9 +365,9 @@ static int item_base(char *in)
     }
 
     if (is_bar)
-        skin->playbarIsPresent = 1;
+        skin->playbarIsPresent = True;
     if (is_menu)
-        skin->menuIsPresent = 1;
+        skin->menuIsPresent = True;
 
     return 0;
 }

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/actions.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -89,7 +89,7 @@ void uiPlay(void)
     }
 
     gui(GUI_SET_STATE, (void *)GUI_PLAY);
-    uiVideoRender = 0;
+    uiVideoRender = False;
     wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0);
     wsClearWindow(&guiApp.videoWindow);
 }
@@ -166,11 +166,11 @@ void uiChangeSkin(char *name)
     prev  = guiApp.menuIsPresent;
     bprev = guiApp.playbarIsPresent;
 
-    mainVisible = 0;
+    mainVisible = False;
 
     if (skinRead(name) != 0) {
         if (skinRead(skinName) != 0) {
-            mainVisible = 1;
+            mainVisible = True;
             return;
         }
     }
@@ -207,7 +207,7 @@ void uiChangeSkin(char *name)
         wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
 
     if (!guiInfo.Playing) {
-        uiVideoRender = 1;
+        uiVideoRender = True;
         wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B);
         wsClearWindow(&guiApp.videoWindow);
         wsPostRedisplay(&guiApp.videoWindow);
@@ -248,7 +248,7 @@ void uiChangeSkin(char *name)
         wsWindowDecoration(&guiApp.mainWindow, 0);
 
     wsVisibleWindow(&guiApp.mainWindow, wsShowWindow);
-    mainVisible = 1;
+    mainVisible = True;
 
     btnModify(evSetVolume, guiInfo.Volume);
     btnModify(evSetBalance, guiInfo.Balance);
@@ -325,7 +325,7 @@ void uiCurr(void)
 
         if (curr) {
             uiSetFile(curr->path, curr->name, STREAMTYPE_FILE);
-            guiInfo.PlaylistNext = 0;
+            guiInfo.PlaylistNext = False;
             guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, curr);
             break;
         }
@@ -342,7 +342,7 @@ void uiCurr(void)
  */
 void uiPrev(void)
 {
-    int stop = 0;
+    int stop = False;
     plItem *prev;
 
     if (guiInfo.Playing == GUI_PAUSE)
@@ -353,7 +353,7 @@ void uiPrev(void)
 
         if (--guiInfo.Track == 0) {
             guiInfo.Track = 1;
-            stop = 1;
+            stop = True;
         }
 
         break;
@@ -362,7 +362,7 @@ void uiPrev(void)
 
         if (--guiInfo.Track == 1) {
             guiInfo.Track = 2;
-            stop = 1;
+            stop = True;
         }
 
         break;
@@ -374,7 +374,7 @@ void uiPrev(void)
 
             if (--guiInfo.Track == 0) {
                 guiInfo.Track = 1;
-                stop = 1;
+                stop = True;
             }
         }
 
@@ -386,7 +386,7 @@ void uiPrev(void)
 
         if (prev) {
             uiSetFile(prev->path, prev->name, STREAMTYPE_FILE);
-            guiInfo.PlaylistNext = (guiInfo.Playing ? 0 : 1);
+            guiInfo.PlaylistNext = (guiInfo.Playing ? False : True);
             guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, prev);
             break;
         }
@@ -406,7 +406,7 @@ void uiPrev(void)
  */
 void uiNext(void)
 {
-    int stop = 0;
+    int stop = False;
     plItem *next;
 
     if (guiInfo.Playing == GUI_PAUSE)
@@ -418,7 +418,7 @@ void uiNext(void)
 
         if (++guiInfo.Track > guiInfo.Tracks) {
             guiInfo.Track = guiInfo.Tracks;
-            stop = 1;
+            stop = True;
         }
 
         break;
@@ -430,7 +430,7 @@ void uiNext(void)
 
             if (++guiInfo.Track > guiInfo.Tracks) {
                 guiInfo.Track = guiInfo.Tracks;
-                stop = 1;
+                stop = True;
             }
         }
 
@@ -442,7 +442,7 @@ void uiNext(void)
 
         if (next) {
             uiSetFile(next->path, next->name, STREAMTYPE_FILE);
-            guiInfo.PlaylistNext = (guiInfo.Playing ? 0 : 1);
+            guiInfo.PlaylistNext = (guiInfo.Playing ? False : True);
             guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, next);
             break;
         }

Modified: trunk/gui/ui/gtk/fileselect.c
==============================================================================
--- trunk/gui/ui/gtk/fileselect.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/gtk/fileselect.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -31,6 +31,7 @@
 #include "gui/ui/pixmaps/file.xpm"
 
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "gui/util/list.h"
 #include "gui/util/mem.h"
@@ -540,7 +541,7 @@ static void fs_Ok_released( GtkButton * 
    item=item->next;
   }
  if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name_utf8() );
- if ( uiMainAutoPlay ) { uiMainAutoPlay=0; uiEventHandling( evPlay,0 ); }
+ if ( uiMainAutoPlay ) { uiMainAutoPlay=False; uiEventHandling( evPlay,0 ); }
   else gui( GUI_SET_STATE,(void *) GUI_STOP );
 }
 

Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/gtk/menu.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -30,6 +30,7 @@
 #include "gui/ui/widgets.h"
 #include "gui/ui/gmplayer.h"
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 
 #include "stream/stream.h"
@@ -645,15 +646,15 @@ GtkWidget * create_PopUpMenu( void )
 
   if ( guiInfo.VideoWindow )
    {
-    int b1 = 0, b2 = 0, b_half = 0;
+    int b1 = False, b2 = False, b_half = False;
     AddSeparator( Menu );
     if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing )
      {
       if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&&
-           ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=1;
+           ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=True;
       else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) &&
-                ( guiApp.videoWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=1;
-      else b1=1;
+                ( guiApp.videoWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=True;
+      else b1=True;
      } else b1=!guiApp.videoWindow.isFullScreen;
     H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize );
     N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize"      ",b1,evNormalSize );

Modified: trunk/gui/ui/gtk/playlist.c
==============================================================================
--- trunk/gui/ui/gtk/playlist.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/gtk/playlist.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -174,8 +174,8 @@ static void plRowSelect( GtkCList * clis
 {
  switch ( (int) user_data )
   {
-   case 0: CLFileSelected[row]=1; break;
-   case 1: CLListSelected[row]=1; break;
+   case 0: CLFileSelected[row]=True; break;
+   case 1: CLListSelected[row]=True; break;
   }
 }
 
@@ -183,8 +183,8 @@ static void plUnRowSelect( GtkCList * cl
 {
  switch ( (int) user_data )
   {
-   case 0: CLFileSelected[row]=0; break;
-   case 1: CLListSelected[row]=0; break;
+   case 0: CLFileSelected[row]=False; break;
+   case 1: CLListSelected[row]=False; break;
   }
 }
 
@@ -233,7 +233,7 @@ static void plButtonReleased( GtkButton 
 	   {
 	    uiSetFile( item->path,item->name,STREAMTYPE_FILE );
 	    guiInfo.NewPlay = GUI_FILE_NEW;
-	    guiInfo.PlaylistNext = (curr.name ? 0 : 1);
+	    guiInfo.PlaylistNext = (curr.name ? False : True);
 	    guiInfo.Track = 1;
 	   }
 	  guiInfo.Tracks = (int) listMgr( PLAYLIST_ITEM_GET_POS,NULL );
@@ -289,7 +289,7 @@ static void plButtonReleased( GtkButton 
 	    else
 	     {
 	      CLListSelected=p;
-	      CLListSelected[NrOfSelected - 1]=0;
+	      CLListSelected[NrOfSelected - 1]=False;
 	      gtk_clist_get_text( GTK_CLIST( CLFiles ),i,0,(char **)&itext );
 	      cpath=g_filename_to_utf8( current_path, -1, NULL, NULL, NULL );
 	      text[0][0]=itext[0][0]; text[0][1]=cpath ? cpath : current_path;
@@ -343,13 +343,13 @@ static gboolean plEvent ( GtkWidget * wi
       switch ( (int) user_data )
       {
         case 0:
-          CLFileSelected[row] = 1;
+          CLFileSelected[row] = True;
           plButtonReleased( NULL, (void *) 3 );
-          CLFileSelected[row] = 0;
+          CLFileSelected[row] = False;
           return TRUE;
 
         case 1:
-          CLListSelected[row] = 1;
+          CLListSelected[row] = True;
           plButtonReleased( NULL, (void *) 2 );
           return TRUE;
       }
@@ -375,13 +375,13 @@ static int check_for_subdir( gchar * pat
        npath=calloc( 1,strlen( path ) + strlen( dirent->d_name ) + 3 );
        sprintf( npath,"%s/%s",path,dirent->d_name );
        if ( stat( npath,&statbuf ) != -1 && S_ISDIR( statbuf.st_mode ) )
-        { free( npath ); closedir( dir ); return 1; }
+        { free( npath ); closedir( dir ); return True; }
        free( npath );
       }
     }
    closedir( dir );
   }
- return 0;
+ return False;
 }
 
 static void plCTree( GtkCTree * ctree,GtkCTreeNode * parent_node,gpointer user_data )
@@ -390,7 +390,7 @@ static void plCTree( GtkCTree * ctree,Gt
  DirNodeType   * DirNode;
  gchar 		   * text, * name = NULL;
  gchar 		   * dummy = "dummy";
- int     	 	 subdir = 1;
+ int     	 	 subdir = True;
  DIR   		   * dir = NULL;
  struct dirent * dirent;
  gchar  	   * path;
@@ -399,7 +399,7 @@ static void plCTree( GtkCTree * ctree,Gt
  DirNode=gtk_ctree_node_get_row_data( ctree,parent_node );
  if ( !DirNode->scaned )
   {
-   DirNode->scaned=1; current_path=DirNode->path;
+   DirNode->scaned=True; current_path=DirNode->path;
    gtk_clist_freeze( GTK_CLIST( ctree ) );
    node=gtk_ctree_find_by_row_data( ctree,parent_node,NULL );
    gtk_ctree_remove_node( ctree,node );
@@ -417,7 +417,7 @@ static void plCTree( GtkCTree * ctree,Gt
 
        if ( stat( path,&statbuf ) != -1 && S_ISDIR( statbuf.st_mode ) && dirent->d_name[0] != '.' )
 	{
-	 DirNode=malloc( sizeof( DirNodeType ) ); DirNode->scaned=0; DirNode->path=strdup( path );
+	 DirNode=malloc( sizeof( DirNodeType ) ); DirNode->scaned=False; DirNode->path=strdup( path );
 	 subdir=check_for_subdir( path );
 	 node=gtk_ctree_insert_node( ctree,parent_node,NULL,(name ? &name : &text ),4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,!subdir,FALSE );
 	 gtk_ctree_node_set_row_data_full( ctree,node,DirNode,NULL );
@@ -533,7 +533,7 @@ GtkWidget * create_PlayList( void )
 
   parent=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),NULL,NULL,&root,4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,FALSE,FALSE );
   DirNode=malloc( sizeof( DirNodeType ) );
-  DirNode->scaned=0; DirNode->path=strdup( root );
+  DirNode->scaned=False; DirNode->path=strdup( root );
   gtk_ctree_node_set_row_data_full(GTK_CTREE( CTDirTree ),parent,DirNode,NULL );
   sibling=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),parent,NULL,&dummy,4,NULL,NULL,NULL,NULL,TRUE,TRUE );
   gtk_ctree_expand( GTK_CTREE( CTDirTree ),parent );

Modified: trunk/gui/ui/gtk/preferences.c
==============================================================================
--- trunk/gui/ui/gtk/preferences.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/gtk/preferences.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -41,6 +41,7 @@
 
 #include "gui/app.h"
 #include "gui/cfg.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "gui/ui/gmplayer.h"
 #include "gui/ui/widgets.h"
@@ -467,11 +468,11 @@ void ShowPreferences( void )
  gtk_widget_show( Preferences );
  gtkSetLayer( Preferences );
  {
-  static int visible = 1;
+  static int visible = True;
   if ( visible )
    {
     gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message );
-    visible=0;
+    visible=False;
    }
  }
 }
@@ -620,11 +621,11 @@ static void prButton( GtkButton * button
 	player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) );
 	mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 );
 
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=1; }
-	 else gtkCacheOn=0;
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=True; }
+	 else gtkCacheOn=False;
 
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=1; }
-	 else gtkAutoSyncOn=0;
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=True; }
+	 else gtkAutoSyncOn=False;
 
 	setdup( &dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) );
 	setdup( &cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) );

Modified: trunk/gui/ui/gtk/skinbrowser.c
==============================================================================
--- trunk/gui/ui/gtk/skinbrowser.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/gtk/skinbrowser.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -28,6 +28,7 @@
 
 #include "gui/app.h"
 #include "gui/cfg.h"
+#include "gui/gui.h"
 #include "gui/skin/skin.h"
 #include "help_mp.h"
 
@@ -87,7 +88,7 @@ int gtkFillSkinList( gchar * mdir )
     }
   }
  globfree( &gg );
- return 1;
+ return True;
 }
 
 static void prButton( GtkButton * button,gpointer user_data )

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/main.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -65,14 +65,14 @@
 unsigned int GetTimerMS( void );
 
 unsigned char * mainDrawBuffer = NULL;
-int             uiMainRender = 1;
+int             uiMainRender = True;
 
-int             uiMainAutoPlay = 0;
+int             uiMainAutoPlay = False;
 int             uiMiddleMenu = 0;
 
-int             mainVisible = 1;
+int             mainVisible = True;
 
-int             boxMoved = 0;
+int             boxMoved = False;
 int             sx = 0,sy = 0;
 int             i,pot = 0;
 
@@ -94,7 +94,7 @@ void uiMainDraw( void )
 
    fast_memcpy( mainDrawBuffer,guiApp.main.Bitmap.Image,guiApp.main.Bitmap.ImageSize );
    RenderAll( &guiApp.mainWindow,guiApp.mainItems,guiApp.IndexOfMainItems,mainDrawBuffer );
-   uiMainRender=0;
+   uiMainRender=False;
   }
  wsPutImage( &guiApp.mainWindow );
 // XFlush( wsDisplay );
@@ -254,7 +254,7 @@ NoPause:
 	break;
 
    case evLoadPlay:
-        uiMainAutoPlay=1;
+        uiMainAutoPlay=True;
 //	guiInfo.StreamType=STREAMTYPE_FILE;
    case evLoad:
         gtkShow( evLoad,NULL );
@@ -402,7 +402,7 @@ set_volume:
             break;
           last_redraw_time = now;
         }
-        uiMainRender=1;
+        uiMainRender=True;
         wsPostRedisplay( &guiApp.mainWindow );
 	wsPostRedisplay( &guiApp.playbarWindow );
         break;
@@ -444,10 +444,10 @@ void uiMainMouseHandle( int Button,int X
 
    case wsPLMouseButton:
 	  gtkShow( ivHidePopUpMenu,NULL );
-          sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton;
+          sx=X; sy=Y; boxMoved=True; itemtype=itPLMButton;
           SelectedItem=currentselected;
           if ( SelectedItem == -1 ) break;
-          boxMoved=0;
+          boxMoved=False;
           item=&guiApp.mainItems[SelectedItem];
           itemtype=item->type;
           item->pressed=btnPressed;
@@ -462,7 +462,7 @@ void uiMainMouseHandle( int Button,int X
            }
           break;
    case wsRLMouseButton:
-          boxMoved=0;
+          boxMoved=False;
           if ( SelectedItem != -1 )   // NOTE TO MYSELF: only if itButton, itHPotmeter or itVPotmeter
            {
             item=&guiApp.mainItems[SelectedItem];
@@ -516,7 +516,7 @@ rollerhandled:
            {
             case itPLMButton:
                  wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) );
-                 uiMainRender=0;
+                 uiMainRender=False;
                  break;
             case itPRMButton:
                  uiMenuMouseHandle( RX,RY );

Modified: trunk/gui/ui/menu.c
==============================================================================
--- trunk/gui/ui/menu.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/menu.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -26,16 +26,17 @@
 #include "help_mp.h"
 #include "mp_msg.h"
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gmplayer.h"
 
 #include "widgets.h"
 
 unsigned char * menuDrawBuffer = NULL;
-int             menuRender = 1;
+int             menuRender = True;
 int             menuItem = -1;
 int             oldMenuItem = -1;
 int             menuX,menuY;
-static int      menuIsInitialized = 0;
+static int      menuIsInitialized = False;
 
 static void uiMenuDraw( void )
 {
@@ -64,7 +65,7 @@ static void uiMenuDraw( void )
    oldMenuItem=menuItem;
 /* --- */
    wsConvert( &guiApp.menuWindow,menuDrawBuffer );
-   menuRender=0;
+   menuRender=False;
   }
  wsPutImage( &guiApp.menuWindow );
 }
@@ -111,7 +112,7 @@ void uiShowMenu( int mx,int my )
  wsMoveWindow( &guiApp.menuWindow,True,x,y );
  wsRaiseWindowTop( wsDisplay,guiApp.menuWindow.WindowID );
  wsSetLayer( wsDisplay,guiApp.menuWindow.WindowID,1 );
- menuRender=1;
+ menuRender=True;
  wsVisibleWindow( &guiApp.menuWindow,wsShowWindow );
  wsPostRedisplay( &guiApp.menuWindow );
 }
@@ -165,9 +166,9 @@ void uiMenuInit( void )
 
  mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu] menuWindow ID: 0x%x\n",(int)guiApp.menuWindow.WindowID );
 
- menuIsInitialized=1;
+ menuIsInitialized=True;
  guiApp.menuWindow.ReDraw=uiMenuDraw;
 // guiApp.menuWindow.MouseHandler=uiMenuMouseHandle;
 // guiApp.menuWindow.KeyHandler=uiMainKeyHandle;
- menuRender=1; wsPostRedisplay( &guiApp.menuWindow );
+ menuRender=True; wsPostRedisplay( &guiApp.menuWindow );
 }

Modified: trunk/gui/ui/playbar.c
==============================================================================
--- trunk/gui/ui/playbar.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/playbar.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "gui/skin/font.h"
 #include "gui/skin/skin.h"
@@ -53,7 +54,7 @@ unsigned int GetTimerMS( void );
 unsigned int GetTimer( void );
 
 unsigned char * playbarDrawBuffer = NULL;
-int		playbarVisible = 0;
+int		playbarVisible = False;
 int  		playbarLength = 0;
 int		uiPlaybarFade = 0;
 
@@ -80,7 +81,7 @@ static void uiPlaybarDraw( void )
 	 {
 	  playbarLength=guiApp.videoWindow.Height - guiApp.playbar.height;
 	  uiPlaybarFade=0;
-	  vo_mouse_autohide=0;
+	  vo_mouse_autohide=False;
 	 }
         wsMoveWindow( &guiApp.playbarWindow,True,x,playbarLength );
 	break;
@@ -89,8 +90,9 @@ static void uiPlaybarDraw( void )
 	if ( playbarLength > guiApp.videoWindow.Height )
 	 {
 	  playbarLength=guiApp.videoWindow.Height;
-	  uiPlaybarFade=playbarVisible=0;
-          vo_mouse_autohide=1;
+	  uiPlaybarFade=0;
+	  playbarVisible=False;
+          vo_mouse_autohide=True;
           wsVisibleWindow( &guiApp.playbarWindow,wsHideWindow );
 	  return;
 	 }
@@ -104,7 +106,7 @@ static void uiPlaybarDraw( void )
    btnModify( evSetMoviePosition,guiInfo.Position );
    btnModify( evSetVolume,guiInfo.Volume );
 
-   vo_mouse_autohide=0;
+   vo_mouse_autohide=False;
 
    fast_memcpy( playbarDrawBuffer,guiApp.playbar.Bitmap.Image,guiApp.playbar.Bitmap.ImageSize );
    RenderAll( &guiApp.playbarWindow,guiApp.playbarItems,guiApp.IndexOfPlaybarItems,playbarDrawBuffer );
@@ -237,7 +239,7 @@ void uiPlaybarShow( int y )
  if ( y > guiApp.videoWindow.Height - guiApp.playbar.height )
   {
    if ( !uiPlaybarFade ) wsVisibleWindow( &guiApp.playbarWindow,wsShowWindow );
-   uiPlaybarFade=1; playbarVisible=1; wsPostRedisplay( &guiApp.playbarWindow );
+   uiPlaybarFade=1; playbarVisible=True; wsPostRedisplay( &guiApp.playbarWindow );
   }
   else if ( !uiPlaybarFade ) uiPlaybarFade=2;
 }

Modified: trunk/gui/ui/video.c
==============================================================================
--- trunk/gui/ui/video.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/video.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -26,10 +26,11 @@
 
 #include "gmplayer.h"
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "widgets.h"
 
-int             uiVideoRender = 0;
+int             uiVideoRender = False;
 int             videoVisible = 0;
 
 void uiVideoDraw( void )
@@ -42,7 +43,7 @@ void uiVideoDraw( void )
  if ( !guiApp.videoWindow.Mapped ||
       guiApp.videoWindow.Visible == wsWindowNotVisible ) return;
 
- if ( guiInfo.Playing ) uiVideoRender=0;
+ if ( guiInfo.Playing ) uiVideoRender=False;
 
  if ( uiVideoRender && guiApp.videoWindow.State == wsWindowExpose )
   {

Modified: trunk/gui/ui/widgets.c
==============================================================================
--- trunk/gui/ui/widgets.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/ui/widgets.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -41,6 +41,7 @@
 
 #include "widgets.h"
 #include "gui/app.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 #include "gui/wm/ws.h"
 
@@ -54,7 +55,7 @@ GtkWidget *ErrorPixmap;
 
 int gtkPopupMenu      = 0;
 int gtkPopupMenuParam = 0;
-int gtkInitialized    = 0;
+int gtkInitialized    = False;
 
 #include "gtk/skinbrowser.h"
 #include "gtk/playlist.h"
@@ -151,7 +152,7 @@ void gtkInit(void)
 
     gtkLoadIcon(theme, 48, &gdkIcon, &gdkIconMask);
 
-    gtkInitialized = 1;
+    gtkInitialized = True;
 }
 
 void gtkAddIcon(GtkWidget *window)

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/util/bitmap.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -27,6 +27,7 @@
 #include <unistd.h>
 
 #include "bitmap.h"
+#include "gui/gui.h"
 
 #include "help_mp.h"
 #include "libavcodec/avcodec.h"
@@ -143,7 +144,7 @@ static int pngRead(const char *fname, gu
         if (img->Image)
             memcpy_pic(img->Image, frame->data[0], bpl, img->Height, bpl, frame->linesize[0]);
         else
-            decode_ok = 0;
+            decode_ok = False;
     }
 
     avcodec_close(avctx);
@@ -159,7 +160,7 @@ static int pngRead(const char *fname, gu
  *
  * @param img image to be converted
  *
- * @return 1 (ok) or 0 (error)
+ * @return #True (ok) or #False (error)
  *
  * @note This is an in-place conversion,
  *       new memory will be allocated for @a img if necessary.
@@ -179,7 +180,7 @@ static int convert_ARGB(guiImage *img)
         if (!img->Image) {
             free(orgImage);
             mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", img->ImageSize);
-            return 0;
+            return False;
         }
 
         mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 32 bpp conversion size: %lu\n", img->ImageSize);
@@ -194,9 +195,9 @@ static int convert_ARGB(guiImage *img)
         for (i = 0; i < img->ImageSize; i += 4)
             *(uint32_t *)&img->Image[i] = (img->Image[i + 3] << 24) | AV_RB24(&img->Image[i]);
     } else
-        return 0;
+        return False;
 
-    return 1;
+    return True;
 }
 
 /**
@@ -278,7 +279,7 @@ void bpFree(guiImage *img)
  * @param in image to render a bitmap mask from
  * @param out bitmap mask
  *
- * @return 1 (ok) or 0 (error)
+ * @return #True (ok) or #False (error)
  *
  * @note As a side effect, transparent pixels of @a in will be rendered black.
  */
@@ -298,7 +299,7 @@ int bpRenderMask(const guiImage *in, gui
 
     if (!out->Image) {
         mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", out->ImageSize);
-        return 0;
+        return False;
     }
 
     buf = (uint32_t *)in->Image;
@@ -334,5 +335,5 @@ int bpRenderMask(const guiImage *in, gui
 
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 1 bpp conversion size: %lu\n", out->ImageSize);
 
-    return 1;
+    return True;
 }

Modified: trunk/gui/util/list.c
==============================================================================
--- trunk/gui/util/list.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/util/list.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "list.h"
+#include "gui/gui.h"
 #include "string.h"
 
 #include "mp_msg.h"
@@ -329,7 +330,7 @@ void listRepl(char ***list, const char *
  * @param what file to be added
  * @param how command (#PLAYLIST_ITEM_APPEND or #PLAYLIST_ITEM_INSERT) to be performed
  *
- * @return 1 (ok) or 0 (error)
+ * @return #True (ok) or #False (error)
  */
 int add_to_gui_playlist(const char *what, int how)
 {
@@ -338,7 +339,7 @@ int add_to_gui_playlist(const char *what
     plItem *item;
 
     if (!what || !*what || (how != PLAYLIST_ITEM_APPEND && how != PLAYLIST_ITEM_INSERT))
-        return 0;
+        return False;
 
     file = mp_basename(what);
     path = strdup(what);
@@ -351,7 +352,7 @@ int add_to_gui_playlist(const char *what
     item = calloc(1, sizeof(plItem));
 
     if (!item)
-        return 0;
+        return False;
 
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[list] adding %s/%s\n", path, file);
 
@@ -360,5 +361,5 @@ int add_to_gui_playlist(const char *what
 
     listMgr(how, item);
 
-    return 1;
+    return True;
 }

Modified: trunk/gui/util/string.c
==============================================================================
--- trunk/gui/util/string.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/util/string.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "string.h"
+#include "gui/gui.h"
 #include "gui/interface.h"
 
 #include "config.h"
@@ -93,7 +94,7 @@ char *strswap(char *in, char from, char 
 char *trim(char *in)
 {
     char *src, *dest;
-    int freeze = 0;
+    int freeze = False;
 
     src = dest = in;
 
@@ -128,7 +129,7 @@ char *trim(char *in)
 char *decomment(char *in)
 {
     char *p;
-    int nap = 0;
+    int nap = False;
 
     p = in;
 

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Dec  4 17:08:18 2012	(r35586)
+++ trunk/gui/wm/ws.c	Tue Dec  4 19:36:14 2012	(r35587)
@@ -107,8 +107,8 @@ wsTWindow *wsWindowList[wsWLCount] = { N
 
 unsigned long wsKeyTable[512];
 
-int wsUseXShm   = 1;
-int wsUseXShape = 1;
+int wsUseXShm   = True;
+int wsUseXShape = True;
 
 static int wsSearch(Window win)
 {
@@ -259,7 +259,7 @@ void wsXInit(Display *mDisplay)
 
         if (dispname && *dispname != ':') {
             localdisp = 0;
-            wsUseXShm = 0;
+            wsUseXShm = False;
         }
 
         mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] display name: %s => %s display.\n", dispname, localdisp ? "local" : "REMOTE");
@@ -271,7 +271,7 @@ void wsXInit(Display *mDisplay)
 #ifdef HAVE_SHM
     if (!XShmQueryExtension(wsDisplay))
 #endif
-    wsUseXShm = 0;
+    wsUseXShm = False;
 
     if (!wsUseXShm)
         mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_WS_NoXshm);
@@ -279,7 +279,7 @@ void wsXInit(Display *mDisplay)
 #ifdef CONFIG_XSHAPE
     if (!XShapeQueryExtension(wsDisplay, &eventbase, &errorbase))
 #endif
-    wsUseXShape = 0;
+    wsUseXShape = False;
 
     if (!wsUseXShape)
         mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_WS_NoXshape);
@@ -439,7 +439,7 @@ void wsCreateWindow(wsTWindow *win, int 
     win->Property = D;
 
     if (D & wsShowFrame)
-        win->Decorations = 1;
+        win->Decorations = True;
 
     wsHGC = DefaultGC(wsDisplay, wsScreen);
 
@@ -788,26 +788,26 @@ expose:
     case KeyRelease:
         i = wsKeyReleased;
 keypressed:
-        wsWindowList[l]->Alt      = 0;
-        wsWindowList[l]->Shift    = 0;
-        wsWindowList[l]->NumLock  = 0;
-        wsWindowList[l]->Control  = 0;
-        wsWindowList[l]->CapsLock = 0;
+        wsWindowList[l]->Alt      = False;
+        wsWindowList[l]->Shift    = False;
+        wsWindowList[l]->NumLock  = False;
+        wsWindowList[l]->Control  = False;
+        wsWindowList[l]->CapsLock = False;
 
         if (Event->xkey.state & Mod1Mask)
-            wsWindowList[l]->Alt = 1;
+            wsWindowList[l]->Alt = True;
 
         if (Event->xkey.state & Mod2Mask)
-            wsWindowList[l]->NumLock = 1;
+            wsWindowList[l]->NumLock = True;
 
         if (Event->xkey.state & ControlMask)
-            wsWindowList[l]->Control = 1;
+            wsWindowList[l]->Control = True;
 
         if (Event->xkey.state & ShiftMask)
-            wsWindowList[l]->Shift = 1;
+            wsWindowList[l]->Shift = True;
 
         if (Event->xkey.state & LockMask)
-            wsWindowList[l]->CapsLock = 1;
+            wsWindowList[l]->CapsLock = True;
 
 #if 0
         {
@@ -1436,7 +1436,7 @@ void wsCreateImage(wsTWindow *win, int W
         }
 
         win->xImage->data     = win->Shminfo.shmaddr;
-        win->Shminfo.readOnly = 0;
+        win->Shminfo.readOnly = False;
         XShmAttach(wsDisplay, &win->Shminfo);
         XSync(wsDisplay, False);
         shmctl(win->Shminfo.shmid, IPC_RMID, 0);


More information about the MPlayer-cvslog mailing list