|
Karsten Hopp |
ea4a5a |
To: vim-dev@vim.org
|
|
Karsten Hopp |
ea4a5a |
Subject: Patch 7.1.275
|
|
Karsten Hopp |
ea4a5a |
Fcc: outbox
|
|
Karsten Hopp |
ea4a5a |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
ea4a5a |
Mime-Version: 1.0
|
|
Karsten Hopp |
ea4a5a |
Content-Type: text/plain; charset=ISO-8859-1
|
|
Karsten Hopp |
ea4a5a |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
ea4a5a |
------------
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
Patch 7.1.275 (extra)
|
|
Karsten Hopp |
ea4a5a |
Problem: Mac: ATSUI and 'antialias' don't work properly together.
|
|
Karsten Hopp |
ea4a5a |
Solution: Fix this and the input method. (Jjgod Jiang)
|
|
Karsten Hopp |
ea4a5a |
Files: src/vim.h, src/gui_mac.c
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
*** ../vim-7.1.274/src/vim.h Wed Feb 20 12:22:59 2008
|
|
Karsten Hopp |
ea4a5a |
--- src/vim.h Wed Mar 12 13:18:58 2008
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 461,468 ****
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Check input method control.
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
! #if defined(FEAT_XIM) || \
|
|
Karsten Hopp |
ea4a5a |
! (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)))
|
|
Karsten Hopp |
ea4a5a |
# define USE_IM_CONTROL
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
--- 461,469 ----
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Check input method control.
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
! #if defined(FEAT_XIM) \
|
|
Karsten Hopp |
ea4a5a |
! || (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|
|
Karsten Hopp |
ea4a5a |
! || defined(FEAT_GUI_MAC)
|
|
Karsten Hopp |
ea4a5a |
# define USE_IM_CONTROL
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
*** ../vim-7.1.274/src/gui_mac.c Sat Sep 29 13:15:29 2007
|
|
Karsten Hopp |
ea4a5a |
--- src/gui_mac.c Wed Mar 12 13:40:57 2008
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 59,65 ****
|
|
Karsten Hopp |
ea4a5a |
--- 59,91 ----
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef MACOS_CONVERT
|
|
Karsten Hopp |
ea4a5a |
# define USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static int im_is_active = FALSE;
|
|
Karsten Hopp |
ea4a5a |
+ #if 0
|
|
Karsten Hopp |
ea4a5a |
+ static int im_start_row = 0;
|
|
Karsten Hopp |
ea4a5a |
+ static int im_start_col = 0;
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ #define NR_ELEMS(x) (sizeof(x) / sizeof(x[0]))
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static TSMDocumentID gTSMDocument;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static void im_on_window_switch(int active);
|
|
Karsten Hopp |
ea4a5a |
static EventHandlerUPP keyEventHandlerUPP = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ static EventHandlerUPP winEventHandlerUPP = NULL;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus gui_mac_handle_window_activate(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler, EventRef theEvent, void *data);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus gui_mac_handle_text_input(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler, EventRef theEvent, void *data);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus gui_mac_update_input_area(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler, EventRef theEvent);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus gui_mac_unicode_key_event(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler, EventRef theEvent);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 137,143 ****
|
|
Karsten Hopp |
ea4a5a |
--- 166,176 ----
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef MACOS_CONVERT
|
|
Karsten Hopp |
ea4a5a |
# define USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
+ int p_macatsui_last;
|
|
Karsten Hopp |
ea4a5a |
ATSUStyle gFontStyle;
|
|
Karsten Hopp |
ea4a5a |
+ # ifdef FEAT_MBYTE
|
|
Karsten Hopp |
ea4a5a |
+ ATSUStyle gWideFontStyle;
|
|
Karsten Hopp |
ea4a5a |
+ # endif
|
|
Karsten Hopp |
ea4a5a |
Boolean gIsFontFallbackSet;
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 265,270 ****
|
|
Karsten Hopp |
ea4a5a |
--- 298,308 ----
|
|
Karsten Hopp |
ea4a5a |
static WindowRef drawer = NULL; // TODO: put into gui.h
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
+ static void gui_mac_set_font_attributes(GuiFont font);
|
|
Karsten Hopp |
ea4a5a |
+ static void gui_mac_dispose_atsui_style(void);
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* ------------------------------------------------------------
|
|
Karsten Hopp |
ea4a5a |
* Conversion Utility
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 1935,1946 ****
|
|
Karsten Hopp |
ea4a5a |
/* Dim scrollbars */
|
|
Karsten Hopp |
ea4a5a |
if (whichWindow == gui.VimWindow)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ControlRef rootControl;
|
|
Karsten Hopp |
ea4a5a |
! GetRootControl(gui.VimWindow, &rootControl);
|
|
Karsten Hopp |
ea4a5a |
! if ((event->modifiers) & activeFlag)
|
|
Karsten Hopp |
ea4a5a |
! ActivateControl(rootControl);
|
|
Karsten Hopp |
ea4a5a |
! else
|
|
Karsten Hopp |
ea4a5a |
! DeactivateControl(rootControl);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Activate */
|
|
Karsten Hopp |
ea4a5a |
--- 1973,1984 ----
|
|
Karsten Hopp |
ea4a5a |
/* Dim scrollbars */
|
|
Karsten Hopp |
ea4a5a |
if (whichWindow == gui.VimWindow)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ControlRef rootControl;
|
|
Karsten Hopp |
ea4a5a |
! GetRootControl(gui.VimWindow, &rootControl);
|
|
Karsten Hopp |
ea4a5a |
! if ((event->modifiers) & activeFlag)
|
|
Karsten Hopp |
ea4a5a |
! ActivateControl(rootControl);
|
|
Karsten Hopp |
ea4a5a |
! else
|
|
Karsten Hopp |
ea4a5a |
! DeactivateControl(rootControl);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Activate */
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 1976,1990 ****
|
|
Karsten Hopp |
ea4a5a |
* Handle the key
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the keys */
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
# define INLINE_KEY_BUFFER_SIZE 80
|
|
Karsten Hopp |
ea4a5a |
static pascal OSStatus
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_doKeyEventCarbon(
|
|
Karsten Hopp |
ea4a5a |
EventHandlerCallRef nextHandler,
|
|
Karsten Hopp |
ea4a5a |
! EventRef theEvent,
|
|
Karsten Hopp |
ea4a5a |
! void *data)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
/* Multibyte-friendly key event handler */
|
|
Karsten Hopp |
ea4a5a |
OSStatus err = -1;
|
|
Karsten Hopp |
ea4a5a |
--- 2014,2100 ----
|
|
Karsten Hopp |
ea4a5a |
* Handle the key
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_handle_window_activate(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler,
|
|
Karsten Hopp |
ea4a5a |
+ EventRef theEvent,
|
|
Karsten Hopp |
ea4a5a |
+ void *data)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ UInt32 eventClass = GetEventClass(theEvent);
|
|
Karsten Hopp |
ea4a5a |
+ UInt32 eventKind = GetEventKind(theEvent);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (eventClass == kEventClassWindow)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ switch (eventKind)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ case kEventWindowActivated:
|
|
Karsten Hopp |
ea4a5a |
+ #if defined(USE_IM_CONTROL)
|
|
Karsten Hopp |
ea4a5a |
+ im_on_window_switch(TRUE);
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ return noErr;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ case kEventWindowDeactivated:
|
|
Karsten Hopp |
ea4a5a |
+ #if defined(USE_IM_CONTROL)
|
|
Karsten Hopp |
ea4a5a |
+ im_on_window_switch(FALSE);
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ return noErr;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static pascal OSStatus
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_handle_text_input(
|
|
Karsten Hopp |
ea4a5a |
+ EventHandlerCallRef nextHandler,
|
|
Karsten Hopp |
ea4a5a |
+ EventRef theEvent,
|
|
Karsten Hopp |
ea4a5a |
+ void *data)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ UInt32 eventClass = GetEventClass(theEvent);
|
|
Karsten Hopp |
ea4a5a |
+ UInt32 eventKind = GetEventKind(theEvent);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (eventClass != kEventClassTextInput)
|
|
Karsten Hopp |
ea4a5a |
+ return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! if ((kEventTextInputUpdateActiveInputArea != eventKind) &&
|
|
Karsten Hopp |
ea4a5a |
! (kEventTextInputUnicodeForKeyEvent != eventKind) &&
|
|
Karsten Hopp |
ea4a5a |
! (kEventTextInputOffsetToPos != eventKind) &&
|
|
Karsten Hopp |
ea4a5a |
! (kEventTextInputPosToOffset != eventKind) &&
|
|
Karsten Hopp |
ea4a5a |
! (kEventTextInputGetSelectedText != eventKind))
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! switch (eventKind)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! case kEventTextInputUpdateActiveInputArea:
|
|
Karsten Hopp |
ea4a5a |
! return gui_mac_update_input_area(nextHandler, theEvent);
|
|
Karsten Hopp |
ea4a5a |
! case kEventTextInputUnicodeForKeyEvent:
|
|
Karsten Hopp |
ea4a5a |
! return gui_mac_unicode_key_event(nextHandler, theEvent);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! case kEventTextInputOffsetToPos:
|
|
Karsten Hopp |
ea4a5a |
! case kEventTextInputPosToOffset:
|
|
Karsten Hopp |
ea4a5a |
! case kEventTextInputGetSelectedText:
|
|
Karsten Hopp |
ea4a5a |
! break;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! static pascal
|
|
Karsten Hopp |
ea4a5a |
! OSStatus gui_mac_update_input_area(
|
|
Karsten Hopp |
ea4a5a |
! EventHandlerCallRef nextHandler,
|
|
Karsten Hopp |
ea4a5a |
! EventRef theEvent)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the
|
|
Karsten Hopp |
ea4a5a |
! keys */
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
# define INLINE_KEY_BUFFER_SIZE 80
|
|
Karsten Hopp |
ea4a5a |
static pascal OSStatus
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_unicode_key_event(
|
|
Karsten Hopp |
ea4a5a |
EventHandlerCallRef nextHandler,
|
|
Karsten Hopp |
ea4a5a |
! EventRef theEvent)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
/* Multibyte-friendly key event handler */
|
|
Karsten Hopp |
ea4a5a |
OSStatus err = -1;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2000,2006 ****
|
|
Karsten Hopp |
ea4a5a |
char_u *to = NULL;
|
|
Karsten Hopp |
ea4a5a |
Boolean isSpecial = FALSE;
|
|
Karsten Hopp |
ea4a5a |
int i;
|
|
Karsten Hopp |
ea4a5a |
! EventRef keyEvent;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Mask the mouse (as per user setting) */
|
|
Karsten Hopp |
ea4a5a |
if (p_mh)
|
|
Karsten Hopp |
ea4a5a |
--- 2110,2116 ----
|
|
Karsten Hopp |
ea4a5a |
char_u *to = NULL;
|
|
Karsten Hopp |
ea4a5a |
Boolean isSpecial = FALSE;
|
|
Karsten Hopp |
ea4a5a |
int i;
|
|
Karsten Hopp |
ea4a5a |
! EventRef keyEvent;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Mask the mouse (as per user setting) */
|
|
Karsten Hopp |
ea4a5a |
if (p_mh)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2008,2046 ****
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Don't use the keys when the dialog wants them. */
|
|
Karsten Hopp |
ea4a5a |
if (dialog_busy)
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText,
|
|
Karsten Hopp |
ea4a5a |
! typeUnicodeText, NULL, 0, &actualSize, NULL))
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
text = (UniChar *)alloc(actualSize);
|
|
Karsten Hopp |
ea4a5a |
if (!text)
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(theEvent, kEventParamTextInputSendText,
|
|
Karsten Hopp |
ea4a5a |
! typeUnicodeText, NULL, actualSize, NULL, text);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent,
|
|
Karsten Hopp |
ea4a5a |
! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyModifiers,
|
|
Karsten Hopp |
ea4a5a |
! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyCode,
|
|
Karsten Hopp |
ea4a5a |
! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes,
|
|
Karsten Hopp |
ea4a5a |
! typeChar, NULL, sizeof(char), NULL, &charcode);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifndef USE_CMD_KEY
|
|
Karsten Hopp |
ea4a5a |
if (modifiers & cmdKey)
|
|
Karsten Hopp |
ea4a5a |
! goto done; /* Let system handle Cmd+... */
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
key_char = charcode;
|
|
Karsten Hopp |
ea4a5a |
--- 2118,2156 ----
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Don't use the keys when the dialog wants them. */
|
|
Karsten Hopp |
ea4a5a |
if (dialog_busy)
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText,
|
|
Karsten Hopp |
ea4a5a |
! typeUnicodeText, NULL, 0, &actualSize, NULL))
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
text = (UniChar *)alloc(actualSize);
|
|
Karsten Hopp |
ea4a5a |
if (!text)
|
|
Karsten Hopp |
ea4a5a |
! return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(theEvent, kEventParamTextInputSendText,
|
|
Karsten Hopp |
ea4a5a |
! typeUnicodeText, NULL, actualSize, NULL, text);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent,
|
|
Karsten Hopp |
ea4a5a |
! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyModifiers,
|
|
Karsten Hopp |
ea4a5a |
! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyCode,
|
|
Karsten Hopp |
ea4a5a |
! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes,
|
|
Karsten Hopp |
ea4a5a |
! typeChar, NULL, sizeof(char), NULL, &charcode);
|
|
Karsten Hopp |
ea4a5a |
require_noerr(err, done);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifndef USE_CMD_KEY
|
|
Karsten Hopp |
ea4a5a |
if (modifiers & cmdKey)
|
|
Karsten Hopp |
ea4a5a |
! goto done; /* Let system handle Cmd+... */
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
key_char = charcode;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2048,2131 ****
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Find the special key (eg., for cursor keys) */
|
|
Karsten Hopp |
ea4a5a |
if (actualSize <= sizeof(UniChar) &&
|
|
Karsten Hopp |
ea4a5a |
! ((text[0] < 0x20) || (text[0] == 0x7f)))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i)
|
|
Karsten Hopp |
ea4a5a |
! if (special_keys[i].key_sym == key_sym)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! key_char = TO_SPECIAL(special_keys[i].vim_code0,
|
|
Karsten Hopp |
ea4a5a |
! special_keys[i].vim_code1);
|
|
Karsten Hopp |
ea4a5a |
! key_char = simplify_key(key_char,
|
|
Karsten Hopp |
ea4a5a |
! (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
! isSpecial = TRUE;
|
|
Karsten Hopp |
ea4a5a |
! break;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Intercept CMD-. and CTRL-c */
|
|
Karsten Hopp |
ea4a5a |
if (((modifiers & controlKey) && key_char == 'c') ||
|
|
Karsten Hopp |
ea4a5a |
! ((modifiers & cmdKey) && key_char == '.'))
|
|
Karsten Hopp |
ea4a5a |
! got_int = TRUE;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (!isSpecial)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! /* remove SHIFT for keys that are already shifted, e.g.,
|
|
Karsten Hopp |
ea4a5a |
! * '(' and '*' */
|
|
Karsten Hopp |
ea4a5a |
! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char))
|
|
Karsten Hopp |
ea4a5a |
! vimModifiers &= ~MOD_MASK_SHIFT;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* remove CTRL from keys that already have it */
|
|
Karsten Hopp |
ea4a5a |
! if (key_char < 0x20)
|
|
Karsten Hopp |
ea4a5a |
! vimModifiers &= ~MOD_MASK_CTRL;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* don't process unicode characters here */
|
|
Karsten Hopp |
ea4a5a |
! if (!IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! /* Following code to simplify and consolidate vimModifiers
|
|
Karsten Hopp |
ea4a5a |
! * taken liberally from gui_w48.c */
|
|
Karsten Hopp |
ea4a5a |
! key_char = simplify_key(key_char, (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* Interpret META, include SHIFT, etc. */
|
|
Karsten Hopp |
ea4a5a |
! key_char = extract_modifiers(key_char, (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
! if (key_char == CSI)
|
|
Karsten Hopp |
ea4a5a |
! key_char = K_CSI;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
! isSpecial = TRUE;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (vimModifiers)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = CSI;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = KS_MODIFIER;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = vimModifiers;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (isSpecial && IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = CSI;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = K_SECOND(key_char);
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = K_THIRD(key_char);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! encLen = actualSize;
|
|
Karsten Hopp |
ea4a5a |
! to = mac_utf16_to_enc(text, actualSize, &encLen);
|
|
Karsten Hopp |
ea4a5a |
! if (to)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! /* This is basically add_to_input_buf_csi() */
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = to[i];
|
|
Karsten Hopp |
ea4a5a |
! if (to[i] == CSI)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = KS_EXTRA;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = (int)KE_CSI;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! vim_free(to);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
add_to_input_buf(result, len);
|
|
Karsten Hopp |
ea4a5a |
--- 2158,2241 ----
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Find the special key (eg., for cursor keys) */
|
|
Karsten Hopp |
ea4a5a |
if (actualSize <= sizeof(UniChar) &&
|
|
Karsten Hopp |
ea4a5a |
! ((text[0] < 0x20) || (text[0] == 0x7f)))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i)
|
|
Karsten Hopp |
ea4a5a |
! if (special_keys[i].key_sym == key_sym)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! key_char = TO_SPECIAL(special_keys[i].vim_code0,
|
|
Karsten Hopp |
ea4a5a |
! special_keys[i].vim_code1);
|
|
Karsten Hopp |
ea4a5a |
! key_char = simplify_key(key_char,
|
|
Karsten Hopp |
ea4a5a |
! (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
! isSpecial = TRUE;
|
|
Karsten Hopp |
ea4a5a |
! break;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Intercept CMD-. and CTRL-c */
|
|
Karsten Hopp |
ea4a5a |
if (((modifiers & controlKey) && key_char == 'c') ||
|
|
Karsten Hopp |
ea4a5a |
! ((modifiers & cmdKey) && key_char == '.'))
|
|
Karsten Hopp |
ea4a5a |
! got_int = TRUE;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (!isSpecial)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! /* remove SHIFT for keys that are already shifted, e.g.,
|
|
Karsten Hopp |
ea4a5a |
! * '(' and '*' */
|
|
Karsten Hopp |
ea4a5a |
! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char))
|
|
Karsten Hopp |
ea4a5a |
! vimModifiers &= ~MOD_MASK_SHIFT;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* remove CTRL from keys that already have it */
|
|
Karsten Hopp |
ea4a5a |
! if (key_char < 0x20)
|
|
Karsten Hopp |
ea4a5a |
! vimModifiers &= ~MOD_MASK_CTRL;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* don't process unicode characters here */
|
|
Karsten Hopp |
ea4a5a |
! if (!IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! /* Following code to simplify and consolidate vimModifiers
|
|
Karsten Hopp |
ea4a5a |
! * taken liberally from gui_w48.c */
|
|
Karsten Hopp |
ea4a5a |
! key_char = simplify_key(key_char, (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* Interpret META, include SHIFT, etc. */
|
|
Karsten Hopp |
ea4a5a |
! key_char = extract_modifiers(key_char, (int *)&vimModifiers);
|
|
Karsten Hopp |
ea4a5a |
! if (key_char == CSI)
|
|
Karsten Hopp |
ea4a5a |
! key_char = K_CSI;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
! isSpecial = TRUE;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (vimModifiers)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = CSI;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = KS_MODIFIER;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = vimModifiers;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (isSpecial && IS_SPECIAL(key_char))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = CSI;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = K_SECOND(key_char);
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = K_THIRD(key_char);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! encLen = actualSize;
|
|
Karsten Hopp |
ea4a5a |
! to = mac_utf16_to_enc(text, actualSize, &encLen);
|
|
Karsten Hopp |
ea4a5a |
! if (to)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! /* This is basically add_to_input_buf_csi() */
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = to[i];
|
|
Karsten Hopp |
ea4a5a |
! if (to[i] == CSI)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = KS_EXTRA;
|
|
Karsten Hopp |
ea4a5a |
! result[len++] = (int)KE_CSI;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! vim_free(to);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
add_to_input_buf(result, len);
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2135,2144 ****
|
|
Karsten Hopp |
ea4a5a |
vim_free(text);
|
|
Karsten Hopp |
ea4a5a |
if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! /* Fake event to wake up WNE (required to get
|
|
Karsten Hopp |
ea4a5a |
! * key repeat working */
|
|
Karsten Hopp |
ea4a5a |
! PostEvent(keyUp, 0);
|
|
Karsten Hopp |
ea4a5a |
! return noErr;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
--- 2245,2254 ----
|
|
Karsten Hopp |
ea4a5a |
vim_free(text);
|
|
Karsten Hopp |
ea4a5a |
if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! /* Fake event to wake up WNE (required to get
|
|
Karsten Hopp |
ea4a5a |
! * key repeat working */
|
|
Karsten Hopp |
ea4a5a |
! PostEvent(keyUp, 0);
|
|
Karsten Hopp |
ea4a5a |
! return noErr;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
return eventNotHandledErr;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2334,2340 ****
|
|
Karsten Hopp |
ea4a5a |
/* prevent that the vim window size changes if it's activated by a
|
|
Karsten Hopp |
ea4a5a |
click into the tab pane */
|
|
Karsten Hopp |
ea4a5a |
if (whichWindow == drawer)
|
|
Karsten Hopp |
ea4a5a |
! return;
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
switch (thePart)
|
|
Karsten Hopp |
ea4a5a |
--- 2444,2450 ----
|
|
Karsten Hopp |
ea4a5a |
/* prevent that the vim window size changes if it's activated by a
|
|
Karsten Hopp |
ea4a5a |
click into the tab pane */
|
|
Karsten Hopp |
ea4a5a |
if (whichWindow == drawer)
|
|
Karsten Hopp |
ea4a5a |
! return;
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
switch (thePart)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2569,2579 ****
|
|
Karsten Hopp |
ea4a5a |
if (IsShowContextualMenuClick(event))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
# if 0
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_handle_contextual_menu(event);
|
|
Karsten Hopp |
ea4a5a |
# else
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_doMouseDownEvent(event);
|
|
Karsten Hopp |
ea4a5a |
# endif
|
|
Karsten Hopp |
ea4a5a |
! return;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Handle normal event */
|
|
Karsten Hopp |
ea4a5a |
--- 2679,2689 ----
|
|
Karsten Hopp |
ea4a5a |
if (IsShowContextualMenuClick(event))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
# if 0
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_handle_contextual_menu(event);
|
|
Karsten Hopp |
ea4a5a |
# else
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_doMouseDownEvent(event);
|
|
Karsten Hopp |
ea4a5a |
# endif
|
|
Karsten Hopp |
ea4a5a |
! return;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Handle normal event */
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2832,2838 ****
|
|
Karsten Hopp |
ea4a5a |
# else
|
|
Karsten Hopp |
ea4a5a |
/* OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr)
|
|
Karsten Hopp |
ea4a5a |
* of TN2015
|
|
Karsten Hopp |
ea4a5a |
- * This technic remove the ../Contents/MacOS/etc part
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
(void)GetCurrentProcess(&psn;;
|
|
Karsten Hopp |
ea4a5a |
/* if (err != noErr) return err; */
|
|
Karsten Hopp |
ea4a5a |
--- 2942,2947 ----
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 2933,2942 ****
|
|
Karsten Hopp |
ea4a5a |
/* TODO: Move most of this stuff toward gui_mch_init */
|
|
Karsten Hopp |
ea4a5a |
Rect windRect;
|
|
Karsten Hopp |
ea4a5a |
MenuHandle pomme;
|
|
Karsten Hopp |
ea4a5a |
- EventTypeSpec eventTypeSpec;
|
|
Karsten Hopp |
ea4a5a |
EventHandlerRef mouseWheelHandlerRef;
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
! EventHandlerRef keyEventHandlerRef;
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
ControlRef rootControl;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
--- 3042,3050 ----
|
|
Karsten Hopp |
ea4a5a |
/* TODO: Move most of this stuff toward gui_mch_init */
|
|
Karsten Hopp |
ea4a5a |
Rect windRect;
|
|
Karsten Hopp |
ea4a5a |
MenuHandle pomme;
|
|
Karsten Hopp |
ea4a5a |
EventHandlerRef mouseWheelHandlerRef;
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
! EventTypeSpec eventTypeSpec;
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
ControlRef rootControl;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3042,3057 ****
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
! eventTypeSpec.eventClass = kEventClassTextInput;
|
|
Karsten Hopp |
ea4a5a |
! eventTypeSpec.eventKind = kEventUnicodeForKeyEvent;
|
|
Karsten Hopp |
ea4a5a |
! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_doKeyEventCarbon);
|
|
Karsten Hopp |
ea4a5a |
! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP, 1,
|
|
Karsten Hopp |
ea4a5a |
! &eventTypeSpec, NULL, &keyEventHandlerRef))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
- keyEventHandlerRef = NULL;
|
|
Karsten Hopp |
ea4a5a |
DisposeEventHandlerUPP(keyEventHandlerUPP);
|
|
Karsten Hopp |
ea4a5a |
keyEventHandlerUPP = NULL;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
--- 3150,3196 ----
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
! InterfaceTypeList supportedServices = { kUnicodeDocument };
|
|
Karsten Hopp |
ea4a5a |
! NewTSMDocument(1, supportedServices, &gTSMDocument, 0);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* We don't support inline input yet, use input window by default */
|
|
Karsten Hopp |
ea4a5a |
! UseInputWindow(gTSMDocument, TRUE);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* Should we activate the document by default? */
|
|
Karsten Hopp |
ea4a5a |
! // ActivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! EventTypeSpec textEventTypes[] = {
|
|
Karsten Hopp |
ea4a5a |
! { kEventClassTextInput, kEventTextInputUpdateActiveInputArea },
|
|
Karsten Hopp |
ea4a5a |
! { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent },
|
|
Karsten Hopp |
ea4a5a |
! { kEventClassTextInput, kEventTextInputPosToOffset },
|
|
Karsten Hopp |
ea4a5a |
! { kEventClassTextInput, kEventTextInputOffsetToPos },
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_text_input);
|
|
Karsten Hopp |
ea4a5a |
! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP,
|
|
Karsten Hopp |
ea4a5a |
! NR_ELEMS(textEventTypes),
|
|
Karsten Hopp |
ea4a5a |
! textEventTypes, NULL, NULL))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
DisposeEventHandlerUPP(keyEventHandlerUPP);
|
|
Karsten Hopp |
ea4a5a |
keyEventHandlerUPP = NULL;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ EventTypeSpec windowEventTypes[] = {
|
|
Karsten Hopp |
ea4a5a |
+ { kEventClassWindow, kEventWindowActivated },
|
|
Karsten Hopp |
ea4a5a |
+ { kEventClassWindow, kEventWindowDeactivated },
|
|
Karsten Hopp |
ea4a5a |
+ };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ /* Install window event handler to support TSMDocument activate and
|
|
Karsten Hopp |
ea4a5a |
+ * deactivate */
|
|
Karsten Hopp |
ea4a5a |
+ winEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_window_activate);
|
|
Karsten Hopp |
ea4a5a |
+ if (noErr != InstallWindowEventHandler(gui.VimWindow,
|
|
Karsten Hopp |
ea4a5a |
+ winEventHandlerUPP,
|
|
Karsten Hopp |
ea4a5a |
+ NR_ELEMS(windowEventTypes),
|
|
Karsten Hopp |
ea4a5a |
+ windowEventTypes, NULL, NULL))
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ DisposeEventHandlerUPP(winEventHandlerUPP);
|
|
Karsten Hopp |
ea4a5a |
+ winEventHandlerUPP = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3107,3112 ****
|
|
Karsten Hopp |
ea4a5a |
--- 3246,3264 ----
|
|
Karsten Hopp |
ea4a5a |
return OK;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
+ static void
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_dispose_atsui_style(void)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDisposeStyle(gFontStyle);
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
ea4a5a |
+ if (p_macatsui && gWideFontStyle)
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDisposeStyle(gWideFontStyle);
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
void
|
|
Karsten Hopp |
ea4a5a |
gui_mch_exit(int rc)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3122,3129 ****
|
|
Karsten Hopp |
ea4a5a |
DisposeEventHandlerUPP(mouseWheelHandlerUPP);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
! if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
! ATSUDisposeStyle(gFontStyle);
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Exit to shell? */
|
|
Karsten Hopp |
ea4a5a |
--- 3274,3286 ----
|
|
Karsten Hopp |
ea4a5a |
DisposeEventHandlerUPP(mouseWheelHandlerUPP);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_dispose_atsui_style();
|
|
Karsten Hopp |
ea4a5a |
! #endif
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! #ifdef USE_CARBONKEYHANDLER
|
|
Karsten Hopp |
ea4a5a |
! FixTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
! DeactivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
! DeleteTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* Exit to shell? */
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3263,3268 ****
|
|
Karsten Hopp |
ea4a5a |
--- 3420,3445 ----
|
|
Karsten Hopp |
ea4a5a |
return selected_font;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
+ static void
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_create_atsui_style(void)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ if (p_macatsui && gFontStyle == NULL)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ if (ATSUCreateStyle(&gFontStyle) != noErr)
|
|
Karsten Hopp |
ea4a5a |
+ gFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
ea4a5a |
+ if (p_macatsui && gWideFontStyle == NULL)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ if (ATSUCreateStyle(&gWideFontStyle) != noErr)
|
|
Karsten Hopp |
ea4a5a |
+ gWideFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ p_macatsui_last = p_macatsui;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Initialise vim to use the font with the given name. Return FAIL if the font
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3280,3290 ****
|
|
Karsten Hopp |
ea4a5a |
char_u used_font_name[512];
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
! if (p_macatsui && gFontStyle == NULL)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUCreateStyle(&gFontStyle) != noErr)
|
|
Karsten Hopp |
ea4a5a |
! gFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (font_name == NULL)
|
|
Karsten Hopp |
ea4a5a |
--- 3457,3463 ----
|
|
Karsten Hopp |
ea4a5a |
char_u used_font_name[512];
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_create_atsui_style();
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (font_name == NULL)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3348,3396 ****
|
|
Karsten Hopp |
ea4a5a |
gui.char_height = font_info.ascent + font_info.descent + p_linespace;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
- ATSUFontID fontID;
|
|
Karsten Hopp |
ea4a5a |
- Fixed fontSize;
|
|
Karsten Hopp |
ea4a5a |
- ATSStyleRenderingOptions fontOptions;
|
|
Karsten Hopp |
ea4a5a |
-
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! fontID = font & 0xFFFF;
|
|
Karsten Hopp |
ea4a5a |
! fontSize = Long2Fix(font >> 16);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* No antialiasing by default (do not attempt to touch antialising
|
|
Karsten Hopp |
ea4a5a |
! * options on pre-Jaguar) */
|
|
Karsten Hopp |
ea4a5a |
! fontOptions =
|
|
Karsten Hopp |
ea4a5a |
! (gMacSystemVersion >= 0x1020) ?
|
|
Karsten Hopp |
ea4a5a |
! kATSStyleNoAntiAliasing :
|
|
Karsten Hopp |
ea4a5a |
! kATSStyleNoOptions;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeTag attribTags[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag,
|
|
Karsten Hopp |
ea4a5a |
! kATSUMaxATSUITagValue+1
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
! ByteCount attribSizes[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! sizeof(ATSUFontID), sizeof(Fixed),
|
|
Karsten Hopp |
ea4a5a |
! sizeof(ATSStyleRenderingOptions), sizeof font
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeValuePtr attribValues[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! &fontID, &fontSize, &fontOptions, &font
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* Convert font id to ATSUFontID */
|
|
Karsten Hopp |
ea4a5a |
! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUSetAttributes(gFontStyle,
|
|
Karsten Hopp |
ea4a5a |
! (sizeof attribTags)/sizeof(ATSUAttributeTag),
|
|
Karsten Hopp |
ea4a5a |
! attribTags, attribSizes, attribValues) != noErr)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! ATSUDisposeStyle(gFontStyle);
|
|
Karsten Hopp |
ea4a5a |
! gFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
return OK;
|
|
Karsten Hopp |
ea4a5a |
--- 3521,3528 ----
|
|
Karsten Hopp |
ea4a5a |
gui.char_height = font_info.ascent + font_info.descent + p_linespace;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_set_font_attributes(font);
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
return OK;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3447,3452 ****
|
|
Karsten Hopp |
ea4a5a |
--- 3579,3646 ----
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
+ static void
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_set_font_attributes(GuiFont font)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ ATSUFontID fontID;
|
|
Karsten Hopp |
ea4a5a |
+ Fixed fontSize;
|
|
Karsten Hopp |
ea4a5a |
+ Fixed fontWidth;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ fontID = font & 0xFFFF;
|
|
Karsten Hopp |
ea4a5a |
+ fontSize = Long2Fix(font >> 16);
|
|
Karsten Hopp |
ea4a5a |
+ fontWidth = Long2Fix(gui.char_width);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUAttributeTag attribTags[] =
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ kATSUFontTag, kATSUSizeTag, kATSUImposeWidthTag,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUMaxATSUITagValue + 1
|
|
Karsten Hopp |
ea4a5a |
+ };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ByteCount attribSizes[] =
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ sizeof(ATSUFontID), sizeof(Fixed), sizeof(fontWidth),
|
|
Karsten Hopp |
ea4a5a |
+ sizeof(font)
|
|
Karsten Hopp |
ea4a5a |
+ };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUAttributeValuePtr attribValues[] =
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ &fontID, &fontSize, &fontWidth, &font
|
|
Karsten Hopp |
ea4a5a |
+ };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ if (ATSUSetAttributes(gFontStyle,
|
|
Karsten Hopp |
ea4a5a |
+ (sizeof attribTags) / sizeof(ATSUAttributeTag),
|
|
Karsten Hopp |
ea4a5a |
+ attribTags, attribSizes, attribValues) != noErr)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ # ifndef NDEBUG
|
|
Karsten Hopp |
ea4a5a |
+ fprintf(stderr, "couldn't set font style\n");
|
|
Karsten Hopp |
ea4a5a |
+ # endif
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDisposeStyle(gFontStyle);
|
|
Karsten Hopp |
ea4a5a |
+ gFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
ea4a5a |
+ if (has_mbyte)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ /* FIXME: we should use a more mbyte sensitive way to support
|
|
Karsten Hopp |
ea4a5a |
+ * wide font drawing */
|
|
Karsten Hopp |
ea4a5a |
+ fontWidth = Long2Fix(gui.char_width * 2);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (ATSUSetAttributes(gWideFontStyle,
|
|
Karsten Hopp |
ea4a5a |
+ (sizeof attribTags) / sizeof(ATSUAttributeTag),
|
|
Karsten Hopp |
ea4a5a |
+ attribTags, attribSizes, attribValues) != noErr)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDisposeStyle(gWideFontStyle);
|
|
Karsten Hopp |
ea4a5a |
+ gWideFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Set the current text font.
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3456,3518 ****
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
GuiFont currFont;
|
|
Karsten Hopp |
ea4a5a |
ByteCount actualFontByteCount;
|
|
Karsten Hopp |
ea4a5a |
- ATSUFontID fontID;
|
|
Karsten Hopp |
ea4a5a |
- Fixed fontSize;
|
|
Karsten Hopp |
ea4a5a |
- ATSStyleRenderingOptions fontOptions;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
/* Avoid setting same font again */
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue+1, sizeof font,
|
|
Karsten Hopp |
ea4a5a |
! &currFont, &actualFontByteCount) == noErr &&
|
|
Karsten Hopp |
ea4a5a |
! actualFontByteCount == (sizeof font))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (currFont == font)
|
|
Karsten Hopp |
ea4a5a |
return;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! fontID = font & 0xFFFF;
|
|
Karsten Hopp |
ea4a5a |
! fontSize = Long2Fix(font >> 16);
|
|
Karsten Hopp |
ea4a5a |
! /* Respect p_antialias setting only for wide font.
|
|
Karsten Hopp |
ea4a5a |
! * The reason for doing this at the moment is a bit complicated,
|
|
Karsten Hopp |
ea4a5a |
! * but it's mainly because a) latin (non-wide) aliased fonts
|
|
Karsten Hopp |
ea4a5a |
! * look bad in OS X 10.3.x and below (due to a bug in ATS), and
|
|
Karsten Hopp |
ea4a5a |
! * b) wide multibyte input does not suffer from that problem. */
|
|
Karsten Hopp |
ea4a5a |
! /*fontOptions =
|
|
Karsten Hopp |
ea4a5a |
! (p_antialias && (font == gui.wide_font)) ?
|
|
Karsten Hopp |
ea4a5a |
! kATSStyleNoOptions : kATSStyleNoAntiAliasing;
|
|
Karsten Hopp |
ea4a5a |
! */
|
|
Karsten Hopp |
ea4a5a |
! /*fontOptions = kATSStyleAntiAliasing;*/
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeTag attribTags[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag,
|
|
Karsten Hopp |
ea4a5a |
! kATSUMaxATSUITagValue+1
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
! ByteCount attribSizes[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! sizeof(ATSUFontID), sizeof(Fixed),
|
|
Karsten Hopp |
ea4a5a |
! sizeof(ATSStyleRenderingOptions), sizeof font
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeValuePtr attribValues[] =
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! &fontID, &fontSize, &fontOptions, &font
|
|
Karsten Hopp |
ea4a5a |
! };
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUSetAttributes(gFontStyle,
|
|
Karsten Hopp |
ea4a5a |
! (sizeof attribTags)/sizeof(ATSUAttributeTag),
|
|
Karsten Hopp |
ea4a5a |
! attribTags, attribSizes, attribValues) != noErr)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! # ifndef NDEBUG
|
|
Karsten Hopp |
ea4a5a |
! fprintf(stderr, "couldn't set font style\n");
|
|
Karsten Hopp |
ea4a5a |
! # endif
|
|
Karsten Hopp |
ea4a5a |
! ATSUDisposeStyle(gFontStyle);
|
|
Karsten Hopp |
ea4a5a |
! gFontStyle = NULL;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && !gIsFontFallbackSet)
|
|
Karsten Hopp |
ea4a5a |
--- 3650,3668 ----
|
|
Karsten Hopp |
ea4a5a |
#ifdef USE_ATSUI_DRAWING
|
|
Karsten Hopp |
ea4a5a |
GuiFont currFont;
|
|
Karsten Hopp |
ea4a5a |
ByteCount actualFontByteCount;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && gFontStyle)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
/* Avoid setting same font again */
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue + 1,
|
|
Karsten Hopp |
ea4a5a |
! sizeof(font), &currFont, &actualFontByteCount) == noErr
|
|
Karsten Hopp |
ea4a5a |
! && actualFontByteCount == (sizeof font))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (currFont == font)
|
|
Karsten Hopp |
ea4a5a |
return;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_set_font_attributes(font);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui && !gIsFontFallbackSet)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3536,3542 ****
|
|
Karsten Hopp |
ea4a5a |
&fallbackFonts,
|
|
Karsten Hopp |
ea4a5a |
NULL) == noErr)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID), &fallbackFonts, kATSUSequentialFallbacksPreferred);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
ATSUAttributeValuePtr fallbackValues[] = { };
|
|
Karsten Hopp |
ea4a5a |
--- 3686,3694 ----
|
|
Karsten Hopp |
ea4a5a |
&fallbackFonts,
|
|
Karsten Hopp |
ea4a5a |
NULL) == noErr)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID),
|
|
Karsten Hopp |
ea4a5a |
! &fallbackFonts,
|
|
Karsten Hopp |
ea4a5a |
! kATSUSequentialFallbacksPreferred);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
ATSUAttributeValuePtr fallbackValues[] = { };
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3921,3927 ****
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* - ATSUI automatically antialiases text (Someone)
|
|
Karsten Hopp |
ea4a5a |
* - for some reason it does not work... (Jussi) */
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* When antialiasing we're using srcOr mode, we have to clear the block
|
|
Karsten Hopp |
ea4a5a |
* before drawing the text.
|
|
Karsten Hopp |
ea4a5a |
--- 4073,4082 ----
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/* - ATSUI automatically antialiases text (Someone)
|
|
Karsten Hopp |
ea4a5a |
* - for some reason it does not work... (Jussi) */
|
|
Karsten Hopp |
ea4a5a |
! #ifdef MAC_ATSUI_DEBUG
|
|
Karsten Hopp |
ea4a5a |
! fprintf(stderr, "row = %d, col = %d, len = %d: '%c'\n",
|
|
Karsten Hopp |
ea4a5a |
! row, col, len, len == 1 ? s[0] : ' ');
|
|
Karsten Hopp |
ea4a5a |
! #endif
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* When antialiasing we're using srcOr mode, we have to clear the block
|
|
Karsten Hopp |
ea4a5a |
* before drawing the text.
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3956,3990 ****
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
- /* Use old-style, non-antialiased QuickDraw text rendering. */
|
|
Karsten Hopp |
ea4a5a |
TextMode(srcCopy);
|
|
Karsten Hopp |
ea4a5a |
TextFace(normal);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! /* SelectFont(hdc, gui.currFont); */
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
if (flags & DRAW_TRANSP)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
TextMode(srcOr);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
MoveTo(TEXT_X(col), TEXT_Y(row));
|
|
Karsten Hopp |
ea4a5a |
- ATSUTextLayout textLayout;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! if (ATSUCreateTextLayoutWithTextPtr(tofree,
|
|
Karsten Hopp |
ea4a5a |
! kATSUFromTextBeginning, kATSUToTextEnd,
|
|
Karsten Hopp |
ea4a5a |
! utf16_len,
|
|
Karsten Hopp |
ea4a5a |
! (gFontStyle ? 1 : 0), &utf16_len,
|
|
Karsten Hopp |
ea4a5a |
! (gFontStyle ? &gFontStyle : NULL),
|
|
Karsten Hopp |
ea4a5a |
! &textLayout) == noErr)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetTransientFontMatching(textLayout, TRUE);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! ATSUDrawText(textLayout,
|
|
Karsten Hopp |
ea4a5a |
! kATSUFromTextBeginning, kATSUToTextEnd,
|
|
Karsten Hopp |
ea4a5a |
! kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
ATSUDisposeTextLayout(textLayout);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (flags & DRAW_UNDERC)
|
|
Karsten Hopp |
ea4a5a |
--- 4111,4232 ----
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
TextMode(srcCopy);
|
|
Karsten Hopp |
ea4a5a |
TextFace(normal);
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! /* SelectFont(hdc, gui.currFont); */
|
|
Karsten Hopp |
ea4a5a |
if (flags & DRAW_TRANSP)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
TextMode(srcOr);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
MoveTo(TEXT_X(col), TEXT_Y(row));
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! if (gFontStyle && flags & DRAW_BOLD)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! Boolean attValue = true;
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag };
|
|
Karsten Hopp |
ea4a5a |
! ByteCount attribSizes[] = { sizeof(Boolean) };
|
|
Karsten Hopp |
ea4a5a |
! ATSUAttributeValuePtr attribValues[] = { &attValue };
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes, attribValues);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! #ifdef FEAT_MBYTE
|
|
Karsten Hopp |
ea4a5a |
! if (has_mbyte)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! int n, width_in_cell, last_width_in_cell;
|
|
Karsten Hopp |
ea4a5a |
! UniCharArrayOffset offset = 0;
|
|
Karsten Hopp |
ea4a5a |
! UniCharCount yet_to_draw = 0;
|
|
Karsten Hopp |
ea4a5a |
! ATSUTextLayout textLayout;
|
|
Karsten Hopp |
ea4a5a |
! ATSUStyle textStyle;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! last_width_in_cell = 1;
|
|
Karsten Hopp |
ea4a5a |
! ATSUCreateTextLayout(&textLayout);
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetTextPointerLocation(textLayout, tofree,
|
|
Karsten Hopp |
ea4a5a |
! kATSUFromTextBeginning,
|
|
Karsten Hopp |
ea4a5a |
! kATSUToTextEnd, utf16_len);
|
|
Karsten Hopp |
ea4a5a |
! /*
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetRunStyle(textLayout, gFontStyle,
|
|
Karsten Hopp |
ea4a5a |
! kATSUFromTextBeginning, kATSUToTextEnd); */
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* Compute the length in display cells. */
|
|
Karsten Hopp |
ea4a5a |
! for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! width_in_cell = (*mb_ptr2cells)(s + n);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* probably we are switching from single byte character
|
|
Karsten Hopp |
ea4a5a |
! * to multibyte characters (which requires more than one
|
|
Karsten Hopp |
ea4a5a |
! * cell to draw) */
|
|
Karsten Hopp |
ea4a5a |
! if (width_in_cell != last_width_in_cell)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! #ifdef MAC_ATSUI_DEBUG
|
|
Karsten Hopp |
ea4a5a |
! fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n",
|
|
Karsten Hopp |
ea4a5a |
! n, last_width_in_cell, width_in_cell, offset, yet_to_draw);
|
|
Karsten Hopp |
ea4a5a |
! #endif
|
|
Karsten Hopp |
ea4a5a |
! textStyle = last_width_in_cell > 1 ? gWideFontStyle
|
|
Karsten Hopp |
ea4a5a |
! : gFontStyle;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! ATSUSetRunStyle(textLayout, textStyle, offset, yet_to_draw);
|
|
Karsten Hopp |
ea4a5a |
! offset += yet_to_draw;
|
|
Karsten Hopp |
ea4a5a |
! yet_to_draw = 0;
|
|
Karsten Hopp |
ea4a5a |
! last_width_in_cell = width_in_cell;
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
+ yet_to_draw++;
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (yet_to_draw)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ #ifdef MAC_ATSUI_DEBUG
|
|
Karsten Hopp |
ea4a5a |
+ fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n",
|
|
Karsten Hopp |
ea4a5a |
+ n, last_width_in_cell, width_in_cell, offset, yet_to_draw);
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ /* finish the rest style */
|
|
Karsten Hopp |
ea4a5a |
+ textStyle = width_in_cell > 1 ? gWideFontStyle : gFontStyle;
|
|
Karsten Hopp |
ea4a5a |
+ ATSUSetRunStyle(textLayout, textStyle, offset, kATSUToTextEnd);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUSetTransientFontMatching(textLayout, TRUE);
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDrawText(textLayout,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUFromTextBeginning, kATSUToTextEnd,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
|
|
Karsten Hopp |
ea4a5a |
ATSUDisposeTextLayout(textLayout);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
+ else
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ ATSUTextLayout textLayout;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (ATSUCreateTextLayoutWithTextPtr(tofree,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUFromTextBeginning, kATSUToTextEnd,
|
|
Karsten Hopp |
ea4a5a |
+ utf16_len,
|
|
Karsten Hopp |
ea4a5a |
+ (gFontStyle ? 1 : 0), &utf16_len,
|
|
Karsten Hopp |
ea4a5a |
+ (gFontStyle ? &gFontStyle : NULL),
|
|
Karsten Hopp |
ea4a5a |
+ &textLayout) == noErr)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ ATSUSetTransientFontMatching(textLayout, TRUE);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDrawText(textLayout,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUFromTextBeginning, kATSUToTextEnd,
|
|
Karsten Hopp |
ea4a5a |
+ kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUDisposeTextLayout(textLayout);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ /* drawing is done, now reset bold to normal */
|
|
Karsten Hopp |
ea4a5a |
+ if (gFontStyle && flags & DRAW_BOLD)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ Boolean attValue = false;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag };
|
|
Karsten Hopp |
ea4a5a |
+ ByteCount attribSizes[] = { sizeof(Boolean) };
|
|
Karsten Hopp |
ea4a5a |
+ ATSUAttributeValuePtr attribValues[] = { &attValue };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes,
|
|
Karsten Hopp |
ea4a5a |
+ attribValues);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
if (flags & DRAW_UNDERC)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 3998,4003 ****
|
|
Karsten Hopp |
ea4a5a |
--- 4240,4252 ----
|
|
Karsten Hopp |
ea4a5a |
gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
#if defined(USE_ATSUI_DRAWING)
|
|
Karsten Hopp |
ea4a5a |
+ if (p_macatsui == 0 && p_macatsui_last != 0)
|
|
Karsten Hopp |
ea4a5a |
+ /* switch from macatsui to nomacatsui */
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_dispose_atsui_style();
|
|
Karsten Hopp |
ea4a5a |
+ else if (p_macatsui != 0 && p_macatsui_last == 0)
|
|
Karsten Hopp |
ea4a5a |
+ /* switch from nomacatsui to macatsui */
|
|
Karsten Hopp |
ea4a5a |
+ gui_mac_create_atsui_style();
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
if (p_macatsui)
|
|
Karsten Hopp |
ea4a5a |
draw_string_ATSUI(row, col, s, len, flags);
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 4228,4239 ****
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
/* TODO: reduce wtime accordinly??? */
|
|
Karsten Hopp |
ea4a5a |
if (wtime > -1)
|
|
Karsten Hopp |
ea4a5a |
! sleeppyTick = 60*wtime/1000;
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
sleeppyTick = 32767;
|
|
Karsten Hopp |
ea4a5a |
if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_handle_event(&event);
|
|
Karsten Hopp |
ea4a5a |
if (input_available())
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
allow_scrollbar = FALSE;
|
|
Karsten Hopp |
ea4a5a |
--- 4477,4489 ----
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
/* TODO: reduce wtime accordinly??? */
|
|
Karsten Hopp |
ea4a5a |
if (wtime > -1)
|
|
Karsten Hopp |
ea4a5a |
! sleeppyTick = 60 * wtime / 1000;
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
sleeppyTick = 32767;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn))
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! gui_mac_handle_event(&event);
|
|
Karsten Hopp |
ea4a5a |
if (input_available())
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
allow_scrollbar = FALSE;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6031,6037 ****
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! #if defined(USE_IM_CONTROL) || defined(PROTO)
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Input Method Control functions.
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
--- 6346,6352 ----
|
|
Karsten Hopp |
ea4a5a |
#endif
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! #if (defined(USE_IM_CONTROL) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
* Input Method Control functions.
|
|
Karsten Hopp |
ea4a5a |
*/
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6042,6048 ****
|
|
Karsten Hopp |
ea4a5a |
--- 6357,6427 ----
|
|
Karsten Hopp |
ea4a5a |
void
|
|
Karsten Hopp |
ea4a5a |
im_set_position(int row, int col)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
+ #if 0
|
|
Karsten Hopp |
ea4a5a |
/* TODO: Implement me! */
|
|
Karsten Hopp |
ea4a5a |
+ im_start_row = row;
|
|
Karsten Hopp |
ea4a5a |
+ im_start_col = col;
|
|
Karsten Hopp |
ea4a5a |
+ #endif
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static ScriptLanguageRecord gTSLWindow;
|
|
Karsten Hopp |
ea4a5a |
+ static ScriptLanguageRecord gTSLInsert;
|
|
Karsten Hopp |
ea4a5a |
+ static ScriptLanguageRecord gTSLDefault = { 0, 0 };
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static Component gTSCWindow;
|
|
Karsten Hopp |
ea4a5a |
+ static Component gTSCInsert;
|
|
Karsten Hopp |
ea4a5a |
+ static Component gTSCDefault;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static int im_initialized = 0;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ static void
|
|
Karsten Hopp |
ea4a5a |
+ im_on_window_switch(int active)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ ScriptLanguageRecord *slptr = NULL;
|
|
Karsten Hopp |
ea4a5a |
+ OSStatus err;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (! gui.in_use)
|
|
Karsten Hopp |
ea4a5a |
+ return;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (im_initialized == 0)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ im_initialized = 1;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ /* save default TSM component (should be U.S.) to default */
|
|
Karsten Hopp |
ea4a5a |
+ GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
|
|
Karsten Hopp |
ea4a5a |
+ kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (active == TRUE)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ im_is_active = TRUE;
|
|
Karsten Hopp |
ea4a5a |
+ ActivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
+ slptr = &gTSLWindow;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (slptr)
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ err = SetDefaultInputMethodOfClass(gTSCWindow, slptr,
|
|
Karsten Hopp |
ea4a5a |
+ kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
+ if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
+ err = SetTextServiceLanguage(slptr);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
+ KeyScript(slptr->fScript | smKeyForceKeyScriptMask);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
+ else
|
|
Karsten Hopp |
ea4a5a |
+ {
|
|
Karsten Hopp |
ea4a5a |
+ err = GetTextServiceLanguage(&gTSLWindow);
|
|
Karsten Hopp |
ea4a5a |
+ if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
+ slptr = &gTSLWindow;
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ if (slptr)
|
|
Karsten Hopp |
ea4a5a |
+ GetDefaultInputMethodOfClass(&gTSCWindow, slptr,
|
|
Karsten Hopp |
ea4a5a |
+ kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
+
|
|
Karsten Hopp |
ea4a5a |
+ im_is_active = FALSE;
|
|
Karsten Hopp |
ea4a5a |
+ DeactivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
+ }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6051,6057 ****
|
|
Karsten Hopp |
ea4a5a |
void
|
|
Karsten Hopp |
ea4a5a |
im_set_active(int active)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! KeyScript(active ? smKeySysScript : smKeyRoman);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
--- 6430,6486 ----
|
|
Karsten Hopp |
ea4a5a |
void
|
|
Karsten Hopp |
ea4a5a |
im_set_active(int active)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! ScriptLanguageRecord *slptr = NULL;
|
|
Karsten Hopp |
ea4a5a |
! OSStatus err;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (! gui.in_use)
|
|
Karsten Hopp |
ea4a5a |
! return;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (im_initialized == 0)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! im_initialized = 1;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* save default TSM component (should be U.S.) to default */
|
|
Karsten Hopp |
ea4a5a |
! GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
|
|
Karsten Hopp |
ea4a5a |
! kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (active == TRUE)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! im_is_active = TRUE;
|
|
Karsten Hopp |
ea4a5a |
! ActivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
! slptr = &gTSLInsert;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (slptr)
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! err = SetDefaultInputMethodOfClass(gTSCInsert, slptr,
|
|
Karsten Hopp |
ea4a5a |
! kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
! if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
! err = SetTextServiceLanguage(slptr);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
! KeyScript(slptr->fScript | smKeyForceKeyScriptMask);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
! else
|
|
Karsten Hopp |
ea4a5a |
! {
|
|
Karsten Hopp |
ea4a5a |
! err = GetTextServiceLanguage(&gTSLInsert);
|
|
Karsten Hopp |
ea4a5a |
! if (err == noErr)
|
|
Karsten Hopp |
ea4a5a |
! slptr = &gTSLInsert;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! if (slptr)
|
|
Karsten Hopp |
ea4a5a |
! GetDefaultInputMethodOfClass(&gTSCInsert, slptr,
|
|
Karsten Hopp |
ea4a5a |
! kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! /* restore to default when switch to normal mode, so than we could
|
|
Karsten Hopp |
ea4a5a |
! * enter commands easier */
|
|
Karsten Hopp |
ea4a5a |
! SetDefaultInputMethodOfClass(gTSCDefault, &gTSLDefault,
|
|
Karsten Hopp |
ea4a5a |
! kKeyboardInputMethodClass);
|
|
Karsten Hopp |
ea4a5a |
! SetTextServiceLanguage(&gTSLDefault);
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! im_is_active = FALSE;
|
|
Karsten Hopp |
ea4a5a |
! DeactivateTSMDocument(gTSMDocument);
|
|
Karsten Hopp |
ea4a5a |
! }
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6060,6068 ****
|
|
Karsten Hopp |
ea4a5a |
int
|
|
Karsten Hopp |
ea4a5a |
im_get_status(void)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! SInt32 script = GetScriptManagerVariable(smKeyScript);
|
|
Karsten Hopp |
ea4a5a |
! return (script != smRoman
|
|
Karsten Hopp |
ea4a5a |
! && script == GetScriptManagerVariable(smSysScript)) ? 1 : 0;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
|
|
Karsten Hopp |
ea4a5a |
--- 6489,6498 ----
|
|
Karsten Hopp |
ea4a5a |
int
|
|
Karsten Hopp |
ea4a5a |
im_get_status(void)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! if (! gui.in_use)
|
|
Karsten Hopp |
ea4a5a |
! return 0;
|
|
Karsten Hopp |
ea4a5a |
!
|
|
Karsten Hopp |
ea4a5a |
! return im_is_active;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
#endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6118,6124 ****
|
|
Karsten Hopp |
ea4a5a |
int numTabs = 0;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
|
Karsten Hopp |
ea4a5a |
! ++numTabs;
|
|
Karsten Hopp |
ea4a5a |
return numTabs;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
--- 6548,6554 ----
|
|
Karsten Hopp |
ea4a5a |
int numTabs = 0;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
|
Karsten Hopp |
ea4a5a |
! ++numTabs;
|
|
Karsten Hopp |
ea4a5a |
return numTabs;
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6126,6133 ****
|
|
Karsten Hopp |
ea4a5a |
static OSStatus
|
|
Karsten Hopp |
ea4a5a |
dbItemDataCallback(ControlRef browser,
|
|
Karsten Hopp |
ea4a5a |
DataBrowserItemID itemID,
|
|
Karsten Hopp |
ea4a5a |
! DataBrowserPropertyID property /* column id */,
|
|
Karsten Hopp |
ea4a5a |
! DataBrowserItemDataRef itemData,
|
|
Karsten Hopp |
ea4a5a |
Boolean changeValue)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
OSStatus status = noErr;
|
|
Karsten Hopp |
ea4a5a |
--- 6556,6563 ----
|
|
Karsten Hopp |
ea4a5a |
static OSStatus
|
|
Karsten Hopp |
ea4a5a |
dbItemDataCallback(ControlRef browser,
|
|
Karsten Hopp |
ea4a5a |
DataBrowserItemID itemID,
|
|
Karsten Hopp |
ea4a5a |
! DataBrowserPropertyID property /* column id */,
|
|
Karsten Hopp |
ea4a5a |
! DataBrowserItemDataRef itemData,
|
|
Karsten Hopp |
ea4a5a |
Boolean changeValue)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
OSStatus status = noErr;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6170,6178 ****
|
|
Karsten Hopp |
ea4a5a |
static void
|
|
Karsten Hopp |
ea4a5a |
dbGetContextualMenuCallback(ControlRef browser,
|
|
Karsten Hopp |
ea4a5a |
MenuRef *menu,
|
|
Karsten Hopp |
ea4a5a |
! UInt32 *helpType,
|
|
Karsten Hopp |
ea4a5a |
CFStringRef *helpItemString,
|
|
Karsten Hopp |
ea4a5a |
! AEDesc *selection)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
// on mac os 9: kCMHelpItemNoHelp, but it's not the same
|
|
Karsten Hopp |
ea4a5a |
*helpType = kCMHelpItemRemoveHelp; // OS X only ;-)
|
|
Karsten Hopp |
ea4a5a |
--- 6600,6608 ----
|
|
Karsten Hopp |
ea4a5a |
static void
|
|
Karsten Hopp |
ea4a5a |
dbGetContextualMenuCallback(ControlRef browser,
|
|
Karsten Hopp |
ea4a5a |
MenuRef *menu,
|
|
Karsten Hopp |
ea4a5a |
! UInt32 *helpType,
|
|
Karsten Hopp |
ea4a5a |
CFStringRef *helpItemString,
|
|
Karsten Hopp |
ea4a5a |
! AEDesc *selection)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
// on mac os 9: kCMHelpItemNoHelp, but it's not the same
|
|
Karsten Hopp |
ea4a5a |
*helpType = kCMHelpItemRemoveHelp; // OS X only ;-)
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6395,6403 ****
|
|
Karsten Hopp |
ea4a5a |
gui_mch_show_tabline(int showit)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (showit == 0)
|
|
Karsten Hopp |
ea4a5a |
! CloseDrawer(drawer, true);
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
! OpenDrawer(drawer, kWindowEdgeRight, true);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
--- 6825,6833 ----
|
|
Karsten Hopp |
ea4a5a |
gui_mch_show_tabline(int showit)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (showit == 0)
|
|
Karsten Hopp |
ea4a5a |
! CloseDrawer(drawer, true);
|
|
Karsten Hopp |
ea4a5a |
else
|
|
Karsten Hopp |
ea4a5a |
! OpenDrawer(drawer, kWindowEdgeRight, true);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/*
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6425,6435 ****
|
|
Karsten Hopp |
ea4a5a |
// adjust data browser
|
|
Karsten Hopp |
ea4a5a |
if (tabLabels != NULL)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! int i;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; i < tabLabelsSize; ++i)
|
|
Karsten Hopp |
ea4a5a |
! CFRelease(tabLabels[i]);
|
|
Karsten Hopp |
ea4a5a |
! free(tabLabels);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef));
|
|
Karsten Hopp |
ea4a5a |
tabLabelsSize = numTabs;
|
|
Karsten Hopp |
ea4a5a |
--- 6855,6865 ----
|
|
Karsten Hopp |
ea4a5a |
// adjust data browser
|
|
Karsten Hopp |
ea4a5a |
if (tabLabels != NULL)
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
! int i;
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
! for (i = 0; i < tabLabelsSize; ++i)
|
|
Karsten Hopp |
ea4a5a |
! CFRelease(tabLabels[i]);
|
|
Karsten Hopp |
ea4a5a |
! free(tabLabels);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef));
|
|
Karsten Hopp |
ea4a5a |
tabLabelsSize = numTabs;
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 6438,6444 ****
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (tp == curtab)
|
|
Karsten Hopp |
ea4a5a |
curtabidx = nr;
|
|
Karsten Hopp |
ea4a5a |
! tabLabels[nr-1] = getTabLabel(tp);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL,
|
|
Karsten Hopp |
ea4a5a |
--- 6868,6874 ----
|
|
Karsten Hopp |
ea4a5a |
{
|
|
Karsten Hopp |
ea4a5a |
if (tp == curtab)
|
|
Karsten Hopp |
ea4a5a |
curtabidx = nr;
|
|
Karsten Hopp |
ea4a5a |
! tabLabels[nr-1] = getTabLabel(tp);
|
|
Karsten Hopp |
ea4a5a |
}
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL,
|
|
Karsten Hopp |
ea4a5a |
*** ../vim-7.1.274/src/version.c Wed Mar 12 13:45:34 2008
|
|
Karsten Hopp |
ea4a5a |
--- src/version.c Wed Mar 12 14:31:37 2008
|
|
Karsten Hopp |
ea4a5a |
***************
|
|
Karsten Hopp |
ea4a5a |
*** 668,669 ****
|
|
Karsten Hopp |
ea4a5a |
--- 668,671 ----
|
|
Karsten Hopp |
ea4a5a |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
ea4a5a |
+ /**/
|
|
Karsten Hopp |
ea4a5a |
+ 275,
|
|
Karsten Hopp |
ea4a5a |
/**/
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
--
|
|
Karsten Hopp |
ea4a5a |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
ea4a5a |
115. You are late picking up your kid from school and try to explain
|
|
Karsten Hopp |
ea4a5a |
to the teacher you were stuck in Web traffic.
|
|
Karsten Hopp |
ea4a5a |
|
|
Karsten Hopp |
ea4a5a |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
ea4a5a |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
ea4a5a |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
ea4a5a |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|