macosx: Remove private API for sort indicator images
[vlc.git] / modules / gui / macosx / VLCPlaylistView.m
blob32aa821cb87ccbcda16067cfa9bcb9d842ec92ea
1 /*****************************************************************************
2  * VLCPlaylistView.m: OutlineView subclass for the playlist
3  *****************************************************************************
4 * Copyright (C) 2003-2015 VLC authors and VideoLAN
5  * $Id$
6  *
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>
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
26 #import "VLCMain.h"
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
39     unichar key = 0;
41     if ([[event characters] length])
42         key = [[event characters] characterAtIndex: 0];
44     switch(key) {
45         case NSDeleteCharacter:
46         case NSDeleteFunctionKey:
47         case NSDeleteCharFunctionKey:
48         case NSBackspaceCharacter:
49             [(VLCPlaylist *)[self delegate] deleteItem:self];
50             break;
52         case NSEnterCharacter:
53         case NSCarriageReturnCharacter:
54             [(VLCPlaylist *)[[VLCMain sharedInstance] playlist] playItem:nil];
55             break;
57         default:
58             [super keyDown: event];
59             break;
60     }
63 - (BOOL)acceptsFirstResponder
65     return YES;
68 - (BOOL)becomeFirstResponder
70     [self setNeedsDisplay:YES];
71     return YES;
74 - (BOOL)resignFirstResponder
76     [self setNeedsDisplay:YES];
77     return YES;
80 @end