summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2022-11-19 21:50:34 +0100
committerDave Davenport <qball@blame.services>2022-11-19 21:50:34 +0100
commitd9935e594e913f6d5399e245f32bda68eb9b46ae (patch)
tree6e3d8205c717e4680211d1d083a5962521930292
parent063195922f667a1d25efdb3ccdbd426fcf62cb9f (diff)
[Doc] Fix some missing docu.
-rw-r--r--include/keyb.h3
-rw-r--r--include/theme.h19
-rw-r--r--include/view-internal.h2
-rw-r--r--include/widgets/textbox.h3
-rw-r--r--include/widgets/widget-internal.h27
-rw-r--r--include/widgets/widget.h6
-rw-r--r--include/xcb.h5
-rw-r--r--source/modes/dmenu.c2
-rw-r--r--source/modes/script.c11
-rw-r--r--source/rofi.c1
-rw-r--r--source/theme.c9
-rw-r--r--source/view.c4
-rw-r--r--source/xcb.c3
13 files changed, 74 insertions, 21 deletions
diff --git a/include/keyb.h b/include/keyb.h
index b2d3b323..8aaeaa76 100644
--- a/include/keyb.h
+++ b/include/keyb.h
@@ -186,6 +186,9 @@ gboolean parse_keys_abe(NkBindings *bindings);
*/
void setup_abe(void);
+/**
+ * List all available key bindings to the terminal.
+ */
void abe_list_all_bindings(gboolean is_term);
/**
* @param name Don't have the name.
diff --git a/include/theme.h b/include/theme.h
index 45faa67c..ec12390b 100644
--- a/include/theme.h
+++ b/include/theme.h
@@ -142,9 +142,11 @@ void rofi_theme_property_free(Property *p);
/**
* @param p The property to free.
*
+ * Make a newly allocted copy of the property.
+ *
* @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
*
@@ -463,9 +465,24 @@ void rofi_theme_free_parsed_files(void);
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
* freed.
+ *
+ * @returns a GList of RofiDistance objects.
*/
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);
#endif
diff --git a/include/view-internal.h b/include/view-internal.h
index 28ab47f3..7779ae3b 100644
--- a/include/view-internal.h
+++ b/include/view-internal.h
@@ -107,7 +107,9 @@ struct RofiViewState {
/** filtered rows */
textbox *tb_filtered_rows;
+ /** Extra icon widget that shows the current selected entries text. */
textbox *tb_current_entry;
+ /** Extra icon widget that shows the current selected entries icon. */
icon *icon_current_entry;
/** Settings of the menu */
diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h
index a3383208..d5695c0b 100644
--- a/include/widgets/textbox.h
+++ b/include/widgets/textbox.h
@@ -313,6 +313,7 @@ PangoAttrList *textbox_get_pango_attributes(textbox *tb);
* @returns the visible text.
*/
const char *textbox_get_visible_text(const textbox *tb);
+
/**
* @param wid The handle to the textbox.
* @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.
*/
-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
diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h
index f7b7c25f..8cc0a295 100644
--- a/include/widgets/widget-internal.h
+++ b/include/widgets/widget-internal.h
@@ -32,23 +32,22 @@
/** Macro for initializing the RofiDistance struct. */
#define WIDGET_DISTANCE_INIT \
- (RofiDistance){ \
- .base = { \
- .distance = 0, \
- .type = ROFI_PU_PX, \
- .modtype = ROFI_DISTANCE_MODIFIER_NONE, \
- .left = NULL, \
- .right = NULL, \
- }, \
+ (RofiDistance) { \
+ .base = \
+ { \
+ .distance = 0, \
+ .type = ROFI_PU_PX, \
+ .modtype = ROFI_DISTANCE_MODIFIER_NONE, \
+ .left = NULL, \
+ .right = NULL, \
+ }, \
.style = ROFI_HL_SOLID, \
}
-/* Macro for initializing the RofiPadding struct. */
+/** Macro for initializing the RofiPadding struct. */
#define WIDGET_PADDING_INIT \
- (RofiPadding){ \
- .top = WIDGET_DISTANCE_INIT, \
- .right = WIDGET_DISTANCE_INIT, \
- .bottom = WIDGET_DISTANCE_INIT, \
- .left = WIDGET_DISTANCE_INIT, \
+ (RofiPadding) { \
+ .top = WIDGET_DISTANCE_INIT, .right = WIDGET_DISTANCE_INIT, \
+ .bottom = WIDGET_DISTANCE_INIT, .left = WIDGET_DISTANCE_INIT, \
}
/**
diff --git a/include/widgets/widget.h b/include/widgets/widget.h
index f41437b1..28edb33a 100644
--- a/include/widgets/widget.h
+++ b/include/widgets/widget.h
@@ -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
*/
-WidgetTriggerActionResult widget_check_action(widget *wid, guint action, gint x,
- gint y);
+WidgetTriggerActionResult widget_check_action(widget *wid,
+ G_GNUC_UNUSED guint action,
+ G_GNUC_UNUSED gint x,
+ G_GNUC_UNUSED gint y);
/**
* @param wid The widget handle
diff --git a/include/xcb.h b/include/xcb.h
index f681eaae..4f67b9f3 100644
--- a/include/xcb.h
+++ b/include/xcb.h
@@ -44,6 +44,11 @@ typedef struct _xcb_stuff xcb_stuff;
*/
extern xcb_stuff *xcb;
+/**
+ * @param data String to copy to clipboard.
+ *
+ * copies string to clipboard.
+ */
void xcb_stuff_set_clipboard(char *data);
/**
diff --git a/source/modes/dmenu.c b/source/modes/dmenu.c
index ee5e9288..e6245013 100644
--- a/source/modes/dmenu.c
+++ b/source/modes/dmenu.c
@@ -114,6 +114,8 @@ typedef struct {
char *ballot_unselected;
} DmenuModePrivateData;
+/** Maximum number of lines rofi parses async before it pushes it to the main
+ * thread. */
#define BLOCK_LINES_SIZE 2048
typedef struct {
unsigned int length;
diff --git a/source/modes/script.c b/source/modes/script.c
index 5a705c36..5e2131de 100644
--- a/source/modes/script.c
+++ b/source/modes/script.c
@@ -463,12 +463,19 @@ static cairo_surface_t *script_get_icon(const Mode *sw,
#include "mode-private.h"
+/** Structure that holds a user script
+ * found in $config/rofi/scripts/
+ */
typedef struct ScriptUser {
+ /** name of the script */
char *name;
+ /** path to the script. */
char *path;
} ScriptUser;
+/** list of user_scripts. */
ScriptUser *user_scripts = NULL;
+/** number of user scripts collected */
size_t num_scripts = 0;
void script_mode_cleanup(void) {
@@ -538,10 +545,10 @@ Mode *script_mode_parse_setup(const char *str) {
unsigned int index = 0;
const char *const sep = ":";
char **tokens = g_strsplit(str, sep, 2);
- if ( tokens ){
+ if (tokens) {
index = g_strv_length(tokens);
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);
}
if (index == 2) {
diff --git a/source/rofi.c b/source/rofi.c
index d8d6a1f1..e57ae721 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -85,6 +85,7 @@ const char *cache_dir = NULL;
/** List of error messages.*/
GList *list_of_error_msgs = NULL;
+/** List of warning messages for the user.*/
GList *list_of_warning_msgs = NULL;
static void rofi_collectmodes_destroy(void);
diff --git a/source/theme.c b/source/theme.c
index 774298c0..386a5ad6 100644
--- a/source/theme.c
+++ b/source/theme.c
@@ -46,13 +46,22 @@
#include "widgets/textbox.h"
#include <gio/gio.h>
+/**
+ * list of config files we parsed.
+ */
GList *parsed_config_files = NULL;
+/** cleanup (free) the list of parsed config files. */
void rofi_theme_free_parsed_files(void) {
g_list_free_full(parsed_config_files, g_free);
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) {
printf("\nParsed files:\n");
for (GList *iter = g_list_first(parsed_config_files); iter != NULL;
diff --git a/source/view.c b/source/view.c
index 491c1404..4378db96 100644
--- a/source/view.c
+++ b/source/view.c
@@ -130,9 +130,13 @@ struct {
guint idle_timeout;
/** timeout for reloading */
guint refilter_timeout;
+ /** amount of time refiltering delay got reset */
guint refilter_timeout_count;
+ /** if filtering takes longer then this time,
+ * reduce the amount of refilters. */
double max_refilter_time;
+ /** enable the reduced refilter mode. */
gboolean delayed_mode;
/** timeout handling */
guint user_timeout;
diff --git a/source/xcb.c b/source/xcb.c
index 6c8515cb..bcc4522f 100644
--- a/source/xcb.c
+++ b/source/xcb.c
@@ -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
// pointer
-
+/** The cached monitor setup (mon_cache) is populated */
gboolean mon_set = FALSE;
+/** cached monitor cache, to avoid multiple roundtrips to fetch this. */
workarea mon_cache = {
0,
};