annotate Gui/mplayer/widgets.c @ 7286:98dd8785cf24

man page documentation
author jonas
date Thu, 05 Sep 2002 16:42:38 +0000
parents 9d21564cfc37
children e5dda05f9aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdio.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
5 #include <sys/types.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6 #include <sys/stat.h>
1700
a0f28ba7c34a gtk exit cleanup
arpi
parents: 1698
diff changeset
7 #include <sys/wait.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include <unistd.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 #include <string.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 #include <signal.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
11
4176
116abdd0aed1 small gtk bug fix (-display bug, baze gabu, miattad fogok elkarhozni:), and remove gui dependencie in mencoder
pontscho
parents: 3586
diff changeset
12 #include <gdk/gdkprivate.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13 #include <gdk/gdkkeysyms.h>
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
14 #include <gdk/gdkx.h>
4176
116abdd0aed1 small gtk bug fix (-display bug, baze gabu, miattad fogok elkarhozni:), and remove gui dependencie in mencoder
pontscho
parents: 3586
diff changeset
15 #include <gdk/gdk.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 #include <gtk/gtk.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18 #include "widgets.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
20 #include "./mplayer.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
21 #include "../events.h"
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
22 #include "../app.h"
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
23 #include "../wm/ws.h"
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
24
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
25
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
26 #include "gtk/menu.h"
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
27 #include "play.h"
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
28 #include "gtk/fs.h"
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
29
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30 #include "../../config.h"
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1883
diff changeset
31 #include "../../help_mp.h"
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6903
diff changeset
32 #include "../../mp_msg.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
33
4950
307a94037c5c bazmeg a playtree - t
pontscho
parents: 4818
diff changeset
34 GtkWidget * PopUpMenu = NULL;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35
1925
633a7f0d72a4 add gui error handling jol.
pontscho
parents: 1907
diff changeset
36 GtkWidget * WarningPixmap;
633a7f0d72a4 add gui error handling jol.
pontscho
parents: 1907
diff changeset
37 GtkWidget * ErrorPixmap;
633a7f0d72a4 add gui error handling jol.
pontscho
parents: 1907
diff changeset
38
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
39 int gtkPopupMenu = 0;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
40 int gtkPopupMenuParam = 0;
5919
60cf2bca993f some bug fix
pontscho
parents: 5520
diff changeset
41 int gtkInited = 0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
42
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
43 #include "gtk/sb.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
44 #include "gtk/pl.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
45 #include "gtk/fs.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
46 #include "gtk/mb.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
47 #include "gtk/about.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
48 #include "gtk/opts.h"
2901
f77f8379f28f rewrite ...
pontscho
parents: 1925
diff changeset
49 #include "gtk/menu.h"
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6222
diff changeset
50 #include "gtk/url.h"
6627
fd3ac41ee1a1 add equalizer support and fix some small bug...
pontscho
parents: 6623
diff changeset
51 #include "gtk/eq.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
52
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
53 #include "pixmaps/MPlayer_mini.xpm"
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
54
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
55 // --- init & close gtk
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
56
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
57 GdkPixmap * gtkIcon = NULL;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
58 GdkBitmap * gtkIconMask = NULL;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
59 Pixmap guiIcon;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
60 Pixmap guiIconMask;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
61
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6146
diff changeset
62 void gtkInit( void )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
63 {
5919
60cf2bca993f some bug fix
pontscho
parents: 5520
diff changeset
64 mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
65 gtk_set_locale();
6218
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6146
diff changeset
66 // gtk_init( &argc,&argv );
8cfddba867b4 fix text render chrash ...
pontscho
parents: 6146
diff changeset
67 gtk_init( 0,NULL );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
68 // gdk_set_use_xshm( TRUE );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
69
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
70 {
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
71 GtkWidget * win;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
72 win=gtk_window_new( GTK_WINDOW_TOPLEVEL );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
73
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
74 if ( !gtkIcon )
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
75 gtkIcon=gdk_pixmap_colormap_create_from_xpm_d( win->window,gdk_colormap_get_system(),&gtkIconMask,&win->style->bg[GTK_STATE_NORMAL],MPlayer_mini_xpm );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
76
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
77 guiIcon=GDK_WINDOW_XWINDOW( gtkIcon );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
78 guiIconMask=GDK_WINDOW_XWINDOW( gtkIconMask );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
79
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
80 gtk_widget_destroy( win );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
81 }
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
82
5919
60cf2bca993f some bug fix
pontscho
parents: 5520
diff changeset
83 gtkInited=1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
84 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
85
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
86 void gtkDone( void )
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
87 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
89
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
90 void gtkAddIcon( GtkWidget * window )
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
91 {
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
92 GdkWindowPrivate * win = (GdkWindowPrivate *)window->window;
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
93 wsSetIcon( gdk_display,win->xwindow,guiIcon,guiIconMask );
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
94 }
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
95
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
96 void gtkClearList( GtkWidget * list )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
97 { gtk_clist_clear( GTK_CLIST( list ) ); }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
98
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
99 int gtkFindCList( GtkWidget * list,char * item )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
100 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
101 gint j,t;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
102 gchar * tmpstr;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103 for( t=0,j=0;j<GTK_CLIST( list )->rows;j++ )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
104 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
105 gtk_clist_get_text( GTK_CLIST( list ),j,0,&tmpstr );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
106 if ( !strcmp( tmpstr,item ) ) return j;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
107 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
108 return -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
109 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
110
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
111 void gtkSetDefaultToCList( GtkWidget * list,char * item )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
112 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113 gint i;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 if ( ( i=gtkFindCList( list,item ) ) > -1 ) gtk_clist_select_row( GTK_CLIST( list ),i,0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
117 void gtkEventHandling( void )
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
118 {
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
119 int i;
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6898
diff changeset
120 for( i=0;i < 25;i++ ) gtk_main_iteration_do( 0 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
121 }
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
122
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
123 // --- funcs
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
124
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
125 void gtkMessageBox( int type,gchar * str )
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
126 {
5919
60cf2bca993f some bug fix
pontscho
parents: 5520
diff changeset
127 if ( !gtkInited ) return;
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
128 ShowMessageBox( str );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
129 gtk_label_set_text( GTK_LABEL( gtkMessageBoxText ),str );
7198
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
130 /* enable linewrapping by alex */
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
131 // GTK_LABEL(gtkMessageBoxText)->max_width = 80;
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
132 if (strlen(str) > 80)
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
133 gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), TRUE);
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
134 else
9d21564cfc37 enable linewrapping
alex
parents: 6996
diff changeset
135 gtk_label_set_line_wrap(GTK_LABEL(gtkMessageBoxText), FALSE);
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
136 switch( type)
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
137 {
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
138 case GTK_MB_FATAL:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
139 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_FatalError );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
140 gtk_widget_hide( WarningPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
141 gtk_widget_show( ErrorPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
142 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
143 case GTK_MB_ERROR:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
144 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Error );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
145 gtk_widget_hide( WarningPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
146 gtk_widget_show( ErrorPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
147 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
148 case GTK_MB_WARNING:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
149 gtk_window_set_title( GTK_WINDOW( MessageBox ),MSGTR_MSGBOX_LABEL_Warning );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
150 gtk_widget_show( WarningPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
151 gtk_widget_hide( ErrorPixmap );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
152 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
153 }
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
154 gtk_widget_show( MessageBox );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
155 gtkSetLayer( MessageBox );
6898
138a7ff52a26 - fix fuckin' locale (?:)
pontscho
parents: 6854
diff changeset
156 gtkActive( MessageBox );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
157 if ( type == GTK_MB_FATAL )
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
158 while ( gtkVMessageBox ) gtk_main_iteration_do( 0 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
159 }
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
160
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
161 void gtkSetLayer( GtkWidget * wdg )
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
162 {
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
163 GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
164 wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen );
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
165 }
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
166
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
167 void gtkActive( GtkWidget * wdg )
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
168 {
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
169 GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
170 wsMoveTopWindow( gdk_display,win->xwindow );
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
171 }
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
172
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
173 void gtkShow( int type,char * param )
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
174 {
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
175 switch( type )
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
176 {
6627
fd3ac41ee1a1 add equalizer support and fix some small bug...
pontscho
parents: 6623
diff changeset
177 case evEqualizer:
fd3ac41ee1a1 add equalizer support and fix some small bug...
pontscho
parents: 6623
diff changeset
178 ShowEqualizer();
fd3ac41ee1a1 add equalizer support and fix some small bug...
pontscho
parents: 6623
diff changeset
179 gtkSetLayer( Equalizer );
fd3ac41ee1a1 add equalizer support and fix some small bug...
pontscho
parents: 6623
diff changeset
180 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
181 case evSkinBrowser:
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
182 ShowSkinBrowser();
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 5997
diff changeset
183 // gtkClearList( SkinList );
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 5997
diff changeset
184 if ( gtkFillSkinList( sbMPlayerPrefixDir ) && gtkFillSkinList( sbMPlayerDirInHome ) )
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
185 {
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
186 gtkSetDefaultToCList( SkinList,param );
6651
8f49c75a2824 - add icon (nice, but very ugly hakk:)
pontscho
parents: 6627
diff changeset
187 gtk_clist_sort( GTK_CLIST( SkinList ) );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
188 gtk_widget_show( SkinBrowser );
6044
153fc4ed86ad fix gtk dialog box destroy bug
pontscho
parents: 5997
diff changeset
189 gtkSetLayer( SkinBrowser );
6222
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6219
diff changeset
190 }
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6219
diff changeset
191 else
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6219
diff changeset
192 {
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6898
diff changeset
193 gtk_widget_destroy( SkinBrowser );
6222
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6219
diff changeset
194 gtkMessageBox( GTK_MB_ERROR,"Skin dirs not found ... Please install skins." );
1a83bd7ff76e small changes in skin selection
pontscho
parents: 6219
diff changeset
195 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
196 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
197 case evPreferences:
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6755
diff changeset
198 ShowPreferences();
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
199 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
200 case evPlayList:
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
201 ShowPlayList();
cc917a581b6e add simple playlist support
pontscho
parents: 6651
diff changeset
202 gtkSetLayer( PlayList );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
203 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
204 case evLoad:
6622
da08877b9512 fix window hiding bug with some wms (kde, gnome, icewm, mwm, wmaker)
pontscho
parents: 6298
diff changeset
205 ShowFileSelect( fsVideoSelector,0 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
206 gtkSetLayer( fsFileSelect );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
207 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
208 case evFirstLoad:
6622
da08877b9512 fix window hiding bug with some wms (kde, gnome, icewm, mwm, wmaker)
pontscho
parents: 6298
diff changeset
209 ShowFileSelect( fsVideoSelector,0 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
210 gtkSetLayer( fsFileSelect );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
211 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
212 case evLoadSubtitle:
6622
da08877b9512 fix window hiding bug with some wms (kde, gnome, icewm, mwm, wmaker)
pontscho
parents: 6298
diff changeset
213 ShowFileSelect( fsSubtitleSelector,0 );
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
214 gtkSetLayer( fsFileSelect );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
215 break;
6623
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6622
diff changeset
216 case evLoadAudioFile:
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6622
diff changeset
217 ShowFileSelect( fsAudioSelector,0 );
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6622
diff changeset
218 gtkSetLayer( fsFileSelect );
7bc4c6ba9485 add -audiofile support for gui
pontscho
parents: 6622
diff changeset
219 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
220 case evAbout:
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6044
diff changeset
221 ShowAboutBox();
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5919
diff changeset
222 gtkSetLayer( AboutBox );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
223 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
224 case evShowPopUpMenu:
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
225 gtkPopupMenu=evNone;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
226 gtkPopupMenuParam=0;
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6898
diff changeset
227 if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
228 PopUpMenu=create_PopUpMenu();
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
229 gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
230 break;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
231 case evHidePopUpMenu:
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6898
diff changeset
232 if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); PopUpMenu=NULL; }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
233 break;
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6222
diff changeset
234 case evPlayNetwork:
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6222
diff changeset
235 ShowURLDialogBox();
6755
a31b9f15cbff - fix audio equalizer
pontscho
parents: 6713
diff changeset
236 gtkSetLayer( URL );
6298
d42cb911d7f7 add network streaming support for gui
pontscho
parents: 6222
diff changeset
237 break;
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
238 }
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4176
diff changeset
239 }