changeset 3054:9507f90d8254

add half dvd support for gui
author pontscho
date Wed, 21 Nov 2001 17:43:57 +0000
parents 153fc4f5464f
children 38df49b91824
files Gui/events.h Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/menu.c Gui/mplayer/mw.h Gui/mplayer/play.h Gui/mplayer/psignal.c Gui/mplayer/sw.h Gui/mplayer/widgets.h Gui/wm/ws.c mplayer.c
diffstat 10 files changed, 423 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/events.h	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/events.h	Wed Nov 21 17:43:57 2001 +0000
@@ -60,6 +60,10 @@
 #define evGtkIsOk         5004
 #define evShowPopUpMenu   5005
 #define evHidePopUpMenu   5006
+#define evSetDVDAudio     5007
+#define evSetDVDSubtitle  5008
+#define evSetDVDTitle     5009
+#define evSetDVDChapter   5010
 
 #define evFName           7000
 #define evMovieTime       7001
--- a/Gui/mplayer/gtk/fs.c	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/gtk/fs.c	Wed Nov 21 17:43:57 2001 +0000
@@ -35,12 +35,17 @@
 gchar         * fsFilter = NULL;
 
 int             fsPressed = 0;
-#define fsLastFilterNames 4
-unsigned char * fsFilterNames[fsLastFilterNames+1][2] = { { "MPEG files( *.mpg )", "*.mpg" },
-					{ "VOB files( *.vob )", "*.vob"  },
-                                        { "AVI files( *.avi )",  "*.avi" },
-					{ "VIVO files( *.viv )", "*.viv" },
-                                        { "All files( *)",       "*"     } };
+#define fsLastFilterNames 6
+unsigned char * fsFilterNames[fsLastFilterNames+1][2] = 
+					{ { "MPEG files( *.mpg )", "*.mpg" },
+					  { "VOB files( *.vob )",  "*.vob" },
+                                          { "AVI files( *.avi )",  "*.avi" },
+					  { "QT files( *.mov )",   "*.mov" },
+					  { "ASF files( *.asf )",  "*.asf" },
+  					  { "VIVO files( *.viv )", "*.viv" },
+                                          { "All files( * )",      "*"     } };
+
+// .avi .mpg .vob .mov .viv .asf
 
 GtkWidget   * fsFileNamesList;
 GtkWidget   * fsFNameList;
--- a/Gui/mplayer/gtk/menu.c	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/gtk/menu.c	Wed Nov 21 17:43:57 2001 +0000
@@ -1,16 +1,21 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+
+#include "../../../config.h"
 
 #include "../../events.h"
+
 #include "menu.h"
 #include "../widgets.h"
 
 void ActivateMenuItem( int Item )
 {
 // fprintf( stderr,"[menu] item: %d\n",Item );
- gtkShMem->popupmenu=Item;
- gtkShMem->visiblepopupmenu=0; 
+ gtkShMem->popupmenu=Item & 0x0000ffff;
+ gtkShMem->popupmenuparam=Item >> 16;
+ gtkShMem->visiblepopupmenu=0;
  gtkSendMessage( evShowPopUpMenu );
 }
 
@@ -52,8 +57,199 @@
  return Item;
 }
 
+typedef struct
+{
+ int id;
+ char * name;
+} Languages_t;
+
+#define lng( a,b ) ( (int)(a) * 256 + b )
+Languages_t Languages[] =
+         {
+           { lng( 'a','b' ), "Abkhazian"                  },
+           { lng( 'a','a' ), "Afar"                       },
+           { lng( 'a','f' ), "Afrikaans"                  },
+           { lng( 's','q' ), "Albanian"                   },
+           { lng( 'a','m' ), "Amharic"                    },
+           { lng( 'a','r' ), "Arabic"                     },
+           { lng( 'h','y' ), "Armenian"                   },
+           { lng( 'a','s' ), "Assamese"                   },
+           { lng( 'a','e' ), "Avestan"                    },
+           { lng( 'a','y' ), "Aymara"                     },
+           { lng( 'a','z' ), "Azerbaijani"                },
+           { lng( 'b','a' ), "Bashkir"                    },
+           { lng( 'e','u' ), "Basque"                     },
+           { lng( 'b','e' ), "Belarusian"                 },
+           { lng( 'b','n' ), "Bengali"                    },
+           { lng( 'b','h' ), "Bihari"                     },
+           { lng( 'b','i' ), "Bislama"                    },
+           { lng( 'b','s' ), "Bosnian"                    },
+           { lng( 'b','r' ), "Breton"                     },
+           { lng( 'b','g' ), "Bulgarian"                  },
+           { lng( 'm','y' ), "Burmese"                    },
+           { lng( 'c','a' ), "Catalan"                    },
+           { lng( 'c','h' ), "Chamorro"                   },
+           { lng( 'c','e' ), "Chechen"                    },
+           { lng( 'n','y' ), "Chichewa;Nyanja"            },
+           { lng( 'z','h' ), "Chinese"                    },
+           { lng( 'c','u' ), "ChurchSlavic"               },
+           { lng( 'c','v' ), "Chuvash"                    },
+           { lng( 'k','w' ), "Cornish"                    },
+           { lng( 'c','o' ), "Corsican"                   },
+           { lng( 'h','r' ), "Croatian"                   },
+           { lng( 'c','s' ), "Czech"                      },
+           { lng( 'd','a' ), "Danish"                     },
+           { lng( 'n','l' ), "Dutch"                      },
+           { lng( 'd','z' ), "Dzongkha"                   },
+           { lng( 'e','n' ), "English"                    },
+           { lng( 'e','o' ), "Esperanto"                  },
+           { lng( 'e','t' ), "Estonian"                   },
+           { lng( 'f','o' ), "Faroese"                    },
+           { lng( 'f','j' ), "Fijian"                     },
+           { lng( 'f','i' ), "Finnish"                    },
+           { lng( 'f','r' ), "French"                     },
+           { lng( 'f','y' ), "Frisian"                    },
+           { lng( 'g','d' ), "Gaelic(Scots"               },
+           { lng( 'g','l' ), "Gallegan"                   },
+           { lng( 'k','a' ), "Georgian"                   },
+           { lng( 'd','e' ), "German"                     },
+           { lng( 'e','l' ), "Greek"                      },
+           { lng( 'g','n' ), "Guarani"                    },
+           { lng( 'g','u' ), "Gujarati"                   },
+           { lng( 'h','a' ), "Hausa"                      },
+           { lng( 'h','e' ), "Hebrew"                     },
+           { lng( 'i','w' ), "Hebrew"                     },
+           { lng( 'h','z' ), "Herero"                     },
+           { lng( 'h','i' ), "Hindi"                      },
+           { lng( 'h','o' ), "HiriMotu"                   },
+           { lng( 'h','u' ), "Hungarian"                  },
+           { lng( 'i','s' ), "Icelandic"                  },
+           { lng( 'i','d' ), "Indonesian"                 },
+           { lng( 'i','n' ), "Indonesian"                 },
+           { lng( 'i','a' ), "Interlingua"                },
+           { lng( 'i','e' ), "Interlingue"                },
+           { lng( 'i','u' ), "Inuktitut"                  },
+           { lng( 'i','k' ), "Inupiaq"                    },
+           { lng( 'g','a' ), "Irish"                      },
+           { lng( 'i','t' ), "Italian"                    },
+           { lng( 'j','a' ), "Japanese"                   },
+           { lng( 'j','v' ), "Javanese"                   },
+           { lng( 'j','w' ), "Javanese"                   },
+           { lng( 'k','l' ), "Kalaallisut"                },
+           { lng( 'k','n' ), "Kannada"                    },
+           { lng( 'k','s' ), "Kashmiri"                   },
+           { lng( 'k','k' ), "Kazakh"                     },
+           { lng( 'k','m' ), "Khmer"                      },
+           { lng( 'k','i' ), "Kikuyu"                     },
+           { lng( 'r','w' ), "Kinyarwanda"                },
+           { lng( 'k','y' ), "Kirghiz"                    },
+           { lng( 'k','v' ), "Komi"                       },
+           { lng( 'k','o' ), "Korean"                     },
+           { lng( 'k','j' ), "Kuanyama"                   },
+           { lng( 'k','u' ), "Kurdish"                    },
+           { lng( 'l','o' ), "Lao"                        },
+           { lng( 'l','a' ), "Latin"                      },
+           { lng( 'l','v' ), "Latvian"                    },
+           { lng( 'l','b' ), "Letzeburgesch"              },
+           { lng( 'l','n' ), "Lingala"                    },
+           { lng( 'l','t' ), "Lithuanian"                 },
+           { lng( 'm','k' ), "Macedonian"                 },
+           { lng( 'm','g' ), "Malagasy"                   },
+           { lng( 'm','s' ), "Malay"                      },
+           { lng( 'm','l' ), "Malayalam"                  },
+           { lng( 'm','t' ), "Maltese"                    },
+           { lng( 'g','v' ), "Manx"                       },
+           { lng( 'm','i' ), "Maori"                      },
+           { lng( 'm','r' ), "Marathi"                    },
+           { lng( 'm','h' ), "Marshall"                   },
+           { lng( 'm','o' ), "Moldavian"                  },
+           { lng( 'm','n' ), "Mongolian"                  },
+           { lng( 'n','a' ), "Nauru"                      },
+           { lng( 'n','v' ), "Navajo"                     },
+           { lng( 'n','d' ), "North Ndebele"              },
+           { lng( 'n','r' ), "South Ndebele"              },
+           { lng( 'n','g' ), "Ndonga"                     },
+           { lng( 'n','e' ), "Nepali"                     },
+           { lng( 's','e' ), "NorthernSami"               },
+           { lng( 'n','o' ), "Norwegian"                  },
+           { lng( 'n','b' ), "NorwegianBokmål"            },
+           { lng( 'n','n' ), "NorwegianNynorsk"           },
+           { lng( 'n','y' ), "Nyanja;Chichewa"            },
+           { lng( 'o','c' ), "Occitan(post1500;Provençal" },
+           { lng( 'o','r' ), "Oriya"                      },
+           { lng( 'o','m' ), "Oromo"                      },
+           { lng( 'o','s' ), "Ossetian;Ossetic"           },
+           { lng( 'p','i' ), "Pali"                       },
+           { lng( 'p','a' ), "Panjabi"                    },
+           { lng( 'f','a' ), "Persian"                    },
+           { lng( 'p','l' ), "Polish"                     },
+           { lng( 'p','t' ), "Portuguese"                 },
+           { lng( 'o','c' ), "Provençal;Occitan(post1500" },
+           { lng( 'p','s' ), "Pushto"                     },
+           { lng( 'q','u' ), "Quechua"                    },
+           { lng( 'r','m' ), "Raeto-Romance"              },
+           { lng( 'r','o' ), "Romanian"                   },
+           { lng( 'r','n' ), "Rundi"                      },
+           { lng( 'r','u' ), "Russian"                    },
+           { lng( 's','m' ), "Samoan"                     },
+           { lng( 's','g' ), "Sango"                      },
+           { lng( 's','a' ), "Sanskrit"                   },
+           { lng( 's','c' ), "Sardinian"                  },
+           { lng( 's','r' ), "Serbian"                    },
+           { lng( 's','n' ), "Shona"                      },
+           { lng( 's','d' ), "Sindhi"                     },
+           { lng( 's','i' ), "Sinhalese"                  },
+           { lng( 's','k' ), "Slovak"                     },
+           { lng( 's','l' ), "Slovenian"                  },
+           { lng( 's','o' ), "Somali"                     },
+           { lng( 's','t' ), "Sotho"                      },
+           { lng( 'e','s' ), "Spanish"                    },
+           { lng( 's','u' ), "Sundanese"                  },
+           { lng( 's','w' ), "Swahili"                    },
+           { lng( 's','s' ), "Swati"                      },
+           { lng( 's','v' ), "Swedish"                    },
+           { lng( 't','l' ), "Tagalog"                    },
+           { lng( 't','y' ), "Tahitian"                   },
+           { lng( 't','g' ), "Tajik"                      },
+           { lng( 't','a' ), "Tamil"                      },
+           { lng( 't','t' ), "Tatar"                      },
+           { lng( 't','e' ), "Telugu"                     },
+           { lng( 't','h' ), "Thai"                       },
+           { lng( 'b','o' ), "Tibetan"                    },
+           { lng( 't','i' ), "Tigrinya"                   },
+           { lng( 't','o' ), "Tonga"                      },
+           { lng( 't','s' ), "Tsonga"                     },
+           { lng( 't','n' ), "Tswana"                     },
+           { lng( 't','r' ), "Turkish"                    },
+           { lng( 't','k' ), "Turkmen"                    },
+           { lng( 't','w' ), "Twi"                        },
+           { lng( 'u','g' ), "Uighur"                     },
+           { lng( 'u','k' ), "Ukrainian"                  },
+           { lng( 'u','r' ), "Urdu"                       },
+           { lng( 'u','z' ), "Uzbek"                      },
+           { lng( 'v','i' ), "Vietnamese"                 },
+           { lng( 'v','o' ), "Volapük"                    },
+           { lng( 'c','y' ), "Welsh"                      },
+           { lng( 'w','o' ), "Wolof"                      },
+           { lng( 'x','h' ), "Xhosa"                      },
+           { lng( 'y','i' ), "Yiddish"                    },
+           { lng( 'j','i' ), "Yiddish"                    },
+           { lng( 'y','o' ), "Yoruba"                     },
+           { lng( 'z','a' ), "Zhuang"                     },
+           { lng( 'z','u' ), "Zulu"                       },
+         };
+#undef lng
+
+char * GetLanguage( int language )
+{
+ int i;
+ for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
+  if ( Languages[i].id == language ) return Languages[i].name;
+}
+
 GtkWidget * DVDSubMenu;
 GtkWidget * DVDTitleMenu;
+GtkWidget * DVDChapterMenu;
 GtkWidget * DVDAudioLanguageMenu;
 GtkWidget * DVDSubtitleLanguageMenu;
 
@@ -61,7 +257,6 @@
 {
  GtkWidget * Menu = NULL;
  GtkWidget * SubMenu = NULL;
- GtkWidget * SubMenuItem = NULL;
 
  Menu=gtk_menu_new();
 
@@ -70,7 +265,9 @@
    SubMenu=AddSubMenu( Menu,"Open ..." );
     AddMenuItem( SubMenu,"Play file ...""    ", evLoadPlay );
     AddMenuItem( SubMenu,"Play VCD ...", evNone );
+#ifdef USE_DVDREAD
     AddMenuItem( SubMenu,"Play DVD ...", evPlayDVD );
+#endif
     AddMenuItem( SubMenu,"Play URL ...", evNone );
     AddMenuItem( SubMenu,"Load subtitle ...   ", evLoadSubtitle );
    SubMenu=AddSubMenu( Menu,"Playing" );
@@ -79,24 +276,65 @@
     AddMenuItem( SubMenu,"Stop", evStop );
     AddMenuItem( SubMenu,"Prev stream", evPrev );
     AddMenuItem( SubMenu,"Next stream", evNext );
-    AddSeparator( SubMenu );
-    AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec );
-    AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec );
-    AddMenuItem( SubMenu,"Back 1 min", evBackward1min );
-    AddMenuItem( SubMenu,"Fwd 1 min", evForward1min );
-    AddMenuItem( SubMenu,"Back 10 min", evBackward10min );
-    AddMenuItem( SubMenu,"Fwk 10 min", evForward10min );
+//    AddSeparator( SubMenu );
+//    AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec );
+//    AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec );
+//    AddMenuItem( SubMenu,"Back 1 min", evBackward1min );
+//    AddMenuItem( SubMenu,"Fwd 1 min", evForward1min );
    SubMenu=AddSubMenu( Menu,"Size" );
     AddMenuItem( SubMenu,"Normal size""      ", evNormalSize );
     AddMenuItem( SubMenu,"Double size", evDoubleSize );
     AddMenuItem( SubMenu,"Fullscreen", evFullScreen );
+#ifdef USE_DVDREAD
    DVDSubMenu=AddSubMenu( Menu,"DVD" );
     AddMenuItem( DVDSubMenu,"Play disc ...""    ", evPlayDVD );
     AddMenuItem( DVDSubMenu,"Show DVD Menu", evNone );
     AddSeparator( DVDSubMenu );
     DVDTitleMenu=AddSubMenu( DVDSubMenu,"Titles" );
+     if ( gtkShMem->DVD.titles )
+      {
+       char tmp[32]; int i;
+       for ( i=0;i<gtkShMem->DVD.titles;i++ )
+        {
+         sprintf( tmp,"Title %2d",i+1 );
+         AddMenuItem( DVDTitleMenu,tmp,( (i+1) << 16 ) + evSetDVDTitle );
+        }
+      }
+      else AddMenuItem( DVDTitleMenu,"(none)",evNone );
+    DVDChapterMenu=AddSubMenu( DVDSubMenu,"Chapter" );
+     if ( gtkShMem->DVD.chapters )
+      {
+       char tmp[32]; int i;
+       for ( i=0;i<gtkShMem->DVD.chapters;i++ )
+        {
+         sprintf( tmp,"Chapter %2d",i+1 );
+         AddMenuItem( DVDChapterMenu,tmp,( (i+1) << 16 ) + evSetDVDChapter );
+        }
+      }
+      else DVDChapterMenu=AddMenuItem( DVDChapterMenu,"(none)",evNone );
     DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,"Audio language" );
+     if ( gtkShMem->DVD.nr_of_audio_channels )
+      {
+       char tmp[64]; int i;
+       for ( i=0;i<gtkShMem->DVD.nr_of_audio_channels;i++ )
+        {
+         strcpy( tmp,GetLanguage( gtkShMem->DVD.audio_streams[i].language ) );
+         AddMenuItem( DVDAudioLanguageMenu,tmp,( gtkShMem->DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
+        }
+      }
+      else DVDChapterMenu=AddMenuItem( DVDAudioLanguageMenu,"(none)",evNone );
     DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,"Subtitle language" );
+     if ( gtkShMem->DVD.nr_of_subtitles )
+      {
+       char tmp[64]; int i;
+       for ( i=0;i<gtkShMem->DVD.nr_of_subtitles;i++ )
+        {
+         strcpy( tmp,GetLanguage( gtkShMem->DVD.subtitles[i].language ) );
+         AddMenuItem( DVDSubtitleLanguageMenu,tmp,( gtkShMem->DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
+        }
+      }
+      else DVDChapterMenu=AddMenuItem( DVDSubtitleLanguageMenu,"(none)",evNone );
+#endif
   AddSeparator( Menu );
   AddMenuItem( Menu,"Playlist", evPlayList );
   AddMenuItem( Menu,"Skin browser", evSkinBrowser );
--- a/Gui/mplayer/mw.h	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/mw.h	Wed Nov 21 17:43:57 2001 +0000
@@ -15,6 +15,39 @@
 int             sx = 0,sy = 0;
 int             i,pot = 0;
 
+inline void TranslateFilename( int c,char * tmp )
+{
+ int i;
+ switch ( mplShMem->StreamType )
+  {
+   case STREAMTYPE_FILE:
+          if ( gtkShMem->fs.filename[0] )
+           {
+            strcpy( tmp,gtkShMem->fs.filename );
+            if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
+            if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
+           } else strcpy( tmp,"no file loaded" );
+          break;
+#ifdef USE_DVDREAD		     
+   case STREAMTYPE_DVD:
+          if ( mplShMem->DVD.current_chapter ) sprintf( tmp,"chapter %d",mplShMem->DVD.current_chapter );
+            else strcat( tmp,"no chapter" );
+          break;
+#endif
+   default: strcpy( tmp,"no media opened" );
+  }
+ if ( c )
+  {
+   for ( i=0;i < strlen( tmp );i++ )
+    {
+     int t=0;
+     if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; }
+     if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; }
+     tmp[i]=(char)( tmp[i] + t );
+    }
+  }
+}
+
 char * Translate( char * str )
 {
  static char   trbuf[512];
@@ -30,49 +63,10 @@
     {
      switch ( str[++i] )
       {
-       case 't':
-            sprintf( tmp,"%02d",mplShMem->Track ); strcat( trbuf,tmp );
-            break;
-       case 'f':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              int i;
-              strcpy( tmp,gtkShMem->fs.filename );
-              for ( i=0;i < strlen( tmp );i++ )
-               {
-                t=0;
-                if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32;
-                tmp[i]=(char)( tmp[i] + t );
-               }
-              if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
-              if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
-             } else strcpy( tmp,"no file loaded" );
-            strcat( trbuf,tmp );
-            break;
-       case 'F':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              int i;
-              strcpy( tmp,gtkShMem->fs.filename );
-              for ( i=0;i < strlen( tmp );i++ )
-               {
-                char t = 0;
-                if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=32;
-                tmp[i]=tmp[i] - t;
-               }
-              if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
-              if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
-             } else strcpy( tmp,"NO FILE LOADED" );
-            strcat( trbuf,tmp );
-            break;
-       case 'o':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              strcat( trbuf,gtkShMem->fs.filename );
-              if ( trbuf[strlen( trbuf ) - 4] == '.' ) trbuf[strlen( trbuf ) - 4]=0;
-              if ( trbuf[strlen( trbuf ) - 5] == '.' ) trbuf[strlen( trbuf ) - 5]=0;
-             } else strcat( trbuf,"no file loaded" );
-            break;
+       case 't': sprintf( tmp,"%02d",mplShMem->Track ); strcat( trbuf,tmp ); break;
+       case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
+       case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
+       case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
        case '6': t=mplShMem->LengthInSec; goto calclengthhhmmss;
        case '1': t=mplShMem->TimeSec;
 calclengthhhmmss:
@@ -109,7 +103,9 @@
              case STREAMTYPE_FILE:   strcat( trbuf,"f" ); break;
              case STREAMTYPE_VCD:    strcat( trbuf,"v" ); break;
              case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
+#ifdef USE_DVDREAD		     
              case STREAMTYPE_DVD:    strcat( trbuf,"d" ); break;
+#endif
              default:                strcat( trbuf," " ); break;
             }
            break;
@@ -122,7 +118,7 @@
  return trbuf;
 }
 
-void PutImage( txSample * bf,int x,int y,int max,int ofs )
+inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
 {
  int i=0,ix,iy;
  unsigned long * buf = NULL;
@@ -157,21 +153,6 @@
  btnModify( evSetMoviePosition,mplShMem->Position );
  btnModify( evSetVolume,mplShMem->Volume );
 
- switch ( mplShMem->Playing )
-  {
-   case 2:
-   case 0:
-        btnModify( evPlaySwitchToPause,btnReleased );
-        btnModify( evPauseSwitchToPlay,btnDisabled );
-        break;
-   case 1:
-        if ( mplShMem->Filename[0] != 0 )
-         {
-          btnModify( evPlaySwitchToPause,btnDisabled );
-          btnModify( evPauseSwitchToPlay,btnReleased );
-         }
-  }
-
  if ( mplMainRender )
   {
    memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
@@ -229,8 +210,10 @@
         exit_player( "Exit" );
         break;
 
+#ifdef USE_DVDREAD
    case evPlayDVD:
         mplShMem->StreamType=STREAMTYPE_DVD;
+#endif
 	
    case evPlay:
    case evPlaySwitchToPause:
@@ -246,21 +229,20 @@
           case STREAMTYPE_FILE:   
 	       dvd_title=0;
 	       break;
+#ifdef USE_DVDREAD
           case STREAMTYPE_DVD:    
 	       dvd_title=1; 
 	       dvd_chapter=1; 
 	       dvd_angle=1; 
 	       strcpy( mplShMem->Filename,"/dev/dvd" );
 	       break;
+#endif
          }
         mplPlay();
         break;
-	
-//        break;
 
    case evPause:
    case evPauseSwitchToPlay:
-Pause:
         btnModify( evPlaySwitchToPause,btnReleased );
         btnModify( evPauseSwitchToPlay,btnDisabled );
 NoPause:
@@ -397,7 +379,7 @@
 	if ( mplMiddleMenu )
 	 {
 	  mplMiddleMenu=0;
-	  mplMsgHandle( gtkShMem->popupmenu,0 );
+	  mplMsgHandle( gtkShMem->popupmenu,gtkShMem->popupmenuparam );
 	 }
         break;
 // --- system events
@@ -488,6 +470,7 @@
           break;
 	  
    case wsPMMouseButton:
+	memcpy( &gtkShMem->DVD,&mplShMem->DVD,sizeof( mplDVDStruct ) );
         gtkSendMessage( evShowPopUpMenu );
 	break;	  
 
--- a/Gui/mplayer/play.h	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/play.h	Wed Nov 21 17:43:57 2001 +0000
@@ -2,9 +2,15 @@
 #ifndef __GUI_PLAY_H
 #define __GUI_PLAY_H
 
+#include "../../config.h"
+
 #include "./psignal.h"
 #include "./mplayer.h"
 
+#ifdef USE_DVDREAD
+ #include "../../libmpdemux/stream.h"
+#endif
+
 typedef struct
 {
  int x;
@@ -28,12 +34,30 @@
  char codecdll[128];
 } mplVideoStruct;
 
+#ifdef USE_DVDREAD
+typedef struct
+{
+ int titles;
+ int chapters;
+ int angles;
+ int current_chapter;
+ int current_title;
+ int nr_of_audio_channels;
+ audio_stream_t audio_streams[8];
+ int nr_of_subtitles;
+ subtitle_t subtitles[32]; 
+} mplDVDStruct;
+#endif
+
 typedef struct
 {
  int message;
    mplResizeStruct      resize;
    mplVideoStruct       videodata;
    mplUnknowErrorStruct error;
+#ifdef USE_DVDREAD
+   mplDVDStruct         DVD;
+#endif
 
    int    Playing;
    float  Position;
--- a/Gui/mplayer/psignal.c	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/psignal.c	Wed Nov 21 17:43:57 2001 +0000
@@ -127,7 +127,7 @@
 	gtk_main_quit();
         break;
    case evShowPopUpMenu:
-        gtkShMem->popupmenu=evNone;
+        gtkShMem->popupmenu=evNone; gtkShMem->popupmenuparam=0;
 	if ( gtkShMem->visiblepopupmenu ) gtk_widget_hide_on_delete( PopUpMenu );
         PopUpMenu=create_PopUpMenu();
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
@@ -190,7 +190,7 @@
         if ( mplMainAutoPlay ) mplGeneralTimer=1;
         break;
    case evShowPopUpMenu:
-        fprintf( stderr,"[psignal] PopUpMenu: %d\n",gtkShMem->popupmenu );
+        fprintf( stderr,"[psignal] PopUpMenu: %d param: %d\n",gtkShMem->popupmenu,gtkShMem->popupmenuparam );
 	mplMiddleMenu=1; mplGeneralTimer=1; 
 	break;
    case evMessageBox:
--- a/Gui/mplayer/sw.h	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/sw.h	Wed Nov 21 17:43:57 2001 +0000
@@ -37,6 +37,7 @@
  switch( Button )
   {
    case wsPMMouseButton:
+	  memcpy( &gtkShMem->DVD,&mplShMem->DVD,sizeof( mplDVDStruct ) );
           gtkSendMessage( evShowPopUpMenu );
           break;
    case wsPRMouseButton:
--- a/Gui/mplayer/widgets.h	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/mplayer/widgets.h	Wed Nov 21 17:43:57 2001 +0000
@@ -5,7 +5,9 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
+#include "../../config.h"
 #include "../../linux/shmem.h"
+#include "play.h"
 
 #define GTK_MB_SIMPLE 0
 #define GTK_MB_MODAL 1
@@ -52,8 +54,13 @@
  gtkSkinStruct         sb;
  gtkVisibleStruct      vs;
  gtkOptionsStruct      op;
+
+#ifdef USE_DVDREAD 
+ mplDVDStruct          DVD;
+#endif
  
  int		       popupmenu;
+ int		       popupmenuparam;
  int		       visiblepopupmenu;
 } gtkCommStruct;
 
--- a/Gui/wm/ws.c	Wed Nov 21 17:07:40 2001 +0000
+++ b/Gui/wm/ws.c	Wed Nov 21 17:43:57 2001 +0000
@@ -36,11 +36,11 @@
 
 typedef struct
 {
- long flags;
- long functions;
- long decorations;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
  long input_mode;
- long status;
+ unsigned long status;
 } MotifWmHints;
 
 Atom                 wsMotifHints;
@@ -107,16 +107,57 @@
 
 void wsWindowDecoration( wsTWindow * win,long d )
 {
+ MotifWmHints *hints = &wsMotifWmHints;
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long bytes_after;
+
  wsMotifHints=XInternAtom( wsDisplay,"_MOTIF_WM_HINTS",0 );
- if ( wsMotifHints != None )
-  {
-   memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
-   wsMotifWmHints.flags=( d?0:MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS );
-   wsMotifWmHints.functions=( d?0:MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
-   wsMotifWmHints.decorations=( d?MWM_DECOR_ALL:0 );
-   XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
-                    PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
-  }
+ if ( wsMotifHints == None ) return;
+
+#if 1
+ memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
+ wsMotifWmHints.flags=( d?0:MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS );
+ wsMotifWmHints.functions=( d?0:MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+ wsMotifWmHints.decorations=( d?MWM_DECOR_ALL:0 );
+ XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
+                  PropModeReplace,(unsigned char *)&wsMotifWmHints,5 );
+#else
+  XGetWindowProperty( wsDisplay,win->WindowID,
+                      wsMotifHints,0,5,
+                      False,AnyPropertyType,&type,&format,&nitems,
+                      &bytes_after,(unsigned char **)&hints );
+
+  if ( type != None )
+   {
+    fprintf( stderr,"[ws] set valid mwm hints.\n" );
+    hints->flags=MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
+    if ( d )
+     {
+      hints->functions|=( MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+      hints->decorations|=MWM_DECOR_ALL;
+     }
+     else
+      {
+      hints->functions|=~( MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE );
+      hints->decorations|=~MWM_DECOR_ALL;
+      }
+   }
+   else
+    {
+     fprintf( stderr,"[ws] set my mwm hints.\n" );
+     memset( &wsMotifWmHints,0,sizeof( MotifWmHints ) );
+     hints=&wsMotifWmHints;
+     hints->flags=( d?MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS:0 );
+     hints->functions=( d?MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE:0 );
+     hints->decorations=( d?MWM_DECOR_ALL:0 );
+    }
+
+ XChangeProperty( wsDisplay,win->WindowID,wsMotifHints,wsMotifHints,32,
+                  PropModeReplace,&wsMotifWmHints,5 );
+ if ( hints != &wsMotifWmHints ) XFree( hints );
+#endif
 }
 
 // ----------------------------------------------------------------------------------------------
--- a/mplayer.c	Wed Nov 21 17:07:40 2001 +0000
+++ b/mplayer.c	Wed Nov 21 17:43:57 2001 +0000
@@ -850,6 +850,25 @@
 sh_audio=d_audio->sh;
 sh_video=d_video->sh;
 
+#ifdef HAVE_NEW_GUI
+#ifdef USE_DVDREAD
+if ( use_gui && stream->type == STREAMTYPE_DVD )
+ {
+  dvd_priv_t * dvdp = stream->priv;
+  mplShMem->DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts;
+  mplShMem->DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
+  mplShMem->DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
+  mplShMem->DVD.nr_of_audio_channels=dvdp->nr_of_channels;
+  memcpy( mplShMem->DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) );
+  mplShMem->DVD.nr_of_subtitles=dvdp->nr_of_subtitles;
+  memcpy( mplShMem->DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) );
+  mplShMem->DVD.current_title=dvd_title + 1;
+  mplShMem->DVD.current_chapter=dvd_chapter + 1;
+  mplShMem->Track=dvd_title + 1;
+ } 
+#endif
+#endif
+
 current_module="video_read_properties";
 
 if(sh_video){
@@ -1970,6 +1989,13 @@
 #endif
 	 } 
 	mplShMem->Volume=(float)mixer_getbothvolume();
+#ifdef USE_DVDREAD
+        if ( stream->type == STREAMTYPE_DVD )
+	 {
+	  dvd_priv_t * dvdp = stream->priv;
+	  mplShMem->DVD.current_chapter=dvdp->cur_cell + 1;
+	 }
+#endif
       }
 #endif