[leveller] Advance plug-in SDK note

  • From: Ray Gardener <rayg@xxxxxxxxxxxxxxxxxx>
  • To: leveller@xxxxxxxxxxxxx
  • Date: Wed, 24 Sep 2003 18:48:08 -0700

The following is just an advance note on future Leveller
plug-in SDK changes.

Prior to Leveller 2.4, plug-in previewing was supported
implicitly, and as a consequence, it was implemented poorly.
Namely, if one clicked "OK" immediately after doing a
preview, the plug-in's effect was performed all over again.
For long processes, this was absurd.

Leveller 2.4 explicitly handles previewing, so this will no
longer happen.

The LevellerPlugin_UI routine's pProceed argument will
change from being a BOOL* to an __int32*. Compatability with
old usage is maintained since BOOLs are ints. However, new
plug-ins can return a value of 2 to indicate that the user
clicked OK, but the last preview that was performed has
settings identical to those when OK was clicked. Thus,
Leveller will know that it can use the effects produced by
the last preview instead of redundantly calling
LevellerPlugin_Run.

Document modifying plug-ins (filters, generators, importers,
selectors) need to handle calls to LevellerPlugin_About in
the following manner:

  - lev_irt_settingsblocksize cannot be ignored.
  - lev_irt_canJournal is a new questiontype and requires
TRUE to be returned if the plug-in supports multiple Undo.
For a heightfield modifier, this means being able to perform
selmask filtering on its own and running deterministically.
To help port legacy plug-ins, a C++ brute-force selmask
filtering class will be provided. It takes more memory, but
all one has to do is instantiate the class prior to the HF
modifying code and call its Apply method afterwards.

For plug-ins supporting multiple Undo, LevellerPlugin_Run
absolutely must not perform any user interaction such as
displaying dialogs or message boxes. Some import plug-ins
have this problem because they do file analysis during Run
and then show the user the results and ask if it's okay to
proceed or not. Such code needs to be made part of
LevellerPlugin_UI.

If lev_irt_canJournal is responded with FALSE, Leveller 2.4
empties the Undo queue and applies the plug-in's effect to
the initial document state. The effect is performed, but it
becomes irreversible.

Ray




Other related posts:

  • » [leveller] Advance plug-in SDK note