Commit Graph

228 Commits

Author SHA1 Message Date
June Tate-Gans
9c0a27e724 Remove the old LICENSE file. 2021-05-08 22:58:52 -05:00
June Tate-Gans
8eb613dad2 Remove a ton of unused stuff
Since the migration to the G13 Configurator for everything, most of these files
have literally no use anymore. We can safely remove them from the project at
this point.
2021-05-08 19:49:27 -05:00
June Tate-Gans
ff25e01694 Migrate g13gui out of the g13gui subdir
The whole project at this point is entirely python, with no g13d present
anywhere, so let's clean up the tree somewhat and make it flatter.
2021-05-08 19:47:35 -05:00
June Tate-Gans
6380b02b32 ui: Make ProfileCombobox use changeTriggers 2021-05-08 19:28:34 -05:00
June Tate-Gans
c98bc506e2 g13: Change Manager's name to DeviceManager 2021-05-08 19:28:07 -05:00
June Tate-Gans
8390c065fe displaydevice: Ensure we start the DBus loop for DeviceManager 2021-05-08 19:27:46 -05:00
June Tate-Gans
83f124bc9c displaydevice: Split update from _pushFrame
This allows loopbackdisplaydevice to function.
2021-05-08 19:27:26 -05:00
June Tate-Gans
18e536d7f7 applets: Add in the framework for Applets!
This allows us to have separate applications from the G13 Configurator render to
the G13's display, just like the way Logitech's design worked. It even includes
an applet switcher, and an example clock applet.

There's quite a few deficiencies in this model, not the least of which is the
fact that we're using dbus-python as the main communications channel. Things
that are broken include:

  - We can't tell when an applet dies except when we fail a call.
  - Applets have to be running at the same time G13 Configurator is to handle
    the initial register call.

We can likely deal with these somehow using DBus signals.
2021-05-08 19:25:05 -05:00
June Tate-Gans
81be3f2cf9 main: Migrate to the Application model
We weren't registering with dbus or the session manager before, so migrating to
Application as our base really really helps with duplicate launches.
2021-05-08 19:23:14 -05:00
June Tate-Gans
841ad65b89 observer: Subject incorrectly notified based on variable names 2021-05-08 19:22:08 -05:00
June Tate-Gans
7945f9d246 g13: Applet buttons aren't "special" keys 2021-05-08 19:20:17 -05:00
June Tate-Gans
519945edbf bitwidgets: Changed the DISPLAY_HEIGHT to the correct value
This took some experimentation to verify it was actually correct.
2021-05-08 19:19:48 -05:00
June Tate-Gans
60d58e8392 bitwidgets: New widgets!
This adds a whole new ListView widget (and associated ListItem widget) so that
we can handle selecting items from a list. Additionally, it brings in rectangle
tests, and sadly removes the nice rounded rectangle from its design.

  - The button module gained a Glyph widget, and Buttons are now composites
    containing both a Rectangle and a Glyph.
  - ButtonBar has been fixed to match the above Button change, which produces a
    much more correct layout of glyphs and their drawing inside of each
    ButtonBar slot.
  - Added a Button test for Glyphs.
  - Made X11DisplayDevice update its output window name when it's assigned to,
    making it possible for each test to indicate which test it belongs to.
  - Created ListView and ListItem.
  - Made Widget not use its accessors for its constructor, which would create a
    ton of erronous observer events down the chain.
  - Made some of Widget's setters ValueErrors more specific.
2021-05-08 19:15:15 -05:00
June Tate-Gans
5cc4e81dd5 saving: Re-add preferences saving to disk
At this point, functionality is nearly the same as what we had before I started
the migration away from g13d. We can now save prefs to disk! The next trick is
to make sure that the backlighting works, and I think we can call that the next
version, and maybe tag it for a alpha release.
2021-05-04 02:20:34 -05:00
June Tate-Gans
83483aa7a3 appindicator: Make the appindicator the root of the app
This reorganizes the ownership of the main window under the control of the
appindicator. It also adds some additional flags in prefs to allow for disabling
the opening of the main window on startup, and removes a bunch of cruft from
main.
2021-05-04 02:06:19 -05:00
June Tate-Gans
69151a450b manager: Setup as an observer
It would make sense that when the profile changes that the manager should
automatically reconfigure for the new profile. This changes the Manager into an
Observer and registers for profile and LCD color changes.
2021-05-04 01:43:32 -05:00
June Tate-Gans
f5e881f0fa bindingprofile: lcdColor is a property, fix it 2021-05-04 01:43:00 -05:00
June Tate-Gans
17350fa524 bindingprofile: Remove a bunch of (now) worthless methods
We no longer need to serialize to g13d command strings.
2021-05-04 01:42:38 -05:00
June Tate-Gans
ccca4b5016 ui: Add changeTriggers to complete the migration to them 2021-05-04 01:41:56 -05:00
June Tate-Gans
aecf1d0644 popover: Fix a bunch of things to be accessors now. 2021-05-04 01:41:14 -05:00
June Tate-Gans
a28a90f37b mainwindow: Fix the names of the analog stick buttons 2021-05-03 18:16:34 -05:00
June Tate-Gans
244368ede3 g13buttonpopover: Read from evdev to capture keys
Since GDK/GTK filter events through Xorg, libinput, and everything else in
between, we can't use their keypress detection code to actually figure out what
the linux key codes are, instead we read directly from all keyboard-like evdev
devices on the system.

This is less than ideal, but directly due to Linux/Xorg/libinput/XKB/GDK/GTK/GNOME's
completely batshit insane input model. On Wayland it gets better, but not by
much since most compositors still use XKB and libinput.

*sigh*
2021-05-03 18:14:32 -05:00
June Tate-Gans
240be20b63 g13button: Swap out the old notification mechanism for triggers
This is a bit cleaner, overall, but also this makes key binding in the UI
actually work again.
2021-05-03 18:12:51 -05:00
June Tate-Gans
003ab3b526 observer: Coerce scalar values in keys to sets
Unfortunately, strings are iterable in python, so without this a call with a
single string, or a construct of "('foo')" would result in creating keys for
each letter of the string 'foo'. "('foo',)" works, because , creates the tuple,
not the parens...
2021-05-03 18:11:28 -05:00
June Tate-Gans
4d11270a7c main: Since we use lots of crazy threads, ensure GDK is ready 2021-05-03 18:10:56 -05:00
June Tate-Gans
ce8a106ea3 input: Restructure to use GObject and io_watches
This isn't ideal, since opening all of the devices in /dev/input is slow, and
this runs on the UI thread, but it works for now. Ultimately, InputReader should
probably be restructured as a threading.Thread and use GLib.idle_add to send the
signals out.
2021-05-03 18:09:08 -05:00
June Tate-Gans
65c2580e45 manager: Use the key name, rather than its number
This allows us to be a bit more flexible in the way we define bindings. We still
have to use the scancodes for the actual bindings (since we're outputting to
uinput), but this should be a little easier to digest.

...also it fixed a bug... =op
2021-05-03 18:08:11 -05:00
June Tate-Gans
6ddee4ae88 g13gui: Actually finish the migration
Add an evdev listener for input so we can use linux "keysyms" for keyboard
events, since uinput uses it.
2021-05-02 23:48:52 -05:00
June Tate-Gans
0a0ecfc9bc observer: Finish migrating Subject 2021-05-02 23:48:20 -05:00
June Tate-Gans
9a9f504995 g13gui: bindings: Setup preliminaries for keycode decoding 2021-05-02 23:47:54 -05:00
June Tate-Gans
8a6fc4b0f0 g13gui: manager: Ensure both the header and buffer are bytes 2021-05-02 23:47:25 -05:00
June Tate-Gans
054d31033f g13gui: Rework the observer model
Subject was large enough to be in its own file.
2021-05-02 23:46:55 -05:00
June Tate-Gans
b3d0cb5f21 g13d: Remove the last few bits of g13d from the tree 2021-05-02 16:25:25 -05:00
June Tate-Gans
f4daed3148 g13d: Kill off the old daemon
We no longer need this -- g13gui.g13 does everything and more.
2021-05-02 16:23:37 -05:00
June Tate-Gans
8ebe1e2fc2 g13gui: bitwidgets: Add in button tests 2021-05-02 15:24:13 -05:00
June Tate-Gans
493206d552 g13gui: g13: Add a bitwidgets backend for displaying to the G13 2021-05-02 15:23:07 -05:00
June Tate-Gans
186f64c33f g13gui: observer: Add a helpful method for misnamed calls 2021-05-02 15:22:43 -05:00
June Tate-Gans
dfe9713011 g13gui: g13: Fix the header to be a series of bytes 2021-05-02 15:22:25 -05:00
June Tate-Gans
caa316c850 g13gui: bitwidgets: Fix a few bugs in widget 2021-05-02 15:22:08 -05:00
June Tate-Gans
5f5b1e0879 g13gui: bitwidgets: Make the buttonbar visible 2021-05-02 15:21:45 -05:00
June Tate-Gans
513928e57e g13gui: bitwidgets: Fix the naming of showAll 2021-05-02 15:21:26 -05:00
June Tate-Gans
95822a273d g13gui: bitwidgets: Adding a Rectangle class
So we can draw nice looking rects with curvy corners.
2021-05-02 15:00:02 -05:00
June Tate-Gans
e71d621ff7 g13gui: bitwidgets: Major work
This adds a whole bunch of tests and additional widgets we can use to draw up
interfaces on the g13's LCD. It also abstracts the backend a bit so we can draw
to X11 rather than a g13.

  - Added a Button and ButtonBar class so we can start making use of those great
    L* buttons
  - Added a Label class so we can stick text all over the screen
  - Added a Screen class to abstract away common display elements such as the
    button bar, as well as send along the next frame to the display.
  - Created the Widget class to make a lot of common boilerplate code live
    somewhere useful.
  - Added X11DisplayDevice so we can test on desktops without needing a G13.
2021-05-02 14:57:31 -05:00
June Tate-Gans
f257d8f11d g13gui: Add a toplevel unittest module
This gives us a one-stop-shop for running unit tests.
2021-05-02 12:52:37 -05:00
June Tate-Gans
32776db309 g13gui: Fix imports 2021-05-02 12:51:32 -05:00
June Tate-Gans
d2881a0e6e g13gui: Make observers use setProperty and properties
This makes them behave in a much more pythonic way.
2021-05-02 12:50:29 -05:00
June Tate-Gans
6daf662698 g13gui: First draft of the g13 manager
This is based upon most of the code written in g13d's device and manager classes
as a means to actually "manage" the g13 itself from the GUI. This eliminates the
silly daemon, fifos, bad protocol design, and overall a whole slew of security
issues.
2021-05-02 12:49:12 -05:00
June Tate-Gans
f9264c390e g13gui: Prep for the great g13d removal
Our key binds will now use actual key codes from evdev instead of using made up
key symbol names from G13D. This results in a *major* change, of which this is
just the start. Effectively, we're going to move away from using the old and
crufty g13d for everything, and just write our own g13 manager instead.
2021-05-02 12:47:54 -05:00
June Tate-Gans
dd21f7fb96 g13gui: Add a missing import 2021-05-02 12:46:30 -05:00
June Tate-Gans
861a85b1f0 g13gui: move _bindKey down 2021-05-02 12:46:11 -05:00