mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
[sipify] keep external forward declaration
This commit is contained in:
parent
09d3e2ff3a
commit
f63adfe145
@ -2056,6 +2056,7 @@ EXPAND_AS_DEFINED = "SIP_ABSTRACT" \
|
|||||||
"SIP_CONVERT_TO_SUBCLASS_CODE" \
|
"SIP_CONVERT_TO_SUBCLASS_CODE" \
|
||||||
"SIP_DEPRECATED" \
|
"SIP_DEPRECATED" \
|
||||||
"SIP_END" \
|
"SIP_END" \
|
||||||
|
"SIP_EXTERNAL" \
|
||||||
"SIP_FACTORY" \
|
"SIP_FACTORY" \
|
||||||
"SIP_FEATURE" \
|
"SIP_FEATURE" \
|
||||||
"SIP_IF_FEATURE" \
|
"SIP_IF_FEATURE" \
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class QgsPaintEffectWidget /External/;
|
||||||
|
|
||||||
class QgsPaintEffectAbstractMetadata
|
class QgsPaintEffectAbstractMetadata
|
||||||
{
|
{
|
||||||
@ -73,8 +74,6 @@ class QgsPaintEffectAbstractMetadata
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & );
|
|
||||||
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -161,6 +160,8 @@ class QgsPaintEffectRegistry
|
|||||||
:rtype: bool
|
:rtype: bool
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
private:
|
||||||
|
QgsPaintEffectRegistry( const QgsPaintEffectRegistry &rh );
|
||||||
};
|
};
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -151,6 +151,7 @@ sub fix_annotations(){
|
|||||||
$line =~ s/\bSIP_ARRAYSIZE\b/\/ArraySize\//g;
|
$line =~ s/\bSIP_ARRAYSIZE\b/\/ArraySize\//g;
|
||||||
$line =~ s/\bSIP_DEPRECATED\b/\/Deprecated\//g;
|
$line =~ s/\bSIP_DEPRECATED\b/\/Deprecated\//g;
|
||||||
$line =~ s/\bSIP_CONSTRAINED\b/\/Constrained\//g;
|
$line =~ s/\bSIP_CONSTRAINED\b/\/Constrained\//g;
|
||||||
|
$line =~ s/\bSIP_EXTERNAL\b/\/External\//g;
|
||||||
$line =~ s/\bSIP_FACTORY\b/\/Factory\//;
|
$line =~ s/\bSIP_FACTORY\b/\/Factory\//;
|
||||||
$line =~ s/\bSIP_IN\b/\/In\//g;
|
$line =~ s/\bSIP_IN\b/\/In\//g;
|
||||||
$line =~ s/\bSIP_INOUT\b/\/In,Out\//g;
|
$line =~ s/\bSIP_INOUT\b/\/In,Out\//g;
|
||||||
@ -357,9 +358,16 @@ while ($line_idx < $line_count){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Skip forward declarations
|
# Skip forward declarations
|
||||||
if ($line =~ m/^\s*(class|struct) \w+;\s*(\/\/.*)?$/){
|
if ($line =~ m/^\s*(class|struct) \w+(?<external> *SIP_EXTERNAL)?;\s*(\/\/.*)?$/){
|
||||||
dbg_info('skipping forward declaration');
|
if ($+{external}){
|
||||||
next;
|
dbg_info('do not skip external forward declaration');
|
||||||
|
$comment = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbg_info('skipping forward declaration');
|
||||||
|
next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET
|
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET
|
||||||
if ($line =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED).*?$/){
|
if ($line =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED).*?$/){
|
||||||
@ -401,8 +409,8 @@ while ($line_idx < $line_count){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# class declaration started
|
# class declaration started
|
||||||
# https://regex101.com/r/6FWntP/5
|
# https://regex101.com/r/6FWntP/6
|
||||||
if ( $line =~ m/^(\s*class)\s+([A-Z]+_EXPORT\s+)?(\w+)(\s*\:\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*(,\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*)*)?(?<annot>\s*SIP_.*)?$/ ){
|
if ( $line =~ m/^(\s*class)\s+([A-Z]+_EXPORT\s+)?(\w+)(\s*\:\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*(,\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*)*)?(?<annot>\s*SIP_\w+)?(?!;)$/ ){
|
||||||
dbg_info("class definition started");
|
dbg_info("class definition started");
|
||||||
push @ACCESS, PUBLIC;
|
push @ACCESS, PUBLIC;
|
||||||
push @EXPORTED, 0;
|
push @EXPORTED, 0;
|
||||||
|
@ -17,13 +17,12 @@
|
|||||||
#define QGSPAINTEFFECTREGISTRY_H
|
#define QGSPAINTEFFECTREGISTRY_H
|
||||||
|
|
||||||
#include "qgis_core.h"
|
#include "qgis_core.h"
|
||||||
#include "qgis_sip.h"
|
|
||||||
#include "qgis.h"
|
#include "qgis.h"
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
||||||
class QgsPaintEffect;
|
class QgsPaintEffect;
|
||||||
class QgsPaintEffectWidget;
|
class QgsPaintEffectWidget SIP_EXTERNAL;
|
||||||
|
|
||||||
/** \ingroup core
|
/** \ingroup core
|
||||||
* \class QgsPaintEffectAbstractMetadata
|
* \class QgsPaintEffectAbstractMetadata
|
||||||
@ -77,8 +76,8 @@ class CORE_EXPORT QgsPaintEffectAbstractMetadata
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & );
|
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & ) SIP_SKIP;
|
||||||
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )();
|
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )() SIP_SKIP;
|
||||||
|
|
||||||
/** \ingroup core
|
/** \ingroup core
|
||||||
* \class QgsPaintEffectMetadata
|
* \class QgsPaintEffectMetadata
|
||||||
@ -219,6 +218,9 @@ class CORE_EXPORT QgsPaintEffectRegistry
|
|||||||
static bool isDefaultStack( QgsPaintEffect *effect );
|
static bool isDefaultStack( QgsPaintEffect *effect );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef SIP_RUN
|
||||||
|
QgsPaintEffectRegistry( const QgsPaintEffectRegistry &rh );
|
||||||
|
#endif
|
||||||
|
|
||||||
QMap<QString, QgsPaintEffectAbstractMetadata *> mMetadata;
|
QMap<QString, QgsPaintEffectAbstractMetadata *> mMetadata;
|
||||||
};
|
};
|
||||||
|
@ -91,6 +91,11 @@
|
|||||||
*/
|
*/
|
||||||
#define SIP_CONSTRAINED
|
#define SIP_CONSTRAINED
|
||||||
|
|
||||||
|
/*
|
||||||
|
* http://pyqt.sourceforge.net/Docs/sip4/annotations.html?highlight=external#class-annotation-External
|
||||||
|
*/
|
||||||
|
#define SIP_EXTERNAL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* discard line
|
* discard line
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user