From ccf3f23d9b1da3f52c269422c22c4faa4b43eb0a Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 1 Jan 2017 18:08:49 +0100 Subject: Update comments, rename Widget to ThemeWidget. --- include/widgets/scrollbar.h | 6 ++++ include/widgets/textbox.h | 7 +++- include/widgets/widget-internal.h | 75 +++++++++++++++++++++++++++++++++++++++ include/widgets/widget.h | 15 ++++++++ include/widgets/window.h | 7 ++++ 5 files changed, 109 insertions(+), 1 deletion(-) (limited to 'include/widgets') diff --git a/include/widgets/scrollbar.h b/include/widgets/scrollbar.h index 0abfa521..4efbaaa5 100644 --- a/include/widgets/scrollbar.h +++ b/include/widgets/scrollbar.h @@ -63,6 +63,12 @@ void scrollbar_set_max_value ( scrollbar *sb, unsigned int max ); */ unsigned int scrollbar_clicked ( const scrollbar *sb, int y ); +/** + * @param sb scrollbar object + * @param width width of the scrollbar + * + * Set the width of the scrollbar handle. + */ void scrollbar_set_width ( scrollbar *sb, int width ); /*@}*/ #endif // ROFI_SCROLLBAR_H diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index 14484a25..1b6a4152 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -196,6 +196,12 @@ int textbox_get_font_width ( const textbox *tb ); * @returns the width of a character in pixels. */ double textbox_get_estimated_char_width ( void ); + +/** + * Estimate the height of a character. + * + * @returns the height of a character in pixels. + */ double textbox_get_estimated_char_height ( void ); /** @@ -255,6 +261,5 @@ PangoAttrList *textbox_get_pango_attributes ( textbox *tb ); * @returns the visible text. */ const char *textbox_get_visible_text ( const textbox *tb ); -int distance_get_pixel ( Distance d ); /*@}*/ #endif //ROFI_TEXTBOX_H diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h index 0eb1ef54..5151c8b1 100644 --- a/include/widgets/widget-internal.h +++ b/include/widgets/widget-internal.h @@ -57,15 +57,90 @@ struct _widget const char *state; }; +/** + * @param widget The widget to initialize. + * @param name The name of the widget. + * @param class The class of the widget. + * + * Initializes the @widget structure. + * + */ void widget_init ( widget *widget , const char *name, const char *class_name ); + +/** + * @param widget The widget handle. + * @param state The state of the widget. + * + * Set the state of the widget. + */ void widget_set_state ( widget *widget, const char *state ); +/** + * @param wid The widget handle. + * + * Get the left padding of the widget. + * + * @returns the left padding in pixels. + */ int widget_padding_get_left ( const widget *wid ); + +/** + * @param wid The widget handle. + * + * Get the right padding of the widget. + * + * @returns the right padding in pixels. + */ int widget_padding_get_right ( const widget *wid ); + +/** + * @param wid The widget handle. + * + * Get the top padding of the widget. + * + * @returns the top padding in pixels. + */ int widget_padding_get_top ( const widget *wid ); + +/** + * @param wid The widget handle. + * + * Get the bottom padding of the widget. + * + * @returns the bottom padding in pixels. + */ int widget_padding_get_bottom ( const widget *wid ); + +/** + * @param wid The widget handle. + * + * Get width of the content of the widget + * + * @returns the widget width, excluding padding. + */ int widget_padding_get_remaining_width ( const widget *wid ); +/** + * @param wid The widget handle. + * + * Get height of the content of the widget + * + * @returns the widget height, excluding padding. + */ int widget_padding_get_remaining_height ( const widget *wid ); +/** + * @param wid The widget handle. + * + * Get the combined top and bottom padding. + * + * @returns the top and bottom padding of the widget in pixels. + */ int widget_padding_get_padding_height ( const widget *wid ); +/** + * @param wid The widget handle. + * + * Get the combined left and right padding. + * + * @returns the left and right padding of the widget in pixels. + */ int widget_padding_get_padding_width ( const widget *wid ); #endif // WIDGET_INTERNAL_H diff --git a/include/widgets/widget.h b/include/widgets/widget.h index 03e85387..9dda0457 100644 --- a/include/widgets/widget.h +++ b/include/widgets/widget.h @@ -175,7 +175,22 @@ void widget_set_clicked_handler ( widget *wid, widget_clicked_cb cb, void *udata gboolean widget_motion_notify ( widget *wid, xcb_motion_notify_event_t *xme ); +/** + * @param wid The widget handle + * @param name The name of the widget. + * + * Set name on widget. + */ void widget_set_name ( widget *wid, const char *name ); + +/** + * @param wid The widget handle + * + * Get the desired height of this widget recursively. + * + * @returns the desired height of the widget in pixels. + */ int widget_get_desired_height ( widget *wid ); + /*@}*/ #endif // ROFI_WIDGET_H diff --git a/include/widgets/window.h b/include/widgets/window.h index 6d8a90a1..3c320d10 100644 --- a/include/widgets/window.h +++ b/include/widgets/window.h @@ -32,6 +32,13 @@ window * window_create ( const char *name ); */ void window_add ( window *window, widget *child ); +/** + * @param window Handle to the window widget. + * + * Get the border width of the widget. + * + * @returns the border width (times 2) of the widget. + */ int window_get_border_width ( const window *window ); /*@}*/ #endif // ROFI_WINDOW_H -- cgit v1.2.3