Ejemplo n.º 1
0
//
//  RL_Find_Event: C
// 
// Find an application event (e.g. GUI) to the event port.
//
// Returns:
//     A pointer to the find event
// Arguments:
//     model - event model
//     type - event type
//
RL_API REBEVT *RL_Find_Event (REBINT model, REBINT type)
{
    REBVAL * val = Find_Last_Event(model, type);
    if (val != NULL) {
        return &val->payload.event;
    }
    return NULL;
}
Ejemplo n.º 2
0
//
//  RL_Update_Event: C
// 
// Updates an application event (e.g. GUI) to the event port.
// 
// Returns:
//     Returns 1 if updated, or 0 if event appended, and -1 if full.
// Arguments:
//     evt - A properly initialized event structure. The
//          model and type of the event are used to address
//          the unhandled event in the queue, when it is found,
//          it will be replaced with this one
//
RL_API int RL_Update_Event(REBEVT *evt)
{
    REBVAL *event = Find_Last_Event(evt->model, evt->type);

    if (event) {
        event->payload.event = *evt;
        return 1;
    }

    return RL_Event(evt) - 1;
}
Ejemplo n.º 3
0
*/ RL_API REBEVT *RL_Find_Event (REBINT model, REBINT type)
/*
**	Find an application event (e.g. GUI) to the event port.
**
**	Returns:
**  	A pointer to the find event
**  Arguments:
**      model - event model
**      type - event type
**
***********************************************************************/
{
	REBVAL * val = Find_Last_Event(model, type);
	if (val != NULL) {
		return &val->data.event;
	}
	return NULL;
}
Ejemplo n.º 4
0
*/	RL_API int RL_Update_Event(REBEVT *evt)
/*
**	Updates an application event (e.g. GUI) to the event port.
**
**	Returns:
**		Returns 1 if updated, or 0 if event appended, and -1 if full.
**	Arguments:
**		evt - A properly initialized event structure. The
**			 model and type of the event are used to address
**           the unhandled event in the queue, when it is found,
**           it will be replaced with this one
**
***********************************************************************/
{
	REBVAL *event = Find_Last_Event(evt->model, evt->type);

	if (event) {
		event->data.event = *evt;
		return 1;
	}

	return RL_Event(evt) - 1;
}