Skip to content
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

Window class implementations for other platforms #35

Closed
drmfinlay opened this issue Sep 25, 2018 · 4 comments
Closed

Window class implementations for other platforms #35

drmfinlay opened this issue Sep 25, 2018 · 4 comments
Assignees
Labels
Enhancement Enhancement existing feature Linux/X11 Issue regarding Linux or X11 support MacOS Issue regarding Apple PC OS Windows Issues regarding Microsoft Windows OS

Comments

@drmfinlay
Copy link
Member

Re: cross-platform support (issue #8).

Dragonfly's Window class could be abstracted somewhat to have implementations for Windows, X11 and MacOS. from dragonfly import Window should import the implementation for the current platform. As with the cross-platform Clipboard class, implementations for other platforms can be in the dragonfly.util sub-package.

If this is done in dragonfly instead of in external projects such as Aenea, engine implementations can get the window context for supported platforms more easily. This should also make it relatively easy to implement dragonfly's WaitWindow, FocusWindow, StartApp and BringApp actions for supported platforms as they mostly just use the Window class in some way.

I think that python-xlib can be used to implement the Window class for X11. xdotool or xdo can be used instead if I'm wrong about that.

@wolfmanstout you may be interested in this for your Google engine.

@drmfinlay drmfinlay added Enhancement Enhancement existing feature Linux/X11 Issue regarding Linux or X11 support Windows Issues regarding Microsoft Windows OS MacOS Issue regarding Apple PC OS labels Sep 25, 2018
@wolfmanstout
Copy link
Contributor

Agreed, this would be very useful, and is something I bumped into with my Google engine. I would say more broadly that Dragonfly needs a cross-platform interface for everything including what is described here, plus mouse and keyboard input, and also accessibility-based control of applications. Basically, all interactions to and from the operating system UI. In principle, this is functionality that is not tied to speech recognition, so it could be in a separate project from Dragonfly, but it cannot be a project which depends on Dragonfly (e.g. Aenea). For now, to keep things simple, I think it makes sense to keep this functionality contained within Dragonfly, but to put it in modules such that if we ever wanted to spin it out, we could easily do so. And I think it certainly makes sense to build on top of other open source projects where available.

@drmfinlay
Copy link
Member Author

I've done a little research on this for MacOS. As I understand it, the accessibility APIs for MacOS are difficult to use from Python without knowledge of Objective-C. I was thinking that it would be easier to write a Swift command-line program using Swindler and/or AXSwift and use it from Python as a subprocess like xdotool.

This is also kind of related to #46.

@drmfinlay
Copy link
Member Author

The macOS Window class has now been implemented and will be released in the next version of dragonfly2. Wayland is the only other desktop platform that comes to mind, but I don't think we can implement a Window class for it.

@drmfinlay
Copy link
Member Author

I'm closing this now that Window classes for X11 (Linux) and macOS are now implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhancement existing feature Linux/X11 Issue regarding Linux or X11 support MacOS Issue regarding Apple PC OS Windows Issues regarding Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants