summaryrefslogtreecommitdiff
path: root/src/ui/widget.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 12:25:17 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 12:25:53 +0200
commitd961d957e26f5c0c1b2603a9a0d98305147c15fb (patch)
tree5a2caecc01918c8f54afb68c5bbd121a89740c11 /src/ui/widget.h
parent2fb1f5bed356520bc0b668f2a8ffef6c8d0318d2 (diff)
Fine-tuning touch behavior
Avoid mouse motion events to prevent spurious hover states in the UI.
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r--src/ui/widget.h60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/ui/widget.h b/src/ui/widget.h
index 602e86cb..1229ba7f 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -195,18 +195,18 @@ iLocalDef iWidget *parent_Widget(const iAnyObject *d) {
195 return NULL; 195 return NULL;
196} 196}
197 197
198iBool isVisible_Widget (const iAnyObject *); 198iBool isVisible_Widget (const iAnyObject *);
199iBool isDisabled_Widget (const iAnyObject *); 199iBool isDisabled_Widget (const iAnyObject *);
200iBool isFocused_Widget (const iAnyObject *); 200iBool isFocused_Widget (const iAnyObject *);
201iBool isHover_Widget (const iAnyObject *); 201iBool isHover_Widget (const iAnyObject *);
202iBool isSelected_Widget (const iAnyObject *); 202iBool isSelected_Widget (const iAnyObject *);
203iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); 203iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd);
204iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); 204iBool hasParent_Widget (const iWidget *d, const iWidget *someParent);
205void setId_Widget (iWidget *, const char *id); 205void setId_Widget (iWidget *, const char *id);
206void setFlags_Widget (iWidget *, int64_t flags, iBool set); 206void setFlags_Widget (iWidget *, int64_t flags, iBool set);
207void setPos_Widget (iWidget *, iInt2 pos); 207void setPos_Widget (iWidget *, iInt2 pos);
208void setSize_Widget (iWidget *, iInt2 size); 208void setSize_Widget (iWidget *, iInt2 size);
209void setPadding_Widget (iWidget *, int left, int top, int right, int bottom); 209void setPadding_Widget (iWidget *, int left, int top, int right, int bottom);
210iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); } 210iLocalDef void setPadding1_Widget (iWidget *d, int padding) { setPadding_Widget(d, padding, padding, padding, padding); }
211void setVisualOffset_Widget (iWidget *d, int value, uint32_t span, int animFlags); 211void setVisualOffset_Widget (iWidget *d, int value, uint32_t span, int animFlags);
212void setBackgroundColor_Widget (iWidget *, int bgColor); 212void setBackgroundColor_Widget (iWidget *, int bgColor);
@@ -217,22 +217,24 @@ iAny * addChildPos_Widget (iWidget *, iAnyObject *child, enum iWidgetA
217iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */ 217iAny * addChildFlags_Widget (iWidget *, iAnyObject *child, int64_t childFlags); /* holds a ref */
218iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex); 218iAny * insertChildAfter_Widget (iWidget *, iAnyObject *child, size_t afterIndex);
219iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags); 219iAny * insertChildAfterFlags_Widget(iWidget *, iAnyObject *child, size_t afterIndex, int64_t childFlags);
220iAny * removeChild_Widget (iWidget *, iAnyObject *child); /* returns a ref */ 220iAny * removeChild_Widget (iWidget *, iAnyObject *child); /* returns a ref */
221iAny * child_Widget (iWidget *, size_t index); /* O(n) */ 221iAny * child_Widget (iWidget *, size_t index); /* O(n) */
222size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */ 222size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */
223void arrange_Widget (iWidget *); 223void arrange_Widget (iWidget *);
224iBool dispatchEvent_Widget(iWidget *, const SDL_Event *); 224iBool dispatchEvent_Widget (iWidget *, const SDL_Event *);
225iBool processEvent_Widget (iWidget *, const SDL_Event *); 225iBool processEvent_Widget (iWidget *, const SDL_Event *);
226void postCommand_Widget (const iAnyObject *, const char *cmd, ...); 226void postCommand_Widget (const iAnyObject *, const char *cmd, ...);
227void refresh_Widget (const iAnyObject *); 227void refresh_Widget (const iAnyObject *);
228
229void setFocus_Widget (iWidget *);
230iWidget *focus_Widget (void);
231iWidget *hover_Widget (void);
232void unhover_Widget (void);
233void setMouseGrab_Widget (iWidget *);
234iWidget *mouseGrab_Widget (void);
235iBool hasVisibleChildOnTop_Widget(const iWidget *parent);
236void printTree_Widget (const iWidget *);
237 228
238iBool equalWidget_Command (const char *cmd, const iWidget *widget, const char *checkCommand); 229iBool equalWidget_Command (const char *cmd, const iWidget *widget, const char *checkCommand);
230
231void setFocus_Widget (iWidget *);
232iWidget * focus_Widget (void);
233void setHover_Widget (iWidget *);
234iWidget * hover_Widget (void);
235void unhover_Widget (void);
236void setMouseGrab_Widget (iWidget *);
237iWidget * mouseGrab_Widget (void);
238iBool hasVisibleChildOnTop_Widget
239 (const iWidget *parent);
240void printTree_Widget (const iWidget *);