From a69c16fec5c2d9ec184ec41f7738a3dc52c36863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 27 Aug 2009 12:35:43 +0000 Subject: [PATCH] Rewrote headers. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32747 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/add-ons/graphics/Accelerant.h | 346 +++++++++++------- headers/os/add-ons/graphics/GraphicsCard.h | 167 ++++----- .../add-ons/input_server/InputServerDevice.h | 2 +- .../add-ons/input_server/InputServerFilter.h | 44 +-- .../add-ons/input_server/InputServerMethod.h | 62 ++-- headers/os/kernel/scheduler.h | 99 +++-- 6 files changed, 393 insertions(+), 327 deletions(-) diff --git a/headers/os/add-ons/graphics/Accelerant.h b/headers/os/add-ons/graphics/Accelerant.h index 46e11c37ce..185af4e38b 100644 --- a/headers/os/add-ons/graphics/Accelerant.h +++ b/headers/os/add-ons/graphics/Accelerant.h @@ -1,128 +1,161 @@ +/* + * Copyright 2009, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _ACCELERANT_H_ #define _ACCELERANT_H_ -#include -#include + #include #include + #if defined(__cplusplus) -extern "C" { + 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); +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 */ + 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 */ + 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_MOVE_CURSOR = 0x200, /* optional */ + B_SET_CURSOR_SHAPE, /* optional */ + B_SHOW_CURSOR, /* 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 */ + 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_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 */ + B_SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT, /* optional. + NOTE: source and dest may NOT overlap */ /* 3D acceleration */ B_ACCELERANT_PRIVATE_START = (int)0x80000000 }; -typedef struct { - uint32 version; /* structure version number */ - char name[32]; /* a name the user will recognize the device by */ - char chipset[32]; /* the chipset used by the device */ - char serial_no[32]; /* serial number for the device */ - uint32 memory; /* amount of memory on the device, in bytes */ - uint32 dac_speed; /* nominal DAC speed, in MHz */ -} accelerant_device_info; typedef struct { - uint32 pixel_clock; /* kHz */ - uint16 h_display; /* in pixels (not character clocks) */ + uint32 version; /* structure version number */ + char name[32]; /* a name the user will recognize */ + /* the device by */ + char chipset[32]; /* the chipset used by the device */ + char serial_no[32]; /* serial number for the device */ + uint32 memory; /* amount of memory on the device, */ + /* in bytes */ + uint32 dac_speed; /* nominal DAC speed, in MHz */ +} accelerant_device_info; + + +typedef struct { + uint32 pixel_clock; /* kHz */ + uint16 h_display; /* in pixels (not character clocks) */ uint16 h_sync_start; uint16 h_sync_end; uint16 h_total; - uint16 v_display; /* in lines */ + uint16 v_display; /* in lines */ uint16 v_sync_start; uint16 v_sync_end; uint16 v_total; - uint32 flags; /* sync polarity, etc. */ + uint32 flags; /* sync polarity, etc. */ } display_timing; typedef struct { - display_timing timing; /* CTRC info */ - uint32 space; /* pixel configuration */ - uint16 virtual_width; /* in pixels */ - uint16 virtual_height; /* in lines */ - uint16 h_display_start; /* first displayed pixel in line */ - uint16 v_display_start; /* first displayed line */ - uint32 flags; /* mode flags */ + display_timing timing; /* CTRC info */ + uint32 space; /* pixel configuration */ + uint16 virtual_width; /* in pixels */ + uint16 virtual_height; /* in lines */ + uint16 h_display_start; /* first displayed pixel in line */ + uint16 v_display_start; /* first displayed line */ + uint32 flags; /* mode flags (Some drivers use this */ + /* for dual head related options.) */ } display_mode; typedef struct { - void *frame_buffer; /* pointer to first byte of frame buffer in virtual memory */ - void *frame_buffer_dma; /* pointer to first byte of frame buffer in physical memory for DMA */ - uint32 bytes_per_row; /* number of bytes in one virtual_width line */ - /* not neccesarily the same as virtual_width * byte_per_pixel */ + void* frame_buffer; /* pointer to first byte of frame */ + /* buffer in virtual memory */ + + void* frame_buffer_dma; /* pointer to first byte of frame */ + /* buffer in physical memory for DMA */ + + uint32 bytes_per_row; /* number of bytes in one */ + /* virtual_width line */ + /* not neccesarily the same as */ + /* virtual_width * byte_per_pixel */ } frame_buffer_config; typedef struct { - uint16 h_res; /* minimum effective change in horizontal pixels, usually 8 */ - uint16 h_sync_min; /* min/max horizontal sync pulse width in pixels, a multiple of h_res */ + uint16 h_res; /* minimum effective change in */ + /* horizontal pixels, usually 8 */ + + uint16 h_sync_min; /* min/max horizontal sync pulse */ + /* width in pixels, a multiple of */ + /* h_res */ uint16 h_sync_max; - uint16 h_blank_min; /* min/max horizontal blank pulse width in pixels, a multiple of h_res */ + uint16 h_blank_min; /* min/max horizontal blank pulse */ + /* width in pixels, a multiple of */ + /* h_res */ uint16 h_blank_max; - uint16 v_res; /* minimum effective change in vertical lines, usually 1 */ - uint16 v_sync_min; /* min/max vertical sync pulse width in lines, a multiple of v_res */ + uint16 v_res; /* minimum effective change in */ + /* vertical lines, usually 1 */ + + uint16 v_sync_min; /* min/max vertical sync pulse */ + /* width in lines, a multiple of */ + /* v_res */ uint16 v_sync_max; - uint16 v_blank_min; /* min/max vertical blank pulse width in linex, a multiple of v_res */ + uint16 v_blank_min; /* min/max vertical blank pulse */ + /* width in linex, a multiple of */ + /* v_res */ uint16 v_blank_max; } display_timing_constraints; -// TODO: experimental API + +// WARNING: This is experimental new Haiku API typedef struct { uint32 version; char vendor[128]; @@ -135,81 +168,107 @@ typedef struct { } produced; float width; float height; - uint32 min_horizontal_frequency; // in kHz + uint32 min_horizontal_frequency; /* in kHz */ uint32 max_horizontal_frequency; - uint32 min_vertical_frequency; // in Hz + uint32 min_vertical_frequency; /* in Hz */ uint32 max_vertical_frequency; - uint32 max_pixel_clock; // in kHz + uint32 max_pixel_clock; /* in kHz */ } monitor_info; -enum { /* mode flags */ - B_SCROLL = 1 << 0, - B_8_BIT_DAC = 1 << 1, - B_HARDWARE_CURSOR = 1 << 2, - B_PARALLEL_ACCESS = 1 << 3, - B_DPMS = 1 << 4, - B_IO_FB_NA = 1 << 5 + +/* mode flags */ +enum { + B_SCROLL = 1 << 0, + B_8_BIT_DAC = 1 << 1, + B_HARDWARE_CURSOR = 1 << 2, + B_PARALLEL_ACCESS = 1 << 3, + B_DPMS = 1 << 4, + B_IO_FB_NA = 1 << 5 }; -enum { /* power saver flags */ - B_DPMS_ON = 1 << 0, - B_DPMS_STAND_BY = 1 << 1, - B_DPMS_SUSPEND = 1 << 2, - B_DPMS_OFF = 1 << 3 + +/* power saver flags */ +enum { + B_DPMS_ON = 1 << 0, + B_DPMS_STAND_BY = 1 << 1, + B_DPMS_SUSPEND = 1 << 2, + B_DPMS_OFF = 1 << 3 }; -enum { /* timing flags */ - B_BLANK_PEDESTAL = 1 << 27, - B_TIMING_INTERLACED = 1 << 28, - B_POSITIVE_HSYNC = 1 << 29, - B_POSITIVE_VSYNC = 1 << 30, - B_SYNC_ON_GREEN = 1 << 31 + +/* timing flags */ +enum { + B_BLANK_PEDESTAL = 1 << 27, + B_TIMING_INTERLACED = 1 << 28, + B_POSITIVE_HSYNC = 1 << 29, + B_POSITIVE_VSYNC = 1 << 30, + B_SYNC_ON_GREEN = 1 << 31 }; + typedef struct { - uint16 src_left; /* guaranteed constrained to virtual width and height */ + uint16 src_left; /* guaranteed constrained to */ + /* virtual width and height */ uint16 src_top; uint16 dest_left; uint16 dest_top; - uint16 width; /* 0 to N, where zero means one pixel, one means two pixels, etc. */ - uint16 height; /* 0 to M, where zero means one line, one means two lines, etc. */ + uint16 width; /* 0 to N, where zero means */ + /* one pixel, one means two pixels, */ + /* etc. */ + uint16 height; /* 0 to M, where zero means one */ + /* line, one means two lines, etc. */ } blit_params; -typedef struct { - uint16 src_left; /* guaranteed constrained to virtual width and height */ - uint16 src_top; - uint16 src_width; /* 0 to N, where zero means one pixel, one means two pixels, etc. */ - uint16 src_height; /* 0 to M, where zero means one line, one means two lines, etc. */ - uint16 dest_left; - uint16 dest_top; - uint16 dest_width; /* 0 to N, where zero means one pixel, one means two pixels, etc. */ - uint16 dest_height; /* 0 to M, where zero means one line, one means two lines, etc. */ -} scaled_blit_params; typedef struct { - uint16 left; /* guaranteed constrained to virtual width and height */ + uint16 src_left; /* guaranteed constrained to */ + /* virtual width and height */ + uint16 src_top; + uint16 src_width; /* 0 to N, where zero means one */ + /* pixel, one means two pixels, */ + /* etc. */ + uint16 src_height; /* 0 to M, where zero means one */ + /* line, one means two lines, etc. */ + uint16 dest_left; + uint16 dest_top; + uint16 dest_width; /* 0 to N, where zero means one */ + /* pixel, one means two pixels, etc. */ + uint16 dest_height; /* 0 to M, where zero means one */ + /* line, one means two lines, etc. */ +} scaled_blit_params; + + +typedef struct { + uint16 left; /* guaranteed constrained to */ + /* virtual width and height */ uint16 top; uint16 right; uint16 bottom; } fill_rect_params; + typedef struct { - uint32 engine_id; /* 0 == no engine, 1,2,3 etc individual engines */ - uint32 capability_mask; /* features this engine supports */ - void *opaque; /* optional pointer to engine private storage */ + uint32 engine_id; /* 0 == no engine, 1,2,3 etc */ + /* individual engines */ + uint32 capability_mask; /* features this engine supports */ + void* opaque; /* optional pointer to engine */ + /* private storage */ } engine_token; + enum { /* engine capabilities */ B_2D_ACCELERATION = 1 << 0, B_3D_ACCELERATION = 1 << 1 }; + typedef struct { - uint64 counter; /* counts issued primatives */ - uint32 engine_id; /* what engine the counter is for */ - char opaque[12]; /* 12 bytes of private storage */ + uint64 counter; /* counts issued primatives */ + uint32 engine_id; /* what engine the counter is for */ + char opaque[12]; /* 12 bytes of private storage */ } sync_token; + /* Masks for color info */ /* B_CMAP8 - 0x000000ff */ /* B_RGB15/16 - 0x0000ffff */ @@ -218,49 +277,62 @@ typedef struct { typedef status_t (*init_accelerant)(int fd); 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 (*get_accelerant_clone_info)(void* data); +typedef status_t (*clone_accelerant)(void* data); typedef void (*uninit_accelerant)(void); -typedef status_t (*get_accelerant_device_info)(accelerant_device_info *adi); +typedef status_t (*get_accelerant_device_info)(accelerant_device_info* adi); 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 *mode_to_set); -typedef status_t (*get_display_mode)(display_mode *current_mode); -typedef status_t (*get_frame_buffer_config)(frame_buffer_config *a_frame_buffer); -typedef status_t (*get_pixel_clock_limits)(display_mode *dm, uint32 *low, uint32 *high); -typedef status_t (*move_display_area)(uint16 h_display_start, uint16 v_display_start); -typedef status_t (*get_timing_constraints)(display_timing_constraints *dtc); -typedef void (*set_indexed_colors)(uint count, uint8 first, uint8 *color_data, uint32 flags); +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* mode_to_set); +typedef status_t (*get_display_mode)(display_mode* current_mode); +typedef status_t (*get_frame_buffer_config)(frame_buffer_config* + a_frame_buffer); +typedef status_t (*get_pixel_clock_limits)(display_mode* dm, uint32* low, + uint32* high); +typedef status_t (*move_display_area)(uint16 h_display_start, + uint16 v_display_start); +typedef status_t (*get_timing_constraints)(display_timing_constraints* dtc); +typedef void (*set_indexed_colors)(uint count, uint8 first, uint8* color_data, + 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 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 hot_x, uint16 hot_y, uint8 *andMask, uint8 *xorMask); +typedef status_t (*set_cursor_shape)(uint16 width, uint16 height, + uint16 hot_x, uint16 hot_y, uint8* andMask, uint8* xorMask); typedef void (*move_cursor)(uint16 x, uint16 y); typedef void (*show_cursor)(bool is_visible); typedef uint32 (*accelerant_engine_count)(void); -typedef status_t (*acquire_engine)(uint32 capabilities, uint32 max_wait, sync_token *st, engine_token **et); -typedef status_t (*release_engine)(engine_token *et, sync_token *st); +typedef status_t (*acquire_engine)(uint32 capabilities, uint32 max_wait, + 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 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 (*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); +typedef void (*fill_span)(engine_token* et, uint32 color, uint16* list, + uint32 count); /* - The uint16 *list points to a list of tripples: + 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 diff --git a/headers/os/add-ons/graphics/GraphicsCard.h b/headers/os/add-ons/graphics/GraphicsCard.h index a7c585da1b..2c8ef662f2 100644 --- a/headers/os/add-ons/graphics/GraphicsCard.h +++ b/headers/os/add-ons/graphics/GraphicsCard.h @@ -1,23 +1,15 @@ -/****************************************************************************** -/ -/ File: GraphicsCard.h -/ -/ Description: App Server interface for graphics card add-ons. -/ -/ Copyright 1993-98, Be Incorporated -/ -*******************************************************************************/ - +/* + * Copyright 2009, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _GRAPHICS_CARD_H #define _GRAPHICS_CARD_H -#include + #include -#include -/*-------------------------------------------------------------*/ -/*----- Command Constants -------------------------------------*/ +/* #pragma mark - command constants */ enum { B_OPEN_GRAPHICS_CARD, B_CLOSE_GRAPHICS_CARD, @@ -28,115 +20,115 @@ enum { B_CONFIG_GRAPHICS_CARD, B_GET_REFRESH_RATES, B_SET_SCREEN_GAMMA, - + B_GET_INFO_FOR_CLONE_SIZE, B_GET_INFO_FOR_CLONE, B_SET_CLONED_GRAPHICS_CARD, - B_CLOSE_CLONED_GRAPHICS_CARD, + B_CLOSE_CLONED_GRAPHICS_CARD, B_PROPOSE_FRAME_BUFFER, B_SET_FRAME_BUFFER, B_SET_DISPLAY_AREA, - B_MOVE_DISPLAY_AREA} -; - -/*----- Optional ---------------*/ - -enum { - B_CRT_CONTROL = 0x0001, - B_GAMMA_CONTROL = 0x0002, - B_FRAME_BUFFER_CONTROL = 0x0004, - B_PARALLEL_BUFFER_ACCESS = 0x0008, - B_LAME_ASS_CARD = 0x0010 + B_MOVE_DISPLAY_AREA }; -/*-------------------------------------------------------------*/ -/*----- Structures --------------------------------------------*/ +/* #pragma mark - optional flags */ +enum { + B_CRT_CONTROL = 0x0001, + B_GAMMA_CONTROL = 0x0002, + B_FRAME_BUFFER_CONTROL = 0x0004, + B_PARALLEL_BUFFER_ACCESS = 0x0008, + B_LAME_ASS_CARD = 0x0010 +}; + + +/* #pragma mark - structures */ + typedef struct { - int16 version; - int16 id; - void *frame_buffer; - char rgba_order[4]; - int16 flags; + int16 version; + int16 id; + void* frame_buffer; + char rgba_order[4]; + int16 flags; int16 bits_per_pixel; - int16 bytes_per_row; + int16 bytes_per_row; int16 width; int16 height; } graphics_card_info; typedef struct { - int32 index; - rgb_color color; + int32 index; + rgb_color color; } indexed_color; typedef struct { - uint32 space; - float refresh_rate; - uchar h_position; - uchar v_position; - uchar h_size; - uchar v_size; + uint32 space; + float refresh_rate; + uchar h_position; + uchar v_position; + uchar h_size; + uchar v_size; } graphics_card_config; typedef struct { - float min; - float max; - float current; + float min; + float max; + float current; } refresh_rate_info; typedef struct { - void *screen_base; - void *io_base; - uint32 vendor_id; - uint32 device_id; - uint32 _reserved1_; - uint32 _reserved2_; + void* screen_base; + void* io_base; + uint32 vendor_id; + uint32 device_id; + uint32 _reserved1_; + uint32 _reserved2_; } graphics_card_spec; typedef struct { - int16 x1; - int16 y1; - int16 x2; - int16 y2; - rgb_color color; + int16 x1; + int16 y1; + int16 x2; + int16 y2; + rgb_color color; } rgb_color_line; typedef struct { - int16 x1; - int16 y1; - int16 x2; - int16 y2; - uchar color; + int16 x1; + int16 y1; + int16 x2; + int16 y2; + uchar color; } indexed_color_line; typedef struct { - int16 bits_per_pixel; - int16 bytes_per_row; - int16 width; - int16 height; - int16 display_width; - int16 display_height; - int16 display_x; - int16 display_y; + int16 bits_per_pixel; + int16 bytes_per_row; + int16 width; + int16 height; + int16 display_width; + int16 display_height; + int16 display_x; + int16 display_y; } frame_buffer_info; typedef struct { - uchar red[256]; - uchar green[256]; - uchar blue[256]; + uchar red[256]; + uchar green[256]; + uchar blue[256]; } screen_gamma; -/*-------------------------------------------------------------*/ -/*----- Hook Function -----------------------------------------*/ +/* #pragma mark - hook function */ + typedef void (*graphics_card_hook) (); @@ -147,42 +139,31 @@ typedef void (*graphics_card_hook) (); extern "C" { #endif -int32 control_graphics_card(uint32, void*); +int32 control_graphics_card(uint32, void*); #ifdef __cplusplus } #endif -/*-------------------------------------------------------------*/ -/*----- Debugging Functions ------------------------------------*/ +/* #pragma mark - debugging functions */ + #ifdef __cplusplus extern "C" { #endif -void dprintf(const char *format, ...); -bool set_dprintf_enabled(bool); /* returns old enable flag */ +void dprintf(const char *format, ...); +bool set_dprintf_enabled(bool); + /* returns old enable flag */ #ifdef __cplusplus } #endif -/*-------------------------------------------------------------*/ -/*----- Obsolete ---------------------------------------------*/ +/* #pragma mark - deprecated */ #define B_HOOK_COUNT B_GRAPHICS_HOOK_COUNT -/*-------------------------------------------------------------*/ -/*-------------------------------------------------------------*/ - #endif /* _GRAPHICS_CARD_H */ - - - - - - - - diff --git a/headers/os/add-ons/input_server/InputServerDevice.h b/headers/os/add-ons/input_server/InputServerDevice.h index 1e50180a0f..3c335887cc 100644 --- a/headers/os/add-ons/input_server/InputServerDevice.h +++ b/headers/os/add-ons/input_server/InputServerDevice.h @@ -1,5 +1,5 @@ /* - * Copyright 2008 Haiku, Inc. All rights reserved. + * Copyright 2008, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _INPUTSERVERDEVICE_H diff --git a/headers/os/add-ons/input_server/InputServerFilter.h b/headers/os/add-ons/input_server/InputServerFilter.h index 306654913e..9812bd6b88 100644 --- a/headers/os/add-ons/input_server/InputServerFilter.h +++ b/headers/os/add-ons/input_server/InputServerFilter.h @@ -1,40 +1,36 @@ -/****************************************************************************** -/ -/ File: InputServerFilter.h -/ -/ Description: Add-on class for input_server filters. -/ -/ Copyright 1998, Be Incorporated, All Rights Reserved. -/ -*******************************************************************************/ - +/* + * Copyright 2009, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _INPUTSERVERFILTER_H #define _INPUTSERVERFILTER_H -#include + #include -#include + class BRegion; + class BInputServerFilter { public: - BInputServerFilter(); - virtual ~BInputServerFilter(); + BInputServerFilter(); + virtual ~BInputServerFilter(); - virtual status_t InitCheck(); + virtual status_t InitCheck(); - virtual filter_result Filter(BMessage *message, BList *outList); + virtual filter_result Filter(BMessage* message, BList* _list); - status_t GetScreenRegion(BRegion *region) const; + status_t GetScreenRegion(BRegion* region) const; private: - virtual void _ReservedInputServerFilter1(); - virtual void _ReservedInputServerFilter2(); - virtual void _ReservedInputServerFilter3(); - virtual void _ReservedInputServerFilter4(); - uint32 _reserved[4]; + // FBC Padding + virtual void _ReservedInputServerFilter1(); + virtual void _ReservedInputServerFilter2(); + virtual void _ReservedInputServerFilter3(); + virtual void _ReservedInputServerFilter4(); + + uint32 _reserved[4]; }; - -#endif +#endif // _INPUTSERVERFILTER_H diff --git a/headers/os/add-ons/input_server/InputServerMethod.h b/headers/os/add-ons/input_server/InputServerMethod.h index 20218f96c4..61792b29e2 100644 --- a/headers/os/add-ons/input_server/InputServerMethod.h +++ b/headers/os/add-ons/input_server/InputServerMethod.h @@ -1,19 +1,12 @@ -/****************************************************************************** -/ -/ File: InputServerMethod.h -/ -/ Description: Add-on class for input_server methods. -/ -/ Copyright 1998, Be Incorporated, All Rights Reserved. -/ -******************************************************************************/ - +/* + * Copyright 2009, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _INPUTSERVERMETHOD_H #define _INPUTSERVERMETHOD_H -#include + #include -#include class _BMethodAddOn_; @@ -21,32 +14,37 @@ class AddOnManager; class BMenu; class InputServer; + class BInputServerMethod : public BInputServerFilter { public: - BInputServerMethod(const char *name, - const uchar *icon); - virtual ~BInputServerMethod(); + BInputServerMethod(const char* name, + const uchar* icon); + virtual ~BInputServerMethod(); - virtual status_t MethodActivated(bool active); + virtual status_t MethodActivated(bool active); - status_t EnqueueMessage(BMessage *message); + status_t EnqueueMessage(BMessage* message); - status_t SetName(const char *name); - status_t SetIcon(const uchar *icon); - status_t SetMenu(const BMenu *menu, const BMessenger target); + status_t SetName(const char* name); + status_t SetIcon(const uchar* icon); + status_t SetMenu(const BMenu* menu, + const BMessenger target); private: - _BMethodAddOn_* fOwner; - - friend class AddOnManager; - friend class InputServer; - - virtual void _ReservedInputServerMethod1(); - virtual void _ReservedInputServerMethod2(); - virtual void _ReservedInputServerMethod3(); - virtual void _ReservedInputServerMethod4(); - uint32 _reserved[4]; + // FBC padding + virtual void _ReservedInputServerMethod1(); + virtual void _ReservedInputServerMethod2(); + virtual void _ReservedInputServerMethod3(); + virtual void _ReservedInputServerMethod4(); + + uint32 _reserved[4]; + +private: + friend class AddOnManager; + friend class InputServer; + +private: + _BMethodAddOn_* fOwner; }; - -#endif +#endif // _INPUTSERVERMETHOD_H diff --git a/headers/os/kernel/scheduler.h b/headers/os/kernel/scheduler.h index 6e179bba42..f55eb2ff57 100644 --- a/headers/os/kernel/scheduler.h +++ b/headers/os/kernel/scheduler.h @@ -1,54 +1,73 @@ -/***************************************************************************** - - File: scheduler.h - - Description: Scheduling inquiry functions - - Copyright 1998-, Be Incorporated, All Rights Reserved. - -*****************************************************************************/ - - -#if !defined(SCHEDULER_H) +/* + * Copyright 2009, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef SCHEDULER_H #define SCHEDULER_H -#include + #include -/* To get a good thread priority, call suggest_thread_priority() with the following information: */ -/* 'what' is a bit mask describing what you're doing in the thread. */ -/* 'period' is how many times a second your thread needs to run (-1 if you're running continuously.) */ -/* 'jitter' is an estimate (in us) of how much that period can vary, as long as it stays centered on the average. */ -/* 'length' is how long (in us) you expect to run for each invocation. */ -/* "invocation" means, typically, receiving a message, dispatching it, and then returning to reading a message. */ -/* MANIPULATION means both filtering and compression/decompression. */ -/* PLAYBACK and RECORDING means threads feeding/reading ACTUAL HARDWARE ONLY. */ -/* 0 means don't care */ -enum be_task_flags { /* bitmasks for "what" */ - B_DEFAULT_MEDIA_PRIORITY = 0, - B_OFFLINE_PROCESSING = 0x1, - B_STATUS_RENDERING = 0x2, /* can also use this for "preview" type things */ - B_USER_INPUT_HANDLING = 0x4, - B_LIVE_VIDEO_MANIPULATION = 0x8, /* non-live processing is OFFLINE_PROCESSING */ - B_VIDEO_PLAYBACK = 0x10, /* feeding hardware */ - B_VIDEO_RECORDING = 0x20, /* grabbing from hardware */ - B_LIVE_AUDIO_MANIPULATION = 0x40, /* non-live processing is OFFLINE_PROCESSING */ - B_AUDIO_PLAYBACK = 0x80, /* feeding hardware */ - B_AUDIO_RECORDING = 0x100, /* grabbing from hardware */ - B_LIVE_3D_RENDERING = 0x200, /* non-live rendering is OFFLINE_PROCESSING */ - B_NUMBER_CRUNCHING = 0x400, - B_MIDI_PROCESSING = 0x800 + +/*! + To get a good thread priority, call suggest_thread_priority() with the + following information: + \a what is a bit mask describing what you're doing in the thread. + \a period is how many times a second your thread needs to run + (-1 if you're running continuously.) + \a jitter is an estimate (in us) of how much that period can vary, + as long as it stays centered on the average. + \a length is how long (in us) you expect to run for each invocation. + "Invocation" means, typically, receiving a message, dispatching + it, and then returning to reading a message. + MANIPULATION means both filtering and compression/decompression. + PLAYBACK and RECORDING means threads feeding/reading ACTUAL + HARDWARE ONLY. + 0 means don't care +*/ + +/* bitmasks for suggest_thread_priority() */ +enum be_task_flags { + B_DEFAULT_MEDIA_PRIORITY = 0x000, + B_OFFLINE_PROCESSING = 0x001, + B_STATUS_RENDERING = 0x002, /* can also use this for */ + /* "preview" type things */ + B_USER_INPUT_HANDLING = 0x004, + B_LIVE_VIDEO_MANIPULATION = 0x008, /* non-live processing is */ + /* OFFLINE_PROCESSING */ + + B_VIDEO_PLAYBACK = 0x010, /* feeding hardware */ + B_VIDEO_RECORDING = 0x020, /* grabbing from hardware */ + B_LIVE_AUDIO_MANIPULATION = 0x040, /* non-live processing is */ + /* OFFLINE_PROCESSING */ + + B_AUDIO_PLAYBACK = 0x080, /* feeding hardware */ + B_AUDIO_RECORDING = 0x100, /* grabbing from hardware */ + B_LIVE_3D_RENDERING = 0x200, /* non-live rendering is */ + /* OFFLINE_PROCESSING */ + B_NUMBER_CRUNCHING = 0x400, + B_MIDI_PROCESSING = 0x800 }; + #if defined(__cplusplus) extern "C" { + int32 suggest_thread_priority(uint32 task_flags = B_DEFAULT_MEDIA_PRIORITY, int32 period = 0, bigtime_t jitter = 0, bigtime_t length = 0); -bigtime_t estimate_max_scheduling_latency(thread_id th = -1); /* default is current thread */ + +bigtime_t estimate_max_scheduling_latency(thread_id th = -1); + /* default is current thread */ + } #else -int32 suggest_thread_priority(uint32 what, int32 period, bigtime_t jitter, bigtime_t length); -bigtime_t estimate_max_scheduling_latency(thread_id th); /* default is current thread */ + +int32 suggest_thread_priority(uint32 what, int32 period, bigtime_t jitter, + bigtime_t length); + +bigtime_t estimate_max_scheduling_latency(thread_id th); + /* default is current thread */ + #endif -#endif /* SCHEDULER_H */ +#endif // SCHEDULER_H