1
0
Fork 0
Commit graph

113 commits

Author SHA1 Message Date
Taylor Holliday
dbda356826 Use &str instead of String. 2023-02-22 10:14:54 -08:00
Taylor Holliday
2b70a08e14 Add stubs for copy_to_clipboard. 2023-02-21 17:09:17 -08:00
Robbert van der Helm
5a1bb0f4d8 Ensure WindowEvent::Resized fires for Linux resize 2022-12-02 20:17:11 +01:00
Robbert van der Helm
3dfff613b9 Use physical sizes in X11 window resize
And update the window info for any future events.
2022-11-30 20:03:12 +01:00
Robbert van der Helm
d61f21666c Add window resizing for X11 2022-11-30 20:03:12 +01:00
Robbert van der Helm
9798d3ca86 Support horizontal scrolling on X11
This was previously bound to the mouse forwards/back
buttons (canonically mouse 4 and 5).
2022-11-22 15:39:49 +01:00
Robbert van der Helm
025f34b80f Map mouse forward and back correctly on X11
Buttons 6 and 7 are for horizontal scrolling, just like buttons 4 and 5
are for vertical scrolling. I couldn't find a list of button numbers in
the X11 protocol specs, but this is what the buttons are bound to on my
Logitech G502 and
http://xahlee.info/linux/linux_x11_mouse_button_number.html also
confirms this.
2022-11-22 15:32:43 +01:00
Robbert van der Helm
13cc12d4e7 Ensure a consistent frame pacing in X11 windows
The next frame's time stamp needs to be computed based on the last
frame's, not based on the current time, unless the last frame took too
long to process.
2022-11-18 15:24:33 +01:00
Robbert van der Helm
5b57af2463 Add the active modifiers to the mouse event
This would solve the most important use case for #116. 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
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
2f7f177be8 Move RawWindowHandleWrapper to a shared module
We're going to need this for the other platforms as well.
2022-02-07 21:51:54 +01:00
Robbert van der Helm
3551d5e253 Implement OpenGL contexts for X11
This should in theory work! When requesting an OpenGL context, the
window visual is determined based on the matched framebuffer config.
2022-02-07 20:23:13 +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
Robbert van der Helm
625fde7957 Create X11 windows with a depth of 32-bits
This should fix the inability to create OpenGL contexts with alpha
channels in raw-gl-context, but it seems like that still needs a bit
more work.
2022-02-07 13:20:46 +01:00
Adrien Prokopowicz
89c051cccc
Add error checking on X11 window creation, and fix parented X11 window creation (#113) 2022-02-06 17:55:12 -06:00
Billy Messenger
f6e99e9aa6
add ability to close window from user code, add HostWindowHandle (#103)
* 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 (#106)
* 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
Billy Messenger
f7873f1854 typo 2021-07-14 11:45:06 -05:00
Billy Messenger
d316c6ae54 send initial window resized event in x11 2021-07-14 11:44:00 -05:00
Weird Constructor
50c41755fd
Fix: Check for remaining events in the internal X11/xcb buffers (#86)
* Fix: Check for remaining events in the internal X11/xcb buffers before going to sleep.

* Also need to set the queue owner to xcb as wrl suggested.
2021-03-04 11:00:42 -06:00
Joakim Frostegård
72b6a4a2d1
Support passing back some events to the platform (#90)
* Add mutable event status argument to WindowHandler::on_event

* macOS: simplify method declaration for simple mouse event handlers

* macOS: add macro for adding simple keyboard class methods

* macOS: reorder code in mouse_moved

* Take EventStatus as return value in WindowHandler::on_event

* Add doc comments for EventStatus

* Improve EventStatus documentation

* x11: ignore return value of on_event for now

* EventStatus: improve docs

* Improve EventsStatus docs

* Improve EventStatus docs further

* macOS: ignore EventStatus::Ignored for mouse events

* macOS: minor formatting improvement

* improve EventStatus docs again
2021-02-09 14:47:31 -06: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
043fe41d05 don't call on_frame on expose events in x11 backend 2020-12-19 15:43:53 -05:00
Micah Johnston
e02854452e remove WindowHandle 2020-12-12 17:15:09 -06:00
Micah Johnston
0633874266 pass WindowHandler as trait object in x11 backend 2020-12-12 17:12:24 -06:00
Micah Johnston
8402310c88 remove Message api 2020-12-12 17:06:50 -06:00
micah
08e56bd5ae remove unnecessary dependencies (log, libc) 2020-12-05 18:01:33 -06:00
Billy Messenger
f696c7d14d implement try_send_message for Linux 2020-12-04 15:29:55 -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
0cbcf989df remove print on unhandled event (produces too much spam) 2020-12-03 23:05:51 -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
6450bff368 api unification: add Linux support 2020-11-23 22:24:25 +01:00
Joakim Frostegård
0a6a0bdffd Use keyboard_types::KeyboardEvent directly instead of wrapping it 2020-11-14 17:46:12 +01:00
Joakim Frostegård
546b0d6eae Use keyboard-types types directly instead of druid wrappers 2020-11-14 17:46:12 +01:00
Joakim Frostegård
86b2aff624 Attempt to fix linux build 2020-11-14 17:46:12 +01:00
Joakim Frostegård
9748e16ebe Add support for macOS and X11 key events with code from druid 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
3fe752ca80 remove min/max resize policy 2020-10-20 16:06:40 -05:00
Billy Messenger
61ef63409b Merge branch 'master' of https://github.com/RustAudio/baseview into master 2020-10-20 15:56:54 -05:00
Billy Messenger
ad12985d08 put WindowHandle back into platform-specific code 2020-10-20 15:52:09 -05:00
William Light
43cdc39335 x11: closure for building WindowHandler 2020-10-20 21:33:52 +02:00
Billy Messenger
a91a5a1126 update x11 code 2020-10-17 17:36:28 -05:00
Billy Messenger
dc5d3b9622 Add Point and Size structs 2020-10-17 14:01:03 -05:00
Billy Messenger
1b9fbf9bb8 refactor and modify events 2020-10-17 13:35:39 -05:00