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

macosx: moved all (main) menu related code to a separate class

This is a first step to re-organize the interface, more to come
parent 6c101d63
......@@ -418,6 +418,8 @@
CC3F9F851350B2A000B0E885 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ../../contrib/Growl/Growl.framework; sourceTree = "<group>"; };
CC402F4B0E00ABBB006A4BA4 /* VLC.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VLC.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
CC426FD01020D44F00A32659 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ../../contrib/Sparkle/Sparkle.framework; sourceTree = SOURCE_ROOT; };
CC448A5A13B61D49009F72E0 /* MainMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MainMenu.h; path = ../../../modules/gui/macosx/MainMenu.h; sourceTree = "<group>"; };
CC448A5B13B61D49009F72E0 /* MainMenu.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MainMenu.m; path = ../../../modules/gui/macosx/MainMenu.m; sourceTree = "<group>"; };
CC4A33210F8CB017000FC4A7 /* coredialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = coredialogs.m; path = ../../../modules/gui/macosx/coredialogs.m; sourceTree = SOURCE_ROOT; };
CC4A33220F8CB017000FC4A7 /* coredialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = coredialogs.h; path = ../../../modules/gui/macosx/coredialogs.h; sourceTree = SOURCE_ROOT; };
CC4D67F51348F587003FCC5B /* quartztext.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = quartztext.c; path = ../../../modules/misc/text_renderer/quartztext.c; sourceTree = "<group>"; };
......@@ -560,6 +562,8 @@
8ED6C27E03E2EB1C0059A3A7 /* macosx.m */,
8ED6C27C03E2EB1C0059A3A7 /* intf.h */,
8ED6C27D03E2EB1C0059A3A7 /* intf.m */,
CC448A5A13B61D49009F72E0 /* MainMenu.h */,
CC448A5B13B61D49009F72E0 /* MainMenu.m */,
CC4A33220F8CB017000FC4A7 /* coredialogs.h */,
CC4A33210F8CB017000FC4A7 /* coredialogs.m */,
8E6BC6FA041684EC0059A3A7 /* controls.h */,
......
/*****************************************************************************
* MainMenu.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <vlc_common.h>
#import <vlc_interface.h>
@interface VLCMainMenu : NSObject
{
intf_thread_t *p_intf;
BOOL b_mainMenu_setup;
BOOL b_nib_about_loaded;
BOOL b_nib_videoeffects_loaded;
BOOL b_nib_audioeffects_loaded;
BOOL b_nib_tracksynchro_loaded;
BOOL b_nib_bookmarks_loaded;
id o_about; /* VLAboutBox */
id o_videoeffects; /* VLCVideoEffects */
id o_audioeffects; /* VLCAudioEffects */
id o_trackSynchronization; /* VLCTrackSynchronization */
id o_bookmarks; /* VLCBookmarks */
/* main menu */
IBOutlet NSMenuItem * o_mi_about;
IBOutlet NSMenuItem * o_mi_prefs;
IBOutlet NSMenuItem * o_mi_checkForUpdate;
IBOutlet NSMenuItem * o_mi_add_intf;
IBOutlet NSMenu * o_mu_add_intf;
IBOutlet NSMenuItem * o_mi_services;
IBOutlet NSMenuItem * o_mi_hide;
IBOutlet NSMenuItem * o_mi_hide_others;
IBOutlet NSMenuItem * o_mi_show_all;
IBOutlet NSMenuItem * o_mi_quit;
IBOutlet NSMenu * o_mu_file;
IBOutlet NSMenuItem * o_mi_open_file;
IBOutlet NSMenuItem * o_mi_open_generic;
IBOutlet NSMenuItem * o_mi_open_disc;
IBOutlet NSMenuItem * o_mi_open_net;
IBOutlet NSMenuItem * o_mi_open_capture;
IBOutlet NSMenuItem * o_mi_open_recent;
IBOutlet NSMenuItem * o_mi_open_recent_cm;
IBOutlet NSMenuItem * o_mi_open_wizard;
IBOutlet NSMenu * o_mu_edit;
IBOutlet NSMenuItem * o_mi_cut;
IBOutlet NSMenuItem * o_mi_copy;
IBOutlet NSMenuItem * o_mi_paste;
IBOutlet NSMenuItem * o_mi_clear;
IBOutlet NSMenuItem * o_mi_select_all;
IBOutlet NSMenu * o_mu_controls;
IBOutlet NSMenuItem * o_mi_play;
IBOutlet NSMenuItem * o_mi_stop;
IBOutlet NSMenuItem * o_mi_faster;
IBOutlet NSMenuItem * o_mi_slower;
IBOutlet NSMenuItem * o_mi_normalSpeed;
IBOutlet NSMenuItem * o_mi_trackSynchronization;
IBOutlet NSMenuItem * o_mi_previous;
IBOutlet NSMenuItem * o_mi_next;
IBOutlet NSMenuItem * o_mi_random;
IBOutlet NSMenuItem * o_mi_repeat;
IBOutlet NSMenuItem * o_mi_loop;
IBOutlet NSMenuItem * o_mi_quitAfterPB;
IBOutlet NSMenuItem * o_mi_fwd;
IBOutlet NSMenuItem * o_mi_bwd;
IBOutlet NSMenuItem * o_mi_program;
IBOutlet NSMenu * o_mu_program;
IBOutlet NSMenuItem * o_mi_title;
IBOutlet NSMenu * o_mu_title;
IBOutlet NSMenuItem * o_mi_chapter;
IBOutlet NSMenu * o_mu_chapter;
IBOutlet NSMenu * o_mu_audio;
IBOutlet NSMenuItem * o_mi_vol_up;
IBOutlet NSMenuItem * o_mi_vol_down;
IBOutlet NSMenuItem * o_mi_mute;
IBOutlet NSMenuItem * o_mi_audiotrack;
IBOutlet NSMenu * o_mu_audiotrack;
IBOutlet NSMenuItem * o_mi_channels;
IBOutlet NSMenu * o_mu_channels;
IBOutlet NSMenuItem * o_mi_device;
IBOutlet NSMenu * o_mu_device;
IBOutlet NSMenuItem * o_mi_visual;
IBOutlet NSMenu * o_mu_visual;
IBOutlet NSMenu * o_mu_video;
IBOutlet NSMenuItem * o_mi_half_window;
IBOutlet NSMenuItem * o_mi_normal_window;
IBOutlet NSMenuItem * o_mi_double_window;
IBOutlet NSMenuItem * o_mi_fittoscreen;
IBOutlet NSMenuItem * o_mi_fullscreen;
IBOutlet NSMenuItem * o_mi_floatontop;
IBOutlet NSMenuItem * o_mi_snapshot;
IBOutlet NSMenuItem * o_mi_videotrack;
IBOutlet NSMenu * o_mu_videotrack;
IBOutlet NSMenuItem * o_mi_screen;
IBOutlet NSMenu * o_mu_screen;
IBOutlet NSMenuItem * o_mi_aspect_ratio;
IBOutlet NSMenu * o_mu_aspect_ratio;
IBOutlet NSMenuItem * o_mi_crop;
IBOutlet NSMenu * o_mu_crop;
IBOutlet NSMenuItem * o_mi_subtitle;
IBOutlet NSMenu * o_mu_subtitle;
IBOutlet NSMenuItem * o_mi_addSub;
IBOutlet NSMenuItem * o_mi_deinterlace;
IBOutlet NSMenu * o_mu_deinterlace;
IBOutlet NSMenuItem * o_mi_deinterlace_mode;
IBOutlet NSMenu * o_mu_deinterlace_mode;
IBOutlet NSMenuItem * o_mi_ffmpeg_pp;
IBOutlet NSMenu * o_mu_ffmpeg_pp;
IBOutlet NSMenuItem * o_mi_teletext;
IBOutlet NSMenuItem * o_mi_teletext_transparent;
IBOutlet NSMenuItem * o_mi_teletext_index;
IBOutlet NSMenuItem * o_mi_teletext_red;
IBOutlet NSMenuItem * o_mi_teletext_green;
IBOutlet NSMenuItem * o_mi_teletext_yellow;
IBOutlet NSMenuItem * o_mi_teletext_blue;
IBOutlet NSMenu * o_mu_window;
IBOutlet NSMenuItem * o_mi_minimize;
IBOutlet NSMenuItem * o_mi_close_window;
IBOutlet NSMenuItem * o_mi_player;
IBOutlet NSMenuItem * o_mi_controller;
IBOutlet NSMenuItem * o_mi_audioeffects;
IBOutlet NSMenuItem * o_mi_videoeffects;
IBOutlet NSMenuItem * o_mi_bookmarks;
IBOutlet NSMenuItem * o_mi_playlist;
IBOutlet NSMenuItem * o_mi_info;
IBOutlet NSMenuItem * o_mi_messages;
IBOutlet NSMenuItem * o_mi_bring_atf;
IBOutlet NSMenu * o_mu_help;
IBOutlet NSMenuItem * o_mi_help;
IBOutlet NSMenuItem * o_mi_readme;
IBOutlet NSMenuItem * o_mi_documentation;
IBOutlet NSMenuItem * o_mi_license;
IBOutlet NSMenuItem * o_mi_website;
IBOutlet NSMenuItem * o_mi_donation;
IBOutlet NSMenuItem * o_mi_forum;
IBOutlet NSMenuItem * o_mi_errorsAndWarnings;
/* dock menu */
IBOutlet NSMenuItem * o_dmi_play;
IBOutlet NSMenuItem * o_dmi_stop;
IBOutlet NSMenuItem * o_dmi_next;
IBOutlet NSMenuItem * o_dmi_previous;
IBOutlet NSMenuItem * o_dmi_mute;
/* vout menu */
IBOutlet NSMenu * o_vout_menu;
IBOutlet NSMenuItem * o_vmi_play;
IBOutlet NSMenuItem * o_vmi_stop;
IBOutlet NSMenuItem * o_vmi_prev;
IBOutlet NSMenuItem * o_vmi_next;
IBOutlet NSMenuItem * o_vmi_volup;
IBOutlet NSMenuItem * o_vmi_voldown;
IBOutlet NSMenuItem * o_vmi_mute;
IBOutlet NSMenuItem * o_vmi_fullscreen;
IBOutlet NSMenuItem * o_vmi_snapshot;
}
+ (VLCMainMenu *)sharedInstance;
- (void)initStrings;
- (void)releaseRepresentedObjects:(NSMenu *)the_menu;
- (void)setupMenus;
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification;
- (void)setSubmenusEnabled:(BOOL)b_enabled;
- (IBAction)clearRecentItems:(id)sender;
- (void)openRecentItem:(id)item;
- (IBAction)intfOpenFile:(id)sender;
- (IBAction)intfOpenFileGeneric:(id)sender;
- (IBAction)intfOpenDisc:(id)sender;
- (IBAction)intfOpenNet:(id)sender;
- (IBAction)intfOpenCapture:(id)sender;
- (IBAction)showWizard:(id)sender;
- (IBAction)showVideoEffects:(id)sender;
- (IBAction)showAudioEffects:(id)sender;
- (IBAction)showTrackSynchronization:(id)sender;
- (IBAction)showBookmarks:(id)sender;
- (IBAction)showInformationPanel:(id)sender;
- (IBAction)viewAbout:(id)sender;
- (IBAction)showLicense:(id)sender;
- (IBAction)viewPreferences:(id)sender;
- (IBAction)viewHelp:(id)sender;
- (IBAction)openReadMe:(id)sender;
- (IBAction)openDocumentation:(id)sender;
- (IBAction)openWebsite:(id)sender;
- (IBAction)openForum:(id)sender;
- (IBAction)openDonate:(id)sender;
- (IBAction)viewErrorsAndWarnings:(id)sender;
- (void)setPlay;
- (void)setPause;
- (IBAction)toggleVar:(id)sender;
- (int)toggleVarThread:(id)_o_data;
- (void)setupVarMenuItem:(NSMenuItem *)o_mi
target:(vlc_object_t *)p_object
var:(const char *)psz_variable
selector:(SEL)pf_callback;
- (void)setupVarMenu:(NSMenu *)o_menu
forMenuItem: (NSMenuItem *)o_parent
target:(vlc_object_t *)p_object
var:(const char *)psz_variable
selector:(SEL)pf_callback;
@end
/*****************************************************************************
* VLCAutoGeneratedMenuContent interface
*****************************************************************************
* This holds our data for autogenerated menus
*****************************************************************************/
@interface VLCAutoGeneratedMenuContent : NSObject
{
char *psz_name;
vlc_object_t * _vlc_object;
vlc_value_t value;
int i_type;
}
- (id)initWithVariableName: (const char *)name
ofObject: (vlc_object_t *)object
andValue: (vlc_value_t)value
ofType: (int)type;
- (const char *)name;
- (vlc_value_t)value;
- (vlc_object_t *)vlcObject;
- (int)type;
@end
This diff is collapsed.
......@@ -10,6 +10,8 @@ SOURCES_macosx = \
SPInvocationGrabbing.m \
SPMediaKeyTap.h \
SPMediaKeyTap.m \
MainMenu.h \
MainMenu.m \
about.h \
about.m \
applescript.h \
......
......@@ -94,48 +94,12 @@
- (BOOL)keyEvent:(NSEvent *)o_event;
- (void)scrollWheel: (NSEvent *)theEvent;
- (void)setupVarMenuItem:(NSMenuItem *)o_mi
target:(vlc_object_t *)p_object
var:(const char *)psz_variable
selector:(SEL)pf_callback;
- (void)setupVarMenu:(NSMenu *)o_menu
forMenuItem: (NSMenuItem *)o_parent
target:(vlc_object_t *)p_object
var:(const char *)psz_variable
selector:(SEL)pf_callback;
- (IBAction)toggleVar:(id)sender;
- (int)toggleVarThread:(id)_o_data;
- (IBAction)goToSpecificTime:(id)sender;
- (id)fspanel;
@end
/*****************************************************************************
* VLCAutoGeneratedMenuContent interface
*****************************************************************************
* This holds our data for autogenerated menus
*****************************************************************************/
@interface VLCAutoGeneratedMenuContent : NSObject
{
char *psz_name;
vlc_object_t * _vlc_object;
vlc_value_t value;
int i_type;
}
- (id)initWithVariableName: (const char *)name
ofObject: (vlc_object_t *)object
andValue: (vlc_value_t)value
ofType: (int)type;
- (const char *)name;
- (vlc_value_t)value;
- (vlc_object_t *)vlcObject;
- (int)type;
@end
/*****************************************************************************
* VLCTimeField interface
*****************************************************************************
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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