]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/mediactrl.mm
reverted the change of r32940 which worked around a bug due to associating a dummy...
[wxWidgets.git] / src / cocoa / mediactrl.mm
index fa0ebb15b027f4ad420e2095850f52a5a37048e9..46f2ef177a968e8e43e3806dc4c0475ced8e1580 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        mac/cocoa/mediactrl.cpp
+// Name:        src/cocoa/mediactrl.cpp
 // Purpose:     Built-in Media Backends for Cocoa
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 // Purpose:     Built-in Media Backends for Cocoa
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 #pragma hdrstop
 #endif
 
 #pragma hdrstop
 #endif
 
-//---------------------------------------------------------------------------
-// Includes
-//---------------------------------------------------------------------------
-#include "wx/mediactrl.h"
-
 //---------------------------------------------------------------------------
 // Compilation guard
 //---------------------------------------------------------------------------
 #if wxUSE_MEDIACTRL
 
 //---------------------------------------------------------------------------
 // Compilation guard
 //---------------------------------------------------------------------------
 #if wxUSE_MEDIACTRL
 
+#include "wx/mediactrl.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/timer.h"
+#endif
+
 //===========================================================================
 //  BACKEND DECLARATIONS
 //===========================================================================
 //===========================================================================
 //  BACKEND DECLARATIONS
 //===========================================================================
@@ -47,7 +48,6 @@
 //---------------------------------------------------------------------------
 //  QT Includes
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 //  QT Includes
 //---------------------------------------------------------------------------
-#include "wx/timer.h"
 #include <QuickTime/QuickTime.h>
 
 #include "wx/cocoa/autorelease.h"
 #include <QuickTime/QuickTime.h>
 
 #include "wx/cocoa/autorelease.h"
@@ -64,11 +64,11 @@ public:
     wxQTMediaBackend();
     ~wxQTMediaBackend();
 
     wxQTMediaBackend();
     ~wxQTMediaBackend();
 
-    virtual bool CreateControl(wxControl* ctrl, wxWindow* parent, 
+    virtual bool CreateControl(wxControl* ctrl, wxWindow* parent,
                                      wxWindowID id,
                                      wxWindowID id,
-                                     const wxPoint& pos, 
+                                     const wxPoint& pos,
                                      const wxSize& size,
                                      const wxSize& size,
-                                     long style, 
+                                     long style,
                                      const wxValidator& validator,
                                      const wxString& name);
 
                                      const wxValidator& validator,
                                      const wxString& name);
 
@@ -95,7 +95,7 @@ public:
     void FinishLoad();
 
     wxSize m_bestSize;              //Original movie size
     void FinishLoad();
 
     wxSize m_bestSize;              //Original movie size
-    Movie m_movie;                             //QT Movie handle/instance
+    Movie m_movie;                  //QT Movie handle/instance
     NSMovieView* m_movieview;       //NSMovieView instance
     wxControl* m_ctrl;              //Parent control
     bool m_bVideo;                  //Whether or not we have video
     NSMovieView* m_movieview;       //NSMovieView instance
     wxControl* m_ctrl;              //Parent control
     bool m_bVideo;                  //Whether or not we have video
@@ -108,7 +108,7 @@ public:
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //
 // wxQTMediaBackend
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //
 // wxQTMediaBackend
-// 
+//
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend, wxMediaBackend);
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 IMPLEMENT_DYNAMIC_CLASS(wxQTMediaBackend, wxMediaBackend);
@@ -147,10 +147,10 @@ public:
         if (!m_bPaused)
         {
             if(!IsMovieDone(m_movie))
         if (!m_bPaused)
         {
             if(!IsMovieDone(m_movie))
-                MoviesTask(m_movie, MOVIE_DELAY); 
+                MoviesTask(m_movie, MOVIE_DELAY);
             else
             {
             else
             {
-                wxMediaEvent theEvent(wxEVT_MEDIA_STOP, 
+                wxMediaEvent theEvent(wxEVT_MEDIA_STOP,
                                       m_parent->m_ctrl->GetId());
                 m_parent->m_ctrl->ProcessEvent(theEvent);
 
                                       m_parent->m_ctrl->GetId());
                 m_parent->m_ctrl->ProcessEvent(theEvent);
 
@@ -161,7 +161,7 @@ public:
                     wxASSERT(::GetMoviesError() == noErr);
 
                     //send the event to our child
                     wxASSERT(::GetMoviesError() == noErr);
 
                     //send the event to our child
-                    wxMediaEvent theEvent(wxEVT_MEDIA_FINISHED, 
+                    wxMediaEvent theEvent(wxEVT_MEDIA_FINISHED,
                                           m_parent->m_ctrl->GetId());
                     m_parent->m_ctrl->ProcessEvent(theEvent);
                 }
                                           m_parent->m_ctrl->GetId());
                     m_parent->m_ctrl->ProcessEvent(theEvent);
                 }
@@ -208,21 +208,21 @@ wxQTMediaBackend::~wxQTMediaBackend()
 // 1) Intializes QuickTime
 // 2) Creates the control window
 //---------------------------------------------------------------------------
 // 1) Intializes QuickTime
 // 2) Creates the control window
 //---------------------------------------------------------------------------
-bool wxQTMediaBackend::CreateControl(wxControl* inctrl, wxWindow* parent, 
+bool wxQTMediaBackend::CreateControl(wxControl* inctrl, wxWindow* parent,
                                      wxWindowID wid,
                                      wxWindowID wid,
-                                     const wxPoint& pos, 
+                                     const wxPoint& pos,
                                      const wxSize& size,
                                      const wxSize& size,
-                                     long style, 
+                                     long style,
                                      const wxValidator& validator,
                                      const wxString& name)
 {
     EnterMovies();
                                      const wxValidator& validator,
                                      const wxString& name)
 {
     EnterMovies();
-    
+
     wxMediaCtrl* ctrl = (wxMediaCtrl*) inctrl;
 
     //Create the control base
     wxASSERT(ctrl->CreateBase(parent,wid,pos,size,style, validator, name));
     wxMediaCtrl* ctrl = (wxMediaCtrl*) inctrl;
 
     //Create the control base
     wxASSERT(ctrl->CreateBase(parent,wid,pos,size,style, validator, name));
-    
+
     //Create the NSMovieView
     ctrl->SetNSView(NULL);
     NSMovieView* theView = [[NSMovieView alloc] initWithFrame: ctrl->MakeDefaultNSRect(size)];
     //Create the NSMovieView
     ctrl->SetNSView(NULL);
     NSMovieView* theView = [[NSMovieView alloc] initWithFrame: ctrl->MakeDefaultNSRect(size)];
@@ -251,7 +251,7 @@ bool wxQTMediaBackend::Load(const wxString& fileName)
 {
     return Load(
                 wxURI(
 {
     return Load(
                 wxURI(
-                    wxString( wxT("file://") ) + fileName 
+                    wxString( wxT("file://") ) + fileName
                      )
                );
 }
                      )
                );
 }
@@ -371,7 +371,7 @@ bool wxQTMediaBackend::Stop()
     ::StopMovie(m_movie);
     if(::GetMoviesError() != noErr)
         return false;
     ::StopMovie(m_movie);
     if(::GetMoviesError() != noErr)
         return false;
-    
+
     ::GoToBeginningOfMovie(m_movie);
     return ::GetMoviesError() == noErr;
 }
     ::GoToBeginningOfMovie(m_movie);
     return ::GetMoviesError() == noErr;
 }
@@ -446,7 +446,7 @@ wxLongLong wxQTMediaBackend::GetDuration()
 //---------------------------------------------------------------------------
 wxMediaState wxQTMediaBackend::GetState()
 {
 //---------------------------------------------------------------------------
 wxMediaState wxQTMediaBackend::GetState()
 {
-    if ( !m_timer || (m_timer->IsRunning() == false && 
+    if ( !m_timer || (m_timer->IsRunning() == false &&
                       m_timer->GetPaused() == false) )
         return wxMEDIASTATE_STOPPED;
 
                       m_timer->GetPaused() == false) )
         return wxMEDIASTATE_STOPPED;
 
@@ -492,7 +492,7 @@ void wxQTMediaBackend::Move(int x, int y, int w, int h)
 
 
 //in source file that contains stuff you don't directly use
 
 
 //in source file that contains stuff you don't directly use
-#include <wx/html/forcelnk.h>
+#include "wx/html/forcelnk.h"
 FORCE_LINK_ME(basewxmediabackends);
 
 #endif //wxUSE_MEDIACTRL
 FORCE_LINK_ME(basewxmediabackends);
 
 #endif //wxUSE_MEDIACTRL