Skip to content

Commit

Permalink
Add some missing /Factory/ annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 24, 2017
1 parent 43d094e commit 15f3bbf
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions python/core/qgscolorramp.sip
Expand Up @@ -144,7 +144,7 @@ class QgsGradientColorRamp : QgsColorRamp
\param stops optional list of additional color stops
%End

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Creates a new QgsColorRamp from a map of properties
:rtype: QgsColorRamp
Expand Down Expand Up @@ -477,7 +477,7 @@ class QgsPresetSchemeColorRamp : QgsColorRamp, QgsColorScheme
not available in Python bindings - use setColors instead
%End

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string
map.
Expand Down Expand Up @@ -541,7 +541,7 @@ class QgsColorBrewerColorRamp : QgsColorRamp
\param inverted invert ramp ordering
%End

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
Returns a new QgsColorBrewerColorRamp color ramp created using the properties encoded in a string
map.
Expand Down Expand Up @@ -647,7 +647,7 @@ class QgsCptCityColorRamp : QgsGradientColorRamp
\param doLoadFile load cpt-city ramp from file
%End

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
:rtype: QgsColorRamp
%End
Expand Down
10 changes: 5 additions & 5 deletions python/core/symbology-ng/qgssymbollayerregistry.sip
Expand Up @@ -52,7 +52,7 @@ Create a symbol layer of this type given the map of properties.
Create widget for symbol layer of this type. Can return NULL if there's no GUI
:rtype: QgsSymbolLayerWidget
%End
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & );
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) /Factory/;
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
Expand Down Expand Up @@ -85,9 +85,9 @@ Convenience metadata class that uses static functions to create symbol layer and



virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map );
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl );
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem );
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) /Factory/;
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) /Factory/;
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) /Factory/;
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );

protected:
Expand Down Expand Up @@ -133,7 +133,7 @@ create a new instance of symbol layer given symbol layer name and properties
:rtype: QgsSymbolLayer
%End

QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const /Factory/;
%Docstring
create a new instance of symbol layer given symbol layer name and SLD
:rtype: QgsSymbolLayer
Expand Down
12 changes: 6 additions & 6 deletions python/core/symbology-ng/qgssymbollayerutils.sip
Expand Up @@ -337,15 +337,15 @@ Writes a symbol definition to XML
:rtype: bool
%End

static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
Expand Down Expand Up @@ -577,7 +577,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
:rtype: QVariant
%End

static QgsColorRamp *loadColorRamp( const QVariant &value );
static QgsColorRamp *loadColorRamp( const QVariant &value ) /Factory/;
%Docstring
Load a color ramp from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.readVariant to load it from an XML document.
Expand Down Expand Up @@ -605,7 +605,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
:rtype: list of QColor
%End

static QMimeData *colorToMimeData( const QColor &color );
static QMimeData *colorToMimeData( const QColor &color ) /Factory/;
%Docstring
Creates mime data from a color. Sets both the mime data's color data, and the
mime data's text with the color's hex code.
Expand Down Expand Up @@ -636,7 +636,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
:rtype: QgsNamedColorList
%End

static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true );
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) /Factory/;
%Docstring
Creates mime data from a list of named colors
\param colorList list of named colors
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscolorramp.h
Expand Up @@ -142,7 +142,7 @@ class CORE_EXPORT QgsGradientColorRamp : public QgsColorRamp
const QgsGradientStopsList &stops = QgsGradientStopsList() );

//! Creates a new QgsColorRamp from a map of properties
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

virtual int count() const override { return mStops.count() + 2; }
virtual double value( int index ) const override;
Expand Down Expand Up @@ -439,7 +439,7 @@ class CORE_EXPORT QgsPresetSchemeColorRamp : public QgsColorRamp, public QgsColo
* \param properties color ramp properties
* \see properties()
*/
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

/** Sets the list of colors used by the ramp.
* \param colors list of colors
Expand Down Expand Up @@ -496,7 +496,7 @@ class CORE_EXPORT QgsColorBrewerColorRamp : public QgsColorRamp
* \param properties color ramp properties
* \see properties()
*/
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

virtual double value( int index ) const override;
virtual QColor color( double value ) const override;
Expand Down Expand Up @@ -586,7 +586,7 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp
const QString &variantName = QString(), bool inverted = false,
bool doLoadFile = true );

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

virtual QString type() const override { return QStringLiteral( "cpt-city" ); }

Expand Down
10 changes: 5 additions & 5 deletions src/core/symbology-ng/qgssymbollayerregistry.h
Expand Up @@ -50,7 +50,7 @@ class CORE_EXPORT QgsSymbolLayerAbstractMetadata
//! Create widget for symbol layer of this type. Can return NULL if there's no GUI
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer * ) SIP_FACTORY { return nullptr; }
//! Create a symbol layer of this type given the map of properties.
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) { return nullptr; }
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) SIP_FACTORY { return nullptr; }

/** Resolve paths in symbol layer's properties (if there are any paths).
* When saving is true, paths are converted from absolute to relative,
Expand Down Expand Up @@ -109,9 +109,9 @@ class CORE_EXPORT QgsSymbolLayerMetadata : public QgsSymbolLayerAbstractMetadata
//! \note not available in Python bindings
void setWidgetFunction( QgsSymbolLayerWidgetFunc f ) { mWidgetFunc = f; } SIP_SKIP

virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) override { return mCreateFunc ? mCreateFunc( map ) : nullptr; } SIP_FACTORY
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) override { return mWidgetFunc ? mWidgetFunc( vl ) : nullptr; } SIP_FACTORY
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) override { return mCreateFromSldFunc ? mCreateFromSldFunc( elem ) : nullptr; } SIP_FACTORY
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) override SIP_FACTORY { return mCreateFunc ? mCreateFunc( map ) : nullptr; }
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) override SIP_FACTORY { return mWidgetFunc ? mWidgetFunc( vl ) : nullptr; }
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) override SIP_FACTORY { return mCreateFromSldFunc ? mCreateFromSldFunc( elem ) : nullptr; }
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving ) override
{
if ( mPathResolverFunc )
Expand Down Expand Up @@ -159,7 +159,7 @@ class CORE_EXPORT QgsSymbolLayerRegistry
QgsSymbolLayer *createSymbolLayer( const QString &name, const QgsStringMap &properties = QgsStringMap() ) const SIP_FACTORY;

//! create a new instance of symbol layer given symbol layer name and SLD
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const SIP_FACTORY;

/** Resolve paths in properties of a particular symbol layer.
* This normally means converting relative paths to absolute paths when loading
Expand Down
12 changes: 6 additions & 6 deletions src/core/symbology-ng/qgssymbollayerutils.h
Expand Up @@ -254,9 +254,9 @@ class CORE_EXPORT QgsSymbolLayerUtils

static bool createSymbolLayerListFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType, QgsSymbolLayerList &layers );

static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) SIP_FACTORY;
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) SIP_FACTORY;
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) SIP_FACTORY;

static bool convertPolygonSymbolizerToPointMarker( QDomElement &element, QgsSymbolLayerList &layerList );
static bool hasExternalGraphic( QDomElement &element );
Expand Down Expand Up @@ -395,7 +395,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
*
* \see colorRampToVariant()
*/
static QgsColorRamp *loadColorRamp( const QVariant &value );
static QgsColorRamp *loadColorRamp( const QVariant &value ) SIP_FACTORY;

/**
* Returns a friendly display name for a color
Expand All @@ -421,7 +421,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
* \see colorFromMimeData
* \since QGIS 2.5
*/
static QMimeData *colorToMimeData( const QColor &color );
static QMimeData *colorToMimeData( const QColor &color ) SIP_FACTORY;

/**
* Attempts to parse mime data as a color
Expand Down Expand Up @@ -449,7 +449,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
* \returns mime data containing encoded colors
* \since QGIS 2.5
*/
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true );
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) SIP_FACTORY;

/**
* Exports colors to a gpl GIMP palette file
Expand Down

0 comments on commit 15f3bbf

Please sign in to comment.