Subversion Repositories Kolibri OS

Rev

Rev 877 | 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_DRAW_RECT           3
  5. #define PX_FILL_RECT           4
  6. #define PX_LINE                5
  7. #define PX_BLIT                6
  8. #define PX_BLIT_TRANSPARENT    7
  9. #define PX_BLIT_ALPHA          8
  10.  
  11. //#define BLIT         4
  12. //#define COMPIZ       5
  13.  
  14.  
  15. typedef unsigned int color_t;
  16.  
  17. typedef struct
  18. {
  19.   int x;
  20.   int y;
  21. }pt_t;
  22.  
  23. /***********               Clipping             **********/
  24.  
  25. typedef struct
  26. {
  27.   int xmin;
  28.   int ymin;
  29.   int xmax;
  30.   int ymax;
  31. }clip_t, *PTRclip;
  32.  
  33. #define CLIP_TOP          1
  34. #define CLIP_BOTTOM       2
  35. #define CLIP_RIGHT        4
  36. #define CLIP_LEFT         8
  37.  
  38. int LineClip ( clip_t *clip, int *x1, int *y1, int *x2, int *y2 );
  39.  
  40. int BlockClip( clip_t *clip, int *x1, int *y1, int *x2, int* y2 );
  41.  
  42. typedef struct
  43. {
  44.   unsigned  width;
  45.   unsigned  height;
  46.   u32_t     format;
  47.   u32_t     flags;
  48.   unsigned  pitch;
  49.   void      *mapped;
  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.  
  61.   unsigned  pitch;
  62.   void      *mapped;
  63.  
  64.   unsigned  pitch_offset;
  65.   void      *local;
  66. }local_pixmap_t;
  67.  
  68. //int CreatePixmap(userpixmap_t *io);
  69. //int DestroyPixmap(userpixmap_t *io);
  70. //int LockPixmap(userpixmap_t *io);
  71. //int UnlockPixmap(userpixmap_t *io);
  72.  
  73. #define   PX_LOCK            1
  74.  
  75. typedef struct
  76. {
  77.   local_pixmap_t  *dstpix;
  78.  
  79.   struct
  80.   {
  81.     int x0;
  82.     int y0;
  83.   };
  84.   union
  85.   {
  86.     struct
  87.     {
  88.       int x1;
  89.       int y1;
  90.     };
  91.     struct
  92.     {
  93.       int w;
  94.       int h;
  95.     };
  96.   };
  97.   color_t color;
  98.   color_t border;
  99. }draw_t;
  100.  
  101. typedef struct
  102. {
  103.   local_pixmap_t  *dstpix;
  104.  
  105.   int x;
  106.   int y;
  107.   int w;
  108.   int h;
  109.  
  110.   color_t bkcolor;
  111.   color_t fcolor;
  112.  
  113.   u32_t   bmp0;
  114.   u32_t   bmp1;
  115. }fill_t;
  116.  
  117. typedef struct
  118. {
  119.   int src_x;
  120.   int src_y;
  121.   int dst_x;
  122.   int dst_y;
  123.   int w;
  124.   int h;
  125. }blit_t;
  126.  
  127. typedef struct
  128. {
  129.   local_pixmap_t  *dstpix;
  130.   int        dst_x;
  131.   int        dst_y;
  132.  
  133.   local_pixmap_t  *srcpix;
  134.   int        src_x;
  135.   int        src_y;
  136.   int        w;
  137.   int        h;
  138. }pixblit_t;
  139.  
  140.  
  141. int Line2P(draw_t *draw);
  142.  
  143. int DrawRect(draw_t * draw);
  144. int FillRect(fill_t * fill);
  145.  
  146. int Blit(blit_t *blit);
  147.  
  148. int RadeonComposite( blit_t *blit);
  149.  
  150.  
  151. int PixBlit(pixblit_t* blit);
  152.  
  153.  
  154.  
  155.  
  156.