Skip to content
  • Albert Gräf's avatar
    Add a <canvas>#editmode receiver for announcing edit mode changes. · c6b31ea0
    Albert Gräf authored
    The problem that we're trying to solve here is that there is no reliable
    way for objects to be notified when the edit mode status of their canvas
    changes. This problem exists across various flavors, but is made worse
    in Purr Data because it uses an ancient version of the canvas_editmode
    method which interprets a zero argument to mean "toggle", not "off".
    
    This makes it virtually impossible for 3rd party objects to observe edit
    mode changes while they are still in progress, as they simply cannot
    know whether the edit mode bit has already been flipped or not.
    
    The solution: Killing two birds with one stone, we first refactor
    existing gui notifications about edit mode changes in various places so
    that they now all go through a single function canvas_announce_editmode.
    This function then goes on to call the new canvas_dispatch_editmode
    function which takes care of notifying all receivers on the C side,
    after which the gui gets notified as befo...
    c6b31ea0