* added half, normal and full size videowindow menuitems.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 7 Feb 2003 20:23:17 +0000 (20:23 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 7 Feb 2003 20:23:17 +0000 (20:23 +0000)
  there seems to be a bug though somewhere. you end up with black bars in
  half and double size.

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m

index 3963a31..c82772e 100644 (file)
@@ -5,11 +5,14 @@
         {
             ACTIONS = {
                 deinterlace = id; 
+                doubleWindow = id; 
                 faster = id; 
                 fullscreen = id; 
+                halfWindow = id; 
                 loop = id; 
                 mute = id; 
                 next = id; 
+                normalWindow = id; 
                 pause = id; 
                 play = id; 
                 prev = id; 
                 "o_mi_cut" = id; 
                 "o_mi_deinterlace" = id; 
                 "o_mi_device" = id; 
+                "o_mi_double_window" = id; 
                 "o_mi_faster" = id; 
                 "o_mi_fullscreen" = id; 
+                "o_mi_half_window" = id; 
                 "o_mi_hide" = id; 
                 "o_mi_hide_others" = id; 
                 "o_mi_language" = id; 
@@ -88,6 +93,7 @@
                 "o_mi_minimize" = id; 
                 "o_mi_mute" = id; 
                 "o_mi_next" = id; 
+                "o_mi_normal_window" = id; 
                 "o_mi_open_disc" = id; 
                 "o_mi_open_file" = id; 
                 "o_mi_open_generic" = id; 
index 41170b7..ffd7615 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>913 -102 365 441 0 0 1280 1002 </string>
+       <string>590 112 365 441 0 0 1280 1002 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
@@ -23,8 +23,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>21</integer>
                <integer>29</integer>
+               <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6G30</string>
index f0d435a..bb006f3 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index a1e0ec5..a8628c0 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.19 2003/01/31 02:53:52 jlj Exp $
+ * $Id: controls.m,v 1.20 2003/02/07 20:23:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -59,6 +59,9 @@
 - (IBAction)volumeSliderUpdated:(id)sender;
 - (void)updateVolumeSlider;
 
+- (IBAction)halfWindow:(id)sender;
+- (IBAction)normalWindow:(id)sender;
+- (IBAction)doubleWindow:(id)sender;
 - (IBAction)fullscreen:(id)sender;
 - (IBAction)deinterlace:(id)sender;
 
     }
 }
 
+- (IBAction)halfWindow:(id)sender
+{
+    id o_window = [NSApp keyWindow];
+    NSArray *o_windows = [NSApp windows];
+    NSEnumerator *o_enumerator = [o_windows objectEnumerator];
+    
+    while ((o_window = [o_enumerator nextObject]))
+    {
+        if( [[o_window className] isEqualToString: @"VLCWindow"] )
+        {
+            [o_window halfWindow];
+        }
+    }
+}
+
+- (IBAction)normalWindow:(id)sender
+{
+    id o_window = [NSApp keyWindow];
+    NSArray *o_windows = [NSApp windows];
+    NSEnumerator *o_enumerator = [o_windows objectEnumerator];
+    
+    while ((o_window = [o_enumerator nextObject]))
+    {
+        if( [[o_window className] isEqualToString: @"VLCWindow"] )
+        {
+            [o_window normalWindow];
+        }
+    }
+}
+
+- (IBAction)doubleWindow:(id)sender
+{
+    id o_window = [NSApp keyWindow];
+    NSArray *o_windows = [NSApp windows];
+    NSEnumerator *o_enumerator = [o_windows objectEnumerator];
+    
+    while ((o_window = [o_enumerator nextObject]))
+    {
+        if( [[o_window className] isEqualToString: @"VLCWindow"] )
+        {
+            [o_window doubleWindow];
+        }
+    }
+}
+
+
 - (IBAction)fullscreen:(id)sender
 {
     id o_window = [NSApp keyWindow];
 
         [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
     }
-    else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )    
+    else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
+                [[o_mi title] isEqualToString: _NS("Half Size")] ||
+                [[o_mi title] isEqualToString: _NS("Normal Size")] ||
+                [[o_mi title] isEqualToString: _NS("Double Size")])    
     {
         id o_window;
         NSArray *o_windows = [NSApp windows];
index fd67f5f..9f523d1 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.22 2003/02/05 16:23:06 hartman Exp $
+ * $Id: intf.h,v 1.23 2003/02/07 20:23:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -172,6 +172,9 @@ struct intf_sys_t
     IBOutlet id o_mi_device;
 
     IBOutlet id o_mu_video;
+    IBOutlet id o_mi_half_window;
+    IBOutlet id o_mi_normal_window;
+    IBOutlet id o_mi_double_window;
     IBOutlet id o_mi_fullscreen;
     IBOutlet id o_mi_screen;
     IBOutlet id o_mi_deinterlace;
index 2b36805..c3645bc 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.47 2003/02/06 23:55:28 massiot Exp $
+ * $Id: intf.m,v 1.48 2003/02/07 20:23:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -309,6 +309,9 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
     [o_mi_device setTitle: _NS("Device")];
     
     [o_mu_video setTitle: _NS("Video")];
+    [o_mi_half_window setTitle: _NS("Half Size")];
+    [o_mi_normal_window setTitle: _NS("Normal Size")];
+    [o_mi_double_window setTitle: _NS("Double Size")];
     [o_mi_fullscreen setTitle: _NS("Fullscreen")];
     [o_mi_screen setTitle: _NS("Screen")];
     [o_mi_deinterlace setTitle: _NS("Deinterlace")];
index 715d7c1..c8a66c7 100644 (file)
@@ -2,7 +2,7 @@
  * vout.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.h,v 1.5 2003/01/31 02:53:52 jlj Exp $
+ * $Id: vout.h,v 1.6 2003/02/07 20:23:17 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -23,6 +23,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define WINDOW_TITLE_HEIGHT 21
+
 /*****************************************************************************
  * VLCWindow interface
  *****************************************************************************/
@@ -34,6 +36,9 @@
 - (void)setVout:(vout_thread_t *)_p_vout;
 - (vout_thread_t *)getVout;
 
+- (void)halfWindow;
+- (void)normalWindow;
+- (void)doubleWindow;
 - (void)toggleFullscreen;
 - (BOOL)isFullscreen;
 
index 1167246..a501c3a 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.23 2003/02/06 13:47:04 hartman Exp $
+ * $Id: vout.m,v 1.24 2003/02/07 20:23:17 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -725,6 +725,39 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     return( p_vout );
 }
 
+- (void)halfWindow
+{
+    NSSize newsize;
+    
+    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;
+}
+
 - (void)toggleFullscreen
 {
     p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;