]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs.h
* ./modules/gui/macosx/prefs.m: new configuration interface
[vlc] / modules / gui / macosx / prefs.h
1 /*****************************************************************************
2  * prefs.h: MacOS X plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2002 VideoLAN
5  * $Id: prefs.h,v 1.1 2002/11/05 03:57:16 jlj Exp $
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * VLCPrefs interface
26  *****************************************************************************/
27 @interface VLCPrefs : NSObject
28 {
29     intf_thread_t *p_intf;
30
31     NSMutableDictionary *o_pref_panels;
32     NSMutableDictionary *o_toolbars;
33     NSMutableDictionary *o_scroll_views;
34     NSMutableDictionary *o_panel_views;
35     NSMutableDictionary *o_save_prefs;
36 }
37
38 - (BOOL)hasPrefs:(NSString *)o_module_name;
39 - (void)createPrefPanel:(NSString *)o_module_name;
40 - (void)destroyPrefPanel:(id)o_unknown;
41 - (void)selectPrefView:(id)sender;
42
43 - (void)moduleSelected:(id)sender;
44 - (void)configureModule:(id)sender;
45 - (void)selectModule:(id)sender;
46
47 - (void)configChanged:(id)o_unknown;
48
49 - (void)clickedApply:(id)sender;
50 - (void)clickedCancelOK:(id)sender;
51
52 @end
53
54 @interface VLCFlippedView : NSView
55 {
56
57 }
58
59 @end
60
61 #define INTF_CONTROL_CONFIG(x) \
62 @interface VLC##x : NS##x \
63 { \
64     NSString *o_module_name; \
65     NSString *o_config_name; \
66     int i_config_type; \
67 } \
68 - (void)setModuleName:(NSString *)_o_module_name; \
69 - (void)setConfigName:(NSString *)_o_config_name; \
70 - (void)setConfigType:(int)_i_config_type; \
71 - (NSString *)moduleName; \
72 - (NSString *)configName; \
73 - (int)configType; \
74 @end
75
76 #define IMPL_CONTROL_CONFIG(x) \
77 @implementation VLC##x \
78 - (id)init \
79 { \
80     self = [super init]; \
81     if( self != nil ) \
82     { \
83         o_module_name = nil; \
84         o_config_name = nil; \
85         i_config_type = 0; \
86     } \
87     return( self ); \
88 } \
89 - (void)dealloc \
90 { \
91     if( o_module_name != nil ) \
92     { \
93         [o_module_name release]; \
94     } \
95     if( o_config_name != nil ) \
96     { \
97         [o_config_name release]; \
98     } \
99     [super dealloc]; \
100 } \
101 - (void)setModuleName:(NSString *)_o_module_name \
102 { \
103     if( o_module_name != nil ) \
104     { \
105         [o_module_name release]; \
106     } \
107     o_module_name = [_o_module_name retain]; \
108 } \
109 - (void)setConfigName:(NSString *)_o_config_name \
110 { \
111     if( o_config_name != nil ) \
112     { \
113         [o_config_name release]; \
114     } \
115     o_config_name = [_o_config_name retain]; \
116 } \
117 - (void)setConfigType:(int)_i_config_type \
118 { \
119     i_config_type = _i_config_type; \
120 } \
121 - (NSString *)moduleName \
122 { \
123     return( o_module_name ); \
124 } \
125 - (NSString *)configName \
126 { \
127     return( o_config_name ); \
128 } \
129 - (int)configType \
130 { \
131     return( i_config_type ); \
132 } \
133 @end
134
135 INTF_CONTROL_CONFIG(Button);
136 INTF_CONTROL_CONFIG(ComboBox);
137 INTF_CONTROL_CONFIG(TextField);
138
139 #define CONTROL_CONFIG( obj, mname, ctype, cname ) \
140     { \
141         [obj setModuleName: mname]; \
142         [obj setConfigType: ctype]; \
143         [obj setConfigName: [NSString stringWithCString: cname]]; \
144     }
145