1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00
rofi/include/widget.h

48 lines
1 KiB
C
Raw Normal View History

#ifndef ROFI_WIDGET_H
#define ROFI_WIDGET_H
/**
* @defgroup Widgets Widgets
*
* Generic Widget class
*
* @{
*/
typedef struct _Widget
{
/** X position relative to parent */
short x;
/** Y position relative to parent */
short y;
/** Width of the widget */
short w;
/** Height of the widget */
short h;
} Widget;
/** Macro to get widget from an implementation (e.g. textbox/scrollbar) */
2016-01-09 13:25:03 -05:00
#define WIDGET( a ) ( a != NULL ? &( a->widget ) : NULL )
/**
* @param widget The widget to check
* @param x The X position relative to parent window
* @param y the Y position relative to parent window
*
* Check if x,y falls within the widget.
*
* @return TRUE if x,y falls within the widget
*/
2016-01-09 13:25:03 -05:00
int widget_intersect ( const Widget *widget, int x, int y );
/**
* @param widget The widget to move
* @param x The new X position relative to parent window
* @param y The new Y position relative to parent window
*
* Moves the widget.
*/
2016-01-09 13:25:03 -05:00
void widget_move ( Widget *widget, short x, short y );
/*@}*/
#endif // ROFI_WIDGET_H