Skip to content

Input/HookManager Rework #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3c9cd49
begin mockup
AustinJ235 Aug 21, 2022
6eb03bf
more mockup
AustinJ235 Aug 21, 2022
8cb5ea6
impl press
AustinJ235 Aug 21, 2022
7a13598
rearrange/refactor a bit
AustinJ235 Aug 21, 2022
0408ed6
impl release
AustinJ235 Aug 21, 2022
4658dea
construct new input
AustinJ235 Aug 21, 2022
96e232f
impl Focus/FocusLost on Bin
AustinJ235 Aug 22, 2022
a9ef43a
Hook.data -> Hook.state
AustinJ235 Aug 22, 2022
2c293fe
impl Focus/FocusLost on Window
AustinJ235 Aug 22, 2022
1b1f996
Prep for Cursor
AustinJ235 Aug 26, 2022
0813099
impl Enter/Leave on Bin
AustinJ235 Aug 26, 2022
c307090
impl Enter/Leave on Window
AustinJ235 Aug 26, 2022
6f029c0
remove submit step of builder
AustinJ235 Aug 26, 2022
75332d1
impl Cursor on Bin & Window
AustinJ235 Aug 26, 2022
6736aa4
introduce Interval
AustinJ235 Aug 27, 2022
547057c
Fix Last
AustinJ235 Aug 27, 2022
5b2c983
mockup Hold
AustinJ235 Aug 27, 2022
532d1fb
impl HoldBuilder
AustinJ235 Aug 27, 2022
5bdbaae
impl Hold on Bin & Window
AustinJ235 Aug 27, 2022
4c5aacc
impl Character on Window & Bin
AustinJ235 Aug 27, 2022
d8e2ea5
impl Scroll on Bin & Window
AustinJ235 Aug 28, 2022
2f616f5
impl Motion
AustinJ235 Aug 28, 2022
9cb3cef
Rearrage, Tweak, & Doc
AustinJ235 Aug 28, 2022
d08d9e9
Fix ScrollBar
AustinJ235 Aug 28, 2022
03ce720
Remove HookManager
AustinJ235 Aug 28, 2022
99e392d
Remove Input
AustinJ235 Aug 29, 2022
afe246f
Remove old Input
AustinJ235 Aug 29, 2022
d478ec6
Rename input_ref_v2() to input_ref()
AustinJ235 Sep 2, 2022
c0b6bdb
impl upper_blocks on Scroll
AustinJ235 Sep 2, 2022
6d2c425
add CHANGELOG entries
AustinJ235 Sep 3, 2022
0496463
Cleanup, make clippy happy
AustinJ235 Sep 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Unreleased

- **BREAKING** `Input` and `HookManager` (a.k.a. `BinHook`) have been rewritten/merged.
- As this is a rewrite, the design has changed greatly. Please refer to docs.
- Convenience methods on `Input` are now accessed on windows instead.
- For example a press can be added via `basalt.window().on_press(...)`.
- Convenience methods on `Bin` have had their named changed and some additional ones added.
- For example `bin.on_mouse_press(...)` is now `bin.on_press(...)`.
- More specific/customized hooks are created via builders accessed by `Input.hook()`.
- Hook method signatures have changed away from an enum style and now have specific signatures for each type of hook.
- Most data available for hooks is still available, but is accessed differently.
- `on_hold` is an exception where querying the cursor position, or any other window state, is no longer available.
- The concept of weights are now implemented.
- This allows hooks to be processed in certain order and block the calling of other hooks of the same class. Refer to the docs for more specfic details on how this system works.
- **BREAKING** `BinStyle.pass_events` is now removed.
- This has been removed in favor of the weight system.
- This was introduced originally as sort of hack for having scrollable content within other scrollable content.
- Specifically `InputScrollBuilder.upper_blocks(...)` replaces this hack.
- **BREAKING** `BinID` is now a concrete type instead of an alias.
- **BREAKING** `Interface.get_bin_id_atop(...)` and `Interface.get_bin_atop(...)` now additionally take a `BstWindowID`.
- Interface now has the methods `get_bins_atop(...)` and `get_bin_ids_atop` which function like their singular varients, but return a sorted `Vec` instead where the top most is first.
- New `Interval` system
- This system introduces the ability to run a hook on a specfic interval down to 1 ms of precision.
- The minimum resolution is platform/scheduler specific, but generally Windows is about 1.4ms and linux at 1 ms.
- The rewritten `Input` system utilizes this functionality with `on_hold` and `on_scroll`, *where smooth scrolling is enabled*, to provide more frequent and consistent intervals.

# Version 0.17.0 (August 19th, 2022)

- `Atlas` now internally uses the `guillotiere` crate for allocation.
Expand Down
1 change: 0 additions & 1 deletion src/atlas/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub struct ImageDims {
pub h: u32,
}


/// Image data used for `Image::new()`
#[derive(Clone)]
pub enum ImageData {
Expand Down
Loading