Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. #define PX_CREATE              1
  3. #define PX_DESTROY             2
  4. #define PX_CLEAR               3
  5. #define PX_DRAW_RECT           4
  6. #define PX_FILL_RECT           5
  7. #define PX_LINE                6
  8. #define PX_BLIT                7
  9. #define PX_BLIT_TRANSPARENT    8
  10. #define PX_BLIT_ALPHA          9
  11.  
  12.  
  13.  
  14. typedef unsigned int color_t;
  15.  
  16. typedef struct
  17. {
  18.   int x;
  19.   int y;
  20. }pt_t;
  21.  
  22. /***********               Clipping             **********/
  23.  
  24. typedef struct
  25. {
  26.   int xmin;
  27.   int ymin;
  28.   int xmax;
  29.   int ymax;
  30. }clip_t, *PTRclip;
  31.  
  32. #define CLIP_TOP          1
  33. #define CLIP_BOTTOM       2
  34. #define CLIP_RIGHT        4
  35. #define CLIP_LEFT         8
  36.  
  37. int LineClip ( clip_t *clip, int *x1, int *y1, int *x2, int *y2 );
  38.  
  39. int BlockClip( clip_t *clip, int *x1, int *y1, int *x2, int* y2 );
  40.  
  41. typedef struct
  42. {
  43.   unsigned   width;
  44.   unsigned   height;
  45.   u32_t      format;
  46.   u32_t      flags;
  47.   size_t     pitch;
  48.   void      *mapped;
  49.  
  50.   u32_t     handle;
  51. }pixmap_t;
  52.  
  53.  
  54. typedef struct
  55. {
  56.   unsigned   width;
  57.   unsigned   height;
  58.   u32_t      format;
  59.   u32_t      flags;
  60.   size_t     pitch;
  61.   void      *mapped;
  62.  
  63.   unsigned  pitch_offset;
  64.   addr_t    local;
  65. }local_pixmap_t;
  66.  
  67. #define  PX_MEM_SYSTEM    0
  68. #define  PX_MEM_LOCAL     1
  69. #define  PX_MEM_GART      2
  70.  
  71. #define  PX_MEM_MASK      3
  72.  
  73. #define  PX_LOCK          1
  74.  
  75. typedef struct
  76. {
  77.   local_pixmap_t  *dstpix;
  78.  
  79.   color_t color;
  80. }io_clear_t;
  81.  
  82. typedef struct
  83. {
  84.   local_pixmap_t  *dstpix;
  85.  
  86.   struct
  87.   {
  88.     int x0;
  89.     int y0;
  90.   };
  91.   union
  92.   {
  93.     struct
  94.     {
  95.       int x1;
  96.       int y1;
  97.     };
  98.     struct
  99.     {
  100.       int w;
  101.       int h;
  102.     };
  103.   };
  104.   color_t color;
  105.   color_t border;
  106. }io_draw_t;
  107.  
  108. typedef struct
  109. {
  110.   local_pixmap_t  *dstpix;
  111.  
  112.   int x;
  113.   int y;
  114.   int w;
  115.   int h;
  116.  
  117.   color_t bkcolor;
  118.   color_t fcolor;
  119.  
  120.   u32_t   bmp0;
  121.   u32_t   bmp1;
  122.   color_t border;
  123. }io_fill_t;
  124.  
  125. typedef struct
  126. {
  127.   local_pixmap_t  *dstpix;
  128.   int        dst_x;
  129.   int        dst_y;
  130.  
  131.   local_pixmap_t  *srcpix;
  132.   int        src_x;
  133.   int        src_y;
  134.   int        w;
  135.   int        h;
  136.  
  137.   union {
  138.     color_t    key;
  139.     color_t    alpha;
  140.   };
  141. }io_blit_t;
  142.  
  143.  
  144. static addr_t bind_pixmap(local_pixmap_t *pixmap);
  145.  
  146.  
  147. int CreatePixmap(pixmap_t *io);
  148.  
  149. int DestroyPixmap(pixmap_t *io);
  150.  
  151. int ClearPixmap(io_clear_t *io);
  152.  
  153. int Line(io_draw_t *draw);
  154.  
  155. int DrawRect(io_draw_t * draw);
  156.  
  157. int FillRect(io_fill_t * fill);
  158.  
  159. int Blit(io_blit_t* blit);
  160.  
  161. int BlitTransparent(io_blit_t* blit);
  162.  
  163.  
  164.  
  165.  
  166.