[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1825.0. "CDA and Global Select" by ATOI::ANDERSON () Thu Nov 30 1989 17:59

    We have run into a problem when using the CDA toolkit and the DECwindows 
    global select functionality. We believe we have found a solution to half 
    of the problem, however, I am looking for some DECwindows tricks to solve
    the other half. Any input would be greatly appreciated.

    There are two DECwindows applications: A1 and A2. In A1 the user
    has selected a region; the window has the global selection. In A2 the
    user presses MB3 to perform the quick copy.

    A1 needs to encode what was selected into DTIF using the CDA toolkit.
    A1 needs to use the incremental method of transfer due to the size
    of the thing selected. A2 also needs to use the incremental method.

    The Sender
    ----------

    A1 is the sender, and receives a callback to return the first block of
    the selection. Within this routine (we'll call this SEND_RTN), 
    A1 initializes the CDA toolkit to initiate an encoding.

    In the CDA initialization, the output routine used by the CDA toolkit
    is replaced. Therefore, any time the toolkit needs to output some 
    portion of the encoding, A1's output callback routine (we'll refer to 
    this as OUTPUT_RTN) will be called. 

    A1 then starts calling the CDA toolkit to encode the selection. The
    OUTPUT_RTN will fill some designated buffer with the encoding output
    generated within the toolkit. This buffer is only large enough to
    contain a portion of the entire encoding. It is this buffer that it
    is to be transferred to A2. During some call to OUTPUT_RTN, this buffer
    is going to become filled. At this time A1 needs to pass the buffer
    through the DECwindows toolkit to A2.

    However, A1 is stuck. In order to pass the buffer to A2 it must exit
    the SEND_RTN. This routine uses the parameters to pass back the address
    and size of the buffer. But in order to exit the SEND_RTN, it must
    return from the OUTPUT_RTN and some how tell the CDA toolkit to suspend
    its entire operation, save all of its context, and return. (When
    the next call to the SEND_RTN occurs, this context would be used to
    continue the encoding).

    It would be nice if there was some Xt routine which could be called
    to send the buffer from the OUTPUT_RTN. 

    We have been talking with the CDA toolkit people about providing
    this kind of elaborate functionality. However, even if the CDA
    toolkit provides some suspend/continue functionality, that is
    not going to help other toolkits which may be used as part of
    operations dealing with global select.

    Any ideas to get around this would be greatly appreciated.


    The Receiver
    ------------

    For the receiver (A2) we believe that we can get around this problem by 
    dispatching our own events. 

    For example, within the MB3 callback routine in A2, 
    the CDA toolkit would be initialized and the input routine replaced.
    Everytime the CDA toolkit needs more bytes to decode, it will call
    this routine. We'll call this routine INPUT_RTN.

    After the CDA toolkit is initialized, the decode operation will begin.
    The first thing the CDA toolkit will do is call the INPUT_RTN to 
    return the first bytes. Within this routine we may then loop dispatching
    existing events until the callback routine is executed which receives
    the portion of the DTIF to decode. When this callback is executed the
    incoming buffer will be copied and some flag set to indicate that
    a buffer has been received. When control returns to the INPUT_RTN,
    it will recognize that the flag is set, break from the dispatch loop
    and return the buffer to the CDA toolkit.

    The next time more input is needed by the CDA toolkit, the INPUT_RTN
    will loop (if necessary) dispatching events until the next block is
    received.

T.RTitleUserPersonal
Name
DateLines