Commit 7253e738 authored by Olivier Teulière's avatar Olivier Teulière

Removed the old skins plugin

parent dae08eab
#!/bin/sh
FEATURES="
SKINS skins
SKINS skins2
FAMILIAR familiar
WXWINDOWS wxwindows
......
......@@ -2113,7 +2113,7 @@ dnl
dnl MP4 module
dnl
AC_CHECK_HEADERS(zlib.h, [
VLC_ADD_LDFLAGS([mp4 skins skins2 sap],[-lz])
VLC_ADD_LDFLAGS([mp4 skins2 sap],[-lz])
] )
AC_CHECK_HEADERS(sysfs/libsysfs.h, [
......@@ -2121,10 +2121,10 @@ AC_CHECK_HEADERS(sysfs/libsysfs.h, [
] )
dnl
dnl skins module
dnl skins2 module
dnl
AC_CHECK_HEADERS(libtar.h, [
VLC_ADD_LDFLAGS([skins skins2],[-ltar])
VLC_ADD_LDFLAGS([skins2],[-ltar])
] )
......@@ -3131,29 +3131,6 @@ then
VLC_ADD_BUILTINS([beos])
fi
dnl
dnl Skins module
dnl
AC_ARG_ENABLE(skins,
[ --enable-skins Skins interface module (default enabled on Win32)])
if test "${enable_skins}" != "no"; then
if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
VLC_ADD_PLUGINS([skins])
ALIASES="${ALIASES} svlc"
VLC_ADD_CPPFLAGS([skins],[-U_OFF_T_ -U_off_t -Imodules/gui/skins])
VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
VLC_ADD_LDFLAGS([skins],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
else if test "${enable_skins}" = "yes"; then
VLC_ADD_PLUGINS([skins])
ALIASES="${ALIASES} svlc"
VLC_ADD_CPPFLAGS([skins],[-Imodules/gui/skins -I${x_includes} -I/usr/include/freetype2 -DX11_SKINS])
VLC_ADD_CXXFLAGS([skins],[-O2 -fno-rtti])
VLC_ADD_LDFLAGS([skins],[-L${x_libraries} -lImlib2 -lXext -lX11 -lfreetype -lpng -lz ])
fi fi
fi
dnl
dnl Skins2 module
dnl
......@@ -4076,7 +4053,6 @@ AC_CONFIG_FILES([
modules/gui/macosx/Makefile
modules/gui/qnx/Makefile
modules/gui/qt/Makefile
modules/gui/skins/Makefile
modules/gui/skins2/Makefile
modules/gui/wxwindows/Makefile
modules/misc/Makefile
......
......@@ -386,8 +386,6 @@ $Id$
* skins2: Skinnable interface, new generation
* skins: Skinnable interface
* slp: input module to access SLP registered sessions
* snapshot: a output module to save pictures from the vout.
......
SOURCES_skins = \
os_api.h \
os_bitmap.h \
os_event.h \
os_font.h \
os_graphics.h \
os_theme.h \
os_window.h \
\
controls/controls.h \
controls/button.cpp \
controls/button.h \
controls/checkbox.cpp \
controls/checkbox.h \
controls/generic.cpp \
controls/generic.h \
controls/image.cpp \
controls/image.h \
controls/playlist.cpp \
controls/playlist.h \
controls/rectangle.cpp \
controls/rectangle.h \
controls/slider.cpp \
controls/slider.h \
controls/text.cpp \
controls/text.h \
\
parser/flex.c \
parser/skin.h \
parser/skin.c \
parser/wrappers.h \
parser/wrappers.cpp \
\
src/anchor.cpp \
src/anchor.h \
src/banks.cpp \
src/banks.h \
src/bezier.cpp \
src/bezier.h \
src/bitmap.cpp \
src/bitmap.h \
src/dialogs.cpp \
src/dialogs.h \
src/event.cpp \
src/event.h \
src/font.cpp \
src/font.h \
src/graphics.cpp \
src/graphics.h \
src/skin_main.cpp \
src/skin_common.h \
src/theme.cpp \
src/theme.h \
src/themeloader.cpp \
src/themeloader.h \
src/vlcproc.cpp \
src/vlcproc.h \
src/window.cpp \
src/window.h \
\
win32/win32_api.cpp \
win32/win32_bitmap.cpp \
win32/win32_bitmap.h \
win32/win32_dragdrop.cpp \
win32/win32_dragdrop.h \
win32/win32_event.cpp \
win32/win32_event.h \
win32/win32_font.cpp \
win32/win32_font.h \
win32/win32_graphics.cpp \
win32/win32_graphics.h \
win32/win32_run.cpp \
win32/win32_theme.cpp \
win32/win32_theme.h \
win32/win32_window.cpp \
win32/win32_window.h \
\
x11/x11_api.cpp \
x11/x11_bitmap.cpp \
x11/x11_bitmap.h \
x11/x11_dragdrop.cpp \
x11/x11_dragdrop.h \
x11/x11_event.cpp \
x11/x11_event.h \
x11/x11_font.cpp \
x11/x11_font.h \
x11/x11_graphics.cpp \
x11/x11_graphics.h \
x11/x11_run.cpp \
x11/x11_theme.cpp \
x11/x11_theme.h \
x11/x11_timer.cpp \
x11/x11_timer.h \
x11/x11_window.cpp \
x11/x11_window.h \
$(NULL)
EXTRA_DIST += \
parser/skin.dtd \
parser/skin.act
/*****************************************************************************
* button.cpp: Button control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: button.cpp,v 1.15 2003/06/09 12:33:16 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@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., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
//--- SKIN ------------------------------------------------------------------
#include "../src/bitmap.h"
#include "../src/banks.h"
#include "generic.h"
#include "button.h"
#include "../src/event.h"
#include "../src/theme.h"
#include "../src/window.h"
#include "../src/skin_common.h"
//---------------------------------------------------------------------------
// Control Button
//---------------------------------------------------------------------------
ControlButton::ControlButton(
string id,
bool visible,
int x, int y,
string Up, string Down, string Disabled,
string onclick, string onmouseover, string onmouseout,
string tooltiptext, string help,
SkinWindow *Parent ) : GenericControl( id, visible, help, Parent )
{
// General
Left = x;
Top = y;
State = 1; // 1=up, 0=down
Selected = false;
Enabled = true;
CursorIn = false;
this->Up = Up;
this->Down = Down;
this->Disabled = Disabled;
// Actions
ClickActionName = onclick;
MouseOverActionName = onmouseover;
MouseOutActionName = onmouseout;
// Texts
ToolTipText = tooltiptext;
}
//---------------------------------------------------------------------------
ControlButton::~ControlButton()
{
if( ClickAction )
{
delete ClickAction;
}
if( MouseOverAction )
{
delete MouseOverAction;
}
if( MouseOutAction )
{
delete MouseOutAction;
}
}
//---------------------------------------------------------------------------
void ControlButton::Init()
{
// Init bitmaps
Img = new (Bitmap *[3]);
Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( Up );
Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Down );
if( Disabled == "none" )
Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Up );
else
Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Disabled );
// Get size of control
Img[0]->GetSize( Width, Height );
// Create script
ClickAction = new Action( p_intf, ClickActionName );
MouseOverAction = new Action( p_intf, MouseOverActionName );
MouseOutAction = new Action( p_intf, MouseOutActionName );
}
//---------------------------------------------------------------------------
bool ControlButton::ProcessEvent( Event *evt )
{
switch( evt->GetMessage() )
{
case CTRL_ENABLED:
Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
break;
}
return false;
}
//---------------------------------------------------------------------------
void ControlButton::MoveRelative( int xOff, int yOff )
{
Left += xOff;
Top += yOff;
}
//---------------------------------------------------------------------------
void ControlButton::Draw( int x, int y, int w, int h, Graphics *dest )
{
if( !Visible )
return;
int xI, yI, wI, hI;
if( GetIntersectRgn( x,y,w,h,Left,Top,Width,Height, xI, yI, wI, hI ) )
{
// Button is in down state
if( State == 0 && Enabled )
Img[1]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
// Button is in up state
if( State == 1 && Enabled )
Img[0]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
// Button is disabled
if( !Enabled )
Img[2]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
}
}
//---------------------------------------------------------------------------
bool ControlButton::MouseUp( int x, int y, int button )
{
// If hit in the button
// XXX: we suppose here that the expected behaviour is to have the MouseUp
// event above the "up" image, and not above the "down" one. This can give
// strange results when the "up" and "down" images have different sizes...
if( Img[1]->Hit( x - Left, y - Top ) )
{
if( !Enabled )
return true;
if( button == 1 && Selected )
{
State = 1;
Selected = false;
ClickAction->SendEvent();
ParentWindow->Refresh( Left, Top, Width, Height );
}
return true;
}
if( button == 1 )
Selected = false;
return false;
}
//---------------------------------------------------------------------------
bool ControlButton::MouseDown( int x, int y, int button )
{
if( Img[0]->Hit( x - Left, y - Top ) )
{
if( !Enabled )
return true;
if( button == 1 )
{
State = 0;
Selected = true;
ParentWindow->Refresh( Left, Top, Width, Height );
}
return true;
}
return false;
}
//---------------------------------------------------------------------------
bool ControlButton::MouseMove( int x, int y, int button )
{
if( !Enabled )
return false;
if( MouseOver( x, y ) && !CursorIn )
{
if( button == 1 && Selected )
{
State = 0;
ParentWindow->Refresh( Left, Top, Width, Height );
}
if( MouseOverActionName != "none" )
{
MouseOverAction->SendEvent();
}
CursorIn = true;
return true;
}
else if( !MouseOver( x, y ) && CursorIn )
{
if( button == 1 && Selected )
{
State = 1;
ParentWindow->Refresh( Left, Top, Width, Height );
}
if( MouseOutActionName != "none" )
{
MouseOutAction->SendEvent();
}
CursorIn = false;
return true;
}
return false;
}
//---------------------------------------------------------------------------
bool ControlButton::MouseOver( int x, int y )
{
if( Img[1 - State]->Hit( x - Left, y - Top ) )
{
return true;
}
else
{
return false;
}
}
//---------------------------------------------------------------------------
bool ControlButton::ToolTipTest( int x, int y )
{
if( MouseOver( x, y ) && Enabled )
{
ParentWindow->ChangeToolTipText( ToolTipText );
return true;
}
return false;
}
//---------------------------------------------------------------------------
void ControlButton::Enable( Event *event, bool enabled )
{
if( !ClickAction->MatchEvent( event, ACTION_MATCH_ONE ) )
return;
if( enabled != Enabled )
{
Enabled = enabled;
// If cursor is in, send mouse out event
if( !Enabled && CursorIn )
{
if( MouseOutActionName != "none" )
MouseOutAction->SendEvent();
CursorIn = false;
}
ParentWindow->Refresh( Left, Top, Width, Height );
}
}
//---------------------------------------------------------------------------
/*****************************************************************************
* button.h: Button control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: button.h,v 1.3 2003/04/21 21:51:16 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@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., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
#ifndef VLC_SKIN_CONTROL_BUTTON
#define VLC_SKIN_CONTROL_BUTTON
//--- GENERAL ---------------------------------------------------------------
#include <string>
using namespace std;
//---------------------------------------------------------------------------
class Action;
class Graphics;
class SkinWindow;
//---------------------------------------------------------------------------
class ControlButton : public GenericControl
{
private:
// Image IDs
string Up;
string Down;
string Disabled;
// Control behaviour
bool Selected;
bool Enabled;
bool CursorIn;
// List of actions to execute
Action *ClickAction;
string ClickActionName;
Action *MouseOverAction;
string MouseOverActionName;
Action *MouseOutAction;
string MouseOutActionName;
// ToolTip text
string ToolTipText;
public:
// Constructor
ControlButton( string id,
bool visible,
int x, int y,
string Up, string Down, string Disabled,
string onclick, string onmousevoer, string onmouseout,
string tooltiptext, string help,
SkinWindow *Parent );
// Destructor
virtual ~ControlButton();
// Initializations
virtual void Init();
virtual bool ProcessEvent( Event *evt );
// Draw button
virtual void Draw( int x1, int y1, int x2, int y2, Graphics *dest );
// Mouse events
virtual bool MouseUp( int x, int y, int button );
virtual bool MouseDown( int x, int y, int button );
virtual bool MouseMove( int x, int y, int button );
virtual bool MouseOver( int x, int y );
virtual bool ToolTipTest( int x, int y );
// Translate control
virtual void MoveRelative( int xOff, int yOff );
// Enabling control
virtual void Enable( Event *event, bool enabled );
};
//---------------------------------------------------------------------------
#endif
/*****************************************************************************
* checkbox.cpp: Checkbox control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: checkbox.cpp,v 1.9 2003/07/26 15:36:46 gbazin Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@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., 59 Temple Place - Suite 330, Boston, MA 02111,
* USA.
*****************************************************************************/
//--- VLC -------------------------------------------------------------------
#include <vlc/vlc.h>
#include <vlc/intf.h>
//--- SKIN ------------------------------------------------------------------
#include "../src/bitmap.h"
#include "../src/banks.h"
#include "generic.h"
#include "checkbox.h"
#include "../src/event.h"
#include "../src/theme.h"
#include "../src/window.h"
#include "../src/skin_common.h"
#include "../os_event.h"
#include "../os_window.h"
//---------------------------------------------------------------------------
// Checkbox Button
//---------------------------------------------------------------------------
ControlCheckBox::ControlCheckBox(
string id,
bool visible,
int x, int y,
string img1, string img2, string clickimg1, string clickimg2,
string disabled1, string disabled2,
string onclick1, string onclick2, string onmouseover1,
string onmouseout1, string onmouseover2, string onmouseout2,
string tooltiptext1, string tooltiptext2, string help,
SkinWindow *Parent ) : GenericControl( id, visible, help, Parent )
{
Left = x;
Top = y;
State = 1; // 1 = up - 0 = down
Selected = false;
CursorIn = false;
Act = 1;
Enabled1 = true;
Enabled2 = true;
Img1 = img1;
Img2 = img2;
Click1 = clickimg1;
Click2 = clickimg2;
Disabled1 = disabled1;
Disabled2 = disabled2;
// Actions
ClickActionName1 = onclick1;
ClickActionName2 = onclick2;
MouseOverActionName1 = onmouseover1;
MouseOutActionName1 = onmouseout1;
if( onmouseover2 == "none" )
MouseOverActionName2 = MouseOverActionName1;
else
MouseOverActionName2 = onmouseover2;
if( onmouseout2 == "none" )
MouseOutActionName2 = MouseOutActionName1;
else
MouseOutActionName2 = onmouseout2;
// Tooltips
ToolTipText1 = tooltiptext1;
ToolTipText2 = tooltiptext2;
}
//---------------------------------------------------------------------------
ControlCheckBox::~ControlCheckBox()
{
if( ClickAction1 )
{
delete ClickAction1;
}
if( ClickAction2 )
{
delete ClickAction2;
}
if( MouseOverAction1 )
{
delete MouseOverAction1;
}
if( MouseOverAction2 )
{
delete MouseOverAction2;
}
if( MouseOutAction1 )
{
delete MouseOutAction1;
}
if( MouseOutAction2 )
{
delete MouseOutAction2;
}
}
//---------------------------------------------------------------------------
void ControlCheckBox::Init()
{
Img = new (Bitmap *[6]);
// Images for position 1
Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
if( Click1 == "none" )
Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Img2 );
else
Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Click1 );
// Images for position 2
Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Img2 );
if( Click2 == "none" )
Img[3] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
else
Img[3] = p_intf->p_sys->p_theme->BmpBank->Get( Click2 );
// Disabled images
if( Disabled1 == "none" )
Img[4] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
else