annotate gui/mplayer/widgets.c @ 33527:9f0812ccc421

Cosmetic: Adjust indent.
author ib
date Tue, 14 Jun 2011 17:53:40 +0000
parents 140525bcc32f
children 6f20f2a42b76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19 #include <stdlib.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 #include <stdio.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22 #include <sys/types.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 #include <sys/stat.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24 #include <sys/wait.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
25 #include <unistd.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
26 #include <string.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27 #include <signal.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29 #include <gdk/gdkprivate.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #include <gdk/gdkkeysyms.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #include <gdk/gdkx.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #include <gdk/gdk.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33 #include <gtk/gtk.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
35 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
36 #include "help_mp.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
37 #include "mp_msg.h"
33465
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
38 #include "libvo/x11_common.h"
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
39
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40 #include "widgets.h"
26365
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 26203
diff changeset
41 #include "gui/app.h"
33466
45d8bfbd27bc Define "gmplayer" as symbolic constant.
ib
parents: 33465
diff changeset
42 #include "gui/interface.h"
26365
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 26203
diff changeset
43 #include "gui/wm/ws.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 #include "play.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 #include "gtk/fs.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 GtkWidget * PopUpMenu = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 GtkWidget * WarningPixmap;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 GtkWidget * ErrorPixmap;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 int gtkPopupMenu = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55 int gtkPopupMenuParam = 0;
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 23077
diff changeset
56 int gtkInitialized = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 #include "gtk/sb.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59 #include "gtk/pl.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60 #include "gtk/fs.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 #include "gtk/mb.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 #include "gtk/about.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 #include "gtk/opts.h"
30531
704903d34069 Rename gui/mplayer/gtk/menu.[ch] --> gui/mplayer/gtk/gtkmenu.[ch].
diego
parents: 29263
diff changeset
64 #include "gtk/gtk_menu.h"
26137
02a08fffb1dc Rename url.c/url.h to the less generic gtk_url.c/gtk_url.h.
diego
parents: 25962
diff changeset
65 #include "gtk/gtk_url.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 #include "gtk/eq.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67
33484
4f940d7917f0 Provide a desktop icon of reasonable size (48x48) and quality.
ib
parents: 33466
diff changeset
68 #include "pixmaps/mplayer.xpm"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 // --- init & close gtk
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 Pixmap guiIcon;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 Pixmap guiIconMask;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
75 void gtkInit( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 {
33465
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
77 int argc = 0;
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
78 char *arg[3], **argv = arg;
33526
140525bcc32f Fix GUI icon bug.
ib
parents: 33509
diff changeset
79 GdkPixmap *gdkIcon;
140525bcc32f Fix GUI icon bug.
ib
parents: 33509
diff changeset
80 GdkBitmap *gdkIconMask;
33465
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
81
33466
45d8bfbd27bc Define "gmplayer" as symbolic constant.
ib
parents: 33465
diff changeset
82 arg[argc++] = GMPlayer;
33465
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
83
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
84 if (mDisplayName) // MPlayer option '-display' was given
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
85 {
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
86 arg[argc++] = "--display"; // Pass corresponding command line arguments to GTK,
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
87 arg[argc++] = mDisplayName; // to open the requested display for the GUI, too.
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
88 }
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
89
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init GTK ...\n" );
27343
5fe6a8adf569 Rename two GUI-related preprocessor directives:
diego
parents: 26458
diff changeset
91 #ifdef CONFIG_GTK2
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 gtk_disable_setlocale();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 #endif
33465
b0430e293333 Take notice of MPlayer option '-display'.
ib
parents: 33314
diff changeset
94 gtk_init( &argc, &argv );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 // gdk_set_use_xshm( TRUE );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96
33527
9f0812ccc421 Cosmetic: Adjust indent.
ib
parents: 33526
diff changeset
97 gdkIcon=gdk_pixmap_colormap_create_from_xpm_d( NULL,gdk_colormap_get_system(),&gdkIconMask,NULL,(gchar **) mplayer_xpm );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98
33526
140525bcc32f Fix GUI icon bug.
ib
parents: 33509
diff changeset
99 // start up GTK which realizes the pixmaps
140525bcc32f Fix GUI icon bug.
ib
parents: 33509
diff changeset
100 gtk_main_iteration_do(FALSE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101
33527
9f0812ccc421 Cosmetic: Adjust indent.
ib
parents: 33526
diff changeset
102 guiIcon=GDK_PIXMAP_XID( gdkIcon );
9f0812ccc421 Cosmetic: Adjust indent.
ib
parents: 33526
diff changeset
103 guiIconMask=GDK_PIXMAP_XID( gdkIconMask );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 23077
diff changeset
105 gtkInitialized=1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
107
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 void gtkAddIcon( GtkWidget * window )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
109 { wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),guiIcon,guiIconMask ); }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
110
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111 void gtkClearList( GtkWidget * list )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
112 { gtk_clist_clear( GTK_CLIST( list ) ); }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
113
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
114 int gtkFindCList( GtkWidget * list,char * item )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
115 {
33314
d30987a7e6cf Remove unused variable.
reimar
parents: 32847
diff changeset
116 gint j;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117 gchar * tmpstr;
33314
d30987a7e6cf Remove unused variable.
reimar
parents: 32847
diff changeset
118 for( j=0;j<GTK_CLIST( list )->rows;j++ )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
119 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
120 gtk_clist_get_text( GTK_CLIST( list ),j,0,&tmpstr );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
121 if ( !strcmp( tmpstr,item ) ) return j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123 return -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
124 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
126 void gtkSetDefaultToCList( GtkWidget * list,char * item )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
127 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
128 gint i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129 if ( ( i=gtkFindCList( list,item ) ) > -1 ) gtk_clist_select_row( GTK_CLIST( list ),i,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
131
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132 void gtkEventHandling( void )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135 for( i=0;i < 25;i++ ) gtk_main_iteration_do( 0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138 // --- funcs
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140 void gtkMessageBox( int type,const gchar * str )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
141 {
25962
afa125da85cf typo fix: inited --> initialized
diego
parents: 23077
diff changeset
142 if ( !gtkInitialized ) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
143 ShowMessageBox( str );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
144 gtk_label_set_text( GTK_LABEL( gtkMessageBoxText ),str );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145 /* enable linewrapping by alex */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
146 // GTK_LABEL(gtkMessageBoxText)->max_width = 80;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147 if (strlen(str) > 80)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
148 gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), TRUE);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
149 else
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), FALSE);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151 switch( type)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
152 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153 case GTK_MB_FATAL:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
154 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_FatalError );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
155 gtk_widget_hide( WarningPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
156 gtk_widget_show( ErrorPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
157 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 case GTK_MB_ERROR:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Error );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
160 gtk_widget_hide( WarningPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 gtk_widget_show( ErrorPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163 case GTK_MB_WARNING:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Warning );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165 gtk_widget_show( WarningPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
166 gtk_widget_hide( ErrorPixmap );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
167 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
168 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169 gtk_widget_show( MessageBox );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170 gtkSetLayer( MessageBox );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171 if ( type == GTK_MB_FATAL )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
172 while ( MessageBox ) gtk_main_iteration_do( 0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 void gtkSetLayer( GtkWidget * wdg )
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
176 {
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
177 wsSetLayer( gdk_display,GDK_WINDOW_XWINDOW( wdg->window ),appMPlayer.subWindow.isFullScreen );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178 gtkActive( wdg );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181 void gtkActive( GtkWidget * wdg )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182 { wsMoveTopWindow( gdk_display,GDK_WINDOW_XWINDOW( wdg->window )); }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 void gtkShow( int type,char * param )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
185 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
186 switch( type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188 case evEqualizer:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
189 ShowEqualizer();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
190 gtkSetLayer( Equalizer );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
191 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192 case evSkinBrowser:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 ShowSkinBrowser();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194 // gtkClearList( SkinList );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195 if ( gtkFillSkinList( sbMPlayerPrefixDir ) &&
32847
12ae3b893c59 Remove support for skins directories using the obsolete name 'Skin'.
ib
parents: 32741
diff changeset
196 gtkFillSkinList( sbMPlayerDirInHome ) )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 gtkSetDefaultToCList( SkinList,param );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 gtk_clist_sort( GTK_CLIST( SkinList ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200 gtk_widget_show( SkinBrowser );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
201 gtkSetLayer( SkinBrowser );
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
202 }
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
203 else
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
204 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
205 gtk_widget_destroy( SkinBrowser );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206 gtkMessageBox( GTK_MB_ERROR,"Skin dirs not found ... Please install skins." );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
207 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209 case evPreferences:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
210 ShowPreferences();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
211 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
212 case evPlayList:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
213 ShowPlayList();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
214 gtkSetLayer( PlayList );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
215 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
216 case evLoad:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
217 ShowFileSelect( fsVideoSelector,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
218 gtkSetLayer( fsFileSelect );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
219 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
220 case evFirstLoad:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
221 ShowFileSelect( fsVideoSelector,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
222 gtkSetLayer( fsFileSelect );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 case evLoadSubtitle:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
225 ShowFileSelect( fsSubtitleSelector,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
226 gtkSetLayer( fsFileSelect );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
228 case evLoadAudioFile:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
229 ShowFileSelect( fsAudioSelector,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
230 gtkSetLayer( fsFileSelect );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
231 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232 case evAbout:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
233 ShowAboutBox();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
234 gtkSetLayer( About );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236 case evShowPopUpMenu:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 gtkPopupMenu=evNone;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238 gtkPopupMenuParam=0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
239 if ( PopUpMenu )
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
240 {
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
241 gtk_widget_hide( PopUpMenu );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
242 gtk_widget_destroy( PopUpMenu );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
243 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
244 PopUpMenu=create_PopUpMenu();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
245 gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
246 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
247 case evHidePopUpMenu:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
248 if ( PopUpMenu )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
249 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
250 gtk_widget_hide( PopUpMenu );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
251 gtk_widget_destroy( PopUpMenu );
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27343
diff changeset
252 PopUpMenu=NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
253 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
254 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
255 case evPlayNetwork:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
256 ShowURLDialogBox();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
257 gtkSetLayer( URL );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
258 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
259 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
260 }