machblue_client.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:10k
- /*-----------------------------------------------------------------------------
- | @(#) machblue_client.h
- |
- | JSWF: The Portable SWF Engine For Embedded Devices,
- | Copyright (c) 2002-2006, BlueStreak Technology Inc., All Rights Reserved.
- |
- +----------------------------------------------------------------------------*/
- #ifndef _MACHBLUE_CLIENT_H_
- #define _MACHBLUE_CLIENT_H_
- /*----------------------------------------------------------
- | Include definition below this line
- +----------------------------------------------------------*/
- #include "machblue_defines.h"
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- /*----------------------------------------------------------
- | Macro definition below this line
- +----------------------------------------------------------*/
- /*----------------------------------------------------------
- | Type definition below this line
- +----------------------------------------------------------*/
- /*----------------------------------------------------------
- | Functions definition below this line
- +----------------------------------------------------------*/
- /** @defgroup mb_client_group Machblue Client API
- * @{
- * This is Machblue Client API. This api allows clients to create and
- * control SWF movies.
- */
- /**
- * Creates a Machblue client.
- * @return MB_SUCCESS and updates client pointer on success, MB_FAILURE otherwise.
- * Cases of failure include but are not limited to invalid gfx context,
- * out of memory, etc.
- */
- extern mb_error_t mb_client_create
- (
- mb_client_t *client, /**< pointer to client to create */
- mb_gfx_ctx_t *gfx_ctx, /**< pointer to user provided client graphic context */
- mb_sound_ctx_t *sound_ctx, /**< pointer to user provided client sound context -- may be
- NULL if no sound context is desired */
- mb_client_notify_f *client_cb_f /**< pointer to user provided client notification function. */
- );
- /**
- * Deletes a Machblue client.
- * @return MB_SUCCESS on success, MB_FAILURE on failure.
- */
- extern mb_error_t mb_client_delete
- (
- mb_client_t client /**< client to delete */
- );
- /**
- * Creates a SWF movie handle from data in memory.
- * @return MB_SUCCESS and updates movie pointer on success or MB_FAILURE
- * otherwise. Cases of failure include but are not limited to invalid movie
- * format, out of memory, etc.
- */
- extern mb_error_t mb_movie_create
- (
- mb_movie_t *movie, /**< pointer to movie to create */
- unsigned char *swf_data, /**< byte array containing the SWF movie to create. */
- unsigned long data_size, /**< size of the byte array containing the SWF movie to create. */
- const mb_char_t *optional_movie_url /**< optional movie_url string. This is used only as a decorator */
- );
- /**
- * Creates a SWF movie handle from data loaded using the provided url.
- * This function is ASYNCHRONOUS. Machblue will invoke the load_notify_f
- * function provided at completion of the load request.
- * @see mb_load_notify_f
- * @return MB_SUCCESS and updates movie pointer on success or MB_FAILURE
- * otherwise. Cases of failure include but are not limited to invalid movie
- * format, out of memory, etc.
- */
- extern mb_error_t mb_movie_create_url
- (
- mb_movie_t *movie, /**< pointer to movie to create */
- const mb_char_t *movie_url, /**< url of the movie to load */
- mb_load_notify_f *load_notify_f, /**< optional load notification function */
- void *ln_client_data /**< optional load notification function client data */
- );
- /**
- * Deletes a SWF movie handle.
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_delete
- (
- mb_movie_t movie /**< handle of movie to delete */
- );
- /**
- * Gets a SWF movie information.
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_info_get
- (
- mb_movie_t movie, /**< handle of movie to query */
- mb_movie_info_t *movie_info /**< pointer to a user allocated mb_movie_info_t
- structure that will be used to store the
- movie info */
- );
- /**
- * Attach a SWF movie to a client in exclusive mode. A movie can only be
- * attached to single client at a time.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_MOVIE_ATTACHED
- * notification to the client at completion of the attach process.
- * @see MB_NR_MOVIE_ATTACHED
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_attach
- (
- mb_movie_t movie, /**< handle of movie to attach */
- mb_client_t client, /**< client to attach the movie to */
- void *client_data /**< client provided data that will be returned to client
- any time the client is notified about the movie */
- );
- /**
- * Attach a SWF movie to a client in cooperative mode. A movie can only be
- * attached to single client at a time.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_MOVIE_ATTACHED
- * notification to the client at completion of the attach process.
- * @see MB_NR_MOVIE_ATTACHED
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_attach_cooperative
- (
- mb_movie_t movie, /**< handle of movie to attach */
- mb_client_t client, /**< client to attach the movie to */
- void *client_data, /**< client provided data that will be returned to client
- any time the client is notified about the movie */
- mb_rect_t *location, /**< location where the movie should be rendered in
- the client's graphic context */
- int z_order /**< z order rank of the movie. O is the default z order.
- high number -> high z order. i.e. z-order 1 is displayed above
- z-order 0. */
- );
- /**
- * Detaches a SWF movie from its client. If the movie was active it is suspended
- * first.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_MOVIE_DETACHED
- * notification to the client at completion of the detach process.
- * @see MB_NR_MOVIE_DETACHED
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_detach
- (
- mb_movie_t movie /**< handle of movie to detach */
- );
- /**
- * Activates a SWF movie.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_MOVIE_ACTIVATED
- * notification to the client at completion of the activation process.
- * @see MB_NR_MOVIE_ACTIVATED
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_activate
- (
- mb_movie_t movie, /**< handle of movie to activate */
- mb_activate_reason_t reason, /**< activation reason */
- mb_param_t *params /**< a { NULL, NULL } teminated array of
- {name, value} pairs of parameters to pass
- to the movie on activation */
- );
- /**
- * Suspend an active SWF movie.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_MOVIE_SUSPENDED
- * notification to the client at completion of the suspension process.
- * @see MB_NR_MOVIE_SUSPENDED
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_suspend
- (
- mb_movie_t movie, /**< handle of movie to suspend */
- mb_suspend_reason_t reason /**< suspension reason */
- );
- /**
- * Posts an event to the host of an SWF movie.
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_event_post
- (
- mb_movie_t movie, /**< handle of movie to send event to */
- mb_event_t *event /**< event to send to the movie */
- );
- /**
- * Refreshes a client display area. All client movies intersecting with the
- * specified dirty area will partially or fully refreshed.
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_client_refresh
- (
- mb_client_t client, /**< client to refresh */
- mb_rect_t *dirty_area /**< dirty area to refresh */
- );
- /**
- * Updates a SWF movie to reflect internal movie changes.
- * @return MB_SUCCESS in case of success, MB_FAILURE otherwise. Cases of
- * failure include invalid handle, etc.
- */
- extern mb_error_t mb_movie_update
- (
- mb_movie_t movie /**< handle of movie to update */
- );
- /**
- * Sends a Local Connection request to an SWF movie.
- * This function is ASYNCHRONOUS. Machblue will send an MB_NR_LC_SEND_COMPLETE
- * notification to the client at completion of the local connection send request.
- * @see MB_NR_LC_SEND_COMPLETE
- * @return MB_SUCCESS on success, MB_failure otherwise.
- * req_handle is updated with a valid request handle in case of success.
- * Cases of failure include invalid movie handle, etc.
- */
- extern mb_error_t mb_movie_lc_request_send
- (
- mb_movie_t movie, /**< movie to send the Local Connection request to */
- const mb_char_t *lc_name, /**< name of the receiving Local Connection to connect to */
- const mb_char_t *method_name, /**< name of the Local Connection method to invoke */
- mb_param_t *args, /**< arguments to pass to the Local Connection method */
- mb_handle_t *req_handle /**< pointer to location to store request handle */
- );
- /** @} */
- #ifdef __cplusplus
- } /* extern "C" */
- #endif /* __cplusplus */
- #endif /* _MACHBLUE_CLIENT_H_ */