From 14073c4a077d0c0d3d9b21bcaa010061f4f9664c Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 5 May 2021 22:39:03 +0200 Subject: [PATCH] More doxygen cleanups. (1 warning left I don't understand) --- include/dialogs/filebrowser.h | 2 +- include/helper.h | 39 +++++++++++++++++++++++++----- include/view.h | 12 +++++++--- include/widgets/widget.h | 4 ++-- source/helper.c | 45 ----------------------------------- source/rofi.c | 5 ---- 6 files changed, 45 insertions(+), 62 deletions(-) diff --git a/include/dialogs/filebrowser.h b/include/dialogs/filebrowser.h index 8816bdb3..37f68595 100644 --- a/include/dialogs/filebrowser.h +++ b/include/dialogs/filebrowser.h @@ -47,7 +47,7 @@ Mode *create_new_file_browser ( void ); * @param sw Mode object. * @param mretv return value passed in. * @param input The user input string. - * @param selected_list The user selected line. + * @param selected_line The user selected line. * @param path The full path as output. * * @returns the state the user selected. diff --git a/include/helper.h b/include/helper.h index 8c26265a..89fbb479 100644 --- a/include/helper.h +++ b/include/helper.h @@ -240,7 +240,24 @@ gchar *rofi_escape_markup ( gchar *text ); * @param str The input to match against pattern. * @param slen Length of str. * - * FZF like fuzzy sorting algorithm. + * rofi_scorer_fuzzy_evaluate implements a global sequence alignment algorithm to find the maximum accumulated score by + * aligning `pattern` to `str`. It applies when `pattern` is a subsequence of `str`. + * + * Scoring criteria + * - Prefer matches at the start of a word, or the start of subwords in CamelCase/camelCase/camel123 words. See WORD_START_SCORE/CAMEL_SCORE. + * - Non-word characters matter. See NON_WORD_SCORE. + * - The first characters of words of `pattern` receive bonus because they usually have more significance than the rest. + * See PATTERN_START_MULTIPLIER/PATTERN_NON_START_MULTIPLIER. + * - Superfluous characters in `str` will reduce the score (gap penalty). See GAP_SCORE. + * - Prefer early occurrence of the first character. See LEADING_GAP_SCORE/GAP_SCORE. + * + * The recurrence of the dynamic programming: + * dp[i][j]: maximum accumulated score by aligning pattern[0..i] to str[0..j] + * dp[0][j] = leading_gap_penalty(0, j) + score[j] + * dp[i][j] = max(dp[i-1][j-1] + CONSECUTIVE_SCORE, max(dp[i-1][k] + gap_penalty(k+1, j) + score[j] : k < j)) + * + * The first dimension can be suppressed since we do not need a matching scheme, which reduces the space complexity from + * O(N*M) to O(M) * * @returns the sorting weight. */ @@ -330,12 +347,22 @@ cairo_surface_t *cairo_image_surface_create_from_svg ( const gchar* file, int he void parse_ranges ( char *input, rofi_range_pair **list, unsigned int *length ); /** - * @param format The format string - * @param string The string - * @param selected_line selected line - * @param filter filter stringr + * @param format The format string used. See below for possible syntax. + * @param string The selected entry. + * @param selected_line The selected line index. + * @param filter The entered filter. * - * Output formatted line + * Function that outputs the selected line in the user-specified format. + * Currently the following formats are supported: + * * i: Print the index (0-(N-1)) + * * d: Print the index (1-N) + * * s: Print input string. + * * q: Print quoted input string. + * * f: Print the entered filter. + * * F: Print the entered filter, quoted + * + * This functions outputs the formatted string to stdout, appends a newline (\n) character and + * calls flush on the file descriptor. */ void rofi_output_formatted_line ( const char *format, const char *string, int selected_line, const char *filter ); diff --git a/include/view.h b/include/view.h index 03455301..58c182e8 100644 --- a/include/view.h +++ b/include/view.h @@ -33,7 +33,11 @@ * @defgroup View View * * The rofi Menu view. - * + * @{ + * @} + */ + +/** * @defgroup ViewHandle ViewHandle * @ingroup View * @@ -304,9 +308,11 @@ void rofi_view_workers_initialize ( void ); void rofi_view_workers_finalize ( void ); /** + * @param width the width of the monitor. + * @param height the height of the monitor. + * * Return the current monitor workarea. * - * @returns the current monitor workarea */ void rofi_view_get_current_monitor ( int *width, int *height ); @@ -323,5 +329,5 @@ void rofi_view_set_window_title ( const char * title ); * set ellipsize mode to start. */ void rofi_view_ellipsize_start ( RofiViewState *state ); -/** @}*/ +/** @} */ #endif diff --git a/include/widgets/widget.h b/include/widgets/widget.h index 3c8724b1..06f57d96 100644 --- a/include/widgets/widget.h +++ b/include/widgets/widget.h @@ -244,7 +244,7 @@ int widget_get_x_pos ( widget *widget ); * @param x A pointer to the absolute X coordinates * @param y A pointer to the absolute Y coordinates * - * Will modify @param x and @param y to make them relative to @param widget . + * Will modify param x and param y to make them relative to param widget . */ void widget_xy_to_relative ( widget *widget, gint *x, gint *y ); @@ -288,7 +288,7 @@ widget *widget_find_mouse_target ( widget *wid, WidgetType type, gint x, gint y * @param y A pointer to the y coordinate of the click * * Trigger an action on widget. - * @param x and @param y are relative to @param wid . + * param x and param y are relative to param wid . * * @returns Whether the action was handled or not */ diff --git a/source/helper.c b/source/helper.c index b443fb9f..6061e064 100644 --- a/source/helper.c +++ b/source/helper.c @@ -902,33 +902,6 @@ static int rofi_scorer_get_score_for ( enum CharClass prev, enum CharClass curr return 0; } -/** - * @param pattern The user input to match against. - * @param plen Pattern length. - * @param str The input to match against pattern. - * @param slen Length of str. - * - * rofi_scorer_fuzzy_evaluate implements a global sequence alignment algorithm to find the maximum accumulated score by - * aligning `pattern` to `str`. It applies when `pattern` is a subsequence of `str`. - * - * Scoring criteria - * - Prefer matches at the start of a word, or the start of subwords in CamelCase/camelCase/camel123 words. See WORD_START_SCORE/CAMEL_SCORE. - * - Non-word characters matter. See NON_WORD_SCORE. - * - The first characters of words of `pattern` receive bonus because they usually have more significance than the rest. - * See PATTERN_START_MULTIPLIER/PATTERN_NON_START_MULTIPLIER. - * - Superfluous characters in `str` will reduce the score (gap penalty). See GAP_SCORE. - * - Prefer early occurrence of the first character. See LEADING_GAP_SCORE/GAP_SCORE. - * - * The recurrence of the dynamic programming: - * dp[i][j]: maximum accumulated score by aligning pattern[0..i] to str[0..j] - * dp[0][j] = leading_gap_penalty(0, j) + score[j] - * dp[i][j] = max(dp[i-1][j-1] + CONSECUTIVE_SCORE, max(dp[i-1][k] + gap_penalty(k+1, j) + score[j] : k < j)) - * - * The first dimension can be suppressed since we do not need a matching scheme, which reduces the space complexity from - * O(N*M) to O(M) - * - * @returns the sorting weight. - */ int rofi_scorer_fuzzy_evaluate ( const char *pattern, glong plen, const char *str, glong slen ) { if ( slen > FUZZY_SCORER_MAX_LENGTH ) { @@ -1187,24 +1160,6 @@ void parse_ranges ( char *input, rofi_range_pair **list, unsigned int *length ) } } } -/** - * @param format The format string used. See below for possible syntax. - * @param string The selected entry. - * @param selected_line The selected line index. - * @param filter The entered filter. - * - * Function that outputs the selected line in the user-specified format. - * Currently the following formats are supported: - * * i: Print the index (0-(N-1)) - * * d: Print the index (1-N) - * * s: Print input string. - * * q: Print quoted input string. - * * f: Print the entered filter. - * * F: Print the entered filter, quoted - * - * This functions outputs the formatted string to stdout, appends a newline (\n) character and - * calls flush on the file descriptor. - */ void rofi_output_formatted_line ( const char *format, const char *string, int selected_line, const char *filter ) { for ( int i = 0; format && format[i]; i++ ) { diff --git a/source/rofi.c b/source/rofi.c index c9dad4d3..fc7ba62c 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -477,11 +477,6 @@ static void cleanup () * Collected modi */ -/** - * @param name Search for mode with this name. - * - * @return returns Mode * when found, NULL if not. - */ Mode * rofi_collect_modi_search ( const char *name ) { for ( unsigned int i = 0; i < num_available_modi; i++ ) {