1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Fix indenting

This commit is contained in:
Dave Davenport 2016-05-08 11:13:11 +02:00
parent 8af7f014cd
commit 8f6c9ee070
6 changed files with 59 additions and 60 deletions

View file

@ -15,60 +15,60 @@
struct RofiViewState
{
Mode *sw;
unsigned int menu_lines;
unsigned int max_elements;
unsigned int max_rows;
unsigned int columns;
Mode *sw;
unsigned int menu_lines;
unsigned int max_elements;
unsigned int max_rows;
unsigned int columns;
unsigned int element_width;
int top_offset;
unsigned int element_width;
int top_offset;
// Update/Refilter list.
int update;
int refilter;
int rchanged;
int cur_page;
int update;
int refilter;
int rchanged;
int cur_page;
// Entries
textbox *text;
textbox *prompt_tb;
textbox *message_tb;
textbox *case_indicator;
textbox **boxes;
scrollbar *scrollbar;
int *distance;
unsigned int *line_map;
textbox *text;
textbox *prompt_tb;
textbox *message_tb;
textbox *case_indicator;
textbox **boxes;
scrollbar *scrollbar;
int *distance;
unsigned int *line_map;
unsigned int num_lines;
unsigned int num_lines;
// Selected element.
unsigned int selected;
unsigned int filtered_lines;
unsigned int selected;
unsigned int filtered_lines;
// Last offset in paginating.
unsigned int last_offset;
unsigned int last_offset;
KeyBindingAction prev_action;
xcb_timestamp_t last_button_press;
xcb_timestamp_t last_button_press;
int quit;
int skip_absorb;
int quit;
int skip_absorb;
// Return state
unsigned int selected_line;
MenuReturn retv;
int *lines_not_ascii;
int line_height;
unsigned int border;
workarea mon;
unsigned int selected_line;
MenuReturn retv;
int *lines_not_ascii;
int line_height;
unsigned int border;
workarea mon;
// Sidebar view
unsigned int num_modi;
textbox **modi;
unsigned int num_modi;
textbox **modi;
MenuFlags menu_flags;
MenuFlags menu_flags;
// Handlers.
void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb );
void ( *finalize )( struct RofiViewState *state );
void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb );
void ( *finalize )( struct RofiViewState *state );
};
/** @} */
#endif

View file

@ -115,7 +115,7 @@ gboolean parse_keys_abe ( void )
for ( char *entry = strtok_r ( keystr, sep, &sp ); entry != NULL; entry = strtok_r ( NULL, sep, &sp ) ) {
abe[iter].kb = g_realloc ( abe[iter].kb, ( abe[iter].num_bindings + 1 ) * sizeof ( KeyBinding ) );
KeyBinding *kb = &( abe[iter].kb[abe[iter].num_bindings] );
memset(kb, 0, sizeof(KeyBinding));
memset ( kb, 0, sizeof ( KeyBinding ) );
if ( !x11_parse_key ( entry, &( kb->modmask ), &( kb->keysym ), &( kb->release ) ) ) {
g_free ( keystr );
return FALSE;
@ -158,12 +158,11 @@ static gboolean abe_test_action ( KeyBindingAction action, unsigned int mask, xk
return FALSE;
}
KeyBindingAction abe_find_action ( unsigned int mask, xkb_keysym_t key )
{
KeyBindingAction action;
for ( action = 0 ; action < NUM_ABE ; ++action ) {
for ( action = 0; action < NUM_ABE; ++action ) {
if ( abe_test_action ( action, mask, key ) ) {
break;
}
@ -174,11 +173,11 @@ KeyBindingAction abe_find_action ( unsigned int mask, xkb_keysym_t key )
void abe_trigger_release ( void )
{
RofiViewState *state;
RofiViewState *state;
KeyBindingAction action;
state = rofi_view_get_active ( );
for ( action = 0 ; action < NUM_ABE ; ++action ) {
for ( action = 0; action < NUM_ABE; ++action ) {
if ( _abe_trigger_on_release[action] ) {
rofi_view_trigger_action ( state, action );
_abe_trigger_on_release[action] = FALSE;

View file

@ -439,7 +439,7 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
case XCB_XKB_STATE_NOTIFY:
{
xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev;
guint modmask;
guint modmask;
xkb_state_update_mask ( xkb.state,
ksne->baseMods,
ksne->latchedMods,

View file

@ -528,7 +528,7 @@ static void textbox_cursor_del_word ( textbox *tb )
int textbox_keybinding ( textbox *tb, KeyBindingAction action )
{
if ( !( tb->flags & TB_EDITABLE ) ) {
g_return_val_if_reached(0);
g_return_val_if_reached ( 0 );
}
switch ( action )
@ -582,10 +582,10 @@ int textbox_keybinding ( textbox *tb, KeyBindingAction action )
case ACCEPT_ENTRY:
return -1;
default:
g_return_val_if_reached(0);
g_return_val_if_reached ( 0 );
}
g_return_val_if_reached(0);
g_return_val_if_reached ( 0 );
}
gboolean textbox_append ( textbox *tb, char *pad, int pad_len )

View file

@ -1154,7 +1154,7 @@ static void rofi_view_keyboard_navigation ( RofiViewState *state, KeyBindingActi
}
break;
default:
g_return_if_reached();
g_return_if_reached ();
}
}
@ -1461,9 +1461,9 @@ gboolean rofi_view_trigger_action ( RofiViewState *state, KeyBindingAction actio
static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xcb_key_press_event_t *xkpe )
{
xcb_keysym_t key;
char pad[32];
int len = 0;
xcb_keysym_t key;
char pad[32];
int len = 0;
key = xkb_state_key_get_one_sym ( xkb->state, xkpe->detail );
@ -1544,11 +1544,11 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
break;
case XCB_KEYMAP_NOTIFY:
{
xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) ev;
guint modstate = x11_get_current_mask ( xkb );
for ( gint32 by = 0 ; by < 32 ; ++by ) {
for ( gint8 bi = 0 ; bi < 7 ; ++bi ) {
if ( kne->keys[by] & (1 << bi) ) {
xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) ev;
guint modstate = x11_get_current_mask ( xkb );
for ( gint32 by = 0; by < 32; ++by ) {
for ( gint8 bi = 0; bi < 7; ++bi ) {
if ( kne->keys[by] & ( 1 << bi ) ) {
// X11 keycodes starts at 8
xkb_keysym_t key = xkb_state_key_get_one_sym ( xkb->state, ( 8 * by + bi ) + 8 );
abe_find_action ( modstate, key );
@ -1562,8 +1562,8 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
break;
case XCB_KEY_RELEASE:
{
xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) ev;
unsigned int modstate = x11_canonalize_mask ( xkre->state );
xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) ev;
unsigned int modstate = x11_canonalize_mask ( xkre->state );
if ( modstate == 0 ) {
abe_trigger_release ( );
}

View file

@ -440,7 +440,7 @@ unsigned int x11_canonalize_mask ( unsigned int mask )
unsigned int x11_get_current_mask ( xkb_stuff *xkb )
{
unsigned int mask = 0;
for ( gsize i = 0 ; i < xkb_keymap_num_mods(xkb->keymap) ; ++i ) {
for ( gsize i = 0; i < xkb_keymap_num_mods ( xkb->keymap ); ++i ) {
if ( xkb_state_mod_index_is_active ( xkb->state, i, XKB_STATE_MODS_EFFECTIVE ) ) {
mask |= ( 1 << i );
}
@ -454,7 +454,7 @@ gboolean x11_parse_key ( char *combo, unsigned int *mod, xkb_keysym_t *key, gboo
GString *str = g_string_new ( "" );
unsigned int modmask = 0;
if ( g_str_has_prefix(combo, "!") ) {
if ( g_str_has_prefix ( combo, "!" ) ) {
++combo;
*release = TRUE;
}
@ -508,7 +508,7 @@ gboolean x11_parse_key ( char *combo, unsigned int *mod, xkb_keysym_t *key, gboo
}
// if there's no "-" or "+", we might be binding directly to a modifier key - no modmask
if( i == 0 ) {
if ( i == 0 ) {
*mod = 0;
}
else {