diff --git a/include/textbox.h b/include/textbox.h index 47ecc984..23574de8 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -1,5 +1,6 @@ #ifndef __TEXTBOX_H__ #define __TEXTBOX_H__ +#include typedef struct { @@ -52,13 +53,35 @@ int textbox_keypress ( textbox *tb, XEvent *ev ); void textbox_cursor_end ( textbox *tb ); void textbox_move ( textbox *tb, int x, int y ); + +/** + * @param tb Handle to the textbox + * + * Unmap the textbox window. Effectively hiding it. + */ void textbox_hide ( textbox *tb ); - +/** + * @param font_str The font to use. + * @param font_active_str The font to use for active entries. + * @param bg The background color. + * @param fg The foreground color. + * @param hlbg The background color for a highlighted entry. + * @param hlfg The foreground color for a highlighted entry. + * + * Setup the cached fonts. This is required to do + * before any of the textbox_ functions is called. + * Clean with textbox_cleanup() + */ void textbox_setup ( const char *font_str, const char *font_active_str, const char *bg, const char *fg, const char *hlbg, const char *hlfg ); + +/** + * Cleanup the allocated colors and fonts by textbox_setup(). + */ void textbox_cleanup (); + #endif //__TEXTBOX_H__ diff --git a/include/xrmoptions.h b/include/xrmoptions.h index 1adecc21..3d15b6ed 100644 --- a/include/xrmoptions.h +++ b/include/xrmoptions.h @@ -1,9 +1,23 @@ #ifndef __XRMOPTIONS_H__ #define __XRMOPTIONS_H__ +/** + * @param display Handler of the display to fetch the settings from. + * + * Parse the rofi related X resource options of the + * connected X server. + */ void parse_xresource_options ( Display *display ); +/** + * Free any allocated memory. + */ void parse_xresource_free ( void ); +/** + * Dump the settings in a Xresources compatible way to + * stdout. + */ void xresource_dump ( void ); + #endif diff --git a/source/dmenu-dialog.c b/source/dmenu-dialog.c index 711431f7..5d4f9406 100644 --- a/source/dmenu-dialog.c +++ b/source/dmenu-dialog.c @@ -71,8 +71,7 @@ SwitcherMode dmenu_switcher_dialog ( char **input ) { int selected_line = 0; SwitcherMode retv = MODE_EXIT; - // act as a launcher - char **list = get_dmenu ( ); + char **list = get_dmenu ( ); int mretv = menu ( list, input, dmenu_prompt, NULL, NULL, token_match, NULL, &selected_line ); diff --git a/source/rofi.c b/source/rofi.c index a15e693d..bc5ab3c4 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -47,8 +47,6 @@ #include #include #include -#include -#include #include #include "rofi.h" @@ -1805,7 +1803,7 @@ static void handle_keypress ( XEvent *ev ) } // convert a Mod+key arg to mod mask and keysym -void parse_key ( char *combo, unsigned int *mod, KeySym *key ) +static void parse_key ( char *combo, unsigned int *mod, KeySym *key ) { unsigned int modmask = 0; @@ -1870,7 +1868,7 @@ void parse_key ( char *combo, unsigned int *mod, KeySym *key ) } // bind a key combination on a root window, compensating for Lock* states -void grab_key ( unsigned int modmask, KeySym key ) +static void grab_key ( unsigned int modmask, KeySym key ) { Screen *screen = DefaultScreenOfDisplay ( display ); Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) ); @@ -1922,7 +1920,7 @@ static inline void display_get_i3_path ( Display *display ) /** * Help function. This calls man. */ -void help () +static void help () { int code = execlp ( "man", "man", MANPAGE_PATH, NULL );