1
0
Fork 0
Commit graph

97 commits

Author SHA1 Message Date
Robbert van der Helm
f2ca0ffa6d Support horizontal scrolling on Windows 2022-11-22 15:42:10 +01:00
Robbert van der Helm
5b57af2463 Add the active modifiers to the mouse event
This would solve the most important use case for . Only the Linux
version has been tested, but the Windows should work perfectly fine, and
I don't know anything about macOS programming but that version also
compiles so it should be fine.
2022-03-11 22:28:42 +01:00
Robbert van der Helm
ba442a4382 Fix overlapping cell borrows in Windows impl
b4a3d2bb04 missed some immutable borrows,
but these borrows need to be local anyways because of the way the
closing is implemented.
2022-02-10 03:14:01 +01:00
Robbert van der Helm
43860aba84 Fix a whackton of warnings and clippy lints
The things remaining are all of the cursor things in the X11
implementation (there's _a lot_ of it, so there's probably a reason why
it's all still there but unused), and the super unsound immutable
reference to mutable reference cast in the macOS implementation that
Clippy automatically errors out on.
2022-02-07 23:10:53 +01:00
Robbert van der Helm
fe107ab378 Implement the OpenGL context on Windows 2022-02-07 22:36:37 +01:00
Robbert van der Helm
b4a3d2bb04 Add stubs for creating OpenGL contexts
There are now three todo!()s when compiling with the OpenGL flag that
need to be filled in, with the only nontrivial one being the X11
version.
2022-02-07 19:00:48 +01:00
Robbert van der Helm
d76b02df44 Upgrade to raw-window-handle 0.4.x
The main change is that all of these types are simplified, there are
more different OS-specific window handle types, and they are no longer
gated behind the respective targets which makes the library a bit easier
to use for applications.
2022-02-07 17:13:51 +01:00
Billy Messenger
f6e99e9aa6
add ability to close window from user code, add HostWindowHandle ()
* add ability to close window from user code, add HostWindowHandle

* fix manual close method for Mac, rename HostWindowHandle to ChildWindowHandle

* fix rustfmt.toml and run cargo format

* fix merge conflict mistake

* fix more merge conflict mistakes

* implement requested changes (with a non-broken commit this time)

* implement requested changes

* slight reordering of impls
2021-11-16 00:00:22 -06:00
Pedro Tacla Yamada
2a894c6bc9
Run cargo fmt on source files ()
* Run cargo fmt on source files

* Update with rustfmt.toml

* Change rustfmt configuration and run it again
2021-11-10 00:57:54 -06:00
DGriffin91
6bfcfbb74d add scrollwheel support for windows 2021-10-09 16:52:56 -07:00
Billy Messenger
ae2f28c5fd add window resizing and dpi scaling support in Windows 2021-07-14 19:32:28 -05:00
micah
ef27adeda1 add window argument to WindowHandler::on_frame() 2021-01-27 02:13:08 -05:00
micah
36e4474c8a separate Window::open() into three functions (parented, as_if_parented, and blocking) 2021-01-01 22:52:59 -06:00
micah
86bf222601 PhantomData<*mut ()> in Window to ensure it is !Send 2021-01-01 22:52:59 -06:00
Micah Johnston
868bd0583c cleanup on window destroyed (free WindowHandler, unregister wndclass) 2020-12-23 16:26:17 -06:00
Micah Johnston
d138cfaccf treat WM_MOUSEMOVE coordinates as i16 to handle negative coordinates properly 2020-12-20 15:36:03 -06:00
George Atkinson
cc6ead3669 Fixed a bug causing 'already borrowed' error
Fixed a bug where an 'already borrowed' arror would occur when pressing keyboard keys in quick succession. Moving the borrow and borrow_mut of the window state inside the button down/up event seems to fix this.
2020-12-20 15:26:41 -06:00
George Atkinson
9fdb75155d
Added mouse capture/release to windows backend ()
* Added mouse capture/release to windows backend

* Mouse capture now automatic only

Removed manual ability to trigger mouse capture and release.

* Added refcount for mouse button event

Added refcount to prevent the mouse capture from releasing before all mouse buttons have been released.

* Removed unnecessary function from window
2020-12-19 17:41:40 -06:00
Micah Johnston
c64b2257f5 use W variants of winapi functions 2020-12-19 15:33:29 -06:00
Micah Johnston
e02854452e remove WindowHandle 2020-12-12 17:15:09 -06:00
Micah Johnston
4e70af1162 store WindowHandler as trait object to reduce generics in winapi backend 2020-12-12 17:12:24 -06:00
Micah Johnston
8402310c88 remove Message api 2020-12-12 17:06:50 -06:00
Micah Johnston
cd0d5215d0 remove unused code from windows backend 2020-12-12 17:06:50 -06:00
Micah Johnston
7ff31ea6f7 ensure title lives long enough to pass it to CreateWindowEx; also validate it as a CString 2020-12-08 23:16:34 -06:00
Micah Johnston
30c34db12e set default arrow cursor on window class rather than null 2020-12-07 01:16:08 -06:00
Micah Johnston
2faea075b1 call on_frame on WM_TIMER events 2020-12-07 01:03:55 -06:00
Micah Johnston
365cc8c018 allow DefWindowProc to be called in the case of WM_PAINT 2020-12-07 01:03:55 -06:00
Micah Johnston
ab0cb10a22 call DefWindowProc in the case of WM_SYSKEYDOWN. makes alt-f4 work.
if we call DefWindowProc for non-system events, pressing alt or f10 puts
focus on the (nonexistent) dropdown menu until the next click or
keystroke, so we only call it in the case of WM_SYSKEYDOWN.
2020-12-07 01:03:41 -06:00
Joakim Frostegård
35a03aff17 Split off AppRunner from WindowHandle on Windows and Linux 2020-12-04 20:03:55 +01:00
Micah Johnston
3f34a70fa8 windows mouse events 2020-11-30 10:10:40 -06:00
glowcoil
3db2bdee17
Merge pull request from greatest-ape/windows-keyboard
Add windows keyboard event support with druid code
2020-11-28 18:23:02 -06:00
Joakim Frostegård
1ddd6fa47e api unification: return shared WindowHandle in platform code 2020-11-24 20:41:55 +01:00
Joakim Frostegård
a8c7c707d2 unify platforms: simplify imports 2020-11-23 22:26:27 +01:00
Joakim Frostegård
185bd62447 api unification: make cross-platform Window hold a reference 2020-11-23 22:09:33 +01:00
Joakim Frostegård
f9226c366e platform api unification: support Windows 2020-11-23 20:26:17 +01:00
Joakim Frostegård
bdd0f8f562 Add windows keyboard event support with code from druid 2020-11-23 08:43:09 +01:00
Joakim Frostegård
0a6a0bdffd Use keyboard_types::KeyboardEvent directly instead of wrapping it 2020-11-14 17:46:12 +01:00
Billy Messenger
2096c37495 rename UseScaleFactor to ScaleFactor 2020-10-20 19:11:47 -05:00
Billy Messenger
579dfee1eb clean up dpi features 2020-10-20 19:02:45 -05:00
Billy Messenger
2ee975231b fix Windows build 2020-10-20 17:04:37 -05:00
Billy Messenger
61ef63409b Merge branch 'master' of https://github.com/RustAudio/baseview into master 2020-10-20 15:56:54 -05:00
William Light
cf96f3cc85 win/mac: closure for building WindowHandler 2020-10-20 21:33:57 +02:00
Billy Messenger
a91a5a1126 update x11 code 2020-10-17 17:36:28 -05:00
Billy Messenger
688d45c720 refactor to use conversion between Point and Size to PhyPoint and PhySize 2020-10-17 17:27:06 -05:00
Billy Messenger
6bae3e7507 Fix window_state pointer 2020-10-17 16:47:36 -05:00
Billy Messenger
11ee384908 fix windows build 2020-10-17 15:19:06 -05:00
William Light
ac0e1215f7 fix syntax error 2020-09-12 19:16:45 +02:00
William Light
29461b14e4 replace *mut c_void with RawWindowHandle in Parent::WithParent 2020-09-12 19:06:21 +02:00
William Light
bb18518cf6 fix some rustfmt annoyances 2020-09-11 22:29:29 +02:00
Billy Messenger
cc2ae0ef39 rebase, cargo fmt 2020-09-11 12:38:06 -05:00