Advertisement
Guest User

Untitled

a guest
Feb 12th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.65 KB | None | 0 0
  1. /*
  2.  * Copyright 2009-2013, Haiku, Inc. All rights reserved.
  3.  * Distributed under the terms of the MIT License.
  4.  */
  5. #ifndef _ACCELERANTAPI_H_
  6. #define _ACCELERANTAPI_H_
  7.  
  8.  
  9. #include <Accelerant.h>
  10. #include <GraphicsDefs.h>
  11. #include <OS.h>
  12.  
  13.  
  14. #if defined(__cplusplus)
  15.     extern "C" {
  16. #endif
  17.  
  18.  
  19. #define B_ACCELERANT_ENTRY_POINT    "get_accelerant_hook"
  20. #define B_ACCELERANT_VERSION        1
  21.  
  22.  
  23. typedef void* (*GetAccelerantHook)(uint32, void*);
  24. void* get_accelerant_hook(uint32 feature, void* data);
  25.  
  26.  
  27. enum {
  28.     /* initialization */
  29.     B_INIT_ACCELERANT = 0,              /* required */
  30.     B_ACCELERANT_CLONE_INFO_SIZE,       /* required */
  31.     B_GET_ACCELERANT_CLONE_INFO,        /* required */
  32.     B_CLONE_ACCELERANT,                 /* required */
  33.     B_UNINIT_ACCELERANT,                /* required */
  34.     B_GET_ACCELERANT_DEVICE_INFO,       /* required */
  35.     B_ACCELERANT_RETRACE_SEMAPHORE,     /* optional */
  36.  
  37.     /* mode configuration */
  38.     B_ACCELERANT_MODE_COUNT = 0x100,    /* required */
  39.     B_GET_MODE_LIST,                    /* required */
  40.     B_PROPOSE_DISPLAY_MODE,             /* optional */
  41.     B_SET_DISPLAY_MODE,                 /* required */
  42.     B_GET_DISPLAY_MODE,                 /* required */
  43.     B_GET_FRAME_BUFFER_CONFIG,          /* required */
  44.     B_GET_PIXEL_CLOCK_LIMITS,           /* required */
  45.     B_GET_TIMING_CONSTRAINTS,           /* optional */
  46.     B_MOVE_DISPLAY,                     /* optional */
  47.     B_SET_INDEXED_COLORS,               /* required if driver supports 8bit */
  48.                                         /* indexed modes */
  49.     B_DPMS_CAPABILITIES,                /* required if driver supports DPMS */
  50.     B_DPMS_MODE,                        /* required if driver supports DPMS */
  51.     B_SET_DPMS_MODE,                    /* required if driver supports DPMS */
  52.     B_GET_PREFERRED_DISPLAY_MODE,       /* optional */
  53.     B_GET_MONITOR_INFO,                 /* optional */
  54.     B_GET_EDID_INFO,                    /* optional */
  55.  
  56.     /* cursor managment */
  57.     B_MOVE_CURSOR = 0x200,              /* optional */
  58.     B_SET_CURSOR_SHAPE,                 /* optional */
  59.     B_SHOW_CURSOR,                      /* optional */
  60.     B_SET_CURSOR_BITMAP,                /* optional */
  61.  
  62.     /* synchronization */
  63.     B_ACCELERANT_ENGINE_COUNT = 0x300/* required */
  64.     B_ACQUIRE_ENGINE,                   /* required */
  65.     B_RELEASE_ENGINE,                   /* required */
  66.     B_WAIT_ENGINE_IDLE,                 /* required */
  67.     B_GET_SYNC_TOKEN,                   /* required */
  68.     B_SYNC_TO_TOKEN,                    /* required */
  69.  
  70.     /* 2D acceleration */
  71.     B_SCREEN_TO_SCREEN_BLIT = 0x400,    /* optional */
  72.     B_FILL_RECTANGLE,                   /* optional */
  73.     B_INVERT_RECTANGLE,                 /* optional */
  74.     B_FILL_SPAN,                        /* optional */
  75.     B_SCREEN_TO_SCREEN_TRANSPARENT_BLIT,    /* optional */
  76.     B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT,    /* optional.
  77.         NOTE: source and dest may NOT overlap */
  78.  
  79.     /* 3D acceleration */
  80.     B_ACCELERANT_PRIVATE_START = (int)0x80000000
  81. };
  82.  
  83.  
  84. typedef status_t (*init_accelerant)(int fd);
  85. typedef status_t (*get_accelerant_device_info)(accelerant_device_info* adi);
  86.  
  87. typedef ssize_t (*accelerant_clone_info_size)(void);
  88. typedef void (*get_accelerant_clone_info)(void* data);
  89. typedef status_t (*clone_accelerant)(void* data);
  90. typedef void (*uninit_accelerant)(void);
  91.  
  92. typedef uint32 (*accelerant_mode_count)(void);
  93. typedef status_t (*get_mode_list)(display_mode*);
  94. typedef status_t (*propose_display_mode)(display_mode* target,
  95.     display_mode* low, display_mode* high);
  96. typedef status_t (*set_display_mode)(display_mode* modeToSet);
  97. typedef status_t (*get_display_mode)(display_mode* currentMode);
  98. typedef status_t (*get_frame_buffer_config)(frame_buffer_config* frameBuffer);
  99. typedef status_t (*get_pixel_clock_limits)(display_mode* dm, uint32* low,
  100.     uint32* high);
  101. typedef status_t (*move_display_area)(uint16 hDisplayStart,
  102.     uint16 vDisplayStart);
  103. typedef status_t (*get_timing_constraints)(display_timing_constraints* dtc);
  104. typedef void (*set_indexed_colors)(uint count, uint8 first,
  105.     const uint8* colorData, uint32 flags);
  106. typedef uint32 (*dpms_capabilities)(void);
  107. typedef uint32 (*dpms_mode)(void);
  108. typedef status_t (*set_dpms_mode)(uint32 dpms_flags);
  109. typedef status_t (*get_preferred_display_mode)(display_mode* preferredMode);
  110. typedef status_t (*get_monitor_info)(monitor_info* info);
  111. typedef status_t (*get_edid_info)(void* info, uint32 size, uint32* _version);
  112. typedef sem_id (*accelerant_retrace_semaphore)(void);
  113.  
  114. typedef status_t (*set_cursor_shape)(uint16 width, uint16 height,
  115.     uint16 hotX, uint16 hotY, const uint8* andMask, const uint8* xorMask);
  116. typedef status_t (*set_cursor_bitmap)(uint16 width, uint16 height,
  117.     uint16 hotX, uint16 hotY, color_space colorSpace, uint16 bytesPerRow,
  118.     const uint8* bitmapData);
  119. typedef void (*move_cursor)(uint16 x, uint16 y);
  120. typedef void (*show_cursor)(bool isVisible);
  121.  
  122. typedef uint32 (*accelerant_engine_count)(void);
  123. typedef status_t (*acquire_engine)(uint32 capabilities, uint32 maxWait,
  124.     sync_token* st, engine_token** et);
  125. typedef status_t (*release_engine)(engine_token* et, sync_token* st);
  126. typedef void (*wait_engine_idle)(void);
  127. typedef status_t (*get_sync_token)(engine_token* et, sync_token* st);
  128. typedef status_t (*sync_to_token)(sync_token* st);
  129.  
  130. typedef void (*screen_to_screen_blit)(engine_token* et, blit_params* list,
  131.     uint32 count);
  132. typedef void (*fill_rectangle)(engine_token* et, uint32 color,
  133.     fill_rect_params* list, uint32 count);
  134. typedef void (*invert_rectangle)(engine_token* et, fill_rect_params* list,
  135.     uint32 count);
  136. typedef void (*screen_to_screen_transparent_blit)(engine_token* et,
  137.     uint32 transparent_color, blit_params* list, uint32 count);
  138. typedef void (*screen_to_screen_scaled_filtered_blit)(engine_token* et,
  139.     scaled_blit_params* list, uint32 count);
  140.  
  141. typedef void (*fill_span)(engine_token* et, uint32 color, uint16* list,
  142.     uint32 count);
  143. /*
  144.     The uint16* list points to a list of tripples:
  145.         list[N+0]  Y co-ordinate of span
  146.         list[N+1]  Left x co-ordinate of span
  147.         list[N+2]  Right x co-ordinate of span
  148.     where N is in the range 0 to count-1.
  149. */
  150.  
  151.  
  152. #if defined(__cplusplus)
  153. }
  154. #endif
  155.  
  156. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement