machblue_defines.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:33k
- /*-----------------------------------------------------------------------------
- | @(#) machblue_defines.h
- |
- | JSWF: The Portable SWF Engine For Embedded Devices,
- | Copyright (c) 2002-2006, BlueStreak Technology Inc., All Rights Reserved.
- |
- +----------------------------------------------------------------------------*/
- #ifndef _MACHBLUE_DEFINES_H_
- #define _MACHBLUE_DEFINES_H_
- /*----------------------------------------------------------
- | Include definition below this line
- +----------------------------------------------------------*/
- #include "machblue_customer.h"
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- /*----------------------------------------------------------
- | Macro definition below this line
- +----------------------------------------------------------*/
- /** Machblue invalid handle */
- #define MB_INVALID_HANDLE 0
- /** Machblue maximum configuration string length */
- #define MB_CFG_MAX_STR_LENGTH 32
- /** Machblue maximum path name length */
- #define MB_MAX_PATH_LENGTH 96
- /** Machblue maximum arg structure entry count */
- #define MB_MAX_ARGS_COUNT 4
- /** Machblue url current version */
- #define MB_URL_CURRENT_VERSION (-1)
- /** Machblue MB_EVENT_KEY_DOWN ascii code argument (int)
- * @see MB_EVENT_KEY_DOWN
- * @see mb_key_constant_t
- */
- #define MB_ASCII_CODE_ARG(args) ((args)->arg[0].l)
- /** Machblue MB_EVENT_KEY_DOWN key code argument (int)
- * @see MB_EVENT_KEY_DOWN
- * @see mb_key_constant_t
- */
- #define MB_KEY_CODE_ARG(args) ((args)->arg[1].l)
- /** Machblue MB_EVENT_INPUT_MOVE input device x position argument (int)
- * @see MB_EVENT_INPUT_MOVE
- */
- #define MB_INPUT_X_ARG(args) ((args)->arg[0].l)
- /** Machblue MB_EVENT_INPUT_MOVE input device y position argument (int)
- * @see MB_EVENT_INPUT_MOVE
- */
- #define MB_INPUT_Y_ARG(args) ((args)->arg[1].l)
- /** Machblue MB_EVENT_INPUT_MOVE input button id argument (mb_input_button_id_t)
- * @see MB_EVENT_INPUT_MOVE
- * @see mb_input_button_id_t
- */
- #define MB_INPUT_BUTTON_ARG(args) ((args)->arg[0].l)
-
- /** Machblue MB_EVENT_NATIVE platform dependent native event argument (void *)
- * @see MB_EVENT_NATIVE
- */
- #define MB_NATIVE_EVENT_ARG(args) ((args)->arg[0].vp)
- /** Machblue MB_GFX_REDRAW_CB gfx rect pointer argument (mb_rect_t *)
- * @see MB_GFX_REDRAW_CB
- * @see mb_rect_t
- */
- #define MB_GFX_RECT_ARG(args) ((args)->arg[0].vp)
- /** Machblue MB_GFX_REDRAW_CB gfx_ctx surface argument (mb_surface_t)
- * @see MB_GFX_REDRAW_CB
- * @see mb_surface_t
- */
- #define MB_GFX_SURFACE_ARG(args) ((args)->arg[1].l)
- /** Machblue MB_GFX_REDRAW_CB gfx context arg (mb_gfx_ctx_t *)
- * @see MB_GFX_REDRAW_CB
- * @see mb_gfx_ctx_t
- */
- #define MB_GFX_CTX_ARG(args) ((args)->arg[2].vp)
- /** Machblue MB_GFX_SET_PALETTE_CB gfx start entry argument (int)
- * @see MB_GFX_SET_PALETTE_CB
- */
- #define MB_GFX_START_ENTRY_ARG(args) ((args)->arg[0].l)
- /** Machblue MB_GFX_SET_PALETTE_CB gfx palette argument (mb_palette_t *)
- * @see MB_GFX_SET_PALETTE_CB
- * @see mb_palette_t
- */
- #define MB_GFX_PALETTE_ARG(args) ((args)->arg[1].vp)
- /** Machblue MB_NR_MOVIE_ATTACHED notification movie (mb_movie_t)
- * @see MB_NR_MOVIE_ATTACHED
- * @see mb_movie_t
- */
- #define MB_NR_MOVIE_ARG(args) ((args)->arg[0].vp)
- /** Machblue MB_NR_MOVIE_ATTACHED notification client (mb_client_t)
- * @see MB_NR_MOVIE_ATTACHED
- * @see mb_client_t
- */
- #define MB_NR_CLIENT_ARG(args) ((args)->arg[1].vp)
- /** Machblue MB_NR_MOVIE_ACTIVATED notification extra context (mb_activate_reason_t)
- * @see MB_NR_MOVIE_ATTACHED
- * @see mb_activate_reason_t
- */
- #define MB_NR_ACTIVATE_REASON_ARG(args) ((args)->arg[2].l)
- /** Machblue MB_NR_MOVIE_SUSPENDED notification extra context (mb_suspend_reason_t)
- * @see MB_NR_MOVIE_SUSPENDED
- * @see mb_suspend_reason_t
- */
- #define MB_NR_SUSPEND_REASON_ARG(args) ((args)->arg[2].l)
- /** Machblue MB_NR_MOVIE_ABORT notification extra context (mb_abort_reason_t)
- * @see MB_NR_MOVIE_ABORT
- * @see mb_abort_reason_t
- */
- #define MB_NR_ABORT_REASON_ARG(args) ((args)->arg[2].l)
- /** Machblue MB_NR_LC_SEND_COMPLETE notification extra context (mb_handle_t)
- * @see MB_NR_LC_SEND_COMPLETE
- * @see mb_handle_t
- */
- #define MB_NR_LC_HANDLE(args) ((args)->arg[2].l)
- /** Machblue MB_NR_LC_REQUEST notification extra context (mb_lc_attributes_t *)
- * @see MB_NR_LC_SEND_COMPLETE
- * @see mb_lc_attributes_t
- */
- #define MB_NR_LC_ATTRIBUTES(args) ((args)->arg[2].vp)
- /** Machblue MB_NR_LC_SEND_COMPLETE notification extra context (mb_error_t)
- * @see MB_NR_LC_SEND_COMPLETE
- * @see mb_error_t
- */
- #define MB_NR_LC_STATUS(args) ((args)->arg[3].l)
- /** Machblue MB_LS_SUCCESS load status movie (mb_movie_t)
- * @see see MB_LS_SUCCESS
- * @see mb_movie_t
- */
- #define MB_LS_MOVIE_ARG(args) ((args)->arg[0].vp)
- /** Machblue MB_URL_OPEN url argument (mb_char_t *)
- * @see MB_URL_OPEN
- * @see mb_char_t
- */
- #define MB_URL_ARG(args) ((args)->arg[0].vp)
- /** Machblue MB_URL_CLOSE url handle argument (mb_url_handle_t)
- * @see MB_URL_CLOSE
- * @see mb_url_handle_t
- */
- #define MB_URL_HANDLE_ARG(args) ((args)->arg[0].l)
- /** Machblue MB_URL_POLL url polled event argument (mb_url_event_t)
- * @see MB_URL_POLL
- * @see mb_url_event_t
- */
- #define MB_URL_EVENT_ARG(args) ((args)->arg[1].l)
-
- /** Machblue MB_URL_STORE url data argument (void *)
- * @see MB_URL_STORE
- */
- #define MB_URL_DATA_ARG(args) ((args)->arg[1].vp)
- /** Machblue MB_URL_STORE url data size argument (mb_size_t)
- * @see MB_URL_STORE
- * @see mb_size_t
- */
- #define MB_URL_SIZE_ARG(args) ((args)->arg[2].l)
- /** Machblue MB_URL_GET_DATA url data size pointer argument (mb_size_t *)
- * @see MB_URL_GET_DATA
- * @see mb_size_t
- */
- #define MB_URL_SIZE_POINTER_ARG(args) ((args)->arg[2].vp)
- /** Machblue MB_URL_GET_VERSION url version pointer argument (int *)
- * @see MB_URL_GET_VERSION
- */
- #define MB_URL_VERSION_POINTER_ARG(args) ((args)->arg[2].vp)
- /** Machblue MB_PCM_PLAY_COMPLETED_CB pcm buffer argument (void *)
- * @see MB_PCM_PLAY_COMPLETED_CB
- */
- #define MB_PCM_BUFFER_ARG(args) ((args)->arg[0].vp)
- /*----------------------------------------------------------
- | Type definition below this line
- +----------------------------------------------------------*/
- /*
- * ======================= Primitive Types ===========================================
- */
- /** Machblue error type */
- typedef enum {
- MB_FAILURE = 0, /**< Machblue failure error code */
- MB_SUCCESS = 1, /**< Machblue success error code */
- MB_NOT_INITIALIZED, /**< Machblue not initialized error code */
- MB_BUSY, /**< Machblue busy error code */
- MB_NOT_A_DIRECTORY, /**< Machblue not a directory error code */
- MB_UNIMPLEMENTED, /**< RESERVED for Machblue internal purposes -- DO NOT USE */
- MB_LAST_ERROR_CODE
- } mb_error_t;
- /** Machblue client type */
- typedef struct _mb_client_s * mb_client_t;
- /** Machblue movie type */
- typedef struct _mb_movie_s * mb_movie_t;
- /** Machblue handle type */
- typedef long mb_handle_t;
- /** Machblue script object type */
- typedef void mb_script_object_t;
- /** Machblue time type in seconds since 01/01/1970 UTC */
- typedef unsigned long mb_time_t;
- /** Machblue point type */
- typedef struct {
- int x;
- int y;
- } mb_point_t;
- /** Machblue rectangle type */
- typedef struct {
- int x;
- int y;
- unsigned int width;
- unsigned int height;
- } mb_rect_t;
- /** Machblue argument type */
- typedef union {
- long l; /**< argument viewed as long */
- void *vp; /**< argument viewed as void pointer */
- } mb_arg_t;
- /** Machblue argument array type */
- typedef struct {
- mb_arg_t arg[MB_MAX_ARGS_COUNT];
- } mb_args_t;
- /** Machblue event structure type */
- typedef struct {
- unsigned long type;
- mb_arg_t arg[MB_MAX_ARGS_COUNT];
- } mb_event_t;
- /** machblue event types enum */
- typedef enum {
- MB_EVENT_NULL = 0, /**< NULL event */
- MB_EVENT_KEY_DOWN, /**< key down event.
- MB_ASCII_CODE_ARG(event) = ascii code of key pressed
- MB_KEY_CODE_ARG(event) = key code of key pressed */
- MB_EVENT_KEY_UP, /**< key up event.
- MB_ASCII_CODE_ARG(event) = ascii code of key pressed
- MB_KEY_CODE_ARG(event) = key code of key pressed */
- MB_EVENT_KEY_REPEAT, /**< key repeat event.
- MB_ASCII_CODE_ARG(event) = ascii code of key pressed
- MB_KEY_CODE_ARG(event) = key code of key pressed */
- MB_EVENT_INPUT_MOVE, /**< INPUT move event.
- MB_INPUT_X_ARG(event) = x position of input device relative
- to gfx ctx bounds,
- MB_INPUT_Y_ARG(event) = y position of input device relative
- to gfx ctx bounds */
- MB_EVENT_INPUT_DOWN, /**< INPUT down event.
- MB_INPUT_BUTTON_ARG(event) = ID of the button pressed. */
- MB_EVENT_INPUT_UP, /**< INPUT up event.
- MB_INPUT_BUTTON_ARG(event) = ID of the button released. */
- MB_EVENT_NATIVE, /**< native event.
- MB_NATIVE_EVENT_ARG(event) = pointer to platform dependent
- native event */
- MB_EVENT_LAST
- } mb_event_type_t;
- /*
- * ======================= Client API Types ===========================================
- */
- /** Machblue rgba color type */
- typedef struct {
- unsigned char r; /**< red component */
- unsigned char g; /**< green component */
- unsigned char b; /**< blue component */
- unsigned char a; /**< alpha component */
- } mb_rgba_color_t;
- /** Machblue palette type */
- typedef struct {
- mb_rgba_color_t *colors; /**< color entries */
- int count; /**< number of colors in palette */
- } mb_palette_t;
- /** Machblue graphic callback function reason enum */
- typedef enum {
- MB_GFX_REDRAW_CB, /**< invoked when a gfx redraw is needed.
- MB_GFX_RECT_ARG(args) = pointer to the mb_rect to redraw
- MB_GFX_SURFACE_ARG(args) = pointer to the client provided
- gfx_ctx surface
- MB_GFX_CTX_ARG(arg) = pointer to the client provided gfx_ctx */
- MB_GFX_SET_PALETTE_CB, /**< invoked when a new palette need to be set (only on CLUT based systems)
- MB_GFX_START_ENTRY_ARG(args) = integer containg the starting
- entry number
- MB_GFX_PALETTE_ARG(args) = pointer to an mb_palette_t structure
- containing the palette to set
- MB_GFX_CTX_ARG(arg) = pointer to the client provided gfx_ctx */
- MB_GFX_LAST_CB
- } mb_gfx_cb_reason_t;
- /** Machblue graphic callback function */
- typedef mb_error_t (mb_gfx_callback_f)( mb_gfx_cb_reason_t reason, mb_args_t *args, void *client_data );
- /** Machblue graphic context type */
- typedef struct {
- mb_surface_t surface; /**< graphic surface to draw to */
- mb_rect_t bounds; /**< graphic context bounds on the physical display */
- mb_gfx_callback_f *callback_f; /**< graphic callback function */
- void *cb_client_data; /**< callback client data */
- } mb_gfx_ctx_t;
- /** Machblue sound context type */
- typedef struct {
- mb_pcm_engine_t pcm_engine; /**< pcm engine to playback sound too */
- } mb_sound_ctx_t;
- /** Machblue client notification reasons */
- typedef enum {
- MB_NR_MOVIE_ATTACHED, /**< movie attached notification reason
- MB_NR_MOVIE_ARG(args) = movie handle attached
- MB_NR_CLIENT_ARG(args)= client handle */
- MB_NR_MOVIE_DETACHED, /**< movie detached notification reason
- MB_NR_MOVIE_ARG(args) = movie handle detached
- MB_NR_CLIENT_ARG(args)= client handle */
- MB_NR_MOVIE_ACTIVATED, /**< movie activated notification reason
- MB_NR_MOVIE_ARG(args) = movie handle activated
- MB_NR_CLIENT_ARG(args) = client handle
- MB_NR_ACTIVATE_REASON_ARG(args) = movie activate reason */
- MB_NR_MOVIE_SUSPENDED, /**< movie suspended notification reason
- MB_NR_MOVIE_ARG(args) = movie handle suspended
- MB_NR_CLIENT_ARG(args) = client handle
- MB_NR_SUSPEND_REASON_ARG(args) = movie suspend reason */
- MB_NR_LC_SEND_COMPLETE, /**< movie local connection completed notification reason
- MB_NR_MOVIE_ARG(args) = target movie handle
- MB_NR_CLIENT_ARG(args) = client handle
- MB_NR_LC_HANDLE(args) = local connection handle
- MB_NR_LC_STATUS(args) = MB_SUCCESS if target could be invoked,
- MB_FAILURE otherwise */
- MB_NR_LC_REQUEST, /**< movie local connection request notification reason
- MB_NR_MOVIE_ARG(args) = movie handle sending the request
- MB_NR_CLIENT_ARG(args) = client handle
- MB_NR_LC_ATTRIBUTES(args) = local connection attributes */
- MB_NR_MOVIE_ABORT, /**< movie error notification reason
- MB_NR_MOVIE_ARG(args) = movie handle aborted
- MB_NR_CLIENT_ARG(args) = client handle
- MB_NR_ABORT_REASON_ARG(args) = movie abort reason */
- MB_NR_LAST
- } mb_notif_reason_t;
- /** Machblue client notification function */
- typedef mb_error_t (mb_client_notify_f)( mb_notif_reason_t reason, mb_args_t *args, void *client_data );
- /** Machnlue load notification status */
- typedef enum {
- MB_LS_FAILURE = 0, /**< load failure notification
- MB_LS_MOVIE_ARG(args) = movie handle that could not be loaded */
- MB_LS_SUCCESS, /**< load success notification
- MB_LS_MOVIE_ARG(args) = movie handle that was successfully loaded */
- MB_LS_LAST
- } mb_load_status_t;
- /** Machblue load notification function */
- typedef mb_error_t (mb_load_notify_f)( mb_load_status_t status, mb_args_t *args, void *client_data );
- /** Machblue movie info type */
- typedef struct {
- const mb_char_t *url; /**< SWF url given at movie handle creation */
- unsigned int version; /**< version of SWF format used*/
- unsigned int height; /**< height of the movie */
- unsigned int width; /**< width of the movie */
- unsigned int frame_rate; /**< frame rate used in the movie */
- } mb_movie_info_t;
- /** Machblue parameter type */
- typedef struct {
- const mb_char_t *name; /**< parameter name */
- const mb_char_t *value; /**< parameter value */
- } mb_param_t;
- /** Machblue Local Connection request attributes */
- typedef struct {
- const mb_char_t *connection; /**< connection name (excluding domain) */
- const mb_char_t *function; /**< function name */
- mb_param_t *parameters; /**< function parameters */
- } mb_lc_attributes_t;
- /** Machblue movie activation reasons */
- typedef enum {
- MB_AR_INITIAL, /**< initial activation reason */
- MB_AR_RESUME, /**< resume activation reason */
- MB_AR_SYSTEM, /**< system activation reason */
- MB_AR_INTERNAL, /**< internal activation reason: used only in
- mb_client_notify_f; do not use in
- mb_movie_activate(). Another movie has been suspended
- and the client's activation engine automatically
- reactivated this movie. */
- MB_AR_LAST
- } mb_activate_reason_t;
- /** Machblue movie suspend reasons */
- typedef enum {
- MB_SR_UNKNOWN, /**< unknown suspend reason */
- MB_SR_SYSTEM, /**< system suspend reason */
- MB_SR_QUIT, /**< movie quit suspend reason */
- MB_SR_INTERNAL, /**< internal suspend reason: used only in
- mb_client_notify_f; do not use in mb_movie_suspend().
- Another movie has been activated and the client's
- activation engine decided to suspended this movie. It
- will be automatically reactivated with MB_AR_INTERNAL
- when the other movie quits or is suspended. To
- prevent this reactivation, invoke mb_movie_suspend()
- with another reason. */
- MB_SR_LAST
- } mb_suspend_reason_t;
- /** Machblue movie abort reasons */
- typedef enum {
- MB_ABR_INIT_FAILED, /**< movie initialization failed abort reason */
- MB_ABR_OUT_OF_MEMORY, /**< movie out of memory abort reason */
- MB_ABR_NOT_RESPONDING, /**< movie not responding abort reason */
- MB_ABR_UNKNOWN_FATAL_ERROR, /**< unknown fatal error abort reason */
- MB_ABR_SYSTEM_SHUTDOWN, /**< player is going down abort reason */
- MB_ABR_LAST
- } mb_abort_reason_t;
- /**
- * Machblue key constants enumeration lists all non-ascii keys directly supported.
- * in flash
- */
- typedef enum {
- MB_KEY_BACKSPACE = 0x00000008, /**< The BACKSPACE key. */
- MB_KEY_TAB = 0x00000009, /**< The TAB key. */
- MB_KEY_SELECT = 0x0000000D, /**< The selection key. This can be enter or some other primary action key. */
- MB_KEY_SHIFT = 0x00000010, /**< The SHIFT key. */
- MB_KEY_CONTROL = 0x00000011, /**< The CONTROL key. */
- MB_KEY_CAPSLOCK = 0x00000014, /**< The CAPSLOCK key. */
- MB_KEY_ESCAPE = 0x0000001B, /**< The ESCAPE key. */
- MB_KEY_SPACE = 0x00000020, /**< The DELETE key. */
- MB_KEY_PAGE_UP = 0x00000021, /**< The key that represents a page up scrolling action. */
- MB_KEY_PAGE_DOWN = 0x00000022, /**< The key that represents a page down scrolling action. */
- MB_KEY_END = 0x00000023, /**< The END key. */
- MB_KEY_HOME = 0x00000024, /**< The HOME key. */
- MB_KEY_LEFT = 0x00000025, /**< The left navigation key. */
- MB_KEY_UP = 0x00000026, /**< The up navigation key. */
- MB_KEY_RIGHT = 0x00000027, /**< The right navigation key. */
- MB_KEY_DOWN = 0x00000028, /**< The down navigation key. */
- MB_KEY_INSERT = 0x0000002D, /**< The INSERT key. */
- MB_KEY_DELETE = 0x0000002E, /**< The DELETE key. */
- MB_KEY_LAST
- } mb_key_constant_t;
- /**
- * Machblue input button id enum type
- */
- typedef enum {
- MB_INPUT_BUTTON_LEFT = 0, /**< Input left button id */
- MB_INPUT_BUTTON_RIGHT, /**< Input right button id */
- MB_INPUT_BUTTON_CENTER, /**< Input center button id */
- MB_INPUT_BUTTON_LAST
- } mb_input_button_id_t;
- /*
- * ======================= Init API Types ===========================================
- */
- /** Machblue memory allocation config */
- typedef struct {
- void *initial_mem_block; /**< initial memory block to use for heap alocations, may be NULL */
- unsigned long imb_size; /**< initial memory block size */
- int is_growable; /**< 1 if heap can grow beyond initial block, 0 otherwise */
- unsigned long min_heap_increment; /**< minimum heap size increment */
- } mb_memory_config_t;
- /** Machblue video memory config */
- typedef struct {
- unsigned int max_mem_per_movie; /**< maximum amount of video memory available
- to a movie besides primary surface mem */
- unsigned int min_alloc_sys_mem_limit; /**< minimum amount of system memory below which
- new video buffer allocation should be denied */
- } mb_video_memory_config_t;
- /** Machblue registry config */
- typedef struct {
- mb_char_t root_path[MB_CFG_MAX_STR_LENGTH]; /**< default filesystem root dir location */
- unsigned int lifetime; /**< default file lifetime in seconds*/
- } mb_registry_config_t;
- /** Machblue http config */
- typedef struct {
- mb_char_t user_agent[MB_CFG_MAX_STR_LENGTH]; /**< http client user agent */
- unsigned int timeout; /**< default connectivity timeout in milliseconds */
- } mb_http_config_t;
- /** Machblue system information config */
- typedef struct {
- mb_char_t network_name[MB_CFG_MAX_STR_LENGTH]; /**< name of the network integrating
- MachBlue player */
- mb_char_t manufacturer_name[MB_CFG_MAX_STR_LENGTH]; /**< hardware manufacturer for the
- set-top box */
- mb_char_t model_name[MB_CFG_MAX_STR_LENGTH]; /**< model number of the set-top box */
- mb_char_t os_middleware_name[MB_CFG_MAX_STR_LENGTH]; /**< name of the OS or middleware on
- top of which the porting layer is
- built */
- mb_char_t os_middleware_version[MB_CFG_MAX_STR_LENGTH]; /**< version of the os/middleware */
- mb_char_t porting_layer_version[MB_CFG_MAX_STR_LENGTH]; /**< version of the porting layer */
- } mb_system_info_config_t;
- /** Machblue config structure */
- typedef struct {
- mb_size_t size; /**< config structure size */
- mb_memory_config_t memory; /**< memory allocation config */
- mb_video_memory_config_t video_memory; /**< video memory config */
- mb_registry_config_t registry; /**< registry config */
- mb_http_config_t http; /**< http config */
- mb_system_info_config_t system_info; /**< system info config */
- void *reserved; /**< reserved (do not modify) */
- void *init_client_data; /**< platform specific init client data to pass to
- mb_porting_layer_init */
- } mb_init_config_t;
- /** Machblue url handler event */
- typedef enum {
- MB_URL_EVENT_LOAD_COMPLETE, /**< Load complete event */
- MB_URL_EVENT_STORE_COMPLETE, /**< Store complete event */
- MB_URL_EVENT_TRANSACTION_COMPLETE, /**< Trasaction complete event */
- MB_URL_EVENT_ERROR, /**< Error condition event */
- MB_URL_EVENT_LAST
- } mb_url_event_t;
- /** Machblue url handler function reason enum */
- typedef enum {
- MB_URL_OPEN, /**< url open call: This is used by the player to open a new url.
- MB_URL_ARG(args) contains the url to open.
- MB_URL_VERSION_ARG(args) contains the version of the url
- to open. This is only relevant for
- schemes that support versioning
- (broadcast carousels, etc.)
- returns a valid mb_url_handle_t on success or MB_INVALID_URL_HANDLE
- on failure */
- MB_URL_CLOSE, /**< url close call: This is used by the player to close a previously opened
- handle.
- MB_URL_HANDLE_ARG(args) contains a url handle to close.
- returns MB_SUCCESS on success, MB_FAILURE on failure */
- MB_URL_LOAD, /**< url load call: This is used by the player to start the asynchronous loading
- process of a url handle.
- MB_URL_HANDLE_ARG(args) contains a url handle to load.
- returns MB_SUCCESS on success, MB_FAILURE on failure */
- MB_URL_STORE, /**< url store call: This is used by the player to store data at a given url.
- MB_URL_HANDLE_ARG(args) contains url handle to store,
- MB_URL_DATA_ARG(args) contains the data to store,
- MB_URL_SIZE_ARG(args) contains the size of the data to store.
- returns MB_SUCCESS on success, MB_FAILURE on failure */
- MB_URL_TRANSACT, /**< url transact call: This is used by the player to transact with a server at
- a given url. For HTTP schemes this corresponds to the POST method.
- MB_URL_HANDLE_ARG(args) contains url handle to transact on,
- MB_URL_DATA_ARG(args) contains the data to send for the transaction,
- MB_URL_SIZE_ARG(args) contains the size of the transaction data.
- returns MB_SUCCESS on success, MB_FAILURE on failure */
- MB_URL_POLL, /**< url poll call: This is used by the player to poll the state of a url handle.
- MB_URL_HANDLE_ARG(args) contains the url handle to poll.
- MB_URL_EVENT_ARG(args) contains the url event to poll for.
- returns MB_SUCCESS if the event condition polled for is current, MB_FAILURE
- otherwise. */
- MB_URL_GET_DATA, /**< url get_data call: This is used by the player to retrieve data from a url handle.
- MB_URL_HANDLE_ARG(args) contains url handle to get data from,
- MB_URL_SIZE_POINTER_ARG(args) contains pointer to data size.
- returns a pointer to url handle data on success, NULL on failure. */
- MB_URL_GET_VERSION, /**< url get_version call: This is used by the player to retrieve the version of a url handle.
- MB_URL_HANDLE_ARG(args) contains url handle to query,
- MB_URL_VERSION_POINTER_ARG(args) contains a pointer to version int to update.
- returns MB_SUCCESS on success, MB_FAILURE on failure. */
- MB_URL_LAST_REASON
- } mb_url_handler_reason_t;
- /** Machblue url handler function */
- typedef unsigned long (mb_url_handler_f)( mb_url_handler_reason_t reason, mb_args_t *args, void *client_data );
- /*
- * ======================= Porting Core API Types ===========================================
- */
- /** Machblue timer callback function */
- typedef mb_error_t (mb_timer_callback_f)( void *client_data );
- /** Machblue socket types */
- typedef enum {
- MB_SOCKET_TYPE_STREAM, /**< TCP socket type */
- MB_SOCKET_TYPE_DATAGRAM, /**< UDP socket type */
- MB_SOCKET_TYPE_LAST
- } mb_socket_type_t;
- /** Machblue socket event */
- typedef enum {
- MB_SOCKET_EVENT_DATA_IN, /**< Data available for read event */
- MB_SOCKET_EVENT_DATA_OUT, /**< Space available for non-blocking write event */
- MB_SOCKET_EVENT_ERROR, /**< Error condition event */
- MB_SOCKET_EVENT_LAST
- } mb_socket_event_t;
- /** Machblue directory entry type */
- typedef struct {
- mb_char_t name[MB_MAX_PATH_LENGTH]; /**< directory entry name */
- long reserved; /**< reserved for future use */
- } mb_dir_entry_t;
- /** Machblue pixel format */
- typedef enum {
- MB_CLUT8_FORMAT, /**< CLUT 8 format */
- MB_ALPHA_FORMAT, /**< 8 bits alpha plane format */
- MB_RGB565_FORMAT, /**< RGB 565 format */
- MB_ARGB4444_FORMAT, /**< ARGB 4444 format */
- MB_ARGB1555_FORMAT, /**< ARGB 1555 format */
- MB_ARGB8888_FORMAT, /**< ARGB 8888 format */
- MB_LAST_PIXEL_FORMAT
- } mb_pixel_format_t;
- /** Machblue blit options */
- typedef enum {
- MB_BLIT_COPY, /**< blit the content of the source to the destination without applying
- any transformation (direct copy) */
- MB_BLIT_TRANSPARENT, /**< blit the content of the source to the destination by applying
- any relevant transparency transformation (color keying or alpha)
- between the source pixels and the destination pixels */
- MB_LAST_BLIT
- } mb_blit_option_t;
- /**< Machblue PCM format */
- typedef enum {
- MB_PCM8_FORMAT, /**< 8 bits per sample PCM format */
- MB_PCM16_FORMAT, /**< 16 bits per sample PCM format (little endian) */
- MB_ADPCM8_FORMAT, /**< 8 bits per sample ADPCM format */
- MB_ADPCM16_FORMAT, /**< 16 bits per sample ADPCM format (little endian) */
- MB_LAST_PCM_FORMAT
- } mb_pcm_format_t;
- /** Machblue PCM callback function reason enum */
- typedef enum {
- MB_PCM_PLAY_COMPLETED_CB, /**< invoked when a pcm sample buffer sent for playback has been consumed.
- MB_PCM_BUFFER_ARG(args) is a pointer to the sample buffer that has
- been consumed */
- MB_PCM_LAST_CB
- } mb_pcm_cb_reason_t;
- /** Machblue PCM callback function */
- typedef mb_error_t (mb_pcm_callback_f)( mb_pcm_cb_reason_t reason, mb_args_t *sample_buffer, void *client_data );
- /** Machblue system time type */
- typedef struct {
- unsigned long sec; /**< seconds since 01/01/1970 UTC */
- long nanosec; /**< nanoseconds since previous second */
- } mb_system_time_t;
- /** Machblue time zone type */
- typedef struct {
- int daylight; /**< 1 if daylight saving is enabled, 0 otherwise */
- long offset; /**< offset in seconds from UTC */
- } mb_timezone_t;
- /** Machblue thread attributes type */
- typedef struct {
- mb_size_t stack_size; /**< thread stack size in bytes. If 0 the default system
- stack value should be used */
- mb_thread_priority_t priority; /**< thread priority (system dependant) */
- } mb_thread_attributes_t ;
- /** Machblue message type */
- typedef mb_event_t mb_message_t ;
- /** Machblue thread start function */
- typedef void (mb_thread_start_function_t)( void *arg );
- /** Machblue font style function */
- typedef enum {
- MB_FONT_STYLE_DEFAULT = 0, /**< normal font style */
- MB_FONT_STYLE_BOLD = 0x1, /**< bold font style */
- MB_FONT_STYLE_ITALIC = 0x2, /**< italic font style */
- MB_FONT_STYLE_LAST
- } mb_font_style_t;
- /** Machblue file statistics structure */
- typedef struct {
- mb_size_t size; /**< file size in bytes */
- mb_time_t creation_date; /**< file creation date in seconds since 01/01/1970 UTC if supported.
- Should be set to 0 otherwise. */
- mb_time_t access_date; /**< file last access date in seconds since 01/01/1970 UTC if supported.
- Sould be set 0 otherwise. */
- mb_time_t expiration_date; /**< file expiration date in seconds since 01/01/1970 UTC. This is
- the date at which the file will automatically be deleted from
- the filesystem if any. Should be set to 0 otherwise. */
- } mb_file_stats_t;
- /*----------------------------------------------------------
- | Functions definition below this line
- +----------------------------------------------------------*/
- #ifdef __cplusplus
- } /* extern "C" */
- #endif /* __cplusplus */
- #endif /* _BLUESTREAK_DEFINES_H_ */