libui 0.2.0.pre-x86_64-linux → 0.2.0-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 +11 -25
- data/lib/libui/ffi.rb +1 -1
- data/lib/libui/fiddle_patch.rb +1 -1
- data/lib/libui/libui_base.rb +6 -4
- data/lib/libui/version.rb +1 -1
- data/lib/libui.rb +10 -4
- data/vendor/libui.x86_64.so +0 -0
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a4a93bc8fdec0c9c4e2587bb2aa99c0ac11d54e34ae9956e64a9a841a39cac5
|
4
|
+
data.tar.gz: 9b4caca40127dea74380e48afa011f0162e2169cdba6a4037d52ad1e38247924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b39de93bfeeb054f86237741ea0b072aead99d1835156fb3f4e18e73f17bbb6e2c8a2592cce0adc31f00c4c1c28d85d31c7d1564a36f074c7bd64664ce39298
|
7
|
+
data.tar.gz: 333a266fcec1f2108cf7443cbcc56b9f0f86d2620886bdbed5e4bd874e6b18c22a4f493c375da1f9afc38c0595baf1ee32bcc3638f6b1d6780d5e71f868ee15f
|
data/README.md
CHANGED
@@ -62,9 +62,8 @@ end
|
|
62
62
|
|
63
63
|
UI.window_on_closing(main_window) do
|
64
64
|
puts 'Bye Bye'
|
65
|
-
UI.control_destroy(main_window)
|
66
65
|
UI.quit
|
67
|
-
|
66
|
+
1
|
68
67
|
end
|
69
68
|
|
70
69
|
UI.window_set_child(main_window, button)
|
@@ -178,40 +177,27 @@ Add additional options below if necessary:
|
|
178
177
|
git clone https://github.com/kojix2/libui
|
179
178
|
cd libui
|
180
179
|
bundle install
|
181
|
-
bundle exec rake vendor:auto
|
180
|
+
bundle exec rake vendor:auto
|
182
181
|
bundle exec rake test
|
183
182
|
```
|
184
183
|
|
185
184
|
### Pre-built shared libraries for libui-ng
|
186
185
|
|
187
|
-
|
186
|
+
Download pre-built libui-ng shared libraries (per your current platform):
|
188
187
|
|
189
|
-
|
190
|
-
|
191
|
-
```
|
192
|
-
rake vendor:build[hash] # Build libui-ng latest master [commit hash]
|
193
|
-
rake vendor:libui-ng:macos # Download latest official pre-build for Mac to vendor directory
|
194
|
-
rake vendor:libui-ng:ubuntu_x64 # Download latest official pre-build for Ubuntu to vendor directory
|
195
|
-
rake vendor:macos_arm64 # Download pre-build for Mac to vendor directory
|
196
|
-
rake vendor:macos_x64 # Download pre-build for Mac to vendor directory
|
197
|
-
rake vendor:raspbian_aarch64 # Download pre-build for Raspbian to vendor directory
|
198
|
-
rake vendor:ubuntu_x64 # Download pre-build for Ubuntu to vendor directory
|
199
|
-
rake vendor:windows_x64 # Download pre-build for Windows to vendor directory
|
200
|
-
rake vendor:windows_x86 # Download pre-build for Windows to vendor directory
|
188
|
+
```sh
|
189
|
+
bundle exec rake vendor:auto
|
201
190
|
```
|
202
191
|
|
203
|
-
|
204
|
-
These shared libraries are [artifacts](https://github.com/kojix2/libui-ng/actions/workflows/pre-build.yml) of the [pre-build branch](https://github.com/kojix2/libui-ng/tree/pre-build) of [kojix2/libui-ng](https://github.com/kojix2/libui-ng). In that case, please let us know.
|
205
|
-
|
206
|
-
### Using C libui compiled from source code
|
192
|
+
Clean downloaded vendor files (keeps `vendor/{LICENSE,README}.md`):
|
207
193
|
|
208
|
-
|
209
|
-
|
210
|
-
|
194
|
+
```sh
|
195
|
+
bundle exec rake vendor:clean
|
196
|
+
```
|
211
197
|
|
212
|
-
|
198
|
+
### Using your own libui build
|
213
199
|
|
214
|
-
|
200
|
+
If you build libui-ng yourself, set `LIBUIDIR` to the directory containing the compiled `.so/.dylib/.dll` so LibUI can load it. You may also replace files under `vendor/` with your build if preferred. See [#46](https://github.com/kojix2/LibUI/issues/46#issuecomment-1041575792).
|
215
201
|
|
216
202
|
### Publishing gems
|
217
203
|
|
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
|
-
class Error < StandardError; end
|
7
6
|
|
8
7
|
module FFI
|
9
8
|
extend Fiddle::Importer
|
@@ -38,6 +37,7 @@ module LibUI
|
|
38
37
|
end
|
39
38
|
|
40
39
|
typealias('uint32_t', 'unsigned int')
|
40
|
+
typealias('uint64_t', 'unsigned long long')
|
41
41
|
|
42
42
|
InitOptions = struct [
|
43
43
|
'size_t Size'
|
data/lib/libui/fiddle_patch.rb
CHANGED
@@ -16,7 +16,7 @@ module LibUI
|
|
16
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
|
-
raise("can't
|
19
|
+
raise("can't parse the function prototype: #{signature}")
|
20
20
|
end
|
21
21
|
symname = func
|
22
22
|
callback_argument_types = {} # Added
|
data/lib/libui/libui_base.rb
CHANGED
@@ -25,11 +25,13 @@ module LibUI
|
|
25
25
|
# Protect from GC
|
26
26
|
# by giving the owner object a reference to the callback.
|
27
27
|
# See https://github.com/kojix2/LibUI/issues/8
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
receiver = args.first
|
29
|
+
owner = if idx == 0 || # UI.queue_main{}
|
30
|
+
receiver.nil? ||
|
31
|
+
(receiver.respond_to?(:frozen?) && receiver.frozen?) # UI.timer(100) {}
|
32
|
+
LibUIBase # keep a reference on an internal module to avoid GC
|
31
33
|
else
|
32
|
-
|
34
|
+
receiver # receiver object holds the callback
|
33
35
|
end
|
34
36
|
if owner.instance_variable_defined?(:@callbacks)
|
35
37
|
owner.instance_variable_get(:@callbacks) << callback
|
data/lib/libui/version.rb
CHANGED
data/lib/libui.rb
CHANGED
@@ -42,15 +42,21 @@ module LibUI
|
|
42
42
|
|
43
43
|
class << self
|
44
44
|
def init(opt = nil)
|
45
|
+
# Allocate uiInitOptions if not provided
|
45
46
|
unless opt
|
46
47
|
opt = FFI::InitOptions.malloc
|
47
48
|
opt.to_ptr.free = Fiddle::RUBY_FREE
|
49
|
+
opt.Size = FFI::InitOptions.size
|
48
50
|
end
|
49
|
-
i = super(opt)
|
50
|
-
return if i.size.zero?
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
err_ptr = super(opt) # uiInit returns const char* error or NULL on success
|
53
|
+
return nil if err_ptr.null?
|
54
|
+
|
55
|
+
# Convert C string to Ruby string and free the error string per API contract
|
56
|
+
err_msg = err_ptr.to_s
|
57
|
+
free_init_error(err_ptr)
|
58
|
+
warn err_msg
|
59
|
+
nil
|
54
60
|
end
|
55
61
|
|
56
62
|
# Gets the window position.
|
data/vendor/libui.x86_64.so
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: fiddle
|
@@ -24,7 +23,6 @@ dependencies:
|
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '0'
|
27
|
-
description:
|
28
26
|
email:
|
29
27
|
- 2xijok@gmail.com
|
30
28
|
executables: []
|
@@ -47,7 +45,6 @@ homepage: https://github.com/kojix2/libui
|
|
47
45
|
licenses:
|
48
46
|
- MIT
|
49
47
|
metadata: {}
|
50
|
-
post_install_message:
|
51
48
|
rdoc_options: []
|
52
49
|
require_paths:
|
53
50
|
- lib
|
@@ -62,8 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
59
|
- !ruby/object:Gem::Version
|
63
60
|
version: '0'
|
64
61
|
requirements: []
|
65
|
-
rubygems_version: 3.
|
66
|
-
signing_key:
|
62
|
+
rubygems_version: 3.6.9
|
67
63
|
specification_version: 4
|
68
64
|
summary: Ruby bindings to libui
|
69
65
|
test_files: []
|