]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
* Bumped up revision number to 0.5.0-test2,
[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.12 2003/01/06 22:07:47 massiot Exp $
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Christophe Massiot <massiot@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  * 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #include <vlc/vlc.h>
26 #include <vlc/intf.h>
27 #include <vlc/vout.h>
28
29 #include <Cocoa/Cocoa.h>
30
31 /*****************************************************************************
32  * VLCApplication interface 
33  *****************************************************************************/
34 @interface VLCApplication : NSApplication
35 {
36     NSStringEncoding i_encoding;
37     intf_thread_t *p_intf;
38 }
39
40 - (void)initIntlSupport;
41 - (NSString *)localizedString:(char *)psz;
42
43 - (void)setIntf:(intf_thread_t *)p_intf;
44 - (intf_thread_t *)getIntf;
45
46 @end
47
48 #define _NS(s) [NSApp localizedString: _(s)]
49
50 /*****************************************************************************
51  * intf_sys_t: description and status of the interface
52  *****************************************************************************/
53 struct intf_sys_t
54 {
55     NSAutoreleasePool * o_pool;
56     NSPort * o_sendport;
57
58     /* special actions */
59     vlc_bool_t b_loop;
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     NSLock * o_slider_lock;     /* slider lock    */
94     float f_slider;             /* slider value   */
95     float f_slider_old;         /* old slider val */ 
96
97     IBOutlet id o_btn_playlist; /* btn playlist   */
98     IBOutlet id o_btn_prev;     /* btn previous   */
99     IBOutlet id o_btn_slower;   /* btn slower     */
100     IBOutlet id o_btn_play;     /* btn play       */
101     IBOutlet id o_btn_pause;    /* btn pause      */
102     IBOutlet id o_btn_stop;     /* btn stop       */
103     IBOutlet id o_btn_faster;   /* btn faster     */
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_view;
146     IBOutlet id o_mi_playlist;
147     IBOutlet id o_mi_messages;
148
149     IBOutlet id o_mu_controls;
150     IBOutlet id o_mi_play;
151     IBOutlet id o_mi_pause;
152     IBOutlet id o_mi_stop;
153     IBOutlet id o_mi_faster;
154     IBOutlet id o_mi_slower;
155     IBOutlet id o_mi_previous;
156     IBOutlet id o_mi_next;
157     IBOutlet id o_mi_loop;
158     IBOutlet id o_mi_vol_up;
159     IBOutlet id o_mi_vol_down;
160     IBOutlet id o_mi_mute;
161     IBOutlet id o_mi_channels;
162     IBOutlet id o_mi_device;
163     IBOutlet id o_mi_fullscreen;
164     IBOutlet id o_mi_screen;
165     IBOutlet id o_mi_deinterlace;
166     IBOutlet id o_mi_program;
167     IBOutlet id o_mi_title;
168     IBOutlet id o_mi_chapter;
169     IBOutlet id o_mi_language;
170     IBOutlet id o_mi_subtitle;
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_bring_atf;
176
177     /* dock menu */
178     IBOutlet id o_dmi_play;
179     IBOutlet id o_dmi_pause;
180     IBOutlet id o_dmi_stop;
181 }
182
183 - (void)terminate;
184
185 - (void)manage;
186 - (void)manageMode;
187
188 - (void)setupMenus;
189 - (void)setupLangMenu:(NSMenuItem *)o_mi
190                       es:(es_descriptor_t *)p_es
191                       category:(int)i_cat
192                       selector:(SEL)pf_callback;
193 - (void)setupVarMenu:(NSMenuItem *)o_mi
194                      target:(vlc_object_t *)p_object
195                      var:(const char *)psz_var
196                      selector:(SEL)pf_callback;
197
198 - (IBAction)clearRecentItems:(id)sender;
199 - (void)openRecentItem:(id)sender;
200
201 - (IBAction)viewPreferences:(id)sender;
202
203 - (IBAction)timesliderUpdate:(id)sender;
204 - (void)displayTime;
205
206 - (IBAction)closeError:(id)sender;
207
208 @end
209
210 @interface VLCMain (Internal)
211 - (void)handlePortMessage:(NSPortMessage *)o_msg;
212 @end