summaryrefslogtreecommitdiff
path: root/src/periodic.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-18 11:26:11 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-18 11:26:11 +0200
commitfa174461abdc5c33de16428109c7d46b4f150093 (patch)
tree21cf16a2426f8a6b76195e1816ceea69778fbd70 /src/periodic.h
parent21f6248a3dc906a0c296b937dd1aa697784e6ea3 (diff)
Scrollbar fading and periodic commands
Added a new mechanism to issue periodic but not per-frame commands. This is used for main-thread operations like checking if it's time to fade away the scrollbars. Scrollbars are faded away completely on Apple platforms. Adjusted list right margins accordingly.
Diffstat (limited to 'src/periodic.h')
-rw-r--r--src/periodic.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/periodic.h b/src/periodic.h
new file mode 100644
index 00000000..acb00aa2
--- /dev/null
+++ b/src/periodic.h
@@ -0,0 +1,39 @@
1/* Copyright 2021 Jaakko Keränen <jaakko.keranen@iki.fi>
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5
61. Redistributions of source code must retain the above copyright notice, this
7 list of conditions and the following disclaimer.
82. 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
12THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19ANY 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
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22
23#include <the_Foundation/mutex.h>
24#include <the_Foundation/sortedarray.h>
25
26iDeclareType(Periodic)
27
28/* Animation utility. Not per frame but several times per second. */
29struct Impl_Periodic {
30 int timer;
31 iMutex * mutex;
32 iSortedArray commands;
33};
34
35void init_Periodic (iPeriodic *);
36void deinit_Periodic (iPeriodic *);
37
38void add_Periodic (iPeriodic *, iAny *context, const char *command);
39void remove_Periodic (iPeriodic *, iAny *context);