-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into x11-split-event-loop
- Loading branch information
Showing
13 changed files
with
153 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
name: Rust | ||
|
||
on: [push, pull_request] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUSTFLAGS: -D warnings | ||
RUSTDOCFLAGS: -D warnings | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Install XCB and GL dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libx11-xcb-dev libxcb-dri2-0-dev libgl1-mesa-dev libxcb-icccm4-dev libxcursor-dev | ||
if: contains(matrix.os, 'ubuntu') | ||
run: sudo apt-get install libx11-dev libxcb1-dev libx11-xcb-dev libgl1-mesa-dev | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Build with default features | ||
run: cargo build --examples --workspace --verbose | ||
- name: Build again with all features | ||
run: cargo build --examples --workspace --all-features --verbose | ||
components: rustfmt, clippy | ||
- name: Build Default | ||
run: cargo build --workspace --all-targets --verbose | ||
- name: Build All Features | ||
run: cargo build --workspace --all-targets --all-features --verbose | ||
- name: Run tests | ||
run: cargo test --examples --workspace --all-features --verbose | ||
run: cargo test --workspace --all-targets --all-features --verbose | ||
- name: Check docs | ||
run: cargo doc --examples --all-features --no-deps | ||
- name: Clippy | ||
run: cargo clippy --workspace --all-targets --all-features -- -D warnings | ||
- name: Check Formatting (rustfmt) | ||
run: cargo fmt --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
msrv = '1.59' | ||
check-private-items = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use crate::MouseCursor; | ||
use winapi::{ | ||
shared::ntdef::LPCWSTR, | ||
um::winuser::{ | ||
IDC_APPSTARTING, IDC_ARROW, IDC_CROSS, IDC_HAND, IDC_HELP, IDC_IBEAM, IDC_NO, IDC_SIZEALL, | ||
IDC_SIZENESW, IDC_SIZENS, IDC_SIZENWSE, IDC_SIZEWE, IDC_WAIT, | ||
}, | ||
}; | ||
|
||
pub fn cursor_to_lpcwstr(cursor: MouseCursor) -> LPCWSTR { | ||
match cursor { | ||
MouseCursor::Default => IDC_ARROW, | ||
MouseCursor::Hand => IDC_HAND, | ||
MouseCursor::HandGrabbing => IDC_SIZEALL, | ||
MouseCursor::Help => IDC_HELP, | ||
// an empty LPCWSTR results in the cursor being hidden | ||
MouseCursor::Hidden => std::ptr::null(), | ||
|
||
MouseCursor::Text => IDC_IBEAM, | ||
MouseCursor::VerticalText => IDC_IBEAM, | ||
|
||
MouseCursor::Working => IDC_WAIT, | ||
MouseCursor::PtrWorking => IDC_APPSTARTING, | ||
|
||
MouseCursor::NotAllowed => IDC_NO, | ||
MouseCursor::PtrNotAllowed => IDC_NO, | ||
|
||
MouseCursor::ZoomIn => IDC_ARROW, | ||
MouseCursor::ZoomOut => IDC_ARROW, | ||
|
||
MouseCursor::Alias => IDC_ARROW, | ||
MouseCursor::Copy => IDC_ARROW, | ||
MouseCursor::Move => IDC_SIZEALL, | ||
MouseCursor::AllScroll => IDC_SIZEALL, | ||
MouseCursor::Cell => IDC_CROSS, | ||
MouseCursor::Crosshair => IDC_CROSS, | ||
|
||
MouseCursor::EResize => IDC_SIZEWE, | ||
MouseCursor::NResize => IDC_SIZENS, | ||
MouseCursor::NeResize => IDC_SIZENESW, | ||
MouseCursor::NwResize => IDC_SIZENWSE, | ||
MouseCursor::SResize => IDC_SIZENS, | ||
MouseCursor::SeResize => IDC_SIZENWSE, | ||
MouseCursor::SwResize => IDC_SIZENESW, | ||
MouseCursor::WResize => IDC_SIZEWE, | ||
MouseCursor::EwResize => IDC_SIZEWE, | ||
MouseCursor::NsResize => IDC_SIZENS, | ||
MouseCursor::NwseResize => IDC_SIZENWSE, | ||
MouseCursor::NeswResize => IDC_SIZENESW, | ||
|
||
MouseCursor::ColResize => IDC_SIZEWE, | ||
MouseCursor::RowResize => IDC_SIZENS, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod cursor; | ||
mod drop_target; | ||
mod keyboard; | ||
mod window; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters