home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / WINPAINT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-28  |  2.2 KB  |  88 lines

  1. /*
  2.     winpaint.c    1/26/88
  3.  
  4.     % functions that paint from a window to the display given win char coords.
  5.     Ted.
  6.  
  7.     OWL 1.2
  8.     Copyright (c) 1988, by Oakland Group, Inc.
  9.     ALL RIGHTS RESERVED.
  10.  
  11.     Revision History:
  12.     -----------------
  13.      6/30/88 Ted    Changed from cmwin_Paint funcs to win_PaintBox funcs.
  14.     10/30/88 Ted    Relocated scroll and clear functions.
  15.  
  16.      5/24/89 jmd     prettified up some things...
  17.  
  18.      3/28/90 jmd    ansi-fied
  19. */
  20. /* -------------------------------------------------------------------------- */
  21. #include "oakhead.h"
  22. #include "disppriv.h"
  23.  
  24. /* -------------------------------------------------------------------------- */
  25. void win_PaintRow(win_type win, int row, int col, int length)
  26. /*
  27.     Repaint the a portion of window 'win' at 'row', 'col', length 'length'
  28.     (For use when the window above has been removed.)
  29. */
  30. {
  31.     ocbox cbox;    /* Painting char coords relative to win */
  32.  
  33.     if (win != NULL && length != 0) {
  34.         if (length < 0) { 
  35.             length = - length; 
  36.             col -= length;
  37.         }
  38.  
  39.         cbox.toprow = row;
  40.         cbox.leftcol = col;
  41.         cbox.botrow = row;
  42.         cbox.rightcol = col + length - 1;
  43.  
  44.         win_PaintBox(win, &cbox);
  45.     }
  46. }
  47. /* -------------------------------------------------------------------------- */
  48. void win_PaintCol(win_type win, int row, int col, int length)
  49. /*
  50.     Repaint the a portion of window 'win' at 'row', 'col', length 'length'
  51.     (For use when the window above has been removed.)
  52. */
  53. {
  54.     ocbox cbox;    /* Painting char coords relative to win */
  55.  
  56.     if (win != NULL && length != 0) {
  57.         if (length < 0) { 
  58.             length = - length;
  59.             row -= length;
  60.         }
  61.  
  62.         cbox.toprow = row;
  63.         cbox.leftcol = col;
  64.         cbox.botrow = row + length - 1;
  65.         cbox.rightcol = col;
  66.  
  67.         win_PaintBox(win, &cbox);
  68.     }
  69. }
  70. /* -------------------------------------------------------------------------- */
  71. void win_PaintBox(win_type win, ocbox *cboxp)
  72. /*
  73.     Paints part of a window's image to the display.
  74.  
  75.     'cboxp'    Clipping coords relative to win
  76. */
  77. {
  78.     opbox box;        /* display coords */
  79.  
  80.     if (win != NULL) {
  81.         ocbox_pixcoords(cboxp, win_GetFont(win), &box);
  82.  
  83.         win_PaintPixBox(win, &box);
  84.     }
  85. }
  86. /* -------------------------------------------------------------------------- */
  87.  
  88.