diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-22 10:48:20 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-22 10:48:20 +0300 |
commit | c56870ab69b71887d703f51881c26ac79f4b7969 (patch) | |
tree | 9c8e70f49b15265d773c55f29056808b40963ee3 /src/ui/util.h | |
parent | 4b7c4ef2659d75ece4d63100a55c278f7c810c9e (diff) |
SmoothScroll is a UI utility; moved it
Diffstat (limited to 'src/ui/util.h')
-rw-r--r-- | src/ui/util.h | 25 |
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 | ||
166 | iDeclareType(SmoothScroll) | ||
167 | |||
168 | typedef void (*iSmoothScrollNotifyFunc)(iAnyObject *, int offset, uint32_t span); | ||
169 | |||
170 | struct Impl_SmoothScroll { | ||
171 | iAnim pos; | ||
172 | int max; | ||
173 | int overscroll; | ||
174 | iWidget *widget; | ||
175 | iSmoothScrollNotifyFunc notify; | ||
176 | }; | ||
177 | |||
178 | void init_SmoothScroll (iSmoothScroll *, iWidget *owner, iSmoothScrollNotifyFunc notify); | ||
179 | |||
180 | void reset_SmoothScroll (iSmoothScroll *); | ||
181 | void setMax_SmoothScroll (iSmoothScroll *, int max); | ||
182 | void move_SmoothScroll (iSmoothScroll *, int offset); | ||
183 | void moveSpan_SmoothScroll (iSmoothScroll *, int offset, uint32_t span); | ||
184 | iBool processEvent_SmoothScroll (iSmoothScroll *, const SDL_Event *ev); | ||
185 | |||
186 | float pos_SmoothScroll (const iSmoothScroll *); | ||
187 | iBool isFinished_SmoothScroll (const iSmoothScroll *); | ||
188 | |||
189 | /*-----------------------------------------------------------------------------------------------*/ | ||
190 | |||
166 | iWidget * makePadding_Widget (int size); | 191 | iWidget * makePadding_Widget (int size); |
167 | iLabelWidget * makeHeading_Widget (const char *text); | 192 | iLabelWidget * makeHeading_Widget (const char *text); |
168 | iWidget * makeHDiv_Widget (void); | 193 | iWidget * makeHDiv_Widget (void); |