[vlc-devel] [RFC] [PATCH] skins2: Remove macOS code

Marvin Scholz epirat07 at gmail.com
Sat Dec 10 02:38:34 CET 2016


Skins2 is not built on macOS since very long time, given that Qt is not
used there. The code is very old with a lot of TODOs and additionally it
requires the quite old Carbon framework which implies 32bit only as
Carbon was never ported to 64bit. (Cocoa should be used instead)

Therefore this commits removes all macOS related skins2 code and
disabled building of skins2 on macOS in the configure script.
---

As already stated in the commit message, given that the code
is quite outdated and of limited use, even if one would get
Qt to work on macOS, I would like to propose to remove it.

Please note, I was not able to test this properly given that
building VLC with Qt does not seem to work properly on macOS,
and I have no Linux build environment.

If this proposal is accepted and no one else wants to test this,
I will try to setup a linux build environment and test it,
but I did not want to invest that much time yet, as this proposal
might be rejected anyway.

 configure.ac                                  |  10 ++
 modules/gui/skins2/Modules.am                 |  21 ----
 modules/gui/skins2/macosx/macosx_dragdrop.cpp |  36 ------
 modules/gui/skins2/macosx/macosx_dragdrop.hpp |  43 -------
 modules/gui/skins2/macosx/macosx_factory.cpp  | 161 --------------------------
 modules/gui/skins2/macosx/macosx_factory.hpp  | 111 ------------------
 modules/gui/skins2/macosx/macosx_graphics.cpp | 109 -----------------
 modules/gui/skins2/macosx/macosx_graphics.hpp |  84 --------------
 modules/gui/skins2/macosx/macosx_loop.cpp     | 108 -----------------
 modules/gui/skins2/macosx/macosx_loop.hpp     |  60 ----------
 modules/gui/skins2/macosx/macosx_popup.cpp    |  73 ------------
 modules/gui/skins2/macosx/macosx_popup.hpp    |  55 ---------
 modules/gui/skins2/macosx/macosx_timer.cpp    |  55 ---------
 modules/gui/skins2/macosx/macosx_timer.hpp    |  54 ---------
 modules/gui/skins2/macosx/macosx_tooltip.cpp  |  53 ---------
 modules/gui/skins2/macosx/macosx_tooltip.hpp  |  48 --------
 modules/gui/skins2/macosx/macosx_window.cpp   |  90 --------------
 modules/gui/skins2/macosx/macosx_window.hpp   |  76 ------------
 modules/gui/skins2/src/os_factory.cpp         |   4 -
 19 files changed, 10 insertions(+), 1241 deletions(-)
 delete mode 100644 modules/gui/skins2/macosx/macosx_dragdrop.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_dragdrop.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_factory.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_factory.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_graphics.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_graphics.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_loop.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_loop.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_popup.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_popup.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_timer.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_timer.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_tooltip.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_tooltip.hpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_window.cpp
 delete mode 100644 modules/gui/skins2/macosx/macosx_window.hpp

diff --git a/configure.ac b/configure.ac
index 84d8e5e..73bd9e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3787,6 +3787,16 @@ AS_IF([test "x$KDE4_CONFIG" = "x"], [
 ])
 
 dnl
+dnl Disable skins2 on macOS
+dnl
+AS_IF([test "${SYS}" = "darwin"], [
+  AS_IF([test "${enable_skins2}" = "yes"], [
+    AC_MSG_ERROR([The skins2 module is not supported on macOS])
+  ])
+  enable_skins2="no"
+])
+
+dnl
 dnl Simple test for skins2 dependency
 dnl
 AS_IF([test "$enable_qt" = "no"], [
diff --git a/modules/gui/skins2/Modules.am b/modules/gui/skins2/Modules.am
index a962ab2..1599907 100644
--- a/modules/gui/skins2/Modules.am
+++ b/modules/gui/skins2/Modules.am
@@ -215,26 +215,6 @@ SOURCES_skins2 += \
 	win32/win32_window.hpp \
     $(NULL)
 else
-if HAVE_DARWIN
-SOURCES_skins2 += \
-	macosx/macosx_dragdrop.cpp \
-	macosx/macosx_dragdrop.hpp \
-	macosx/macosx_factory.cpp \
-	macosx/macosx_factory.hpp \
-	macosx/macosx_graphics.cpp \
-	macosx/macosx_graphics.hpp \
-	macosx/macosx_loop.cpp \
-	macosx/macosx_loop.hpp \
-	macosx/macosx_popup.cpp \
-	macosx/macosx_popup.hpp \
-	macosx/macosx_timer.cpp \
-	macosx/macosx_timer.hpp \
-	macosx/macosx_window.cpp \
-	macosx/macosx_window.hpp \
-	macosx/macosx_tooltip.cpp \
-	macosx/macosx_tooltip.hpp \
-    $(NULL)
-else
 if HAVE_OS2
 SOURCES_skins2 += \
 	os2/os2_dragdrop.cpp \
@@ -277,4 +257,3 @@ SOURCES_skins2 += \
     $(NULL)
 endif
 endif
-endif
diff --git a/modules/gui/skins2/macosx/macosx_dragdrop.cpp b/modules/gui/skins2/macosx/macosx_dragdrop.cpp
deleted file mode 100644
index 966d16a..0000000
--- a/modules/gui/skins2/macosx/macosx_dragdrop.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*****************************************************************************
- * macosx_dragdrop.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_dragdrop.hpp"
-
-
-MacOSXDragDrop::MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop ):
-    SkinObject( pIntf ), m_playOnDrop( playOnDrop )
-{
-    // TODO
-}
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_dragdrop.hpp b/modules/gui/skins2/macosx/macosx_dragdrop.hpp
deleted file mode 100644
index 1fd5b03..0000000
--- a/modules/gui/skins2/macosx/macosx_dragdrop.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * macosx_dragdrop.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_DRAGDROP_HPP
-#define MACOSX_DRAGDROP_HPP
-
-#include "../src/skin_common.hpp"
-
-class MacOSXDragDrop: public SkinObject
-{
-public:
-    typedef long ldata_t[5];
-
-    MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop );
-    virtual ~MacOSXDragDrop() { }
-
-private:
-    /// Indicates whether the file(s) must be played immediately
-    bool m_playOnDrop;
-};
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_factory.cpp b/modules/gui/skins2/macosx/macosx_factory.cpp
deleted file mode 100644
index 3efac86..0000000
--- a/modules/gui/skins2/macosx/macosx_factory.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/*****************************************************************************
- * macosx_factory.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_factory.hpp"
-#include "macosx_graphics.hpp"
-#include "macosx_loop.hpp"
-#include "macosx_popup.hpp"
-#include "macosx_timer.hpp"
-#include "macosx_window.hpp"
-#include "macosx_tooltip.hpp"
-
-
-MacOSXFactory::MacOSXFactory( intf_thread_t *pIntf ): OSFactory( pIntf ),
-    m_dirSep( "/" )
-{
-    // TODO
-}
-
-
-MacOSXFactory::~MacOSXFactory()
-{
-    // TODO
-}
-
-
-bool MacOSXFactory::init()
-{
-    // TODO
-    return true;
-}
-
-
-OSGraphics *MacOSXFactory::createOSGraphics( int width, int height )
-{
-    return new MacOSXGraphics( getIntf(), width, height );
-}
-
-
-OSLoop *MacOSXFactory::getOSLoop()
-{
-    return MacOSXLoop::instance( getIntf() );
-}
-
-
-void MacOSXFactory::destroyOSLoop()
-{
-    MacOSXLoop::destroy( getIntf() );
-}
-
-void MacOSXFactory::minimize()
-{
-    // TODO
-}
-
-void MacOSXFactory::restore()
-{
-    // TODO
-}
-
-void MacOSXFactory::addInTray()
-{
-    // TODO
-}
-
-void MacOSXFactory::removeFromTray()
-{
-    // TODO
-}
-
-void MacOSXFactory::addInTaskBar()
-{
-    // TODO
-}
-
-void MacOSXFactory::removeFromTaskBar()
-{
-    // TODO
-}
-
-OSTimer *MacOSXFactory::createOSTimer( CmdGeneric &rCmd )
-{
-    return new MacOSXTimer( getIntf(), rCmd );
-}
-
-
-OSWindow *MacOSXFactory::createOSWindow( GenericWindow &rWindow, bool dragDrop,
-                                      bool playOnDrop, OSWindow *pParent )
-{
-    return new MacOSXWindow( getIntf(), rWindow, dragDrop,
-                             playOnDrop, (MacOSXWindow*)pParent );
-}
-
-
-OSTooltip *MacOSXFactory::createOSTooltip()
-{
-    return new MacOSXTooltip( getIntf() );
-}
-
-
-OSPopup *MacOSXFactory::createOSPopup()
-{
-    return new MacOSXPopup( getIntf() );
-}
-
-
-int MacOSXFactory::getScreenWidth() const
-{
-    // TODO
-    return 0;
-}
-
-
-int MacOSXFactory::getScreenHeight() const
-{
-    // TODO
-    return 0;
-}
-
-
-SkinsRect MacOSXFactory::getWorkArea() const
-{
-    // XXX
-    return SkinsRect( 0, 0, getScreenWidth(), getScreenHeight() );
-}
-
-
-void MacOSXFactory::getMousePos( int &rXPos, int &rYPos ) const
-{
-    // TODO
-}
-
-
-void MacOSXFactory::rmDir( const string &rPath )
-{
-    // TODO
-}
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_factory.hpp b/modules/gui/skins2/macosx/macosx_factory.hpp
deleted file mode 100644
index 3fa9b5a..0000000
--- a/modules/gui/skins2/macosx/macosx_factory.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************
- * macosx_factory.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_FACTORY_HPP
-#define MACOSX_FACTORY_HPP
-
-#include "../src/os_factory.hpp"
-
-
-/// Class used to instanciate MacOSX specific objects
-class MacOSXFactory: public OSFactory
-{
-public:
-    MacOSXFactory( intf_thread_t *pIntf );
-    virtual ~MacOSXFactory();
-
-    /// Initialization method
-    virtual bool init();
-
-    /// Instantiate an object OSGraphics
-    virtual OSGraphics *createOSGraphics( int width, int height );
-
-    /// Get the instance of the singleton OSLoop
-    virtual OSLoop *getOSLoop();
-
-    /// Destroy the instance of OSLoop
-    virtual void destroyOSLoop();
-
-    /// Instantiate an OSTimer with the given callback
-    virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
-
-    /// Minimize all the windows
-    virtual void minimize();
-
-    /// Restore the minimized windows
-    virtual void restore();
-
-    /// Add an icon in the system tray
-    virtual void addInTray();
-
-    /// Remove the icon from the system tray
-    virtual void removeFromTray();
-
-    /// Show the task in the task bar
-    virtual void addInTaskBar();
-
-    /// Remove the task from the task bar
-    virtual void removeFromTaskBar();
-
-    /// Instantiate an OSWindow object
-    virtual OSWindow *createOSWindow( GenericWindow &rWindow,
-                                      bool dragDrop, bool playOnDrop,
-                                      OSWindow *pParent );
-
-    /// Instantiate an object OSTooltip
-    virtual OSTooltip *createOSTooltip();
-
-    /// Instantiate an object OSPopup
-    virtual OSPopup *createOSPopup();
-
-    /// Get the directory separator
-    virtual const string &getDirSeparator() const { return m_dirSep; }
-
-    /// Get the resource path
-    virtual const list<string> &getResourcePath() const
-        { return m_resourcePath; }
-
-    /// Get the screen size
-    virtual int getScreenWidth() const;
-    virtual int getScreenHeight() const;
-
-    /// Get the work area (screen area without taskbars)
-    virtual SkinsRect getWorkArea() const;
-
-    /// Get the position of the mouse
-    virtual void getMousePos( int &rXPos, int &rYPos ) const;
-
-    /// Change the cursor
-    virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
-
-    /// Delete a directory recursively
-    virtual void rmDir( const string &rPath );
-
-private:
-    /// Directory separator
-    const string m_dirSep;
-    /// Resource path
-    list<string> m_resourcePath;
-};
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_graphics.cpp b/modules/gui/skins2/macosx/macosx_graphics.cpp
deleted file mode 100644
index 23aea45..0000000
--- a/modules/gui/skins2/macosx/macosx_graphics.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*****************************************************************************
- * macosx_graphics.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_graphics.hpp"
-#include "macosx_window.hpp"
-
-
-MacOSXGraphics::MacOSXGraphics( intf_thread_t *pIntf, int width, int height ):
-    OSGraphics( pIntf ), m_width( width ), m_height( height )
-{
-    // TODO
-}
-
-
-MacOSXGraphics::~MacOSXGraphics()
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::clear()
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::drawGraphics( const OSGraphics &rGraphics, int xSrc,
-                                   int ySrc, int xDest, int yDest, int width,
-                                   int height )
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::drawBitmap( const GenericBitmap &rBitmap, int xSrc,
-                                 int ySrc, int xDest, int yDest, int width,
-                                 int height, bool blend )
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::fillRect( int left, int top, int width, int height,
-                               uint32_t color )
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::drawRect( int left, int top, int width, int height,
-                            uint32_t color )
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::applyMaskToWindow( OSWindow &rWindow )
-{
-    // TODO
-}
-
-
-void MacOSXGraphics::copyToWindow( OSWindow &rWindow, int xSrc,  int ySrc,
-                                int width, int height, int xDest, int yDest )
-{
-    // Get the graphics context
-    WindowRef win = ((MacOSXWindow&)rWindow).getWindowRef();
-    SetPortWindowPort( win );
-    GrafPtr port = GetWindowPort( win );
-    CGContextRef gc;
-    QDBeginCGContext( port, &gc );
-
-//    CGContextSetRGBFillColor( gc, 1, 0, 0, 1 );
-//    CGContextFillRect( gc, CGRectMake( 0, 0, 50, 50 ));
-
-    // Release the graphics context
-    QDEndCGContext( port, &gc );
-}
-
-
-bool MacOSXGraphics::hit( int x, int y ) const
-{
-    // TODO
-    return false;
-}
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_graphics.hpp b/modules/gui/skins2/macosx/macosx_graphics.hpp
deleted file mode 100644
index 05ae823..0000000
--- a/modules/gui/skins2/macosx/macosx_graphics.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*****************************************************************************
- * macosx_graphics.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_GRAPHICS_HPP
-#define MACOSX_GRAPHICS_HPP
-
-#include "../src/os_graphics.hpp"
-#include <Carbon/Carbon.h>
-
-class GenericWindow;
-class GenericBitmap;
-
-/// MacOSX implementation of OSGraphics
-class MacOSXGraphics: public OSGraphics
-{
-public:
-    MacOSXGraphics( intf_thread_t *pIntf, int width, int height);
-
-    virtual ~MacOSXGraphics();
-
-    /// Clear the graphics
-    virtual void clear();
-
-    /// Draw another graphics on this one
-    virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
-                               int ySrc = 0, int xDest = 0, int yDest = 0,
-                               int width = -1, int height = -1 );
-
-    /// Render a bitmap on this graphics
-    virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
-                             int ySrc = 0, int xDest = 0, int yDest = 0,
-                             int width = -1, int height = -1,
-                             bool blend = false );
-
-    /// Draw a filled rectangle on the grahics (color is #RRGGBB)
-    virtual void fillRect( int left, int top, int width, int height,
-                           uint32_t color );
-
-    /// Draw an empty rectangle on the grahics (color is #RRGGBB)
-    virtual void drawRect( int left, int top, int width, int height,
-                           uint32_t color );
-
-    /// Set the shape of a window with the mask of this graphics.
-    virtual void applyMaskToWindow( OSWindow &rWindow );
-
-    /// Copy the graphics on a window
-    virtual void copyToWindow( OSWindow &rWindow, int xSrc,
-                               int ySrc, int width, int height,
-                               int xDest, int yDest );
-
-    /// Tell whether the pixel at the given position is visible
-    virtual bool hit( int x, int y ) const;
-
-    /// Getters
-    virtual int getWidth() const { return m_width; }
-    virtual int getHeight() const { return m_height; }
-
-private:
-    /// Size of the image
-    int m_width, m_height;
-};
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_loop.cpp b/modules/gui/skins2/macosx/macosx_loop.cpp
deleted file mode 100644
index ab46ae9..0000000
--- a/modules/gui/skins2/macosx/macosx_loop.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*****************************************************************************
- * macosx_loop.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_loop.hpp"
-#include "macosx_window.hpp"
-#include "../src/generic_window.hpp"
-#include "../events/evt_refresh.hpp"
-
-static pascal OSStatus WinEventHandler( EventHandlerCallRef handler,
-                                        EventRef event, void *data )
-{
-    GenericWindow *pWin = (GenericWindow*)data;
-    intf_thread_t *pIntf = pWin->getIntf();
-
-    //fprintf(stderr, "event\n" );
-    UInt32 evclass = GetEventClass( event );
-    UInt32 evkind = GetEventKind( event );
-
-    switch( evclass )
-    {
-    case kEventClassWindow:
-        EvtRefresh evt( pIntf, 0, 0, -1, -1);
-        pWin->processEvent( evt );
-        break;
-    }
-}
-
-
-MacOSXLoop::MacOSXLoop( intf_thread_t *pIntf ):
-    OSLoop( pIntf ), m_exit( false )
-{
-}
-
-
-MacOSXLoop::~MacOSXLoop()
-{
-}
-
-
-OSLoop *MacOSXLoop::instance( intf_thread_t *pIntf )
-{
-    if( pIntf->p_sys->p_osLoop == NULL )
-    {
-        OSLoop *pOsLoop = new MacOSXLoop( pIntf );
-        pIntf->p_sys->p_osLoop = pOsLoop;
-    }
-    return pIntf->p_sys->p_osLoop;
-}
-
-
-void MacOSXLoop::destroy( intf_thread_t *pIntf )
-{
-    delete pIntf->p_sys->p_osLoop;
-    pIntf->p_sys->p_osLoop = NULL;
-}
-
-
-void MacOSXLoop::run()
-{
-    // Main event loop
-    while( !m_exit )
-    {
-        sleep(1);
-    }
-}
-
-
-void MacOSXLoop::exit()
-{
-    m_exit = true;
-}
-
-
-void MacOSXLoop::registerWindow( GenericWindow &rGenWin, WindowRef win )
-{
-    // Create the event handler
-    EventTypeSpec evList[] = {
-        { kEventClassWindow, kEventWindowUpdate },
-        { kEventClassMouse, kEventMouseMoved }
-    };
-    EventHandlerUPP handler = NewEventHandlerUPP( WinEventHandler );
-    InstallWindowEventHandler( win, handler, GetEventTypeCount( evList ),
-                               evList, &rGenWin, NULL );
-}
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_loop.hpp b/modules/gui/skins2/macosx/macosx_loop.hpp
deleted file mode 100644
index 54b4d1d..0000000
--- a/modules/gui/skins2/macosx/macosx_loop.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * MacOSX_loop.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_LOOP_HPP
-#define MACOSX_LOOP_HPP
-
-#include "../src/os_loop.hpp"
-#include <Carbon/Carbon.h>
-
-class MacOSXDisplay;
-class GenericWindow;
-
-/// Main event loop for MacOSX (singleton)
-class MacOSXLoop: public OSLoop
-{
-public:
-    /// Get the instance of MacOSXLoop
-    static OSLoop *instance( intf_thread_t *pIntf );
-
-    /// Destroy the instance of MacOSXLoop
-    static void destroy( intf_thread_t *pIntf );
-
-    /// Enter the event loop
-    virtual void run();
-
-    /// Exit the main loop
-    virtual void exit();
-
-    // Handle a window event
-    void registerWindow( GenericWindow &rGenWin, WindowRef win );
-
-private:
-    // Private because it's a singleton
-    MacOSXLoop( intf_thread_t *pIntf );
-    virtual ~MacOSXLoop();
-    // Flag set to exit the loop
-    bool m_exit;
-};
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_popup.cpp b/modules/gui/skins2/macosx/macosx_popup.cpp
deleted file mode 100644
index d95f310..0000000
--- a/modules/gui/skins2/macosx/macosx_popup.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * macosx_popup.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Olivier Teulière <ipkiss at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_popup.hpp"
-
-
-MacOSXPopup::MacOSXPopup( intf_thread_t *pIntf )
-    : OSPopup( pIntf )
-{
-    // TODO
-}
-
-
-MacOSXPopup::~MacOSXPopup()
-{
-    // TODO
-}
-
-
-void MacOSXPopup::show( int xPos, int yPos )
-{
-    // TODO
-}
-
-
-void MacOSXPopup::hide()
-{
-    // TODO
-}
-
-
-void MacOSXPopup::addItem( const string &rLabel, int pos )
-{
-    // TODO
-}
-
-
-void MacOSXPopup::addSeparator( int pos )
-{
-    // TODO
-}
-
-
-int MacOSXPopup::getPosFromId( int id ) const
-{
-    // TODO
-}
-
-
-#endif
-
diff --git a/modules/gui/skins2/macosx/macosx_popup.hpp b/modules/gui/skins2/macosx/macosx_popup.hpp
deleted file mode 100644
index 5d903a4..0000000
--- a/modules/gui/skins2/macosx/macosx_popup.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*****************************************************************************
- * macosx_popup.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Olivier Teulière <ipkiss at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_POPUP_HPP
-#define MACOSX_POPUP_HPP
-
-#include "../src/os_popup.hpp"
-
-
-/// MacOSX implementation of OSPopup
-class MacOSXPopup: public OSPopup
-{
-public:
-    MacOSXPopup( intf_thread_t *pIntf );
-
-    virtual ~MacOSXPopup();
-
-    /// Show the popup menu at the given (absolute) corrdinates
-    virtual void show( int xPos, int yPos );
-
-    /// Hide the popup menu
-    virtual void hide();
-
-    /// Append a new menu item with the given label to the popup menu
-    virtual void addItem( const string &rLabel, int pos );
-
-    /// Create a dummy menu item to separate sections
-    virtual void addSeparator( int pos );
-
-    /// Return the position of the item identified by the given id
-    virtual int getPosFromId( int id ) const;
-};
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_timer.cpp b/modules/gui/skins2/macosx/macosx_timer.cpp
deleted file mode 100644
index 7c1d7cd..0000000
--- a/modules/gui/skins2/macosx/macosx_timer.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*****************************************************************************
- * macosx_timer.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_timer.hpp"
-#include "../commands/cmd_generic.hpp"
-
-
-MacOSXTimer::MacOSXTimer( intf_thread_t *pIntf,  CmdGeneric &rCmd ):
-    OSTimer( pIntf ), m_rCommand( rCmd )
-{
-    // TODO
-}
-
-
-MacOSXTimer::~MacOSXTimer()
-{
-    // TODO
-    stop();
-}
-
-
-void MacOSXTimer::start( int delay, bool oneShot )
-{
-    // TODO
-}
-
-
-void MacOSXTimer::stop()
-{
-    // TODO
-}
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_timer.hpp b/modules/gui/skins2/macosx/macosx_timer.hpp
deleted file mode 100644
index 29d59f9..0000000
--- a/modules/gui/skins2/macosx/macosx_timer.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*****************************************************************************
- * macosx_timer.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_TIMER_HPP
-#define MACOSX_TIMER_HPP
-
-#include "../src/os_timer.hpp"
-
-// Forward declaration
-class MacOSXTimerLoop;
-class CmdGeneric;
-
-
-// MacOSX specific timer
-class MacOSXTimer: public OSTimer
-{
-public:
-    MacOSXTimer( intf_thread_t *pIntf, CmdGeneric &rCmd );
-    virtual ~MacOSXTimer();
-
-    /// (Re)start the timer with the given delay (in ms). If oneShot is
-    /// true, stop it after the first execution of the callback.
-    virtual void start( int delay, bool oneShot );
-
-    /// Stop the timer
-    virtual void stop();
-
-private:
-    /// Command to execute
-    CmdGeneric &m_rCommand;
-};
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_tooltip.cpp b/modules/gui/skins2/macosx/macosx_tooltip.cpp
deleted file mode 100644
index 257d9ec..0000000
--- a/modules/gui/skins2/macosx/macosx_tooltip.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*****************************************************************************
- * macosx_tooltip.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_tooltip.hpp"
-
-MacOSXTooltip::MacOSXTooltip( intf_thread_t *pIntf ):
-    OSTooltip( pIntf )
-{
-    // TODO
-}
-
-
-MacOSXTooltip::~MacOSXTooltip()
-{
-    // TODO
-}
-
-
-void MacOSXTooltip::show( int left, int top, OSGraphics &rText )
-{
-    // TODO
-}
-
-
-void MacOSXTooltip::hide()
-{
-    // TODO
-}
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_tooltip.hpp b/modules/gui/skins2/macosx/macosx_tooltip.hpp
deleted file mode 100644
index a559d29..0000000
--- a/modules/gui/skins2/macosx/macosx_tooltip.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*****************************************************************************
- * macosx_tooltip.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_TOOLTIP_HPP
-#define MACOSX_TOOLTIP_HPP
-
-#include "../src/os_tooltip.hpp"
-
-class MacOSXDisplay;
-
-
-/// MacOSX implementation of OSTooltip
-class MacOSXTooltip: public OSTooltip
-{
-public:
-    MacOSXTooltip( intf_thread_t *pIntf );
-
-    virtual ~MacOSXTooltip();
-
-    /// Show the tooltip
-    virtual void show( int left, int top, OSGraphics &rText );
-
-    /// Hide the tooltip
-    virtual void hide();
-};
-
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_window.cpp b/modules/gui/skins2/macosx/macosx_window.cpp
deleted file mode 100644
index 2e035df..0000000
--- a/modules/gui/skins2/macosx/macosx_window.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/*****************************************************************************
- * macosx_window.cpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef MACOSX_SKINS
-
-#include "macosx_window.hpp"
-#include "macosx_loop.hpp"
-#include "../src/os_factory.hpp"
-
-
-MacOSXWindow::MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
-                            bool dragDrop, bool playOnDrop,
-                            MacOSXWindow *pParentWindow ):
-    OSWindow( pIntf ), m_pParent( pParentWindow ), m_dragDrop( dragDrop )
-{
-    // Create the window
-    Rect rect;
-    SetRect( &rect, 0, 0, 0, 0 );
-    CreateNewWindow( kDocumentWindowClass, kWindowNoShadowAttribute |
-                     kWindowNoTitleBarAttribute, &rect, &m_win );
-
-    // Create the event handler for this window
-    OSFactory *pOSFactory = OSFactory::instance( getIntf() );
-    ((MacOSXLoop*)pOSFactory->getOSLoop())->registerWindow( rWindow, m_win );
-}
-
-
-MacOSXWindow::~MacOSXWindow()
-{
-    DisposeWindow( m_win );
-}
-
-
-void MacOSXWindow::show( int left, int top ) const
-{
-    ShowWindow( m_win );
-}
-
-
-void MacOSXWindow::hide() const
-{
-    HideWindow( m_win );
-}
-
-
-void MacOSXWindow::moveResize( int left, int top, int width, int height ) const
-{
-    MoveWindow( m_win, left, top, false );
-    SizeWindow( m_win, width, height, true );
-}
-
-
-void MacOSXWindow::raise() const
-{
-    SelectWindow( m_win );
-}
-
-
-void MacOSXWindow::setOpacity( uint8_t value ) const
-{
-    SetWindowAlpha( m_win, (float)value / 255.0 );
-}
-
-
-void MacOSXWindow::toggleOnTop( bool onTop ) const
-{
-    // TODO
-}
-
-#endif
diff --git a/modules/gui/skins2/macosx/macosx_window.hpp b/modules/gui/skins2/macosx/macosx_window.hpp
deleted file mode 100644
index f47746f..0000000
--- a/modules/gui/skins2/macosx/macosx_window.hpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * macosx_window.hpp
- *****************************************************************************
- * Copyright (C) 2003 the VideoLAN team
- * $Id$
- *
- * Authors: Cyril Deguet     <asmax at via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * 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
- * GNU General Public License for more details.
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef MACOSX_WINDOW_HPP
-#define MACOSX_WINDOW_HPP
-
-#include "../src/os_window.hpp"
-#include <Carbon/Carbon.h>
-
-class MacOSXDisplay;
-class MacOSXDragDrop;
-
-
-/// MacOSX implementation of OSWindow
-class MacOSXWindow: public OSWindow
-{
-public:
-    MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
-                  bool dragDrop, bool playOnDrop,
-                  MacOSXWindow *pParentWindow );
-
-    virtual ~MacOSXWindow();
-
-    // Show the window
-    virtual void show( int left, int top ) const;
-
-    // Hide the window
-    virtual void hide() const;
-
-    /// Move the window
-    virtual void moveResize( int left, int top,
-                             int width, int height ) const;
-
-    /// Bring the window on top
-    virtual void raise() const;
-
-    /// Set the opacity of the window (0 = transparent, 255 = opaque)
-    virtual void setOpacity( uint8_t value ) const;
-
-    /// Toggle the window on top
-    virtual void toggleOnTop( bool onTop ) const;
-
-    /// Get the Carbon window handle
-    WindowRef getWindowRef() const { return m_win; };
-
-private:
-    /// Parent window
-    MacOSXWindow *m_pParent;
-    /// Indicates whether the window handles drag&drop events
-    bool m_dragDrop;
-    /// Carbon Window object
-    WindowRef m_win;
-};
-
-
-#endif
diff --git a/modules/gui/skins2/src/os_factory.cpp b/modules/gui/skins2/src/os_factory.cpp
index cbf81ab..b00be30 100644
--- a/modules/gui/skins2/src/os_factory.cpp
+++ b/modules/gui/skins2/src/os_factory.cpp
@@ -28,8 +28,6 @@
 #include "../x11/x11_factory.hpp"
 #elif defined WIN32_SKINS
 #include "../win32/win32_factory.hpp"
-#elif defined MACOSX_SKINS
-#include "../macosx/macosx_factory.hpp"
 #elif defined OS2_SKINS
 #include "../os2/os2_factory.hpp"
 #endif
@@ -43,8 +41,6 @@ OSFactory *OSFactory::instance( intf_thread_t *pIntf )
         pOsFactory = new X11Factory( pIntf );
 #elif defined WIN32_SKINS
         pOsFactory = new Win32Factory( pIntf );
-#elif defined MACOSX_SKINS
-        pOsFactory = new MacOSXFactory( pIntf );
 #elif defined OS2_SKINS
         pOsFactory = new OS2Factory( pIntf );
 #else
-- 
2.9.3 (Apple Git-75)




More information about the vlc-devel mailing list