mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
st/oxr: Tidy events code [NFC]
This commit is contained in:
parent
1cad1baed0
commit
69ab1f486c
|
@ -134,6 +134,7 @@ is_session_link_to_event(struct oxr_event *event, XrSession session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* 'Exported' functions.
|
* 'Exported' functions.
|
||||||
|
@ -166,7 +167,6 @@ oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log,
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XrResult
|
XrResult
|
||||||
oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess)
|
oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess)
|
||||||
{
|
{
|
||||||
|
@ -186,6 +186,30 @@ oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, stru
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OXR_HAVE_FB_display_refresh_rate
|
||||||
|
XrResult
|
||||||
|
oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log,
|
||||||
|
struct oxr_session *sess,
|
||||||
|
float fromDisplayRefreshRate,
|
||||||
|
float toDisplayRefreshRate)
|
||||||
|
{
|
||||||
|
struct oxr_instance *inst = sess->sys->inst;
|
||||||
|
XrEventDataDisplayRefreshRateChangedFB *changed;
|
||||||
|
struct oxr_event *event = NULL;
|
||||||
|
|
||||||
|
ALLOC(log, inst, &event, &changed);
|
||||||
|
changed->type = XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB;
|
||||||
|
changed->fromDisplayRefreshRate = fromDisplayRefreshRate;
|
||||||
|
changed->toDisplayRefreshRate = toDisplayRefreshRate;
|
||||||
|
event->result = XR_SUCCESS;
|
||||||
|
lock(inst);
|
||||||
|
push(inst, event);
|
||||||
|
unlock(inst);
|
||||||
|
|
||||||
|
return XR_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif // OXR_HAVE_FB_display_refresh_rate
|
||||||
|
|
||||||
XrResult
|
XrResult
|
||||||
oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
|
oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
|
||||||
struct oxr_session *sess,
|
struct oxr_session *sess,
|
||||||
|
@ -268,27 +292,3 @@ oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuf
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OXR_HAVE_FB_display_refresh_rate
|
|
||||||
XrResult
|
|
||||||
oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log,
|
|
||||||
struct oxr_session *sess,
|
|
||||||
float fromDisplayRefreshRate,
|
|
||||||
float toDisplayRefreshRate)
|
|
||||||
{
|
|
||||||
struct oxr_instance *inst = sess->sys->inst;
|
|
||||||
XrEventDataDisplayRefreshRateChangedFB *changed;
|
|
||||||
struct oxr_event *event = NULL;
|
|
||||||
|
|
||||||
ALLOC(log, inst, &event, &changed);
|
|
||||||
changed->type = XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB;
|
|
||||||
changed->fromDisplayRefreshRate = fromDisplayRefreshRate;
|
|
||||||
changed->toDisplayRefreshRate = toDisplayRefreshRate;
|
|
||||||
event->result = XR_SUCCESS;
|
|
||||||
lock(inst);
|
|
||||||
push(inst, event);
|
|
||||||
unlock(inst);
|
|
||||||
|
|
||||||
return XR_SUCCESS;
|
|
||||||
}
|
|
||||||
#endif // OXR_HAVE_FB_display_refresh_rate
|
|
||||||
|
|
|
@ -928,26 +928,19 @@ oxr_system_get_eye_gaze_support(struct oxr_logger *log, struct oxr_instance *ins
|
||||||
bool
|
bool
|
||||||
oxr_system_get_force_feedback_support(struct oxr_logger *log, struct oxr_instance *inst);
|
oxr_system_get_force_feedback_support(struct oxr_logger *log, struct oxr_instance *inst);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* oxr_event.cpp
|
* oxr_event.cpp
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
XrResult
|
|
||||||
oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData);
|
|
||||||
|
|
||||||
XrResult
|
XrResult
|
||||||
oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log,
|
oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log,
|
||||||
struct oxr_session *sess,
|
struct oxr_session *sess,
|
||||||
XrSessionState state,
|
XrSessionState state,
|
||||||
XrTime time);
|
XrTime time);
|
||||||
|
|
||||||
XrResult
|
|
||||||
oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
|
|
||||||
struct oxr_session *sess,
|
|
||||||
bool visible);
|
|
||||||
|
|
||||||
XrResult
|
XrResult
|
||||||
oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess);
|
oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess);
|
||||||
|
|
||||||
|
@ -959,12 +952,23 @@ oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log,
|
||||||
float toDisplayRefreshRate);
|
float toDisplayRefreshRate);
|
||||||
#endif // OXR_HAVE_FB_display_refresh_rate
|
#endif // OXR_HAVE_FB_display_refresh_rate
|
||||||
|
|
||||||
|
XrResult
|
||||||
|
oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
|
||||||
|
struct oxr_session *sess,
|
||||||
|
bool visible);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* This clears all pending events refers to the given session.
|
* This clears all pending events refers to the given session.
|
||||||
*/
|
*/
|
||||||
XrResult
|
XrResult
|
||||||
oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess);
|
oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Will return one event if available, also drain the sessions event queues.
|
||||||
|
*/
|
||||||
|
XrResult
|
||||||
|
oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue