]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
* core/playlist: PLAYLIST_PAUSE, playlist_IsPlaying, playlist_IsEmpty
[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.19 2003/01/29 11:34:11 jlj 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_playing;
61     vlc_bool_t b_stopping;
62     vlc_bool_t b_mute;
63
64     /* menus handlers */
65     vlc_bool_t b_chapter_update;
66     vlc_bool_t b_program_update;
67     vlc_bool_t b_title_update;
68     vlc_bool_t b_audio_update;
69     vlc_bool_t b_spu_update;
70     vlc_bool_t b_aout_update;
71     vlc_bool_t b_vout_update;
72
73     /* The input thread */
74     input_thread_t * p_input;
75
76     /* The messages window */
77     msg_subscription_t * p_sub;
78
79     /* DVD mode */
80     unsigned int i_part;
81 };
82
83 /*****************************************************************************
84  * VLCMain interface 
85  *****************************************************************************/
86 @interface VLCMain : NSObject
87 {
88     id o_prefs;                 /* VLCPrefs       */
89
90     IBOutlet id o_window;       /* main window    */
91     IBOutlet id o_timefield;    /* time field     */
92     IBOutlet id o_timeslider;   /* time slider    */
93     float f_slider;             /* slider value   */
94     float f_slider_old;         /* old slider val */ 
95     IBOutlet id o_volumeslider; /* volume slider  */
96
97     IBOutlet id o_btn_playlist; /* btn playlist   */
98     IBOutlet id o_btn_prev;     /* btn previous   */
99     IBOutlet id o_btn_slowmotion;   /* btn slowmotion     */
100     IBOutlet id o_btn_play;     /* btn play       */
101     IBOutlet id o_btn_stop;     /* btn stop       */
102     IBOutlet id o_btn_fastforward;   /* btn fastforward     */
103     IBOutlet id o_btn_next;     /* btn next       */
104     IBOutlet id o_btn_prefs;    /* btn prefs      */
105
106     IBOutlet id o_controls;     /* VLCControls    */
107     IBOutlet id o_playlist;     /* VLCPlaylist    */
108
109     IBOutlet id o_messages;     /* messages tv    */
110     IBOutlet id o_msgs_panel;   /* messages panel */
111     IBOutlet id o_msgs_btn_ok;  /* messages btn   */
112     NSMutableArray * o_msg_arr; /* messages array */
113     NSLock * o_msg_lock;        /* messages lock  */
114
115     IBOutlet id o_error;        /* error panel    */
116     IBOutlet id o_err_msg;      /* NSTextView     */
117     IBOutlet id o_err_lbl;
118     IBOutlet id o_err_bug_lbl;
119     IBOutlet id o_err_btn_msgs; /* Open Messages  */
120     IBOutlet id o_err_btn_dismiss;
121
122     /* main menu */
123
124     IBOutlet id o_mi_about;
125     IBOutlet id o_mi_prefs;
126     IBOutlet id o_mi_hide;
127     IBOutlet id o_mi_hide_others;
128     IBOutlet id o_mi_show_all;
129     IBOutlet id o_mi_quit;
130
131     IBOutlet id o_mu_file;
132     IBOutlet id o_mi_open_file;
133     IBOutlet id o_mi_open_generic;
134     IBOutlet id o_mi_open_disc;
135     IBOutlet id o_mi_open_net;
136     IBOutlet id o_mi_open_recent;
137     IBOutlet id o_mi_open_recent_cm;
138
139     IBOutlet id o_mu_edit;
140     IBOutlet id o_mi_cut;
141     IBOutlet id o_mi_copy;
142     IBOutlet id o_mi_paste;
143     IBOutlet id o_mi_clear;
144     IBOutlet id o_mi_select_all;
145
146     IBOutlet id o_mu_controls;
147     IBOutlet id o_mi_play;
148     IBOutlet id o_mi_stop;
149     IBOutlet id o_mi_faster;
150     IBOutlet id o_mi_slower;
151     IBOutlet id o_mi_previous;
152     IBOutlet id o_mi_next;
153     IBOutlet id o_mi_loop;
154     IBOutlet id o_mi_program;
155     IBOutlet id o_mi_title;
156     IBOutlet id o_mi_chapter;
157     IBOutlet id o_mi_language;
158     IBOutlet id o_mi_subtitle;
159
160     IBOutlet id o_mu_audio;
161     IBOutlet id o_mi_vol_up;
162     IBOutlet id o_mi_vol_down;
163     IBOutlet id o_mi_mute;
164     IBOutlet id o_mi_channels;
165     IBOutlet id o_mi_device;
166
167     IBOutlet id o_mu_video;
168     IBOutlet id o_mi_fullscreen;
169     IBOutlet id o_mi_screen;
170     IBOutlet id o_mi_deinterlace;
171
172     IBOutlet id o_mu_window;
173     IBOutlet id o_mi_minimize;
174     IBOutlet id o_mi_close_window;
175     IBOutlet id o_mi_controller;
176     IBOutlet id o_mi_playlist;
177     IBOutlet id o_mi_messages;
178     IBOutlet id o_mi_bring_atf;
179     
180     IBOutlet id o_mu_help;
181     IBOutlet id o_mi_readme;
182     IBOutlet id o_mi_reportabug;
183     IBOutlet id o_mi_website;
184     IBOutlet id o_mi_license;
185
186     /* dock menu */
187     IBOutlet id o_dmi_play;
188     IBOutlet id o_dmi_stop;
189 }
190
191 - (void)terminate;
192
193 - (void)manage;
194 - (void)manageMode;
195 - (void)setControlItems;
196
197 - (void)setupMenus;
198 - (void)setupLangMenu:(NSMenuItem *)o_mi
199                       es:(es_descriptor_t *)p_es
200                       category:(int)i_cat
201                       selector:(SEL)pf_callback;
202 - (void)setupVarMenu:(NSMenuItem *)o_mi
203                      target:(vlc_object_t *)p_object
204                      var:(const char *)psz_var
205                      selector:(SEL)pf_callback;
206
207 - (IBAction)clearRecentItems:(id)sender;
208 - (void)openRecentItem:(id)sender;
209
210 - (IBAction)viewPreferences:(id)sender;
211
212 - (IBAction)timesliderUpdate:(id)sender;
213 - (void)displayTime;
214
215 - (IBAction)closeError:(id)sender;
216
217 - (IBAction)openReadMe:(id)sender;
218 - (IBAction)reportABug:(id)sender;
219 - (IBAction)openWebsite:(id)sender;
220 - (IBAction)openLicense:(id)sender;
221
222 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
223
224 @end
225
226 @interface VLCMain (Internal)
227 - (void)handlePortMessage:(NSPortMessage *)o_msg;
228 @end