Subversion Repositories Kolibri OS

Rev

Rev 878 | 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.  
  68. #define   PX_LOCK            1
  69.  
  70. typedef struct
  71. {
  72.   local_pixmap_t  *dstpix;
  73.  
  74.   color_t color;
  75. }io_clear_t;
  76.  
  77. typedef struct
  78. {
  79.   local_pixmap_t  *dstpix;
  80.  
  81.   struct
  82.   {
  83.     int x0;
  84.     int y0;
  85.   };
  86.   union
  87.   {
  88.     struct
  89.     {
  90.       int x1;
  91.       int y1;
  92.     };
  93.     struct
  94.     {
  95.       int w;
  96.       int h;
  97.     };
  98.   };
  99.   color_t color;
  100.   color_t border;
  101. }io_draw_t;
  102.  
  103. typedef struct
  104. {
  105.   local_pixmap_t  *dstpix;
  106.  
  107.   int x;
  108.   int y;
  109.   int w;
  110.   int h;
  111.  
  112.   color_t bkcolor;
  113.   color_t fcolor;
  114.  
  115.   u32_t   bmp0;
  116.   u32_t   bmp1;
  117.   color_t border;
  118. }io_fill_t;
  119.  
  120. typedef struct
  121. {
  122.   local_pixmap_t  *dstpix;
  123.   int        dst_x;
  124.   int        dst_y;
  125.  
  126.   local_pixmap_t  *srcpix;
  127.   int        src_x;
  128.   int        src_y;
  129.   int        w;
  130.   int        h;
  131.  
  132.   color_t    key;
  133. }io_blit_t;
  134.  
  135.  
  136. int CreatePixmap(pixmap_t *io);
  137.  
  138. int DestroyPixmap(pixmap_t *io);
  139.  
  140. int ClearPixmap(io_clear_t *io);
  141.  
  142. int Line(io_draw_t *draw);
  143.  
  144. int DrawRect(io_draw_t * draw);
  145.  
  146. int FillRect(io_fill_t * fill);
  147.  
  148. int Blit(io_blit_t* blit);
  149.  
  150. int BlitTransparent(io_blit_t* blit);
  151.  
  152.  
  153.  
  154.  
  155.