Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2004 12:15:24 +0300 (MSK)
From:      Seva Gluschenko <gvs@rinet.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61115: MPlayer-1.0pre3 can be compiled with GTK2
Message-ID:  <200401090915.i099FO0r010820@road.yandex.ru>
Resent-Message-ID: <200401090920.i099KIKw045900@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         61115
>Category:       ports
>Synopsis:       MPlayer-1.0pre3 can be compiled with GTK2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 09 01:20:18 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Seva Gluschenko
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Yandex LLC
>Environment:
System: FreeBSD road.yandex.ru 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Mon Dec 22 19:53:00 MSK 2003 root@:/local/obj/local/usr/src/sys/ROAD i386


	
>Description:
	The most recent version of MPlayer, 1.0pre3 can be compiled with GTK2
	using the patch supplied. A bunch of updates needed for FreeBSD port to
	have it successfully installed. They are provided below. Not all of them
	are clean and nice, some pieces of code can be considered a dirty hack,
	but voila! - I have it installed and working with a nice GTK2 GUI.

	Here is the short summary of patch changes:

	Updated:	patch-ad patch-ae patch-libdha::Makefile
	Obsoleted:	patch-cfg-common.h patch-demux-tv.c patch-demux-tv.h \
			patch-demux_rawdv.c patch-loader-ldt_keeper.c

	Also patch-loader-win32.c needs to be rewritten completely. Updated
	patches follow inline.

>How-To-Repeat:
	1. cd to /usr/ports/multimedia/mplayer.
	2. Extract patch-ad, patch-ae and patch-libdha::Makefile from this
	   message and replace original ones.
	3. Remove obsoleted patches and patch-loader-win32.c.
	4. Extract GTK2 patch from this message and place it to
	   files/patch-gtk2.
	5. Extract patch to the port Makefile from this message and apply it.
	6. Replace distinfo with the supplied below.
	7. make install (optionally make deinstall first if you have the
	   previous version installed).

	I used the following making string:

	make -DWITHOUT_WIN32_CODECS -DWITHOUT_RUNTIME_CPUDETECTION -DWITH_GUI reinstall
>Fix:

	Distinfo is:

MD5 (MPlayer-1.0pre3.tar.bz2) = 998becb79417c6a14d15c07e85188b82

	Updated patches are:

Index: files/patch-ad:
--- configure.orig	Sat Aug  9 16:12:30 2003
+++ configure	Tue Dec 23 18:52:29 2003
@@ -300,7 +300,7 @@
 
 
 # 1st pass checking for vital options
-_install=install
+_install=@${BSD_INSTALL_PROGRAM}
 _ranlib=ranlib
 _cc=gcc
 test "$CC" && _cc="$CC"
@@ -392,6 +392,7 @@
       i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;;
       ia64) host_arch=ia64 ;;
       x86_64) host_arch=x86_64 ;;
+      amd64) host_arch=x86_64 ;;
       ppc) host_arch=ppc ;;
       alpha) host_arch=alpha ;;
       sparc*) host_arch=sparc ;;
@@ -1423,8 +1415,8 @@
     ;;
 
   *)
-    echo "Unknown parameter: $ac_option"
-    exit 1
+    echo -n "Unknown parameter: $ac_option"
+    echo " (ignoring)"
     ;;
 
   esac
@@ -1434,7 +1426,7 @@
 test -z "$_bindir" && _bindir="$_prefix/bin"
 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
 test -z "$_mandir" && _mandir="$_prefix/man"
-test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
+test -z "$_confdir" && _confdir="$_prefix/share/mplayer"
 test -z "$_libdir" && _libdir="$_prefix/lib"
 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
 
@@ -1866,13 +1858,7 @@
 
 
 echocheck "memalign()"
-# XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
-cat > $TMPC << EOF
-#include <malloc.h>
-int main (void) { (void) memalign(64, sizeof(char)); return 0; }
-EOF
 _memalign=no
-cc_check && _memalign=yes
 if test "$_memalign" = yes ; then
  _def_memalign='#define HAVE_MEMALIGN 1'
 else
@@ -2282,38 +2277,8 @@
 
 
 echocheck "pthread"
-cat > $TMPC << EOF
-#include <pthread.h>
-void* func(void *arg) { return arg; }
-int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
-EOF
-if mingw32 ; then
-  _ld_pthread=''
-elif ( cc_check && $TMPO ) ; then              # QNX
-  _ld_pthread=''
-elif ( cc_check -lpthread && $TMPO ) ; then
-  _ld_pthread='-lpthread'
-elif ( cc_check -pthread && $TMPO ) ; then
-  _ld_pthread='-pthread'
-else
-  if test "$_ld_static" ; then
-    # for crosscompilation, we cannot execute the program, be happy if we can link statically
-    if ( cc_check -lpthread ) ; then
-      _ld_pthread='-lpthread'
-    elif ( cc_check -pthread ) ; then
-     _ld_pthread='-pthread'
-    else
-      echores "no static pthread found (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, Win32 loader disabled)"
-      _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _tv_v4l=no ; _macosx=no ; _win32=no
-    fi
-  else
-    echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
-    _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _tv_v4l=no ; _macosx=no ; _win32=no
-  fi
-fi
-if test "$_ld_pthread" != '' ; then
-  echores "yes (using $_ld_pthread)"
-fi
+_ld_pthread="${PTHREAD_LIBS}"
+echores "yes (using $_ld_pthread)"
 
 echocheck "sys/soundcard.h"
 cat > $TMPC << EOF
@@ -4848,7 +4810,7 @@
   CFLAGS="$CFLAGS -D_REENTRANT"
 elif bsd ; then
   # FIXME bsd needs this so maybe other OS'es
-  CFLAGS="$CFLAGS -D_THREAD_SAFE"
+  CFLAGS="$CFLAGS ${PTHREAD_CFLAGS}"
 fi
 # 64 bit file offsets?
 if test "$_largefiles" = yes || freebsd ; then

Index: files/patch-ae
--- Makefile.orig	Tue Dec  9 00:33:31 2003
+++ Makefile	Fri Jan  9 11:06:46 2004
@@ -252,22 +252,10 @@
 ifeq ($(VIDIX),yes)
 	$(DO_MAKE)
 endif
-	if test ! -d $(BINDIR) ; then mkdir -p $(BINDIR) ; fi
-	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG) $(BINDIR)/$(PRG)
-ifeq ($(GUI),yes)
-	-ln -sf $(PRG) $(BINDIR)/gmplayer
-endif
-	if test ! -d $(MANDIR)/man1 ; then mkdir -p $(MANDIR)/man1; fi
-	for i in $(LANGUAGES); do \
-		if test "$$i" = en ; then \
-			$(INSTALL) -c -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/mplayer.1 ; \
-		else \
-			mkdir -p $(MANDIR)/$$i/man1 ; \
-			$(INSTALL) -c -m 644 DOCS/man/$$i/mplayer.1 $(MANDIR)/$$i/man1/mplayer.1 ; \
-		fi ; \
-	done
+	@${BSD_INSTALL_PROGRAM} $(PRG) $(BINDIR)/$(PRG)
+	@${BSD_INSTALL_MAN} DOCS/man/en/mplayer.1 $(MANDIR)/man1/mplayer.1
 ifeq ($(MENCODER),yes)
-	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
+	@${BSD_INSTALL_PROGRAM} $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
 	for i in $(LANGUAGES); do \
 		if test "$$i" = en ; then \
 			ln -sf mplayer.1 $(MANDIR)/man1/mencoder.1 ; \
@@ -275,30 +263,6 @@
 			ln -sf mplayer.1 $(MANDIR)/$$i/man1/mencoder.1 ; \
 		fi ; \
 	done
-endif
-	@if test ! -d $(DATADIR) ; then mkdir -p $(DATADIR) ; fi
-	@if test ! -d $(DATADIR)/font ; then mkdir -p $(DATADIR)/font ; fi
-	@if test ! -f $(DATADIR)/font/font.desc ; then \
-	echo "*** Download font at http://www.mplayerhq.hu/homepage/dload.html" ; \
-	echo "*** for OSD/Subtitles support and extract to $(DATADIR)/font/" ; \
-	fi
-ifeq ($(GUI),yes)
-	@if test ! -d $(DATADIR)/Skin ; then mkdir -p $(DATADIR)/Skin ; fi
-	@echo "*** Download skin(s) at http://www.mplayerhq.hu/homepage/dload.html"
-	@echo "*** for GUI, and extract to $(DATADIR)/Skin/"
-endif
-	@if test ! -d $(CONFDIR) ; then mkdir -p $(CONFDIR) ; fi
-	@if test -f $(CONFDIR)/codecs.conf ; then mv -f $(CONFDIR)/codecs.conf $(CONFDIR)/codecs.conf.old ; fi
-ifeq ($(DVDKIT_SHARED),yes)
-ifeq ($(DVDKIT2),yes)
-	if test ! -d $(LIBDIR) ; then mkdir -p $(LIBDIR) ; fi
-	$(INSTALL) -m 755 $(INSTALLSTRIP) libmpdvdkit2/libmpdvdkit.so $(LIBDIR)/libmpdvdkit.so
-else
-ifeq ($(DVDKIT),yes)
-	if test ! -d $(LIBDIR) ; then mkdir -p $(LIBDIR) ; fi
-	$(INSTALL) -m 755 $(INSTALLSTRIP) libmpdvdkit/libmpdvdkit.so $(LIBDIR)/libmpdvdkit.so
-endif
-endif
 endif
 
 uninstall:

Index: files/patch-libdha::Makefile
--- libdha/Makefile.orig	Thu Oct 23 00:17:23 2003
+++ libdha/Makefile	Thu Jan  8 19:34:39 2004
@@ -4,8 +4,6 @@
 
 MAJOR_VERSION = 0
 MINOR_VERSION = 1
-VERSION = $(MAJOR_VERSION).$(MINOR_VERSION) 
-
 
 ifeq ($(TARGET_OS),CYGWIN)
 SHORTNAME = libdha.dll
@@ -19,7 +17,7 @@
 LIBNAME = libdha.a
 SHORTNAME = libdha.a
 else
-LIBNAME = libdha.so.$(VERSION)
+LIBNAME = libdha-$(MAJOR_VERSION).so.$(MINOR_VERSION)
 endif
 
 SRCS=libdha.c mtrr.c pci.c pci_names.c

Index: files/patch-gtk2
--- Gui/Makefile.orig	Fri Apr  4 19:39:51 2003
+++ Gui/Makefile	Thu Jan  8 18:54:25 2004
@@ -9,12 +9,21 @@
 OPTIMIZE =  $(OPTFLAGS) \
             -fexpensive-optimizations -fschedule-insns2 -Wall
 
-CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG) 
+CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG) -DGDK_DISABLE_DEPRECATED \
+	-DGTK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED 
 
 SRCS = wm/ws.c wm/wsxdnd.c app.c interface.c cfg.c bitmap.c \
 	skin/skin.c skin/font.c skin/cut.c \
-	mplayer/widgets.c mplayer/play.c mplayer/mw.c mplayer/sw.c mplayer/menu.c mplayer/pb.c mplayer/common.c \
-	mplayer/gtk/menu.c mplayer/gtk/mb.c mplayer/gtk/about.c mplayer/gtk/pl.c mplayer/gtk/sb.c mplayer/gtk/fs.c mplayer/gtk/opts.c mplayer/gtk/url.c mplayer/gtk/eq.c mplayer/gtk/common.c
+	mplayer/widgets.c mplayer/play.c mplayer/mw.c mplayer/sw.c \
+	mplayer/menu.c mplayer/pb.c mplayer/common.c \
+	mplayer/gtk/menu.c mplayer/gtk/mb.c mplayer/gtk/about.c \
+	mplayer/gtk/pl.c mplayer/gtk/sb.c mplayer/gtk/fs.c \
+	mplayer/gtk/opts.c mplayer/gtk/url.c mplayer/gtk/eq.c \
+	mplayer/gtk/common.c mplayer/gtk/enfilesel.c \
+	mplayer/gtk/filefilt.c mplayer/gtk/playlist.c \
+	mplayer/gtk/playlist_create.c \
+	mplayer/gtk/mp_pl.c
+
 OBJS = $(SRCS:.c=.o)
 
 .SUFFIXES: .c .o
--- Gui/interface.c.orig	Sat Nov  8 03:26:44 2003
+++ Gui/interface.c	Thu Jan  8 18:54:25 2004
@@ -177,10 +178,12 @@
  if ( stream_cache_size != -1 ) { gtkCacheOn=1; gtkCacheSize=stream_cache_size; }
  if ( autosync && autosync != gtkAutoSync ) { gtkAutoSyncOn=1; gtkAutoSync=autosync; }
    
- gtkInit();
 // --- initialize X 
  wsXInit( (void *)mDisplay );
 // --- load skin
+
+ gtkInit();	//TODO: pass in arc + argv.
+
  skinDirInHome=get_path("Skin");
  skinMPlayerDir=MPLAYER_DATADIR "/Skin";
  printf("SKIN dir 1: '%s'\n",skinDirInHome);
@@ -597,7 +600,7 @@
 	 }
 	break;
    case guiIEvent:
-        printf( "cmd: %d\n",(int)arg );
+//CJE3        printf( "cmd: %d\n",(int)arg );
 	switch( (int)arg )
 	 {
           case MP_CMD_QUIT:
--- Gui/mplayer/gtk/about.c.orig	Mon Mar 17 03:48:26 2003
+++ Gui/mplayer/gtk/about.c	Thu Jan  8 18:54:25 2004
@@ -8,6 +8,8 @@
 #include "about.h"
 #include "common.h"
 
+#include <gtk/gtktext.h>
+
 GtkWidget * About = NULL;
 
 void ShowAboutBox( void )
@@ -23,14 +25,11 @@
 GtkWidget * create_About( void )
 {
   GtkWidget     * vbox;
-  GtkWidget     * pixmap1;
   GtkWidget     * scrolledwindow1;
   GtkWidget     * AboutText;
   GtkWidget     * Ok;
-
-  GtkStyle      * pixmapstyle;
-  GdkPixmap     * pixmapwid;
-  GdkBitmap     * mask;
+  GdkPixbuf     * pixmaster;
+	GtkWidget		 * about_pic;
 
   GtkAccelGroup * accel_group;
 
@@ -38,11 +37,10 @@
 
   About=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( About,MSGTR_About );
-  gtk_object_set_data( GTK_OBJECT( About ),MSGTR_About,About );
-  gtk_widget_set_usize( About,340,415 );
+  g_object_set_data( G_OBJECT( About ),MSGTR_About,About );
+  gtk_widget_set_size_request( About,340,415 );
   gtk_window_set_title( GTK_WINDOW( About ),MSGTR_About );
   gtk_window_set_position( GTK_WINDOW( About ),GTK_WIN_POS_CENTER );
-  gtk_window_set_policy( GTK_WINDOW( About ),TRUE,FALSE,FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( About ),"About","MPlayer" );
 
   gtk_widget_realize( About );
@@ -50,14 +48,14 @@
   
   vbox=AddVBox( AddDialogFrame( About ),0 );
 
-  pixmapstyle=gtk_widget_get_style( About );
-  pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( About->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],about_xpm );
-  pixmap1=gtk_pixmap_new( pixmapwid,mask );
-
-  gtk_widget_set_name( pixmap1,"pixmap1" );
-  gtk_widget_show( pixmap1 );
-  gtk_box_pack_start( GTK_BOX( vbox ),pixmap1,FALSE,FALSE,0 );
-  gtk_widget_set_usize( pixmap1,-2,174 );
+	pixmaster = gdk_pixbuf_new_from_xpm_data( about_xpm );
+	about_pic = gtk_image_new_from_pixbuf( pixmaster );
+	g_object_unref( G_OBJECT( pixmaster ) );
+	
+  gtk_widget_set_name(about_pic,"pixmap1" );
+  gtk_widget_show( about_pic );
+  gtk_box_pack_start( GTK_BOX( vbox ),about_pic,FALSE,FALSE,0 );
+  gtk_widget_set_size_request( about_pic,-1,174 );
 
   AddHSeparator( vbox );
 
@@ -67,11 +65,11 @@
   gtk_box_pack_start( GTK_BOX( vbox ),scrolledwindow1,TRUE,TRUE,0 );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
 
-  AboutText=gtk_text_new( NULL,NULL );
-  gtk_widget_set_name( AboutText,"AboutText" );
+	AboutText=gtk_text_view_new( );
   gtk_widget_show( AboutText );
   gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
-  gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
+	gtk_text_buffer_insert_at_cursor( gtk_text_view_get_buffer( GTK_TEXT_VIEW( AboutText ) ), 
+
   	"\n" 
 	MSGTR_ABOUT_UHU 
 	"             (http://www.uhulinux.hu/)\n" 
@@ -178,8 +176,8 @@
   AddHSeparator( vbox );
   Ok=AddButton( MSGTR_Ok,AddHButtonBox( vbox ) );
 
-  gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&About );
-  gtk_signal_connect_object( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( abWidgetDestroy ),NULL );
+  g_signal_connect( G_OBJECT( About ),"destroy",G_CALLBACK( WidgetDestroy ),&About );
+  g_signal_connect_swapped( G_OBJECT( Ok ),"clicked",G_CALLBACK( abWidgetDestroy ),NULL );
 
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
--- Gui/mplayer/gtk/common.c.orig	Tue Jan 21 16:33:39 2003
+++ Gui/mplayer/gtk/common.c	Thu Jan  8 18:54:25 2004
@@ -16,17 +16,12 @@
 {
  GtkWidget * frame;
  frame=AddFrame( NULL,GTK_SHADOW_IN,parent,1 );
- gtk_container_set_border_width( GTK_CONTAINER( frame ),1 );
- frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 );
- frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,frame,1 );
- frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 );
  return frame;
 }
 
 GtkWidget * AddFrame( char * title,int type,GtkWidget * parent,int add )
 {
- GtkWidget * frame = NULL;
- frame=gtk_frame_new( title );
+ GtkWidget * frame = gtk_frame_new( title );;
  gtk_widget_set_name( frame,"frame" );
  gtk_widget_show( frame );
  gtk_frame_set_shadow_type( GTK_FRAME( frame ),type );
@@ -90,7 +85,7 @@
 {
  GtkWidget * RB;
  RB=gtk_radio_button_new_with_label( *group,title );
- *group=gtk_radio_button_group( GTK_RADIO_BUTTON( RB ) );
+ *group= gtk_radio_button_get_group( GTK_RADIO_BUTTON( RB ) );
  gtk_widget_set_name( RB,"RB" );
  gtk_widget_show( RB );
  gtk_box_pack_start( GTK_BOX( parent ),RB,FALSE,FALSE,0 );
@@ -114,7 +109,7 @@
  gtk_widget_set_name( hseparator,"hseparator1" );
  gtk_widget_show( hseparator );
  gtk_box_pack_start( GTK_BOX( parent ),hseparator,FALSE,FALSE,0 );
- gtk_widget_set_usize( hseparator,-2,6 );
+ gtk_widget_set_size_request( hseparator,-1,6 );
  return hseparator;
 }
 
@@ -123,9 +118,17 @@
  GtkWidget * hbuttonbox;
  hbuttonbox=gtk_hbutton_box_new();
  gtk_widget_set_name( hbuttonbox,"hbuttonbox" );
+
+		//NOTE: the documention conflicts on whether 
+		//or not it is ok to write to these.
+		//So if it crashes, remove them.
+  GTK_BUTTON_BOX( hbuttonbox )->child_min_width = 85;
+  GTK_BUTTON_BOX( hbuttonbox )->child_min_height = 20;
+//Was: gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox ),85,20 );
+
  gtk_widget_show( hbuttonbox );
  gtk_box_pack_start( GTK_BOX( parent ),hbuttonbox,FALSE,FALSE,0 );
- gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox ),85,20 );
+
  return hbuttonbox;
 }
 
--- Gui/mplayer/gtk/enfilesel.c.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/enfilesel.c	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,585 @@
+/* enfilesel.c
+ *
+ * July 21, 2003
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */ 
+
+/*
+	* This class adds a file type drop down
+	* with support for multiple file masks.
+	*/
+
+/* TODO:
+ * -Use utf8 file funcs
+ * -when passed a file name, change to any directories 
+	*		one at a time.
+	* -Implement tab completion: g_completion*
+	* -Replace glob() with g_pattern* + g_dir*
+	* -If there is a path in the selection entry, change to it.
+	* -Add ability to change the filter.
+	* -_() all static strings, etc.
+	* -Possibly fix the file operations. Or a context menu.
+	*/
+
+#include "enfilesel.h"
+
+#include <glob.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+
+static void remove_pesky_signals( GtkFileSelection* selector );
+static GtkWidget* create_filter_menu( FileFilter* f );
+
+static void file_selector_show_once( GtkFileSelection* selector, 
+	gpointer user_data );
+
+static void filter_changed( GtkOptionMenu* m, gpointer user_data );
+
+static void selection_dir_activate( GtkTreeView* tree_view,
+	GtkTreePath* path, GtkTreeViewColumn* column,
+		gpointer user_data );
+
+//static void update_in_case_of_error( GtkFileSelection *selector, gpointer user_data );
+
+/*Parameter types for CheckDir.
+typedef enum completion_option_ completion_option;
+enum completion_option_ { no_completion, do_completion };
+
+typedef enum selection_option_ selection_option;
+enum selection_option{ leave_selection, clear_selection };
+*/
+
+	//TODO: rename.
+static void CheckDir( GtkFileSelection* selector, const gchar * directory/*const gchar* to_complete, completion_option complete, selection_option selection*/ );
+
+extern GtkWidget* enhanced_file_selection_new( const gchar* title, FileFilter* f, guint active_filter )
+{
+	GtkFileSelection* selector = GTK_FILE_SELECTION( gtk_file_selection_new( title ) ); 
+
+	remove_pesky_signals( selector );
+	
+	GtkWidget* filters = gtk_option_menu_new( );
+
+	GList* children = gtk_container_get_children( GTK_CONTAINER( selector->main_vbox ) );
+			//WARNING: This has a 99% chance of breaking for the next version of gtk.
+			//									But they are supposedly implementing a really good
+			//									fileselector for that version --so we'll be able to dump this.
+			//TODO: Test this on every version of GTK+ 2.
+	GtkWidget* vbox =  GTK_WIDGET( g_list_nth_data( children, 6 ) );
+	g_list_free( children );
+			//:GNINRAW
+		
+	gtk_file_selection_hide_fileop_buttons( selector );
+
+  gtk_box_pack_start( GTK_BOX( vbox  ), filters, FALSE, FALSE, 0 );
+  gtk_widget_show( filters );
+
+	g_object_set_data_full( G_OBJECT( selector ), "file-filter", f, (GDestroyNotify)file_filter_free );
+	
+	gtk_option_menu_set_menu( GTK_OPTION_MENU( filters ), 
+		create_filter_menu( f ) );
+	g_object_set_data( G_OBJECT( selector ), "filter-menu", filters );
+
+	g_signal_connect( G_OBJECT( selector ), "show", 
+		G_CALLBACK( file_selector_show_once ), (gpointer)selector );
+
+	g_signal_connect( G_OBJECT( filters ), "changed", 
+		G_CALLBACK( filter_changed ), (gpointer)selector );
+
+  g_signal_connect( selector->dir_list, "row_activated",
+		G_CALLBACK( selection_dir_activate ), selector );
+
+	g_signal_connect_swapped( selector->cancel_button, "clicked",
+		G_CALLBACK( gtk_widget_destroy ), selector );
+/*
+		//TODO: going to have to implement the file ops as well...
+	g_signal_connect_swapped( selector->fileop_c_dir, "clicked",
+		G_CALLBACK( update_in_case_of_error ), selector );
+
+	g_signal_connect_swapped( selector->fileop_del_file, "clicked",
+		G_CALLBACK( update_in_case_of_error ), selector );
+
+	g_signal_connect_swapped( selector->fileop_ren_file, "clicked",
+		G_CALLBACK( update_in_case_of_error ), selector );
+*/
+	gtk_option_menu_set_history( GTK_OPTION_MENU( filters ), active_filter );
+	
+	return GTK_WIDGET( selector );
+}
+
+extern G_CONST_RETURN gchar* enhanced_file_selection_get_filename( EnhancedFileSelection* selector )
+{
+		//TODO: make this a GString and carry it around with the selector.
+	static gchar buf[4096];
+	const gchar* filename;
+	gchar* dir = g_get_current_dir( );
+	
+	strcpy( buf, dir ); 
+	g_free( dir ); 
+	
+		//TODO: can really optimize this.
+	filename = gtk_entry_get_text( GTK_ENTRY( selector->selection_entry ) );
+	if( *filename )
+	{
+		int buf_len = strlen( buf );
+		if( buf[buf_len - 1] != G_DIR_SEPARATOR ) 
+		{
+			buf[buf_len] = G_DIR_SEPARATOR;
+			buf[++buf_len] = '\0';
+//			strcat( buf, G_DIR_SEPARATOR_S );
+		}
+
+		strcat( buf, filename );
+	}
+	
+	return buf;	
+}
+
+extern void enhanced_file_selection_set_filename( EnhancedFileSelection* selector,
+	const gchar *filename )
+{
+	 struct stat file_info;
+	
+	stat( filename, &file_info );
+	if( S_ISDIR( file_info.st_mode ) )
+	{
+		CheckDir( selector, filename/*, NULL, no_completion, clear_selection*/ );
+	}
+	else
+	{
+		char* file = strrchr( filename, G_DIR_SEPARATOR );
+		if( file )
+		{
+			gchar* dir = g_strndup( filename, file - filename );
+			CheckDir( selector, dir/*, NULL, no_completion, leave_selection*/ );
+			g_free( dir );
+		
+			//TODO: if the file exits, select it in the file list?
+		gtk_entry_set_text( GTK_ENTRY( selector->selection_entry ), ++file );
+		}
+		else
+		{
+			gtk_entry_set_text( GTK_ENTRY( selector->selection_entry ), filename );
+		}
+	}	
+}
+
+//-----
+
+	//TODO: rename.
+typedef struct file_info_ file_info;
+struct file_info_ 
+{
+	gchar* path;
+	gint path_len;
+	gchar** list;
+	gint current;
+};
+
+void store_filenames( GtkTreeModel *model, 
+	GtkTreePath *path, GtkTreeIter *iter, gpointer data )
+{
+	gchar* filename;
+	gchar* temp;
+	file_info* info = (file_info*)data;
+
+	++info->current;
+	
+	gtk_tree_model_get( model, iter, 0, &filename, -1 );
+
+//	g_print ( "adding filename: %s\n", filename );	
+	
+	temp = g_strndup( info->path, info->path_len + strlen( filename ) + 1 );
+	
+//	g_print ( "temp: %s\n", temp );	
+
+	info->list[info->current] = strcat( temp, filename );
+
+//	g_print ( "result: %s\n\n", info->list[info->current] );	
+	
+	//TODO: Find out once and for all if this needs to be freed.
+//	g_free( filename );
+}
+//-----
+
+gchar** enhanced_file_selection_get_selections( EnhancedFileSelection* selector )
+{
+	file_info info;
+	gchar* temp;
+	gint path_len; 
+	GtkTreeView* files = GTK_TREE_VIEW( selector->file_list );
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( files );
+	gint num_files = gtk_tree_selection_count_selected_rows( selection );
+
+		//TODO: put the dir code in its own function.
+	temp = g_get_current_dir( );
+	path_len = strlen( temp );
+
+	if( temp[path_len - 1] != G_DIR_SEPARATOR ) 
+		{
+			info.path = g_strndup( temp, ++path_len );
+			g_free( temp );
+			info.path[path_len - 1] = G_DIR_SEPARATOR;
+			info.path[path_len] = '\0';
+		}
+	else
+	{
+		info.path = temp;
+	}
+
+	info.path_len = path_len;
+	info.list = g_new( gchar*, num_files + 1 );
+	info.current = -1;
+	
+	gtk_tree_selection_selected_foreach( selection, store_filenames, &info );
+	g_free( info.path );
+		
+	info.list[num_files] = 0;
+	return info.list;
+}
+
+void enhanced_file_selection_set_select_multiple( 
+	EnhancedFileSelection* selector, gboolean select_multiple )
+{
+	gtk_file_selection_set_select_multiple( GTK_FILE_SELECTION( selector ), TRUE );
+}
+
+//-----
+
+	//TODO: This is handy, move it to a common file.
+void disconnect_signal( gpointer instance, gchar* signal_name )
+{
+	int id =  g_signal_lookup( signal_name,  G_TYPE_FROM_INSTANCE( instance ) );
+	id = g_signal_handler_find( instance, G_SIGNAL_MATCH_ID, id, 0, NULL, NULL, NULL );
+	g_signal_handler_disconnect ( instance, id );
+}
+
+	//Get rid of all signals that can change the 
+	//contents of the directory and file lists.
+	//This is, of course, a complete hack.
+void remove_pesky_signals( GtkFileSelection* selector )
+{
+	disconnect_signal( selector->selection_entry, "key_press_event" );
+	disconnect_signal( selector->dir_list, "row_activated" );
+}
+
+static GtkWidget* create_filter_menu( FileFilter* f )
+{
+	GtkWidget* mask;
+	GtkWidget* types = gtk_menu_new( );
+	GList* fl = (GList*)f;
+
+	while( fl )
+	{
+		mask = gtk_menu_item_new_with_label( FILE_FILTER_ENTRY( fl->data )->description->str );
+		gtk_widget_show( mask );
+		gtk_menu_shell_append( GTK_MENU_SHELL( types ), mask );
+		fl = g_list_next( fl );
+	}
+
+	gtk_widget_show( types );
+	return types;
+}
+
+static void file_selector_show_once( GtkFileSelection* selector, 
+	gpointer user_data )
+{
+		//This has the important side effect of 
+		//removing the old history menu as well
+		//as refreshing the dir + file lists so
+		//the user will not notice any inconsitency.
+	CheckDir( selector, ""/*, NULL, no_completion, leave_selection*/ );
+
+		//This sets the entry label to always say
+		//"Selection:" (or the locale equivalent).
+	const gchar* label = gtk_label_get_label( GTK_LABEL( selector->selection_text ) );
+	const gchar* sel = strchr( label, ':' );
+	if( sel )
+	{
+		gchar* new_text = g_strndup( label, sel - label + 1 ); 
+		gtk_label_set_text_with_mnemonic( GTK_LABEL( selector->selection_text ), new_text );
+		g_free( new_text );
+	}
+	
+		//We never need to be called again.
+	disconnect_signal( selector, "show" );
+}
+
+FileFilter* get_file_filter( GtkFileSelection* selector )
+{
+	return FILE_FILTER( g_object_get_data( G_OBJECT( selector ), "file-filter" ) );
+}
+
+GtkOptionMenu* get_filter_menu( GtkFileSelection* selector )
+{
+	return GTK_OPTION_MENU( g_object_get_data( G_OBJECT( selector ), "filter-menu" ) );
+}
+
+	//Retrieves the filter entry that is currently being used.
+FileFilterEntry* get_file_filter_entry( GtkFileSelection* selector )
+{
+	GList* f = (GList*)get_file_filter( selector );
+	gint item = gtk_option_menu_get_history( get_filter_menu( selector ) );
+	return  FILE_FILTER_ENTRY( g_list_nth_data( f, item ) );
+}
+
+void filter_changed( GtkOptionMenu* m, gpointer user_data )
+{
+	g_return_if_fail( GTK_IS_FILE_SELECTION( user_data )  );
+
+		//Prob. don't need this, but I'd rather be safe.
+	if( gtk_option_menu_get_history( m ) >= 0 )
+	{
+			//TODO:
+//		gtk_editable_delete_text( GTK_EDITABLE( selector->selection_entry ), 0, -1 );
+		GtkFileSelection* selector = GTK_FILE_SELECTION( user_data );
+		CheckDir( selector, ""/*, NULL, no_completion, leave_selection*/ );
+	}
+}
+
+	//Shamelessly stolen from GTK+.
+static void
+selection_dir_activate (GtkTreeView       *tree_view,
+				 GtkTreePath       *path,
+				 GtkTreeViewColumn *column,
+				 gpointer           user_data)
+{
+		//TODO: use a function for this.
+  GtkFileSelection *fs = GTK_FILE_SELECTION (user_data);
+  GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
+  GtkTreeIter iter;
+  gchar *dir;
+
+  gtk_tree_model_get_iter (model, &iter, path);
+  gtk_tree_model_get (model, &iter, 0, &dir, -1); //TODO: use enum for column.
+
+	chdir( dir ); //TODO: fix this! 
+	CheckDir( fs, ""/*dir*//*, NULL, no_completion, leave_selection*/ );
+	
+  g_free (dir);
+}
+/*
+void update_in_case_of_error( GtkFileSelection *selector, gpointer user_data )
+{
+	CheckDir( selector, "" );
+}*/
+
+//-----
+
+static void activate_history_item( GtkWidget* widget, 
+	gpointer data )
+{
+	gchar* dir = g_object_get_data( G_OBJECT( widget ), "history-dir" );
+
+	chdir( dir ); //TODO: fix this! Slight hack.
+	CheckDir( GTK_FILE_SELECTION( data ), ""/*dir*//*, NULL, no_completion, leave_selection*/ );
+}
+
+	//TODO: make this a generic function.
+GtkWidget* create_history_menu_item(GtkFileSelection* selector,  gchar* directory, GtkWidget* menu )
+{
+	GtkWidget* item = gtk_menu_item_new_with_label( directory );
+
+	g_object_set_data_full( G_OBJECT( item ), "history-dir", 
+		g_strdup( directory ), (GDestroyNotify)g_free );
+
+	g_signal_connect( item, "activate",
+		G_CALLBACK( activate_history_item ),
+		selector );
+
+	gtk_menu_shell_append( GTK_MENU_SHELL( menu ), item );
+	
+	gtk_widget_show( item );
+	
+	return item;
+}
+
+	//Yet more code based off of GtkFileSelection.
+	//Just much cleaner :)
+void fill_history_menu( GtkFileSelection* selector, const gchar* current_directory )
+{
+	if( selector->history_menu )
+	{
+		gtk_widget_destroy( selector->history_menu );
+	}
+	
+	selector->history_menu = gtk_menu_new( );
+	
+	GString* gdir = g_string_new_len( current_directory, strlen( current_directory ) + 1 );
+	int i = gdir->len;
+	gchar* dir = gdir->str;
+
+	for( ; i > 0; --i )
+	{
+		if( dir[i] == G_DIR_SEPARATOR || i == gdir->len )
+		{
+			dir[i] = '\0';
+			create_history_menu_item( selector, dir, selector->history_menu );
+		}
+	}
+
+	g_string_free( gdir, TRUE );
+	create_history_menu_item( selector, "/", selector->history_menu );
+	
+	gtk_widget_show( selector->history_menu );
+  gtk_option_menu_set_menu( GTK_OPTION_MENU( selector->history_pulldown ), 
+		selector->history_menu );	
+}
+
+static char * Filter( char * name )
+{
+	//TODO: figure out what this does, then use tolower() + isalpha().
+ static char tmp[32];
+ int  i,c;
+ for ( i=0,c=0;i < strlen( name );i++ )
+  {
+   if ( ( name[i] >='a' )&&( name[i] <= 'z' ) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
+    else tmp[c++]=name[i];
+  }
+ tmp[c]=0;
+ return tmp;
+}
+
+	//TODO: ASAP: need to enable passing in a column #.
+	//TEMP.  PUT THIS ELSEWHERE.
+void tree_view_append_item( GtkTreeView * view, const char * item )
+{
+	GtkTreeIter iter;
+	GtkListStore *store = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+	gtk_list_store_append( store, &iter );  
+	gtk_list_store_set( store, &iter, 0, item, -1 );	
+}
+
+	//TODO: rename.
+	//TODO: break this down into sub functions.
+	//TODO: pass in a directory _and_ filename.
+	//TODO: rewrite this using glib functions for globbing.
+	//Prototype borrowed (hey, I'll return it!) from GTK+.
+	//Globbing code is from Mplayer: fs.c. Thank you!
+void CheckDir( GtkFileSelection* selector, const gchar * directory/*, fsconst gchar* to_complete, completion_option complete, selection_option selection*/ )
+{
+	struct stat     fs;
+	glob_t          gg;
+	int             i;
+	gboolean using_directory = FALSE, dir_valid = FALSE;
+	gchar* file_mask = get_file_filter_entry( selector )->file_mask->str;
+
+		//TODO: this doesn't actually handle directories
+		//correctly and needs to be fixed.
+	chdir( directory );
+	
+	if( selector->history_pulldown ) 
+	{
+		gchar* cdir = g_get_current_dir( );
+		fill_history_menu( selector, cdir );
+		g_free( cdir );
+	}
+
+	GtkTreeView* dir_list = GTK_TREE_VIEW( selector->dir_list ),
+											* file_list = GTK_TREE_VIEW( selector->file_list );
+	 
+	gtk_list_store_clear( GTK_LIST_STORE( gtk_tree_view_get_model( dir_list ) ) );   
+	gtk_list_store_clear( GTK_LIST_STORE( gtk_tree_view_get_model( file_list  ) ) );  
+ 
+	 tree_view_append_item( dir_list, "." );
+	 tree_view_append_item( dir_list, ".." );
+
+	 //Don't glob directories, Hallelujah!
+ glob( "*",0,NULL,&gg );
+//// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
+ for(  i=0;(unsigned)i<gg.gl_pathc;i++ )
+  {
+   stat( gg.gl_pathv[i],&fs );
+
+		if( S_ISDIR( fs.st_mode ) )
+		{
+		tree_view_append_item( dir_list, gg.gl_pathv[i] );
+		}
+  }
+ globfree( &gg );
+
+ if ( strchr( file_mask,',' ) )
+  {
+   char tmp[8];
+   int  i,c,glob_param = 0;
+	//printf( "sub item detected.\n" );   
+   for ( i=0,c=0;i<(int)strlen( file_mask ) + 1;i++,c++ )
+    {
+     tmp[c]=file_mask[i];
+     if ( ( tmp[c] == ',' )||( tmp[c] == '\0' ) )
+      {
+       tmp[c]=0; c=-1;
+			//printf( "substr: %s\n",tmp );
+       glob( Filter( tmp ),glob_param,NULL,&gg ); 
+       glob_param=GLOB_APPEND;
+      }
+    }
+  } else glob( Filter( file_mask ),0,NULL,&gg );
+ 
+//// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
+ for(  i=0;(unsigned)i<gg.gl_pathc;i++ )
+  {
+   stat( gg.gl_pathv[i],&fs );
+
+		if(  !S_ISDIR( fs.st_mode ) )
+		{
+		 tree_view_append_item( file_list, gg.gl_pathv[i] );
+		}
+	}
+	
+ globfree( &gg );
+}
+
+
+/*	
+ This sucks. It is here to help me think.
+		//ISSUE: directory = "/something/foo".  We are in
+		//a dir with a file/dir foo.
+	
+	gchar* dir = g_path_get_dirname( directory ),
+						* file = g_path_get_basename( directory );
+	
+	g_printf( "dir: %s\n", dir );
+	g_printf( "file: %s\n", file );
+
+		//Fun.  TODO: clean this up.  A lot.
+	if( ( dir[0] != '\0' && dir[0] != '.' ) )
+	{
+		if( !chdir( dir ) )
+			dir_valid = TRUE;
+		else if( !chdir( directory ) )
+			using_directory = TRUE;
+		else
+				chdir( file );
+//		if( !chdir( directory ) )
+	}
+	else
+	{
+		if( chdir( file ) )
+	}
+		
+	if( file )
+	{
+			gtk_entry_set_text( GTK_ENTRY( selector->selection_entry ), file );
+	}
+	g_free( file );
+	g_free( dir );
+*/
--- Gui/mplayer/gtk/enfilesel.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/enfilesel.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,64 @@
+/* enfilesel.h
+ *
+ * July 21, 2003
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */ 
+
+/*
+ * This class adds a file type drop down
+ * with support for multiple file masks.
+ *
+ * For example, an EnhancedFileSelection that 
+ * was created with this filter: "*.jpg,*.png"
+ * would show all files ending in .jpg or
+ * .png.
+ *
+ * Notes:
+ *  -Tab completion is not implemented yet.
+ *  -The file operations have been hidden because 
+ *   using them leaves the selector in an inconsitent
+ *   state.
+ * 
+ * Credits:
+ *  -GTK+ team for GtkFileSelection, which served
+ *   as reference and provided some code.
+ *  -Mplayer team for the file globbing code.
+ */
+
+#ifndef ENFILESEL_H
+#define ENFILESEL_H
+
+#include <gtk/gtk.h>
+
+#include "filefilt.h"
+
+
+#define ENHANCED_FILE_SELECTION( p )	((GtkFileSelection*)p)
+typedef GtkFileSelection EnhancedFileSelection;
+	
+extern GtkWidget* enhanced_file_selection_new( const gchar* title, FileFilter* raw_filter, guint active_filter );
+
+extern G_CONST_RETURN gchar* enhanced_file_selection_get_filename( EnhancedFileSelection* selector );
+extern void enhanced_file_selection_set_filename( EnhancedFileSelection* selector,
+	const gchar *filename );
+
+gchar** enhanced_file_selection_get_selections( EnhancedFileSelection* selector );
+void enhanced_file_selection_set_select_multiple( 
+	EnhancedFileSelection* selector, gboolean select_multiple );
+
+#endif /*ENFILESEL_H*/
--- Gui/mplayer/gtk/eq.c.orig	Sat Feb  1 21:41:33 2003
+++ Gui/mplayer/gtk/eq.c	Thu Jan  8 18:54:25 2004
@@ -82,27 +82,26 @@
 
 static void eqSetChannelNames( void )
 {
- gchar * str[2];
- gtk_clist_clear( GTK_CLIST( ChannelsList ) );
- str[1]="";
- str[0]=MSGTR_EQU_All;
- gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+ GtkTreeView* channels = GTK_TREE_VIEW( ChannelsList );
+	
+ gtkClearList( channels );
+ gtkAppendList( channels, MSGTR_EQU_All);
  if ( guiIntfStruct.AudioType > 1 )
   {
-   str[0]=gtkEquChannel1; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
-   str[0]=gtkEquChannel2; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+   gtkAppendList( channels, gtkEquChannel1);
+   gtkAppendList( channels, gtkEquChannel2);
   }
  if ( guiIntfStruct.AudioType > 2 )
   {
-   str[0]=gtkEquChannel3; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
-   str[0]=gtkEquChannel4; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+   gtkAppendList( channels, gtkEquChannel3);
+   gtkAppendList( channels, gtkEquChannel4);
   }
  if ( guiIntfStruct.AudioType > 4 )
   {
-   str[0]=gtkEquChannel5; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
-   str[0]=gtkEquChannel6; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
+   gtkAppendList( channels, gtkEquChannel5);
+   gtkAppendList( channels, gtkEquChannel6);
   }
- gtk_clist_select_row( GTK_CLIST( ChannelsList ),0,0 );
+ gtkSelectListRow( channels, 0 );
 }
 
 void ShowEqualizer( void )
@@ -230,16 +229,35 @@
 static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data )
 { eqSetBands( Channel ); }
 
-static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
+static void eqSelectChannelsListRow( GtkTreeSelection * selection, GtkTreeView* view )
 {
- Channel=row - 1;
+	GtkTreeIter iter;
+
+	if( gtk_tree_selection_get_selected( selection, NULL, &iter) )
+	{
+		gint* indices;
+		GtkTreePath* path;
+		
+		path = gtk_tree_model_get_path( GTK_TREE_MODEL( gtk_tree_view_get_model( view ) ), &iter );
+		indices = gtk_tree_path_get_indices( path );
+		
+			//TODO: be paranoid and check for null?
+		Channel=indices[0] - 1;
+		gtk_tree_path_free( path );
+	
  eqSetBands( Channel );
  if ( Channel == -1 )
   {
    int i,j; equalizer_t eq;
    for ( i=1;i<6;i++ )
     for ( j=0;j<10;j++ )
-     { eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; gtkSet( gtkSetEqualizer,0,&eq ); }
+			 { 
+				 eq.band=j; 
+				 eq.channel=i; 
+				 eq.gain=gtkEquChannels[0][j]; 
+				 gtkSet( gtkSetEqualizer,0,&eq ); 
+			}
+		}
   }
 }
 
@@ -262,11 +280,11 @@
 
   Equalizer=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( Equalizer,MSGTR_Equalizer );
-  gtk_object_set_data( GTK_OBJECT( Equalizer ),MSGTR_Equalizer,Equalizer );
-  gtk_widget_set_usize( Equalizer,-1,256 );
+  g_object_set_data( G_OBJECT( Equalizer ),MSGTR_Equalizer,Equalizer );
+  gtk_widget_set_size_request( Equalizer,-1,256 );
   gtk_window_set_title( GTK_WINDOW( Equalizer ),MSGTR_Equalizer );
   gtk_window_set_position( GTK_WINDOW( Equalizer ),GTK_WIN_POS_CENTER );
-  gtk_window_set_policy( GTK_WINDOW( Equalizer ),FALSE,FALSE,FALSE );
+  gtk_window_set_resizable( GTK_WINDOW( Equalizer ),FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( Equalizer ),"Equalizer","MPlayer" );
 
   gtk_widget_realize( Equalizer );
@@ -286,15 +304,12 @@
   gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
   gtk_widget_show( scrolledwindow1 );
   gtk_box_pack_start( GTK_BOX( hbox1 ),scrolledwindow1,FALSE,FALSE,0 );
-  gtk_widget_set_usize( scrolledwindow1,106,-2 );
+  gtk_widget_set_size_request( scrolledwindow1,106,-1 );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
 
-  ChannelsList=gtk_clist_new( 1 );
-  gtk_widget_set_name( ChannelsList,"ChannelsList" );
+	ChannelsList = gtkListNew( 1, NULL, FALSE );
   gtk_widget_show( ChannelsList );
   gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),ChannelsList );
-  gtk_clist_set_column_width( GTK_CLIST( ChannelsList ),0,80 );
-  gtk_clist_column_titles_hide( GTK_CLIST( ChannelsList ) );
 
   table1=gtk_table_new( 2,10,FALSE );
   gtk_widget_set_name( table1,"table1" );
@@ -410,22 +425,22 @@
   VContrastadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
   VContrast=AddHScaler( VContrastadj,NULL,1 );
     gtk_table_attach( GTK_TABLE( table1 ),VContrast,1,2,0,1,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
-    gtk_widget_set_usize( VContrast,-1,45 );
+    gtk_widget_set_size_request( VContrast,-1,45 );
 
   VBrightnessadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
   VBrightness=AddHScaler( VBrightnessadj,NULL,1 );
     gtk_table_attach( GTK_TABLE( table1 ),VBrightness,1,2,1,2,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
-    gtk_widget_set_usize( VBrightness,-1,45 );
+    gtk_widget_set_size_request( VBrightness,-1,45 );
 
   VHueadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
   VHue=AddHScaler( VHueadj,NULL,1 );
     gtk_table_attach( GTK_TABLE( table1 ),VHue,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
-    gtk_widget_set_usize( VHue,-1,45 );
+    gtk_widget_set_size_request( VHue,-1,45 );
 
   VSaturationadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-100,100,1,0,0 ) );
   VSaturation=AddHScaler( VSaturationadj,NULL,1 );
     gtk_table_attach( GTK_TABLE( table1 ),VSaturation,1,2,3,4,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
-    gtk_widget_set_usize( VSaturation,-1,45 );
+    gtk_widget_set_size_request( VSaturation,-1,45 );
 
   gtk_notebook_set_tab_label( GTK_NOTEBOOK( Notebook ),gtk_notebook_get_nth_page( GTK_NOTEBOOK( Notebook ),1 ),
     AddLabel( MSGTR_EQU_Video,NULL ) );
@@ -434,7 +449,7 @@
 
   hbuttonbox1=AddHButtonBox( vbox1 );
     gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
+    gtk_box_set_spacing( GTK_BOX( hbuttonbox1 ),10 );
 
   Config=AddButton( MSGTR_Config,hbuttonbox1 );
   Clear=AddButton( MSGTR_Clear,hbuttonbox1 );
@@ -443,32 +458,34 @@
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Equalizer );
-  gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 );
+  g_signal_connect( G_OBJECT( Equalizer ),"destroy",G_CALLBACK( WidgetDestroy ),&Equalizer );
+  g_signal_connect( G_OBJECT( Equalizer ),"focus_in_event",G_CALLBACK( eqFocus ),(void *)2 );
 
-  gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL );
+	g_signal_connect( 
+		G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( ChannelsList ) ) ), "changed", 
+			G_CALLBACK( eqSelectChannelsListRow ), ChannelsList );
+
+  g_signal_connect( G_OBJECT( A3125 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)0 );
+  g_signal_connect( G_OBJECT( A6250 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)1 );
+  g_signal_connect( G_OBJECT( A125 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)2 );
+  g_signal_connect( G_OBJECT( A250 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)3 );
+  g_signal_connect( G_OBJECT( A500 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)4 );
+  g_signal_connect( G_OBJECT( A1000 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)5 );
+  g_signal_connect( G_OBJECT( A2000 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)6 );
+  g_signal_connect( G_OBJECT( A4000 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)7 );
+  g_signal_connect( G_OBJECT( A8000 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)8 );
+  g_signal_connect( G_OBJECT( A16000 ),"motion_notify_event",G_CALLBACK( eqHScaleMotion ),(void*)9 );
+
+  g_signal_connect( G_OBJECT( VContrast ),"motion_notify_event",G_CALLBACK( eqVScaleMotion ),(void*)1 );
+  g_signal_connect( G_OBJECT( VBrightness ),"motion_notify_event",G_CALLBACK( eqVScaleMotion ),(void*)2 );
+  g_signal_connect( G_OBJECT( VHue ),"motion_notify_event",G_CALLBACK( eqVScaleMotion ),(void*)3 );
+  g_signal_connect( G_OBJECT( VSaturation ),"motion_notify_event",G_CALLBACK( eqVScaleMotion ),(void *)4 );
+  
+  g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( eqButtonReleased ),(void *)0 );
+  g_signal_connect( G_OBJECT( Clear ),"clicked",G_CALLBACK( eqButtonReleased ),(void *)1 );
+  g_signal_connect( G_OBJECT( Config ),"clicked",G_CALLBACK( eqButtonReleased ),(void *)2 );
 
-  gtk_signal_connect( GTK_OBJECT( A3125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)0 );
-  gtk_signal_connect( GTK_OBJECT( A6250 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( A125 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( A250 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( A500 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)4 );
-  gtk_signal_connect( GTK_OBJECT( A1000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)5 );
-  gtk_signal_connect( GTK_OBJECT( A2000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)6 );
-  gtk_signal_connect( GTK_OBJECT( A4000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)7 );
-  gtk_signal_connect( GTK_OBJECT( A8000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)8 );
-  gtk_signal_connect( GTK_OBJECT( A16000 ),"motion_notify_event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)9 );
-
-  gtk_signal_connect( GTK_OBJECT( VContrast ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( VBrightness ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( VHue ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion_notify_event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void *)4 );
-  
-  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( Clear ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 );
-  gtk_signal_connect( GTK_OBJECT( Config ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)2 );
-
-  gtk_signal_connect( GTK_OBJECT( Notebook ),"switch_page",GTK_SIGNAL_FUNC( eqNotebook ),NULL );
+  g_signal_connect( G_OBJECT( Notebook ),"switch_page",G_CALLBACK( eqNotebook ),NULL );
 
   gtk_window_add_accel_group( GTK_WINDOW( Equalizer ),accel_group );
 
@@ -517,12 +534,12 @@
 
  g_list_free( Items );
 
- gtk_entry_set_text( GTK_ENTRY( CEChannel1 ),gtkEquChannel1 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel1 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel2 ),gtkEquChannel2 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel2 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel3 ),gtkEquChannel3 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel3 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel4 ),gtkEquChannel4 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel4 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel5 ),gtkEquChannel5 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel5 ),FALSE );
- gtk_entry_set_text( GTK_ENTRY( CEChannel6 ),gtkEquChannel6 ); gtk_entry_set_editable( GTK_ENTRY( CEChannel6 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel1 ),gtkEquChannel1 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel1 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel2 ),gtkEquChannel2 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel2 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel3 ),gtkEquChannel3 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel3 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel4 ),gtkEquChannel4 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel4 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel5 ),gtkEquChannel5 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel5 ),FALSE );
+ gtk_entry_set_text( GTK_ENTRY( CEChannel6 ),gtkEquChannel6 ); gtk_editable_set_editable( GTK_EDITABLE( CEChannel6 ),FALSE );
 
  gtk_widget_show( EquConfig );
  gtkSetLayer( EquConfig );
@@ -562,13 +579,13 @@
 
   EquConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( EquConfig,"EquConfig" );
-  gtk_object_set_data( GTK_OBJECT( EquConfig ),"EquConfig",EquConfig );
-  gtk_widget_set_usize( EquConfig,350,198 );
+  g_object_set_data( G_OBJECT( EquConfig ),"EquConfig",EquConfig );
+  gtk_widget_set_size_request( EquConfig,350,198 );
   GTK_WIDGET_SET_FLAGS( EquConfig,GTK_CAN_DEFAULT );
   gtk_window_set_title( GTK_WINDOW( EquConfig ),"Configure Equalizer" );
   gtk_window_set_position( GTK_WINDOW( EquConfig ),GTK_WIN_POS_CENTER );
 //  gtk_window_set_modal( GTK_WINDOW( EquConfig ),TRUE );
-  gtk_window_set_policy( GTK_WINDOW( EquConfig ),FALSE,FALSE,FALSE );
+  gtk_window_set_resizable( GTK_WINDOW( EquConfig ),FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( EquConfig ),"EquConfig","MPlayer" );
 
   gtk_widget_realize( EquConfig );
@@ -653,7 +670,7 @@
 
   hbuttonbox1=AddHButtonBox( vbox1 );
     gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
+    gtk_box_set_spacing( GTK_BOX( hbuttonbox1 ),10 );
 
   ecOk=AddButton( MSGTR_Ok,hbuttonbox1 );
   ecCancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
@@ -661,10 +678,10 @@
   gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&EquConfig );
+  g_signal_connect( G_OBJECT( EquConfig ),"destroy",G_CALLBACK( WidgetDestroy ),&EquConfig );
   
-  gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 );
-  gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 );
+  g_signal_connect( G_OBJECT( ecOk ),"clicked",G_CALLBACK( ecButtonReleased ),(void *)1 );
+  g_signal_connect( G_OBJECT( ecCancel ),"clicked",G_CALLBACK( ecButtonReleased ),(void *)0 );
 
   gtk_window_add_accel_group( GTK_WINDOW( EquConfig ),accel_group );
 
--- Gui/mplayer/gtk/filefilt.c.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/filefilt.c	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,90 @@
+/* filefilt.c
+ *
+ * July 21, 2003
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */ 
+
+#include "filefilt.h"
+
+/*
+typedef struct _FileFilterEntry       FileFilterEntry;
+#define FILE_FILTER_ENTRY( p )		((FileFilterEntry*)p)	
+
+struct _FileFilterEntry
+{
+	GString* description;
+	GString* file_mask;
+};*/
+
+extern FileFilterEntry* file_filter_entry_new( const gchar* description, const gchar* file_mask )
+{
+	FileFilterEntry* f = g_new( FileFilterEntry , 1 );
+
+	f->description = g_string_new( description );
+	f->file_mask = g_string_new( file_mask );
+
+	return f;
+}
+
+static void file_filter_entry_free_( gpointer data, gpointer user_data )
+{
+	FileFilterEntry* f = (FileFilterEntry*)data;
+//	g_printf( "Destroying item: (%s, %s)\n", f->description->str, f->file_mask->str );
+	
+	g_string_free( f->description, TRUE );
+	g_string_free( f->file_mask, TRUE );
+	
+	g_free( f );
+}
+
+extern FileFilter* file_filter_new( const gchar* description, const gchar* file_mask )
+{
+	return g_list_append( NULL, file_filter_entry_new( description, file_mask ) );
+}
+	
+extern FileFilter* filter_newv( const gchar* filter_table[][2] )
+{
+	FileFilter* f;
+/*	if( filter_table[0][0] )
+	{*/
+		int i;
+		f = file_filter_new( filter_table[0][0], filter_table[0][1] );
+
+		for( i=1; filter_table[i][0]; ++i )
+		{
+			file_filter_append( &f, filter_table[i][0], filter_table[i][1] );
+		}
+/*	}
+	else
+	{
+		f = file_filter_new( filter_table[0][0], filter_table[0][1] );
+	}*/
+	
+	return f;
+}
+
+extern void file_filter_append( FileFilter** filter, const gchar* description, const gchar* file_mask )
+{
+	*filter = g_list_append( *filter, file_filter_entry_new( description, file_mask ) );
+}
+		
+extern void file_filter_free( FileFilter* filter )	
+{
+	g_list_foreach( filter, (GFunc)file_filter_entry_free_, NULL );
+	g_list_free( filter );
+}
--- Gui/mplayer/gtk/filefilt.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/filefilt.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,53 @@
+/* filefilt.h
+ *
+ * July 21, 2003
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */ 
+
+
+#ifndef FILEFILT_H
+#define FILEFILT_H
+
+#include <glib.h>
+
+
+	//File filters will 'always' be able to be cast to a glist.
+typedef GList FileFilter;
+#define FILE_FILTER( p )		((FileFilter*)p)
+	
+extern FileFilter* file_filter_new( const gchar* description, const gchar* file_mask );
+extern FileFilter* filter_newv( const gchar* filter_table[][2] ); 
+extern void file_filter_append( FileFilter** filter, const gchar* description, const gchar* file_mask );
+extern void file_filter_destroy( FileFilter* filter );
+
+	//TODO: Move FileFilterEntry decls. here?
+typedef struct _FileFilterEntry       FileFilterEntry;
+#define FILE_FILTER_ENTRY( p )		((FileFilterEntry*)p)	
+
+struct _FileFilterEntry
+{
+	GString* description;
+	GString* file_mask;
+};
+
+extern FileFilterEntry* file_filter_entry_new( const gchar* description, const gchar* file_mask );
+extern FileFilter* filter_newv( const gchar* filter_table[][2] );
+extern void file_filter_free( FileFilter* filter )	;
+
+
+#endif /*FILEFILT_H*/
--- Gui/mplayer/gtk/fs.c.orig	Sun Dec  7 18:42:03 2003
+++ Gui/mplayer/gtk/fs.c	Thu Jan  8 18:54:25 2004
@@ -1,17 +1,9 @@
+/* New file selction code: use   */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <glob.h>
-#include <unistd.h>
+#include "fs.h"
 
 #include "../mplayer.h"
 
-#include "mplayer/pixmaps/up.xpm"
-#include "mplayer/pixmaps/dir.xpm"
-#include "mplayer/pixmaps/file.xpm"
-
 #include "../../app.h"
 #include "../../interface.h"
 #include "../../../config.h"
@@ -23,23 +15,12 @@
 #include "opts.h"
 #include "common.h"
 
-#ifndef __linux__
-#define get_current_dir_name()  getcwd(NULL, PATH_MAX)
-#endif
+#include "enfilesel.h" 
 
-#ifndef get_current_dir_name
- extern char * get_current_dir_name( void );
-#endif
-
-gchar         * fsSelectedFile = NULL;
-gchar         * fsSelectedDirectory = NULL;
-unsigned char * fsThatDir = ".";
-gchar         * fsFilter = "*";
+#include <gtk/gtkmarshal.h>
 
-int             fsPressed = 0;
-int             fsType    = 0;
 
-char * fsVideoFilterNames[][2] =
+const gchar * fsVideoFilterNames[][2] =
          { { "MPEG files (*.mpg,*.mpeg,*.m1v)",                         "*.mpg,*.mpeg,*.m1v" },
 	   { "VCD/SVCD Images (*.bin)",					"*.bin" },
            { "VOB files (*.vob)",  				  	"*.vob" },
@@ -64,7 +45,7 @@
 	   { NULL,NULL }
 	 };
 
-char * fsSubtitleFilterNames[][2] =
+const gchar * fsSubtitleFilterNames[][2] =
          { { "UTF (*.utf)",  						   "*.utf" },
            { "SUB (*.sub)",   						   "*.sub" },
            { "SRT (*.srt)",   						   "*.str" },
@@ -78,13 +59,13 @@
 	   { NULL,NULL }
 	 };
 
-char * fsOtherFilterNames[][2] =
+const gchar * fsOtherFilterNames[][2] =
          { 
 	   { "All files", "*"     },
 	   { NULL,NULL }
 	 };
 	 
-char * fsAudioFileNames[][2] =
+const gchar * fsAudioFileNames[][2] =
 	 { 
 	   { "WAV files (*.wav)",					   "*.wav" },
 	   { "MP3 files (*.mp2, *.mp3)",				   "*.mp2,*.mp3" },
@@ -96,7 +77,7 @@
 	   { NULL, NULL }
 	 };
 
-char * fsFontFileNames[][2] =
+const gchar * fsFontFileNames[][2] =
          {
 #ifdef HAVE_FREETYPE
 	   { "True Type fonts (*.ttf)",					   "*.ttf" },
@@ -109,580 +90,234 @@
 	   { NULL,NULL }
 	 };
 
-GtkWidget   * fsFileNamesList;
-GtkWidget   * fsFNameList;
-GtkWidget   * fsFileSelect = NULL;
-GdkColormap * fsColorMap;
-GtkWidget   * fsOk;
-GtkWidget   * fsUp;
-GtkWidget   * fsCancel;
-GtkWidget   * fsCombo4;
-GtkWidget   * fsPathCombo;
-GList       * fsList_items = NULL;
-GList       * fsTopList_items = NULL;
-GtkWidget   * List;
-GtkWidget   * fsFilterCombo;
-
-GtkStyle    * style;
-GdkPixmap   * dpixmap;
-GdkPixmap   * fpixmap;
-GdkBitmap   * dmask;
-GdkBitmap   * fmask;
-
-static char * Filter( char * name )
-{
- static char tmp[32];
- int  i,c;
- for ( i=0,c=0;i < strlen( name );i++ )
-  {
-   if ( ( name[i] >='a' )&&( name[i] <= 'z' ) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
-    else tmp[c++]=name[i];
-  }
- tmp[c]=0;
- return tmp;
-}
-
-void CheckDir( GtkWidget * list,char * directory )
-{
- struct stat     fs;
- int             i,c=2;
- gchar         * str[1][2];
- GdkPixmap     * pixmap;
- GdkBitmap     * mask;
- glob_t          gg;
-
- if ( !fsFilter[0] ) return;
-
- gtk_widget_hide( list );
- gtk_clist_clear( GTK_CLIST( list ) );
- str[0][0]=NULL;
 
- pixmap=dpixmap; mask=dmask;
- str[0][0]=NULL;
- str[0][1]=".";  gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask );
- str[0][1]=".."; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask );
+static void mplayer_control( GtkWidget* ok_button, gpointer user_data );
 
- glob( "*",0,NULL,&gg );
-// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
- for(  i=0;(unsigned)i<gg.gl_pathc;i++ )
+void attach_ok_clicked( GtkWidget* selector, GCallback default_handler, GCallback user_handler  )
+{
+	if( user_handler )
   {
-   stat( gg.gl_pathv[i],&fs );
-   if( !S_ISDIR( fs.st_mode ) ) continue;
-
-   str[0][1]=gg.gl_pathv[i];
-   pixmap=dpixmap; mask=dmask;
-   gtk_clist_append( GTK_CLIST( list ),str[0] );
-   gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
+		g_signal_connect_swapped( ENHANCED_FILE_SELECTION( selector )->ok_button, "clicked", user_handler, selector );
   }
- globfree( &gg );
-
- if ( strchr( fsFilter,',' ) )
-  {
-   char tmp[8];
-   int  i,c,glob_param = 0;
-//printf( "sub item detected.\n" );   
-   for ( i=0,c=0;i<(int)strlen( fsFilter ) + 1;i++,c++ )
+	else
     {
-     tmp[c]=fsFilter[i];
-     if ( ( tmp[c] == ',' )||( tmp[c] == '\0' ) )
-      {
-       tmp[c]=0; c=-1;
-//       printf( "substr: %s\n",tmp );
-       glob( Filter( tmp ),glob_param,NULL,&gg ); 
-       glob_param=GLOB_APPEND;
-      }
-    }
-  } else glob( Filter( fsFilter ),0,NULL,&gg );
+		GClosure* ok = g_cclosure_new_object_swap( default_handler, G_OBJECT( selector ) );
 
-#if 0
- if ( !strcmp( fsFilter,"*" ) )
- {
-  char * f = strdup( fsFilter );
-  int    i;
-  for( i=0;i<strlen( f );i++ )
-   if ( ( f[i] >= 'A' )&&( f[i] <= 'Z' ) ) f[i]+=32;
-  glob( f,GLOB_APPEND,NULL,&gg );
-
-  for( i=0;i<strlen( f );i++ )
-   if ( ( f[i] >= 'a' )&&( f[i] <= 'z' ) ) f[i]-=32;
-  glob( f,GLOB_APPEND,NULL,&gg );
-  free( f );
+		g_closure_sink( g_closure_ref( ok ) );	
+		g_closure_set_marshal( ok, g_cclosure_marshal_VOID__OBJECT );
+		g_signal_connect( ENHANCED_FILE_SELECTION( selector )->ok_button, "clicked", G_CALLBACK( mplayer_control ), ok );
  }
+}
+
+
+static void FileSelect_new( GtkWidget** f, const gchar* title, const gchar* path, const gchar* filter_table[][2] );
+static void FileSelectSetType( GtkWidget* f, gint type );
+
+static void video_select_ok( EnhancedFileSelection* selector );
+static void font_select_ok( EnhancedFileSelection* selector );
+static void other_select_ok( EnhancedFileSelection* selector );
+static void audio_select_ok( EnhancedFileSelection* selector );
+#ifdef USE_SUB
+static void sub_select_ok( EnhancedFileSelection* selector );
 #endif
 
-// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
- pixmap=fpixmap; mask=fmask;
- for(  i=0;(unsigned)i<gg.gl_pathc;i++ )
-  {
-   stat( gg.gl_pathv[i],&fs );
-   if(  S_ISDIR( fs.st_mode ) ) continue;
+	//If ok_handler is NULL, the default handler for type 
+	//will be used.
+void ShowFileSelect( int type, GCallback ok_handler, int modal )
+{
+		//This is temp. a static until I have some other code in place.
+	static GtkWidget* selector = NULL; 
 
-   str[0][1]=gg.gl_pathv[i];
-   gtk_clist_append( GTK_CLIST( list ),str[0] );
-   gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
+	if ( selector ) 
+	{
+		gtkActive( selector );
+		return; 
   }
- globfree( &gg );
 
- gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
- gtk_clist_select_row( GTK_CLIST( list ),0,1 );
- gtk_widget_show( list );
-}
-
-void fs_PersistantHistory( char *subject ); /* forward declaration */
+	create_FileSelect( &selector, type, ok_handler, modal );
 
-void ShowFileSelect( int type,int modal )
+	gtk_widget_show( selector );
+	gtkSetLayer( selector );
+}
+/*
+void HideFileSelect( void )
 {
- int i;
- char * tmp = NULL;
-
- if ( fsFileSelect ) gtkActive( fsFileSelect );
-  else fsFileSelect=create_FileSelect();
+ if ( !fsFileSelect ) return;
+ gtk_widget_hide( fsFileSelect );
+ gtk_widget_destroy( fsFileSelect );
+// fsFileSelect = NULL; //Handled automatically.
+}
+*/
  
- fsType=type;
+	//selector will be set to the new file selector
+	//and will be automatically set to NULL when
+	//the selector is closed.
+void create_FileSelect( GtkWidget** selector, int type, GCallback ok_handler, int modal )
+{
  switch ( type )
   {
    case fsVideoSelector:
-        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
-        fsList_items=NULL;
-        for( i=0;fsVideoFilterNames[i][0];i++ )
-          fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] );
-        gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
-        g_list_free( fsList_items );
-        gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[i-2][0] );
-	tmp=guiIntfStruct.Filename;
+			FileSelect_new( selector, MSGTR_FileSelect, guiIntfStruct.Filename, fsVideoFilterNames ); 
+			attach_ok_clicked( *selector, G_CALLBACK( video_select_ok ), ok_handler );
         break;
+
    case fsSubtitleSelector:
-        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect );
-        fsList_items=NULL;
-        for( i=0;fsSubtitleFilterNames[i][0];i++ )
-          fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] );
-        gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
-        g_list_free( fsList_items );
-        gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[i-2][0] );
-	tmp=guiIntfStruct.Subtitlename;
+			FileSelect_new( selector, MSGTR_SubtitleSelect, guiIntfStruct.Subtitlename, fsSubtitleFilterNames ); 
+			attach_ok_clicked( *selector, G_CALLBACK( sub_select_ok ), ok_handler );
         break;
+
    case fsOtherSelector:
-        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
-        fsList_items=NULL;
-        for( i=0;fsOtherFilterNames[i][0];i++ )
-          fsList_items=g_list_append( fsList_items,fsOtherFilterNames[i][0] );
-        gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
-        g_list_free( fsList_items );
-        gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] );
-	tmp=guiIntfStruct.Othername;
+			FileSelect_new( selector, MSGTR_OtherSelect, guiIntfStruct.Othername, fsOtherFilterNames ); 
+			attach_ok_clicked( *selector, G_CALLBACK( other_select_ok ), ok_handler );
         break;
+
    case fsAudioSelector:
-	gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect );
-	fsList_items=NULL;
-	for( i=0;fsAudioFileNames[i][0];i++ )
-	  fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] );
-	gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
-	g_list_free( fsList_items );
-	gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[i-2][0] );
-	tmp=guiIntfStruct.AudioFile;
+			FileSelect_new( selector, MSGTR_AudioFileSelect, guiIntfStruct.AudioFile, fsAudioFileNames ); 
+			attach_ok_clicked( *selector, G_CALLBACK( audio_select_ok ), ok_handler );
 	break;
+
    case fsFontSelector:
-        gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect );
-	fsList_items=NULL;
-	for( i=0;fsFontFileNames[i][0];i++ )
-	  fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] );
-	gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
-	g_list_free( fsList_items );
-	gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[i-2][0] );
-	tmp=font_name;
+			FileSelect_new( selector, MSGTR_FontSelect, font_name, fsFontFileNames ); 
+			attach_ok_clicked( *selector, G_CALLBACK( font_select_ok ), ok_handler );
 	break;
   }
 
- if ( tmp && tmp[0] )
-  {
-   struct stat f;
-   char * dir = strdup( tmp );
+	FileSelectSetType( *selector, type );
 
-   do 
-    {
-     char * c = strrchr( dir,'/' );
-     stat( dir,&f );
-     if ( S_ISDIR( f.st_mode ) ) break;
-     if ( c ) *c=0;
-    } while ( strrchr( dir,'/' ) );
+	gtk_window_set_modal( GTK_WINDOW( *selector ), modal );
 
-   if ( dir[0] ) chdir( dir );
-   
-   free( dir );
-  }
+//return selector;
+}
  
- if ( fsTopList_items ) g_list_free( fsTopList_items ); fsTopList_items=NULL;
- {
-  char * hist;
-  int  i, c = 1;
+//-----
   
-  if ( fsType == fsVideoSelector )
-   {
-    for ( i=0;i < fsPersistant_MaxPos;i++ )
-     if ( fsHistory[i] ) { fsTopList_items=g_list_append( fsTopList_items,fsHistory[i] ); c=0; }
-   }
-  if ( c ) fsTopList_items=g_list_append( fsTopList_items,(gchar *)get_current_dir_name() );
- }
- if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) );
- fsTopList_items=g_list_append( fsTopList_items,"/home" );
- fsTopList_items=g_list_append( fsTopList_items,"/mnt" );
- fsTopList_items=g_list_append( fsTopList_items,"/" );
- gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items );
-  
- gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
+	//TODO: move this. Possibly just make filter table
+	//always use the second-to-last item as the default filter.
+int get_default_filter( const gchar* filter_table[][2] )
+{
+	int result = 0;
+	while( filter_table[result][0] ) 
+		++result;
 
- gtk_widget_show( fsFileSelect );
+	return result - 2;
 }
 
-void HideFileSelect( void )
-{
- if ( !fsFileSelect ) return;
- gtk_widget_hide( fsFileSelect );
- gtk_widget_destroy( fsFileSelect );
- fsFileSelect=NULL;
-}
+//-----
 
-void fs_PersistantHistory( char * subject )
+void FileSelect_new( GtkWidget** f, const gchar* title, const gchar* path, const gchar* filter_table[][2] )
 {
- int i;
+	guint default_filter = get_default_filter( filter_table );
+	*f= enhanced_file_selection_new( title, filter_newv( filter_table ), default_filter );
 
- if ( fsType != fsVideoSelector ) return;
+	gtkAddIcon( *f );
 
- for ( i=0;i < fsPersistant_MaxPos;i++ )
-  if ( fsHistory[i] && !strcmp( fsHistory[i],subject ) )
+		//TODO: set fs-type to a default value.
+	g_object_set_data_full( G_OBJECT( *f ), "fs-type", g_new( gint, 1 ), (GDestroyNotify)g_free );
+	
+	
+	if ( path && path[0] )	
    {
-    char * tmp = fsHistory[i]; fsHistory[i]=fsHistory[0]; fsHistory[0]=tmp;
-    return;
+		enhanced_file_selection_set_filename( ENHANCED_FILE_SELECTION( *f ), path );
    }
- gfree( (void **)&fsHistory[fsPersistant_MaxPos - 1] );
- for ( i=fsPersistant_MaxPos - 1;i;i-- ) fsHistory[i]=fsHistory[i - 1];
- fsHistory[0]=gstrdup( subject );
+	
+	g_signal_connect( G_OBJECT( *f ),
+												 "destroy",
+												 G_CALLBACK( gtk_widget_destroyed ), 
+												 f ); 
 }
-//-----------------------------------------------
 
-void fs_fsFilterCombo_activate( GtkEditable * editable,gpointer user_data )
+static void FileSelectSetType( GtkWidget* f, gint type )
 {
- fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) );
- CheckDir( fsFNameList,get_current_dir_name() );
+	*(gint*)g_object_get_data( G_OBJECT( f ), "fs-type" ) = type;
 }
 
-void fs_fsFilterCombo_changed( GtkEditable * editable,gpointer user_data )
+//-----
+
+static void guiSetString( gchar** dest, const gchar* src )
 {
- char * str;
- int    i;
+	g_free( *dest );
+	*dest = g_strdup( src );
+}
 
- str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
+static void video_select_ok( EnhancedFileSelection* selector )
+{
+	guiSetString( &guiIntfStruct.Filename, enhanced_file_selection_get_filename( selector ) );
 
- switch ( fsType )
-  {
-   case fsVideoSelector:
-          for( i=0;fsVideoFilterNames[i][0];i++ )
-           if( !strcmp( str,fsVideoFilterNames[i][0] ) )
-            { fsFilter=fsVideoFilterNames[i][1]; break; }
-          break;
-   case fsSubtitleSelector:
-          for( i=0;fsSubtitleFilterNames[i][0];i++ )
-           if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
-            { fsFilter=fsSubtitleFilterNames[i][1]; break; }
-          break;
-   case fsOtherSelector:
-          for( i=0;fsOtherFilterNames[i][0];i++ )
-           if( !strcmp( str,fsOtherFilterNames[i][0] ) )
-            { fsFilter=fsOtherFilterNames[i][1]; break; }
-          break;
-   case fsAudioSelector:
-          for( i=0;fsAudioFileNames[i][0];i++ )
-           if( !strcmp( str,fsAudioFileNames[i][0] ) )
-            { fsFilter=fsAudioFileNames[i][1]; break; }
-	  break;
-   case fsFontSelector:
-          for( i=0;fsFontFileNames[i][0];i++ )
-	    if( !strcmp( str,fsFontFileNames[i][0] ) )
-	     { fsFilter=fsFontFileNames[i][1]; break; }
-	  break;
-   default: return;
-  }
- CheckDir( fsFNameList,get_current_dir_name() );
+	guiIntfStruct.StreamType=STREAMTYPE_FILE;
+	guiIntfStruct.FilenameChanged=1; 
+	sub_fps=0;
+	gfree( (void**)&guiIntfStruct.AudioFile );
+	gfree( (void**)&guiIntfStruct.Subtitlename );
 }
 
-void fs_fsPathCombo_activate( GtkEditable * editable,gpointer user_data )
+#ifdef USE_SUB
+static void sub_select_ok( EnhancedFileSelection* selector )
 {
- unsigned char * str;
-
- str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
- if ( chdir( str ) != -1 ) CheckDir( fsFNameList,get_current_dir_name() );
+	guiSetString( &guiIntfStruct.Subtitlename, enhanced_file_selection_get_filename( selector ) );
+	guiLoadSubtitle( guiIntfStruct.Subtitlename );
 }
+#endif
 
-void fs_fsPathCombo_changed( GtkEditable * editable,gpointer user_data )
+static void font_select_ok( EnhancedFileSelection* selector )
 {
- unsigned char * str;
+	guiSetString( &font_name, enhanced_file_selection_get_filename( selector ) );
 
- str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
- fsPressed=2;
- if ( chdir( str ) != -1 ) CheckDir( fsFNameList,get_current_dir_name() );
+#if defined( USE_OSD ) || defined( USE_SUB )
+	guiLoadFont( );
+#endif
+	
+	if ( Preferences ) 
+		gtk_entry_set_text( GTK_ENTRY( prEFontName ), font_name );
 }
 
-void fs_Up_released( GtkButton * button,gpointer user_data )
+static void other_select_ok( EnhancedFileSelection* selector )
 {
- chdir( ".." );
- fsSelectedFile=fsThatDir;
- CheckDir( fsFNameList,get_current_dir_name() );
- gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name() );
- return;
+	guiSetString( &guiIntfStruct.Othername, enhanced_file_selection_get_filename( selector ) );
 }
 
-int fsFileExist( unsigned char * fname )
+static void audio_select_ok( EnhancedFileSelection* selector )
 {
- FILE * f = fopen( fname,"r" );
- if ( f == NULL ) return 0;
- fclose( f );
- return 1;
+	guiSetString( &guiIntfStruct.AudioFile, enhanced_file_selection_get_filename( selector ) );
 }
 
-void fs_Ok_released( GtkButton * button,gpointer user_data )
-{
- unsigned char * str;
- GList         * item;
- int             size,j,i = 1;
- struct stat     fs;
 
- stat( fsSelectedFile,&fs );
- if(  S_ISDIR(fs.st_mode ) )
-  {
-   chdir( fsSelectedFile );
-   fsSelectedFile=fsThatDir;
-   CheckDir( fsFNameList,get_current_dir_name() );
-   gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name() );
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+	//TODO: rename me!
+	//This calls the calls the correct ok handler and then finishes up.
+static void mplayer_control( GtkWidget* ok_button, gpointer user_data )
+{
+	EnhancedFileSelection* selector = ENHANCED_FILE_SELECTION( gtk_widget_get_toplevel( ok_button ) );
+	g_return_if_fail( GTK_IS_FILE_SELECTION( gtk_widget_get_toplevel( GTK_WIDGET( selector ) ) ) );
+
+		//TODO: put in file_exists(). Actually, check for std function that does that.
+	struct stat info; 
+	int result = stat( enhanced_file_selection_get_filename( selector ), &info );
+	if( result || ( !result && S_ISDIR( info.st_mode ) ) ) 
    return;
-  }
+		//
 
- switch( fsPressed )
-  {
-   case 1:
-        fsSelectedDirectory=(unsigned char *)get_current_dir_name();
-        break;
-   case 2:
-        str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
-        fsSelectedFile=str;
-        if ( !fsFileExist( fsSelectedFile ) ) { HideFileSelect(); return; }
-        fsSelectedDirectory=fsSelectedFile;
-        size=strlen( fsSelectedDirectory );
-        for ( j=0;j<size;j++ )
-         {
-          if ( fsSelectedDirectory[ size - j ] == '/' )
-           {
-            fsSelectedFile+=size - j + 1;
-            fsSelectedDirectory[ size - j ]=0;
-            break;
-           }
-         }
-        break;
-  }
- switch ( fsType )
-  {
-   case fsVideoSelector:
-          guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile );
-          guiIntfStruct.StreamType=STREAMTYPE_FILE;
-          guiIntfStruct.FilenameChanged=1; sub_fps=0;
-	  gfree( (void **)&guiIntfStruct.AudioFile );
-	  gfree( (void **)&guiIntfStruct.Subtitlename );
-          fs_PersistantHistory( fsSelectedDirectory );      //totem, write into history
-          break;
-#ifdef USE_SUB
-   case fsSubtitleSelector:
-          guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
-	  guiLoadSubtitle( guiIntfStruct.Subtitlename );
-          break;
-#endif
-   case fsOtherSelector:
-          guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
-          break;
-   case fsAudioSelector:
-          guiSetDF( guiIntfStruct.AudioFile,fsSelectedDirectory,fsSelectedFile );
-          break;
-   case fsFontSelector:
-          guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile );
-#if defined( USE_OSD ) || defined( USE_SUB )
-	  guiLoadFont();
-#endif
-	  if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
-	  break;
-  }
+	GValue params[2];
+	memset( params, 0, sizeof( params ) );
 
- HideFileSelect();
+		//This is never actually used but needs to be here anyway.
+  g_value_init( &params[0], G_TYPE_OBJECT ); 
 
- item=fsTopList_items;
- while( item )
-  {
-   if ( !strcmp( item->data,fsSelectedDirectory ) ) i=0;
-   item=item->next;
-  }
- if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
- if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); }
-  else guiGetEvent( guiCEvent,guiSetStop );
-}
+	GClosure* ok_handler = (GClosure*)user_data;
+  g_closure_invoke (ok_handler, NULL, 2, params, NULL);
 
-void fs_Cancel_released( GtkButton * button,gpointer user_data )
-{
- HideFileSelect();
- fs_PersistantHistory( get_current_dir_name() );      //totem, write into history file
-}
+	g_closure_unref( ok_handler );
+  g_value_unset( &params[0] );
 
-void fs_fsFNameList_select_row( GtkWidget * widget,gint row,gint column,GdkEventButton *bevent,gpointer user_data )
-{
- gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile );
- fsPressed=1;
- if( bevent && bevent->type == GDK_BUTTON_PRESS )  gtk_button_released( GTK_BUTTON( fsOk ) );
-}
+	gtk_widget_destroy( GTK_WIDGET( selector ) ); 
 
-gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
-{
- switch ( event->keyval )
+	if ( mplMainAutoPlay ) 
   {
-   case GDK_Escape:
-        gtk_button_released( GTK_BUTTON( fsCancel ) );
-        break;
-   case GDK_Return:
-        gtk_button_released( GTK_BUTTON( fsOk ) );
-        break;
-   case GDK_BackSpace:
-        gtk_button_released( GTK_BUTTON( fsUp ) );
-        break;
+		mplMainAutoPlay = 0; 
+		mplEventHandling( evPlay, 0 ); 
   }
- return FALSE;
-}
-
-GtkWidget * create_FileSelect( void )
-{
- GtkWidget     * FSFrame;
- GtkWidget     * frame2;
- GtkWidget     * frame3;
- GtkWidget     * frame4;
- GtkWidget     * vbox4;
- GtkWidget     * hbox4;
- GtkWidget     * vseparator1;
- GtkWidget     * hseparator1;
- GtkWidget     * hbox6;
- GtkWidget     * fsFNameListWindow;
- GtkWidget     * label1;
- GtkWidget     * hseparator2;
- GtkWidget     * hseparator3;
- GtkWidget     * hbuttonbox3;
-
- GtkWidget     * uppixmapwid;
- GdkPixmap     * uppixmap;
- GdkBitmap     * upmask;
- GtkStyle      * upstyle;
-
-
- fsFileSelect=gtk_window_new( GTK_WINDOW_TOPLEVEL );
- gtk_widget_set_name( fsFileSelect,"fsFileSelect" );
- gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect );
- gtk_widget_set_usize( fsFileSelect,512,300 );
- GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_DEFAULT );
- gtk_widget_set_events( fsFileSelect,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
- gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
- gtk_window_set_position( GTK_WINDOW( fsFileSelect ),GTK_WIN_POS_CENTER );
- gtk_window_set_policy( GTK_WINDOW( fsFileSelect ),TRUE,TRUE,TRUE );
- gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),"FileSelect","MPlayer" );
- fsColorMap=gdk_colormap_get_system();
- 
- gtk_widget_realize( fsFileSelect );
- gtkAddIcon( fsFileSelect );
-
- style=gtk_widget_get_style( fsFileSelect );
- dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm );
- fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm );
-
- vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 );
- hbox4=AddHBox( vbox4,1 );
-
- fsCombo4=gtk_combo_new();
- gtk_widget_set_name( fsCombo4,"fsCombo4" );
- gtk_widget_show( fsCombo4 );
- gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
- gtk_widget_set_usize( fsCombo4,-2,20 );
-
- fsPathCombo=GTK_COMBO( fsCombo4 )->entry;
- gtk_widget_set_name( fsPathCombo,"fsPathCombo" );
- gtk_widget_show( fsPathCombo );
- gtk_widget_set_usize( fsPathCombo,-2,20 );
-
- vseparator1=gtk_vseparator_new();
- gtk_widget_set_name( vseparator1,"vseparator1" );
- gtk_widget_show( vseparator1 );
- gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 );
- gtk_widget_set_usize( vseparator1,7,20 );
-
- upstyle=gtk_widget_get_style( fsFileSelect );
- uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm );
- uppixmapwid=gtk_pixmap_new( uppixmap,upmask );
- gtk_widget_show( uppixmapwid );
-
- fsUp=gtk_button_new();
- gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid );
- gtk_widget_show( fsUp );
- gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 );
- gtk_widget_set_usize( fsUp,65,15 );
-
- AddHSeparator( vbox4 );
-
- hbox6=AddHBox( NULL,0 );
-   gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 );
-
- fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL );
- gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" );
- gtk_widget_show( fsFNameListWindow );
- gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 );
- gtk_widget_set_usize( fsFNameListWindow,-2,145 );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
-
- fsFNameList=gtk_clist_new( 2 );
- gtk_widget_set_name( fsFNameList,"fsFNameList" );
- gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList );
- gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 );
- gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE );
- gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) );
- gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT );
-
- AddHSeparator( vbox4 );
-
- List=gtk_combo_new();
- gtk_widget_set_name( List,"List" );
- gtk_widget_ref( List );
- gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref );
- gtk_widget_show( List );
- gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 );
- gtk_widget_set_usize( List,-2,20 );
-
- fsFilterCombo=GTK_COMBO( List )->entry;
- gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" );
- gtk_widget_show( fsFilterCombo );
- gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE );
-
- AddHSeparator( vbox4 );
-
- hbuttonbox3=AddHButtonBox( vbox4 );
-   gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
-   gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );
-
- fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
- fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );
-
- gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&fsFileSelect );
- gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
-
- gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
- gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
- gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
- gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
- gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
- gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
- gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
- gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
-
- gtk_widget_grab_focus( fsFNameList );
-
- return fsFileSelect;
+	else 
+		guiGetEvent( guiCEvent,guiSetStop );
 }
-
--- Gui/mplayer/gtk/fs.h.orig	Tue Jan 21 16:33:39 2003
+++ Gui/mplayer/gtk/fs.h	Thu Jan  8 18:54:25 2004
@@ -11,11 +11,15 @@
 
 #include <errno.h>
 
-extern GtkWidget   * fsFileSelect;
 
-extern void HideFileSelect( void );
-extern void ShowFileSelect( int type, int modal );
+	//If ok_handler is NULL, the default handler for type 
+	//will be used.
+extern void ShowFileSelect( int type, GCallback ok_handler, int modal );
+//CJE3 extern void HideFileSelect( void );
 
-extern GtkWidget * create_FileSelect( void );
+	//selector will be set to the new file selector
+	//and will be automatically set to NULL when
+	//the selector is closed.
+extern void create_FileSelect( GtkWidget** selector, int type, GCallback ok_handler, int modal );
 
 #endif
--- Gui/mplayer/gtk/mb.c.orig	Thu Mar 20 15:42:14 2003
+++ Gui/mplayer/gtk/mb.c	Thu Jan  8 18:54:25 2004
@@ -3,8 +3,8 @@
 #include "../../../config.h"
 #include "../../../help_mp.h"
 
-#include "../pixmaps/error.xpm"
-#include "../pixmaps/warning.xpm"
+//#include "../pixmaps/error.xpm"
+//#include "../pixmaps/warning.xpm"
 
 #include "../widgets.h"
 #include "mb.h"
@@ -17,7 +17,8 @@
 {
  if ( MessageBox ) { gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); }
  MessageBox=create_MessageBox( 0 );
- if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
+ if ( strlen( msg ) < 20 ) gtk_window_set_default_size( GTK_WINDOW( MessageBox ),196,-1 );
+//CJE3 if ( strlen( msg ) < 20 ) gtk_widget_set_size_request( MessageBox,196,-1 );
 }
 
 static void on_Ok_released( GtkButton * button,gpointer user_data  )
@@ -35,19 +36,20 @@
  GtkWidget * Ok;
  GtkAccelGroup * accel_group;
  GtkStyle * pixmapstyle;
- GdkPixmap * pixmapwid;
- GdkBitmap * mask;
+ //GdkPixmap * pixmapwid;
+ //GdkBitmap * mask;
 
  accel_group=gtk_accel_group_new();
 
  MessageBox=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( MessageBox,"MessageBox" );
- gtk_object_set_data( GTK_OBJECT( MessageBox ),"MessageBox",MessageBox );
+ g_object_set_data( G_OBJECT( MessageBox ),"MessageBox",MessageBox );
  gtk_widget_set_events( MessageBox,GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
  gtk_window_set_title( GTK_WINDOW( MessageBox ),"MPlayer ..." );
  gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER );
  gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE );
- gtk_window_set_policy( GTK_WINDOW( MessageBox ),TRUE,TRUE,FALSE );
+ gtk_window_set_resizable( GTK_WINDOW( MessageBox ),TRUE );
+ gtk_window_set_resizable( GTK_WINDOW( MessageBox ),FALSE );
  gtk_window_set_wmclass( GTK_WINDOW( MessageBox ),"Message","MPlayer" );
  
  gtk_widget_realize( MessageBox );
@@ -58,21 +60,23 @@
 
  pixmapstyle=gtk_widget_get_style( MessageBox );
 
+/* CJE3 20030718: If I ever do this it will be after everything else is working flawlessly.
  pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )warning_xpm );
- WarningPixmap=gtk_pixmap_new( pixmapwid,mask );
+ WarningPixmap=gdk_pixmap_create_from_xpm_d( MessageBox->window,mask,NULL,(gchar ** )warning_xpm);
+//CJE3 WarningPixmap=gtk_pixmap_new( pixmapwid,mask );
  pixmapwid=gdk_pixmap_colormap_create_from_xpm_d( MessageBox->window,gdk_colormap_get_system(),&mask,&pixmapstyle->bg[GTK_STATE_NORMAL],(gchar ** )error_xpm );
  ErrorPixmap=gtk_pixmap_new( pixmapwid,mask );
 
  gtk_widget_set_name( WarningPixmap,"pixmap1" );
  gtk_widget_hide( WarningPixmap );
  gtk_box_pack_start( GTK_BOX( hbox1 ),WarningPixmap,FALSE,FALSE,0 );
- gtk_widget_set_usize( WarningPixmap,55,-2 );
+ gtk_widget_set_size_request( WarningPixmap,55,-1 );
 
  gtk_widget_set_name( ErrorPixmap,"pixmap1" );
  gtk_widget_hide( ErrorPixmap );
  gtk_box_pack_start( GTK_BOX( hbox1 ),ErrorPixmap,FALSE,FALSE,0 );
- gtk_widget_set_usize( ErrorPixmap,55,-2 );
-
+ gtk_widget_set_size_request( ErrorPixmap,55,-1 );
+*/
  gtkMessageBoxText=gtk_label_new( "Text jol. Ha ezt megerted,akkor neked nagyon jo a magyar tudasod,te." );
  gtk_widget_set_name( gtkMessageBoxText,"gtkMessageBoxText" );
  gtk_widget_show( gtkMessageBoxText );
@@ -88,8 +92,8 @@
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&MessageBox );
- gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
+ g_signal_connect( G_OBJECT( MessageBox ),"destroy",G_CALLBACK( WidgetDestroy ),&MessageBox );
+ g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( on_Ok_released ),NULL );
 
  gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
 
--- Gui/mplayer/gtk/menu.c.orig	Sat Feb  1 19:42:01 2003
+++ Gui/mplayer/gtk/menu.c	Thu Jan  8 18:54:25 2004
@@ -20,6 +20,8 @@
 void ActivateMenuItem( int Item )
 {
 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
+// fprintf( stderr,"[menu] item: %d\n",Item );
+	
  gtkPopupMenu=Item & 0x0000ffff;
  gtkPopupMenuParam=Item >> 16;
  mplEventHandling( Item & 0x0000ffff,Item >> 16 );
@@ -29,10 +31,10 @@
 {
  GtkWidget * Item = NULL;
  Item=gtk_check_menu_item_new_with_label( label );
- gtk_menu_append( GTK_MENU( Menu ),Item );
+ gtk_menu_shell_append( GTK_MENU_SHELL( Menu ),Item );
  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state);
- gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
-   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
+ g_signal_connect_swapped( G_OBJECT(Item),"activate",
+   G_CALLBACK(ActivateMenuItem),(gpointer)Number ); 
  gtk_widget_show( Item );
  return Item;
 }
@@ -37,15 +39,16 @@
  return Item;
 }
 
-
 GtkWidget * AddMenuItem( GtkWidget * Menu,char * label,int Number )
 {
- GtkWidget * Item = NULL;
- Item=gtk_menu_item_new_with_label( label );
- gtk_menu_append( GTK_MENU( Menu ),Item );
- gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
-   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
+ GtkWidget * Item = gtk_menu_item_new_with_label( label );;
+ gtk_menu_shell_append( GTK_MENU_SHELL( Menu ),Item );
+	
+ g_signal_connect_swapped( G_OBJECT(Item),"activate",
+   G_CALLBACK(ActivateMenuItem),(gpointer)Number ); 
+	
  gtk_widget_show( Item );
+	
  return Item;
 }
 
@@ -55,7 +58,7 @@
  GtkWidget * SubItem = NULL;
 
  SubItem=gtk_menu_item_new_with_label( label );
- gtk_menu_append( GTK_MENU( Menu ),SubItem );
+ gtk_menu_shell_append( GTK_MENU_SHELL( Menu ),SubItem );
  gtk_widget_show( SubItem );
 
  Item=gtk_menu_new();
@@ -66,12 +69,9 @@
 
 GtkWidget * AddSeparator( GtkWidget * Menu )
 {
- GtkWidget * Item = NULL;
-
- Item=gtk_menu_item_new ();
+	GtkWidget * Item = gtk_menu_item_new ();
+	gtk_menu_shell_append( GTK_MENU_SHELL( Menu ), Item );
  gtk_widget_show( Item );
- gtk_container_add( GTK_CONTAINER( Menu ),Item );
- gtk_widget_set_sensitive( Item,FALSE );
 
  return Item;
 }
@@ -191,10 +191,10 @@
            { lng( 'n','e' ), "Nepali"                     },
            { lng( 's','e' ), "NorthernSami"               },
            { lng( 'n','o' ), "Norwegian"                  },
-           { lng( 'n','b' ), "NorwegianBokmål"            },
+           { lng( 'n','b' ), "NorwegianBokmål"            },
            { lng( 'n','n' ), "NorwegianNynorsk"           },
            { lng( 'n','y' ), "Nyanja;Chichewa"            },
-           { lng( 'o','c' ), "Occitan(post1500;Provençal" },
+           { lng( 'o','c' ), "Occitan(post1500;Provençal" },
            { lng( 'o','r' ), "Oriya"                      },
            { lng( 'o','m' ), "Oromo"                      },
            { lng( 'o','s' ), "Ossetian;Ossetic"           },
@@ -203,7 +203,7 @@
            { lng( 'f','a' ), "Persian"                    },
            { lng( 'p','l' ), "Polish"                     },
            { lng( 'p','t' ), "Portuguese"                 },
-           { lng( 'o','c' ), "Provençal;Occitan(post1500" },
+           { lng( 'o','c' ), "Provençal;Occitan(post1500" },
            { lng( 'p','s' ), "Pushto"                     },
            { lng( 'q','u' ), "Quechua"                    },
            { lng( 'r','m' ), "Raeto-Romance"              },
@@ -247,7 +247,7 @@
            { lng( 'u','r' ), "Urdu"                       },
            { lng( 'u','z' ), "Uzbek"                      },
            { lng( 'v','i' ), "Vietnamese"                 },
-           { lng( 'v','o' ), "Volapük"                    },
+           { lng( 'v','o' ), "Volapük"                    },
            { lng( 'c','y' ), "Welsh"                      },
            { lng( 'w','o' ), "Wolof"                      },
            { lng( 'x','h' ), "Xhosa"                      },
@@ -286,7 +286,7 @@
  GtkWidget * Menu = NULL;
  GtkWidget * SubMenu = NULL;
  GtkWidget * MenuItem = NULL;
- GtkWidget * N, * D, * F;
+ GtkWidget * N = NULL, * D = NULL, * F = NULL;
 
  Menu=gtk_menu_new();
 
@@ -486,9 +486,18 @@
 
   if ( !gtkShowVideoWindow && !guiIntfStruct.Playing )
    {
+			 //CJE3 TODO: Just for curiousity's sake.
+//		 if( N && D && F ) 
+//		 {
     gtk_widget_set_sensitive( N,FALSE );
     gtk_widget_set_sensitive( D,FALSE );
     gtk_widget_set_sensitive( F,FALSE );
+//		 }
+//		 else
+//		 {
+				 //TODO: use mplayer's function.
+//			 g_printf( "In create_PopUpMenu: attempted to use NULL N, D or F.\n" );
+//		 }
    }
 
   AddSeparator( Menu );
--- Gui/mplayer/gtk/mp_pl.c.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/mp_pl.c	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,153 @@
+/* mp_pl.c
+ *
+ * July 29, 2003.
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+//Functions to manipulate the playlist.
+
+//TODO: study play_tree.
+
+
+#include "mp_pl.h"
+//#include "../../interface.h"
+#include "../widgets.h"
+
+
+	//PRE: prev != NULL,
+	//					model != NULL,
+	//					i != NULL.
+plItem* append_item( plItem* prev, GtkTreeModel* model, GtkTreeIter* i )
+{
+	plItem* n = g_new0( plItem, 1 ); 
+	gtkGetList2( model, i, &n->name, &n->path );
+	
+	prev->next = n;
+	n->prev = prev;
+
+	return n;
+}
+
+	//PRE: n != NULL,
+	//					model != NULL,
+	//					i != NULL.
+void update_item( plItem* n, GtkTreeModel* model, GtkTreeIter* i )
+{
+	g_free( n->name );
+	g_free( n->path );
+	gtkGetList2( model, i, &n->name, &n->path );
+}
+
+//-----
+
+void mp_playlist_load( GtkTreeModel* playlist, plItem* list )
+{
+	while( list )
+	{
+		gtkAppendList2( playlist, list->name, list->path );
+		
+		list = list->next;
+	}
+}
+
+plItem* mp_playlist_generate( GtkTreeModel* playlist )
+{
+	GtkTreeIter i;
+	plItem* head = NULL;
+
+	if( gtk_tree_model_get_iter_first( playlist, &i ) ) 
+	{
+		head = g_new0( plItem, 1 );
+	
+		gtkGetList2( playlist, &i, &head->name, &head->path );
+
+		plItem* temp = head;
+		while( gtk_tree_model_iter_next( playlist, &i ) )
+		{
+			temp = append_item( temp, playlist, &i );
+		}
+	}
+	
+	return head;
+}
+
+	//Untested.  I want to make it slightly more
+	//advanced: items were only added at the end,
+	//or at postion x, etc...
+void mp_playlist_update( plItem** h, GtkTreeModel* playlist )
+{
+	plItem* temp = *h;
+
+	if( !temp )
+	{
+		*h = mp_playlist_generate( playlist );
+	}
+	else
+	{
+		GtkTreeIter i;
+		plItem* head = temp, 
+								* last = temp;
+		gboolean more = gtk_tree_model_get_iter_first( playlist, &i );
+		
+		while( temp && more )
+		{
+			update_item( temp, playlist, &i );
+
+			last = temp;
+			temp = temp->next;
+			more = gtk_tree_model_iter_next( playlist, &i );
+		}
+		
+		if( temp )
+		{
+			if( temp->prev )
+				temp->prev->next = NULL;
+			else
+				head = NULL;
+			
+			mp_playlist_free( &temp );
+		}
+		
+		while( more )
+		{
+			last = append_item( last, playlist, &i );
+			more = gtk_tree_model_iter_next( playlist, &i );
+		}
+
+		*h = head;
+	}	
+}
+
+void mp_playlist_free( plItem** h )
+{
+	plItem* temp, 
+						* head = *h;
+	
+	while( head )
+	{
+		g_free( head->name );
+		g_free( head->path );
+		
+		temp = head;
+		head = head->next;
+		
+		g_free( temp );
+	}
+	
+	*h = NULL;
+}
--- Gui/mplayer/gtk/mp_pl.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/mp_pl.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,40 @@
+/* mp_pl.h
+ *
+ * July 29, 2003.
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+//Functions to manipulate the playlist.
+
+
+#ifndef GUI_MP_PL_H
+#define GUI_MP_PL_H
+
+#include <gtk/gtk.h>
+#include "../../interface.h"
+
+
+//typedef struct _plItem plItem;
+
+void mp_playlist_load( GtkTreeModel* playlist, plItem* list );
+plItem* mp_playlist_generate( GtkTreeModel* playlist );
+void mp_playlist_update( plItem** h, GtkTreeModel* playlist );
+void mp_playlist_free( plItem** h );
+
+
+#endif //GUI_MP_PL_H
--- Gui/mplayer/gtk/opts.c.orig	Sun May 25 21:25:59 2003
+++ Gui/mplayer/gtk/opts.c	Thu Jan  8 18:54:25 2004
@@ -28,7 +28,7 @@
 #include "../../../libmpcodecs/vd.h"
 #include "../../../libmpcodecs/ad.h"
 
-       GtkWidget * Preferences = NULL;
+GtkWidget * Preferences = NULL;
 static GtkWidget * AConfig;
 static GtkWidget * VConfig;
 //static GtkWidget * BLoadSubtitle;
@@ -148,8 +148,8 @@
 #endif
 	    
 static int    old_audio_driver = 0;
-static char * ao_driver[3];
-static char * vo_driver[3];
+static char * ao_driver;
+static char * vo_driver;
 static int    old_video_driver = 0;
 
 #ifdef USE_OSS_AUDIO
@@ -166,7 +166,7 @@
 #endif
 static gboolean prHScaler( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data );
 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data );
-static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data );
+static void prCListRow( GtkTreeSelection *selection, gpointer* type );
 #if defined( HAVE_FREETYPE ) || defined( USE_ICONV )
 static void prEntry( GtkContainer * container,gpointer user_data );
 #endif
@@ -174,6 +174,22 @@
 extern int    muted;
 extern int    stop_xscreensaver;
 
+gboolean select_row_and_get( GtkTreeView *view, guint row, gchar** result  )
+{
+	GtkTreeIter i;
+	gboolean successful = FALSE;
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
+	
+	gtkSelectListRow( view, row );
+	if( gtk_tree_selection_get_selected( selection, NULL, &i ) )
+	{
+		gtk_tree_model_get( gtk_tree_view_get_model( view ), &i, 0/*column*/, result, -1 );
+		successful = TRUE;
+	}	
+	
+	return successful;
+}
+
 void ShowPreferences( void )
 {
  if ( Preferences ) gtkActive( Preferences );
@@ -189,9 +205,8 @@
  gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul );
  {
   int    i = 0;
-  char * tmp[3]; tmp[2]="";
   old_audio_driver=-1;
-  if ( CLADrivers ) gtk_clist_clear( GTK_CLIST( CLADrivers ) );
+  if ( CLADrivers ) gtkClearList( GTK_TREE_VIEW( CLADrivers ) );
   while ( audio_out_drivers[i] )
    {
     const ao_info_t *info = audio_out_drivers[i++]->info;
@@ -204,19 +219,22 @@
       if ( !gstrcmp( name,(char *)info->short_name ) ) old_audio_driver=i - 1;
       free( name );
      }
-    tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
+			
+			gtkAppendListN( GTK_TREE_VIEW( CLADrivers ), 0, info->short_name ); //TODO: create and use column ids.
+			gtkSetListN( GTK_TREE_VIEW( CLADrivers ), i - 1, 1, info->name ); //Same.
    }
   if ( old_audio_driver > -1 )
    {
-    gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 );
-    gtk_clist_get_text( GTK_CLIST( CLADrivers ),old_audio_driver,0,(char **)&ao_driver );
+		 	if( select_row_and_get( GTK_TREE_VIEW( CLADrivers ), old_audio_driver, &ao_driver ) ) 
+			{
     gtk_widget_set_sensitive( AConfig,FALSE );
-#ifdef USE_OSS_AUDIO
-    if ( !strncmp( ao_driver[0],"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
-#endif
-#ifdef HAVE_SDL
-    if ( !strncmp( ao_driver[0],"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
-#endif
+				#ifdef USE_OSS_AUDIO
+				if ( !strncmp( ao_driver,"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+				#endif
+				#ifdef HAVE_SDL
+				if ( !strncmp( ao_driver,"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+				#endif
+			}
    }
  }
 
@@ -238,22 +256,30 @@
 
  {
   int i = 0, c = 0;
-  char * tmp[3]; tmp[2]="";
-  old_video_driver=0; 
-  if ( CLVDrivers ) gtk_clist_clear( GTK_CLIST( CLVDrivers ) );
+	guint column = 0;
+	old_video_driver=0;  //TODO: is this really supposed to be 0, or -1?
+  if ( CLVDrivers ) gtkClearList( GTK_TREE_VIEW( CLVDrivers ) );
   while ( video_out_drivers[i] )
    if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
     { 
+				//TODO: Is c really nec.? Like the c++, though. ;)
      if ( video_driver_list && !gstrcmp( video_driver_list[0],(char *)video_out_drivers[i - 1]->info->short_name ) ) old_video_driver=c; c++;
-     tmp[0]=(char *)video_out_drivers[i - 1]->info->short_name; tmp[1]=(char *)video_out_drivers[i - 1]->info->name; 
-     gtk_clist_append( GTK_CLIST( CLVDrivers ),tmp );
+				
+			gtkAppendListN( GTK_TREE_VIEW( CLVDrivers ), 0, video_out_drivers[i - 1]->info->short_name );
+			gtkSetListN( GTK_TREE_VIEW( CLVDrivers ), column, 1, video_out_drivers[i - 1]->info->name );
+			++column;
     }
-  gtk_clist_select_row( GTK_CLIST( CLVDrivers ),old_video_driver,0 );
-  gtk_clist_get_text( GTK_CLIST( CLVDrivers ),old_video_driver,0,(char **)&vo_driver );
+
+//  if ( old_audio_driver > -1 )
+//   {
+		if( select_row_and_get( GTK_TREE_VIEW( CLVDrivers ), old_video_driver, &vo_driver ) )
+		{
   gtk_widget_set_sensitive( VConfig,FALSE );
-#ifdef HAVE_DXR3
-  if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE );
-#endif
+			#ifdef HAVE_DXR3
+			if ( !gstrcmp( vo_driver,"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE );
+			#endif
+		}
+//	}
  }
  
   gtk_adjustment_set_value( HSFPSadj,force_fps );
@@ -413,40 +439,45 @@
 #endif
 
 // -- signals
- gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
- gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 );
- gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 );
+ g_signal_connect( G_OBJECT( CBExtraStereo ),"toggled",G_CALLBACK( prToggled ),(void*)0 );
+ g_signal_connect( G_OBJECT( CBNormalize ),"toggled",G_CALLBACK( prToggled ),(void*)1 );
+ g_signal_connect( G_OBJECT( CBAudioEqualizer ),"toggled",G_CALLBACK( prToggled ),(void*)2 );
+ g_signal_connect( G_OBJECT( CBShowVideoWindow ),"toggled",G_CALLBACK( prToggled ), (void*)3 );
 #ifdef HAVE_FREETYPE
- gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)4 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleHeight ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)5 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)6 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)7 );
-#endif
- gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)8);
- gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)9);
-
- gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)1 );
- gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)2 );
- gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)3 );
- gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)4 );
+ g_signal_connect( G_OBJECT( RBFontNoAutoScale ),"toggled",G_CALLBACK( prToggled ),(void*)4 );
+ g_signal_connect( G_OBJECT( RBFontAutoScaleHeight ),"toggled",G_CALLBACK( prToggled ),(void*)5 );
+ g_signal_connect( G_OBJECT( RBFontAutoScaleWidth ),"toggled",G_CALLBACK( prToggled ),(void*)6 );
+ g_signal_connect( G_OBJECT( RBFontAutoScaleDiagonal ),"toggled",G_CALLBACK( prToggled ),(void*)7 );
+#endif
+ g_signal_connect( G_OBJECT( CBCache ),"toggled",G_CALLBACK( prToggled ),(void*)8);
+ g_signal_connect( G_OBJECT( CBAutoSync ),"toggled",G_CALLBACK( prToggled ),(void*)9);
+
+ g_signal_connect( G_OBJECT( HSExtraStereoMul ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)0 );
+ g_signal_connect( G_OBJECT( HSAudioDelay ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)1 );
+ g_signal_connect( G_OBJECT( HSPanscan ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)2 );
+ g_signal_connect( G_OBJECT( HSSubDelay ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)3 );
+ g_signal_connect( G_OBJECT( HSSubPosition ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)4 );
 #ifndef HAVE_FREETYPE
- gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)5 );
+ g_signal_connect( G_OBJECT( HSFontFactor ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)5 );
 #else
- gtk_signal_connect( GTK_OBJECT( HSFontBlur ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)6 );
- gtk_signal_connect( GTK_OBJECT( HSFontOutLine ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)7 );
- gtk_signal_connect( GTK_OBJECT( HSFontTextScale ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)8 );
- gtk_signal_connect( GTK_OBJECT( HSFontOSDScale ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)9 );
- gtk_signal_connect( GTK_OBJECT( EFontEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)0 );
+ g_signal_connect( G_OBJECT( HSFontBlur ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)6 );
+ g_signal_connect( G_OBJECT( HSFontOutLine ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)7 );
+ g_signal_connect( G_OBJECT( HSFontTextScale ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)8 );
+ g_signal_connect( G_OBJECT( HSFontOSDScale ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)9 );
+ g_signal_connect( G_OBJECT( EFontEncoding ),"changed",G_CALLBACK( prEntry ),(void *)0 );
 #endif
 #ifdef USE_ICONV
- gtk_signal_connect( GTK_OBJECT( ESubEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)1 );
+ g_signal_connect( G_OBJECT( ESubEncoding ),"changed",G_CALLBACK( prEntry ),(void *)1 );
 #endif
- gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( prHScaler ),(void*)10 );
+ g_signal_connect( G_OBJECT( HSPPQuality ),"motion_notify_event",G_CALLBACK( prHScaler ),(void*)10 );
  
- gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 );
+	{
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( CLADrivers ) );
+	g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( prCListRow ), (void*)0 );
+
+	selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( CLVDrivers ) );
+	g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( prCListRow ), (void*)1 );
+	}
 
  gtk_widget_show( Preferences );
  gtkSetLayer( Preferences );
@@ -525,8 +556,8 @@
 	gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
 	audio_delay=HSAudioDelayadj->value;
 
-	gaddlist( &audio_driver_list,ao_driver[0] );
-	gaddlist( &video_driver_list,vo_driver[0] );
+	gaddlist( &audio_driver_list,ao_driver );
+	gaddlist( &video_driver_list,vo_driver );
 
 	// -- 2. page
 	vo_doublebuffering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) );
@@ -614,20 +645,20 @@
 	HidePreferences();
 	break;
    case bAConfig:
-	if ( !ao_driver[0] ) break;
+	if ( !ao_driver ) break;
         gtk_widget_set_sensitive( AConfig,FALSE );
 #ifdef USE_OSS_AUDIO
-        if ( !strncmp( ao_driver[0],"oss",3 ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
+        if ( !strncmp( ao_driver,"oss",3 ) ) { ShowOSSConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
 #endif
 #ifdef HAVE_SDL
-        if ( !strncmp( ao_driver[0],"sdl",3 ) ) { ShowSDLConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
+        if ( !strncmp( ao_driver,"sdl",3 ) ) { ShowSDLConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); }
 #endif
 	break;
    case bVconfig:
-	if ( !vo_driver[0] ) break;
+	if ( !vo_driver ) break;
         gtk_widget_set_sensitive( VConfig,FALSE );
 #ifdef HAVE_DXR3
-	if ( !gstrcmp( vo_driver[0],"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); }
+	if ( !gstrcmp( vo_driver,"dxr3" ) ) { ShowDXR3Config(); gtk_widget_set_sensitive( VConfig,TRUE ); }
 #endif
 	break;
 #if 0
@@ -635,8 +666,7 @@
 	break;
 #endif
    case bLFont:
-        ShowFileSelect( fsFontSelector,FALSE );
-	gtkSetLayer( fsFileSelect );
+        ShowFileSelect( fsFontSelector, NULL, FALSE );
 	break;
   }
 }
@@ -728,35 +758,45 @@
   }
 }
 
-static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
+static void prCListRow( GtkTreeSelection *selection, gpointer* type )
 {
- switch ( (int)user_data )
+	GtkTreeIter i;
+	GtkTreeModel *model;
+	if( gtk_tree_selection_get_selected( selection, &model, &i ) )
+	{
+//		gchar *driver;
+		switch ( (int)type )
   {
    case 0: // audio driver 
-	gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver ); 
+					//TODO: free ao_driver[0]?
+				gtk_tree_model_get( model, &i, 0, &ao_driver, -1 );
+/*				gtk_tree_model_get( model, &i, 0, &driver, -1 );
+				strcpy( ao_driver, driver );*/
+					
 	gtk_widget_set_sensitive( AConfig,FALSE );
-#ifdef USE_OSS_AUDIO
-	if ( !strncmp( ao_driver[0],"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
-#endif
-#ifdef HAVE_SDL
-	if ( !strncmp( ao_driver[0],"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
-#endif
+				#ifdef USE_OSS_AUDIO
+				if ( !strncmp( ao_driver,"oss",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+				#endif
+				#ifdef HAVE_SDL
+				if ( !strncmp( ao_driver,"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE );
+				#endif
 	break;
    case 1: // video driver 
-	gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver ); 
+					//TODO: free vo_driver[0]?
+				gtk_tree_model_get( model, &i, 0, &vo_driver, -1 );
+
 	gtk_widget_set_sensitive( VConfig,FALSE );
-#ifdef HAVE_DXR3
-	if ( !gstrcmp( vo_driver[0],"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE );
-#endif
+				#ifdef HAVE_DXR3
+				if ( !gstrcmp( vo_driver,"dxr3" ) ) gtk_widget_set_sensitive( VConfig,TRUE );
+				#endif
 	break;
   } 
+	}
 }
 
 GtkWidget * create_Preferences( void )
 {
   GtkWidget * label;
-  GtkWidget * frame;
-
   GtkWidget * vbox1;
   GtkWidget * notebook1;
   GtkWidget * hbox1;
@@ -792,15 +832,16 @@
   GtkWidget * hbox5;
   GtkWidget * hbuttonbox1;
   GtkAccelGroup * accel_group;
+	const gchar* column_headers[2] = { MSGTR_PREFERENCES_AvailableDrivers, "" };
 
   accel_group=gtk_accel_group_new();
 
   Preferences=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( Preferences,"Preferences" );
-  gtk_object_set_data( GTK_OBJECT( Preferences ),"Preferences",Preferences );
+  g_object_set_data( G_OBJECT( Preferences ),"Preferences",Preferences );
   gtk_window_set_title( GTK_WINDOW( Preferences ),MSGTR_Preferences );
   gtk_window_set_position( GTK_WINDOW( Preferences ),GTK_WIN_POS_CENTER );
-//  gtk_window_set_policy( GTK_WINDOW( Preferences ),FALSE,FALSE,FALSE );
+//  gtk_window_set_resizable( GTK_WINDOW( Preferences ),FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( Preferences ),"Preferences","MPlayer" );
   
   gtk_widget_realize( Preferences );
@@ -814,37 +855,25 @@
 
   hbox1=AddVBox( notebook1,0 );
 
-  frame=AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,1 );
-  frame=AddFrame( NULL,GTK_SHADOW_NONE,frame,1 );
-
 // --- 1. page
 
-  vbox2=AddVBox( frame,0 );
-
+	vbox2=AddVBox( hbox1,0 );
   scrolledwindow3=gtk_scrolled_window_new( NULL,NULL );
   gtk_widget_set_name( scrolledwindow3,"scrolledwindow3" );
-  gtk_widget_show( scrolledwindow3 );
   gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 );
+  gtk_widget_show( scrolledwindow3 );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
 
-  CLADrivers=gtk_clist_new( 2 );
-  gtk_widget_set_name( CLADrivers,"CLADrivers" );
+	CLADrivers = gtkListNew( 2, column_headers, TRUE );
   gtk_widget_show( CLADrivers );
-  gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLADrivers );
-  gtk_clist_set_column_width( GTK_CLIST( CLADrivers ),0,50 );
-  gtk_clist_column_titles_show( GTK_CLIST( CLADrivers ) );
-  gtk_clist_set_shadow_type( GTK_CLIST( CLADrivers ),GTK_SHADOW_NONE );
-  gtk_widget_set_usize( CLADrivers,250,-2 );
-  gtk_clist_set_column_widget( GTK_CLIST( CLADrivers ),0,
-    AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL ) );
+  gtk_container_add( GTK_CONTAINER( scrolledwindow3 ), CLADrivers );
 
   AConfig=AddButton( MSGTR_ConfigDriver,
     AddHButtonBox( vbox2 ) );
 
-  vbox3=AddVBox( 
-    AddFrame( NULL,GTK_SHADOW_NONE,
-      AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox1,0 ),1 ),0 );
-    gtk_widget_set_usize( vbox3,250,-2 );
+  vbox3=AddVBox( hbox1, 0 );
+
+	gtk_widget_set_size_request( vbox3,250,-1 );
 
   CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 );
   CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnEqualizer,vbox3 );
@@ -873,9 +902,7 @@
 
   hbox2=AddVBox( notebook1,0 );
 
-  vbox4=AddVBox( 
-    AddFrame( NULL,GTK_SHADOW_NONE,
-      AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,1 ),1 ),0 );
+  vbox4=AddVBox( hbox2, 0 );
 
   scrolledwindow2=gtk_scrolled_window_new( NULL,NULL );
   gtk_widget_set_name( scrolledwindow2,"scrolledwindow2" );
@@ -883,25 +910,16 @@
   gtk_box_pack_start( GTK_BOX( vbox4 ),scrolledwindow2,TRUE,TRUE,0 );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
 
-  CLVDrivers=gtk_clist_new( 2 );
-  gtk_widget_set_name( CLVDrivers,"CLVDrivers" );
+	CLVDrivers = gtkListNew( 2, column_headers, TRUE );
   gtk_widget_show( CLVDrivers );
-  gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLVDrivers );
-  gtk_clist_set_column_width( GTK_CLIST( CLVDrivers ),0,50 );
-  gtk_clist_column_titles_show( GTK_CLIST( CLVDrivers ) );
-  gtk_clist_set_shadow_type( GTK_CLIST( CLVDrivers ),GTK_SHADOW_NONE );
-  gtk_widget_set_usize( CLVDrivers,250,-2 );
-
-  label=AddLabel( MSGTR_PREFERENCES_AvailableDrivers,NULL );
-    gtk_clist_set_column_widget( GTK_CLIST( CLVDrivers ),0,label );
+  gtk_container_add( GTK_CONTAINER( scrolledwindow2 ), CLVDrivers );
 
   hbuttonbox3=AddHButtonBox( vbox4 );
   VConfig=AddButton( MSGTR_ConfigDriver,hbuttonbox3 );
 
-  vbox5=AddVBox( 
-    AddFrame( NULL,GTK_SHADOW_NONE,
-      AddFrame( NULL,GTK_SHADOW_ETCHED_OUT,hbox2,0 ),1 ),0 );
-    gtk_widget_set_usize( vbox5,250,-2 );
+  vbox5=AddVBox( hbox2, 0 );
+
+	gtk_widget_set_size_request( vbox5,250,-1 );
 
   CBDoubleBuffer=AddCheckButton( MSGTR_PREFERENCES_DoubleBuffer,vbox5 );
   CBDR=AddCheckButton( MSGTR_PREFERENCES_DirectRender,vbox5 );
@@ -999,7 +1017,7 @@
   HSSubFPS=gtk_spin_button_new( GTK_ADJUSTMENT( HSSubFPSadj ),1,3 );
     gtk_widget_set_name( HSSubFPS,"HSSubFPS" );
     gtk_widget_show( HSSubFPS );
-    gtk_widget_set_usize( HSSubFPS,60,-1 );
+    gtk_widget_set_size_request( HSSubFPS,60,-1 );
     gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( HSSubFPS ),TRUE );
     gtk_table_attach( GTK_TABLE( table1 ),HSSubFPS,1,2,2,3,(GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
 
@@ -1018,7 +1036,7 @@
 
   ESubEncoding=GTK_COMBO( CBSubEncoding )->entry;
   gtk_widget_set_name( ESubEncoding,"ESubEncoding" );
-  gtk_entry_set_editable( GTK_ENTRY( ESubEncoding ),FALSE );
+  gtk_editable_set_editable( GTK_EDITABLE( ESubEncoding ),FALSE );
   gtk_widget_show( ESubEncoding );
 #endif
 
@@ -1083,7 +1101,7 @@
 
   EFontEncoding=GTK_COMBO( CBFontEncoding )->entry;
   gtk_widget_set_name( EFontEncoding,"EFontEncoding" );
-  gtk_entry_set_editable( GTK_ENTRY( EFontEncoding ),FALSE );
+  gtk_editable_set_editable( GTK_EDITABLE( EFontEncoding ),FALSE );
   gtk_widget_show( EFontEncoding );
 
   label=AddLabel( MSGTR_PREFERENCES_FontBlur,NULL );
@@ -1140,7 +1158,7 @@
 
   EVFM=GTK_COMBO( CBVFM )->entry;
   gtk_widget_set_name( EVFM,"CEVFM" );
-  gtk_entry_set_editable( GTK_ENTRY( EVFM ),FALSE );
+  gtk_editable_set_editable( GTK_EDITABLE( EVFM ),FALSE );
   gtk_widget_show( EVFM );
 
   hbox5=AddHBox( vbox602,1 );
@@ -1154,7 +1172,7 @@
 
   EAFM=GTK_COMBO( CBAFM )->entry;
   gtk_widget_set_name( EAFM,"EAFM" );
-  gtk_entry_set_editable( GTK_ENTRY( EAFM ),FALSE );
+  gtk_editable_set_editable( GTK_EDITABLE( EAFM ),FALSE );
   gtk_widget_show( EAFM );
 
   label=AddLabel( MSGTR_PREFERENCES_Codecs,NULL );
@@ -1245,60 +1263,60 @@
 
   hbuttonbox1=AddHButtonBox( vbox1 );
     gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
+    gtk_box_set_spacing( GTK_BOX( hbuttonbox1 ),10 );
   BOk=AddButton( MSGTR_Ok,hbuttonbox1 );
   BCancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
   
   gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Preferences );
+  g_signal_connect( G_OBJECT( Preferences ),"destroy",G_CALLBACK( WidgetDestroy ),&Preferences );
   
-  gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig );
-  gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk );
-  gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel );
-  gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig );
+  g_signal_connect( G_OBJECT( AConfig ),"clicked",G_CALLBACK( prButton ),(void*)bAConfig );
+  g_signal_connect( G_OBJECT( BOk ),"clicked",G_CALLBACK( prButton ),(void*)bOk );
+  g_signal_connect( G_OBJECT( BCancel ),"clicked",G_CALLBACK( prButton ),(void*)bCancel );
+  g_signal_connect( G_OBJECT( VConfig ),"clicked",G_CALLBACK( prButton ),(void*)bVconfig );
 #if 0
-  gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle );
+  g_signal_connect( G_OBJECT( BLoadSubtitle ),"clicked",G_CALLBACK( prButton ),(void*)bLSubtitle );
 #endif
-  gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont );
+  g_signal_connect( G_OBJECT( BLoadFont ),"clicked",G_CALLBACK( prButton ),(void*)bLFont );
 
 #if 0
-  gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBDR ),"toggled",GTK_SIGNAL_FUNC( on_CBDR_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBFramedrop_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBHFramedrop ),"toggled",GTK_SIGNAL_FUNC( on_CBHFramedrop_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBFullScreen ),"toggled",GTK_SIGNAL_FUNC( on_CBFullScreen_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBNonInterlaved ),"toggled",GTK_SIGNAL_FUNC( on_CBNonInterlaved_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBFlip ),"toggled",GTK_SIGNAL_FUNC( on_CBFlip_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBPostprocess ),"toggled",GTK_SIGNAL_FUNC( on_CBPostprocess_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBNoAutoSub ),"toggled",GTK_SIGNAL_FUNC( on_CBNoAutoSub_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBSubUnicode ),"toggled",GTK_SIGNAL_FUNC( on_CNSubUnicode_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBDumpMPSub ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpMPSub_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBDumpSrt ),"toggled",GTK_SIGNAL_FUNC( on_CBDumpSrt_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBNormalize ),"toggled",G_CALLBACK( on_CBNormalize_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBSurround ),"toggled",G_CALLBACK( on_CBSurround_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBExtraStereo ),"toggled",G_CALLBACK( on_CBExtraStereo_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBDoubleBuffer ),"toggled",G_CALLBACK( on_CBDoubleBuffer_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBDR ),"toggled",G_CALLBACK( on_CBDR_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBFramedrop ),"toggled",G_CALLBACK( on_CBFramedrop_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBHFramedrop ),"toggled",G_CALLBACK( on_CBHFramedrop_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBFullScreen ),"toggled",G_CALLBACK( on_CBFullScreen_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBNonInterlaved ),"toggled",G_CALLBACK( on_CBNonInterlaved_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBFlip ),"toggled",G_CALLBACK( on_CBFlip_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBPostprocess ),"toggled",G_CALLBACK( on_CBPostprocess_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBNoAutoSub ),"toggled",G_CALLBACK( on_CBNoAutoSub_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBSubUnicode ),"toggled",G_CALLBACK( on_CNSubUnicode_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBDumpMPSub ),"toggled",G_CALLBACK( on_CBDumpMPSub_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBDumpSrt ),"toggled",G_CALLBACK( on_CBDumpSrt_toggled ),NULL );
 #endif
 #if 0
-  gtk_signal_connect( GTK_OBJECT( RBOSDNone ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDNone_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( RBOSDTandP ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDTandP_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( RBOSDIndicator ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( RBOSDTPTT ),"toggled",GTK_SIGNAL_FUNC( on_RBOSDIndicator_toggled ),NULL );
-  gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( on_CBAudioEqualizer_toggled ),NULL );
+  g_signal_connect( G_OBJECT( RBOSDNone ),"toggled",G_CALLBACK( on_RBOSDNone_toggled ),NULL );
+  g_signal_connect( G_OBJECT( RBOSDTandP ),"toggled",G_CALLBACK( on_RBOSDTandP_toggled ),NULL );
+  g_signal_connect( G_OBJECT( RBOSDIndicator ),"toggled",G_CALLBACK( on_RBOSDIndicator_toggled ),NULL );
+  g_signal_connect( G_OBJECT( RBOSDTPTT ),"toggled",G_CALLBACK( on_RBOSDIndicator_toggled ),NULL );
+  g_signal_connect( G_OBJECT( CBAudioEqualizer ),"toggled",G_CALLBACK( on_CBAudioEqualizer_toggled ),NULL );
 #endif
 #if 0
-  gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSAudioDelay_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPanscan_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( label2 ),"motion_notify_event",GTK_SIGNAL_FUNC( on_label2_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubDelay_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubPosition_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSSubFPS ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSSubFPS_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSFontFactor_motion_notify_event ),NULL );
-  gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion_notify_event",GTK_SIGNAL_FUNC( on_HSPPQuality_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSAudioDelay ),"motion_notify_event",G_CALLBACK( on_HSAudioDelay_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSPanscan ),"motion_notify_event",G_CALLBACK( on_HSPanscan_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( label2 ),"motion_notify_event",G_CALLBACK( on_label2_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSSubDelay ),"motion_notify_event",G_CALLBACK( on_HSSubDelay_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSSubPosition ),"motion_notify_event",G_CALLBACK( on_HSSubPosition_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSSubFPS ),"motion_notify_event",G_CALLBACK( on_HSSubFPS_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSFontFactor ),"motion_notify_event",G_CALLBACK( on_HSFontFactor_motion_notify_event ),NULL );
+  g_signal_connect( G_OBJECT( HSPPQuality ),"motion_notify_event",G_CALLBACK( on_HSPPQuality_motion_notify_event ),NULL );
 #endif
 
-  gtk_notebook_set_page( GTK_NOTEBOOK( notebook1 ),2 );
+  gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook1 ),2 );
 
   gtk_window_add_accel_group( GTK_WINDOW( Preferences ),accel_group );
 
@@ -1361,11 +1379,11 @@
 
   OSSConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( OSSConfig,"OSSConfig" );
-  gtk_object_set_data( GTK_OBJECT( OSSConfig ),"OSSConfig",OSSConfig );
-  gtk_widget_set_usize( OSSConfig,270,92 );
+  g_object_set_data( G_OBJECT( OSSConfig ),"OSSConfig",OSSConfig );
+  gtk_widget_set_size_request( OSSConfig,270,92 );
   gtk_window_set_title( GTK_WINDOW( OSSConfig ),MSGTR_OSSPreferences );
   gtk_window_set_position( GTK_WINDOW( OSSConfig ),GTK_WIN_POS_CENTER );
-  gtk_window_set_policy( GTK_WINDOW( OSSConfig ),FALSE,FALSE,FALSE );
+	gtk_window_set_resizable( GTK_WINDOW( OSSConfig ),FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( OSSConfig ),"OSS Config","MPlayer" );
 
   gtk_widget_realize( OSSConfig );
@@ -1444,14 +1462,14 @@
 
   hbuttonbox6=AddHButtonBox( vbox604 );
     gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox6 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox6 ),10 );
+    gtk_box_set_spacing( GTK_BOX( hbuttonbox6 ),10 );
   BOssOk=AddButton( MSGTR_Ok,hbuttonbox6 );
   BOssCancel=AddButton( MSGTR_Cancel,hbuttonbox6 );
 
-  gtk_signal_connect( GTK_OBJECT( OSSConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&OSSConfig );
+  g_signal_connect( G_OBJECT( OSSConfig ),"destroy",G_CALLBACK( WidgetDestroy ),&OSSConfig );
   
-  gtk_signal_connect( GTK_OBJECT( BOssOk ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( BOssCancel ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)0 );
+  g_signal_connect( G_OBJECT( BOssOk ),"clicked",G_CALLBACK( ossButton ),(void*)1 );
+  g_signal_connect( G_OBJECT( BOssCancel ),"clicked",G_CALLBACK( ossButton ),(void*)0 );
 
   gtk_widget_add_accelerator( BOssOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( BOssCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
@@ -1515,11 +1533,11 @@
 
   SDLConfig=gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_widget_set_name( SDLConfig,"SDLConfig" );
-  gtk_object_set_data( GTK_OBJECT( SDLConfig ),"SDLConfig",SDLConfig );
-  gtk_widget_set_usize( SDLConfig,270,70 );
+  g_object_set_data( G_OBJECT( SDLConfig ),"SDLConfig",SDLConfig );
+  gtk_widget_set_size_request( SDLConfig,270,70 );
   gtk_window_set_title( GTK_WINDOW( SDLConfig ),MSGTR_SDLPreferences );
   gtk_window_set_position( GTK_WINDOW( SDLConfig ),GTK_WIN_POS_CENTER );
-  gtk_window_set_policy( GTK_WINDOW( SDLConfig ),FALSE,FALSE,FALSE );
+  gtk_window_set_resizable( GTK_WINDOW( SDLConfig ),FALSE );
   gtk_window_set_wmclass( GTK_WINDOW( SDLConfig ),"SDL Config","MPlayer" );
 
   gtk_widget_realize( SDLConfig );
@@ -1555,14 +1573,14 @@
 
   hbuttonbox6=AddHButtonBox( vbox604 );
     gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox6 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox6 ),10 );
+    gtk_box_set_spacing( GTK_BOX( hbuttonbox6 ),10 );
   BSDLOk=AddButton( MSGTR_Ok,hbuttonbox6 );
   BSDLCancel=AddButton( MSGTR_Cancel,hbuttonbox6 );
 
-  gtk_signal_connect( GTK_OBJECT( SDLConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&SDLConfig );
+  g_signal_connect( G_OBJECT( SDLConfig ),"destroy",G_CALLBACK( WidgetDestroy ),&SDLConfig );
   
-  gtk_signal_connect( GTK_OBJECT( BSDLOk ),"clicked",GTK_SIGNAL_FUNC( sdlButton ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( BSDLCancel ),"clicked",GTK_SIGNAL_FUNC( sdlButton ),(void*)0 );
+  g_signal_connect( G_OBJECT( BSDLOk ),"clicked",G_CALLBACK( sdlButton ),(void*)1 );
+  g_signal_connect( G_OBJECT( BSDLCancel ),"clicked",G_CALLBACK( sdlButton ),(void*)0 );
 
   gtk_widget_add_accelerator( BSDLOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( BSDLCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
@@ -1651,12 +1669,12 @@
 
  DXR3Config=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( DXR3Config,"DXR3Config" );
- gtk_object_set_data( GTK_OBJECT( DXR3Config ),"DXR3Config",DXR3Config );
-// gtk_widget_set_usize( DXR3Config,300,156 );
+ g_object_set_data( G_OBJECT( DXR3Config ),"DXR3Config",DXR3Config );
+ gtk_widget_set_size_request( DXR3Config,300,156 );
  GTK_WIDGET_SET_FLAGS( DXR3Config,GTK_CAN_DEFAULT );
  gtk_window_set_title( GTK_WINDOW( DXR3Config ),"DXR3/H+" );
  gtk_window_set_position( GTK_WINDOW( DXR3Config ),GTK_WIN_POS_CENTER );
- gtk_window_set_policy( GTK_WINDOW( DXR3Config ),FALSE,FALSE,FALSE );
+ gtk_window_set_resizable( GTK_WINDOW( DXR3Config ),FALSE );
  gtk_window_set_wmclass( GTK_WINDOW( DXR3Config ),"DXR3","MPlayer" );
 
  gtk_widget_realize( DXR3Config );
@@ -1707,10 +1725,10 @@
  gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&DXR3Config );
+ g_signal_connect( G_OBJECT( DXR3Config ),"destroy",G_CALLBACK( WidgetDestroy ),&DXR3Config );
  
- gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 );
- gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 );
+ g_signal_connect( G_OBJECT( dxr3BOk ),"clicked",G_CALLBACK( dxr3Button ),(void *)0 );
+ g_signal_connect( G_OBJECT( dxr3BCancel ),"clicked",G_CALLBACK( dxr3Button ),(void *)1 );
 
  gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group );
 
--- Gui/mplayer/gtk/pl.c.orig	Thu Apr  3 16:09:44 2003
+++ Gui/mplayer/gtk/pl.c	Thu Jan  8 18:54:25 2004
@@ -17,513 +17,49 @@
 #include "../../interface.h"
 #include "../widgets.h"
 #include "pl.h"
+#include "mp_pl.h"
 #include "common.h"
 
-static char * book_open_xpm[] = {
-	"16 16 4 1",
-	"       c None s None",
-	".      c black",
-	"X      c #808080",
-	"o      c white",
-	"                ",
-	"  ..            ",
-	" .Xo.    ...    ",
-	" .Xoo. ..oo.    ",
-	" .Xooo.Xooo...  ",
-	" .Xooo.oooo.X.  ",
-	" .Xooo.Xooo.X.  ",
-	" .Xooo.oooo.X.  ",
-	" .Xooo.Xooo.X.  ",
-	" .Xooo.oooo.X.  ",
-	"  .Xoo.Xoo..X.  ",
-	"   .Xo.o..ooX.  ",
-	"    .X..XXXXX.  ",
-	"    ..X.......  ",
-	"     ..         ",
-	"                "};
-
-static char * book_closed_xpm[] = {
-	"16 16 6 1",
-	"       c None s None",
-	".      c black",
-	"X      c red",
-	"o      c yellow",
-	"O      c #808080",
-	"#      c white",
-	"                ",
-	"       ..       ",
-	"     ..XX.      ",
-	"   ..XXXXX.     ",
-	" ..XXXXXXXX.    ",
-	".ooXXXXXXXXX.   ",
-	"..ooXXXXXXXXX.  ",
-	".X.ooXXXXXXXXX. ",
-	".XX.ooXXXXXX..  ",
-	" .XX.ooXXX..#O  ",
-	"  .XX.oo..##OO. ",
-	"   .XX..##OO..  ",
-	"    .X.#OO..    ",
-	"     ..O..      ",
-	"      ..        ",
-	"                "};
-
-       GtkWidget * PlayList = NULL;
-static GtkWidget * CTDirTree;
-static GtkWidget * CLFiles;
-static GtkWidget * CLSelected;
-static GtkWidget * Add;
-static GtkWidget * Remove;
-static GtkWidget * Ok;
-static GtkWidget * Cancel;
-static GdkPixmap * pxOpenedBook;
-static GdkPixmap * pxClosedBook;
-static GdkBitmap * msOpenedBook;
-static GdkBitmap * msClosedBook;
-
-static int   NrOfEntrys = 0;
-static int   NrOfSelected = 0;
-static int * CLFileSelected = NULL;
-static int * CLListSelected = NULL;
+#include "playlist.h"
+#include "playlist_create.h"
 
-static int sigSel;
-static int sigUnsel;
 
-typedef struct
-{
- int    scaned;
- char * path;
-} DirNodeType;
-
-static GtkCTreeNode * sibling;
-static GtkCTreeNode * parent;
-static gchar        * current_path;
-static gchar        * old_path = NULL;
-
-static int compare_func(const void *a, const void *b)
-{
- char * tmp;
- int    i;
- if ( !a || !b || !( (DirNodeType *)a )->path ) return -1;
- tmp=strdup( (char *)b ); tmp[strlen( tmp )-1]=0;
- i=strcmp( ( (DirNodeType *)a )->path,tmp );
- free( tmp );
- return i;
-}
+GtkWidget* PlayList = NULL;
 
-static void scan_dir( char * path );
 
 void ShowPlayList( void )
 {
- if ( PlayList ) gtkActive( PlayList );
-  else PlayList=create_PlayList();
-
- if ( old_path && *old_path )
-  {
-   char         * currentdir = strdup( old_path );
-   char         * tpath,* pos;
-   GtkCTreeNode * node,* nextnode;
-   gboolean       leaf;
-   tpath=strdup( "/" );
-   pos=strtok( currentdir,"/" );
-   node=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),NULL,"/",compare_func );
-   do
-    {
-     char * tpathnew = g_strconcat( tpath,pos,"/",NULL );
-     free( tpath ); tpath=tpathnew;
-     nextnode=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),node,tpath,compare_func );
-     if ( !nextnode ) break;
-     node=nextnode;
-     pos=strtok( NULL,"/" );
-     gtk_ctree_get_node_info( GTK_CTREE( CTDirTree ),node,NULL,NULL,NULL,NULL,NULL,NULL,&leaf,NULL );
-     if ( !leaf && pos ) gtk_ctree_expand( GTK_CTREE( CTDirTree ),node );
-      else 
-       {
-        DirNodeType * DirNode;
-        gtk_ctree_select( GTK_CTREE( CTDirTree ),node );
-	DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( CTDirTree ),node );
-	current_path=DirNode->path;
-        scan_dir( DirNode->path );
-        if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
-	break;
-       }
-    } while( pos );
-   free( tpath );
-   free( currentdir );
-  }
-  else gtk_ctree_select( GTK_CTREE( CTDirTree ),parent );
-
- gtk_clist_freeze( GTK_CLIST( CLSelected ) );
- gtk_clist_clear( GTK_CLIST( CLSelected ) );
- if ( plList )
-  {
-   plItem * next = plList;
-   while ( next || next->next )
-    {
-     char * text[1][3]; text[0][2]="";
-     text[0][0]=next->name;
-     text[0][1]=next->path;
-     gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
-     NrOfSelected++;
-     if ( next->next ) next=next->next; else break;
-    }
-   CLListSelected=calloc( 1,NrOfSelected * sizeof( int ) );
-  }
- gtk_clist_thaw( GTK_CLIST( CLSelected ) );
+	GtkTreeView* view;
+	if( PlayList )
+		return;
+	
+	PlayList = create_PlayList( );
+
+	g_signal_connect( G_OBJECT( PlayList ),
+												 "destroy",
+												 G_CALLBACK( gtk_widget_destroyed ), 
+												 &PlayList );
 
+		//Show the window first so its constructor
+		//(the realize event handler) is called.
  gtk_widget_show( PlayList );
+	
+		//TODO: functionalize this.
+	view = g_object_get_data( G_OBJECT( PlayList ), "playlist" );
+	mp_playlist_load( gtk_tree_view_get_model( view ), plList );
 }
 
 void HidePlayList( void )
 {
  if ( !PlayList ) return;
- NrOfSelected=NrOfEntrys=0;
- gfree( (void **)&CLListSelected ); gfree( (void **)&CLFileSelected );
- if ( old_path ) free( old_path ); old_path=strdup( current_path );
+	 
  gtk_widget_hide( PlayList );
  gtk_widget_destroy( PlayList );
- PlayList=NULL;
-}
-
-static void plRowSelect( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
-{
- switch ( (int) user_data )
-  {
-   case 0: CLFileSelected[row]=1; break;
-   case 1: CLListSelected[row]=1; break;
-  }
-}
-
-static void plUnRowSelect( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
-{
- switch ( (int) user_data )
-  {
-   case 0: CLFileSelected[row]=0; break;
-   case 1: CLListSelected[row]=0; break;
-  }
-}
-
-static void plButtonReleased( GtkButton * button,gpointer user_data )
-{
- switch ( (int) user_data )
- {
-  case 1: // ok
-       {
-        int i;
-	if ( plList ) gtkSet( gtkDelPl,0,NULL );
-	for ( i=0;i<NrOfSelected;i++ )
-	 {
-	  plItem * item;
-	  char * text[3];
-	  item=calloc( 1,sizeof( plItem ) );
-	  gtk_clist_get_text( GTK_CLIST( CLSelected ),i,0,&text[0] );
-	  gtk_clist_get_text( GTK_CLIST( CLSelected ),i,1,&text[1] );
-	  item->name=strdup( text[0] );
-	  item->path=strdup( text[1] );
-	  gtkSet( gtkAddPlItem,0,(void*)item );
-	 }
-	if ( plCurrent )
-	 {
-	  mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
-//	  guiSetDF( guiIntfStruct.Filename,plCurrent->path,plCurrent->name );
-//	  guiIntfStruct.FilenameChanged=1;
-//	  guiIntfStruct.StreamType=STREAMTYPE_FILE;
-	 }
-       }
-  case 0: // cancel
-       HidePlayList(); 
-       break;
-  case 2: // remove
-       {
-	int i; int j; int c=0;
-
-	gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigSel );
-	gtk_signal_handler_block( GTK_OBJECT( CLSelected ),sigUnsel );
-
-        gtk_clist_freeze( GTK_CLIST( CLSelected ) );
-        for ( i=0;i<NrOfSelected-c;i++ )
-  	 if ( CLListSelected[i] ) 
-	  {
-	   gtk_clist_remove( GTK_CLIST( CLSelected ),i - c );
-	   c++;
-	   for ( j=i;j<NrOfSelected-c;j++ )
-		CLListSelected[i] = CLListSelected[i+1];
-	  }
-	NrOfSelected-=c;
-	gtk_clist_thaw( GTK_CLIST( CLSelected ) );
-
-	gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigSel );
-	gtk_signal_handler_unblock( GTK_OBJECT( CLSelected ),sigUnsel );
-
-       }
-       break;
-  case 3: // add
-       {
-        int i;
-        char * itext[1][2];
-        char * text[1][3]; text[0][2]="";
-        gtk_clist_freeze( GTK_CLIST( CLSelected ) );
-        for ( i=0;i<NrOfEntrys;i++ )
-         {
-          if ( CLFileSelected[i] )
-           {
-	    gtk_clist_get_text( GTK_CLIST( CLFiles ),i,0,(char **)&itext );
-	    text[0][0]=itext[0][0]; text[0][1]=current_path;
-	    gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
-	    NrOfSelected++;
-	    CLListSelected=realloc( CLListSelected,NrOfSelected * sizeof( int ) );
-	    CLListSelected[NrOfSelected - 1]=0;
-	   }
-	 }
-	gtk_clist_thaw( GTK_CLIST( CLSelected ) );
-       }
-       break;
- }
 }
 
-static int check_for_subdir( gchar * path )
+GtkWidget* create_PlayList (void)
 {
- DIR 	       * dir;
- struct dirent * dirent;
- struct stat     statbuf;
- gchar 	       * npath;
-
- if ( (dir=opendir( path )) )
-  {
-   while ( (dirent=readdir( dir )) )
-    {
-     if ( dirent->d_name[0] != '.' )
-      {
-       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 0;
+	GtkWidget* playlist = create_playlist_window( );
+	gtkAddIcon( playlist );
+	return playlist;
 }
-
-static void plCTree( GtkCTree * ctree,GtkCTreeNode * parent_node,gpointer user_data )
-{
- GtkCTreeNode  * node;
- DirNodeType   * DirNode;
- gchar 		   * text;
- gchar 		   * dummy = "dummy";
- int     	 	 subdir = 1;
- DIR   		   * dir = NULL;
- struct dirent * dirent;
- gchar  	   * path;
- struct 		 stat statbuf;
-
- DirNode=gtk_ctree_node_get_row_data( ctree,parent_node );
- if ( !DirNode->scaned )
-  {
-   DirNode->scaned=1; 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 );
-			   
-   if ( (dir=opendir( DirNode->path ) ) )
-    {
-     while( (dirent=readdir( dir )) )
-      {
-       path=calloc( 1,strlen( DirNode->path ) + strlen( dirent->d_name ) + 2 );
-       if ( !strcmp( current_path,"/" ) ) sprintf( path,"/%s",dirent->d_name );
-	else sprintf( path,"%s/%s",current_path,dirent->d_name );
-       text=dirent->d_name;
-
-       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 );
-	 subdir=check_for_subdir( path );
-	 node=gtk_ctree_insert_node( ctree,parent_node,NULL,&text,4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,!subdir,FALSE );
-	 gtk_ctree_node_set_row_data_full( ctree,node,DirNode,NULL );
-	 if ( subdir ) node=gtk_ctree_insert_node( ctree,node,NULL,&dummy,4,NULL,NULL,NULL,NULL,FALSE,FALSE );
-	}
-       free( path ); path=NULL;
-      }
-     closedir( dir );
-    }
-		    
-   gtk_ctree_sort_node( ctree,parent_node );
-   gtk_clist_thaw( GTK_CLIST( ctree ) );
-  }
-}
-
-static void scan_dir( char * path )
-{
- DIR   		   * dir = NULL;
- char		   * curr;
- struct dirent * dirent;
- struct 		 stat statbuf;
- char 		   * text[1][2]; text[0][1]="";
-
- gtk_clist_clear( GTK_CLIST( CLFiles ) );
- if ( (dir=opendir( path )) )
-  {
-   NrOfEntrys=0;
-   while( (dirent=readdir( dir )) )
-    {
-	 curr=calloc( 1,strlen( path ) + strlen( dirent->d_name ) + 3 ); sprintf( curr,"%s/%s",path,dirent->d_name );
-	 if ( stat( curr,&statbuf ) != -1 && ( S_ISREG( statbuf.st_mode ) || S_ISLNK( statbuf.st_mode ) ) )
-	  {
-	   text[0][0]=dirent->d_name;
-	   gtk_clist_append( GTK_CLIST( CLFiles ),text[0] );
-	   NrOfEntrys++;
-	  }
-	 free( curr );
-	}
-   closedir( dir );
-   gtk_clist_sort( GTK_CLIST( CLFiles ) );
-  }
-}
-
-static void plCTRow(GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer data)
-{
- DirNodeType  * DirNode;
- GtkCTreeNode * node;
- node=gtk_ctree_node_nth( GTK_CTREE( widget ),row );
- DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( widget ),node );
- current_path=DirNode->path;
- gtk_ctree_expand( GTK_CTREE( widget ),node );
- scan_dir( DirNode->path );
- if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
-}
-
-GtkWidget * create_PlayList( void )
-{
-  GtkWidget 	* vbox1;
-  GtkWidget 	* hbox1;
-  GtkWidget 	* scrolledwindow1;
-  GtkWidget 	* vbox2;
-  GtkWidget 	* scrolledwindow2;
-  GtkWidget 	* scrolledwindow3;
-  GtkWidget 	* hbuttonbox1;
-  GtkAccelGroup * accel_group;
-  GdkColor 	  transparent = { 0,0,0,0 };
-  gchar 	* root = "/";
-  gchar 	* dummy = "dummy";
-  DirNodeType 	* DirNode;
-
-  accel_group=gtk_accel_group_new();
-
-  PlayList=gtk_window_new( GTK_WINDOW_TOPLEVEL );
-  gtk_object_set_data( GTK_OBJECT( PlayList ),"PlayList",PlayList );
-  gtk_widget_set_usize( PlayList,512,384 );
-  gtk_window_set_title( GTK_WINDOW( PlayList ),MSGTR_PlayList );
-  gtk_window_set_position( GTK_WINDOW( PlayList ),GTK_WIN_POS_CENTER );
-//  gtk_window_set_policy( GTK_WINDOW( PlayList ),FALSE,FALSE,FALSE );
-  gtk_window_set_wmclass( GTK_WINDOW( PlayList ),"Playlist","MPlayer" );
-
-  gtk_widget_realize( PlayList );
-  gtkAddIcon( PlayList );
-
-  vbox1=AddVBox( AddDialogFrame( PlayList ),0 );
-  hbox1=AddHBox( NULL,1 );
-   gtk_box_pack_start( GTK_BOX( vbox1 ),hbox1,TRUE,TRUE,0 );
-
-  scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
-  gtk_widget_show( scrolledwindow1 );
-  gtk_container_add( GTK_CONTAINER( 
-    AddFrame( NULL,0,hbox1,1 ) ),scrolledwindow1 );
-  gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
-
-  CTDirTree=gtk_ctree_new( 1,0 );
-  gtk_signal_connect( GTK_OBJECT( CTDirTree ),"tree_expand",GTK_SIGNAL_FUNC( plCTree ),(void*)0 );
-  gtk_signal_connect( GTK_OBJECT( CTDirTree ),"select_row",GTK_SIGNAL_FUNC( plCTRow ),(void *)0 );
-  gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),CTDirTree );
-  gtk_clist_set_column_auto_resize( GTK_CLIST( CTDirTree ),0,TRUE );
-  gtk_clist_set_column_width( GTK_CLIST( CTDirTree ),0,80 );
-  gtk_clist_set_selection_mode( GTK_CLIST( CTDirTree ),GTK_SELECTION_SINGLE );
-  gtk_ctree_set_line_style( GTK_CTREE( CTDirTree ),GTK_CTREE_LINES_SOLID );
-  gtk_clist_column_titles_show( GTK_CLIST( CTDirTree ) );
-  gtk_clist_set_shadow_type( GTK_CLIST( CTDirTree ),GTK_SHADOW_NONE );
-
-  if ( !pxOpenedBook ) pxOpenedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msOpenedBook,&transparent,book_closed_xpm );
-  if ( !pxClosedBook ) pxClosedBook=gdk_pixmap_create_from_xpm_d( PlayList->window,&msClosedBook,&transparent,book_open_xpm );
-
-  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 );
-  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 );
-  gtk_widget_show( CTDirTree );
-
-  
-  gtk_clist_set_column_widget( GTK_CLIST( CTDirTree ),0,
-    AddLabel( MSGTR_PLAYLIST_DirectoryTree,NULL ) );
-  
-  vbox2=AddVBox(
-    AddFrame( NULL,1,hbox1,1 ),0 );
-
-  scrolledwindow2=gtk_scrolled_window_new( NULL,NULL );
-  gtk_widget_show( scrolledwindow2 );
-  gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow2,TRUE,TRUE,0 );
-  gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow2 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
-
-  CLFiles=gtk_clist_new( 1 );
-  gtk_widget_show( CLFiles );
-  gtk_container_add( GTK_CONTAINER( scrolledwindow2 ),CLFiles );
-  gtk_clist_set_column_width( GTK_CLIST( CLFiles ),0,80 );
-  gtk_clist_set_selection_mode( GTK_CLIST( CLFiles ),GTK_SELECTION_EXTENDED );
-  gtk_clist_column_titles_show( GTK_CLIST( CLFiles ) );
-  gtk_clist_set_shadow_type( GTK_CLIST( CLFiles ),GTK_SHADOW_NONE );
-
-  gtk_clist_set_column_widget( GTK_CLIST( CLFiles ),0,
-    AddLabel( MSGTR_PLAYLIST_Files,NULL ) );
-
-  AddHSeparator( vbox2 );
-
-  scrolledwindow3=gtk_scrolled_window_new( NULL,NULL );
-  gtk_widget_show( scrolledwindow3 );
-  gtk_box_pack_start( GTK_BOX( vbox2 ),scrolledwindow3,TRUE,TRUE,0 );
-  gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow3 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
-
-  CLSelected=gtk_clist_new( 2 );
-  gtk_widget_show( CLSelected );
-  gtk_container_add( GTK_CONTAINER( scrolledwindow3 ),CLSelected );
-  gtk_clist_set_column_width( GTK_CLIST( CLSelected ),0,295 );
-  gtk_clist_set_column_width( GTK_CLIST( CLSelected ),1,295 );
-  gtk_clist_set_selection_mode( GTK_CLIST( CLSelected ),GTK_SELECTION_MULTIPLE );
-  gtk_clist_column_titles_show( GTK_CLIST( CLSelected ) );
-  gtk_clist_set_shadow_type( GTK_CLIST( CLSelected ),GTK_SHADOW_NONE );
-
-  gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),0,
-    AddLabel( MSGTR_PLAYLIST_Selected,NULL ) );
-
-  gtk_clist_set_column_widget( GTK_CLIST( CLSelected ),1,
-    AddLabel( MSGTR_PLAYLIST_Path,NULL ) );
-
-  AddHSeparator( vbox1 );
-
-  hbuttonbox1=AddHButtonBox( vbox1 );
-    gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
-    gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
-
-  Add=AddButton( MSGTR_Add,hbuttonbox1 );
-  Remove=AddButton( MSGTR_Remove,hbuttonbox1 );
-  Ok=AddButton( MSGTR_Ok,hbuttonbox1 );
-  Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
-
-  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
-
-  gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&PlayList );
-
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 );
-  sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void*)1 );
-  sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void*)1 );
-
-  gtk_signal_connect( GTK_OBJECT( Add ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( Remove ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)0 );
-
-  gtk_window_add_accel_group( GTK_WINDOW( PlayList ),accel_group );
-
-  return PlayList;
-}
-
--- Gui/mplayer/gtk/playlist.c.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/playlist.c	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,428 @@
+/* playlist.c
+ *
+ * July 27, 2003.
+ * Copyright (C) 2003 Charles J. Ezell III.  
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+mozilla-bin * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+//Graphical playlist editor.
+
+//TODO: set up a dirty flag so the 
+//playlist is only updated when necessary.
+
+//MODULE LEVEL INVARIANTS:
+//
+//The number of rows in the playlist can be
+//retrieved via get_n_rows().
+//
+
+
+#include "playlist.h"
+
+#include <gtk/gtk.h>
+#include <glib/gprintf.h>
+
+#include "enfilesel.h"
+#include "fs.h"
+#include "mp_pl.h"
+#include "../play.h"
+//#include "support.h"
+#include "../widgets.h"
+
+	//Testing.
+#include "../../app.h"
+//#include "../help_mp.h"
+
+
+gint get_n_rows( GtkTreeView* view )
+{
+	return *(gint*)g_object_get_data( G_OBJECT( view ), "last-row" );
+}
+
+//-----
+
+void added_item( /*GtkTreeModel *model,
+	GtkTreePath *arg1,	GtkTreeIter *arg2,*/	gpointer num_rows )
+{
+	++*(gint*)num_rows;
+}
+
+void removed_item( /*GtkTreeModel *model,
+	GtkTreePath *arg1,*/ gpointer num_rows )
+{
+	++*(gint*)num_rows;
+}
+
+//-----
+
+void store_filename( EnhancedFileSelection* selector/*, gpointer user_data*/ )
+{
+	int i = 0;
+	gchar** files = enhanced_file_selection_get_selections( selector );
+	GtkTreeView* playlist = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( selector ), "playlist" ) );
+	GtkTreeModel* model = gtk_tree_view_get_model( playlist );
+	
+	while( files[i] )
+	{
+		gchar* end_path = strrchr( files[i], G_DIR_SEPARATOR );
+		if( end_path )
+		{
+			*end_path = '\0';
+			gtkAppendList2( model, ++end_path, files[i] );
+		}
+		else
+		{
+				//TODO: this needs tested and possibly updated.
+			gtkAppendList2( model, files[i], files[i] );
+		}
+		
+		++i;
+	}
+	
+	g_strfreev( files );
+	gtk_widget_destroy( GTK_WIDGET( selector ) );
+}
+
+//-----
+/* For debugging.
+void print_path( const gchar* message, gpointer path, gboolean newline )
+{
+	if( path )
+	{
+		gchar* s = gtk_tree_path_to_string( (GtkTreePath*)path );
+		g_printf( "%s %s", message, s );
+		g_free( s );
+		
+		if( newline )
+			g_printf( "\n" );
+	}
+}
+
+void print_paths( const gchar* message, GList* path_list )
+{
+	g_printf( "%s path: ", message );
+	while( path_list )
+	{
+		print_path( "", path_list->data, FALSE );
+		g_printf( ", " );
+		path_list = g_list_next( path_list );
+	}
+	
+	g_printf( "\n" );
+}
+*/
+//-----
+
+GList* prune_top( GList* paths, GList**  removed_items )
+{
+	if( paths && paths->next )
+	{
+		GList* s = g_list_next( paths );
+		
+		gint i = gtk_tree_path_get_indices( (GtkTreePath*)paths->data )[0] == 0 ? 0 : -1, 
+				row = gtk_tree_path_get_indices( (GtkTreePath*)s->data )[0];
+
+		while( s && ( row - 1 == i ) )
+		{
+			GList* removed = s;
+			s = g_list_remove_link( s, s );
+			
+			*removed_items = g_list_concat( *removed_items, removed );
+			
+			++i;
+			row = s ? gtk_tree_path_get_indices( (GtkTreePath*)s->data )[0] : -3;
+		}
+	}
+	
+	return paths;
+}
+
+GList* prune_bottom( GList* paths, GList**  removed_items, gint last_row )
+{
+	if( paths && paths->next )
+	{
+		GList* s = g_list_next( paths );
+
+		--last_row;
+		gint trailer = gtk_tree_path_get_indices( (GtkTreePath*)paths->data )[0] == last_row ? last_row : -1, 
+						row = gtk_tree_path_get_indices( (GtkTreePath*)s->data )[0];
+
+		while( s && ( row + 1 == trailer ) )
+		{
+			GList* removed = s;
+			s = g_list_remove_link( s, s );
+			
+			*removed_items = g_list_concat( *removed_items, removed );
+			
+			--trailer;
+			row = s ? gtk_tree_path_get_indices( (GtkTreePath*)s->data )[0] : -3;
+		}
+	}
+	
+	return paths;
+}
+
+//-----
+
+	//TODO: put in lib.
+void remove_row( GtkTreePath* path, GtkTreeModel* model )
+{
+	GtkTreeIter i;
+	gtk_tree_model_get_iter( model, &i, path );
+
+	gtk_list_store_remove( GTK_LIST_STORE( model ), &i );
+}
+
+
+void move_row_up( GtkTreePath* path, GtkTreeModel* model )
+{
+	GtkTreeIter i, one_up;
+	gint new_row = gtk_tree_path_get_indices( path )[0] - 1;
+
+	gtk_tree_model_get_iter( model, &i, path );	 
+	if( new_row > 0 && gtk_tree_path_prev( path ) )
+	{
+		gtk_tree_model_get_iter( model, &one_up, path );
+		gtk_list_store_move_before( GTK_LIST_STORE( model ), &i, &one_up );	
+	}
+	else	
+	{
+		gtk_tree_model_get_iter_first( model, &one_up );
+		gtk_list_store_swap( GTK_LIST_STORE( model ), &i, &one_up );	
+	}
+}
+
+
+void move_row_down( GtkTreePath* path, GtkTreeModel* model )
+{
+	GtkTreeIter i, one_down;
+	gtk_tree_model_get_iter( model, &i, path );	 
+
+	gtk_tree_path_next( path );
+	if( gtk_tree_model_get_iter( model, &one_down, path ) )
+	{
+		gtk_list_store_move_after( GTK_LIST_STORE( model ), &i, &one_down );	
+	}
+}
+
+//-----
+
+void
+up_button_clicked                      (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+	GtkTreeModel* model;
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
+	GList* sel_rows = gtk_tree_selection_get_selected_rows( selection, &model ),
+			* ignored_rows = NULL;
+	
+	sel_rows = prune_top( sel_rows, &ignored_rows  );
+
+	g_list_foreach( sel_rows, (GFunc)move_row_up, model );
+
+	g_list_foreach( sel_rows, (GFunc)gtk_tree_path_free, NULL );
+	g_list_foreach( ignored_rows, (GFunc)gtk_tree_path_free, NULL );
+	g_list_free( sel_rows );
+}
+
+
+void
+down_button_clicked                    (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+	GtkTreeModel* model;
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
+	GList* sel_rows = gtk_tree_selection_get_selected_rows( selection, &model ),
+			* ignored_rows = NULL;
+
+	sel_rows = g_list_reverse( sel_rows );
+	
+	sel_rows = prune_bottom( sel_rows, &ignored_rows, get_n_rows( view ) );
+
+	g_list_foreach( sel_rows, (GFunc)move_row_down, model );
+	
+	g_list_foreach( sel_rows, (GFunc)gtk_tree_path_free, NULL );
+	g_list_foreach( ignored_rows, (GFunc)gtk_tree_path_free, NULL );
+	g_list_free( sel_rows );	
+}
+
+
+void
+add_button_clicked                     (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+	EnhancedFileSelection* selector;
+	create_FileSelect( (GtkWidget**)&selector, fsVideoSelector, G_CALLBACK( store_filename ), FALSE );
+
+	enhanced_file_selection_set_select_multiple( selector, TRUE );
+	g_object_set_data( G_OBJECT( selector ), "playlist", view );
+	gtk_widget_show( GTK_WIDGET( selector ) );
+}
+
+
+void
+remove_button_clicked                  (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+	GtkTreeModel* model;
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
+	GList* sel_rows = gtk_tree_selection_get_selected_rows( selection, &model );
+	
+	sel_rows = g_list_reverse( sel_rows );
+	g_list_foreach( sel_rows, (GFunc)remove_row, model );
+
+	g_list_foreach( sel_rows, (GFunc)gtk_tree_path_free, NULL );
+	g_list_free( sel_rows );
+}
+
+
+void
+close_button_clicked                   (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+//	mp_playlist_update( &plList, gtk_tree_view_get_model( view ) );
+	mp_playlist_free( &plList );
+	plCurrent = NULL;
+	plLastPlayed = NULL;
+	
+	plList = mp_playlist_generate( gtk_tree_view_get_model( view ) );
+	
+	if( plList )
+		mplSetFileName( plList->path, plList->name, STREAMTYPE_FILE );
+//	else
+//		mplSetFileName( MSGTR_NoMediaOpened, NULL, -15/*STREAMTYPE_DUMMY*/ );
+	
+		//TODO: kind of hackish.  See if there is a
+		//better way that doesn't require too much 
+		//work.
+	gtk_widget_destroy( gtk_widget_get_toplevel( GTK_WIDGET( view ) ) );
+}
+
+
+void
+on_playlist_realize                    (GtkTreeView       *view/*,
+                                        gpointer         user_data*/)
+{
+	GtkCellRenderer* renderer;
+	GtkTreeViewColumn* column;
+	GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING );
+	gtk_tree_view_set_model( view, GTK_TREE_MODEL( store ) );
+
+	g_object_unref( G_OBJECT( store ) );
+	
+	renderer = gtk_cell_renderer_text_new( );
+	column = gtk_tree_view_column_new_with_attributes( 
+		"Filename", renderer, "text", 0, NULL );
+
+	gtk_tree_view_append_column( view, column );	
+	
+	column = gtk_tree_view_column_new_with_attributes( 
+		"Full Paths", renderer, "text", 0, NULL );
+	gtk_tree_view_column_set_visible( column, FALSE );
+	gtk_tree_view_append_column( view, column );	
+	
+	gtk_tree_view_set_headers_visible ( view, FALSE );
+
+  gtk_tree_view_set_reorderable( view, FALSE );
+
+		//Allow everyone else to get at the playlist
+		//easily.
+		//TODO: the usual comment about gtk_widget_get_toplevel().
+	g_object_set_data( G_OBJECT( gtk_widget_get_toplevel( GTK_WIDGET( view ) ) ), "playlist", view );
+
+			//This is used to enable us to quickly find the
+			//number of rows.  
+	gint* last_row = g_new( gint, 1 );
+	*last_row = 0;
+	g_object_set_data_full( G_OBJECT( view ), "last-row", last_row, ( GDestroyNotify)g_free );
+
+	g_signal_connect_swapped( G_OBJECT( store ), "row-inserted", G_CALLBACK( added_item ), last_row );
+	g_signal_connect_swapped( G_OBJECT( store ), "row-deleted", G_CALLBACK( removed_item ), last_row );
+
+	gtk_tree_selection_set_mode( gtk_tree_view_get_selection( view ), GTK_SELECTION_MULTIPLE );
+}
+
+
+void
+playlist_row_activated                 (GtkTreeView     *view,
+                                        GtkTreePath     *path/*,
+                                        GtkTreeViewColumn *column,
+                                        gpointer         user_data*/)
+{
+	mplEventHandling( evStop, 0 ); 
+
+		//TEMP.
+	mp_playlist_free( &plList );
+	plList = mp_playlist_generate( gtk_tree_view_get_model( view ) );
+		//
+
+	int row = gtk_tree_path_get_indices( path )[0];
+/*
+	plItem* temp = plList;
+	while( row-- )
+		temp = temp->next;
+
+	plCurrent = temp;
+//	mplGotoTheNext = plCurrent->prev ? 0 : 1;
+	mplSetFileName( temp->path, temp->name, STREAMTYPE_FILE );
+	mplPlay( );
+*/
+
+// Mostly works.	
+	plItem* temp = plList;
+	while( row-- )
+		temp = temp->next;
+
+	mplSetFileName( temp->path, temp->name, STREAMTYPE_FILE );
+
+	plCurrent = temp;
+	mplGotoTheNext = plCurrent->prev ? 0 : 1;
+	mplEventHandling( evPlay,0 );
+
+		//Weak attempts to fix the video refreshing problem.
+//	wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID ); 
+//	wsSetLayer( wsDisplay,appMPlayer.subWindow.WindowID,4 );
+
+/* Junk bin.
+//	guiGetEvent( guiCEvent,guiSetStop );
+//	guiGetEvent( guiCEvent,guiSetPlay );
+
+	mp_playlist_free( &plList );
+	plList = mp_playlist_generate( gtk_tree_view_get_model( view ) );
+
+	int row = gtk_tree_path_get_indices( path )[0];
+
+	plCurrent = plList;
+	while( row-- )
+		plCurrent = plCurrent->next;
+
+	plItem* temp = plList;
+	while( row-- )
+		temp = temp->next;
+
+		//Brute force + not correct.
+	plCurrent = temp;
+	mplEnd( );
+	mplCurr( );
+	mplPlay( );
+	
+//  mplSetFileName( plCurrent->path, plCurrent->name, STREAMTYPE_FILE );
+//	mplEventHandling( evStop,0 );
+//	mplEventHandling( evPlay,0 );
+		//.PMET
+*/
+}
--- Gui/mplayer/gtk/playlist.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/playlist.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,32 @@
+#include <gtk/gtk.h>
+
+
+void
+up_button_clicked                      (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+down_button_clicked                    (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+add_button_clicked                     (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+remove_button_clicked                  (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+close_button_clicked                   (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+on_playlist_realize                    (GtkTreeView       *view/*,
+                                        gpointer         user_data*/);
+
+void
+playlist_row_activated                 (GtkTreeView     *treeview,
+                                        GtkTreePath     *path/*,
+                                        GtkTreeViewColumn *column,
+                                        gpointer         user_data*/);
--- Gui/mplayer/gtk/playlist_create.c.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/playlist_create.c	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,204 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+
+#include "playlist.h"
+#include "playlist_create.h"
+#include "support.h"
+
+#define GLADE_HOOKUP_OBJECT(component,widget,name) \
+  g_object_set_data_full (G_OBJECT (component), name, \
+    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
+
+#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
+  g_object_set_data (G_OBJECT (component), name, widget)
+
+GtkWidget*
+create_playlist_window (void)
+{
+  GtkWidget *playlist_window;
+  GtkWidget *vbox1;
+  GtkWidget *playlist_scrolledwindow;
+  GtkWidget *playlist;
+  GtkWidget *hseparator1;
+  GtkWidget *alignment1;
+  GtkWidget *hbox2;
+  GtkWidget *add_remove_hbox;
+  GtkWidget *add_button;
+  GtkWidget *image4;
+  GtkWidget *remove_button;
+  GtkWidget *image5;
+  GtkWidget *up_down_hbox;
+  GtkWidget *down_button;
+  GtkWidget *image2;
+  GtkWidget *up_button;
+  GtkWidget *image1;
+  GtkWidget *eventbox5;
+  GtkWidget *hbox1;
+  GtkWidget *hseparator2;
+  GtkWidget *hbuttonbox1;
+  GtkWidget *search_button;
+  GtkWidget *statusbar1;
+
+  playlist_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_title (GTK_WINDOW (playlist_window), _("Playlist"));
+  gtk_window_set_default_size (GTK_WINDOW (playlist_window), 300, 450);
+  gtk_window_set_destroy_with_parent (GTK_WINDOW (playlist_window), TRUE);
+
+  vbox1 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox1);
+  gtk_container_add (GTK_CONTAINER (playlist_window), vbox1);
+
+  playlist_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (playlist_scrolledwindow);
+  gtk_box_pack_start (GTK_BOX (vbox1), playlist_scrolledwindow, TRUE, TRUE, 0);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (playlist_scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+  playlist = gtk_tree_view_new ();
+  gtk_widget_show (playlist);
+  gtk_container_add (GTK_CONTAINER (playlist_scrolledwindow), playlist);
+  gtk_tree_view_set_reorderable (GTK_TREE_VIEW (playlist), TRUE);
+
+  hseparator1 = gtk_hseparator_new ();
+  gtk_widget_show (hseparator1);
+  gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, TRUE, 5);
+
+  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
+  gtk_widget_show (alignment1);
+  gtk_box_pack_start (GTK_BOX (vbox1), alignment1, FALSE, FALSE, 0);
+
+  hbox2 = gtk_hbox_new (TRUE, 0);
+  gtk_widget_show (hbox2);
+  gtk_container_add (GTK_CONTAINER (alignment1), hbox2);
+
+  add_remove_hbox = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (add_remove_hbox);
+  gtk_box_pack_start (GTK_BOX (hbox2), add_remove_hbox, FALSE, TRUE, 0);
+
+  add_button = gtk_button_new ();
+  gtk_widget_show (add_button);
+  gtk_box_pack_start (GTK_BOX (add_remove_hbox), add_button, FALSE, FALSE, 0);
+
+  image4 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_BUTTON);
+  gtk_widget_show (image4);
+  gtk_container_add (GTK_CONTAINER (add_button), image4);
+
+  remove_button = gtk_button_new ();
+  gtk_widget_show (remove_button);
+  gtk_box_pack_start (GTK_BOX (add_remove_hbox), remove_button, FALSE, FALSE, 0);
+
+  image5 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_BUTTON);
+  gtk_widget_show (image5);
+  gtk_container_add (GTK_CONTAINER (remove_button), image5);
+
+  up_down_hbox = gtk_hbox_new (FALSE, 0);
+  gtk_widget_show (up_down_hbox);
+  gtk_box_pack_start (GTK_BOX (hbox2), up_down_hbox, FALSE, TRUE, 0);
+
+  down_button = gtk_button_new ();
+  gtk_widget_show (down_button);
+  gtk_box_pack_start (GTK_BOX (up_down_hbox), down_button, FALSE, FALSE, 0);
+  GTK_WIDGET_SET_FLAGS (down_button, GTK_CAN_DEFAULT);
+
+  image2 = gtk_image_new_from_stock ("gtk-go-down", GTK_ICON_SIZE_BUTTON);
+  gtk_widget_show (image2);
+  gtk_container_add (GTK_CONTAINER (down_button), image2);
+
+  up_button = gtk_button_new ();
+  gtk_widget_show (up_button);
+  gtk_box_pack_start (GTK_BOX (up_down_hbox), up_button, FALSE, FALSE, 0);
+  GTK_WIDGET_SET_FLAGS (up_button, GTK_CAN_DEFAULT);
+
+  image1 = gtk_image_new_from_stock ("gtk-go-up", GTK_ICON_SIZE_BUTTON);
+  gtk_widget_show (image1);
+  gtk_container_add (GTK_CONTAINER (up_button), image1);
+
+  eventbox5 = gtk_event_box_new ();
+  gtk_widget_show (eventbox5);
+  gtk_box_pack_start (GTK_BOX (hbox2), eventbox5, TRUE, TRUE, 0);
+
+  hbox1 = gtk_hbox_new (TRUE, 0);
+  gtk_widget_show (hbox1);
+  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 5);
+
+  hseparator2 = gtk_hseparator_new ();
+  gtk_widget_show (hseparator2);
+  gtk_box_pack_start (GTK_BOX (hbox1), hseparator2, TRUE, TRUE, 0);
+
+  hbuttonbox1 = gtk_hbutton_box_new ();
+  gtk_widget_show (hbuttonbox1);
+  gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 0);
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
+
+  search_button = gtk_button_new_from_stock ("gtk-close");
+  gtk_widget_show (search_button);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox1), search_button);
+  GTK_WIDGET_SET_FLAGS (search_button, GTK_CAN_DEFAULT);
+
+  statusbar1 = gtk_statusbar_new ();
+  gtk_widget_show (statusbar1);
+  gtk_box_pack_start (GTK_BOX (vbox1), statusbar1, FALSE, FALSE, 0);
+
+  g_signal_connect_after ((gpointer) playlist, "realize",
+                          G_CALLBACK (on_playlist_realize),
+                          NULL);
+  g_signal_connect ((gpointer) playlist, "row_activated",
+                    G_CALLBACK (playlist_row_activated),
+                    NULL);
+  g_signal_connect_swapped ((gpointer) add_button, "clicked",
+                            G_CALLBACK (add_button_clicked),
+                            G_OBJECT (playlist));
+  g_signal_connect_swapped ((gpointer) remove_button, "clicked",
+                            G_CALLBACK (remove_button_clicked),
+                            G_OBJECT (playlist));
+  g_signal_connect_swapped ((gpointer) down_button, "clicked",
+                            G_CALLBACK (down_button_clicked),
+                            G_OBJECT (playlist));
+  g_signal_connect_swapped ((gpointer) up_button, "clicked",
+                            G_CALLBACK (up_button_clicked),
+                            G_OBJECT (playlist));
+  g_signal_connect_swapped ((gpointer) search_button, "clicked",
+                            G_CALLBACK (close_button_clicked),
+                            G_OBJECT (playlist));
+
+  /* Store pointers to all widgets, for use by lookup_widget(). */
+  GLADE_HOOKUP_OBJECT_NO_REF (playlist_window, playlist_window, "playlist_window");
+  GLADE_HOOKUP_OBJECT (playlist_window, vbox1, "vbox1");
+  GLADE_HOOKUP_OBJECT (playlist_window, playlist_scrolledwindow, "playlist_scrolledwindow");
+  GLADE_HOOKUP_OBJECT (playlist_window, playlist, "playlist");
+  GLADE_HOOKUP_OBJECT (playlist_window, hseparator1, "hseparator1");
+  GLADE_HOOKUP_OBJECT (playlist_window, alignment1, "alignment1");
+  GLADE_HOOKUP_OBJECT (playlist_window, hbox2, "hbox2");
+  GLADE_HOOKUP_OBJECT (playlist_window, add_remove_hbox, "add_remove_hbox");
+  GLADE_HOOKUP_OBJECT (playlist_window, add_button, "add_button");
+  GLADE_HOOKUP_OBJECT (playlist_window, image4, "image4");
+  GLADE_HOOKUP_OBJECT (playlist_window, remove_button, "remove_button");
+  GLADE_HOOKUP_OBJECT (playlist_window, image5, "image5");
+  GLADE_HOOKUP_OBJECT (playlist_window, up_down_hbox, "up_down_hbox");
+  GLADE_HOOKUP_OBJECT (playlist_window, down_button, "down_button");
+  GLADE_HOOKUP_OBJECT (playlist_window, image2, "image2");
+  GLADE_HOOKUP_OBJECT (playlist_window, up_button, "up_button");
+  GLADE_HOOKUP_OBJECT (playlist_window, image1, "image1");
+  GLADE_HOOKUP_OBJECT (playlist_window, eventbox5, "eventbox5");
+  GLADE_HOOKUP_OBJECT (playlist_window, hbox1, "hbox1");
+  GLADE_HOOKUP_OBJECT (playlist_window, hseparator2, "hseparator2");
+  GLADE_HOOKUP_OBJECT (playlist_window, hbuttonbox1, "hbuttonbox1");
+  GLADE_HOOKUP_OBJECT (playlist_window, search_button, "search_button");
+  GLADE_HOOKUP_OBJECT (playlist_window, statusbar1, "statusbar1");
+
+  gtk_widget_grab_default (search_button);
+  return playlist_window;
+}
--- Gui/mplayer/gtk/playlist_create.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/playlist_create.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,5 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+GtkWidget* create_playlist_window (void);
--- Gui/mplayer/gtk/sb.c.orig	Sat Jan 18 03:22:18 2003
+++ Gui/mplayer/gtk/sb.c	Thu Jan  8 18:54:25 2004
@@ -40,35 +40,51 @@
  SkinBrowser=NULL;
 }
 
+	//Used by a GtkTree to free g_strings.
+static void free_gstring( gpointer data )
+{
+		//TODO: find out if using FALSE here is correct...
+	g_string_free( (GString*)data, FALSE );
+}
+
+void add_skin( gpointer key, gpointer value, gpointer user_data )
+{ 
+	gtkAppendList( GTK_TREE_VIEW( SkinList ), ((GString*)key)->str );
+}
+
 int gtkFillSkinList( gchar * mdir )
 {
- gchar         * str[2];
  gchar         * tmp;
  int             i;
  glob_t          gg;
  struct stat     fs;
 
- gtkOldSkin=strdup( skinName );
- prev=gtkOldSkin;
+	GHashTable* skins = g_hash_table_new_full( g_str_hash, g_str_equal, free_gstring, NULL );  
 
- str[0]="default";
- str[1]="";
- if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+ gtkOldSkin=strdup( skinName ); //TODO: use gstrings + functions.
+ prev=gtkOldSkin;
 
  glob( mdir,GLOB_NOSORT,NULL,&gg );
  for( i=0;i<(int)gg.gl_pathc;i++ )
   {
-   if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
+    if ( strcmp( gg.gl_pathv[i],"." ) && strcmp( gg.gl_pathv[i],".." ) )
+    {
    stat( gg.gl_pathv[i],&fs );
    if ( S_ISDIR( fs.st_mode ) )
     {
      tmp=strrchr( gg.gl_pathv[i],'/' ); tmp++;
-     if ( !strcmp( tmp,"default" ) ) continue;
-     str[0]=tmp;
-     if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+     
+        g_hash_table_insert( skins, (gpointer)g_string_new( tmp ), NULL );
     }
   }
+  }
+
  globfree( &gg );
+
+  g_hash_table_foreach( skins, add_skin, NULL );
+
+	 g_hash_table_destroy( skins ); 
+ 
  return 1;
 }
 
@@ -88,97 +104,111 @@
  HideSkinBrowser();
 }
 
-static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
+static void on_SkinList_select_row( GtkTreeSelection * selection, GtkTreeView* view )
 {
- gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
- if ( strcmp( prev,sbSelectedSkin ) )
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+
+	if( gtk_tree_selection_get_selected( selection, &model, &iter) )
+	{
+		gtk_tree_model_get( model, &iter, SkinColumn, &sbSelectedSkin, -1 );
+
+		if ( strcmp( prev, sbSelectedSkin ) )
   {
+				//TODO: fix mixing of allocation functions.
    prev=sbSelectedSkin;
    ChangeSkin( sbSelectedSkin );
-   gtkActive( SkinBrowser );
+			gtk_window_present( GTK_WINDOW( SkinBrowser ) );
+//			gtkActive( SkinBrowser ); //Currently does bad things.
   }
- if( !bevent ) return;
- if( bevent->type == GDK_2BUTTON_PRESS )
-  {
-   if ( skinName ) free( skinName );
-   skinName=strdup( sbSelectedSkin );
-   HideSkinBrowser();
   }
 }
 
 GtkWidget * create_SkinBrowser( void )
 {
- GtkWidget     * vbox5;
- GtkWidget     * scrolledwindow1;
- GtkWidget     * hbuttonbox4;
- GtkWidget     * Cancel;
- GtkWidget     * Ok;
- GtkAccelGroup * accel_group;
+  GtkWidget *vbox1;
+  GtkWidget *scrolledwindow1;
+  GtkWidget *hbuttonbox1;
+  GtkWidget *cancel;
+  GtkWidget *ok;
+  GtkAccelGroup *accel_group;
+	const gchar* column_headers[] = { MSGTR_SKIN_LABEL };
 
  accel_group = gtk_accel_group_new ();
 
- SkinBrowser=gtk_window_new( GTK_WINDOW_TOPLEVEL );
+  SkinBrowser = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
+  gtk_window_set_position (GTK_WINDOW (SkinBrowser), GTK_WIN_POS_CENTER);
+  gtk_window_set_default_size (GTK_WINDOW (SkinBrowser), 256, 320);
+	gtk_window_set_destroy_with_parent (GTK_WINDOW (SkinBrowser), TRUE); 
+
  gtk_widget_set_name( SkinBrowser,MSGTR_SkinBrowser );
- gtk_object_set_data( GTK_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser );
- gtk_widget_set_usize( SkinBrowser,256,320 );
- gtk_container_set_border_width( GTK_CONTAINER( SkinBrowser ),1 );
+	g_object_set_data( G_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser );
  GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_DEFAULT );
  gtk_widget_set_events( SkinBrowser,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
- gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
- gtk_window_set_position( GTK_WINDOW( SkinBrowser ),GTK_WIN_POS_CENTER );
- gtk_window_set_policy( GTK_WINDOW( SkinBrowser ),FALSE,FALSE,TRUE );
- gtk_window_set_wmclass( GTK_WINDOW( SkinBrowser ),"SkinBrowser","MPlayer" );
-
- gtk_widget_realize( SkinBrowser );
  gtkAddIcon( SkinBrowser );
 
- vbox5=AddVBox( AddDialogFrame( SkinBrowser ),0 );
- AddLabel( MSGTR_SKIN_LABEL,vbox5 );
- AddHSeparator( vbox5 );
-
- scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
- gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
- gtk_widget_ref( scrolledwindow1 );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
- gtk_widget_show( scrolledwindow1 );
- gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
- gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
-
- SkinList=gtk_clist_new( 1 );
- gtk_widget_set_name( SkinList,"SkinList" );
- gtk_widget_ref( SkinList );
- gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,(GtkDestroyNotify)gtk_widget_unref );
+  vbox1 = AddVBox( SkinBrowser, 0 );//gtk_vbox_new (FALSE, 0);
+	gtk_widget_show (vbox1);
+//  gtk_container_add (GTK_CONTAINER (SkinBrowser), vbox1);
+ 
+  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+  gtk_widget_show (scrolledwindow1);
+//	AddFrame( NULL, GTK_SHADOW_NONE, scrolledwindow1, 1 ), //TODO:
+	gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow1, TRUE, TRUE, 0);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ 
+	SkinList = gtkListNew( 1, column_headers, TRUE );
+
+	gtk_tree_sortable_set_sort_column_id( 
+		GTK_TREE_SORTABLE( gtk_tree_view_get_model( GTK_TREE_VIEW( SkinList ) ) ),
+			0, GTK_SORT_ASCENDING );	//TODO: use symbolic column id.
+			
+	g_signal_connect( 
+		G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( SkinList ) ) ), "changed", //TODO: use row-activated?
+			G_CALLBACK( on_SkinList_select_row ), SkinList );
+									
  gtk_widget_show( SkinList );
- gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
- gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
- gtk_clist_set_selection_mode( GTK_CLIST( SkinList ),GTK_SELECTION_SINGLE );
- gtk_clist_column_titles_hide( GTK_CLIST( SkinList ) );
- gtk_clist_set_shadow_type( GTK_CLIST( SkinList ),GTK_SHADOW_ETCHED_OUT );
-
- AddHSeparator( vbox5 );
-
- hbuttonbox4=AddHButtonBox( vbox5 );
-  gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_SPREAD );
-  gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),10 );
-
- Ok=AddButton( MSGTR_Ok,hbuttonbox4 );
- Cancel=AddButton( MSGTR_Cancel,hbuttonbox4 );
-
- gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
- gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
-
- gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&SkinBrowser );
- gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
- gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
- gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
+	gtk_container_add( GTK_CONTAINER( scrolledwindow1 ), SkinList );
+	
+	g_signal_connect( G_OBJECT( SkinBrowser ),"destroy",G_CALLBACK( WidgetDestroy ),&SkinBrowser );
+
+  hbuttonbox1 = gtk_hbutton_box_new ();
+  gtk_widget_show (hbuttonbox1);
+  gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, TRUE, 8);
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);
+
+  cancel = gtk_button_new_with_mnemonic ("_Cancel");
+  gtk_widget_show (cancel);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel);
+  GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);
+  gtk_widget_add_accelerator (cancel, "clicked", accel_group,
+                              GDK_Escape, 0,
+                              GTK_ACCEL_VISIBLE);
+
+  ok = gtk_button_new_with_mnemonic ("_OK");
+  gtk_widget_show (ok);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox1), ok);
+  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);
+  gtk_widget_add_accelerator (ok, "clicked", accel_group,
+                              GDK_Return, 0,
+                              GTK_ACCEL_VISIBLE);
+
+  g_signal_connect ((gpointer) cancel, "clicked",
+                    G_CALLBACK (prButton),
+                    (void*)0);
+
+  g_signal_connect ((gpointer) ok, "clicked",
+                    G_CALLBACK (prButton),
+                    (void*)1);
+
+  gtk_window_add_accel_group (GTK_WINDOW (SkinBrowser), accel_group);
 
  if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerDirInHome,skinDirInHome ); strcat( sbMPlayerDirInHome,"/*" ); }
  if ( ( sbMPlayerPrefixDir=(char *)calloc( 1,strlen( skinMPlayerDir ) + 4 ) ) != NULL )
   { strcpy( sbMPlayerPrefixDir,skinMPlayerDir ); strcat( sbMPlayerPrefixDir,"/*" ); }
 
- gtk_window_add_accel_group( GTK_WINDOW( SkinBrowser ),accel_group );
  gtk_widget_grab_focus( SkinList );
 
  return SkinBrowser;
--- Gui/mplayer/gtk/sb.h.orig	Mon May 20 17:56:16 2002
+++ Gui/mplayer/gtk/sb.h	Thu Jan  8 18:54:25 2004
@@ -3,6 +3,8 @@
 
 #include <gtk/gtk.h>
 
+enum SkinBrowserLayout { SkinColumn, NumSkinColumns };
+
 extern GtkWidget * SkinList;
 extern char      * sbSelectedSkin;
 extern char      * sbMPlayerDirInHome;
--- Gui/mplayer/gtk/support.h.orig	Thu Jan  8 18:54:25 2004
+++ Gui/mplayer/gtk/support.h	Thu Jan  8 18:54:25 2004
@@ -0,0 +1,67 @@
+/*
+ * DO NOT EDIT THIS FILE - it is generated by Glade.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+/*
+ * Standard gettext macros.
+ */
+#ifdef ENABLE_NLS
+#  include <libintl.h>
+#  undef _
+#  define _(String) dgettext (PACKAGE, String)
+#  ifdef gettext_noop
+#    define N_(String) gettext_noop (String)
+#  else
+#    define N_(String) (String)
+#  endif
+#else
+#  define textdomain(String) (String)
+#  define gettext(String) (String)
+#  define dgettext(Domain,Message) (Message)
+#  define dcgettext(Domain,Message,Type) (Message)
+#  define bindtextdomain(Domain,Directory) (Domain)
+#  define _(String) (String)
+#  define N_(String) (String)
+#endif
+
+
+/*
+ * Public Functions.
+ */
+
+/*
+ * This function returns a widget in a component created by Glade.
+ * Call it with the toplevel widget in the component (i.e. a window/dialog),
+ * or alternatively any widget in the component, and the name of the widget
+ * you want returned.
+ */
+GtkWidget*  lookup_widget              (GtkWidget       *widget,
+                                        const gchar     *widget_name);
+
+
+/* Use this function to set the directory containing installed pixmaps. */
+void        add_pixmap_directory       (const gchar     *directory);
+
+
+/*
+ * Private Functions.
+ */
+
+/* This is used to create the pixmaps used in the interface. */
+GtkWidget*  create_pixmap              (GtkWidget       *widget,
+                                        const gchar     *filename);
+
+/* This is used to create the pixbufs used in the interface. */
+GdkPixbuf*  create_pixbuf              (const gchar     *filename);
+
+/* This is used to set ATK action descriptions. */
+void        glade_set_atk_action_description (AtkAction       *action,
+                                              const gchar     *action_name,
+                                              const gchar     *description);
+
--- Gui/mplayer/gtk/url.c.orig	Fri May 23 16:58:13 2003
+++ Gui/mplayer/gtk/url.c	Thu Jan  8 18:54:25 2004
@@ -103,12 +103,11 @@
 
  URL=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_name( URL,"URL" );
- gtk_object_set_data( GTK_OBJECT( URL ),"URL",URL );
- gtk_widget_set_usize( URL,384,70 );
+ g_object_set_data( G_OBJECT( URL ),"URL",URL );
+ gtk_widget_set_size_request( URL,384,70 );
  GTK_WIDGET_SET_FLAGS( URL,GTK_CAN_DEFAULT );
  gtk_window_set_title( GTK_WINDOW( URL ),MSGTR_Network );
  gtk_window_set_position( GTK_WINDOW( URL ),GTK_WIN_POS_CENTER );
- gtk_window_set_policy( GTK_WINDOW( URL ),TRUE,TRUE,FALSE );
  gtk_window_set_wmclass( GTK_WINDOW( URL ),"Network","MPlayer" );
  
  gtk_widget_realize( URL );
@@ -133,7 +132,7 @@
 
  hbuttonbox1=AddHButtonBox( vbox1 );
   gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
-  gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
+  gtk_box_set_spacing( GTK_BOX( hbuttonbox1 ),10 );
 
  Ok=AddButton( MSGTR_Ok,hbuttonbox1 );
  Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
@@ -141,9 +140,9 @@
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&URL );
- gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 );
- gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL );
+ g_signal_connect( G_OBJECT( URL ),"destroy",G_CALLBACK( WidgetDestroy ),&URL );
+ g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( on_Button_pressed ),(void *)1 );
+ g_signal_connect( G_OBJECT( Cancel ),"clicked",G_CALLBACK( on_Button_pressed ),NULL );
 
  gtk_widget_grab_focus( URLEntry );
  gtk_window_add_accel_group( GTK_WINDOW( URL ),accel_group );
--- Gui/mplayer/pixmaps/about.xpm.orig	Wed Sep 12 13:47:29 2001
+++ Gui/mplayer/pixmaps/about.xpm	Thu Jan  8 18:54:25 2004
@@ -1,5 +1,5 @@
 /* XPM */
-static char * about_xpm[] = {
+static const char * about_xpm[] = {
 "320 170 254 2",
 "  	c None",
 ". 	c #070707",
--- Gui/mplayer/play.c.orig	Mon May 26 12:45:42 2003
+++ Gui/mplayer/play.c	Thu Jan  8 18:54:25 2004
@@ -194,6 +194,7 @@
    if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
    if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
     { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
+			//TODO: keep the window hidden, because it is annoying to have it flash up.
    wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
    wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
    wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
--- Gui/mplayer/widgets.c.orig	Sat Jan 18 01:39:39 2003
+++ Gui/mplayer/widgets.c	Thu Jan  8 18:54:25 2004
@@ -15,6 +15,10 @@
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
+#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+
+#include <glib.h>
+
 #include "widgets.h"
 
 #include "./mplayer.h"
@@ -53,8 +57,9 @@
 
 // --- init & close gtk
 
-GdkPixmap * gtkIcon = NULL;
-GdkBitmap * gtkIconMask = NULL;
+GdkPixbuf* win_icon = NULL;
+//GdkPixmap * gtkIcon = NULL;
+//GdkBitmap * gtkIconMask = NULL;
 Pixmap	    guiIcon;
 Pixmap	    guiIconMask;
 
@@ -63,46 +68,177 @@
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
  gtk_set_locale();
  gtk_init( 0,NULL );
+ gdk_pixbuf_xlib_init( wsDisplay, wsScreen );
 // gdk_set_use_xshm( TRUE );
 
  {
-  GtkWidget * win;
-  win=gtk_window_new( GTK_WINDOW_TOPLEVEL );
+  if ( !win_icon ) 
+	{
+			win_icon = gdk_pixbuf_new_from_xpm_data( (const char**)MPlayer_mini_xpm );
+				//TODO: use gdk_pixbuf_render_pixmap_and_mask().
+			gdk_pixbuf_xlib_render_pixmap_and_mask( win_icon, &guiIcon, &guiIconMask, 0 );
+	}
+ }
 
-  if ( !gtkIcon ) 
-    gtkIcon=gdk_pixmap_colormap_create_from_xpm_d( win->window,gdk_colormap_get_system(),&gtkIconMask,&win->style->bg[GTK_STATE_NORMAL],MPlayer_mini_xpm );
+ gtkInited=1;
+}
 
-  guiIcon=GDK_WINDOW_XWINDOW( gtkIcon );
-  guiIconMask=GDK_WINDOW_XWINDOW( gtkIconMask );
+void gtkAddIcon( GtkWidget * window )
+{ 
+	 gtk_window_set_icon( GTK_WINDOW( window ), win_icon );
+}
+
+	//NOTE: If you want headers, there need to be at least num_columns strings in column_headers.
+	//			Otherwise, you can pass in NULL for column_headers.
+extern GtkWidget* gtkListNew( gint num_columns, const gchar* column_headers[], gboolean show_headers )
+{
+	int i;
+	GtkListStore* store;
+	GtkWidget* view;
+	GtkCellRenderer* renderer;
+	const gchar* header;
+	GtkTreeViewColumn* column;
+	gboolean use_hdrs = column_headers ? TRUE : FALSE;
+	GType* col_types = g_new0( GType, num_columns );
+
+	for( i = 0; i < num_columns; ++i )
+		col_types[i] = G_TYPE_STRING;
+
+	store = gtk_list_store_newv( num_columns, col_types );
+	g_free( col_types );
+
+	view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) );
+	g_object_unref( G_OBJECT( store ) );
+	
+	renderer = gtk_cell_renderer_text_new( );
+	for( i = 0; i < num_columns; ++i )
+	{
+		header = use_hdrs ? column_headers[i] : "";
+		column = gtk_tree_view_column_new_with_attributes( 
+			header, renderer, "text", i, NULL );
 
-  gtk_widget_destroy( win );
+		gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
  }
  
- gtkInited=1;
+	gtk_tree_view_set_headers_visible ( GTK_TREE_VIEW( view ), show_headers );
+
+	return view;
 }
 
-void gtkAddIcon( GtkWidget * window )
-{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),guiIcon,guiIconMask ); }
+void gtkClearList( GtkTreeView * view )
+{ 
+	gtk_list_store_clear( GTK_LIST_STORE( gtk_tree_view_get_model( view ) ) );  
+}
+
+GtkTreeIter* gtkFindList( GtkTreeView * view,char * item )
+{
+  GtkTreeIter iter;
+	gchar *str_data;
+	GtkTreeModel* model = gtk_tree_view_get_model( view );
+  gboolean valid	= gtk_tree_model_get_iter_first( model, &iter ), 
+										found = FALSE;
+
+  while( valid && !found )
+    {
+      gtk_tree_model_get( model, &iter, 0, &str_data, -1 );
+
+			if( !strcmp( item, str_data ) ) 
+				found = TRUE;
+			else 
+				valid = gtk_tree_model_iter_next( model, &iter );
+
+			g_free( str_data );
+    }
+
+	return found ? gtk_tree_iter_copy( &iter ) : NULL;
+}
+
+gboolean gtkInList( GtkTreeView * view, char * item )
+{
+	gboolean result = FALSE;
 
-void gtkClearList( GtkWidget * list )
-{ gtk_clist_clear( GTK_CLIST( list ) ); }
+	GtkTreeIter* i = gtkFindList( view, item );
+	if( i )
+		{
+		gtk_tree_iter_free( i );
+		result = TRUE;
+		}
+		
+	return result;
+}
 
-int gtkFindCList( GtkWidget * list,char * item )
+void gtkSetDefaultToList( GtkTreeView * view, char * item )
 {
- gint    j,t;
- gchar * tmpstr;
- for( t=0,j=0;j<GTK_CLIST( list )->rows;j++ )
+	GtkTreeIter* i = gtkFindList( view,item );
+	if( i ) 
   {
-   gtk_clist_get_text( GTK_CLIST( list ),j,0,&tmpstr );
-   if ( !strcmp( tmpstr,item ) ) return j;
+		GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
+		gtk_tree_selection_select_iter( selection, i );
+		gtk_tree_iter_free( i );
   }
- return -1;
 }
 
-void gtkSetDefaultToCList( GtkWidget * list,char * item )
+void gtkSelectListItem( GtkTreeView * view, guint column, const gchar* item )
 {
- gint    i;
- if ( ( i=gtkFindCList( list,item ) ) > -1 ) gtk_clist_select_row( GTK_CLIST( list ),i,0 );
+	gtkSetDefaultToList( view, (char*)item ); //TEMP.
+}
+
+void gtkSelectListRow( GtkTreeView * view, guint row )
+{
+	GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
+	GtkTreePath* p = gtk_tree_path_new_from_indices( row,  -1 );
+	gtk_tree_selection_select_path( selection, p );
+	gtk_tree_path_free( p );   
+}
+
+	//Append to the first column.
+void gtkAppendList( GtkTreeView * view, const gchar* item )
+{
+	gtkAppendListN( view, 0, item );
+}
+
+	//Append to a specific column.
+void gtkAppendListN( GtkTreeView * view, guint column, const gchar* item )
+{
+	GtkTreeIter iter;
+	GtkListStore *store = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+	gtk_list_store_append( store, &iter );  
+	gtk_list_store_set( store, &iter, column, item, -1 );	
+}
+
+	//Set an item in then given row and column.
+void gtkSetListN( GtkTreeView * view, guint row, guint column, const gchar* item )
+{
+	GtkTreeIter i;
+	GtkTreeModel* model = gtk_tree_view_get_model( view );
+	
+		//TODO: use this elsewhere.
+	gtk_tree_model_get_iter_first( model, &i );
+	gtk_tree_model_iter_nth_child( model, &i, NULL, row );
+	gtk_list_store_set( GTK_LIST_STORE( model ), &i, column, item, -1 );	
+}
+
+	//These break parameter convention because of how they are used (in loops).
+void gtkAppendList2( GtkTreeModel* model, const gchar* item1, const gchar* item2 )
+{
+	GtkTreeIter i;
+	GtkListStore *store = GTK_LIST_STORE( model );
+
+	gtk_list_store_append( store, &i );  
+	gtk_list_store_set( store, &i, 0, item1, -1 );	
+	gtk_list_store_set( store, &i, 1, item2, -1 );	
+}
+
+void gtkGetList2( GtkTreeModel* model, GtkTreeIter* i, gchar** item1, gchar** item2 )
+{
+	gtk_tree_model_get( model, i, 0, item1, -1 );
+	gtk_tree_model_get( model, i, 1, item2, -1 );
+}
+
+void gtkSortList( GtkTreeView * view )
+{
+	gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE( gtk_tree_view_get_model( view ) ),
+                                        0, GTK_SORT_ASCENDING );
 }
 
 void gtkEventHandling( void )
@@ -128,18 +264,21 @@
   {
     case GTK_MB_FATAL:
          gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_FatalError );
+/*CJE3: disabled
          gtk_widget_hide( WarningPixmap );
-         gtk_widget_show( ErrorPixmap );
+				gtk_widget_show( ErrorPixmap );*/
          break;
     case GTK_MB_ERROR:
          gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Error );
+/*CJE3: disabled
          gtk_widget_hide( WarningPixmap );
-         gtk_widget_show( ErrorPixmap );
+				gtk_widget_show( ErrorPixmap );*/
          break;
     case GTK_MB_WARNING:
          gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Warning );
+/*CJE3: disabled         
          gtk_widget_show( WarningPixmap );
-         gtk_widget_hide( ErrorPixmap );
+				gtk_widget_hide( ErrorPixmap );*/
          break;
   }
  gtk_widget_show( MessageBox );
@@ -155,7 +294,14 @@
 }
 
 void gtkActive( GtkWidget * wdg )
-{ wsMoveTopWindow( gdk_display,GDK_WINDOW_XWINDOW( wdg->window )); }
+{ 
+	//TODO: going to have to fix or remove this.
+	//It can cause mplayer to crash.
+	//A likely replacement is this:
+//gtk_window_present( GTK_WINDOW( wdg ) );
+	//which seems to work well for the skin browser.
+wsMoveTopWindow( gdk_display,GDK_WINDOW_XWINDOW( wdg->window )); 
+}
 
 void gtkShow( int type,char * param )
 {
@@ -167,11 +313,11 @@
 	break;
    case evSkinBrowser:
 	ShowSkinBrowser();
-//        gtkClearList( SkinList );
+        gtkClearList( GTK_TREE_VIEW( SkinList ) );
         if ( gtkFillSkinList( sbMPlayerPrefixDir ) && gtkFillSkinList( sbMPlayerDirInHome ) )
          {
-          gtkSetDefaultToCList( SkinList,param );
-	  gtk_clist_sort( GTK_CLIST( SkinList ) );
+          gtkSetDefaultToList( GTK_TREE_VIEW( SkinList ), param );
+
           gtk_widget_show( SkinBrowser );
 	  gtkSetLayer( SkinBrowser );
          } 
@@ -189,20 +335,16 @@
 	gtkSetLayer( PlayList );
         break;
    case evLoad:
-        ShowFileSelect( fsVideoSelector,0 );
-	gtkSetLayer( fsFileSelect );
+        ShowFileSelect( fsVideoSelector, NULL, FALSE );
         break;
    case evFirstLoad:
-        ShowFileSelect( fsVideoSelector,0 );
-	gtkSetLayer( fsFileSelect );
+        ShowFileSelect( fsVideoSelector, NULL, FALSE );
         break;
    case evLoadSubtitle:
-        ShowFileSelect( fsSubtitleSelector,0 );
-	gtkSetLayer( fsFileSelect );
+        ShowFileSelect( fsSubtitleSelector, NULL, FALSE );
         break;
    case evLoadAudioFile:
-	ShowFileSelect( fsAudioSelector,0 );
-	gtkSetLayer( fsFileSelect );
+				ShowFileSelect( fsAudioSelector, NULL, FALSE );
 	break;
    case evAbout:
 	ShowAboutBox();
@@ -213,11 +355,13 @@
         gtkPopupMenuParam=0;
         if ( PopUpMenu ) 
 	 { 
-	  gtk_widget_hide( PopUpMenu ); 
+		 gtk_menu_popdown( GTK_MENU( PopUpMenu ) ); 
 	  gtk_widget_destroy( PopUpMenu );
 	 }
-        PopUpMenu=create_PopUpMenu();
+	 
+	PopUpMenu=create_PopUpMenu( );
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
+
         break;
    case evHidePopUpMenu:
         if ( PopUpMenu ) 
@@ -222,7 +366,7 @@
    case evHidePopUpMenu:
         if ( PopUpMenu ) 
 	 {
-	  gtk_widget_hide( PopUpMenu );
+		gtk_menu_popdown( GTK_MENU( PopUpMenu ) ); 
 	  gtk_widget_destroy( PopUpMenu );
 	  PopUpMenu=NULL; 
 	 }
--- Gui/mplayer/widgets.h.orig	Sun Feb  9 23:18:16 2003
+++ Gui/mplayer/widgets.h	Thu Jan  8 18:54:25 2004
@@ -36,8 +36,6 @@
 extern char          * sbMPlayerDirInHome;
 extern char          * sbMPlayerPrefixDir;
 
-extern GdkPixmap * gtkIcon;
-extern GdkBitmap * gtkIconMask;
 extern Pixmap      guiIcon;
 extern Pixmap	   guiIconMask;
 
@@ -46,10 +44,31 @@
 extern void gtkInit( void );
 extern void gtkAddIcon( GtkWidget * window );
 
-extern int  gtkFillSkinList( gchar * dir );
-extern void gtkClearList( GtkWidget * list );
-extern void gtkSetDefaultToCList( GtkWidget * list,char * item );
-extern int  gtkFindCList( GtkWidget * list,char * item );
+//TODO: rename these to follow gtk convention:
+//						gtk<Type><Operation>.
+
+	//NOTE: If you want headers, there need to be at least num_columns strings in column_headers.
+	//			Otherwise, you can pass in NULL for column_headers.
+extern GtkWidget* gtkListNew( gint num_columns, const gchar* column_headers[], gboolean show_headers );
+extern void gtkClearList( GtkTreeView * list );
+extern void gtkSetDefaultToList( GtkTreeView * view, char * item );//Deprecated. Use gtkSelectListItem().
+extern void gtkSelectListItem( GtkTreeView* view, guint column, const gchar* item );
+extern GtkTreeIter* gtkFindList( GtkTreeView * view, char * item );
+extern void gtkSelectListRow( GtkTreeView * view, guint row );
+extern gboolean gtkInList( GtkTreeView * view, char * item );
+	//Append to the first column.
+extern void gtkAppendList( GtkTreeView * view, const gchar* item );
+	//Append to a specific column.
+extern void gtkAppendListN( GtkTreeView * view, guint column, const gchar* item );
+extern void gtkSetListN( GtkTreeView * view, guint row, guint column, const gchar* item );
+
+	//These break parameter convention because of how they are used (in loops).
+	//Append items to two columns.
+void gtkAppendList2( GtkTreeModel* model, const gchar* item1, const gchar* item2 );
+	//Get items from two columns.
+void gtkGetList2( GtkTreeModel* model, GtkTreeIter* i, gchar** item1, gchar** item2 );
+
+extern void gtkSortList( GtkTreeView * view );
 
 extern void gtkEventHandling( void );
 
--- configure.orig	Tue Dec  9 00:33:31 2003
+++ configure	Thu Jan  8 19:02:04 2004
@@ -148,7 +148,7 @@
 
 Optional features:
   --disable-mencoder     disable mencoder (a/v encoder) compilation [enable]
-  --enable-gui           enable gmplayer compilation (gtk-1.2 GUI) [disable]
+  --enable-gui           enable gmplayer compilation (gtk-2 GUI) [disable]
   --enable-largefiles    enable support for files > 2 GBytes [disable]
   --enable-linux-devfs   set default devices to devfs ones [disable]
   --enable-termcap       use termcap database for key codes [autodetect]
@@ -314,8 +314,6 @@
   --with-sdl-config=PATH   path to sdl*-config (e.g. /opt/bin/sdl-config)
   --with-freetype-config=PATH  path to freetype-config
                                (e.g. /opt/bin/freetype-config)
-  --with-gtk-config=PATH   path to gtk*-config (e.g. /opt/bin/gtk-config)
-  --with-glib-config=PATH  path to glib*-config (e.g. /opt/bin/glib-config)
   --with-livelibdir=DIR    path to LIVE.COM Streaming Media libraries
   --with-xmmsplugindir=DIR path to XMMS plugins
   --with-xmmslibdir=DIR    path to libxmms.so.1
@@ -1542,12 +1540,6 @@
   --with-fribidi-config=*)
     _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
     ;;
-  --with-gtk-config=*)
-    _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
-    ;;
-  --with-glib-config=*)
-    _glibconfig=`echo $ac_option | cut -d '=' -f 2`
-    ;;
 # dvdnav disabled, it does not work
 #  --with-dvdnav-config=*)
 #    _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
@@ -5541,35 +5533,45 @@
   # Check for GTK:
   echocheck "gtk version"
   if test -z "$_gtkconfig" ; then
-    if ( gtk-config --version ) >/dev/null 2>&1 ; then
-      _gtkconfig="gtk-config"
-    elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
-      _gtkconfig="gtk12-config"
+    if ( pkg-config gtk+-2.0 --exists ) >/dev/null 2>&1 ; then
+       _gtkconfig="pkg-config gtk+-2.0"
     else
       die "The GUI requires GTK devel packages (which were not found)."
     fi
   fi
-  _gtk=`$_gtkconfig --version 2>&1`
-  _inc_gtk=`$_gtkconfig --cflags 2>&1`
+  _gtk=`$_gtkconfig --modversion 2>&1`
+  _inc_gtk="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED "`$_gtkconfig --cflags 2>&1`
   _ld_gtk=`$_gtkconfig --libs 2>&1`
   echores "$_gtk (using $_gtkconfig)"
 
   # Check for GLIB
   echocheck "glib version"
   if test -z "$_glibconfig" ; then
-    if ( glib-config --version ) >/dev/null 2>&1 ; then
-      _glibconfig="glib-config"
-    elif ( glib12-config --version ) >/dev/null 2>&1 ; then
-      _glibconfig="glib12-config"
+    if ( pkg-config glib-2.0 --exists ) >/dev/null 2>&1 ; then
+       _glibconfig="pkg-config glib-2.0"
     else
       die "The GUI requires GLib devel packages (which were not found)"
     fi
   fi
-  _glib=`$_glibconfig --version 2>&1`
-  _inc_glib=`$_glibconfig --cflags 2>&1`
+  _glib=`$_glibconfig --modversion 2>&1`
+  _inc_glib="-DG_DISABLE_DEPRECATED "`$_glibconfig --cflags 2>&1`
   _ld_glib=`$_glibconfig --libs 2>&1`
   echores "$_glib (using $_glibconfig)"
 
+   # Check for GDK Pixbuf
+   echocheck "gdk-pixbuf version"
+   if test -z "$_gdkpixbufconfig" ; then
+     if ( pkg-config  gdk-pixbuf-xlib-2.0 --exists ) >/dev/null 2>&1 ; then
+       _gdkpixbufconfig="pkg-config gdk-pixbuf-xlib-2.0"
+     else
+       die "the GUI requires GDK Pixbuf (which was not found)"
+     fi
+   fi
+   _gdkpixbuf=`$_gdkpixbufconfig --modversion 2>&1`
+   _inc_gdkpixbuf="-DGDK_PIXBUF_DISABLE_DEPRECATED "`$_gdkpixbufconfig --cflags 2>&1`
+   _ld_gdkpixbuf=`$_gdkpixbufconfig --libs 2>&1`
+   echores "$_gdkpixbuf (using $_gdkpixbufconfig)"
+
   _def_gui='#define HAVE_NEW_GUI 1'
   _ld_gui='$(GTKLIB) $(GLIBLIB)'
 
@@ -5577,8 +5579,8 @@
   cat > Gui/config.mak << EOF
 # -------- Generated by configure -----------
 
-GTKINC = $_inc_gtk
-GTKLIBS = $_ld_gtk
+GTKINC = $_inc_gtk $_inc_gdkpixbuf
+GTKLIBS = $_ld_gtk $_ld_gdkpixbuf
 GLIBINC = $_inc_glib
 GLIBLIBS = $_ld_glib
 
@@ -5792,7 +5794,7 @@
 RANLIB = $_ranlib
 INSTALL = $_install
 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu -pipe -fomit-frame-pointer -ffast-math
-EXTRA_INC = $_inc_extra $_inc_gtk
+EXTRA_INC = $_inc_extra $_inc_gtk $_inc_gdkpixbuf
 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
 STRIPBINARIES = $_stripbinaries
 
@@ -5924,7 +5926,7 @@
 TARGET_ALTIVEC = $_altivec
 
 # --- GUI stuff ---
-GTKLIB = $_ld_static $_ld_gtk
+GTKLIB = $_ld_static $_ld_gtk $_ld_gdkpixbuf
 GLIBLIB = $_ld_static  $_ld_glib
 GTK_LIBS =  $_ld_static $_ld_gui
 GUI = $_gui

	Wow, you're still here? Strong man :-). Okay, the finest piece of patching -
	the port's Makefile. As you can see, pre-install is the complete dirty hack
	caused by spontaneous changes in MPlayer's documentation structure. I didn't
	dig into its methods of installing docs, I just found the analogues and made
	links. Amazingly, de/, it/, hu/ and zh/ documentation pieces remained the
	old style, so it's maybe MPlayer developers's bug, but anyway.

	Well, stop babbling now, patch follows:

--- Makefile.orig	Thu Jan  8 19:07:29 2004
+++ Makefile	Fri Jan  9 11:57:06 2004
@@ -169,8 +169,7 @@
 # to be installed.
 
 PORTNAME=	mplayer
-PORTVERSION=	0.92.0
-PORTREVISION=	4
+PORTVERSION=	1.0pre3
 CATEGORIES=	multimedia audio ipv6
 MASTER_SITES=	http://www1.mplayerhq.hu/MPlayer/releases/ \
 		http://www2.mplayerhq.hu/MPlayer/releases/ \
@@ -182,11 +181,7 @@
 		ftp://ftp.lug.udel.edu/MPlayer/releases/ \
 		ftp://mirrors.xmission.com/MPlayer/releases/ \
 		http://www.rrr.de/~riggs/mplayer/
-DISTNAME=	MPlayer-0.92
-
-PATCH_SITES=	${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/kame/misc/&,}
-PATCHFILES=	mplayer-0.9.2-v6-20030930.diff.gz
-PATCH_DIST_STRIP=	-p1
+DISTNAME=	MPlayer-1.0pre3
 
 MAINTAINER=	riggs@rrr.de
 COMMENT=	High performance media player/encoder supporting many formats
@@ -322,7 +317,7 @@
 CFLAGS+=	-O3 -ffast-math -fomit-frame-pointer
 .endif
 
-.if ${HAVE_GNOME:Mgtk12}!=""
+.if ${HAVE_GNOME:Mgtk20}!=""
 WITH_GUI=	yes
 PLIST_SUB+=	GMPLAYER=""
 .else
@@ -330,12 +325,12 @@
 .endif
 
 .if defined(WITH_GUI)
-USE_GNOME+=	gtk12
+USE_GNOME+=	gtk20
 RUN_DEPENDS+=	${LOCALBASE}/share/mplayer/Skin:${PORTSDIR}/multimedia/mplayer-skins
 .if defined(PKGNAMESUFFIX)
-PKGNAMESUFFIX:=	${PKGNAMESUFFIX}-gtk
+PKGNAMESUFFIX:=	${PKGNAMESUFFIX}-gtk2
 .else
-PKGNAMESUFFIX=	-gtk
+PKGNAMESUFFIX=	-gtk2
 .endif
 CONFIGURE_ARGS+=	--enable-gui
 .endif
@@ -559,6 +554,20 @@
 post-configure:
 	@${REINPLACE_CMD} -e 's#-pthread#${PTHREAD_LIBS}#g' \
 		${WRKSRC}/config.mak
+
+pre-install:
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/bugreports.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/cd-dvd.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/tech/codecs-in.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/codecs.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/index.html ${WRKSRC}/DOCS/documentation.html
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/faq.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/skin.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/mencoder.html ${WRKSRC}/DOCS/encoding.html
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/formats.html ${WRKSRC}/DOCS
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/bugs-audio.html ${WRKSRC}/DOCS/sound.html
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/users-vs-dev.html ${WRKSRC}/DOCS/users_against_developers.html
+	@${LN} -sf ${WRKSRC}/DOCS/HTML/en/vcd.html ${WRKSRC}/DOCS/video.html
 
 post-install:
 	@${MKDIR} ${DATADIR}
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401090915.i099FO0r010820>