1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[Doc] Fix some missing docu.

This commit is contained in:
Dave Davenport 2022-11-19 21:50:34 +01:00
parent 063195922f
commit d9935e594e
13 changed files with 74 additions and 21 deletions

View file

@ -186,6 +186,9 @@ gboolean parse_keys_abe(NkBindings *bindings);
*/ */
void setup_abe(void); void setup_abe(void);
/**
* List all available key bindings to the terminal.
*/
void abe_list_all_bindings(gboolean is_term); void abe_list_all_bindings(gboolean is_term);
/** /**
* @param name Don't have the name. * @param name Don't have the name.

View file

@ -142,9 +142,11 @@ void rofi_theme_property_free(Property *p);
/** /**
* @param p The property to free. * @param p The property to free.
* *
* Make a newly allocted copy of the property.
*
* @returns a copy of p * @returns a copy of p
*/ */
Property *rofi_theme_property_copy(const Property *p, void *); Property *rofi_theme_property_copy(const Property *p, G_GNUC_UNUSED void *);
/** /**
* @param widget * @param widget
* *
@ -463,9 +465,24 @@ void rofi_theme_free_parsed_files(void);
void rofi_theme_print_parsed_files(int is_term); void rofi_theme_print_parsed_files(int is_term);
/** /**
* @param widget The widget handle.
* @param property The property to query.
*
* Returns a list of allocated RofiDistance objects that should be * Returns a list of allocated RofiDistance objects that should be
* freed. * freed.
*
* @returns a GList of RofiDistance objects.
*/ */
GList *rofi_theme_get_list_distance(const widget *widget, const char *property); GList *rofi_theme_get_list_distance(const widget *widget, const char *property);
/**
* @param widget The widget handle.
* @param property The property to query.
*
* Returns a list of allocated strings othat should be
* freed.
*
* @returns a GList of strings.
*/
GList *rofi_theme_get_list_strings(const widget *widget, const char *property); GList *rofi_theme_get_list_strings(const widget *widget, const char *property);
#endif #endif

View file

@ -107,7 +107,9 @@ struct RofiViewState {
/** filtered rows */ /** filtered rows */
textbox *tb_filtered_rows; textbox *tb_filtered_rows;
/** Extra icon widget that shows the current selected entries text. */
textbox *tb_current_entry; textbox *tb_current_entry;
/** Extra icon widget that shows the current selected entries icon. */
icon *icon_current_entry; icon *icon_current_entry;
/** Settings of the menu */ /** Settings of the menu */

View file

@ -313,6 +313,7 @@ PangoAttrList *textbox_get_pango_attributes(textbox *tb);
* @returns the visible text. * @returns the visible text.
*/ */
const char *textbox_get_visible_text(const textbox *tb); const char *textbox_get_visible_text(const textbox *tb);
/** /**
* @param wid The handle to the textbox. * @param wid The handle to the textbox.
* @param height The height we want the desired width for * @param height The height we want the desired width for
@ -321,7 +322,7 @@ const char *textbox_get_visible_text(const textbox *tb);
* *
* @returns the desired width of the textbox. * @returns the desired width of the textbox.
*/ */
int textbox_get_desired_width(widget *wid, const int height); int textbox_get_desired_width(widget *wid, G_GNUC_UNUSED const int height);
/** /**
* @param tb Handle to the textbox * @param tb Handle to the textbox

View file

@ -32,8 +32,9 @@
/** Macro for initializing the RofiDistance struct. */ /** Macro for initializing the RofiDistance struct. */
#define WIDGET_DISTANCE_INIT \ #define WIDGET_DISTANCE_INIT \
(RofiDistance){ \ (RofiDistance) { \
.base = { \ .base = \
{ \
.distance = 0, \ .distance = 0, \
.type = ROFI_PU_PX, \ .type = ROFI_PU_PX, \
.modtype = ROFI_DISTANCE_MODIFIER_NONE, \ .modtype = ROFI_DISTANCE_MODIFIER_NONE, \
@ -42,13 +43,11 @@
}, \ }, \
.style = ROFI_HL_SOLID, \ .style = ROFI_HL_SOLID, \
} }
/* Macro for initializing the RofiPadding struct. */ /** Macro for initializing the RofiPadding struct. */
#define WIDGET_PADDING_INIT \ #define WIDGET_PADDING_INIT \
(RofiPadding){ \ (RofiPadding) { \
.top = WIDGET_DISTANCE_INIT, \ .top = WIDGET_DISTANCE_INIT, .right = WIDGET_DISTANCE_INIT, \
.right = WIDGET_DISTANCE_INIT, \ .bottom = WIDGET_DISTANCE_INIT, .left = WIDGET_DISTANCE_INIT, \
.bottom = WIDGET_DISTANCE_INIT, \
.left = WIDGET_DISTANCE_INIT, \
} }
/** /**

View file

@ -284,8 +284,10 @@ widget *widget_find_mouse_target(widget *wid, WidgetType type, gint x, gint y);
* *
* @returns Whether the action would be handled or not * @returns Whether the action would be handled or not
*/ */
WidgetTriggerActionResult widget_check_action(widget *wid, guint action, gint x, WidgetTriggerActionResult widget_check_action(widget *wid,
gint y); G_GNUC_UNUSED guint action,
G_GNUC_UNUSED gint x,
G_GNUC_UNUSED gint y);
/** /**
* @param wid The widget handle * @param wid The widget handle

View file

@ -44,6 +44,11 @@ typedef struct _xcb_stuff xcb_stuff;
*/ */
extern xcb_stuff *xcb; extern xcb_stuff *xcb;
/**
* @param data String to copy to clipboard.
*
* copies string to clipboard.
*/
void xcb_stuff_set_clipboard(char *data); void xcb_stuff_set_clipboard(char *data);
/** /**

View file

@ -114,6 +114,8 @@ typedef struct {
char *ballot_unselected; char *ballot_unselected;
} DmenuModePrivateData; } DmenuModePrivateData;
/** Maximum number of lines rofi parses async before it pushes it to the main
* thread. */
#define BLOCK_LINES_SIZE 2048 #define BLOCK_LINES_SIZE 2048
typedef struct { typedef struct {
unsigned int length; unsigned int length;

View file

@ -463,12 +463,19 @@ static cairo_surface_t *script_get_icon(const Mode *sw,
#include "mode-private.h" #include "mode-private.h"
/** Structure that holds a user script
* found in $config/rofi/scripts/
*/
typedef struct ScriptUser { typedef struct ScriptUser {
/** name of the script */
char *name; char *name;
/** path to the script. */
char *path; char *path;
} ScriptUser; } ScriptUser;
/** list of user_scripts. */
ScriptUser *user_scripts = NULL; ScriptUser *user_scripts = NULL;
/** number of user scripts collected */
size_t num_scripts = 0; size_t num_scripts = 0;
void script_mode_cleanup(void) { void script_mode_cleanup(void) {
@ -538,10 +545,10 @@ Mode *script_mode_parse_setup(const char *str) {
unsigned int index = 0; unsigned int index = 0;
const char *const sep = ":"; const char *const sep = ":";
char **tokens = g_strsplit(str, sep, 2); char **tokens = g_strsplit(str, sep, 2);
if ( tokens ){ if (tokens) {
index = g_strv_length(tokens); index = g_strv_length(tokens);
sw->name = g_strdup(tokens[0]); sw->name = g_strdup(tokens[0]);
sw->ed = (void*)rofi_expand_path(tokens[1]); sw->ed = (void *)rofi_expand_path(tokens[1]);
g_strfreev(tokens); g_strfreev(tokens);
} }
if (index == 2) { if (index == 2) {

View file

@ -85,6 +85,7 @@ const char *cache_dir = NULL;
/** List of error messages.*/ /** List of error messages.*/
GList *list_of_error_msgs = NULL; GList *list_of_error_msgs = NULL;
/** List of warning messages for the user.*/
GList *list_of_warning_msgs = NULL; GList *list_of_warning_msgs = NULL;
static void rofi_collectmodes_destroy(void); static void rofi_collectmodes_destroy(void);

View file

@ -46,13 +46,22 @@
#include "widgets/textbox.h" #include "widgets/textbox.h"
#include <gio/gio.h> #include <gio/gio.h>
/**
* list of config files we parsed.
*/
GList *parsed_config_files = NULL; GList *parsed_config_files = NULL;
/** cleanup (free) the list of parsed config files. */
void rofi_theme_free_parsed_files(void) { void rofi_theme_free_parsed_files(void) {
g_list_free_full(parsed_config_files, g_free); g_list_free_full(parsed_config_files, g_free);
parsed_config_files = NULL; parsed_config_files = NULL;
} }
/**
* @param is_term if print to terminal
*
* print the list of parsed config files.
*/
void rofi_theme_print_parsed_files(gboolean is_term) { void rofi_theme_print_parsed_files(gboolean is_term) {
printf("\nParsed files:\n"); printf("\nParsed files:\n");
for (GList *iter = g_list_first(parsed_config_files); iter != NULL; for (GList *iter = g_list_first(parsed_config_files); iter != NULL;

View file

@ -130,9 +130,13 @@ struct {
guint idle_timeout; guint idle_timeout;
/** timeout for reloading */ /** timeout for reloading */
guint refilter_timeout; guint refilter_timeout;
/** amount of time refiltering delay got reset */
guint refilter_timeout_count; guint refilter_timeout_count;
/** if filtering takes longer then this time,
* reduce the amount of refilters. */
double max_refilter_time; double max_refilter_time;
/** enable the reduced refilter mode. */
gboolean delayed_mode; gboolean delayed_mode;
/** timeout handling */ /** timeout handling */
guint user_timeout; guint user_timeout;

View file

@ -992,8 +992,9 @@ static int monitor_active_from_id(int mon_id, workarea *mon) {
// determine which monitor holds the active window, or failing that the mouse // determine which monitor holds the active window, or failing that the mouse
// pointer // pointer
/** The cached monitor setup (mon_cache) is populated */
gboolean mon_set = FALSE; gboolean mon_set = FALSE;
/** cached monitor cache, to avoid multiple roundtrips to fetch this. */
workarea mon_cache = { workarea mon_cache = {
0, 0,
}; };