/**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* */ /* This software is licensed under the Microsoft Software License */ /* Terms for Microsoft Azure RTOS. Full text of the license can be */ /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ /* and in the root directory of this software. */ /* */ /**************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** GUIX Component */ /** */ /** Widget Management (Widget) */ /** */ /**************************************************************************/ #define GX_SOURCE_CODE /* Include necessary system files. */ #include "gx_api.h" #include "gx_system.h" #include "gx_utility.h" #include "gx_widget.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _gx_widget_event_generate PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Kenneth Maxwell, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function creates a new GX_EVENT and send the event to the */ /* widget parent. */ /* */ /* INPUT */ /* */ /* widget Widget control block */ /* event_type Type of event */ /* value Additional event information */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* [gx_widget_event_process_function] The parent event process */ /* routine */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* GUIX Internal Code */ /* */ /* 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_widget_event_generate(GX_WIDGET *widget, USHORT event_type, LONG value) { GX_EVENT newevent; GX_WIDGET *parent; parent = widget -> gx_widget_parent; if (parent && widget -> gx_widget_id) { newevent.gx_event_target = parent; newevent.gx_event_sender = widget -> gx_widget_id; newevent.gx_event_type = (ULONG)GX_SIGNAL(widget -> gx_widget_id, event_type); newevent.gx_event_payload.gx_event_longdata = value; _gx_system_event_send(&newevent); } return(GX_SUCCESS); }