Skip to content
Permalink
Browse files

- add missing sip bindings

- port widgets_tree.py to QtXml and update customization.xml (fixes #5752 and  #8054)
  • Loading branch information
jef-n committed Jun 22, 2013
1 parent c8f1bb9 commit 99f998aa30ec5862214e4dd971730980cb91aed2
Showing with 4,074 additions and 1,752 deletions.
  1. +15 −0 python/core/composer/qgscomposereffect.sip
  2. +49 −0 python/core/composer/qgscomposerlegendstyle.sip
  3. +18 −0 python/core/core.sip
  4. +77 −0 python/core/qgscachedfeatureiterator.sip
  5. +48 −0 python/core/qgscacheindex.sip
  6. +47 −0 python/core/qgscacheindexfeatureid.sip
  7. +13 −0 python/core/qgscentralpointpositionmanager.sip
  8. +23 −0 python/core/qgsfeatureiterator.sip
  9. +39 −0 python/core/qgsfeaturestore.sip
  10. +30 −0 python/core/qgsgeometrycache.sip
  11. +16 −0 python/core/qgspalobjectpositionmanager.sip
  12. +23 −0 python/core/qgsprojectfiletransform.sip
  13. +91 −0 python/core/qgsvectorlayereditutils.sip
  14. +29 −0 python/core/qgsvectorlayerfeatureiterator.sip
  15. +30 −0 python/core/raster/qgsbrightnesscontrastfilter.sip
  16. +47 −0 python/core/raster/qgshuesaturationfilter.sip
  17. +20 −0 python/core/raster/qgsrasterdrawer.sip
  18. +15 −0 python/core/symbology-ng/qgssymbologyv2conversion.sip
  19. +42 −0 python/gui/attributetable/qgsattributetabledelegate.sip
  20. +133 −0 python/gui/attributetable/qgsattributetablefiltermodel.sip
  21. +191 −0 python/gui/attributetable/qgsattributetablemodel.sip
  22. +144 −0 python/gui/attributetable/qgsdualview.sip
  23. +67 −0 python/gui/attributetable/qgsfeaturelistmodel.sip
  24. +99 −0 python/gui/attributetable/qgsfeaturelistview.sip
  25. +27 −0 python/gui/attributetable/qgsfeaturelistviewdelegate.sip
  26. +9 −0 python/gui/attributetable/qgsfeaturemodel.sip
  27. +75 −0 python/gui/attributetable/qgsfeatureselectionmodel.sip
  28. +26 −0 python/gui/gui.sip
  29. +20 −0 python/gui/qgsblendmodecombobox.sip
  30. +12 −0 python/gui/qgscharacterselectdialog.sip
  31. +29 −0 python/gui/qgscomposerruler.sip
  32. +209 −0 python/gui/qgsdatadefinedbutton.sip
  33. +11 −0 python/gui/qgsdetaileditemwidget.sip
  34. +21 −0 python/gui/qgserrordialog.sip
  35. +59 −0 python/gui/qgsexpressionselectiondialog.sip
  36. +18 −0 python/gui/qgshighlight.sip
  37. +34 −0 python/gui/qgsoptionsdialogbase.sip
  38. +18 −0 python/gui/qgssvgannotationitem.sip
  39. +28 −0 python/gui/symbology-ng/characterwidget.sip
  40. +24 −0 python/gui/symbology-ng/qgscolorrampcombobox.sip
  41. +11 −0 python/gui/symbology-ng/qgsdashspacedialog.sip
  42. +22 −0 python/gui/symbology-ng/qgsdatadefinedsymboldialog.sip
  43. +25 −0 python/gui/symbology-ng/qgsstylev2exportimportdialog.sip
  44. +79 −0 python/gui/symbology-ng/qgssvgselectorwidget.sip
  45. +1,980 −1,685 resources/customization.xml
  46. +24 −33 scripts/widgets_tree.py
  47. +0 −4 src/core/qgscacheindexfeatureid.h
  48. +1 −1 src/core/qgscentralpointpositionmanager.h
  49. +1 −1 src/core/qgspalobjectpositionmanager.h
  50. +1 −1 src/core/raster/qgsrasterdrawer.h
  51. +0 −1 src/core/symbology-ng/qgssymbologyv2conversion.h
  52. +1 −1 src/gui/qgsdetaileditemwidget.h
  53. +1 −1 src/gui/symbology-ng/characterwidget.h
  54. +0 −3 src/gui/symbology-ng/qgscolorrampcombobox.h
  55. +1 −1 src/gui/symbology-ng/qgsdashspacedialog.h
  56. +1 −2 src/gui/symbology-ng/qgsstylev2exportimportdialog.h
  57. +0 −18 src/gui/symbology-ng/qgsvectorfieldwidget.h
@@ -0,0 +1,15 @@
class QgsComposerEffect : QGraphicsEffect
{
%TypeHeaderCode
#include <qgscomposereffect.h>
%End
public:
QgsComposerEffect();
~QgsComposerEffect();

void setCompositionMode( const QPainter::CompositionMode compositionMode );

protected:
/** Called whenever source needs to be drawn */
virtual void draw( QPainter *painter );
};
@@ -0,0 +1,49 @@
class QgsComposerLegendStyle
{
%TypeHeaderCode
#include <qgscomposerlegendstyle.h>
%End
public:
enum Style
{
Undefined, // should not happen, only if corrupted project file
Hidden, // special style, item is hidden includeing margins around
Title,
Group,
Subgroup, // layer
Symbol, // symbol without label
SymbolLabel
};
enum Side // margin side
{
Top = 0,
Bottom = 1,
Left = 2,
Right = 3
};
QgsComposerLegendStyle();
~QgsComposerLegendStyle();

QFont font() const;
QFont & rfont();
void setFont( const QFont & font );

double margin( Side side );
void setMargin( Side side, double margin );

// set all margins
void setMargin( double margin );

void writeXML( QString name, QDomElement& elem, QDomDocument & doc ) const;

void readXML( const QDomElement& elem, const QDomDocument& doc );

/** Get name for style, used in project file */
static QString styleName( Style s );

/** Get style from name, used in project file */
static Style styleFromName( QString styleName );

/** Get style label, translated, used in UI */
static QString styleLabel( Style s );
};
@@ -89,6 +89,17 @@
%Include qgsvectoroverlay.sip
%Include qgsfontutils.sip

%Include qgscachedfeatureiterator.sip
%Include qgscacheindex.sip
%Include qgscacheindexfeatureid.sip
%Include qgscentralpointpositionmanager.sip
%Include qgsfeaturestore.sip
%Include qgsgeometrycache.sip
%Include qgspalobjectpositionmanager.sip
%Include qgsprojectfiletransform.sip
%Include qgsvectorlayereditutils.sip
%Include qgsvectorlayerfeatureiterator.sip

%Include composer/qgsaddremoveitemcommand.sip
%Include composer/qgsaddremovemultiframecommand.sip
%Include composer/qgscomposerarrow.sip
@@ -118,6 +129,8 @@
%Include composer/qgssingleboxscalebarstyle.sip
%Include composer/qgsticksscalebarstyle.sip
%Include composer/qgscomposertexttable.sip
%Include composer/qgscomposereffect.sip
%Include composer/qgscomposerlegendstyle.sip

%Include qgsdiagramrendererv2.sip
%Include diagram/qgsdiagram.sip
@@ -169,6 +182,9 @@
%Include raster/qgspalettedrasterrenderer.sip
%Include raster/qgscubicrasterresampler.sip
%Include raster/qgsmultibandcolorrenderer.sip
%Include raster/qgsbrightnesscontrastfilter.sip
%Include raster/qgshuesaturationfilter.sip
%Include raster/qgsrasterdrawer.sip

%Include symbology-ng/qgsstylev2.sip
%Include symbology-ng/qgssvgcache.sip
@@ -193,3 +209,5 @@
%Include symbology-ng/qgslinesymbollayerv2.sip
%Include symbology-ng/qgsmarkersymbollayerv2.sip
%Include symbology-ng/qgssymbollayerv2registry.sip

%Include symbology-ng/qgssymbologyv2conversion.sip
@@ -0,0 +1,77 @@
class QgsCachedFeatureIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* @brief
* This constructor creates a feature iterator, that delivers only cached information, based on the
* @link QgsFeatureIds @endlink. No request is made to the backend.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
* @param featureIds The feature ids to return
*/
QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest, QgsFeatureIds featureIds );

/**
* @brief
*
* @param f
* @return bool
*/
virtual bool nextFeature( QgsFeature& f );

/**
* @brief
*
* @return bool
*/
virtual bool rewind();

/**
* @brief
*
* @return bool
*/
virtual bool close();
};

class QgsCachedFeatureWriterIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* @brief
* This constructor creates a feature iterator, which queries the backend and caches retrieved features.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
*/
QgsCachedFeatureWriterIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest );

/**
* @brief
*
* @param f
* @return bool
*/
virtual bool nextFeature( QgsFeature& f );

/**
* @brief
*
* @return bool
*/
virtual bool rewind();

/**
* @brief
*
* @return bool
*/
virtual bool close();
};
@@ -0,0 +1,48 @@
class QgsAbstractCacheIndex
{
%TypeHeaderCode
#include <qgscacheindex.h>
%End
public:
QgsAbstractCacheIndex();
virtual ~QgsAbstractCacheIndex();

/**
* Is called, whenever a feature is removed from the cache. You should update your indexes, so
* they become invalid in case this feature was required to successfuly answer a request.
*/
virtual void flushFeature( const QgsFeatureId fid ) = 0;

/**
* Sometimes, the whole cache changes its state and its easier to just withdraw everything.
* In this case, this method is issued. Be sure to clear all cache information in here.
*/
virtual void flush() = 0;

/**
* @brief
* Implement this method to update the the indices, in case you need information contained by the request
* to properly index. (E.g. spatial index)
* Does nothing by default
*
* @param featureRequest The feature request that was answered
* @param fids The feature ids that have been returned
*/
virtual void requestCompleted( QgsFeatureRequest featureRequest, QgsFeatureIds fids );

/**
* Is called, when a feature request is issued on a cached layer.
* If this cache index is able to completely answer the feature request, it will return true
* and write the list of feature ids of cached features to cachedFeatures. If it is not able
* it will return false and the cachedFeatures state is undefined.
*
* @param featureIterator A reference to a {@link QgsFeatureIterator}. A valid featureIterator will
* be assigned in case this index is able to answer the request and the return
* value is true.
* @param featureRequest The feature request, for which this index is queried.
*
* @return True, if this index holds the information to answer the request.
*
*/
virtual bool getCacheIterator( QgsFeatureIterator& featureIterator, const QgsFeatureRequest& featureRequest ) = 0;
};
@@ -0,0 +1,47 @@
class QgsCacheIndexFeatureId : QgsAbstractCacheIndex
{
%TypeHeaderCode
#include <qgscacheindexfeatureid.h>
%End
public:
QgsCacheIndexFeatureId( QgsVectorLayerCache* );

/**
* Is called, whenever a feature is removed from the cache. You should update your indexes, so
* they become invalid in case this feature was required to successfuly answer a request.
*/
virtual void flushFeature( const QgsFeatureId fid );

/**
* Sometimes, the whole cache changes its state and its easier to just withdraw everything.
* In this case, this method is issued. Be sure to clear all cache information in here.
*/
virtual void flush();

/**
* @brief
* Implement this method to update the the indices, in case you need information contained by the request
* to properly index. (E.g. spatial index)
* Does nothing by default
*
* @param featureRequest The feature request that was answered
* @param fids The feature ids that have been returned
*/
virtual void requestCompleted( QgsFeatureRequest featureRequest, QgsFeatureIds fids );

/**
* Is called, when a feature request is issued on a cached layer.
* If this cache index is able to completely answer the feature request, it will return true
* and write the list of feature ids of cached features to cachedFeatures. If it is not able
* it will return false and the cachedFeatures state is undefined.
*
* @param featureIterator A reference to a {@link QgsFeatureIterator}. A valid featureIterator will
* be assigned in case this index is able to answer the request and the return
* value is true.
* @param featureRequest The feature request, for which this index is queried.
*
* @return True, if this index holds the information to answer the request.
*
*/
virtual bool getCacheIterator( QgsFeatureIterator& featureIterator, const QgsFeatureRequest& featureRequest );
};
@@ -0,0 +1,13 @@
class QgsCentralPointPositionManager : QgsOverlayObjectPositionManager
{
%TypeHeaderCode
#include <qgscentralpointpositionmanager.h>
%End
public:
QgsCentralPointPositionManager();
~QgsCentralPointPositionManager();
void addLayer( QgsVectorLayer* vl, QList<QgsVectorOverlay*>& overlays );
/**Removes all the overlays*/
void removeLayers();
void findObjectPositions( const QgsRenderContext& context, QGis::UnitType unitType );
};
@@ -1,3 +1,26 @@
class QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgsfeatureiterator.h>
%End
public:
//! base class constructor - stores the iteration parameters
QgsAbstractFeatureIterator( const QgsFeatureRequest& request );

//! destructor makes sure that the iterator is closed properly
virtual ~QgsAbstractFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& f ) = 0;
//! reset the iterator to the starting position
virtual bool rewind() = 0;
//! end of iterating: free the resources / lock
virtual bool close() = 0;

protected:
void ref(); // add reference
void deref(); // remove reference, delete if refs == 0
};


class QgsFeatureIterator
@@ -0,0 +1,39 @@
class QgsFeatureStore
{
%TypeHeaderCode
#include <qgsfeaturestore.h>
%End
public:
//! Constructor
QgsFeatureStore();

//! Constructor
QgsFeatureStore( const QgsFeatureStore &rhs );

//! Constructor
QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceSystem& crs );

//! Destructor
~QgsFeatureStore();

/** Get fields list */
QgsFields& fields();

/** Set fields */
void setFields( const QgsFields & fields );

/** Get crs */
QgsCoordinateReferenceSystem crs() const;

/** Set crs */
void setCrs( const QgsCoordinateReferenceSystem& crs );

/** Get features list reference */
QgsFeatureList& features();

/** Set map of optional parameters */
void setParams( const QMap<QString, QVariant> &theParams );

/** Get map of optional parameters */
QMap<QString, QVariant> params() const;
};
@@ -0,0 +1,30 @@
class QgsGeometryCache
{
%TypeHeaderCode
#include <qgsgeometrycache.h>
%End
public:
QgsGeometryCache( QgsVectorLayer* layer );
~QgsGeometryCache();

QgsGeometryMap& cachedGeometries();

//! fetch geometry from cache, return true if successful
bool geometry( QgsFeatureId fid, QgsGeometry& geometry );

//! store a geometry in the cache
void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );

//! get rid of the cached geometry
void removeGeometry( QgsFeatureId fid );


/** Deletes the geometries in mCachedGeometries */
void deleteCachedGeometries();

void setCachedGeometriesRect( const QgsRectangle& extent );
const QgsRectangle& cachedGeometriesRect();

protected:
QgsVectorLayerEditBuffer *editBuffer();
};

0 comments on commit 99f998a

Please sign in to comment.
You can’t perform that action at this time.