diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-10-15 15:39:08 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-10-15 15:39:08 +0200 |
commit | f0981d66972c07127f4bd7b54ab1b9dc7e0a91e9 (patch) | |
tree | 1122aec0001bc61bacc917767b6377ff233ace07 | |
parent | 9293c8b8ce5580c3be0d29366ca4287a706ee03e (diff) |
Indenting, comments
-rw-r--r-- | include/mode-private.h | 2 | ||||
-rw-r--r-- | include/timings.h | 43 | ||||
-rw-r--r-- | include/widgets/listview.h | 6 | ||||
-rw-r--r-- | include/widgets/textbox.h | 20 | ||||
-rw-r--r-- | include/xcb-internal.h | 3 | ||||
-rw-r--r-- | include/xcb.h | 19 | ||||
-rw-r--r-- | include/xkb.h | 3 | ||||
-rw-r--r-- | include/xrmoptions.h | 6 | ||||
-rw-r--r-- | source/dialogs/ssh.c | 2 | ||||
-rw-r--r-- | source/helper.c | 4 | ||||
-rw-r--r-- | source/rofi.c | 36 | ||||
-rw-r--r-- | source/widgets/box.c | 7 | ||||
-rw-r--r-- | source/widgets/separator.c | 2 | ||||
-rw-r--r-- | source/widgets/textbox.c | 2 |
14 files changed, 113 insertions, 42 deletions
diff --git a/include/mode-private.h b/include/mode-private.h index da6456fa..f3731143 100644 --- a/include/mode-private.h +++ b/include/mode-private.h @@ -87,7 +87,7 @@ typedef ModeMode ( *_mode_result )( Mode *sw, int menu_retv, char **input, unsig * * Preprocess the input for sorting. * - * @returns Entry stripped from markup for sorting + * @returns Entry stripped from markup for sorting */ typedef char* ( *_mode_preprocess_input )( Mode *sw, const char *input ); diff --git a/include/timings.h b/include/timings.h index 6656867b..040840d4 100644 --- a/include/timings.h +++ b/include/timings.h @@ -8,21 +8,62 @@ * @{ */ #if TIMINGS - +/** + * Init the timestamping mechanism . + * implementation. + */ void rofi_timings_init ( void ); +/** + * @param str function name. + * @param line line number + * @param msg message + * + * Report a tick. + */ void rofi_timings_tick ( char const *str, int line, char const *msg ); +/** + * Stop the timestamping mechanism + */ void rofi_timings_quit ( void ); +/** + * Start timestamping mechanism. + * Call to this function is time 0. + */ #define TIMINGS_START() rofi_timings_init () +/** + * Report current time since TIMINGS_START + */ #define TICK() rofi_timings_tick ( __func__, __LINE__, "" ) +/** + * @param a an string + * Report current time since TIMINGS_START + */ #define TICK_N( a ) rofi_timings_tick ( __func__, __LINE__, a ) +/** + * Stop timestamping mechanism. + */ #define TIMINGS_STOP() rofi_timings_quit () #else +/** + * Start timestamping mechanism. + * Call to this function is time 0. + */ #define TIMINGS_START() +/** + * Stop timestamping mechanism. + */ #define TIMINGS_STOP() +/** + * Report current time since TIMINGS_START + */ #define TICK() +/** + * @param a an string + * Report current time since TIMINGS_START + */ #define TICK_N( a ) #endif // TIMINGS diff --git a/include/widgets/listview.h b/include/widgets/listview.h index 22a67653..a489a085 100644 --- a/include/widgets/listview.h +++ b/include/widgets/listview.h @@ -83,7 +83,7 @@ void listview_set_padding ( listview *lv, unsigned int padding ); /** * @param lv Handler to the listview object - * @param lines The maximum number of lines + * @param lines The maximum number of lines * * Set the maximum number of lines to show. */ @@ -91,7 +91,7 @@ void listview_set_max_lines ( listview *lv, unsigned int lines ); /** * @param lv Handler to the listview object - * @param columns The maximum number of columns + * @param columns The maximum number of columns * * Set the maximum number of columns to show. */ @@ -123,7 +123,7 @@ void listview_set_scrollbar_width ( listview *lv, unsigned int width ); * @param lv Handler to the listview object * @param cycle True for cycle mode * - * Set cycle mode. On last entry go to first. + * Set cycle mode. On last entry go to first. */ void listview_set_cycle ( listview *lv, gboolean cycle ); /** diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index 15de87dc..f467ea6c 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -46,16 +46,16 @@ typedef struct */ typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, - TB_PASSWORD = 1 << 22, - TB_INDICATOR = 1 << 23, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, + TB_PASSWORD = 1 << 22, + TB_INDICATOR = 1 << 23, } TextboxFlags; /** * Flags indicating current state of the textbox. diff --git a/include/xcb-internal.h b/include/xcb-internal.h index dc4d5db2..cf09da08 100644 --- a/include/xcb-internal.h +++ b/include/xcb-internal.h @@ -1,6 +1,6 @@ #ifndef ROFI_XCB_INTERNAL_H #define ROFI_XCB_INTERNAL_H - +/** Indication we accept that startup notification api is not yet frozen */ #define SN_API_NOT_YET_FROZEN #include <libsn/sn.h> @@ -10,7 +10,6 @@ /** * Structure to keep xcb stuff around. */ - struct _xcb_stuff { xcb_connection_t *connection; diff --git a/include/xcb.h b/include/xcb.h index 47e235ab..7c41ad86 100644 --- a/include/xcb.h +++ b/include/xcb.h @@ -1,10 +1,27 @@ #ifndef ROFI_XCB_H #define ROFI_XCB_H +/** + * xcb data structure type declaration. + */ typedef struct _xcb_stuff xcb_stuff; +/** + * Global pointer to xcb_stuff instance. + */ extern xcb_stuff *xcb; -xcb_window_t xcb_stuff_get_root_window ( xcb_stuff *xcb ); +/** + * @param xcb the xcb data structure + * + * Get the root window. + * + * @returns the root window. + xcb_window_t xcb_stuff_get_root_window ( xcb_stuff *xcb ); + /** + * @param xcb The xcb data structure. + * + * Disconnect and free all xcb connections and references. + */ void xcb_stuff_wipe ( xcb_stuff *xcb ); #endif diff --git a/include/xkb.h b/include/xkb.h index 5fbd68ad..19fcff8c 100644 --- a/include/xkb.h +++ b/include/xkb.h @@ -1,5 +1,8 @@ #ifndef ROFI_XKB_H #define ROFI_XKB_H +/** + * Structure holding xkb related state. + */ typedef struct xkb_stuff xkb_stuff; #endif diff --git a/include/xrmoptions.h b/include/xrmoptions.h index f0c8e3ac..b4abc76b 100644 --- a/include/xrmoptions.h +++ b/include/xrmoptions.h @@ -63,6 +63,9 @@ typedef enum void config_parse_xresource_options ( xcb_stuff *xcb ); /** + * @param filename The xresources file to parse + * + * Parses filename and updates the config * @ingroup CONFFile */ void config_parse_xresource_options_file ( const char *filename ); @@ -90,6 +93,9 @@ void config_parse_cmd_options_dynamic ( void ); void config_parse_xresource_options_dynamic ( xcb_stuff *xcb ); /** + * @param filename The xresources file to parse + * + * Parses filename and updates the config. For dynamic options. * @ingroup CONFFile */ void config_parse_xresource_options_dynamic_file ( const char *filename ); diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c index 397893dc..f11ba3a1 100644 --- a/source/dialogs/ssh.c +++ b/source/dialogs/ssh.c @@ -198,7 +198,7 @@ static char **read_hosts_file ( char ** retv, unsigned int *length ) // Reading one line per time. while ( getline ( &buffer, &buffer_length, fd ) > 0 ) { // Evaluate one line. - unsigned int index = 0, ti = 0; + unsigned int index = 0, ti = 0; char *token = buffer; // Tokenize it. diff --git a/source/helper.c b/source/helper.c index 7fabbcea..773c8fc3 100644 --- a/source/helper.c +++ b/source/helper.c @@ -194,7 +194,7 @@ static GRegex * create_regex ( const char *input, int case_sensitive ) { #define R( s ) g_regex_new ( s, G_REGEX_OPTIMIZE | ( ( case_sensitive ) ? 0 : G_REGEX_CASELESS ), 0, NULL ) GRegex * retv = NULL; - gchar *r; + gchar *r; switch ( config.matching_method ) { case MM_GLOB: @@ -234,7 +234,7 @@ GRegex **tokenize ( const char *input, int case_sensitive ) } char *saveptr = NULL, *token; - GRegex **retv = NULL; + GRegex **retv = NULL; if ( !config.tokenize ) { retv = g_malloc0 ( sizeof ( GRegex* ) * 2 ); retv[0] = (GRegex *) create_regex ( input, case_sensitive ); diff --git a/source/rofi.c b/source/rofi.c index 391d8f21..b35128c0 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -73,9 +73,9 @@ struct xkb_stuff xkb = { .keymap = NULL, .state = NULL, .compose = { - .table = NULL, - .state = NULL - } + .table = NULL, + .state = NULL +} }; char *config_path = NULL; // Array of modi. @@ -456,22 +456,22 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN xkb.state = xkb_x11_state_new_from_device ( xkb.keymap, xcb->connection, xkb.device_id ); break; case XCB_XKB_STATE_NOTIFY: - { - xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev; - guint modmask; - xkb_state_update_mask ( xkb.state, - ksne->baseMods, - ksne->latchedMods, - ksne->lockedMods, - ksne->baseGroup, - ksne->latchedGroup, - ksne->lockedGroup ); - modmask = x11_get_current_mask ( &xkb ); - if ( modmask == 0 ) { - abe_trigger_release ( ); + { + xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev; + guint modmask; + xkb_state_update_mask ( xkb.state, + ksne->baseMods, + ksne->latchedMods, + ksne->lockedMods, + ksne->baseGroup, + ksne->latchedGroup, + ksne->lockedGroup ); + modmask = x11_get_current_mask ( &xkb ); + if ( modmask == 0 ) { + abe_trigger_release ( ); + } + break; } - break; - } } return G_SOURCE_CONTINUE; } diff --git a/source/widgets/box.c b/source/widgets/box.c index c762d2fb..8aec12b1 100644 --- a/source/widgets/box.c +++ b/source/widgets/box.c @@ -281,12 +281,15 @@ static void box_update ( widget *wid ) } int box_get_fixed_pixels ( box *box ) { - return box->max_size; + if ( box != NULL ) { + return box->max_size; + } + return 0; } void box_set_padding ( box * box, unsigned int padding ) { - if ( box ) { + if ( box != NULL ) { box->padding = padding; widget_queue_redraw ( WIDGET ( box ) ); } diff --git a/source/widgets/separator.c b/source/widgets/separator.c index ae5865c5..d7d2f425 100644 --- a/source/widgets/separator.c +++ b/source/widgets/separator.c @@ -41,7 +41,9 @@ struct _separator separator_type type; }; +/** Configuration value for separator style indicating no line */ const char *const _separator_style_none = "none"; +/** Configuration value for separator style indicating dashed line. */ const char *const _separator_style_dash = "dash"; static void separator_draw ( widget *, cairo_t * ); static void separator_free ( widget * ); diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 3f659d8b..08bb5b60 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -61,7 +61,7 @@ typedef struct /** * Different colors for the different states */ -RowColor colors[num_states]; +RowColor colors[num_states]; /** Default pango context */ static PangoContext *p_context = NULL; |