There are several main classes/objects in LyX that are not gui independant. Most of these classes will have an base class that describes the interface. This ensures that the needed methods is implemented. The Painter and PainterBase is perhaps the best example of this. The Painter must only implement the pure virtual methods in PainterBase.