libui 0.0.9 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/lib/libui/ffi.rb +32 -81
- data/lib/libui/fiddle_patch.rb +79 -0
- data/lib/libui/libui_base.rb +52 -0
- data/lib/libui/version.rb +1 -3
- data/lib/libui.rb +192 -46
- metadata +5 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6de141936b3efcb92a52161f0426d62485efe1e5aad3117f76cf97d0ddc8031b
|
4
|
+
data.tar.gz: b7ce62745c0c8dc93fc8ba0555a5240f0f56d73b68b6f6ba238153d6478d4f83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8caad6d8235897aa9b1c1c0782a425f85c4b7016d57464d69bfba9c3a1716eb5d3ea8520157ecc1a9209a299e863fc178c21897256e26e80b02a3beeff1be894
|
7
|
+
data.tar.gz: 2c328acfbc5862157124d6f31cf66950b07af1dacbbb81ee1f50340bb837bdb08e1d3b6abfaa9bfa5b8ecd81fe5e80a9d10e239c3489e534160ddb720135c502
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|

|
4
4
|
[](https://badge.fury.io/rb/libui)
|
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>
|
5
6
|
|
6
7
|
:radio_button: [libui](https://github.com/andlabs/libui) - a portable GUI library - for Ruby
|
7
8
|
|
@@ -64,11 +65,18 @@ Compared to original libui written in C,
|
|
64
65
|
* You can pass a block as a callback.
|
65
66
|
* The block will be converted to a Proc object and added to the last argument.
|
66
67
|
* Even in that case, it is possible to omit the last argument nil.
|
67
|
-
|
68
|
+
|
69
|
+
You can use [the documentation for libui's Go bindings](https://pkg.go.dev/github.com/andlabs/ui) as a reference.
|
70
|
+
|
68
71
|
### Not object oriented?
|
69
72
|
|
70
|
-
|
71
|
-
|
73
|
+
LibUI is not object-oriented, but provides high portability with minimal implementation.
|
74
|
+
If you want to write in an object-oriented way, please use the following DSLs built on top of LibUI.
|
75
|
+
|
76
|
+
### DSLs for LibUI
|
77
|
+
|
78
|
+
* [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
|
79
|
+
* [libui_paradise](https://rubygems.org/gems/libui_paradise)
|
72
80
|
|
73
81
|
### How to use fiddle pointers?
|
74
82
|
|
@@ -93,6 +101,8 @@ font_button = UI.new_font_button
|
|
93
101
|
|
94
102
|
# Allocate memory
|
95
103
|
font_descriptor = UI::FFI::FontDescriptor.malloc
|
104
|
+
font_descriptor.to_ptr.free = Fiddle::RUBY_FREE
|
105
|
+
# font_descriptor = UI::FFI::FontDescriptor.malloc(Fiddle::RUBY_FREE) # fiddle 1.0.1 or higher
|
96
106
|
|
97
107
|
UI.font_button_on_changed(font_button) do
|
98
108
|
UI.font_button_font(font_button, font_descriptor)
|
data/lib/libui/ffi.rb
CHANGED
@@ -1,78 +1,10 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require 'fiddle/import'
|
4
|
-
|
5
|
-
module Fiddle
|
6
|
-
# Change the Function to hold a little more information.
|
7
|
-
class Function
|
8
|
-
# Note:
|
9
|
-
# Ruby 2.7 Fiddle::Function dose not have @argument_types
|
10
|
-
# Ruby 3.0 Fiddle::Function has @argument_types
|
11
|
-
attr_accessor :callback_argument_types, :argument_types
|
12
|
-
end
|
13
|
-
|
14
|
-
module Importer
|
15
|
-
def parse_signature(signature, tymap = nil)
|
16
|
-
tymap ||= {}
|
17
|
-
ctype, func, args = case compact(signature)
|
18
|
-
when /^(?:[\w\*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
|
19
|
-
[TYPE_VOIDP, Regexp.last_match(1), Regexp.last_match(2)]
|
20
|
-
when /^([\w\*\s]+[*\s])(\w+)\((.*?)\);?$/
|
21
|
-
[parse_ctype(Regexp.last_match(1).strip, tymap), Regexp.last_match(2), Regexp.last_match(3)]
|
22
|
-
else
|
23
|
-
raise("can't parserake the function prototype: #{signature}")
|
24
|
-
end
|
25
|
-
symname = func
|
26
|
-
callback_argument_types = {} # Added
|
27
|
-
argtype = split_arguments(args).collect.with_index do |arg, idx| # Added with_index
|
28
|
-
# Check if it is a function pointer or not
|
29
|
-
if arg =~ /\(\*.*\)\(.*\)/ # Added
|
30
|
-
# From the arguments, create a notation that looks like a function declaration
|
31
|
-
# int(*f)(int *, void *) -> int f(int *, void *)
|
32
|
-
func_arg = arg.sub('(*', ' ').sub(')', '') # Added
|
33
|
-
# Use Fiddle's parse_signature method again.
|
34
|
-
callback_argument_types[idx] = parse_signature(func_arg) # Added
|
35
|
-
end
|
36
|
-
parse_ctype(arg, tymap)
|
37
|
-
end
|
38
|
-
# Added callback_argument_types. Original method return only 3 values.
|
39
|
-
[symname, ctype, argtype, callback_argument_types]
|
40
|
-
end
|
41
|
-
|
42
|
-
def extern(signature, *opts)
|
43
|
-
symname, ctype, argtype, callback_argument_types = parse_signature(signature, type_alias)
|
44
|
-
opt = parse_bind_options(opts)
|
45
|
-
func = import_function(symname, ctype, argtype, opt[:call_type])
|
46
|
-
|
47
|
-
func.callback_argument_types = callback_argument_types # Added
|
48
|
-
# Ruby 2.7 Fiddle::Function dose not have @argument_types
|
49
|
-
# Ruby 3.0 Fiddle::Function has @argument_types
|
50
|
-
func.argument_types = argtype
|
51
|
-
|
52
|
-
name = symname.gsub(/@.+/, '')
|
53
|
-
@func_map[name] = func
|
54
|
-
# define_method(name){|*args,&block| f.call(*args,&block)}
|
55
|
-
begin
|
56
|
-
/^(.+?):(\d+)/ =~ caller.first
|
57
|
-
file = Regexp.last_match(1)
|
58
|
-
line = Regexp.last_match(2).to_i
|
59
|
-
rescue StandardError
|
60
|
-
file, line = __FILE__, __LINE__ + 3
|
61
|
-
end
|
62
|
-
module_eval(<<-EOS, file, line)
|
63
|
-
def #{name}(*args, &block)
|
64
|
-
@func_map['#{name}'].call(*args,&block)
|
65
|
-
end
|
66
|
-
EOS
|
67
|
-
module_function(name)
|
68
|
-
func
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
2
|
+
require_relative 'fiddle_patch'
|
72
3
|
|
73
4
|
module LibUI
|
74
5
|
module FFI
|
75
6
|
extend Fiddle::Importer
|
7
|
+
extend FiddlePatch
|
76
8
|
|
77
9
|
begin
|
78
10
|
dlload LibUI.ffi_lib
|
@@ -100,6 +32,9 @@ module LibUI
|
|
100
32
|
'size_t Size'
|
101
33
|
]
|
102
34
|
|
35
|
+
# https://github.com/andlabs/libui/blob/master/ui.h
|
36
|
+
# keep same order
|
37
|
+
|
103
38
|
try_extern 'const char *uiInit(uiInitOptions *options)'
|
104
39
|
try_extern 'void uiUninit(void)'
|
105
40
|
try_extern 'void uiFreeInitError(const char *err)'
|
@@ -280,17 +215,33 @@ module LibUI
|
|
280
215
|
# uiDateTimePicker
|
281
216
|
|
282
217
|
# time.h
|
283
|
-
TM =
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
218
|
+
TM = if Fiddle::WINDOWS
|
219
|
+
struct [
|
220
|
+
'int tm_sec',
|
221
|
+
'int tm_min',
|
222
|
+
'int tm_hour',
|
223
|
+
'int tm_mday',
|
224
|
+
'int tm_mon',
|
225
|
+
'int tm_year',
|
226
|
+
'int tm_wday',
|
227
|
+
'int tm_yday',
|
228
|
+
'int tm_isdst'
|
229
|
+
]
|
230
|
+
else # The GNU C Library (glibc)
|
231
|
+
struct [
|
232
|
+
'int tm_sec',
|
233
|
+
'int tm_min',
|
234
|
+
'int tm_hour',
|
235
|
+
'int tm_mday',
|
236
|
+
'int tm_mon',
|
237
|
+
'int tm_year',
|
238
|
+
'int tm_wday',
|
239
|
+
'int tm_yday',
|
240
|
+
'int tm_isdst',
|
241
|
+
'long tm_gmtoff',
|
242
|
+
'const char *tm_zone'
|
243
|
+
]
|
244
|
+
end
|
294
245
|
|
295
246
|
try_extern 'void uiDateTimePickerTime(uiDateTimePicker *d, struct tm *time)'
|
296
247
|
try_extern 'void uiDateTimePickerSetTime(uiDateTimePicker *d, const struct tm *time)'
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module LibUI
|
2
|
+
module FiddlePatch
|
3
|
+
def parse_signature(signature, tymap = nil)
|
4
|
+
tymap ||= {}
|
5
|
+
ctype, func, args = case compact(signature)
|
6
|
+
when /^(?:[\w\*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
|
7
|
+
[TYPE_VOIDP, Regexp.last_match(1), Regexp.last_match(2)]
|
8
|
+
when /^([\w\*\s]+[*\s])(\w+)\((.*?)\);?$/
|
9
|
+
[parse_ctype(Regexp.last_match(1).strip, tymap), Regexp.last_match(2), Regexp.last_match(3)]
|
10
|
+
else
|
11
|
+
raise("can't parserake the function prototype: #{signature}")
|
12
|
+
end
|
13
|
+
symname = func
|
14
|
+
callback_argument_types = {} # Added
|
15
|
+
argtype = split_arguments(args).collect.with_index do |arg, idx| # Added with_index
|
16
|
+
# Check if it is a function pointer or not
|
17
|
+
if arg =~ /\(\*.*\)\(.*\)/ # Added
|
18
|
+
# From the arguments, create a notation that looks like a function declaration
|
19
|
+
# int(*f)(int *, void *) -> int f(int *, void *)
|
20
|
+
func_arg = arg.sub('(*', ' ').sub(')', '') # Added
|
21
|
+
# Use Fiddle's parse_signature method again.
|
22
|
+
callback_argument_types[idx] = parse_signature(func_arg) # Added
|
23
|
+
end
|
24
|
+
parse_ctype(arg, tymap)
|
25
|
+
end
|
26
|
+
# Added callback_argument_types. Original method return only 3 values.
|
27
|
+
[symname, ctype, argtype, callback_argument_types]
|
28
|
+
end
|
29
|
+
|
30
|
+
def extern(signature, *opts)
|
31
|
+
symname, ctype, argtype, callback_argument_types = parse_signature(signature, type_alias)
|
32
|
+
opt = parse_bind_options(opts)
|
33
|
+
func = import_function(symname, ctype, argtype, opt[:call_type])
|
34
|
+
|
35
|
+
# callback_argument_types
|
36
|
+
func.instance_variable_set(:@callback_argument_types,
|
37
|
+
callback_argument_types) # Added
|
38
|
+
# attr_reader
|
39
|
+
def func.callback_argument_types
|
40
|
+
@callback_argument_types
|
41
|
+
end
|
42
|
+
|
43
|
+
# argument_types
|
44
|
+
# Ruby 2.7 Fiddle::Function dose not have @argument_types
|
45
|
+
# Ruby 3.0 Fiddle::Function has @argument_types
|
46
|
+
if func.instance_variable_defined?(:@argument_types)
|
47
|
+
# check if @argument_types are the same
|
48
|
+
if func.instance_variable_get(:@argument_types) != argtype
|
49
|
+
warn "#{symname} func.argument_types:#{func.argument_types} != argtype #{argtype}"
|
50
|
+
end
|
51
|
+
else
|
52
|
+
func.instance_variable_set(:@argument_types, argtype)
|
53
|
+
end
|
54
|
+
# attr_reader
|
55
|
+
def func.argument_types
|
56
|
+
@argument_types
|
57
|
+
end
|
58
|
+
|
59
|
+
name = symname.gsub(/@.+/, '')
|
60
|
+
@func_map[name] = func
|
61
|
+
# define_method(name){|*args,&block| f.call(*args,&block)}
|
62
|
+
begin
|
63
|
+
/^(.+?):(\d+)/ =~ caller.first
|
64
|
+
file = Regexp.last_match(1)
|
65
|
+
line = Regexp.last_match(2).to_i
|
66
|
+
rescue StandardError
|
67
|
+
file, line = __FILE__, __LINE__ + 3
|
68
|
+
end
|
69
|
+
module_eval(<<-EOS, file, line)
|
70
|
+
def #{name}(*args, &block)
|
71
|
+
@func_map['#{name}'].call(*args,&block)
|
72
|
+
end
|
73
|
+
EOS
|
74
|
+
module_function(name)
|
75
|
+
func
|
76
|
+
end
|
77
|
+
end
|
78
|
+
private_constant :FiddlePatch
|
79
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module LibUI
|
2
|
+
module LibUIBase
|
3
|
+
FFI.func_map.each_key do |original_method_name|
|
4
|
+
name = Utils.convert_to_ruby_method(original_method_name)
|
5
|
+
func = FFI.func_map[original_method_name]
|
6
|
+
|
7
|
+
define_method(name) do |*args, &blk|
|
8
|
+
# Assume that block is the last argument.
|
9
|
+
args << blk if blk
|
10
|
+
|
11
|
+
# The proc object is converted to a Closure::BlockCaller object.
|
12
|
+
args.map!.with_index do |arg, idx|
|
13
|
+
next arg unless arg.is_a?(Proc)
|
14
|
+
|
15
|
+
# now arg must be Proc
|
16
|
+
|
17
|
+
# The types of the function arguments are stored in advance.
|
18
|
+
# See the monkey patch in ffi.rb.
|
19
|
+
_f, ret_type, arg_types = func.callback_argument_types[idx]
|
20
|
+
# TODO: raise some nice error if _f is nil.
|
21
|
+
|
22
|
+
callback = Fiddle::Closure::BlockCaller.new(
|
23
|
+
ret_type, arg_types, &arg
|
24
|
+
)
|
25
|
+
# Protect from GC
|
26
|
+
# by giving the owner object a reference to the callback.
|
27
|
+
# See https://github.com/kojix2/LibUI/issues/8
|
28
|
+
owner = if idx == 0 or # UI.queue_main{}
|
29
|
+
owner.frozen? # UI.timer(100) {}
|
30
|
+
LibUIBase # or UI is better?
|
31
|
+
else
|
32
|
+
args[0] # receiver
|
33
|
+
end
|
34
|
+
if owner.instance_variable_defined?(:@callbacks)
|
35
|
+
owner.instance_variable_get(:@callbacks) << callback
|
36
|
+
else
|
37
|
+
owner.instance_variable_set(:@callbacks, [callback])
|
38
|
+
end
|
39
|
+
callback
|
40
|
+
end
|
41
|
+
|
42
|
+
# Make it possible to omit the last nil. This may be an over-optimization.
|
43
|
+
siz = func.argument_types.size - 1
|
44
|
+
args[siz] = nil if args.size == siz
|
45
|
+
|
46
|
+
FFI.public_send(original_method_name, *args)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
private_constant :LibUIBase
|
52
|
+
end
|
data/lib/libui/version.rb
CHANGED
data/lib/libui.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require_relative 'libui/version'
|
4
2
|
require_relative 'libui/utils'
|
5
3
|
|
@@ -10,7 +8,7 @@ module LibUI
|
|
10
8
|
attr_accessor :ffi_lib
|
11
9
|
end
|
12
10
|
|
13
|
-
lib_name = "libui.#{RbConfig::CONFIG[
|
11
|
+
lib_name = "libui.#{RbConfig::CONFIG['SOEXT']}"
|
14
12
|
|
15
13
|
self.ffi_lib = if ENV['LIBUIDIR'] && !ENV['LIBUIDIR'].empty?
|
16
14
|
File.expand_path(lib_name, ENV['LIBUIDIR'])
|
@@ -19,56 +17,204 @@ module LibUI
|
|
19
17
|
end
|
20
18
|
|
21
19
|
require_relative 'libui/ffi'
|
20
|
+
require_relative 'libui/libui_base'
|
21
|
+
|
22
|
+
extend LibUIBase
|
22
23
|
|
23
24
|
class << self
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
define_method(name) do |*args, &blk|
|
29
|
-
# Assume that block is the last argument.
|
30
|
-
args << blk if blk
|
31
|
-
|
32
|
-
# The proc object is converted to a Closure::BlockCaller object.
|
33
|
-
args.map!.with_index do |arg, idx|
|
34
|
-
if arg.is_a?(Proc)
|
35
|
-
# The types of the function arguments are recorded beforehand.
|
36
|
-
# See the monkey patch in ffi.rb.
|
37
|
-
callback = Fiddle::Closure::BlockCaller.new(
|
38
|
-
*func.callback_argument_types[idx][1..2], &arg
|
39
|
-
)
|
40
|
-
# Protect from GC
|
41
|
-
# See https://github.com/kojix2/LibUI/issues/8
|
42
|
-
receiver = args[0]
|
43
|
-
if receiver.instance_variable_defined?(:@callbacks)
|
44
|
-
receiver.instance_variable_get(:@callbacks) << callback
|
45
|
-
else
|
46
|
-
receiver.instance_variable_set(:@callbacks, [callback])
|
47
|
-
end
|
48
|
-
callback
|
49
|
-
else
|
50
|
-
arg
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# Make it possible to omit the last nil. This may be an over-optimization.
|
55
|
-
siz = func.argument_types.size - 1
|
56
|
-
args[siz] = nil if args.size == siz
|
57
|
-
|
58
|
-
FFI.public_send(original_method_name, *args)
|
25
|
+
def init(opt = nil)
|
26
|
+
unless opt
|
27
|
+
opt = FFI::InitOptions.malloc
|
28
|
+
opt.to_ptr.free = Fiddle::RUBY_FREE
|
59
29
|
end
|
30
|
+
i = super(opt)
|
31
|
+
return if i.size.zero?
|
32
|
+
|
33
|
+
warn 'error'
|
34
|
+
warn UI.free_init_error(init)
|
60
35
|
end
|
61
36
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
37
|
+
def open_type_features_add(otf, a, b, c, d, value)
|
38
|
+
a, b, c, d = [a, b, c, d].map { |s| s.is_a?(String) ? s.ord : s }
|
39
|
+
super(otf, a, b, c, d, value)
|
40
|
+
end
|
66
41
|
|
67
|
-
|
68
|
-
|
69
|
-
|
42
|
+
def open_type_features_remove(otf, a, b, c, d)
|
43
|
+
a, b, c, d = [a, b, c, d].map { |s| s.is_a?(String) ? s.ord : s }
|
44
|
+
super(otf, a, b, c, d)
|
70
45
|
end
|
71
46
|
|
72
|
-
|
47
|
+
def open_type_features_get(otf, a, b, c, d, value)
|
48
|
+
a, b, c, d = [a, b, c, d].map { |s| s.is_a?(String) ? s.ord : s }
|
49
|
+
super(otf, a, b, c, d, value)
|
50
|
+
end
|
73
51
|
end
|
52
|
+
|
53
|
+
# UI_ENUM
|
54
|
+
# https://github.com/andlabs/libui/blob/master/ui.h
|
55
|
+
|
56
|
+
# ForEach
|
57
|
+
ForEachContinue = 0
|
58
|
+
ForEachStop = 1
|
59
|
+
|
60
|
+
# WindowResizeEdge
|
61
|
+
WindowResizeEdgeLeft = 0
|
62
|
+
WindowResizeEdgeTop = 1
|
63
|
+
WindowResizeEdgeRight = 2
|
64
|
+
WindowResizeEdgeBottom = 3
|
65
|
+
WindowResizeEdgeTopLeft = 4
|
66
|
+
WindowResizeEdgeTopRight = 5
|
67
|
+
WindowResizeEdgeBottomLeft = 6
|
68
|
+
WindowResizeEdgeBottomRight = 7
|
69
|
+
|
70
|
+
# DrawBrushType
|
71
|
+
DrawBrushTypeSolid = 0
|
72
|
+
DrawBrushTypeLinearGradient = 1
|
73
|
+
DrawBrushTypeRadialGradient = 2
|
74
|
+
DrawBrushTypeImage = 3
|
75
|
+
|
76
|
+
# DrawLineCap
|
77
|
+
DrawLineCapFlat = 0
|
78
|
+
DrawLineCapRound = 1
|
79
|
+
DrawLineCapSquare = 2
|
80
|
+
|
81
|
+
# DrawLineJoin
|
82
|
+
DrawLineJoinMiter = 0
|
83
|
+
DrawLineJoinRound = 1
|
84
|
+
DrawLineJoinBevel = 2
|
85
|
+
|
86
|
+
DrawDefaultMiterLimit = 10.0
|
87
|
+
|
88
|
+
# DrawFillMode
|
89
|
+
DrawFillModeWinding = 0
|
90
|
+
DrawFillModeAlternate = 1
|
91
|
+
|
92
|
+
# AttributeType
|
93
|
+
AttributeTypeFamily = 0
|
94
|
+
AttributeTypeSize = 1
|
95
|
+
AttributeTypeWeight = 2
|
96
|
+
AttributeTypeItalic = 3
|
97
|
+
AttributeTypeStretch = 4
|
98
|
+
AttributeTypeColor = 5
|
99
|
+
AttributeTypeBackground = 6
|
100
|
+
AttributeTypeUnderline = 7
|
101
|
+
AttributeTypeUnderlineColor = 8
|
102
|
+
AttributeTypeFeatures = 9
|
103
|
+
|
104
|
+
# TextWeight
|
105
|
+
TextWeightMinimum = 0
|
106
|
+
TextWeightThin = 100
|
107
|
+
TextWeightUltraLight = 200
|
108
|
+
TextWeightLight = 300
|
109
|
+
TextWeightBook = 350
|
110
|
+
TextWeightNormal = 400
|
111
|
+
TextWeightMedium = 500
|
112
|
+
TextWeightSemiBold = 600
|
113
|
+
TextWeightBold = 700
|
114
|
+
TextWeightUltraBold = 800
|
115
|
+
TextWeightHeavy = 900
|
116
|
+
TextWeightUltraHeavy = 950
|
117
|
+
TextWeightMaximum = 1000
|
118
|
+
|
119
|
+
# TextItalic
|
120
|
+
TextItalicNormal = 0
|
121
|
+
TextItalicOblique = 1
|
122
|
+
TextItalicItalic = 2
|
123
|
+
|
124
|
+
# TextStretch
|
125
|
+
TextStretchUltraCondensed = 0
|
126
|
+
TextStretchExtraCondensed = 1
|
127
|
+
TextStretchCondensed = 2
|
128
|
+
TextStretchSemiCondensed = 3
|
129
|
+
TextStretchNormal = 4
|
130
|
+
TextStretchSemiExpanded = 5
|
131
|
+
TextStretchExpanded = 6
|
132
|
+
TextStretchExtraExpanded = 7
|
133
|
+
TextStretchUltraExpanded = 8
|
134
|
+
|
135
|
+
# Underline
|
136
|
+
UnderlineNone = 0
|
137
|
+
UnderlineSingle = 1
|
138
|
+
UnderlineDouble = 2
|
139
|
+
UnderlineSuggestion = 3
|
140
|
+
|
141
|
+
# UnderlineColor
|
142
|
+
UnderlineColorCustom = 0
|
143
|
+
UnderlineColorSpelling = 1
|
144
|
+
UnderlineColorGrammar = 2
|
145
|
+
UnderlineColorAuxiliary = 3
|
146
|
+
|
147
|
+
# DrawTextAlign
|
148
|
+
DrawTextAlignLeft = 0
|
149
|
+
DrawTextAlignCenter = 1
|
150
|
+
DrawTextAlignRight = 2
|
151
|
+
|
152
|
+
# Modifiers
|
153
|
+
ModifierCtrl = (1 << 0)
|
154
|
+
ModifierAlt = (1 << 1)
|
155
|
+
ModifierShift = (1 << 2)
|
156
|
+
ModifierSuper = (1 << 3)
|
157
|
+
|
158
|
+
# ExtKey
|
159
|
+
ExtKeyEscape = 1
|
160
|
+
ExtKeyInsert = 2
|
161
|
+
ExtKeyDelete = 3
|
162
|
+
ExtKeyHome = 4
|
163
|
+
ExtKeyEnd = 5
|
164
|
+
ExtKeyPageUp = 6
|
165
|
+
ExtKeyPageDown = 7
|
166
|
+
ExtKeyUp = 8
|
167
|
+
ExtKeyDown = 9
|
168
|
+
ExtKeyLeft = 10
|
169
|
+
ExtKeyRight = 11
|
170
|
+
ExtKeyF1 = 12
|
171
|
+
ExtKeyF2 = 13
|
172
|
+
ExtKeyF3 = 14
|
173
|
+
ExtKeyF4 = 15
|
174
|
+
ExtKeyF5 = 16
|
175
|
+
ExtKeyF6 = 17
|
176
|
+
ExtKeyF7 = 18
|
177
|
+
ExtKeyF8 = 19
|
178
|
+
ExtKeyF9 = 20
|
179
|
+
ExtKeyF10 = 21
|
180
|
+
ExtKeyF11 = 22
|
181
|
+
ExtKeyF12 = 23
|
182
|
+
ExtKeyN0 = 24
|
183
|
+
ExtKeyN1 = 25
|
184
|
+
ExtKeyN2 = 26
|
185
|
+
ExtKeyN3 = 27
|
186
|
+
ExtKeyN4 = 28
|
187
|
+
ExtKeyN5 = 29
|
188
|
+
ExtKeyN6 = 30
|
189
|
+
ExtKeyN7 = 31
|
190
|
+
ExtKeyN8 = 32
|
191
|
+
ExtKeyN9 = 33
|
192
|
+
ExtKeyNDot = 34
|
193
|
+
ExtKeyNEnter = 35
|
194
|
+
ExtKeyNAdd = 36
|
195
|
+
ExtKeyNSubtract = 37
|
196
|
+
ExtKeyNMultiply = 38
|
197
|
+
ExtKeyNDivide = 39
|
198
|
+
|
199
|
+
# Align
|
200
|
+
AlignFill = 0
|
201
|
+
AlignStart = 1
|
202
|
+
AlignCenter = 2
|
203
|
+
AlignEnd = 3
|
204
|
+
|
205
|
+
# At
|
206
|
+
AtLeading = 0
|
207
|
+
AtTop = 1
|
208
|
+
AtTrailing = 2
|
209
|
+
AtBottom = 3
|
210
|
+
|
211
|
+
# TableValueType
|
212
|
+
TableValueTypeString = 0
|
213
|
+
TableValueTypeImage = 1
|
214
|
+
TableValueTypeInt = 2
|
215
|
+
TableValueTypeColor = 3
|
216
|
+
|
217
|
+
# editable
|
218
|
+
TableModelColumnNeverEditable = -1
|
219
|
+
TableModelColumnAlwaysEditable = -2
|
74
220
|
end
|
metadata
CHANGED
@@ -1,85 +1,15 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: minitest
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubyzip
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
83
13
|
description:
|
84
14
|
email:
|
85
15
|
- 2xijok@gmail.com
|
@@ -91,6 +21,8 @@ files:
|
|
91
21
|
- README.md
|
92
22
|
- lib/libui.rb
|
93
23
|
- lib/libui/ffi.rb
|
24
|
+
- lib/libui/fiddle_patch.rb
|
25
|
+
- lib/libui/libui_base.rb
|
94
26
|
- lib/libui/utils.rb
|
95
27
|
- lib/libui/version.rb
|
96
28
|
- vendor/LICENSE
|