New Gtk3 UI

From vice-emu
Jump to: navigation, search

New Gtk3 UI

This page is meant to keep track of development efforts on the new Gtk3 UI. Once the Gtk3 UI is the de-facto UI standard, this page can be (re)moved. For now, I'd like to keep it here so it can quickly be found.

Rationale

The how and why we go Gtk3 for *nix, Windows and OSX should be clear, but I'll reiterate: since we don't have any Windows or OSX maintainters left and failed to attract new ones, the decision was made to use Gtk3 as the new UI for 'modern' OSes.

Gtk3 is portable and widely supported and has a C interface. So we should be able to write the UI code once and have it run on our major platforms: Linux, Windows and OSX. Using GLib (a dependency of Gtk3) a lot of platform-dependent code in the UI can be avoided and many standard dialogs, such as open/save/select-dir need to written only once, Gtk3/GLib will handle most of the platform-dependent stuff.

Current development state

  • All emulators work, though some UI code still needs to be written or updated to properly support all machines
  • Default renderer is OpenGL 3.2 based (GTK 3.16 required) and does full HW scaling. Fallback renderer is Cairo-based, which will scale in software if necessary but slows down noticably when it does.
  • All UI code is hand-written, we tried using Glade/GtkBuilder, but the amount of machines and extra hardware VICE supports is way too much what a static UI can handle
  • Though many UI elements look okay, some don't. This isn't lazyness but rather to avoid tweaking the layout only to discover later that it still needs to be changed. So any layout/style issues will eventually get fixed. So don't complain about it, unless there are glaring bugs (such as dialogs that are too large to fit on a decent screen)
  • The developers currently working on Gtk3 are:
    • compyx - UI, archdep, documentation, bug fixes
    • McMartin - rendering backends, UI, archdep, bug fixes
    • loggedoubt - testing, bug fixes
    • groepaz - testing, monitor code, QA
    • blacky startdust - testing, build system, QA

BUGS/TODO

This is a list of things to do and bugs to fix. This is no way an exhaustive list, to get a better understanding of what needs to be fixed/altered, run this command inside VICE's top dir: grep -n 'FIXME\|TODO\|XXX' `find src/arch/gtk3 -name '*.c'`, and be amazed.

  • VSID: functionality is on par with Gtk2, but some extra stuff would be nice (see Stretch Goals)
  • Monitor support for Windows (2017-11-08)
    • it should work in the mingw console - what we really need is something like VTE that works everywhere Gpz (talk) 01:13, 17 November 2017 (CET)
  • Mouse-grab. The UI items is there, but the actual mouse code isn't implemented yet (2017-11-08)
  • The Tape Devices widget needs to check if resources can be set to avoid segfaults (2017-11-14)
  • Light pen support. (2017-11-15) Light pen support is now in. (McMartin 2018-02-13)
  • OpenGL
    • The OpenGL renderer should transform itself into a Cairo renderer if the system doesn't support OpenGL. (2017-11-15)
    • Do-not-scale option. Important for Cairo renderer, possible for OpenGL. (2017-11-15)
    • Stretch goal: the OpenGL renderer should fall back to legacy mode (the SDL renderer) if GTK3 itself has, instead of failing. (2017-11-15)
    • sometimes the window comes up with the menu- and statusbar being black, slightly resizing the window would fix it. perhaps related to grabbing the GL context at points it expects it to be somewhere else, and then its not "given back". So one possible fix would be to move all those operations into the 'realize' and 'render' signals. A patch has been implemented to "give back" any pre-existing context, which seems to influence normal screen updates. Further testing is required before this bug can be called definitely fixed. (2017-11-19)
      • still no dice. upstream bug? Gpz (talk) 23:16, 21 November 2017 (CET)
  • Settings
    • xpet: "model settings" widget is way too large, vertical space needs to be reduced drastically (2017-11-16) Fixed, but more glue logic is needed (2017-11-21)
    • On Windows (and perhaps OSX) the MIDI widget should show a combobox with supported drivers (2017-11-14)
    • ROM settings are missing (partially supported, needs work (2018-01-31)
    • CRT-emulation settings are missing (the sliders at the bottom in GTK2 UI). perhaps just move them into the regular settings
    • Activating the setting UI causes the emulator to un-pause
  • C64 Cartridge settings
    • cartridge images vs extra eeprom images are screwed up...
      • some of the cartridges have flash rom - this refers to the actual cartridge image. for this the filename can NOT be selected (MMC64 is an exception - perhaps we can even generally allow it for the others too). there is also "flush image" (button) "save image as" (browse button) and "update image on detach/quit" (checkbox)
      • only mmcr and gmod2 have an extra eeprom, for this only the filename can be selected (textfield, browse button), and there is a resource to make the eeprom read/write (checkbox)
        • in detail:
          • GMOD2 "GMod2FlashWrite" resource is related to the flash rom (actual cartridge image) and not the EEPROM. it should be moved further down on the page and the description should mention "flash image" to make clear its not related to the eeprom. also the "flush cartridge" and "save as" buttons should refer to the cartridge image (which is flash rom)
          • MMC64 - BIOS file selection is inactive when MMC64 is not enabled. this makes no sense, since in order to enable it, a BIOS file must be set. so always enable it :)
          • MMCR - cartridge image and EEPROM image is mixed up. only the filename selection is related to the EEPROM, the other stuff is related to the cartridge image/flash ROM. also "make eeprom read/write" checkbox is missing.
    • for those cartridges with an "enable cartridge" checkbox the logic is backwards, when the cartridge is disabled then the filename selection is disabled. it should be the other way around, when no filename is set, then the cartridge can not be enabled (but in order to enable it, a filename must be set)
      • IEEE-488 Cartridge
      • Magic Voice
    • I/O extensions to check for proper behaviour:
      • Memory Expansion Hack
      • GEO-RAM
      • RAM Expansion Module
      • RamCart
      • Double Quick Brown Box
      • Expert Cartridge
      • ISEPIC
      • EasyFlash
      • GMod2
      • IDE64 (this one is so 'special', I probably actually go it right --compyx)
      • MMC64
      • MMC Replay
      • Retro Replay
      • Super Snapshot V5
      • Ethernet Cartridge
      • RR-Net Mk3
      • IEEE-488 interface
      • Magic Voice
  • Menus
    • in the HELP menu the "browse documentation" item is non functional. we either need a portable solution, or use archdep code here
    • the debug menu is completely non functional
  • Dialogs
    • "File->Netplay" needs some testing and refactoring. perhaps move it into settings?
      • Work is under way in uinetplay_new.c, which mostly works but needs the client/server mapping of keyboard/joystick etc. And indeed moving into settings would be prefered (compyx, 2018-02-09)
  • Media recording
    • Implement audio recording and video recording (2017-12-17) -- Mostly implemented, what is missing is a 'stop recording' button on the status bar (compyx 2017-12-23)
    • MacOS: Add QuickTime recording settings widget, like the FFMPEG recording settings widget (I can't do this, someone with MacOS/QuickTime knowledge will have implement that compyx 2017-12-17)

Upstream bugs

  • Some combobox contents appear to have 'empty' entries and sometimes the colors of the items change (upstream Gtk3 bug) (2017-11-08)


misc

  • in xvic the joysticks do not work
    • the status bar shows two joysticks (it should show one) Between one and five joysticks will now be displayed depending on your configuration of the machine and user ports (McMartin 2018-02-13)

Feature requests / Stretch goals

  • Add some way to show the keycodes of the keys being pressed (perhaps in the status bar?) - that would make it a lot easier to fix/create keymaps
  • Add preview of the RAM init pattern (2017-11-08)
  • Add 'revert changes' to dialogs/widgets to revert resources to their state when the widget/dialog was activated. (This is different from restoring to factory defaults) (2017-11-16)
  • Add a 'smart' cartridge attach dialog: show "preview" of .crt image if selected in the dialog, show only valid cartridge types when selecting a cart image.
  • Implement a playlist for VSID
  • Add HVSC song length database support for VSID (both .txt and .md5 file formats)