1 /*****************************************************************************
2 * VLCPlaylistView.m: OutlineView subclass for the playlist
3 *****************************************************************************
4 * Copyright (C) 2003-2015 VLC authors and VideoLAN
7 * Authors: Derk-Jan Hartman <hartman at videola/n dot org>
8 * Benjamin Pracht <bigben at videolab dot org>
9 * Felix Paul Kühne <fkuehne at videolan dot org>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
27 #import "VLCPlaylistView.h"
28 #import "VLCPlaylist.h"
30 @implementation VLCPlaylistView
32 - (NSMenu *)menuForEvent:(NSEvent *)event
34 return([(VLCPlaylist *)[self delegate] menuForEvent: event]);
37 - (void)keyDown:(NSEvent *)event
41 if ([[event characters] length])
42 key = [[event characters] characterAtIndex: 0];
45 case NSDeleteCharacter:
46 case NSDeleteFunctionKey:
47 case NSDeleteCharFunctionKey:
48 case NSBackspaceCharacter:
49 [(VLCPlaylist *)[self delegate] deleteItem:self];
52 case NSEnterCharacter:
53 case NSCarriageReturnCharacter:
54 [(VLCPlaylist *)[[VLCMain sharedInstance] playlist] playItem:nil];
58 [super keyDown: event];
63 - (BOOL)acceptsFirstResponder
68 - (BOOL)becomeFirstResponder
70 [self setNeedsDisplay:YES];
74 - (BOOL)resignFirstResponder
76 [self setNeedsDisplay:YES];