diff options
-rw-r--r-- | include/mode-private.h | 62 | ||||
-rw-r--r-- | include/widgets/listview.h | 66 | ||||
-rw-r--r-- | include/widgets/widget-internal.h | 20 | ||||
-rw-r--r-- | include/xkb-internal.h | 9 | ||||
-rw-r--r-- | source/history.c | 5 | ||||
-rw-r--r-- | source/widgets/textbox.c | 7 |
6 files changed, 162 insertions, 7 deletions
diff --git a/include/mode-private.h b/include/mode-private.h index 31e92c98..da6456fa 100644 --- a/include/mode-private.h +++ b/include/mode-private.h @@ -1,11 +1,35 @@ #ifndef ROFI_MODE_PRIVATE_H #define ROFI_MODE_PRIVATE_H +/** + * @param data The #self pointer. + * + * Mode free function. + */ typedef void ( *_mode_free )( Mode *data ); +/** + * @param sw The #Mode pointer + * @param selected_line The selected line + * @param state The state to display [out] + * @param get_entry if it should only return the state + * + * Get the value for displaying. + * + * @return the string and state for displaying. + */ typedef char * ( *_mode_get_display_value )( const Mode *sw, unsigned int selected_line, int *state, int get_entry ); +/** + * @param sw The #Mode pointer + * @param selected_line The selected line + * + * Obtains the string to complete. + * + * @return Get the completion string + */ typedef char * ( *_mode_get_completion )( const Mode *sw, unsigned int selected_line ); + /** * @param tokens List of (input) tokens to match. * @param input The entry to match against. @@ -19,14 +43,52 @@ typedef char * ( *_mode_get_completion )( const Mode *sw, unsigned int selected_ */ typedef int ( *_mode_token_match )( const Mode *data, GRegex **tokens, unsigned int index ); +/** + * @param sw The #Mode pointer + * + * Initialize the mode. + * + * @returns TRUE is successfull + */ typedef int ( *__mode_init )( Mode *sw ); +/** + * @param sw The #Mode pointer + * + * Get the number of entries. + * + * @returns the number of entries + */ typedef unsigned int ( *__mode_get_num_entries )( const Mode *sw ); +/** + * @param sw The #Mode pointer + * + * Destroy the current mode. Still ready to restart. + * + */ typedef void ( *__mode_destroy )( Mode *sw ); +/** + * @param sw The #Mode pointer + * @param menu_retv The return value + * @param input The input string + * @param selected_line The selected line + * + * Handle the user accepting an entry. + * + * @returns the next action to take + */ typedef ModeMode ( *_mode_result )( Mode *sw, int menu_retv, char **input, unsigned int selected_line ); +/** + * @param sw The #Mode pointer + * @param input The input string + * + * Preprocess the input for sorting. + * + * @returns Entry stripped from markup for sorting + */ typedef char* ( *_mode_preprocess_input )( Mode *sw, const char *input ); /** diff --git a/include/widgets/listview.h b/include/widgets/listview.h index 0a8a9a80..22a67653 100644 --- a/include/widgets/listview.h +++ b/include/widgets/listview.h @@ -72,18 +72,82 @@ void listview_nav_page_next ( listview *lv ); * - Clip at top/bottom */ void listview_nav_page_prev ( listview *lv ); + /** - * Configuration. + * @param lv Handler to the listview object + * @param padding The padding + * + * Padding on between the widgets. */ void listview_set_padding ( listview *lv, unsigned int padding ); + +/** + * @param lv Handler to the listview object + * @param lines The maximum number of lines + * + * Set the maximum number of lines to show. + */ void listview_set_max_lines ( listview *lv, unsigned int lines ); + +/** + * @param lv Handler to the listview object + * @param columns The maximum number of columns + * + * Set the maximum number of columns to show. + */ void listview_set_max_columns ( listview *lv, unsigned int columns ); + +/** + * @param lv Handler to the listview object + * @param enabled enable + * + * Set fixed num lines mode. + */ void listview_set_fixed_num_lines ( listview *lv, gboolean enabled ); +/** + * @param lv Handler to the listview object + * @param enabled enable + * + * Hide the scrollbar. + */ void listview_set_hide_scrollbar ( listview *lv, gboolean enabled ); +/** + * @param lv Handler to the listview object + * @param width Width in pixels + * + * Set the width of the scrollbar + */ void listview_set_scrollbar_width ( listview *lv, unsigned int width ); + +/** + * @param lv Handler to the listview object + * @param cycle True for cycle mode + * + * Set cycle mode. On last entry go to first. + */ void listview_set_cycle ( listview *lv, gboolean cycle ); +/** + * @param lv Handler to the listview object + * @param type ScrollType + * + * Set the scroll type ScrollType::LISTVIEW_SCROLL_CONTINIOUS or ScrollType::LISTVIEW_SCROLL_PER_PAGE + */ void listview_set_scroll_type ( listview *lv, ScrollType type ); + +/** + * @param lv Handler to the listview object + * @param cb The callback + * @param udata User data + * + * Set the mouse activated callback. + */ void listview_set_mouse_activated_cb ( listview *lv, listview_mouse_activated_cb cb, void *udata ); +/** + * @param lv Handler to the listview object + * @param enabled + * + * Enable,disable multi-select. + */ void listview_set_multi_select ( listview *lv, gboolean enable ); /* @} */ diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h index b2f3b4f5..9e287cb3 100644 --- a/include/widgets/widget-internal.h +++ b/include/widgets/widget-internal.h @@ -1,6 +1,9 @@ #ifndef WIDGET_INTERNAL_H #define WIDGET_INTERNAL_H +/** + * Data structure holding the internal state of the Widget + */ struct _widget { /** X position relative to parent */ @@ -13,26 +16,31 @@ struct _widget short h; /** enabled or not */ gboolean enabled; - /** Information about packing. */ + /** Expand the widget when packed */ gboolean expand; + /** Place widget at end of parent */ gboolean end; - + /** Parent widget */ struct _widget *parent; /** Internal */ gboolean need_redraw; - /** Function prototypes */ + /** get width of widget implementation function */ int ( *get_width )( struct _widget * ); + /** get height of widget implementation function */ int ( *get_height )( struct _widget * ); - + /** draw widget implementation function */ void ( *draw )( struct _widget *widget, cairo_t *draw ); + /** resize widget implementation function */ void ( *resize )( struct _widget *, short, short ); + /** update widget implementation function */ void ( *update )( struct _widget * ); - // Signals. + /** widget clicked callback */ widget_clicked_cb clicked; + /** user data for ::clicked callback */ void *clicked_cb_data; - // Free + /** Free widget callback */ void ( *free )( struct _widget *widget ); }; #endif // WIDGET_INTERNAL_H diff --git a/include/xkb-internal.h b/include/xkb-internal.h index 3a95c1a2..83010e14 100644 --- a/include/xkb-internal.h +++ b/include/xkb-internal.h @@ -6,15 +6,24 @@ struct xkb_stuff { + /** connection to the X server*/ xcb_connection_t *xcb_connection; + /** Keyboard context */ struct xkb_context *context; + /** Flag indicating first event */ uint8_t first_event; + /** Keyboard device id */ int32_t device_id; + /** Current keymap */ struct xkb_keymap *keymap; + /** Keyboard state */ struct xkb_state *state; + /** Compose information */ struct { + /** Compose table */ struct xkb_compose_table *table; + /** Compose state */ struct xkb_compose_state * state; } compose; }; diff --git a/source/history.c b/source/history.c index d404d36b..ff71fa6c 100644 --- a/source/history.c +++ b/source/history.c @@ -39,9 +39,14 @@ #define HISTORY_MAX_ENTRIES 25 +/** + * History element + */ typedef struct __element { + /** Index in history */ long int index; + /** Entry */ char *name; }_element; diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 6e9fbed8..3f659d8b 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -56,11 +56,18 @@ typedef struct Color hlbg; } RowColor; +/** Number of states */ #define num_states 3 +/** + * Different colors for the different states + */ RowColor colors[num_states]; +/** Default pango context */ static PangoContext *p_context = NULL; +/** The pango font metrics */ static PangoFontMetrics *p_metrics = NULL; + static gboolean textbox_blink ( gpointer data ) { textbox *tb = (textbox *) data; |