#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../../../mixer.h"
#include "../../../libao2/audio_out.h"
#include "../../../libvo/video_out.h"
#include "../../cfg.h"
#include "../../interface.h"
#include "../widgets.h"
#include "opts.h"
#include "fs.h"
#include "common.h"
typedef struct sh_video_t sh_video_t;
typedef struct sh_audio_t sh_audio_t;
// for mpcodecs_[av]d_drivers:
#include "../../../libmpcodecs/vd.h"
#include "../../../libmpcodecs/ad.h"
GtkWidget * Preferences = NULL;
static GtkWidget * AConfig;
static GtkWidget * VConfig;
//static GtkWidget * BLoadSubtitle;
static GtkWidget * BLoadFont;
static GtkWidget * BOk;
static GtkWidget * BCancel;
static GtkWidget * CLADrivers;
static GtkWidget * CLVDrivers;
//static GtkWidget * ESubtitleName;
GtkWidget * prEFontName;
GtkWidget * prEDVDDevice;
GtkWidget * prECDRomDevice;
static GtkWidget * EVFM;
static GtkWidget * EAFM;
static GtkWidget * CBVFM;
static GtkWidget * CBAFM;
static GtkWidget * CBAudioEqualizer;
//static GtkWidget * CBSurround;
static GtkWidget * CBExtraStereo;
static GtkWidget * CBNormalize;
static GtkWidget * CBDoubleBuffer;
static GtkWidget * CBDR;
static GtkWidget * CBFramedrop;
static GtkWidget * CBHFramedrop;
//static GtkWidget * CBFullScreen;
static GtkWidget * CBNonInterlaved;
static GtkWidget * CBIndex;
static GtkWidget * CBFlip;
static GtkWidget * CBNoAutoSub;
static GtkWidget * CBSubUnicode;
static GtkWidget * CBSubOverlap;
static GtkWidget * CBDumpMPSub;
static GtkWidget * CBDumpSrt;
static GtkWidget * CBPostprocess;
static GtkWidget * CBCache;
static GtkWidget * CBLoadFullscreen;
static GtkWidget * CBStopXScreenSaver;
static GtkWidget * SBCache;
static GtkAdjustment * SBCacheadj;
static GtkWidget * CBAutoSync;
static GtkWidget * SBAutoSync;
static GtkAdjustment * SBAutoSyncadj;
static GtkWidget * RBOSDNone;
static GtkWidget * RBOSDTandP;
static GtkWidget * RBOSDIndicator;
static GtkWidget * RBOSDTPTT;
static GtkWidget * HSAudioDelay;
static GtkWidget * HSExtraStereoMul;
static GtkWidget * HSPanscan;
static GtkWidget * HSSubDelay;
static GtkWidget * HSSubPosition;
static GtkWidget * HSSubFPS;
static GtkWidget * HSPPQuality;
static GtkAdjustment * HSExtraStereoMuladj, * HSAudioDelayadj, * HSPanscanadj, * HSSubDelayadj;
static GtkAdjustment * HSSubPositionadj, * HSSubFPSadj, * HSPPQualityadj;
#ifndef HAVE_FREETYPE
static GtkWidget * HSFontFactor;
static GtkAdjustment * HSFontFactoradj;
#else
static GtkWidget * HSFontBlur, * HSFontOutLine, * HSFontTextScale, * HSFontOSDScale;
static GtkAdjustment * HSFontBluradj, * HSFontOutLineadj, * HSFontTextScaleadj, * HSFontOSDScaleadj;
static GtkWidget * CBFontEncoding, * EFontEncoding;
static GtkWidget * RBFontNoAutoScale, * BRFontAutoScaleWidth, * RBFontAutoScaleHeight, * RBFontAutoScaleDiagonal;
//static GtkWidget * AutoScale;
#endif
#ifdef HAVE_FREETYPE
static struct
{
char * name;
char * comment;
} lEncoding[] =
{
{ "unicode", MSGTR_PREFERENCES_FontEncoding1 },
{ "iso-8859-1", MSGTR_PREFERENCES_FontEncoding2 },
{ "iso-8859-15", MSGTR_PREFERENCES_FontEncoding3 },
{ "iso-8859-2", MSGTR_PREFERENCES_FontEncoding4 },
{ "iso-8859-3", MSGTR_PREFERENCES_FontEncoding5 },
{ "iso-8859-4", MSGTR_PREFERENCES_FontEncoding6 },
{ "iso-8859-5", MSGTR_PREFERENCES_FontEncoding7 },
{ "cp1251", MSGTR_PREFERENCES_FontEncoding21},
{ "iso-8859-6", MSGTR_PREFERENCES_FontEncoding8 },
{ "iso-8859-7", MSGTR_PREFERENCES_FontEncoding9 },
{ "iso-8859-9", MSGTR_PREFERENCES_FontEncoding10 },
{ "iso-8859-13", MSGTR_PREFERENCES_FontEncoding11 },
{ "iso-8859-14", MSGTR_PREFERENCES_FontEncoding12 },
{ "iso-8859-8", MSGTR_PREFERENCES_FontEncoding13 },
{ "koi8-r", MSGTR_PREFERENCES_FontEncoding14 },
{ "koi8-u/ru", MSGTR_PREFERENCES_FontEncoding15 },
{ "cp936", MSGTR_PREFERENCES_FontEncoding16 },
{ "big5", MSGTR_PREFERENCES_FontEncoding17 },
{ "shift-jis", MSGTR_PREFERENCES_FontEncoding18 },
{ "cp949", MSGTR_PREFERENCES_FontEncoding19 },
{ "cp874", MSGTR_PREFERENCES_FontEncoding20 },
{ NULL,NULL }
};
char * lCEncoding = NULL;
#endif
static int old_audio_driver = 0;
static char * ao_driver[3];
static char * vo_driver[3];
static int old_video_driver = 0;
#ifdef USE_OSS_AUDIO
void ShowOSSConfig( void );
void HideOSSConfig( void );
#endif
#ifdef HAVE_DXR3
void ShowDXR3Config( void );
void HideDXR3Config( void );
#endif
#ifdef HAVE_SDL
void ShowSDLConfig( void );
void HideSDLConfig( void );
#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 );
#ifdef HAVE_FREETYPE
static void prEntry( GtkContainer * container,GtkWidget * widget,gpointer user_data );
#endif
extern int muted;
extern int stop_xscreensaver;
void ShowPreferences( void )
{
if ( Preferences ) gtkActive( Preferences );
else Preferences=create_Preferences();
// -- 1. page
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ),gtkEnableAudioEqualizer );
#if 0
gtk_toggle_butto
|