-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework the listbox so that it can contain symbols with quoted spaces.
Get rid of that awful atom_quote_spaces kludge. Instead, we store the list in its unquoted form in the symbol and use a special delimiter ALIST_DELIM instead of spaces to separate the list items. ALIST_DELIM is ASCII character 127 at present, which seems to be the perfect choice because it is a non-printable character which doesn't normally occur in symbol values. ALIST_DELIM is only used internally, in the external representation (rtext_retext et al) it is replaced by the space character. There are some complications with this approach (e.g., we need special variants of binbuf_text, binbuf_gettext, and atom_string to deal with these atoms, and mapping click actions on float atoms in a list becomes more difficult because of the differences in internal and external representations of list values). But overall this seems to be a much better approach which gets rid of pretty much all previous limitations in our "fake" listbox implementation, so that for all practical purposes our listboxes now look and behave exactly as they do in vanilla Pd. One might ask why we go to all these lengths to store the listbox atom as a single atom instead of a list, as it is done in vanilla Pd. The answer is that Purr Data offers some special editing operations on gatoms which vanilla Pd doesn't have, and which rest on the assumption that gatom values are always just single atoms. Implementing listboxes as list objects would make this much more difficult. The code is already complicated enough as it is, so I don't want to go there.
- Loading branch information
Showing
4 changed files
with
244 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.