1 /*****************************************************************************
2 * prefs.m: MacOS X plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: prefs.m,v 1.6 2003/01/05 16:23:57 massiot Exp $
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
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.
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.
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 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <stdlib.h> /* malloc(), free() */
28 #include <sys/param.h> /* for MAXPATHLEN */
31 #import <Cocoa/Cocoa.h>
39 /*****************************************************************************
40 * VLCPrefs implementation
41 *****************************************************************************/
42 @implementation VLCPrefs
50 p_intf = [NSApp getIntf];
52 o_pref_panels = [[NSMutableDictionary alloc] init];
53 o_toolbars = [[NSMutableDictionary alloc] init];
54 o_scroll_views = [[NSMutableDictionary alloc] init];
55 o_panel_views = [[NSMutableDictionary alloc] init];
56 o_save_prefs = [[NSMutableDictionary alloc] init];
68 #define DIC_REL1(o_dic) \
70 o_e1 = [o_dic objectEnumerator]; \
71 while( (v1 = [o_e1 nextObject]) ) \
75 [o_dic removeAllObjects]; \
79 #define DIC_REL2(o_dic) \
81 o_e2 = [o_dic objectEnumerator]; \
82 while( (v2 = [o_e2 nextObject]) ) \
86 [o_dic removeAllObjects]; \
89 DIC_REL1(o_pref_panels);
91 DIC_REL1(o_scroll_views);
92 DIC_REL2(o_panel_views);
93 DIC_REL1(o_save_prefs);
101 - (BOOL)hasPrefs:(NSString *)o_module_name
105 char *psz_module_name;
108 psz_module_name = (char *)[o_module_name lossyCString];
110 /* look for module */
111 list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
113 for( i_index = 0; i_index < list.i_count; i_index++ )
115 p_parser = (module_t *)list.p_values[i_index].p_object ;
117 if( !strcmp( p_parser->psz_object_name, psz_module_name ) )
119 BOOL b_has_prefs = p_parser->i_config_items != 0;
120 vlc_list_release( &list );
121 return( b_has_prefs );
125 vlc_list_release( &list );
130 - (void)createPrefPanel:(NSString *)o_module_name
135 module_t *p_parser = NULL;
137 module_config_t *p_item;
138 char *psz_module_name;
141 NSPanel *o_panel; /* panel */
142 NSRect s_panel_rc; /* panel rect */
143 NSView *o_panel_view; /* panel view */
144 NSToolbar *o_toolbar; /* panel toolbar */
145 NSMutableDictionary *o_tb_items; /* panel toolbar items */
146 NSScrollView *o_scroll_view; /* panel scroll view */
147 NSRect s_scroll_rc; /* panel scroll view rect */
148 NSMutableDictionary *o_views; /* panel scroll view docviews */
150 NSRect s_rc; /* rect */
151 NSView *o_view; /* view */
152 NSRect s_vrc; /* view rect */
153 NSButton *o_button; /* button */
154 NSRect s_brc; /* button rect */
155 VLCTextField *o_text_field; /* input field / label */
157 o_panel = [o_pref_panels objectForKey: o_module_name];
161 [o_panel makeKeyAndOrderFront: nil];
165 psz_module_name = (char *)[o_module_name lossyCString];
167 /* Look for the selected module */
168 list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
170 for( i_index = 0; i_index < list.i_count; i_index++ )
172 p_parser = (module_t *)list.p_values[i_index].p_object ;
175 && !strcmp( psz_module_name, p_parser->psz_object_name ) )
181 if( !p_parser || i_index == list.i_count )
183 vlc_list_release( &list );
187 /* We found it, now we can start building its configuration interface */
189 s_panel_rc = NSMakeRect( 0, 0, 450, 450 );
190 o_panel = [[NSPanel alloc] initWithContentRect: s_panel_rc
191 styleMask: NSTitledWindowMask
192 backing: NSBackingStoreBuffered
194 o_toolbar = [[NSToolbar alloc] initWithIdentifier: o_module_name];
195 [o_panel setTitle: [NSString stringWithFormat: @"%@ (%@)",
196 _NS("Preferences"), o_module_name]];
197 o_panel_view = [o_panel contentView];
199 s_scroll_rc = s_panel_rc;
200 s_scroll_rc.size.height -= 55; s_scroll_rc.origin.y += 55;
201 o_scroll_view = [[NSScrollView alloc] initWithFrame: s_scroll_rc];
202 [o_scroll_views setObject: o_scroll_view forKey: o_module_name];
203 [o_scroll_view setBorderType: NSGrooveBorder];
204 [o_scroll_view setHasVerticalScroller: YES];
205 [o_scroll_view setDrawsBackground: NO];
206 [o_scroll_view setRulersVisible: YES];
207 [o_panel_view addSubview: o_scroll_view];
209 o_tb_items = [[NSMutableDictionary alloc] init];
210 o_views = [[NSMutableDictionary alloc] init];
212 [o_save_prefs setObject: [[NSMutableArray alloc] init]
213 forKey: o_module_name];
215 /* Enumerate config options and add corresponding config boxes */
216 p_item = p_parser->p_config;
223 #define Y_ORIGIN (X_ORIGIN - 10)
225 #define CHECK_VIEW_HEIGHT \
227 float f_new_pos = s_rc.origin.y + s_rc.size.height + X_ORIGIN; \
228 if( f_new_pos > s_vrc.size.height ) \
230 s_vrc.size.height = f_new_pos; \
231 [o_view setFrame: s_vrc]; \
235 #define CONTROL_LABEL( label ) \
237 s_rc.origin.x += s_rc.size.width + 10; \
238 s_rc.size.width = s_vrc.size.width - s_rc.origin.x - X_ORIGIN - 20; \
239 o_text_field = [[NSTextField alloc] initWithFrame: s_rc]; \
240 [o_text_field setDrawsBackground: NO]; \
241 [o_text_field setBordered: NO]; \
242 [o_text_field setEditable: NO]; \
243 [o_text_field setSelectable: NO]; \
244 [o_text_field setStringValue: \
245 [NSApp localizedString: label]]; \
246 [o_view addSubview: [o_text_field autorelease]]; \
249 #define INPUT_FIELD( ctype, cname, label, w, msg, param, tip ) \
251 s_rc.size.height = 25; \
252 s_rc.size.width = w; \
253 s_rc.origin.y += 10; \
255 o_text_field = [[VLCTextField alloc] initWithFrame: s_rc]; \
256 [o_text_field setAlignment: NSRightTextAlignment]; \
257 CONTROL_CONFIG( o_text_field, o_module_name, ctype, cname ); \
258 [o_text_field msg: param]; \
259 [o_text_field setToolTip: [NSApp localizedString: tip]]; \
260 [o_view addSubview: [o_text_field autorelease]]; \
261 [[NSNotificationCenter defaultCenter] addObserver: self \
262 selector: @selector(configChanged:) \
263 name: NSControlTextDidChangeNotification \
264 object: o_text_field]; \
265 CONTROL_LABEL( label ); \
266 s_rc.origin.y += s_rc.size.height; \
267 s_rc.origin.x = X_ORIGIN; \
270 #define INPUT_FIELD_INTEGER( name, label, w, param, tip ) \
271 INPUT_FIELD( CONFIG_ITEM_INTEGER, name, label, w, setIntValue, param, tip )
272 #define INPUT_FIELD_FLOAT( name, label, w, param, tip ) \
273 INPUT_FIELD( CONFIG_ITEM_FLOAT, name, label, w, setFloatValue, param, tip )
274 #define INPUT_FIELD_STRING( name, label, w, param, tip ) \
275 INPUT_FIELD( CONFIG_ITEM_STRING, name, label, w, setStringValue, param, tip )
280 switch( p_item->i_type )
283 case CONFIG_HINT_CATEGORY:
287 NSToolbarItem *o_tbi;
289 o_label = [NSApp localizedString: p_item->psz_text];
290 o_tbi = [[NSToolbarItem alloc] initWithItemIdentifier: o_label];
291 [o_tbi setImage: [NSImage imageNamed: @"NSApplicationIcon"]];
292 [o_tbi setLabel: o_label];
293 [o_tbi setTarget: self];
294 [o_tbi setAction: @selector(selectPrefView:)];
296 o_key = [NSString stringWithFormat: @"%02d %@",
298 [o_tb_items setObject: o_tbi forKey: o_key];
300 s_vrc = s_scroll_rc; s_vrc.size.height -= 4;
301 o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
302 [o_views setObject: o_view forKey: o_label];
304 s_rc.origin.x = X_ORIGIN;
305 s_rc.origin.y = Y_ORIGIN;
311 [o_scroll_view setDocumentView: o_view];
318 case CONFIG_ITEM_MODULE:
323 NSPopUpButton *o_modules;
324 NSButton *o_btn_select;
325 NSButton *o_btn_configure;
327 #define MODULE_BUTTON( button, title, sel ) \
329 s_brc.size.height = 32; \
330 s_brc.origin.x += s_brc.size.width + 10; \
331 s_brc.size.width = s_crc.size.width - s_brc.origin.x - 10; \
332 button = [[NSButton alloc] initWithFrame: s_brc]; \
333 [button setButtonType: NSMomentaryPushInButton]; \
334 [button setBezelStyle: NSRoundedBezelStyle]; \
335 [button setTitle: title]; \
336 [button setTag: i_module_tag++]; \
337 [button setTarget: self]; \
338 [button setAction: @selector(sel)]; \
339 [o_cview addSubview: [button autorelease]]; \
342 s_rc.size.height = 107;
343 s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
344 s_rc.origin.y += i_module_tag == 3 ? Y_ORIGIN : 20;
348 o_box = [[NSBox alloc] initWithFrame: s_rc];
349 [o_box setTitle: [NSApp localizedString: p_item->psz_text]];
350 [o_view addSubview: [o_box autorelease]];
351 s_rc.origin.y += s_rc.size.height + 10;
352 o_cview = [[VLCFlippedView alloc] initWithFrame: s_rc];
353 [o_box setContentView: [o_cview autorelease]];
354 s_crc = [o_cview bounds];
356 s_brc = NSMakeRect( 5, 10, 200, 30 );
357 o_modules = [[NSPopUpButton alloc] initWithFrame: s_brc];
358 [o_modules setTag: i_module_tag++];
359 [o_modules setTarget: self];
360 [o_modules setAction: @selector(moduleSelected:)];
361 [o_modules setToolTip: [NSApp localizedString: p_item->psz_longtext]];
362 [o_cview addSubview: [o_modules autorelease]];
364 MODULE_BUTTON( o_btn_configure, _NS("Configure"),
367 s_brc = NSMakeRect( 8, s_brc.origin.y + s_brc.size.height + 10,
369 o_text_field = [[VLCTextField alloc] initWithFrame: s_brc];
370 [o_text_field setTag: i_module_tag++];
371 [o_text_field setAlignment: NSLeftTextAlignment];
372 CONTROL_CONFIG( o_text_field, o_module_name,
373 CONFIG_ITEM_MODULE, p_item->psz_name );
374 [[NSNotificationCenter defaultCenter] addObserver: self
375 selector: @selector(configChanged:)
376 name: NSControlTextDidChangeNotification
377 object: o_text_field];
378 [o_cview addSubview: [o_text_field autorelease]];
381 MODULE_BUTTON( o_btn_select, _NS("Select"),
384 [o_modules addItemWithTitle: _NS("None")];
386 /* build a list of available modules */
388 for( i_index = 0; i_index < list.i_count; i_index++ )
390 p_parser = (module_t *)list.p_values[i_index].p_object ;
392 if( !strcmp( p_parser->psz_capability,
395 NSString *o_object_name = [NSString
396 stringWithCString: p_parser->psz_object_name];
397 [o_modules addItemWithTitle: o_object_name];
402 if( p_item->psz_value != NULL )
405 [NSString stringWithCString: p_item->psz_value];
407 [o_text_field setStringValue: o_value];
408 [o_modules selectItemWithTitle: o_value];
409 [o_btn_configure setEnabled: [self hasPrefs: o_value]];
413 [o_modules selectItemWithTitle: _NS("None")];
414 [o_btn_configure setEnabled: NO];
421 case CONFIG_ITEM_STRING:
422 case CONFIG_ITEM_FILE:
425 if( !p_item->ppsz_list )
427 char *psz_value = p_item->psz_value ?
428 p_item->psz_value : "";
430 INPUT_FIELD_STRING( p_item->psz_name, p_item->psz_text, 150,
431 [NSString stringWithCString: psz_value],
432 p_item->psz_longtext );
437 VLCComboBox *o_combo_box;
439 s_rc.size.height = 27;
440 s_rc.size.width = 150;
445 o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
446 CONTROL_CONFIG( o_combo_box, o_module_name,
447 CONFIG_ITEM_STRING, p_item->psz_name );
448 [o_combo_box setToolTip:
449 [NSApp localizedString: p_item->psz_longtext]];
450 [o_view addSubview: [o_combo_box autorelease]];
451 [[NSNotificationCenter defaultCenter] addObserver: self
452 selector: @selector(configChanged:)
453 name: NSControlTextDidChangeNotification
454 object: o_combo_box];
455 [[NSNotificationCenter defaultCenter] addObserver: self
456 selector: @selector(configChanged:)
457 name: NSComboBoxSelectionDidChangeNotification
458 object: o_combo_box];
460 for( i=0; p_item->ppsz_list[i]; i++ )
462 [o_combo_box addItemWithObjectValue:
463 [NSString stringWithCString: p_item->ppsz_list[i]]];
466 CONTROL_LABEL( p_item->psz_text );
468 s_rc.origin.y += s_rc.size.height;
469 s_rc.origin.x = X_ORIGIN;
475 case CONFIG_ITEM_INTEGER:
477 INPUT_FIELD_INTEGER( p_item->psz_name, p_item->psz_text, 70,
478 p_item->i_value, p_item->psz_longtext );
482 case CONFIG_ITEM_FLOAT:
484 INPUT_FIELD_FLOAT( p_item->psz_name, p_item->psz_text, 70,
485 p_item->f_value, p_item->psz_longtext );
489 case CONFIG_ITEM_BOOL:
491 VLCButton *o_btn_bool;
493 s_rc.size.height = 27;
494 s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2 - 20;
499 o_btn_bool = [[VLCButton alloc] initWithFrame: s_rc];
500 [o_btn_bool setButtonType: NSSwitchButton];
501 [o_btn_bool setIntValue: p_item->i_value];
502 [o_btn_bool setTitle:
503 [NSApp localizedString: p_item->psz_text]];
504 [o_btn_bool setToolTip:
505 [NSApp localizedString: p_item->psz_longtext]];
506 [o_btn_bool setTarget: self];
507 [o_btn_bool setAction: @selector(configChanged:)];
508 CONTROL_CONFIG( o_btn_bool, o_module_name,
509 CONFIG_ITEM_BOOL, p_item->psz_name );
510 [o_view addSubview: [o_btn_bool autorelease]];
512 s_rc.origin.y += s_rc.size.height;
518 #undef INPUT_FIELD_INTEGER
519 #undef INPUT_FIELD_FLOAT
520 #undef INPUT_FIELD_STRING
522 #undef CHECK_VIEW_HEIGHT
527 while( p_item->i_type != CONFIG_HINT_END && p_item++ );
529 vlc_list_release( &list );
531 [o_toolbars setObject: o_tb_items forKey: o_module_name];
532 [o_toolbar setDelegate: self];
533 [o_panel setToolbar: [o_toolbar autorelease]];
535 #define DEF_PANEL_BUTTON( tag, title, sel ) \
537 o_button = [[NSButton alloc] initWithFrame: s_rc]; \
538 [o_button setButtonType: NSMomentaryPushInButton]; \
539 [o_button setBezelStyle: NSRoundedBezelStyle]; \
540 [o_button setAction: @selector(sel)]; \
541 [o_button setTarget: self]; \
542 [o_button setTitle: title]; \
543 [o_button setTag: tag]; \
544 [o_panel_view addSubview: [o_button autorelease]]; \
547 s_rc.origin.y = s_panel_rc.origin.y + 14;
548 s_rc.size.height = 25; s_rc.size.width = 100;
549 s_rc.origin.x = s_panel_rc.size.width - s_rc.size.width - 14;
550 DEF_PANEL_BUTTON( 0, _NS("OK"), clickedCancelOK: );
551 [o_panel setDefaultButtonCell: [o_button cell]];
553 s_rc.origin.x -= s_rc.size.width;
554 DEF_PANEL_BUTTON( 1, _NS("Cancel"), clickedCancelOK: );
555 [o_button setKeyEquivalent: @"\E"];
557 s_rc.origin.x -= s_rc.size.width;
558 DEF_PANEL_BUTTON( 2, _NS("Apply"), clickedApply: );
559 [o_button setEnabled: NO];
561 #undef DEF_PANEL_BUTTON
563 [o_pref_panels setObject: o_panel forKey: o_module_name];
564 [o_panel_views setObject: o_views forKey: o_module_name];
567 [o_panel makeKeyAndOrderFront: nil];
570 - (void)destroyPrefPanel:(id)o_unknown
575 NSMutableArray *o_prefs;
576 NSMutableDictionary *o_dic;
577 NSScrollView *o_scroll_view;
578 NSString *o_module_name;
580 o_module_name = (NSString *)([o_unknown isKindOfClass: [NSTimer class]] ?
581 [o_unknown userInfo] : o_unknown);
583 #define DIC_REL(dic) \
585 o_dic = [dic objectForKey: o_module_name]; \
586 [dic removeObjectForKey: o_module_name]; \
587 o_e1 = [o_dic objectEnumerator]; \
588 while( (v1 = [o_e1 nextObject]) ) \
592 [o_dic removeAllObjects]; \
596 o_panel = [o_pref_panels objectForKey: o_module_name];
597 [o_pref_panels removeObjectForKey: o_module_name];
602 o_scroll_view = [o_scroll_views objectForKey: o_module_name];
603 [o_scroll_views removeObjectForKey: o_module_name];
604 [o_scroll_view release];
606 DIC_REL(o_panel_views);
608 o_prefs = [o_save_prefs objectForKey: o_module_name];
609 [o_save_prefs removeObjectForKey: o_module_name];
610 [o_prefs removeAllObjects];
617 - (void)selectPrefView:(id)sender
620 NSString *o_module_name;
621 NSScrollView *o_scroll_view;
622 NSMutableDictionary *o_views;
624 o_module_name = [[sender toolbar] identifier];
625 o_views = [o_panel_views objectForKey: o_module_name];
626 o_view = [o_views objectForKey: [sender label]];
628 o_scroll_view = [o_scroll_views objectForKey: o_module_name];
629 [o_scroll_view setDocumentView: o_view];
632 - (void)moduleSelected:(id)sender
634 NSButton *o_btn_config;
635 NSString *o_module_name;
636 BOOL b_has_prefs = NO;
638 o_module_name = [sender titleOfSelectedItem];
639 o_btn_config = [[sender superview] viewWithTag: [sender tag] + 1];
641 if( ![o_module_name isEqualToString: _NS("None")] )
643 b_has_prefs = [self hasPrefs: o_module_name];
646 [o_btn_config setEnabled: b_has_prefs];
649 - (void)configureModule:(id)sender
651 NSString *o_module_name;
652 NSPopUpButton *o_modules;
654 o_modules = [[sender superview] viewWithTag: [sender tag] - 1];
655 o_module_name = [o_modules titleOfSelectedItem];
657 [self createPrefPanel: o_module_name];
660 - (void)selectModule:(id)sender
662 NSString *o_module_name;
663 NSPopUpButton *o_modules;
664 NSTextField *o_module;
666 o_module = [[sender superview] viewWithTag: [sender tag] - 1];
667 o_modules = [[sender superview] viewWithTag: [sender tag] - 3];
668 o_module_name = [o_modules titleOfSelectedItem];
670 if( [o_module_name isEqualToString: _NS("None")] )
672 o_module_name = [NSString string];
675 [o_module setStringValue: o_module_name];
676 [self configChanged: o_module];
679 - (void)configChanged:(id)o_unknown
681 id o_vlc_config = [o_unknown isKindOfClass: [NSNotification class]] ?
682 [o_unknown object] : o_unknown;
684 NSString *o_module_name = [o_vlc_config moduleName];
685 NSPanel *o_pref_panel = [o_pref_panels objectForKey: o_module_name];
686 NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
688 if( [o_prefs indexOfObjectIdenticalTo: o_vlc_config] == NSNotFound )
690 NSView *o_pref_view = [o_pref_panel contentView];
691 NSButton *o_btn_apply = [o_pref_view viewWithTag: 2];
693 [o_prefs addObject: o_vlc_config];
694 [o_btn_apply setEnabled: YES];
698 - (void)clickedApply:(id)sender
701 NSEnumerator *o_enum;
703 NSView *o_config_view = [sender superview];
704 NSWindow *o_config_panel = [o_config_view window];
705 NSButton *o_btn_apply = [o_config_view viewWithTag: 2];
706 NSString *o_module_name = [[o_config_panel toolbar] identifier];
707 NSMutableArray *o_prefs = [o_save_prefs objectForKey: o_module_name];
709 o_enum = [o_prefs objectEnumerator];
710 while( ( o_vlc_control = [o_enum nextObject] ) )
712 int i_type = [o_vlc_control configType];
713 NSString *o_name = [o_vlc_control configName];
714 char *psz_name = (char *)[o_name lossyCString];
719 case CONFIG_ITEM_MODULE:
720 case CONFIG_ITEM_STRING:
721 case CONFIG_ITEM_FILE:
726 o_value = [o_vlc_control stringValue];
727 psz_value = (char *)[o_value lossyCString];
729 config_PutPsz( p_intf, psz_name,
730 *psz_value ? psz_value : NULL );
734 case CONFIG_ITEM_INTEGER:
735 case CONFIG_ITEM_BOOL:
737 int i_value = [o_vlc_control intValue];
739 config_PutInt( p_intf, psz_name, i_value );
743 case CONFIG_ITEM_FLOAT:
745 float f_value = [o_vlc_control floatValue];
747 config_PutFloat( p_intf, psz_name, f_value );
754 [o_btn_apply setEnabled: NO];
755 [o_prefs removeAllObjects];
757 config_SaveConfigFile( p_intf, NULL );
760 - (void)clickedCancelOK:(id)sender
762 NSWindow *o_pref_panel = [[sender superview] window];
763 NSString *o_module_name = [[o_pref_panel toolbar] identifier];
765 if( [[sender title] isEqualToString: _NS("OK")] )
767 [self clickedApply: sender];
770 [o_pref_panel close];
772 if( [self respondsToSelector: @selector(performSelectorOnMainThread:
773 withObject:waitUntilDone:)] )
775 [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
776 withObject: o_module_name
781 [NSTimer scheduledTimerWithTimeInterval: 0.1
782 target: self selector: @selector(destroyPrefPanel:)
783 userInfo: o_module_name repeats: NO];
789 @implementation VLCPrefs (NSToolbarDelegate)
791 - (NSToolbarItem *)toolbar:(NSToolbar *)o_toolbar
792 itemForItemIdentifier:(NSString *)o_item_id
793 willBeInsertedIntoToolbar:(BOOL)b_flag
795 NSMutableDictionary *o_toolbar_items;
796 NSString *o_module_name = [o_toolbar identifier];
798 o_toolbar_items = [o_toolbars objectForKey: o_module_name];
799 if( o_toolbar_items == nil )
804 return( [o_toolbar_items objectForKey: o_item_id] );
807 - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)o_toolbar
809 return( [self toolbarDefaultItemIdentifiers: o_toolbar] );
812 - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)o_toolbar
815 NSMutableDictionary *o_toolbar_items;
816 NSString *o_module_name = [o_toolbar identifier];
818 o_toolbar_items = [o_toolbars objectForKey: o_module_name];
819 if( o_toolbar_items == nil )
824 o_ids = [[o_toolbar_items allKeys]
825 sortedArrayUsingSelector: @selector(compare:)];
832 @implementation VLCFlippedView
841 IMPL_CONTROL_CONFIG(Button);
842 IMPL_CONTROL_CONFIG(ComboBox);
843 IMPL_CONTROL_CONFIG(TextField);