diff options
-rw-r--r-- | include/widgets/widget-internal.h | 1 | ||||
-rw-r--r-- | source/dialogs/dmenu.c | 1 | ||||
-rw-r--r-- | source/dialogs/run.c | 2 | ||||
-rw-r--r-- | source/keyb.c | 6 | ||||
-rw-r--r-- | source/rofi.c | 23 | ||||
-rw-r--r-- | source/view.c | 1 | ||||
-rw-r--r-- | source/x11-helper.c | 11 |
7 files changed, 34 insertions, 11 deletions
diff --git a/include/widgets/widget-internal.h b/include/widgets/widget-internal.h index d66a8d05..4ffe6482 100644 --- a/include/widgets/widget-internal.h +++ b/include/widgets/widget-internal.h @@ -35,6 +35,7 @@ struct _widget /** update widget implementation function */ void ( *update )( struct _widget * ); + /** Handle mouse motion, used for dragging */ gboolean (*motion_notify)( struct _widget *, xcb_motion_notify_event_t * ); /** widget clicked callback */ diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index d13c8ddd..0700ca26 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -443,6 +443,7 @@ static int dmenu_token_match ( const Mode *sw, GRegex **tokens, unsigned int ind } #include "mode-private.h" +/** dmenu Mode object. */ Mode dmenu_mode = { .name = "dmenu", diff --git a/source/dialogs/run.c b/source/dialogs/run.c index 31519ee8..b88be5a4 100644 --- a/source/dialogs/run.c +++ b/source/dialogs/run.c @@ -53,6 +53,8 @@ * Name of the history file where previously choosen commands are stored. */ #define RUN_CACHE_FILE "rofi-3.runcache" + +/** The log domain of this dialog. */ #define LOG_DOMAIN "Dialogs.Run" /** diff --git a/source/keyb.c b/source/keyb.c index 0f52c909..8c309bf6 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -27,6 +27,9 @@ typedef struct char *comment; } DefaultBinding; +/** + * Data structure holding all the action keybinding. + */ ActionBindingEntry abe[NUM_ABE]; /** @@ -141,6 +144,9 @@ void cleanup_abe ( void ) } } +/** + * Array holding actions that should be trigger on release. + */ static gboolean _abe_trigger_on_release[NUM_ABE] = { 0 }; static gboolean abe_test_action ( KeyBindingAction action, unsigned int mask, xkb_keysym_t key ) diff --git a/source/rofi.c b/source/rofi.c index 46b81ae7..6967e9e3 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -67,6 +67,8 @@ // Pidfile. char *pidfile = NULL; const char *cache_dir = NULL; + +/** global structure holding the keyboard status */ struct xkb_stuff xkb = { .xcb_connection = NULL, .context = NULL, @@ -77,18 +79,24 @@ struct xkb_stuff xkb = { .state = NULL } }; + +/** Path to the configuration file */ char *config_path = NULL; -// Array of modi. +/** Array holding all activated modi. */ Mode **modi = NULL; +/** Number of activated modi in #modi array */ unsigned int num_modi = 0; -// Current selected switcher. +/** Current selected mode */ unsigned int curr_switcher = 0; +/** Glib main loop. */ GMainLoop *main_loop = NULL; +/** GWater xcb source, signalling events from the X server */ GWaterXcbSource *main_loop_source = NULL; +/** Flag indicating we are in dmenu mode. */ static int dmenu_mode = FALSE; - +/** Rofi's return code */ int return_code = EXIT_SUCCESS; void process_result ( RofiViewState *state ); @@ -500,6 +508,7 @@ static gboolean main_loop_signal_handler_int ( G_GNUC_UNUSED gpointer data ) return G_SOURCE_CONTINUE; } +/** X server error depth. to handle nested errors. */ static int error_trap_depth = 0; static void error_trap_push ( G_GNUC_UNUSED SnDisplay *display, G_GNUC_UNUSED xcb_connection_t *xdisplay ) { @@ -600,6 +609,14 @@ static gboolean startup ( G_GNUC_UNUSED gpointer data ) return G_SOURCE_REMOVE; } +/** + * @param argc number of input arguments. + * @param argv array of the input arguments. + * + * Main application entry point. + * + * @returns return code of rofi. + */ int main ( int argc, char *argv[] ) { TIMINGS_START (); diff --git a/source/view.c b/source/view.c index 566f81c0..aac1f93d 100644 --- a/source/view.c +++ b/source/view.c @@ -58,6 +58,7 @@ #include "view.h" #include "view-internal.h" +/** The Rofi View log domain */ #define LOG_DOMAIN "View" #include "xcb.h" diff --git a/source/x11-helper.c b/source/x11-helper.c index b316973a..1aa65d41 100644 --- a/source/x11-helper.c +++ b/source/x11-helper.c @@ -46,13 +46,8 @@ #include "helper.h" #include <rofi.h> -#define OVERLAP( a, b, c, \ - d ) ( ( ( a ) == ( c ) && \ - ( b ) == ( d ) ) || \ - MIN ( ( a ) + ( b ), ( c ) + ( d ) ) - MAX ( ( a ), ( c ) ) > 0 ) -#define INTERSECT( x, y, w, h, x1, y1, w1, \ - h1 ) ( OVERLAP ( ( x ), ( w ), ( x1 ), \ - ( w1 ) ) && OVERLAP ( ( y ), ( h ), ( y1 ), ( h1 ) ) ) +/** Checks if the if x and y is inside rectangle. */ +#define INTERSECT( x,y, x1, y1, w1, h1 ) ( ( ((x) >= (x1)) && ((x) < (x1+w1)) ) && ( ((y) >= (y1)) && ((y) < (y1+h1)) ) ) #include "x11-helper.h" #include "xkb-internal.h" @@ -347,7 +342,7 @@ static void monitor_dimensions ( int x, int y, workarea *mon ) mon->h = xcb->screen->height_in_pixels; for ( workarea *iter = xcb->monitors; iter; iter = iter->next ) { - if ( INTERSECT ( x, y, 1, 1, iter->x, iter->y, iter->w, iter->h ) ) { + if ( INTERSECT ( x, y, iter->x, iter->y, iter->w, iter->h ) ) { *mon = *iter; break; } |