1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** GUIX Component */ 17 /** */ 18 /** Canvas Management (Canvas) */ 19 /** */ 20 /**************************************************************************/ 21 22 #define GX_SOURCE_CODE 23 24 25 /* Include necessary system files. */ 26 27 #include "gx_api.h" 28 #include "gx_system.h" 29 #include "gx_utility.h" 30 #include "gx_canvas.h" 31 #include "gx_port.h" 32 33 /* Bring in externs for caller checking code. */ 34 GX_CALLER_CHECKING_EXTERNS 35 36 37 /**************************************************************************/ 38 /* */ 39 /* FUNCTION RELEASE */ 40 /* */ 41 /* _gxe_canvas_offset_set PORTABLE C */ 42 /* 6.1 */ 43 /* AUTHOR */ 44 /* */ 45 /* Kenneth Maxwell, Microsoft Corporation */ 46 /* */ 47 /* DESCRIPTION */ 48 /* */ 49 /* This function checks for errors in the canvas offset set function */ 50 /* call. */ 51 /* */ 52 /* INPUT */ 53 /* */ 54 /* canvas Canvas control block */ 55 /* x X coordinate of offset */ 56 /* y Y coordinate of offset */ 57 /* */ 58 /* OUTPUT */ 59 /* */ 60 /* status Completion status */ 61 /* */ 62 /* CALLS */ 63 /* */ 64 /* _gx_canvas_offset_set Actual canvas offset set call */ 65 /* */ 66 /* CALLED BY */ 67 /* */ 68 /* Application Code */ 69 /* */ 70 /* RELEASE HISTORY */ 71 /* */ 72 /* DATE NAME DESCRIPTION */ 73 /* */ 74 /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ 75 /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ 76 /* resulting in version 6.1 */ 77 /* */ 78 /**************************************************************************/ _gxe_canvas_offset_set(GX_CANVAS * canvas,GX_VALUE x,GX_VALUE y)79UINT _gxe_canvas_offset_set(GX_CANVAS *canvas, GX_VALUE x, GX_VALUE y) 80 { 81 UINT status; 82 83 /* Check for appropriate caller. */ 84 GX_INIT_AND_THREADS_CALLER_CHECKING 85 86 /* Check for the invalid input pointers. */ 87 if ((canvas == GX_NULL) || 88 (canvas -> gx_canvas_display == GX_NULL) || 89 (canvas -> gx_canvas_memory == GX_NULL)) 90 { 91 return(GX_PTR_ERROR); 92 } 93 94 if (canvas -> gx_canvas_id != GX_CANVAS_ID) 95 { 96 return (GX_INVALID_CANVAS); 97 } 98 99 /* Call the actual canvas offset set function. */ 100 status = _gx_canvas_offset_set(canvas, x, y); 101 102 /* Return completion status. */ 103 return status; 104 } 105 106