]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs.h
* src/extras/libc.c: New vlc_wraptext function,
[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.2 2003/02/08 22:20:28 massiot 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 #define PREFS_WRAP 60
25
26 /*****************************************************************************
27  * VLCPrefs interface
28  *****************************************************************************/
29 @interface VLCPrefs : NSObject
30 {
31     intf_thread_t *p_intf;
32
33     NSMutableDictionary *o_pref_panels;
34     NSMutableDictionary *o_toolbars;
35     NSMutableDictionary *o_scroll_views;
36     NSMutableDictionary *o_panel_views;
37     NSMutableDictionary *o_save_prefs;
38 }
39
40 - (BOOL)hasPrefs:(NSString *)o_module_name;
41 - (void)createPrefPanel:(NSString *)o_module_name;
42 - (void)destroyPrefPanel:(id)o_unknown;
43 - (void)selectPrefView:(id)sender;
44
45 - (void)moduleSelected:(id)sender;
46 - (void)configureModule:(id)sender;
47 - (void)selectModule:(id)sender;
48
49 - (void)configChanged:(id)o_unknown;
50
51 - (void)clickedApply:(id)sender;
52 - (void)clickedCancelOK:(id)sender;
53
54 @end
55
56 @interface VLCFlippedView : NSView
57 {
58
59 }
60
61 @end
62
63 #define INTF_CONTROL_CONFIG(x) \
64 @interface VLC##x : NS##x \
65 { \
66     NSString *o_module_name; \
67     NSString *o_config_name; \
68     int i_config_type; \
69 } \
70 - (void)setModuleName:(NSString *)_o_module_name; \
71 - (void)setConfigName:(NSString *)_o_config_name; \
72 - (void)setConfigType:(int)_i_config_type; \
73 - (NSString *)moduleName; \
74 - (NSString *)configName; \
75 - (int)configType; \
76 @end
77
78 #define IMPL_CONTROL_CONFIG(x) \
79 @implementation VLC##x \
80 - (id)init \
81 { \
82     self = [super init]; \
83     if( self != nil ) \
84     { \
85         o_module_name = nil; \
86         o_config_name = nil; \
87         i_config_type = 0; \
88     } \
89     return( self ); \
90 } \
91 - (void)dealloc \
92 { \
93     if( o_module_name != nil ) \
94     { \
95         [o_module_name release]; \
96     } \
97     if( o_config_name != nil ) \
98     { \
99         [o_config_name release]; \
100     } \
101     [super dealloc]; \
102 } \
103 - (void)setModuleName:(NSString *)_o_module_name \
104 { \
105     if( o_module_name != nil ) \
106     { \
107         [o_module_name release]; \
108     } \
109     o_module_name = [_o_module_name retain]; \
110 } \
111 - (void)setConfigName:(NSString *)_o_config_name \
112 { \
113     if( o_config_name != nil ) \
114     { \
115         [o_config_name release]; \
116     } \
117     o_config_name = [_o_config_name retain]; \
118 } \
119 - (void)setConfigType:(int)_i_config_type \
120 { \
121     i_config_type = _i_config_type; \
122 } \
123 - (NSString *)moduleName \
124 { \
125     return( o_module_name ); \
126 } \
127 - (NSString *)configName \
128 { \
129     return( o_config_name ); \
130 } \
131 - (int)configType \
132 { \
133     return( i_config_type ); \
134 } \
135 @end
136
137 INTF_CONTROL_CONFIG(Button);
138 INTF_CONTROL_CONFIG(ComboBox);
139 INTF_CONTROL_CONFIG(TextField);
140
141 #define CONTROL_CONFIG( obj, mname, ctype, cname ) \
142     { \
143         [obj setModuleName: mname]; \
144         [obj setConfigType: ctype]; \
145         [obj setConfigName: [NSString stringWithCString: cname]]; \
146     }
147