Skip to content
  • Jehan's avatar
    libgimp, libgimpconfig: GimpResource can now be (de)serialized. · ce0a8400
    Jehan authored
    I add a new class method deserialize_create() to GimpConfigInterface which
    returns the GimpConfig object per deserialization, instead of modifying an
    existing bare object.
    
    This matters for cases like our GimpResource (and later our GimpItem) classes
    which are fully managed by libgimp and should be unique objects per actual
    resource. It should even be possible to compare the pointer itself for identity.
    That's why we need to let GimpResource create the object (in reality request it
    to the infra and only ref it) through this new class method.
    
    With this commit and the previous ones, all GimpResource are now properly stored
    as plug-in settings (e.g. the "film" plug-in has a font setting which is now
    properly remembered).
    
    These identifiers are not portable (across various installations and therefore
    not for XCF either), but at least they are reasonably identifying data on a same
    installation (unlike GimpResource's int ID which is only valid within a single
    session) which makes them very fine for plug-in settings storage.
    
    When a data file disappears, we fallback to the context default data instead.
    ce0a8400