home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI07.ARJ / ictari.07 / C / GEM_TUT / GEMCL9.C < prev   
Text File  |  1987-10-05  |  3KB  |  75 lines

  1. >>>>>>>>>>>>>>>> Routines to set clip to a GRECT <<<<<<<<<<<<<<<<
  2.  
  3.         VOID
  4. grect_to_array(area, array)     /* convert x,y,w,h to upr lt x,y and    */
  5.         GRECT   *area;          /*                    lwr rt x,y        */
  6.         WORD    *array;
  7.         {
  8.         *array++ = area->g_x;
  9.         *array++ = area->g_y;
  10.         *array++ = area->g_x + area->g_w - 1;
  11.         *array = area->g_y + area->g_h - 1;
  12.         }
  13.  
  14.         VOID
  15. set_clip(clip_flag, s_area)     /* set clip to specified area           */
  16.         WORD    clip_flag;
  17.         GRECT   *s_area;
  18.         {
  19.         WORD    pxy[4];
  20.  
  21.         grect_to_array(s_area, pxy);
  22.         vs_clip(vdi_handle, clip_flag, pxy);
  23.         }
  24.  
  25. >>>>>>>>>> Routines to set attributes before output <<<<<<<<<<<<
  26.  
  27.         VOID
  28. rr_perim(mode, color, type, width, pxy)      /* Draw a rounded    */
  29.         WORD    mode, color, width, *pxy;    /* rectangle outline */
  30.         {
  31.         vswr_mode(vdi_handle, mode);
  32.         vsl_color(vdi_handle, color);
  33.         vsl_type(vdi_handle, type);
  34.         vsl_width(vdi_handle, width);
  35.         v_rbox(vdi_handle, pxy);
  36.         vswr_mode(vdi_handle, MD_REPLACE);
  37.         }
  38.  
  39.         VOID
  40. pl_perim(mode, type, color, width, npts, pxy)     /* Draw a polygonal */
  41.                                                   /* figure           */
  42.         WORD    mode, type, color, width, npts, *pxy;
  43.         {
  44.         vswr_mode(vdi_handle, mode);
  45.         vsl_type(vdi_handle, type);
  46.         vsl_color(vdi_handle, color);
  47.         vsl_width(vdi_handle, width);
  48.         v_pline(vdi_handle, npts, pxy);
  49.         }
  50.  
  51.         VOID                  /* Draw a filled polygonal area */
  52. pl_fill(mode, perim, color, interior, style, npts, pxy)
  53.         WORD    mode, perim, color, interior, style, npts, *pxy;
  54.         {
  55.         vswr_mode(vdi_handle, mode);
  56.         vsf_color(vdi_handle, color);
  57.         vsf_style(vdi_handle, style);
  58.         vsf_interior(vdi_handle, interior);
  59.         vsf_perimeter(vdi_handle, perim);
  60.         v_fillarea(vdi_handle, npts, pxy);
  61.         }
  62.  
  63.         VOID                  /* Draw a filled rectangle    */
  64. rect_fill(mode, perim, color, interior, style, pxy)
  65.         WORD    mode, perim, color, style, interior, *pxy;
  66.         {
  67.         vswr_mode(vdi_handle, mode);
  68.         vsf_color(vdi_handle, color);
  69.         vsf_style(vdi_handle, style);
  70.         vsf_interior(vdi_handle, interior);
  71.         vsf_perimeter(vdi_handle, perim);
  72.         vr_recfl(vdi_handle, pxy);
  73.         }
  74.  
  75.