Commit 84bfb7f2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Resize window fixes

  - we should not resize the window in fullscreen
  - fixed the black bars bug in half and double size
  - position of top left corner should not change
  - more efficient code
parent c25947e7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin * controls.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: controls.m,v 1.20 2003/02/07 20:23:17 hartman Exp $ * $Id: controls.m,v 1.21 2003/02/07 21:30:25 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
{ {
if( [[o_window className] isEqualToString: @"VLCWindow"] ) if( [[o_window className] isEqualToString: @"VLCWindow"] )
{ {
[o_window halfWindow]; [o_window scaleWindowWithFactor: 0.5];
} }
} }
} }
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
{ {
if( [[o_window className] isEqualToString: @"VLCWindow"] ) if( [[o_window className] isEqualToString: @"VLCWindow"] )
{ {
[o_window normalWindow]; [o_window scaleWindowWithFactor: 1];
} }
} }
} }
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
{ {
if( [[o_window className] isEqualToString: @"VLCWindow"] ) if( [[o_window className] isEqualToString: @"VLCWindow"] )
{ {
[o_window doubleWindow]; [o_window scaleWindowWithFactor: 2];
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin * vout.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.h,v 1.6 2003/02/07 20:23:17 hartman Exp $ * $Id: vout.h,v 1.7 2003/02/07 21:30:25 hartman Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define WINDOW_TITLE_HEIGHT 21 #define WINDOW_TITLE_HEIGHT 24
/***************************************************************************** /*****************************************************************************
* VLCWindow interface * VLCWindow interface
...@@ -36,9 +36,7 @@ ...@@ -36,9 +36,7 @@
- (void)setVout:(vout_thread_t *)_p_vout; - (void)setVout:(vout_thread_t *)_p_vout;
- (vout_thread_t *)getVout; - (vout_thread_t *)getVout;
- (void)halfWindow; - (void)scaleWindowWithFactor: (float)factor;
- (void)normalWindow;
- (void)doubleWindow;
- (void)toggleFullscreen; - (void)toggleFullscreen;
- (BOOL)isFullscreen; - (BOOL)isFullscreen;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin * vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.24 2003/02/07 20:23:17 hartman Exp $ * $Id: vout.m,v 1.25 2003/02/07 21:30:25 hartman Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -725,37 +725,25 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -725,37 +725,25 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
return( p_vout ); return( p_vout );
} }
- (void)halfWindow - (void)scaleWindowWithFactor: (float)factor
{ {
NSSize newsize; NSSize newsize;
NSPoint topleftbase;
NSPoint topleftscreen;
newsize.width = (int) p_vout->render.i_width / 2 ; if ( !p_vout->b_fullscreen )
newsize.height = ((int) p_vout->render.i_height / 2 ) + WINDOW_TITLE_HEIGHT ; {
[self setContentSize: newsize]; topleftbase.x = 0;
//[[self contentView] setFrameSize: newsize]; topleftbase.y = [self frame].size.height;
p_vout->i_changes |= VOUT_SIZE_CHANGE; topleftscreen = [self convertBaseToScreen: topleftbase];
}
- (void)normalWindow
{
NSSize newsize;
newsize.width = p_vout->render.i_width ; newsize.width = (int) ( p_vout->render.i_width * factor );
newsize.height = p_vout->render.i_height + WINDOW_TITLE_HEIGHT ; newsize.height = (int) ( ( p_vout->render.i_height + WINDOW_TITLE_HEIGHT ) * factor );
[self setContentSize: newsize]; [self setContentSize: newsize];
//[[self contentView] setFrameSize: newsize];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
- (void)doubleWindow [self setFrameTopLeftPoint: topleftscreen];
{
NSSize newsize;
newsize.width = p_vout->render.i_width * 2 ;
newsize.height = (p_vout->render.i_height * 2 ) + WINDOW_TITLE_HEIGHT;
[self setContentSize: newsize];
//[[self contentView] setFrameSize: newsize];
p_vout->i_changes |= VOUT_SIZE_CHANGE; p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
} }
- (void)toggleFullscreen - (void)toggleFullscreen
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment