wxruby3 0.9.0.pre.beta.14 → 0.9.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/INSTALL.md +51 -22
- data/README.md +81 -6
- data/assets/hello_button-macos.png +0 -0
- data/assets/hello_button-msw.png +0 -0
- data/assets/hello_button.png +0 -0
- data/assets/hello_button_clicked-macos.png +0 -0
- data/assets/hello_button_clicked-msw.png +0 -0
- data/assets/hello_button_clicked.png +0 -0
- data/assets/hello_button_clicked_combi.png +0 -0
- data/assets/hello_world-macos.png +0 -0
- data/assets/hello_world-msw.png +0 -0
- data/assets/hello_world.png +0 -0
- data/assets/hello_world_combi.png +0 -0
- data/assets/repo-social-preview.png +0 -0
- data/ext/wxruby3/include/wxruby-runtime.h +1 -0
- data/ext/wxruby3/swig/memory_management.i +6 -10
- data/ext/wxruby3/swig/wx.i +17 -6
- data/lib/wx/core/art_locator.rb +2 -2
- data/lib/wx/core/artprovider.rb +2 -2
- data/lib/wx/core/bitmap.rb +6 -5
- data/lib/wx/core/bitmap_combobox.rb +34 -0
- data/lib/wx/core/brush.rb +6 -0
- data/lib/wx/core/controlwithitems.rb +52 -14
- data/lib/wx/core/cursor.rb +1 -1
- data/lib/wx/core/dc.rb +0 -20
- data/lib/wx/core/event_blocker.rb +14 -0
- data/lib/wx/core/evthandler.rb +48 -2
- data/lib/wx/core/find_replace_dialog.rb +24 -0
- data/lib/wx/core/font.rb +22 -14
- data/lib/wx/core/helpprovider.rb +2 -2
- data/lib/wx/core/icon.rb +1 -1
- data/lib/wx/core/image.rb +1 -1
- data/lib/wx/core/menu.rb +5 -0
- data/lib/wx/core/paintdc.rb +8 -0
- data/lib/wx/core/pen.rb +6 -0
- data/lib/wx/core/text_entry.rb +15 -0
- data/lib/wx/core/v_list_box.rb +13 -0
- data/lib/wx/core/window.rb +29 -2
- data/lib/wx/doc/app.rb +40 -0
- data/lib/wx/doc/brush.rb +17 -0
- data/lib/wx/doc/busy_info.rb +21 -0
- data/lib/wx/doc/client_dc.rb +28 -0
- data/lib/wx/doc/controlwithitems.rb +11 -0
- data/lib/wx/doc/dc.rb +0 -14
- data/lib/wx/doc/event_blocker.rb +27 -0
- data/lib/wx/doc/evthandler.rb +4 -0
- data/lib/wx/doc/extra/02_lifecycles.md +49 -0
- data/lib/wx/doc/extra/10_art.md +1 -1
- data/lib/wx/doc/extra/11_drawing_and_dc.md +62 -0
- data/lib/wx/doc/font.rb +27 -0
- data/lib/wx/doc/memory_dc.rb +75 -0
- data/lib/wx/doc/mirror_dc.rb +16 -0
- data/lib/wx/doc/pen.rb +17 -0
- data/lib/wx/doc/prt/printer_dc.rb +26 -0
- data/lib/wx/doc/radio_box.rb +20 -0
- data/lib/wx/doc/screen_dc.rb +10 -6
- data/lib/wx/doc/svg_file_dc.rb +20 -0
- data/lib/wx/doc/v_list_box.rb +9 -0
- data/lib/wx/doc/window.rb +27 -0
- data/lib/wx/doc/window_disabler.rb +10 -0
- data/lib/wx/html/keyword_defs.rb +6 -7
- data/lib/wx/html/require.rb +1 -0
- data/lib/wx/html/simple_html_listbox.rb +105 -0
- data/lib/wx/keyword_defs.rb +83 -75
- data/lib/wx/prt/keyword_defs.rb +5 -1
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/cmd/test.rb +1 -1
- data/rakelib/install.rb +20 -7
- data/rakelib/lib/config/linux.rb +4 -2
- data/rakelib/lib/config/macosx.rb +120 -1
- data/rakelib/lib/config/mingw.rb +6 -1
- data/rakelib/lib/config/unixish.rb +26 -11
- data/rakelib/lib/config.rb +15 -6
- data/rakelib/lib/core/mapping.rb +5 -5
- data/rakelib/lib/core/package.rb +1 -1
- data/rakelib/lib/core/spec.rb +9 -5
- data/rakelib/lib/core/spec_helper.rb +9 -1
- data/rakelib/lib/director/accelerator.rb +1 -1
- data/rakelib/lib/director/app.rb +55 -4
- data/rakelib/lib/director/art_provider.rb +5 -1
- data/rakelib/lib/director/aui_pane_info.rb +1 -1
- data/rakelib/lib/director/aui_tab_ctrl.rb +1 -1
- data/rakelib/lib/director/aui_toolbar.rb +41 -0
- data/rakelib/lib/director/bitmap.rb +2 -1
- data/rakelib/lib/director/bitmap_combobox.rb +32 -0
- data/rakelib/lib/director/brush.rb +11 -1
- data/rakelib/lib/director/busy_info.rb +1 -1
- data/rakelib/lib/director/choice.rb +1 -0
- data/rakelib/lib/director/clipboard.rb +1 -1
- data/rakelib/lib/director/colour.rb +1 -0
- data/rakelib/lib/director/colour_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/combobox.rb +2 -3
- data/rakelib/lib/director/context_help_button.rb +23 -0
- data/rakelib/lib/director/ctrl_with_items.rb +3 -0
- data/rakelib/lib/director/cursor.rb +1 -0
- data/rakelib/lib/director/data_object.rb +5 -7
- data/rakelib/lib/director/dc.rb +5 -1
- data/rakelib/lib/director/defs.rb +3 -0
- data/rakelib/lib/director/derived_dc.rb +278 -27
- data/rakelib/lib/director/dialog.rb +12 -3
- data/rakelib/lib/director/dir_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/event.rb +3 -3
- data/rakelib/lib/director/event_blocker.rb +41 -0
- data/rakelib/lib/director/event_filter.rb +20 -0
- data/rakelib/lib/director/event_handler.rb +29 -2
- data/rakelib/lib/director/file_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/find_replace_data.rb +1 -0
- data/rakelib/lib/director/font.rb +14 -4
- data/rakelib/lib/director/font_data.rb +1 -0
- data/rakelib/lib/director/font_picker_ctrl.rb +1 -1
- data/rakelib/lib/director/gdi_object.rb +1 -0
- data/rakelib/lib/director/graphics_context.rb +6 -6
- data/rakelib/lib/director/grid_table_message.rb +1 -1
- data/rakelib/lib/director/help_provider.rb +8 -10
- data/rakelib/lib/director/html_cell.rb +1 -1
- data/rakelib/lib/director/html_data_object.rb +5 -7
- data/rakelib/lib/director/html_listbox.rb +65 -1
- data/rakelib/lib/director/hyperlink_event.rb +22 -0
- data/rakelib/lib/director/icon.rb +2 -0
- data/rakelib/lib/director/listbox.rb +1 -0
- data/rakelib/lib/director/locale.rb +2 -1
- data/rakelib/lib/director/menu.rb +0 -3
- data/rakelib/lib/director/menu_bar.rb +3 -0
- data/rakelib/lib/director/palette.rb +1 -0
- data/rakelib/lib/director/pen.rb +12 -2
- data/rakelib/lib/director/pgproperties.rb +1 -1
- data/rakelib/lib/director/pgproperty.rb +1 -1
- data/rakelib/lib/director/pgvalidation_info.rb +1 -1
- data/rakelib/lib/director/platform_info.rb +1 -1
- data/rakelib/lib/director/popup_window.rb +18 -0
- data/rakelib/lib/director/print_data.rb +1 -1
- data/rakelib/lib/director/property_grid_interface.rb +1 -1
- data/rakelib/lib/director/property_grid_page_state.rb +1 -1
- data/rakelib/lib/director/radio_box.rb +15 -4
- data/rakelib/lib/director/region.rb +1 -0
- data/rakelib/lib/director/ribbon_art_provider.rb +1 -1
- data/rakelib/lib/director/richtext_buffer_data_object.rb +5 -7
- data/rakelib/lib/director/richtext_header_footer_data.rb +1 -1
- data/rakelib/lib/director/searchctrl.rb +25 -0
- data/rakelib/lib/director/sizer.rb +2 -2
- data/rakelib/lib/director/static_box.rb +1 -1
- data/rakelib/lib/director/styled_text_ctrl.rb +2 -0
- data/rakelib/lib/director/text_entry.rb +7 -2
- data/rakelib/lib/director/textctrl.rb +1 -1
- data/rakelib/lib/director/tree_ctrl.rb +6 -3
- data/rakelib/lib/director/uiaction_simulator.rb +20 -0
- data/rakelib/lib/director/variant.rb +1 -1
- data/rakelib/lib/director/vlistbox.rb +25 -0
- data/rakelib/lib/director/window.rb +37 -7
- data/rakelib/lib/director/with_images.rb +1 -1
- data/rakelib/lib/director/xml_node.rb +1 -1
- data/rakelib/lib/extractor/function.rb +5 -3
- data/rakelib/lib/generate/doc/about_dialog_info.yaml +46 -0
- data/rakelib/lib/generate/doc/accelerator.yaml +21 -0
- data/rakelib/lib/generate/doc/art_provider.yaml +35 -0
- data/rakelib/lib/generate/doc/bitmap.yaml +37 -0
- data/rakelib/lib/generate/doc/box_sizer.yaml +15 -0
- data/rakelib/lib/generate/doc/busy_info.yaml +74 -0
- data/rakelib/lib/generate/doc/client_dc.yaml +19 -0
- data/rakelib/lib/generate/doc/clipboard.yaml +43 -0
- data/rakelib/lib/generate/doc/collapsible_pane.yaml +21 -0
- data/rakelib/lib/generate/doc/colour_dialog.yaml +32 -0
- data/rakelib/lib/generate/doc/context_help_button.yaml +16 -0
- data/rakelib/lib/generate/doc/control.yaml +46 -0
- data/rakelib/lib/generate/doc/cursor.yaml +40 -0
- data/rakelib/lib/generate/doc/data_object.yaml +55 -0
- data/rakelib/lib/generate/doc/dc.yaml +14 -0
- data/rakelib/lib/generate/doc/dialog.yaml +36 -0
- data/rakelib/lib/generate/doc/dir_dialog.yaml +25 -0
- data/rakelib/lib/generate/doc/event_blocker.yaml +27 -0
- data/rakelib/lib/generate/doc/event_filter.yaml +47 -0
- data/rakelib/lib/generate/doc/events.yaml +152 -0
- data/rakelib/lib/generate/doc/evt_handler.yaml +63 -0
- data/rakelib/lib/generate/doc/file_dialog.yaml +68 -0
- data/rakelib/lib/generate/doc.rb +77 -14
- data/rakelib/lib/generate/interface.rb +22 -10
- data/rakelib/lib/specs/interfaces.rb +9 -5
- data/rakelib/lib/swig_runner.rb +3 -3
- data/rakelib/lib/typemap/common.rb +15 -3
- data/rakelib/lib/util/string.rb +1 -0
- data/rakelib/yard/yard/relative_markdown_links.rb +5 -1
- data/samples/aui/aui.rb +432 -363
- data/samples/bigdemo/wxArtProvider.rbw +5 -4
- data/samples/controls/controls.rb +2 -2
- data/samples/controls/htlbox.rb +411 -0
- data/samples/controls/tn_htlbox.png +0 -0
- data/samples/drawing/graphics_drawing.rb +1 -2
- data/samples/drawing/{svgtest.rb → image_prt.rb} +49 -18
- data/samples/drawing/tn_image_prt.png +0 -0
- data/samples/propgrid/propgrid.rb +26 -21
- data/samples/ribbon/ribbon.rb +47 -46
- data/samples/sampler/editor.rb +33 -25
- data/samples/sampler/sample.rb +2 -2
- data/samples/sampler/stc_editor.rb +4 -2
- data/tests/lib/item_container_tests.rb +82 -0
- data/tests/lib/text_entry_tests.rb +80 -0
- data/tests/lib/wxapp_runner.rb +15 -3
- data/tests/lib/wxframe_runner.rb +144 -0
- data/tests/test_app_event_filter.rb +74 -0
- data/tests/test_art_provider.rb +52 -0
- data/tests/test_clipboard.rb +2 -1
- data/tests/test_event_handling.rb +199 -16
- data/tests/test_events.rb +4 -11
- data/tests/test_ext_controls.rb +28 -0
- data/tests/test_font.rb +239 -0
- data/tests/test_gdi_object.rb +161 -0
- data/tests/test_intl.rb +16 -15
- data/tests/test_item_data.rb +33 -1
- data/tests/test_std_controls.rb +373 -0
- data/tests/test_window.rb +340 -0
- metadata +82 -4
- data/samples/drawing/tn_svgtest.png +0 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
###
|
2
|
+
# wxRuby3 wxWidgets interface director
|
3
|
+
# Copyright (c) M.J.N. Corino, The Netherlands
|
4
|
+
###
|
5
|
+
|
6
|
+
module WXRuby3
|
7
|
+
|
8
|
+
class Director
|
9
|
+
|
10
|
+
class EventFilter < Director
|
11
|
+
|
12
|
+
def setup
|
13
|
+
super
|
14
|
+
spec.gc_as_untracked # no tracking
|
15
|
+
end
|
16
|
+
end # class EventFilter
|
17
|
+
|
18
|
+
end # class Director
|
19
|
+
|
20
|
+
end # module WXRuby3
|
@@ -64,6 +64,32 @@ module WXRuby3
|
|
64
64
|
$1 = wx_ev;
|
65
65
|
__CODE
|
66
66
|
end
|
67
|
+
# add special mapping for event filters so we can accept the app instance as well
|
68
|
+
# although Wx::App is not derived from Wx::EventFilter in wxRuby (no multiple inheritance)
|
69
|
+
spec.map 'wxEventFilter*' => 'Wx::EventFilter,Wx::App' do
|
70
|
+
map_in code: <<~__CODE
|
71
|
+
int res = SWIG_ERROR;
|
72
|
+
void *argp = 0;
|
73
|
+
if (rb_obj_is_kind_of($input, ((swig_class*)SWIGTYPE_p_wxEventFilter->clientdata)->klass))
|
74
|
+
{
|
75
|
+
res = SWIG_ConvertPtr($input, &argp, SWIGTYPE_p_wxEventFilter, 0);
|
76
|
+
if (SWIG_IsOK(res)) $1 = reinterpret_cast< wxEventFilter * >(argp);
|
77
|
+
}
|
78
|
+
else
|
79
|
+
{
|
80
|
+
VALUE app_klass = rb_eval_string("Wx::App");
|
81
|
+
if (rb_obj_is_kind_of($input, app_klass))
|
82
|
+
{
|
83
|
+
res = SWIG_ConvertPtr($input, &argp, wxRuby_GetSwigTypeForClass(app_klass), 0);
|
84
|
+
if (SWIG_IsOK(res)) $1 = reinterpret_cast< wxApp * >(argp);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
if (!SWIG_IsOK(res))
|
88
|
+
{
|
89
|
+
SWIG_exception_fail(SWIG_ArgError(res), Ruby_Format_TypeError( "", "wxEventFilter *","wxEvtHandler::$symname", 1, $input));
|
90
|
+
}
|
91
|
+
__CODE
|
92
|
+
end
|
67
93
|
spec.add_runtime_code <<~__HEREDOC
|
68
94
|
static swig_class wxRuby_GetSwigClassWxEvtHandler();
|
69
95
|
WXRUBY_EXPORT VALUE wxRuby_GetEventTypeClassMap();
|
@@ -324,8 +350,9 @@ module WXRuby3
|
|
324
350
|
}
|
325
351
|
|
326
352
|
WXRUBY_EXPORT VALUE wxRuby_GetEventTypeClassMap() {
|
327
|
-
|
328
|
-
|
353
|
+
return rb_funcall(wxRuby_GetSwigClassWxEvtHandler().klass,
|
354
|
+
rb_intern("send"),
|
355
|
+
1, ID2SYM(rb_intern("get_event_type_class_map")), 0);
|
329
356
|
}
|
330
357
|
__HEREDOC
|
331
358
|
spec.do_not_generate :typedefs, :variables, :enums, :defines, :functions
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
super
|
16
|
-
spec.
|
16
|
+
spec.make_concrete 'wxFilePickerCtrl'
|
17
17
|
spec.do_not_generate(:variables, :defines, :enums, :functions) # with FileDirPickerEvent
|
18
18
|
end
|
19
19
|
end # class FilePickerCtrl
|
@@ -12,7 +12,8 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.items << 'wxFontInfo'
|
15
|
-
spec.
|
15
|
+
spec.gc_as_untracked 'wxFontInfo'
|
16
|
+
spec.gc_as_untracked 'wxFont'
|
16
17
|
# all but the default ctor require a running App
|
17
18
|
spec.require_app 'wxFont::wxFont(const wxFont &)',
|
18
19
|
'wxFont::wxFont(const wxFontInfo &)',
|
@@ -23,9 +24,7 @@ module WXRuby3
|
|
23
24
|
'wxFont::GetDefaultEncoding',
|
24
25
|
'wxFont::SetDefaultEncoding'
|
25
26
|
spec.rename_for_ruby 'create' => 'wxFont::New'
|
26
|
-
spec.ignore
|
27
|
-
wxFont::SetNativeFontInfo wxFont::GetNativeFontInfo wxFont::operator!=
|
28
|
-
]
|
27
|
+
spec.ignore [ 'wxFont::SetNativeFontInfo(const wxNativeFontInfo &)', 'wxFont::GetNativeFontInfo', 'wxFont::operator!=' ]
|
29
28
|
spec.ignore 'wxFont::wxFont(const wxNativeFontInfo &)'
|
30
29
|
if Config.instance.wx_port == :wxQT
|
31
30
|
# not implemented
|
@@ -86,6 +85,17 @@ module WXRuby3
|
|
86
85
|
return SWIG_NewPointerObj(new wxFont(font), SWIGTYPE_p_wxFont, SWIG_POINTER_OWN);
|
87
86
|
}
|
88
87
|
__HEREDOC
|
88
|
+
# implement wxTheFontList methods as static methods of Wx::Font
|
89
|
+
spec.add_extend_code 'wxFont', <<~__HEREDOC
|
90
|
+
static wxFont * find_or_create_font(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &facename=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
|
91
|
+
{
|
92
|
+
return wxTheFontList->FindOrCreateFont(point_size, family, style, weight, underline, facename, encoding);
|
93
|
+
}
|
94
|
+
static wxFont * find_or_create_font(const wxFontInfo &fontInfo)
|
95
|
+
{
|
96
|
+
return wxTheFontList->FindOrCreateFont(fontInfo);
|
97
|
+
}
|
98
|
+
__HEREDOC
|
89
99
|
spec.do_not_generate :functions
|
90
100
|
end
|
91
101
|
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
super
|
16
|
-
spec.
|
16
|
+
spec.make_concrete 'wxFontPickerCtrl'
|
17
17
|
spec.do_not_generate(:variables, :defines, :enums, :functions) # with FontPickerEvent
|
18
18
|
end
|
19
19
|
end # class FontPickerCtrl
|
@@ -12,14 +12,16 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.disable_proxies
|
15
|
-
#
|
16
|
-
|
17
|
-
|
15
|
+
# do not track GraphicContext objects as that causes problems probably for similar
|
16
|
+
# reasons as for DC objects
|
17
|
+
spec.gc_as_untracked
|
18
|
+
# ignore all these; wxRuby only supports the ::draw_on methods
|
18
19
|
spec.ignore 'wxGraphicsContext::CreateFromNative',
|
19
20
|
'wxGraphicsContext::CreateFromNativeWindow',
|
20
21
|
'wxGraphicsContext::CreateFromNativeHDC',
|
22
|
+
'wxGraphicsContext::CreateFromUnknownDC',
|
21
23
|
'wxGraphicsContext::GetNativeContext',
|
22
|
-
'wxGraphicsContext::Create
|
24
|
+
'wxGraphicsContext::Create'
|
23
25
|
# type mappings
|
24
26
|
# Typemap to fix GraphicsContext#get_text_extent
|
25
27
|
spec.map_apply 'double *OUTPUT' => [ 'wxDouble* width', 'wxDouble* height',
|
@@ -135,8 +137,6 @@ module WXRuby3
|
|
135
137
|
}
|
136
138
|
__CODE
|
137
139
|
end
|
138
|
-
spec.new_object 'wxGraphicsContext::Create',
|
139
|
-
'wxGraphicsContext::CreateFromUnknownDC'
|
140
140
|
# add convenience method providing efficient gc memory management
|
141
141
|
spec.add_extend_code 'wxGraphicsContext', <<~__HEREDOC
|
142
142
|
static VALUE draw_on(wxWindow* win)
|
@@ -27,7 +27,7 @@ module WXRuby3
|
|
27
27
|
public:
|
28
28
|
// This is pure virtual in base Wx class, so won't compile unless an
|
29
29
|
// implementation is provided
|
30
|
-
wxString GetHelp(const wxWindowBase* window)
|
30
|
+
wxString GetHelp(const wxWindowBase* window) override
|
31
31
|
{
|
32
32
|
static WxRuby_ID get_help_id("get_help");
|
33
33
|
|
@@ -50,7 +50,7 @@ module WXRuby3
|
|
50
50
|
// RemoveHelp is called by Wx after the window deletion event has been
|
51
51
|
// handled. A standard director here re-wraps the already destroyed
|
52
52
|
// object, which will cause rapid segfaults when it is later marked.
|
53
|
-
void RemoveHelp(wxWindowBase* window)
|
53
|
+
void RemoveHelp(wxWindowBase* window) override
|
54
54
|
{
|
55
55
|
static WxRuby_ID remove_help_id("remove_help");
|
56
56
|
|
@@ -64,13 +64,8 @@ module WXRuby3
|
|
64
64
|
};
|
65
65
|
__HEREDOC
|
66
66
|
spec.add_swig_code <<~__HEREDOC
|
67
|
+
GC_MANAGE_AS_OBJECT(wxRubyHelpProvider);
|
67
68
|
typedef wxWindow wxWindowBase;
|
68
|
-
|
69
|
-
%ignore wxHelpProvider::GetHelp; // Must be supplied in Ruby
|
70
|
-
|
71
|
-
// Need to avoid standard director as it will call with destroyed
|
72
|
-
// objects
|
73
|
-
%feature("nodirector") wxHelpProvider::RemoveHelp;
|
74
69
|
__HEREDOC
|
75
70
|
spec.map 'wxWindowBase' => 'Wx::Window', swig: false do
|
76
71
|
map_in
|
@@ -88,8 +83,11 @@ module WXRuby3
|
|
88
83
|
static wxRubyHelpProvider* Get();
|
89
84
|
virtual void AddHelp(wxWindowBase* window, const wxString& text);
|
90
85
|
virtual void AddHelp(wxWindowID id, const wxString& text);
|
91
|
-
|
92
|
-
|
86
|
+
// we do not include the declaration of GetHelp here because
|
87
|
+
// we do not want a default implementation or director as we have
|
88
|
+
// a fixed director implementation above and the rest is pure Ruby
|
89
|
+
// virtual wxString GetHelp(const wxWindowBase* window);
|
90
|
+
void RemoveHelp(wxWindowBase* window); // no virtual as we have fixed director impl above
|
93
91
|
virtual bool ShowHelp(wxWindowBase* window);
|
94
92
|
virtual bool ShowHelpAtPoint(wxWindowBase* window, const wxPoint point,
|
95
93
|
wxHelpEvent::Origin origin);
|
@@ -20,7 +20,7 @@ module WXRuby3
|
|
20
20
|
spec.make_abstract 'wxHtmlCell'
|
21
21
|
spec.make_abstract 'wxHtmlLinkInfo'
|
22
22
|
spec.make_abstract 'wxHtmlContainerCell'
|
23
|
-
spec.
|
23
|
+
spec.gc_as_untracked 'wxHtmlLinkInfo' # no tracking
|
24
24
|
spec.ignore 'wxHtmlCell::Find'
|
25
25
|
# not useful for wxRuby as we do not support customizing these
|
26
26
|
spec.ignore 'wxHtmlCell::AdjustPagebreak',
|
@@ -20,13 +20,11 @@ module WXRuby3
|
|
20
20
|
# we only allow Ruby derivatives from wxDataObject but not of any of the C++ implemented
|
21
21
|
# specializations
|
22
22
|
spec.no_proxy 'wxHTMLDataObject'
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
%feature("notabstract") wxHTMLDataObject;
|
29
|
-
__HEREDOC
|
23
|
+
# SWIG gets confused and doesn't realise that various virtual methods
|
24
|
+
# from wxDataObject are implemented fully in this subclass, and so,
|
25
|
+
# believing it to be abstract doesn't provide an allocator for this
|
26
|
+
# class. This overrides this.
|
27
|
+
spec.make_concrete 'wxHTMLDataObject'
|
30
28
|
|
31
29
|
end
|
32
30
|
|
@@ -12,7 +12,7 @@ module WXRuby3
|
|
12
12
|
class HtmlListBox < Window
|
13
13
|
|
14
14
|
def setup
|
15
|
-
spec.items << 'wxSimpleHtmlListBox'
|
15
|
+
spec.items << 'wxSimpleHtmlListBox' << 'wxItemContainer'
|
16
16
|
super
|
17
17
|
spec.override_inheritance_chain('wxHtmlListBox', %w[wxVListBox wxVScrolledWindow wxPanel wxWindow wxEvtHandler wxObject])
|
18
18
|
spec.make_abstract 'wxHtmlListBox'
|
@@ -44,8 +44,72 @@ module WXRuby3
|
|
44
44
|
$self->GetFileSystem().ChangePathTo(location, is_dir);
|
45
45
|
}
|
46
46
|
__HEREDOC
|
47
|
+
# make sure protected methods are included
|
48
|
+
spec.regard 'wxHtmlListBox::OnGetItem',
|
49
|
+
'wxHtmlListBox::OnGetItemMarkup',
|
50
|
+
'wxHtmlListBox::GetSelectedTextColour',
|
51
|
+
'wxHtmlListBox::GetSelectedTextBgColour',
|
52
|
+
'wxHtmlListBox::OnLinkClicked'
|
53
|
+
# add missing protected overloads
|
54
|
+
spec.extend_interface 'wxHtmlListBox',
|
55
|
+
'virtual void OnDrawItem(wxDC &dc, const wxRect &rect, size_t n) const',
|
56
|
+
'virtual wxCoord OnMeasureItem(size_t n) const',
|
57
|
+
'virtual void OnDrawBackground(wxDC &dc, const wxRect &rect, size_t n) const',
|
58
|
+
'virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const',
|
59
|
+
visibility: 'protected'
|
60
|
+
|
47
61
|
# override inheritance chain
|
48
62
|
spec.override_inheritance_chain('wxSimpleHtmlListBox', %w[wxHtmlListBox wxVListBox wxVScrolledWindow wxPanel wxWindow wxEvtHandler wxObject])
|
63
|
+
spec.fold_bases('wxSimpleHtmlListBox' => %w[wxItemContainer])
|
64
|
+
# override SWIG's confusion
|
65
|
+
spec.make_concrete 'wxSimpleHtmlListBox'
|
66
|
+
# not useful overload
|
67
|
+
spec.ignore 'wxSimpleHtmlListBox::wxSimpleHtmlListBox(wxWindow *, wxWindowID, const wxPoint &, const wxSize &, int, const wxString[], long, const wxValidator &, const wxString &)'
|
68
|
+
# add missing overloads
|
69
|
+
spec.extend_interface 'wxSimpleHtmlListBox',
|
70
|
+
'virtual wxString GetString(unsigned int n) const',
|
71
|
+
'virtual void SetString(unsigned int n, const wxString &string)'
|
72
|
+
spec.ignore([ 'wxItemContainer::Append(const wxString &, wxClientData *)',
|
73
|
+
'wxItemContainer::Append(const std::vector< wxString > &)',
|
74
|
+
'wxItemContainer::Append(const wxArrayString &, wxClientData **)',
|
75
|
+
'wxItemContainer::Append(unsigned int, const wxString *)',
|
76
|
+
'wxItemContainer::Append(unsigned int, const wxString *, void **)',
|
77
|
+
'wxItemContainer::Append(unsigned int, const wxString *, wxClientData **)',
|
78
|
+
'wxItemContainer::Insert(const wxString &, unsigned int, wxClientData *)',
|
79
|
+
'wxItemContainer::Insert(const std::vector< wxString > &)',
|
80
|
+
'wxItemContainer::Insert(const wxArrayString &, unsigned int, wxClientData **)',
|
81
|
+
'wxItemContainer::Insert(unsigned int, const wxString *, unsigned int)',
|
82
|
+
'wxItemContainer::Insert(unsigned int, const wxString *, unsigned int, void **)',
|
83
|
+
'wxItemContainer::Insert(unsigned int, const wxString *, unsigned int, wxClientData **)',
|
84
|
+
'wxItemContainer::Set(const std::vector< wxString > &)',
|
85
|
+
'wxItemContainer::Set(const wxArrayString &, wxClientData **)',
|
86
|
+
'wxItemContainer::Set(unsigned int, const wxString *)',
|
87
|
+
'wxItemContainer::Set(unsigned int, const wxString *, void **)',
|
88
|
+
'wxItemContainer::Set(unsigned int, const wxString *, wxClientData **)',
|
89
|
+
'wxItemContainer::DetachClientObject',
|
90
|
+
'wxItemContainer::HasClientObjectData',
|
91
|
+
'wxItemContainer::GetClientObject',
|
92
|
+
'wxItemContainer::SetClientObject',
|
93
|
+
'wxItemContainer::HasClientUntypedData',
|
94
|
+
'wxItemContainer::Clear'])
|
95
|
+
spec.ignore([ 'wxItemContainer::Append(const wxArrayString &, void **)',
|
96
|
+
'wxItemContainer::Insert(const wxArrayString &, unsigned int, void **)',
|
97
|
+
'wxItemContainer::Set(const wxArrayString &, void **)'], ignore_doc: false)
|
98
|
+
# for doc only
|
99
|
+
spec.map 'void** clientData' => 'Array', swig: false do
|
100
|
+
map_in code: ''
|
101
|
+
end
|
102
|
+
spec.ignore(%w[wxItemContainer::GetClientData wxItemContainer::SetClientData], ignore_doc: false) # keep docs
|
103
|
+
# Replace the old Wx definition of this method (which segfaults)
|
104
|
+
# Only need the setter as we cache data in Ruby and the getter
|
105
|
+
# therefor can be pure Ruby
|
106
|
+
spec.add_extend_code('wxSimpleHtmlListBox', <<~__HEREDOC
|
107
|
+
VALUE set_client_data(int n, VALUE item_data) {
|
108
|
+
self->SetClientData(n, (void *)item_data);
|
109
|
+
return item_data;
|
110
|
+
}
|
111
|
+
__HEREDOC
|
112
|
+
)
|
49
113
|
end
|
50
114
|
end # class HtmlListBox
|
51
115
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
###
|
2
|
+
# wxRuby3 wxWidgets interface director
|
3
|
+
# Copyright (c) M.J.N. Corino, The Netherlands
|
4
|
+
###
|
5
|
+
|
6
|
+
require_relative './event'
|
7
|
+
|
8
|
+
module WXRuby3
|
9
|
+
|
10
|
+
class Director
|
11
|
+
|
12
|
+
class HyperlinkEvent < Event
|
13
|
+
|
14
|
+
def setup
|
15
|
+
super
|
16
|
+
spec.do_not_generate :variables, :enums, :defines, :functions # with HyperlinkCtrl
|
17
|
+
end
|
18
|
+
end # class HyperlinkEvent
|
19
|
+
|
20
|
+
end # class Director
|
21
|
+
|
22
|
+
end # module WXRuby3
|
@@ -13,6 +13,8 @@ module WXRuby3
|
|
13
13
|
|
14
14
|
def setup
|
15
15
|
spec.items << 'wxIconBundle'
|
16
|
+
spec.gc_as_untracked 'wxIcon'
|
17
|
+
spec.gc_as_untracked 'wxIconBundle'
|
16
18
|
spec.disable_proxies
|
17
19
|
spec.require_app 'wxIcon', 'wxIconBundle'
|
18
20
|
# disable as there is no way to distinguish char*/[] from wxString in Ruby
|
@@ -14,7 +14,8 @@ module WXRuby3
|
|
14
14
|
spec.disable_proxies
|
15
15
|
spec.items << 'wxLanguageInfo' << 'language.h'
|
16
16
|
spec.gc_as_object('wxLocale')
|
17
|
-
spec.
|
17
|
+
spec.gc_as_untracked('wxLanguageInfo')
|
18
|
+
spec.make_concrete 'wxLanguageInfo'
|
18
19
|
spec.regard %w[
|
19
20
|
wxLanguageInfo::Language
|
20
21
|
wxLanguageInfo::LocaleTag
|
@@ -30,9 +30,6 @@ module WXRuby3
|
|
30
30
|
__HEREDOC
|
31
31
|
# make Ruby director and wrappers use custom implementation
|
32
32
|
spec.use_class_implementation('wxMenu', 'wxRubyMenu')
|
33
|
-
spec.rename_for_ruby(
|
34
|
-
'AppendItem' =>
|
35
|
-
'wxMenu::Append(wxMenuItem *item)')
|
36
33
|
# ignore non-const version as that has no benefits in Ruby
|
37
34
|
spec.ignore 'wxMenu::GetMenuItems()'
|
38
35
|
# Fix for GetMenuItems - converts list of MenuItems to Array
|
@@ -19,6 +19,9 @@ module WXRuby3
|
|
19
19
|
'wxMenuBar::GetLabelTop',
|
20
20
|
'wxMenuBar::SetLabelTop',
|
21
21
|
'wxMenuBar::Refresh')
|
22
|
+
unless Config.instance.wx_version >= '3.3' || Config.instance.wx_abi_version > '3.0.0'
|
23
|
+
spec.ignore 'wxMenuBar::OSXGetAppleMenu'
|
24
|
+
end
|
22
25
|
super
|
23
26
|
end
|
24
27
|
end # class MenuBar
|
@@ -12,6 +12,7 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.disable_proxies
|
15
|
+
spec.gc_as_untracked 'wxPalette'
|
15
16
|
if Config.instance.wx_port == :wxQT
|
16
17
|
# mismatched implementation which does nothing anyway
|
17
18
|
spec.ignore 'wxPalette::wxPalette(int, const unsigned char *, const unsigned char *, const unsigned char *)'
|
data/rakelib/lib/director/pen.rb
CHANGED
@@ -12,7 +12,8 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.items << 'wxPenInfo'
|
15
|
-
spec.
|
15
|
+
spec.gc_as_untracked 'wxPenInfo'
|
16
|
+
spec.gc_as_untracked 'wxPen'
|
16
17
|
spec.disable_proxies
|
17
18
|
spec.add_header_code <<~__HEREDOC
|
18
19
|
// special free funcs are needed to clean up Dashes array if it has been
|
@@ -165,7 +166,16 @@ module WXRuby3
|
|
165
166
|
# these are defined and loaded in RubyStockObjects.i
|
166
167
|
spec.ignore %w[
|
167
168
|
wxRED_PEN wxBLUE_PEN wxCYAN_PEN wxGREEN_PEN wxYELLOW_PEN wxBLACK_PEN wxWHITE_PEN
|
168
|
-
wxTRANSPARENT_PEN wxBLACK_DASHED_PEN wxGREY_PEN wxMEDIUM_GREY_PEN wxLIGHT_GREY_PEN
|
169
|
+
wxTRANSPARENT_PEN wxBLACK_DASHED_PEN wxGREY_PEN wxMEDIUM_GREY_PEN wxLIGHT_GREY_PEN]
|
170
|
+
# do not expose this
|
171
|
+
spec.ignore 'wxThePenList'
|
172
|
+
# provide it's functionality as a class method of Pen instead
|
173
|
+
spec.add_extend_code 'wxPen', <<~__HEREDOC
|
174
|
+
static wxPen* find_or_create_pen(const wxColour &colour, int width=1, wxPenStyle style=wxPENSTYLE_SOLID)
|
175
|
+
{
|
176
|
+
return wxThePenList->FindOrCreatePen(colour, width, style);
|
177
|
+
}
|
178
|
+
__HEREDOC
|
169
179
|
end
|
170
180
|
end # class Pen
|
171
181
|
|
@@ -26,7 +26,7 @@ module WXRuby3
|
|
26
26
|
'wxEnumProperty::wxEnumProperty(const wxString &, const wxString &, const wxChar *const *, const long *, wxPGChoices *, int)'
|
27
27
|
spec.ignore 'wxEditEnumProperty::wxEditEnumProperty(const wxString &, const wxString &, const wxChar *const *, const long *, const wxString&)',
|
28
28
|
'wxEditEnumProperty::wxEditEnumProperty(const wxString &, const wxString &, const wxChar *const *, const long *, wxPGChoices *, const wxString&)'
|
29
|
-
spec.
|
29
|
+
spec.gc_as_untracked 'wxColourPropertyValue'
|
30
30
|
spec.regard 'wxColourPropertyValue::m_type',
|
31
31
|
'wxColourPropertyValue::m_colour'
|
32
32
|
spec.regard 'wxSystemColourProperty::Init',
|
@@ -29,7 +29,7 @@ module WXRuby3
|
|
29
29
|
'drawn_height' => 'wxPGPaintData::m_drawnHeight'
|
30
30
|
# wxPGChoices are always returned by value and never transfer ownership
|
31
31
|
# so we do not need tracking or special free function
|
32
|
-
spec.
|
32
|
+
spec.gc_as_untracked 'wxPGChoices'
|
33
33
|
# prevent exposure of wxPGChoicesData; not of any real use in wxRuby
|
34
34
|
spec.ignore 'wxPGChoices::wxPGChoices(wxPGChoicesData*)',
|
35
35
|
'wxPGChoices::AssignData',
|
@@ -12,7 +12,7 @@ module WXRuby3
|
|
12
12
|
def setup
|
13
13
|
super
|
14
14
|
spec.items << 'propgrid/propgrid.h'
|
15
|
-
spec.
|
15
|
+
spec.gc_as_untracked 'wxPGValidationInfo'
|
16
16
|
if Config.instance.wx_version < '3.3.0'
|
17
17
|
spec.ignore 'wxPGVFBFlags' # not a constant but a rather a clumsy typedef
|
18
18
|
end
|
@@ -14,6 +14,24 @@ module WXRuby3
|
|
14
14
|
def setup
|
15
15
|
spec.items << 'wxPopupTransientWindow'
|
16
16
|
super
|
17
|
+
spec.items.each do |itm|
|
18
|
+
spec.no_proxy("#{itm}::ClearBackground",
|
19
|
+
"#{itm}::Enable",
|
20
|
+
"#{itm}::GetHelpTextAtPoint",
|
21
|
+
"#{itm}::GetMaxSize",
|
22
|
+
"#{itm}::GetMinSize",
|
23
|
+
"#{itm}::Refresh",
|
24
|
+
"#{itm}::Update")
|
25
|
+
end
|
26
|
+
# add these to the generated interface to be parsed by SWIG
|
27
|
+
# the wxWidgets docs are flawed in this respect that several reimplemented
|
28
|
+
# virtual methods are not documented at the reimplementing class as such
|
29
|
+
# that would cause them missing from the interface which would cause a problem
|
30
|
+
# for a SWIG director redirecting to the Ruby class as the SWIG wrappers
|
31
|
+
# redirect explicitly to the implementation at the same class level as the wrapper
|
32
|
+
# for upcalls
|
33
|
+
spec.extend_interface('wxPopupWindow',
|
34
|
+
'virtual bool Show(bool show = true) override')
|
17
35
|
end
|
18
36
|
|
19
37
|
end # class PopupWindow
|
@@ -11,7 +11,7 @@ module WXRuby3
|
|
11
11
|
|
12
12
|
def setup
|
13
13
|
super
|
14
|
-
spec.
|
14
|
+
spec.gc_as_untracked
|
15
15
|
spec.disable_proxies # fixed and final data structures
|
16
16
|
spec.items << 'wxPrintDialogData' << 'wxPageSetupDialogData'
|
17
17
|
spec.ignore 'wxPrintDialogData::SetSetupDialog' # deprecated since 2.5.4
|
@@ -19,7 +19,7 @@ module WXRuby3
|
|
19
19
|
|
20
20
|
def setup
|
21
21
|
super
|
22
|
-
spec.
|
22
|
+
spec.gc_as_untracked 'wxPropertyGridInterface' # actually no GC control necessary as this is a mixin only
|
23
23
|
# turn wxPropertyGridInterface into a mixin module
|
24
24
|
spec.make_mixin 'wxPropertyGridInterface'
|
25
25
|
# add typedef to work around flaky define in wxWidgets
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
super
|
14
14
|
spec.items << 'wxPropertyGridHitTestResult'
|
15
15
|
spec.gc_never 'wxPropertyGridPageState'
|
16
|
-
spec.
|
16
|
+
spec.gc_as_untracked 'wxPropertyGridHitTestResult'
|
17
17
|
spec.make_abstract 'wxPropertyGridPageState'
|
18
18
|
spec.disable_proxies
|
19
19
|
spec.ignore 'wxPropertyGridPageState::DoDelete',
|
@@ -14,22 +14,33 @@ module WXRuby3
|
|
14
14
|
spec.items << 'wxItemContainerImmutable'
|
15
15
|
spec.fold_bases('wxRadioBox' => 'wxItemContainerImmutable')
|
16
16
|
spec.override_inheritance_chain('wxRadioBox', %w[wxControl wxWindow wxEvtHandler wxObject])
|
17
|
-
# ignore
|
18
|
-
spec.ignore('wxRadioBox::Enable')
|
17
|
+
# ignore overloads hiding common Window method
|
18
|
+
spec.ignore('wxRadioBox::Enable', 'wxRadioBox::Show')
|
19
19
|
spec.add_extend_code 'wxRadioBox', <<~__HEREDOC
|
20
|
-
// add custom method to reach common Window method
|
20
|
+
// add custom method to reach common Window method overload
|
21
21
|
bool EnableWindow(bool enable=true)
|
22
22
|
{
|
23
|
-
return $self->
|
23
|
+
return $self->Enable(enable);
|
24
24
|
}
|
25
25
|
// add right method to enable/disable items
|
26
26
|
bool EnableItem(unsigned int n, bool enable=true)
|
27
27
|
{
|
28
28
|
return $self->Enable(n, enable);
|
29
29
|
}
|
30
|
+
// add custom method to reach common Window method overload
|
31
|
+
bool ShowWindow(bool show=true)
|
32
|
+
{
|
33
|
+
return $self->Show(show);
|
34
|
+
}
|
35
|
+
// add right method to show/hide items
|
36
|
+
bool ShowItem(unsigned int n, bool show=true)
|
37
|
+
{
|
38
|
+
return $self->Show(n, show);
|
39
|
+
}
|
30
40
|
__HEREDOC
|
31
41
|
# rename common method
|
32
42
|
spec.rename_for_ruby('Enable' => 'wxRadioBox::EnableWindow')
|
43
|
+
spec.rename_for_ruby('Show' => 'wxRadioBox::ShowWindow')
|
33
44
|
super
|
34
45
|
end
|
35
46
|
end # class Window
|
@@ -13,7 +13,7 @@ module WXRuby3
|
|
13
13
|
spec.items << 'wxRibbonPageTabInfo' << 'wxRibbonMSWArtProvider' << 'wxRibbonAUIArtProvider'
|
14
14
|
super
|
15
15
|
spec.gc_as_object 'wxRibbonArtProvider'
|
16
|
-
spec.
|
16
|
+
spec.gc_as_untracked 'wxRibbonPageTabInfo'
|
17
17
|
spec.suppress_warning(473,
|
18
18
|
'wxRibbonArtProvider::Clone',
|
19
19
|
'wxRibbonMSWArtProvider::Clone',
|