home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h_doc / Handler < prev    next >
Encoding:
Text File  |  1996-05-21  |  5.0 KB  |  147 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 __Desk_Handler_h
  26. #define __Desk_Handler_h
  27.  
  28. #ifdef __cplusplus
  29.     extern "C" {
  30. #endif
  31.  
  32. #ifndef __Desk_Wimp_h
  33.     #include "Desk.Wimp.h"
  34. #endif
  35.  
  36.  
  37. extern Desk_bool Desk_Handler_CloseWindow(Desk_event_pollblock *event, void *reference);
  38.  /*
  39.   *  Simply calls Desk_Wimp_CloseWindow()
  40.   */
  41.  
  42.  
  43. extern Desk_bool Desk_Handler_DeleteWindow(Desk_event_pollblock *event, void *reference);
  44.  /*  Alternate handler to Desk_Handler_Close, which calls the higher-level 
  45.   *  Desk_Window_Delete() to close and delete the window, release memory, and
  46.   *  remove all handlers attached to the window.
  47.   */
  48.  
  49.  
  50. extern Desk_bool Desk_Handler_OpenWindow(Desk_event_pollblock *event, void *reference);
  51.  /*
  52.   *  Simply calls Desk_Wimp_OpenWindow()
  53.   */
  54.  
  55.  
  56. extern Desk_bool Desk_Handler_NullRedraw(Desk_event_pollblock *event, void *reference);
  57.  /*
  58.   *  Supplies a NULL redraw loop (gets rectangles from the WIMP until
  59.   *  all rectangles have been "redrawn"). Doesn't actually do any drawing
  60.   *  though.
  61.   */
  62.  
  63.  
  64. extern Desk_bool Desk_Handler_ClickOK(Desk_event_pollblock *event, void *reference);
  65.  /*
  66.   * Handler for clicks on "OK" or "Cancel" (3-d) type buttons 
  67.   * (Indents the button, waits for 1/3 second, and un-indents the button)
  68.   */
  69.  
  70.  
  71. extern Desk_bool Desk_Handler_Key(Desk_event_pollblock *event, void *reference);
  72.  /*
  73.   * Handler for unprocessed key events.  Calls Desk_Wimp_ProcessKey to pass
  74.   * the code on to other tasks.
  75.   */
  76.  
  77.  
  78.  
  79.  
  80. extern Desk_bool Desk_Handler_ModeChange(Desk_event_pollblock *event, void *reference);
  81.  /* 
  82.   * This is a handler for mode change events. It calls Desk_Screen_CacheModeInfo()
  83.   * every time the screen mode changes, guaranteeing that the screen variables
  84.   * are always correct (EXCEPT, YOU must call Desk_Screen_CacheModeInfo() once
  85.   * during initialisation.
  86.   *
  87.   * If you have called Desk_Template_UseOutlineFonts() and the screen resolution
  88.   * has changed in such a way as to necessitate it, it also calls
  89.   * Desk_Window_ModeChange to fix all your icons which use outline fonts
  90.   * (otherwise, they often become the wrong size upon a mode change)
  91.   * (Note that this won't have a very useful effect unless you use Template
  92.   * and Window functions to create all your windows - in fact, such windows
  93.   * will no longer 'own' the fonts they are using, and these fonts may
  94.   * disappear or change at random in the future - so DON'T use this function
  95.   * unless ALL your windows were created with Desk_Window_Create.
  96.   *
  97.   * See also Window.h
  98.   *
  99.   * Attach it to mode change messages using:
  100.   *  Desk_EventMsg_Claim(Desk_message_MODECHANGE, Desk_event_any, Desk_Handler_ModeChange, NULL);
  101.   */
  102.  
  103.  
  104.  
  105.  
  106. extern Desk_bool Desk_Handler_DragNULL(Desk_event_pollblock *event, void *reference);
  107. /*
  108.  * For use with the Drag sublibrary.
  109.  * See Drag.h for details of how this operates.
  110.  *
  111.  * DragNULL is called on NULL events to allow drag updates (redraw of a
  112.  * selection as it is dragged, for example). It calls the drag handler
  113.  * registered with Desk_Drag_SetHandlers() on each NULL it recieves.
  114.  * (Note that currently I have not written support for enabling and disabling
  115.  * NULL events with the Event sublibrary as needed, because I never use Event)
  116.  *
  117.  */
  118.  
  119. extern Desk_bool Desk_Handler_DragFinish(Desk_event_pollblock *event, void *reference);
  120.  
  121. /*
  122.  * For use with the Drag sublibrary.
  123.  * See Drag.h for details of how this operates.
  124.  *
  125.  * DragFinish is called on a USERDRAG event (drag has finished) to tidy up
  126.  * at the end of a drag (Complete a selection, or save a file, etc).
  127.  * This calls the Drag-Completed handler registered with Desk_Drag_SetHandlers
  128.  * and also resets the drag handlers (as no drag is now in progress)
  129.  */
  130.  
  131.  
  132.  
  133. extern Desk_bool Desk_Handler_HatchRedraw(Desk_event_pollblock *event, void *reference);
  134.  /*
  135.   *  Hatch the work area of a window. Useful when testing
  136.   *  a program before you get round to writing your own redraw
  137.   *  routines so you can see that something is happening.
  138.   */
  139.  
  140.  
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145.  
  146. #endif
  147.