Changeset 7960 in project


Ignore:
Timestamp:
01/27/08 11:59:16 (12 years ago)
Author:
hans
Message:

define bitfields with define-foreign-bitfield

File:
1 edited

Legend:

Unmodified
Added
Removed
  • directfb/trunk/directfb.scm

    r7866 r7960  
    6969(require-extension lolevel dollar srfi-1 srfi-4)
    7070(include "dfb-struct.scm")
     71(include "bitfield.scm")
     72
    7173
    7274;;; Enums
     
    7577  DFSCL_NORMAL DFSCL_FULLSCREEN DFSCL_EXCLUSIVE)
    7678
    77 (define-foreign-enum (dfb-surface-description-flags int)
    78   DSDESC_NONE DSDESC_CAPS DSDESC_WIDTH DSDESC_HEIGHT DSDESC_PIXELFORMAT
    79   DSDESC_PREALLOCATED DSDESC_PALETTE DSDESC_RESOURCE_ID DSDESC_ALL)
    80 
    81 (define-foreign-enum (dfb-surface-capabilities int)
    82   DSCAPS_NONE DSCAPS_PRIMARY DSCAPS_SYSTEMONLY DSCAPS_VIDEOONLY DSCAPS_DOUBLE
     79(define-foreign-bitfield (dfb-surface-capabilities int) (strip-prefix: DSCAPS_)
     80  DSCAPS_PRIMARY DSCAPS_SYSTEMONLY DSCAPS_VIDEOONLY DSCAPS_DOUBLE
    8381  DSCAPS_SUBSURFACE DSCAPS_INTERLACED DSCAPS_SEPARATED DSCAPS_STATIC_ALLOC
    8482  DSCAPS_TRIPLE DSCAPS_PREMULTIPLIED DSCAPS_DEPTH DSCAPS_ALL DSCAPS_FLIPPING)
    8583
    86 (define-foreign-enum (dfb-surface-flip-flags int)
    87   DSFLIP_NONE DSFLIP_WAIT DSFLIP_BLIT DSFLIP_ONSYNC DSFLIP_PIPELINE
    88   DSFLIP_WAITFORSYNC)
    89 
    90 (define-foreign-enum (dfbs-text-flags int)
    91   DSTF_LEFT DSTF_CENTER DSTF_RIGHT DSTF_TOP DSTF_BOTTOM DSTF_TOPLEFT
    92   DSTF_TOPCENTER DSTF_TOPRIGHT DSTF_BOTTOMLEFT DSTF_BOTTOMCENTER
    93   DSTF_BOTTOMRIGHT)
    94 
    95 (define-foreign-enum (dfbs-drawing-flags int)
    96   DSDRAW_NOFX DSDRAW_BLEND DSDRAW_DST_COLORKEY DSDRAW_SRC_PREMULTIPLY
     84(define-foreign-bitfield (dfb-surface-flip-flags int) (strip-prefix: DSFLIP_)
     85  DSFLIP_WAIT DSFLIP_BLIT DSFLIP_ONSYNC DSFLIP_PIPELINE)
     86
     87(define-foreign-bitfield (dfbs-text-flags int) (strip-prefix: DSTF_)
     88  DSTF_CENTER DSTF_RIGHT DSTF_TOP DSTF_BOTTOM)
     89
     90(define-foreign-bitfield (dfbs-drawing-flags int) (strip-prefix: DSDRAW_)
     91  DSDRAW_BLEND DSDRAW_DST_COLORKEY DSDRAW_SRC_PREMULTIPLY
    9792  DSDRAW_DST_PREMULTIPLY DSDRAW_DEMULTIPLY DSDRAW_XOR)
    9893
    99 (define-foreign-enum (dfbs-blitting-flags int)
    100   DSBLIT_NOFX DSBLIT_BLEND_ALPHACHANNEL DSBLIT_BLEND_COLORALPHA DSBLIT_COLORIZE
     94(define-foreign-bitfield (dfbs-blitting-flags int) (strip-prefix: DSBLIT_)
     95  DSBLIT_BLEND_ALPHACHANNEL DSBLIT_BLEND_COLORALPHA DSBLIT_COLORIZE
    10196  DSBLIT_SRC_COLORKEY DSBLIT_DST_COLORKEY DSBLIT_SRC_PREMULTIPLY
    10297  DSBLIT_DST_PREMULTIPLY DSBLIT_DEMULTIPLY DSBLIT_DEINTERLACE
    10398  DSBLIT_SRC_PREMULTCOLOR DSBLIT_XOR DSBLIT_INDEX_TRANSLATION DSBLIT_ROTATE180)
    10499
    105 (define-foreign-enum (dfbs-render-options int)
    106   DSRO_NONE DSRO_SMOOTH_UPSCALE DSRO_SMOOTH_DOWNSCALE DSRO_ALL)
    107 
    108 ;;(define-foreign-enum (dfb-acceleration-mask int)
    109 ;;  DFXL_NONE DFXL_FILLRECTANGLE DFXL_DRAWRECTANGLE DFXL_DRAWLINE
    110 ;;  DFXL_FILLTRIANGLE DFXL_BLIT DFXL_STRETCHBLIT DFXL_TEXTRIANGLES
    111 ;;  DFXL_DRAWSTRING DFXL_ALL)
    112 (define-foreign-type dfb-acceleration-mask int)
    113 
    114 (define-foreign-enum (dfb-font-attributes int)
    115   DFFA_NONE DFFA_NOKERNING DFFA_NOHINTING DFFA_MONOCHROME
     100(define-foreign-bitfield (dfbs-render-options int) (strip-prefix: DSRO_)
     101  DSRO_SMOOTH_UPSCALE DSRO_SMOOTH_DOWNSCALE DSRO_ALL)
     102
     103(define-foreign-bitfield (dfb-acceleration-mask int) (strip-prefix: DFXL_)
     104  DFXL_FILLRECTANGLE DFXL_DRAWRECTANGLE DFXL_DRAWLINE
     105  DFXL_FILLTRIANGLE DFXL_BLIT DFXL_STRETCHBLIT DFXL_TEXTRIANGLES
     106  DFXL_DRAWSTRING DFXL_ALL)
     107
     108(define-foreign-bitfield (dfb-font-attributes int) (strip-prefix: DFFA_)
     109  DFFA_NOKERNING DFFA_NOHINTING DFFA_MONOCHROME
    116110  DFFA_NOCHARMAP DFFA_FIXEDCLIP)
    117111
     
    127121  DIDID_KEYBOARD DIDID_MOUSE DIDID_JOYSTICK DIDID_REMOTE DIDID_ANY)
    128122
    129 (define-foreign-enum (dfb-input-device-capabilities int)
     123(define-foreign-bitfield (dfb-input-device-capabilities int) (strip-prefix: DICAPS_)
    130124  DICAPS_KEYS DICAPS_AXES DICAPS_BUTTONS DICAPS_ALL)
    131125
     
    137131  DIET_BUTTONRELEASE DIET_AXISMOTION)
    138132
    139 (define-foreign-enum (dfb-input-device-modifier-mask int)
     133(define-foreign-bitfield (dfb-input-device-modifier-mask int) (strip-prefix: DIMM_)
    140134  DIMM_SHIFT DIMM_CONTROL DIMM_ALT DIMM_ALTGR DIMM_META DIMM_SUPER DIMM_HYPER)
    141135
    142 (define-foreign-enum (dfb-input-device-lock-state int)
     136(define-foreign-bitfield (dfb-input-device-lock-state int) (strip-prefix: DILS_)
    143137  DILS_SCROLL DILS_NUM DILS_CAPS)
    144138
     
    155149(define-foreign-type dfbid-button-state bool)
    156150(define-foreign-type dfbid-axis-identifier int)
    157 (define-foreign-type dfbdl-type-flags int)
    158 (define-foreign-type dfbdl-capabilities int)
    159 
     151
     152(define-foreign-bitfield (dfbdl-type-flags int) (strip-prefix: DLTF_)
     153  DLTF_GRAPHICS DLTF_VIDEO DLTF_STILL_PICTURE DLTF_BACKGROUND DLTF_ALL)
     154
     155(define-foreign-bitfield (dfbdl-capabilities int) (strip-prefix: DLCAPS_)
     156  DLCAPS_SURFACE DLCAPS_OPACITY DLCAPS_ALPHACHANNEL DLCAPS_SCREEN_LOCATION
     157  DLCAPS_FLICKER_FILTERING DLCAPS_DEINTERLACING DLCAPS_SRC_COLORKEY
     158  DLCAPS_DST_COLORKEY DLCAPS_BRIGHTNESS DLCAPS_CONTRAST DLCAPS_HUE
     159  DLCAPS_SATURATION DLCAPS_LEVELS DLCAPS_FIELD_PARITY DLCAPS_WINDOWS
     160  DLCAPS_SOURCES DLCAPS_ALPHA_RAMP DLCAPS_PREMULTIPLIED DLCAPS_SCREEN_POSITION
     161  DLCAPS_SCREEN_SIZE DLCAPS_CLIP_REGIONS DLCAPS_ALL)
    160162
    161163;;; Utility function and macros
Note: See TracChangeset for help on using the changeset viewer.