home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / VIDEO / WMINSCHA.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  915 b   |  40 lines

  1. /* wminscha.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <string.h>
  4. #include <sys/winmgr.h>
  5. #include "winmgr2.h"
  6.  
  7. void wm_ins_char (wm_handle wh, int x, int y, int count)
  8. {
  9.   char *mem;
  10.   int idx, px, py, len;
  11.  
  12.   if (wh->used != WM_USED || count <= 0)
  13.     return;
  14.   if (x+count >= wh->width)
  15.     count = wh->width-x;
  16.   len = wh->width-x - count;
  17.   px = x + wh->ax;
  18.   py = y + wh->ay;
  19.   idx = px + py * wh->bwidth;
  20.   mem = &wh->data[2*idx];
  21.   memmove (mem + 2 * count, mem, 2 * len);
  22.   while (--count >= 0)
  23.     {
  24.       mem[2*count+0] = ' ';
  25.       mem[2*count+1] = (char)wh->wattr;
  26.     }
  27.   if (wh->display)
  28.     {
  29.       px = x+wh->x0;
  30.       py = y+wh->y0;
  31.       if (wh->visible)
  32.         _wm_move2 (mem, py, px, wh->bx1, 1);
  33.       else
  34.         _wm_line2 (&wh->mask[idx], mem, py, px, wh->bx1);
  35.     }
  36.   else
  37.     wh->update_req = TRUE;
  38.   _wm_cursor1 ();
  39. }
  40.