home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / !DeskLib / h / Handler < prev    next >
Encoding:
Text File  |  1994-04-10  |  4.6 KB  |  122 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Handler.h
  12.     Author:  Copyright © 1992, 1993, 1994 Jason Williams
  13.     Version: 1.03 (01 April 1994)
  14.     Purpose: Predefined default handlers for you to COPY and use as the
  15.              basis of your own handlers
  16.  
  17.              NOTE that these are basically EXAMPLE handlers, and so are
  18.              not all designed with peak efficiency in mind.
  19.              PLEASE read the information about these handlers *carefully*
  20.              before use.
  21.              Note that some handlers are for Event, some are for EventMsg
  22. */
  23.  
  24.  
  25. #ifndef __dl_handler_h
  26. #define __dl_handler_h
  27.  
  28.  
  29.  /*
  30.   *  Simply calls Wimp_CloseWindow()
  31.   */
  32. extern BOOL Handler_CloseWindow(event_pollblock *event, void *reference);
  33.  
  34.  
  35.  /*  Alternate handler to Handler_Close, which calls the higher-level 
  36.   *  Window_Delete() to close and delete the window, release memory, and
  37.   *  remove all handlers attached to the window.
  38.   */
  39. extern BOOL Handler_DeleteWindow(event_pollblock *event, void *reference);
  40.  
  41.  
  42.  /*
  43.   *  Simply calls Wimp_OpenWindow()
  44.   */
  45. extern BOOL Handler_OpenWindow(event_pollblock *event, void *reference);
  46.  
  47.  
  48.  /*
  49.   *  Supplies a NULL redraw loop (gets rectangles from the WIMP until
  50.   *  all rectangles have been "redrawn"). Doesn't actually do any drawing
  51.   *  though.
  52.   */
  53. extern BOOL Handler_NullRedraw(event_pollblock *event, void *reference);
  54.  
  55.  
  56.  /*
  57.   * Handler for clicks on "OK" or "Cancel" (3-d) type buttons 
  58.   * (Indents the button, waits for 1/3 second, and un-indents the button)
  59.   */
  60. extern BOOL Handler_ClickOK(event_pollblock *event, void *reference);
  61.  
  62.  
  63.  
  64.  
  65.  /* Handler_ModeChange ----------------------------------------------------
  66.   * This is a handler for mode change events. It calls Screen_CacheModeInfo()
  67.   * every time the screen mode changes, guaranteeing that the screen variables
  68.   * are always correct (EXCEPT, YOU must call Screen_CacheModeInfo() once
  69.   * during initialisation.
  70.   *
  71.   * If you have called Template_UseOutlineFonts() and the screen resolution
  72.   * has changed in such a way as to necessitate it, it also calls
  73.   * Window_ModeChange to fix all your icons which use outline fonts
  74.   * (otherwise, they often become the wrong size upon a mode change)
  75.   * (Note that this won't have a very useful effect unless you use Template
  76.   * and Window functions to create all your windows - in fact, such windows
  77.   * will no longer 'own' the fonts they are using, and these fonts may
  78.   * disappear or change at random in the future - so DON'T use this function
  79.   * unless ALL your windows were created with Window_Create.
  80.   *
  81.   * See also Window.h
  82.   *
  83.   * Attach it to mode change messages using:
  84.   *  EventMsg_Claim(message_MODECHANGE, event_any, Handler_ModeChange, NULL);
  85.   */
  86. extern BOOL Handler_ModeChange(event_pollblock *event, void *reference);
  87.  
  88.  
  89.  
  90.  
  91. /* Handler_DragNULL & Handler_DragFinish ----------------------------------
  92.  *
  93.  * These handlers are for use with the Drag sublibrary.
  94.  * See Drag.h for details of how this operates.
  95.  *
  96.  * DragNULL is called on NULL events to allow drag updates (redraw of a
  97.  * selection as it is dragged, for example). It calls the drag handler
  98.  * registered with Drag_SetHandlers() on each NULL it recieves.
  99.  * (Note that currently I have not written support for enabling and disabling
  100.  * NULL events with the Event sublibrary as needed, because I never use Event)
  101.  *
  102.  * DragFinish is called on a USERDRAG event (drag has finished) to tidy up
  103.  * at the end of a drag (Complete a selection, or save a file, etc).
  104.  * This calls the Drag-Completed handler registered with Drag_SetHandlers
  105.  * and also resets the drag handlers (as no drag is now in progress)
  106.  */
  107. extern BOOL Handler_DragNULL(event_pollblock *event, void *reference);
  108. extern BOOL Handler_DragFinish(event_pollblock *event, void *reference);
  109.  
  110.  
  111.  
  112.  /*  Handler_HatchRedraw --------------------------------------------------
  113.   *
  114.   *  Hatch the work area of a window. Useful when testing
  115.   *  a program before you get round to writing your own redraw
  116.   *  routines so you can see that something is happening.
  117.   */
  118. extern BOOL Handler_HatchRedraw(event_pollblock *event, void *reference);
  119.  
  120.  
  121. #endif
  122.