1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-12-16 14:17:07 -05:00

[Doc] Fix some missing/wrong doxygen headers.

This commit is contained in:
Dave Davenport 2023-06-12 19:40:25 +02:00
parent e409322faf
commit 47f37f2bbc
7 changed files with 59 additions and 34 deletions

View file

@ -34,13 +34,17 @@ G_BEGIN_DECLS
/** ABI version to check if loaded plugin is compatible. */ /** ABI version to check if loaded plugin is compatible. */
#define ABI_VERSION 7u #define ABI_VERSION 7u
/**
* Indicator what type of mode this is.
* For now it can be the classic switcher, or also implement a completer.
*/
typedef enum { typedef enum {
/** Mode type is not set */ /** Mode type is not set */
MODE_TYPE_UNSET = 0b0000, MODE_TYPE_UNSET = 0b0000,
/** A normal mode. */ /** A normal mode. */
MODE_TYPE_SWITCHER = 0b0001, MODE_TYPE_SWITCHER = 0b0001,
/** A mode that can be used to completer */ /** A mode that can be used to completer */
MODE_TYPE_COMPLETER = 0b0010, MODE_TYPE_COMPLETER = 0b0010,
} ModeType; } ModeType;
/** /**
@ -160,28 +164,29 @@ typedef char *(*_mode_preprocess_input)(Mode *sw, const char *input);
*/ */
typedef char *(*_mode_get_message)(const Mode *sw); typedef char *(*_mode_get_message)(const Mode *sw);
/** /**
* Create a new instance of this mode. * Create a new instance of this mode.
* Free (free) result after use, after using mode_destroy. * Free (free) result after use, after using mode_destroy.
* *
* @returns Instantiate a new instance of this mode. * @returns Instantiate a new instance of this mode.
*/ */
typedef Mode *(*_mode_create)( void ); typedef Mode *(*_mode_create)(void);
/** /**
* @param sw The #Mode pointer * @param sw The #Mode pointer
* @param menu_retv The return value * @param menu_retv The return value
* @param input The input string * @param input The input string
* @param selected_line The selected line * @param selected_line The selected line
* @param the path that was completed * @param path the path that was completed
* *
* Handle the user accepting an entry in completion mode. * Handle the user accepting an entry in completion mode.
* *
* @returns the next action to take * @returns the next action to take
*/ */
typedef ModeMode (*_mode_completer_result)(Mode *sw, int menu_retv, char **input, typedef ModeMode (*_mode_completer_result)(Mode *sw, int menu_retv,
unsigned int selected_line, char **path); char **input,
unsigned int selected_line,
char **path);
/** /**
* Structure defining a switcher. * Structure defining a switcher.
* It consists of a name, callback and if enabled * It consists of a name, callback and if enabled

View file

@ -256,7 +256,7 @@ char *mode_get_message(const Mode *mode);
Mode *mode_create(const Mode *mode); Mode *mode_create(const Mode *mode);
/** /**
* @param mode The mode to query * @param sw The mode to query
* @param menu_retv The menu return value. * @param menu_retv The menu return value.
* @param input Pointer to the user input string. [in][out] * @param input Pointer to the user input string. [in][out]
* @param selected_line the line selected by the user. * @param selected_line the line selected by the user.
@ -270,7 +270,7 @@ ModeMode mode_completer_result(Mode *sw, int menu_retv, char **input,
unsigned int selected_line, char **path); unsigned int selected_line, char **path);
/** /**
* @param mode The mode to query. * @param sw The mode to query.
* *
* Check if mode is a valid completer. * Check if mode is a valid completer.
* *

View file

@ -104,6 +104,12 @@ void rofi_quit_main_loop(void);
*/ */
Mode *rofi_collect_modes_search(const char *name); Mode *rofi_collect_modes_search(const char *name);
/**
* Query the configure file completer.
*
* @returns the Mode that can be used for file completion or NULL when not
* found.
*/
const Mode *rofi_get_completer(void); const Mode *rofi_get_completer(void);
/** Reset terminal */ /** Reset terminal */
#define color_reset "\033[0m" #define color_reset "\033[0m"

View file

@ -356,6 +356,17 @@ void rofi_view_ellipsize_listview(RofiViewState *state,
*/ */
gboolean rofi_set_im_window_pos(int new_x, int new_y); gboolean rofi_set_im_window_pos(int new_x, int new_y);
/**
* @param wid to test.
* @param action the action done.
* @param x [unused]
* @param y [unsued]
* @param user_data
*
* textbux widget trigger action function.
*
* @return the result.
*/
WidgetTriggerActionResult textbox_button_trigger_action( WidgetTriggerActionResult textbox_button_trigger_action(
widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x, widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data); G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data);

View file

@ -50,6 +50,7 @@
#include "rofi-icon-fetcher.h" #include "rofi-icon-fetcher.h"
#define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache" #define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache"
/** The default program used to open the file. */
#define DEFAULT_OPEN "xdg-open" #define DEFAULT_OPEN "xdg-open"
#if defined(__APPLE__) #if defined(__APPLE__)
@ -712,24 +713,22 @@ ModeMode file_browser_mode_completer(Mode *sw, int mretv, char **input,
} }
#endif #endif
Mode file_browser_mode = { Mode file_browser_mode = {.display_name = NULL,
.display_name = NULL, .abi_version = ABI_VERSION,
.abi_version = ABI_VERSION, .name = "filebrowser",
.name = "filebrowser", .cfg_name_key = "display-filebrowser",
.cfg_name_key = "display-filebrowser", ._init = file_browser_mode_init,
._init = file_browser_mode_init, ._get_num_entries = file_browser_mode_get_num_entries,
._get_num_entries = file_browser_mode_get_num_entries, ._result = file_browser_mode_result,
._result = file_browser_mode_result, ._destroy = file_browser_mode_destroy,
._destroy = file_browser_mode_destroy, ._token_match = file_browser_token_match,
._token_match = file_browser_token_match, ._get_display_value = _get_display_value,
._get_display_value = _get_display_value, ._get_icon = _get_icon,
._get_icon = _get_icon, ._get_message = _get_message,
._get_message = _get_message, ._get_completion = _get_completion,
._get_completion = _get_completion, ._preprocess_input = NULL,
._preprocess_input = NULL, ._create = create_new_file_browser,
._create = create_new_file_browser, ._completer_result = file_browser_mode_completer,
._completer_result = file_browser_mode_completer, .private_data = NULL,
.private_data = NULL, .free = NULL,
.free = NULL, .type = MODE_TYPE_SWITCHER | MODE_TYPE_COMPLETER};
.type = MODE_TYPE_SWITCHER|MODE_TYPE_COMPLETER
};

View file

@ -52,6 +52,7 @@
#include "rofi-icon-fetcher.h" #include "rofi-icon-fetcher.h"
/** The default program used to open the file. */
#define DEFAULT_OPEN "xdg-open" #define DEFAULT_OPEN "xdg-open"
/** /**

View file

@ -155,8 +155,11 @@ struct {
X11CursorType cursor_type; X11CursorType cursor_type;
/** Entry box */ /** Entry box */
gboolean entry_history_enable; gboolean entry_history_enable;
/** Array with history entriy input. */
EntryHistoryIndex *entry_history; EntryHistoryIndex *entry_history;
/** Length of the array */
gssize entry_history_length; gssize entry_history_length;
/** The current index being viewed. */
gssize entry_history_index; gssize entry_history_index;
} CacheState = {.main_window = XCB_WINDOW_NONE, } CacheState = {.main_window = XCB_WINDOW_NONE,
.fake_bg = NULL, .fake_bg = NULL,