1
0
Fork 0
Commit graph

411 commits

Author SHA1 Message Date
Micah Johnston 0cbcf989df remove print on unhandled event (produces too much spam) 2020-12-03 23:05:51 -06:00
Micah Johnston 3f34a70fa8 windows mouse events 2020-11-30 10:10:40 -06:00
glowcoil 3db2bdee17
Merge pull request #57 from greatest-ape/windows-keyboard
Add windows keyboard event support with druid code
2020-11-28 18:23:02 -06:00
glowcoil 307e82c7b2
Merge pull request #59 from greatest-ape/unify-platforms
Unify platform APIs with wrapper Window and WindowHandle
2020-11-28 11:58:15 -06:00
Joakim Frostegård dd87afefd9 api unification: impl HasRawWindowHandle on wrapper Window 2020-11-27 00:34:09 +01: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 6450bff368 api unification: add Linux support 2020-11-23 22:24:25 +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 4ba64d8f86 Add cross-platform Window wrapper, currently only macOS support 2020-11-23 20:05:36 +01:00
Joakim Frostegård ff09c3a256
macOS: add timer triggering WindowHandler::on_frame (#58)
* macOS: add simple NSTimer that triggers WindowHandler::on_frame

* macOS: invalidate frame timer when releasing view

* macOS: clean up
2020-11-23 14:38:32 +01:00
Joakim Frostegård 06578c64c9 README: mark basic event handling as working on Windows 2020-11-23 08:44:11 +01:00
Joakim Frostegård bdd0f8f562 Add windows keyboard event support with code from druid 2020-11-23 08:43:09 +01:00
william light 726632624c
README.md: we do in fact have parent window support on Linux 2020-11-16 22:08:16 +01:00
william light 808094db22
Merge pull request #56 from greatest-ape/macos-keyboard
Add support for macOS and X11 key events with code from druid
2020-11-14 18:03:09 +01:00
Joakim Frostegård 71b27cf473 README: fix error in milestone checkmarks 2020-11-14 17:46:50 +01:00
Joakim Frostegård d36f289663 README: mark events and parenting as solved for macOS and Linux 2020-11-14 17:46:50 +01:00
Joakim Frostegård f8c994a23c README: add Linux installation prerequisites 2020-11-14 17:46:50 +01:00
Joakim Frostegård dd3f85b347 Cargo.toml: set default-features = false for keyboard-types 2020-11-14 17:46:12 +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
william light 24d063ba26
Merge pull request #55 from greatest-ape/license
Add license statement and files (dual MIT or Apache 2.0)
2020-11-14 17:43:11 +01:00
Joakim Frostegård e569015c31 Add license statement and files (dual MIT or Apache 2.0) 2020-11-12 21:52:49 +01:00
Joakim Frostegård 2167a091fa
macOS: basic event handling (#52)
* macOS: add basic event handling

* macos: don't store subview pointer in WindowHandle

* macOS: mention inspiration from antonok's vst_window crate, clean up

* Add Anton Lazarev and myself to author list

* macOS: fix event handling issues

- Rename EventDelegate to WindowState
- Make Window.ns_window optional, only set it if parentless
- Put our own NSView subclass in Window.ns_view
- Don't create useless "intermediate" NSView in parentless mode

* macOS: use Arc::from_raw in WindowHandler dealloc fn

* macOS: move subview code own file, handle more mouse events

* macOS: add (non-tested) support for AsIfParented window

* macOS: rename subview module to view

* macOS: rename "mouse_click_extern_fn!" to "mouse_button_extern_fn!"

This avoids confusion with the click event

* macOS: make WindowState Arc wrapping code clearer

* macOS: handle basic key press and release events

* macOS: accept mouseMoved events, don't trigger them on clicks

* macOS: fix cursor movement location conversion

* macOS: add WindowState.trigger_event fn, make fields private

* macOS: in view, set preservesContentInLiveResize to NO

* macOS: add NSTrackingArea, cursor enter/exit events, better window init

* macOS: remove unused WindowState.size field

* macOS: acceptFirstMouse = YES in view

* macOS: rename macro mouse_button_extern_fn to mouse_simple_extern_fn

* macOS: remove key event handling, it will be implemented differently

* macOS: trigger CursorMoved on right and middle mouse drag

* macOS: run NSEvent.setMouseCoalescingEnabled(NO)

* macOS: clean up

* macOS: non-parented mode: don't "activate ignoring other apps"

This is rarely necessary according to
https://developer.apple.com/documentation/appkit/nsapplication/1428468-activate
and I don't see any reason why we would need to do it.

* macOS: call NSApp() before doing more work in non-parented mode

* macOS: don't attempt to declare NSView subclass multiple times

* macOS: add random suffix to name of NSView subclass to prevent issues

* macOS: send tracking area options as a usize (objc UInt)

* macOS: use UUID for class name suffix

* macOS: fix view_will_move_to_window super call

* macOS: drop WindowState when our NSView is released

* macOS: in Window::open, autorelease an NSString that was allocated

* macOS: delete our view class when the view is released

* Upgrade cocoa dependency to version 0.24.0

* macOS: reorder some code in view.rs

* macOS: mark WindowState::from_field as unsafe, update doc comment

* macOS: in HasRawWindowHandle impl, use unwrap_or for ns_window
2020-11-11 16:04:40 -06:00
william light cd5c91f8a8
Merge pull request #50 from BillyDM/master
Clean up dpi features
2020-10-21 02:25:53 +02:00
Billy Messenger 7904ed77e1 reword comment 2020-10-20 19:18:42 -05:00
Billy Messenger b2146908cc add comments to size 2020-10-20 19:17:20 -05:00
Billy Messenger 2096c37495 rename UseScaleFactor to ScaleFactor 2020-10-20 19:11:47 -05:00
Billy Messenger 42e8ea6bef fix mac build 2020-10-20 19:05:49 -05:00
Billy Messenger 579dfee1eb clean up dpi features 2020-10-20 19:02:45 -05:00
william light b57fd5db85
Merge pull request #48 from BillyDM/master
Add UI scaling support
2020-10-21 00:41:26 +02:00
Billy Messenger b0196b8c5f attempt to fix mac build 2020-10-20 17:09:59 -05:00
Billy Messenger 84cac3e7ba attempt to fix mac build 2020-10-20 17:07:37 -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 e3171da665
Merge pull request #49 from RustAudio/build-closure
replace `WindowHandler::build()` with closure passed to `Window::open()`
2020-10-20 21:42:59 +02:00
William Light cf96f3cc85 win/mac: closure for building WindowHandler 2020-10-20 21:33:57 +02: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 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 5866bf372e fix window_info_from_scale 2020-10-17 15:42:16 -05:00
Billy Messenger 3fca9d3c78 remove #[repr(C)] as it did not work 2020-10-17 15:23:24 -05:00
Billy Messenger 11ee384908 fix windows build 2020-10-17 15:19:06 -05:00
Billy Messenger dc5d3b9622 Add Point and Size structs 2020-10-17 14:01:03 -05:00