libui 0.2.1-aarch64-linux → 0.3.0.pre-aarch64-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 +2 -7
- data/lib/libui/ffi.rb +9 -1
- data/lib/libui/fiddle_patch.rb +10 -10
- data/lib/libui/version.rb +1 -1
- data/lib/libui.rb +4 -0
- data/vendor/libui.aarch64.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: c574d66c9aed94a75cc4f6be9736d5dd7690a6cf2f782c0a4ef5f0da7e3665e7
|
|
4
|
+
data.tar.gz: fe67f24b496f5b5db00202e54a1414496a6f2997d9bbad250b686cb15a000b0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4440a926c29fc84608e413e9a4bc1ce12cd399c948f0b514af7f201e2b94586c83b4155a088dd4cba4307522a1969b28c98eec5a68700a630c1f70bf0a274cf0
|
|
7
|
+
data.tar.gz: 6781e13639949e951110884515fb88f0f3124e8a1744b8e737c38c9bf2d6bf5fde2daec0ceaf87456ef8014669882bb8f729d5185fca8a274aa1c89db6a90a45
|
data/README.md
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
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)
|
|
8
8
|
|
|
9
9
|
LibUI is a Ruby wrapper for libui family.
|
|
10
10
|
|
|
11
|
-
:rocket: [libui-ng](https://github.com/
|
|
12
|
-
|
|
13
|
-
:wrench: [libui-dev](https://github.com/petabyt/libui-dev) - Native UI library for C - with some extras
|
|
14
|
-
|
|
15
|
-
:radio_button: [libui](https://github.com/andlabs/libui) - Original version by andlabs.
|
|
11
|
+
:rocket: [libui-ng](https://github.com/kojix2/libui-ng) - A cross-platform portable GUI library
|
|
16
12
|
|
|
17
13
|
## Installation
|
|
18
14
|
|
|
@@ -86,7 +82,6 @@ LibUI is not object-oriented because it is a thin Ruby wrapper (binding) for the
|
|
|
86
82
|
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
83
|
|
|
88
84
|
- [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
|
89
|
-
- [libui_paradise](https://rubygems.org/gems/libui_paradise)
|
|
90
85
|
|
|
91
86
|
### Working with fiddle pointers
|
|
92
87
|
|
data/lib/libui/ffi.rb
CHANGED
|
@@ -3,7 +3,6 @@ require_relative 'fiddle_patch'
|
|
|
3
3
|
require_relative 'error'
|
|
4
4
|
|
|
5
5
|
module LibUI
|
|
6
|
-
|
|
7
6
|
module FFI
|
|
8
7
|
extend Fiddle::Importer
|
|
9
8
|
extend FiddlePatch
|
|
@@ -419,6 +418,7 @@ module LibUI
|
|
|
419
418
|
try_extern 'void uiDrawClip(uiDrawContext *c, uiDrawPath *path)'
|
|
420
419
|
try_extern 'void uiDrawSave(uiDrawContext *c)'
|
|
421
420
|
try_extern 'void uiDrawRestore(uiDrawContext *c)'
|
|
421
|
+
try_extern 'void uiDrawImage(uiDrawContext *c, uiImage *img, double x, double y, double width, double height)'
|
|
422
422
|
|
|
423
423
|
# uiAttribute
|
|
424
424
|
try_extern 'void uiFreeAttribute(uiAttribute *a)'
|
|
@@ -582,6 +582,14 @@ module LibUI
|
|
|
582
582
|
try_extern 'void uiFreeImage(uiImage *i)'
|
|
583
583
|
try_extern 'void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride)'
|
|
584
584
|
|
|
585
|
+
# uiImageView
|
|
586
|
+
try_extern 'uiImageView *uiNewImageView(void)'
|
|
587
|
+
try_extern 'void uiImageViewSetImage(uiImageView *iv, const uiImage *image)'
|
|
588
|
+
|
|
589
|
+
typealias 'uiImageViewContentMode', 'int'
|
|
590
|
+
|
|
591
|
+
try_extern 'void uiImageViewSetContentMode(uiImageView *iv, uiImageViewContentMode mode)'
|
|
592
|
+
|
|
585
593
|
# uiTable
|
|
586
594
|
try_extern 'void uiFreeTableValue(uiTableValue *v)'
|
|
587
595
|
|
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/lib/libui.rb
CHANGED
data/vendor/libui.aarch64.so
CHANGED
|
Binary file
|