home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / DTS.Lib / DTS.Lib.headers / AppWannabe.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-11  |  25.7 KB  |  643 lines  |  [TEXT/MPS ]

  1. #ifndef __APPWANNABE__
  2. #define __APPWANNABE__
  3.  
  4. #ifndef __TYPES__
  5. #include <Types.h>
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /********** DoEvent.c **********/
  12.  
  13.  
  14. void            DoEvent(EventRecord *event);
  15.     /*
  16.     **    ¶ •AppWannabe (DoEvent.c).  This is where event dispatching occurs.
  17.     **
  18.     **    INPUT:    event        
  19.     **
  20.     **    This AppWannabe is where dispatching for the event occurs. */
  21.  
  22. void            DoActivate(WindowPtr window);
  23.     /*
  24.     **    ¶ •AppWannabe (DoEvent.c).  Called by framework to activate or deactivate a window.
  25.     **
  26.     **    INPUT:    window        This is the window being activated or deactivated.
  27.     **
  28.     **    The application framework calls this AppWannabe function when a window needs
  29.     **    activation or deactivation.  Note that this may happen at times other than
  30.     **    event handling.  For example:  If you call HiliteWindows, if some windows are
  31.     **    found with the wrong hilite value, they will be hilited or unhilited, and 
  32.     **    DoActivate will be called to give the application a chance to do whatever
  33.     **    else is appropriate for activation or deactivation of the window. */
  34.  
  35. void            DoCursor(void);
  36.     /*
  37.     **    ¶ •AppWannabe (DoEvent.c).  Called by framework to adjust the cursor.
  38.     **
  39.     **    The application framework calls this AppWannabe function when the cursor
  40.     **    needs updating.  The application does whatever is appropriate, which in many cases
  41.     **    is simply to call the framework function DoWindowCursor.  See DoWindowCursor
  42.     **    for more information. */
  43.  
  44.  
  45.  
  46. /********** File.c **********/
  47.  
  48. OSErr            InitDocument(FileRecHndl frHndl);
  49.     /*
  50.     **    ¶ •AppWannabe (File.c).  Called by framework to instantiate doc handle (frHndl).
  51.     **
  52.     **    INPUT:    frHndl        The file (document) reference handle.
  53.     **    RESULT:    OSErr
  54.     **
  55.     **    The application framework calls this AppWannabe function when a file reference
  56.     **    handle needs to be further initialized.  The frHndl has already been initialized
  57.     **    with default values.  This is the application’s chance to change these values
  58.     **    before the window is created for the document (if one is to be created), and also
  59.     **    if this was called by OpenDocument, then the document will also be read.  This is
  60.     **    the application’s chance to change the file read/write procs so that if there is a
  61.     **    custom file format, the correct read/write routines will be called for this
  62.     **    document. */
  63.  
  64. long            InitDocumentSize(OSType sftype);
  65.     /*
  66.     **    ¶ •AppWannabe (File.c).  Called by framework to get size of doc handle to create.
  67.     **
  68.     **    INPUT:    sftype        The OSType of the document about to be created.
  69.     **    RESULT:    long        The size that the file reference handle should be created.
  70.     **
  71.     **    The application framework calls this AppWannabe function when it is about to
  72.     **    create a file reference handle.  The framework needs to know how big to create the
  73.     **    handle.  Your application may wish to store additional fields in the frHndl, and so
  74.     **    therefore it may be a different size than usual.  See the various sample
  75.     **    applications for a sample of this function (in the source file File.c).  Note that
  76.     **    for the ViewHierarchy debugging window, a different size is returned. */
  77.  
  78.  
  79.  
  80. /********** Menu.c **********/
  81.  
  82. void            DoAdjustMenus(void);
  83.     /*
  84.     **    ¶ •AppWannabe (Menu.c).  Called by framework to activate or deactivate a window.
  85.     **
  86.     **    The application framework calls this AppWannabe function when menus need
  87.     **    adjusting.  The application can then “adjust” the menu items any way it sees fit.
  88.     **
  89.     **    There is a framework service for adjusting the menus called DoAdjustMBARMenus.
  90.     **    The MBAR in the name indicates that it restricts its actions to the menus in
  91.     **    the designated MBAR resource.  Menus other than those mentioned in the MBAR
  92.     **    resource are not handled by the framework.
  93.     **
  94.     **    DoAdjustMBARMenus walks the MBAR, and calls the application for each menu it
  95.     **    finds.  All items in the menu are first disabled, and then the application is
  96.     **    called.  This allows the application to only worry about enabling items, which
  97.     **    should simplify the task.
  98.     **
  99.     **    __________
  100.     **
  101.     **    Also see:    AdjustMenuItems. */
  102.  
  103. Boolean            DoMenuCommand(short menuID, short menuItem);
  104.     /*
  105.     **    ¶ •AppWannabe (Menu.c).  Called by framework to execute menu command.
  106.     **
  107.     **    INPUT:    menuID
  108.     **            menuItem
  109.     **
  110.     **    The application framework calls this AppWannabe function when a menu
  111.     **    command has been received and it needs to be handled.  Note that the menuItem
  112.     **    has already been converted to a "soft" menuItem if you have a STR# hard <-> soft
  113.     **    menuItem mapping resource of the same resource ID as the menu.
  114.     **
  115.     **    The menuItem mapping resource is simply a STR# resource that has the same ID as
  116.     **    the menu.  For each menuItem in the menu, you have an entry in the STR# resource.
  117.     **    For example:  If you have a menu of ID 130, then you need a STR# menu of ID 130.
  118.     **    If you want menuItem #1 to have a soft ID of 100, you put a decimal 100 in the
  119.     **    first position of the STR# resource.
  120.     **
  121.     **    DoMenuCommand can handle the menu item any way it sees fit.
  122.     **
  123.     **    __________
  124.     **
  125.     **    Also see:    MapMenuItem, UnmapMenuItem. */
  126.  
  127.  
  128.  
  129. /********** Window.c **********/
  130.  
  131. void        CalcFrameRgn(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn);
  132.     /*
  133.     **    ¶ •AppWannabe (Window.c).  Called by framework to calculate the frame region.
  134.     **
  135.     **    INPUT:    frHndl        Document reference to calc frame region for.
  136.     **            window        Window to calc frame region for.
  137.     **    IN/OUT:    rgn            Region to return frame region in.
  138.     **
  139.     **    You are passed an empty region.  You are supposed to add any custom frame
  140.     **    parts that this document uses.  Typically there are no frame portions, as
  141.     **    they are accounted for in other ways.  The scrollbars and grow icon will
  142.     **    automatically be contributed to the calculation of the frame region.
  143.     **    If you use sidebars, these are also added in automatically.  This is only
  144.     **    used if the frame region is more complicated than can automatically be
  145.     **    handled.  So, almost always, you will simply leave the region empty. */
  146.  
  147. void        ContentClick(WindowPtr window, EventRecord *event, Boolean firstCLick);
  148.     /*
  149.     **    ¶ •AppWannabe (Window.c).  Called by framework to let app handle content click.
  150.     **
  151.     **    INPUT:    window        Window content click belongs to.
  152.     **            event        Event record holding content click.
  153.     **            firstClick    True if window is marked as first-click window, and it is.
  154.     **
  155.     **    This is called (by DoContentClick) when a mouse-down event occurs in the content of
  156.     **    a window.  Other applications might want to call FindControl, TEClick, etc., to
  157.     **    further process the click. */
  158.  
  159.  
  160. Boolean        ContentKey(WindowPtr window, EventRecord *event, Boolean *passThrough);
  161.     /*
  162.     **    ¶ •AppWannabe (Window.c).  Called by framework to let app handle keypress.
  163.     **
  164.     **    INPUT:    window            Window keypress may belongs to.
  165.     **            event            Event record holding keypress.
  166.     **            passThrough        Return true if key should be passed to next window.
  167.     **    RESULT:    Boolean            If key handled, return true.
  168.     **
  169.     **    This is called (by DoContentClick) when a mouse-down event occurs in the content of
  170.     **    a window.  Other applications might want to call FindControl, TEClick, etc., to
  171.     **    further process the click.
  172.     **    DoKeyDown is first called by the application.  Then if the key isn’t a menu
  173.     **    key, DoKeyDown calls this code.  Here are the rules for this function:
  174.     **
  175.     **    1)    If you handle the key, return(true).  This completes the key handling.
  176.     **    2)    If you don’t handle the key, you return false.  However, there are two
  177.     **        situations for not handling the key:
  178.     **            a) You want someone else to.
  179.     **            b) You want nobody else to look at the key.
  180.     **        This is what the boolean passThrough is for.  If you wish the next window
  181.     **        to have a look at the key, set the boolean passThrough to true.  passThrough
  182.     **        is already initialized to false, which is the common case, so you only have
  183.     **        to worry about setting it true.
  184.     **
  185.     **    If you have a window that never processes keys and always passes them through,
  186.     **    just set the contentKeyProc to nil.  This will indicate to the application
  187.     **    framework that all keys should be passed through this window.  DTS.Draw has
  188.     **    such a window.  Its palette window doesn’t accept keys.  They are passed through
  189.     **    to document windows. */
  190.  
  191. void        DrawFrame(FileRecHndl frHndl, WindowPtr window, Boolean activate);
  192.     /*
  193.     **    ¶ •AppWannabe (Window.c).  Called by framework to let app draw frame.
  194.     **
  195.     **    INPUT:    window        Window content click belongs to.
  196.     **            event        Event record holding content click.
  197.     **            firstClick    True if window is marked as first-click window, and it is.
  198.     **
  199.     **    Draw application specific content (Called by DoDrawFrame).
  200.     **
  201.     **    If your application has any custom frame areas, or if it uses sidebars,
  202.     **    this is the function that you would put the frame drawing code.  The
  203.     **    document scrollbars and grow icon drawing is handled by DTS.framework.
  204.     **    Just do the sidebar and custom areas here. */
  205.  
  206. OSErr        FreeDocument(FileRecHndl frHndl);
  207.     /*
  208.     **    ¶ •AppWannabe (Window.c).  Called by framework to let app free up related memory.
  209.     **
  210.     **    INPUT:    frHndl        File reference going away.
  211.     **
  212.     **    Frees up any application-specific memory in the document.  This is called by
  213.     **    DoFreeDocument, which is called by DisposeDocument.  The application would
  214.     **    call DisposeDocument, not DoFreeDocument or FreeDocument directly.
  215.     **
  216.     **    The document may have a bunch of handles off the main handle of the document.
  217.     **    This is where they are freed.  DisposeDocument calls this prior to releasing
  218.     **    the ram for the main handle of the document, so release everything else
  219.     **    here, or you will have a memory leak.
  220.     **
  221.     **    NOTE:    Calling DefaultFreeDocument frees up all memory used by a
  222.     **            hierarchical document (see TreeObj package). */
  223.  
  224. OSErr        FreeWindow(FileRecHndl frHndl, WindowPtr window);
  225.     /*
  226.     **    ¶ •AppWannabe (Window.c).  Called by framework to let app free up related memory.
  227.     **
  228.     **    INPUT:    window        Window going away.
  229.     **
  230.     **    Any additional window disposal tasks can be handled here. */
  231.  
  232. OSErr        ImageDocument(FileRecHndl frHndl);
  233.     /*
  234.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can draw or print doc.
  235.     **
  236.     **    INPUT:    frHndl        Document to image.
  237.     **
  238.     **    The only thing tricky about this function is that it needs to key off of
  239.     **    the global variable gPrintPage.  gPrintPage is the current page that is
  240.     **    being printed.  If gPrintPage is 0, then you are drawing to the window.
  241.     **
  242.     **    For when printing:
  243.     **
  244.     **    If gPrintPage is non-0, that is the page to be printed.  If after imaging
  245.     **    the page there are no more pages, you should set gPrintPage to 0.  This
  246.     **    indicates to the print loop that the end of the document has been reached.
  247.     **    Even if the user indicated in the job dialog to print more pages, setting
  248.     **    gPrintPage to 0 states that the last page has been printed.  This is necessary
  249.     **    because the print loop can’t know when printing is done.  The imaging procedure
  250.     **    is the logical one to state when everything has been imaged. */
  251.  
  252. OSErr        InitContent(FileRecHndl frHndl, WindowPtr window);
  253.     /*
  254.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can do more window init.
  255.     **
  256.     **    INPUT:    frHndl        Document to initialize window content for.
  257.     **            window        Window to initialize window content for.
  258.     **
  259.     **    There may be additional content initialization for the window.  At this point,
  260.     **    you have a window, but it is currently invisible.  If you return noErr, then
  261.     **    the window will be set to the state indicated for that window.  Why this function?
  262.     **    You may wish to add controls to the content of the window.  You may have a
  263.     **    TextEdit record in the content.  All of these sort of things can't be created
  264.     **    until there is a window to contain them.  First a document is read in, and then
  265.     **    if the document creation succeeds, a window is created for that document.
  266.     **    At this point we have a document, and we are on our way to having a window.
  267.     **    All that remains is any additional content initialization.  Do it, return
  268.     **    noErr, and everybody's happy.  If something goes wrong here, return the error,
  269.     **    and the incomplete window will be disposed of. */
  270.  
  271. OSErr        ReadDocument(FileRecHndl frHndl);
  272.     /*
  273.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can read the document.
  274.     **
  275.     **    INPUT:    frHndl        Document to read.
  276.     **
  277.     **    The sample function below assumes that you are using the hierarchical document package.
  278.     **    If you are, the entire hierarchical document is read in with just this little code.
  279.     **    If you don't use it, you are on your own.  See DTS.StyleChat for an example of an
  280.     **    application that uses the DTS.framework without the hierarchical document package.
  281.     **
  282.     **    OSErr    ReadDocument(FileRecHndl frHndl)
  283.     **    {
  284.     **        OSErr    err;
  285.     **
  286.     **        err = DefaultReadDocument(frHndl);
  287.     **        if (!err)
  288.     **            DefaultReadDocumentFixup(frHndl);
  289.     **
  290.     **        return(err);
  291.     **    }
  292.     */
  293.  
  294.  
  295. void        ResizeContent(WindowPtr window, short oldh, short oldv);
  296.     /*
  297.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can resize window content.
  298.     **
  299.     **    INPUT:    window        Window that has just resized.
  300.     **            oldh        Old horizontal size.
  301.     **            oldv        Old vertical size.
  302.     **
  303.     **    Resize application specific content (Called by ResizeWindow).
  304.     **
  305.     **    This gets called when a user does a zoom or window resizing operation.
  306.     **    It is possible that things in the content need to be resized in conjunction
  307.     **    with the resizing of the window. */
  308.  
  309. void        ScrollFrame(FileRecHndl frHndl, WindowPtr window, long dh, long dv);
  310.     /*
  311.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can scroll frame.
  312.     **
  313.     **    INPUT:    frHndl        File reference of scrolling document.
  314.     **            window        Window of scrolling document.
  315.     **            dh            Horizontal delta for scroll.
  316.     **            dv            Vertical delta for scroll.
  317.     **
  318.     **    Some applications may need to scroll the "frame" of the document along
  319.     **    with the document contents.  This is common for applications with rulers,
  320.     **    or other similar sidebar items. */
  321.  
  322. void        UndoFixup(FileRecHndl frHndl, Point contOrg, Boolean afterUndo);
  323.     /*
  324.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can manage undo.
  325.     **
  326.     **    INPUT:    frHndl        File reference of document undergoing an undo.
  327.     **            contOrg        Origin that undo was recorded at.
  328.     **            afterUndo    If false, before undo process begun.  If true, completion message.
  329.     **
  330.     **    Since the hierarchical document package isn't used by DTS.StyleChat,
  331.     **    this function actually never gets called. */
  332.  
  333. Boolean        WindowCursor(FileRecHndl frHndl, WindowPtr window, Point globalPt);
  334.     /*
  335.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can manage undo.
  336.     **
  337.     **    INPUT:    frHndl        File reference of document to determine cursor for.
  338.     **            window        Window to determine cursor for.
  339.     **            globalPt    Global location of cursor to determine.
  340.     **
  341.     **    This function is where you adjust the cursor to reflect the location in the
  342.     **    document or window.  You have the additional input of gCursorRgn to deal
  343.     **    with.  The way that the cursor handling works is as follows:
  344.     **    1)    The application calls DoWindowCursor.
  345.     **    2)    DoWindowCursor works its way through the windows/documents, front to back.
  346.     **        It looks at the document's windowCursorProc and checks to see if the document
  347.     **        has one.  If the document doesn't have one, then it assumes that that window
  348.     **        always wants an arrow.  If the cursor is over that window, the cursor is set
  349.     **        to an arrow, and we're done.  If the cursor isn't over the window, then the next
  350.     **        window is tried.  If all documents don't have a windowCursorProc, then the cursor
  351.     **        is set to an arrow (for the non-document area of the screen).
  352.     **    3)    If a document has a windowCursorProc, then the proc is called.  The proc's
  353.     **        job is as follows:
  354.     **        a)    If the cursor is over a position that is determined by the window, then
  355.     **            the proc removes other areas from gCursorRgn.  Note that it should not
  356.     **            simply set the area to what it "thinks" is the correct area.  This window
  357.     **            may not be the front-most.  Other windows will have already been subtracted
  358.     **            from gCursorRgn.  The resultant gCursorRgn is the correct cursor area,
  359.     **            and should be passed to WaitNextEvent calls in the application (already the case
  360.     **            in EventLoop.c).  Also, the cursor should be set to the correct cursor, of course.
  361.     **            You should also return true, as the cursor has been determined.
  362.     **        b)    If the cursor is not over a position for this window, then you should
  363.     **            return.  You will either pass back true or false.  If you don't wish
  364.     **            windows behind this window to have a shot at cursor determination, then
  365.     **            return true.  This states that the cursor is "determined".  It is, in the
  366.     **            sense that no further determination will occur.  If you return false, then
  367.     **            other windows get a shot at determining the cursor.
  368.     **
  369.     **    Setting the cursor to the correct cursor isn't as easy as you would expect.
  370.     **    DTS.Lib..framework uses the global gCursorPtr as the reference to the cursor.  This is
  371.     **    fine if the cursor is pointer-based, but if the cursor is resource-based, it is a bit
  372.     **    more of a problem.  What you will need to do is to call DoSetResCursor to make the
  373.     **    resource cursor pointer-based.  DoSetResCursor will set gCursorPtr to nil, and it
  374.     **    also returns the pointer to the permanent copy of the cursor resource.  Just set gCursorPtr
  375.     **    to the return result of DoSetResCursor, and you will be set. */
  376.  
  377. void        WindowGoneFixup(WindowPtr window);
  378.     /*
  379.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can have chance to do more.
  380.     **
  381.     **    INPUT:    window        Window that was just removed.  Do related tasks, if any.
  382.     */
  383.  
  384. OSErr        WriteDocument(FileRecHndl frHndl);
  385.     /*
  386.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can write the document.
  387.     **
  388.     **    INPUT:    frHndl        Document to write.
  389.     **
  390.     **    The sample function below assumes that you are using the hierarchical document package.
  391.     **    If you are, the entire hierarchical document is written in with just this little code.
  392.     **    If you don't use it, you are on your own.  See DTS.StyleChat for an example of an
  393.     **    application that uses the DTS.framework without the hierarchical document package.
  394.     **
  395.     **    OSErr    WriteDocument(FileRecHndl frHndl)
  396.     **    {
  397.     **        return(DefaultWriteDocument(frHndl));
  398.     **    }
  399.     */
  400.  
  401. OSErr        DoOpenApplication(void);
  402.     /*
  403.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can start/restart/edited.
  404.     **
  405.     **    Since an AppsToGo application can be restarted while running, there are certain
  406.     **    tasks that you will need to do in this function.  This function is called at
  407.     **    both startup and restart time, so any initialization code should take this in
  408.     **    mind.  Any code that is related to startup that could be different on a restart
  409.     **    should be placed in this function. */
  410.  
  411. Boolean        AdjustMenuItems(WindowPtr window, short menuID);
  412.     /*
  413.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can adjust the menus.
  414.     **
  415.     **    The AppsToGo framework does a lot of the menu handling for you, but there
  416.     **    are certain tasks that must be done by the application.  The framework
  417.     **    iterates through the menuBar, and calls the application for each menu.
  418.     **    The rules for application calling are:
  419.     **    1)    If there are no windows, then AdjustMenuItems is called absolutely.
  420.     **        Given that it can be called with no windows, this should be kept in mind.
  421.     **    2)    If there is a top window, then that document’s AdjustMenuItemsProcPtr field
  422.     **        is referenced to determine where to call.  This field is initialized to
  423.     **        AdjustMenuItems.  This means that, unless you go to some trouble, this
  424.     **        is the only place that the framework will call for menu adjustment.
  425.     **
  426.     **    The following code is from AppWannabe.  It is a sample of what this function
  427.     **    should look like:
  428.     **
  429.     **    Boolean    AdjustMenuItems(WindowPtr window, short menuID)
  430.     **    {
  431.     **        Boolean        redrawMenuBar;
  432.     **        MenuHandle    menu;
  433.     **
  434.     **        redrawMenuBar = false;
  435.     **
  436.     **        switch (menuID) {
  437.     **            case mFile:
  438.     **                redrawMenuBar = DoAdjustFileMenu(window);
  439.     **                break;
  440.     **            case mEdit:
  441.     **                redrawMenuBar = DoAdjustEditMenu(window);
  442.     **                break;
  443.     **            default:
  444.     **                menu = GetMenuHandle(menuID);
  445.     **                if (menu)
  446.     **                    (*menu)->enableFlags |= 0xFFFFFFFEL;
  447.     **                break;
  448.     **        }
  449.     **
  450.     **        return(redrawMenuBar);
  451.     **    }
  452.     */
  453.  
  454. Boolean        DoMenuItem(WindowPtr window, short menuID, short menuItem);
  455.     /*
  456.     **    ¶ •AppWannabe (Window.c).  Called by framework so app can do the menu command.
  457.     **
  458.     **    INPUT:    window        Window that menu item supposedly belongs to (top non-floater).
  459.     **            menuID        The menuID that the user chose.
  460.     **            menuItem    The menuItem (mapped to a soft ID if available).
  461.     **    RESULT:    Boolean        Return true if handled.  If false is returned, the framework
  462.     **                        may try to do something with it. */
  463.  
  464.  
  465.  
  466. /********** WindowDialog.c **********/
  467.  
  468. void        DialogCalcFrameRgn(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn);
  469.     /*
  470.     **    ¶ •AppWannabe (WindowDialog.c).  Same as CalcFrameRgn, but for dialogs.
  471.     **
  472.     **    Same as CalcFrameRgn, but for dialogs. */
  473.  
  474. void        DialogContentClick(WindowPtr window, EventRecord *event, Boolean firstClick);
  475.     /*
  476.     **    ¶ •AppWannabe (WindowDialog.c).  Same as ContentClick, but for dialogs.
  477.     **
  478.     **    Same as ContentClick, but for dialogs. */
  479.  
  480. Boolean        DialogContentKey(WindowPtr window, EventRecord *event, Boolean *passThrough);
  481.     /*
  482.     **    ¶ •AppWannabe (WindowDialog.c).  Same as ContentKey, but for dialogs.
  483.     **
  484.     **    Same as ContentKey, but for dialogs. */
  485.  
  486. void        DialogDrawFrame(FileRecHndl frHndl, WindowPtr window, Boolean activate);
  487.     /*
  488.     **    ¶ •AppWannabe (WindowDialog.c).  Same as DrawFrame, but for dialogs.
  489.     **
  490.     **    Same as DrawFrame, but for dialogs. */
  491.  
  492. OSErr        DialogFreeDocument(FileRecHndl frHndl);
  493.     /*
  494.     **    ¶ •AppWannabe (WindowDialog.c).  Same as FreeDocument, but for dialogs.
  495.     **
  496.     **    Same as FreeDocument, but for dialogs. */
  497.  
  498. OSErr        DialogFreeWindow(FileRecHndl frHndl, WindowPtr window);
  499.     /*
  500.     **    ¶ •AppWannabe (WindowDialog.c).  Same as FreeWindow, but for dialogs.
  501.     **
  502.     **    Same as FreeWindow, but for dialogs. */
  503.  
  504. OSErr        DialogImageDocument(FileRecHndl frHndl);
  505.     /*
  506.     **    ¶ •AppWannabe (WindowDialog.c).  Same as ImageDocument, but for dialogs.
  507.     **
  508.     **    Same as ImageDocument, but for dialogs. */
  509.  
  510. OSErr        DialogInitContent(FileRecHndl frHndl, WindowPtr window);
  511.     /*
  512.     **    ¶ •AppWannabe (WindowDialog.c).  Same as InitContent, but for dialogs.
  513.     **
  514.     **    Same as InitContent, but for dialogs. */
  515.  
  516. void        DialogResizeContent(WindowPtr window, short oldh, short oldv);
  517.     /*
  518.     **    ¶ •AppWannabe (WindowDialog.c).  Same as ResizeContent, but for dialogs.
  519.     **
  520.     **    Same as ResizeContent, but for dialogs. */
  521.  
  522. void        DialogScrollFrame(FileRecHndl frHndl, WindowPtr window, long dh, long dv);
  523.     /*
  524.     **    ¶ •AppWannabe (WindowDialog.c).  Same as ScrollFrame, but for dialogs.
  525.     **
  526.     **    Same as ScrollFrame, but for dialogs. */
  527.  
  528. void        DialogUndoFixup(FileRecHndl frHndl, Point contOrg, Boolean afterUndo);
  529.     /*
  530.     **    ¶ •AppWannabe (WindowDialog.c).  Same as UndoFixup, but for dialogs.
  531.     **
  532.     **    Same as UndoFixup, but for dialogs. */
  533.  
  534. Boolean        DialogWindowCursor(FileRecHndl frHndl, WindowPtr window, Point globalPt);
  535.     /*
  536.     **    ¶ •AppWannabe (WindowDialog.c).  Same as WindowCursor, but for dialogs.
  537.     **
  538.     **    Same as WindowCursor, but for dialogs. */
  539.  
  540. void        DialogWindowGoneFixup(WindowPtr window);
  541.     /*
  542.     **    ¶ •AppWannabe (WindowDialog.c).  Same as WindowGoneFixup, but for dialogs.
  543.     **
  544.     **    Same as WindowGoneFixup, but for dialogs. */
  545.  
  546. Boolean        DialogAdjustMenuItems(WindowPtr window, short menuID);
  547.     /*
  548.     **    ¶ •AppWannabe (WindowDialog.c).  Same as AdjustMenuItems, but for dialogs.
  549.     **
  550.     **    Same as AdjustMenuItems, but for dialogs. */
  551.  
  552. Boolean        DialogDoMenuItem(WindowPtr window, short menuID, short menuItem);
  553.     /*
  554.     **    ¶ •AppWannabe (WindowDialog.c).  Same as DoMenuItem, but for dialogs.
  555.     **
  556.     **    Same as DoMenuItem, but for dialogs. */
  557.  
  558.  
  559.  
  560. /********** WindowPalette.c **********/
  561.  
  562. void        PaletteCalcFrameRgn(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn);
  563.     /*
  564.     **    ¶ •AppWannabe (WindowPalette.c).  Same as CalcFrameRgn, but for palettes.
  565.     **
  566.     **    Same as CalcFrameRgn, but for dialogs. */
  567.  
  568. void        PaletteContentClick(WindowPtr window, EventRecord *event, Boolean firstCLick);
  569.     /*
  570.     **    ¶ •AppWannabe (WindowPalette.c).  Same as ContentClick, but for palettes.
  571.     **
  572.     **    Same as ContentClick, but for dialogs. */
  573.  
  574. Boolean        PaletteContentKey(WindowPtr window, EventRecord *event, Boolean *passThrough);
  575.     /*
  576.     **    ¶ •AppWannabe (WindowPalette.c).  Same as ContentKey, but for palettes.
  577.     **
  578.     **    Same as ContentKey, but for dialogs. */
  579.  
  580. void        PaletteDrawFrame(FileRecHndl frHndl, WindowPtr window, Boolean activate);
  581.     /*
  582.     **    ¶ •AppWannabe (WindowPalette.c).  Same as DrawFrame, but for palettes.
  583.     **
  584.     **    Same as DrawFrame, but for dialogs. */
  585.  
  586. OSErr        PaletteFreeDocument(FileRecHndl frHndl);
  587.     /*
  588.     **    ¶ •AppWannabe (WindowPalette.c).  Same as FreeDocument, but for palettes.
  589.     **
  590.     **    Same as FreeDocument, but for dialogs. */
  591.  
  592. OSErr        PaletteFreeWindow(FileRecHndl frHndl, WindowPtr window);
  593.     /*
  594.     **    ¶ •AppWannabe (WindowPalette.c).  Same as FreeWindow, but for palettes.
  595.     **
  596.     **    Same as FreeWindow, but for dialogs. */
  597.  
  598. OSErr        PaletteImageDocument(FileRecHndl frHndl);
  599.     /*
  600.     **    ¶ •AppWannabe (WindowPalette.c).  Same as ImageDocument, but for palettes.
  601.     **
  602.     **    Same as ImageDocument, but for dialogs. */
  603.  
  604. OSErr        PaletteInitContent(FileRecHndl frHndl, WindowPtr window);
  605.     /*
  606.     **    ¶ •AppWannabe (WindowPalette.c).  Same as InitContent, but for palettes.
  607.     **
  608.     **    Same as InitContent, but for dialogs. */
  609.  
  610. void        PaletteResizeContent(WindowPtr window, short oldh, short oldv);
  611.     /*
  612.     **    ¶ •AppWannabe (WindowPalette.c).  Same as ResizeContent, but for palettes.
  613.     **
  614.     **    Same as ResizeContent, but for dialogs. */
  615.  
  616. void        PaletteScrollFrame(FileRecHndl frHndl, WindowPtr window, long dh, long dv);
  617.     /*
  618.     **    ¶ •AppWannabe (WindowPalette.c).  Same as ScrollFrame, but for palettes.
  619.     **
  620.     **    Same as ScrollFrame, but for dialogs. */
  621.  
  622. void        PaletteUndoFixup(FileRecHndl frHndl, Point contOrg, Boolean afterUndo);
  623.     /*
  624.     **    ¶ •AppWannabe (WindowPalette.c).  Same as UndoFixup, but for palettes.
  625.     **
  626.     **    Same as UndoFixup, but for dialogs. */
  627.  
  628. Boolean        PaletteWindowCursor(FileRecHndl frHndl, WindowPtr window, Point globalPt);
  629.     /*
  630.     **    ¶ •AppWannabe (WindowPalette.c).  Same as WindowCursor, but for palettes.
  631.     **
  632.     **    Same as WindowCursor, but for dialogs. */
  633.  
  634. void        PaletteWindowGoneFixup(WindowPtr window);
  635.     /*
  636.     **    ¶ •AppWannabe (WindowPalette.c).  Same as WindowGoneFixup, but for palettes.
  637.     **
  638.     **    Same as WindowGoneFixup, but for dialogs. */
  639.  
  640.  
  641.  
  642. #endif
  643.