Hi there
This is a patch that doesn't change any functionality. It just formats
the code according to vim's code style.
Greetings
Elias
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
*** ../vim/src/gui_photon.c 2011-08-08 09:32:09.000000000 +0200
--- src/gui_photon.c 2011-08-08 09:34:58.000000000 +0200
***************
*** 358,378 ****
}
static int
! gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
{
PhWindowEvent_t *we = info->cbdata;
ushort_t *width, *height;
! switch( we->event_f ) {
case Ph_WM_CLOSE:
gui_shell_closed();
break;
case Ph_WM_FOCUS:
/* Just in case it's hidden and needs to be shown */
! gui_mch_mousehide( MOUSE_SHOW );
! if( we->event_state == Ph_WM_EVSTATE_FOCUS )
{
gui_focus_change(TRUE);
gui_mch_start_blink();
--- 358,378 ----
}
static int
! gui_ph_handle_window_cb(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PhWindowEvent_t *we = info->cbdata;
ushort_t *width, *height;
! switch(we->event_f) {
case Ph_WM_CLOSE:
gui_shell_closed();
break;
case Ph_WM_FOCUS:
/* Just in case it's hidden and needs to be shown */
! gui_mch_mousehide(MOUSE_SHOW);
! if (we->event_state == Ph_WM_EVSTATE_FOCUS)
{
gui_focus_change(TRUE);
gui_mch_start_blink();
***************
*** 385,401 ****
break;
case Ph_WM_RESIZE:
! PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 );
! PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 );
#ifdef USE_PANEL_GROUP
width -= (pg_margin_left + pg_margin_right);
height -= (pg_margin_top + pg_margin_bottom);
#endif
! gui_resize_shell( *width, *height );
! gui_set_shellsize( FALSE, FALSE, RESIZE_BOTH );
is_ignore_draw = FALSE;
! PtEndFlux( gui.vimContainer );
! PtContainerRelease( gui.vimContainer );
break;
default:
--- 385,401 ----
break;
case Ph_WM_RESIZE:
! PtGetResource(gui.vimWindow, Pt_ARG_WIDTH, &width, 0);
! PtGetResource(gui.vimWindow, Pt_ARG_HEIGHT, &height, 0);
#ifdef USE_PANEL_GROUP
width -= (pg_margin_left + pg_margin_right);
height -= (pg_margin_top + pg_margin_bottom);
#endif
! gui_resize_shell(*width, *height);
! gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
is_ignore_draw = FALSE;
! PtEndFlux(gui.vimContainer);
! PtContainerRelease(gui.vimContainer);
break;
default:
***************
*** 406,412 ****
}
static int
! gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
{
PtScrollbarCallback_t *scroll;
scrollbar_T *sb;
--- 406,412 ----
}
static int
! gui_ph_handle_scrollbar(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PtScrollbarCallback_t *scroll;
scrollbar_T *sb;
***************
*** 415,424 ****
scroll = info->cbdata;
sb = (scrollbar_T *) data;
! if( sb != NULL )
{
value = scroll->position;
! switch( scroll->action )
{
case Pt_SCROLL_DRAGGED:
dragging = TRUE;
--- 415,424 ----
scroll = info->cbdata;
sb = (scrollbar_T *) data;
! if (sb != NULL)
{
value = scroll->position;
! switch(scroll->action)
{
case Pt_SCROLL_DRAGGED:
dragging = TRUE;
***************
*** 436,532 ****
}
static int
! gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
{
PhKeyEvent_t *key;
unsigned char string[6];
int len, i;
int ch, modifiers;
! key = PhGetData( info->event );
ch = modifiers = len = 0;
! if( p_mh )
! gui_mch_mousehide( MOUSE_HIDE );
/* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
! if( key->key_flags & Pk_KF_Compose )
{
return Pt_CONTINUE;
}
! if( (key->key_flags & Pk_KF_Cap_Valid) &&
! PkIsKeyDown( key->key_flags ) )
{
#ifdef FEAT_MENU
/*
* Only show the menu if the Alt key is down, and the Shift & Ctrl
* keys aren't down, as well as the other conditions
*/
! if( ( ( key->key_mods & Pk_KM_Alt ) &&
! !( key->key_mods & Pk_KM_Shift ) &&
! !( key->key_mods & Pk_KM_Ctrl ) ) &&
gui.menu_is_active &&
! ( *p_wak == 'y' ||
! ( *p_wak == 'm' &&
! gui_is_menu_shortcut( key->key_cap ) ) ) )
{
/* Fallthrough and let photon look for the hotkey */
return Pt_CONTINUE;
}
#endif
! for( i = 0; special_keys[i].key_sym != 0; i++ )
{
! if( special_keys[i].key_sym == key->key_cap )
{
len = 0;
! if( special_keys[i].vim_code1 == NUL )
ch = special_keys[i].vim_code0;
else
{
/* Detect if a keypad number key has been pressed
* and change the key if Num Lock is on */
! if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
! && ( key->key_mods & Pk_KM_Num_Lock ) )
{
/* FIXME: For now, just map the key to a ascii value
* (see <photon/PkKeyDef.h>) */
ch = key->key_cap - 0xf080;
}
else
! ch = TO_SPECIAL( special_keys[i].vim_code0,
! special_keys[i].vim_code1 );
}
break;
}
}
! if( key->key_mods & Pk_KM_Ctrl )
modifiers |= MOD_MASK_CTRL;
! if( key->key_mods & Pk_KM_Alt )
modifiers |= MOD_MASK_ALT;
! if( key->key_mods & Pk_KM_Shift )
modifiers |= MOD_MASK_SHIFT;
/* Is this not a special key? */
! if( special_keys[i].key_sym == 0 )
{
! ch = PhTo8859_1( key );
! if( ch == -1
#ifdef FEAT_MBYTE
! || ( enc_utf8 && ch > 127 )
#endif
)
{
#ifdef FEAT_MBYTE
! len = PhKeyToMb( string, key );
! if( len > 0 )
{
static char buf[6];
int src_taken, dst_made;
! if( enc_utf8 != TRUE )
{
PxTranslateFromUTF(
charset_translate,
--- 436,532 ----
}
static int
! gui_ph_handle_keyboard(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
{
PhKeyEvent_t *key;
unsigned char string[6];
int len, i;
int ch, modifiers;
! key = PhGetData(info->event);
ch = modifiers = len = 0;
! if (p_mh)
! gui_mch_mousehide(MOUSE_HIDE);
/* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
! if (key->key_flags & Pk_KF_Compose)
{
return Pt_CONTINUE;
}
! if ((key->key_flags & Pk_KF_Cap_Valid) &&
! PkIsKeyDown(key->key_flags))
{
#ifdef FEAT_MENU
/*
* Only show the menu if the Alt key is down, and the Shift & Ctrl
* keys aren't down, as well as the other conditions
*/
! if (((key->key_mods & Pk_KM_Alt) &&
! !(key->key_mods & Pk_KM_Shift) &&
! !(key->key_mods & Pk_KM_Ctrl)) &&
gui.menu_is_active &&
! (*p_wak == 'y' ||
! (*p_wak == 'm' &&
! gui_is_menu_shortcut(key->key_cap))))
{
/* Fallthrough and let photon look for the hotkey */
return Pt_CONTINUE;
}
#endif
! for(i = 0; special_keys[i].key_sym != 0; i++)
{
! if (special_keys[i].key_sym == key->key_cap)
{
len = 0;
! if (special_keys[i].vim_code1 == NUL)
ch = special_keys[i].vim_code0;
else
{
/* Detect if a keypad number key has been pressed
* and change the key if Num Lock is on */
! if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
! && (key->key_mods & Pk_KM_Num_Lock))
{
/* FIXME: For now, just map the key to a ascii value
* (see <photon/PkKeyDef.h>) */
ch = key->key_cap - 0xf080;
}
else
! ch = TO_SPECIAL(special_keys[i].vim_code0,
! special_keys[i].vim_code1);
}
break;
}
}
! if (key->key_mods & Pk_KM_Ctrl)
modifiers |= MOD_MASK_CTRL;
! if (key->key_mods & Pk_KM_Alt)
modifiers |= MOD_MASK_ALT;
! if (key->key_mods & Pk_KM_Shift)
modifiers |= MOD_MASK_SHIFT;
/* Is this not a special key? */
! if (special_keys[i].key_sym == 0)
{
! ch = PhTo8859_1(key);
! if (ch == -1
#ifdef FEAT_MBYTE
! || (enc_utf8 && ch > 127)
#endif
)
{
#ifdef FEAT_MBYTE
! len = PhKeyToMb(string, key);
! if (len > 0)
{
static char buf[6];
int src_taken, dst_made;
! if (enc_utf8 != TRUE)
{
PxTranslateFromUTF(
charset_translate,