Skip to content

leds: Separate single color from multicolor leds

Guido Gunther requested to merge guido.gunther/feedbackd:led-class into main

Turn the FbdDevLed into a class and allow FbdDevMulticolor to derive form it. This avoids special cases for the later.

The order of things is as follows:

  • move FbdDevLed to a separate file
  • encapsulte FbdDevLed attributes until we can make the struct opaque
  • turn FbdDevLed into GObject
  • Make FbdDevLed a GInitable so initialization can fail without having all in fbd_dev_led_new () (thus making things harder for derived classes)
  • Add a minimal set of class methods with a default implementation (that still doesn't change the way things work)
  • Extract multicolor specific bits into a derived class thus making the default implementations simpler

I haven't yet tested the multicolor bits on a multicolor led system but single color still works as expected. I'll give this a second pass to cleanup some details but wanted to get this out so !100 can move forward.

Edited by Guido Gunther

Merge request reports