wxruby3 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/wxruby3/include/wxruby-Config.h +23 -5
- data/ext/wxruby3/include/wxruby-Persistence.h +79 -0
- data/ext/wxruby3/swig/memory_management.i +6 -0
- data/lib/wx/core/book_ctrl_base.rb +16 -0
- data/lib/wx/core/config.rb +454 -83
- data/lib/wx/core/notebook.rb +10 -8
- data/lib/wx/core/peristent_object.rb +15 -0
- data/lib/wx/core/persistence_manager.rb +39 -0
- data/lib/wx/core/persistent_window.rb +16 -0
- data/lib/wx/core/top_level_window.rb +16 -0
- data/lib/wx/core/treebook.rb +18 -0
- data/lib/wx/core.rb +4 -0
- data/lib/wx/doc/book_ctrl_base.rb +19 -0
- data/lib/wx/doc/config.rb +101 -41
- data/lib/wx/doc/extra/14_config.md +101 -0
- data/lib/wx/doc/extra/15_persistence.md +148 -0
- data/lib/wx/doc/persistence_manager.rb +36 -0
- data/lib/wx/doc/persistent_object.rb +27 -0
- data/lib/wx/doc/top_level_window.rb +19 -0
- data/lib/wx/doc/treebook.rb +6 -1
- data/lib/wx/version.rb +1 -1
- data/rakelib/build.rb +1 -1
- data/rakelib/lib/core/package.rb +22 -1
- data/rakelib/lib/core/spec.rb +10 -0
- data/rakelib/lib/core/spec_helper.rb +1 -1
- data/rakelib/lib/director/config_base.rb +490 -19
- data/rakelib/lib/director/event_filter.rb +1 -1
- data/rakelib/lib/director/event_loop.rb +1 -1
- data/rakelib/lib/director/file_dialog_customize_hook.rb +2 -2
- data/rakelib/lib/director/grid_cell_attr.rb +1 -1
- data/rakelib/lib/director/grid_cell_editor.rb +1 -1
- data/rakelib/lib/director/grid_cell_renderer.rb +1 -1
- data/rakelib/lib/director/header_ctrl.rb +3 -0
- data/rakelib/lib/director/html_listbox.rb +2 -1
- data/rakelib/lib/director/persistence_manager.rb +410 -0
- data/rakelib/lib/director/persistent_object.rb +70 -0
- data/rakelib/lib/director/persistent_window.rb +73 -0
- data/rakelib/lib/director/static_bitmap.rb +4 -0
- data/rakelib/lib/director/text_entry.rb +1 -1
- data/rakelib/lib/generate/analyzer.rb +43 -43
- data/rakelib/lib/generate/doc.rb +1 -1
- data/rakelib/lib/specs/interfaces.rb +3 -0
- data/rakelib/lib/typemap/config.rb +8 -0
- data/samples/widgets/widgets.rb +5 -9
- data/tests/test_config.rb +207 -42
- data/tests/test_persistence.rb +142 -0
- metadata +19 -2
@@ -0,0 +1,27 @@
|
|
1
|
+
# :stopdoc:
|
2
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
3
|
+
#
|
4
|
+
# This software is released under the MIT license.
|
5
|
+
# :startdoc:
|
6
|
+
|
7
|
+
|
8
|
+
module Wx
|
9
|
+
|
10
|
+
class PersistentObject < ::Object
|
11
|
+
|
12
|
+
# Save the specified value using the given name.
|
13
|
+
# @param [String] name The name of the value in the configuration file.
|
14
|
+
# @param [Object] value The value to save, currently must be a type supported by wxConfig.
|
15
|
+
# @return [Boolean] true if the value was saved or false if an error occurred.
|
16
|
+
def save_value(name, value); end
|
17
|
+
protected :save_value
|
18
|
+
|
19
|
+
# Restore a value saved by {#save_value}.
|
20
|
+
# @param [String] name The name of the value in the configuration file.
|
21
|
+
# @return [Object,nil] The value if successfully read, nil otherwise
|
22
|
+
def restore_value(name); end
|
23
|
+
protected :restore_value
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# :stopdoc:
|
2
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
3
|
+
#
|
4
|
+
# This software is released under the MIT license.
|
5
|
+
# :startdoc:
|
6
|
+
|
7
|
+
|
8
|
+
module Wx
|
9
|
+
|
10
|
+
class TopLevelWindow < NonOwnedWindow
|
11
|
+
|
12
|
+
# Creates PersistentObject for this toplevel window instance (incl. Dialog and Frame).
|
13
|
+
# @see Wx.create_persistent_object
|
14
|
+
# @return [Wx::PersistentTLW]
|
15
|
+
def create_persistent_object; end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/lib/wx/doc/treebook.rb
CHANGED
@@ -7,13 +7,18 @@
|
|
7
7
|
|
8
8
|
module Wx
|
9
9
|
|
10
|
-
class Treebook
|
10
|
+
class Treebook < BookCtrlBase
|
11
11
|
|
12
12
|
# Returns the Wx::TreeCtrl used for this Treebook
|
13
13
|
# @return [Wx::TreeCtrl] the tree control
|
14
14
|
def get_tree_ctrl; end
|
15
15
|
alias :tree_ctrl :get_tree_ctrl
|
16
16
|
|
17
|
+
# Creates PersistentObject for this treebook control instance.
|
18
|
+
# @see Wx.create_persistent_object
|
19
|
+
# @return [Wx::PersistentTreeBookCtrl]
|
20
|
+
def create_persistent_object; end
|
21
|
+
|
17
22
|
end
|
18
23
|
|
19
24
|
end
|
data/lib/wx/version.rb
CHANGED
data/rakelib/build.rb
CHANGED
@@ -48,7 +48,7 @@ if WXRuby3.is_bootstrapped?
|
|
48
48
|
end
|
49
49
|
|
50
50
|
# The main source module - which needs to initialize all the other modules in the package
|
51
|
-
file pkg.initializer_src => pkg.all_swig_files do |t|
|
51
|
+
file pkg.initializer_src => (pkg.all_swig_files + (pkg.parent ? [pkg.parent.initializer_src] : [])) do |t|
|
52
52
|
pkg.generate_initializer
|
53
53
|
end
|
54
54
|
|
data/rakelib/lib/core/package.rb
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
# wxRuby3 extension library Package class
|
7
7
|
###
|
8
8
|
|
9
|
+
require 'monitor'
|
10
|
+
|
9
11
|
module WXRuby3
|
10
12
|
|
11
13
|
class Director
|
@@ -434,9 +436,29 @@ module WXRuby3
|
|
434
436
|
def generated_events
|
435
437
|
@generated_events ||= ::Set.new
|
436
438
|
end
|
439
|
+
|
440
|
+
def event_list_packages
|
441
|
+
unless @event_list_packages
|
442
|
+
@event_list_packages = ::Set.new
|
443
|
+
@event_list_packages.extend(MonitorMixin)
|
444
|
+
end
|
445
|
+
@event_list_packages
|
446
|
+
end
|
437
447
|
end
|
438
448
|
|
439
449
|
def generate_event_list
|
450
|
+
# make sure parent package has already generated event list
|
451
|
+
Package.event_list_packages.synchronize do
|
452
|
+
if parent && !Package.event_list_packages.include?(parent)
|
453
|
+
# make sure all included director modules have been extracted
|
454
|
+
parent.included_directors.each do |dir|
|
455
|
+
dir.extract_interface(false) # no need to generate anything here
|
456
|
+
end
|
457
|
+
parent.generate_event_list
|
458
|
+
end
|
459
|
+
end
|
460
|
+
# list ourselves as generated
|
461
|
+
Package.event_list_packages << self
|
440
462
|
# determine Ruby library events root for package
|
441
463
|
rbevt_root = File.join(ruby_classes_path, 'events')
|
442
464
|
# create event list file
|
@@ -483,7 +505,6 @@ module WXRuby3
|
|
483
505
|
fout.puts 'end'
|
484
506
|
end
|
485
507
|
end
|
486
|
-
private :generate_event_list
|
487
508
|
|
488
509
|
def find_event_doc(evh_name)
|
489
510
|
unless doc = event_docs[evh_name]
|
data/rakelib/lib/core/spec.rb
CHANGED
@@ -272,6 +272,16 @@ module WXRuby3
|
|
272
272
|
self
|
273
273
|
end
|
274
274
|
|
275
|
+
def gc_as_marked(*names)
|
276
|
+
if names.empty?
|
277
|
+
@gc_type = :GC_MANAGE_AS_MARKED
|
278
|
+
else
|
279
|
+
@gc_type = ::Hash.new unless @gc_type.is_a?(::Hash)
|
280
|
+
names.flatten.each {|n| @gc_type[n] = :GC_MANAGE_AS_MARKED }
|
281
|
+
end
|
282
|
+
self
|
283
|
+
end
|
284
|
+
|
275
285
|
def gc_type(name)
|
276
286
|
@gc_type.is_a?(::Hash) ? @gc_type[name] : @gc_type
|
277
287
|
end
|
@@ -121,7 +121,7 @@ module WXRuby3
|
|
121
121
|
|
122
122
|
def get_base_module_list(hierarchy, foldedbases, list = ::Set.new)
|
123
123
|
hierarchy.each_value do |super_def|
|
124
|
-
list << super_def.module unless foldedbases.include?(super_def.name)
|
124
|
+
list << super_def.module unless foldedbases.include?(super_def.name) || super_def.module == module_name
|
125
125
|
get_base_module_list(super_def.supers, folded_bases(super_def.name), list)
|
126
126
|
end
|
127
127
|
list
|