Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 41 additions & 32 deletions rakelib/lib/director/derived_dc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setup
}
return rc;
}
__HEREDOC
__HEREDOC
# not relevant anymore
spec.ignore 'wxScreenDC::StartDrawingOnTop',
'wxScreenDC::EndDrawingOnTop',
Expand Down Expand Up @@ -82,14 +82,14 @@ def setup
return Qfalse;
#endif
}
__HEREDOC
__HEREDOC
spec.add_extend_code 'wxPaintDC', <<~__HEREDOC
#include "wx/dcbuffer.h"
static VALUE has_native_double_buffer()
{
return do_check_native_double_buffer();
}
__HEREDOC
__HEREDOC
when 'wxMemoryDC'
spec.items << 'wxBufferedDC' << 'wxBufferedPaintDC'
spec.override_inheritance_chain('wxMemoryDC', ['wxDC', { 'wxReadOnlyDC' => 'wxDC' }, 'wxObject']) if Config.instance.wx_version_check('3.3.0') >= 0
Expand Down Expand Up @@ -249,6 +249,9 @@ def setup
when 'wxSVGFileDC'
spec.override_inheritance_chain('wxSVGFileDC', ['wxDC', { 'wxReadOnlyDC' => 'wxDC' }, 'wxObject']) if Config.instance.wx_version_check('3.3.0') >= 0
spec.items.concat %w[wxSVGBitmapHandler wxSVGBitmapFileHandler wxSVGBitmapEmbedHandler]
if Config.instance.wx_version_check('3.3.2') > 0
spec.items.concat %w[wxSVGAttributes]
end
spec.make_abstract 'wxSVGFileDC'
spec.ignore 'wxSVGFileDC::wxSVGFileDC'
# like all DC this should best always be a temporary stack object
Expand Down Expand Up @@ -284,6 +287,12 @@ def setup
'wxSVGFileDC::EndDoc',
'wxSVGFileDC::StartPage',
'wxSVGFileDC::EndPage'
if Config.instance.wx_version_check('3.3.2') > 0
# simplify/optimize mapping for wxSVGAttributes return values
spec.map 'wxSVGAttributes&' => 'Wx::SVGAttributes' do
map_out code: '$result = self; (void)$1;' # simply return the 'self' argument
end
end
when 'wxGCDC'
spec.override_inheritance_chain('wxGCDC', ['wxDC', { 'wxReadOnlyDC' => 'wxDC' }, 'wxObject']) if Config.instance.wx_version_check('3.3.0') >= 0
spec.make_abstract 'wxGCDC'
Expand Down Expand Up @@ -311,7 +320,7 @@ def setup
}
return rc;
}
__HEREDOC
__HEREDOC
end
spec.add_extend_code 'wxGCDC', <<~__HEREDOC
static VALUE draw_on()
Expand Down Expand Up @@ -386,7 +395,7 @@ def setup
}
return rc;
}
__HEREDOC
__HEREDOC
spec.disown 'wxGraphicsContext *gc'
spec.ignore 'wxGCDC::wxGCDC(const wxEnhMetaFileDC &)'
when 'wxScaledDC'
Expand Down Expand Up @@ -422,7 +431,7 @@ def setup
return rc;
}
};
__HEREDOC
__HEREDOC
spec.swig_import %w[ext/wxruby3/swig/classes/include/wxObject.h
ext/wxruby3/swig/classes/include/wxDC.h]
spec.add_interface_code <<~__HEREDOC
Expand All @@ -433,7 +442,7 @@ class wxScaledDC : public wxDC
protected:
wxScaledDC(wxDC& target, double scale);
};
__HEREDOC
__HEREDOC
when 'wxPrinterDC'
spec.override_inheritance_chain('wxPrinterDC', ['wxDC', { 'wxReadOnlyDC' => 'wxDC' }, 'wxObject']) if Config.instance.wx_version_check('3.3.0') >= 0
spec.make_abstract 'wxPrinterDC'
Expand Down Expand Up @@ -513,41 +522,41 @@ class wxScaledDC : public wxDC
}
return rc;
}
__HEREDOC
__HEREDOC
if Config.instance.wx_version_check('3.3.0') >= 0
spec.items << 'wxOverlayDC'
spec.override_inheritance_chain('wxOverlayDC', ['wxDC', { 'wxReadOnlyDC' => 'wxDC' }, 'wxObject'])
spec.make_abstract 'wxOverlayDC'
spec.ignore 'wxOverlayDC::wxOverlayDC'
spec.add_extend_code 'wxOverlayDC', <<~__HEREDOC
static VALUE draw_on(wxOverlay &overlay, wxWindow *win)
{
if (!wxRuby_IsAppRunning())
rb_raise(rb_eRuntimeError, "A running Wx::App is required.");
VALUE rc = Qnil;
if (rb_block_given_p ())
static VALUE draw_on(wxOverlay &overlay, wxWindow *win)
{
wxOverlayDC ovl_dc(overlay, win);
wxOverlayDC* ovl_dc_ptr = &ovl_dc;
VALUE rb_dc = SWIG_NewPointerObj(SWIG_as_voidptr(ovl_dc_ptr), SWIGTYPE_p_wxOverlayDC, 0);
rc = rb_yield(rb_dc);
if (!wxRuby_IsAppRunning())
rb_raise(rb_eRuntimeError, "A running Wx::App is required.");
VALUE rc = Qnil;
if (rb_block_given_p ())
{
wxOverlayDC ovl_dc(overlay, win);
wxOverlayDC* ovl_dc_ptr = &ovl_dc;
VALUE rb_dc = SWIG_NewPointerObj(SWIG_as_voidptr(ovl_dc_ptr), SWIGTYPE_p_wxOverlayDC, 0);
rc = rb_yield(rb_dc);
}
return rc;
}
return rc;
}
static VALUE draw_on(wxOverlay &overlay, wxWindow *win, const wxRect &rect)
{
if (!wxRuby_IsAppRunning())
rb_raise(rb_eRuntimeError, "A running Wx::App is required.");
VALUE rc = Qnil;
if (rb_block_given_p ())
static VALUE draw_on(wxOverlay &overlay, wxWindow *win, const wxRect &rect)
{
wxOverlayDC ovl_dc(overlay, win, rect);
wxOverlayDC* ovl_dc_ptr = &ovl_dc;
VALUE rb_dc = SWIG_NewPointerObj(SWIG_as_voidptr(ovl_dc_ptr), SWIGTYPE_p_wxOverlayDC, 0);
rc = rb_yield(rb_dc);
if (!wxRuby_IsAppRunning())
rb_raise(rb_eRuntimeError, "A running Wx::App is required.");
VALUE rc = Qnil;
if (rb_block_given_p ())
{
wxOverlayDC ovl_dc(overlay, win, rect);
wxOverlayDC* ovl_dc_ptr = &ovl_dc;
VALUE rb_dc = SWIG_NewPointerObj(SWIG_as_voidptr(ovl_dc_ptr), SWIGTYPE_p_wxOverlayDC, 0);
rc = rb_yield(rb_dc);
}
return rc;
}
return rc;
}
__HEREDOC
end
else
Expand Down
4 changes: 2 additions & 2 deletions rakelib/lib/specs/interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ module WXRuby3
Director.Spec(pkg, 'wxPersistentWindow', requirements: %w[USE_CONFIG])
Director.Spec(pkg, 'wxSecretStore', requirements: %w[USE_SECRETSTORE])
Director.Spec(pkg, 'wxDCOverlay', director: Director::DerivedDC)
Director.Spec(pkg, 'wxGeometry', requirements: %w[USE_GEOMETRY])
Director.Spec(pkg, 'wxAffineMatrix2D', requirements: %w[USE_GEOMETRY])
Director.Spec(pkg, 'wxGeometry', requirements: Config.instance.wx_version_check('3.3.2') <= 0 ? %w[USE_GEOMETRY] : [])
Director.Spec(pkg, 'wxAffineMatrix2D', requirements: Config.instance.wx_version_check('3.3.2') <= 0 ? %w[USE_GEOMETRY] : [])
Director.Spec(pkg, 'wxCredentialEntryDialog', director: Director::Dialog, requirements: %w[USE_CREDENTIALDLG])
Director.Spec(pkg, 'wxGenericAboutDialog', director: Director::Dialog, requirements: %w[USE_ABOUTDLG])
Director.Spec(pkg, 'wxMBConv')
Expand Down
5 changes: 3 additions & 2 deletions tools/scripts/docker/setup-opensuse.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

zypper install -y git xorg-x11-server-Xvfb xvfb-run xauth xorg-x11-fonts which find curl gcc make tar gzip xz zlib-devel libyaml-devel libopenssl-devel libffi-devel readline-devel libwebp-devel libexpat-devel
zypper ref --force
zypper install -y --force-resolution git xorg-x11-server-Xvfb xvfb-run xauth xorg-x11-fonts which find curl gcc make tar gzip xz zlib-devel libyaml-devel libopenssl-devel libffi-devel readline-devel libwebp-devel libexpat-devel
if [ "$1" == "test" ]; then
zypper install -y gtk3 webkit2gtk3-devel libGLU1 gspell libnotify4 libsecret curl
zypper install -y --force-resolution gtk3 webkit2gtk3-devel libGLU1 gspell libnotify4 libsecret curl
fi
Loading