first previous next last contents

Specific Notification Tasks

Some registered items may support extra forms of communication than the listed notifications. In this case, we use the REG_GENERIC notification together with a task number and some task specific data to send a specific task to a specific registered data. This provides a way for individual displays to add new communicates methods to the registration scheme.

To send a REG_GENERIC task, the reg_generic structure must first be completed by setting job, task and data. Data will point to another structure, which is unique for specific type of task. The task data structure must then be initialised and sent to the appropriate client contig, id or type.

The task number needs to be unique across all the types of generic tasks likely to be sent to the client. For instance, a contig editor can receive TASK_EDITOR_SETCURSOR and TASK_EDITOR_GETCON tasks. Obviously the #defines for these tasks need to be different. However they may safely coincide with TASK_TEMPLATE_REDRAW, which is used by the template display, as we know that the the editor will never receive this task (and vice versa). The assignment of task numbers is at present something which requires further investigation. However the use of defines everywhere means that they are trivial to change.

TASK_EDITOR_GETCON

typedef struct {
    char  *con;         /* Allocated by the contig editor */
    int    lreg;        /* Set lreg and rreg to 0 for all consensus */
    int    rreg;
    int    con_cut;
    int    qual_cut;
} task_editor_getcon;

Allocates and calculates a consensus (stored in con) between lreg and rreg. If lreg and rreg are both zero, then all the consensus is computed. The calling function is expected to free con when finished. An example of use can be seen in the stop codon code:

reg_generic gen;
task_editor_getcon tc;

gen.job = REG_GENERIC;
gen.task = TASK_EDITOR_GETCON;
gen.data = (void *)&tc;

tc.lreg = 0;
tc.rreg = 0;
tc.con_cut = consensus_cutoff;
tc.qual_cut = quality_cutoff;

if (type_contig_notify(args.io, args.contig, REG_TYPE_EDITOR,
                       (reg_data *)&gen, 0) == -1)
    return TCL_OK;

[...]

xfree(tc.con);

TASK_CANVAS_SCROLLX

TASK_CANVAS_SCROLLY

TASK_CANVAS_ZOOMBACK

TASK_CANVAS_ZOOM

TASK_CANVAS_CURSOR_X

TASK_CANVAS_CURSOR_Y

TASK_CANVAS_CURSOR_DELETE

TASK_CANVAS_RESIZE

TASK_CANVAS_REDRAW

TASK_CANVAS_WORLD

TASK_WINDOW_ADD

TASK_WINDOW_DELETE

TASK_CS_REDRAW

TASK_RENZ_INFO

TASK_TEMPLATE_REDRAW

TASK_DISPLAY_RULER

TASK_DISPLAY_TICKS


first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_185.html