home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / demo1.zoo / demo / tests / test_rop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-24  |  2.4 KB  |  103 lines

  1. /*                        Copyright (c) 1987 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: test_rop.c,v 4.1 88/06/21 14:02:09 bianchi Exp $
  9.     $Source: /tmp/mgrsrc/demo/tests/RCS/test_rop.c,v $
  10. */
  11. static char    RCSid_[] = "$Source: /tmp/mgrsrc/demo/tests/RCS/test_rop.c,v $$Revision: 4.1 $";
  12.  
  13.  
  14. /* test raster op functions */
  15.  
  16. #include <signal.h>
  17. #include "term.h"
  18.  
  19. char *op_names[] = {
  20.    "0", 
  21.    "~(destination | source)",
  22.    "destination & ~source",
  23.    "~source",
  24.    "~destination & source",
  25.    "~destination",
  26.    "destination ^ source",
  27.    "~(destination & source)",
  28.    "destination & source",
  29.    "~(destination ^ source)",
  30.    "destination",
  31.    "destination | ~source",
  32.    "source",
  33.    "~destination | source",
  34.    "destination | source",
  35.    "~0"    
  36.    };
  37.    
  38. char buff[100];
  39.  
  40. main(argc,argv)
  41. int argc;
  42. char **argv;
  43.    {
  44.    register int i;
  45.    int clean();
  46.    int f_high;
  47.  
  48.    m_setup(M_FLUSH);
  49.    m_ttyset();
  50.    get_font(0,&f_high);
  51.  
  52.    signal(SIGINT,clean);
  53.    signal(SIGTERM,clean);
  54.  
  55.    m_clear();
  56.  
  57.    m_moveprint( 70, 190, "destination" );
  58.    m_moveprint( 70 + 333, 190, "source" );
  59.    m_func(B_SET);
  60.    for(i=0;i<3;i++)
  61.       m_bitwrite(70+333*i,200,200,600);
  62.    m_func(B_CLEAR);
  63.    for(i=0;i<2;i++)
  64.       m_bitwrite(75+333*i,205,190,590);
  65.    m_func(B_SET);
  66.    m_bitwrite(75+333*0,205,85,590);
  67.    m_bitwrite(75+333*1,205,190,295);
  68.  
  69.    for(i=0;i<16;i++) {
  70.       m_func(B_SET);
  71.       m_moveprint(10,f_high*2,"destination ...");
  72.       m_cleareol();
  73.       m_moveprint( 70 + 333*2, 190, "destination" );
  74.       m_cleareol();
  75.       m_func(B_CLEAR);
  76.       m_bitwrite(75+333*2,205,190,590);
  77.       m_func(B_SET);
  78.       m_bitwrite(75+333*2,205,85,590);
  79.       m_func(i);
  80.       sleep(1);
  81.       m_bitcopy(75+333*2,205,190,590,75+333*1,205);
  82.       sprintf(buff,"function %d: %s",i,op_names[i]);
  83.       m_moveprint(10,f_high*2,buff);
  84.       m_cleareol();
  85.       sprintf( buff, "function %d", i );
  86.       m_moveprint( 70 + 333*2, 190, buff );
  87.       m_cleareol();
  88.       m_cleareol();
  89.       m_gets(buff);
  90.       }
  91.    clean(0);
  92.    }
  93.  
  94. /* restore window state and exit */
  95.  
  96. clean(n)
  97. int n;
  98.    {
  99.    m_ttyreset();
  100.    m_popall();
  101.    exit(n);
  102.    }
  103.