mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Re-indent the code using indenter.
This commit is contained in:
parent
5a7df38ccd
commit
3b297ee80d
19 changed files with 206 additions and 196 deletions
|
@ -726,9 +726,11 @@ static gint drun_int_sort_list ( gconstpointer a, gconstpointer b, G_GNUC_UNUSED
|
||||||
if ( da->sort_index < 0 && db->sort_index < 0 ) {
|
if ( da->sort_index < 0 && db->sort_index < 0 ) {
|
||||||
if ( da->name == NULL && db->name == NULL ) {
|
if ( da->name == NULL && db->name == NULL ) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if ( da->name == NULL ) {
|
}
|
||||||
|
else if ( da->name == NULL ) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if ( db->name == NULL ) {
|
}
|
||||||
|
else if ( db->name == NULL ) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return g_utf8_collate ( da->name, db->name );
|
return g_utf8_collate ( da->name, db->name );
|
||||||
|
@ -1078,7 +1080,8 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
|
||||||
rmpd->cmd_list_length--;
|
rmpd->cmd_list_length--;
|
||||||
}
|
}
|
||||||
retv = RELOAD_DIALOG;
|
retv = RELOAD_DIALOG;
|
||||||
} else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
}
|
||||||
|
else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
}
|
}
|
||||||
return retv;
|
return retv;
|
||||||
|
|
|
@ -239,9 +239,11 @@ static ModeMode file_browser_mode_result ( Mode *sw, int mretv, char **input, un
|
||||||
}
|
}
|
||||||
else if ( mretv & MENU_QUICK_SWITCH ) {
|
else if ( mretv & MENU_QUICK_SWITCH ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
} else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
}
|
||||||
|
else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
} else if ( ( mretv & MENU_OK ) ) {
|
}
|
||||||
|
else if ( ( mretv & MENU_OK ) ) {
|
||||||
if ( selected_line < pd->array_length ) {
|
if ( selected_line < pd->array_length ) {
|
||||||
if ( pd->array[selected_line].type == UP ) {
|
if ( pd->array[selected_line].type == UP ) {
|
||||||
GFile *new = g_file_get_parent ( pd->current_dir );
|
GFile *new = g_file_get_parent ( pd->current_dir );
|
||||||
|
|
|
@ -71,7 +71,6 @@ static ModeMode help_keys_mode_result ( G_GNUC_UNUSED Mode *sw,
|
||||||
G_GNUC_UNUSED char **input,
|
G_GNUC_UNUSED char **input,
|
||||||
G_GNUC_UNUSED unsigned int selected_line )
|
G_GNUC_UNUSED unsigned int selected_line )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( mretv & MENU_CUSTOM_COMMAND ) {
|
if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
int retv = ( mretv & MENU_LOWER_MASK );
|
int retv = ( mretv & MENU_LOWER_MASK );
|
||||||
return retv;
|
return retv;
|
||||||
|
|
|
@ -391,8 +391,8 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in
|
||||||
retv = RELOAD_DIALOG;
|
retv = RELOAD_DIALOG;
|
||||||
run_mode_destroy ( sw );
|
run_mode_destroy ( sw );
|
||||||
run_mode_init ( sw );
|
run_mode_init ( sw );
|
||||||
|
}
|
||||||
} else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
}
|
}
|
||||||
return retv;
|
return retv;
|
||||||
|
|
|
@ -297,7 +297,8 @@ static ModeMode script_mode_result ( Mode *sw, int mretv, char **input, unsigned
|
||||||
return RELOAD_DIALOG;
|
return RELOAD_DIALOG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
return retv;
|
return retv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -606,7 +606,8 @@ static ModeMode ssh_mode_result ( Mode *sw, int mretv, char **input, unsigned in
|
||||||
retv = RELOAD_DIALOG;
|
retv = RELOAD_DIALOG;
|
||||||
ssh_mode_destroy ( sw );
|
ssh_mode_destroy ( sw );
|
||||||
ssh_mode_init ( sw );
|
ssh_mode_init ( sw );
|
||||||
} else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
}
|
||||||
|
else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
}
|
}
|
||||||
return retv;
|
return retv;
|
||||||
|
|
|
@ -727,7 +727,8 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i
|
||||||
retv = RELOAD_DIALOG;
|
retv = RELOAD_DIALOG;
|
||||||
}
|
}
|
||||||
g_free ( lf_cmd );
|
g_free ( lf_cmd );
|
||||||
} else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
}
|
||||||
|
else if ( mretv & MENU_CUSTOM_COMMAND ) {
|
||||||
retv = ( mretv & MENU_LOWER_MASK );
|
retv = ( mretv & MENU_LOWER_MASK );
|
||||||
}
|
}
|
||||||
return retv;
|
return retv;
|
||||||
|
|
|
@ -118,7 +118,6 @@ static int dmenu_mode = FALSE;
|
||||||
/** Rofi's return code */
|
/** Rofi's return code */
|
||||||
int return_code = EXIT_SUCCESS;
|
int return_code = EXIT_SUCCESS;
|
||||||
|
|
||||||
|
|
||||||
void process_result ( RofiViewState *state );
|
void process_result ( RofiViewState *state );
|
||||||
|
|
||||||
void rofi_set_return_code ( int code )
|
void rofi_set_return_code ( int code )
|
||||||
|
@ -795,7 +794,6 @@ int main ( int argc, char *argv[] )
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const char *ro_pid = g_getenv ( "ROFI_OUTSIDE" );
|
const char *ro_pid = g_getenv ( "ROFI_OUTSIDE" );
|
||||||
if ( ro_pid != NULL ) {
|
if ( ro_pid != NULL ) {
|
||||||
|
@ -1067,7 +1065,6 @@ int main ( int argc, char *argv[] )
|
||||||
return return_code;
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** List of error messages.*/
|
/** List of error messages.*/
|
||||||
extern GList *list_of_error_msgs;
|
extern GList *list_of_error_msgs;
|
||||||
int rofi_theme_rasi_validate ( const char *filename )
|
int rofi_theme_rasi_validate ( const char *filename )
|
||||||
|
|
|
@ -1517,7 +1517,8 @@ static X11CursorType rofi_cursor_type_to_x11_cursor_type ( RofiCursorType type )
|
||||||
return CURSOR_DEFAULT;
|
return CURSOR_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static RofiCursorType rofi_view_resolve_cursor ( RofiViewState *state, gint x, gint y ) {
|
static RofiCursorType rofi_view_resolve_cursor ( RofiViewState *state, gint x, gint y )
|
||||||
|
{
|
||||||
widget *target = widget_find_mouse_target ( WIDGET ( state->main_window ), WIDGET_TYPE_UNKNOWN, x, y );
|
widget *target = widget_find_mouse_target ( WIDGET ( state->main_window ), WIDGET_TYPE_UNKNOWN, x, y );
|
||||||
|
|
||||||
return target != NULL
|
return target != NULL
|
||||||
|
|
|
@ -190,7 +190,8 @@ textbox* textbox_create ( widget *parent, WidgetType type, const char *name, Tex
|
||||||
// Allow overriding of markup.
|
// Allow overriding of markup.
|
||||||
if ( rofi_theme_get_boolean ( WIDGET ( tb ), "markup", ( tb->flags & TB_MARKUP ) == TB_MARKUP ) ) {
|
if ( rofi_theme_get_boolean ( WIDGET ( tb ), "markup", ( tb->flags & TB_MARKUP ) == TB_MARKUP ) ) {
|
||||||
tb->flags |= TB_MARKUP;
|
tb->flags |= TB_MARKUP;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
tb->flags &= ( ~TB_MARKUP );
|
tb->flags &= ( ~TB_MARKUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
source/xcb.c
31
source/xcb.c
|
@ -131,7 +131,8 @@ static xcb_visualtype_t * lookup_visual ( xcb_screen_t *s, xcb_visualid_t visu
|
||||||
* http://macslow.thepimp.net. I'm not entirely sure he's proud of it, but it has
|
* http://macslow.thepimp.net. I'm not entirely sure he's proud of it, but it has
|
||||||
* proved immeasurably useful for me. */
|
* proved immeasurably useful for me. */
|
||||||
|
|
||||||
static uint32_t* create_kernel(double radius, double deviation, uint32_t *sum2) {
|
static uint32_t* create_kernel ( double radius, double deviation, uint32_t *sum2 )
|
||||||
|
{
|
||||||
int size = 2 * (int) ( radius ) + 1;
|
int size = 2 * (int) ( radius ) + 1;
|
||||||
uint32_t* kernel = (uint32_t *) ( g_malloc ( sizeof ( uint32_t ) * ( size + 1 ) ) );
|
uint32_t* kernel = (uint32_t *) ( g_malloc ( sizeof ( uint32_t ) * ( size + 1 ) ) );
|
||||||
double radiusf = fabs ( radius ) + 1.0;
|
double radiusf = fabs ( radius ) + 1.0;
|
||||||
|
@ -164,7 +165,9 @@ void cairo_image_surface_blur(cairo_surface_t* surface, double radius, double de
|
||||||
cairo_format_t format;
|
cairo_format_t format;
|
||||||
unsigned int channels;
|
unsigned int channels;
|
||||||
|
|
||||||
if(cairo_surface_status(surface)) return ;
|
if ( cairo_surface_status ( surface ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t *data = cairo_image_surface_get_data ( surface );
|
uint8_t *data = cairo_image_surface_get_data ( surface );
|
||||||
format = cairo_image_surface_get_format ( surface );
|
format = cairo_image_surface_get_format ( surface );
|
||||||
|
@ -172,8 +175,12 @@ void cairo_image_surface_blur(cairo_surface_t* surface, double radius, double de
|
||||||
const int height = cairo_image_surface_get_height ( surface );
|
const int height = cairo_image_surface_get_height ( surface );
|
||||||
const int stride = cairo_image_surface_get_stride ( surface );
|
const int stride = cairo_image_surface_get_stride ( surface );
|
||||||
|
|
||||||
if(format == CAIRO_FORMAT_ARGB32) channels = 4;
|
if ( format == CAIRO_FORMAT_ARGB32 ) {
|
||||||
else return ;
|
channels = 4;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
horzBlur = (uint32_t *) ( g_malloc ( sizeof ( uint32_t ) * height * stride ) );
|
horzBlur = (uint32_t *) ( g_malloc ( sizeof ( uint32_t ) * height * stride ) );
|
||||||
TICK ();
|
TICK ();
|
||||||
|
@ -210,7 +217,6 @@ void cairo_image_surface_blur(cairo_surface_t* surface, double radius, double de
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*horzBlur_ptr++ = blue / sum;
|
*horzBlur_ptr++ = blue / sum;
|
||||||
*horzBlur_ptr++ = green / sum;
|
*horzBlur_ptr++ = green / sum;
|
||||||
*horzBlur_ptr++ = red / sum;
|
*horzBlur_ptr++ = red / sum;
|
||||||
|
@ -248,7 +254,6 @@ void cairo_image_surface_blur(cairo_surface_t* surface, double radius, double de
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*data++ = blue / sum;
|
*data++ = blue / sum;
|
||||||
*data++ = green / sum;
|
*data++ = green / sum;
|
||||||
*data++ = red / sum;
|
*data++ = red / sum;
|
||||||
|
@ -263,8 +268,6 @@ void cairo_image_surface_blur(cairo_surface_t* surface, double radius, double de
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cairo_surface_t *x11_helper_get_screenshot_surface_window ( xcb_window_t window, int size )
|
cairo_surface_t *x11_helper_get_screenshot_surface_window ( xcb_window_t window, int size )
|
||||||
{
|
{
|
||||||
xcb_get_geometry_cookie_t cookie;
|
xcb_get_geometry_cookie_t cookie;
|
||||||
|
@ -1053,8 +1056,7 @@ static void main_loop_x11_event_handler_view ( xcb_generic_event_t *event )
|
||||||
xcb_client_message_event_t *cme = (xcb_client_message_event_t *) event;
|
xcb_client_message_event_t *cme = (xcb_client_message_event_t *) event;
|
||||||
xcb_atom_t atom = cme->data.data32[0];
|
xcb_atom_t atom = cme->data.data32[0];
|
||||||
xcb_timestamp_t time = cme->data.data32[1];
|
xcb_timestamp_t time = cme->data.data32[1];
|
||||||
if ( atom == netatoms[WM_TAKE_FOCUS] )
|
if ( atom == netatoms[WM_TAKE_FOCUS] ) {
|
||||||
{
|
|
||||||
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_NONE, cme->window, time );
|
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_NONE, cme->window, time );
|
||||||
xcb_flush ( xcb->connection );
|
xcb_flush ( xcb->connection );
|
||||||
}
|
}
|
||||||
|
@ -1219,7 +1221,8 @@ void rofi_xcb_set_input_focus ( xcb_window_t w )
|
||||||
g_warning ( "Could not get input focus (error %d), will revert focus to best effort", error->error_code );
|
g_warning ( "Could not get input focus (error %d), will revert focus to best effort", error->error_code );
|
||||||
free ( error );
|
free ( error );
|
||||||
xcb->focus_revert = 0;
|
xcb->focus_revert = 0;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
xcb->focus_revert = freply->focus;
|
xcb->focus_revert = freply->focus;
|
||||||
}
|
}
|
||||||
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT, w, XCB_CURRENT_TIME );
|
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT, w, XCB_CURRENT_TIME );
|
||||||
|
@ -1228,8 +1231,9 @@ void rofi_xcb_set_input_focus ( xcb_window_t w )
|
||||||
|
|
||||||
void rofi_xcb_revert_input_focus ( void )
|
void rofi_xcb_revert_input_focus ( void )
|
||||||
{
|
{
|
||||||
if ( xcb->focus_revert == 0 )
|
if ( xcb->focus_revert == 0 ) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT, xcb->focus_revert, XCB_CURRENT_TIME );
|
xcb_set_input_focus ( xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT, xcb->focus_revert, XCB_CURRENT_TIME );
|
||||||
xcb_flush ( xcb->connection );
|
xcb_flush ( xcb->connection );
|
||||||
|
@ -1526,7 +1530,8 @@ static void x11_create_visual_and_colormap ( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void x11_lookup_cursors ( void ) {
|
static void x11_lookup_cursors ( void )
|
||||||
|
{
|
||||||
xcb_cursor_context_t *ctx;
|
xcb_cursor_context_t *ctx;
|
||||||
|
|
||||||
if ( xcb_cursor_context_new ( xcb->connection, xcb->screen, &ctx ) < 0 ) {
|
if ( xcb_cursor_context_new ( xcb->connection, xcb->screen, &ctx ) < 0 ) {
|
||||||
|
|
|
@ -259,7 +259,6 @@ void config_parser_add_option ( XrmOptionType type, const char *key, void **valu
|
||||||
num_extra_options++;
|
num_extra_options++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse an option from the commandline vector.
|
* Parse an option from the commandline vector.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue