Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dtk
dtk
Commits
2d25ea6c
Commit
2d25ea6c
authored
Nov 10, 2017
by
NICLAUSSE Nicolas
Browse files
wrap objectManager and qvariant with swig + add extend rule for
qvariant in factory macro
parent
de0ceb4a
Changes
5
Hide whitespace changes
Inline
Side-by-side
cmake/dtkConfig.cmake.in
View file @
2d25ea6c
...
...
@@ -49,6 +49,7 @@ set(dtk_INSTALL_DOCS @dtk_INSTALL_DOCS@)
set(dtk_CONFIG_DOCS @dtk_CONFIG_DOCS@)
set(dtk_WRAP_BASE "@CMAKE_BINARY_DIR@/dtk_base.i")
set(dtk_WRAP_CORE "@CMAKE_BINARY_DIR@/dtkCore.i")
set(dtk_WRAP_QVARIANT "@CMAKE_BINARY_DIR@/QVariant.i")
## ###################################################################
## Options
...
...
src/dtkCore/dtkCore.i
View file @
2d25ea6c
...
...
@@ -22,10 +22,13 @@
#
include
<
dtkCore
/
dtkCorePluginBase
.
h
>
#
include
<
dtkCore
/
dtkCorePluginManager
.
h
>
#
include
<
dtkCore
/
dtkCorePluginFactory
.
h
>
#
include
<
dtkCore
/
dtkObjectManager
.
h
>
#
include
<
dtkCore
/
dtkArray
.
h
>
%
}
%
feature
(
"director"
)
;
// /////////////////////////////////////////////////////////////////
...
...
@@ -43,6 +46,7 @@
%
include
<
dtkCore
/
dtkCorePluginManager
.
h
>
%
include
<
dtkCore
/
dtkCorePluginFactory
.
h
>
%
include
<
dtkCore
/
dtkArray
.
h
>
%
include
<
dtkCore
/
dtkObjectManager
.
h
>
%
template
(
dtkArrayInt
)
dtkArray
<
long
long
>
;
%
template
(
dtkArrayDouble
)
dtkArray
<
double
>
;
...
...
wrp/QtCore/CMakeLists.txt
View file @
2d25ea6c
...
...
@@ -13,6 +13,7 @@
### Code:
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/qt_core.i
${
CMAKE_BINARY_DIR
}
/qt_core.i COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/QVariant.i
${
CMAKE_BINARY_DIR
}
/QVariant.i COPYONLY
)
######################################################################
### CMakeLists.txt ends here
wrp/QtCore/QVariant.i
0 → 100644
View file @
2d25ea6c
class
QVariant
{
public
:
QVariant
()
;
QVariant
(
int
)
;
QVariant
(
const
char
*
)
;
QVariant
(
bool
)
;
int
toInt
()
const
;
QString
toString
()
const
;
QStringList
toStringList
()
const
;
bool
toBool
()
const
;
}
;
%
extend
QVariant
{
void
setValue
(
int
value
)
{
$
self-
>
setValue
(
QVariant
::
fromValue
(
value
))
;
}
}
wrp/dtkBase/dtk_base.i
View file @
2d25ea6c
...
...
@@ -65,6 +65,14 @@
#
undef
DTK_DECLARE_PLUGIN_FACTORY
(
type
,
Export
)
%
define
DTK_DECLARE_PLUGIN_FACTORY
(
type
,
Export
)
%
extend
QVariant
{
void
setValue
(
type
*
value
)
{
$
self-
>
setValue
(
dtkMetaType
::
variantFromValue
(
value
))
;
}
type
*
to
##
type
()
const
{
return
$
self-
>
value
<
type
*>
()
;
}
}
%
template
(
type
##
PluginFactorySwigTemplate
)
dtkCorePluginFactory
<
type
>
;
class
Export
type
##
PluginFactory
:
public
dtkCorePluginFactory
<
type
>
{}
;
%
enddef
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment