widget_state_t: new type.

(widget_get_state): new widget API.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2016-04-10 11:01:48 +03:00
parent f5a1dfcef4
commit a9fcd6c4c6
1 changed files with 22 additions and 0 deletions

View File

@ -70,6 +70,12 @@ typedef enum
WOP_DISABLED = (1 << 5) /* Widget cannot be selected */
} widget_options_t;
/* Widget state */
typedef enum
{
WST_DEFAULT = (0 << 0),
} widget_state_t;
/* Flags for widget repositioning on dialog resize */
typedef enum
{
@ -202,4 +208,20 @@ widget_get_options (const Widget * w, widget_options_t options)
/* --------------------------------------------------------------------------------------------- */
/**
* Check whether one or several state flags are set or not.
* @param w widget
* @param state widget state flags
*
* @return TRUE if all requested state flags are set, FALSE otherwise.
*/
static inline gboolean
widget_get_state (const Widget * w, widget_state_t state)
{
return ((w->state & state) == state);
}
/* --------------------------------------------------------------------------------------------- */
#endif /* MC__WIDGET_INTERNAL_H */