]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/VideoWindow.h
FSF address change.
[vlc] / modules / gui / beos / VideoWindow.h
index 419e4e991d0c95783245945c2c249635b73ef7a2..da7b9c9fea4fe6d974e439dd86277c7811af4783 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * VideoWindow.h: BeOS video window class prototype
  *****************************************************************************
- * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: VideoWindow.h,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * Copyright (C) 1999, 2000, 2001 the VideoLAN team
+ * $Id$
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Tony Castley <tcastley@mail.powerup.com.au>
@@ -13,7 +13,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -21,7 +21,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef BEOS_VIDEO_WINDOW_H
@@ -38,7 +38,7 @@ typedef struct colorcombo
 {
        color_space colspace;
        const char *name;
-       u32 chroma;
+       uint32_t chroma;
        int planes;
        int pixel_bytes;
 } colorcombo;
@@ -53,24 +53,74 @@ colorcombo colspace[]=
 };
 
 #define COLOR_COUNT 5
-#define DEFAULT_COL 4
+#define DEFAULT_COL 3
+
+class VideoSettings
+{
+ public:
+                                                       VideoSettings( const VideoSettings& clone );
+       virtual                                 ~VideoSettings();
+
+       static  VideoSettings*  DefaultSettings();
+
+       enum
+       {
+               SIZE_OTHER                      = 0,
+               SIZE_50                         = 1,
+               SIZE_100                        = 2,
+               SIZE_200                        = 3,
+       };
+
+                       void                    SetVideoSize( uint32_t mode );
+       inline  uint32_t                        VideoSize() const
+                                                               { return fVideoSize; }
+       enum
+       {
+               FLAG_CORRECT_RATIO      = 0x0001,
+               FLAG_SYNC_RETRACE       = 0x0002,
+               FLAG_ON_TOP_ALL         = 0x0004,
+               FLAG_FULL_SCREEN        = 0x0008,
+       };
+
+       inline  void                    SetFlags( uint32_t flags )
+                                                               { fFlags = flags; }
+       inline  void                    AddFlags( uint32_t flags )
+                                                               { fFlags |= flags; }
+       inline  void                    ClearFlags( uint32_t flags )
+                                                               { fFlags &= ~flags; }
+       inline  bool                    HasFlags( uint32_t flags ) const
+                                                               { return fFlags & flags; }
+       inline  uint32_t                        Flags() const
+                                                               { return fFlags; }
+
+ private:
+                                                       VideoSettings(); // reserved for default settings
+
+       static  VideoSettings   fDefaultSettings;
+
+                       uint32_t                        fVideoSize;
+                       uint32_t                        fFlags;
+                       BMessage*               fSettings;
+};
 
 
 class VLCView : public BView
 {
  public:
-                                                       VLCView( BRect bounds);
+                                                       VLCView( BRect bounds, vout_thread_t *p_vout );
        virtual                                 ~VLCView();
 
        virtual void                    AttachedToWindow();
        virtual void                    MouseDown(BPoint where);
+       virtual void                    MouseUp(BPoint where);
        virtual void                    MouseMoved(BPoint where, uint32 transit,
                                                                           const BMessage* dragMessage);
        virtual void                    Pulse();
        virtual void                    Draw(BRect updateRect);
-       virtual void                    KeyDown(const char* bytes, int32 numBytes);
 
  private:
+            vout_thread_t   *p_vout;
+
                        bigtime_t               fLastMouseMovedTime;
                        bool                    fCursorHidden;
                        bool                    fCursorInside;
@@ -81,12 +131,13 @@ class VLCView : public BView
 class VideoWindow : public BWindow
 {
 public:
-                                                       VideoWindow(int v_width, 
+                                                       VideoWindow(int v_width,
                                                                                int v_height,
-                                                                               BRect frame); 
+                                                                               BRect frame,
+                                                                               vout_thread_t *p_vout);
        virtual                                 ~VideoWindow();
 
-                                                       // BWindow    
+                                                       // BWindow
        virtual void                    MessageReceived(BMessage* message);
        virtual void                    Zoom(BPoint origin,
                                                                 float width, float height);
@@ -103,24 +154,30 @@ public:
                        void                    SetInterfaceShowing(bool showIt);
 
                        void                    SetCorrectAspectRatio(bool doIt);
-       inline  bool                    CorrectAspectRatio() const
-                                                               { return fCorrectAspect; }
+                       bool                    CorrectAspectRatio() const;
+                       void                    ToggleFullScreen();
+                       void                    SetFullScreen(bool doIt);
+                       bool                    IsFullScreen() const;
+                       void                    SetOnTop(bool doIt);
+                       bool                    IsOnTop() const;
+                       void                    SetSyncToRetrace(bool doIt);
+                       bool                    IsSyncedToRetrace() const;
        inline  status_t                InitCheck() const
                                                                { return fInitStatus; }
 
 
     // this is the hook controling direct screen connection
-    int32           i_width;     // aspect corrected bitmap size 
-    int32           i_height;
+    int32_t         i_width;     // aspect corrected bitmap size
+    int32_t         i_height;
     BRect           winSize;     // current window size
-    bool            is_zoomed, vsync;
     BBitmap            *bitmap[3];
-    BBitmap         *overlaybitmap;
+//    BBitmap         *overlaybitmap;
     VLCView            *view;
     int             i_buffer;
        volatile bool   teardownwindow;
     thread_id       fDrawThreadID;
     int             mode;
+    int             bitmap_count;
     int             colspace_index;
 
 private:
@@ -129,31 +186,18 @@ private:
                                                                                         int* mode);
                        void                    _FreeBuffers();
                        void                    _BlankBitmap(BBitmap* bitmap) const;
-                       void                    _SetVideoSize(uint32 mode);
+                       void                    _SetVideoSize(uint32_t mode);
+                       void                    _SetToSettings();
 
-                       void                    _SaveScreenShot( BBitmap* bitmap,
-                                                                                        char* path,
-                                                                                        uint32 translatorID ) const;
-       static  int32                   _save_screen_shot( void* cookie );
+    vout_thread_t   *p_vout;
 
-       struct screen_shot_info
-       {
-               BBitmap*        bitmap;
-               char*           path;
-               uint32          translatorID;
-               int32           width;
-               int32           height;
-       };
-
-    struct vout_thread_s   *p_vout;
-
-                       int32                   fTrueWidth;     // incomming bitmap size 
-                       int32                   fTrueHeight;
-                       bool                    fCorrectAspect;
-                       window_feel             fCachedFeel;
-                       bool                    fInterfaceShowing;
-                       status_t                fInitStatus;
+       int32_t                 fTrueWidth;     // incomming bitmap size
+       int32_t                 fTrueHeight;
+       window_feel             fCachedFeel;
+       bool                    fInterfaceShowing;
+       status_t                fInitStatus;
+       VideoSettings*  fSettings;
 };
 
 #endif // BEOS_VIDEO_WINDOW_H
+