]> git.sesse.net Git - vlc/commitdiff
* skins2/src/generic_window.cpp: avoid crashing on Ctrl+S when there
authorOlivier Teulière <ipkiss@videolan.org>
Sat, 6 Mar 2004 16:25:46 +0000 (16:25 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Sat, 6 Mar 2004 16:25:46 +0000 (16:25 +0000)
        is no dialog provider
 * skins/*: renamed 'onclick' attribute to 'action', to be coherent with
        other controls

modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/builder_data.def
modules/gui/skins2/parser/builder_data.hpp
modules/gui/skins2/parser/skin_parser.cpp
modules/gui/skins2/src/generic_window.cpp
modules/gui/skins2/theme/skin.dtd
modules/gui/skins2/theme/theme.xml

index 5061fa3240938242256fdb22d99e6ed68e98d0a6..2ed75d6cc2f7f91ccb0af2d439de474d2c0739cf 100755 (executable)
@@ -2,7 +2,7 @@
  * builder.cpp
  *****************************************************************************
  * 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>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -342,14 +342,14 @@ void Builder::addImage( const BuilderData::Image &rData )
                                        pBmp->getHeight(), *pLayout );
 
     // XXX: test to be changed! XXX
-    if( rData.m_onclickId == "move" )
+    if( rData.m_actionId == "move" )
     {
         CtrlMove *pMove = new CtrlMove( getIntf(), m_pTheme->getWindowManager(),
              *pImage, *pWindow, UString( getIntf(), rData.m_help.c_str() ),
              NULL);
         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,
                 UString( getIntf(), rData.m_help.c_str() ), NULL );
index 159798693eb37f2a658d962ef52956f118d55425..7c89ba28a72fcbae26c6c01222d93190c41ea2b0 100644 (file)
@@ -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
 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
-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
 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
index bfab368c162f0ddef260dd76df7e62efc23aebc2..4c893e7fda5d76c7051b3a5ed0e791c48de423aa 100644 (file)
@@ -2,7 +2,7 @@
  * builder_data.hpp
  *****************************************************************************
  * 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>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
 #ifndef BUILDER_DATA_HPP
 #define BUILDER_DATA_HPP
 
-using namespace std;
-
 #include <vlc/vlc.h>
 #include <list>
 #include <map>
 #include <string>
 
+using namespace std;
+
 /// Structure for mapping data from XML file
 struct BuilderData
 {
@@ -186,8 +186,8 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
     /// Type definition
     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 ):
-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 ) {}
+        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_actionId( actionId ), m_help( help ), m_layer( layer ), m_windowId( windowId ), m_layoutId( layoutId ) {}
 
         const string m_id;
         int m_xPos;
@@ -196,7 +196,7 @@ m_id( id ), m_xPos( xPos ), m_yPos( yPos ), m_leftTop( leftTop ), m_rightBottom(
         const string m_rightBottom;
         bool m_visible;
         const string m_bmpId;
-        const string m_onclickId;
+        const string m_actionId;
         const string m_help;
         int m_layer;
         const string m_windowId;
index 7d92e8583faac83f76c58bbfc3603f45213a47f3..7c8ea53e632aa6b573c18095824743577229a4ec 100644 (file)
@@ -2,7 +2,7 @@
  * skin_parser.cpp
  *****************************************************************************
  * 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>
  *
@@ -95,7 +95,7 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
         const BuilderData::Image imageData( uniqueId( attr["id"] ), atoi( attr["x"] ) +
                 m_xOffset, atoi( attr["y"] ) + m_yOffset, attr["lefttop"],
                 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_curLayer++;
         m_data.m_listImage.push_back( imageData );
index 7803ef86d5f27d43a6337dc283c39ff0cb0e472c..d3a2d5ac154ba031ee9e37bf331f36e26633293e 100644 (file)
@@ -2,7 +2,7 @@
  * generic_window.cpp
  *****************************************************************************
  * 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>
  *          Olivier Teulière <ipkiss@via.ecp.fr>
@@ -212,7 +212,11 @@ void GenericWindow::processEvent( EvtKey &rEvtKey )
         if( (rEvtKey.getMod() & EvtInput::kModCtrl) &&
             rEvtKey.getKey() == 's' )
         {
-            Dialogs::instance( getIntf() )->showChangeSkin();
+            Dialogs *pDialogs = Dialogs::instance( getIntf() );
+            if( pDialogs != NULL )
+            {
+                pDialogs->showChangeSkin();
+            }
             return;
         }
 
index 98df0f84d1107430a504fac6ca3a123549d5d92a..efe40b543edc6397739a8943f797563720d8999e 100644 (file)
@@ -81,7 +81,7 @@
         lefttop     CDATA   "lefttop"
         rightbottom CDATA   "lefttop"
         image       CDATA   #REQUIRED
-        onclick     CDATA   "none"
+        action      CDATA   "none"
         help        CDATA   ""
     >
 <!ELEMENT Button EMPTY>
index 78255f40f4cbfbfbbccc849cce17f4652499b4f9..3a80caf919aeed7dd368dc14c9ba03080706a125 100644 (file)
@@ -68,7 +68,7 @@
 
     <Layout id="testlayout" width="424" height="152">
     <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"/>
     </Group>
    </Layout>
@@ -76,7 +76,7 @@
    <Layout id="mainlayout" width="424" height="152">
     <Group x="0" y="0">
       <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"/>
       <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"/>
    <Layout id="playlistLayout" width="410" height="250" minwidth="200" minheight="150" maxwidth="1000" maxheight="800">
     <Group x="0" y="0">
       <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="playlist2" x="17" y="0" lefttop="lefttop" rightbottom="righttop" onclick="move"/>
-      <Image image="playlist3" x="350" y="0" lefttop="righttop" rightbottom="righttop" onclick="move"/>
-      <Image image="playlist4" x="0" y="70" lefttop="lefttop" rightbottom="leftbottom" onclick="move"/>
-      <Image image="playlist6" x="350" y="70" lefttop="righttop" rightbottom="rightbottom" onclick="move"/>
-      <Image image="playlist7" x="0" y="200" lefttop="leftbottom" rightbottom="leftbottom" onclick="move"/>
-      <Image image="playlist8" x="17" y="200" lefttop="leftbottom" rightbottom="rightbottom" onclick="move"/>
-      <Image image="playlist9" x="350" y="200" lefttop="rightbottom" rightbottom="rightbottom" onclick="move"/> 
-      <Image image="resize" x="392" y="232" lefttop="rightbottom" rightbottom="rightbottom" onclick="resize"/>
+      <Image image="playlist1" x="0" y="0" lefttop="lefttop" rightbottom="lefttop" action="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" action="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" action="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" action="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" 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="40" up="delete_item" lefttop="righttop" rightbottom="righttop" down="delete_item_onclick" over="delete_item" action="playlist.del()" tooltiptext="Del item"/>