Commit a992f271 authored by Marvin Scholz's avatar Marvin Scholz

skins2: Remove macOS code

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 commit removes all macOS related skins2 code.
parent 8ae6c8bb
......@@ -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
/*****************************************************************************
* macosx_dragdrop.cpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_dragdrop.hpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_factory.cpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_factory.hpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_graphics.cpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_graphics.hpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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
/*****************************************************************************
* macosx_loop.cpp
*****************************************************************************
* Copyright (C) 2003 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@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 )