mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -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_DEPRECATED" \
|
||||
"SIP_END" \
|
||||
"SIP_EXTERNAL" \
|
||||
"SIP_FACTORY" \
|
||||
"SIP_FEATURE" \
|
||||
"SIP_IF_FEATURE" \
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
|
||||
class QgsPaintEffectWidget /External/;
|
||||
|
||||
class QgsPaintEffectAbstractMetadata
|
||||
{
|
||||
@ -73,8 +74,6 @@ class QgsPaintEffectAbstractMetadata
|
||||
|
||||
};
|
||||
|
||||
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & );
|
||||
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )();
|
||||
|
||||
|
||||
|
||||
@ -161,6 +160,8 @@ class QgsPaintEffectRegistry
|
||||
:rtype: bool
|
||||
%End
|
||||
|
||||
private:
|
||||
QgsPaintEffectRegistry( const QgsPaintEffectRegistry &rh );
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -151,6 +151,7 @@ sub fix_annotations(){
|
||||
$line =~ s/\bSIP_ARRAYSIZE\b/\/ArraySize\//g;
|
||||
$line =~ s/\bSIP_DEPRECATED\b/\/Deprecated\//g;
|
||||
$line =~ s/\bSIP_CONSTRAINED\b/\/Constrained\//g;
|
||||
$line =~ s/\bSIP_EXTERNAL\b/\/External\//g;
|
||||
$line =~ s/\bSIP_FACTORY\b/\/Factory\//;
|
||||
$line =~ s/\bSIP_IN\b/\/In\//g;
|
||||
$line =~ s/\bSIP_INOUT\b/\/In,Out\//g;
|
||||
@ -357,9 +358,16 @@ while ($line_idx < $line_count){
|
||||
}
|
||||
|
||||
# Skip forward declarations
|
||||
if ($line =~ m/^\s*(class|struct) \w+;\s*(\/\/.*)?$/){
|
||||
dbg_info('skipping forward declaration');
|
||||
next;
|
||||
if ($line =~ m/^\s*(class|struct) \w+(?<external> *SIP_EXTERNAL)?;\s*(\/\/.*)?$/){
|
||||
if ($+{external}){
|
||||
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
|
||||
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
|
||||
# https://regex101.com/r/6FWntP/5
|
||||
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_.*)?$/ ){
|
||||
# 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_\w+)?(?!;)$/ ){
|
||||
dbg_info("class definition started");
|
||||
push @ACCESS, PUBLIC;
|
||||
push @EXPORTED, 0;
|
||||
|
@ -17,13 +17,12 @@
|
||||
#define QGSPAINTEFFECTREGISTRY_H
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgis.h"
|
||||
#include <QDomElement>
|
||||
#include <QDomDocument>
|
||||
|
||||
class QgsPaintEffect;
|
||||
class QgsPaintEffectWidget;
|
||||
class QgsPaintEffectWidget SIP_EXTERNAL;
|
||||
|
||||
/** \ingroup core
|
||||
* \class QgsPaintEffectAbstractMetadata
|
||||
@ -77,8 +76,8 @@ class CORE_EXPORT QgsPaintEffectAbstractMetadata
|
||||
|
||||
};
|
||||
|
||||
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & );
|
||||
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )();
|
||||
typedef QgsPaintEffect *( *QgsPaintEffectCreateFunc )( const QgsStringMap & ) SIP_SKIP;
|
||||
typedef QgsPaintEffectWidget *( *QgsPaintEffectWidgetFunc )() SIP_SKIP;
|
||||
|
||||
/** \ingroup core
|
||||
* \class QgsPaintEffectMetadata
|
||||
@ -219,6 +218,9 @@ class CORE_EXPORT QgsPaintEffectRegistry
|
||||
static bool isDefaultStack( QgsPaintEffect *effect );
|
||||
|
||||
private:
|
||||
#ifdef SIP_RUN
|
||||
QgsPaintEffectRegistry( const QgsPaintEffectRegistry &rh );
|
||||
#endif
|
||||
|
||||
QMap<QString, QgsPaintEffectAbstractMetadata *> mMetadata;
|
||||
};
|
||||
|
@ -91,6 +91,11 @@
|
||||
*/
|
||||
#define SIP_CONSTRAINED
|
||||
|
||||
/*
|
||||
* http://pyqt.sourceforge.net/Docs/sip4/annotations.html?highlight=external#class-annotation-External
|
||||
*/
|
||||
#define SIP_EXTERNAL
|
||||
|
||||
/*
|
||||
* discard line
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user