]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
* ./README.MacOSX.rtf: added two remarks on subtitle support.
[vlc] / modules / gui / macosx / intf.h
1 /*****************************************************************************
2  * intf.h: MacOS X interface plugin
3  *****************************************************************************
4  * Copyright (C) 2002 VideoLAN
5  * $Id: intf.h,v 1.17 2003/01/25 18:42:17 hartman Exp $
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Christophe Massiot <massiot@via.ecp.fr>
9  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
10  *
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.
15  * 
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.
20  *
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  *****************************************************************************/
25
26 #include <vlc/vlc.h>
27 #include <vlc/intf.h>
28 #include <vlc/vout.h>
29
30 #include <Cocoa/Cocoa.h>
31
32 /*****************************************************************************
33  * VLCApplication interface 
34  *****************************************************************************/
35 @interface VLCApplication : NSApplication
36 {
37     NSStringEncoding i_encoding;
38     intf_thread_t *p_intf;
39 }
40
41 - (void)initIntlSupport;
42 - (NSString *)localizedString:(char *)psz;
43
44 - (void)setIntf:(intf_thread_t *)p_intf;
45 - (intf_thread_t *)getIntf;
46
47 @end
48
49 #define _NS(s) [NSApp localizedString: _(s)]
50
51 /*****************************************************************************
52  * intf_sys_t: description and status of the interface
53  *****************************************************************************/
54 struct intf_sys_t
55 {
56     NSAutoreleasePool * o_pool;
57     NSPort * o_sendport;
58
59     /* special actions */
60     vlc_bool_t b_loop;
61     vlc_bool_t b_playing;
62     vlc_bool_t b_stopping;
63     vlc_bool_t b_mute;
64
65     /* menus handlers */
66     vlc_bool_t b_chapter_update;
67     vlc_bool_t b_program_update;
68     vlc_bool_t b_title_update;
69     vlc_bool_t b_audio_update;
70     vlc_bool_t b_spu_update;
71     vlc_bool_t b_aout_update;
72     vlc_bool_t b_vout_update;
73
74     /* The input thread */
75     input_thread_t * p_input;
76
77     /* The messages window */
78     msg_subscription_t * p_sub;
79
80     /* DVD mode */
81     unsigned int i_part;
82 };
83
84 /*****************************************************************************
85  * VLCMain interface 
86  *****************************************************************************/
87 @interface VLCMain : NSObject
88 {
89     id o_prefs;                 /* VLCPrefs       */
90
91     IBOutlet id o_window;       /* main window    */
92     IBOutlet id o_timefield;    /* time field     */
93     IBOutlet id o_timeslider;   /* time slider    */
94     float f_slider;             /* slider value   */
95     float f_slider_old;         /* old slider val */ 
96     IBOutlet id o_volumeslider; /* volume slider  */
97
98     IBOutlet id o_btn_playlist; /* btn playlist   */
99     IBOutlet id o_btn_prev;     /* btn previous   */
100     IBOutlet id o_btn_slowmotion;   /* btn slowmotion     */
101     IBOutlet id o_btn_play;     /* btn play       */
102     IBOutlet id o_btn_stop;     /* btn stop       */
103     IBOutlet id o_btn_fastforward;   /* btn fastforward     */
104     IBOutlet id o_btn_next;     /* btn next       */
105     IBOutlet id o_btn_prefs;    /* btn prefs      */
106
107     IBOutlet id o_controls;     /* VLCControls    */
108     IBOutlet id o_playlist;     /* VLCPlaylist    */
109
110     IBOutlet id o_messages;     /* messages tv    */
111     IBOutlet id o_msgs_panel;   /* messages panel */
112     IBOutlet id o_msgs_btn_ok;  /* messages btn   */
113
114     IBOutlet id o_error;        /* error panel    */
115     IBOutlet id o_err_msg;      /* NSTextView     */
116     IBOutlet id o_err_lbl;
117     IBOutlet id o_err_bug_lbl;
118     IBOutlet id o_err_btn_msgs; /* Open Messages  */
119     IBOutlet id o_err_btn_dismiss;
120
121     /* main menu */
122
123     IBOutlet id o_mi_about;
124     IBOutlet id o_mi_prefs;
125     IBOutlet id o_mi_hide;
126     IBOutlet id o_mi_hide_others;
127     IBOutlet id o_mi_show_all;
128     IBOutlet id o_mi_quit;
129
130     IBOutlet id o_mu_file;
131     IBOutlet id o_mi_open_file;
132     IBOutlet id o_mi_open_generic;
133     IBOutlet id o_mi_open_disc;
134     IBOutlet id o_mi_open_net;
135     IBOutlet id o_mi_open_recent;
136     IBOutlet id o_mi_open_recent_cm;
137
138     IBOutlet id o_mu_edit;
139     IBOutlet id o_mi_cut;
140     IBOutlet id o_mi_copy;
141     IBOutlet id o_mi_paste;
142     IBOutlet id o_mi_clear;
143     IBOutlet id o_mi_select_all;
144
145     IBOutlet id o_mu_controls;
146     IBOutlet id o_mi_play;
147     IBOutlet id o_mi_stop;
148     IBOutlet id o_mi_faster;
149     IBOutlet id o_mi_slower;
150     IBOutlet id o_mi_previous;
151     IBOutlet id o_mi_next;
152     IBOutlet id o_mi_loop;
153     IBOutlet id o_mi_program;
154     IBOutlet id o_mi_title;
155     IBOutlet id o_mi_chapter;
156     IBOutlet id o_mi_language;
157     IBOutlet id o_mi_subtitle;
158
159     IBOutlet id o_mu_audio;
160     IBOutlet id o_mi_vol_up;
161     IBOutlet id o_mi_vol_down;
162     IBOutlet id o_mi_mute;
163     IBOutlet id o_mi_channels;
164     IBOutlet id o_mi_device;
165
166     IBOutlet id o_mu_video;
167     IBOutlet id o_mi_fullscreen;
168     IBOutlet id o_mi_screen;
169     IBOutlet id o_mi_deinterlace;
170
171     IBOutlet id o_mu_window;
172     IBOutlet id o_mi_minimize;
173     IBOutlet id o_mi_close_window;
174     IBOutlet id o_mi_controller;
175     IBOutlet id o_mi_playlist;
176     IBOutlet id o_mi_messages;
177     IBOutlet id o_mi_bring_atf;
178     
179     IBOutlet id o_mu_help;
180     IBOutlet id o_mi_readme;
181     IBOutlet id o_mi_reportabug;
182     IBOutlet id o_mi_website;
183     IBOutlet id o_mi_license;
184
185     /* dock menu */
186     IBOutlet id o_dmi_play;
187     IBOutlet id o_dmi_stop;
188 }
189
190 - (void)terminate;
191
192 - (void)manage;
193 - (void)manageMode;
194 - (void)setControlItems;
195
196 - (void)setupMenus;
197 - (void)setupLangMenu:(NSMenuItem *)o_mi
198                       es:(es_descriptor_t *)p_es
199                       category:(int)i_cat
200                       selector:(SEL)pf_callback;
201 - (void)setupVarMenu:(NSMenuItem *)o_mi
202                      target:(vlc_object_t *)p_object
203                      var:(const char *)psz_var
204                      selector:(SEL)pf_callback;
205
206 - (IBAction)clearRecentItems:(id)sender;
207 - (void)openRecentItem:(id)sender;
208
209 - (IBAction)viewPreferences:(id)sender;
210
211 - (IBAction)timesliderUpdate:(id)sender;
212 - (void)displayTime;
213
214 - (IBAction)closeError:(id)sender;
215
216 - (IBAction)openReadMe:(id)sender;
217 - (IBAction)reportABug:(id)sender;
218 - (IBAction)openWebsite:(id)sender;
219 - (IBAction)openLicense:(id)sender;
220
221 @end
222
223 @interface VLCMain (Internal)
224 - (void)handlePortMessage:(NSPortMessage *)o_msg;
225 @end