[widget] Documentation fix
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
802f0add92
commit
6f6235acd5
54
widget.c
54
widget.c
|
@ -31,13 +31,12 @@ extern AwesomeConf globalconf;
|
||||||
/** Compute widget alignment.
|
/** Compute widget alignment.
|
||||||
* This will process all widget starting at `widget' and will check their
|
* This will process all widget starting at `widget' and will check their
|
||||||
* alignment and guess it if set to AlignAuto.
|
* alignment and guess it if set to AlignAuto.
|
||||||
* \param widget a linked list of all widgets
|
* \param widget A linked list of all widgets.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
widget_calculate_alignments(widget_t *widget)
|
widget_calculate_alignments(widget_t *widget)
|
||||||
{
|
{
|
||||||
for(; widget && widget->alignment != AlignFlex; widget = widget->next)
|
for(; widget && widget->alignment != AlignFlex; widget = widget->next)
|
||||||
{
|
|
||||||
switch(widget->alignment)
|
switch(widget->alignment)
|
||||||
{
|
{
|
||||||
case AlignCenter:
|
case AlignCenter:
|
||||||
|
@ -48,7 +47,6 @@ widget_calculate_alignments(widget_t *widget)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(widget)
|
if(widget)
|
||||||
for(widget = widget->next; widget; widget = widget->next)
|
for(widget = widget->next; widget; widget = widget->next)
|
||||||
|
@ -70,10 +68,10 @@ widget_calculate_alignments(widget_t *widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Compute offset for drawing the first pixel of a widget.
|
/** Compute offset for drawing the first pixel of a widget.
|
||||||
* \param barwidth the statusbar width
|
* \param barwidth The statusbar width.
|
||||||
* \param widgetwidth the widget width
|
* \param widgetwidth The widget width.
|
||||||
* \param alignment the widget alignment on statusbar
|
* \param alignment The widget alignment on statusbar.
|
||||||
* \return the x coordinate to draw at
|
* \return The x coordinate to draw at.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
widget_calculate_offset(int barwidth, int widgetwidth, int offset, int alignment)
|
widget_calculate_offset(int barwidth, int widgetwidth, int offset, int alignment)
|
||||||
|
@ -87,10 +85,10 @@ widget_calculate_offset(int barwidth, int widgetwidth, int offset, int alignment
|
||||||
return barwidth - offset - widgetwidth;
|
return barwidth - offset - widgetwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Find a widget on a screen by its name
|
/** Find a widget on a screen by its name.
|
||||||
* \param statusbar the statusbar to look into
|
* \param statusbar The statusbar to look into.
|
||||||
* \param name the widget name
|
* \param name The widget name.
|
||||||
* \return a widget
|
* \return A widget pointer.
|
||||||
*/
|
*/
|
||||||
static widget_t *
|
static widget_t *
|
||||||
widget_getbyname(statusbar_t *sb, char *name)
|
widget_getbyname(statusbar_t *sb, char *name)
|
||||||
|
@ -106,8 +104,8 @@ widget_getbyname(statusbar_t *sb, char *name)
|
||||||
|
|
||||||
/** Common function for button press event on widget.
|
/** Common function for button press event on widget.
|
||||||
* It will look into configuration to find the callback function to call.
|
* It will look into configuration to find the callback function to call.
|
||||||
* \param widget the widget
|
* \param widget The widget.
|
||||||
* \param ev the XButtonPressedEvent the widget received
|
* \param ev The button press event the widget received.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
widget_common_button_press(widget_t *widget, xcb_button_press_event_t *ev)
|
widget_common_button_press(widget_t *widget, xcb_button_press_event_t *ev)
|
||||||
|
@ -115,18 +113,16 @@ widget_common_button_press(widget_t *widget, xcb_button_press_event_t *ev)
|
||||||
Button *b;
|
Button *b;
|
||||||
|
|
||||||
for(b = widget->buttons; b; b = b->next)
|
for(b = widget->buttons; b; b = b->next)
|
||||||
if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod && b->func)
|
if(ev->detail == b->button && CLEANMASK(ev->state) == b->mod
|
||||||
{
|
&& b->func)
|
||||||
b->func(widget->statusbar->screen, b->arg);
|
b->func(widget->statusbar->screen, b->arg);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Common tell function for widget, which only warn user that widget
|
/** Common tell function for widget, which only warn user that widget
|
||||||
* cannot be told anything
|
* cannot be told anything.
|
||||||
* \param widget the widget
|
* \param widget The widget.
|
||||||
* \param new_value unused argument
|
* \param new_value Unused argument.
|
||||||
* \return widget_tell_status_t enum (see structs.h)
|
* \return The status of the command, which is always an error in this case.
|
||||||
*/
|
*/
|
||||||
static widget_tell_status_t
|
static widget_tell_status_t
|
||||||
widget_common_tell(widget_t *widget, char *property __attribute__ ((unused)),
|
widget_common_tell(widget_t *widget, char *property __attribute__ ((unused)),
|
||||||
|
@ -136,10 +132,10 @@ widget_common_tell(widget_t *widget, char *property __attribute__ ((unused)),
|
||||||
return WIDGET_ERROR_CUSTOM;
|
return WIDGET_ERROR_CUSTOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Common function for creating a widget
|
/** Common function for creating a widget.
|
||||||
* \param widget The allocated widget
|
* \param widget The allocated widget.
|
||||||
* \param statusbar the statusbar the widget is on
|
* \param statusbar The statusbar the widget is on.
|
||||||
* \param config the cfg_t structure we will parse to set common info
|
* \param config The cfg_t structure we will parse to set common info.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
widget_common_new(widget_t *widget, statusbar_t *statusbar, cfg_t *config)
|
widget_common_new(widget_t *widget, statusbar_t *statusbar, cfg_t *config)
|
||||||
|
@ -157,8 +153,8 @@ widget_common_new(widget_t *widget, statusbar_t *statusbar, cfg_t *config)
|
||||||
/** Invalidate widgets which should be refresh upon
|
/** Invalidate widgets which should be refresh upon
|
||||||
* external modifications. widget_t who watch flags will
|
* external modifications. widget_t who watch flags will
|
||||||
* be set to be refreshed.
|
* be set to be refreshed.
|
||||||
* \param screen screen id
|
* \param screen Virtual screen number.
|
||||||
* \param flags cache flags
|
* \param flags Cache flags to invalidate.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
widget_invalidate_cache(int screen, int flags)
|
widget_invalidate_cache(int screen, int flags)
|
||||||
|
@ -175,8 +171,8 @@ widget_invalidate_cache(int screen, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send commands to widgets.
|
/** Send commands to widgets.
|
||||||
* \param screen Screen ID
|
* \param screen Virtual screen number.
|
||||||
* \param arg widget_t command. Syntax depends on specific widget.
|
* \param arg Widget command. Syntax depends on specific widget.
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue