diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/ui/linkinfo.c | 41 | ||||
-rw-r--r-- | src/ui/linkinfo.h | 32 |
3 files changed, 75 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cccf2176..ba63bf78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -196,6 +196,8 @@ set (SOURCES | |||
196 | src/ui/documentwidget.h | 196 | src/ui/documentwidget.h |
197 | src/ui/indicatorwidget.c | 197 | src/ui/indicatorwidget.c |
198 | src/ui/indicatorwidget.h | 198 | src/ui/indicatorwidget.h |
199 | src/ui/linkinfo.c | ||
200 | src/ui/linkinfo.h | ||
199 | src/ui/listwidget.c | 201 | src/ui/listwidget.c |
200 | src/ui/listwidget.h | 202 | src/ui/listwidget.h |
201 | src/ui/lookupwidget.c | 203 | src/ui/lookupwidget.c |
diff --git a/src/ui/linkinfo.c b/src/ui/linkinfo.c new file mode 100644 index 00000000..e20c183c --- /dev/null +++ b/src/ui/linkinfo.c | |||
@@ -0,0 +1,41 @@ | |||
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 | #include "linkinfo.h" | ||
24 | |||
25 | #define hPad_LinkInfo_ (2 * gap_UI) | ||
26 | #define vPad_LinkInfo_ (1 * gap_UI) | ||
27 | |||
28 | void init_LinkInfo(iLinkInfo *d) { | ||
29 | d->buf = NULL; | ||
30 | } | ||
31 | |||
32 | void deinit_LinkInfo(iLinkInfo *d) { | ||
33 | delete_TextBuf(d->buf); | ||
34 | } | ||
35 | |||
36 | iInt2 size_LinkInfo(const iLinkInfo *d) { | ||
37 | if (!d->buf) { | ||
38 | return zero_I2(); | ||
39 | } | ||
40 | return add_I2(d->buf->size, init_I2(2 * hPad_LinkInfo_, 2 * vPad_LinkInfo_))); | ||
41 | } | ||
diff --git a/src/ui/linkinfo.h b/src/ui/linkinfo.h new file mode 100644 index 00000000..dbedf359 --- /dev/null +++ b/src/ui/linkinfo.h | |||
@@ -0,0 +1,32 @@ | |||
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 "text.h" | ||
26 | |||
27 | iDeclareType(LinkInfo) | ||
28 | iDeclareTypeConstruction(LinkInfo) | ||
29 | |||
30 | struct Impl_LinkInfo { | ||
31 | iTextBuf *buf; | ||
32 | }; | ||