IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2888


Ignore:
Timestamp:
Jan 4, 2005, 10:24:45 AM (22 years ago)
Author:
eugene
Message:

both active and inactive cursor mana signal interprets are now in this loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kii/event/CheckPipe.c

    r2466 r2888  
    11# include "Ximage.h"
    22# define STRCONST(A) ((int)(0x1000000*A[0] + 0x10000*A[1] + 0x100*A[2] + 0x1*A[3]))
     3# define DEBUG 0
     4
     5static int ActiveCursor = FALSE;
    36
    47int CheckPipe (Graphic *graphic, Layout *layout) {
    58
    69  int status;
    7   char buffer[1024];
     10  char buffer[20];
     11
     12  bzero (buffer, 20);
    813
    914  /* attempt to read 4 bytes from stdin */
    10 
    1115  status = read (layout[0].Ximage, buffer, 4);
    12   buffer[4] = 0;
    1316
    1417  switch (status) {
     
    2427
    2528  case 4:
    26 /*    fprintf (stderr, "got signal %s from pipe\n", buffer);    */
     29    if (DEBUG) fprintf (stderr, "got signal %s from pipe\n", buffer);
    2730    break;
    2831
     
    3235    break;
    3336  }
     37 
     38  /* In Active Cursor mode, we can only receive the NCUR signal */
     39  if (ActiveCursor) {
     40    if (!strcmp (buffer, "NCUR")) {
     41      ActiveCursor = FALSE;
     42      return (2);
     43    }
     44    fprintf (stderr, "unknown signal %s\n", buffer);
     45    return (TRUE);
     46  }
    3447
    35  
    3648  if (!strcmp (buffer, "QUIT")) {
    37     /* fprintf (stderr, "Goodbye!\n"); */
     49    if (DEBUG) fprintf (stderr, "Goodbye!\n");
    3850    return (FALSE);
    3951  }
     
    4557
    4658  if (!strcmp (buffer, "CURS")) {
     59    ActiveCursor = TRUE;
    4760    status = cursor (graphic, layout);
    4861    return (status);
     62  }
     63
     64  if (!strcmp (buffer, "NCUR")) {
     65    fprintf (stderr, "error: not in active cursor mode\n");
     66    return (TRUE);
    4967  }
    5068
Note: See TracChangeset for help on using the changeset viewer.