home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / clibs / HeapGraph / !HeapDisp / c / Redaw < prev    next >
Encoding:
Text File  |  1994-09-01  |  1.5 KB  |  67 lines

  1. #include "DeskLib:WimpSWIs.h"
  2.  
  3. #include "Shell.Shell.h"
  4.  
  5. #include "Redraw.h"
  6. #include "Structs.h"
  7.  
  8.  
  9.  
  10.  
  11. void    HeapRedrawer(
  12.         Shell_convertpoint    convert,
  13.         wimp_point        rectsize,
  14.         void            *reference,
  15.         const wimp_rect        *redrawrect
  16.         )
  17. {
  18. app_block    *app = (app_block *) reference;
  19. int        i, minpos, maxpos;
  20. int        lastymax = 0;
  21.  
  22.  
  23. minpos = (redrawrect->min.y-2*Shell_PIXELYSIZE) * app->words_per_os + app->min_mem;
  24. maxpos = (redrawrect->max.y+2*Shell_PIXELYSIZE) * app->words_per_os + app->min_mem;
  25.  
  26. for ( i=0; i<app->num_blocks; i++)    {
  27.     int    ymin, ymax;
  28.  
  29.     if ( app->blocks[i].pos > maxpos)            break;
  30.     if ( app->blocks[i].pos+app->blocks[i].size < minpos)    continue;
  31.  
  32.     ymin = (app->blocks[i].pos-app->min_mem) / app->words_per_os;
  33.     ymax = (app->blocks[i].pos-app->min_mem+app->blocks[i].size) / app->words_per_os;
  34.  
  35.  
  36.     if ( ymin>=lastymax)    {
  37.         Wimp_SetColour( colour_BLACK);
  38.         Shell_RectangleFill2( 0, lastymax, rectsize.x, ymin, convert);
  39.         }
  40.  
  41.     if ( ymax-ymin>Shell_PIXELYSIZE)    {
  42.         Wimp_SetColour( 8 + (app->blocks[i].ref & 7));
  43.         Shell_RectangleFill2( 0, ymin, rectsize.x, ymax, convert);
  44.         }
  45.  
  46.     Wimp_SetColour( colour_WHITE);
  47.     Shell_Move( 0, ymin, convert);
  48.     GFX_Plot( plot_SOLIDEXFINAL + plot_DRAWRELFORE, rectsize.x, 0);
  49.     Shell_Move( 0, ymax, convert);
  50.     GFX_Plot( plot_SOLIDEXFINAL + plot_DRAWRELFORE, rectsize.x, 0);
  51.  
  52.     lastymax = ymax+Shell_PIXELYSIZE;
  53.  
  54.     }
  55.  
  56.  
  57. if ( rectsize.y>lastymax)    {
  58.     Wimp_SetColour( colour_BLACK);
  59.     Shell_RectangleFill2( 0, lastymax, rectsize.x, rectsize.y, convert);
  60.     }
  61.  
  62.  
  63. return;
  64. }
  65.  
  66.  
  67.