<typesystem package="com.trolltech.qt.svg" default-superclass="com.trolltech.qt.QtJambiObject">
  <inject-code>
    com.trolltech.qt.Utilities.loadQtLibrary("QtXml");
    com.trolltech.qt.Utilities.loadQtLibrary("QtSvg");
  </inject-code>

  <namespace-type name="QSvg" />
  
  <object-type name="QSvgRenderer">
    <extra-includes>
        <include file-name="QRectF" location="global" />
        <include file-name="QMatrix" location="global" />
        <include file-name="QSize" location="global" />
        <include file-name="QByteArray" location="global" />
    </extra-includes>  
  </object-type>  
  
  <object-type name="QSvgWidget">
    <extra-includes>
        <include file-name="QByteArray" location="global" />
        <include file-name="QSvgRenderer" location="global" />
        <include file-name="QSize" location="global" />
    </extra-includes>  
  </object-type> 

  <object-type name="QGraphicsSvgItem" delete-in-main-thread="yes">
    <extra-includes>
        <include file-name="QGraphicsItem" location="global" />
        <include file-name="QSvgRenderer" location="global" />
        <include file-name="QSize" location="global" />
    </extra-includes> 
    <modify-function signature="setGroup(QGraphicsItemGroup*)">
        <modify-argument index="1">
            <!-- Handled by injected code in QGraphicsItem -->
            <reference-count action="ignore" />
        </modify-argument>
    </modify-function>
    <modify-function signature="setParentItem(QGraphicsItem*)">
        <modify-argument index="1">
            <!-- Handled by injected code in QGraphicsItem -->
            <reference-count action="ignore" />
        </modify-argument>
    </modify-function>
    <modify-function signature="setSharedRenderer(QSvgRenderer*)">
        <modify-argument index="1">
            <define-ownership class="java" owner="c++" />
        </modify-argument>
        <inject-code position="beginning">
            QSvgRenderer oldRenderer = renderer();
        </inject-code>
        <inject-code position="end">
            if (oldRenderer != null)
                oldRenderer.reenableGarbageCollection();
        </inject-code>       
    </modify-function>
    <modify-function signature="QGraphicsSvgItem(QGraphicsItem*)">
        <inject-code position="end">
            <argument-map index="1" meta-name="%1" />
            if (%1 != null) disableGarbageCollection();
        </inject-code>
    </modify-function>  
    <modify-function signature="QGraphicsSvgItem(const QString &amp;,QGraphicsItem*)">
        <inject-code position="end">
            <argument-map index="2" meta-name="%2" />
            if (%2 != null) disableGarbageCollection();
        </inject-code>
    </modify-function>      
    <modify-function signature="matrix()const" remove="all"/>
    <modify-function signature="resetMatrix()" remove="all"/>
    <modify-function signature="sceneMatrix()const" remove="all"/>
    <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
  </object-type>
  
  <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'" />
  <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'" />  
  <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'" />  
</typesystem>
