GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_canvas_shift.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 14 14 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
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_window.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_shift                                   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 shift function call.  */
50
/*                                                                        */
51
/*  INPUT                                                                 */
52
/*                                                                        */
53
/*    canvas                                canvas control block          */
54
/*    x                                     x-axis shift amount in pixels */
55
/*    y                                     y-axis shift amount in pixels */
56
/*                                                                        */
57
/*  OUTPUT                                                                */
58
/*                                                                        */
59
/*    status                                Completion status             */
60
/*                                                                        */
61
/*  CALLS                                                                 */
62
/*                                                                        */
63
/*   _gx_canvas_shift                       Actual canvas shift call.     */
64
/*                                                                        */
65
/*  CALLED BY                                                             */
66
/*                                                                        */
67
/*    Application Code                                                    */
68
/*                                                                        */
69
/**************************************************************************/
70
40
UINT  _gxe_canvas_shift(GX_CANVAS *canvas, GX_VALUE x, GX_VALUE y)
71
{
72
UINT status;
73
74
    /* Check for appropriate caller.  */
75

40
    GX_INIT_AND_THREADS_CALLER_CHECKING
76
77
    /* Check for the invalid input pointers.  */
78
38
    if ((canvas == GX_NULL) ||
79
36
        (canvas -> gx_canvas_display == GX_NULL) ||
80
35
        (canvas -> gx_canvas_memory == GX_NULL))
81
    {
82
4
        return(GX_PTR_ERROR);
83
    }
84
85
34
    if (canvas -> gx_canvas_id != GX_CANVAS_ID)
86
    {
87
1
        return (GX_INVALID_CANVAS);
88
    }
89
90
    /* Call the actual canvas shift function.  */
91
33
    status = _gx_canvas_shift(canvas, x, y);
92
93
    /* Return completion status.  */
94
33
    return status;
95
}
96