Skip to content

Commit

Permalink
fix QgsSymbolLayerV2Metadata sip bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 24, 2012
1 parent f99cf89 commit 86217d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
23 changes: 6 additions & 17 deletions python/core/symbology-ng/qgssymbollayerv2registry.sip
@@ -1,3 +1,5 @@
class QgsSymbolLayerV2Widget /External/;

typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMap& );
typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )( const QgsVectorLayer* );
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
Expand Down Expand Up @@ -36,28 +38,15 @@ class QgsSymbolLayerV2Metadata : QgsSymbolLayerV2AbstractMetadata
%End

public:
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );

QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2CreateFromSldFunc pfCreateFromSld,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );

QgsSymbolLayerV2CreateFunc createFunction() const;
QgsSymbolLayerV2WidgetFunc widgetFunction() const;
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const;

void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f );

virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) /Factory/;
virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVectorLayer* vl ) /Factory/;
virtual QgsSymbolLayerV2* createSymbolLayerFromSld( QDomElement& elem ) /Factory/;

private:
QgsSymbolLayerV2Metadata(); // pretend this is private
};


/**
Registry of available symbol layer classes.
Implemented as a singleton.
Expand Down
6 changes: 6 additions & 0 deletions src/core/symbology-ng/qgssymbollayerv2registry.h
Expand Up @@ -63,6 +63,7 @@ typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMetadata
{
public:
//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
Expand All @@ -73,6 +74,7 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( NULL )
{}

//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
Expand All @@ -84,10 +86,14 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( pfCreateFromSld )
{}

//! not available in python bindings
QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc; }
//! not available in python bindings
QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc; }
//! not available in python bindings
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const { return mCreateFromSldFunc; }

//! not available in python bindings
void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f ) { mWidgetFunc = f; }

virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) { return mCreateFunc ? mCreateFunc( map ) : NULL; }
Expand Down

0 comments on commit 86217d0

Please sign in to comment.