home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / trionbbs110 / Trion / docs / RIPdoors / ripbuttons.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-06  |  3.2 KB  |  129 lines

  1.  
  2.  
  3. /*  Trion BBS 'RIPscrip Clidoor Support' system functions               */
  4. /*                                                                      */
  5. /*  V 1.00   08 - Jan - 1998                                            */
  6. /*                                                                      */
  7. /*  (c) Copyright 1995-98 by Paul Spijkerman                            */
  8.  
  9.  
  10. #include "ripdoor.h"
  11.  
  12.  
  13.  
  14.  
  15. void ButtonStyle(UWORD wid,  UWORD hgt,     UWORD orient, UWORD flags,
  16.                  UWORD size, UWORD dfore,   UWORD dback,  UWORD bright,
  17.                  UWORD dark, UWORD surface, UWORD grp_no, UWORD flags2,
  18.                  UWORD uline_col, UWORD corner_col )
  19. {
  20.    UBYTE *str = "!|1B000000000000000000000000000000000000";
  21.  
  22.    Store2Chars( &str[ 4],  wid        );
  23.    Store2Chars( &str[ 6],  hgt        );
  24.    Store2Chars( &str[ 8],  orient     );
  25.    Store4Chars( &str[10],  flags      );
  26.    Store2Chars( &str[14],  size       );
  27.    Store2Chars( &str[16],  dfore      );
  28.    Store2Chars( &str[18],  dback      );
  29.    Store2Chars( &str[20],  bright     );
  30.    Store2Chars( &str[22],  dark       );
  31.    Store2Chars( &str[24],  surface    );
  32.    Store2Chars( &str[26],  grp_no     );
  33.    Store2Chars( &str[28],  flags2     );
  34.    Store2Chars( &str[30],  uline_col  );
  35.    Store2Chars( &str[32],  corner_col );
  36. /* Store6Chars( &str[34],  reserved   );   */
  37.  
  38.    printf( "%s\r\n" , str);
  39. }
  40.  
  41. void RipButton(UWORD x1, UWORD y1, UWORD x2, UWORD y2, UBYTE hotkey,
  42.                UWORD flags, UBYTE *text)
  43. {
  44.    UBYTE *str = "!|1U000000000000";
  45.  
  46.    Store2Chars( &str[ 4], x1 );
  47.    Store2Chars( &str[ 6], y1 );
  48.  
  49.    Store2Chars( &str[ 8], x2 );
  50.    Store2Chars( &str[10], y2 );
  51.  
  52.    Store2Chars( &str[12], hotkey   );
  53.    Store1Chars( &str[14], flags    );
  54. /* Store1Chars( &str[15], reserved ); */
  55.  
  56.    printf( "%s%s\r\n" , str, text);
  57. }
  58.  
  59.  
  60.  
  61. /* copy image to clipboard */
  62.  
  63. void  GetImage      (UWORD x1, UWORD y1, UWORD x2, UWORD y2)
  64. {
  65.    UBYTE *str = "!|1C000000000";
  66.  
  67.    Store2Chars( &str[ 4], x1 );
  68.    Store2Chars( &str[ 6], y1 );
  69.  
  70.    Store2Chars( &str[ 8], x2 );
  71.    Store2Chars( &str[10], y2 );
  72. /* Store1Chars( &str[12], reserved ); */
  73.  
  74.    printf( "%s\r\n" , str);
  75. }
  76.  
  77. /* paste clipboard image to screen */
  78. /* Mode: 0=copy, 1=XOR, 2=OR, 3=AND, 4=NOT */
  79.  
  80. void  PutImage      (UWORD  x, UWORD  y, UWORD mode)
  81. {
  82.    UBYTE *str = "!|1P0000000";
  83.  
  84.    Store2Chars( &str[ 4], x  );
  85.    Store2Chars( &str[ 6], y  );
  86.  
  87.    Store2Chars( &str[ 8], mode );
  88. /* Store1Chars( &str[10], reserved ); */
  89.  
  90.    printf( "%s\r\n" , str);
  91. }
  92.  
  93. /* write clipboard contents to disk */
  94.  
  95. void  WriteIcon     (UBYTE *name)
  96. {
  97.    UBYTE *str = "!|1W0";
  98.  
  99. /* Store1Chars( &str[ 4], reserved ); */
  100.  
  101.    printf( "%s%s\r\n" , str, name);
  102. }
  103.  
  104. /* loads and displays a disk based icon to screen  */
  105. /* Mode: 0=copy, 1=XOR, 2=OR, 3=AND, 4=NOT         */
  106. /* if clip=1 image is also copied to the clipboard */
  107. /* if clip=0 image is only pasted on the screen    */
  108.  
  109. void  LoadIcon      (UWORD x, UWORD y, UWORD mode, UWORD clip, UBYTE *name)
  110. {
  111.    UBYTE *str = "!|1I000000010";     /* don't change the "10" part ! */
  112.  
  113.    Store2Chars( &str[ 4], x  );
  114.    Store2Chars( &str[ 6], y  );
  115.  
  116.    Store2Chars( &str[ 8], mode );
  117.    Store1Chars( &str[10], clip );
  118.  
  119. /* Store2Chars( &str[11], reserved ); */   /* default "10" */
  120.  
  121.    printf( "%s%s\r\n" , str, name);
  122. }
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.