* controls.m: MacOS X interface plugin
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
- [o_window halfWindow];
+ [o_window scaleWindowWithFactor: 0.5];
}
}
}
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
- [o_window normalWindow];
+ [o_window scaleWindowWithFactor: 1];
}
}
}
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
- [o_window doubleWindow];
+ [o_window scaleWindowWithFactor: 2];
}
}
}
* vout.h: MacOS X interface plugin
*****************************************************************************
* 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>
* Florian G. Pflug <fgp@phlo.org>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define WINDOW_TITLE_HEIGHT 21
+#define WINDOW_TITLE_HEIGHT 24
/*****************************************************************************
* VLCWindow interface
- (void)setVout:(vout_thread_t *)_p_vout;
- (vout_thread_t *)getVout;
-- (void)halfWindow;
-- (void)normalWindow;
-- (void)doubleWindow;
+- (void)scaleWindowWithFactor: (float)factor;
- (void)toggleFullscreen;
- (BOOL)isFullscreen;
* vout.m: MacOS X video output plugin
*****************************************************************************
* 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>
* Florian G. Pflug <fgp@phlo.org>
return( p_vout );
}
-- (void)halfWindow
+- (void)scaleWindowWithFactor: (float)factor
{
NSSize newsize;
+ NSPoint topleftbase;
+ NSPoint topleftscreen;
- newsize.width = (int) p_vout->render.i_width / 2 ;
- newsize.height = ((int) p_vout->render.i_height / 2 ) + WINDOW_TITLE_HEIGHT ;
- [self setContentSize: newsize];
- //[[self contentView] setFrameSize: newsize];
- p_vout->i_changes |= VOUT_SIZE_CHANGE;
-}
-
-- (void)normalWindow
-{
- NSSize newsize;
-
- newsize.width = p_vout->render.i_width ;
- newsize.height = p_vout->render.i_height + WINDOW_TITLE_HEIGHT ;
- [self setContentSize: newsize];
- //[[self contentView] setFrameSize: newsize];
- p_vout->i_changes |= VOUT_SIZE_CHANGE;
-}
-
-- (void)doubleWindow
-{
- 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;
+ if ( !p_vout->b_fullscreen )
+ {
+ topleftbase.x = 0;
+ topleftbase.y = [self frame].size.height;
+ topleftscreen = [self convertBaseToScreen: topleftbase];
+
+ newsize.width = (int) ( p_vout->render.i_width * factor );
+ newsize.height = (int) ( ( p_vout->render.i_height + WINDOW_TITLE_HEIGHT ) * factor );
+ [self setContentSize: newsize];
+
+ [self setFrameTopLeftPoint: topleftscreen];
+ p_vout->i_changes |= VOUT_SIZE_CHANGE;
+ }
}
- (void)toggleFullscreen