/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** Canvas Management (Canvas) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_utility.h" #include "gx_canvas.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_canvas_hardware_layer_bind PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function binds a GUIX canvas to a hardware graphics layer */ /* */ /* INPUT */ /* */ /* canvas Canvas control block */ /* layer Hardware layer */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _gx_canvas_dirty_mark Set the canvas dirty flag */ /* */ /* CALLED BY */ /* */ /* Application */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Kenneth Maxwell Initial Version 6.0 */ /* 09-30-2020 Kenneth Maxwell Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _gx_canvas_hardware_layer_bind(GX_CANVAS *canvas, INT layer) { UINT (*initialize_function)(INT, GX_CANVAS *); UINT status = GX_SUCCESS; initialize_function = canvas -> gx_canvas_display -> gx_display_layer_services -> gx_display_layer_initialize; if (initialize_function == GX_NULL) { return (GX_INVALID_DISPLAY); } status = initialize_function(layer, canvas); if (status == GX_SUCCESS) { canvas -> gx_canvas_hardware_layer = (GX_BYTE)layer; } return(status); }