summaryrefslogtreecommitdiff
path: root/src/ui/util.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-22 10:48:20 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-22 10:48:20 +0300
commitc56870ab69b71887d703f51881c26ac79f4b7969 (patch)
tree9c8e70f49b15265d773c55f29056808b40963ee3 /src/ui/util.h
parent4b7c4ef2659d75ece4d63100a55c278f7c810c9e (diff)
SmoothScroll is a UI utility; moved it
Diffstat (limited to 'src/ui/util.h')
-rw-r--r--src/ui/util.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ui/util.h b/src/ui/util.h
index 191b8a87..223982a8 100644
--- a/src/ui/util.h
+++ b/src/ui/util.h
@@ -163,6 +163,31 @@ iInt2 delta_Click (const iClick *);
163 163
164/*-----------------------------------------------------------------------------------------------*/ 164/*-----------------------------------------------------------------------------------------------*/
165 165
166iDeclareType(SmoothScroll)
167
168typedef void (*iSmoothScrollNotifyFunc)(iAnyObject *, int offset, uint32_t span);
169
170struct Impl_SmoothScroll {
171 iAnim pos;
172 int max;
173 int overscroll;
174 iWidget *widget;
175 iSmoothScrollNotifyFunc notify;
176};
177
178void init_SmoothScroll (iSmoothScroll *, iWidget *owner, iSmoothScrollNotifyFunc notify);
179
180void reset_SmoothScroll (iSmoothScroll *);
181void setMax_SmoothScroll (iSmoothScroll *, int max);
182void move_SmoothScroll (iSmoothScroll *, int offset);
183void moveSpan_SmoothScroll (iSmoothScroll *, int offset, uint32_t span);
184iBool processEvent_SmoothScroll (iSmoothScroll *, const SDL_Event *ev);
185
186float pos_SmoothScroll (const iSmoothScroll *);
187iBool isFinished_SmoothScroll (const iSmoothScroll *);
188
189/*-----------------------------------------------------------------------------------------------*/
190
166iWidget * makePadding_Widget (int size); 191iWidget * makePadding_Widget (int size);
167iLabelWidget * makeHeading_Widget (const char *text); 192iLabelWidget * makeHeading_Widget (const char *text);
168iWidget * makeHDiv_Widget (void); 193iWidget * makeHDiv_Widget (void);