| convert.h | | convert.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| | | | |
| #define PIXEL_RGB332(r,g,b) ( (((r)&0xE0) ) | \ | | #define PIXEL_RGB332(r,g,b) ( (((r)&0xE0) ) | \ | |
| (((g)&0xE0) >> 3) | \ | | (((g)&0xE0) >> 3) | \ | |
| (((b)&0xC0) >> 6) ) | | (((b)&0xC0) >> 6) ) | |
| | | | |
| #define PIXEL_ARGB1555(a,r,g,b)( (((a)&0x80) << 8) | \ | | #define PIXEL_ARGB1555(a,r,g,b)( (((a)&0x80) << 8) | \ | |
| (((r)&0xF8) << 7) | \ | | (((r)&0xF8) << 7) | \ | |
| (((g)&0xF8) << 2) | \ | | (((g)&0xF8) << 2) | \ | |
| (((b)&0xF8) >> 3) ) | | (((b)&0xF8) >> 3) ) | |
| | | | |
|
| | | #define PIXEL_RGBA5551(a,r,g,b)( (((a)&0x80) >> 7) | \ | |
| | | (((r)&0xF8) << 8) | \ | |
| | | (((g)&0xF8) << 3) | \ | |
| | | (((b)&0xF8) >> 2) ) | |
| | | | |
| #define PIXEL_RGB555(r,g,b) ( (((r)&0xF8) << 7) | \ | | #define PIXEL_RGB555(r,g,b) ( (((r)&0xF8) << 7) | \ | |
| (((g)&0xF8) << 2) | \ | | (((g)&0xF8) << 2) | \ | |
| (((b)&0xF8) >> 3) ) | | (((b)&0xF8) >> 3) ) | |
| | | | |
| #define PIXEL_BGR555(r,g,b) ( (((b)&0xF8) << 7) | \ | | #define PIXEL_BGR555(r,g,b) ( (((b)&0xF8) << 7) | \ | |
| (((g)&0xF8) << 2) | \ | | (((g)&0xF8) << 2) | \ | |
| (((r)&0xF8) >> 3) ) | | (((r)&0xF8) >> 3) ) | |
| | | | |
| #define PIXEL_ARGB2554(a,r,g,b)( (((a)&0xC0) << 8) | \ | | #define PIXEL_ARGB2554(a,r,g,b)( (((a)&0xC0) << 8) | \ | |
| (((r)&0xF8) << 6) | \ | | (((r)&0xF8) << 6) | \ | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 88 | |
| (((b)&0xF0) >> 4) ) | | (((b)&0xF0) >> 4) ) | |
| | | | |
| #define PIXEL_RGB16(r,g,b) ( (((r)&0xF8) << 8) | \ | | #define PIXEL_RGB16(r,g,b) ( (((r)&0xF8) << 8) | \ | |
| (((g)&0xFC) << 3) | \ | | (((g)&0xFC) << 3) | \ | |
| (((b)&0xF8) >> 3) ) | | (((b)&0xF8) >> 3) ) | |
| | | | |
| #define PIXEL_RGB18(r,g,b) ( (((r)&0xFC) << 10) | \ | | #define PIXEL_RGB18(r,g,b) ( (((r)&0xFC) << 10) | \ | |
| (((g)&0xFC) << 4) | \ | | (((g)&0xFC) << 4) | \ | |
| (((b)&0xFC) >> 2) ) | | (((b)&0xFC) >> 2) ) | |
| | | | |
|
| #define PIXEL_RGB32(r,g,b) ( ((r) << 16) | \ | | #define PIXEL_RGB32(r,g,b) ( (0xff << 24) | \ | |
| ((g) << 8) | \ | | ((r) << 16) | \ | |
| | | ((g) << 8) | \ | |
| (b) ) | | (b) ) | |
| | | | |
| #define PIXEL_ARGB(a,r,g,b) ( ((a) << 24) | \ | | #define PIXEL_ARGB(a,r,g,b) ( ((a) << 24) | \ | |
| ((r) << 16) | \ | | ((r) << 16) | \ | |
| ((g) << 8) | \ | | ((g) << 8) | \ | |
| (b) ) | | (b) ) | |
| | | | |
| #define PIXEL_ARGB1666(a,r,g,b) ( (((a)&0x80) << 11) | \ | | #define PIXEL_ARGB1666(a,r,g,b) ( (((a)&0x80) << 11) | \ | |
| (((r)&0xFC) << 10) | \ | | (((r)&0xFC) << 10) | \ | |
| (((g)&0xFC) << 4) | \ | | (((g)&0xFC) << 4) | \ | |
| | | | |
| skipping to change at line 306 | | skipping to change at line 312 | |
| | | | |
| #define RGB32_TO_RGB444(pixel) ( (((pixel) & 0xF00000) >> 12) | \ | | #define RGB32_TO_RGB444(pixel) ( (((pixel) & 0xF00000) >> 12) | \ | |
| (((pixel) & 0x00F000) >> 8) | \ | | (((pixel) & 0x00F000) >> 8) | \ | |
| (((pixel) & 0x0000F0) >> 4) ) | | (((pixel) & 0x0000F0) >> 4) ) | |
| | | | |
| #define ARGB_TO_ARGB1555(pixel) ( (((pixel) & 0x80000000) >> 16) | \ | | #define ARGB_TO_ARGB1555(pixel) ( (((pixel) & 0x80000000) >> 16) | \ | |
| (((pixel) & 0x00F80000) >> 9) | \ | | (((pixel) & 0x00F80000) >> 9) | \ | |
| (((pixel) & 0x0000F800) >> 6) | \ | | (((pixel) & 0x0000F800) >> 6) | \ | |
| (((pixel) & 0x000000F8) >> 3) ) | | (((pixel) & 0x000000F8) >> 3) ) | |
| | | | |
|
| | | #define ARGB_TO_RGBA5551(pixel) ( (((pixel) & 0x80000000) >> 31) | \ | |
| | | (((pixel) & 0x00F80000) >> 8) | \ | |
| | | (((pixel) & 0x0000F800) >> 5) | \ | |
| | | (((pixel) & 0x000000F8) >> 2) ) | |
| | | | |
| #define ARGB_TO_ARGB2554(pixel) ( (((pixel) & 0xC0000000) >> 16) | \ | | #define ARGB_TO_ARGB2554(pixel) ( (((pixel) & 0xC0000000) >> 16) | \ | |
| (((pixel) & 0x00F80000) >> 10) | \ | | (((pixel) & 0x00F80000) >> 10) | \ | |
| (((pixel) & 0x0000F800) >> 7) | \ | | (((pixel) & 0x0000F800) >> 7) | \ | |
| (((pixel) & 0x000000F0) >> 4) ) | | (((pixel) & 0x000000F0) >> 4) ) | |
| | | | |
| #define ARGB_TO_ARGB4444(pixel) ( (((pixel) & 0xF0000000) >> 16) | \ | | #define ARGB_TO_ARGB4444(pixel) ( (((pixel) & 0xF0000000) >> 16) | \ | |
| (((pixel) & 0x00F00000) >> 12) | \ | | (((pixel) & 0x00F00000) >> 12) | \ | |
| (((pixel) & 0x0000F000) >> 8) | \ | | (((pixel) & 0x0000F000) >> 8) | \ | |
| (((pixel) & 0x000000F0) >> 4) ) | | (((pixel) & 0x000000F0) >> 4) ) | |
| | | | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 429 | |
| int i; | | int i; | |
| | | | |
| for (i=0; i<len; i++) { | | for (i=0; i<len; i++) { | |
| register u32 argb = src[i]; | | register u32 argb = src[i]; | |
| | | | |
| dst[i] = ARGB_TO_ARGB1555( argb ); | | dst[i] = ARGB_TO_ARGB1555( argb ); | |
| } | | } | |
| } | | } | |
| | | | |
| static inline void | | static inline void | |
|
| | | dfb_argb_to_rgba5551( const u32 *src, u16 *dst, int len ) | |
| | | { | |
| | | int i; | |
| | | | |
| | | for (i=0; i<len; i++) { | |
| | | register u32 argb = src[i]; | |
| | | | |
| | | dst[i] = ARGB_TO_RGBA5551( argb ); | |
| | | } | |
| | | } | |
| | | | |
| | | static inline void | |
| dfb_argb_to_argb2554( const u32 *src, u16 *dst, int len ) | | dfb_argb_to_argb2554( const u32 *src, u16 *dst, int len ) | |
| { | | { | |
| int i; | | int i; | |
| | | | |
| for (i=0; i<len; i++) { | | for (i=0; i<len; i++) { | |
| register u32 argb = src[i]; | | register u32 argb = src[i]; | |
| | | | |
| dst[i] = ARGB_TO_ARGB2554( argb ); | | dst[i] = ARGB_TO_ARGB2554( argb ); | |
| } | | } | |
| } | | } | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 25 lines changed or added | |
|
| directfb.h | | directfb.h | |
| | | | |
| skipping to change at line 420 | | skipping to change at line 420 | |
| | | | |
| typedef unsigned int DFBScreenID; | | typedef unsigned int DFBScreenID; | |
| typedef unsigned int DFBDisplayLayerID; | | typedef unsigned int DFBDisplayLayerID; | |
| typedef unsigned int DFBDisplayLayerSourceID; | | typedef unsigned int DFBDisplayLayerSourceID; | |
| typedef unsigned int DFBWindowID; | | typedef unsigned int DFBWindowID; | |
| typedef unsigned int DFBInputDeviceID; | | typedef unsigned int DFBInputDeviceID; | |
| typedef unsigned int DFBTextEncodingID; | | typedef unsigned int DFBTextEncodingID; | |
| | | | |
| typedef u32 DFBDisplayLayerIDs; | | typedef u32 DFBDisplayLayerIDs; | |
| | | | |
|
| | | typedef unsigned int DFBColorID; | |
| | | | |
| | | /* | |
| | | * Predefined color IDs. | |
| | | */ | |
| | | #define DCID_PRIMARY 0 | |
| | | #define DCID_OUTLINE 1 | |
| | | | |
| | | /* | |
| | | * Maximum number of color ids. | |
| | | */ | |
| | | #define DFB_COLOR_IDS_MAX 8 | |
| | | | |
| /* | | /* | |
| * Maximum number of layer ids. | | * Maximum number of layer ids. | |
| */ | | */ | |
| #define DFB_DISPLAYLAYER_IDS_MAX 32 | | #define DFB_DISPLAYLAYER_IDS_MAX 32 | |
| | | | |
| /* | | /* | |
| * Adds the id to the bitmask of layer ids. | | * Adds the id to the bitmask of layer ids. | |
| */ | | */ | |
| #define DFB_DISPLAYLAYER_IDS_ADD(ids,id) (ids) |= (1 << (id)) | | #define DFB_DISPLAYLAYER_IDS_ADD(ids,id) (ids) |= (1 << (id)) | |
| | | | |
| | | | |
| skipping to change at line 980 | | skipping to change at line 993 | |
| * same font file. | | * same font file. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DFFA_NONE = 0x00000000, /* none of these flags */ | | DFFA_NONE = 0x00000000, /* none of these flags */ | |
| DFFA_NOKERNING = 0x00000001, /* don't use kerning */ | | DFFA_NOKERNING = 0x00000001, /* don't use kerning */ | |
| DFFA_NOHINTING = 0x00000002, /* don't use hinting */ | | DFFA_NOHINTING = 0x00000002, /* don't use hinting */ | |
| DFFA_MONOCHROME = 0x00000004, /* don't use anti-aliasing */ | | DFFA_MONOCHROME = 0x00000004, /* don't use anti-aliasing */ | |
| DFFA_NOCHARMAP = 0x00000008, /* no char map, glyph indices are | | DFFA_NOCHARMAP = 0x00000008, /* no char map, glyph indices are | |
| specified directly */ | | specified directly */ | |
| DFFA_FIXEDCLIP = 0x00000010, /* width fixed advance, clip to it
*/ | | DFFA_FIXEDCLIP = 0x00000010, /* width fixed advance, clip to it
*/ | |
|
| DFFA_NOBITMAP = 0x00000020 /* ignore bitmap strikes; for | | DFFA_NOBITMAP = 0x00000020, /* ignore bitmap strikes; for | |
| bitmap-only fonts this flag is | | bitmap-only fonts this flag is | |
| ignored */ | | ignored */ | |
|
| | | DFFA_OUTLINED = 0x00000040 | |
| } DFBFontAttributes; | | } DFBFontAttributes; | |
| | | | |
| /* | | /* | |
| * Flags defining which fields of a DFBFontDescription are valid. | | * Flags defining which fields of a DFBFontDescription are valid. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
|
| DFDESC_ATTRIBUTES = 0x00000001, /* attributes field is valid */ | | DFDESC_ATTRIBUTES = 0x00000001, /* attributes field is valid * | |
| DFDESC_HEIGHT = 0x00000002, /* height is specified */ | | / | |
| DFDESC_WIDTH = 0x00000004, /* width is specified */ | | DFDESC_HEIGHT = 0x00000002, /* height is specified */ | |
| DFDESC_INDEX = 0x00000008, /* index is specified */ | | DFDESC_WIDTH = 0x00000004, /* width is specified */ | |
| DFDESC_FIXEDADVANCE = 0x00000010, /* specify a fixed advance overridi | | DFDESC_INDEX = 0x00000008, /* index is specified */ | |
| ng | | DFDESC_FIXEDADVANCE = 0x00000010, /* specify a fixed advance ove | |
| any character advance of fixed o | | rriding | |
| r | | any character advance of fi | |
| proportional fonts */ | | xed or | |
| DFDESC_FRACT_HEIGHT = 0x00000020, /* fractional height is set */ | | proportional fonts */ | |
| DFDESC_FRACT_WIDTH = 0x00000040, /* fractional width is set */ | | DFDESC_FRACT_HEIGHT = 0x00000020, /* fractional height is set */ | |
| | | DFDESC_FRACT_WIDTH = 0x00000040, /* fractional width is set */ | |
| | | DFDESC_OUTLINE_WIDTH = 0x00000080, /* outline width is set */ | |
| | | DFDESC_OUTLINE_OPACITY = 0x00000100, /* outline opacity is set */ | |
| } DFBFontDescriptionFlags; | | } DFBFontDescriptionFlags; | |
| | | | |
| /* | | /* | |
| * Description of how to load glyphs from a font file. | | * Description of how to load glyphs from a font file. | |
| * | | * | |
| * The attributes control how the glyphs are rendered. Width and height can
be used to specify the | | * The attributes control how the glyphs are rendered. Width and height can
be used to specify the | |
| * desired face size in pixels. If you are loading a non-scalable font, you
shouldn't specify a | | * desired face size in pixels. If you are loading a non-scalable font, you
shouldn't specify a | |
| * font size. | | * font size. | |
| * | | * | |
| * Please note that the height value in the DFBFontDescription doesn't corr
espond to the height | | * Please note that the height value in the DFBFontDescription doesn't corr
espond to the height | |
| * returned by IDirectFBFont::GetHeight(). | | * returned by IDirectFBFont::GetHeight(). | |
| * | | * | |
| * The index field controls which face is loaded from a font file that prov
ides a collection of | | * The index field controls which face is loaded from a font file that prov
ides a collection of | |
| * faces. This is rarely needed. | | * faces. This is rarely needed. | |
| * | | * | |
| * Fractional sizes (fract_height and fract_width) are 26.6 fixed point int
egers and override | | * Fractional sizes (fract_height and fract_width) are 26.6 fixed point int
egers and override | |
| * the pixel sizes if both are specified. | | * the pixel sizes if both are specified. | |
|
| | | * | |
| | | * Outline parameters are ignored if DFFA_OUTLINED is not used (see DFBFont | |
| | | Attributes). To change the | |
| | | * default values of 1.0 each use DFDESC_OUTLINE_WIDTH and/or DFDESC_OUTLIN | |
| | | E_OPACITY. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBFontDescriptionFlags flags; | | DFBFontDescriptionFlags flags; | |
| | | | |
| DFBFontAttributes attributes; | | DFBFontAttributes attributes; | |
| int height; | | int height; | |
| int width; | | int width; | |
| unsigned int index; | | unsigned int index; | |
| int fixed_advance; | | int fixed_advance; | |
| | | | |
| int fract_height; | | int fract_height; | |
| int fract_width; | | int fract_width; | |
|
| | | | |
| | | int outline_width; /* Outline widt | |
| | | h as 16.16 fixed point integer */ | |
| | | int outline_opacity; /* Outline opac | |
| | | ity as 16.16 fixed point integer */ | |
| } DFBFontDescription; | | } DFBFontDescription; | |
| | | | |
| /* | | /* | |
| * @internal | | * @internal | |
| * | | * | |
| * Encodes format constants in the following way (bit 31 - 0): | | * Encodes format constants in the following way (bit 31 - 0): | |
| * | | * | |
| * lkjj:hhgg | gfff:eeed | cccc:bbbb | baaa:aaaa | | * lkjj:hhgg | gfff:eeed | cccc:bbbb | baaa:aaaa | |
| * | | * | |
| * a) pixelformat index<br> | | * a) pixelformat index<br> | |
| | | | |
| skipping to change at line 1157 | | skipping to change at line 1179 | |
| /* 2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from pa
lette) */ | | /* 2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from pa
lette) */ | |
| DSPF_LUT2 = DFB_SURFACE_PIXELFORMAT( 26, 2, 0, 1, 2, 0, 3, 0, 0,
1, 0 ), | | DSPF_LUT2 = DFB_SURFACE_PIXELFORMAT( 26, 2, 0, 1, 2, 0, 3, 0, 0,
1, 0 ), | |
| | | | |
| /* 16 bit RGB (2 byte, nothing @12, red 4@8, green 4@4, blue 4@0) */ | | /* 16 bit RGB (2 byte, nothing @12, red 4@8, green 4@4, blue 4@0) */ | |
| DSPF_RGB444 = DFB_SURFACE_PIXELFORMAT( 27, 12, 0, 0, 0, 2, 0, 0, 0,
0, 0 ), | | DSPF_RGB444 = DFB_SURFACE_PIXELFORMAT( 27, 12, 0, 0, 0, 2, 0, 0, 0,
0, 0 ), | |
| | | | |
| /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) *
/ | | /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) *
/ | |
| DSPF_RGB555 = DFB_SURFACE_PIXELFORMAT( 28, 15, 0, 0, 0, 2, 0, 0, 0,
0, 0 ), | | DSPF_RGB555 = DFB_SURFACE_PIXELFORMAT( 28, 15, 0, 0, 0, 2, 0, 0, 0,
0, 0 ), | |
| | | | |
| /* 16 bit BGR (2 byte, nothing @15, blue 5@10, green 5@5, red 5@0) *
/ | | /* 16 bit BGR (2 byte, nothing @15, blue 5@10, green 5@5, red 5@0) *
/ | |
|
| DSPF_BGR555 = DFB_SURFACE_PIXELFORMAT( 29, 15, 0, 0, 0, 2, 0, 0, 0, | | DSPF_BGR555 = DFB_SURFACE_PIXELFORMAT( 29, 15, 0, 0, 0, 2, 0, 0, 0, | |
| 0, 0 ) | | 0, 0 ), | |
| | | | |
| | | /* 16 bit RGBA (2 byte, red 5@11, green 5@6, blue 5@1, alpha 1@0) */ | |
| | | DSPF_RGBA5551 = DFB_SURFACE_PIXELFORMAT( 30, 15, 1, 1, 0, 2, 0, 0, 0, | |
| | | 0, 0 ) | |
| | | | |
| } DFBSurfacePixelFormat; | | } DFBSurfacePixelFormat; | |
| | | | |
| /* Number of pixelformats defined */ | | /* Number of pixelformats defined */ | |
|
| #define DFB_NUM_PIXELFORMATS 30 | | #define DFB_NUM_PIXELFORMATS 31 | |
| | | | |
| /* These macros extract information about the pixel format. */ | | /* These macros extract information about the pixel format. */ | |
| #define DFB_PIXELFORMAT_INDEX(fmt) (((fmt) & 0x0000007F) ) | | #define DFB_PIXELFORMAT_INDEX(fmt) (((fmt) & 0x0000007F) ) | |
| | | | |
| #define DFB_COLOR_BITS_PER_PIXEL(fmt) (((fmt) & 0x00000F80) >> 7) | | #define DFB_COLOR_BITS_PER_PIXEL(fmt) (((fmt) & 0x00000F80) >> 7) | |
| | | | |
| #define DFB_ALPHA_BITS_PER_PIXEL(fmt) (((fmt) & 0x0000F000) >> 12) | | #define DFB_ALPHA_BITS_PER_PIXEL(fmt) (((fmt) & 0x0000F000) >> 12) | |
| | | | |
| #define DFB_PIXELFORMAT_HAS_ALPHA(fmt) (((fmt) & 0x00010000) != 0) | | #define DFB_PIXELFORMAT_HAS_ALPHA(fmt) (((fmt) & 0x00010000) != 0) | |
| | | | |
| | | | |
| skipping to change at line 3100 | | skipping to change at line 3125 | |
| typedef enum { | | typedef enum { | |
| DSTF_LEFT = 0x00000000, /* left aligned */ | | DSTF_LEFT = 0x00000000, /* left aligned */ | |
| DSTF_CENTER = 0x00000001, /* horizontally centered */ | | DSTF_CENTER = 0x00000001, /* horizontally centered */ | |
| DSTF_RIGHT = 0x00000002, /* right aligned */ | | DSTF_RIGHT = 0x00000002, /* right aligned */ | |
| | | | |
| DSTF_TOP = 0x00000004, /* y specifies the top | | DSTF_TOP = 0x00000004, /* y specifies the top | |
| instead of the baseline */ | | instead of the baseline */ | |
| DSTF_BOTTOM = 0x00000008, /* y specifies the bottom | | DSTF_BOTTOM = 0x00000008, /* y specifies the bottom | |
| instead of the baseline */ | | instead of the baseline */ | |
| | | | |
|
| | | DSTF_OUTLINE = 0x00000010, /* enables outline rendering if loa | |
| | | ded font supports it */ | |
| | | | |
| DSTF_TOPLEFT = DSTF_TOP | DSTF_LEFT, | | DSTF_TOPLEFT = DSTF_TOP | DSTF_LEFT, | |
| DSTF_TOPCENTER = DSTF_TOP | DSTF_CENTER, | | DSTF_TOPCENTER = DSTF_TOP | DSTF_CENTER, | |
| DSTF_TOPRIGHT = DSTF_TOP | DSTF_RIGHT, | | DSTF_TOPRIGHT = DSTF_TOP | DSTF_RIGHT, | |
| | | | |
| DSTF_BOTTOMLEFT = DSTF_BOTTOM | DSTF_LEFT, | | DSTF_BOTTOMLEFT = DSTF_BOTTOM | DSTF_LEFT, | |
| DSTF_BOTTOMCENTER = DSTF_BOTTOM | DSTF_CENTER, | | DSTF_BOTTOMCENTER = DSTF_BOTTOM | DSTF_CENTER, | |
| DSTF_BOTTOMRIGHT = DSTF_BOTTOM | DSTF_RIGHT | | DSTF_BOTTOMRIGHT = DSTF_BOTTOM | DSTF_RIGHT | |
| } DFBSurfaceTextFlags; | | } DFBSurfaceTextFlags; | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 3143 | | skipping to change at line 3170 | |
| DSPD_SRC_OVER = 3, /* fs: 1.0 fd: 1.0-sa */ | | DSPD_SRC_OVER = 3, /* fs: 1.0 fd: 1.0-sa */ | |
| DSPD_DST_OVER = 4, /* fs: 1.0-da fd: 1.0 */ | | DSPD_DST_OVER = 4, /* fs: 1.0-da fd: 1.0 */ | |
| DSPD_SRC_IN = 5, /* fs: da fd: 0.0 */ | | DSPD_SRC_IN = 5, /* fs: da fd: 0.0 */ | |
| DSPD_DST_IN = 6, /* fs: 0.0 fd: sa */ | | DSPD_DST_IN = 6, /* fs: 0.0 fd: sa */ | |
| DSPD_SRC_OUT = 7, /* fs: 1.0-da fd: 0.0 */ | | DSPD_SRC_OUT = 7, /* fs: 1.0-da fd: 0.0 */ | |
| DSPD_DST_OUT = 8, /* fs: 0.0 fd: 1.0-sa */ | | DSPD_DST_OUT = 8, /* fs: 0.0 fd: 1.0-sa */ | |
| DSPD_SRC_ATOP = 9, /* fs: da fd: 1.0-sa */ | | DSPD_SRC_ATOP = 9, /* fs: da fd: 1.0-sa */ | |
| DSPD_DST_ATOP = 10, /* fs: 1.0-da fd: sa */ | | DSPD_DST_ATOP = 10, /* fs: 1.0-da fd: sa */ | |
| DSPD_ADD = 11, /* fs: 1.0 fd: 1.0 */ | | DSPD_ADD = 11, /* fs: 1.0 fd: 1.0 */ | |
| DSPD_XOR = 12, /* fs: 1.0-da fd: 1.0-sa */ | | DSPD_XOR = 12, /* fs: 1.0-da fd: 1.0-sa */ | |
|
| | | DSPD_DST = 13, /* fs: 0.0 fd: 1.0 */ | |
| } DFBSurfacePorterDuffRule; | | } DFBSurfacePorterDuffRule; | |
| | | | |
| /* | | /* | |
| * Blend functions to use for source and destination blending | | * Blend functions to use for source and destination blending | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| /* | | /* | |
| * pixel color = sc * cf[sf] + dc * cf[df] | | * pixel color = sc * cf[sf] + dc * cf[df] | |
| * pixel alpha = sa * af[sf] + da * af[df] | | * pixel alpha = sa * af[sf] + da * af[df] | |
| * sc = source color | | * sc = source color | |
| | | | |
| skipping to change at line 3998 | | skipping to change at line 4026 | |
| * <b>rect</b> defines the area inside the surface to be read. | | * <b>rect</b> defines the area inside the surface to be read. | |
| * <br><b>ptr</b> and <b>pitch</b> specify the destination. | | * <br><b>ptr</b> and <b>pitch</b> specify the destination. | |
| * <br>The destination data will have the same format as the surface. | | * <br>The destination data will have the same format as the surface. | |
| */ | | */ | |
| DFBResult (*Read) ( | | DFBResult (*Read) ( | |
| IDirectFBSurface *thiz, | | IDirectFBSurface *thiz, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
| void *ptr, | | void *ptr, | |
| int pitch | | int pitch | |
| ); | | ); | |
|
| | | | |
| | | /** Drawing/blitting control **/ | |
| | | | |
| | | /* | |
| | | * Sets color values used for drawing/text functions or | |
| | | * alpha/color modulation (blitting functions). | |
| | | */ | |
| | | DFBResult (*SetColors) ( | |
| | | IDirectFBSurface *thiz, | |
| | | const DFBColorID *ids, | |
| | | const DFBColor *colors, | |
| | | unsigned int num | |
| | | ); | |
| ) | | ) | |
| | | | |
| /******************** | | /******************** | |
| * IDirectFBPalette * | | * IDirectFBPalette * | |
| ********************/ | | ********************/ | |
| | | | |
| /* | | /* | |
| * <i>No summary yet...</i> | | * <i>No summary yet...</i> | |
| */ | | */ | |
| DEFINE_INTERFACE( IDirectFBPalette, | | DEFINE_INTERFACE( IDirectFBPalette, | |
| | | | |
| skipping to change at line 4982 | | skipping to change at line 5023 | |
| | | | |
| /* | | /* | |
| * Get options controlling appearance and behaviour of the window. | | * Get options controlling appearance and behaviour of the window. | |
| */ | | */ | |
| DFBResult (*GetOptions) ( | | DFBResult (*GetOptions) ( | |
| IDirectFBWindow *thiz, | | IDirectFBWindow *thiz, | |
| DFBWindowOptions *ret_options | | DFBWindowOptions *ret_options | |
| ); | | ); | |
| | | | |
| /* | | /* | |
|
| * Set the window color. | | * Set the window color, or colorises the window. | |
| * | | * | |
|
| * This is used in case you specified DWCAPS_COLOR. | | * In case you specified DWCAPS_COLOR, this sets the window draw color | |
| * It specifies the window draw color. | | . | |
| | | * In case you didn't, it colorises the window with this color; this w | |
| | | ill darken the window. | |
| | | * no DWCAPS_COLOR and an opacity of 0 means: no effect. | |
| */ | | */ | |
| DFBResult (*SetColor) ( | | DFBResult (*SetColor) ( | |
| IDirectFBWindow *thiz, | | IDirectFBWindow *thiz, | |
| u8 r, | | u8 r, | |
| u8 g, | | u8 g, | |
| u8 b, | | u8 b, | |
| u8 a | | u8 a | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 5366 | | skipping to change at line 5408 | |
| | | | |
| /* | | /* | |
| * Change the window association. | | * Change the window association. | |
| * | | * | |
| * If <b>window_id</b> is 0, the window will be dissociated. | | * If <b>window_id</b> is 0, the window will be dissociated. | |
| */ | | */ | |
| DFBResult (*SetAssociation) ( | | DFBResult (*SetAssociation) ( | |
| IDirectFBWindow *thiz, | | IDirectFBWindow *thiz, | |
| DFBWindowID window_id | | DFBWindowID window_id | |
| ); | | ); | |
|
| | | | |
| | | /** Application ID **/ | |
| | | | |
| | | /* | |
| | | * Set application ID. | |
| | | * | |
| | | * The usage of the application ID is not imposed by DirectFB | |
| | | * and can be used at will by the application. Any change will | |
| | | * be notified, and as such, an application manager using SaWMan | |
| | | * can be used to act on any change. | |
| | | */ | |
| | | DFBResult (*SetApplicationID) ( | |
| | | IDirectFBWindow *thiz, | |
| | | unsigned long application_id | |
| | | ); | |
| | | | |
| | | /* | |
| | | * Get current application ID. | |
| | | */ | |
| | | DFBResult (*GetApplicationID) ( | |
| | | IDirectFBWindow *thiz, | |
| | | unsigned long *ret_application_id | |
| | | ); | |
| ) | | ) | |
| | | | |
| /* | | /* | |
| * Called for each provided text encoding. | | * Called for each provided text encoding. | |
| */ | | */ | |
| typedef DFBEnumerationResult (*DFBTextEncodingCallback) ( | | typedef DFBEnumerationResult (*DFBTextEncodingCallback) ( | |
| DFBTextEncodingID encoding_id, | | DFBTextEncodingID encoding_id, | |
| const char *name, | | const char *name, | |
| void *context | | void *context | |
| ); | | ); | |
| | | | |
End of changes. 14 change blocks. |
| 18 lines changed or deleted | | 92 lines changed or added | |
|
| fonts.h | | fonts.h | |
| | | | |
| skipping to change at line 45 | | skipping to change at line 45 | |
| | | | |
| #include <directfb.h> | | #include <directfb.h> | |
| | | | |
| #include <core/coretypes.h> | | #include <core/coretypes.h> | |
| | | | |
| #include <core/state.h> | | #include <core/state.h> | |
| | | | |
| /* | | /* | |
| * glyph struct | | * glyph struct | |
| */ | | */ | |
|
| typedef struct { | | struct _CoreGlyphData { | |
| DirectLink link; | | DirectLink link; | |
| | | | |
| unsigned int index; | | unsigned int index; | |
|
| | | unsigned int layer; | |
| unsigned int row; | | unsigned int row; | |
| | | | |
| CoreSurface *surface; /* contains bitmap of glyph
*/ | | CoreSurface *surface; /* contains bitmap of glyph
*/ | |
| int start; /* x offset of glyph in surface
*/ | | int start; /* x offset of glyph in surface
*/ | |
| int width; /* width of the glyphs bitmap
*/ | | int width; /* width of the glyphs bitmap
*/ | |
| int height; /* height of the glyphs bitmap
*/ | | int height; /* height of the glyphs bitmap
*/ | |
| int left; /* x offset of the glyph
*/ | | int left; /* x offset of the glyph
*/ | |
| int top; /* y offset of the glyph
*/ | | int top; /* y offset of the glyph
*/ | |
| int advance; /* placement of next glyph
*/ | | int advance; /* placement of next glyph
*/ | |
| | | | |
| int magic; | | int magic; | |
|
| } CoreGlyphData; | | }; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult (* GetCharacterIndex) ( CoreFont *thiz, | | DFBResult (* GetCharacterIndex) ( CoreFont *thiz, | |
| unsigned int character, | | unsigned int character, | |
| unsigned int *ret_index ); | | unsigned int *ret_index ); | |
| | | | |
| DFBResult (* DecodeText) ( CoreFont *thiz, | | DFBResult (* DecodeText) ( CoreFont *thiz, | |
| const void *text, | | const void *text, | |
| int length, | | int length, | |
| unsigned int *ret_indices, | | unsigned int *ret_indices, | |
| | | | |
| skipping to change at line 95 | | skipping to change at line 96 | |
| unsigned int stamp; | | unsigned int stamp; | |
| | | | |
| CoreSurface *surface; | | CoreSurface *surface; | |
| int next_x; | | int next_x; | |
| | | | |
| DirectLink *glyphs; | | DirectLink *glyphs; | |
| | | | |
| int magic; | | int magic; | |
| } CoreFontCacheRow; | | } CoreFontCacheRow; | |
| | | | |
|
| | | #define DFB_FONT_MAX_LAYERS 2 | |
| | | | |
| /* | | /* | |
| * font struct | | * font struct | |
| */ | | */ | |
| | | | |
| struct _CoreFont { | | struct _CoreFont { | |
| CoreDFB *core; | | CoreDFB *core; | |
| | | | |
| DFBSurfaceBlittingFlags blittingflags; | | DFBSurfaceBlittingFlags blittingflags; | |
|
| CardState state; /* the state used to blit
glyphs */ | | | |
| DFBSurfacePixelFormat pixel_format; | | DFBSurfacePixelFormat pixel_format; | |
| DFBSurfaceCapabilities surface_caps; | | DFBSurfaceCapabilities surface_caps; | |
| int row_width; | | int row_width; | |
| int max_rows; | | int max_rows; | |
| | | | |
|
| | | DFBFontAttributes attributes; | |
| | | | |
| CoreFontCacheRow **rows; /* contain bitmaps of loa
ded glyphs */ | | CoreFontCacheRow **rows; /* contain bitmaps of loa
ded glyphs */ | |
| int num_rows; | | int num_rows; | |
| int active_row; | | int active_row; | |
| unsigned int row_stamp; | | unsigned int row_stamp; | |
| | | | |
|
| DirectHash *glyph_hash; /* infos about loaded gly | | struct { | |
| phs */ | | DirectHash *glyph_hash; /* infos about loaded gly | |
| CoreGlyphData *glyph_data[128]; | | phs */ | |
| | | CoreGlyphData *glyph_data[128]; | |
| | | } layers[DFB_FONT_MAX_LAYERS]; | |
| | | | |
| int height; /* font height
*/ | | int height; /* font height
*/ | |
| | | | |
| int ascender; /* a positive value, the
distance | | int ascender; /* a positive value, the
distance | |
| from the baseline to t
he top */ | | from the baseline to t
he top */ | |
| int descender; /* a negative value, the
distance | | int descender; /* a negative value, the
distance | |
| from the baseline to t
he bottom */ | | from the baseline to t
he bottom */ | |
| int maxadvance; /* width of largest chara
cter */ | | int maxadvance; /* width of largest chara
cter */ | |
| | | | |
| pthread_mutex_t lock; /* lock during access to
the font */ | | pthread_mutex_t lock; /* lock during access to
the font */ | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 166 | |
| /* | | /* | |
| * allocates and initializes a new font structure | | * allocates and initializes a new font structure | |
| */ | | */ | |
| DFBResult dfb_font_create( CoreDFB *core, CoreFont **ret_font ); | | DFBResult dfb_font_create( CoreDFB *core, CoreFont **ret_font ); | |
| | | | |
| /* | | /* | |
| * destroy all data in the CoreFont struct | | * destroy all data in the CoreFont struct | |
| */ | | */ | |
| void dfb_font_destroy( CoreFont *font ); | | void dfb_font_destroy( CoreFont *font ); | |
| | | | |
|
| void dfb_font_drop_destination( CoreFont *font, CoreSurface *surface ); | | | |
| | | | |
| /* | | /* | |
| * lock the font before accessing it | | * lock the font before accessing it | |
| */ | | */ | |
| static inline void | | static inline void | |
| dfb_font_lock( CoreFont *font ) | | dfb_font_lock( CoreFont *font ) | |
| { | | { | |
| D_MAGIC_ASSERT( font, CoreFont ); | | D_MAGIC_ASSERT( font, CoreFont ); | |
| | | | |
| pthread_mutex_lock( &font->lock ); | | pthread_mutex_lock( &font->lock ); | |
|
| | | | |
| dfb_state_lock( &font->state ); | | | |
| } | | } | |
| | | | |
| /* | | /* | |
| * unlock the font after access | | * unlock the font after access | |
| */ | | */ | |
| static inline void | | static inline void | |
| dfb_font_unlock( CoreFont *font ) | | dfb_font_unlock( CoreFont *font ) | |
| { | | { | |
| D_MAGIC_ASSERT( font, CoreFont ); | | D_MAGIC_ASSERT( font, CoreFont ); | |
| | | | |
|
| dfb_state_unlock( &font->state ); | | | |
| | | | |
| pthread_mutex_unlock( &font->lock ); | | pthread_mutex_unlock( &font->lock ); | |
| } | | } | |
| | | | |
| /* | | /* | |
| * loads glyph data from font | | * loads glyph data from font | |
| */ | | */ | |
| DFBResult dfb_font_get_glyph_data( CoreFont *font, | | DFBResult dfb_font_get_glyph_data( CoreFont *font, | |
| unsigned int index, | | unsigned int index, | |
|
| | | unsigned int layer, | |
| CoreGlyphData **glyph_data ); | | CoreGlyphData **glyph_data ); | |
| | | | |
| /* | | /* | |
| * Called by font module to register encoding implementations. | | * Called by font module to register encoding implementations. | |
| * | | * | |
| * The encoding can be DTEID_UTF8 or DTEID_OTHER, where in the | | * The encoding can be DTEID_UTF8 or DTEID_OTHER, where in the | |
| * latter case the actual id will be allocated dynamically. | | * latter case the actual id will be allocated dynamically. | |
| * | | * | |
| * In the case of DTEID_UTF8 it's allowed to only provide | | * In the case of DTEID_UTF8 it's allowed to only provide | |
| * GetCharacterIndex() and let the core do the DecodeText(), | | * GetCharacterIndex() and let the core do the DecodeText(), | |
| | | | |
End of changes. 11 change blocks. |
| 12 lines changed or deleted | | 13 lines changed or added | |
|