diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-11 23:46:13 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-11 23:46:13 +0300 |
commit | d36cabcc327d586a13d30c53c579927a4837e4a3 (patch) | |
tree | f25ce540ecad8a9a046c35bf29aae68ceac930b2 /src/ui/util.h | |
parent | 25417c357d46f3ba65d7ac1ef460d52ccea41a9b (diff) |
Integer range utilities
Diffstat (limited to 'src/ui/util.h')
-rw-r--r-- | src/ui/util.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ui/util.h b/src/ui/util.h index ae3742b5..468f2057 100644 --- a/src/ui/util.h +++ b/src/ui/util.h | |||
@@ -48,7 +48,17 @@ iLocalDef iBool isResize_UserEvent(const SDL_Event *d) { | |||
48 | # define KMOD_SECONDARY KMOD_GUI | 48 | # define KMOD_SECONDARY KMOD_GUI |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | int keyMods_Sym (int kmods); /* shift, alt, control, or gui */ | 51 | int keyMods_Sym (int kmods); /* shift, alt, control, or gui */ |
52 | |||
53 | iRangei intersect_Rangei (iRangei a, iRangei b); | ||
54 | iRangei union_Rangei (iRangei a, iRangei b); | ||
55 | |||
56 | iLocalDef iBool equal_Rangei(iRangei a, iRangei b) { | ||
57 | return a.start == b.start && a.end == b.end; | ||
58 | } | ||
59 | iLocalDef iBool isEmpty_Rangei(iRangei d) { | ||
60 | return size_Range(&d) == 0; | ||
61 | } | ||
52 | 62 | ||
53 | /*-----------------------------------------------------------------------------------------------*/ | 63 | /*-----------------------------------------------------------------------------------------------*/ |
54 | 64 | ||