libui 0.2.1-x86_64-linux → 0.2.2-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/libui/ffi.rb +0 -1
- data/lib/libui/fiddle_patch.rb +10 -10
- data/lib/libui/version.rb +1 -1
- data/vendor/libui.x86_64.so +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19f94055bcaf8d77d1a3400b92cc9c2ea871e2683d1f67bca77e5df92369f7d4
|
|
4
|
+
data.tar.gz: d9868e00988881499b935aea1d5bb2b06534395c1742d2751a7878a75214221b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d4601a5b785c8caf0feac08b427b23e5570e0f4f14a426b6fba82e2c919e03afb77ec22c09468e25dbf7bf0049b111bf2ec556674cbe85392f783d7cd46707a
|
|
7
|
+
data.tar.gz: 4b95ac42fd8ec00d13ad5a0943d3b563c52feb7eb46296ce7a1d67eb3d383b04e8d11c6e3cbb19f4e84568c0126cd637275df3013cc7273af96efac8755ea6df
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# LibUI
|
|
2
2
|
|
|
3
3
|
[](https://github.com/kojix2/LibUI/actions/workflows/test.yml)
|
|
4
|
-
[](https://rubygems.org/gems/libui/versions)
|
|
5
5
|
<a href="https://github.com/AndyObtiva/glimmer-dsl-libui"><img alt="glimmer-dsl-libui" src="https://github.com/AndyObtiva/glimmer/blob/master/images/glimmer-logo-hi-res.svg" width="50" height="50" align="right"></a>
|
|
6
6
|
[](https://github.com/kojix2/libui-ng/actions/workflows/pre-build.yml)
|
|
7
7
|
[](https://tokei.kojix2.net/github/kojix2/LibUI)
|
|
@@ -86,7 +86,6 @@ LibUI is not object-oriented because it is a thin Ruby wrapper (binding) for the
|
|
|
86
86
|
To build actual applications, it is recommended to use a DSL for LibUI, as they enable writing object-oriented code the Ruby way (instead of procedural code the C way):
|
|
87
87
|
|
|
88
88
|
- [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
|
89
|
-
- [libui_paradise](https://rubygems.org/gems/libui_paradise)
|
|
90
89
|
|
|
91
90
|
### Working with fiddle pointers
|
|
92
91
|
|
data/lib/libui/ffi.rb
CHANGED
data/lib/libui/fiddle_patch.rb
CHANGED
|
@@ -11,9 +11,9 @@ module LibUI
|
|
|
11
11
|
def parse_signature(signature, tymap = nil)
|
|
12
12
|
tymap ||= {}
|
|
13
13
|
ctype, func, args = case compact(signature)
|
|
14
|
-
when /^(?:[\w
|
|
14
|
+
when /^(?:[\w*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
|
|
15
15
|
[TYPE_VOIDP, Regexp.last_match(1), Regexp.last_match(2)]
|
|
16
|
-
when /^([\w
|
|
16
|
+
when /^([\w*\s]+[*\s])(\w+)\((.*?)\);?$/
|
|
17
17
|
[parse_ctype(Regexp.last_match(1).strip, tymap), Regexp.last_match(2), Regexp.last_match(3)]
|
|
18
18
|
else
|
|
19
19
|
raise("can't parse the function prototype: #{signature}")
|
|
@@ -22,12 +22,12 @@ module LibUI
|
|
|
22
22
|
callback_argument_types = {} # Added
|
|
23
23
|
argtype = split_arguments(args).collect.with_index do |arg, idx| # Added with_index
|
|
24
24
|
# Check if it is a function pointer or not
|
|
25
|
-
if arg =~ /\(\*.*\)\(.*\)/
|
|
25
|
+
if arg =~ /\(\*.*\)\(.*\)/ # Added
|
|
26
26
|
# From the arguments, create a notation that looks like a function declaration
|
|
27
27
|
# int(*f)(int *, void *) -> int f(int *, void *)
|
|
28
|
-
func_arg = arg.sub('(*', ' ').sub(')', '')
|
|
28
|
+
func_arg = arg.sub('(*', ' ').sub(')', '') # Added
|
|
29
29
|
# Use Fiddle's parse_signature method again.
|
|
30
|
-
callback_argument_types[idx] = parse_signature(func_arg)
|
|
30
|
+
callback_argument_types[idx] = parse_signature(func_arg) # Added
|
|
31
31
|
end
|
|
32
32
|
parse_ctype(arg, tymap)
|
|
33
33
|
end
|
|
@@ -41,8 +41,8 @@ module LibUI
|
|
|
41
41
|
func = import_function(symname, ctype, argtype, opt[:call_type])
|
|
42
42
|
|
|
43
43
|
# callback_argument_types
|
|
44
|
-
func.instance_variable_set(:@callback_argument_types,
|
|
45
|
-
|
|
44
|
+
func.instance_variable_set(:@callback_argument_types,
|
|
45
|
+
callback_argument_types) # Added
|
|
46
46
|
# attr_reader
|
|
47
47
|
def func.callback_argument_types
|
|
48
48
|
@callback_argument_types
|
|
@@ -68,9 +68,9 @@ module LibUI
|
|
|
68
68
|
@func_map[name] = func
|
|
69
69
|
# define_method(name){|*args,&block| f.call(*args,&block)}
|
|
70
70
|
begin
|
|
71
|
-
|
|
72
|
-
file =
|
|
73
|
-
line =
|
|
71
|
+
location = caller_locations(1, 1).first
|
|
72
|
+
file = location.path
|
|
73
|
+
line = location.lineno
|
|
74
74
|
rescue StandardError
|
|
75
75
|
file, line = __FILE__, __LINE__ + 3
|
|
76
76
|
end
|
data/lib/libui/version.rb
CHANGED
data/vendor/libui.x86_64.so
CHANGED
|
Binary file
|