1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-07-31 21:59:25 -04:00

Re-Indent code

This commit is contained in:
Dave Davenport 2017-04-27 22:59:14 +02:00
parent b1ecb6ca77
commit ce4b1b23b4
17 changed files with 118 additions and 105 deletions

View file

@ -116,7 +116,6 @@ typedef enum
P_HIGHLIGHT,
} PropertyType;
/**
* Represent the color in theme.
*/

View file

@ -280,5 +280,10 @@ void rofi_view_workers_finalize ( void );
* @returns the current monitor workarea
*/
void rofi_view_get_current_monitor ( int *width, int *height );
/**
* Takes a screenshot.
*/
void rofi_capture_screenshot ( void );
/**@}*/
#endif

View file

@ -964,7 +964,6 @@ int helper_execute_command ( const char *wd, const char *cmd, int run_in_term )
return retv;
}
char *helper_get_theme_path ( const char *file )
{
char *filename = rofi_expand_path ( file );
@ -975,7 +974,8 @@ char *helper_get_theme_path ( const char *file )
if ( g_str_has_suffix ( file, ".rasi" ) ) {
filename = g_strdup ( file );
} else {
}
else {
filename = g_strconcat ( file, ".rasi", NULL );
}
// Check config directory.

View file

@ -289,7 +289,6 @@ static void print_list_of_modi ( int is_term )
is_term ? color_reset : ""
);
}
}
static void print_main_application_options ( int is_term )
{
@ -684,7 +683,8 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
g_warning ( "The XCB connection to X server had a fatal error: %d", status );
g_main_loop_quit ( main_loop );
return G_SOURCE_REMOVE;
} else {
}
else {
g_warning ( "main_loop_x11_event_handler: ev == NULL, status == %d", status );
return G_SOURCE_CONTINUE;
}
@ -908,6 +908,11 @@ static gboolean startup ( G_GNUC_UNUSED gpointer data )
return G_SOURCE_REMOVE;
}
static gboolean record ( void )
{
rofi_capture_screenshot ();
return G_SOURCE_CONTINUE;
}
/**
* @param argc number of input arguments.
* @param argv array of the input arguments.
@ -1163,8 +1168,7 @@ int main ( int argc, char *argv[] )
if ( !dmenu_mode ) {
// setup_modi
if ( setup_modi () )
{
if ( setup_modi () ) {
cleanup ();
return EXIT_FAILURE;
}
@ -1215,6 +1219,11 @@ int main ( int argc, char *argv[] )
cleanup ();
return EXIT_SUCCESS;
}
unsigned int interval = 1;
if ( find_arg_uint ( "-record-screenshots", &interval ) ) {
g_timeout_add ( 1000 / (double) interval, record, NULL );
}
main_loop_source = g_water_xcb_source_new_for_connection ( NULL, xcb->connection, main_loop_x11_event_handler, NULL, NULL );
TICK_N ( "X11 Setup " );

View file

@ -173,7 +173,7 @@ static int lev_sort ( const void *p1, const void *p2, void *arg )
/**
* Stores a screenshot of Rofi at that point in time.
*/
static void menu_capture_screenshot ( void )
void rofi_capture_screenshot ( void )
{
const char *outp = g_getenv ( "ROFI_PNG_OUTPUT" );
if ( CacheState.edit_surf == NULL ) {
@ -190,7 +190,7 @@ static void menu_capture_screenshot ( void )
GDateTime *now = g_date_time_new_now_local ();
// Format filename.
char *timestmp = g_date_time_format ( now, "rofi-%Y-%m-%d-%H%M" );
char *filename = g_strdup_printf ( "%s.png", timestmp );
char *filename = g_strdup_printf ( "%s-%05d.png", timestmp, 0 );
// Build full path
char *fpath = NULL;
if ( outp == NULL ) {
@ -202,7 +202,7 @@ static void menu_capture_screenshot ( void )
// Try the next index.
index++;
// Format filename.
filename = g_strdup_printf ( "%s-%d.png", timestmp, index );
filename = g_strdup_printf ( "%s-%05d.png", timestmp, index );
// Build full path
fpath = g_build_filename ( xdg_pict_dir, filename, NULL );
}
@ -1164,7 +1164,7 @@ gboolean rofi_view_trigger_action ( RofiViewState *state, KeyBindingAction actio
xcb_flush ( xcb->connection );
break;
case SCREENSHOT:
menu_capture_screenshot ( );
rofi_capture_screenshot ( );
break;
case TOGGLE_SORT:
if ( state->case_indicator != NULL ) {