Commit eeb8eda7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: moved preliminary vout to main window, removed most interface related...

macosx: moved preliminary vout to main window, removed most interface related parts from VLCMain, implemented theming for the main window

the former embedded window is no longer accessible
parent e589c149
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1037,7 +1037,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
else if( [o_title isEqualToString: _NS("Mute")] )
{
[o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
//FIXME [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
[self setupMenus]; /* Make sure audio menu is up to date */
}
else if( [o_title isEqualToString: _NS("Half Size")] ||
......
/*****************************************************************************
* MainWindow.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne
* Copyright (C) 2002-2011 VideoLAN
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -22,8 +25,77 @@
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <vlc_input.h>
@interface VLCMainWindow : NSObject {
@interface VLCMainWindow : NSWindow {
IBOutlet id o_play_btn;
IBOutlet id o_bwd_btn;
IBOutlet id o_fwd_btn;
IBOutlet id o_stop_btn;
IBOutlet id o_playlist_btn;
IBOutlet id o_repeat_btn;
IBOutlet id o_shuffle_btn;
IBOutlet id o_effects_btn;
IBOutlet id o_fullscreen_btn;
IBOutlet id o_search_fld;
IBOutlet id o_volume_sld;
IBOutlet id o_volume_track_view;
IBOutlet id o_volume_down_btn;
IBOutlet id o_volume_up_btn;
IBOutlet id o_time_sld;
IBOutlet id o_time_fld;
IBOutlet id o_progress_bar;
IBOutlet id o_bottombar_view;
IBOutlet id o_time_sld_left_view;
IBOutlet id o_time_sld_middle_view;
IBOutlet id o_time_sld_right_view;
// TODO Playlist table, additional ui stuff at the top of the window
IBOutlet id o_playlist_table;
IBOutlet id o_video_view;
BOOL b_gray_interface;
BOOL b_video_playback_enabled;
BOOL b_time_remaining;
int i_lastShownVolume;
BOOL b_mute;
input_state_e cachedInputState;
NSImage * o_pause_img;
NSImage * o_pause_pressed_img;
NSImage * o_play_img;
NSImage * o_play_pressed_img;
NSImage * o_repeat_img;
NSImage * o_repeat_pressed_img;
NSImage * o_repeat_all_img;
NSImage * o_repeat_all_pressed_img;
NSImage * o_repeat_one_img;
NSImage * o_repeat_one_pressed_img;
NSImage * o_shuffle_img;
NSImage * o_shuffle_pressed_img;
NSImage * o_shuffle_on_img;
NSImage * o_shuffle_on_pressed_img;
}
+ (VLCMainWindow *)sharedInstance;
- (IBAction)play:(id)sender;
- (IBAction)bwd:(id)sender;
- (IBAction)fwd:(id)sender;
- (IBAction)stop:(id)sender;
- (IBAction)togglePlaylist:(id)sender;
- (IBAction)repeat:(id)sender;
- (IBAction)shuffle:(id)sender;
- (IBAction)timeSliderAction:(id)sender;
- (IBAction)timeFieldWasClicked:(id)sender;
- (IBAction)volumeAction:(id)sender;
- (IBAction)effects:(id)sender;
- (IBAction)fullscreen:(id)sender;
- (id)videoView;
- (void)setVideoplayEnabled:(BOOL)b_value;
- (void)updateTimeSlider;
- (void)updateVolumeSlider;
- (void)updateWindow;
- (void)setPause;
- (void)setPlay;
@end
\ No newline at end of file
This diff is collapsed.
......@@ -141,8 +141,6 @@
/* we don't want this window to be restored on relaunch */
if ([self respondsToSelector:@selector(setRestorable:)])
[self setRestorable:NO];
[self makeKeyAndOrderFront: self];
}
- (void)controlTintChanged
......
......@@ -30,6 +30,7 @@
#import "vout.h"
#import "misc.h"
#import "fspanel.h"
#import "MainWindow.h"
@interface VLCFSPanel ()
- (void)hideMouse;
......@@ -554,7 +555,7 @@
- (IBAction)fsTimeSliderUpdate:(id)sender
{
[[VLCMain sharedInstance] timesliderUpdate: sender];
[[VLCMainWindow sharedInstance] updateTimeSlider];
}
- (IBAction)fsVolumeSliderUpdate:(id)sender
......
......@@ -67,8 +67,8 @@ aout_instance_t *getAout(void);
struct intf_sys_t
{
/* special actions */
bool b_mute;
int i_play_status;
int i_old_play_status;
/* interface update */
bool b_intf_update;
......@@ -76,7 +76,6 @@ struct intf_sys_t
bool b_playmode_update;
bool b_current_title_update;
bool b_fullscreen_update;
bool b_volume_update;
bool b_intf_show;
/* menus handlers */
......@@ -93,7 +92,6 @@ struct intf_sys_t
*****************************************************************************/
@class AppleRemote;
@class VLCInformation;
@class VLCControllerWindow;
@class VLCEmbeddedWindow;
@class VLCControls;
@class VLCPlaylist;
......@@ -120,31 +118,7 @@ struct intf_sys_t
BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
BOOL nib_bookmarks_loaded; /* Bookmarks nibfile */
IBOutlet VLCControllerWindow * o_window; /* main window */
IBOutlet id o_scrollfield; /* info field */
IBOutlet NSTextField * o_timefield; /* time field */
IBOutlet NSSlider * o_timeslider; /* time slider */
BOOL b_time_remaining; /* show remaining time or playtime ? */
IBOutlet VLCEmbeddedWindow * o_embedded_window; /* Embedded Vout Window */
float f_slider; /* slider value */
float f_slider_old; /* old slider val */
IBOutlet NSSlider * o_volumeslider; /* volume slider */
IBOutlet NSProgressIndicator * o_main_pgbar; /* playlist window progress bar */
IBOutlet NSButton * o_btn_prev; /* btn previous */
IBOutlet NSButton * o_btn_rewind; /* btn rewind */
IBOutlet NSButton * o_btn_play; /* btn play */
IBOutlet NSButton * o_btn_stop; /* btn stop */
IBOutlet NSButton * o_btn_ff; /* btn fast forward */
IBOutlet NSButton * o_btn_next; /* btn next */
IBOutlet NSButton * o_btn_fullscreen;/* btn fullscreen (embedded vout window) */
IBOutlet NSButton * o_btn_playlist; /* btn playlist */
IBOutlet NSButton * o_btn_audioEffects; /* AudioEffects btn */
NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */
NSImage * o_img_play_pressed; /* btn play img */
NSImage * o_img_pause_pressed; /* btn pause img */
IBOutlet id o_mainwindow; /* VLCMainWindow */
IBOutlet VLCControls * o_controls; /* VLCControls */
IBOutlet VLCPlaylist * o_playlist; /* VLCPlaylist */
......@@ -167,11 +141,8 @@ struct intf_sys_t
IBOutlet NSButton * o_crashrep_includeEmail_ckb;
IBOutlet NSTextField * o_crashrep_includeEmail_txt;
mtime_t i_end_scroll;
int i_lastShownVolume;
input_state_e cachedInputState;
mtime_t i_end_scroll;
/* the manage thread */
pthread_t manage_thread;
......@@ -204,14 +175,11 @@ struct intf_sys_t
- (id)simplePreferences;
- (id)preferences;
- (id)playlist;
- (BOOL)isPlaylistCollapsed;
- (id)info;
- (id)wizard;
- (id)embeddedList;
- (id)getVideoViewAtPositionX: (int *)pi_x Y: (int *)pi_y withWidth: (unsigned int*)pi_width andHeight: (unsigned int*)pi_height;
- (id)coreDialogProvider;
- (id)mainIntfPgbar;
- (id)controllerWindow;
- (id)eyeTVController;
- (id)appleRemoteController;
- (void)applicationWillTerminate:(NSNotification *)notification;
......@@ -229,14 +197,8 @@ struct intf_sys_t
- (void)manage;
- (void)manageIntf:(NSTimer *)o_timer;
- (void)setScrollField:(NSString *)o_string stopAfter:(int )timeout;
- (void)resetScrollField;
- (void)updateMessageDisplay;
- (void)playStatusUpdated:(int) i_status;
- (void)manageVolumeSlider;
- (IBAction)timesliderUpdate:(id)sender;
- (IBAction)timeFieldWasClicked:(id)sender;
- (IBAction)showController:(id)sender;
- (IBAction)crashReporterAction:(id)sender;
......
This diff is collapsed.
......@@ -88,17 +88,6 @@
@end
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
@interface VLCControllerWindow : NSWindow
{
}
@end
/*****************************************************************************
* VLCControllerView
*****************************************************************************/
......
......@@ -26,6 +26,7 @@
#import <Carbon/Carbon.h>
#import "intf.h" /* VLCApplication */
#import "MainWindow.h"
#import "misc.h"
#import "playlist.h"
#import "controls.h"
......@@ -403,62 +404,6 @@ static NSMutableArray *blackoutWindows = NULL;
}
@end
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
@implementation VLCControllerWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
/* FIXME: this should enable the SnowLeopard window style, however, it leads to ugly artifacts
* needs some further investigation! -- feepk
BOOL b_useTextured = YES;
if( [[NSWindow class] instancesRespondToSelector:@selector(setContentBorderThickness:forEdge:)] )
{
b_useTextured = NO;
styleMask ^= NSTexturedBackgroundWindowMask;
} */
self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
backing:backingType defer:flag];
[[VLCMain sharedInstance] updateTogglePlaylistState];
/* FIXME: see above...
if(! b_useTextured )
{
[self setContentBorderThickness:28.0 forEdge:NSMinYEdge];
}
*/
/* we want to be moveable regardless of our style */
[self setMovableByWindowBackground: YES];
/* we don't want this window to be restored on relaunch */
if ([self respondsToSelector:@selector(setRestorable:)])
[self setRestorable:NO];
return self;
}
- (BOOL)performKeyEquivalent:(NSEvent *)o_event
{
/* We indeed want to prioritize Cocoa key equivalent against libvlc,
so we perform the menu equivalent now. */
if([[NSApp mainMenu] performKeyEquivalent:o_event])
return TRUE;
return [[VLCMain sharedInstance] hasDefinedShortcutKey:o_event] ||
[(VLCControls *)[[VLCMain sharedInstance] controls] keyEvent:o_event];
}
@end
/*****************************************************************************
* VLCControllerView
*****************************************************************************/
......@@ -771,6 +716,6 @@ void _drawFrameInRect(NSRect frameRect)
if( [ourEvent clickCount] > 1 )
[[[VLCMain sharedInstance] controls] goToSpecificTime: nil];
else
[[VLCMain sharedInstance] timeFieldWasClicked: self];
[[VLCMainWindow sharedInstance] timeFieldWasClicked: self];
}
@end
......@@ -569,12 +569,9 @@
free( psz_uri );
}
if( [[VLCMain sharedInstance] isPlaylistCollapsed] == NO )
{
/* update our info-panel to reflect the new item, if we aren't collapsed */
/* update our info-panel to reflect the new item */
[[[VLCMain sharedInstance] info] updatePanelWithItem:p_item->p_input];
}
}
}
- (BOOL)isSelectionEmpty
......
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