]> git.sesse.net Git - vlc/blob - plugins/beos/VideoWindow.h
Implemented correct scaling and used new window size variables.
[vlc] / plugins / beos / VideoWindow.h
1 /*****************************************************************************
2  * VideoWindow.h: BeOS video window class prototype
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001 VideoLAN
5  * $Id: VideoWindow.h,v 1.13 2002/03/22 13:16:35 tcastley Exp $
6  *
7  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8  *          Tony Castley <tcastley@mail.powerup.com.au>
9  *          Richard Shepherd <richard@rshepherd.demon.co.uk>
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25 #define BITMAP  0
26 #define DIRECT  1
27 #define OVERLAY 2
28 #define OPENGL  3
29
30 class VLCView : public BView
31 {
32 public:
33         VLCView( BRect bounds);
34         ~VLCView();
35         
36         void MouseDown(BPoint point);
37         void Draw(BRect updateRect);
38 };
39
40
41 class VideoWindow 
42 {
43 public:
44     // standard constructor and destructor
45     VideoWindow( int v_width, int v_height,
46                  int w_width, int w_height); 
47     ~VideoWindow();
48     
49     void                Zoom(BPoint origin, float width, float height);
50     void            FrameResized(float width, float height);
51     void            FrameMoved(BPoint origin);
52     void            ScreenChanged(BRect frame, color_space mode);
53     void            drawBuffer(int bufferIndex);
54     
55     // this is the hook controling direct screen connection
56     int32           i_width;     // incomming bitmap size 
57     int32           i_height;
58     BRect           winSize;     // current window size
59     float           width_scale, height_scale;
60     float           out_top, out_left, out_height, out_width;
61     bool            is_zoomed, resized, vsync;
62     BBitmap             *bitmap[2];
63     VLCView             *view;
64     BWindow         *voutWindow;
65     int             i_buffer;
66     bool                        teardownwindow;
67     thread_id       fDrawThreadID;
68
69 private:
70     // display_mode old_mode;
71     struct vout_thread_s   *p_vout;
72     int             mode;
73
74 };
75
76 class bitmapWindow : public BWindow
77 {
78 public:
79     bitmapWindow(BRect frame, VideoWindow *theOwner);
80     ~bitmapWindow();
81     // standard window member
82     virtual void    FrameResized(float width, float height);
83     virtual void    FrameMoved(BPoint origin);
84     virtual void        Zoom(BPoint origin, float width, float height);
85     virtual void    ScreenChanged(BRect frame, color_space mode);
86     void            drawBuffer(int bufferIndex);
87 private:
88         VideoWindow     *owner;
89 };
90
91  
92 class directWindow : public BDirectWindow
93 {
94 public:
95     // standard constructor and destructor
96     directWindow( BRect frame, VideoWindow *theOwner); 
97     ~directWindow();
98
99     // standard window member
100     virtual void    FrameResized(float width, float height);
101     virtual void    FrameMoved(BPoint origin);    
102     virtual void        Zoom(BPoint origin, float width, float height);
103     virtual void    DirectConnected(direct_buffer_info *info);
104     virtual void    ScreenChanged(BRect frame, color_space mode);
105     void            drawBuffer(int bufferIndex);
106 private:
107     VideoWindow     *owner;
108 };