-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 2D affine transformation support
- Loading branch information
Showing
3 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright (c) 2023 M.J.N. Corino, The Netherlands | ||
# | ||
# This software is released under the MIT license. | ||
|
||
### | ||
# wxRuby3 wxWidgets interface director | ||
### | ||
|
||
module WXRuby3 | ||
|
||
class Director | ||
|
||
class AffineMatrix2D < Director | ||
|
||
def setup | ||
spec.items.unshift('wxAffineMatrix2DBase') << 'wxMatrix2D' | ||
|
||
spec.make_abstract 'wxAffineMatrix2DBase' | ||
spec.disable_proxies | ||
|
||
spec.map_apply 'int * OUTPUT' => ['wxDouble *'] | ||
spec.map 'wxPoint2DDouble *' => 'Wx::Point2DDouble' do | ||
map_in ignore: true, temp: 'wxPoint2DDouble tmp', code: '$1 = &tmp;' | ||
|
||
map_argout code: <<~__CODE | ||
$result = SWIG_Ruby_AppendOutput($result, SWIG_NewPointerObj(new wxPoint2DDouble(tmp$argnum), SWIGTYPE_p_wxPoint2DDouble, SWIG_POINTER_OWN)); | ||
__CODE | ||
end | ||
spec.map 'wxMatrix2D *' => 'Wx::Matrix2D' do | ||
map_in ignore: true, temp: 'wxMatrix2D tmp', code: '$1 = &tmp;' | ||
|
||
map_argout code: <<~__CODE | ||
$result = SWIG_Ruby_AppendOutput($result, SWIG_NewPointerObj(new wxMatrix2D(tmp$argnum), SWIGTYPE_p_wxPoint2DDouble, SWIG_POINTER_OWN)); | ||
__CODE | ||
end | ||
|
||
spec.ignore 'wxAffineMatrix2D::Mirror', | ||
'wxAffineMatrix2D::TransformPoint', | ||
'wxAffineMatrix2D::TransformDistance', | ||
'wxAffineMatrix2D::IsEqual' | ||
|
||
spec.regard 'wxMatrix2D::m_11', 'wxMatrix2D::m_12', | ||
'wxMatrix2D::m_21', 'wxMatrix2D::m_22' | ||
|
||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters