mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.3.271
Problem: Code not following Vim coding style. Solution: Fix the style. (Elias Diem)
This commit is contained in:
parent
1cb7e0976d
commit
d0988c50f3
116
src/gui_photon.c
116
src/gui_photon.c
@ -358,21 +358,21 @@ gui_ph_handle_timer_timeout(PtWidget_t *widget, void *data, PtCallbackInfo_t *in
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
|
gui_ph_handle_window_cb(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
|
||||||
{
|
{
|
||||||
PhWindowEvent_t *we = info->cbdata;
|
PhWindowEvent_t *we = info->cbdata;
|
||||||
ushort_t *width, *height;
|
ushort_t *width, *height;
|
||||||
|
|
||||||
switch( we->event_f ) {
|
switch (we->event_f) {
|
||||||
case Ph_WM_CLOSE:
|
case Ph_WM_CLOSE:
|
||||||
gui_shell_closed();
|
gui_shell_closed();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Ph_WM_FOCUS:
|
case Ph_WM_FOCUS:
|
||||||
/* Just in case it's hidden and needs to be shown */
|
/* Just in case it's hidden and needs to be shown */
|
||||||
gui_mch_mousehide( MOUSE_SHOW );
|
gui_mch_mousehide(MOUSE_SHOW);
|
||||||
|
|
||||||
if( we->event_state == Ph_WM_EVSTATE_FOCUS )
|
if (we->event_state == Ph_WM_EVSTATE_FOCUS)
|
||||||
{
|
{
|
||||||
gui_focus_change(TRUE);
|
gui_focus_change(TRUE);
|
||||||
gui_mch_start_blink();
|
gui_mch_start_blink();
|
||||||
@ -385,17 +385,17 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Ph_WM_RESIZE:
|
case Ph_WM_RESIZE:
|
||||||
PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 );
|
PtGetResource(gui.vimWindow, Pt_ARG_WIDTH, &width, 0);
|
||||||
PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 );
|
PtGetResource(gui.vimWindow, Pt_ARG_HEIGHT, &height, 0);
|
||||||
#ifdef USE_PANEL_GROUP
|
#ifdef USE_PANEL_GROUP
|
||||||
width -= (pg_margin_left + pg_margin_right);
|
width -= (pg_margin_left + pg_margin_right);
|
||||||
height -= (pg_margin_top + pg_margin_bottom);
|
height -= (pg_margin_top + pg_margin_bottom);
|
||||||
#endif
|
#endif
|
||||||
gui_resize_shell( *width, *height );
|
gui_resize_shell(*width, *height);
|
||||||
gui_set_shellsize( FALSE, FALSE, RESIZE_BOTH );
|
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
|
||||||
is_ignore_draw = FALSE;
|
is_ignore_draw = FALSE;
|
||||||
PtEndFlux( gui.vimContainer );
|
PtEndFlux(gui.vimContainer);
|
||||||
PtContainerRelease( gui.vimContainer );
|
PtContainerRelease(gui.vimContainer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -406,7 +406,7 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
|
gui_ph_handle_scrollbar(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
|
||||||
{
|
{
|
||||||
PtScrollbarCallback_t *scroll;
|
PtScrollbarCallback_t *scroll;
|
||||||
scrollbar_T *sb;
|
scrollbar_T *sb;
|
||||||
@ -415,10 +415,10 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
|
|||||||
scroll = info->cbdata;
|
scroll = info->cbdata;
|
||||||
|
|
||||||
sb = (scrollbar_T *) data;
|
sb = (scrollbar_T *) data;
|
||||||
if( sb != NULL )
|
if (sb != NULL)
|
||||||
{
|
{
|
||||||
value = scroll->position;
|
value = scroll->position;
|
||||||
switch( scroll->action )
|
switch (scroll->action)
|
||||||
{
|
{
|
||||||
case Pt_SCROLL_DRAGGED:
|
case Pt_SCROLL_DRAGGED:
|
||||||
dragging = TRUE;
|
dragging = TRUE;
|
||||||
@ -436,97 +436,97 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
|
gui_ph_handle_keyboard(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
|
||||||
{
|
{
|
||||||
PhKeyEvent_t *key;
|
PhKeyEvent_t *key;
|
||||||
unsigned char string[6];
|
unsigned char string[6];
|
||||||
int len, i;
|
int len, i;
|
||||||
int ch, modifiers;
|
int ch, modifiers;
|
||||||
|
|
||||||
key = PhGetData( info->event );
|
key = PhGetData(info->event);
|
||||||
|
|
||||||
ch = modifiers = len = 0;
|
ch = modifiers = len = 0;
|
||||||
|
|
||||||
if( p_mh )
|
if (p_mh)
|
||||||
gui_mch_mousehide( MOUSE_HIDE );
|
gui_mch_mousehide(MOUSE_HIDE);
|
||||||
|
|
||||||
/* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
|
/* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
|
||||||
if( key->key_flags & Pk_KF_Compose )
|
if (key->key_flags & Pk_KF_Compose)
|
||||||
{
|
{
|
||||||
return Pt_CONTINUE;
|
return Pt_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (key->key_flags & Pk_KF_Cap_Valid) &&
|
if ((key->key_flags & Pk_KF_Cap_Valid) &&
|
||||||
PkIsKeyDown( key->key_flags ) )
|
PkIsKeyDown(key->key_flags))
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
/*
|
/*
|
||||||
* Only show the menu if the Alt key is down, and the Shift & Ctrl
|
* Only show the menu if the Alt key is down, and the Shift & Ctrl
|
||||||
* keys aren't down, as well as the other conditions
|
* keys aren't down, as well as the other conditions
|
||||||
*/
|
*/
|
||||||
if( ( ( key->key_mods & Pk_KM_Alt ) &&
|
if (((key->key_mods & Pk_KM_Alt) &&
|
||||||
!( key->key_mods & Pk_KM_Shift ) &&
|
!(key->key_mods & Pk_KM_Shift) &&
|
||||||
!( key->key_mods & Pk_KM_Ctrl ) ) &&
|
!(key->key_mods & Pk_KM_Ctrl)) &&
|
||||||
gui.menu_is_active &&
|
gui.menu_is_active &&
|
||||||
( *p_wak == 'y' ||
|
(*p_wak == 'y' ||
|
||||||
( *p_wak == 'm' &&
|
(*p_wak == 'm' &&
|
||||||
gui_is_menu_shortcut( key->key_cap ) ) ) )
|
gui_is_menu_shortcut(key->key_cap))))
|
||||||
{
|
{
|
||||||
/* Fallthrough and let photon look for the hotkey */
|
/* Fallthrough and let photon look for the hotkey */
|
||||||
return Pt_CONTINUE;
|
return Pt_CONTINUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for( i = 0; special_keys[i].key_sym != 0; i++ )
|
for(i = 0; special_keys[i].key_sym != 0; i++)
|
||||||
{
|
{
|
||||||
if( special_keys[i].key_sym == key->key_cap )
|
if (special_keys[i].key_sym == key->key_cap)
|
||||||
{
|
{
|
||||||
len = 0;
|
len = 0;
|
||||||
if( special_keys[i].vim_code1 == NUL )
|
if (special_keys[i].vim_code1 == NUL)
|
||||||
ch = special_keys[i].vim_code0;
|
ch = special_keys[i].vim_code0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Detect if a keypad number key has been pressed
|
/* Detect if a keypad number key has been pressed
|
||||||
* and change the key if Num Lock is on */
|
* and change the key if Num Lock is on */
|
||||||
if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
|
if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
|
||||||
&& ( key->key_mods & Pk_KM_Num_Lock ) )
|
&& (key->key_mods & Pk_KM_Num_Lock))
|
||||||
{
|
{
|
||||||
/* FIXME: For now, just map the key to a ascii value
|
/* FIXME: For now, just map the key to a ascii value
|
||||||
* (see <photon/PkKeyDef.h>) */
|
* (see <photon/PkKeyDef.h>) */
|
||||||
ch = key->key_cap - 0xf080;
|
ch = key->key_cap - 0xf080;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ch = TO_SPECIAL( special_keys[i].vim_code0,
|
ch = TO_SPECIAL(special_keys[i].vim_code0,
|
||||||
special_keys[i].vim_code1 );
|
special_keys[i].vim_code1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( key->key_mods & Pk_KM_Ctrl )
|
if (key->key_mods & Pk_KM_Ctrl)
|
||||||
modifiers |= MOD_MASK_CTRL;
|
modifiers |= MOD_MASK_CTRL;
|
||||||
if( key->key_mods & Pk_KM_Alt )
|
if (key->key_mods & Pk_KM_Alt)
|
||||||
modifiers |= MOD_MASK_ALT;
|
modifiers |= MOD_MASK_ALT;
|
||||||
if( key->key_mods & Pk_KM_Shift )
|
if (key->key_mods & Pk_KM_Shift)
|
||||||
modifiers |= MOD_MASK_SHIFT;
|
modifiers |= MOD_MASK_SHIFT;
|
||||||
|
|
||||||
/* Is this not a special key? */
|
/* Is this not a special key? */
|
||||||
if( special_keys[i].key_sym == 0 )
|
if (special_keys[i].key_sym == 0)
|
||||||
{
|
{
|
||||||
ch = PhTo8859_1( key );
|
ch = PhTo8859_1(key);
|
||||||
if( ch == -1
|
if (ch == -1
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
|| ( enc_utf8 && ch > 127 )
|
|| (enc_utf8 && ch > 127)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
len = PhKeyToMb( string, key );
|
len = PhKeyToMb(string, key);
|
||||||
if( len > 0 )
|
if (len > 0)
|
||||||
{
|
{
|
||||||
static char buf[6];
|
static char buf[6];
|
||||||
int src_taken, dst_made;
|
int src_taken, dst_made;
|
||||||
if( enc_utf8 != TRUE )
|
if (enc_utf8 != TRUE)
|
||||||
{
|
{
|
||||||
PxTranslateFromUTF(
|
PxTranslateFromUTF(
|
||||||
charset_translate,
|
charset_translate,
|
||||||
@ -2931,13 +2931,13 @@ gui_ph_parse_font_name(
|
|||||||
name_len = (int_u) ( mark - vim_font );
|
name_len = (int_u) ( mark - vim_font );
|
||||||
|
|
||||||
*font_name = vim_strnsave( vim_font, name_len );
|
*font_name = vim_strnsave( vim_font, name_len );
|
||||||
if( *font_name != NULL )
|
if (*font_name != NULL)
|
||||||
{
|
{
|
||||||
if( mark != NULL )
|
if (mark != NULL)
|
||||||
{
|
{
|
||||||
while( *mark != NUL && *mark++ == ':')
|
while (*mark != NUL && *mark++ == ':')
|
||||||
{
|
{
|
||||||
switch( tolower( *mark++ ) )
|
switch (tolower(*mark++))
|
||||||
{
|
{
|
||||||
case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
|
case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
|
||||||
case 'b': *font_flags |= PF_STYLE_BOLD; break;
|
case 'b': *font_flags |= PF_STYLE_BOLD; break;
|
||||||
@ -2946,7 +2946,7 @@ gui_ph_parse_font_name(
|
|||||||
case 's':
|
case 's':
|
||||||
size = getdigits( &mark );
|
size = getdigits( &mark );
|
||||||
/* Restrict the size to some vague limits */
|
/* Restrict the size to some vague limits */
|
||||||
if( size < 1 || size > 100 )
|
if (size < 1 || size > 100)
|
||||||
size = 8;
|
size = 8;
|
||||||
|
|
||||||
*font_size = size;
|
*font_size = size;
|
||||||
@ -2973,18 +2973,18 @@ gui_mch_init_font(char_u *vim_font_name, int fontset)
|
|||||||
FontQueryInfo info;
|
FontQueryInfo info;
|
||||||
PhRect_t extent;
|
PhRect_t extent;
|
||||||
|
|
||||||
if( vim_font_name == NULL )
|
if (vim_font_name == NULL)
|
||||||
{
|
{
|
||||||
/* Default font */
|
/* Default font */
|
||||||
vim_font_name = "PC Terminal";
|
vim_font_name = "PC Terminal";
|
||||||
}
|
}
|
||||||
|
|
||||||
if( STRCMP( vim_font_name, "*" ) == 0 )
|
if (STRCMP( vim_font_name, "*" ) == 0)
|
||||||
{
|
{
|
||||||
font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
|
font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
|
||||||
"pcterm12", -1, PHFONT_FIXED, NULL );
|
"pcterm12", -1, PHFONT_FIXED, NULL );
|
||||||
|
|
||||||
if( font_tag == NULL )
|
if (font_tag == NULL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
gui_mch_free_font( gui.norm_font );
|
gui_mch_free_font( gui.norm_font );
|
||||||
@ -2995,12 +2995,12 @@ gui_mch_init_font(char_u *vim_font_name, int fontset)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
|
if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
|
||||||
&font_size ) == FALSE )
|
&font_size ) == FALSE)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
|
font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
|
||||||
if( font_tag == NULL )
|
if (font_tag == NULL)
|
||||||
{
|
{
|
||||||
vim_free( font_name );
|
vim_free( font_name );
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@ -3053,17 +3053,17 @@ gui_mch_get_font(char_u *vim_font_name, int report_error)
|
|||||||
int_u font_size = 12;
|
int_u font_size = 12;
|
||||||
int_u font_flags = 0;
|
int_u font_flags = 0;
|
||||||
|
|
||||||
if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
|
if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
|
||||||
&font_size ) != FALSE )
|
&font_size ) != FALSE)
|
||||||
{
|
{
|
||||||
font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
|
font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
|
||||||
vim_free( font_name );
|
vim_free( font_name );
|
||||||
|
|
||||||
if( font_tag != NULL )
|
if (font_tag != NULL)
|
||||||
return (GuiFont)font_tag;
|
return (GuiFont)font_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( report_error )
|
if (report_error)
|
||||||
EMSG2(e_font, vim_font_name );
|
EMSG2(e_font, vim_font_name );
|
||||||
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -709,6 +709,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
271,
|
||||||
/**/
|
/**/
|
||||||
270,
|
270,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user