[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/zippl
From:       Klaas Freitag <freitag () suse ! de>
Date:       2010-06-11 14:25:38
Message-ID: 20100611142538.2B0E0AC8D2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1137059 by freitag:

TOC

 M  +12 -12    zippl.pro.user  
 M  +15 -1     zippl.xml  
 M  +23 -9     zipplxmlreader.cpp  
 M  +1 -0      zipplxmlreader.h  


--- trunk/playground/office/zippl/zippl.pro.user #1137058:1137059
@@ -84,14 +84,14 @@
     <value type="QString">CSHEDIT=emacs</value>
     <value type="QString">CVSROOT=:pserver:freitag@cvs.kde.org:/home/kde</value>
     <value type="QString">CVS_RSH=ssh</value>
-    <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Tyzud3zOAc,guid=7974408348b106ae2d7aeaf84c0f3cb3</value>
 +    <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-yXaeR5mAci,guid=3834d1030019827936330f924c11eb87</value>
  <value type="QString">DESKTOP_SESSION=kde4</value>
     <value type="QString">DISPLAY=:0</value>
     <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
     <value type="QString">ENV=/etc/bash.bashrc</value>
     <value type="QString">FROM_HEADER=</value>
     <value type="QString">GNOMEDIR=/opt/gnome</value>
-    <value type="QString">GPG_AGENT_INFO=/tmp/gpg-uchE0D/S.gpg-agent:4194:1</value>
+    <value type="QString">GPG_AGENT_INFO=/tmp/gpg-nONyQa/S.gpg-agent:2936:1</value>
     <value type="QString">GS_LIB=/suse/freitag/.fonts</value>
     <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve \
/gtk-2.0/gtkrc:/suse/freitag/.gtkrc-2.0-qtengine:/suse/freitag/.gtkrc-2.0:/suse/freitag/.kde4/share/config/gtkrc-2.0</value>
  <value type="QString">GTK_IM_MODULE=cedilla</value>
@@ -148,12 +148,12 @@
     <value type="QString">QT_PLUGIN_PATH=/suse/freitag/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/</value>
  <value type="QString">QT_SYSTEM_DIR=/usr/share/desktop-data</value>
     <value type="QString">SDK_HOME=/usr/lib64/jvm/java</value>
-    <value type="QString">SESSION_MANAGER=local/subbotin:@/tmp/.ICE-unix/4315,unix/subbotin:/tmp/.ICE-unix/4315</value>
 +    <value type="QString">SESSION_MANAGER=local/subbotin:@/tmp/.ICE-unix/3062,unix/subbotin:/tmp/.ICE-unix/3062</value>
  <value type="QString">SHELL=/bin/bash</value>
     <value type="QString">SHLVL=1</value>
-    <value type="QString">SSH_AGENT_PID=4195</value>
+    <value type="QString">SSH_AGENT_PID=2937</value>
     <value type="QString">SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass</value>
-    <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-UzMFn4135/agent.4135</value>
+    <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-jYnvY2878/agent.2878</value>
     <value type="QString">STARTUP=/usr/bin/startkde</value>
     <value type="QString">SWAMP_HOME=/space/eclipse/swamp</value>
     <value type="QString">TERM=xterm</value>
@@ -167,7 +167,7 @@
     <value type="QString">XCURSOR_THEME=crystalwhite</value>
     <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
     <value type="QString">XDG_DATA_DIRS=/usr/local/share:/usr/share:/etc/opt/kde3/share:/opt/arora/share:/opt/kde3/share</value>
                
-    <value type="QString">XDG_SESSION_COOKIE=e82c971ca19a39ecabfcee0047a6e996-1276066987.174186-451391814</value>
 +    <value type="QString">XDG_SESSION_COOKIE=e82c971ca19a39ecabfcee0047a6e996-1276242821.714387-256505445</value>
                
     <value type="QString">XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic</value>
  <value type="QString">XKEYSYMDB=/usr/share/X11/XKeysymDB</value>
     <value type="QString">XMODIFIERS=@im=local</value>
@@ -199,14 +199,14 @@
     <value type="QString">CSHEDIT=emacs</value>
     <value type="QString">CVSROOT=:pserver:freitag@cvs.kde.org:/home/kde</value>
     <value type="QString">CVS_RSH=ssh</value>
-    <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-Tyzud3zOAc,guid=7974408348b106ae2d7aeaf84c0f3cb3</value>
 +    <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-yXaeR5mAci,guid=3834d1030019827936330f924c11eb87</value>
  <value type="QString">DESKTOP_SESSION=kde4</value>
     <value type="QString">DISPLAY=:0</value>
     <value type="QString">DM_CONTROL=/var/run/xdmctl</value>
     <value type="QString">ENV=/etc/bash.bashrc</value>
     <value type="QString">FROM_HEADER=</value>
     <value type="QString">GNOMEDIR=/opt/gnome</value>
-    <value type="QString">GPG_AGENT_INFO=/tmp/gpg-uchE0D/S.gpg-agent:4194:1</value>
+    <value type="QString">GPG_AGENT_INFO=/tmp/gpg-nONyQa/S.gpg-agent:2936:1</value>
     <value type="QString">GS_LIB=/suse/freitag/.fonts</value>
     <value type="QString">GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/usr/share/themes//QtCurve \
/gtk-2.0/gtkrc:/suse/freitag/.gtkrc-2.0-qtengine:/suse/freitag/.gtkrc-2.0:/suse/freitag/.kde4/share/config/gtkrc-2.0</value>
  <value type="QString">GTK_IM_MODULE=cedilla</value>
@@ -263,12 +263,12 @@
     <value type="QString">QT_PLUGIN_PATH=/suse/freitag/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/</value>
  <value type="QString">QT_SYSTEM_DIR=/usr/share/desktop-data</value>
     <value type="QString">SDK_HOME=/usr/lib64/jvm/java</value>
-    <value type="QString">SESSION_MANAGER=local/subbotin:@/tmp/.ICE-unix/4315,unix/subbotin:/tmp/.ICE-unix/4315</value>
 +    <value type="QString">SESSION_MANAGER=local/subbotin:@/tmp/.ICE-unix/3062,unix/subbotin:/tmp/.ICE-unix/3062</value>
  <value type="QString">SHELL=/bin/bash</value>
     <value type="QString">SHLVL=1</value>
-    <value type="QString">SSH_AGENT_PID=4195</value>
+    <value type="QString">SSH_AGENT_PID=2937</value>
     <value type="QString">SSH_ASKPASS=/usr/lib64/ssh/x11-ssh-askpass</value>
-    <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-UzMFn4135/agent.4135</value>
+    <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-jYnvY2878/agent.2878</value>
     <value type="QString">STARTUP=/usr/bin/startkde</value>
     <value type="QString">SWAMP_HOME=/space/eclipse/swamp</value>
     <value type="QString">TERM=xterm</value>
@@ -282,7 +282,7 @@
     <value type="QString">XCURSOR_THEME=crystalwhite</value>
     <value type="QString">XDG_CONFIG_DIRS=/etc/xdg</value>
     <value type="QString">XDG_DATA_DIRS=/usr/local/share:/usr/share:/etc/opt/kde3/share:/opt/arora/share:/opt/kde3/share</value>
                
-    <value type="QString">XDG_SESSION_COOKIE=e82c971ca19a39ecabfcee0047a6e996-1276066987.174186-451391814</value>
 +    <value type="QString">XDG_SESSION_COOKIE=e82c971ca19a39ecabfcee0047a6e996-1276242821.714387-256505445</value>
                
     <value type="QString">XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic</value>
  <value type="QString">XKEYSYMDB=/usr/share/X11/XKeysymDB</value>
     <value type="QString">XMODIFIERS=@im=local</value>
--- trunk/playground/office/zippl/zippl.xml #1137058:1137059
@@ -9,7 +9,9 @@
     </author>
   </meta>
   <presentation width="10000" height="20000">
-    <spot x="-2000" y="0" color="#ffffff">
+    
+    <spot x="-2000" y="0" backgroundcolor="#ffffff">
+      <tocentry>A Greeting Page</tocentry>
     <image x="300" y="0">images/question-mark.jpg</image>
       <text x="50" y="0" font="Helvetica" size="40">Zippl Fun</text>
       <text x="50" y="64">Discover what you can do with Zippl!</text>
@@ -17,6 +19,7 @@
     </spot>
 
     <spot x="1000" y="0">
+      <tocentry>Sequences</tocentry>
       <image x="5" y="45">images/sequence.png</image>
       <text x="30" y="15">All presentation spots lie around on a huge</text>
       <text x="130" y="15" size="60">canvas</text>
@@ -36,6 +39,7 @@
     </spot>
 
     <spot x="0" y="4000">
+      <tocentry>Geometrics</tocentry>
       <circle x="350" y="190" r="22" linewidth="4" color="#afafaf"/>
       <rect x="370" y="220" width="80" height="44" color="#efefef"/>
       <text x="300" y="85">Spots can contain geometric forms:</text>
@@ -45,6 +49,7 @@
     </spot>
 
     <spot x="1000" y="4000">
+      <tocentry>Fonts</tocentry>
       <text x="0" y="10" font="Helvetica" >Text of course</text>
       <text x="0" y="40" font="Times">Of course Text</text>
       <text x="0" y="70" font="Trebuchet" size="30">And Text</text>
@@ -52,9 +57,18 @@
     </spot>
 
     <spot x="0" y="-6000">
+     <tocentry>Images</tocentry>
      <text x="0" y="4" size="32">And of course images!</text>
      <image x="10" y="58">images/bea.jpg</image>
      <circle x="36" y="125" r="12"/>
     </spot>
+    
+    <spot x="3000" y="-4500">
+      <tocentry>Thanks!</tocentry>
+      <text x="440" y="5" size="66" color="#d19c10">Thanks!</text>
+      <text x="10" y="65" size="20">Zippl is just a proof of concept yet!</text>
+      <text x="10" y="100" size="20">Find the code in playground/office of \
KDE.</text> +      <text x="10" y="140" size="20" color="#669900">Send Feedback to \
Klaas Freitag &lt;freitag@suse.de&gt;</text> +    </spot>
   </presentation>
 </zippl>
--- trunk/playground/office/zippl/zipplxmlreader.cpp #1137058:1137059
@@ -7,6 +7,7 @@
 
 ZipplXmlReader::ZipplXmlReader( GraphWidget *widget )
   :mGraphWidget( widget ),
+  mToc(0),
   mMode( "production")
 {
 
@@ -80,12 +81,14 @@
 
   QGraphicsScene *scene = mGraphWidget->scene();
   int spotID = 0;
+  int tocCount = 0;
 
   while (!atEnd()) {
     readNext();
 
     if( isStartElement() ) {
       qDebug() << "XML name: " << name();
+
       if( name() == "presentation") {
         // presentation mode: debug & presentation
         QString mode = attributes().value("mode").toString();
@@ -96,6 +99,24 @@
         QRectF rect( dx, dy, -2.0*dx, -2.0*dy );
         scene->setSceneRect( rect );
 
+      } else if( name() == "toc" ) {
+        QGraphicsRectItem *rect = new QGraphicsRectItem();
+        rect->setPen( pen( rect->pen(),QColor("#aeaeae") ) );
+        rect->setBrush( brush( rect->brush() ) );
+        rect->setPos( position() );
+        mToc = rect;
+        tocCount = 0;
+        mCurrParent = mToc;
+        scene->addItem( mCurrParent );
+
+      } else if( name() == "tocentry" ) {
+        if( mToc ) {
+          QGraphicsSimpleTextItem *textItem = new QGraphicsSimpleTextItem( mToc, \
scene ); +          QString toccy = QString("%1. %2").arg( 1+tocCount ).arg( \
readElementText() ); +
+          textItem->setText( toccy );
+          textItem->setPos( QPointF( 5.0, tocCount++ * 18.0 ) );
+        }
       } else if( name() == "spot" ) {
         if( mCurrParent != 0 ) {
           qDebug() << "Strange: Current Parent should be zero here!";
@@ -109,15 +130,8 @@
         mCurrParent->setData( ID, QVariant( spotID++ ));
 
         mCurrParent->setPos( position() );
-        QString bg = attributes().value("background").toString();
 
-        QBrush brush = rectItem->brush();
-        if( bg.startsWith('#')) {
-          qDebug() << "Setting background-color: " << bg;
-          brush.setColor( QColor(bg) );
-          brush.setStyle( Qt::SolidPattern );
-          rectItem->setBrush(brush);
-        }
+        rectItem->setBrush( brush( rectItem->brush() ) );
 
         scene->addItem( mCurrParent );
         mSpots.append( mCurrParent );
@@ -204,7 +218,7 @@
       }
     } else if( isEndElement() ) {
       qDebug( ) << "XML CLOSE: " << name().toString();
-      if( name() == "spot" ) {
+      if( name() == "spot" || name() == "toc" ) {
         QRectF rect = mCurrParent->childrenBoundingRect();
         rect.setX(0);
         rect.setY(0);
--- trunk/playground/office/zippl/zipplxmlreader.h #1137058:1137059
@@ -37,6 +37,7 @@
 
     GraphWidget *mGraphWidget;
 
+    QGraphicsItem* mToc;
     QList<QGraphicsItem*> mSpots;
     QMap<QGraphicsItem*, GraphicsItemList> mHiddenItems;
     QString mMode;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic