autogui 1.0.0 → 1.0.1
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/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/autogui/platform/darwin.rb +2 -0
- data/lib/autogui/platform/linux.rb +2 -0
- data/lib/autogui/platform/windows.rb +9 -3
- data/lib/autogui/platform.rb +12 -0
- data/lib/autogui/version.rb +1 -1
- data/lib/autogui/window.rb +2 -0
- data/lib/autogui.rb +1 -42
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a127667e017faf9fbe1e753ed2e7f3f798d962c956d8cfedc9608ca87eac67e6
|
|
4
|
+
data.tar.gz: 0a1d1c83c364c68145bb792b7c36f5dc2a5d57378f23bf5c56314fa5b170be75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86b02a48de330d63b52eda854a792344631d2387be99faa5d2b26e4945b2acb8eb2c1bdce9ff803cb8e5ef1ddb0209af4c822369fb22de3516ee3e9c2e787b33
|
|
7
|
+
data.tar.gz: 343aa3597a505ed1a498b68cbbc3f12ce6f95a253da50be820329aeb524575f0b2bc80ffd0ca1199d7e07ed703a2452fe8df9f927f730f2204fd274207115fbb
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.1] — 2026-09-04
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Windows `AutoGUI.alert` / `confirm` no longer raise `Encoding::CompatibilityError` when concatenating a UTF-16LE string with a binary null terminator.
|
|
13
|
+
- `module_function` aliases are promoted on `AutoGUI`, window helpers, and platform modules. This restores `resolution`, snake_case window APIs, and `vscroll`.
|
|
14
|
+
- Windows window titles decode from the returned UTF-16 length instead of stripping NUL bytes from a padded buffer.
|
|
15
|
+
|
|
8
16
|
## [1.0.0] — 2026-09-03
|
|
9
17
|
|
|
10
18
|
### Added
|
data/README.md
CHANGED
|
@@ -279,8 +279,12 @@ module AutoGUI
|
|
|
279
279
|
return "" if len <= 0
|
|
280
280
|
|
|
281
281
|
buf = "\x00".b * ((len + 1) * 2)
|
|
282
|
-
GetWindowTextW(hwnd, buf, len + 1)
|
|
283
|
-
|
|
282
|
+
copied = GetWindowTextW(hwnd, buf, len + 1)
|
|
283
|
+
return "" if copied <= 0
|
|
284
|
+
|
|
285
|
+
buf.byteslice(0, copied * 2)
|
|
286
|
+
.force_encoding("UTF-16LE")
|
|
287
|
+
.encode("UTF-8", invalid: :replace, undef: :replace)
|
|
284
288
|
end
|
|
285
289
|
|
|
286
290
|
def window_rect(hwnd)
|
|
@@ -393,8 +397,10 @@ module AutoGUI
|
|
|
393
397
|
end
|
|
394
398
|
|
|
395
399
|
def wide(str)
|
|
396
|
-
|
|
400
|
+
str.to_s.encode("UTF-16LE").b + "\x00\x00".b
|
|
397
401
|
end
|
|
402
|
+
|
|
403
|
+
Platform.copy_aliases!(self)
|
|
398
404
|
end
|
|
399
405
|
end
|
|
400
406
|
end
|
data/lib/autogui/platform.rb
CHANGED
|
@@ -4,6 +4,18 @@ require "rbconfig"
|
|
|
4
4
|
|
|
5
5
|
module AutoGUI
|
|
6
6
|
module Platform
|
|
7
|
+
# `module_function` copies each `def` to the singleton class, but not later
|
|
8
|
+
# `alias` names. Promote any instance method that is still missing there.
|
|
9
|
+
def self.copy_aliases!(mod)
|
|
10
|
+
names = (mod.private_instance_methods(false) + mod.instance_methods(false)).uniq
|
|
11
|
+
names.each do |name|
|
|
12
|
+
sc = mod.singleton_class
|
|
13
|
+
next if sc.method_defined?(name) || sc.private_method_defined?(name)
|
|
14
|
+
|
|
15
|
+
mod.send(:module_function, name)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
7
19
|
module_function
|
|
8
20
|
|
|
9
21
|
def current
|
data/lib/autogui/version.rb
CHANGED
data/lib/autogui/window.rb
CHANGED
data/lib/autogui.rb
CHANGED
|
@@ -684,48 +684,7 @@ module AutoGUI
|
|
|
684
684
|
@log_screenshot_filenames << filename
|
|
685
685
|
end
|
|
686
686
|
|
|
687
|
-
|
|
688
|
-
# subsequent `alias` names. Re-alias them on the singleton class.
|
|
689
|
-
class << self
|
|
690
|
-
{
|
|
691
|
-
get_point_on_line: :getPointOnLine,
|
|
692
|
-
fail_safe_check: :failSafeCheck,
|
|
693
|
-
use_image_not_found_exception!: :useImageNotFoundException,
|
|
694
|
-
on_screen: :onScreen,
|
|
695
|
-
valid_key?: :isValidKey,
|
|
696
|
-
is_valid_key: :isValidKey,
|
|
697
|
-
mouse_down: :mouseDown,
|
|
698
|
-
mouse_up: :mouseUp,
|
|
699
|
-
left_click: :leftClick,
|
|
700
|
-
right_click: :rightClick,
|
|
701
|
-
middle_click: :middleClick,
|
|
702
|
-
double_click: :doubleClick,
|
|
703
|
-
triple_click: :tripleClick,
|
|
704
|
-
move_to: :moveTo,
|
|
705
|
-
move_rel: :moveRel,
|
|
706
|
-
move: :moveRel,
|
|
707
|
-
drag_to: :dragTo,
|
|
708
|
-
drag_rel: :dragRel,
|
|
709
|
-
drag: :dragRel,
|
|
710
|
-
key_down: :keyDown,
|
|
711
|
-
key_up: :keyUp,
|
|
712
|
-
write: :typewrite,
|
|
713
|
-
shortcut: :hotkey,
|
|
714
|
-
grab: :screenshot,
|
|
715
|
-
locate_on_screen: :locateOnScreen,
|
|
716
|
-
locate_all_on_screen: :locateAllOnScreen,
|
|
717
|
-
locate_center_on_screen: :locateCenterOnScreen,
|
|
718
|
-
locate_all: :locateAll,
|
|
719
|
-
locate_on_window: :locateOnWindow,
|
|
720
|
-
pixel_matches_color: :pixelMatchesColor,
|
|
721
|
-
mouse_info: :mouseInfo,
|
|
722
|
-
display_mouse_position: :displayMousePosition,
|
|
723
|
-
print_info: :printInfo,
|
|
724
|
-
get_info: :getInfo
|
|
725
|
-
}.each do |snake, camel|
|
|
726
|
-
alias_method snake, camel if method_defined?(camel) || private_method_defined?(camel)
|
|
727
|
-
end
|
|
728
|
-
end
|
|
687
|
+
Platform.copy_aliases!(self)
|
|
729
688
|
end
|
|
730
689
|
|
|
731
690
|
begin
|