To: vim-dev@vim.org Subject: Patch 6.1.076 (extra) Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.076 (extra) Problem: Macintosh: explorer plugin doesn't work on Mac Classic. IME doesn't work. Dialog boxes don't work on Mac OS X Solution: Fix explorer plugin and key modifiers. (Axel Kielhorn) Fix IME support. (Muraoka Taro) Disable dialog boxes. (Benji Fisher) Files: src/edit.c, src/feature.h, src/gui_mac.c, src/os_mac.c *** ../vim61.075/src/edit.c Sat Mar 30 16:59:33 2002 --- src/edit.c Fri May 17 19:22:44 2002 *************** *** 195,201 **** int revins_scol; /* start column of revins session */ #endif ! #if defined(FEAT_MBYTE) && defined(MACOS) static short previous_script = smRoman; #endif --- 195,201 ---- int revins_scol; /* start column of revins session */ #endif ! #if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC) static short previous_script = smRoman; #endif *************** *** 341,347 **** im_set_active(curbuf->b_p_iminsert == B_IMODE_IM); #endif ! #if defined(FEAT_MBYTE) && defined(MACOS) KeyScript(previous_script); #endif --- 341,347 ---- im_set_active(curbuf->b_p_iminsert == B_IMODE_IM); #endif ! #if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC) KeyScript(previous_script); #endif *************** *** 5630,5636 **** composing_hangul = 0; } #endif ! #if defined(FEAT_MBYTE) && defined(MACOS) previous_script = GetScriptManagerVariable(smKeyScript); KeyScript(smKeyRoman); /* or smKeySysScript */ #endif --- 5630,5636 ---- composing_hangul = 0; } #endif ! #if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC) previous_script = GetScriptManagerVariable(smKeyScript); KeyScript(smKeyRoman); /* or smKeySysScript */ #endif *** ../vim61.075/src/feature.h Wed May 1 21:20:47 2002 --- src/feature.h Fri May 17 19:24:32 2002 *************** *** 706,712 **** # if defined(FEAT_GUI_MSWIN) # define FEAT_GUI_DIALOG # else ! # if ((defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)) && defined(HAVE_X11_XPM_H)) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) # define FEAT_CON_DIALOG # define FEAT_GUI_DIALOG # else --- 706,716 ---- # if defined(FEAT_GUI_MSWIN) # define FEAT_GUI_DIALOG # else ! # if ((defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)) \ ! && defined(HAVE_X11_XPM_H)) \ ! || defined(FEAT_GUI_GTK) \ ! || defined(FEAT_GUI_PHOTON) \ ! || (defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON) # define FEAT_CON_DIALOG # define FEAT_GUI_DIALOG # else *** ../vim61.075/src/gui_mac.c Sat May 4 22:23:07 2002 --- src/gui_mac.c Fri May 17 19:22:44 2002 *************** *** 2060,2071 **** --- 2060,2079 ---- /* Do not want SHIFT-A or CTRL-A with modifier */ if (!IS_SPECIAL(key_char)) { + #if 1 + /* Clear modifiers when only one modifier is set */ + if( (modifiers == MOD_MASK_SHIFT) || + (modifiers == MOD_MASK_CTRL) || + (modifiers == MOD_MASK_ALT)) + modifiers = 0; + #else if( modifiers & MOD_MASK_CTRL) modifiers = modifiers & ~MOD_MASK_CTRL; if( modifiers & MOD_MASK_ALT) modifiers = modifiers & ~MOD_MASK_ALT; if( modifiers & MOD_MASK_SHIFT) modifiers = modifiers & ~MOD_MASK_SHIFT; + #endif } if( modifiers ) { *************** *** 5328,5330 **** --- 5336,5372 ---- #endif } + #if defined(USE_IM_CONTROL) || defined(PROTO) + /* + * Input Method Control functions. + */ + + /* + * Notify cursor position to IM. + */ + void + im_set_position(int row, int col) + { + /* TODO: Implement me! */ + } + + /* + * Set IM status on ("active" is TRUE) or off ("active" is FALSE). + */ + void + im_set_active(int active) + { + KeyScript(active ? smKeySysScript : smKeyRoman); + } + + /* + * Get IM status. When IM is on, return not 0. Else return 0. + */ + int + im_get_status() + { + SInt32 script = GetScriptManagerVariable(smKeyScript); + return (script != smRoman + && script == GetScriptManagerVariable(smSysScript)) ? 1 : 0; + } + #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */ *** ../vim61.075/src/os_mac.c Mon Mar 11 21:45:08 2002 --- src/os_mac.c Fri May 17 19:26:05 2002 *************** *** 1081,1094 **** --- 1081,1100 ---- */ struct stat statb; + #if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON /* For some reason the name is sometimes empty, * (such as for a not yet named file). An empty * filename is interpreted by the MacOS version * of stat (at least under Codewarrior) as the * current directory. */ + /* AK 20020413 + * This is required for Carbon but breaks the + * explorer plugin in Classic + */ if (name[0] == NULL) return FALSE; + #endif if (stat((char *)name, &statb)) return FALSE; *** ../vim61.075/src/version.c Fri May 17 10:21:40 2002 --- src/version.c Fri May 17 19:26:33 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 76, /**/ -- Now it is such a bizarrely improbable coincidence that anything as mind-bogglingly useful as the Babel fish could have evolved purely by chance that some thinkers have chosen to see it as a final and clinching proof of the NON-existence of God. The argument goes something like this: 'I refuse to prove that I exist,' says God, 'for proof denies faith, and without faith I am nothing.' 'But,' says Man, 'the Babel fish is a dead giveaway, isn't it? It could not have evolved by chance. It proves you exist, and so therefore, by your own arguments, you don't. QED.' 'Oh dear,' says God, 'I hadn't thought of that,' and promptly vanishes in a puff of logic. 'Oh, that was easy,' says Man, and for an encore goes on to prove that black is white and gets himself killed on the next pedestrian crossing. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///