bubblezone 0.1.0-aarch64-linux-gnu
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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +370 -0
- data/bubblezone.gemspec +39 -0
- data/ext/bubblezone/extconf.rb +65 -0
- data/ext/bubblezone/extension.c +107 -0
- data/ext/bubblezone/extension.h +36 -0
- data/ext/bubblezone/manager.c +127 -0
- data/ext/bubblezone/zone_info.c +100 -0
- data/go/bubblezone.go +369 -0
- data/go/build/linux_arm64/libbubblezone.a +0 -0
- data/go/build/linux_arm64/libbubblezone.h +114 -0
- data/go/go.mod +28 -0
- data/go/go.sum +47 -0
- data/lib/bubblezone/3.2/bubblezone.so +0 -0
- data/lib/bubblezone/3.3/bubblezone.so +0 -0
- data/lib/bubblezone/3.4/bubblezone.so +0 -0
- data/lib/bubblezone/4.0/bubblezone.so +0 -0
- data/lib/bubblezone/manager.rb +56 -0
- data/lib/bubblezone/version.rb +5 -0
- data/lib/bubblezone/zone_info.rb +25 -0
- data/lib/bubblezone.rb +59 -0
- metadata +84 -0
data/go/go.mod
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module github.com/marcoroth/bubblezone-ruby/go
|
|
2
|
+
|
|
3
|
+
go 1.23.0
|
|
4
|
+
|
|
5
|
+
require github.com/lrstanley/bubblezone v1.0.0
|
|
6
|
+
|
|
7
|
+
require (
|
|
8
|
+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
|
9
|
+
github.com/charmbracelet/bubbletea v1.3.4 // indirect
|
|
10
|
+
github.com/charmbracelet/colorprofile v0.3.1 // indirect
|
|
11
|
+
github.com/charmbracelet/lipgloss v1.1.0 // indirect
|
|
12
|
+
github.com/charmbracelet/x/ansi v0.8.0 // indirect
|
|
13
|
+
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
|
|
14
|
+
github.com/charmbracelet/x/term v0.2.1 // indirect
|
|
15
|
+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
|
16
|
+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
|
17
|
+
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
18
|
+
github.com/mattn/go-localereader v0.0.1 // indirect
|
|
19
|
+
github.com/mattn/go-runewidth v0.0.16 // indirect
|
|
20
|
+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
|
21
|
+
github.com/muesli/cancelreader v0.2.2 // indirect
|
|
22
|
+
github.com/muesli/termenv v0.16.0 // indirect
|
|
23
|
+
github.com/rivo/uniseg v0.4.7 // indirect
|
|
24
|
+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
|
25
|
+
golang.org/x/sync v0.13.0 // indirect
|
|
26
|
+
golang.org/x/sys v0.32.0 // indirect
|
|
27
|
+
golang.org/x/text v0.24.0 // indirect
|
|
28
|
+
)
|
data/go/go.sum
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
|
2
|
+
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
|
3
|
+
github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI=
|
|
4
|
+
github.com/charmbracelet/bubbletea v1.3.4/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
|
|
5
|
+
github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
|
|
6
|
+
github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
|
|
7
|
+
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
|
|
8
|
+
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
|
|
9
|
+
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
|
|
10
|
+
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
|
|
11
|
+
github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
|
|
12
|
+
github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
|
|
13
|
+
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
|
|
14
|
+
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
|
|
15
|
+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
|
|
16
|
+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
|
|
17
|
+
github.com/lrstanley/bubblezone v1.0.0 h1:bIpUaBilD42rAQwlg/4u5aTqVAt6DSRKYZuSdmkr8UA=
|
|
18
|
+
github.com/lrstanley/bubblezone v1.0.0/go.mod h1:kcTekA8HE/0Ll2bWzqHlhA2c513KDNLW7uDfDP4Mly8=
|
|
19
|
+
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
|
20
|
+
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
|
21
|
+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
|
22
|
+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
|
23
|
+
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
|
24
|
+
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
|
|
25
|
+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
|
26
|
+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
|
27
|
+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
|
|
28
|
+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
|
|
29
|
+
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
|
|
30
|
+
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
|
|
31
|
+
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
|
|
32
|
+
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
|
|
33
|
+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
|
34
|
+
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
|
35
|
+
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
|
36
|
+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
|
|
37
|
+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
|
|
38
|
+
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
|
|
39
|
+
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
|
40
|
+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
|
|
41
|
+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
42
|
+
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
43
|
+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
44
|
+
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
|
45
|
+
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
46
|
+
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
|
47
|
+
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bubblezone
|
|
4
|
+
class Manager
|
|
5
|
+
def zone_ids_set
|
|
6
|
+
@zone_ids_set ||= Set.new
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def zone_ids_mutex
|
|
10
|
+
@zone_ids_mutex ||= Mutex.new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
alias _native_mark mark
|
|
14
|
+
|
|
15
|
+
def mark(zone_id, text)
|
|
16
|
+
zone_ids_mutex.synchronize { zone_ids_set.add(zone_id) }
|
|
17
|
+
_native_mark(zone_id, text)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
alias _native_clear clear
|
|
21
|
+
|
|
22
|
+
def clear(zone_id)
|
|
23
|
+
zone_ids_mutex.synchronize { zone_ids_set.delete(zone_id) }
|
|
24
|
+
_native_clear(zone_id)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def clear_all
|
|
28
|
+
zone_ids_mutex.synchronize do
|
|
29
|
+
zone_ids_set.each { |id| _native_clear(id) }
|
|
30
|
+
zone_ids_set.clear
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def zone_ids
|
|
35
|
+
zone_ids_mutex.synchronize { zone_ids_set.to_a }
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def each_in_bounds(x, y)
|
|
39
|
+
return enum_for(:each_in_bounds, x, y) unless block_given?
|
|
40
|
+
|
|
41
|
+
ids = zone_ids_mutex.synchronize { zone_ids_set.to_a.sort }
|
|
42
|
+
ids.each do |id|
|
|
43
|
+
zone = get(id)
|
|
44
|
+
yield(id, zone) if zone&.in_bounds?(x, y)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def any_in_bounds?(x, y)
|
|
49
|
+
each_in_bounds(x, y).any?
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def find_in_bounds(x, y)
|
|
53
|
+
each_in_bounds(x, y).first
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bubblezone
|
|
4
|
+
class ZoneInfo
|
|
5
|
+
def width
|
|
6
|
+
end_x - start_x + 1
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def height
|
|
10
|
+
end_y - start_y + 1
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def size
|
|
14
|
+
[width, height]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def to_s
|
|
18
|
+
"ZoneInfo(start: (#{start_x}, #{start_y}), end: (#{end_x}, #{end_y}))"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def inspect
|
|
22
|
+
"#<#{self.class} start_x=#{start_x} start_y=#{start_y} end_x=#{end_x} end_y=#{end_y}>"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/bubblezone.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "bubblezone/version"
|
|
4
|
+
require_relative "bubblezone/bubblezone"
|
|
5
|
+
require_relative "bubblezone/manager"
|
|
6
|
+
require_relative "bubblezone/zone_info"
|
|
7
|
+
|
|
8
|
+
module Bubblezone
|
|
9
|
+
class Error < StandardError; end
|
|
10
|
+
|
|
11
|
+
@global_zone_ids = Set.new
|
|
12
|
+
@global_zone_ids_mutex = Mutex.new
|
|
13
|
+
|
|
14
|
+
class << self
|
|
15
|
+
alias _native_mark mark
|
|
16
|
+
|
|
17
|
+
def mark(zone_id, text)
|
|
18
|
+
@global_zone_ids_mutex.synchronize { @global_zone_ids.add(zone_id) }
|
|
19
|
+
_native_mark(zone_id, text)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
alias _native_clear clear
|
|
23
|
+
|
|
24
|
+
def clear(zone_id)
|
|
25
|
+
@global_zone_ids_mutex.synchronize { @global_zone_ids.delete(zone_id) }
|
|
26
|
+
_native_clear(zone_id)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def clear_all
|
|
30
|
+
@global_zone_ids_mutex.synchronize do
|
|
31
|
+
@global_zone_ids.each { |id| _native_clear(id) }
|
|
32
|
+
@global_zone_ids.clear
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def zone_ids
|
|
37
|
+
@global_zone_ids_mutex.synchronize { @global_zone_ids.to_a }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def each_in_bounds(x, y)
|
|
41
|
+
return enum_for(:each_in_bounds, x, y) unless block_given?
|
|
42
|
+
|
|
43
|
+
ids = @global_zone_ids_mutex.synchronize { @global_zone_ids.to_a.sort }
|
|
44
|
+
|
|
45
|
+
ids.each do |id|
|
|
46
|
+
zone = get(id)
|
|
47
|
+
yield(id, zone) if zone&.in_bounds?(x, y)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def any_in_bounds?(x, y)
|
|
52
|
+
each_in_bounds(x, y).any?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def find_in_bounds(x, y)
|
|
56
|
+
each_in_bounds(x, y).first
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: bubblezone
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: aarch64-linux-gnu
|
|
6
|
+
authors:
|
|
7
|
+
- Marco Roth
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rake-compiler
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '1.2'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '1.2'
|
|
26
|
+
description: Ruby bindings for the bubblezone, providing zone management for terminal
|
|
27
|
+
applications with mouse support.
|
|
28
|
+
email:
|
|
29
|
+
- marco.roth@intergga.ch
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- LICENSE.txt
|
|
35
|
+
- README.md
|
|
36
|
+
- bubblezone.gemspec
|
|
37
|
+
- ext/bubblezone/extconf.rb
|
|
38
|
+
- ext/bubblezone/extension.c
|
|
39
|
+
- ext/bubblezone/extension.h
|
|
40
|
+
- ext/bubblezone/manager.c
|
|
41
|
+
- ext/bubblezone/zone_info.c
|
|
42
|
+
- go/bubblezone.go
|
|
43
|
+
- go/build/linux_arm64/libbubblezone.a
|
|
44
|
+
- go/build/linux_arm64/libbubblezone.h
|
|
45
|
+
- go/go.mod
|
|
46
|
+
- go/go.sum
|
|
47
|
+
- lib/bubblezone.rb
|
|
48
|
+
- lib/bubblezone/3.2/bubblezone.so
|
|
49
|
+
- lib/bubblezone/3.3/bubblezone.so
|
|
50
|
+
- lib/bubblezone/3.4/bubblezone.so
|
|
51
|
+
- lib/bubblezone/4.0/bubblezone.so
|
|
52
|
+
- lib/bubblezone/manager.rb
|
|
53
|
+
- lib/bubblezone/version.rb
|
|
54
|
+
- lib/bubblezone/zone_info.rb
|
|
55
|
+
homepage: https://github.com/marcoroth/bubblezone-ruby
|
|
56
|
+
licenses:
|
|
57
|
+
- MIT
|
|
58
|
+
metadata:
|
|
59
|
+
homepage_uri: https://github.com/marcoroth/bubblezone-ruby
|
|
60
|
+
source_code_uri: https://github.com/marcoroth/bubblezone-ruby
|
|
61
|
+
changelog_uri: https://github.com/marcoroth/bubblezone-ruby/releases
|
|
62
|
+
rubygems_mfa_required: 'true'
|
|
63
|
+
rdoc_options: []
|
|
64
|
+
require_paths:
|
|
65
|
+
- lib
|
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
|
+
requirements:
|
|
68
|
+
- - ">="
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: '3.2'
|
|
71
|
+
- - "<"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: 4.1.dev
|
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
|
+
requirements:
|
|
76
|
+
- - ">="
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: 3.3.22
|
|
79
|
+
requirements: []
|
|
80
|
+
rubygems_version: 4.0.3
|
|
81
|
+
specification_version: 4
|
|
82
|
+
summary: Ruby bindings for bubblezone, helper utility for BubbleTea, allowing easy
|
|
83
|
+
mouse event tracking.
|
|
84
|
+
test_files: []
|