libui 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/libui/ffi.rb +27 -11
- data/lib/libui/version.rb +1 -1
- data/lib/libui.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f74d579c937d71a61c613abe93ca07ae1bafa8c78933d7cd4f979fc92b327883
|
4
|
+
data.tar.gz: f091c583e9fd5c53673232b4babc90f87c626a8185c4fcfb576ce9d89d36affa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8897e6b92a054070600be68a2f646e7b79468ace0ed6b6c0de4713a2b3cf8e7a72ef35e6934d72f1d31112778a6f948c49ca74130d805e189a72c448144fd35f
|
7
|
+
data.tar.gz: ad4f816e611238801cfefdbff60891f86703c92554fbca79691e4bcff1fd9a4dff45ebeabd78acd57aedaf56ff3f120b9cd16ca95788a469bb0cb58060194dcc
|
data/README.md
CHANGED
@@ -64,12 +64,17 @@ Compared to original libui written in C,
|
|
64
64
|
* You can pass a block as a callback.
|
65
65
|
* The block will be converted to a Proc object and added to the last argument.
|
66
66
|
* Even in that case, it is possible to omit the last argument nil.
|
67
|
-
|
67
|
+
|
68
|
+
You can use [the documentation for libui's Go bindings](https://pkg.go.dev/github.com/andlabs/ui) as a reference.
|
69
|
+
|
68
70
|
### Not object oriented?
|
69
71
|
|
70
72
|
* At the moment, it is not object-oriented.
|
71
73
|
* Instead of providing a half-baked object-oriented approach, leave it as is.
|
72
|
-
|
74
|
+
|
75
|
+
### DSLs for LibUI
|
76
|
+
* [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
77
|
+
* [libui_paradise](https://rubygems.org/gems/libui_paradise)
|
73
78
|
|
74
79
|
### How to use fiddle pointers?
|
75
80
|
|
@@ -94,6 +99,7 @@ font_button = UI.new_font_button
|
|
94
99
|
|
95
100
|
# Allocate memory
|
96
101
|
font_descriptor = UI::FFI::FontDescriptor.malloc
|
102
|
+
font_descriptor.to_ptr.free = Fiddle::RUBY_FREE
|
97
103
|
|
98
104
|
UI.font_button_on_changed(font_button) do
|
99
105
|
UI.font_button_font(font_button, font_descriptor)
|
data/lib/libui/ffi.rb
CHANGED
@@ -217,17 +217,33 @@ module LibUI
|
|
217
217
|
# uiDateTimePicker
|
218
218
|
|
219
219
|
# time.h
|
220
|
-
TM =
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
220
|
+
TM = if Fiddle::WINDOWS
|
221
|
+
struct [
|
222
|
+
'int tm_sec',
|
223
|
+
'int tm_min',
|
224
|
+
'int tm_hour',
|
225
|
+
'int tm_mday',
|
226
|
+
'int tm_mon',
|
227
|
+
'int tm_year',
|
228
|
+
'int tm_wday',
|
229
|
+
'int tm_yday',
|
230
|
+
'int tm_isdst'
|
231
|
+
]
|
232
|
+
else # The GNU C Library (glibc)
|
233
|
+
struct [
|
234
|
+
'int tm_sec',
|
235
|
+
'int tm_min',
|
236
|
+
'int tm_hour',
|
237
|
+
'int tm_mday',
|
238
|
+
'int tm_mon',
|
239
|
+
'int tm_year',
|
240
|
+
'int tm_wday',
|
241
|
+
'int tm_yday',
|
242
|
+
'int tm_isdst',
|
243
|
+
'long tm_gmtoff',
|
244
|
+
'const char *tm_zone'
|
245
|
+
]
|
246
|
+
end
|
231
247
|
|
232
248
|
try_extern 'void uiDateTimePickerTime(uiDateTimePicker *d, struct tm *time)'
|
233
249
|
try_extern 'void uiDateTimePickerSetTime(uiDateTimePicker *d, const struct tm *time)'
|
data/lib/libui/version.rb
CHANGED
data/lib/libui.rb
CHANGED
@@ -24,7 +24,11 @@ module LibUI
|
|
24
24
|
extend LibUIBase
|
25
25
|
|
26
26
|
class << self
|
27
|
-
def init(opt =
|
27
|
+
def init(opt = nil)
|
28
|
+
unless opt
|
29
|
+
opt = FFI::InitOptions.malloc
|
30
|
+
opt.to_ptr.free = Fiddle::RUBY_FREE
|
31
|
+
end
|
28
32
|
i = super(opt)
|
29
33
|
return if i.size.zero?
|
30
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|