]> git.sesse.net Git - vlc/blob - plugins/macosx/vout_window.m
* ALL: the first libvlc commit.
[vlc] / plugins / macosx / vout_window.m
1 /*****************************************************************************
2  * vout_window.c: MacOS X plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: vout_window.m,v 1.2 2002/06/01 12:32:00 sam 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  * Preamble
26  *****************************************************************************/
27 #import <Cocoa/Cocoa.h>
28
29 #import "vout_window.h"
30
31 /*****************************************************************************
32  * VLCWindow implementation 
33  *****************************************************************************/
34 @implementation VLCWindow
35
36 - (void)setWrapper:(Vout_VLCWrapper *)_o_wrapper forVout:(void *)_p_vout
37 {
38     p_vout = _p_vout;
39     o_wrapper = _o_wrapper;
40 }
41
42 - (BOOL)canBecomeKeyWindow
43 {
44     return( YES );
45 }
46
47 - (void)becomeKeyWindow
48 {
49     [super becomeKeyWindow];
50 #if 0
51     [o_wrapper 
52         mouseEvent: (MOUSE_NOT_MOVED | MOUSE_LAST_MOVED)
53         forVout: p_vout];
54 #endif
55 }
56
57 - (void)resignKeyWindow
58 {
59     [super resignKeyWindow];
60
61     [o_wrapper
62         mouseEvent: (MOUSE_MOVED | MOUSE_NOT_LAST_MOVED)
63         forVout: p_vout];
64 }
65
66 - (void)keyDown:(NSEvent *)o_event
67 {
68     if( [o_wrapper keyDown: o_event forVout: p_vout] == NO )
69     {
70         [super keyDown: o_event];
71     }
72 }
73
74 - (void)mouseMoved:(NSEvent *)o_event
75 {
76     [o_wrapper
77         mouseEvent: MOUSE_LAST_MOVED
78         forVout: p_vout];
79 }
80
81 - (void)mouseDown:(NSEvent *)o_event
82 {
83     [o_wrapper
84         mouseEvent: MOUSE_DOWN
85         forVout: p_vout];
86 }
87
88 @end