diff options
Diffstat (limited to 'src/ui/banner.h')
-rw-r--r-- | src/ui/banner.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/ui/banner.h b/src/ui/banner.h new file mode 100644 index 00000000..5ee8b3ae --- /dev/null +++ b/src/ui/banner.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* Copyright 2021 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
2 | |||
3 | Redistribution and use in source and binary forms, with or without | ||
4 | modification, are permitted provided that the following conditions are met: | ||
5 | |||
6 | 1. Redistributions of source code must retain the above copyright notice, this | ||
7 | list of conditions and the following disclaimer. | ||
8 | 2. Redistributions in binary form must reproduce the above copyright notice, | ||
9 | this list of conditions and the following disclaimer in the documentation | ||
10 | and/or other materials provided with the distribution. | ||
11 | |||
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
14 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
15 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
16 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
17 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
18 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | ||
22 | |||
23 | #pragma once | ||
24 | |||
25 | #include "../gmutil.h" | ||
26 | |||
27 | #include <the_Foundation/vec2.h> | ||
28 | #include <SDL_events.h> | ||
29 | |||
30 | iDeclareType(Banner) | ||
31 | iDeclareTypeConstruction(Banner) | ||
32 | |||
33 | iDeclareType(DocumentWidget) | ||
34 | |||
35 | enum iBannerType { | ||
36 | warning_BannerType, | ||
37 | error_BannerType, | ||
38 | }; | ||
39 | |||
40 | void setOwner_Banner (iBanner *, iDocumentWidget *owner); | ||
41 | void setWidth_Banner (iBanner *, int width); | ||
42 | void setPos_Banner (iBanner *, iInt2 pos); | ||
43 | |||
44 | int height_Banner (const iBanner *); | ||
45 | |||
46 | iLocalDef iBool isEmpty_Banner(const iBanner *d) { | ||
47 | return height_Banner(d) == 0; | ||
48 | } | ||
49 | |||
50 | void clear_Banner (iBanner *); | ||
51 | void setSite_Banner (iBanner *, iRangecc site, iChar icon); | ||
52 | void add_Banner (iBanner *, enum iBannerType type, enum iGmStatusCode code, const iString *message); | ||
53 | void remove_Banner (iBanner *, enum iGmStatusCode code); | ||
54 | |||
55 | iBool processEvent_Banner (iBanner *, const SDL_Event *ev); | ||
56 | void draw_Banner (const iBanner *); | ||