/*
 * !tpluslib.drawwin.h
 *
 * provides routines for simply redrering a drawfile in a window
 *
 *  Tony Howat/Risc User 1997
 *
 * The TPlus library is *not* freeware and should not be distributed by
 * anyone other than Risc User. Those with an official copy of TPlus
 * (on a Risc User Magazine Disc, Special Disc, CD-ROM etc)
 * have an unlimited licence to link the library with their own programs.
 */

#include "toolbox.h"

#define DRAWWIN_FIT_BBOX  1          /* size window to fit bounding box of draw
                                        file */
#define DRAWWIN_SCALE_PIC 2          /* scale the picture */
#define DRAWWIN_SCALE_PIC_BESTFIT 4  /* scale the picture, limited so its
                                        BBox fits the current window size */

/* -------------------------- drawwin_register ---------------------------
 *
 * Description:   Registers a window and a drawfile with the library.
 *
 * Parameters:    int flags        -- See above
 *                ObjectId win     -- The host window
 *                void **drawdata  -- Drawfile data - pointer to a pointer
 *                                    to allow for moving flex blocks
 *                int length       -- Length of drawfile
 *                int scale        -- Scaling factor
 * Returns:       ...any errors.
 * Other Info:
 */

extern _kernel_oserror *drawwin_register(int flags, ObjectId win, void **drawdata, int length, int scale);

/* -------------------------- drawwin_rescale ----------------------------
 *
 * Description:   Changes scaling method of drawfile in a previously
 *                registered window.
 * Parameters:    ObjectId win     -- Host window
 *                int flags        -- See above
 *                int scale        -- Scaling factor
 * Returns:       ...any errors.
 * Other Info:    Flags are same as for drawwin_register
 */ 

extern _kernel_oserror *drawwin_rescale(int flags, ObjectId win, int scale);

/* ------------------------- drawwin_deregister --------------------------
 *
 * Description:   Forces the deregistration of the pane library routines
 *                for win concerning a pane.
 * Parameters:    ObjectId win    -- The host window
 *                ObjectId pane   -- The pane
 * Returns:       ...any errors.
 * Other Info:    The pane is hidden. Deregistration is usually done
 *                when the pane library picks up a close message from
 *                the host window.
 */

extern _kernel_oserror *drawwin_deregister(ObjectId win);

/* ---------------------------- drawwin_bbox ----------------------------
 *
 * Description:   Fills in a supplied BBox structure with a the bounding
 *                box of a draw file in OS units.
 * Parameters:    void **data     -- Pointer to pointer to drawfile data
 *                int length      -- Length in bytes of draw file
 *                BBox *box       -- Pointer to BBox to fill in
 * Returns:       ...any errors.
 */

extern _kernel_oserror *drawwin_bbox(void **data, int length, BBox *box);
