libui 0.1.2 → 0.2.3
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/LICENSE.txt +1 -1
- data/README.md +146 -82
- data/lib/libui/error.rb +10 -0
- data/lib/libui/ffi.rb +17 -4
- data/lib/libui/fiddle_patch.rb +19 -11
- data/lib/libui/libui_base.rb +6 -4
- data/lib/libui/platform.rb +164 -0
- data/lib/libui/version.rb +1 -1
- data/lib/libui.rb +141 -14
- data/vendor/README.md +20 -6
- data/vendor/libui.aarch64.so +0 -0
- data/vendor/libui.arm64.dylib +0 -0
- data/vendor/libui.x64.dll +0 -0
- data/vendor/libui.x86.dll +0 -0
- data/vendor/libui.x86_64.dylib +0 -0
- data/vendor/libui.x86_64.so +0 -0
- metadata +27 -12
- data/vendor/libui.dll +0 -0
- data/vendor/libui.dylib +0 -0
- data/vendor/libui.so +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e6ba214bc5ec73625a54c9ac037bd58d1123ef4d35f6578653a79b157c44758
|
|
4
|
+
data.tar.gz: a295c5651bf4f60277e1220c49780bb9746a072ccdc8faba573b4a1e61f69933
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8f8b8c1d5506c91ff6703f58bbfbdf129cb92e9fc6c0ff992d5faa1bc78f4a2fcf6beefc467669872f26f6d346cd2f42343882dfeeeeef6e3a92f7cc47d2fe3
|
|
7
|
+
data.tar.gz: e18b72547d935cd81ec709a319d87066fef77c88f0f0c8b3269c0ad44b617b8e3c888f16c8713558c98172363b8a09e94b62bf38a68a8673c890df4f3d32ea77
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# LibUI
|
|
2
2
|
|
|
3
|
-
](https://github.com/kojix2/LibUI/actions/workflows/test.yml)
|
|
4
|
+
[](https://rubygems.org/gems/libui/versions)
|
|
5
|
+
[](https://tokei.kojix2.net/github/kojix2/LibUI)
|
|
5
6
|
<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
7
|
|
|
7
|
-
LibUI is a Ruby wrapper for libui
|
|
8
|
+
LibUI is a Ruby wrapper for libui family.
|
|
8
9
|
|
|
9
|
-
:rocket: [libui-ng](https://github.com/
|
|
10
|
-
|
|
11
|
-
:radio_button: [libui](https://github.com/andlabs/libui) - Original version by andlabs
|
|
10
|
+
:rocket: [libui-ng](https://github.com/kojix2/libui-ng) - A cross-platform portable GUI library
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
15
14
|
```sh
|
|
16
|
-
gem install libui
|
|
15
|
+
gem install libui # --pre
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
- The gem package includes the libui-ng shared library for Windows, Mac, and Linux.
|
|
19
|
+
- Namely `libui.x64.dll`/`libui.x86.dll`, `libui.x86_64.dylib`/`libui.arm64.dylib`, or `libui.x86_64.so`/`libui.aarch64.so`.
|
|
20
|
+
- No dependencies required.
|
|
21
|
+
- The libui gem uses the standard Ruby library [Fiddle](https://github.com/ruby/fiddle) to call C functions.
|
|
22
|
+
|
|
23
|
+
| Windows | Mac | Linux |
|
|
24
|
+
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| <img src="https://user-images.githubusercontent.com/5798442/103118046-900ea780-46b0-11eb-81fc-32626762e4df.png"> | <img src="https://user-images.githubusercontent.com/5798442/103118059-99980f80-46b0-11eb-9d12-324ec4d297c9.png"> | <img src="https://user-images.githubusercontent.com/5798442/103118068-a0bf1d80-46b0-11eb-8c5c-3bdcc3dcfb26.png"> |
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|---------|-----|-------|
|
|
26
|
-
|<img src="https://user-images.githubusercontent.com/5798442/103118046-900ea780-46b0-11eb-81fc-32626762e4df.png">|<img src="https://user-images.githubusercontent.com/5798442/103118059-99980f80-46b0-11eb-9d12-324ec4d297c9.png">|<img src="https://user-images.githubusercontent.com/5798442/103118068-a0bf1d80-46b0-11eb-8c5c-3bdcc3dcfb26.png">|
|
|
27
|
+
Notes:
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* [Raspberry Pi](https://www.raspberrypi.com/) and other platform users will need to compile C libui. See [Development](#development).
|
|
29
|
+
- If you are using the 32-bit (x86) version of Ruby, you need to download the 32-bit (x86) native dll. See the [Development](#development) section.
|
|
30
|
+
- On Windows, libui may not work due to missing DLLs. In that case, you need to install [Visual C++ Redistributable](https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist). See ([#48](https://github.com/kojix2/LibUI/issues/48))
|
|
31
|
+
- Users with [Raspberry Pi](https://www.raspberrypi.com/) or other platforms will need to compile the C libui library. See the [Development](#development) section.
|
|
32
32
|
|
|
33
33
|
## Usage
|
|
34
34
|
|
|
@@ -49,9 +49,8 @@ end
|
|
|
49
49
|
|
|
50
50
|
UI.window_on_closing(main_window) do
|
|
51
51
|
puts 'Bye Bye'
|
|
52
|
-
UI.control_destroy(main_window)
|
|
53
52
|
UI.quit
|
|
54
|
-
|
|
53
|
+
1
|
|
55
54
|
end
|
|
56
55
|
|
|
57
56
|
UI.window_set_child(main_window, button)
|
|
@@ -61,30 +60,29 @@ UI.main
|
|
|
61
60
|
UI.quit
|
|
62
61
|
```
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
For more examples, see the [examples](https://github.com/kojix2/libui/tree/main/examples) directory.
|
|
65
64
|
|
|
66
65
|
### General Rules
|
|
67
66
|
|
|
68
|
-
Compared to original libui written in C
|
|
67
|
+
Compared to the original libui library written in C:
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
- Method names use snake_case.
|
|
70
|
+
- The last argument can be omitted if it's nil.
|
|
71
|
+
- A block can be passed as a callback.
|
|
72
|
+
- The block will be converted to a Proc object and added as the last argument.
|
|
73
|
+
- The last argument can still be omitted when nil.
|
|
75
74
|
|
|
76
|
-
You can use [the
|
|
75
|
+
You can use [the libui-ng API documentation](https://libui-ng.github.io/libui-ng/) as a reference.
|
|
77
76
|
|
|
78
77
|
### DSLs for LibUI
|
|
79
78
|
|
|
80
|
-
LibUI is
|
|
79
|
+
LibUI is not object-oriented because it is a thin Ruby wrapper (binding) for the procedural C libui library, mirroring its API structure.
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
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):
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
* [libui_paradise](https://rubygems.org/gems/libui_paradise)
|
|
83
|
+
- [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
|
86
84
|
|
|
87
|
-
###
|
|
85
|
+
### Working with fiddle pointers
|
|
88
86
|
|
|
89
87
|
```ruby
|
|
90
88
|
require 'libui'
|
|
@@ -92,54 +90,71 @@ UI = LibUI
|
|
|
92
90
|
UI.init
|
|
93
91
|
```
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
Text getter methods such as `label_text`, `entry_text`, and `window_title`
|
|
94
|
+
return `Fiddle::Pointer` objects for strings allocated by libui. Convert the
|
|
95
|
+
pointer to a Ruby string, then release it with `free_text`.
|
|
96
96
|
|
|
97
97
|
```ruby
|
|
98
98
|
label = UI.new_label("Ruby")
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
pointer = UI.label_text(label) # #<Fiddle::Pointer>
|
|
100
|
+
text = pointer.to_s
|
|
101
|
+
UI.free_text(pointer)
|
|
102
|
+
p text # Ruby
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Use `ensure` if the code between conversion and cleanup can raise:
|
|
106
|
+
|
|
107
|
+
```ruby
|
|
108
|
+
def ui_text(text_pointer)
|
|
109
|
+
text_pointer.to_s
|
|
110
|
+
ensure
|
|
111
|
+
UI.free_text(text_pointer) if text_pointer && !text_pointer.null?
|
|
112
|
+
end
|
|
101
113
|
```
|
|
102
114
|
|
|
103
|
-
If you need to use C structs, you can do the following
|
|
115
|
+
If you need to use C structs, you can do the following:
|
|
104
116
|
|
|
105
117
|
```ruby
|
|
106
118
|
font_button = UI.new_font_button
|
|
107
119
|
|
|
108
|
-
# Allocate memory
|
|
120
|
+
# Allocate memory
|
|
109
121
|
font_descriptor = UI::FFI::FontDescriptor.malloc
|
|
110
122
|
font_descriptor.to_ptr.free = Fiddle::RUBY_FREE
|
|
111
123
|
# font_descriptor = UI::FFI::FontDescriptor.malloc(Fiddle::RUBY_FREE) # fiddle 1.0.1 or higher
|
|
112
124
|
|
|
113
125
|
UI.font_button_on_changed(font_button) do
|
|
114
126
|
UI.font_button_font(font_button, font_descriptor)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
begin
|
|
128
|
+
p family: font_descriptor.Family.to_s,
|
|
129
|
+
size: font_descriptor.Size,
|
|
130
|
+
weight: font_descriptor.Weight,
|
|
131
|
+
italic: font_descriptor.Italic,
|
|
132
|
+
stretch: font_descriptor.Stretch
|
|
133
|
+
ensure
|
|
134
|
+
UI.free_font_button_font(font_descriptor)
|
|
135
|
+
end
|
|
120
136
|
end
|
|
121
137
|
```
|
|
122
138
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
`Fiddle::Closure::BlockCaller` or `Fiddle::Closure`.
|
|
126
|
-
|
|
127
|
-
If the function object is collected, memory will be freed
|
|
128
|
-
and a segmentation violation will occur when the callback is invoked.
|
|
139
|
+
- Callbacks
|
|
140
|
+
- In Ruby/Fiddle, a C callback function is written as an object of
|
|
141
|
+
`Fiddle::Closure::BlockCaller` or `Fiddle::Closure`.
|
|
142
|
+
Be careful about Ruby's garbage collection - if the function object is collected, memory will be freed resulting in a segmentation violation when the callback is invoked.
|
|
129
143
|
|
|
130
144
|
```ruby
|
|
131
|
-
# to a local variable to prevent it from being collected by GC.
|
|
145
|
+
# Assign to a local variable to prevent it from being collected by GC.
|
|
132
146
|
handler.MouseEvent = (c1 = Fiddle::Closure::BlockCaller.new(0, [0]) {})
|
|
133
147
|
handler.MouseCrossed = (c2 = Fiddle::Closure::BlockCaller.new(0, [0]) {})
|
|
134
148
|
handler.DragBroken = (c3 = Fiddle::Closure::BlockCaller.new(0, [0]) {})
|
|
135
149
|
```
|
|
136
150
|
|
|
137
|
-
###
|
|
151
|
+
### Creating a Windows executable (.exe) with OCRA
|
|
152
|
+
|
|
153
|
+
OCRA (One-Click Ruby Application) builds Windows executables from Ruby source code.
|
|
138
154
|
|
|
139
|
-
|
|
140
|
-
* https://github.com/larsch/ocra/
|
|
155
|
+
- https://github.com/larsch/ocra/
|
|
141
156
|
|
|
142
|
-
|
|
157
|
+
To build an exe with Ocra, include 3 DLLs from the ruby_builtin_dlls folder:
|
|
143
158
|
|
|
144
159
|
```sh
|
|
145
160
|
ocra examples/control_gallery.rb ^
|
|
@@ -149,7 +164,7 @@ ocra examples/control_gallery.rb ^
|
|
|
149
164
|
--gem-all=fiddle ^
|
|
150
165
|
```
|
|
151
166
|
|
|
152
|
-
Add additional options below if necessary
|
|
167
|
+
Add additional options below if necessary:
|
|
153
168
|
|
|
154
169
|
```sh
|
|
155
170
|
--window ^
|
|
@@ -162,59 +177,108 @@ Add additional options below if necessary.
|
|
|
162
177
|
|
|
163
178
|
## Development
|
|
164
179
|
|
|
165
|
-
LibUI is not object-oriented, but it provides high portability with a minimal implementation.
|
|
166
|
-
|
|
167
180
|
```sh
|
|
168
181
|
git clone https://github.com/kojix2/libui
|
|
169
182
|
cd libui
|
|
170
183
|
bundle install
|
|
171
|
-
bundle exec rake vendor:
|
|
184
|
+
bundle exec rake vendor:auto
|
|
172
185
|
bundle exec rake test
|
|
173
186
|
```
|
|
174
187
|
|
|
175
|
-
|
|
188
|
+
JRuby on macOS needs Java and AppKit must start on the first thread:
|
|
176
189
|
|
|
177
|
-
|
|
190
|
+
```sh
|
|
191
|
+
export JAVA_HOME=/path/to/openjdk
|
|
192
|
+
export JRUBY_OPTS=-J-XstartOnFirstThread
|
|
193
|
+
jruby -Ilib examples/basic_button.rb
|
|
194
|
+
jruby -S rake test
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Take note that, as the above code shows, LibUI works via jruby as well, so you have an additional
|
|
198
|
+
GUI library (aside from jruby-swing by default) to test simple User Interfaces too.
|
|
199
|
+
|
|
200
|
+
### Pre-built shared libraries for libui-ng
|
|
178
201
|
|
|
202
|
+
Download pre-built libui-ng shared libraries (per your current platform):
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
bundle exec rake vendor:auto
|
|
179
206
|
```
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
rake vendor:
|
|
185
|
-
rake vendor:libui-ng:build[hash] # Build libui-ng latest master [commit hash]
|
|
186
|
-
rake vendor:libui-ng:mac # Download latest dev build for Mac to vendor directory
|
|
187
|
-
rake vendor:libui-ng:ubuntu_x64 # Download latest dev build for Ubuntu to vendor directory
|
|
207
|
+
|
|
208
|
+
Clean downloaded vendor files (keeps `vendor/{LICENSE,README}.md`):
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
bundle exec rake vendor:clean
|
|
188
212
|
```
|
|
189
213
|
|
|
190
|
-
|
|
214
|
+
### Using your own libui build
|
|
215
|
+
|
|
216
|
+
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).
|
|
191
217
|
|
|
192
|
-
###
|
|
218
|
+
### Publishing gems
|
|
193
219
|
|
|
194
|
-
|
|
220
|
+
#### Automated Publishing
|
|
195
221
|
|
|
196
|
-
|
|
222
|
+
Push a version tag to automatically publish platform-specific gems:
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
git tag v0.2.0
|
|
226
|
+
git push origin v0.2.0
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Requires `RUBYGEMS_API_KEY` repository secret with scoped API key.
|
|
230
|
+
|
|
231
|
+
#### Manual Publishing
|
|
232
|
+
|
|
233
|
+
```sh
|
|
234
|
+
ls vendor # check the vendor directory
|
|
235
|
+
rm -rf pkg # remove previously built gems
|
|
236
|
+
rake build_platform # build gems
|
|
237
|
+
|
|
238
|
+
# Check the contents of the gem
|
|
239
|
+
find pkg -name *.gem -exec sh -c "echo; echo \# {}; tar -O -f {} -x data.tar.gz | tar zt" \;
|
|
240
|
+
|
|
241
|
+
rake release_platform # publish gems
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Windows Ruby (x64-mingw32 or x64-mingw-ucrt)
|
|
245
|
+
|
|
246
|
+
```sh
|
|
247
|
+
gem install rake rubyzip
|
|
248
|
+
GEM_PLATFORM=x64-mingw32 rake vendor:clean
|
|
249
|
+
GEM_PLATFORM=x64-mingw32 rake vendor:auto
|
|
250
|
+
GEM_PLATFORM=x64-mingw32 gem build libui.gemspec
|
|
251
|
+
gem push libui-0.2.0-x64-mingw32.gem
|
|
252
|
+
```
|
|
197
253
|
|
|
198
254
|
### libui or libui-ng
|
|
199
255
|
|
|
200
|
-
|
|
201
|
-
|
|
256
|
+
- From version 0.1.X, LibUI supports only libui-ng.
|
|
257
|
+
- Version 0.0.X only supports andlabs/libui.
|
|
202
258
|
|
|
203
259
|
## Contributing
|
|
204
260
|
|
|
205
|
-
Would you like to
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
261
|
+
Would you like to contribute to LibUI?
|
|
262
|
+
|
|
263
|
+
- Please feel free to send us your [pull requests](https://github.com/kojix2/libui/pulls).
|
|
264
|
+
- Small corrections, such as typo fixes, are appreciated.
|
|
265
|
+
- Did you find any bugs? Submit them in the [issues](https://github.com/kojix2/LibUI/issues) section!
|
|
266
|
+
|
|
267
|
+
Do you need commit rights?
|
|
268
|
+
|
|
269
|
+
- If you need commit rights to my repository or want to get admin rights and take over the project, please feel free to contact @kojix2.
|
|
270
|
+
- Many OSS projects become abandoned because only the founder has commit rights to the original repository.
|
|
271
|
+
|
|
272
|
+
Support libui-ng development
|
|
209
273
|
|
|
210
|
-
|
|
211
|
-
|
|
274
|
+
- Contributing to the development of libui-ng is a contribution to the entire libui community, including Ruby's LibUI.
|
|
275
|
+
- For example, it would be easier to release LibUI in Ruby if libui-ng could be built easily and official shared libraries could be distributed.
|
|
212
276
|
|
|
213
|
-
##
|
|
277
|
+
## Acknowledgements
|
|
214
278
|
|
|
215
279
|
This project is inspired by libui-ruby.
|
|
216
280
|
|
|
217
|
-
|
|
281
|
+
- https://github.com/jamescook/libui-ruby
|
|
218
282
|
|
|
219
283
|
While libui-ruby uses [Ruby-FFI](https://github.com/ffi/ffi), this gem uses [Fiddle](https://github.com/ruby/fiddle).
|
|
220
284
|
|
data/lib/libui/error.rb
ADDED
data/lib/libui/ffi.rb
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
require 'fiddle/import'
|
|
2
2
|
require_relative 'fiddle_patch'
|
|
3
|
+
require_relative 'error'
|
|
3
4
|
|
|
4
5
|
module LibUI
|
|
5
6
|
module FFI
|
|
6
7
|
extend Fiddle::Importer
|
|
7
8
|
extend FiddlePatch
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
raise
|
|
10
|
+
if LibUI.ffi_lib.nil?
|
|
11
|
+
raise LibraryNotFoundError, 'Could not find libui shared library. LibUI.ffi_lib is nil.'
|
|
12
|
+
elsif !File.exist?(LibUI.ffi_lib)
|
|
13
|
+
raise LibraryNotFoundError, "Could not find libui shared library: #{LibUI.ffi_lib}"
|
|
14
|
+
else
|
|
15
|
+
begin
|
|
16
|
+
dlload LibUI.ffi_lib
|
|
17
|
+
rescue LoadError
|
|
18
|
+
raise LibraryLoadError, "Could not load libui shared library: #{LibUI.ffi_lib}"
|
|
19
|
+
end
|
|
13
20
|
end
|
|
14
21
|
|
|
15
22
|
class << self
|
|
@@ -18,6 +25,8 @@ module LibUI
|
|
|
18
25
|
def try_extern(signature, *opts)
|
|
19
26
|
extern(signature, *opts)
|
|
20
27
|
rescue StandardError => e
|
|
28
|
+
# Do not raise error when the function is not found
|
|
29
|
+
# because some functions may not be available on older versions of libui.
|
|
21
30
|
warn "#{e.class.name}: #{e.message}"
|
|
22
31
|
end
|
|
23
32
|
|
|
@@ -27,6 +36,7 @@ module LibUI
|
|
|
27
36
|
end
|
|
28
37
|
|
|
29
38
|
typealias('uint32_t', 'unsigned int')
|
|
39
|
+
typealias('uint64_t', 'unsigned long long')
|
|
30
40
|
|
|
31
41
|
InitOptions = struct [
|
|
32
42
|
'size_t Size'
|
|
@@ -89,6 +99,9 @@ module LibUI
|
|
|
89
99
|
|
|
90
100
|
try_extern 'char *uiWindowTitle(uiWindow *w)'
|
|
91
101
|
try_extern 'void uiWindowSetTitle(uiWindow *w, const char *title)'
|
|
102
|
+
try_extern 'void uiWindowPosition(uiWindow *w, int *x, int *y)'
|
|
103
|
+
try_extern 'void uiWindowSetPosition(uiWindow *w, int x, int y)'
|
|
104
|
+
try_extern 'void uiWindowOnPositionChanged(uiWindow *w, void (*f)(uiWindow *sender, void *senderData), void *data)'
|
|
92
105
|
try_extern 'void uiWindowContentSize(uiWindow *w, int *width, int *height)'
|
|
93
106
|
try_extern 'void uiWindowSetContentSize(uiWindow *w, int width, int height)'
|
|
94
107
|
try_extern 'int uiWindowFullscreen(uiWindow *w)'
|
data/lib/libui/fiddle_patch.rb
CHANGED
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
module LibUI
|
|
2
|
+
# This module overrides Fiddle's mtehods
|
|
3
|
+
# - Fiddle::Importer#extern
|
|
4
|
+
# - Fiddle::CParser#parse_signature
|
|
5
|
+
# Original methods are in
|
|
6
|
+
# - https://github.com/ruby/fiddle/blob/master/lib/fiddle/import.rb
|
|
7
|
+
# - https://github.com/ruby/fiddle/blob/master/lib/fiddle/cparser.rb
|
|
8
|
+
# These changes add the ability to parse the signatures of functions given as arguments.
|
|
9
|
+
|
|
2
10
|
module FiddlePatch
|
|
3
11
|
def parse_signature(signature, tymap = nil)
|
|
4
12
|
tymap ||= {}
|
|
5
13
|
ctype, func, args = case compact(signature)
|
|
6
|
-
when /^(?:[\w
|
|
14
|
+
when /^(?:[\w*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
|
|
7
15
|
[TYPE_VOIDP, Regexp.last_match(1), Regexp.last_match(2)]
|
|
8
|
-
when /^([\w
|
|
16
|
+
when /^([\w*\s]+[*\s])(\w+)\((.*?)\);?$/
|
|
9
17
|
[parse_ctype(Regexp.last_match(1).strip, tymap), Regexp.last_match(2), Regexp.last_match(3)]
|
|
10
18
|
else
|
|
11
|
-
raise("can't
|
|
19
|
+
raise("can't parse the function prototype: #{signature}")
|
|
12
20
|
end
|
|
13
21
|
symname = func
|
|
14
22
|
callback_argument_types = {} # Added
|
|
15
23
|
argtype = split_arguments(args).collect.with_index do |arg, idx| # Added with_index
|
|
16
24
|
# Check if it is a function pointer or not
|
|
17
|
-
if arg =~ /\(\*.*\)\(.*\)/
|
|
25
|
+
if arg =~ /\(\*.*\)\(.*\)/ # Added
|
|
18
26
|
# From the arguments, create a notation that looks like a function declaration
|
|
19
27
|
# int(*f)(int *, void *) -> int f(int *, void *)
|
|
20
|
-
func_arg = arg.sub('(*', ' ').sub(')', '')
|
|
28
|
+
func_arg = arg.sub('(*', ' ').sub(')', '') # Added
|
|
21
29
|
# Use Fiddle's parse_signature method again.
|
|
22
|
-
callback_argument_types[idx] = parse_signature(func_arg)
|
|
30
|
+
callback_argument_types[idx] = parse_signature(func_arg) # Added
|
|
23
31
|
end
|
|
24
32
|
parse_ctype(arg, tymap)
|
|
25
33
|
end
|
|
@@ -33,8 +41,8 @@ module LibUI
|
|
|
33
41
|
func = import_function(symname, ctype, argtype, opt[:call_type])
|
|
34
42
|
|
|
35
43
|
# callback_argument_types
|
|
36
|
-
func.instance_variable_set(:@callback_argument_types,
|
|
37
|
-
|
|
44
|
+
func.instance_variable_set(:@callback_argument_types,
|
|
45
|
+
callback_argument_types) # Added
|
|
38
46
|
# attr_reader
|
|
39
47
|
def func.callback_argument_types
|
|
40
48
|
@callback_argument_types
|
|
@@ -60,9 +68,9 @@ module LibUI
|
|
|
60
68
|
@func_map[name] = func
|
|
61
69
|
# define_method(name){|*args,&block| f.call(*args,&block)}
|
|
62
70
|
begin
|
|
63
|
-
|
|
64
|
-
file =
|
|
65
|
-
line =
|
|
71
|
+
location = caller_locations(1, 1).first
|
|
72
|
+
file = location.path
|
|
73
|
+
line = location.lineno
|
|
66
74
|
rescue StandardError
|
|
67
75
|
file, line = __FILE__, __LINE__ + 3
|
|
68
76
|
end
|
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
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
require 'rbconfig'
|
|
2
|
+
|
|
3
|
+
module LibUI
|
|
4
|
+
module Platform
|
|
5
|
+
CONFIG = {
|
|
6
|
+
'arm64-darwin' => {
|
|
7
|
+
vendor: 'vendor/libui.arm64.dylib',
|
|
8
|
+
lib_names: ['libui.arm64.dylib', 'libui.dylib'],
|
|
9
|
+
release_zip: 'macOS-arm64-shared-release.zip',
|
|
10
|
+
release_src: 'builddir/meson-out/libui.dylib'
|
|
11
|
+
},
|
|
12
|
+
'x86_64-darwin' => {
|
|
13
|
+
vendor: 'vendor/libui.x86_64.dylib',
|
|
14
|
+
lib_names: ['libui.x86_64.dylib', 'libui.dylib'],
|
|
15
|
+
release_zip: 'macOS-x64-shared-release.zip',
|
|
16
|
+
release_src: 'builddir/meson-out/libui.dylib'
|
|
17
|
+
},
|
|
18
|
+
'x86_64-linux' => {
|
|
19
|
+
vendor: 'vendor/libui.x86_64.so',
|
|
20
|
+
lib_names: ['libui.x86_64.so', 'libui.so'],
|
|
21
|
+
release_zip: 'Ubuntu-x64-shared-release.zip',
|
|
22
|
+
release_src: 'builddir/meson-out/libui.so'
|
|
23
|
+
},
|
|
24
|
+
'aarch64-linux' => {
|
|
25
|
+
vendor: 'vendor/libui.aarch64.so',
|
|
26
|
+
lib_names: ['libui.aarch64.so', 'libui.so'],
|
|
27
|
+
release_zip: 'Ubuntu-arm64-shared-release.zip',
|
|
28
|
+
release_src: 'builddir/meson-out/libui.so'
|
|
29
|
+
},
|
|
30
|
+
'x64-mingw32' => {
|
|
31
|
+
vendor: 'vendor/libui.x64.dll',
|
|
32
|
+
lib_names: ['libui.x64.dll', 'libui.dll'],
|
|
33
|
+
release_zip: 'Windows-x64-msvc-shared-release.zip',
|
|
34
|
+
release_src: 'builddir/meson-out/libui.dll'
|
|
35
|
+
},
|
|
36
|
+
'x86-mingw32' => {
|
|
37
|
+
vendor: 'vendor/libui.x86.dll',
|
|
38
|
+
lib_names: ['libui.x86.dll', 'libui.dll'],
|
|
39
|
+
release_zip: 'Windows-x86-msvc-shared-release.zip',
|
|
40
|
+
release_src: 'builddir/meson-out/libui.dll'
|
|
41
|
+
}
|
|
42
|
+
}.freeze
|
|
43
|
+
|
|
44
|
+
class << self
|
|
45
|
+
def config_keys
|
|
46
|
+
CONFIG.keys
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def config_for(platform_key)
|
|
50
|
+
CONFIG[normalize_platform_key(platform_key)]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def current_config
|
|
54
|
+
config_for(detect_platform_key)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def detect_platform_key
|
|
58
|
+
native_platform_key || rubygems_platform_key
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def native_platform_key
|
|
62
|
+
platform_key = case host_os
|
|
63
|
+
when /darwin/
|
|
64
|
+
"#{normalized_cpu}-darwin"
|
|
65
|
+
when /linux/
|
|
66
|
+
# libc variants (glibc vs musl) are not supported as
|
|
67
|
+
# separate prebuilt targets yet; the shipped Linux
|
|
68
|
+
# binaries are built on Ubuntu. Supporting musl would
|
|
69
|
+
# require adding explicit *-linux-musl entries.
|
|
70
|
+
"#{normalized_cpu}-linux"
|
|
71
|
+
when /mingw|mswin/
|
|
72
|
+
windows_platform_key
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
CONFIG.key?(platform_key) ? platform_key : nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def rubygems_platform_key
|
|
79
|
+
current_platform = Gem::Platform.local
|
|
80
|
+
platform_key = normalize_platform_key(current_platform.to_s)
|
|
81
|
+
return platform_key if CONFIG.key?(platform_key)
|
|
82
|
+
|
|
83
|
+
CONFIG.keys.find do |config_key|
|
|
84
|
+
config_platform = Gem::Platform.new(config_key)
|
|
85
|
+
|
|
86
|
+
# NOTE: match_platforms? is a private RubyGems API. It is used to
|
|
87
|
+
# reuse RubyGems' own platform matching (including the libc wildcard
|
|
88
|
+
# behaviour), but it may change or disappear across RubyGems versions.
|
|
89
|
+
if Gem::Platform.send(:match_platforms?, current_platform, [config_platform])
|
|
90
|
+
true
|
|
91
|
+
elsif config_key == 'x64-mingw32' &&
|
|
92
|
+
current_platform.os.start_with?('mingw') &&
|
|
93
|
+
%w[x64 x86_64 amd64].include?(current_platform.cpu)
|
|
94
|
+
true
|
|
95
|
+
elsif config_key == 'x86-mingw32' &&
|
|
96
|
+
current_platform.os.start_with?('mingw') &&
|
|
97
|
+
%w[x86 i386 i686].include?(current_platform.cpu)
|
|
98
|
+
true
|
|
99
|
+
else
|
|
100
|
+
false
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Canonicalizes alternate platform spellings to the keys used in CONFIG.
|
|
106
|
+
# Linux libc suffixes (-gnu / -musl) are intentionally not stripped here;
|
|
107
|
+
# adding libc-specific artifacts should be an explicit CONFIG change.
|
|
108
|
+
def normalize_platform_key(platform_key)
|
|
109
|
+
platform_key.to_s
|
|
110
|
+
.sub(/\Aarm64-linux\z/, 'aarch64-linux')
|
|
111
|
+
.sub(/\Ax64-linux\z/, 'x86_64-linux')
|
|
112
|
+
.sub(/-mingw-ucrt\z/, '-mingw32')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def vendor_file_for(platform_key)
|
|
116
|
+
config = config_for(platform_key)
|
|
117
|
+
config && config[:vendor]
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def current_lib_names
|
|
121
|
+
# host_lib_name and the bare "libui.<soext>" are fallbacks for locally
|
|
122
|
+
# built or manually placed libraries (e.g. via LIBUIDIR or a source
|
|
123
|
+
# checkout) whose file names may not match the CONFIG lib_names.
|
|
124
|
+
host_lib_name = "libui.#{host_cpu}.#{RbConfig::CONFIG['SOEXT']}"
|
|
125
|
+
names = current_config ? current_config[:lib_names] : []
|
|
126
|
+
([host_lib_name] + names + ["libui.#{RbConfig::CONFIG['SOEXT']}"]).uniq
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
private
|
|
130
|
+
|
|
131
|
+
def host_cpu
|
|
132
|
+
RbConfig::CONFIG['host_cpu']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def host_os
|
|
136
|
+
RbConfig::CONFIG['host_os']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def normalized_cpu
|
|
140
|
+
case host_cpu
|
|
141
|
+
when /i\d86/
|
|
142
|
+
'x86'
|
|
143
|
+
when 'amd64', 'x64'
|
|
144
|
+
'x86_64'
|
|
145
|
+
when 'aarch64'
|
|
146
|
+
host_os =~ /darwin/ ? 'arm64' : host_cpu
|
|
147
|
+
when 'arm64'
|
|
148
|
+
host_os =~ /linux/ ? 'aarch64' : host_cpu
|
|
149
|
+
else
|
|
150
|
+
host_cpu
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def windows_platform_key
|
|
155
|
+
case normalized_cpu
|
|
156
|
+
when 'x86_64'
|
|
157
|
+
'x64-mingw32'
|
|
158
|
+
when 'x86'
|
|
159
|
+
'x86-mingw32'
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
data/lib/libui/version.rb
CHANGED
data/lib/libui.rb
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
require_relative 'libui/version'
|
|
2
2
|
require_relative 'libui/utils'
|
|
3
|
-
|
|
3
|
+
require_relative 'libui/error'
|
|
4
|
+
require_relative 'libui/platform'
|
|
4
5
|
|
|
5
6
|
module LibUI
|
|
6
|
-
class Error < StandardError; end
|
|
7
|
-
|
|
8
7
|
class << self
|
|
9
8
|
attr_accessor :ffi_lib
|
|
10
9
|
end
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
self.ffi_lib = \
|
|
12
|
+
if ENV['LIBUIDIR'] && !ENV['LIBUIDIR'].empty?
|
|
13
|
+
Platform.current_lib_names.lazy
|
|
14
|
+
.map { |name| File.expand_path(name, ENV['LIBUIDIR']) }
|
|
15
|
+
.find { |path| File.exist?(path) }
|
|
16
|
+
else
|
|
17
|
+
Platform.current_lib_names.lazy
|
|
18
|
+
.map { |name| File.expand_path("../vendor/#{name}", __dir__) }
|
|
19
|
+
.find { |path| File.exist?(path) }
|
|
20
|
+
end
|
|
19
21
|
|
|
20
22
|
require_relative 'libui/ffi'
|
|
21
23
|
require_relative 'libui/libui_base'
|
|
@@ -24,17 +26,142 @@ module LibUI
|
|
|
24
26
|
|
|
25
27
|
class << self
|
|
26
28
|
def init(opt = nil)
|
|
29
|
+
# Allocate uiInitOptions if not provided
|
|
27
30
|
unless opt
|
|
28
31
|
opt = FFI::InitOptions.malloc
|
|
29
32
|
opt.to_ptr.free = Fiddle::RUBY_FREE
|
|
33
|
+
opt.Size = FFI::InitOptions.size
|
|
30
34
|
end
|
|
31
|
-
i = super(opt)
|
|
32
|
-
return if i.size.zero?
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
err_ptr = super(opt) # uiInit returns const char* error or NULL on success
|
|
37
|
+
return nil if err_ptr.null?
|
|
38
|
+
|
|
39
|
+
# Convert C string to Ruby string and free the error string per API contract
|
|
40
|
+
err_msg = err_ptr.to_s
|
|
41
|
+
free_init_error(err_ptr)
|
|
42
|
+
warn err_msg
|
|
43
|
+
nil
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def new_button(text = '')
|
|
47
|
+
super(text)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def new_checkbox(text = '')
|
|
51
|
+
super(text)
|
|
36
52
|
end
|
|
37
53
|
|
|
54
|
+
def window_set_title(window, title = '')
|
|
55
|
+
super(window, title)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def button_set_text(button, text = '')
|
|
59
|
+
super(button, text)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def checkbox_set_text(checkbox, text = '')
|
|
63
|
+
super(checkbox, text)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def entry_set_text(entry, text = '')
|
|
67
|
+
super(entry, text)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def label_set_text(label, text = '')
|
|
71
|
+
super(label, text)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def new_label(text = '')
|
|
75
|
+
super(text)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def group_set_title(group, title = '')
|
|
79
|
+
super(group, title)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def new_group(title = '')
|
|
83
|
+
super(title)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def combobox_append(combobox, text = '')
|
|
87
|
+
super(combobox, text)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def combobox_insert_at(combobox, index, text = '')
|
|
91
|
+
super(combobox, index, text)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def editable_combobox_append(combobox, text = '')
|
|
95
|
+
super(combobox, text)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def editable_combobox_set_text(combobox, text = '')
|
|
99
|
+
super(combobox, text)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def radio_buttons_append(radio_buttons, text = '')
|
|
103
|
+
super(radio_buttons, text)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def multiline_entry_set_text(entry, text = '')
|
|
107
|
+
super(entry, text)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def multiline_entry_append(entry, text = '')
|
|
111
|
+
super(entry, text)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def menu_append_item(menu, name = '')
|
|
115
|
+
super(menu, name)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def menu_append_check_item(menu, name = '')
|
|
119
|
+
super(menu, name)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def new_menu(name = '')
|
|
123
|
+
super(name)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def msg_box(parent, title, description = '')
|
|
127
|
+
super(parent, title, description)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def msg_box_error(parent, title, description = '')
|
|
131
|
+
super(parent, title, description)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def new_attributed_string(initial_string = '')
|
|
135
|
+
super(initial_string)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def attributed_string_append_unattributed(attributed_string, str = '')
|
|
139
|
+
super(attributed_string, str)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def new_table_value_string(str = '')
|
|
143
|
+
super(str)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Gets the window position.
|
|
147
|
+
# Coordinates are measured from the top left corner of the screen.
|
|
148
|
+
# @param w [Fiddle::Pointer] Pointer of uiWindow instance.
|
|
149
|
+
# @return [Array] position of the window. [x, y]
|
|
150
|
+
# @note This method may return inaccurate or dummy values on Unix platforms.
|
|
151
|
+
|
|
152
|
+
def window_position(w)
|
|
153
|
+
x_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT, Fiddle::RUBY_FREE)
|
|
154
|
+
y_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT, Fiddle::RUBY_FREE)
|
|
155
|
+
super(w, x_ptr, y_ptr)
|
|
156
|
+
x = x_ptr[0, Fiddle::SIZEOF_INT].unpack1('i*')
|
|
157
|
+
y = y_ptr[0, Fiddle::SIZEOF_INT].unpack1('i*')
|
|
158
|
+
[x, y]
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# FIXME: This is a workaround for a old version of Fiddle.
|
|
162
|
+
# Fiddle 1.1.2 and above should be able to handle one character string.
|
|
163
|
+
# See https://github.com/ruby/fiddle/issues/96
|
|
164
|
+
|
|
38
165
|
def open_type_features_add(otf, a, b, c, d, value)
|
|
39
166
|
a, b, c, d = [a, b, c, d].map { |s| s.is_a?(String) ? s.ord : s }
|
|
40
167
|
super(otf, a, b, c, d, value)
|
data/vendor/README.md
CHANGED
|
@@ -68,6 +68,16 @@ For the sake of completeness, I should note that the default value of `--layout`
|
|
|
68
68
|
|
|
69
69
|
Backends other than `ninja` should work, but are untested by me.
|
|
70
70
|
|
|
71
|
+
## Testing
|
|
72
|
+
|
|
73
|
+
### Automated Unit Tests
|
|
74
|
+
|
|
75
|
+
Run the included unit tests via `meson test -C build`. Alternatively you can also run the `unit` executable manually.
|
|
76
|
+
|
|
77
|
+
### Manual Testing Suite
|
|
78
|
+
|
|
79
|
+
Run the manual quality assurance test suite via `qa` and follow the instructions laid out within.
|
|
80
|
+
|
|
71
81
|
## Installation
|
|
72
82
|
|
|
73
83
|
Meson also supports installing from source; if you use Ninja, just do
|
|
@@ -82,9 +92,13 @@ When running `meson`, the `--prefix` option will set the installation prefix. [T
|
|
|
82
92
|
|
|
83
93
|
Can be built from AUR: https://aur.archlinux.org/packages/libui-ng-git/
|
|
84
94
|
|
|
85
|
-
## Documentation
|
|
95
|
+
## Documentation [WIP]
|
|
96
|
+
|
|
97
|
+
[API](https://libui-ng.github.io/libui-ng/), check the [modules](https://libui-ng.github.io/libui-ng/modules.html) section for an overview of (nearly all) uiControls.
|
|
98
|
+
|
|
99
|
+
Consult the `ui.h` comments for the uiControls missing in the docs.
|
|
86
100
|
|
|
87
|
-
|
|
101
|
+
Check the `examples` directory for fully fledged examples. Check out the `tests` directory and subdirectories for more real world usage.
|
|
88
102
|
|
|
89
103
|
## Language Bindings
|
|
90
104
|
|
|
@@ -96,7 +110,7 @@ Language | Bindings
|
|
|
96
110
|
--- | ---
|
|
97
111
|
C++ | [libui-cpp](https://github.com/billyquith/libui-cpp), [cpp-libui-qtlike](https://github.com/aoloe/cpp-libui-qtlike)
|
|
98
112
|
C# / .NET Framework | [LibUI.Binding](https://github.com/NattyNarwhal/LibUI.Binding)
|
|
99
|
-
C# / .NET Core | [DevZH.UI](https://github.com/noliar/DevZH.UI), [SharpUI](https://github.com/benpye/sharpui/)
|
|
113
|
+
C# / .NET Core | [DevZH.UI](https://github.com/noliar/DevZH.UI), [SharpUI](https://github.com/benpye/sharpui/)
|
|
100
114
|
CHICKEN Scheme | [wasamasa/libui](https://github.com/wasamasa/libui)
|
|
101
115
|
Common Lisp | [jinwoo/cl-ui](https://github.com/jinwoo/cl-ui)
|
|
102
116
|
Crystal | [libui.cr](https://github.com/Fusion/libui.cr), [hedron](https://github.com/Qwerp-Derp/hedron), [iu](https://github.com/grkek/iu)
|
|
@@ -109,13 +123,13 @@ JavaScript/Node.js | [libui-node](https://github.com/parro-it/libui-node), [libu
|
|
|
109
123
|
Julia | [Libui.jl](https://github.com/joa-quim/Libui.jl)
|
|
110
124
|
Kotlin | [kotlin-libui](https://github.com/msink/kotlin-libui)
|
|
111
125
|
Lua | [libuilua](https://github.com/zevv/libuilua), [libui-lua](https://github.com/mdombroski/libui-lua), [lui](http://tset.de/lui/index.html), [lui](https://github.com/zhaozg/lui)
|
|
112
|
-
Nim | [ui](https://github.com/nim-lang/ui)
|
|
126
|
+
Nim | [ui](https://github.com/nim-lang/ui), [uing](https://github.com/neroist/uing)
|
|
113
127
|
Perl6 | [perl6-libui](https://github.com/Garland-g/perl6-libui)
|
|
114
|
-
PHP | [ui](https://github.com/krakjoe/ui)
|
|
128
|
+
PHP | [ui](https://github.com/krakjoe/ui), [Ardillo](https://github.com/ardillo-php/ext)
|
|
115
129
|
Python | [pylibui](https://github.com/joaoventura/pylibui)
|
|
116
130
|
Ring | [RingLibui](https://github.com/ring-lang/ring/tree/master/extensions/ringlibui)
|
|
117
131
|
Ruby | [libui-ruby](https://github.com/jamescook/libui-ruby), [LibUI](https://github.com/kojix2/libui), [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
|
118
|
-
Rust | [libui-ng-sys](https://github.com/norepimorphism/libui-ng-sys), [boing](https://github.com/norepimorphism/boing), [libui-rs](https://github.com/rust-native-ui/libui-rs)
|
|
132
|
+
Rust | [libui-ng-sys](https://github.com/norepimorphism/libui-ng-sys), [boing](https://github.com/norepimorphism/boing), [libui-rs](https://github.com/rust-native-ui/libui-rs), [libui](https://github.com/libui-rs/libui)
|
|
119
133
|
Scala | [scalaui](https://github.com/lolgab/scalaui)
|
|
120
134
|
Swift | [libui-swift](https://github.com/sclukey/libui-swift)
|
|
121
135
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kojix2
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: fiddle
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
14
26
|
email:
|
|
15
27
|
- 2xijok@gmail.com
|
|
16
28
|
executables: []
|
|
@@ -20,21 +32,25 @@ files:
|
|
|
20
32
|
- LICENSE.txt
|
|
21
33
|
- README.md
|
|
22
34
|
- lib/libui.rb
|
|
35
|
+
- lib/libui/error.rb
|
|
23
36
|
- lib/libui/ffi.rb
|
|
24
37
|
- lib/libui/fiddle_patch.rb
|
|
25
38
|
- lib/libui/libui_base.rb
|
|
39
|
+
- lib/libui/platform.rb
|
|
26
40
|
- lib/libui/utils.rb
|
|
27
41
|
- lib/libui/version.rb
|
|
28
42
|
- vendor/LICENSE.md
|
|
29
43
|
- vendor/README.md
|
|
30
|
-
- vendor/libui.
|
|
31
|
-
- vendor/libui.dylib
|
|
32
|
-
- vendor/libui.
|
|
44
|
+
- vendor/libui.aarch64.so
|
|
45
|
+
- vendor/libui.arm64.dylib
|
|
46
|
+
- vendor/libui.x64.dll
|
|
47
|
+
- vendor/libui.x86.dll
|
|
48
|
+
- vendor/libui.x86_64.dylib
|
|
49
|
+
- vendor/libui.x86_64.so
|
|
33
50
|
homepage: https://github.com/kojix2/libui
|
|
34
51
|
licenses:
|
|
35
52
|
- MIT
|
|
36
53
|
metadata: {}
|
|
37
|
-
post_install_message:
|
|
38
54
|
rdoc_options: []
|
|
39
55
|
require_paths:
|
|
40
56
|
- lib
|
|
@@ -42,15 +58,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
42
58
|
requirements:
|
|
43
59
|
- - ">="
|
|
44
60
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: '2.
|
|
61
|
+
version: '2.6'
|
|
46
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
63
|
requirements:
|
|
48
64
|
- - ">="
|
|
49
65
|
- !ruby/object:Gem::Version
|
|
50
66
|
version: '0'
|
|
51
67
|
requirements: []
|
|
52
|
-
rubygems_version: 3.
|
|
53
|
-
signing_key:
|
|
68
|
+
rubygems_version: 3.6.9
|
|
54
69
|
specification_version: 4
|
|
55
70
|
summary: Ruby bindings to libui
|
|
56
71
|
test_files: []
|
data/vendor/libui.dll
DELETED
|
Binary file
|
data/vendor/libui.dylib
DELETED
|
Binary file
|
data/vendor/libui.so
DELETED
|
Binary file
|