Commit aa1d6fe8 authored by Olivier Teulière's avatar Olivier Teulière

* skins2/src/generic_window.cpp: avoid crashing on Ctrl+S when there

        is no dialog provider
 * skins/*: renamed 'onclick' attribute to 'action', to be coherent with
        other controls
parent 42113b34
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* builder.cpp * builder.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: builder.cpp,v 1.9 2004/03/02 21:45:15 ipkiss Exp $ * $Id$
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -342,14 +342,14 @@ void Builder::addImage( const BuilderData::Image &rData ) ...@@ -342,14 +342,14 @@ void Builder::addImage( const BuilderData::Image &rData )
pBmp->getHeight(), *pLayout ); pBmp->getHeight(), *pLayout );
// XXX: test to be changed! XXX // XXX: test to be changed! XXX
if( rData.m_onclickId == "move" ) if( rData.m_actionId == "move" )
{ {
CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(), CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(),
*pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ), *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ),
NULL); NULL);
pLayout->addControl( pMove, pos, rData.m_layer ); pLayout->addControl( pMove, pos, rData.m_layer );
} }
else if( rData.m_onclickId == "resize" ) else if( rData.m_actionId == "resize" )
{ {
CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout, CtrlResize *pResize = new CtrlResize( getIntf(), *pImage, *pLayout,
UString( getIntf(), rData.m_help.c_str() ), NULL ); UString( getIntf(), rData.m_help.c_str() ), NULL );
......
...@@ -6,7 +6,7 @@ Layout id:string width:int height:int minWidth:int maxWidth:int minHeight:int ma ...@@ -6,7 +6,7 @@ Layout id:string width:int height:int minWidth:int maxWidth:int minHeight:int ma
Anchor xPos:int yPos:int range:int priority:int points:string windowId:string Anchor xPos:int yPos:int range:int priority:int points:string windowId:string
Button id:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string Button id:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string actionId:string tooltip:string help:string layer:int windowId:string layoutId:string
Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string Checkbox id:string xPos:int yPos:int leftTop:string rightBottom:string up1Id:string down1Id:string over1Id:string up2Id:string down2Id:string over2Id:string state:string action1:string action2:string tooltip1:string tooltip2:string help:string layer:int windowId:string layoutId:string
Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string onclickId:string help:string layer:int windowId:string layoutId:string Image id:string xPos:int yPos:int leftTop:string rightBottom:string visible:bool bmpId:string actionId:string help:string layer:int windowId:string layoutId:string
Text id:string xPos:int yPos:int fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string Text id:string xPos:int yPos:int fontId:string text:string width:int color:uint32_t help:string layer:int windowId:string layoutId:string
RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string RadialSlider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string sequence:string nbImages:int minAngle:float maxAngle:float value:string tooltip:string help:string layer:int windowId:string layoutId:string
Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string Slider id:string visible:string xPos:int yPos:int leftTop:string rightBottom:string upId:string downId:string overId:string points:string thickness:int value:string tooltip:string help:string layer:int windowId:string layoutId:string
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* builder_data.hpp * builder_data.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: builder_data.hpp,v 1.6 2004/03/02 21:45:15 ipkiss Exp $ * $Id$
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
#ifndef BUILDER_DATA_HPP #ifndef BUILDER_DATA_HPP
#define BUILDER_DATA_HPP #define BUILDER_DATA_HPP
using namespace std;
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <list> #include <list>
#include <map> #include <map>
#include <string> #include <string>
using namespace std;
/// Structure for mapping data from XML file /// Structure for mapping data from XML file
struct BuilderData struct BuilderData
{ {
...@@ -186,8 +186,8 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( ...@@ -186,8 +186,8 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
/// Type definition /// Type definition
struct Image struct Image
{ {
Image( const string & id, int xPos, int yPos, const string & leftTop, const string & rightBottom, bool visible, const string & bmpId, const string & onclickId, const string & help, int layer, const string & windowId, const string & layoutId ): Image( const string & id, int xPos, int yPos, const string & leftTop, const string & rightBottom, bool visible, const string & bmpId, const string & actionId, const string & help, int layer, const string & windowId, const string & layoutId ):
m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_bmpId( bmpId ), m_onclickId( onclickId ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {} m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( rightBottom ), m_visible( visible ), m_bmpId( bmpId ), m_actionId( actionId ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
const string m_id; const string m_id;
int m_xPos; int m_xPos;
...@@ -196,7 +196,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom( ...@@ -196,7 +196,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
const string m_rightBottom; const string m_rightBottom;
bool m_visible; bool m_visible;
const string m_bmpId; const string m_bmpId;
const string m_onclickId; const string m_actionId;
const string m_help; const string m_help;
int m_layer; int m_layer;
const string m_windowId; const string m_windowId;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin_parser.cpp * skin_parser.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 VideoLAN * Copyright (C) 2004 VideoLAN
* $Id: skin_parser.cpp,v 1.5 2004/03/02 21:45:15 ipkiss Exp $ * $Id$
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* *
...@@ -95,7 +95,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr ) ...@@ -95,7 +95,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
const BuilderData::Image imageData( uniqueId( attr["id"] ), atoi( attr["x"] ) + const BuilderData::Image imageData( uniqueId( attr["id"] ), atoi( attr["x"] ) +
m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"], m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
attr["rightbottom"], ConvertBoolean( attr["visible"] ), attr["rightbottom"], ConvertBoolean( attr["visible"] ),
attr["image"], attr["onclick"], attr["help"], m_curLayer, attr["image"], attr["action"], attr["help"], m_curLayer,
m_curWindowId, m_curLayoutId ); m_curWindowId, m_curLayoutId );
m_curLayer++; m_curLayer++;
m_data.m_listImage.push_back( imageData ); m_data.m_listImage.push_back( imageData );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* generic_window.cpp * generic_window.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: generic_window.cpp,v 1.3 2004/02/29 16:49:55 asmax Exp $ * $Id$
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -212,7 +212,11 @@ void GenericWindow::processEvent( EvtKey &rEvtKey ) ...@@ -212,7 +212,11 @@ void GenericWindow::processEvent( EvtKey &rEvtKey )
if( (rEvtKey.getMod() & EvtInput::kModCtrl) && if( (rEvtKey.getMod() & EvtInput::kModCtrl) &&
rEvtKey.getKey() == 's' ) rEvtKey.getKey() == 's' )
{ {
Dialogs::instance( getIntf() )->showChangeSkin(); Dialogs *pDialogs = Dialogs::instance( getIntf() );
if( pDialogs != NULL )
{
pDialogs->showChangeSkin();
}
return; return;
} }
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
lefttop CDATA "lefttop" lefttop CDATA "lefttop"
rightbottom CDATA "lefttop" rightbottom CDATA "lefttop"
image CDATA #REQUIRED image CDATA #REQUIRED
onclick CDATA "none" action CDATA "none"
help CDATA "" help CDATA ""
> >
<!ELEMENT Button EMPTY> <!ELEMENT Button EMPTY>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<Layout id="testlayout" width="424" height="152"> <Layout id="testlayout" width="424" height="152">
<Group x="0" y="0"> <Group x="0" y="0">
<Image x="0" y="0" image="mainbody" onclick="move"/> <Image x="0" y="0" image="mainbody" action="move"/>
<Button x="8" y="5" up="close" down="close_onclick" over="close_mouseover" action="vlc.quit()" tooltiptext="Quit VLC"/> <Button x="8" y="5" up="close" down="close_onclick" over="close_mouseover" action="vlc.quit()" tooltiptext="Quit VLC"/>
</Group> </Group>
</Layout> </Layout>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<Layout id="mainlayout" width="424" height="152"> <Layout id="mainlayout" width="424" height="152">
<Group x="0" y="0"> <Group x="0" y="0">
<Anchor x="7" y="151" points="(0,0)" priority="100"/> <Anchor x="7" y="151" points="(0,0)" priority="100"/>
<Image x="0" y="0" image="mainbody" onclick="move"/> <Image x="0" y="0" image="mainbody" action="move"/>
<Text font="default_font" width="70" x="287" y="79" text="$T" color="#000000"/> <Text font="default_font" width="70" x="287" y="79" text="$T" color="#000000"/>
<Button x="42" y="42" up="preferences" down="preferences_onclick" over="preferences" action="dialogs.prefs()" tooltiptext="Preferences"/> <Button x="42" y="42" up="preferences" down="preferences_onclick" over="preferences" action="dialogs.prefs()" tooltiptext="Preferences"/>
<Button x="17" y="64" up="stop" down="stop_onclick" over="stop" action="vlc.stop()" tooltiptext="Stop"/> <Button x="17" y="64" up="stop" down="stop_onclick" over="stop" action="vlc.stop()" tooltiptext="Stop"/>
...@@ -97,15 +97,15 @@ ...@@ -97,15 +97,15 @@
<Layout id="playlistLayout" width="410" height="250" minwidth="200" minheight="150" maxwidth="1000" maxheight="800"> <Layout id="playlistLayout" width="410" height="250" minwidth="200" minheight="150" maxwidth="1000" maxheight="800">
<Group x="0" y="0"> <Group x="0" y="0">
<Anchor x="0" y="0" points="(0,0)" priority="50"/> <Anchor x="0" y="0" points="(0,0)" priority="50"/>
<Image image="playlist1" x="0" y="0" lefttop="lefttop" rightbottom="lefttop" onclick="move"/> <Image image="playlist1" x="0" y="0" lefttop="lefttop" rightbottom="lefttop" action="move"/>
<Image image="playlist2" x="17" y="0" lefttop="lefttop" rightbottom="righttop" onclick="move"/> <Image image="playlist2" x="17" y="0" lefttop="lefttop" rightbottom="righttop" action="move"/>
<Image image="playlist3" x="350" y="0" lefttop="righttop" rightbottom="righttop" onclick="move"/> <Image image="playlist3" x="350" y="0" lefttop="righttop" rightbottom="righttop" action="move"/>
<Image image="playlist4" x="0" y="70" lefttop="lefttop" rightbottom="leftbottom" onclick="move"/> <Image image="playlist4" x="0" y="70" lefttop="lefttop" rightbottom="leftbottom" action="move"/>
<Image image="playlist6" x="350" y="70" lefttop="righttop" rightbottom="rightbottom" onclick="move"/> <Image image="playlist6" x="350" y="70" lefttop="righttop" rightbottom="rightbottom" action="move"/>
<Image image="playlist7" x="0" y="200" lefttop="leftbottom" rightbottom="leftbottom" onclick="move"/> <Image image="playlist7" x="0" y="200" lefttop="leftbottom" rightbottom="leftbottom" action="move"/>
<Image image="playlist8" x="17" y="200" lefttop="leftbottom" rightbottom="rightbottom" onclick="move"/> <Image image="playlist8" x="17" y="200" lefttop="leftbottom" rightbottom="rightbottom" action="move"/>
<Image image="playlist9" x="350" y="200" lefttop="rightbottom" rightbottom="rightbottom" onclick="move"/> <Image image="playlist9" x="350" y="200" lefttop="rightbottom" rightbottom="rightbottom" action="move"/>
<Image image="resize" x="392" y="232" lefttop="rightbottom" rightbottom="rightbottom" onclick="resize"/> <Image image="resize" x="392" y="232" lefttop="rightbottom" rightbottom="rightbottom" action="resize"/>
<Button x="374" y="12" lefttop="righttop" rightbottom="righttop" up="add_item" down="add_item_onclick" over="add_item" action="playlist.add()" tooltiptext="Add item"/> <Button x="374" y="12" lefttop="righttop" rightbottom="righttop" up="add_item" down="add_item_onclick" over="add_item" action="playlist.add()" tooltiptext="Add item"/>
<Button x="374" y="40" up="delete_item" lefttop="righttop" rightbottom="righttop" down="delete_item_onclick" over="delete_item" action="playlist.del()" tooltiptext="Del item"/> <Button x="374" y="40" up="delete_item" lefttop="righttop" rightbottom="righttop" down="delete_item_onclick" over="delete_item" action="playlist.del()" tooltiptext="Del item"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment