Skip to content
Permalink
Browse files
sipify_all
  • Loading branch information
m-kuhn committed Apr 7, 2017
1 parent ebc1afe commit 58d2d6d7f9f44507108612903be3b2b83cac0a16
@@ -28,7 +28,6 @@ class QgsAnnotationManager : QObject
%TypeHeaderCode
#include "qgsannotationmanager.h"
%End

public:

explicit QgsAnnotationManager( QgsProject *project /TransferThis/ = 0 );
@@ -19,7 +19,6 @@ class QgsSvgAnnotation: QgsAnnotation
%TypeHeaderCode
#include "qgssvgannotation.h"
%End

public:

QgsSvgAnnotation( QObject *parent /TransferThis/ = 0 );
@@ -19,7 +19,6 @@ class QgsTextAnnotation: QgsAnnotation
%TypeHeaderCode
#include "qgstextannotation.h"
%End

public:

QgsTextAnnotation( QObject *parent /TransferThis/ = 0 );
@@ -23,7 +23,6 @@ class QgsProcessingFeedback : QgsFeedback
%TypeHeaderCode
#include "qgsprocessingfeedback.h"
%End

public:

virtual void setProgressText( const QString &text );
@@ -21,7 +21,6 @@ class QgsProcessingProvider : QObject
%TypeHeaderCode
#include "qgsprocessingprovider.h"
%End

public:

QgsProcessingProvider( QObject *parent /TransferThis/ = 0 );
@@ -23,7 +23,6 @@ class QgsProcessingRegistry : QObject
%TypeHeaderCode
#include "qgsprocessingregistry.h"
%End

public:

QgsProcessingRegistry( QObject *parent /TransferThis/ = 0 );
@@ -22,7 +22,6 @@ class QgsProcessingUtils
%TypeHeaderCode
#include "qgsprocessingutils.h"
%End

public:

static QList< QgsRasterLayer * > compatibleRasterLayers( QgsProject *project, bool sort = true );
@@ -27,7 +27,6 @@ class QgsActionScopeRegistry : QObject
%TypeHeaderCode
#include "qgsactionscoperegistry.h"
%End

public:

explicit QgsActionScopeRegistry( QObject *parent = 0 );
@@ -15,7 +15,7 @@ class QgsAggregateCalculator
{
%Docstring
Utility class for calculating aggregates for a field (or expression) over the features
from a vector layer. It is recommended that QgsVectorLayer::aggregate() is used rather then
from a vector layer. It is recommended that QgsVectorLayer.aggregate() is used rather then
directly using this class, as the QgsVectorLayer method can handle delegating aggregate calculation
to a data provider for remote calculation.
.. versionadded:: 2.16
@@ -57,15 +57,15 @@ class QgsAggregateCalculator
%Docstring
Optional filter for calculating aggregate over a subset of features, or an
empty string to use all features.
\see QgsAggregateCalculator::setFilter()
\see QgsAggregateCalculator::filter()
\see QgsAggregateCalculator.setFilter()
\see QgsAggregateCalculator.filter()
%End

QString delimiter;
%Docstring
Delimiter to use for joining values with the StringConcatenate aggregate.
\see QgsAggregateCalculator::setDelimiter()
\see QgsAggregateCalculator::delimiter()
\see QgsAggregateCalculator.setDelimiter()
\see QgsAggregateCalculator.delimiter()
%End
};

@@ -15,7 +15,6 @@ class QgsAttributeEditorElement /Abstract/
%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End

%ConvertToSubClassCode
switch ( sipCpp->type() )
{
@@ -31,7 +31,7 @@ class QgsAttributeTableConfig
Constructor for ColumnConfig
%End

bool operator== ( const ColumnConfig &other ) const;
bool operator== ( const QgsAttributeTableConfig::ColumnConfig &other ) const;

QgsAttributeTableConfig::Type type; //!< The type of this column.
QString name; //!< The name of the attribute if this column represents a field
@@ -33,8 +33,6 @@ class QgsFeature
#define sipType_QVariant ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QVariant))
#endif
%End


public:

SIP_PYOBJECT __iter__();
@@ -125,7 +125,7 @@ class QgsPropertyTransformer
%TypeHeaderCode
#include "qgspropertytransformer.h"
%End

private:
%ConvertToSubClassCode
if ( sipCpp->transformerType() == QgsPropertyTransformer::GenericNumericTransformer )
sipType = sipType_QgsGenericNumericTransformer;
@@ -136,7 +136,6 @@ class QgsPropertyTransformer
else
sipType = sipType_QgsPropertyTransformer;
%End

public:

enum Type
@@ -297,8 +297,6 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
%TypeHeaderCode
#include "qgsvectorlayer.h"
%End


public:

enum EditResult
@@ -22,7 +22,6 @@ class QgsRasterFileWriterTask : QgsTask
%TypeHeaderCode
#include "qgsrasterfilewritertask.h"
%End

public:

QgsRasterFileWriterTask( const QgsRasterFileWriter &writer, QgsRasterPipe *pipe /Transfer/,
@@ -20,7 +20,6 @@ class CharacterWidget : QWidget
%TypeHeaderCode
#include "characterwidget.h"
%End

public:

CharacterWidget( QWidget *parent /TransferThis/ = 0 );
@@ -3,6 +3,10 @@
use warnings;
use File::Basename;

use constant PRIVATE => 0;
use constant PROTECTED => 1;
use constant PUBLIC => 2;

# TODO add contexts for
# "multiline function signatures"
# docustrings for QgsFeature::QgsAttributes
@@ -40,7 +44,7 @@ sub processDoxygenLine
# contexts
my $SIP_RUN = 0;
my $HEADER_CODE = 0;
my $PRIVATE_SECTION = 0;
my $ACCESS = PUBLIC;
my $MULTILINE_DEFINITION = 0;

my $comment = '';
@@ -85,8 +89,8 @@ sub processDoxygenLine
if ($line =~ m/^\s*#/){
if ( $line =~ m/^\s*#ifdef SIP_RUN/){
$SIP_RUN = 1;
if ($PRIVATE_SECTION == 1){
print $private_section_line;
if ($ACCESS == PRIVATE){
print $private_section_line
}
next;
}
@@ -133,7 +137,7 @@ sub processDoxygenLine
}
elsif ( $line =~ m/^\s*#else/ && $nesting_index == 0 ){
# code here will be printed out
if ($PRIVATE_SECTION == 1){
if ($ACCESS == PRIVATE){
print $private_section_line;
}
$SIP_RUN = 1;
@@ -178,21 +182,22 @@ sub processDoxygenLine

# Private members (exclude SIP_RUN)
if ( $line =~ m/^\s*private( slots)?:/ ){
$PRIVATE_SECTION = 1;
$ACCESS = PRIVATE;
$private_section_line = $line;
next;
}
if ( $PRIVATE_SECTION == 1 ){
if ( $SIP_RUN == 0){
if ( $line =~ m/^\s*(public|protected)( slots)?:.*$/ || $line =~ m/^\};.*$/){
$PRIVATE_SECTION = 0;
}
else {
next;
}
}
elsif ( $line =~ m/^\s*(public)( slots)?:.*$/ ){
$ACCESS = PUBLIC;
}
elsif ( $line =~ m/^\};.*$/ ) {
$ACCESS = PUBLIC;
}
elsif ( $line =~ m/^\s*(protected)( slots)?:.*$/ ){
$ACCESS = PROTECTED;
}
elsif ( $ACCESS == PRIVATE && $SIP_RUN == 0 ) {
next;
}

# Skip assignment operator
if ( $line =~ m/operator=\s*\(/ ){
print "// $line";
@@ -226,6 +231,10 @@ sub processDoxygenLine
}
}

if ( $line =~ m/^(\s*struct)\s+(\w+)$/ ) {
$ACCESS = PUBLIC;
}

# class declaration started
if ( $line =~ m/^(\s*class)\s*([A-Z]+_EXPORT)?\s+(\w+)(\s*\:.*)?(\s*SIP_ABSTRACT)?$/ ){
do {no warnings 'uninitialized';
@@ -260,6 +269,7 @@ sub processDoxygenLine

$comment = '';
$HEADER_CODE = 1;
$ACCESS = PRIVATE;
next;
}

@@ -282,8 +292,8 @@ sub processDoxygenLine
next;
}

# skip non-method member declaration (e.g. in protected sections)
if ( $SIP_RUN != 1 && $line =~ m/^\s*\w+(::\w+)? \*?\w+( = \w+(\([^()]+\))?)?;/){
# skip non-method member declaration (in non-public sections)
if ( $SIP_RUN != 1 && $ACCESS != PUBLIC && $line =~ m/^\s*\w+(::\w+)? \*?\w+( = \w+(\([^()]+\))?)?;/){
next;
}

@@ -56,7 +56,7 @@ class CORE_EXPORT QgsAttributeTableConfig
, width( -1 )
{}

bool operator== ( const ColumnConfig &other ) const;
bool operator== ( const QgsAttributeTableConfig::ColumnConfig &other ) const;

QgsAttributeTableConfig::Type type; //!< The type of this column.
QString name; //!< The name of the attribute if this column represents a field

0 comments on commit 58d2d6d

Please sign in to comment.