mirror of https://github.com/mpv-player/mpv
fix some gtk bug...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6147 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c7b919a1b9
commit
4c6ce6a195
|
@ -7,8 +7,24 @@
|
||||||
#include "../widgets.h"
|
#include "../widgets.h"
|
||||||
#include "about.h"
|
#include "about.h"
|
||||||
|
|
||||||
|
int gtkVAboutBox = 0;
|
||||||
|
GtkWidget * AboutBox;
|
||||||
|
|
||||||
|
void ShowAboutBox( void )
|
||||||
|
{
|
||||||
|
if ( gtkVAboutBox ) gtkActive( AboutBox );
|
||||||
|
else AboutBox=create_About();
|
||||||
|
gtk_widget_show( AboutBox );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ab_AboutBox_show( GtkButton * button,gpointer user_data )
|
||||||
|
{ gtkVAboutBox=(int)user_data; }
|
||||||
|
|
||||||
void ab_Ok_released( GtkButton * button,gpointer user_data )
|
void ab_Ok_released( GtkButton * button,gpointer user_data )
|
||||||
{ gtk_widget_destroy( AboutBox ); }
|
{
|
||||||
|
gtkVAboutBox=(int)user_data;
|
||||||
|
gtk_widget_destroy( AboutBox );
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget * create_About( void )
|
GtkWidget * create_About( void )
|
||||||
{
|
{
|
||||||
|
@ -115,65 +131,79 @@ GtkWidget * create_About( void )
|
||||||
gtk_widget_show( AboutText );
|
gtk_widget_show( AboutText );
|
||||||
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
|
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
|
||||||
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
|
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
|
||||||
"\nMPlayer code:\n" \
|
"\n" \
|
||||||
" fileformat detection,demuxers - A'rpi\n" \
|
" MPlayer core team:\n" \
|
||||||
" DVD support - ( alpha version was: LGB ) now: ?\n" \
|
"\n" \
|
||||||
" network streaming - Bertrand BAUDET\n" \
|
" * Arpad Gereoffy (A'rpi/ESP-team)\n" \
|
||||||
" A-V sync code - A'rpi\n" \
|
" * Zoltan Ponekker (Pontscho/Fresh!mindworkz)\n" \
|
||||||
" subtitles file parser/reader - Lez( most of them )\n" \
|
" * Gabor Berczi (Gabucino)\n" \
|
||||||
" config files & commandline parser - Szabi\n" \
|
" * Alex Beregszaszi (al3x)\n" \
|
||||||
" fastmemcpy - Nick Kurshev\n" \
|
" * Gabor Lenart (LGB)\n" \
|
||||||
" LIRC support - Acki\n" \
|
" * Felix Bunemann (Atmos)\n" \
|
||||||
" SUB/OSD renderer - Adam Tla/lka\n" \
|
" * Alban Bedel (Albeu)\n" \
|
||||||
" Gui - Pontscho\n\nlibvo drivers:\n" \
|
" * pl\n" \
|
||||||
" vo_aa.c - Folke Ashberg\n" \
|
" * Michael Niedermayer\n" \
|
||||||
" vo_dga.c - Acki\n" \
|
"\n" \
|
||||||
" vo_fbdev.c - Szabi\n" \
|
" Additional codes:\n" \
|
||||||
" vo_ggi.c - al3x\n" \
|
"\n" \
|
||||||
" vo_gl.c - A'rpi\n" \
|
" * Szabolcs Berecz (Szabi)\n" \
|
||||||
" vo_md5.c - A'rpi\n" \
|
" * Laszlo Megyer (Lez, Laaz)\n" \
|
||||||
" vo_mga.c - A'rpi\n" \
|
" * Gyula Laszlo (Chass, Tegla)\n" \
|
||||||
" vo_null.c - A'rpi\n" \
|
" * Zoltan Mark Vician (Se7en)\n" \
|
||||||
" vo_odivx.c - A'rpi\n" \
|
" * Andreas Ackermann (Acki)\n" \
|
||||||
" vo_pgm.c - A'rpi\n" \
|
" * TeLeNiEkO\n" \
|
||||||
" vo_png.c - Atmos\n" \
|
" * Michael Graffam\n" \
|
||||||
" vo_sdl.c - Atmos\n" \
|
" * Jens Hoffmann\n" \
|
||||||
" vo_svga.c - se7en\n" \
|
" * German Gomez Garcia\n" \
|
||||||
" vo_x11.c - Pontscho\n"\
|
" * Dariusz Pietrzak (Eyck)\n" \
|
||||||
" vo_xmga.c - Pontscho\n"\
|
" * Marcus Comstedt\n" \
|
||||||
" vo_xv.c - Pontscho\n" \
|
" * Jurgen Keil\n" \
|
||||||
" vo_aa.c - Folke Ashberg\n\n" \
|
" * Vladimir Kushnir\n" \
|
||||||
"libao2 drivers:\n" \
|
" * Bertrand BAUDET\n" \
|
||||||
" ao_alsa5.c - al3x\n" \
|
" * Derek J Witt\n" \
|
||||||
" ao_alsa9.c - al3x( BUGGY,use oss )\n" \
|
" * Artur Zaprzala\n" \
|
||||||
" ao_null.c - A'rpi\n" \
|
" * lanzz@lanzz.org\n" \
|
||||||
" ao_oss.c - A'rpi\n" \
|
" * Adam Tla/lka\n" \
|
||||||
" ao_pcm.c - Atmos\n" \
|
" * Folke Ashberg\n" \
|
||||||
" ao_sdl.c - Atmos\n" \
|
" * Kamil Toman\n" \
|
||||||
" ao_sun.c - Jürgen Keil\n\n" \
|
" * Ivan Kalvatchev\n" \
|
||||||
"Homepage:\n" \
|
" * Sven Goethel\n" \
|
||||||
" Design: Chass\n" \
|
" * joy_ping\n" \
|
||||||
" Contents: Gabucino\n" \
|
" * Eric Anholt\n" \
|
||||||
" LGB\n\n" \
|
" * Jiri Svoboda\n" \
|
||||||
"English documentation:\n" \
|
" * Oliver Schoenbrunner\n" \
|
||||||
" tech-*.txt: A'rpi\n" \
|
" * Jeroen Dobbelaere\n" \
|
||||||
" all the others: Gabucino\n\n" \
|
" * David Holm\n" \
|
||||||
"Documentation translations:\n" \
|
" * Panagiotis Issaris\n" \
|
||||||
" Hungarian - Gabucino\n" \
|
" * Mike Melanson\n" \
|
||||||
" Spanish - TeLeNiEkO\n" \
|
" * Tobias Diedrich\n" \
|
||||||
" Russian - Nick Kurshev\n" \
|
" * Kilian A. Foth\n" \
|
||||||
" Polish - Dariush Pietrzak\n" \
|
" * Tim Ferguson\n" \
|
||||||
" German - Atmosfear\n\n" \
|
" * Sam Lin\n" \
|
||||||
"Platforms/ports:\n" \
|
" * Johannes Feigl\n" \
|
||||||
" DEBIAN packaging - Dariush Pietrzak\n" \
|
" * Kim Minh Kaplan\n" \
|
||||||
" FreeBSD support - Vladimir Kushnir\n" \
|
" * Brian Kuschak\n" \
|
||||||
" Solaris 8 support - Jürgen Keil\n",1535 );
|
" * Stephen Davies\n" \
|
||||||
|
" * Rik Snel\n" \
|
||||||
|
" * Anders Johansson\n" \
|
||||||
|
" * Roberto Togni\n" \
|
||||||
|
" * Wojtek Kaniewski\n" \
|
||||||
|
" * Fredrik Kuivinen\n" \
|
||||||
|
"\n" \
|
||||||
|
" Main testers:\n" \
|
||||||
|
"\n" \
|
||||||
|
" * Tibor Balazs (Tibcu)\n" \
|
||||||
|
" * Peter Sasi (SaPe)\n" \
|
||||||
|
" * Christoph H. Lampert\n" \
|
||||||
|
" * Attila Kinali\n" \
|
||||||
|
" * Dirk Vornheder\n" \
|
||||||
|
" * Bohdan Horst (Nexus)\n" \
|
||||||
|
"\n",1481 );
|
||||||
|
|
||||||
hseparator1=gtk_hseparator_new();
|
hseparator1=gtk_hseparator_new();
|
||||||
gtk_widget_set_name( hseparator1,"hseparator1" );
|
gtk_widget_set_name( hseparator1,"hseparator1" );
|
||||||
gtk_widget_ref( hseparator1 );
|
gtk_widget_ref( hseparator1 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,
|
gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( hseparator1 );
|
gtk_widget_show( hseparator1 );
|
||||||
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
|
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
|
||||||
gtk_widget_set_usize( hseparator1,-2,10 );
|
gtk_widget_set_usize( hseparator1,-2,10 );
|
||||||
|
@ -181,8 +211,7 @@ GtkWidget * create_About( void )
|
||||||
hbuttonbox1=gtk_hbutton_box_new( );
|
hbuttonbox1=gtk_hbutton_box_new( );
|
||||||
gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
|
gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
|
||||||
gtk_widget_ref( hbuttonbox1 );
|
gtk_widget_ref( hbuttonbox1 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,
|
gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_set_usize( hbuttonbox1,-2,25 );
|
gtk_widget_set_usize( hbuttonbox1,-2,25 );
|
||||||
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 );
|
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox1 ),75,0 );
|
||||||
gtk_widget_show( hbuttonbox1 );
|
gtk_widget_show( hbuttonbox1 );
|
||||||
|
@ -195,8 +224,10 @@ GtkWidget * create_About( void )
|
||||||
gtk_widget_show( Ok );
|
gtk_widget_show( Ok );
|
||||||
gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
|
gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
|
gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),0 );
|
||||||
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
|
gtk_signal_connect( GTK_OBJECT( About ),"show",GTK_SIGNAL_FUNC( ab_AboutBox_show ),1 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( About ),"hide",GTK_SIGNAL_FUNC( ab_AboutBox_show ),0 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),0 );
|
||||||
|
|
||||||
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
||||||
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
|
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
extern GtkWidget * AboutBox;
|
||||||
|
|
||||||
extern GtkWidget * create_About( void );
|
extern GtkWidget * create_About( void );
|
||||||
|
extern void ShowAboutBox( void );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,6 +38,8 @@ int fsPressed = 0;
|
||||||
int fsMessage = -1;
|
int fsMessage = -1;
|
||||||
int fsType = 0;
|
int fsType = 0;
|
||||||
|
|
||||||
|
int gtkVFileSelect = 0;
|
||||||
|
|
||||||
#define fsNumberOfVideoFilterNames 9
|
#define fsNumberOfVideoFilterNames 9
|
||||||
char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] =
|
char * fsVideoFilterNames[fsNumberOfVideoFilterNames+1][2] =
|
||||||
{ { "MPEG files (*.mpg,*.mpeg)", "*.mpg,*.mpeg" },
|
{ { "MPEG files (*.mpg,*.mpeg)", "*.mpg,*.mpeg" },
|
||||||
|
@ -186,7 +188,9 @@ static int FirstInit = 1;
|
||||||
void ShowFileSelect( int type )
|
void ShowFileSelect( int type )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
FileSelect=create_FileSelect();
|
|
||||||
|
if ( gtkVFileSelect ) gtkActive( fsFileSelect );
|
||||||
|
else fsFileSelect=create_FileSelect();
|
||||||
|
|
||||||
if ( FirstInit )
|
if ( FirstInit )
|
||||||
{
|
{
|
||||||
|
@ -231,11 +235,15 @@ void ShowFileSelect( int type )
|
||||||
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[fsNumberOfOtherFilterNames][0] );
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[fsNumberOfOtherFilterNames][0] );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gtk_widget_show( FileSelect );
|
gtk_widget_show( fsFileSelect );
|
||||||
}
|
}
|
||||||
|
|
||||||
void HideFileSelect( void )
|
void HideFileSelect( void )
|
||||||
{ gtk_widget_destroy( fsFileSelect ); }
|
{
|
||||||
|
gtk_widget_hide( fsFileSelect );
|
||||||
|
gtk_widget_destroy( fsFileSelect );
|
||||||
|
gtkVFileSelect=0;
|
||||||
|
}
|
||||||
|
|
||||||
void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
|
void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
|
||||||
{ HideFileSelect(); }
|
{ HideFileSelect(); }
|
||||||
|
@ -336,8 +344,6 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HideFileSelect();
|
|
||||||
|
|
||||||
switch( fsPressed )
|
switch( fsPressed )
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -346,7 +352,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||||
case 2:
|
case 2:
|
||||||
str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
|
str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
|
||||||
fsSelectedFile=str;
|
fsSelectedFile=str;
|
||||||
if ( !fsFileExist( fsSelectedFile ) ) return;
|
if ( !fsFileExist( fsSelectedFile ) ) { HideFileSelect(); return; }
|
||||||
fsSelectedDirectory=fsSelectedFile;
|
fsSelectedDirectory=fsSelectedFile;
|
||||||
size=strlen( fsSelectedDirectory );
|
size=strlen( fsSelectedDirectory );
|
||||||
for ( j=0;j<size;j++ )
|
for ( j=0;j<size;j++ )
|
||||||
|
@ -375,6 +381,9 @@ void fs_Ok_released( GtkButton * button,gpointer user_data )
|
||||||
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
|
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HideFileSelect();
|
||||||
|
|
||||||
item=fsTopList_items;
|
item=fsTopList_items;
|
||||||
while( item )
|
while( item )
|
||||||
{
|
{
|
||||||
|
@ -413,6 +422,9 @@ gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fs_FileSelect_show( GtkWidget * widget,gpointer user_data )
|
||||||
|
{ gtkVFileSelect=(int)user_data; }
|
||||||
|
|
||||||
GtkWidget * create_FileSelect( void )
|
GtkWidget * create_FileSelect( void )
|
||||||
{
|
{
|
||||||
GtkWidget * FSFrame;
|
GtkWidget * FSFrame;
|
||||||
|
@ -639,6 +651,10 @@ GtkWidget * create_FileSelect( void )
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_fsFileSelect_destroy ),NULL );
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_fsFileSelect_destroy ),NULL );
|
||||||
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"show",GTK_SIGNAL_FUNC( fs_FileSelect_show ),1 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"hide",GTK_SIGNAL_FUNC( fs_FileSelect_show ),0 );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
|
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( 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 ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#define fsSubtitleSelector 1
|
#define fsSubtitleSelector 1
|
||||||
#define fsOtherSelector 2
|
#define fsOtherSelector 2
|
||||||
|
|
||||||
|
extern GtkWidget * fsFileSelect;
|
||||||
|
|
||||||
extern void HideFileSelect( void );
|
extern void HideFileSelect( void );
|
||||||
extern void ShowFileSelect( int type );
|
extern void ShowFileSelect( int type );
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,22 @@
|
||||||
#include "mb.h"
|
#include "mb.h"
|
||||||
|
|
||||||
GtkWidget * gtkMessageBoxText;
|
GtkWidget * gtkMessageBoxText;
|
||||||
|
GtkWidget * MessageBox;
|
||||||
|
|
||||||
static void on_MessageBox_Ok_released( GtkButton * button,gpointer user_data )
|
int gtkVMessageBox = 0;
|
||||||
{ gtk_widget_destroy( MessageBox ); }
|
|
||||||
|
void ShowMessageBox( char * msg )
|
||||||
|
{
|
||||||
|
if ( gtkVMessageBox ) gtkActive( MessageBox );
|
||||||
|
else MessageBox=create_MessageBox( 0 );
|
||||||
|
if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void on_Ok_released( GtkButton * button,gpointer user_data )
|
||||||
|
{ gtkVMessageBox=0; gtk_widget_destroy( MessageBox ); }
|
||||||
|
|
||||||
|
static void on_MessageBox_show( GtkButton * button,gpointer user_data )
|
||||||
|
{ gtkVMessageBox=(int)user_data; }
|
||||||
|
|
||||||
GtkWidget * create_MessageBox( int type )
|
GtkWidget * create_MessageBox( int type )
|
||||||
{
|
{
|
||||||
|
@ -117,7 +130,7 @@ GtkWidget * create_MessageBox( int type )
|
||||||
gtk_widget_show( gtkMessageBoxText );
|
gtk_widget_show( gtkMessageBoxText );
|
||||||
gtk_box_pack_start( GTK_BOX( hbox1 ),gtkMessageBoxText,TRUE,TRUE,0 );
|
gtk_box_pack_start( GTK_BOX( hbox1 ),gtkMessageBoxText,TRUE,TRUE,0 );
|
||||||
gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL );
|
gtk_label_set_justify( GTK_LABEL( gtkMessageBoxText ),GTK_JUSTIFY_FILL );
|
||||||
gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),TRUE );
|
gtk_label_set_line_wrap( GTK_LABEL( gtkMessageBoxText ),FALSE );
|
||||||
|
|
||||||
hseparator1=gtk_hseparator_new();
|
hseparator1=gtk_hseparator_new();
|
||||||
gtk_widget_set_name( hseparator1,"hseparator1" );
|
gtk_widget_set_name( hseparator1,"hseparator1" );
|
||||||
|
@ -145,8 +158,10 @@ GtkWidget * create_MessageBox( int type )
|
||||||
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
|
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
|
||||||
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy_event",GTK_SIGNAL_FUNC( on_MessageBox_Ok_released ),NULL );
|
gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy_event",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
|
||||||
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_MessageBox_Ok_released ),NULL );
|
gtk_signal_connect( GTK_OBJECT( MessageBox ),"show",GTK_SIGNAL_FUNC( on_MessageBox_show ),1 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( MessageBox ),"hide",GTK_SIGNAL_FUNC( on_MessageBox_show ),0 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
|
||||||
|
|
||||||
gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
|
gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
extern GtkWidget * gtkMessageBoxText;
|
extern GtkWidget * gtkMessageBoxText;
|
||||||
|
extern GtkWidget * MessageBox;
|
||||||
|
|
||||||
extern GtkWidget * create_MessageBox( int type );
|
extern GtkWidget * create_MessageBox( int type );
|
||||||
|
extern void ShowMessageBox( char * msg );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,6 +22,21 @@ char * sbMPlayerPrefixDir=NULL;
|
||||||
char * gtkOldSkin;
|
char * gtkOldSkin;
|
||||||
static char * prev;
|
static char * prev;
|
||||||
|
|
||||||
|
int gtkVSkinBrowser = 0;
|
||||||
|
GtkWidget * SkinBrowser;
|
||||||
|
|
||||||
|
void ShowSkinBrowser( void )
|
||||||
|
{
|
||||||
|
if ( gtkVSkinBrowser ) gtkActive( SkinBrowser );
|
||||||
|
else SkinBrowser=create_SkinBrowser();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HideSkinBrowser( void )
|
||||||
|
{
|
||||||
|
gtkVSkinBrowser=0;
|
||||||
|
gtk_widget_destroy( SkinBrowser );
|
||||||
|
}
|
||||||
|
|
||||||
int gtkFillSkinList( gchar * mdir )
|
int gtkFillSkinList( gchar * mdir )
|
||||||
{
|
{
|
||||||
gchar * str[2];
|
gchar * str[2];
|
||||||
|
@ -62,12 +77,15 @@ int gtkFillSkinList( gchar * mdir )
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
|
void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
|
||||||
{ gtk_widget_destroy( SkinBrowser ); }
|
{ HideSkinBrowser(); }
|
||||||
|
|
||||||
|
void on_SkinBrowser_show( GtkObject * object,gpointer user_data )
|
||||||
|
{ gtkVSkinBrowser=(int)user_data; }
|
||||||
|
|
||||||
void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
|
void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
|
||||||
{
|
{
|
||||||
if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
|
if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
|
||||||
gtk_widget_destroy( SkinBrowser );
|
HideSkinBrowser();
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
|
void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
|
||||||
|
@ -75,7 +93,7 @@ void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
|
||||||
ChangeSkin( sbSelectedSkin );
|
ChangeSkin( sbSelectedSkin );
|
||||||
if ( skinName ) free( skinName );
|
if ( skinName ) free( skinName );
|
||||||
skinName=strdup( sbSelectedSkin );
|
skinName=strdup( sbSelectedSkin );
|
||||||
gtk_widget_destroy( SkinBrowser );
|
HideSkinBrowser();
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
|
void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
|
||||||
|
@ -91,7 +109,7 @@ void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * be
|
||||||
{
|
{
|
||||||
if ( skinName ) free( skinName );
|
if ( skinName ) free( skinName );
|
||||||
skinName=strdup( sbSelectedSkin );
|
skinName=strdup( sbSelectedSkin );
|
||||||
gtk_widget_destroy( SkinBrowser );
|
HideSkinBrowser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,8 +148,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
frame5=gtk_frame_new( NULL );
|
frame5=gtk_frame_new( NULL );
|
||||||
gtk_widget_set_name( frame5,"frame5" );
|
gtk_widget_set_name( frame5,"frame5" );
|
||||||
gtk_widget_ref( frame5 );
|
gtk_widget_ref( frame5 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame5",frame5,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame5",frame5,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( frame5 );
|
gtk_widget_show( frame5 );
|
||||||
gtk_container_add( GTK_CONTAINER( SkinBrowser ),frame5 );
|
gtk_container_add( GTK_CONTAINER( SkinBrowser ),frame5 );
|
||||||
gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_IN );
|
gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_IN );
|
||||||
|
@ -139,8 +156,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
frame6=gtk_frame_new( NULL );
|
frame6=gtk_frame_new( NULL );
|
||||||
gtk_widget_set_name( frame6,"frame6" );
|
gtk_widget_set_name( frame6,"frame6" );
|
||||||
gtk_widget_ref( frame6 );
|
gtk_widget_ref( frame6 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame6",frame6,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame6",frame6,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( frame6 );
|
gtk_widget_show( frame6 );
|
||||||
gtk_container_add( GTK_CONTAINER( frame5 ),frame6 );
|
gtk_container_add( GTK_CONTAINER( frame5 ),frame6 );
|
||||||
gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_NONE );
|
gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_NONE );
|
||||||
|
@ -148,8 +164,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
frame7=gtk_frame_new( NULL );
|
frame7=gtk_frame_new( NULL );
|
||||||
gtk_widget_set_name( frame7,"frame7" );
|
gtk_widget_set_name( frame7,"frame7" );
|
||||||
gtk_widget_ref( frame7 );
|
gtk_widget_ref( frame7 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame7",frame7,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame7",frame7,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( frame7 );
|
gtk_widget_show( frame7 );
|
||||||
gtk_container_add( GTK_CONTAINER( frame6 ),frame7 );
|
gtk_container_add( GTK_CONTAINER( frame6 ),frame7 );
|
||||||
gtk_frame_set_shadow_type( GTK_FRAME( frame7 ),GTK_SHADOW_ETCHED_OUT );
|
gtk_frame_set_shadow_type( GTK_FRAME( frame7 ),GTK_SHADOW_ETCHED_OUT );
|
||||||
|
@ -157,8 +172,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
frame8=gtk_frame_new( NULL );
|
frame8=gtk_frame_new( NULL );
|
||||||
gtk_widget_set_name( frame8,"frame8" );
|
gtk_widget_set_name( frame8,"frame8" );
|
||||||
gtk_widget_ref( frame8 );
|
gtk_widget_ref( frame8 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame8",frame8,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame8",frame8,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( frame8 );
|
gtk_widget_show( frame8 );
|
||||||
gtk_container_add( GTK_CONTAINER( frame7 ),frame8 );
|
gtk_container_add( GTK_CONTAINER( frame7 ),frame8 );
|
||||||
gtk_frame_set_shadow_type( GTK_FRAME( frame8 ),GTK_SHADOW_NONE );
|
gtk_frame_set_shadow_type( GTK_FRAME( frame8 ),GTK_SHADOW_NONE );
|
||||||
|
@ -166,16 +180,14 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
vbox5=gtk_vbox_new( FALSE,0 );
|
vbox5=gtk_vbox_new( FALSE,0 );
|
||||||
gtk_widget_set_name( vbox5,"vbox5" );
|
gtk_widget_set_name( vbox5,"vbox5" );
|
||||||
gtk_widget_ref( vbox5 );
|
gtk_widget_ref( vbox5 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"vbox5",vbox5,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"vbox5",vbox5,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( vbox5 );
|
gtk_widget_show( vbox5 );
|
||||||
gtk_container_add( GTK_CONTAINER( frame8 ),vbox5 );
|
gtk_container_add( GTK_CONTAINER( frame8 ),vbox5 );
|
||||||
|
|
||||||
label=gtk_label_new( MSGTR_SKIN_LABEL );
|
label=gtk_label_new( MSGTR_SKIN_LABEL );
|
||||||
gtk_widget_set_name( label,"label" );
|
gtk_widget_set_name( label,"label" );
|
||||||
gtk_widget_ref( label );
|
gtk_widget_ref( label );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label",label,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label",label,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( label );
|
gtk_widget_show( label );
|
||||||
gtk_box_pack_start( GTK_BOX( vbox5 ),label,FALSE,FALSE,0 );
|
gtk_box_pack_start( GTK_BOX( vbox5 ),label,FALSE,FALSE,0 );
|
||||||
gtk_label_set_justify( GTK_LABEL( label ),GTK_JUSTIFY_RIGHT );
|
gtk_label_set_justify( GTK_LABEL( label ),GTK_JUSTIFY_RIGHT );
|
||||||
|
@ -184,8 +196,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
hseparator4=gtk_hseparator_new();
|
hseparator4=gtk_hseparator_new();
|
||||||
gtk_widget_set_name( hseparator4,"hseparator4" );
|
gtk_widget_set_name( hseparator4,"hseparator4" );
|
||||||
gtk_widget_ref( hseparator4 );
|
gtk_widget_ref( hseparator4 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator4",hseparator4,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator4",hseparator4,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( hseparator4 );
|
gtk_widget_show( hseparator4 );
|
||||||
gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator4,FALSE,TRUE,0 );
|
gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator4,FALSE,TRUE,0 );
|
||||||
gtk_widget_set_usize( hseparator4,-2,5 );
|
gtk_widget_set_usize( hseparator4,-2,5 );
|
||||||
|
@ -193,8 +204,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
|
scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
|
||||||
gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
|
gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
|
||||||
gtk_widget_ref( scrolledwindow1 );
|
gtk_widget_ref( scrolledwindow1 );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"scrolledwindow1",scrolledwindow1,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( scrolledwindow1 );
|
gtk_widget_show( scrolledwindow1 );
|
||||||
gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
|
gtk_box_pack_start( GTK_BOX( vbox5 ),scrolledwindow1,TRUE,TRUE,0 );
|
||||||
gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
|
gtk_container_set_border_width( GTK_CONTAINER( scrolledwindow1 ),2 );
|
||||||
|
@ -203,8 +213,7 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
SkinList=gtk_clist_new( 1 );
|
SkinList=gtk_clist_new( 1 );
|
||||||
gtk_widget_set_name( SkinList,"SkinList" );
|
gtk_widget_set_name( SkinList,"SkinList" );
|
||||||
gtk_widget_ref( SkinList );
|
gtk_widget_ref( SkinList );
|
||||||
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,
|
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"SkinList",SkinList,(GtkDestroyNotify)gtk_widget_unref );
|
||||||
( GtkDestroyNotify ) gtk_widget_unref );
|
|
||||||
gtk_widget_show( SkinList );
|
gtk_widget_show( SkinList );
|
||||||
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
|
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),SkinList );
|
||||||
gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
|
gtk_clist_set_column_width( GTK_CLIST( SkinList ),0,80 );
|
||||||
|
@ -256,7 +265,10 @@ GtkWidget * create_SkinBrowser( void )
|
||||||
gtk_widget_set_usize( Cancel,-2,22 );
|
gtk_widget_set_usize( Cancel,-2,22 );
|
||||||
gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
gtk_widget_add_accelerator( Cancel,"released",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL );
|
gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),0 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"show",GTK_SIGNAL_FUNC( on_SkinBrowser_show ),1 );
|
||||||
|
gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"hide",GTK_SIGNAL_FUNC( on_SkinBrowser_show ),0 );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
|
gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
|
||||||
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Ok ),NULL );
|
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Ok ),NULL );
|
||||||
gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL );
|
gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL );
|
||||||
|
|
|
@ -7,8 +7,9 @@ extern GtkWidget * SkinList;
|
||||||
extern char * sbSelectedSkin;
|
extern char * sbSelectedSkin;
|
||||||
extern char * sbMPlayerDirInHome;
|
extern char * sbMPlayerDirInHome;
|
||||||
extern char * sbMPlayerPrefixDir;
|
extern char * sbMPlayerPrefixDir;
|
||||||
|
extern GtkWidget * SkinBrowser;
|
||||||
|
|
||||||
extern void HideSkinBrowser( void );
|
extern void ShowSkinBrowser( void );
|
||||||
extern int gtkFillSkinList( gchar * mdir );
|
extern int gtkFillSkinList( gchar * mdir );
|
||||||
extern GtkWidget * create_SkinBrowser( void );
|
extern GtkWidget * create_SkinBrowser( void );
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ void mplShowMenu( int mx,int my )
|
||||||
mplMenuItem = 0;
|
mplMenuItem = 0;
|
||||||
|
|
||||||
wsMoveWindow( &appMPlayer.menuWindow,False,x,y );
|
wsMoveWindow( &appMPlayer.menuWindow,False,x,y );
|
||||||
wsMoveTopWindow( &appMPlayer.menuWindow );
|
wsMoveTopWindow( wsDisplay,appMPlayer.menuWindow.WindowID );
|
||||||
mplMenuRender=1;
|
mplMenuRender=1;
|
||||||
wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow );
|
wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow );
|
||||||
wsPostRedisplay( &appMPlayer.menuWindow );
|
wsPostRedisplay( &appMPlayer.menuWindow );
|
||||||
|
|
|
@ -209,7 +209,8 @@ void ChangeSkin( char * name )
|
||||||
if ( mplDrawBuffer ) free( mplDrawBuffer );
|
if ( mplDrawBuffer ) free( mplDrawBuffer );
|
||||||
if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
|
if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
|
||||||
{ mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
|
{ mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
|
||||||
wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
|
|
||||||
|
if ( wsWMType == wsWMUnknown ) wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow );
|
||||||
wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
|
wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
|
||||||
wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y );
|
wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y );
|
||||||
wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
|
wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height );
|
||||||
|
|
|
@ -64,8 +64,8 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY )
|
||||||
case wsRLMouseButton:
|
case wsRLMouseButton:
|
||||||
if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) )
|
if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) )
|
||||||
{
|
{
|
||||||
if( SubVisible++%2 ) wsMoveTopWindow( &appMPlayer.mainWindow );
|
if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
|
||||||
else wsMoveTopWindow( &appMPlayer.subWindow );
|
else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
|
||||||
}
|
}
|
||||||
msButton=0;
|
msButton=0;
|
||||||
mplSubMoved=0;
|
mplSubMoved=0;
|
||||||
|
|
|
@ -27,15 +27,10 @@
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#include "../../help_mp.h"
|
#include "../../help_mp.h"
|
||||||
|
|
||||||
GtkWidget * SkinBrowser;
|
|
||||||
GtkWidget * PlayList;
|
GtkWidget * PlayList;
|
||||||
GtkWidget * FileSelect;
|
|
||||||
GtkWidget * AboutBox;
|
|
||||||
GtkWidget * Options;
|
GtkWidget * Options;
|
||||||
GtkWidget * PopUpMenu = NULL;
|
GtkWidget * PopUpMenu = NULL;
|
||||||
|
|
||||||
GtkWidget * MessageBox;
|
|
||||||
|
|
||||||
GtkWidget * WarningPixmap;
|
GtkWidget * WarningPixmap;
|
||||||
GtkWidget * ErrorPixmap;
|
GtkWidget * ErrorPixmap;
|
||||||
|
|
||||||
|
@ -58,14 +53,7 @@ void gtkInit( int argc,char* argv[], char *envp[] )
|
||||||
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
|
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
gtk_init( &argc,&argv );
|
gtk_init( &argc,&argv );
|
||||||
gdk_set_use_xshm( FALSE );
|
// gdk_set_use_xshm( TRUE );
|
||||||
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create about box.\n" ); AboutBox=create_About();
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create skin browser.\n" ); SkinBrowser=create_SkinBrowser();
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create playlist.\n" ); PlayList=create_PlayList();
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create file selector.\n" ); FileSelect=create_FileSelect();
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create message box.\n" ); MessageBox=create_MessageBox(0);
|
|
||||||
// mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] Create preferences dialog box.\n" ); Options=create_Options();
|
|
||||||
|
|
||||||
gtkInited=1;
|
gtkInited=1;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +94,7 @@ void gtkEventHandling( void )
|
||||||
void gtkMessageBox( int type,gchar * str )
|
void gtkMessageBox( int type,gchar * str )
|
||||||
{
|
{
|
||||||
if ( !gtkInited ) return;
|
if ( !gtkInited ) return;
|
||||||
MessageBox=create_MessageBox(0);
|
ShowMessageBox( str );
|
||||||
gtk_label_set_text( GTK_LABEL( gtkMessageBoxText ),str );
|
gtk_label_set_text( GTK_LABEL( gtkMessageBoxText ),str );
|
||||||
switch( type)
|
switch( type)
|
||||||
{
|
{
|
||||||
|
@ -135,45 +123,53 @@ void gtkSetLayer( GtkWidget * wdg )
|
||||||
wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen );
|
wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gtkActive( GtkWidget * wdg )
|
||||||
|
{
|
||||||
|
GdkWindowPrivate * win = wdg->window;
|
||||||
|
wsMoveTopWindow( gdk_display,win->xwindow );
|
||||||
|
}
|
||||||
|
|
||||||
void gtkShow( int type,char * param )
|
void gtkShow( int type,char * param )
|
||||||
{
|
{
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
case evSkinBrowser:
|
case evSkinBrowser:
|
||||||
SkinBrowser=create_SkinBrowser();
|
// SkinBrowser=create_SkinBrowser();
|
||||||
|
ShowSkinBrowser();
|
||||||
// gtkClearList( SkinList );
|
// gtkClearList( SkinList );
|
||||||
if ( gtkFillSkinList( sbMPlayerPrefixDir ) && gtkFillSkinList( sbMPlayerDirInHome ) )
|
if ( gtkFillSkinList( sbMPlayerPrefixDir ) && gtkFillSkinList( sbMPlayerDirInHome ) )
|
||||||
{
|
{
|
||||||
gtkSetDefaultToCList( SkinList,param );
|
gtkSetDefaultToCList( SkinList,param );
|
||||||
gtk_widget_show( SkinBrowser );
|
gtk_widget_show( SkinBrowser );
|
||||||
gtkSetLayer( SkinBrowser );
|
gtkSetLayer( SkinBrowser );
|
||||||
}
|
} else gtk_widget_destroy( SkinBrowser );
|
||||||
break;
|
break;
|
||||||
case evPreferences:
|
case evPreferences:
|
||||||
Options=create_Options();
|
gtkMessageBox( GTK_MB_WARNING,"Sorry, this feature is under development ..." );
|
||||||
gtk_widget_show( Options );
|
// Options=create_Options();
|
||||||
gtkSetLayer( Options );
|
// gtk_widget_show( Options );
|
||||||
|
// gtkSetLayer( Options );
|
||||||
break;
|
break;
|
||||||
case evPlayList:
|
case evPlayList:
|
||||||
PlayList=create_PlayList();
|
gtkMessageBox( GTK_MB_WARNING,"Sorry, this feature is under development ..." );
|
||||||
gtk_widget_show( PlayList );
|
// PlayList=create_PlayList();
|
||||||
gtkSetLayer( PlayList );
|
// gtk_widget_show( PlayList );
|
||||||
|
// gtkSetLayer( PlayList );
|
||||||
break;
|
break;
|
||||||
case evLoad:
|
case evLoad:
|
||||||
ShowFileSelect( fsVideoSelector );
|
ShowFileSelect( fsVideoSelector );
|
||||||
gtkSetLayer( FileSelect );
|
gtkSetLayer( fsFileSelect );
|
||||||
break;
|
break;
|
||||||
case evFirstLoad:
|
case evFirstLoad:
|
||||||
ShowFileSelect( fsVideoSelector );
|
ShowFileSelect( fsVideoSelector );
|
||||||
gtkSetLayer( FileSelect );
|
gtkSetLayer( fsFileSelect );
|
||||||
break;
|
break;
|
||||||
case evLoadSubtitle:
|
case evLoadSubtitle:
|
||||||
ShowFileSelect( fsSubtitleSelector );
|
ShowFileSelect( fsSubtitleSelector );
|
||||||
gtkSetLayer( FileSelect );
|
gtkSetLayer( fsFileSelect );
|
||||||
break;
|
break;
|
||||||
case evAbout:
|
case evAbout:
|
||||||
AboutBox=create_About();
|
ShowAboutBox();
|
||||||
gtk_widget_show( AboutBox );
|
|
||||||
gtkSetLayer( AboutBox );
|
gtkSetLayer( AboutBox );
|
||||||
break;
|
break;
|
||||||
case evShowPopUpMenu:
|
case evShowPopUpMenu:
|
||||||
|
|
|
@ -19,15 +19,10 @@
|
||||||
#define GTK_MB_ERROR 4
|
#define GTK_MB_ERROR 4
|
||||||
#define GTK_MB_WARNING 8
|
#define GTK_MB_WARNING 8
|
||||||
|
|
||||||
extern GtkWidget * SkinBrowser;
|
|
||||||
extern GtkWidget * PlayList;
|
extern GtkWidget * PlayList;
|
||||||
extern GtkWidget * FileSelect;
|
|
||||||
extern GtkWidget * AboutBox;
|
|
||||||
extern GtkWidget * Options;
|
extern GtkWidget * Options;
|
||||||
extern GtkWidget * PopUpMenu;
|
extern GtkWidget * PopUpMenu;
|
||||||
|
|
||||||
extern GtkWidget * MessageBox;
|
|
||||||
|
|
||||||
extern GtkWidget * WarningPixmap;
|
extern GtkWidget * WarningPixmap;
|
||||||
extern GtkWidget * ErrorPixmap;
|
extern GtkWidget * ErrorPixmap;
|
||||||
|
|
||||||
|
@ -54,5 +49,7 @@ extern void gtkEventHandling( void );
|
||||||
|
|
||||||
extern void gtkShow( int type,char * param );
|
extern void gtkShow( int type,char * param );
|
||||||
extern void gtkMessageBox( int type,gchar * str );
|
extern void gtkMessageBox( int type,gchar * str );
|
||||||
|
extern void gtkSetLayer( GtkWidget * wdg );
|
||||||
|
extern void gtkActive( GtkWidget * wdg );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
16
Gui/wm/ws.c
16
Gui/wm/ws.c
|
@ -810,8 +810,6 @@ void wsFullScreen( wsTWindow * win )
|
||||||
{
|
{
|
||||||
int decoration = 0;
|
int decoration = 0;
|
||||||
|
|
||||||
if ( wsWMType == wsWMUnknown ) XUnmapWindow( wsDisplay,win->WindowID );
|
|
||||||
|
|
||||||
switch ( wsWMType )
|
switch ( wsWMType )
|
||||||
{
|
{
|
||||||
case wsWMUnknown:
|
case wsWMUnknown:
|
||||||
|
@ -990,13 +988,13 @@ void wsIconify( wsTWindow win )
|
||||||
// ----------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------
|
||||||
// Move top the window.
|
// Move top the window.
|
||||||
// ----------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------
|
||||||
void wsMoveTopWindow( wsTWindow * win )
|
void wsMoveTopWindow( Display * wsDisplay,Window win )
|
||||||
{
|
{
|
||||||
switch ( wsWMType )
|
switch ( wsWMType )
|
||||||
{
|
{
|
||||||
case wsWMIceWM:
|
case wsWMIceWM:
|
||||||
XUnmapWindow( wsDisplay,win->WindowID );
|
XUnmapWindow( wsDisplay,win );
|
||||||
XMapWindow( wsDisplay,win->WindowID );
|
XMapWindow( wsDisplay,win );
|
||||||
break;
|
break;
|
||||||
case wsWMNetWM:
|
case wsWMNetWM:
|
||||||
case wsWMKDE:
|
case wsWMKDE:
|
||||||
|
@ -1005,15 +1003,15 @@ void wsMoveTopWindow( wsTWindow * win )
|
||||||
e.xclient.type=ClientMessage;
|
e.xclient.type=ClientMessage;
|
||||||
e.xclient.message_type=XInternAtom( wsDisplay,"_NET_ACTIVE_WINDOW",False );
|
e.xclient.message_type=XInternAtom( wsDisplay,"_NET_ACTIVE_WINDOW",False );
|
||||||
e.xclient.display=wsDisplay;
|
e.xclient.display=wsDisplay;
|
||||||
e.xclient.window=win->WindowID;
|
e.xclient.window=win;
|
||||||
e.xclient.format=32;
|
e.xclient.format=32;
|
||||||
e.xclient.data.l[0]=0;
|
e.xclient.data.l[0]=0;
|
||||||
XSendEvent( wsDisplay,wsRootWin,False,SubstructureRedirectMask,&e );
|
XSendEvent( wsDisplay,RootWindow( wsDisplay,DefaultScreen( wsDisplay ) ),False,SubstructureRedirectMask,&e );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
XMapRaised( wsDisplay,win->WindowID );
|
XMapRaised( wsDisplay,win );
|
||||||
XRaiseWindow( wsDisplay,win->WindowID );
|
XRaiseWindow( wsDisplay,win );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ extern void wsDestroyWindow( wsTWindow * win );
|
||||||
extern void wsMoveWindow( wsTWindow * win,int b,int x, int y );
|
extern void wsMoveWindow( wsTWindow * win,int b,int x, int y );
|
||||||
extern void wsResizeWindow( wsTWindow * win,int sx, int sy );
|
extern void wsResizeWindow( wsTWindow * win,int sx, int sy );
|
||||||
extern void wsIconify( wsTWindow win );
|
extern void wsIconify( wsTWindow win );
|
||||||
extern void wsMoveTopWindow( wsTWindow * win );
|
extern void wsMoveTopWindow( Display * wsDisplay,Window win );
|
||||||
extern void wsSetBackground( wsTWindow * win,int color );
|
extern void wsSetBackground( wsTWindow * win,int color );
|
||||||
extern void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b );
|
extern void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b );
|
||||||
extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b );
|
extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b );
|
||||||
|
|
Loading…
Reference in New Issue