home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / WINPAINT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  2.2 KB  |  90 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.1
  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. /* -------------------------------------------------------------------------- */
  19. #include "oakhead.h"
  20. #include "disppriv.h"
  21.  
  22. /* -------------------------------------------------------------------------- */
  23. void win_PaintRow(win, row, col, length)
  24.     win_type win;
  25.     int row, col, 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, row, col, length)
  49.     win_type win;
  50.     int row, col, length;
  51. /*
  52.     Repaint the a portion of window 'win' at 'row', 'col', length 'length'
  53.     (For use when the window above has been removed.)
  54. */
  55. {
  56.     ocbox cbox;    /* Painting char coords relative to win */
  57.  
  58.     if (win != NULL && length != 0) {
  59.         if (length < 0) { 
  60.             length = - length;
  61.             row -= length;
  62.         }
  63.  
  64.         cbox.toprow = row;
  65.         cbox.leftcol = col;
  66.         cbox.botrow = row + length - 1;
  67.         cbox.rightcol = col;
  68.  
  69.         win_PaintBox(win, &cbox);
  70.     }
  71. }
  72. /* -------------------------------------------------------------------------- */
  73. void win_PaintBox(win, cboxp)
  74.     win_type win;
  75.     ocbox *cboxp;    /* Clipping coords relative to win */
  76. /*
  77.     Paints part of a window's image to the display.
  78. */
  79. {
  80.     opbox box;        /* display coords */
  81.  
  82.     if (win != NULL) {
  83.         ocbox_pixcoords(cboxp, win_GetFont(win), &box);
  84.  
  85.         win_PaintPixBox(win, &box);
  86.     }
  87. }
  88. /* -------------------------------------------------------------------------- */
  89.  
  90.