Karsten Hopp c13f03
To: vim_dev@googlegroups.com
Karsten Hopp c13f03
Subject: Patch 7.3.271
Karsten Hopp c13f03
Fcc: outbox
Karsten Hopp c13f03
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c13f03
Mime-Version: 1.0
Karsten Hopp c13f03
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c13f03
Content-Transfer-Encoding: 8bit
Karsten Hopp c13f03
------------
Karsten Hopp c13f03
Karsten Hopp c13f03
Patch 7.3.271
Karsten Hopp c13f03
Problem:    Code not following Vim coding style.
Karsten Hopp c13f03
Solution:   Fix the style. (Elias Diem)
Karsten Hopp c13f03
Files:	    src/gui_photon.c
Karsten Hopp c13f03
Karsten Hopp c13f03
Karsten Hopp c13f03
*** ../vim-7.3.270/src/gui_photon.c	2011-07-27 14:09:05.000000000 +0200
Karsten Hopp c13f03
--- src/gui_photon.c	2011-08-10 12:18:35.000000000 +0200
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 358,378 ****
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PhWindowEvent_t *we = info->cbdata;
Karsten Hopp c13f03
      ushort_t *width, *height;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     switch( we->event_f ) {
Karsten Hopp c13f03
  	case Ph_WM_CLOSE:
Karsten Hopp c13f03
  	    gui_shell_closed();
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	case Ph_WM_FOCUS:
Karsten Hopp c13f03
  	    /* Just in case it's hidden and needs to be shown */
Karsten Hopp c13f03
! 	    gui_mch_mousehide( MOUSE_SHOW );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	    if( we->event_state == Ph_WM_EVSTATE_FOCUS )
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  		gui_focus_change(TRUE);
Karsten Hopp c13f03
  		gui_mch_start_blink();
Karsten Hopp c13f03
--- 358,378 ----
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_window_cb(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PhWindowEvent_t *we = info->cbdata;
Karsten Hopp c13f03
      ushort_t *width, *height;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     switch (we->event_f) {
Karsten Hopp c13f03
  	case Ph_WM_CLOSE:
Karsten Hopp c13f03
  	    gui_shell_closed();
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	case Ph_WM_FOCUS:
Karsten Hopp c13f03
  	    /* Just in case it's hidden and needs to be shown */
Karsten Hopp c13f03
! 	    gui_mch_mousehide(MOUSE_SHOW);
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	    if (we->event_state == Ph_WM_EVSTATE_FOCUS)
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  		gui_focus_change(TRUE);
Karsten Hopp c13f03
  		gui_mch_start_blink();
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 385,401 ****
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	case Ph_WM_RESIZE:
Karsten Hopp c13f03
! 	    PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 );
Karsten Hopp c13f03
! 	    PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 );
Karsten Hopp c13f03
  #ifdef USE_PANEL_GROUP
Karsten Hopp c13f03
  	    width  -= (pg_margin_left + pg_margin_right);
Karsten Hopp c13f03
  	    height -= (pg_margin_top + pg_margin_bottom);
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
! 	    gui_resize_shell( *width, *height );
Karsten Hopp c13f03
! 	    gui_set_shellsize( FALSE, FALSE, RESIZE_BOTH );
Karsten Hopp c13f03
  	    is_ignore_draw = FALSE;
Karsten Hopp c13f03
! 	    PtEndFlux( gui.vimContainer );
Karsten Hopp c13f03
! 	    PtContainerRelease( gui.vimContainer );
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	default:
Karsten Hopp c13f03
--- 385,401 ----
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	case Ph_WM_RESIZE:
Karsten Hopp c13f03
! 	    PtGetResource(gui.vimWindow, Pt_ARG_WIDTH, &width, 0);
Karsten Hopp c13f03
! 	    PtGetResource(gui.vimWindow, Pt_ARG_HEIGHT, &height, 0);
Karsten Hopp c13f03
  #ifdef USE_PANEL_GROUP
Karsten Hopp c13f03
  	    width  -= (pg_margin_left + pg_margin_right);
Karsten Hopp c13f03
  	    height -= (pg_margin_top + pg_margin_bottom);
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
! 	    gui_resize_shell(*width, *height);
Karsten Hopp c13f03
! 	    gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
Karsten Hopp c13f03
  	    is_ignore_draw = FALSE;
Karsten Hopp c13f03
! 	    PtEndFlux(gui.vimContainer);
Karsten Hopp c13f03
! 	    PtContainerRelease(gui.vimContainer);
Karsten Hopp c13f03
  	    break;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	default:
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 406,412 ****
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PtScrollbarCallback_t *scroll;
Karsten Hopp c13f03
      scrollbar_T *sb;
Karsten Hopp c13f03
--- 406,412 ----
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_scrollbar(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PtScrollbarCallback_t *scroll;
Karsten Hopp c13f03
      scrollbar_T *sb;
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 415,424 ****
Karsten Hopp c13f03
      scroll = info->cbdata;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      sb = (scrollbar_T *) data;
Karsten Hopp c13f03
!     if( sb != NULL )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	value = scroll->position;
Karsten Hopp c13f03
! 	switch( scroll->action )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    case Pt_SCROLL_DRAGGED:
Karsten Hopp c13f03
  		dragging = TRUE;
Karsten Hopp c13f03
--- 415,424 ----
Karsten Hopp c13f03
      scroll = info->cbdata;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      sb = (scrollbar_T *) data;
Karsten Hopp c13f03
!     if (sb != NULL)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	value = scroll->position;
Karsten Hopp c13f03
! 	switch (scroll->action)
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    case Pt_SCROLL_DRAGGED:
Karsten Hopp c13f03
  		dragging = TRUE;
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 436,532 ****
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PhKeyEvent_t    *key;
Karsten Hopp c13f03
      unsigned char   string[6];
Karsten Hopp c13f03
      int		    len, i;
Karsten Hopp c13f03
      int		    ch, modifiers;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     key = PhGetData( info->event );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      ch = modifiers = len = 0;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( p_mh )
Karsten Hopp c13f03
! 	gui_mch_mousehide( MOUSE_HIDE );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
Karsten Hopp c13f03
!     if( key->key_flags & Pk_KF_Compose )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	return Pt_CONTINUE;
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( (key->key_flags & Pk_KF_Cap_Valid) &&
Karsten Hopp c13f03
! 	    PkIsKeyDown( key->key_flags ) )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  #ifdef FEAT_MENU
Karsten Hopp c13f03
  	/*
Karsten Hopp c13f03
  	 * Only show the menu if the Alt key is down, and the Shift & Ctrl
Karsten Hopp c13f03
  	 * keys aren't down, as well as the other conditions
Karsten Hopp c13f03
  	 */
Karsten Hopp c13f03
! 	if( ( ( key->key_mods & Pk_KM_Alt ) &&
Karsten Hopp c13f03
! 		    !( key->key_mods & Pk_KM_Shift ) &&
Karsten Hopp c13f03
! 		    !( key->key_mods & Pk_KM_Ctrl ) ) &&
Karsten Hopp c13f03
  	    gui.menu_is_active &&
Karsten Hopp c13f03
! 	    ( *p_wak == 'y' ||
Karsten Hopp c13f03
! 	      ( *p_wak == 'm' &&
Karsten Hopp c13f03
! 		gui_is_menu_shortcut( key->key_cap ) ) ) )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    /* Fallthrough and let photon look for the hotkey */
Karsten Hopp c13f03
  	    return Pt_CONTINUE;
Karsten Hopp c13f03
  	}
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	for( i = 0; special_keys[i].key_sym != 0; i++ )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    if( special_keys[i].key_sym == key->key_cap )
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  		len = 0;
Karsten Hopp c13f03
! 		if( special_keys[i].vim_code1 == NUL )
Karsten Hopp c13f03
  		    ch = special_keys[i].vim_code0;
Karsten Hopp c13f03
  		else
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    /* Detect if a keypad number key has been pressed
Karsten Hopp c13f03
  		     * and change the key if Num Lock is on */
Karsten Hopp c13f03
! 		    if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
Karsten Hopp c13f03
! 			    && ( key->key_mods & Pk_KM_Num_Lock ) )
Karsten Hopp c13f03
  		    {
Karsten Hopp c13f03
  			/* FIXME: For now, just map the key to a ascii value
Karsten Hopp c13f03
  			 * (see <photon/PkKeyDef.h>) */
Karsten Hopp c13f03
  			ch = key->key_cap - 0xf080;
Karsten Hopp c13f03
  		    }
Karsten Hopp c13f03
  		    else
Karsten Hopp c13f03
! 			ch = TO_SPECIAL( special_keys[i].vim_code0,
Karsten Hopp c13f03
! 				special_keys[i].vim_code1 );
Karsten Hopp c13f03
  		}
Karsten Hopp c13f03
  		break;
Karsten Hopp c13f03
  	    }
Karsten Hopp c13f03
  	}
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if( key->key_mods & Pk_KM_Ctrl )
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_CTRL;
Karsten Hopp c13f03
! 	if( key->key_mods & Pk_KM_Alt )
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_ALT;
Karsten Hopp c13f03
! 	if( key->key_mods & Pk_KM_Shift )
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_SHIFT;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	/* Is this not a special key? */
Karsten Hopp c13f03
! 	if( special_keys[i].key_sym == 0 )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    ch = PhTo8859_1( key );
Karsten Hopp c13f03
! 	    if( ch == -1
Karsten Hopp c13f03
  #ifdef FEAT_MBYTE
Karsten Hopp c13f03
! 		|| ( enc_utf8 && ch > 127 )
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
  		)
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  #ifdef FEAT_MBYTE
Karsten Hopp c13f03
! 		len = PhKeyToMb( string, key );
Karsten Hopp c13f03
! 		if( len > 0 )
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    static char buf[6];
Karsten Hopp c13f03
  		    int src_taken, dst_made;
Karsten Hopp c13f03
! 		    if( enc_utf8 != TRUE )
Karsten Hopp c13f03
  		    {
Karsten Hopp c13f03
  			PxTranslateFromUTF(
Karsten Hopp c13f03
  				charset_translate,
Karsten Hopp c13f03
--- 436,532 ----
Karsten Hopp c13f03
  }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      static int
Karsten Hopp c13f03
! gui_ph_handle_keyboard(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
Karsten Hopp c13f03
  {
Karsten Hopp c13f03
      PhKeyEvent_t    *key;
Karsten Hopp c13f03
      unsigned char   string[6];
Karsten Hopp c13f03
      int		    len, i;
Karsten Hopp c13f03
      int		    ch, modifiers;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     key = PhGetData(info->event);
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      ch = modifiers = len = 0;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if (p_mh)
Karsten Hopp c13f03
! 	gui_mch_mousehide(MOUSE_HIDE);
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
Karsten Hopp c13f03
!     if (key->key_flags & Pk_KF_Compose)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	return Pt_CONTINUE;
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if ((key->key_flags & Pk_KF_Cap_Valid) &&
Karsten Hopp c13f03
! 	    PkIsKeyDown(key->key_flags))
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  #ifdef FEAT_MENU
Karsten Hopp c13f03
  	/*
Karsten Hopp c13f03
  	 * Only show the menu if the Alt key is down, and the Shift & Ctrl
Karsten Hopp c13f03
  	 * keys aren't down, as well as the other conditions
Karsten Hopp c13f03
  	 */
Karsten Hopp c13f03
! 	if (((key->key_mods & Pk_KM_Alt) &&
Karsten Hopp c13f03
! 		    !(key->key_mods & Pk_KM_Shift) &&
Karsten Hopp c13f03
! 		    !(key->key_mods & Pk_KM_Ctrl)) &&
Karsten Hopp c13f03
  	    gui.menu_is_active &&
Karsten Hopp c13f03
! 	    (*p_wak == 'y' ||
Karsten Hopp c13f03
! 	      (*p_wak == 'm' &&
Karsten Hopp c13f03
! 		gui_is_menu_shortcut(key->key_cap))))
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    /* Fallthrough and let photon look for the hotkey */
Karsten Hopp c13f03
  	    return Pt_CONTINUE;
Karsten Hopp c13f03
  	}
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	for(i = 0; special_keys[i].key_sym != 0; i++)
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    if (special_keys[i].key_sym == key->key_cap)
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  		len = 0;
Karsten Hopp c13f03
! 		if (special_keys[i].vim_code1 == NUL)
Karsten Hopp c13f03
  		    ch = special_keys[i].vim_code0;
Karsten Hopp c13f03
  		else
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    /* Detect if a keypad number key has been pressed
Karsten Hopp c13f03
  		     * and change the key if Num Lock is on */
Karsten Hopp c13f03
! 		    if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
Karsten Hopp c13f03
! 			    && (key->key_mods & Pk_KM_Num_Lock))
Karsten Hopp c13f03
  		    {
Karsten Hopp c13f03
  			/* FIXME: For now, just map the key to a ascii value
Karsten Hopp c13f03
  			 * (see <photon/PkKeyDef.h>) */
Karsten Hopp c13f03
  			ch = key->key_cap - 0xf080;
Karsten Hopp c13f03
  		    }
Karsten Hopp c13f03
  		    else
Karsten Hopp c13f03
! 			ch = TO_SPECIAL(special_keys[i].vim_code0,
Karsten Hopp c13f03
! 				special_keys[i].vim_code1);
Karsten Hopp c13f03
  		}
Karsten Hopp c13f03
  		break;
Karsten Hopp c13f03
  	    }
Karsten Hopp c13f03
  	}
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if (key->key_mods & Pk_KM_Ctrl)
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_CTRL;
Karsten Hopp c13f03
! 	if (key->key_mods & Pk_KM_Alt)
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_ALT;
Karsten Hopp c13f03
! 	if (key->key_mods & Pk_KM_Shift)
Karsten Hopp c13f03
  	    modifiers |= MOD_MASK_SHIFT;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	/* Is this not a special key? */
Karsten Hopp c13f03
! 	if (special_keys[i].key_sym == 0)
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    ch = PhTo8859_1(key);
Karsten Hopp c13f03
! 	    if (ch == -1
Karsten Hopp c13f03
  #ifdef FEAT_MBYTE
Karsten Hopp c13f03
! 		|| (enc_utf8 && ch > 127)
Karsten Hopp c13f03
  #endif
Karsten Hopp c13f03
  		)
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
  #ifdef FEAT_MBYTE
Karsten Hopp c13f03
! 		len = PhKeyToMb(string, key);
Karsten Hopp c13f03
! 		if (len > 0)
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    static char buf[6];
Karsten Hopp c13f03
  		    int src_taken, dst_made;
Karsten Hopp c13f03
! 		    if (enc_utf8 != TRUE)
Karsten Hopp c13f03
  		    {
Karsten Hopp c13f03
  			PxTranslateFromUTF(
Karsten Hopp c13f03
  				charset_translate,
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 2931,2943 ****
Karsten Hopp c13f03
  	name_len = (int_u) ( mark - vim_font );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      *font_name = vim_strnsave( vim_font, name_len );
Karsten Hopp c13f03
!     if( *font_name != NULL )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
! 	if( mark != NULL )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    while( *mark != NUL && *mark++ == ':')
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
! 		switch( tolower( *mark++ ) )
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
Karsten Hopp c13f03
  		    case 'b': *font_flags |= PF_STYLE_BOLD; break;
Karsten Hopp c13f03
--- 2931,2943 ----
Karsten Hopp c13f03
  	name_len = (int_u) ( mark - vim_font );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      *font_name = vim_strnsave( vim_font, name_len );
Karsten Hopp c13f03
!     if (*font_name != NULL)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
! 	if (mark != NULL)
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
! 	    while (*mark != NUL && *mark++ == ':')
Karsten Hopp c13f03
  	    {
Karsten Hopp c13f03
! 		switch (tolower(*mark++))
Karsten Hopp c13f03
  		{
Karsten Hopp c13f03
  		    case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
Karsten Hopp c13f03
  		    case 'b': *font_flags |= PF_STYLE_BOLD; break;
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 2946,2952 ****
Karsten Hopp c13f03
  		    case 's':
Karsten Hopp c13f03
  			size = getdigits( &mark );
Karsten Hopp c13f03
  			/* Restrict the size to some vague limits */
Karsten Hopp c13f03
! 			if( size < 1 || size > 100 )
Karsten Hopp c13f03
  			    size = 8;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  			*font_size = size;
Karsten Hopp c13f03
--- 2946,2952 ----
Karsten Hopp c13f03
  		    case 's':
Karsten Hopp c13f03
  			size = getdigits( &mark );
Karsten Hopp c13f03
  			/* Restrict the size to some vague limits */
Karsten Hopp c13f03
! 			if (size < 1 || size > 100)
Karsten Hopp c13f03
  			    size = 8;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  			*font_size = size;
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 2973,2990 ****
Karsten Hopp c13f03
      FontQueryInfo info;
Karsten Hopp c13f03
      PhRect_t extent;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( vim_font_name == NULL )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	/* Default font */
Karsten Hopp c13f03
  	vim_font_name = "PC Terminal";
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( STRCMP( vim_font_name, "*" ) == 0 )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
Karsten Hopp c13f03
  		"pcterm12", -1, PHFONT_FIXED, NULL );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if( font_tag == NULL )
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	gui_mch_free_font( gui.norm_font );
Karsten Hopp c13f03
--- 2973,2990 ----
Karsten Hopp c13f03
      FontQueryInfo info;
Karsten Hopp c13f03
      PhRect_t extent;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if (vim_font_name == NULL)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	/* Default font */
Karsten Hopp c13f03
  	vim_font_name = "PC Terminal";
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if (STRCMP( vim_font_name, "*" ) == 0)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
Karsten Hopp c13f03
  		"pcterm12", -1, PHFONT_FIXED, NULL );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if (font_tag == NULL)
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	gui_mch_free_font( gui.norm_font );
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 2995,3006 ****
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
      else
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
! 	if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
Karsten Hopp c13f03
! 		    &font_size ) == FALSE )
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
Karsten Hopp c13f03
! 	if( font_tag == NULL )
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    vim_free( font_name );
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
--- 2995,3006 ----
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
      else
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
! 	if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
Karsten Hopp c13f03
! 		    &font_size ) == FALSE)
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
  	font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
Karsten Hopp c13f03
! 	if (font_tag == NULL)
Karsten Hopp c13f03
  	{
Karsten Hopp c13f03
  	    vim_free( font_name );
Karsten Hopp c13f03
  	    return FAIL;
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 3053,3069 ****
Karsten Hopp c13f03
      int_u   font_size = 12;
Karsten Hopp c13f03
      int_u   font_flags = 0;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
Karsten Hopp c13f03
! 		&font_size ) != FALSE )
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
Karsten Hopp c13f03
  	vim_free( font_name );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if( font_tag != NULL )
Karsten Hopp c13f03
  	    return (GuiFont)font_tag;
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if( report_error )
Karsten Hopp c13f03
  	EMSG2(e_font, vim_font_name );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      return FAIL;
Karsten Hopp c13f03
--- 3053,3069 ----
Karsten Hopp c13f03
      int_u   font_size = 12;
Karsten Hopp c13f03
      int_u   font_flags = 0;
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
Karsten Hopp c13f03
! 		&font_size ) != FALSE)
Karsten Hopp c13f03
      {
Karsten Hopp c13f03
  	font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
Karsten Hopp c13f03
  	vim_free( font_name );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
! 	if (font_tag != NULL)
Karsten Hopp c13f03
  	    return (GuiFont)font_tag;
Karsten Hopp c13f03
      }
Karsten Hopp c13f03
  
Karsten Hopp c13f03
!     if (report_error)
Karsten Hopp c13f03
  	EMSG2(e_font, vim_font_name );
Karsten Hopp c13f03
  
Karsten Hopp c13f03
      return FAIL;
Karsten Hopp c13f03
*** ../vim-7.3.270/src/version.c	2011-08-10 12:10:55.000000000 +0200
Karsten Hopp c13f03
--- src/version.c	2011-08-10 12:17:06.000000000 +0200
Karsten Hopp c13f03
***************
Karsten Hopp c13f03
*** 711,712 ****
Karsten Hopp c13f03
--- 711,714 ----
Karsten Hopp c13f03
  {   /* Add new patch number below this line */
Karsten Hopp c13f03
+ /**/
Karsten Hopp c13f03
+     271,
Karsten Hopp c13f03
  /**/
Karsten Hopp c13f03
Karsten Hopp c13f03
-- 
Karsten Hopp c13f03
An indication you must be a manager:
Karsten Hopp c13f03
You believe you never have any problems in your life, just
Karsten Hopp c13f03
"issues" and "improvement opportunities".
Karsten Hopp c13f03
Karsten Hopp c13f03
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c13f03
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c13f03
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c13f03
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///