Subversion Repositories Kolibri OS

Rev

Rev 954 | 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.   unsigned  pitch;
  48.   void      *mapped;
  49.   u32_t     handle;
  50. }pixmap_t;
  51.  
  52.  
  53. typedef struct
  54. {
  55.   unsigned  width;
  56.   unsigned  height;
  57.   u32_t     format;
  58.   u32_t     flags;
  59.  
  60.   unsigned  pitch;
  61.   void      *mapped;
  62.  
  63.   unsigned  pitch_offset;
  64.   void      *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.  
  74. #define   PX_LOCK         1
  75.  
  76. typedef struct
  77. {
  78.   local_pixmap_t  *dstpix;
  79.  
  80.   color_t color;
  81. }io_clear_t;
  82.  
  83. typedef struct
  84. {
  85.   local_pixmap_t  *dstpix;
  86.  
  87.   struct
  88.   {
  89.     int x0;
  90.     int y0;
  91.   };
  92.   union
  93.   {
  94.     struct
  95.     {
  96.       int x1;
  97.       int y1;
  98.     };
  99.     struct
  100.     {
  101.       int w;
  102.       int h;
  103.     };
  104.   };
  105.   color_t color;
  106.   color_t border;
  107. }io_draw_t;
  108.  
  109. typedef struct
  110. {
  111.   local_pixmap_t  *dstpix;
  112.  
  113.   int x;
  114.   int y;
  115.   int w;
  116.   int h;
  117.  
  118.   color_t bkcolor;
  119.   color_t fcolor;
  120.  
  121.   u32_t   bmp0;
  122.   u32_t   bmp1;
  123.   color_t border;
  124. }io_fill_t;
  125.  
  126. typedef struct
  127. {
  128.   local_pixmap_t  *dstpix;
  129.   int        dst_x;
  130.   int        dst_y;
  131.  
  132.   local_pixmap_t  *srcpix;
  133.   int        src_x;
  134.   int        src_y;
  135.   int        w;
  136.   int        h;
  137.  
  138.   union {
  139.     color_t    key;
  140.     color_t    alpha;
  141.   };
  142. }io_blit_t;
  143.  
  144.  
  145. int CreatePixmap(pixmap_t *io);
  146.  
  147. int DestroyPixmap(pixmap_t *io);
  148.  
  149. int ClearPixmap(io_clear_t *io);
  150.  
  151. int Line(io_draw_t *draw);
  152.  
  153. int DrawRect(io_draw_t * draw);
  154.  
  155. int FillRect(io_fill_t * fill);
  156.  
  157. int Blit(io_blit_t* blit);
  158.  
  159. int BlitTransparent(io_blit_t* blit);
  160.  
  161.  
  162.  
  163.  
  164.