Google

CHAPTER 4 - REPAINT, EVENT-HANDLING, ON-OFF & TIDY-UP ROUTINE CALLS

4.1 INTRODUCTION

This chpater describes the calls made to the various types of routines which may be called by the XDL_VIEW management routines. The routines under consideration are the following:

  1. Event Handling Routines

    These are called by the xdl_get_events routine when an event from a view-object window is processed. The events are considered in two classes with Expose and Configure Notify events causing the window's repaint routine to be called and with other events causing the window's general event handling routine to be called.

  2. On-off Routine

    The on-off routine for a view-object is called by the xdl_get_events routine when the view-object is one of those in the list of view-objects from which the application is prepared to receive input. It is called once with the 'on' option at the start of the xdl_get_events routine and a second time with the 'off' option set just before the routine xdl_get_events makes a return to the calling program.

  3. Tidy-up Routine

    This routine is called by the xdl_delete_view_object routine when a view-object is deleted. It enables the user to free any workspace or other resources allocated to the view-object just prior to its removal. Tidy-up routines will also be called for any library routines associated with the view-object.

List of sections:

Repaint/Event-Handling Routine Calls
On-Off Routine Calls
Tidy-Up Routine Calls

4.2 REPAINT/EVENT-HANDLING ROUTINE CALLS

The repaint and general event handling routines are called as follows:

   (*repaint/ehp) (wid, event, iv, global, callback)

Window wid; The (X) window id of the window in generating the event.

XEvent *event; A pointer to the XEvent structure for the X event.

int iv; The offset in the XDL_view_objects array for the view-object to which the window belongs.

char *global; A pointer to the global data area associated with the window. This will normally be the global data area associated with the view-object to which the window belongs except in the case of a library routine window in which case it will be a private data area for the routine.

void (*callback)() This will normally be a NULL except for events associated with windows created by library routines such as the panel item routines.

4.3 ON-OFF ROUTINE CALLS

The on-off routine is called as follows:

   (*on_off) (iv, iflag)

int iv; The offset in the XDL_view_objects array for the view-object to which the window belongs.

int iflag; Flag = 1, set view-object to program input 'on' mode. = 0, set view-object to program input 'off' mode.

4.4 TIDY-UP ROUTINE CALLS

The tidy-up routine is called as follows:

   (*tidy_up) (global)

char *global; A pointer to the global data area associated with the window. This will normally be the global data area associated with the view-object to which the window belongs except in the case of a library routine window in which case it will be a private data area for the routine.



John W. Campbell
CCLRC Daresbury Laboratory
Last update 4 Feb 1998