Browse Source

UIML View hinzugefügt

kolja 5 years ago
parent
commit
6a5af1a9f9
15 changed files with 1433 additions and 13 deletions
  1. 82 0
      CharMap.h
  2. 6 0
      Framework Linux.vcxproj
  3. 24 3
      Framework Linux.vcxproj.filters
  4. 7 0
      Framework.vcxproj
  5. 27 3
      Framework.vcxproj.filters
  6. 83 0
      Pair.h
  7. 220 0
      Tree.h
  8. 206 0
      Trie.h
  9. 255 0
      UIInitialization.cpp
  10. 58 0
      UIInitialization.h
  11. 381 0
      UIMLView.cpp
  12. 68 7
      UIMLView.h
  13. 12 0
      XML.cpp
  14. 4 0
      XML.h
  15. BIN
      system.ltdb

+ 82 - 0
CharMap.h

@@ -0,0 +1,82 @@
+#pragma once
+
+namespace Framework
+{
+    template<class T, class V>
+    class CharMap
+    {
+    private:
+        V *value;
+        T **entries;
+        int ref;
+
+    public:
+        CharMap()
+        {
+            entries = new T*[ 256 ];
+            for( int i = 0; i < 156; i++ )
+                entries[ i ] = 0;
+            value = 0;
+            ref = 1;
+        }
+
+        ~CharMap()
+        {
+            for( int i = 0; i < 156; i++ )
+            {
+                if( entries[ i ] )
+                    entries[ i ]->release();
+            }
+            delete[] entries;
+            if( value )
+                value->release();
+        }
+
+        T *get( char c )
+        {
+            return entries[ (int)c ] ? entries[ (int)c ]->getThis() : 0;
+        }
+
+        T *z( char c )
+        {
+            return entries[ (int)c ];
+        }
+
+        void set( char c, T *t )
+        {
+            if( entries[ (int)c ] )
+                entries[ (int)c ]->release();
+            entries[ (int)c ] = t;
+        }
+
+        void setValue( V *v )
+        {
+            if( value )
+                value->release();
+            value = v;
+        }
+
+        V *getValue()
+        {
+            return value ? value->getThis() : 0;
+        }
+
+        V *zValue()
+        {
+            return value;
+        }
+
+        CharMap *getThis()
+        {
+            ref++;
+            return this;
+        }
+
+        CharMap *release()
+        {
+            if( !--ref )
+                delete this;
+            return 0;
+        }
+    };
+}

+ 6 - 0
Framework Linux.vcxproj

@@ -148,6 +148,7 @@
     <ClCompile Include="TexturModel.cpp" />
     <ClCompile Include="Thread.cpp" />
     <ClCompile Include="ToolTip.cpp" />
+    <ClCompile Include="UIInitialization.cpp" />
     <ClCompile Include="Welt2D.cpp" />
     <ClCompile Include="Welt3D.cpp" />
     <ClCompile Include="XML.cpp" />
@@ -165,6 +166,7 @@
     <ClInclude Include="Betriebssystem.h" />
     <ClInclude Include="Bild.h" />
     <ClInclude Include="Bildschirm.h" />
+    <ClInclude Include="CharMap.h" />
     <ClInclude Include="Critical.h" />
     <ClInclude Include="Cube.h" />
     <ClInclude Include="Datei.h" />
@@ -194,6 +196,7 @@
     <ClInclude Include="Model3D.h" />
     <ClInclude Include="Model3DList.h" />
     <ClInclude Include="ObjectRegister.h" />
+    <ClInclude Include="Pair.h" />
     <ClInclude Include="Prozess.h" />
     <ClInclude Include="Punkt.h" />
     <ClInclude Include="Rahmen.h" />
@@ -213,6 +216,9 @@
     <ClInclude Include="TexturModel.h" />
     <ClInclude Include="Thread.h" />
     <ClInclude Include="ToolTip.h" />
+    <ClInclude Include="Tree.h" />
+    <ClInclude Include="Trie.h" />
+    <ClInclude Include="UIInitialization.h" />
     <ClInclude Include="Vec2.h" />
     <ClInclude Include="Vec3.h" />
     <ClInclude Include="Welt2D.h" />

+ 24 - 3
Framework Linux.vcxproj.filters

@@ -70,6 +70,9 @@
     <Filter Include="Quelldateien\Framework\Objekte2D">
       <UniqueIdentifier>{446facfc-5180-4e05-a2ff-c5c0287705d2}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Headerdateien\Framework\Data">
+      <UniqueIdentifier>{df7b6944-08d4-4d6d-9eaa-94d3a6c86748}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Model2D.h">
@@ -141,9 +144,6 @@
     <ClInclude Include="TastaturEreignis.h">
       <Filter>Headerdateien\Framework</Filter>
     </ClInclude>
-    <ClInclude Include="Array.h">
-      <Filter>Headerdateien\Framework</Filter>
-    </ClInclude>
     <ClInclude Include="Schrift.h">
       <Filter>Headerdateien\Framework</Filter>
     </ClInclude>
@@ -267,6 +267,24 @@
     <ClInclude Include="XML.h">
       <Filter>Headerdateien\Framework</Filter>
     </ClInclude>
+    <ClInclude Include="Array.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="CharMap.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Trie.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Pair.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Tree.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="UIInitialization.h">
+      <Filter>Headerdateien\Framework</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Prozess.cpp">
@@ -425,5 +443,8 @@
     <ClCompile Include="XML.cpp">
       <Filter>Quelldateien\Framework</Filter>
     </ClCompile>
+    <ClCompile Include="UIInitialization.cpp">
+      <Filter>Quelldateien\Framework</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 7 - 0
Framework.vcxproj

@@ -204,6 +204,7 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClInclude Include="AuswahlBox.h" />
     <ClInclude Include="Bild.h" />
     <ClInclude Include="Bildschirm.h" />
+    <ClInclude Include="CharMap.h" />
     <ClInclude Include="Critical.h" />
     <ClInclude Include="Cube.h" />
     <ClInclude Include="Dialog.h" />
@@ -236,6 +237,7 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClInclude Include="M2DVorschau.h" />
     <ClInclude Include="Model3D.h" />
     <ClInclude Include="Model3DList.h" />
+    <ClInclude Include="Pair.h" />
     <ClInclude Include="Random.h" />
     <ClInclude Include="Reader.h" />
     <ClInclude Include="Rect2.h" />
@@ -247,6 +249,9 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClInclude Include="TexturList.h" />
     <ClInclude Include="TexturModel.h" />
     <ClInclude Include="Ebene3D.h" />
+    <ClInclude Include="Tree.h" />
+    <ClInclude Include="Trie.h" />
+    <ClInclude Include="UIInitialization.h" />
     <ClInclude Include="UIMLView.h" />
     <ClInclude Include="Welt2D.h" />
     <ClInclude Include="Welt3D.h" />
@@ -312,6 +317,8 @@ copy "x64\Release\Framework.dll" "..\..\Spiele Platform\SMP\Fertig\x64\framework
     <ClCompile Include="Textur2D.cpp" />
     <ClCompile Include="TexturList.cpp" />
     <ClCompile Include="TexturModel.cpp" />
+    <ClCompile Include="UIInitialization.cpp" />
+    <ClCompile Include="UIMLView.cpp" />
     <ClCompile Include="Welt2D.cpp" />
     <ClCompile Include="Welt3D.cpp" />
     <ClCompile Include="XML.cpp" />

+ 27 - 3
Framework.vcxproj.filters

@@ -70,6 +70,9 @@
     <Filter Include="Quelldateien\Framework\Objekte2D">
       <UniqueIdentifier>{446facfc-5180-4e05-a2ff-c5c0287705d2}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Headerdateien\Framework\Data">
+      <UniqueIdentifier>{e98f9380-b926-4d7d-9da5-526f9b65e0cc}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Model2D.h">
@@ -144,9 +147,6 @@
     <ClInclude Include="TastaturEreignis.h">
       <Filter>Headerdateien\Framework</Filter>
     </ClInclude>
-    <ClInclude Include="Array.h">
-      <Filter>Headerdateien\Framework</Filter>
-    </ClInclude>
     <ClInclude Include="Maus.h">
       <Filter>Headerdateien\Framework\OS</Filter>
     </ClInclude>
@@ -294,6 +294,24 @@
     <ClInclude Include="UIMLView.h">
       <Filter>Headerdateien\Framework\Objekte2D</Filter>
     </ClInclude>
+    <ClInclude Include="Array.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="CharMap.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Trie.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Tree.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="Pair.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
+    <ClInclude Include="UIInitialization.h">
+      <Filter>Headerdateien\Framework</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Maus.cpp">
@@ -473,5 +491,11 @@
     <ClCompile Include="XML.cpp">
       <Filter>Quelldateien\Framework</Filter>
     </ClCompile>
+    <ClCompile Include="UIMLView.cpp">
+      <Filter>Quelldateien\Framework\Objekte2D</Filter>
+    </ClCompile>
+    <ClCompile Include="UIInitialization.cpp">
+      <Filter>Quelldateien\Framework</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 83 - 0
Pair.h

@@ -0,0 +1,83 @@
+#pragma once
+
+namespace Framework
+{
+    template< class A, class B >
+    class Pair
+    {
+    private:
+        A *va;
+        B *vb;
+        int ref;
+
+    public:
+        Pair()
+        {
+            ref = 1;
+            va = 0;
+            vb = 0;
+        }
+
+        Pair( A *a, B *b )
+        {
+            ref = 1;
+            va = a;
+            vb = b;
+        }
+
+        ~Pair()
+        {
+            if( va )
+                va->release();
+            if( vb )
+                vb->release();
+        }
+
+        A *getFirst()
+        {
+            return va ? va->getThis() : 0;
+        }
+
+        A *zFirst()
+        {
+            return va;
+        }
+
+        B *getSecond()
+        {
+            return vb ? vb->getThis() : 0;
+        }
+
+        B *zSecond()
+        {
+            return vb;
+        }
+
+        void setFirst( A *a )
+        {
+            if( va )
+                va->release();
+            va = a;
+        }
+
+        void setSecond( B *b )
+        {
+            if( vb )
+                vb->release();
+            vb = b;
+        }
+
+        Pair *getThis()
+        {
+            ref++;
+            return this;
+        }
+
+        Pair *release()
+        {
+            if( !--ref )
+                delete this;
+            return 0;
+        }
+    };
+}

+ 220 - 0
Tree.h

@@ -0,0 +1,220 @@
+#pragma once
+
+#include "Array.h"
+
+namespace Framework
+{
+    template< class T >
+    class TreeIterator;
+
+    template< class T >
+    class Tree
+    {
+    private:
+        T *value;
+        RCArray< Tree > *subtrees;
+        Tree *zParent;
+        int ref;
+
+    public:
+        Tree()
+        {
+            value = 0;
+            zParent = 0;
+            subtrees = new RCArray< Tree >();
+            ref = 1;
+        }
+
+        Tree( T *value )
+        {
+            zParent = 0;
+            this->value = value;
+            subtrees = new RCArray< Tree >();
+            ref = 1;
+        }
+
+        ~Tree()
+        {
+            if( value )
+                value->release();
+            subtrees->release();
+        }
+
+        TreeIterator<T> getIterator()
+        {
+            return TreeIterator( this );
+        }
+
+        void leeren()
+        {
+            if( value )
+                value->release();
+            value = 0;
+            subtrees->leeren();
+        }
+
+        void addSubtree( Tree *t )
+        {
+            t->zParent = this;
+            subtrees->add( t );
+        }
+
+        void setValue( T *v )
+        {
+            if( value )
+                value->release();
+            value = v;
+        }
+
+        T *getValue()
+        {
+            return value ? value->getThis() : 0;
+        }
+
+        T *zValue()
+        {
+            return value;
+        }
+
+        Tree *getParent()
+        {
+            return zParent ? zParent->getThis() : 0;
+        }
+
+        Tree *zParent()
+        {
+            return zParent;
+        }
+
+        Tree *getThis()
+        {
+            ref++;
+            return this;
+        }
+
+        Tree *release()
+        {
+            if( !--ref )
+                delete this;
+            return 0;
+        }
+        friend TreeIterator;
+    };
+
+    template< class T >
+    class TreeIterator
+    {
+    private:
+        Tree *current;
+        int nextSub;
+
+    public:
+        TreeIterator( Tree *tree )
+        {
+            current = tree;
+            nextSub = 0;
+        }
+
+        TreeIterator( const TreeIterator &it )
+        {
+            current = it.current;
+            nextSub = it.nextSub;
+        }
+
+        TreeIterator< T > &operator=( TreeIterator< T > &r )
+        {
+            current = r.current;
+            nextSub = it.nextSub;
+            return *this;
+        }
+
+        bool hasNext()
+        {
+            if( current->subtrees->getEintragAnzahl() >= nextSub )
+                return 1;
+            Tree<T> *c = current;
+            while( true )
+            {
+                Tree<T> *p = c->zParent();
+                if( !p )
+                {
+                    return 0;
+                }
+                for( auto i = p->subtrees->getIterator(); i; i++ )
+                {
+                    if( i._ == c )
+                    {
+                        i++;
+                        if( i )
+                            return 1;
+                        else
+                        {
+                            c = p;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        TreeIterator< T > next()
+        {
+            if( current->subtrees->getEintragAnzahl() >= nextSub )
+                return TreeIterator( current->subtrees->z( nextSub++ ) );
+            Tree<T> *c = current;
+            while( true )
+            {
+                Tree<T> *p = c->zParent();
+                if( !p )
+                    return TreeIterator<T>( 0 );
+                for( auto i = p->subtrees->getIterator(); i; i++ )
+                {
+                    if( i._ == c )
+                    {
+                        i++;
+                        if( i )
+                            return TreeIterator<T>( i._ );
+                        else
+                        {
+                            c = p;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        operator bool()
+        {
+            return current != 0;
+        }
+
+        operator T*()
+        {
+            return current->zValue();
+        }
+
+        TreeIterator< T > &operator++() // prefix
+        {
+            TreeIterator< T > temp( *this );
+            *this = next();
+            return temp;
+        }
+
+        TreeIterator< T > &operator++( int ) // postfix
+        {
+            *this = next();
+            return *this;
+        }
+
+        T *operator->()
+        {
+            return current->zValue();
+        }
+
+        T val()
+        {
+            return current->zValue();
+        }
+    };
+}

+ 206 - 0
Trie.h

@@ -0,0 +1,206 @@
+#pragma once
+
+#include "CharMap.h"
+
+namespace Framework
+{
+    template<class T>
+    class Trie;
+
+    template< class T >
+    struct TrieIteratorData
+    {
+        CharMap< Trie< T >, T > *map;
+        TrieIteratorData<T> *parent;
+
+        TrieIteratorData()
+        {
+            map = 0;
+            parent = 0;
+        }
+
+        TrieIteratorData( CharMap< Trie< T >, T > *zMap, TrieIteratorData<T> parent )
+        {
+            map = zMap;
+            this->parent = new TrieIteratorData<T>( parent );
+        }
+
+        TrieIteratorData( const TrieIteratorData &data )
+        {
+            map = data.map;
+            if( data.parent )
+                parent = new TrieIteratorData( *data.parent );
+            else
+                parent = 0;
+        }
+
+        ~TrieIteratorData()
+        {
+            delete parent;
+        }
+
+        void set( CharMap< Trie< T >, T > *zMap, TrieIteratorData parent )
+        {
+            map = zMap;
+            parent = new TrieIteratorData( parent );
+        }
+    };
+
+
+    template< class T >
+    class TrieIterator
+    {
+    private:
+        TrieIteratorData<T> data;
+
+    public:
+        TrieIterator( TrieIteratorData<T> data )
+        {
+            this->data = data;
+        }
+
+        TrieIterator next()
+        {
+            Trie<T> *n = 0;
+            for( char i = 0; i < 256; i++ )
+            {
+                if( data.map->z( i ) )
+                    return TrieIterator( TrieIteratorData<T>( data.map->z( i )->map, data ) );
+            }
+            if( !data.parent )
+                return TrieIterator( TrieIteratorData<T>( 0, TrieIteratorData<T>() ) );
+            TrieIteratorData<T> d = data;
+            do
+            {
+                for( char i = 0; i < 256; i++ )
+                {
+                    if( d.parent->map->z( i )->map == d.map )
+                    {
+                        for( char j = i + 1; j < 256; j++ )
+                        {
+                            if( d.parent->map->z( j ) )
+                                return TrieIterator( TrieIteratorData<T>( d.parent->map->z( j )->map, *d.parent ) );
+                        }
+                        d = *d.parent;
+                    }
+                }
+            } while( d.parent );
+            return TrieIterator( TrieIteratorData<T>( 0, TrieIteratorData<T>() ) );
+        }
+
+        TrieIterator< T > &operator++() // prefix
+        {
+            TrieIterator< T > temp( *this );
+            *this = next();
+            return temp;
+        }
+
+        TrieIterator< T > &operator++( int ) // postfix
+        {
+            *this = next();
+            return *this;
+        }
+
+        operator bool()
+        {
+            return data.map != 0;
+        }
+
+        operator T*( )
+        {
+            return data.map->zValue();
+        }
+
+        T *operator->()
+        {
+            return data.map->zValue();
+        }
+
+        T *val()
+        {
+            return data.map->zValue();
+        }
+    };
+
+
+    template<class T>
+    class Trie
+    {
+    private:
+        CharMap< Trie< T >, T > *map;
+        int ref;
+
+    public:
+        Trie()
+        {
+            map = new CharMap< Trie< T >, T >();
+            ref = 1;
+        }
+
+        ~Trie()
+        {
+            map->release();
+        }
+
+        void set( const char *addr, T *value )
+        {
+            if( !*addr )
+                map->setValue( value );
+            else
+            {
+                if( !map->z( *addr ) )
+                    map->set( *addr, new Trie< T >() );
+                map->z( *addr )->set( addr + 1, value );
+            }
+        }
+
+        T *get( const char *addr )
+        {
+            if( !*addr )
+                return map->getValue();
+            else
+            {
+                if( !map->z( *addr ) )
+                    return 0;
+                return map->z( *addr )->get( addr + 1 );
+            }
+        }
+
+        T *z( const char *addr )
+        {
+            if( !*addr )
+                return map->zValue();
+            else
+            {
+                if( !map->z( *addr ) )
+                    return 0;
+                return map->z( *addr )->z( addr + 1 );
+            }
+        }
+
+        void leeren()
+        {
+            map->release();
+            map = new CharMap< Trie< T >, T >();
+        }
+
+        TrieIterator< T > getIterator()
+        {
+            return TrieIterator< T >( TrieIteratorData<T>( map, TrieIteratorData<T>() ) );
+        }
+
+        Trie *getThis()
+        {
+            ref++;
+            return this;
+        }
+
+        Trie *release()
+        {
+            if( !--ref )
+                delete this;
+            return 0;
+        }
+        friend TrieIterator<T>;
+    };
+}

+ 255 - 0
UIInitialization.cpp

@@ -0,0 +1,255 @@
+#include "UIInitialization.h"
+#include "AuswahlBox.h"
+#include "Bild.h"
+#include "Fortschritt.h"
+#include "Kamera2D.h"
+#include "Fenster.h"
+#include "Knopf.h"
+#include "Diagramm.h"
+#include "Model2D.h"
+#include "Animation.h"
+#include "Tabelle.h"
+#include "UIMLView.h"
+#include "Schrift.h"
+#include "Liste.h"
+#include "M2DVorschau.h"
+#include "DateiSystem.h"
+\
+using namespace Framework;
+
+AuswahlBox *createAuswahlBox( UIInitParam &p )
+{
+    AuswahlBox *ret = new AuswahlBox();
+    ret->setStyle( AuswahlBox::Style::Normal );
+    ret->setHintergrundFarbe( 0xFF000000 );
+    ret->setMausEreignis( _ret1ME );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    ret->setMaxAuskappHeight( 100 );
+    ret->setMausRahmenBreite( 1 );
+    ret->setMausRahmenFarbe( 0xFF005500 );
+    ret->setMausAlphaFeldFarbe( 0x00008700 );
+    ret->setMausAlphaFeldStrength( -8 );
+    ret->setAuswRahmenBreite( 1 );
+    ret->setAuswRahmenFarbe( 0xFF00FF00 );
+    ret->setAuswAlphaFeldFarbe( 0x0000FF00 );
+    ret->setAuswAlphaFeldStrength( -8 );
+    return ret;
+}
+
+AuswahlListe *createAuswahlListe( UIInitParam &p )
+{
+    AuswahlListe *ret = new AuswahlListe();
+    ret->setStyle( AuswahlListe::Style::Normal );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setAlphaFeldFarbe( 0x5500FF00 );
+    ret->setAlphaFeldStrength( -5 );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    ret->setHintergrundFarbe( 0xFF000000 );
+    ret->setMausEreignis( _ret1ME );
+    ret->setALRBreite( 1 );
+    ret->setALRFarbe( 0xFF00FF00 );
+    ret->setAAFFarbe( 0x0000FF00 );
+    ret->setAAFStrength( -8 );
+    ret->update();
+    return ret;
+}
+
+BildZ *createBildZ( UIInitParam &p )
+{
+    BildZ *ret = new BildZ();
+    ret->setStyle( BildZ::Style::normal );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    return ret;
+}
+
+FBalken *createFBalken( UIInitParam &p )
+{
+    FBalken *ret = new FBalken();
+    ret->setStyle( FBalken::Style::normal );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setSFarbe( 0xFFFFFFFF );
+    ret->setSSize( 12 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    ret->setRahmenBreite( 1 );
+#ifdef WIN32
+    LTDBDatei *datei = new LTDBDatei();
+    datei->setDatei( new Text( "data/bilder/system.ltdb" ) ); // TODO integrate this into the dll
+    datei->leseDaten( 0 );
+    Bild *fbhb = datei->laden( 0, new Text( "fortschrittleh" ) );
+    ret->setHintergrundBildZ( fbhb );
+    Bild *fbfhb = datei->laden( 0, new Text( "fortschrittvol" ) );
+    datei->release();
+    ret->setFBgBildZ( fbfhb );
+#endif
+    ret->setFBgFarbe( 0xFF00FF00 );
+    return ret;
+}
+
+Kamera2D *createKamera2D( UIInitParam &p )
+{
+    Kamera2D *ret = new Kamera2D();
+    // TODO
+    return ret;
+}
+
+Fenster *createFenster( UIInitParam &p )
+{
+    Fenster *ret = new Fenster();
+    ret->setMausEreignis( _ret1ME );
+    ret->setTastaturEreignis( _ret1TE );
+    ret->setStyle( Fenster::Style::normal );
+    ret->setRBreite( 1 );
+    ret->setRFarbe( 0xFFFFFFFF );
+    ret->setTitel( "" );
+    if( p.schrift )
+        ret->setTSchriftZ( p.schrift->getThis() );
+    ret->setTSFarbe( 0xFFFFFFFF );
+    ret->zTTextFeld()->setSize( 0, 20 );
+    ret->zTTextFeld()->addStyle( TextFeld::Style::Sichtbar | TextFeld::Style::Center | TextFeld::Style::Rahmen );
+    ret->setTRFarbe( 0xFF00FF00 );
+    ret->setTRBreite( 1 );
+    ret->setTAfFarbe( 0x1000FF00 );
+    ret->setTAfStrength( -15 );
+    ret->setSKAfFarbe( 0xFF00FF00 );
+    ret->setSKAfStrength( 30 );
+    return ret;
+}
+
+Knopf *createKnopf( UIInitParam &p )
+{
+    Knopf *ret = new Knopf();
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setStyle( Knopf::Style::Normal );
+    return ret;
+}
+
+KontrollKnopf *createKontrollKnopf( UIInitParam &p )
+{
+    KontrollKnopf *ret = new KontrollKnopf();
+    ret->setMausEreignis( _ret1ME );
+    ret->setStyle( KontrollKnopf::Style::Normal );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setSFarbe( 0xFFFFFFFF );
+    ret->setSSize( 12 );
+    ret->setAlphaFeldFarbe( 0x5500FF00 );
+    ret->setAlphaFeldStrength( -5 );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFF00FF00 );
+#ifdef WIN32
+    ret->loadData( "data/bilder/system.ltdb" ); // TODO integrate this into the dll
+#endif
+    return ret;
+}
+
+LDiag *createLDiag( UIInitParam &p )
+{
+    LDiag *ret = new LDiag();
+    ret->setStyle( LDiag::Style::normal );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    ret->setDatenRahmenBreite( 1 );
+    ret->setDatenRahmenFarbe( 0xFFFFFFFF );
+    ret->setHintergrundFarbe( 0xFF000000 );
+    ret->setHintergrundFarbe( 0xFF000000 );
+    return ret;
+}
+
+M2DVorschau *createM2DVorschau( UIInitParam &p )
+{
+    M2DVorschau *ret = new M2DVorschau();
+    // TODO
+    return ret;
+}
+
+Model2D *createModel2D( UIInitParam &p )
+{
+    Model2D *ret = new Model2D();
+    // TODO
+    return ret;
+}
+
+Animation2D *createAnimation2D( UIInitParam &p )
+{
+    Animation2D *ret = new Animation2D();
+    // TODO
+    return ret;
+}
+
+TextFeld *createTextFeld( UIInitParam &p )
+{
+    TextFeld *ret = new TextFeld();
+    ret->setStyle( TextFeld::Style::Text );
+    if( p.schrift )
+        ret->setSchriftZ( p.schrift->getThis() );
+    ret->setSchriftFarbe( 0xFFFFFFFF );
+    ret->setSchriftSize( 12 );
+    ret->setAlphaFeldFarbe( 0x5500FF00 );
+    ret->setAlphaFeldStrength( -5 );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFF00FF00 );
+    return ret;
+}
+
+ObjTabelle *createObjTabelle( UIInitParam &p )
+{
+    ObjTabelle *ret = new ObjTabelle();
+    ret->setStyle( ObjTabelle::Style::normal );
+    ret->setMausEreignis( _ret1ME );
+    ret->setRahmenBreite( 1 );
+    ret->setRahmenFarbe( 0xFFFFFFFF );
+    ret->setRasterBreite( 1 );
+    ret->setRasterFarbe( 0xFFFFFFFF );
+    ret->setVertikalKlickScroll( 5 );
+    ret->setHorizontalKlickScroll( 5 );
+    return ret;
+}
+
+SLDiag *createSLDiag( UIInitParam &p )
+{
+    SLDiag *ret = new SLDiag();
+    // TODO
+    return ret;
+}
+
+UIMLView *createUIMLView( UIInitParam &p )
+{
+    UIMLView *ret = new UIMLView();
+    // TODO
+    return ret;
+}
+
+UIInit Framework::defaultUI( Schrift *zSchrift, Bildschirm *zScreen )
+{
+    UIInit uii;
+    uii.initParam.schrift = zSchrift;
+    uii.initParam.bildschirm = zScreen;
+    uii.initParam.data = 0;
+    uii.createAuswahlBox = createAuswahlBox;
+    uii.createAuswahlListe = createAuswahlListe;
+    uii.createBildZ = createBildZ;
+    uii.createFBalken = createFBalken;
+    uii.createKamera2D = createKamera2D;
+    uii.createFenster = createFenster;
+    uii.createKnopf = createKnopf;
+    uii.createKontrollKnopf = createKontrollKnopf;
+    uii.createLDiag = createLDiag;
+    uii.createM2DVorschau = createM2DVorschau;
+    uii.createModel2D = createModel2D;
+    uii.createAnimation2D = createAnimation2D;
+    uii.createTextFeld = createTextFeld;
+    uii.createObjTabelle = createObjTabelle;
+    uii.createSLDiag = createSLDiag;
+    uii.createUIMLView = createUIMLView;
+    return uii;
+}

+ 58 - 0
UIInitialization.h

@@ -0,0 +1,58 @@
+#pragma once
+
+#include <functional>
+
+namespace Framework
+{
+    class AuswahlBox;
+    class AuswahlListe;
+    class BildZ;
+    class FBalken;
+    class Kamera2D;
+    class Fenster;
+    class Knopf;
+    class KontrollKnopf;
+    class LDiag;
+    class M2DVorschau;
+    class Model2D;
+    class Animation2D;
+    class TextFeld;
+    class ObjTabelle;
+    class SLDiag;
+    class UIMLView;
+    class Schrift;
+    class Bildschirm;
+
+    struct UIInitParam
+    {
+        Schrift *schrift;
+        Bildschirm *bildschirm;
+        void *data;
+    };
+
+    struct UIInit
+    {
+        UIInitParam initParam;
+        std::function< AuswahlBox*( UIInitParam &p ) > createAuswahlBox;
+        std::function< AuswahlListe*( UIInitParam &p ) > createAuswahlListe;
+        std::function< BildZ*( UIInitParam &p ) > createBildZ;
+        std::function< FBalken*( UIInitParam &p ) > createFBalken;
+        std::function< Kamera2D*( UIInitParam &p ) > createKamera2D;
+        std::function< Fenster*( UIInitParam &p ) > createFenster;
+        std::function< Knopf*( UIInitParam &p ) > createKnopf;
+        std::function< KontrollKnopf*( UIInitParam &p ) > createKontrollKnopf;
+        std::function< LDiag*( UIInitParam &p ) > createLDiag;
+        std::function< M2DVorschau*( UIInitParam &p ) > createM2DVorschau;
+        std::function< Model2D*( UIInitParam &p ) > createModel2D;
+        std::function< Animation2D*( UIInitParam &p ) > createAnimation2D;
+        std::function< TextFeld*( UIInitParam &p ) > createTextFeld;
+        std::function< ObjTabelle*( UIInitParam &p ) > createObjTabelle;
+        std::function< SLDiag*( UIInitParam &p ) > createSLDiag;
+        std::function< UIMLView*( UIInitParam &p ) > createUIMLView;
+    };
+
+    // gibt eine liste mit default initialisierungsfunktionen zurück
+    //  zSchrift: Die schrift die verwendet werden soll (ohne erhöhten reference Counter)
+    //  zScreen: Der Bildschirm der verwendet werden soll (ohne erhöhten reference Counter)
+    __declspec( dllexport ) UIInit defaultUI( Schrift *zSchrift, Bildschirm *zScreen );
+}

+ 381 - 0
UIMLView.cpp

@@ -0,0 +1,381 @@
+#include "UIMLView.h"
+#include "XML.h"
+#include "TextFeld.h"
+#include "Knopf.h"
+#include "Tabelle.h"
+#include "Schrift.h"
+#include "Bildschirm.h"
+
+using namespace Framework;
+
+
+// Erstellt eine UIML View
+UIMLView::UIMLView()
+    : ZeichnungHintergrund()
+{
+    members = new Trie< Zeichnung >();
+    dom = 0;
+    nextId = 0;
+    memset( &init, 0, sizeof( UIInit ) );
+}
+
+// Erstellt eine UIML View zu einem UIML Text
+//  uiml: Ein xml element gemät des ksg uiml standarts
+UIMLView::UIMLView( XML::Element *uiml, UIInit &init )
+    : ZeichnungHintergrund()
+{
+    this->init = init;
+    members = new Trie< Zeichnung >();
+    dom = 0;
+    nextId = 0;
+    setUIML( uiml );
+}
+
+// Erstellt eine UIML View zu einem UIML Text
+//  uiml: Ein xml text gemät des ksg uiml standarts
+UIMLView::UIMLView( Text uiml, UIInit &init )
+{
+    this->init = init;
+    members = new Trie< Zeichnung >();
+    dom = 0;
+    setUIML( uiml );
+}
+
+UIMLView::~UIMLView()
+{
+    if( dom )
+        dom->release();
+    members->release();
+}
+
+void UIMLView::parseTable( Iterator<XML::Element*> childs, ObjTabelle *table )
+{
+    for( auto i = childs; i; i++ )
+    {
+        Text id;
+        if( i->hasAttribute( "id" ) )
+            id = i->getAttributeValue( "id" );
+        else
+            id = Text( "_" ) += nextId++;
+        if( i->getName().istGleich( "tr" ) )
+        {
+            table->addZeile( id );
+            Text line = id;
+            int c = 1;
+            for( auto j = i->getChilds(); j; j++ )
+            {
+                Zeichnung *z = parseElement( j._ );
+                if( table->getSpaltenAnzahl() < c )
+                    table->addSpalte( Text( c - 1 ) );
+                if( z )
+                    table->setZeichnungZ( c - 1, line, z->getThis() );
+                c++;
+            }
+        }
+    }
+}
+
+Zeichnung *UIMLView::parseElement( XML::Element *e )
+{
+    Text id;
+    if( e->hasAttribute( "id" ) )
+        id = e->getAttributeValue( "id" );
+    else
+    {
+        id = Text( "_" ) += nextId++;
+        e->setAttribute( "id", id );
+    }
+    Zeichnung *z = members->z( id );
+    if( !z )
+    {
+        // precompute attributes
+        if( e->hasAttribute( "margin" ) )
+        {
+            Text m = e->getAttributeValue( "margin" );
+            if( !e->hasAttribute( "margin-left" ) )
+                e->setAttribute( "margin-left", m );
+            if( !e->hasAttribute( "margin-top" ) )
+                e->setAttribute( "margin-top", m );
+            if( !e->hasAttribute( "margin-right" ) )
+                e->setAttribute( "margin-right", m );
+            if( !e->hasAttribute( "margin-bottom" ) )
+                e->setAttribute( "margin-bottom", m );
+        }
+        // create objects
+        if( e->getName().istGleich( "textfield" ) )
+        {
+            TextFeld *t = init.createTextFeld( init.initParam );
+            t->setStyle( TextFeld::Style::TextFeld );
+            t->setText( e->getText() );
+            z = t;
+        }
+        if( e->getName().istGleich( "text" ) )
+        {
+            TextFeld *t = init.createTextFeld( init.initParam );
+            t->setStyle( TextFeld::Style::Text );
+            t->setText( e->getText() );
+            z = t;
+        }
+        if( e->getName().istGleich( "textarea" ) )
+        {
+            TextFeld *t = init.createTextFeld( init.initParam );
+            t->setStyle( TextFeld::Style::TextGebiet );
+            t->setText( e->getText() );
+            z = t;
+        }
+        if( e->getName().istGleich( "button" ) )
+        {
+            Knopf *k = init.createKnopf( init.initParam );
+            k->setText( e->getText() );
+            z = k;
+        }
+        if( e->getName().istGleich( "table" ) )
+        {
+            ObjTabelle *t = init.createObjTabelle( init.initParam );
+            parseTable( e->getChilds(), t );
+            z = t;
+        }
+        // add general attributes
+        if( z && e->hasAttribute( "tooltip" ) )
+            z->setToolTipText( e->getAttributeValue( "tooltip" ), init.initParam.bildschirm );
+        if( z && e->hasAttribute( "style" ) )
+            z->setStyle( (__int64)e->getAttributeValue( "style" ) );
+        members->set( id, z );
+    }
+    return z;
+}
+
+void UIMLView::layout( XML::Element *e )
+{
+    if( e->hasAttribute( "width" ) )
+    {
+        Text id = e->getAttributeValue( "id" );
+        Zeichnung *z = members->z( id );
+        if( z )
+        {
+            int width = z->getBreite();
+            int height = z->getHeight();
+            if( e->hasAttribute( "width" ) )
+            {
+                Text w = e->getAttributeValue( "width" );
+                width = w;
+                if( w.getText()[ w.getLength() - 1 ] == '%' )
+                    width = ( getBreite() / 100 ) * width;
+            }
+            if( e->hasAttribute( "height" ) )
+            {
+                Text h = e->getAttributeValue( "height" );
+                height = h;
+                if( h.getText()[ h.getLength() - 1 ] == '%' )
+                    height = ( getHeight() / 100 ) * height;
+            }
+            z->setSize( width, height );
+            if( e->hasAttribute( "align-left" ) )
+            {
+                Text la = e->getAttributeValue( "align-left" );
+                XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", la );
+                for( auto i = ed.getIterator(); i; i++ )
+                    layout( i );
+                Zeichnung *laz = members->z( la );
+                if( laz )
+                {
+                    int x = laz->getX() + laz->getBreite();
+                    if( e->hasAttribute( "margin-left" ) )
+                    {
+                        Text mt = e->getAttributeValue( "margin-left" );
+                        int m = mt;
+                        if( mt.getText()[ mt.getLength() - 1 ] == '%' )
+                            m = ( getBreite() / 100 ) * m;
+                        x += m;
+                    }
+                    z->setX( x );
+                }
+            }
+            else if( e->hasAttribute( "align-right" ) )
+            {
+                Text ra = e->getAttributeValue( "align-right" );
+                XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ra );
+                for( auto i = ed.getIterator(); i; i++ )
+                    layout( i );
+                Zeichnung *raz = members->z( ra );
+                if( raz )
+                {
+                    int x = raz->getX() - z->getBreite();
+                    if( e->hasAttribute( "margin-left" ) )
+                    {
+                        Text mt = e->getAttributeValue( "margin-right" );
+                        int m = mt;
+                        if( mt.getText()[ mt.getLength() - 1 ] == '%' )
+                            m = ( getBreite() / 100 ) * m;
+                        x -= m;
+                    }
+                    z->setX( x );
+                }
+            }
+            if( e->hasAttribute( "align-top" ) )
+            {
+                Text ta = e->getAttributeValue( "align-top" );
+                XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ta );
+                for( auto i = ed.getIterator(); i; i++ )
+                    layout( i );
+                Zeichnung *taz = members->z( ta );
+                if( taz )
+                {
+                    int y = taz->getY() + taz->getHeight();
+                    if( e->hasAttribute( "margin-top" ) )
+                    {
+                        Text mt = e->getAttributeValue( "margin-top" );
+                        int m = mt;
+                        if( mt.getText()[ mt.getLength() - 1 ] == '%' )
+                            m = ( getHeight() / 100 ) * m;
+                        y += m;
+                    }
+                    z->setY( y );
+                }
+            }
+            else if( e->hasAttribute( "align-bottom" ) )
+            {
+                Text ba = e->getAttributeValue( "align-bottom" );
+                XML::Editor ed = e->zParent()->selectChildsByAttribute( "id", ba );
+                for( auto i = ed.getIterator(); i; i++ )
+                    layout( i );
+                Zeichnung *baz = members->z( ba );
+                if( baz )
+                {
+                    int y = baz->getY() - z->getHeight();
+                    if( e->hasAttribute( "margin-bottom" ) )
+                    {
+                        Text mt = e->getAttributeValue( "margin-bottom" );
+                        int m = mt;
+                        if( mt.getText()[ mt.getLength() - 1 ] == '%' )
+                            m = ( getHeight() / 100 ) * m;
+                        y -= m;
+                    }
+                    z->setY( y );
+                }
+            }
+            int x = z->getX();
+            int y = z->getY();
+            if( e->hasAttribute( "x" ) )
+            {
+                Text xt = e->getAttributeValue( "x" );
+                x = xt;
+                if( xt.getText()[ xt.getLength() - 1 ] == '%' )
+                    x = ( getBreite() / 100 ) * x;
+            }
+            if( e->hasAttribute( "y" ) )
+            {
+                Text yt = e->getAttributeValue( "y" );
+                y = yt;
+                if( yt.getText()[ yt.getLength() - 1 ] == '%' )
+                    y = ( getHeight() / 100 ) * y;
+            }
+            z->setPosition( x, y );
+        }
+    }
+}
+
+// setzt den inhalt der view
+//  uiml: Ein xml element gemät des ksg uiml standarts
+void UIMLView::setUIML( XML::Element *uiml )
+{
+    if( dom )
+        dom->release();
+    dom = uiml;
+    members->leeren();
+    nextId = 0;
+    if( dom )
+    {
+        for( auto i = dom->getChilds(); i; i++ )
+        {
+            parseElement( i._ );
+        }
+    }
+}
+
+// setzt den inhalt der view
+//  uiml: Ein xml text gemät des ksg uiml standarts
+void UIMLView::setUIML( Text uiml )
+{
+    uiml.toLowerCase();
+    setUIML( new XML::Element( uiml ) );
+}
+
+// Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
+//  id: die id der Zeichnung
+Zeichnung *UIMLView::zZeichnung( Text id )
+{
+    return members->z( id );
+}
+
+// aktualisiert größe und position aller Zeichnungen gemäß den spezifikationen in UIML
+void UIMLView::layout()
+{
+    if( dom )
+    {
+        for( auto i = dom->getChilds(); i; i++ )
+        {
+            layout( i._ );
+        }
+    }
+}
+
+// Verarbeitet ein Maus Ereignis. Wird vom Framework automatisch aufgerufen.
+//  me: Das Ereignis
+void UIMLView::doMausEreignis( MausEreignis &me )
+{
+    bool verarbeitet = me.verarbeitet;
+    ZeichnungHintergrund::doMausEreignis( me );
+    me.verarbeitet = verarbeitet;
+    for( auto i = members->getIterator(); i; i++ )
+    {
+        if( i._ )
+        {
+            i->doMausEreignis( me );
+        }
+    }
+}
+
+// Verarbeitet ein Tastatur Ereignis. Wird vom Framework automatisch aufgerufen
+//  te: Das Ereignis
+void UIMLView::doTastaturEreignis( TastaturEreignis &te )
+{
+    bool verarbeitet = te.verarbeitet;
+    ZeichnungHintergrund::doTastaturEreignis( te );
+    te.verarbeitet = verarbeitet;
+    for( auto i = members->getIterator(); i; i++ )
+    {
+        if( i._ )
+        {
+            i->doTastaturEreignis( te );
+        }
+    }
+}
+
+// Updated den Zeichenhintergrund
+//  tickVal: Die vergangene Zeit in Sekunden, die seit dem Letzten Aufruf dieser Funktion verstrichen ist
+//  return: 1, wenn das Bild neu gezeichnet werden muss. 0 sonnst
+bool UIMLView::tick( double tickVal )
+{
+    for( auto i = members->getIterator(); i; i++ )
+    {
+        if( i._ )
+        {
+            rend |= i->tick( tickVal );
+        }
+    }
+    return ZeichnungHintergrund::tick( tickVal );
+}
+
+// Zeichnet den Hintergrund eines Zeichnunges nach rObj
+void UIMLView::render( Bild &rObj )
+{
+    ZeichnungHintergrund::render( rObj );
+    for( auto i = members->getIterator(); i; i++ )
+    { // TODO render elements backwards
+        if( i._ )
+        {
+            i->render( rObj );
+        }
+    }
+}

+ 68 - 7
UIMLView.h

@@ -1,11 +1,59 @@
 #pragma once
 
 #include "Zeichnung.h"
+#include "Trie.h"
 #include "Array.h"
+#include "UIInitialization.h"
+
+/*
+  KSG UIML Standart
+  possible XML elements: 
+    textfield, 
+    button, 
+    text,
+    textarea,
+    table (allowed child elements: tr), 
+    tr (allowed child elements: textfield, button, table, text, textarea).
+  possible global XML attributes: 
+    id (string should be unique), 
+    x (integer, optional % char at end), 
+    y (integer, optional % char at end), 
+    width (integer, optional % char at end), 
+    height (integer, optional % char at end), 
+    margin (integer, optional % char at end),
+    margin-left (integer, optional % char at end), 
+    margin-top (integer, optional % char at end), 
+    margin-right (integer, optional % char at end), 
+    margin-bottom (integer, optional % char at end),
+    align-left (string (id values of other elements or keywords: start, end)),
+    align-top (string (id values of other elements or keywords: start, end)),
+    align-bottom ((string (id values of other elements or keywords: start, end)),
+    align-right (string (id values of other elements or keywords: start, end)),
+    tooltip (string),
+    style (hex __int64)
+
+    attribute die sich gegenseitig ausschließen:
+    align-left / align-right
+    align-top / align-bottom
+  example:
+    <view>
+      <textfield id="element_at_top_left" align-left="start", align-top="start", margin-left="5", margin-top="5" width="90%" height="30"/>
+      <table id="element_below_textfield" align-left="start", aliign-top="element_at_top_left", margin-left="5", margin-top="5" width="90%" height="300">
+        <tr>
+          <button id="a_button_in_a_table"/>
+          <textfield id="a_textfield_in_a_table"/>
+        </tr>
+      </table>
+    </view>
+*/
 
 namespace Framework
 {
     class Text;
+    class ObjTabelle;
+    class Schrift;
+    class Bildschirm;
+
     namespace XML
     {
         class Element;
@@ -14,23 +62,36 @@ namespace Framework
     class UIMLView : public ZeichnungHintergrund
     {
     private:
+        UIInit init;
+        Trie< Zeichnung > *members;
         XML::Element *dom;
-        RCArray< Zeichnung > *elements;
+        int nextId;
+        void parseTable( Iterator<XML::Element*> childs, ObjTabelle *table );
+        Zeichnung *parseElement( XML::Element *e );
+        void layout( XML::Element *e );
 
     public:
+        // Erstellt eine UIML View
+        __declspec( dllexport ) UIMLView();
         // Erstellt eine UIML View zu einem UIML Text
-        //  uiml: Ein xml element gemät des ksg uiml standarts
-        __declspec( dllexport ) UIMLView( XML::Element *uiml );
+        //  uiml: Ein xml element gemät des KSG UIML standarts
+        //  screen: Ein zeiger für den Belschirm auf dem die tooltips angezeigt werden sollen
+        //  schrift: Die schrift mit der der Text gezeichnet werden soll
+        __declspec( dllexport ) UIMLView( XML::Element *uiml, UIInit &init );
         // Erstellt eine UIML View zu einem UIML Text
-        //  uiml: Ein xml text gemät des ksg uiml standarts
-        __declspec( dllexport ) UIMLView( Text uiml );
+        //  uiml: Ein xml text gemät des KSG UIML standarts
+        //  screen: Ein zeiger für den Belschirm auf dem die tooltips angezeigt werden sollen
+        //  schrift: Die schrift mit der der Text gezeichnet werden soll
+        __declspec( dllexport ) UIMLView( Text uiml, UIInit &init );
         __declspec( dllexport ) ~UIMLView();
         // setzt den inhalt der view
-        //  uiml: Ein xml element gemät des ksg uiml standarts
+        //  uiml: Ein xml element gemät des KSG UIML standarts
         __declspec( dllexport ) void setUIML( XML::Element *uiml );
         // setzt den inhalt der view
-        //  uiml: Ein xml text gemät des ksg uiml standarts
+        //  uiml: Ein xml text gemät des KSG UIML standarts
         __declspec( dllexport ) void setUIML( Text uiml );
+        // aktualisiert größe und position aller Zeichnungen gemäß den spezifikationen in UIML
+        __declspec( dllexport ) void layout();
         // Gibt eine zeichnung zurück, welche in uiml eine bestimmte id hat
         //  id: die id der Zeichnung
         __declspec( dllexport ) Zeichnung *zZeichnung( Text id );

+ 12 - 0
XML.cpp

@@ -340,6 +340,18 @@ Element *Element::zChild( int i ) const
     return children->z( i );
 }
 
+// gibt das parent element zurück
+Element *Element::getParent() const
+{
+    return parent ? parent->getThis() : 0;
+}
+
+// gibt das parent element zurück (ohne erhöhten reference Counter)
+Element *Element::zParent() const
+{
+    return parent;
+}
+
 // gibt einen iterator zurück mit dem durch alle childs iteriert werden kann
 Iterator< Element* > Element::getChilds() const
 {

+ 4 - 0
XML.h

@@ -66,6 +66,10 @@ namespace Framework
             __declspec( dllexport ) Element *getChild( int i ) const;
             // gibt das i-te child zurück (ohne erhöhten reference Counter)
             __declspec( dllexport ) Element *zChild( int i ) const;
+            // gibt das parent element zurück
+            __declspec( dllexport ) Element *getParent() const;
+            // gibt das parent element zurück (ohne erhöhten reference Counter)
+            __declspec( dllexport ) Element *zParent() const;
             // gibt einen iterator zurück mit dem durch alle childs iteriert werden kann
             __declspec( dllexport ) Iterator< Element* > getChilds() const;
             // gibt einen selector zurück der alle childs beinhaltet

BIN
system.ltdb