1 /*************************************************************************** 2 * Copyright (c) 2024 Microsoft Corporation 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the MIT License which is available at 6 * https://opensource.org/licenses/MIT. 7 * 8 * SPDX-License-Identifier: MIT 9 **************************************************************************/ 10 11 12 /**************************************************************************/ 13 /**************************************************************************/ 14 /** */ 15 /** GUIX Component */ 16 /** */ 17 /** Sprite Management (Sprite) */ 18 /** */ 19 /**************************************************************************/ 20 /**************************************************************************/ 21 22 23 /**************************************************************************/ 24 /* */ 25 /* COMPONENT DEFINITION RELEASE */ 26 /* */ 27 /* gx_sprite.h PORTABLE C */ 28 /* 6.1 */ 29 /* AUTHOR */ 30 /* */ 31 /* Kenneth Maxwell, Microsoft Corporation */ 32 /* */ 33 /* DESCRIPTION */ 34 /* */ 35 /* This file defines the GUIX sprite component, including all data */ 36 /* types and external references. It is assumed that gx_api.h and */ 37 /* gx_port.h have already been included. */ 38 /* */ 39 /* RELEASE HISTORY */ 40 /* */ 41 /* DATE NAME DESCRIPTION */ 42 /* */ 43 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ 44 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ 45 /* resulting in version 6.1 */ 46 /* */ 47 /**************************************************************************/ 48 49 #ifndef GX_SPRITE_H 50 #define GX_SPRITE_H 51 52 #define GX_SPRITE_IDLE 0x0001 53 #define GX_SPRITE_RUNNING 0x0002 54 #define GX_SPRITE_TIMER 0x1000 55 56 /* Define animation management function prototypes. */ 57 UINT _gx_sprite_create(GX_SPRITE *sprite, GX_CONST GX_CHAR *name, GX_WIDGET *parent, 58 GX_SPRITE_FRAME *frame_list, USHORT frame_count, 59 ULONG style, USHORT sprite_id, GX_CONST GX_RECTANGLE *size); 60 61 UINT _gx_sprite_start(GX_SPRITE *sprite, USHORT start_frame); 62 UINT _gx_sprite_stop(GX_SPRITE *sprite); 63 VOID _gx_sprite_update(GX_SPRITE *sprite); 64 VOID _gx_sprite_complete(GX_SPRITE *sprite); 65 UINT _gx_sprite_current_frame_set(GX_SPRITE *sprite, USHORT frame); 66 VOID _gx_sprite_draw(GX_SPRITE *sprite); 67 UINT _gx_sprite_event_process(GX_SPRITE *sprite, GX_EVENT *event_ptr); 68 UINT _gx_sprite_frame_list_set(GX_SPRITE *sprite, GX_SPRITE_FRAME *frame_list, USHORT frame_count); 69 70 /* error checking versions of the animation API functions */ 71 UINT _gxe_sprite_create(GX_SPRITE *sprite, GX_CONST GX_CHAR *name, GX_WIDGET *parent, 72 GX_SPRITE_FRAME *frame_list, USHORT frame_count, 73 ULONG style, USHORT sprite_id, GX_CONST GX_RECTANGLE *size, UINT sprite_control_block_size); 74 UINT _gxe_sprite_current_frame_set(GX_SPRITE *sprite, USHORT frame); 75 UINT _gxe_sprite_frame_list_set(GX_SPRITE *sprite, GX_SPRITE_FRAME *frame_list, USHORT frame_count); 76 UINT _gxe_sprite_start(GX_SPRITE *sprite, USHORT frame); 77 UINT _gxe_sprite_stop(GX_SPRITE *sprite); 78 79 80 #endif 81 82