[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk about.c,NONE,1.1 fs.c,NONE,1.1 mb.c,NONE,1.1 menu.c,NONE,1.1 opts.c,NONE,1.1 pl.c,NONE,1.1 sb.c,NONE,1.1
Zoltan Ponekker
pontscho at mplayer.dev.hu
Wed Nov 14 17:04:27 CET 2001
- Previous message: [Mplayer-cvslog] CVS: main/Gui/mplayer psignal.c,1.16,1.17 widgets.c,1.10,1.11
- Next message: [Mplayer-cvslog] CVS: main/Gui events.c,1.4,1.5 events.h,1.4,1.5 gui.mak,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mplayer:/var/tmp.root/cvs-serv15318/Gui/mplayer/gtk
Added Files:
about.c fs.c mb.c menu.c opts.c pl.c sb.c
Log Message:
rewrite ...
--- NEW FILE ---
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "pixmaps/about.xpm"
#include "../widgets.h"
#include "about.h"
void ab_Ok_released( GtkButton * button,gpointer user_data )
{
gtk_widget_hide( AboutBox );
gtkVisibleAboutBox=0;
}
GtkWidget * create_About( void )
{
GtkWidget * About;
GtkWidget * frame1;
GtkWidget * frame2;
GtkWidget * frame3;
GtkWidget * frame4;
GtkWidget * vbox1;
GtkWidget * pixmap1;
GtkWidget * hseparator2;
GtkWidget * scrolledwindow1;
GtkWidget * AboutText;
GtkWidget * hseparator1;
GtkWidget * hbuttonbox1;
GtkWidget * Ok;
GtkStyle * pixmapstyle;
GtkPixmap * pixmapwid;
GdkBitmap * mask;
GtkAccelGroup * accel_group;
accel_group=gtk_accel_group_new( );
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 );
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 );
frame1=gtk_frame_new( NULL );
gtk_widget_set_name( frame1,"frame1" );
gtk_widget_ref( frame1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"frame1",frame1,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( About ),frame1 );
gtk_frame_set_shadow_type( GTK_FRAME( frame1 ),GTK_SHADOW_IN );
frame2=gtk_frame_new( NULL );
gtk_widget_set_name( frame2,"frame2" );
gtk_widget_ref( frame2 );
gtk_object_set_data_full( GTK_OBJECT( About ),"frame2",frame2,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame2 );
gtk_container_add( GTK_CONTAINER( frame1 ),frame2 );
gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
frame3=gtk_frame_new( NULL );
gtk_widget_set_name( frame3,"frame3" );
gtk_widget_ref( frame3 );
gtk_object_set_data_full( GTK_OBJECT( About ),"frame3",frame3,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame3 );
gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
frame4=gtk_frame_new( NULL );
gtk_widget_set_name( frame4,"frame4" );
gtk_widget_ref( frame4 );
gtk_object_set_data_full( GTK_OBJECT( About ),"frame4",frame4,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame4 );
gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
vbox1=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox1,"vbox1" );
gtk_widget_ref( vbox1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"vbox1",vbox1,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( frame4 ),vbox1 );
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],(gchar ** )about_xpm );
pixmap1=gtk_pixmap_new( pixmapwid,mask );
gtk_widget_set_name( pixmap1,"pixmap1" );
gtk_widget_ref( pixmap1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"pixmap1",pixmap1,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( pixmap1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),pixmap1,FALSE,FALSE,0 );
gtk_widget_set_usize( pixmap1,-2,174 );
hseparator2=gtk_hseparator_new( );
gtk_widget_set_name( hseparator2,"hseparator2" );
gtk_widget_ref( hseparator2 );
gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator2",hseparator2,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator2 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator2,FALSE,FALSE,0 );
gtk_widget_set_usize( hseparator2,-2,7 );
scrolledwindow1=gtk_scrolled_window_new( NULL,NULL );
gtk_widget_set_name( scrolledwindow1,"scrolledwindow1" );
gtk_widget_ref( scrolledwindow1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"scrolledwindow1",scrolledwindow1,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( scrolledwindow1 );
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 );
AboutText=gtk_text_new( NULL,NULL );
gtk_widget_set_name( AboutText,"AboutText" );
gtk_widget_ref( AboutText );
gtk_object_set_data_full( GTK_OBJECT( About ),"AboutText",AboutText,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( AboutText );
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
"\nMPlayer code:\n" \
" fileformat detection,demuxers - A'rpi\n" \
" DVD support - ( alpha version was: LGB ) now: ?\n" \
" network streaming - Bertrand BAUDET\n" \
" A-V sync code - A'rpi\n" \
" subtitles file parser/reader - Lez( most of them )\n" \
" config files & commandline parser - Szabi\n" \
" fastmemcpy - Nick Kurshev\n" \
" LIRC support - Acki\n" \
" SUB/OSD renderer - Adam Tla/lka\n" \
" Gui - Pontscho\n\nlibvo drivers:\n" \
" vo_aa.c - Folke Ashberg\n" \
" vo_dga.c - Acki\n" \
" vo_fbdev.c - Szabi\n" \
" vo_ggi.c - al3x\n" \
" vo_gl.c - A'rpi\n" \
" vo_md5.c - A'rpi\n" \
" vo_mga.c - A'rpi\n" \
" vo_null.c - A'rpi\n" \
" vo_odivx.c - A'rpi\n" \
" vo_pgm.c - A'rpi\n" \
" vo_png.c - Atmos\n" \
" vo_sdl.c - Atmos\n" \
" vo_svga.c - se7en\n" \
" vo_x11.c - Pontscho\n"\
" vo_xmga.c - Pontscho\n"\
" vo_xv.c - Pontscho\n" \
" vo_aa.c - Folke Ashberg\n\n" \
"libao2 drivers:\n" \
" ao_alsa5.c - al3x\n" \
" ao_alsa9.c - al3x( BUGGY,use oss )\n" \
" ao_null.c - A'rpi\n" \
" ao_oss.c - A'rpi\n" \
" ao_pcm.c - Atmos\n" \
" ao_sdl.c - Atmos\n" \
" ao_sun.c - Jürgen Keil\n\n" \
"Homepage:\n" \
" Design: Chass\n" \
" Contents: Gabucino\n\n" \
"English documentation:\n" \
" tech-*.txt: A'rpi\n" \
" all the others: Gabucino\n\n" \
"Documentation translations:\n" \
" Hungarian - Gabucino\n" \
" Spanish - TeLeNiEkO\n" \
" Russian - Nick Kurshev\n" \
" Polish - Dariush Pietrzak\n" \
" German - Atmosfear\n\n" \
"Platforms/ports:\n" \
" DEBIAN packaging - Dariush Pietrzak\n" \
" FreeBSD support - Vladimir Kushnir\n" \
" Solaris 8 support - Jürgen Keil\n",1535 );
hseparator1=gtk_hseparator_new( );
gtk_widget_set_name( hseparator1,"hseparator1" );
gtk_widget_ref( hseparator1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"hseparator1",hseparator1,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hseparator1,FALSE,FALSE,0 );
gtk_widget_set_usize( hseparator1,-2,10 );
hbuttonbox1=gtk_hbutton_box_new( );
gtk_widget_set_name( hbuttonbox1,"hbuttonbox1" );
gtk_widget_ref( hbuttonbox1 );
gtk_object_set_data_full( GTK_OBJECT( About ),"hbuttonbox1",hbuttonbox1,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbuttonbox1 );
gtk_box_pack_start( GTK_BOX( vbox1 ),hbuttonbox1,FALSE,FALSE,0 );
Ok=gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_set_name( Ok,MSGTR_Ok );
gtk_widget_ref( Ok );
gtk_object_set_data_full( GTK_OBJECT( About ),MSGTR_Ok,Ok,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( Ok );
gtk_container_add( GTK_CONTAINER( hbuttonbox1 ),Ok );
GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT );
gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( ab_Ok_released ),NULL );
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_window_add_accel_group( GTK_WINDOW( About ),accel_group );
return About;
}
--- NEW FILE ---
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <glob.h>
#include <unistd.h>
#include "./mplayer.h"
#include "psignal.h"
#include "../error.h"
#include "pixmaps/up.xpm"
#include "pixmaps/dir.xpm"
#include "pixmaps/file.xpm"
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../widgets.h"
#include "fs.h"
#ifndef __linux__
#define get_current_dir_name() getcwd(NULL, PATH_MAX)
#endif
#ifndef get_current_dir_name
extern char * get_current_dir_name( void );
#endif
gchar * fsSelectedFile = NULL;
gchar * fsSelectedDirectory = NULL;
unsigned char * fsThatDir = ".";
gchar * fsFilter = NULL;
int fsPressed = 0;
int fsLastFilterNames = 2;
unsigned char * fsFilterNames[3][2] = { { "MPEG files( *.mpg )", "*.mpg" },
{ "AVI files( *.avi )", "*.avi" },
{ "All files( *)", "*" } };
GtkWidget * fsFileNamesList;
GtkWidget * fsFNameList;
GtkWidget * fsFileSelect;
GdkColormap * fsColorMap;
GtkWidget * fsOk;
GtkWidget * fsUp;
GtkWidget * fsCancel;
GtkWidget * fsCombo4;
GtkWidget * fsComboEntry2;
GList * fsList_items = NULL;
GList * fsTopList_items = NULL;
void CheckDir( GtkWidget * list,unsigned char * directory )
{
struct stat fs;
int i,c=2;
gchar * str[1][2];
GdkPixmap * dpixmap,*fpixmap,*pixmap;
GdkBitmap * dmask,*fmask,*mask;
GtkStyle * style;
glob_t gg;
gtk_widget_hide( list );
str[0][0]=NULL;
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 );
pixmap=dpixmap; mask=dmask;
str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 );
strcpy( str[0][1],"." );
gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask );
strcpy( str[0][1],".." );
gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask );
free( str[0][0] );
glob( "*",GLOB_NOSORT,NULL,&gg );
// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
for( i=0;i<gg.gl_pathc;i++ )
{
if( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
stat( gg.gl_pathv[i],&fs );
if( S_ISDIR( fs.st_mode ) )
{
str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 2 );
strcpy( str[0][1],"" );
strcat( 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 );
free( str[0][1] );
c++;
}
}
globfree( &gg );
glob( fsFilter,GLOB_NOSORT,NULL,&gg );
// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
pixmap=fpixmap; mask=fmask;
for( i=0;i<gg.gl_pathc;i++ )
{
if( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
stat( gg.gl_pathv[i],&fs );
if( S_ISDIR( fs.st_mode ) ) continue;
str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 2 );
strcpy( str[0][1],"" ); strcat( 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 );
free( str[0][1] );
c++;
}
globfree( &gg );
gtk_clist_set_sort_type( GTK_CLIST( list ),GTK_SORT_ASCENDING );
gtk_clist_set_compare_func( GTK_CLIST( list ),NULL );
gtk_clist_set_sort_column( GTK_CLIST( list ),1 );
gtk_clist_sort( GTK_CLIST( list ) );
gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
gtk_clist_select_row( GTK_CLIST( list ),0,1 );
gtk_widget_show( list );
}
void HideFileSelect( void )
{
gtk_widget_hide( fsFileSelect );
gtkVisibleFileSelect=0;
gtkShMem->vs.window=evLoad;
gtkSendMessage( evHideWindow );
}
void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
{ HideFileSelect(); }
void fs_combo_entry1_activate( GtkEditable * editable,gpointer user_data )
{
unsigned char * str;
str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
gtk_clist_clear( GTK_CLIST( fsFNameList ) );
if( fsFilter ) free( fsFilter );
if( ( fsFilter=(unsigned char *)malloc( strlen( str ) + 1 ) ) == NULL )
{
dbprintf( 0,"[gtk] not enough memory.\n" );
exit( 0 );
}
strcpy( fsFilter,str );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
}
void fs_combo_entry1_changed( GtkEditable * editable,gpointer user_data )
{
unsigned char * str;
int i;
str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
for( i=0;i<fsLastFilterNames+1;i++ )
{
if( !strcmp( str,fsFilterNames[i][0] ) )
{
if( fsFilter ) free( fsFilter );
if( ( fsFilter=(unsigned char *)malloc( 6 ) ) == NULL )
{
dbprintf( 0,"[gtk] not enough memory.\n" );
exit( 0 );
}
strcpy( fsFilter,fsFilterNames[i][1] );
}
}
gtk_clist_clear( GTK_CLIST( fsFNameList ) );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
}
void fs_fsComboEntry2_activate( GtkEditable * editable,gpointer user_data )
{
unsigned char * str;
str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
if ( chdir( str ) != -1 )
{
gtk_clist_clear( GTK_CLIST( fsFNameList ) );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
}
}
void fs_fsComboEntry2_changed( GtkEditable * editable,gpointer user_data )
{
unsigned char * str;
str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
fsPressed=2;
// if (
// tmp=(unsigned char *)malloc( strlen( fsSelectedDirectory ) + 5 );
// strcpy( tmp,fsSelectedDirectory ); strcat( tmp,"/*" );
// fprintf( stderr,"str: %s\n",tmp );
// free( tmp );
if ( chdir( str ) != -1 )
{
gtk_clist_clear( GTK_CLIST( fsFNameList ) );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
}
}
void fs_Up_released( GtkButton * button,gpointer user_data )
{
chdir( ".." );
fsSelectedFile=fsThatDir;
gtk_clist_clear( GTK_CLIST( user_data ) );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
gtk_entry_set_text( GTK_ENTRY( fsComboEntry2 ),(unsigned char *)get_current_dir_name() );
return;
}
int fsFileExist( unsigned char * fname )
{
FILE * f = fopen( fname,"r" );
if ( f == NULL ) return 0;
fclose( f );
return 1;
}
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;
if( fsFNameList != NULL ) gtk_clist_clear( GTK_CLIST( fsFNameList ) );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
gtk_entry_set_text( GTK_ENTRY( fsComboEntry2 ),(unsigned char *)get_current_dir_name() );
return;
}
HideFileSelect();
switch( fsPressed )
{
case 1:
fsSelectedDirectory=(unsigned char *)get_current_dir_name();
printf("[gtk-fs] 1-fsSelectedFile: %s\n",fsSelectedFile);
#ifdef DEBUG
dbprintf( 1,"[gtk-fs] fsSelectedFile: %s\n",fsSelectedFile );
#endif
break;
case 2:
str=gtk_entry_get_text( GTK_ENTRY( fsComboEntry2 ) );
fsSelectedFile=str;
printf("[gtk-fs] 2-fsSelectedFile: '%s' \n",fsSelectedFile);
#ifdef DEBUG
dbprintf( 1,"[gtk-fs] fsSelectedFile: %s\n",fsSelectedFile );
#endif
if ( !fsFileExist( fsSelectedFile ) ) 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;
}
}
printf("[gtk-fs-xxx] fsSelectedFile: '%s' \n",fsSelectedFile);
printf("[gtk-fs-xxx] fsSelectedDirectory: '%s' \n",fsSelectedDirectory);
break;
}
strcpy( gtkShMem->fs.dir,fsSelectedDirectory );
strcpy( gtkShMem->fs.filename,fsSelectedFile );
printf( "----gtk---> directory: %s\n",fsSelectedDirectory );
printf( "----gtk---> filename: %s\n",fsSelectedFile );
printf( "----gtksm-> directory: %s\n",gtkShMem->fs.dir );
printf( "----gtksm-> filename: %s\n",gtkShMem->fs.filename );
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() );
gtk_combo_set_popdown_strings( GTK_COMBO( user_data ),fsTopList_items );
}
gtkSendMessage( evFileLoaded );
}
void fs_Cancel_released( GtkButton * button,gpointer user_data )
{ HideFileSelect(); }
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 ); fsSelectedFile++;
fsPressed=1;
if( !bevent ) return;
if( bevent->type == GDK_2BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) );
}
gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
{
switch ( event->keyval )
{
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;
}
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 * List;
GtkWidget * combo_entry1;
GtkWidget * hseparator3;
GtkWidget * hbuttonbox3;
int i;
// GtkWidget * okpixmapwid,*uppixmapwid,*cancelpixmapwid;
// GdkPixmap * okpixmap,*uppixmap,*cancelpixmap;
// GdkBitmap * okmask,*upmask,*cancelmask;
// GtkStyle * okstyle,*upstyle,*cancelstyle;
GtkWidget * uppixmapwid;
GdkPixmap * uppixmap;
GdkBitmap * upmask;
GtkStyle * upstyle;
if( ( fsFilter=(unsigned char *)malloc( 3 ) ) == NULL )
{
dbprintf( 0,"[gtk] not enough memory.\n" );
exit( 0 );
}
strcpy( fsFilter,"*" );
fsFileSelect=gtk_window_new( GTK_WINDOW_DIALOG );
gtk_widget_set_name( fsFileSelect,"fsFileSelect" );
gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect );
gtk_widget_set_usize( fsFileSelect,416,256 );
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 ),FALSE,FALSE,TRUE );
fsColorMap=gdk_colormap_get_system();
FSFrame=gtk_frame_new( NULL );
gtk_widget_set_name( FSFrame,"FSFrame" );
gtk_widget_ref( FSFrame );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"FSFrame",FSFrame,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( FSFrame );
gtk_container_add( GTK_CONTAINER( fsFileSelect ),FSFrame );
gtk_container_set_border_width( GTK_CONTAINER( FSFrame ),1 );
gtk_frame_set_shadow_type( GTK_FRAME( FSFrame ),GTK_SHADOW_IN );
frame2=gtk_frame_new( NULL );
gtk_widget_set_name( frame2,"frame2" );
gtk_widget_ref( frame2 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame2",frame2,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame2 );
gtk_container_add( GTK_CONTAINER( FSFrame ),frame2 );
gtk_frame_set_shadow_type( GTK_FRAME( frame2 ),GTK_SHADOW_NONE );
frame3=gtk_frame_new( NULL );
gtk_widget_set_name( frame3,"frame3" );
gtk_widget_ref( frame3 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame3",frame3,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame3 );
gtk_container_add( GTK_CONTAINER( frame2 ),frame3 );
gtk_frame_set_shadow_type( GTK_FRAME( frame3 ),GTK_SHADOW_ETCHED_OUT );
frame4=gtk_frame_new( NULL );
gtk_widget_set_name( frame4,"frame4" );
gtk_widget_ref( frame4 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"frame4",frame4,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame4 );
gtk_container_add( GTK_CONTAINER( frame3 ),frame4 );
gtk_container_set_border_width( GTK_CONTAINER( frame4 ),1 );
gtk_frame_set_shadow_type( GTK_FRAME( frame4 ),GTK_SHADOW_NONE );
vbox4=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox4,"vbox4" );
gtk_widget_ref( vbox4 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vbox4",vbox4,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( vbox4 );
gtk_container_add( GTK_CONTAINER( frame4 ),vbox4 );
hbox4=gtk_hbox_new( FALSE,0 );
gtk_widget_set_name( hbox4,"hbox4" );
gtk_widget_ref( hbox4 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox4",hbox4,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbox4 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hbox4,TRUE,TRUE,0 );
fsCombo4=gtk_combo_new();
gtk_widget_set_name( fsCombo4,"fsCombo4" );
gtk_widget_ref( fsCombo4 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsCombo4",fsCombo4,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( fsCombo4 );
gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
gtk_widget_set_usize( fsCombo4,-2,20 );
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 );
fsComboEntry2=GTK_COMBO( fsCombo4 )->entry;
gtk_widget_set_name( fsComboEntry2,"fsComboEntry2" );
gtk_widget_ref( fsComboEntry2 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsComboEntry2",fsComboEntry2,( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( fsComboEntry2 );
gtk_widget_set_usize( fsComboEntry2,-2,20 );
vseparator1=gtk_vseparator_new();
gtk_widget_set_name( vseparator1,"vseparator1" );
gtk_widget_ref( vseparator1 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"vseparator1",vseparator1,
( GtkDestroyNotify ) gtk_widget_unref );
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 );
hseparator1=gtk_hseparator_new();
gtk_widget_set_name( hseparator1,"hseparator1" );
gtk_widget_ref( hseparator1 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator1",hseparator1,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator1 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator1,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator1,-2,8 );
hbox6=gtk_hbox_new( FALSE,0 );
gtk_widget_set_name( hbox6,"hbox6" );
gtk_widget_ref( hbox6 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbox6",hbox6,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbox6 );
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_ref( fsFNameListWindow );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameListWindow",fsFNameListWindow,
( GtkDestroyNotify ) gtk_widget_unref );
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_widget_ref( fsFNameList );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"fsFNameList",fsFNameList,
( GtkDestroyNotify ) gtk_widget_unref );
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 );
CheckDir( fsFNameList,(unsigned char *)get_current_dir_name() );
label1=gtk_label_new( "label1" );
gtk_widget_set_name( label1,"label1" );
gtk_widget_ref( label1 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"label1",label1,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( label1 );
gtk_clist_set_column_widget( GTK_CLIST( fsFNameList ),0,label1 );
hseparator2=gtk_hseparator_new();
gtk_widget_set_name( hseparator2,"hseparator2" );
gtk_widget_ref( hseparator2 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator2",hseparator2,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator2 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator2,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator2,-2,9 );
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 );
fsList_items=NULL;
for( i=0;i<fsLastFilterNames + 1;i++ )
fsList_items=g_list_append( fsList_items,fsFilterNames[i][0] );
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
g_list_free( fsList_items );
combo_entry1=GTK_COMBO( List )->entry;
gtk_widget_set_name( combo_entry1,"combo_entry1" );
gtk_widget_ref( combo_entry1 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"combo_entry1",combo_entry1,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( combo_entry1 );
gtk_entry_set_text( GTK_ENTRY( combo_entry1 ),fsFilterNames[fsLastFilterNames][0] );
hseparator3=gtk_hseparator_new();
gtk_widget_set_name( hseparator3,"hseparator3" );
gtk_widget_ref( hseparator3 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hseparator3",hseparator3,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator3 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hseparator3,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator3,-2,7 );
hbuttonbox3=gtk_hbutton_box_new();
gtk_widget_set_name( hbuttonbox3,"hbuttonbox3" );
gtk_widget_ref( hbuttonbox3 );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"hbuttonbox3",hbuttonbox3,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbuttonbox3 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hbuttonbox3,FALSE,TRUE,0 );
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox3 ),85,20 );
gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox3 ),0,0 );
// okstyle=gtk_widget_get_style( fsFileSelect );
// okpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&okmask,&okstyle->bg[GTK_STATE_NORMAL],(gchar **)ok_xpm );
// okpixmapwid=gtk_pixmap_new( okpixmap,okmask );
// gtk_widget_show( okpixmapwid );
// fsOk=gtk_button_new();
// gtk_container_add( GTK_CONTAINER(fsOk ),okpixmapwid );
// gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsOk );
// gtk_widget_show( fsOk );
fsOk=gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_set_name( fsOk,MSGTR_Ok );
gtk_widget_ref( fsOk );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),MSGTR_Ok,fsOk,( GtkDestroyNotify )gtk_widget_unref );
gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsOk );
gtk_widget_show( fsOk );
// cancelstyle=gtk_widget_get_style( fsFileSelect );
// cancelpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&cancelmask,&cancelstyle->bg[GTK_STATE_NORMAL],(gchar **)cancel_xpm );
// cancelpixmapwid=gtk_pixmap_new( cancelpixmap,cancelmask );
// gtk_widget_show( cancelpixmapwid );
// fsCancel=gtk_button_new();
// gtk_widget_show( fsCancel );
// gtk_container_add( GTK_CONTAINER( fsCancel ),cancelpixmapwid );
// gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsCancel );
// gtk_widget_show( fsCancel );
fsCancel=gtk_button_new_with_label( MSGTR_Cancel );
gtk_widget_set_name( fsCancel,MSGTR_Cancel );
gtk_widget_ref( fsCancel );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),MSGTR_Cancel,fsCancel,( GtkDestroyNotify )gtk_widget_unref );
gtk_container_add( GTK_CONTAINER( hbuttonbox3 ),fsCancel );
gtk_widget_show( fsCancel );
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( combo_entry1 ),"changed",
GTK_SIGNAL_FUNC( fs_combo_entry1_changed ),
combo_entry1 );
gtk_signal_connect( GTK_OBJECT( combo_entry1 ),"activate",
GTK_SIGNAL_FUNC( fs_combo_entry1_activate ),
combo_entry1 );
gtk_signal_connect( GTK_OBJECT( fsComboEntry2 ),"changed",
GTK_SIGNAL_FUNC( fs_fsComboEntry2_changed ),
fsComboEntry2 );
gtk_signal_connect( GTK_OBJECT( fsComboEntry2 ),"activate",
GTK_SIGNAL_FUNC( fs_fsComboEntry2_activate ),
fsComboEntry2 );
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;
}
--- NEW FILE ---
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../pixmaps/error.xpm"
#include "../pixmaps/warning.xpm"
#include "../widgets.h"
#include "mb.h"
GtkWidget * gtkMessageBoxText;
void on_MessageBox_destroy( GtkObject * object,gpointer user_data )
{
/*
switch( (int)user_data )
{
case GTK_MB_ERROR: gtk_widget_hide( ErrorMessageBox ); break;
case GTK_MB_WARNING: gtk_widget_hide( WarningMessageBox ); break;
}
*/
gtk_widget_hide( MessageBox );
gtkVisibleMessageBox=0;
}
void on_Ok_released( GtkButton * button,gpointer user_data )
{
gtk_widget_hide( MessageBox );
gtkVisibleMessageBox=0;
gtkSendMessage( evMessageBox );
}
GtkWidget * create_MessageBox( int type )
{
GtkWidget * MessageBox;
GtkWidget * frame1;
GtkWidget * frame2;
GtkWidget * frame3;
GtkWidget * frame4;
GtkWidget * vbox1;
GtkWidget * hbox1;
GtkWidget * pixmap1;
GtkWidget * hseparator1;
GtkWidget * hbuttonbox1;
GtkWidget * Ok;
GtkAccelGroup * accel_group;
GtkStyle * pixmapstyle;
GtkPixmap * 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);
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);
frame1 = gtk_frame_new (NULL);
gtk_widget_set_name (frame1, "frame1");
gtk_widget_ref (frame1);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "frame1", frame1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame1);
gtk_container_add (GTK_CONTAINER (MessageBox), frame1);
gtk_container_set_border_width (GTK_CONTAINER (frame1), 1);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
frame2 = gtk_frame_new (NULL);
gtk_widget_set_name (frame2, "frame2");
gtk_widget_ref (frame2);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "frame2", frame2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame2);
gtk_container_add (GTK_CONTAINER (frame1), frame2);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);
frame3 = gtk_frame_new (NULL);
gtk_widget_set_name (frame3, "frame3");
gtk_widget_ref (frame3);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "frame3", frame3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame3);
gtk_container_add (GTK_CONTAINER (frame2), frame3);
gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_ETCHED_OUT);
frame4 = gtk_frame_new (NULL);
gtk_widget_set_name (frame4, "frame4");
gtk_widget_ref (frame4);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "frame4", frame4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame4);
gtk_container_add (GTK_CONTAINER (frame3), frame4);
gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_NONE);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox1, "vbox1");
gtk_widget_ref (vbox1);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "vbox1", vbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (frame4), vbox1);
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_set_name (hbox1, "hbox1");
gtk_widget_ref (hbox1);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "hbox1", hbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
pixmapstyle=gtk_widget_get_style( MessageBox );
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 );
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_ref (WarningPixmap);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "pixmap1", WarningPixmap,(GtkDestroyNotify)gtk_widget_unref);
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_name (ErrorPixmap, "pixmap1");
gtk_widget_ref (ErrorPixmap);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "pixmap1", ErrorPixmap,(GtkDestroyNotify)gtk_widget_unref);
gtk_widget_hide (ErrorPixmap);
gtk_box_pack_start (GTK_BOX (hbox1), ErrorPixmap, FALSE, FALSE, 0);
gtk_widget_set_usize (ErrorPixmap, 55, -2);
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_ref (gtkMessageBoxText);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "gtkMessageBoxText", gtkMessageBoxText,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (gtkMessageBoxText);
gtk_box_pack_start (GTK_BOX (hbox1), gtkMessageBoxText, TRUE, TRUE, 0);
gtk_label_set_justify (GTK_LABEL (gtkMessageBoxText), GTK_JUSTIFY_FILL);
gtk_label_set_line_wrap (GTK_LABEL (gtkMessageBoxText), TRUE);
hseparator1 = gtk_hseparator_new ();
gtk_widget_set_name (hseparator1, "hseparator1");
gtk_widget_ref (hseparator1);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "hseparator1", hseparator1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hseparator1);
gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, FALSE, 0);
gtk_widget_set_usize (hseparator1, -2, 9);
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
gtk_widget_ref (hbuttonbox1);
gtk_object_set_data_full (GTK_OBJECT (MessageBox), "hbuttonbox1", hbuttonbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 0);
Ok = gtk_button_new_with_label (MSGTR_Ok);
gtk_widget_set_name (Ok, MSGTR_Ok);
gtk_widget_ref (Ok);
gtk_object_set_data_full (GTK_OBJECT (MessageBox),MSGTR_Ok, Ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (Ok);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), Ok);
GTK_WIDGET_SET_FLAGS (Ok, GTK_CAN_DEFAULT);
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_signal_connect (GTK_OBJECT (MessageBox), "destroy_event",
GTK_SIGNAL_FUNC (on_MessageBox_destroy),
NULL);
gtk_signal_connect (GTK_OBJECT (Ok), "released",GTK_SIGNAL_FUNC (on_Ok_released),NULL);
gtk_window_add_accel_group (GTK_WINDOW (MessageBox), accel_group);
return MessageBox;
}
--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include "../../events.h"
#include "menu.h"
#include "../widgets.h"
void ActivateMenuItem( int Item )
{
gtkVisiblePopUpMenu=0;
fprintf( stderr,"[menu] item: %d\n",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 );
gtk_widget_show( Item );
return Item;
}
GtkWidget * AddSubMenu( GtkWidget * Menu,char * label )
{
GtkWidget * Item = NULL;
GtkWidget * SubItem = NULL;
SubItem=gtk_menu_item_new_with_label( label );
gtk_menu_append( GTK_MENU( Menu ),SubItem );
gtk_widget_show( SubItem );
Item=gtk_menu_new();
gtk_widget_show( Item );
gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item );
return Item;
}
GtkWidget * AddSeparator( GtkWidget * Menu )
{
GtkWidget * Item = NULL;
Item=gtk_menu_item_new ();
gtk_widget_show( Item );
gtk_container_add( GTK_CONTAINER( Menu ),Item );
gtk_widget_set_sensitive( Item,FALSE );
return Item;
}
GtkWidget * DVDSubMenu;
GtkWidget * create_PopUpMenu( void )
{
GtkWidget * Menu = NULL;
GtkWidget * SubMenu = NULL;
GtkWidget * SubMenuItem = NULL;
Menu=gtk_menu_new();
AddMenuItem( Menu,"About MPlayer"" ", evAbout );
AddSeparator( Menu );
SubMenu=AddSubMenu( Menu,"Open ..." );
AddMenuItem( SubMenu,"Play file ..."" ", evLoad );
AddMenuItem( SubMenu,"Play VCD ...", evNone );
AddMenuItem( SubMenu,"Play DVD ...", evNone );
AddMenuItem( SubMenu,"Play URL ...", evNone );
AddMenuItem( SubMenu,"Load subtitle ... ", evLoadSubtitle );
SubMenu=AddSubMenu( Menu,"Playing" );
AddMenuItem( SubMenu,"Play"" ", evPlay );
AddMenuItem( SubMenu,"Pause", evPause );
AddMenuItem( SubMenu,"Stop", evStop );
AddMenuItem( SubMenu,"Prev stream", evPrev );
AddMenuItem( SubMenu,"Next stream", evNext );
AddSeparator( SubMenu );
AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec );
AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec );
AddMenuItem( SubMenu,"Back 1 min", evBackward1min );
AddMenuItem( SubMenu,"Fwd 1 min", evForward1min );
AddMenuItem( SubMenu,"Back 10 min", evBackward10min );
AddMenuItem( SubMenu,"Fwk 10 min", evForward10min );
SubMenu=AddSubMenu( Menu,"Size" );
AddMenuItem( SubMenu,"Normal size"" ", evNormalSize );
AddMenuItem( SubMenu,"Double size", evDoubleSize );
AddMenuItem( SubMenu,"Fullscreen", evFullScreen );
DVDSubMenu=AddSubMenu( Menu,"DVD" );
AddMenuItem( DVDSubMenu,"Play disc ...", evNone );
AddMenuItem( DVDSubMenu,"Show DVD Menu", evNone );
AddSeparator( DVDSubMenu );
AddMenuItem( DVDSubMenu," ... ", evNone );
AddSeparator( Menu );
AddMenuItem( Menu,"Playlist", evPlayList );
AddMenuItem( Menu,"Skin browser", evSkinBrowser );
AddMenuItem( Menu,"Preferences", evPreferences );
AddSeparator( Menu );
AddMenuItem( Menu,"Exit ...", evExit );
return Menu;
}
--- NEW FILE ---
#include "./mplayer.h"
#include "psignal.h"
#include "../error.h"
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../widgets.h"
#include "opts.h"
GtkWidget * opAudioFrameLabel;
GtkWidget * opAudioLabel;
GtkWidget * opAudioDriverMenu;
GtkWidget * opDelayLabel;
GtkWidget * opAudioDelaySkinButton;
GtkWidget * opAudioConfigureButton;
GtkWidget * OpVideoFrameLabel;
GtkWidget * opVideoLabel;
GtkWidget * opVideoMenu;
GtkWidget * opOsdCheckButton;
GtkWidget * opVideoConfButton;
GtkWidget * opOSDLabel;
GtkWidget * opOSDLevelSpinButton;
GtkWidget * opAutoFullscreenCheckBox;
GtkWidget * opOk;
GtkWidget * opCancel;
int opShift = False;
void HideOptions( void )
{
gtk_widget_hide( Options );
gtkVisibleOptions=0;
gtkShMem->vs.window=evPreferences;
gtkSendMessage( evHideWindow );
}
gboolean on_window2_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
{
switch ( event->keyval )
{
case GDK_Shift_L:
case GDK_Shift_R:
opShift=True;
break;
}
return FALSE;
}
gboolean on_window2_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
{
switch ( event->keyval )
{
case GDK_Escape:
case GDK_Return:
if ( !opShift ) HideOptions();
break;
case GDK_Tab:
// if ( sbShift )
// { if ( (--sbItemsListCounter) < 0 ) sbItemsListCounter=2; }
// else
// { if ( (++sbItemsListCounter) > 2 ) sbItemsListCounter=0; }
// gtk_widget_grab_focus( sbItemsList[sbItemsListCounter] );
break;
case GDK_Shift_L:
case GDK_Shift_R:
opShift=False;
break;
}
return FALSE;
}
gboolean on_window2_destroy_event( GtkWidget * widget,GdkEvent * event,gpointer user_data)
{
HideOptions();
return FALSE;
}
void on_opAudioDriverMenu_released( GtkButton * button,gpointer user_data )
{
}
void on_opAudioDelaySkinButton_changed( GtkEditable * editable,gpointer user_data )
{
}
void on_opAudioDelaySkinButton_move_to_column( GtkEditable * editable,gint column,gpointer user_data )
{
}
void on_opAudioDelaySkinButton_move_to_row( GtkEditable * editable,gint row,gpointer user_data )
{
}
void on_opAudioConfigureButton_released( GtkButton * button,gpointer user_data )
{
}
void on_opVideoMenu_released( GtkButton * button,gpointer user_data )
{
fprintf( stderr,"[opts] data: %s\n",(char *)user_data );
}
void on_opVideoMenu_pressed( GtkButton * button,gpointer user_data )
{
fprintf( stderr,"[opts] data: %s\n",(char *)user_data );
}
void on_opVideoMenu_clicked( GtkButton * button,gpointer user_data)
{
fprintf( stderr,"[opts] data(2): %s\n",(char *)user_data );
}
gboolean on_opVideoMenu_button_release_event( GtkWidget * widget,GdkEventButton * event,gpointer user_data )
{
fprintf( stderr,"[opts] video menu.\n" );
return FALSE;
}
void on_opOsdCheckButton_toggled( GtkToggleButton * togglebutton,gpointer user_data )
{
}
void on_opVideoConfButton_released( GtkButton * button,gpointer user_data )
{
}
void on_opOSDLevelSpinButton_changed( GtkEditable * editable,gpointer user_data )
{
}
void on_opOSDLevelSpinButton_move_to_column( GtkEditable * editable,gint column,gpointer user_data )
{
}
void on_opOSDLevelSpinButton_move_to_row( GtkEditable * editable,gint row,gpointer user_data )
{
}
void on_opOk_released( GtkButton * button,gpointer user_data )
{ HideOptions(); }
void on_opCancel_released( GtkButton * button,gpointer user_data )
{ HideOptions(); }
gboolean on_confOSS_destroy_event ( GtkWidget * widget,GdkEvent * event,gpointer user_data)
{
return FALSE;
}
gboolean on_confOSS_key_press_event ( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
{
return FALSE;
}
gboolean on_confOSS_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
{
return FALSE;
}
void on_opOSSDSPCombo_set_focus_child( GtkContainer * container,GtkWidget * widget,gpointer user_data )
{
}
void on_opOSSDSPComboEntry_changed( GtkEditable * editable,gpointer user_data )
{
}
void on_opOSSMixerCombo_set_focus_child( GtkContainer * container,GtkWidget * widget,gpointer user_data )
{
}
void on_opOSSMixerComboEntry_changed( GtkEditable * editable,gpointer user_data )
{
}
void on_opOSSOk_released( GtkButton * button,gpointer user_data )
{
}
void on_opOSSCancel_released( GtkButton * button,gpointer user_data )
{
}
void on_opAutoFullscreenCheckBox_toggled( GtkToggleButton *togglebutton,gpointer user_data )
{
}
GtkWidget * create_Options( void )
{
GtkWidget *frame1;
GtkWidget *frame2;
GtkWidget *frame3;
GtkWidget *frame4;
GtkWidget *vbox1;
GtkWidget *notebook1;
GtkWidget *frame5;
GtkWidget *frame6;
GtkWidget *hbox1;
GtkWidget *table1;
GtkWidget *opAudioDriverMenu_menu;
GtkWidget *glade_menuitem;
GtkObject *opAudioDelaySkinButton_adj;
GtkWidget *hbuttonbox2;
GtkWidget *frame16;
GtkWidget *table2;
GtkWidget *opVideoMenu_menu;
GtkWidget *hbuttonbox3;
GtkWidget *label5;
GtkObject *opOSDLevelSpinButton_adj;
GtkWidget *frame17;
GtkWidget *opAudio;
GtkWidget *frame11;
GtkWidget *frame12;
GtkWidget *hbox2;
GtkWidget *frame13;
GtkWidget *table4;
GtkWidget *vseparator1;
GtkWidget *frame14;
GtkWidget *opMisc;
GtkWidget *hseparator1;
GtkWidget *hbuttonbox1;
GtkTooltips *tooltips;
tooltips = gtk_tooltips_new ();
Options = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (Options, "Options");
gtk_object_set_data (GTK_OBJECT (Options), "Options", Options);
gtk_widget_set_usize (Options, 448, 260);
gtk_widget_set_events (Options, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK);
gtk_window_set_title (GTK_WINDOW (Options),"Options");
gtk_window_set_policy (GTK_WINDOW (Options), FALSE, FALSE, FALSE);
gtk_window_set_wmclass (GTK_WINDOW (Options), "Options", "Options");
frame1 = gtk_frame_new (NULL);
gtk_widget_set_name (frame1, "frame1");
gtk_widget_ref (frame1);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame1", frame1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame1);
gtk_container_add (GTK_CONTAINER (Options), frame1);
gtk_container_set_border_width (GTK_CONTAINER (frame1), 1);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
frame2 = gtk_frame_new (NULL);
gtk_widget_set_name (frame2, "frame2");
gtk_widget_ref (frame2);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame2", frame2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame2);
gtk_container_add (GTK_CONTAINER (frame1), frame2);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_NONE);
frame3 = gtk_frame_new (NULL);
gtk_widget_set_name (frame3, "frame3");
gtk_widget_ref (frame3);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame3", frame3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame3);
gtk_container_add (GTK_CONTAINER (frame2), frame3);
gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_ETCHED_OUT);
frame4 = gtk_frame_new (NULL);
gtk_widget_set_name (frame4, "frame4");
gtk_widget_ref (frame4);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame4", frame4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame4);
gtk_container_add (GTK_CONTAINER (frame3), frame4);
gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_NONE);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_set_name (vbox1, "vbox1");
gtk_widget_ref (vbox1);
gtk_object_set_data_full (GTK_OBJECT (Options), "vbox1", vbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (frame4), vbox1);
notebook1 = gtk_notebook_new ();
gtk_widget_set_name (notebook1, "notebook1");
gtk_widget_ref (notebook1);
gtk_object_set_data_full (GTK_OBJECT (Options), "notebook1", notebook1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (notebook1);
gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
frame5 = gtk_frame_new (NULL);
gtk_widget_set_name (frame5, "frame5");
gtk_widget_ref (frame5);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame5", frame5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame5);
gtk_container_add (GTK_CONTAINER (notebook1), frame5);
frame6 = gtk_frame_new (NULL);
gtk_widget_set_name (frame6, "frame6");
gtk_widget_ref (frame6);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame6", frame6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame6);
gtk_container_add (GTK_CONTAINER (frame5), frame6);
gtk_frame_set_shadow_type (GTK_FRAME (frame6), GTK_SHADOW_NONE);
hbox1 = gtk_hbox_new (TRUE, 0);
gtk_widget_set_name (hbox1, "hbox1");
gtk_widget_ref (hbox1);
gtk_object_set_data_full (GTK_OBJECT (Options), "hbox1", hbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox1);
gtk_container_add (GTK_CONTAINER (frame6), hbox1);
opAudioFrameLabel = gtk_frame_new ("Audio");
gtk_widget_set_name (opAudioFrameLabel, "opAudioFrameLabel");
gtk_widget_ref (opAudioFrameLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudioFrameLabel", opAudioFrameLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudioFrameLabel);
gtk_box_pack_start (GTK_BOX (hbox1), opAudioFrameLabel, FALSE, FALSE, 0);
gtk_widget_set_usize (opAudioFrameLabel, 212, -2);
gtk_container_set_border_width (GTK_CONTAINER (opAudioFrameLabel), 3);
gtk_frame_set_shadow_type (GTK_FRAME (opAudioFrameLabel), GTK_SHADOW_ETCHED_OUT);
table1 = gtk_table_new (4, 2, FALSE);
gtk_widget_set_name (table1, "table1");
gtk_widget_ref (table1);
gtk_object_set_data_full (GTK_OBJECT (Options), "table1", table1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table1);
gtk_container_add (GTK_CONTAINER (opAudioFrameLabel), table1);
opAudioLabel = gtk_label_new ("Driver: ");
gtk_widget_set_name (opAudioLabel, "opAudioLabel");
gtk_widget_ref (opAudioLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudioLabel", opAudioLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudioLabel);
gtk_table_attach (GTK_TABLE (table1), opAudioLabel, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opAudioLabel, 40, -2);
gtk_misc_set_alignment (GTK_MISC (opAudioLabel), 0, 0.5);
opAudioDriverMenu = gtk_option_menu_new ();
gtk_widget_set_name (opAudioDriverMenu, "opAudioDriverMenu");
gtk_widget_ref (opAudioDriverMenu);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudioDriverMenu", opAudioDriverMenu,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudioDriverMenu);
gtk_table_attach (GTK_TABLE (table1), opAudioDriverMenu, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opAudioDriverMenu, 159, 25);
gtk_tooltips_set_tip (tooltips, opAudioDriverMenu, "Select audio output driver.", NULL);
opAudioDriverMenu_menu = gtk_menu_new ();
glade_menuitem = gtk_menu_item_new_with_label ("null");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opAudioDriverMenu_menu), glade_menuitem);
#ifdef USE_OSS_AUDIO
glade_menuitem = gtk_menu_item_new_with_label ("OSS");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opAudioDriverMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_ALSA5
glade_menuitem = gtk_menu_item_new_with_label ("ALSA 0.5.x");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opAudioDriverMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_ALSA9
glade_menuitem = gtk_menu_item_new_with_label ("ALSA 0.9.x");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opAudioDriverMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_ESD
glade_menuitem = gtk_menu_item_new_with_label ("ESD");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opAudioDriverMenu_menu), glade_menuitem);
#endif
gtk_option_menu_set_menu (GTK_OPTION_MENU (opAudioDriverMenu), opAudioDriverMenu_menu);
opDelayLabel = gtk_label_new ("Delay:");
gtk_widget_set_name (opDelayLabel, "opDelayLabel");
gtk_widget_ref (opDelayLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opDelayLabel", opDelayLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opDelayLabel);
gtk_table_attach (GTK_TABLE (table1), opDelayLabel, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opDelayLabel, 35, -2);
gtk_misc_set_alignment (GTK_MISC (opDelayLabel), 0, 0.5);
opAudioDelaySkinButton_adj = gtk_adjustment_new (0, -500, 500, 0.01, 10, 10);
opAudioDelaySkinButton = gtk_spin_button_new (GTK_ADJUSTMENT (opAudioDelaySkinButton_adj), 1, 2);
gtk_widget_set_name (opAudioDelaySkinButton, "opAudioDelaySkinButton");
gtk_widget_ref (opAudioDelaySkinButton);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudioDelaySkinButton", opAudioDelaySkinButton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudioDelaySkinButton);
gtk_table_attach (GTK_TABLE (table1), opAudioDelaySkinButton, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL), //GTK_EXPAND |
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opAudioDelaySkinButton, 160, 25);
gtk_tooltips_set_tip (tooltips, opAudioDelaySkinButton, "Set audio delay.", NULL);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (opAudioDelaySkinButton), TRUE);
hbuttonbox2 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox2, "hbuttonbox2");
gtk_widget_ref (hbuttonbox2);
gtk_object_set_data_full (GTK_OBJECT (Options), "hbuttonbox2", hbuttonbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox2);
gtk_table_attach (GTK_TABLE (table1), hbuttonbox2, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_widget_set_usize (hbuttonbox2, -2, 31);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);
opAudioConfigureButton = gtk_button_new_with_label ("Configure");
gtk_widget_set_name (opAudioConfigureButton, "opAudioConfigureButton");
gtk_widget_ref (opAudioConfigureButton);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudioConfigureButton", opAudioConfigureButton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudioConfigureButton);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), opAudioConfigureButton);
gtk_widget_set_usize (opAudioConfigureButton, -2, 31);
GTK_WIDGET_SET_FLAGS (opAudioConfigureButton, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, opAudioConfigureButton, "Configure selected audio driver.", NULL);
frame16 = gtk_frame_new (NULL);
gtk_widget_set_name (frame16, "frame16");
gtk_widget_ref (frame16);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame16", frame16,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame16);
gtk_table_attach (GTK_TABLE (table1), frame16, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
gtk_frame_set_shadow_type (GTK_FRAME (frame16), GTK_SHADOW_NONE);
OpVideoFrameLabel = gtk_frame_new ("Video");
gtk_widget_set_name (OpVideoFrameLabel, "OpVideoFrameLabel");
gtk_widget_ref (OpVideoFrameLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "OpVideoFrameLabel", OpVideoFrameLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (OpVideoFrameLabel);
gtk_box_pack_start (GTK_BOX (hbox1), OpVideoFrameLabel, FALSE, FALSE, 0);
gtk_widget_set_usize (OpVideoFrameLabel, 212, -2);
gtk_container_set_border_width (GTK_CONTAINER (OpVideoFrameLabel), 3);
gtk_frame_set_shadow_type (GTK_FRAME (OpVideoFrameLabel), GTK_SHADOW_ETCHED_OUT);
table2 = gtk_table_new (5, 2, FALSE);
gtk_widget_set_name (table2, "table2");
gtk_widget_ref (table2);
gtk_object_set_data_full (GTK_OBJECT (Options), "table2", table2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table2);
gtk_container_add (GTK_CONTAINER (OpVideoFrameLabel), table2);
opVideoLabel = gtk_label_new ("Driver:");
gtk_widget_set_name (opVideoLabel, "opVideoLabel");
gtk_widget_ref (opVideoLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opVideoLabel", opVideoLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opVideoLabel);
gtk_table_attach (GTK_TABLE (table2), opVideoLabel, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opVideoLabel, 35, -2);
gtk_misc_set_alignment (GTK_MISC (opVideoLabel), 0, 0.5);
opVideoMenu = gtk_option_menu_new ();
gtk_widget_set_name (opVideoMenu, "opVideoMenu");
gtk_widget_ref (opVideoMenu);
gtk_object_set_data_full (GTK_OBJECT (Options), "opVideoMenu", opVideoMenu,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opVideoMenu);
gtk_table_attach (GTK_TABLE (table2), opVideoMenu, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opVideoMenu, 137, 25);
gtk_tooltips_set_tip (tooltips, opVideoMenu, "Select video output driver.", NULL);
opVideoMenu_menu = gtk_menu_new ();
#if defined( HAVE_X11 ) && defined( HAVE_MGA )
glade_menuitem = gtk_menu_item_new_with_label ("xmga");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opVideoMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_XV
glade_menuitem = gtk_menu_item_new_with_label ("xv");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opVideoMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_X11
glade_menuitem = gtk_menu_item_new_with_label ("x11");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opVideoMenu_menu), glade_menuitem);
#endif
#ifdef HAVE_PNG
glade_menuitem = gtk_menu_item_new_with_label ("png");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opVideoMenu_menu), glade_menuitem);
#endif
glade_menuitem = gtk_menu_item_new_with_label ("null");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (opVideoMenu_menu), glade_menuitem);
gtk_option_menu_set_menu (GTK_OPTION_MENU (opVideoMenu), opVideoMenu_menu);
opOsdCheckButton = gtk_check_button_new_with_label ("");
gtk_widget_set_name (opOsdCheckButton, "opOsdCheckButton");
gtk_widget_ref (opOsdCheckButton);
gtk_object_set_data_full (GTK_OBJECT (Options), "opOsdCheckButton", opOsdCheckButton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opOsdCheckButton);
gtk_table_attach (GTK_TABLE (table2), opOsdCheckButton, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opOsdCheckButton, -2, 24);
gtk_tooltips_set_tip (tooltips, opOsdCheckButton, "On/off OSD.", NULL);
hbuttonbox3 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox3, "hbuttonbox3");
gtk_widget_ref (hbuttonbox3);
gtk_object_set_data_full (GTK_OBJECT (Options), "hbuttonbox3", hbuttonbox3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox3);
gtk_table_attach (GTK_TABLE (table2), hbuttonbox3, 1, 2, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
gtk_widget_set_usize (hbuttonbox3, -2, 31);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox3), GTK_BUTTONBOX_END);
opVideoConfButton = gtk_button_new_with_label ("Configure");
gtk_widget_set_name (opVideoConfButton, "opVideoConfButton");
gtk_widget_ref (opVideoConfButton);
gtk_object_set_data_full (GTK_OBJECT (Options), "opVideoConfButton", opVideoConfButton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opVideoConfButton);
gtk_container_add (GTK_CONTAINER (hbuttonbox3), opVideoConfButton);
gtk_widget_set_usize (opVideoConfButton, -2, 31);
GTK_WIDGET_SET_FLAGS (opVideoConfButton, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, opVideoConfButton, "Configure selected video driver.", NULL);
opOSDLabel = gtk_label_new ("OSD:");
gtk_widget_set_name (opOSDLabel, "opOSDLabel");
gtk_widget_ref (opOSDLabel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opOSDLabel", opOSDLabel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opOSDLabel);
gtk_table_attach (GTK_TABLE (table2), opOSDLabel, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opOSDLabel, 35, -2);
gtk_misc_set_alignment (GTK_MISC (opOSDLabel), 0, 0.5);
label5 = gtk_label_new ("OSD level:");
gtk_widget_set_name (label5, "label5");
gtk_widget_ref (label5);
gtk_object_set_data_full (GTK_OBJECT (Options), "label5", label5,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label5);
gtk_table_attach (GTK_TABLE (table2), label5, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (label5, 63, -2);
gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
opOSDLevelSpinButton_adj = gtk_adjustment_new (0, 0, 2, 1, 10, 10);
opOSDLevelSpinButton = gtk_spin_button_new (GTK_ADJUSTMENT (opOSDLevelSpinButton_adj), 1, 0);
gtk_widget_set_name (opOSDLevelSpinButton, "opOSDLevelSpinButton");
gtk_widget_ref (opOSDLevelSpinButton);
gtk_object_set_data_full (GTK_OBJECT (Options), "opOSDLevelSpinButton", opOSDLevelSpinButton,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opOSDLevelSpinButton);
gtk_table_attach (GTK_TABLE (table2), opOSDLevelSpinButton, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opOSDLevelSpinButton, 136, 25);
gtk_tooltips_set_tip (tooltips, opOSDLevelSpinButton, "Set OSD level.", NULL);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (opOSDLevelSpinButton), TRUE);
frame17 = gtk_frame_new (NULL);
gtk_widget_set_name (frame17, "frame17");
gtk_widget_ref (frame17);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame17", frame17,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame17);
gtk_table_attach (GTK_TABLE (table2), frame17, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_widget_set_usize (frame17, -2, 40);
gtk_frame_set_shadow_type (GTK_FRAME (frame17), GTK_SHADOW_NONE);
opAudio = gtk_label_new ("Audio & Video");
gtk_widget_set_name (opAudio, "opAudio");
gtk_widget_ref (opAudio);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAudio", opAudio,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAudio);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), opAudio);
gtk_widget_set_usize (opAudio, 80, -2);
frame11 = gtk_frame_new (NULL);
gtk_widget_set_name (frame11, "frame11");
gtk_widget_ref (frame11);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame11", frame11,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame11);
gtk_container_add (GTK_CONTAINER (notebook1), frame11);
frame12 = gtk_frame_new (NULL);
gtk_widget_set_name (frame12, "frame12");
gtk_widget_ref (frame12);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame12", frame12,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame12);
gtk_container_add (GTK_CONTAINER (frame11), frame12);
gtk_frame_set_shadow_type (GTK_FRAME (frame12), GTK_SHADOW_NONE);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_set_name (hbox2, "hbox2");
gtk_widget_ref (hbox2);
gtk_object_set_data_full (GTK_OBJECT (Options), "hbox2", hbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox2);
gtk_container_add (GTK_CONTAINER (frame12), hbox2);
frame13 = gtk_frame_new (NULL);
gtk_widget_set_name (frame13, "frame13");
gtk_widget_ref (frame13);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame13", frame13,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame13);
gtk_box_pack_start (GTK_BOX (hbox2), frame13, TRUE, TRUE, 0);
gtk_widget_set_usize (frame13, 212, -2);
gtk_frame_set_shadow_type (GTK_FRAME (frame13), GTK_SHADOW_NONE);
table4 = gtk_table_new (2, 1, FALSE);
gtk_widget_set_name (table4, "table4");
gtk_widget_ref (table4);
gtk_object_set_data_full (GTK_OBJECT (Options), "table4", table4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table4);
gtk_container_add (GTK_CONTAINER (frame13), table4);
opAutoFullscreenCheckBox = gtk_check_button_new_with_label ("Always switch fullscreen on play");
gtk_widget_set_name (opAutoFullscreenCheckBox, "opAutoFullscreenCheckBox");
gtk_widget_ref (opAutoFullscreenCheckBox);
gtk_object_set_data_full (GTK_OBJECT (Options), "opAutoFullscreenCheckBox", opAutoFullscreenCheckBox,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opAutoFullscreenCheckBox);
gtk_table_attach (GTK_TABLE (table4), opAutoFullscreenCheckBox, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (opAutoFullscreenCheckBox, -2, 25);
gtk_tooltips_set_tip (tooltips, opAutoFullscreenCheckBox, "Switch player window to fullscreen on all play.", NULL);
vseparator1 = gtk_vseparator_new ();
gtk_widget_set_name (vseparator1, "vseparator1");
gtk_widget_ref (vseparator1);
gtk_object_set_data_full (GTK_OBJECT (Options), "vseparator1", vseparator1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vseparator1);
gtk_box_pack_start (GTK_BOX (hbox2), vseparator1, FALSE, FALSE, 0);
gtk_widget_set_usize (vseparator1, 3, -2);
frame14 = gtk_frame_new (NULL);
gtk_widget_set_name (frame14, "frame14");
gtk_widget_ref (frame14);
gtk_object_set_data_full (GTK_OBJECT (Options), "frame14", frame14,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame14);
gtk_box_pack_start (GTK_BOX (hbox2), frame14, TRUE, TRUE, 0);
gtk_widget_set_usize (frame14, 212, -2);
gtk_frame_set_shadow_type (GTK_FRAME (frame14), GTK_SHADOW_NONE);
opMisc = gtk_label_new ("Misc");
gtk_widget_set_name (opMisc, "opMisc");
gtk_widget_ref (opMisc);
gtk_object_set_data_full (GTK_OBJECT (Options), "opMisc", opMisc,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opMisc);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), opMisc);
gtk_widget_set_usize (opMisc, 75, -2);
hseparator1 = gtk_hseparator_new ();
gtk_widget_set_name (hseparator1, "hseparator1");
gtk_widget_ref (hseparator1);
gtk_object_set_data_full (GTK_OBJECT (Options), "hseparator1", hseparator1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hseparator1);
gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, FALSE, 0);
gtk_widget_set_usize (hseparator1, -2, 5);
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
gtk_widget_ref (hbuttonbox1);
gtk_object_set_data_full (GTK_OBJECT (Options), "hbuttonbox1", hbuttonbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, TRUE, TRUE, 0);
gtk_widget_set_usize (hbuttonbox1, -2, 27);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 0);
gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox1), 90, 30);
opOk = gtk_button_new_with_label ("Ok");
gtk_widget_set_name (opOk, "opOk");
gtk_widget_ref (opOk);
gtk_object_set_data_full (GTK_OBJECT (Options), "opOk", opOk,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opOk);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), opOk);
GTK_WIDGET_SET_FLAGS (opOk, GTK_CAN_DEFAULT);
opCancel = gtk_button_new_with_label ("Cancel");
gtk_widget_set_name (opCancel, "opCancel");
gtk_widget_ref (opCancel);
gtk_object_set_data_full (GTK_OBJECT (Options), "opCancel", opCancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (opCancel);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), opCancel);
GTK_WIDGET_SET_FLAGS (opCancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (Options), "key_press_event",
GTK_SIGNAL_FUNC (on_window2_key_press_event),
NULL);
gtk_signal_connect (GTK_OBJECT (Options), "key_release_event",
GTK_SIGNAL_FUNC (on_window2_key_release_event),
NULL);
gtk_signal_connect (GTK_OBJECT (Options), "destroy_event",
GTK_SIGNAL_FUNC (on_window2_destroy_event),
NULL);
gtk_signal_connect (GTK_OBJECT (opAudioDriverMenu), "released",
GTK_SIGNAL_FUNC (on_opAudioDriverMenu_released),
NULL);
gtk_signal_connect (GTK_OBJECT (opAudioDelaySkinButton), "changed",
GTK_SIGNAL_FUNC (on_opAudioDelaySkinButton_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (opAudioDelaySkinButton), "move_to_column",
GTK_SIGNAL_FUNC (on_opAudioDelaySkinButton_move_to_column),
NULL);
gtk_signal_connect (GTK_OBJECT (opAudioDelaySkinButton), "move_to_row",
GTK_SIGNAL_FUNC (on_opAudioDelaySkinButton_move_to_row),
NULL);
gtk_signal_connect (GTK_OBJECT (opAudioConfigureButton), "released",
GTK_SIGNAL_FUNC (on_opAudioConfigureButton_released),
NULL);
gtk_signal_connect (GTK_OBJECT (opVideoMenu), "released",
GTK_SIGNAL_FUNC (on_opVideoMenu_released),
NULL);
gtk_signal_connect (GTK_OBJECT (opVideoMenu), "clicked",
GTK_SIGNAL_FUNC (on_opVideoMenu_clicked),
NULL);
gtk_signal_connect (GTK_OBJECT (opVideoMenu), "button_release_event",
GTK_SIGNAL_FUNC (on_opVideoMenu_button_release_event),
NULL);
gtk_signal_connect (GTK_OBJECT (opVideoMenu), "pressed",
GTK_SIGNAL_FUNC (on_opVideoMenu_pressed),
NULL);
gtk_signal_connect (GTK_OBJECT (opOsdCheckButton), "toggled",
GTK_SIGNAL_FUNC (on_opOsdCheckButton_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (opVideoConfButton), "released",
GTK_SIGNAL_FUNC (on_opVideoConfButton_released),
NULL);
gtk_signal_connect (GTK_OBJECT (opOSDLevelSpinButton), "changed",
GTK_SIGNAL_FUNC (on_opOSDLevelSpinButton_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (opOSDLevelSpinButton), "move_to_column",
GTK_SIGNAL_FUNC (on_opOSDLevelSpinButton_move_to_column),
NULL);
gtk_signal_connect (GTK_OBJECT (opOSDLevelSpinButton), "move_to_row",
GTK_SIGNAL_FUNC (on_opOSDLevelSpinButton_move_to_row),
NULL);
gtk_signal_connect (GTK_OBJECT (opAutoFullscreenCheckBox), "toggled",
GTK_SIGNAL_FUNC (on_opAutoFullscreenCheckBox_toggled),
NULL);
gtk_signal_connect (GTK_OBJECT (opOk), "released",
GTK_SIGNAL_FUNC (on_opOk_released),
NULL);
gtk_signal_connect (GTK_OBJECT (opCancel), "released",
GTK_SIGNAL_FUNC (on_opCancel_released),
NULL);
gtk_object_set_data (GTK_OBJECT (Options), "tooltips", tooltips);
return Options;
}
--- NEW FILE ---
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../widgets.h"
#include "pl.h"
void HidePlayList( void )
{
gtk_widget_hide( PlayList );
gtkVisiblePlayList=0;
gtkShMem->vs.window=evPlayList;
gtkSendMessage( evHideWindow );
}
void pl_PlayList_destroy( GtkObject * object,gpointer user_data )
{ HidePlayList(); }
void pl_Add_released( GtkButton * button,gpointer user_data )
{
}
void pl_Remove_released( GtkButton * button,gpointer user_data )
{
}
void pl_Ok_released( GtkButton * button,gpointer user_data )
{ HidePlayList(); }
void pl_Cancel_released( GtkButton * button,gpointer user_data )
{ HidePlayList(); }
void pl_DirTree_select_child( GtkTree * tree,GtkWidget * widget,gpointer user_data )
{
}
void pl_DirTree_selection_changed( GtkTree * tree,gpointer user_data )
{
}
void pl_DirTree_unselect_child( GtkTree * tree,GtkWidget * widget,gpointer user_data )
{
}
void pl_FNameList_select_child( GtkList * list,GtkWidget * widget,gpointer user_data )
{
}
void pl_FNameList_selection_changed( GtkList * list,gpointer user_data )
{
}
void pl_FNameList_unselect_child( GtkList * list,GtkWidget * widget,gpointer user_data )
{
}
void pl_SelectedList_select_child( GtkList * list,GtkWidget * widget,gpointer user_data )
{
}
void pl_SelectedList_selection_changed( GtkList * list,gpointer user_data )
{
}
void pl_SelectedList_unselect_child( GtkList * list,GtkWidget * widget,gpointer user_data )
{
}
GtkWidget* create_PlayList( void )
{
GtkWidget *PlayList;
GtkWidget *frame9;
GtkWidget *frame10;
GtkWidget *frame11;
GtkWidget *frame12;
GtkWidget *hbox5;
GtkWidget *frame13;
GtkWidget *frame14;
GtkWidget *DirTree;
GtkWidget *vbox6;
GtkWidget *frame15;
GtkWidget *FNameList;
GtkWidget *frame16;
GtkWidget *SelectedList;
GtkWidget *hseparator6;
GtkWidget *hbuttonbox5;
GtkWidget *Add;
GtkWidget *Remove;
GtkWidget *Ok;
GtkWidget *Cancel;
PlayList = gtk_window_new( GTK_WINDOW_DIALOG );
gtk_object_set_data( GTK_OBJECT( PlayList ),MSGTR_PlayList,PlayList );
gtk_widget_set_usize( PlayList,512,256 );
GTK_WIDGET_SET_FLAGS( PlayList,GTK_CAN_FOCUS );
GTK_WIDGET_SET_FLAGS( PlayList,GTK_CAN_DEFAULT );
gtk_widget_set_events( PlayList,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( PlayList ),MSGTR_PlayList );
gtk_window_set_position( GTK_WINDOW( PlayList ),GTK_WIN_POS_CENTER );
gtk_window_set_policy( GTK_WINDOW( PlayList ),FALSE,FALSE,TRUE );
frame9 = gtk_frame_new( NULL );
gtk_widget_ref( frame9 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame9",frame9,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame9 );
gtk_container_add( GTK_CONTAINER( PlayList ),frame9 );
gtk_container_set_border_width( GTK_CONTAINER( frame9 ),1 );
gtk_frame_set_shadow_type( GTK_FRAME( frame9 ),GTK_SHADOW_IN );
frame10 = gtk_frame_new( NULL );
gtk_widget_ref( frame10 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame10",frame10,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame10 );
gtk_container_add( GTK_CONTAINER( frame9 ),frame10 );
gtk_frame_set_shadow_type( GTK_FRAME( frame10 ),GTK_SHADOW_NONE );
frame11 = gtk_frame_new( NULL );
gtk_widget_ref( frame11 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame11",frame11,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame11 );
gtk_container_add( GTK_CONTAINER( frame10 ),frame11 );
gtk_frame_set_shadow_type( GTK_FRAME( frame11 ),GTK_SHADOW_ETCHED_OUT );
frame12 = gtk_frame_new( NULL );
gtk_widget_ref( frame12 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame12",frame12,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame12 );
gtk_container_add( GTK_CONTAINER( frame11 ),frame12 );
gtk_frame_set_shadow_type( GTK_FRAME( frame12 ),GTK_SHADOW_NONE );
hbox5 = gtk_hbox_new( FALSE,0 );
gtk_widget_ref( hbox5 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hbox5",hbox5,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbox5 );
gtk_container_add( GTK_CONTAINER( frame12 ),hbox5 );
frame13 = gtk_frame_new( NULL );
gtk_widget_ref( frame13 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame13",frame13,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame13 );
gtk_box_pack_start( GTK_BOX( hbox5 ),frame13,TRUE,TRUE,0 );
gtk_frame_set_shadow_type( GTK_FRAME( frame13 ),GTK_SHADOW_ETCHED_OUT );
frame14 = gtk_frame_new( NULL );
gtk_widget_ref( frame14 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame14",frame14,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame14 );
gtk_container_add( GTK_CONTAINER( frame13 ),frame14 );
gtk_frame_set_shadow_type( GTK_FRAME( frame14 ),GTK_SHADOW_NONE );
DirTree = gtk_tree_new();
gtk_widget_ref( DirTree );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"DirTree",DirTree,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( DirTree );
gtk_container_add( GTK_CONTAINER( frame14 ),DirTree );
gtk_widget_set_usize( DirTree,217,-2 );
vbox6 = gtk_vbox_new( FALSE,0 );
gtk_widget_ref( vbox6 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"vbox6",vbox6,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( vbox6 );
gtk_box_pack_start( GTK_BOX( hbox5 ),vbox6,TRUE,TRUE,0 );
frame15 = gtk_frame_new( NULL );
gtk_widget_ref( frame15 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame15",frame15,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame15 );
gtk_box_pack_start( GTK_BOX( vbox6 ),frame15,TRUE,TRUE,0 );
gtk_frame_set_shadow_type( GTK_FRAME( frame15 ),GTK_SHADOW_ETCHED_OUT );
FNameList = gtk_list_new();
gtk_widget_ref( FNameList );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"FNameList",FNameList,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( FNameList );
gtk_container_add( GTK_CONTAINER( frame15 ),FNameList );
frame16 = gtk_frame_new( NULL );
gtk_widget_ref( frame16 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"frame16",frame16,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame16 );
gtk_box_pack_start( GTK_BOX( vbox6 ),frame16,TRUE,TRUE,0 );
gtk_frame_set_shadow_type( GTK_FRAME( frame16 ),GTK_SHADOW_ETCHED_OUT );
SelectedList = gtk_list_new();
gtk_widget_ref( SelectedList );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"SelectedList",SelectedList,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( SelectedList );
gtk_container_add( GTK_CONTAINER( frame16 ),SelectedList );
hseparator6 = gtk_hseparator_new();
gtk_widget_ref( hseparator6 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hseparator6",hseparator6,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator6 );
gtk_box_pack_start( GTK_BOX( vbox6 ),hseparator6,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator6,-2,11 );
hbuttonbox5 = gtk_hbutton_box_new();
gtk_widget_ref( hbuttonbox5 );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),"hbuttonbox5",hbuttonbox5,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hbuttonbox5 );
gtk_box_pack_start( GTK_BOX( vbox6 ),hbuttonbox5,FALSE,FALSE,0 );
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox5 ),GTK_BUTTONBOX_END );
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox5 ),0 );
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox5 ),65,27 );
gtk_button_box_set_child_ipadding( GTK_BUTTON_BOX( hbuttonbox5 ),2,0 );
Add = gtk_button_new_with_label( MSGTR_Add );
gtk_widget_ref( Add );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),MSGTR_Add,Add,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( Add );
gtk_container_add( GTK_CONTAINER( hbuttonbox5 ),Add );
gtk_widget_set_usize( Add,45,-2 );
GTK_WIDGET_SET_FLAGS( Add,GTK_CAN_DEFAULT );
Remove = gtk_button_new_with_label( MSGTR_Remove );
gtk_widget_ref( Remove );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),MSGTR_Remove,Remove,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( Remove );
gtk_container_add( GTK_CONTAINER( hbuttonbox5 ),Remove );
gtk_widget_set_usize( Remove,45,-2 );
GTK_WIDGET_SET_FLAGS( Remove,GTK_CAN_DEFAULT );
Ok = gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_ref( Ok );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),MSGTR_Ok,Ok,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( Ok );
gtk_container_add( GTK_CONTAINER( hbuttonbox5 ),Ok );
gtk_widget_set_usize( Ok,45,-2 );
GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT );
Cancel = gtk_button_new_with_label( MSGTR_Cancel );
gtk_widget_ref( Cancel );
gtk_object_set_data_full( GTK_OBJECT( PlayList ),MSGTR_Cancel,Cancel,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( Cancel );
gtk_container_add( GTK_CONTAINER( hbuttonbox5 ),Cancel );
gtk_widget_set_usize( Cancel,45,-2 );
GTK_WIDGET_SET_FLAGS( Cancel,GTK_CAN_DEFAULT );
gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",
GTK_SIGNAL_FUNC( pl_PlayList_destroy ),
NULL );
gtk_signal_connect( GTK_OBJECT( DirTree ),"select_child",
GTK_SIGNAL_FUNC( pl_DirTree_select_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( DirTree ),"selection_changed",
GTK_SIGNAL_FUNC( pl_DirTree_selection_changed ),
NULL );
gtk_signal_connect( GTK_OBJECT( DirTree ),"unselect_child",
GTK_SIGNAL_FUNC( pl_DirTree_unselect_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( FNameList ),"select_child",
GTK_SIGNAL_FUNC( pl_FNameList_select_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( FNameList ),"selection_changed",
GTK_SIGNAL_FUNC( pl_FNameList_selection_changed ),
NULL );
gtk_signal_connect( GTK_OBJECT( FNameList ),"unselect_child",
GTK_SIGNAL_FUNC( pl_FNameList_unselect_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( SelectedList ),"select_child",
GTK_SIGNAL_FUNC( pl_SelectedList_select_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( SelectedList ),"selection_changed",
GTK_SIGNAL_FUNC( pl_SelectedList_selection_changed ),
NULL );
gtk_signal_connect( GTK_OBJECT( SelectedList ),"unselect_child",
GTK_SIGNAL_FUNC( pl_SelectedList_unselect_child ),
NULL );
gtk_signal_connect( GTK_OBJECT( Add ),"released",
GTK_SIGNAL_FUNC( pl_Add_released ),
NULL );
gtk_signal_connect( GTK_OBJECT( Remove ),"released",
GTK_SIGNAL_FUNC( pl_Remove_released ),
NULL );
gtk_signal_connect( GTK_OBJECT( Ok ),"released",
GTK_SIGNAL_FUNC( pl_Ok_released ),
NULL );
gtk_signal_connect( GTK_OBJECT( Cancel ),"released",
GTK_SIGNAL_FUNC( pl_Cancel_released ),
NULL );
return PlayList;
}
--- NEW FILE ---
#include <sys/stat.h>
#include <glob.h>
#include <unistd.h>
#include "sb.h"
#include "../../events.h"
#include "../../../config.h"
#include "../../../help_mp.h"
#include "../widgets.h"
#include "../app.h"
GtkWidget * SkinList;
char * sbSelectedSkin=NULL;
char * sbMPlayerDirInHome=NULL;
char * sbMPlayerPrefixDir=NULL;
void HideSkinBrowser( void )
{
gtk_widget_hide( SkinBrowser );
gtkVisibleSkinBrowser=0;
gtkShMem->vs.window=evSkinBrowser;
gtkSendMessage( evHideWindow );
gtkSendMessage( evSkinBrowser );
}
char gtkOldSkin[128];
int gtkFillSkinList( gchar * mdir )
{
gchar * str[2];
gchar * tmp;
int i;
glob_t gg;
struct stat fs;
strcpy( gtkOldSkin,gtkShMem->sb.name );
if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL )
{
gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory );
return 0;
}
str[1]="";
strcpy( str[0],"default" );
if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
free( str[0] );
glob( mdir,GLOB_NOSORT,NULL,&gg );
for( i=0;i<gg.gl_pathc;i++ )
{
if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
stat( gg.gl_pathv[i],&fs );
if ( S_ISDIR( fs.st_mode ) )
{
tmp=strrchr( gg.gl_pathv[i],'/' ); tmp++;
if ( !strcmp( tmp,"default" ) ) continue;
if ( ( str[0]=(char *)malloc( strlen( tmp ) + 1 ) ) == NULL ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory ); return 0; }
strcpy( str[0],tmp );
if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
free( str[0] );
}
}
globfree( &gg );
return 1;
}
void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
{ HideSkinBrowser(); }
void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
{
strcpy( gtkShMem->sb.name,gtkOldSkin );
HideSkinBrowser();
}
void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
{
gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
strcpy( gtkShMem->sb.name,sbSelectedSkin );
gtkSendMessage( evSkinBrowser );
if( !bevent ) return;
if( bevent->type == GDK_2BUTTON_PRESS ) HideSkinBrowser();
}
GtkWidget * create_SkinBrowser( void )
{
GtkWidget * SkinBrowser;
GtkWidget * frame5;
GtkWidget * frame6;
GtkWidget * frame7;
GtkWidget * frame8;
GtkWidget * vbox5;
GtkWidget * label;
GtkWidget * hseparator4;
GtkWidget * scrolledwindow1;
GtkWidget * label2;
GtkWidget * hseparator5;
GtkWidget * hbuttonbox4;
GtkWidget * Cancel;
GtkWidget * Ok;
GtkAccelGroup * accel_group;
accel_group = gtk_accel_group_new ();
SkinBrowser=gtk_window_new( GTK_WINDOW_DIALOG );
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 );
// GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_FOCUS );
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 );
frame5=gtk_frame_new( NULL );
gtk_widget_set_name( frame5,"frame5" );
gtk_widget_ref( frame5 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame5",frame5,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame5 );
gtk_container_add( GTK_CONTAINER( SkinBrowser ),frame5 );
gtk_frame_set_shadow_type( GTK_FRAME( frame5 ),GTK_SHADOW_IN );
frame6=gtk_frame_new( NULL );
gtk_widget_set_name( frame6,"frame6" );
gtk_widget_ref( frame6 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame6",frame6,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame6 );
gtk_container_add( GTK_CONTAINER( frame5 ),frame6 );
gtk_frame_set_shadow_type( GTK_FRAME( frame6 ),GTK_SHADOW_NONE );
frame7=gtk_frame_new( NULL );
gtk_widget_set_name( frame7,"frame7" );
gtk_widget_ref( frame7 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame7",frame7,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame7 );
gtk_container_add( GTK_CONTAINER( frame6 ),frame7 );
gtk_frame_set_shadow_type( GTK_FRAME( frame7 ),GTK_SHADOW_ETCHED_OUT );
frame8=gtk_frame_new( NULL );
gtk_widget_set_name( frame8,"frame8" );
gtk_widget_ref( frame8 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"frame8",frame8,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( frame8 );
gtk_container_add( GTK_CONTAINER( frame7 ),frame8 );
gtk_frame_set_shadow_type( GTK_FRAME( frame8 ),GTK_SHADOW_NONE );
vbox5=gtk_vbox_new( FALSE,0 );
gtk_widget_set_name( vbox5,"vbox5" );
gtk_widget_ref( vbox5 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"vbox5",vbox5,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( vbox5 );
gtk_container_add( GTK_CONTAINER( frame8 ),vbox5 );
label=gtk_label_new( "Skins:" );
gtk_widget_set_name( label,"label" );
gtk_widget_ref( label );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label",label,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( vbox5 ),label,FALSE,FALSE,0 );
gtk_label_set_justify( GTK_LABEL( label ),GTK_JUSTIFY_RIGHT );
gtk_misc_set_alignment( GTK_MISC( label ),7.45058e-09,7.45058e-09 );
hseparator4=gtk_hseparator_new();
gtk_widget_set_name( hseparator4,"hseparator4" );
gtk_widget_ref( hseparator4 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator4",hseparator4,
( GtkDestroyNotify ) gtk_widget_unref );
gtk_widget_show( hseparator4 );
gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator4,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator4,-2,5 );
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 );
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 );
label2=gtk_label_new( "label2" );
gtk_widget_set_name( label2,"label2" );
gtk_widget_ref( label2 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"label2",label2,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( label2 );
gtk_clist_set_column_widget( GTK_CLIST( SkinList ),0,label2 );
hseparator5=gtk_hseparator_new();
gtk_widget_set_name( hseparator5,"hseparator5" );
gtk_widget_ref( hseparator5 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hseparator5",hseparator5,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hseparator5 );
gtk_box_pack_start( GTK_BOX( vbox5 ),hseparator5,FALSE,TRUE,0 );
gtk_widget_set_usize( hseparator5,-2,9 );
hbuttonbox4=gtk_hbutton_box_new();
gtk_widget_set_name( hbuttonbox4,"hbuttonbox4" );
gtk_widget_ref( hbuttonbox4 );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),"hbuttonbox4",hbuttonbox4,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( hbuttonbox4 );
gtk_box_pack_start( GTK_BOX( vbox5 ),hbuttonbox4,FALSE,TRUE,0 );
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox4 ),GTK_BUTTONBOX_END );
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox4 ),0 );
gtk_button_box_set_child_size( GTK_BUTTON_BOX( hbuttonbox4 ),80,0 );
Ok=gtk_button_new_with_label( MSGTR_Ok );
gtk_widget_set_name( Ok,MSGTR_Ok );
gtk_widget_ref( Ok );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),MSGTR_Ok,Ok,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( Ok );
gtk_container_add( GTK_CONTAINER( hbuttonbox4 ),Ok );
gtk_widget_set_usize( Ok,-2,33 );
GTK_WIDGET_SET_FLAGS( Ok,GTK_CAN_DEFAULT );
gtk_widget_add_accelerator( Ok,"released",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
Cancel=gtk_button_new_with_label( MSGTR_Cancel );
gtk_widget_set_name( Cancel,MSGTR_Cancel );
gtk_widget_ref( Cancel );
gtk_object_set_data_full( GTK_OBJECT( SkinBrowser ),MSGTR_Cancel,Cancel,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( Cancel );
gtk_container_add( GTK_CONTAINER( hbuttonbox4 ),Cancel );
gtk_widget_set_usize( Cancel,-2,33 );
GTK_WIDGET_SET_FLAGS( Cancel,GTK_CAN_DEFAULT );
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( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),NULL );
gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),NULL );
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;
}
- Previous message: [Mplayer-cvslog] CVS: main/Gui/mplayer psignal.c,1.16,1.17 widgets.c,1.10,1.11
- Next message: [Mplayer-cvslog] CVS: main/Gui events.c,1.4,1.5 events.h,1.4,1.5 gui.mak,1.5,1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list