~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to gui/ui/main.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "config.h"
28
28
#include "gmplayer.h"
29
29
#include "gui/app.h"
 
30
#include "gui/interface.h"
30
31
#include "gui/skin/font.h"
31
32
#include "gui/skin/skin.h"
 
33
#include "gui/util/list.h"
 
34
#include "gui/util/mem.h"
 
35
#include "gui/util/string.h"
32
36
#include "gui/wm/ws.h"
33
37
 
34
38
#include "help_mp.h"
 
39
#include "mp_msg.h"
35
40
#include "libvo/x11_common.h"
36
41
#include "libvo/fastmemcpy.h"
37
42
#include "libvo/wskeys.h"
51
56
#include "mp_core.h"
52
57
#include "mpcommon.h"
53
58
 
 
59
#define CLEAR_FILE 1
 
60
#define CLEAR_VCD  2
 
61
#define CLEAR_DVD  4
 
62
#define CLEAR_ALL  (CLEAR_FILE + CLEAR_VCD + CLEAR_DVD)
 
63
 
54
64
#define GUI_REDRAW_WAIT 375
55
65
 
56
66
#include "actions.h"
75
85
void uiMainDraw( void )
76
86
{
77
87
 
78
 
 if ( guiApp.mainWindow.State == wsWindowClosed ) guiExit( EXIT_QUIT );
 
88
 if ( guiApp.mainWindow.State == wsWindowClosed ) mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
79
89
 
80
90
 if ( guiApp.mainWindow.Visible == wsWindowNotVisible ||
81
91
      !mainVisible ) return;
94
104
// XFlush( wsDisplay );
95
105
}
96
106
 
 
107
static void guiInfoMediumClear (int what)
 
108
{
 
109
  if (what & CLEAR_FILE)
 
110
  {
 
111
    nfree(guiInfo.Filename);
 
112
    nfree(guiInfo.SubtitleFilename);
 
113
    nfree(guiInfo.AudioFilename);
 
114
    listSet(gtkDelPl, NULL);
 
115
  }
 
116
 
 
117
#ifdef CONFIG_VCD
 
118
  if (what & CLEAR_VCD) guiInfo.Tracks = 0;
 
119
#endif
 
120
 
 
121
#ifdef CONFIG_DVDREAD
 
122
  if (what & CLEAR_DVD)
 
123
  {
 
124
    guiInfo.AudioStreams = 0;
 
125
    guiInfo.Subtitles = 0;
 
126
    guiInfo.Tracks = 0;
 
127
    guiInfo.Chapters = 0;
 
128
    guiInfo.Angles = 0;
 
129
  }
 
130
#endif
 
131
}
 
132
 
97
133
static unsigned last_redraw_time = 0;
98
134
 
99
135
void uiEventHandling( int msg,float param )
105
141
  {
106
142
// --- user events
107
143
   case evExit:
108
 
        guiExit( EXIT_QUIT );
 
144
        mplayer( MPLAYER_EXIT_GUI, EXIT_QUIT, 0 );
109
145
        break;
110
146
 
111
 
   case evPlayNetwork:
112
 
        gfree( (void **)&guiInfo.Subtitlename );
113
 
        gfree( (void **)&guiInfo.AudioFile );
114
 
        guiInfo.StreamType=STREAMTYPE_STREAM;
115
 
        goto play;
116
 
   case evSetURL:
117
 
        gtkShow( evPlayNetwork,NULL );
 
147
   case evLoadURL:
 
148
        gtkShow( evLoadURL,NULL );
118
149
        break;
119
150
 
120
 
   case evSetAudio:
121
 
        if ( !guiInfo.demuxer || audio_id == iparam ) break;
 
151
   case ivSetAudio:
 
152
        if ( !mpctx_get_demuxer(guiInfo.mpcontext) || audio_id == iparam ) break;
122
153
        audio_id=iparam;
123
154
        goto play;
124
155
 
125
 
   case evSetVideo:
126
 
        if ( !guiInfo.demuxer || video_id == iparam ) break;
 
156
   case ivSetVideo:
 
157
        if ( !mpctx_get_demuxer(guiInfo.mpcontext) || video_id == iparam ) break;
127
158
        video_id=iparam;
128
159
        goto play;
129
160
 
130
 
   case evSetSubtitle:
 
161
   case ivSetSubtitle:
131
162
        mp_property_do("sub",M_PROPERTY_SET,&iparam,guiInfo.mpcontext);
132
163
        break;
133
164
 
 
165
#ifdef CONFIG_CDDA
 
166
   case ivSetCDTrack:
 
167
        guiInfo.Track=iparam;
 
168
   case evPlayCD:
 
169
        guiInfoMediumClear ( CLEAR_ALL );
 
170
        guiInfo.StreamType=STREAMTYPE_CDDA;
 
171
        goto play;
 
172
#endif
134
173
#ifdef CONFIG_VCD
135
 
   case evSetVCDTrack:
 
174
   case ivSetVCDTrack:
136
175
        guiInfo.Track=iparam;
137
176
   case evPlayVCD:
138
 
        gtkSet( gtkClearStruct,0,(void *)guiALL );
 
177
        guiInfoMediumClear ( CLEAR_ALL );
139
178
        guiInfo.StreamType=STREAMTYPE_VCD;
140
179
        goto play;
141
180
#endif
142
181
#ifdef CONFIG_DVDREAD
 
182
   case ivSetDVDSubtitle:
 
183
        dvdsub_id=iparam;
 
184
        goto play_dvd_2;
 
185
        break;
 
186
   case ivSetDVDAudio:
 
187
        audio_id=iparam;
 
188
        goto play_dvd_2;
 
189
        break;
 
190
   case ivSetDVDChapter:
 
191
        guiInfo.Chapter=iparam;
 
192
        goto play_dvd_2;
 
193
        break;
 
194
   case ivSetDVDTitle:
 
195
        guiInfo.Track=iparam;
 
196
        guiInfo.Chapter=1;
 
197
        guiInfo.Angle=1;
 
198
        goto play_dvd_2;
 
199
        break;
143
200
   case evPlayDVD:
144
 
        guiInfo.DVD.current_title=1;
145
 
        guiInfo.DVD.current_chapter=1;
146
 
        guiInfo.DVD.current_angle=1;
 
201
        guiInfo.Track=1;
 
202
        guiInfo.Chapter=1;
 
203
        guiInfo.Angle=1;
147
204
play_dvd_2:
148
 
        gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
 
205
        guiInfoMediumClear( CLEAR_ALL - CLEAR_DVD );
149
206
        guiInfo.StreamType=STREAMTYPE_DVD;
150
207
        goto play;
151
208
#endif
155
212
 
156
213
        if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause;
157
214
 
158
 
        if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) )
 
215
        if ( listSet( gtkGetCurrPlItem,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) )
159
216
         {
160
 
          plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
 
217
          plItem * next = listSet( gtkGetCurrPlItem,NULL );
161
218
          plLastPlayed=next;
162
 
          uiSetFileName( next->path,next->name,STREAMTYPE_FILE );
 
219
          uiSetFileName( next->path,next->name,SAME_STREAMTYPE );
163
220
         }
164
221
 
165
222
        switch ( guiInfo.StreamType )
166
223
         {
 
224
          case STREAMTYPE_FILE:
167
225
          case STREAMTYPE_STREAM:
168
 
          case STREAMTYPE_FILE:
169
 
               gtkSet( gtkClearStruct,0,(void *)(guiALL - guiFilenames) );
170
 
               break;
 
226
               guiInfoMediumClear( CLEAR_ALL - CLEAR_FILE );
 
227
               if ( !guiInfo.Track )
 
228
                 guiInfo.Track=1;
 
229
               guiInfo.NewPlay=GUI_FILE_NEW;
 
230
               break;
 
231
#ifdef CONFIG_CDDA
 
232
          case STREAMTYPE_CDDA:
 
233
               guiInfoMediumClear( CLEAR_ALL - CLEAR_VCD - CLEAR_FILE );
 
234
               if ( guiInfo.Playing != GUI_PAUSE )
 
235
                {
 
236
                 if ( !guiInfo.Track )
 
237
                   guiInfo.Track=1;
 
238
                 guiInfo.NewPlay=GUI_FILE_SAME;
 
239
                }
 
240
               break;
 
241
#endif
171
242
#ifdef CONFIG_VCD
172
243
          case STREAMTYPE_VCD:
173
 
               gtkSet( gtkClearStruct,0,(void *)(guiALL - guiVCD - guiFilenames) );
174
 
               if ( !cdrom_device ) cdrom_device=gstrdup( DEFAULT_CDROM_DEVICE );
175
 
               uiSetFileName( NULL,cdrom_device,STREAMTYPE_VCD );
 
244
               guiInfoMediumClear( CLEAR_ALL - CLEAR_VCD - CLEAR_FILE );
176
245
               if ( guiInfo.Playing != GUI_PAUSE )
177
246
                {
178
247
                 if ( !guiInfo.Track )
179
 
                   guiInfo.Track=1;
180
 
                 guiInfo.DiskChanged=1;
 
248
                   guiInfo.Track=2;
 
249
                 guiInfo.NewPlay=GUI_FILE_SAME;
181
250
                }
182
251
               break;
183
252
#endif
184
253
#ifdef CONFIG_DVDREAD
185
254
          case STREAMTYPE_DVD:
186
 
               gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD - guiFilenames) );
187
 
               if ( !dvd_device ) dvd_device=gstrdup( DEFAULT_DVD_DEVICE );
188
 
               uiSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
 
255
               guiInfoMediumClear( CLEAR_ALL - CLEAR_DVD - CLEAR_FILE );
189
256
               if ( guiInfo.Playing != GUI_PAUSE )
190
257
                {
191
 
                 guiInfo.Title=guiInfo.DVD.current_title;
192
 
                 guiInfo.Chapter=guiInfo.DVD.current_chapter;
193
 
                 guiInfo.Angle=guiInfo.DVD.current_angle;
194
 
                 guiInfo.DiskChanged=1;
 
258
                 guiInfo.NewPlay=GUI_FILE_SAME;
195
259
                }
196
260
               break;
197
261
#endif
198
262
         }
199
 
        guiInfo.NewPlay=1;
200
263
        uiPlay();
201
264
        break;
202
 
#ifdef CONFIG_DVDREAD
203
 
   case evSetDVDSubtitle:
204
 
        dvdsub_id=iparam;
205
 
        goto play_dvd_2;
206
 
        break;
207
 
   case evSetDVDAudio:
208
 
        audio_id=iparam;
209
 
        goto play_dvd_2;
210
 
        break;
211
 
   case evSetDVDChapter:
212
 
        guiInfo.DVD.current_chapter=iparam;
213
 
        goto play_dvd_2;
214
 
        break;
215
 
   case evSetDVDTitle:
216
 
        guiInfo.DVD.current_title=iparam;
217
 
        guiInfo.DVD.current_chapter=1;
218
 
        guiInfo.DVD.current_angle=1;
219
 
        goto play_dvd_2;
220
 
        break;
221
 
#endif
222
265
 
223
266
   case evPause:
224
267
   case evPauseSwitchToPlay:
229
272
   case evStop:
230
273
        guiInfo.Playing=GUI_STOP;
231
274
        uiState();
232
 
        guiInfo.NoWindow=False;
233
275
        break;
234
276
 
235
277
   case evLoadPlay:
236
278
        uiMainAutoPlay=1;
237
279
//      guiInfo.StreamType=STREAMTYPE_FILE;
238
280
   case evLoad:
239
 
        gtkSet( gtkDelPl,0,NULL );
 
281
        listSet( gtkDelPl,NULL );
240
282
        gtkShow( evLoad,NULL );
241
283
        break;
242
284
   case evLoadSubtitle:  gtkShow( evLoadSubtitle,NULL );  break;
243
285
   case evDropSubtitle:
244
 
        gfree( (void **)&guiInfo.Subtitlename );
245
 
        guiLoadSubtitle( NULL );
 
286
        nfree( guiInfo.SubtitleFilename );
 
287
        mplayerLoadSubtitle( NULL );
246
288
        break;
247
289
   case evLoadAudioFile: gtkShow( evLoadAudioFile,NULL ); break;
248
290
   case evPrev: uiPrev(); break;
249
291
   case evNext: uiNext(); break;
250
292
 
251
 
   case evPlayList:    gtkShow( evPlayList,NULL );        break;
 
293
   case evPlaylist:    gtkShow( evPlaylist,NULL );        break;
252
294
   case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
253
295
   case evAbout:       gtkShow( evAbout,NULL );           break;
254
296
   case evPreferences: gtkShow( evPreferences,NULL );     break;
298
340
         }
299
341
        break;
300
342
   case evHalfSize:
301
 
        btnSet( evFullScreen,btnReleased );
302
 
        if ( guiInfo.Playing )
 
343
        if ( guiInfo.VideoWindow && guiInfo.Playing )
303
344
         {
304
345
          if ( guiApp.subWindow.isFullScreen )
305
346
           {
306
347
            uiFullScreen();
307
348
           }
308
 
          wsResizeWindow( &guiApp.subWindow, guiInfo.MovieWidth / 2, guiInfo.MovieHeight / 2 );
309
 
          wsMoveWindow( &guiApp.subWindow, 0,
310
 
                        ( wsMaxX - guiInfo.MovieWidth/2  )/2 + wsOrgX,
311
 
                        ( wsMaxY - guiInfo.MovieHeight/2 )/2 + wsOrgY  );
 
349
          wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth / 2, guiInfo.VideoHeight / 2 );
 
350
          wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
 
351
          btnSet( evFullScreen,btnReleased );
312
352
         }
313
353
        break;
314
354
   case evDoubleSize:
315
 
        btnSet( evFullScreen,btnReleased );
316
 
        if ( guiInfo.Playing )
 
355
        if ( guiInfo.VideoWindow && guiInfo.Playing )
317
356
         {
318
357
          if ( guiApp.subWindow.isFullScreen )
319
358
           {
320
359
            uiFullScreen();
321
360
           }
322
 
          wsResizeWindow( &guiApp.subWindow, guiInfo.MovieWidth * 2, guiInfo.MovieHeight * 2 );
323
 
          wsMoveWindow( &guiApp.subWindow, 0,
324
 
                        ( wsMaxX - guiInfo.MovieWidth*2  )/2 + wsOrgX,
325
 
                        ( wsMaxY - guiInfo.MovieHeight*2 )/2 + wsOrgY  );
 
361
          wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth * 2, guiInfo.VideoHeight * 2 );
 
362
          wsMoveWindowWithin( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
 
363
          btnSet( evFullScreen,btnReleased );
326
364
         }
327
365
        break;
328
366
   case evNormalSize:
329
 
        btnSet( evFullScreen,btnReleased );
330
 
        if ( guiInfo.Playing )
 
367
        if ( guiInfo.VideoWindow && guiInfo.Playing )
331
368
         {
332
369
          if ( guiApp.subWindow.isFullScreen )
333
370
           {
334
371
            uiFullScreen();
335
372
           }
336
 
          wsResizeWindow( &guiApp.subWindow, guiInfo.MovieWidth, guiInfo.MovieHeight );
337
 
          wsMoveWindow( &guiApp.subWindow, 0,
338
 
                        ( wsMaxX - guiInfo.MovieWidth  )/2 + wsOrgX,
339
 
                        ( wsMaxY - guiInfo.MovieHeight )/2 + wsOrgY  );
 
373
          wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
 
374
          wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
 
375
          btnSet( evFullScreen,btnReleased );
340
376
          break;
341
377
         } else if ( !guiApp.subWindow.isFullScreen ) break;
342
378
   case evFullScreen:
343
 
        if ( !guiInfo.Playing && !gtkShowVideoWindow ) break;
344
 
        uiFullScreen();
 
379
        if ( guiInfo.VideoWindow && guiInfo.Playing )
 
380
         {
 
381
          uiFullScreen();
 
382
          if ( !guiApp.subWindow.isFullScreen )
 
383
           {
 
384
            wsResizeWindow( &guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight );
 
385
            wsMoveWindow( &guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y );
 
386
           }
 
387
         }
345
388
        if ( guiApp.subWindow.isFullScreen ) btnSet( evFullScreen,btnPressed );
346
389
         else btnSet( evFullScreen,btnReleased );
347
390
        break;
357
400
         }
358
401
        wsClearWindow( guiApp.subWindow );
359
402
#ifdef CONFIG_DVDREAD
360
 
        if ( guiInfo.StreamType == STREAMTYPE_DVD || guiInfo.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
 
403
        if ( guiInfo.StreamType == STREAMTYPE_VCD || guiInfo.StreamType == STREAMTYPE_DVD ) goto play_dvd_2;
361
404
         else
362
405
#endif
363
 
         guiInfo.NewPlay=1;
 
406
         guiInfo.NewPlay=GUI_FILE_NEW;
364
407
        break;
365
408
 
366
409
// --- timer events
367
 
   case evRedraw:
 
410
   case ivRedraw:
368
411
        {
369
412
          unsigned now = GetTimerMS();
370
413
          if ((now > last_redraw_time) &&
371
414
              (now < last_redraw_time + GUI_REDRAW_WAIT) &&
372
 
              !uiPlaybarFade)
 
415
              !uiPlaybarFade && (iparam == 0))
373
416
            break;
374
417
          last_redraw_time = now;
375
418
        }
378
421
        wsPostRedisplay( &guiApp.playbarWindow );
379
422
        break;
380
423
// --- system events
381
 
#ifdef MP_DEBUG
382
424
   case evNone:
383
 
        mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] event none received.\n" );
 
425
        mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] uiEventHandling: evNone\n" );
384
426
        break;
385
427
   default:
386
 
        mp_msg( MSGT_GPLAYER,MSGL_STATUS,"[mw] unknown event received ( %d,%.2f ).\n",msg,param );
 
428
        mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] uiEventHandling: unknown event %d, param %.2f\n", msg, param );
387
429
        break;
388
 
#endif
389
430
  }
390
431
}
391
432
 
407
448
 switch ( Button )
408
449
  {
409
450
   case wsPMMouseButton:
410
 
          gtkShow( evHidePopUpMenu,NULL );
 
451
          gtkShow( ivHidePopUpMenu,NULL );
411
452
          uiShowMenu( RX,RY );
412
453
          itemtype=itPRMButton;
413
454
          break;
416
457
          break;
417
458
 
418
459
   case wsPLMouseButton:
419
 
          gtkShow( evHidePopUpMenu,NULL );
 
460
          gtkShow( ivHidePopUpMenu,NULL );
420
461
          sx=X; sy=Y; boxMoved=1; itemtype=itPLMButton;
421
462
          SelectedItem=currentselected;
422
463
          if ( SelectedItem == -1 ) break;
463
504
          break;
464
505
 
465
506
   case wsRRMouseButton:
466
 
        gtkShow( evShowPopUpMenu,NULL );
 
507
        gtkShow( ivShowPopUpMenu,NULL );
467
508
        break;
468
509
 
469
510
// --- rolled mouse ... de szar :)))
485
526
          switch ( itemtype )
486
527
           {
487
528
            case itPLMButton:
488
 
                 wsMoveWindow( &guiApp.mainWindow,False,RX - abs( sx ),RY - abs( sy ) );
 
529
                 wsMoveWindow( &guiApp.mainWindow,True,RX - abs( sx ),RY - abs( sy ) );
489
530
                 uiMainRender=0;
490
531
                 break;
491
532
            case itPRMButton:
546
587
      case wsXF86Next:         msg=evNext; break;
547
588
      case wsXF86Media:        msg=evLoad; break;
548
589
      case wsEscape:
549
 
            if ( guiApp.subWindow.isFullScreen )
 
590
            if ( guiInfo.VideoWindow && guiInfo.Playing && guiApp.subWindow.isFullScreen )
550
591
             {
551
 
              if ( guiInfo.event_struct ) ((XEvent *)guiInfo.event_struct)->type=None;
552
592
              uiEventHandling( evNormalSize,0 );
553
593
              return;
554
594
             }
592
632
          if((len=strlen(++ext)) && (type=strstr(supported,ext)) &&\
593
633
             (type-supported)%4 == 0 && *(type+len) == '/'){
594
634
            /* handle subtitle file */
595
 
            gfree((void**)&subtitles);
 
635
            nfree(subtitles);
596
636
            subtitles = str;
597
637
            continue;
598
638
          }
602
642
      /* clear playlist */
603
643
      if (filename == NULL) {
604
644
        filename = files[f];
605
 
        gtkSet(gtkDelPl,0,NULL);
 
645
        listSet(gtkDelPl,NULL);
606
646
      }
607
647
 
608
648
      item = calloc(1,sizeof(plItem));
617
657
        item->name = strdup(str);
618
658
        item->path = strdup("");
619
659
      }
620
 
      gtkSet(gtkAddPlItem,0,(void*)item);
 
660
      listSet(gtkAddPlItem,item);
621
661
    } else {
622
662
      mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str );
623
663
    }
630
670
    uiEventHandling( evPlay,0 );
631
671
  }
632
672
  if (subtitles) {
633
 
    gfree((void**)&guiInfo.Subtitlename);
634
 
    guiInfo.Subtitlename = subtitles;
635
 
    guiLoadSubtitle(guiInfo.Subtitlename);
 
673
    nfree(guiInfo.SubtitleFilename);
 
674
    guiInfo.SubtitleFilename = subtitles;
 
675
    mplayerLoadSubtitle(guiInfo.SubtitleFilename);
636
676
  }
637
677
}