Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. brush_t* CreateHatch(int hatch, color_t bkcolor, color_t fcolor)
  3. {
  4.   if (hatch < HATCH_MAX)
  5.   {
  6.     if( br_slab.available )
  7.     {
  8.       brush_t *brush;
  9.  
  10.       br_slab.available--;
  11.       brush = (brush_t*)br_slab.nextavail;
  12.       br_slab.nextavail = *(void**)brush;
  13.  
  14.       brush->bkcolor = bkcolor;
  15.       brush->fcolor  = fcolor;
  16.  
  17.       brush->bmp[0] = hatches[hatch*2];
  18.       brush->bmp[1] = hatches[hatch*2+1];
  19.       return brush;
  20.     }
  21.     return NULL;
  22.   }
  23.   return NULL;
  24. };
  25.  
  26. brush_t* CreateMonoBrush(color_t bkcolor, color_t fcolor,u32_t bmp0,u32_t bmp1)
  27. {
  28.      if( br_slab.available )
  29.      {
  30.        brush_t *brush;
  31.  
  32.        br_slab.available--;
  33.        brush = (brush_t*)br_slab.nextavail;
  34.        br_slab.nextavail = *(void**)brush;
  35.  
  36.        brush->bkcolor = bkcolor;
  37.        brush->fcolor  = fcolor;
  38.  
  39.        brush->bmp[0] = bmp0;
  40.        brush->bmp[1] = bmp1;
  41.        return brush;
  42.      }
  43.      return NULL;
  44. };
  45.  
  46. void DestroyBrush(brush_t *brush)
  47. {
  48.   *(void**)brush = br_slab.nextavail;
  49.   br_slab.nextavail = brush;
  50.   br_slab.available++;
  51. };
  52.