home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / xfedor.zip / XFree86 / src / xfedor / ed_write.c < prev    next >
C/C++ Source or Header  |  1999-03-02  |  1KB  |  65 lines

  1. /* Copyright 1989 GROUPE BULL -- See licence conditions in file COPYRIGHT */
  2. #include <stdio.h>
  3. #include "couche.h"        /* myEvent */
  4. #include "clientimage.h"        /* ClientImage pour fedor.h */
  5. #include "fedor.h"
  6.  
  7. extern fedchar  chartab[MAXFONTCARD];
  8. extern int editresol ;
  9. extern BackColor, CurColor ;
  10.  
  11. Autom_write(pev)
  12.     myEvent        *pev;
  13. {
  14.     static int      x, y;
  15.     int             hcar, code;
  16.     register int    i, j;
  17.     register fedchar *pcar;
  18.     int oldresol ;
  19.     int  color ;
  20.  
  21.     switch (pev->type) {
  22.     case EnterZone:
  23.         Afficher_boutons("ORIGIN", "ORIGIN");
  24.         Invpoint(x, y);
  25.         break;
  26.     case ButtonPressed:
  27.         Invpoint(x, y);
  28.         x = convert(pev->x);
  29.         y = convert(pev->y);
  30.         Invpoint(x, y);
  31.         break;
  32.     case KeyPressed:
  33.         code = pev->key;
  34.         if ((code >= 0) && (code < MAXFONTCARD)) {
  35.                 Invpoint(x, y);
  36.             Dodo();
  37.             pcar = &chartab[code];
  38.             x += pcar->hadj;
  39.             hcar = pcar->down - pcar->up;
  40.             for (i = 0; i < pcar->hsize; i++)
  41.                 for (j = 0; j < hcar; j++)
  42.                 if (Rast_Inq(pcar->image, i, j) != 0 ) 
  43.                   /* pcar monochrome */
  44.                     Adjpoint(x + i, y + pcar->up + j);
  45.                       
  46.             x += pcar->hincr;
  47.             oldresol = editresol ;
  48.             Changer_editresol() ;
  49.             if (oldresol != editresol) MontrerCarTrav() ; 
  50.             else {
  51.                 CarFen();
  52.                 Aff_all();
  53.             }
  54.             Invpoint(x, y);
  55.         }
  56.         break;
  57.     case LeaveZone:
  58.         Afficher_numview(-1, -1);    /* restaure le gris */
  59.         Afficher_boutons("", "");
  60.         Invpoint(x, y);
  61.         break;
  62.     case CloseWindow : break ;                
  63.     }
  64. }
  65.