1 /*****************************************************************************
2 * intf.h: MacOS X interface plugin
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: intf.h,v 1.22 2003/02/05 16:23:06 hartman Exp $
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <thedj@users.sourceforge.net>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
31 #include <Cocoa/Cocoa.h>
33 /*****************************************************************************
34 * VLCApplication interface
35 *****************************************************************************/
36 @interface VLCApplication : NSApplication
38 NSStringEncoding i_encoding;
39 intf_thread_t *p_intf;
42 - (void)initIntlSupport;
43 - (NSString *)localizedString:(char *)psz;
45 - (void)setIntf:(intf_thread_t *)p_intf;
46 - (intf_thread_t *)getIntf;
50 #define _NS(s) [NSApp localizedString: _(s)]
52 int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
54 /*****************************************************************************
55 * intf_sys_t: description and status of the interface
56 *****************************************************************************/
59 NSAutoreleasePool * o_pool;
66 /* interface update */
67 vlc_bool_t b_intf_update;
68 vlc_bool_t b_play_status;
71 vlc_bool_t b_chapter_update;
72 vlc_bool_t b_program_update;
73 vlc_bool_t b_title_update;
74 vlc_bool_t b_audio_update;
75 vlc_bool_t b_spu_update;
76 vlc_bool_t b_aout_update;
77 vlc_bool_t b_vout_update;
79 /* The messages window */
80 msg_subscription_t * p_sub;
86 /*****************************************************************************
88 *****************************************************************************/
89 @interface VLCMain : NSObject
91 id o_prefs; /* VLCPrefs */
93 IBOutlet id o_window; /* main window */
94 IBOutlet id o_timefield; /* time field */
95 IBOutlet id o_timeslider; /* time slider */
96 float f_slider; /* slider value */
97 float f_slider_old; /* old slider val */
98 IBOutlet id o_volumeslider; /* volume slider */
100 IBOutlet id o_btn_playlist; /* btn playlist */
101 IBOutlet id o_btn_prev; /* btn previous */
102 IBOutlet id o_btn_slower; /* btn slower */
103 IBOutlet id o_btn_play; /* btn play */
104 IBOutlet id o_btn_stop; /* btn stop */
105 IBOutlet id o_btn_faster; /* btn faster */
106 IBOutlet id o_btn_next; /* btn next */
107 IBOutlet id o_btn_prefs; /* btn prefs */
109 NSImage * o_img_play; /* btn play img */
110 NSImage * o_img_pause; /* btn pause img */
112 IBOutlet id o_controls; /* VLCControls */
113 IBOutlet id o_playlist; /* VLCPlaylist */
115 IBOutlet id o_messages; /* messages tv */
116 IBOutlet id o_msgs_panel; /* messages panel */
117 IBOutlet id o_msgs_btn_ok; /* messages btn */
118 NSMutableArray * o_msg_arr; /* messages array */
119 NSLock * o_msg_lock; /* messages lock */
120 IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */
122 IBOutlet id o_error; /* error panel */
123 IBOutlet id o_err_msg; /* NSTextView */
124 IBOutlet id o_err_lbl;
125 IBOutlet id o_err_bug_lbl;
126 IBOutlet id o_err_btn_msgs; /* Open Messages */
127 IBOutlet id o_err_btn_dismiss;
131 IBOutlet id o_mi_about;
132 IBOutlet id o_mi_prefs;
133 IBOutlet id o_mi_hide;
134 IBOutlet id o_mi_hide_others;
135 IBOutlet id o_mi_show_all;
136 IBOutlet id o_mi_quit;
138 IBOutlet id o_mu_file;
139 IBOutlet id o_mi_open_file;
140 IBOutlet id o_mi_open_generic;
141 IBOutlet id o_mi_open_disc;
142 IBOutlet id o_mi_open_net;
143 IBOutlet id o_mi_open_recent;
144 IBOutlet id o_mi_open_recent_cm;
146 IBOutlet id o_mu_edit;
147 IBOutlet id o_mi_cut;
148 IBOutlet id o_mi_copy;
149 IBOutlet id o_mi_paste;
150 IBOutlet id o_mi_clear;
151 IBOutlet id o_mi_select_all;
153 IBOutlet id o_mu_controls;
154 IBOutlet id o_mi_play;
155 IBOutlet id o_mi_stop;
156 IBOutlet id o_mi_faster;
157 IBOutlet id o_mi_slower;
158 IBOutlet id o_mi_previous;
159 IBOutlet id o_mi_next;
160 IBOutlet id o_mi_loop;
161 IBOutlet id o_mi_program;
162 IBOutlet id o_mi_title;
163 IBOutlet id o_mi_chapter;
164 IBOutlet id o_mi_language;
165 IBOutlet id o_mi_subtitle;
167 IBOutlet id o_mu_audio;
168 IBOutlet id o_mi_vol_up;
169 IBOutlet id o_mi_vol_down;
170 IBOutlet id o_mi_mute;
171 IBOutlet id o_mi_channels;
172 IBOutlet id o_mi_device;
174 IBOutlet id o_mu_video;
175 IBOutlet id o_mi_fullscreen;
176 IBOutlet id o_mi_screen;
177 IBOutlet id o_mi_deinterlace;
179 IBOutlet id o_mu_window;
180 IBOutlet id o_mi_minimize;
181 IBOutlet id o_mi_close_window;
182 IBOutlet id o_mi_controller;
183 IBOutlet id o_mi_playlist;
184 IBOutlet id o_mi_messages;
185 IBOutlet id o_mi_bring_atf;
187 IBOutlet id o_mu_help;
188 IBOutlet id o_mi_readme;
189 IBOutlet id o_mi_reportabug;
190 IBOutlet id o_mi_website;
191 IBOutlet id o_mi_license;
194 IBOutlet id o_dmi_play;
195 IBOutlet id o_dmi_stop;
196 IBOutlet id o_dmi_next;
197 IBOutlet id o_dmi_previous;
203 - (void)manage:(playlist_t *)p_playlist;
204 - (void)manageMode:(playlist_t *)p_playlist;
205 - (void)manageIntf:(NSTimer *)o_timer;
207 - (void)updateMessageArray;
208 - (void)playStatusUpdated:(BOOL)b_pause;
209 - (void)setSubmenusEnabled:(BOOL)b_enabled;
210 - (void)manageVolumeSlider;
212 - (void)setupMenus:(input_thread_t *)p_input;
213 - (void)setupLangMenu:(input_thread_t *)p_input
214 mi:(NSMenuItem *)o_mi
215 es:(es_descriptor_t *)p_es
217 selector:(SEL)pf_callback;
218 - (void)setupVarMenu:(NSMenuItem *)o_mi
219 target:(vlc_object_t *)p_object
220 var:(const char *)psz_var
221 selector:(SEL)pf_callback;
223 - (IBAction)clearRecentItems:(id)sender;
224 - (void)openRecentItem:(id)sender;
226 - (IBAction)viewPreferences:(id)sender;
228 - (IBAction)timesliderUpdate:(id)sender;
230 - (IBAction)closeError:(id)sender;
232 - (IBAction)openReadMe:(id)sender;
233 - (IBAction)reportABug:(id)sender;
234 - (IBAction)openWebsite:(id)sender;
235 - (IBAction)openLicense:(id)sender;
237 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
241 @interface VLCMain (Internal)
242 - (void)handlePortMessage:(NSPortMessage *)o_msg;