snip-class% : class? |
superclass: object% |
In deriving a new snip-class% class, override the read method. Then, for each instance of the derived class (where each instance corresponds to a single snip class):
Set the classname using set-classname.
Set the version using set-version.
Install the class into the list returned by get-the-snip-class-list using the add method. Note that if the same name is inserted into the same class list multiple times, all but the first insertion is ignored.
See also Snip Classes.
(new snip-class%) → (is-a?/c snip-class%) |
(send a-snip-class get-classname) → string? |
A snip class name should usually have the form "((lib ...)\n(lib ...))" to enable on-demand loading of the class. See Snip Classes for details.
(send a-snip-class get-version) → exact-integer? |
Default implementation: Returns #f.
(send a-snip-class read-header f) → boolean? |
f : (is-a?/c editor-stream-in%) |
The return value is #f if a read error occurs or anything else otherwise.
See also write-header.
Default implementation: Returns #t.
(send a-snip-class reading-version stream) → exact-integer? |
stream : (is-a?/c editor-stream-in%) |
(send a-snip-class set-classname name) → void? |
name : string? |
(send a-snip-class set-version v) → void? |
v : exact-integer? |
(send a-snip-class write-header stream) → boolean? |
stream : (is-a?/c editor-stream-out%) |
When reading the snips back in, read-header will only be called if write-header writes some data to the stream.
The return value is #f if a write error occurs or anything else otherwise.