Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright 2009-2013, Haiku, Inc. All rights reserved.
- * Distributed under the terms of the MIT License.
- */
- #ifndef _ACCELERANTAPI_H_
- #define _ACCELERANTAPI_H_
- #include <Accelerant.h>
- #include <GraphicsDefs.h>
- #include <OS.h>
- #if defined(__cplusplus)
- extern "C" {
- #endif
- #define B_ACCELERANT_ENTRY_POINT "get_accelerant_hook"
- #define B_ACCELERANT_VERSION 1
- typedef void* (*GetAccelerantHook)(uint32, void*);
- void* get_accelerant_hook(uint32 feature, void* data);
- enum {
- /* initialization */
- B_INIT_ACCELERANT = 0, /* required */
- B_ACCELERANT_CLONE_INFO_SIZE, /* required */
- B_GET_ACCELERANT_CLONE_INFO, /* required */
- B_CLONE_ACCELERANT, /* required */
- B_UNINIT_ACCELERANT, /* required */
- B_GET_ACCELERANT_DEVICE_INFO, /* required */
- B_ACCELERANT_RETRACE_SEMAPHORE, /* optional */
- /* mode configuration */
- B_ACCELERANT_MODE_COUNT = 0x100, /* required */
- B_GET_MODE_LIST, /* required */
- B_PROPOSE_DISPLAY_MODE, /* optional */
- B_SET_DISPLAY_MODE, /* required */
- B_GET_DISPLAY_MODE, /* required */
- B_GET_FRAME_BUFFER_CONFIG, /* required */
- B_GET_PIXEL_CLOCK_LIMITS, /* required */
- B_GET_TIMING_CONSTRAINTS, /* optional */
- B_MOVE_DISPLAY, /* optional */
- B_SET_INDEXED_COLORS, /* required if driver supports 8bit */
- /* indexed modes */
- B_DPMS_CAPABILITIES, /* required if driver supports DPMS */
- B_DPMS_MODE, /* required if driver supports DPMS */
- B_SET_DPMS_MODE, /* required if driver supports DPMS */
- B_GET_PREFERRED_DISPLAY_MODE, /* optional */
- B_GET_MONITOR_INFO, /* optional */
- B_GET_EDID_INFO, /* optional */
- /* cursor managment */
- B_MOVE_CURSOR = 0x200, /* optional */
- B_SET_CURSOR_SHAPE, /* optional */
- B_SHOW_CURSOR, /* optional */
- B_SET_CURSOR_BITMAP, /* optional */
- /* synchronization */
- B_ACCELERANT_ENGINE_COUNT = 0x300, /* required */
- B_ACQUIRE_ENGINE, /* required */
- B_RELEASE_ENGINE, /* required */
- B_WAIT_ENGINE_IDLE, /* required */
- B_GET_SYNC_TOKEN, /* required */
- B_SYNC_TO_TOKEN, /* required */
- /* 2D acceleration */
- B_SCREEN_TO_SCREEN_BLIT = 0x400, /* optional */
- B_FILL_RECTANGLE, /* optional */
- B_INVERT_RECTANGLE, /* optional */
- B_FILL_SPAN, /* optional */
- B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT, /* optional */
- B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT, /* optional.
- NOTE: source and dest may NOT overlap */
- /* 3D acceleration */
- B_ACCELERANT_PRIVATE_START = (int)0x80000000
- };
- typedef status_t (*init_accelerant)(int fd);
- typedef status_t (*get_accelerant_device_info)(accelerant_device_info* adi);
- typedef ssize_t (*accelerant_clone_info_size)(void);
- typedef void (*get_accelerant_clone_info)(void* data);
- typedef status_t (*clone_accelerant)(void* data);
- typedef void (*uninit_accelerant)(void);
- typedef uint32 (*accelerant_mode_count)(void);
- typedef status_t (*get_mode_list)(display_mode*);
- typedef status_t (*propose_display_mode)(display_mode* target,
- display_mode* low, display_mode* high);
- typedef status_t (*set_display_mode)(display_mode* modeToSet);
- typedef status_t (*get_display_mode)(display_mode* currentMode);
- typedef status_t (*get_frame_buffer_config)(frame_buffer_config* frameBuffer);
- typedef status_t (*get_pixel_clock_limits)(display_mode* dm, uint32* low,
- uint32* high);
- typedef status_t (*move_display_area)(uint16 hDisplayStart,
- uint16 vDisplayStart);
- typedef status_t (*get_timing_constraints)(display_timing_constraints* dtc);
- typedef void (*set_indexed_colors)(uint count, uint8 first,
- const uint8* colorData, uint32 flags);
- typedef uint32 (*dpms_capabilities)(void);
- typedef uint32 (*dpms_mode)(void);
- typedef status_t (*set_dpms_mode)(uint32 dpms_flags);
- typedef status_t (*get_preferred_display_mode)(display_mode* preferredMode);
- typedef status_t (*get_monitor_info)(monitor_info* info);
- typedef status_t (*get_edid_info)(void* info, uint32 size, uint32* _version);
- typedef sem_id (*accelerant_retrace_semaphore)(void);
- typedef status_t (*set_cursor_shape)(uint16 width, uint16 height,
- uint16 hotX, uint16 hotY, const uint8* andMask, const uint8* xorMask);
- typedef status_t (*set_cursor_bitmap)(uint16 width, uint16 height,
- uint16 hotX, uint16 hotY, color_space colorSpace, uint16 bytesPerRow,
- const uint8* bitmapData);
- typedef void (*move_cursor)(uint16 x, uint16 y);
- typedef void (*show_cursor)(bool isVisible);
- typedef uint32 (*accelerant_engine_count)(void);
- typedef status_t (*acquire_engine)(uint32 capabilities, uint32 maxWait,
- sync_token* st, engine_token** et);
- typedef status_t (*release_engine)(engine_token* et, sync_token* st);
- typedef void (*wait_engine_idle)(void);
- typedef status_t (*get_sync_token)(engine_token* et, sync_token* st);
- typedef status_t (*sync_to_token)(sync_token* st);
- typedef void (*screen_to_screen_blit)(engine_token* et, blit_params* list,
- uint32 count);
- typedef void (*fill_rectangle)(engine_token* et, uint32 color,
- fill_rect_params* list, uint32 count);
- typedef void (*invert_rectangle)(engine_token* et, fill_rect_params* list,
- uint32 count);
- typedef void (*screen_to_screen_transparent_blit)(engine_token* et,
- uint32 transparent_color, blit_params* list, uint32 count);
- typedef void (*screen_to_screen_scaled_filtered_blit)(engine_token* et,
- scaled_blit_params* list, uint32 count);
- typedef void (*fill_span)(engine_token* et, uint32 color, uint16* list,
- uint32 count);
- /*
- The uint16* list points to a list of tripples:
- list[N+0] Y co-ordinate of span
- list[N+1] Left x co-ordinate of span
- list[N+2] Right x co-ordinate of span
- where N is in the range 0 to count-1.
- */
- #if defined(__cplusplus)
- }
- #endif
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement