diff options
| author | Karoly Lorentey | 2006-07-14 05:56:32 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-07-14 05:56:32 +0000 |
| commit | 99715bbc447eb633e45ffa23b87284771ce3ac74 (patch) | |
| tree | 3a8a53dfe3dbdd9f8e36965e9f043eae522d3c0e /src/macterm.c | |
| parent | 556b89447234f15d1784a23dadbfe429464463a8 (diff) | |
| parent | 763bb2d43615bc3ae816422f965d76d5e1ae4bdd (diff) | |
| download | emacs-99715bbc447eb633e45ffa23b87284771ce3ac74.tar.gz emacs-99715bbc447eb633e45ffa23b87284771ce3ac74.zip | |
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-331
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-332
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-333
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-334
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-335
Add note about "link" button-class to etc/TODO
* emacs@sv.gnu.org/emacs--devo--0--patch-336
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-337
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-338
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-339
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-340
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-341
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-342
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-343
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-344
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-345
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-346
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-347
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-348
Update for ERC 5.1.3.
* emacs@sv.gnu.org/emacs--devo--0--patch-349
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-350
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/gnus--rel--5.10--patch-111
Update from CVS: texi/gnus.texi (Summary Buffer Lines): Fix typo.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-112
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-113
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-114
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-572
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 93 |
1 files changed, 78 insertions, 15 deletions
diff --git a/src/macterm.c b/src/macterm.c index 19040392aa5..8d627446f65 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -196,6 +196,8 @@ static int input_signal_count; | |||
| 196 | 196 | ||
| 197 | extern Lisp_Object Vsystem_name; | 197 | extern Lisp_Object Vsystem_name; |
| 198 | 198 | ||
| 199 | extern Lisp_Object Qeql; | ||
| 200 | |||
| 199 | /* A mask of extra modifier bits to put into every keyboard char. */ | 201 | /* A mask of extra modifier bits to put into every keyboard char. */ |
| 200 | 202 | ||
| 201 | extern EMACS_INT extra_keyboard_modifiers; | 203 | extern EMACS_INT extra_keyboard_modifiers; |
| @@ -6031,13 +6033,28 @@ x_set_mouse_pixel_position (f, pix_x, pix_y) | |||
| 6031 | struct frame *f; | 6033 | struct frame *f; |
| 6032 | int pix_x, pix_y; | 6034 | int pix_x, pix_y; |
| 6033 | { | 6035 | { |
| 6034 | #if 0 /* MAC_TODO: CursorDeviceMoveTo is non-Carbon */ | 6036 | #ifdef MAC_OSX |
| 6037 | Point p; | ||
| 6038 | CGPoint point; | ||
| 6039 | |||
| 6040 | BLOCK_INPUT; | ||
| 6041 | SetPortWindowPort (FRAME_MAC_WINDOW (f)); | ||
| 6042 | p.h = pix_x; | ||
| 6043 | p.v = pix_y; | ||
| 6044 | LocalToGlobal (&p); | ||
| 6045 | point.x = p.h; | ||
| 6046 | point.y = p.v; | ||
| 6047 | CGWarpMouseCursorPosition (point); | ||
| 6048 | UNBLOCK_INPUT; | ||
| 6049 | #else | ||
| 6050 | #if 0 /* MAC_TODO: LMSetMouseLocation and CursorDeviceMoveTo are non-Carbon */ | ||
| 6035 | BLOCK_INPUT; | 6051 | BLOCK_INPUT; |
| 6036 | 6052 | ||
| 6037 | XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), | 6053 | XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), |
| 6038 | 0, 0, 0, 0, pix_x, pix_y); | 6054 | 0, 0, 0, 0, pix_x, pix_y); |
| 6039 | UNBLOCK_INPUT; | 6055 | UNBLOCK_INPUT; |
| 6040 | #endif | 6056 | #endif |
| 6057 | #endif | ||
| 6041 | } | 6058 | } |
| 6042 | 6059 | ||
| 6043 | /* focus shifting, raising and lowering. */ | 6060 | /* focus shifting, raising and lowering. */ |
| @@ -6897,6 +6914,8 @@ static Lisp_Object fm_font_family_alist; | |||
| 6897 | #if USE_ATSUI | 6914 | #if USE_ATSUI |
| 6898 | /* Hash table linking font family names to ATSU font IDs. */ | 6915 | /* Hash table linking font family names to ATSU font IDs. */ |
| 6899 | static Lisp_Object atsu_font_id_hash; | 6916 | static Lisp_Object atsu_font_id_hash; |
| 6917 | /* Alist linking Font Manager style to face attributes. */ | ||
| 6918 | static Lisp_Object fm_style_face_attributes_alist; | ||
| 6900 | static Lisp_Object Vmac_atsu_font_table; | 6919 | static Lisp_Object Vmac_atsu_font_table; |
| 6901 | extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic; | 6920 | extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic; |
| 6902 | #endif | 6921 | #endif |
| @@ -7132,6 +7151,29 @@ add_mac_font_name (name, size, style, charset) | |||
| 7132 | } | 7151 | } |
| 7133 | } | 7152 | } |
| 7134 | 7153 | ||
| 7154 | #if USE_ATSUI | ||
| 7155 | static Lisp_Object | ||
| 7156 | fm_style_to_face_attributes (fm_style) | ||
| 7157 | FMFontStyle fm_style; | ||
| 7158 | { | ||
| 7159 | Lisp_Object tem; | ||
| 7160 | |||
| 7161 | fm_style &= (bold | italic); | ||
| 7162 | tem = assq_no_quit (make_number (fm_style), | ||
| 7163 | fm_style_face_attributes_alist); | ||
| 7164 | if (!NILP (tem)) | ||
| 7165 | return XCDR (tem); | ||
| 7166 | |||
| 7167 | tem = list4 (QCweight, fm_style & bold ? Qbold : Qnormal, | ||
| 7168 | QCslant, fm_style & italic ? Qitalic : Qnormal); | ||
| 7169 | fm_style_face_attributes_alist = | ||
| 7170 | Fcons (Fcons (make_number (fm_style), tem), | ||
| 7171 | fm_style_face_attributes_alist); | ||
| 7172 | |||
| 7173 | return tem; | ||
| 7174 | } | ||
| 7175 | #endif | ||
| 7176 | |||
| 7135 | /* Sets up the table font_name_table to contain the list of all fonts | 7177 | /* Sets up the table font_name_table to contain the list of all fonts |
| 7136 | in the system the first time the table is used so that the Resource | 7178 | in the system the first time the table is used so that the Resource |
| 7137 | Manager need not be accessed every time this information is | 7179 | Manager need not be accessed every time this information is |
| @@ -7200,14 +7242,12 @@ init_font_name_table () | |||
| 7200 | decode_mac_font_name (name, name_len + 1, Qnil); | 7242 | decode_mac_font_name (name, name_len + 1, Qnil); |
| 7201 | family = make_unibyte_string (name, name_len); | 7243 | family = make_unibyte_string (name, name_len); |
| 7202 | FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style); | 7244 | FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style); |
| 7203 | Fputhash (make_unibyte_string ((char *)(font_ids + i), | 7245 | Fputhash ((font_ids[i] > MOST_POSITIVE_FIXNUM |
| 7204 | sizeof (ATSUFontID)), | 7246 | ? make_float (font_ids[i]) |
| 7247 | : make_number (font_ids[i])), | ||
| 7205 | Fcons (QCfamily, | 7248 | Fcons (QCfamily, |
| 7206 | list5 (family, | 7249 | Fcons (family, |
| 7207 | QCweight, | 7250 | fm_style_to_face_attributes (style))), |
| 7208 | style & bold ? Qbold : Qnormal, | ||
| 7209 | QCslant, | ||
| 7210 | style & italic ? Qitalic : Qnormal)), | ||
| 7211 | Vmac_atsu_font_table); | 7251 | Vmac_atsu_font_table); |
| 7212 | if (*name != '.' | 7252 | if (*name != '.' |
| 7213 | && hash_lookup (h, family, &hash_code) < 0) | 7253 | && hash_lookup (h, family, &hash_code) < 0) |
| @@ -8513,6 +8553,7 @@ static Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event; | |||
| 8513 | static Lisp_Object Vmac_ts_active_input_overlay; | 8553 | static Lisp_Object Vmac_ts_active_input_overlay; |
| 8514 | extern Lisp_Object Qbefore_string; | 8554 | extern Lisp_Object Qbefore_string; |
| 8515 | static Lisp_Object Vmac_ts_script_language_on_focus; | 8555 | static Lisp_Object Vmac_ts_script_language_on_focus; |
| 8556 | static Lisp_Object saved_ts_script_language_on_focus; | ||
| 8516 | static ScriptLanguageRecord saved_ts_language; | 8557 | static ScriptLanguageRecord saved_ts_language; |
| 8517 | static Component saved_ts_component; | 8558 | static Component saved_ts_component; |
| 8518 | #endif | 8559 | #endif |
| @@ -8875,11 +8916,17 @@ mac_tsm_resume () | |||
| 8875 | 8916 | ||
| 8876 | if (err == noErr) | 8917 | if (err == noErr) |
| 8877 | { | 8918 | { |
| 8878 | if (EQ (Vmac_ts_script_language_on_focus, Qt)) | 8919 | if (EQ (Vmac_ts_script_language_on_focus, Qt) |
| 8920 | && EQ (saved_ts_script_language_on_focus, Qt)) | ||
| 8879 | slptr = &saved_ts_language; | 8921 | slptr = &saved_ts_language; |
| 8880 | else if (CONSP (Vmac_ts_script_language_on_focus) | 8922 | else if (CONSP (Vmac_ts_script_language_on_focus) |
| 8881 | && INTEGERP (XCAR (Vmac_ts_script_language_on_focus)) | 8923 | && INTEGERP (XCAR (Vmac_ts_script_language_on_focus)) |
| 8882 | && INTEGERP (XCDR (Vmac_ts_script_language_on_focus))) | 8924 | && INTEGERP (XCDR (Vmac_ts_script_language_on_focus)) |
| 8925 | && CONSP (saved_ts_script_language_on_focus) | ||
| 8926 | && EQ (XCAR (saved_ts_script_language_on_focus), | ||
| 8927 | XCAR (Vmac_ts_script_language_on_focus)) | ||
| 8928 | && EQ (XCDR (saved_ts_script_language_on_focus), | ||
| 8929 | XCDR (Vmac_ts_script_language_on_focus))) | ||
| 8883 | { | 8930 | { |
| 8884 | slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus)); | 8931 | slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus)); |
| 8885 | slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus)); | 8932 | slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus)); |
| @@ -8912,6 +8959,8 @@ mac_tsm_suspend () | |||
| 8912 | OSStatus err; | 8959 | OSStatus err; |
| 8913 | ScriptLanguageRecord slrec, *slptr = NULL; | 8960 | ScriptLanguageRecord slrec, *slptr = NULL; |
| 8914 | 8961 | ||
| 8962 | saved_ts_script_language_on_focus = Vmac_ts_script_language_on_focus; | ||
| 8963 | |||
| 8915 | if (EQ (Vmac_ts_script_language_on_focus, Qt)) | 8964 | if (EQ (Vmac_ts_script_language_on_focus, Qt)) |
| 8916 | { | 8965 | { |
| 8917 | err = GetTextServiceLanguage (&saved_ts_language); | 8966 | err = GetTextServiceLanguage (&saved_ts_language); |
| @@ -9560,7 +9609,11 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 9560 | typeLongInteger, | 9609 | typeLongInteger, |
| 9561 | typeIntlWritingCode, | 9610 | typeIntlWritingCode, |
| 9562 | typeLongInteger, | 9611 | typeLongInteger, |
| 9612 | #ifdef MAC_OSX | ||
| 9563 | typeUnicodeText, | 9613 | typeUnicodeText, |
| 9614 | #else | ||
| 9615 | typeChar, | ||
| 9616 | #endif | ||
| 9564 | typeTextRangeArray, | 9617 | typeTextRangeArray, |
| 9565 | typeTextRangeArray, | 9618 | typeTextRangeArray, |
| 9566 | typeOffsetArray, | 9619 | typeOffsetArray, |
| @@ -10646,7 +10699,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 10646 | #endif | 10699 | #endif |
| 10647 | mapped_modifiers &= modifiers; | 10700 | mapped_modifiers &= modifiers; |
| 10648 | 10701 | ||
| 10649 | #if USE_CARBON_EVENTS && defined (MAC_OSX) | 10702 | #if USE_CARBON_EVENTS && (defined (MAC_OSX) || USE_MAC_TSM) |
| 10650 | /* When using Carbon Events, we need to pass raw keyboard | 10703 | /* When using Carbon Events, we need to pass raw keyboard |
| 10651 | events to the TSM ourselves. If TSM handles it, it | 10704 | events to the TSM ourselves. If TSM handles it, it |
| 10652 | will pass back noErr, otherwise it will pass back | 10705 | will pass back noErr, otherwise it will pass back |
| @@ -11302,7 +11355,11 @@ init_menu_bar () | |||
| 11302 | static void | 11355 | static void |
| 11303 | init_tsm () | 11356 | init_tsm () |
| 11304 | { | 11357 | { |
| 11358 | #ifdef MAC_OSX | ||
| 11305 | static InterfaceTypeList types = {kUnicodeDocument}; | 11359 | static InterfaceTypeList types = {kUnicodeDocument}; |
| 11360 | #else | ||
| 11361 | static InterfaceTypeList types = {kTextService}; | ||
| 11362 | #endif | ||
| 11306 | 11363 | ||
| 11307 | NewTSMDocument (sizeof (types) / sizeof (types[0]), types, | 11364 | NewTSMDocument (sizeof (types) / sizeof (types[0]), types, |
| 11308 | &tsm_document_id, 0); | 11365 | &tsm_document_id, 0); |
| @@ -11491,6 +11548,14 @@ syms_of_macterm () | |||
| 11491 | #if USE_ATSUI | 11548 | #if USE_ATSUI |
| 11492 | staticpro (&atsu_font_id_hash); | 11549 | staticpro (&atsu_font_id_hash); |
| 11493 | atsu_font_id_hash = Qnil; | 11550 | atsu_font_id_hash = Qnil; |
| 11551 | |||
| 11552 | staticpro (&fm_style_face_attributes_alist); | ||
| 11553 | fm_style_face_attributes_alist = Qnil; | ||
| 11554 | #endif | ||
| 11555 | |||
| 11556 | #if USE_MAC_TSM | ||
| 11557 | staticpro (&saved_ts_script_language_on_focus); | ||
| 11558 | saved_ts_script_language_on_focus = Qnil; | ||
| 11494 | #endif | 11559 | #endif |
| 11495 | 11560 | ||
| 11496 | /* We don't yet support this, but defining this here avoids whining | 11561 | /* We don't yet support this, but defining this here avoids whining |
| @@ -11603,11 +11668,9 @@ CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */); | |||
| 11603 | 11668 | ||
| 11604 | #if USE_ATSUI | 11669 | #if USE_ATSUI |
| 11605 | DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table, | 11670 | DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table, |
| 11606 | doc: /* Hash table of ATSU font IDs vs plist of attributes and values. | 11671 | doc: /* Hash table of ATSU font IDs vs plist of attributes and values. */); |
| 11607 | Each font ID is represented as a four-byte string in native byte | ||
| 11608 | order. */); | ||
| 11609 | Vmac_atsu_font_table = | 11672 | Vmac_atsu_font_table = |
| 11610 | make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), | 11673 | make_hash_table (Qeql, make_number (DEFAULT_HASH_SIZE), |
| 11611 | make_float (DEFAULT_REHASH_SIZE), | 11674 | make_float (DEFAULT_REHASH_SIZE), |
| 11612 | make_float (DEFAULT_REHASH_THRESHOLD), | 11675 | make_float (DEFAULT_REHASH_THRESHOLD), |
| 11613 | Qnil, Qnil, Qnil); | 11676 | Qnil, Qnil, Qnil); |