diff --git a/src/uterm.h b/src/uterm.h index 413d600..c65689b 100644 --- a/src/uterm.h +++ b/src/uterm.h @@ -146,6 +146,8 @@ enum uterm_video_type { }; enum uterm_video_action { + UTERM_WAKE_UP, + UTERM_SLEEP, UTERM_NEW, UTERM_GONE, }; diff --git a/src/uterm_video.c b/src/uterm_video.c index 02f3a79..5b74eee 100644 --- a/src/uterm_video.c +++ b/src/uterm_video.c @@ -488,17 +488,25 @@ void uterm_video_sleep(struct uterm_video *video) if (!video || !video_is_awake(video)) return; + VIDEO_CB(video, NULL, UTERM_SLEEP); VIDEO_CALL(video->ops->sleep, 0, video); } int uterm_video_wake_up(struct uterm_video *video) { + int ret; + if (!video) return -EINVAL; if (video_is_awake(video)) return 0; - return VIDEO_CALL(video->ops->wake_up, 0, video); + ret = VIDEO_CALL(video->ops->wake_up, 0, video); + if (ret) + return ret; + + VIDEO_CB(video, NULL, UTERM_WAKE_UP); + return 0; } bool uterm_video_is_awake(struct uterm_video *video)