Mercurial > emacs
annotate src/macterm.c @ 90503:8e3ffc0a529f
(QCscalable, Qc, Qm, Qp, Qd): New variables.
(syms_of_font): Initialize them.
(font_pixel_size): Allow float value in dpi.
(font_prop_validate_type): Deleted.
(font_prop_validate_symbol, font_prop_validate_style): Argument
changed. Caller changed.
(font_prop_validate_non_neg): Renamed from
font_prop_validate_size.
(font_prop_validate_extra): Deleted.
(font_prop_validate_spacing): New function.
(font_property_table): Add elements for all known properties.
(get_font_prop_index): Renamed from check_font_prop_name. New
argument FROM. Caller changed.
(font_prop_validate): Validate all known properties.
(font_put_extra): Argument force deleted. Caller changed.
(font_expand_wildcards): Make it static. Fix the way of shrinking
the possible range.
(font_parse_xlfd): Arguemnt merge deleted. Fix handling of RESX,
RESY, SPACING, and AVGWIDTH. Don't validate property values here.
Caller changed.
(font_unparse_xlfd): Handle dpi, spacing, and scalable properties.
(font_parse_fcname): Arguemnt merge deleted. Fix parsing of point
size. Don't validate properties values here. Caller changed.
(font_unparse_fcname): Handle dpi, spacing, and scalable
properties.
(font_open_by_name): Delete unused variable.
(Ffont_spec): Likewise. Validate property values.
(Ffont_match_p): New function.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 28 Jun 2006 05:57:27 +0000 |
parents | 138027c8c982 |
children | 138ce2701550 |
rev | line source |
---|---|
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1 /* Implementation of GUI terminal on the Mac OS. |
64770
a0d1312ede66
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64471
diff
changeset
|
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, |
68651
3bd95f4f2941
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
68145
diff
changeset
|
3 2005, 2006 Free Software Foundation, Inc. |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5 This file is part of GNU Emacs. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7 GNU Emacs is free software; you can redistribute it and/or modify |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8 it under the terms of the GNU General Public License as published by |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9 the Free Software Foundation; either version 2, or (at your option) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10 any later version. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
12 GNU Emacs is distributed in the hope that it will be useful, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
15 GNU General Public License for more details. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
16 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
18 along with GNU Emacs; see the file COPYING. If not, write to |
64084 | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 Boston, MA 02110-1301, USA. */ | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
21 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
22 /* Contributed by Andrew Choi (akochoi@mac.com). */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
23 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
24 #include <config.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
25 #include <signal.h> |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
26 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
27 #include <stdio.h> |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
28 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
29 #include "lisp.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
30 #include "blockinput.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
31 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
32 #include "macterm.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
33 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
34 #ifndef MAC_OSX |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
35 #include <alloca.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
36 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
37 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
38 #if TARGET_API_MAC_CARBON |
46798 | 39 /* USE_CARBON_EVENTS determines if the Carbon Event Manager is used to |
40 obtain events from the event queue. If set to 0, WaitNextEvent is | |
41 used instead. */ | |
42 #define USE_CARBON_EVENTS 1 | |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
43 #else /* not TARGET_API_MAC_CARBON */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
44 #include <Quickdraw.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
45 #include <ToolUtils.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
46 #include <Sound.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
47 #include <Events.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
48 #include <Script.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
49 #include <Resources.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
50 #include <Fonts.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
51 #include <TextUtils.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
52 #include <LowMem.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
53 #include <Controls.h> |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
54 #include <Windows.h> |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
55 #if defined (__MRC__) || (__MSL__ >= 0x6000) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
56 #include <ControlDefinitions.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
57 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
58 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
59 #if __profile__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
60 #include <profiler.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
61 #endif |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
62 #endif /* not TARGET_API_MAC_CARBON */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
63 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
64 #include "systty.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
65 #include "systime.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
66 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
67 #include <ctype.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
68 #include <errno.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
69 #include <setjmp.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
70 #include <sys/stat.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
71 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
72 #include "charset.h" |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
73 #include "coding.h" |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
74 #include "frame.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
75 #include "dispextern.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
76 #include "fontset.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
77 #include "termhooks.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
78 #include "termopts.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
79 #include "termchar.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
80 #include "disptab.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
81 #include "buffer.h" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
82 #include "window.h" |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
83 #include "keyboard.h" |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
84 #include "intervals.h" |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
85 #include "atimer.h" |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
86 #include "keymap.h" |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
87 #include "character.h" |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
88 #include "ccl.h" |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
89 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
90 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
91 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
92 /* Non-nil means Emacs uses toolkit scroll bars. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
93 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
94 Lisp_Object Vx_toolkit_scroll_bars; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
95 |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
96 /* If non-zero, the text will be rendered using Core Graphics text |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
97 rendering which may anti-alias the text. */ |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
98 int mac_use_core_graphics; |
59577
a4a748516aa7
* macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents:
59575
diff
changeset
|
99 |
a4a748516aa7
* macterm.c (Vmac_use_core_graphics): defined
Steven Tamm <steventamm@mac.com>
parents:
59575
diff
changeset
|
100 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
101 /* Non-zero means that a HELP_EVENT has been generated since Emacs |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
102 start. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
103 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
104 static int any_help_event_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
105 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
106 /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
107 static Lisp_Object last_window; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
108 |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
109 /* Non-zero means make use of UNDERLINE_POSITION font properties. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
110 (Not yet supported.) */ |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
111 int x_use_underline_position_properties; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
112 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
113 /* This is a chain of structures for all the X displays currently in |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
114 use. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
115 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
116 struct x_display_info *x_display_list; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
117 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
118 /* This is a list of cons cells, each of the form (NAME |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
119 FONT-LIST-CACHE . RESOURCE-DATABASE), one for each element of |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
120 x_display_list and in the same order. NAME is the name of the |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
121 frame. FONT-LIST-CACHE records previous values returned by |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
122 x-list-fonts. RESOURCE-DATABASE preserves the X Resource Database |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
123 equivalent, which is implemented with a Lisp object, for the |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
124 display. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
125 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
126 Lisp_Object x_display_name_list; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
127 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
128 /* This is display since Mac does not support multiple ones. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
129 struct mac_display_info one_mac_display_info; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
130 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
131 /* Frame being updated by update_frame. This is declared in term.c. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
132 This is set by update_begin and looked at by all the XT functions. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
133 It is zero while not inside an update. In that case, the XT |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
134 functions assume that `selected_frame' is the frame to apply to. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
135 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
136 extern struct frame *updating_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
137 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
138 /* This is a frame waiting to be auto-raised, within XTread_socket. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
139 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
140 struct frame *pending_autoraise_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
141 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
142 /* Mouse movement. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
143 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
144 Formerly, we used PointerMotionHintMask (in standard_event_mask) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
145 so that we would have to call XQueryPointer after each MotionNotify |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
146 event to ask for another such event. However, this made mouse tracking |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
147 slow, and there was a bug that made it eventually stop. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
148 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
149 Simply asking for MotionNotify all the time seems to work better. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
150 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
151 In order to avoid asking for motion events and then throwing most |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
152 of them away or busy-polling the server for mouse positions, we ask |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
153 the server for pointer motion hints. This means that we get only |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
154 one event per group of mouse movements. "Groups" are delimited by |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
155 other kinds of events (focus changes and button clicks, for |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
156 example), or by XQueryPointer calls; when one of these happens, we |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
157 get another MotionNotify event the next time the mouse moves. This |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
158 is at least as efficient as getting motion events when mouse |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
159 tracking is on, and I suspect only negligibly worse when tracking |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
160 is off. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
161 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
162 /* Where the mouse was last time we reported a mouse event. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
163 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
164 static Rect last_mouse_glyph; |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
165 static FRAME_PTR last_mouse_glyph_frame; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
166 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
167 /* The scroll bar in which the last X motion event occurred. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
168 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
169 If the last X motion event occurred in a scroll bar, we set this so |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
170 XTmouse_position can know whether to report a scroll bar motion or |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
171 an ordinary motion. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
172 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
173 If the last X motion event didn't occur in a scroll bar, we set |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
174 this to Qnil, to tell XTmouse_position to return an ordinary motion |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
175 event. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
176 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
177 static Lisp_Object last_mouse_scroll_bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
178 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
179 /* This is a hack. We would really prefer that XTmouse_position would |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
180 return the time associated with the position it returns, but there |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
181 doesn't seem to be any way to wrest the time-stamp from the server |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
182 along with the position query. So, we just keep track of the time |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
183 of the last movement we received, and return that in hopes that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
184 it's somewhat accurate. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
185 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
186 static Time last_mouse_movement_time; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
187 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
188 struct scroll_bar *tracked_scroll_bar = NULL; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
189 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
190 /* Incremented by XTread_socket whenever it really tries to read |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
191 events. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
192 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
193 #ifdef __STDC__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
194 static int volatile input_signal_count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
195 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
196 static int input_signal_count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
197 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
198 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
199 extern Lisp_Object Vsystem_name; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
200 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
201 /* A mask of extra modifier bits to put into every keyboard char. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
202 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
203 extern EMACS_INT extra_keyboard_modifiers; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
204 |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
205 /* The keysyms to use for the various modifiers. */ |
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
206 |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
207 static Lisp_Object Qalt, Qhyper, Qsuper, Qcontrol, Qmeta, Qmodifier_value; |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
208 |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
209 extern int inhibit_window_system; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
210 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
211 #if __MRC__ && !TARGET_API_MAC_CARBON |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
212 QDGlobals qd; /* QuickDraw global information structure. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
213 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
214 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
215 #define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
216 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
217 struct mac_display_info *mac_display_info_for_display (Display *); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
218 static void x_update_window_end P_ ((struct window *, int, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
219 int x_catch_errors P_ ((Display *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
220 void x_uncatch_errors P_ ((Display *, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
221 void x_lower_frame P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
222 void x_scroll_bar_clear P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
223 int x_had_errors_p P_ ((Display *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
224 void x_wm_set_size_hint P_ ((struct frame *, long, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
225 void x_raise_frame P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
226 void x_set_window_size P_ ((struct frame *, int, int, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
227 void x_wm_set_window_state P_ ((struct frame *, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
228 void x_wm_set_icon_pixmap P_ ((struct frame *, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
229 void mac_initialize P_ ((void)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
230 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
231 static int x_compute_min_glyph_bounds P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
232 static void x_update_end P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
233 static void XTframe_up_to_date P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
234 static void XTset_terminal_modes P_ ((void)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
235 static void XTreset_terminal_modes P_ ((void)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
236 static void x_clear_frame P_ ((void)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
237 static void frame_highlight P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
238 static void frame_unhighlight P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
239 static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
240 static void mac_focus_changed P_ ((int, struct mac_display_info *, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
241 struct frame *, struct input_event *)); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
242 static void x_detect_focus_change P_ ((struct mac_display_info *, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
243 EventRecord *, struct input_event *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
244 static void XTframe_rehighlight P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
245 static void x_frame_rehighlight P_ ((struct x_display_info *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
246 static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
247 static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
248 enum text_cursor_kinds)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
249 |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
250 static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
251 static void x_flush P_ ((struct frame *f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
252 static void x_update_begin P_ ((struct frame *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
253 static void x_update_window_begin P_ ((struct window *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
254 static void x_after_update_window_line P_ ((struct glyph_row *)); |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
255 static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *, |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
256 enum scroll_bar_part *, |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
257 Lisp_Object *, Lisp_Object *, |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
258 unsigned long *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
259 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
260 static int is_emacs_window P_ ((WindowPtr)); |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
261 static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int)); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
262 static void XSetFont P_ ((Display *, GC, XFontStruct *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
263 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
264 /* Defined in macmenu.h. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
265 extern void menubar_selection_callback (FRAME_PTR, int); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
266 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
267 #define GC_FORE_COLOR(gc) (&(gc)->fore_color) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
268 #define GC_BACK_COLOR(gc) (&(gc)->back_color) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
269 #define GC_FONT(gc) ((gc)->xgcv.font) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
270 #define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc) |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
271 #define CG_SET_FILL_COLOR(context, color) \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
272 CGContextSetRGBFillColor (context, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
273 RED_FROM_ULONG (color) / 255.0f, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
274 GREEN_FROM_ULONG (color) / 255.0f, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
275 BLUE_FROM_ULONG (color) / 255.0f, 1.0f) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
276 #define CG_SET_STROKE_COLOR(context, color) \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
277 CGContextSetRGBStrokeColor (context, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
278 RED_FROM_ULONG (color) / 255.0f, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
279 GREEN_FROM_ULONG (color) / 255.0f, \ |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
280 BLUE_FROM_ULONG (color) / 255.0f, 1.0f) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
281 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
282 #define FRAME_CG_CONTEXT(f) ((f)->output_data.mac->cg_context) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
283 |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
284 /* Fringe bitmaps. */ |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
285 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
286 static int max_fringe_bmp = 0; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
287 static CGImageRef *fringe_bmp = 0; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
288 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
289 static CGContextRef |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
290 mac_begin_cg_clip (f, gc) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
291 struct frame *f; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
292 GC gc; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
293 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
294 CGContextRef context = FRAME_CG_CONTEXT (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
295 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
296 if (!context) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
297 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
298 QDBeginCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)), &context); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
299 FRAME_CG_CONTEXT (f) = context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
300 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
301 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
302 CGContextSaveGState (context); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
303 CGContextTranslateCTM (context, 0, FRAME_PIXEL_HEIGHT (f)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
304 CGContextScaleCTM (context, 1, -1); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
305 if (gc && gc->n_clip_rects) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
306 CGContextClipToRects (context, gc->clip_rects, gc->n_clip_rects); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
307 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
308 return context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
309 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
310 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
311 static void |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
312 mac_end_cg_clip (f) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
313 struct frame *f; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
314 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
315 CGContextRestoreGState (FRAME_CG_CONTEXT (f)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
316 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
317 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
318 void |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
319 mac_prepare_for_quickdraw (f) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
320 struct frame *f; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
321 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
322 if (f == NULL) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
323 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
324 Lisp_Object rest, frame; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
325 FOR_EACH_FRAME (rest, frame) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
326 if (FRAME_MAC_P (XFRAME (frame))) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
327 mac_prepare_for_quickdraw (XFRAME (frame)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
328 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
329 else |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
330 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
331 CGContextRef context = FRAME_CG_CONTEXT (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
332 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
333 if (context) |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
334 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
335 CGContextSynchronize (context); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
336 QDEndCGContext (GetWindowPort (FRAME_MAC_WINDOW (f)), |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
337 &FRAME_CG_CONTEXT (f)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
338 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
339 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
340 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
341 #endif |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
342 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
343 static RgnHandle saved_port_clip_region = NULL; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
344 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
345 static void |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
346 mac_begin_clip (gc) |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
347 GC gc; |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
348 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
349 static RgnHandle new_region = NULL; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
350 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
351 if (saved_port_clip_region == NULL) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
352 saved_port_clip_region = NewRgn (); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
353 if (new_region == NULL) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
354 new_region = NewRgn (); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
355 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
356 if (gc->n_clip_rects) |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
357 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
358 GetClip (saved_port_clip_region); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
359 SectRgn (saved_port_clip_region, gc->clip_region, new_region); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
360 SetClip (new_region); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
361 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
362 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
363 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
364 static void |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
365 mac_end_clip (gc) |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
366 GC gc; |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
367 { |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
368 if (gc->n_clip_rects) |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
369 SetClip (saved_port_clip_region); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
370 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
371 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
372 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
373 /* X display function emulation */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
374 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
375 void |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
376 XFreePixmap (display, pixmap) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
377 Display *display; /* not used */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
378 Pixmap pixmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
379 { |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
380 DisposeGWorld (pixmap); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
381 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
382 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
383 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
384 /* Mac version of XDrawLine. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
385 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
386 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
387 mac_draw_line (f, gc, x1, y1, x2, y2) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
388 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
389 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
390 int x1, y1, x2, y2; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
391 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
392 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
393 CGContextRef context; |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
394 float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
395 |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
396 if (y1 != y2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
397 gx1 += 0.5f, gx2 += 0.5f; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
398 if (x1 != x2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
399 gy1 += 0.5f, gy2 += 0.5f; |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
400 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
401 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
402 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
403 CGContextBeginPath (context); |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
404 CGContextMoveToPoint (context, gx1, gy1); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
405 CGContextAddLineToPoint (context, gx2, gy2); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
406 CGContextClosePath (context); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
407 CGContextStrokePath (context); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
408 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
409 #else |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
410 if (x1 == x2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
411 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
412 if (y1 > y2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
413 y1--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
414 else if (y2 > y1) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
415 y2--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
416 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
417 else if (y1 == y2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
418 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
419 if (x1 > x2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
420 x1--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
421 else |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
422 x2--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
423 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
424 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
425 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
426 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
427 RGBForeColor (GC_FORE_COLOR (gc)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
428 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
429 mac_begin_clip (gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
430 MoveTo (x1, y1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
431 LineTo (x2, y2); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
432 mac_end_clip (gc); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
433 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
434 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
435 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
436 void |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
437 mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
438 Display *display; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
439 Pixmap p; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
440 GC gc; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
441 int x1, y1, x2, y2; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
442 { |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
443 CGrafPtr old_port; |
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
444 GDHandle old_gdh; |
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
445 |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
446 if (x1 == x2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
447 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
448 if (y1 > y2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
449 y1--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
450 else if (y2 > y1) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
451 y2--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
452 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
453 else if (y1 == y2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
454 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
455 if (x1 > x2) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
456 x1--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
457 else |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
458 x2--; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
459 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
460 |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
461 GetGWorld (&old_port, &old_gdh); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
462 SetGWorld (p, NULL); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
463 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
464 RGBForeColor (GC_FORE_COLOR (gc)); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
465 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
466 LockPixels (GetGWorldPixMap (p)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
467 MoveTo (x1, y1); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
468 LineTo (x2, y2); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
469 UnlockPixels (GetGWorldPixMap (p)); |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
470 |
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
471 SetGWorld (old_port, old_gdh); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
472 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
473 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
474 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
475 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
476 mac_erase_rectangle (f, gc, x, y, width, height) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
477 struct frame *f; |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
478 GC gc; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
479 int x, y; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
480 unsigned int width, height; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
481 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
482 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
483 CGContextRef context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
484 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
485 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
486 CG_SET_FILL_COLOR (context, gc->xgcv.background); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
487 CGContextFillRect (context, CGRectMake (x, y, width, height)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
488 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
489 #else |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
490 Rect r; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
491 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
492 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
493 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
494 RGBBackColor (GC_BACK_COLOR (gc)); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
495 SetRect (&r, x, y, x + width, y + height); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
496 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
497 mac_begin_clip (gc); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
498 EraseRect (&r); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
499 mac_end_clip (gc); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
500 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
501 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
502 #endif |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
503 } |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
504 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
505 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
506 /* Mac version of XClearArea. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
507 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
508 void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
509 mac_clear_area (f, x, y, width, height) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
510 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
511 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
512 unsigned int width, height; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
513 { |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
514 mac_erase_rectangle (f, FRAME_NORMAL_GC (f), x, y, width, height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
515 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
516 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
517 /* Mac version of XClearWindow. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
518 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
519 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
520 mac_clear_window (f) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
521 struct frame *f; |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
522 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
523 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
524 CGContextRef context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
525 GC gc = FRAME_NORMAL_GC (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
526 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
527 context = mac_begin_cg_clip (f, NULL); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
528 CG_SET_FILL_COLOR (context, gc->xgcv.background); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
529 CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f), |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
530 FRAME_PIXEL_HEIGHT (f))); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
531 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
532 #else |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
533 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
534 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
535 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
536 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
537 #if TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
538 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
539 Rect r; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
540 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
541 GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
542 EraseRect (&r); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
543 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
544 #else /* not TARGET_API_MAC_CARBON */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
545 EraseRect (&(FRAME_MAC_WINDOW (f)->portRect)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
546 #endif /* not TARGET_API_MAC_CARBON */ |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
547 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
548 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
549 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
550 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
551 /* Mac replacement for XCopyArea. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
552 |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
553 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
554 static void |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
555 mac_draw_cg_image (image, f, gc, src_x, src_y, width, height, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
556 dest_x, dest_y, overlay_p) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
557 CGImageRef image; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
558 struct frame *f; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
559 GC gc; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
560 int src_x, src_y; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
561 unsigned int width, height; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
562 int dest_x, dest_y, overlay_p; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
563 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
564 CGContextRef context; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
565 float port_height = FRAME_PIXEL_HEIGHT (f); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
566 CGRect dest_rect = CGRectMake (dest_x, dest_y, width, height); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
567 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
568 context = mac_begin_cg_clip (f, gc); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
569 if (!overlay_p) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
570 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
571 CG_SET_FILL_COLOR (context, gc->xgcv.background); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
572 CGContextFillRect (context, dest_rect); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
573 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
574 CGContextClipToRect (context, dest_rect); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
575 CGContextScaleCTM (context, 1, -1); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
576 CGContextTranslateCTM (context, 0, -port_height); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
577 if (CGImageIsMask (image)) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
578 CG_SET_FILL_COLOR (context, gc->xgcv.foreground); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
579 CGContextDrawImage (context, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
580 CGRectMake (dest_x - src_x, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
581 port_height - (dest_y - src_y |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
582 + CGImageGetHeight (image)), |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
583 CGImageGetWidth (image), |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
584 CGImageGetHeight (image)), |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
585 image); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
586 mac_end_cg_clip (f); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
587 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
588 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
589 #else /* !USE_CG_DRAWING */ |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
590 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
591 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
592 mac_draw_bitmap (f, gc, x, y, width, height, bits, overlay_p) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
593 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
594 GC gc; |
53935
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
595 int x, y, width, height; |
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
596 unsigned short *bits; |
53899
e45e1fbbe83e
(mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents:
53885
diff
changeset
|
597 int overlay_p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
598 { |
53935
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
599 BitMap bitmap; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
600 Rect r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
601 |
53935
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
602 bitmap.rowBytes = sizeof(unsigned short); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
603 bitmap.baseAddr = (char *)bits; |
53935
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
604 SetRect (&(bitmap.bounds), 0, 0, width, height); |
60bbfcb6328e
(mac_draw_bitmap): Handle 16 bits wide bitmaps directly.
Kim F. Storm <storm@cua.dk>
parents:
53899
diff
changeset
|
605 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
606 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
607 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
608 RGBForeColor (GC_FORE_COLOR (gc)); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
609 RGBBackColor (GC_BACK_COLOR (gc)); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
610 SetRect (&r, x, y, x + width, y + height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
611 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
612 mac_begin_clip (gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
613 #if TARGET_API_MAC_CARBON |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
614 { |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
615 CGrafPtr port; |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
616 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
617 GetPort (&port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
618 LockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
619 CopyBits (&bitmap, GetPortBitMapForCopyBits (port), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
620 &(bitmap.bounds), &r, overlay_p ? srcOr : srcCopy, 0); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
621 UnlockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
622 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
623 #else /* not TARGET_API_MAC_CARBON */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
624 CopyBits (&bitmap, &(FRAME_MAC_WINDOW (f)->portBits), &(bitmap.bounds), &r, |
53899
e45e1fbbe83e
(mac_draw_bitmap): Add overlay_p arg.
Kim F. Storm <storm@cua.dk>
parents:
53885
diff
changeset
|
625 overlay_p ? srcOr : srcCopy, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
626 #endif /* not TARGET_API_MAC_CARBON */ |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
627 mac_end_clip (gc); |
60623
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
628 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
629 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
630 } |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
631 #endif /* !USE_CG_DRAWING */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
632 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
633 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
634 /* Mac replacement for XCreateBitmapFromBitmapData. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
635 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
636 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
637 mac_create_bitmap_from_bitmap_data (bitmap, bits, w, h) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
638 BitMap *bitmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
639 char *bits; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
640 int w, h; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
641 { |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
642 static unsigned char swap_nibble[16] |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
643 = { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */ |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
644 0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */ |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
645 0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */ |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
646 0x3, 0xb, 0x7, 0xf }; /* 0011 1011 0111 1111 */ |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
647 int i, j, w1; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
648 char *p; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
649 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
650 w1 = (w + 7) / 8; /* nb of 8bits elt in X bitmap */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
651 bitmap->rowBytes = ((w + 15) / 16) * 2; /* nb of 16bits elt in Mac bitmap */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
652 bitmap->baseAddr = xmalloc (bitmap->rowBytes * h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
653 bzero (bitmap->baseAddr, bitmap->rowBytes * h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
654 for (i = 0; i < h; i++) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
655 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
656 p = bitmap->baseAddr + i * bitmap->rowBytes; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
657 for (j = 0; j < w1; j++) |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
658 { |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
659 /* Bitswap XBM bytes to match how Mac does things. */ |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
660 unsigned char c = *bits++; |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
661 *p++ = (unsigned char)((swap_nibble[c & 0xf] << 4) |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
662 | (swap_nibble[(c>>4) & 0xf]));; |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
663 } |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
664 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
665 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
666 SetRect (&(bitmap->bounds), 0, 0, w, h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
667 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
668 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
669 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
670 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
671 mac_free_bitmap (bitmap) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
672 BitMap *bitmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
673 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
674 xfree (bitmap->baseAddr); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
675 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
676 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
677 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
678 Pixmap |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
679 XCreatePixmap (display, w, width, height, depth) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
680 Display *display; /* not used */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
681 WindowPtr w; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
682 unsigned int width, height; |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
683 unsigned int depth; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
684 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
685 Pixmap pixmap; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
686 Rect r; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
687 QDErr err; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
688 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
689 SetPortWindowPort (w); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
690 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
691 SetRect (&r, 0, 0, width, height); |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
692 #if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
693 if (depth == 1) |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
694 #endif |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
695 err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0); |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
696 #if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
697 else |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
698 /* CreateCGImageFromPixMaps requires ARGB format. */ |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
699 err = QTNewGWorld (&pixmap, k32ARGBPixelFormat, &r, NULL, NULL, 0); |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
700 #endif |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
701 if (err != noErr) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
702 return NULL; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
703 return pixmap; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
704 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
705 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
706 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
707 Pixmap |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
708 XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
709 Display *display; /* not used */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
710 WindowPtr w; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
711 char *data; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
712 unsigned int width, height; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
713 unsigned long fg, bg; |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
714 unsigned int depth; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
715 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
716 Pixmap pixmap; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
717 BitMap bitmap; |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
718 CGrafPtr old_port; |
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
719 GDHandle old_gdh; |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
720 static GC gc = NULL; /* not reentrant */ |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
721 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
722 if (gc == NULL) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
723 gc = XCreateGC (display, w, 0, NULL); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
724 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
725 pixmap = XCreatePixmap (display, w, width, height, depth); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
726 if (pixmap == NULL) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
727 return NULL; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
728 |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
729 GetGWorld (&old_port, &old_gdh); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
730 SetGWorld (pixmap, NULL); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
731 mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
732 XSetForeground (display, gc, fg); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
733 XSetBackground (display, gc, bg); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
734 RGBForeColor (GC_FORE_COLOR (gc)); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
735 RGBBackColor (GC_BACK_COLOR (gc)); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
736 LockPixels (GetGWorldPixMap (pixmap)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
737 #if TARGET_API_MAC_CARBON |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
738 CopyBits (&bitmap, GetPortBitMapForCopyBits (pixmap), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
739 &bitmap.bounds, &bitmap.bounds, srcCopy, 0); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
740 #else /* not TARGET_API_MAC_CARBON */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
741 CopyBits (&bitmap, &(((GrafPtr)pixmap)->portBits), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
742 &bitmap.bounds, &bitmap.bounds, srcCopy, 0); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
743 #endif /* not TARGET_API_MAC_CARBON */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
744 UnlockPixels (GetGWorldPixMap (pixmap)); |
55412
53a1a79a33f9
macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT
Steven Tamm <steventamm@mac.com>
parents:
55128
diff
changeset
|
745 SetGWorld (old_port, old_gdh); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
746 mac_free_bitmap (&bitmap); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
747 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
748 return pixmap; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
749 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
750 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
751 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
752 /* Mac replacement for XFillRectangle. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
753 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
754 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
755 mac_fill_rectangle (f, gc, x, y, width, height) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
756 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
757 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
758 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
759 unsigned int width, height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
760 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
761 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
762 CGContextRef context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
763 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
764 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
765 CG_SET_FILL_COLOR (context, gc->xgcv.foreground); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
766 CGContextFillRect (context, CGRectMake (x, y, width, height)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
767 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
768 #else |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
769 Rect r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
770 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
771 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
772 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
773 RGBForeColor (GC_FORE_COLOR (gc)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
774 SetRect (&r, x, y, x + width, y + height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
775 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
776 mac_begin_clip (gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
777 PaintRect (&r); /* using foreground color of gc */ |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
778 mac_end_clip (gc); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
779 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
780 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
781 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
782 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
783 /* Mac replacement for XDrawRectangle: dest is a window. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
784 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
785 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
786 mac_draw_rectangle (f, gc, x, y, width, height) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
787 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
788 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
789 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
790 unsigned int width, height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
791 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
792 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
793 CGContextRef context; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
794 |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
795 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
796 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
797 CGContextStrokeRect (context, |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
798 CGRectMake (x + 0.5f, y + 0.5f, width, height)); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
799 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
800 #else |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
801 Rect r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
802 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
803 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
804 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
805 RGBForeColor (GC_FORE_COLOR (gc)); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
806 SetRect (&r, x, y, x + width + 1, y + height + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
807 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
808 mac_begin_clip (gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
809 FrameRect (&r); /* using foreground color of gc */ |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
810 mac_end_clip (gc); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
811 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
812 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
813 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
814 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
815 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
816 static OSStatus |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
817 atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
818 ConstUniCharArrayPtr text; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
819 UniCharCount text_length; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
820 ATSUStyle style; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
821 ATSUTextLayout *text_layout; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
822 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
823 OSStatus err; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
824 static ATSUTextLayout saved_text_layout = NULL; /* not reentrant */ |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
825 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
826 if (saved_text_layout == NULL) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
827 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
828 UniCharCount lengths[] = {kATSUToTextEnd}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
829 ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
830 ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
831 static ATSLineLayoutOptions line_layout = |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
832 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
833 kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics |
68145
d88b44855af3
[USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67788
diff
changeset
|
834 | kATSLineUseQDRendering |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
835 #else |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
836 kATSLineIsDisplayOnly | kATSLineFractDisable |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
837 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
838 ; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
839 ATSUAttributeValuePtr values[] = {&line_layout}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
840 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
841 err = ATSUCreateTextLayoutWithTextPtr (text, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
842 kATSUFromTextBeginning, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
843 kATSUToTextEnd, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
844 text_length, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
845 1, lengths, &style, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
846 &saved_text_layout); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
847 if (err == noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
848 err = ATSUSetLayoutControls (saved_text_layout, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
849 sizeof (tags) / sizeof (tags[0]), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
850 tags, sizes, values); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
851 /* XXX: Should we do this? */ |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
852 if (err == noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
853 err = ATSUSetTransientFontMatching (saved_text_layout, true); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
854 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
855 else |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
856 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
857 err = ATSUSetRunStyle (saved_text_layout, style, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
858 kATSUFromTextBeginning, kATSUToTextEnd); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
859 if (err == noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
860 err = ATSUSetTextPointerLocation (saved_text_layout, text, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
861 kATSUFromTextBeginning, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
862 kATSUToTextEnd, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
863 text_length); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
864 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
865 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
866 if (err == noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
867 *text_layout = saved_text_layout; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
868 return err; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
869 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
870 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
871 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
872 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
873 static void |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
874 mac_invert_rectangle (f, x, y, width, height) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
875 struct frame *f; |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
876 int x, y; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
877 unsigned int width, height; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
878 { |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
879 Rect r; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
880 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
881 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
882 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
883 #endif |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
884 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
885 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
886 SetRect (&r, x, y, x + width, y + height); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
887 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
888 InvertRect (&r); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
889 } |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
890 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
891 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
892 static void |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
893 mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
894 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
895 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
896 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
897 char *buf; |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
898 int nchars, bg_width, bytes_per_char; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
899 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
900 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
901 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
902 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
903 if (GC_FONT (gc)->mac_style) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
904 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
905 OSErr err; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
906 ATSUTextLayout text_layout; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
907 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
908 xassert (bytes_per_char == 2); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
909 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
910 #ifndef WORDS_BIG_ENDIAN |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
911 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
912 int i; |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
913 UniChar *text = (UniChar *)buf; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
914 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
915 for (i = 0; i < nchars; i++) |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
916 text[i] = EndianU16_BtoN (text[i]); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
917 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
918 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
919 err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
920 nchars, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
921 GC_FONT (gc)->mac_style, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
922 &text_layout); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
923 if (err != noErr) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
924 return; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
925 #ifdef MAC_OSX |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
926 if (!mac_use_core_graphics) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
927 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
928 #endif |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
929 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
930 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
931 #endif |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
932 mac_begin_clip (gc); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
933 RGBForeColor (GC_FORE_COLOR (gc)); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
934 if (bg_width) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
935 { |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
936 Rect r; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
937 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
938 SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
939 x + bg_width, y + FONT_DESCENT (GC_FONT (gc))); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
940 RGBBackColor (GC_BACK_COLOR (gc)); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
941 EraseRect (&r); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
942 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
943 } |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
944 MoveTo (x, y); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
945 ATSUDrawText (text_layout, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
946 kATSUFromTextBeginning, kATSUToTextEnd, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
947 kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
948 mac_end_clip (gc); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
949 #ifdef MAC_OSX |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
950 } |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
951 else |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
952 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
953 CGrafPtr port; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
954 CGContextRef context; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
955 float port_height = FRAME_PIXEL_HEIGHT (f); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
956 ATSUAttributeTag tags[] = {kATSUCGContextTag}; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
957 ByteCount sizes[] = {sizeof (CGContextRef)}; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
958 ATSUAttributeValuePtr values[] = {&context}; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
959 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
960 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
961 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
962 #else |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
963 GetPort (&port); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
964 QDBeginCGContext (port, &context); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
965 if (gc->n_clip_rects || bg_width) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
966 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
967 CGContextTranslateCTM (context, 0, port_height); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
968 CGContextScaleCTM (context, 1, -1); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
969 if (gc->n_clip_rects) |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
970 CGContextClipToRects (context, gc->clip_rects, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
971 gc->n_clip_rects); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
972 #endif |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
973 if (bg_width) |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
974 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
975 CG_SET_FILL_COLOR (context, gc->xgcv.background); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
976 CGContextFillRect |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
977 (context, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
978 CGRectMake (x, y - FONT_BASE (GC_FONT (gc)), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
979 bg_width, FONT_HEIGHT (GC_FONT (gc)))); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
980 } |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
981 CGContextScaleCTM (context, 1, -1); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
982 CGContextTranslateCTM (context, 0, -port_height); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
983 #if !USE_CG_DRAWING |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
984 } |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
985 #endif |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
986 CG_SET_FILL_COLOR (context, gc->xgcv.foreground); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
987 err = ATSUSetLayoutControls (text_layout, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
988 sizeof (tags) / sizeof (tags[0]), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
989 tags, sizes, values); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
990 if (err == noErr) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
991 ATSUDrawText (text_layout, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
992 kATSUFromTextBeginning, kATSUToTextEnd, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
993 Long2Fix (x), Long2Fix (port_height - y)); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
994 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
995 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
996 context = NULL; |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
997 #else |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
998 CGContextSynchronize (context); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
999 QDEndCGContext (port, &context); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1000 #endif |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
1001 #if 0 |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1002 /* This doesn't work on Mac OS X 10.1. */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1003 ATSUClearLayoutControls (text_layout, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1004 sizeof (tags) / sizeof (tags[0]), tags); |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
1005 #else |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1006 ATSUSetLayoutControls (text_layout, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1007 sizeof (tags) / sizeof (tags[0]), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1008 tags, sizes, values); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
1009 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
1010 } |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1011 #endif /* MAC_OSX */ |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
1012 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
1013 else |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1014 #endif /* USE_ATSUI */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1015 { |
59899
96a18b943293
(mac_draw_string_common, x_make_frame_visible): Use
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59804
diff
changeset
|
1016 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1017 UInt32 savedFlags; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1018 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1019 if (mac_use_core_graphics) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1020 savedFlags = SwapQDTextFlags (kQDUseCGTextRendering); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1021 #endif |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1022 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1023 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1024 #endif |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1025 mac_begin_clip (gc); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1026 RGBForeColor (GC_FORE_COLOR (gc)); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1027 #ifdef MAC_OS8 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1028 if (bg_width) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1029 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1030 RGBBackColor (GC_BACK_COLOR (gc)); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1031 TextMode (srcCopy); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1032 } |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1033 else |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1034 TextMode (srcOr); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1035 #else |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1036 /* We prefer not to use srcCopy text transfer mode on Mac OS X |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1037 because: |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1038 - Screen is double-buffered. (In srcCopy mode, a text is |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1039 drawn into an offscreen graphics world first. So |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1040 performance gain cannot be expected.) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1041 - It lowers rendering quality. |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1042 - Some fonts leave garbage on cursor movement. */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1043 if (bg_width) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1044 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1045 Rect r; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1046 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1047 RGBBackColor (GC_BACK_COLOR (gc)); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1048 SetRect (&r, x, y - FONT_BASE (GC_FONT (gc)), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1049 x + bg_width, y + FONT_DESCENT (GC_FONT (gc))); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1050 EraseRect (&r); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1051 } |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1052 TextMode (srcOr); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1053 #endif |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1054 TextFont (GC_FONT (gc)->mac_fontnum); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1055 TextSize (GC_FONT (gc)->mac_fontsize); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1056 TextFace (GC_FONT (gc)->mac_fontface); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1057 MoveTo (x, y); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1058 DrawText (buf, 0, nchars * bytes_per_char); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1059 if (bg_width) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1060 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1061 mac_end_clip (gc); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1062 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1063 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1064 if (mac_use_core_graphics) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1065 SwapQDTextFlags(savedFlags); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1066 #endif |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1067 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1068 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1069 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1070 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1071 /* Mac replacement for XDrawString. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1072 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1073 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1074 mac_draw_string (f, gc, x, y, buf, nchars) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1075 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1076 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1077 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1078 char *buf; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1079 int nchars; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1080 { |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1081 mac_draw_string_common (f, gc, x, y, buf, nchars, 0, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1082 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1083 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1084 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1085 /* Mac replacement for XDrawString16. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1086 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1087 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1088 mac_draw_string_16 (f, gc, x, y, buf, nchars) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1089 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1090 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1091 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1092 XChar2b *buf; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1093 int nchars; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1094 { |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1095 mac_draw_string_common (f, gc, x, y, (char *) buf, nchars, 0, 2); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1096 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1097 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1098 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1099 /* Mac replacement for XDrawImageString. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1100 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1101 static void |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1102 mac_draw_image_string (f, gc, x, y, buf, nchars, bg_width) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1103 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1104 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1105 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1106 char *buf; |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1107 int nchars, bg_width; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1108 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1109 mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1110 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1111 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1112 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1113 /* Mac replacement for XDrawString16. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1114 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1115 static void |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1116 mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1117 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1118 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1119 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1120 XChar2b *buf; |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1121 int nchars, bg_width; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1122 { |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1123 mac_draw_string_common (f, gc, x, y, (char *) buf, nchars, bg_width, 2); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1124 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1125 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1126 |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1127 /* Mac replacement for XQueryTextExtents, but takes a character. If |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1128 STYLE is NULL, measurement is done by QuickDraw Text routines for |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1129 the font of the current graphics port. If CG_GLYPH is not NULL, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1130 *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */ |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1131 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1132 static OSErr |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1133 mac_query_char_extents (style, c, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1134 font_ascent_return, font_descent_return, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1135 overall_return, cg_glyph) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1136 #if USE_ATSUI |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1137 ATSUStyle style; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1138 #else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1139 void *style; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1140 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1141 int c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1142 int *font_ascent_return, *font_descent_return; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1143 XCharStruct *overall_return; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1144 #if USE_CG_TEXT_DRAWING |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1145 CGGlyph *cg_glyph; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1146 #else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1147 void *cg_glyph; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1148 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1149 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1150 OSErr err = noErr; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1151 int width; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1152 Rect char_bounds; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1153 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1154 #if USE_ATSUI |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1155 if (style) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1156 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1157 ATSUTextLayout text_layout; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1158 UniChar ch = c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1159 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1160 err = atsu_get_text_layout_with_text_ptr (&ch, 1, style, &text_layout); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1161 if (err == noErr) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1162 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1163 ATSTrapezoid glyph_bounds; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1164 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1165 err = ATSUGetGlyphBounds (text_layout, 0, 0, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1166 kATSUFromTextBeginning, kATSUToTextEnd, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1167 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1168 kATSUseFractionalOrigins, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1169 #else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1170 kATSUseDeviceOrigins, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1171 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1172 1, &glyph_bounds, NULL); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1173 if (err == noErr) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1174 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1175 xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1176 == glyph_bounds.upperRight.x - glyph_bounds.upperLeft.x); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1177 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1178 width = Fix2Long (glyph_bounds.upperRight.x |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1179 - glyph_bounds.upperLeft.x); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1180 if (font_ascent_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1181 *font_ascent_return = -Fix2Long (glyph_bounds.upperLeft.y); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1182 if (font_descent_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1183 *font_descent_return = Fix2Long (glyph_bounds.lowerLeft.y); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1184 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1185 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1186 if (err == noErr && overall_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1187 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1188 err = ATSUMeasureTextImage (text_layout, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1189 kATSUFromTextBeginning, kATSUToTextEnd, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1190 0, 0, &char_bounds); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1191 if (err == noErr) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1192 STORE_XCHARSTRUCT (*overall_return, width, char_bounds); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1193 #if USE_CG_TEXT_DRAWING |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1194 if (err == noErr && cg_glyph) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1195 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1196 OSErr err1; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1197 ATSUGlyphInfoArray glyph_info_array; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1198 ByteCount count = sizeof (ATSUGlyphInfoArray); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1199 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1200 err1 = ATSUMatchFontsToText (text_layout, kATSUFromTextBeginning, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1201 kATSUToTextEnd, NULL, NULL, NULL); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1202 if (err1 == noErr) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1203 err1 = ATSUGetGlyphInfo (text_layout, kATSUFromTextBeginning, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1204 kATSUToTextEnd, &count, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1205 &glyph_info_array); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1206 if (err1 == noErr) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1207 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1208 xassert (glyph_info_array.glyphs[0].glyphID); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1209 *cg_glyph = glyph_info_array.glyphs[0].glyphID; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1210 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1211 else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1212 *cg_glyph = 0; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1213 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1214 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1215 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1216 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1217 else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1218 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1219 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1220 if (font_ascent_return || font_descent_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1221 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1222 FontInfo font_info; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1223 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1224 GetFontInfo (&font_info); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1225 if (font_ascent_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1226 *font_ascent_return = font_info.ascent; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1227 if (font_descent_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1228 *font_descent_return = font_info.descent; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1229 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1230 if (overall_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1231 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1232 char ch = c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1233 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1234 width = CharWidth (ch); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1235 QDTextBounds (1, &ch, &char_bounds); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1236 STORE_XCHARSTRUCT (*overall_return, width, char_bounds); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1237 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1238 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1239 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1240 return err; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1241 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1242 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1243 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1244 /* Mac replacement for XTextExtents16. Only sets horizontal metrics. */ |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1245 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1246 static int |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1247 mac_text_extents_16 (font_struct, string, nchars, overall_return) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1248 XFontStruct *font_struct; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1249 XChar2b *string; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1250 int nchars; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1251 XCharStruct *overall_return; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1252 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1253 int i; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1254 short width = 0, lbearing = 0, rbearing = 0; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1255 XCharStruct *pcm; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1256 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1257 for (i = 0; i < nchars; i++) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1258 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1259 pcm = mac_per_char_metric (font_struct, string, 0); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1260 if (pcm == NULL) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1261 width += FONT_WIDTH (font_struct); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1262 else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1263 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1264 lbearing = min (lbearing, width + pcm->lbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1265 rbearing = max (rbearing, width + pcm->rbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1266 width += pcm->width; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1267 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1268 string++; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1269 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1270 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1271 overall_return->lbearing = lbearing; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1272 overall_return->rbearing = rbearing; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1273 overall_return->width = width; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1274 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1275 /* What's the meaning of the return value of XTextExtents16? */ |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1276 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1277 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1278 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1279 #if USE_CG_TEXT_DRAWING |
67000
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1280 static int cg_text_anti_aliasing_threshold = 8; |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1281 |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1282 static void |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1283 init_cg_text_anti_aliasing_threshold () |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1284 { |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1285 int threshold; |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1286 Boolean valid_p; |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1287 |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1288 threshold = |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1289 CFPreferencesGetAppIntegerValue (CFSTR ("AppleAntiAliasingThreshold"), |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1290 kCFPreferencesCurrentApplication, |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1291 &valid_p); |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1292 if (valid_p) |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
1293 cg_text_anti_aliasing_threshold = threshold; |
67000
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1294 } |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1295 |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1296 static int |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1297 mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width) |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1298 struct frame *f; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1299 GC gc; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1300 int x, y; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1301 XChar2b *buf; |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1302 int nchars, bg_width; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1303 { |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1304 CGrafPtr port; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1305 float port_height, gx, gy; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1306 int i; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1307 CGContextRef context; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1308 CGGlyph *glyphs; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1309 CGSize *advances; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1310 |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
1311 if (!mac_use_core_graphics || GC_FONT (gc)->cg_font == NULL) |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1312 return 0; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1313 |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1314 port = GetWindowPort (FRAME_MAC_WINDOW (f)); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1315 port_height = FRAME_PIXEL_HEIGHT (f); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1316 gx = x; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1317 gy = port_height - y; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1318 glyphs = (CGGlyph *)buf; |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1319 advances = alloca (sizeof (CGSize) * nchars); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1320 if (advances == NULL) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1321 return 0; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1322 for (i = 0; i < nchars; i++) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1323 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1324 XCharStruct *pcm = mac_per_char_metric (GC_FONT (gc), buf, 0); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1325 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
1326 advances[i].width = pcm->width; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1327 advances[i].height = 0; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1328 glyphs[i] = GC_FONT (gc)->cg_glyphs[buf->byte2]; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1329 buf++; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1330 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1331 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1332 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1333 context = mac_begin_cg_clip (f, gc); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1334 #else |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1335 QDBeginCGContext (port, &context); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1336 if (gc->n_clip_rects || bg_width) |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1337 { |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1338 CGContextTranslateCTM (context, 0, port_height); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1339 CGContextScaleCTM (context, 1, -1); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1340 if (gc->n_clip_rects) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1341 CGContextClipToRects (context, gc->clip_rects, gc->n_clip_rects); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1342 #endif |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1343 if (bg_width) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1344 { |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1345 CG_SET_FILL_COLOR (context, gc->xgcv.background); |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1346 CGContextFillRect |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1347 (context, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1348 CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)), |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1349 bg_width, FONT_HEIGHT (GC_FONT (gc)))); |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
1350 } |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1351 CGContextScaleCTM (context, 1, -1); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1352 CGContextTranslateCTM (context, 0, -port_height); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1353 #if !USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1354 } |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1355 #endif |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1356 CG_SET_FILL_COLOR (context, gc->xgcv.foreground); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1357 CGContextSetFont (context, GC_FONT (gc)->cg_font); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1358 CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); |
67000
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1359 if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
1360 CGContextSetShouldAntialias (context, false); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1361 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1362 CGContextSetTextPosition (context, gx, gy); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1363 CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1364 #else |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1365 for (i = 0; i < nchars; i++) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1366 { |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1367 CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1368 gx += advances[i].width; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1369 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1370 #endif |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1371 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1372 mac_end_cg_clip (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1373 #else |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1374 CGContextSynchronize (context); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1375 QDEndCGContext (port, &context); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1376 #endif |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1377 |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1378 return 1; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1379 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1380 #endif |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1381 |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
1382 |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
1383 #if !USE_CG_DRAWING |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1384 /* Mac replacement for XCopyArea: dest must be window. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1385 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1386 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1387 mac_copy_area (src, f, gc, src_x, src_y, width, height, dest_x, dest_y) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1388 Pixmap src; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1389 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1390 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1391 int src_x, src_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1392 unsigned int width, height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1393 int dest_x, dest_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1394 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1395 Rect src_r, dest_r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1396 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1397 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1398 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1399 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1400 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1401 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1402 ForeColor (blackColor); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1403 BackColor (whiteColor); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1404 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1405 mac_begin_clip (gc); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1406 LockPixels (GetGWorldPixMap (src)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1407 #if TARGET_API_MAC_CARBON |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1408 { |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1409 CGrafPtr port; |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1410 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1411 GetPort (&port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1412 LockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1413 CopyBits (GetPortBitMapForCopyBits (src), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1414 GetPortBitMapForCopyBits (port), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1415 &src_r, &dest_r, srcCopy, 0); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1416 UnlockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1417 } |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1418 #else /* not TARGET_API_MAC_CARBON */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1419 CopyBits (&(((GrafPtr)src)->portBits), &(FRAME_MAC_WINDOW (f)->portBits), |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1420 &src_r, &dest_r, srcCopy, 0); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1421 #endif /* not TARGET_API_MAC_CARBON */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1422 UnlockPixels (GetGWorldPixMap (src)); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1423 mac_end_clip (gc); |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
1424 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1425 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1426 } |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1427 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1428 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1429 static void |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1430 mac_copy_area_with_mask (src, mask, f, gc, src_x, src_y, |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1431 width, height, dest_x, dest_y) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1432 Pixmap src, mask; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1433 struct frame *f; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1434 GC gc; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1435 int src_x, src_y; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1436 unsigned int width, height; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1437 int dest_x, dest_y; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1438 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1439 Rect src_r, dest_r; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1440 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1441 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1442 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1443 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1444 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1445 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1446 ForeColor (blackColor); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1447 BackColor (whiteColor); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1448 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1449 mac_begin_clip (gc); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1450 LockPixels (GetGWorldPixMap (src)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1451 LockPixels (GetGWorldPixMap (mask)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1452 #if TARGET_API_MAC_CARBON |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1453 { |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1454 CGrafPtr port; |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1455 |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1456 GetPort (&port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1457 LockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1458 CopyMask (GetPortBitMapForCopyBits (src), GetPortBitMapForCopyBits (mask), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1459 GetPortBitMapForCopyBits (port), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1460 &src_r, &src_r, &dest_r); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1461 UnlockPortBits (port); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1462 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1463 #else /* not TARGET_API_MAC_CARBON */ |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1464 CopyMask (&(((GrafPtr)src)->portBits), &(((GrafPtr)mask)->portBits), |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1465 &(FRAME_MAC_WINDOW (f)->portBits), &src_r, &src_r, &dest_r); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1466 #endif /* not TARGET_API_MAC_CARBON */ |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1467 UnlockPixels (GetGWorldPixMap (mask)); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1468 UnlockPixels (GetGWorldPixMap (src)); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1469 mac_end_clip (gc); |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
1470 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1471 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1472 } |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
1473 #endif /* !USE_CG_DRAWING */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1474 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1475 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1476 /* Mac replacement for XCopyArea: used only for scrolling. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1477 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1478 static void |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1479 mac_scroll_area (f, gc, src_x, src_y, width, height, dest_x, dest_y) |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1480 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1481 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1482 int src_x, src_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1483 unsigned int width, height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1484 int dest_x, dest_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1485 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1486 #if TARGET_API_MAC_CARBON |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1487 Rect src_r; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1488 RgnHandle dummy = NewRgn (); /* For avoiding update events. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1489 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1490 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1491 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1492 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1493 #endif |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1494 ScrollWindowRect (FRAME_MAC_WINDOW (f), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1495 &src_r, dest_x - src_x, dest_y - src_y, |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1496 kScrollWindowNoOptions, dummy); |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1497 DisposeRgn (dummy); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1498 #else /* not TARGET_API_MAC_CARBON */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1499 Rect src_r, dest_r; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1500 WindowPtr w = FRAME_MAC_WINDOW (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1501 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1502 SetPort (w); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1503 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1504 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1505 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1506 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1507 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1508 color mapping in CopyBits. Otherwise, it will be slow. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1509 ForeColor (blackColor); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1510 BackColor (whiteColor); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1511 mac_begin_clip (gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1512 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1513 mac_end_clip (gc); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1514 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1515 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1516 #endif /* not TARGET_API_MAC_CARBON */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1517 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1518 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1519 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1520 /* Mac replacement for XChangeGC. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1521 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1522 static void |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1523 XChangeGC (display, gc, mask, xgcv) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1524 Display *display; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1525 GC gc; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1526 unsigned long mask; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1527 XGCValues *xgcv; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1528 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1529 if (mask & GCForeground) |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1530 XSetForeground (display, gc, xgcv->foreground); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1531 if (mask & GCBackground) |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1532 XSetBackground (display, gc, xgcv->background); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1533 if (mask & GCFont) |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1534 XSetFont (display, gc, xgcv->font); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1535 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1536 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1537 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1538 /* Mac replacement for XCreateGC. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1539 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1540 GC |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1541 XCreateGC (display, window, mask, xgcv) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1542 Display *display; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1543 Window window; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1544 unsigned long mask; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1545 XGCValues *xgcv; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1546 { |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1547 GC gc = xmalloc (sizeof (*gc)); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1548 |
70071
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
1549 bzero (gc, sizeof (*gc)); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
1550 XChangeGC (display, gc, mask, xgcv); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1551 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1552 return gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1553 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1554 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1555 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1556 /* Used in xfaces.c. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1557 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1558 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1559 XFreeGC (display, gc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1560 Display *display; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1561 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1562 { |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1563 if (gc->clip_region) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1564 DisposeRgn (gc->clip_region); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1565 xfree (gc); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1566 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1567 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1568 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1569 /* Mac replacement for XGetGCValues. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1570 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1571 static void |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1572 XGetGCValues (display, gc, mask, xgcv) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1573 Display *display; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1574 GC gc; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1575 unsigned long mask; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1576 XGCValues *xgcv; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1577 { |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1578 if (mask & GCForeground) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1579 xgcv->foreground = gc->xgcv.foreground; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1580 if (mask & GCBackground) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1581 xgcv->background = gc->xgcv.background; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1582 if (mask & GCFont) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1583 xgcv->font = gc->xgcv.font; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1584 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1585 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1586 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1587 /* Mac replacement for XSetForeground. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1588 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
1589 void |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1590 XSetForeground (display, gc, color) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1591 Display *display; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1592 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1593 unsigned long color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1594 { |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1595 if (gc->xgcv.foreground != color) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1596 { |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1597 gc->xgcv.foreground = color; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1598 gc->fore_color.red = RED16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1599 gc->fore_color.green = GREEN16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1600 gc->fore_color.blue = BLUE16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1601 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1602 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1603 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1604 |
59575
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1605 /* Mac replacement for XSetBackground. */ |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1606 |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1607 void |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1608 XSetBackground (display, gc, color) |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1609 Display *display; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1610 GC gc; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1611 unsigned long color; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1612 { |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1613 if (gc->xgcv.background != color) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1614 { |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1615 gc->xgcv.background = color; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1616 gc->back_color.red = RED16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1617 gc->back_color.green = GREEN16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1618 gc->back_color.blue = BLUE16_FROM_ULONG (color); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1619 } |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1620 } |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1621 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1622 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1623 /* Mac replacement for XSetFont. */ |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1624 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1625 static void |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1626 XSetFont (display, gc, font) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1627 Display *display; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1628 GC gc; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1629 XFontStruct *font; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1630 { |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
1631 gc->xgcv.font = font; |
59575
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1632 } |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1633 |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1634 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1635 /* Mac replacement for XSetClipRectangles. */ |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1636 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1637 static void |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1638 mac_set_clip_rectangles (display, gc, rectangles, n) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1639 Display *display; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1640 GC gc; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1641 Rect *rectangles; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1642 int n; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1643 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1644 int i; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1645 |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1646 xassert (n >= 0 && n <= MAX_CLIP_RECTS); |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1647 |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1648 gc->n_clip_rects = n; |
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1649 if (n > 0) |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1650 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1651 if (gc->clip_region == NULL) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1652 gc->clip_region = NewRgn (); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1653 RectRgn (gc->clip_region, rectangles); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1654 if (n > 1) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1655 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1656 RgnHandle region = NewRgn (); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1657 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1658 for (i = 1; i < n; i++) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1659 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1660 RectRgn (region, rectangles + i); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1661 UnionRgn (gc->clip_region, region, gc->clip_region); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1662 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1663 DisposeRgn (region); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1664 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1665 } |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
1666 #if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING) |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1667 for (i = 0; i < n; i++) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1668 { |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1669 Rect *rect = rectangles + i; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1670 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1671 gc->clip_rects[i] = CGRectMake (rect->left, rect->top, |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1672 rect->right - rect->left, |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1673 rect->bottom - rect->top); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1674 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1675 #endif |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1676 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1677 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1678 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1679 /* Mac replacement for XSetClipMask. */ |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1680 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1681 static INLINE void |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1682 mac_reset_clip_rectangles (display, gc) |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1683 Display *display; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1684 GC gc; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1685 { |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
1686 gc->n_clip_rects = 0; |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1687 } |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1688 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
1689 |
59575
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1690 /* Mac replacement for XSetWindowBackground. */ |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1691 |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1692 void |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1693 XSetWindowBackground (display, w, color) |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1694 Display *display; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1695 WindowPtr w; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1696 unsigned long color; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1697 { |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1698 #if !TARGET_API_MAC_CARBON |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1699 AuxWinHandle aw_handle; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1700 CTabHandle ctab_handle; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1701 ColorSpecPtr ct_table; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1702 short ct_size; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1703 #endif |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1704 RGBColor bg_color; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1705 |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1706 bg_color.red = RED16_FROM_ULONG (color); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1707 bg_color.green = GREEN16_FROM_ULONG (color); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1708 bg_color.blue = BLUE16_FROM_ULONG (color); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1709 |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1710 #if TARGET_API_MAC_CARBON |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1711 SetWindowContentColor (w, &bg_color); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1712 #else |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1713 if (GetAuxWin (w, &aw_handle)) |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1714 { |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1715 ctab_handle = (*aw_handle)->awCTable; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1716 HandToHand ((Handle *) &ctab_handle); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1717 ct_table = (*ctab_handle)->ctTable; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1718 ct_size = (*ctab_handle)->ctSize; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1719 while (ct_size > -1) |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1720 { |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1721 if (ct_table->value == 0) |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1722 { |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1723 ct_table->rgb = bg_color; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1724 CTabChanged (ctab_handle); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1725 SetWinColor (w, (WCTabHandle) ctab_handle); |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1726 } |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1727 ct_size--; |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1728 } |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1729 } |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1730 #endif |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1731 } |
011a0c55c1f2
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
Steven Tamm <steventamm@mac.com>
parents:
59407
diff
changeset
|
1732 |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1733 /* Flush display of frame F, or of all frames if F is null. */ |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1734 |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1735 static void |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1736 x_flush (f) |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1737 struct frame *f; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1738 { |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1739 #if TARGET_API_MAC_CARBON |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1740 BLOCK_INPUT; |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1741 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1742 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
1743 #endif |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1744 if (f) |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1745 QDFlushPortBuffer (GetWindowPort (FRAME_MAC_WINDOW (f)), NULL); |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1746 else |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1747 QDFlushPortBuffer (GetQDGlobalsThePort (), NULL); |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1748 UNBLOCK_INPUT; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1749 #endif |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1750 } |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1751 |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
1752 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1753 /* Remove calls to XFlush by defining XFlush to an empty replacement. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1754 Calls to XFlush should be unnecessary because the X output buffer |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1755 is flushed automatically as needed by calls to XPending, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1756 XNextEvent, or XWindowEvent according to the XFlush man page. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1757 XTread_socket calls XPending. Removing XFlush improves |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1758 performance. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1759 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1760 #define XFlush(DISPLAY) (void) 0 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1761 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1762 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1763 /* Return the struct mac_display_info corresponding to DPY. There's |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1764 only one. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1765 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1766 struct mac_display_info * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1767 mac_display_info_for_display (dpy) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1768 Display *dpy; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1769 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1770 return &one_mac_display_info; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1771 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1772 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1773 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1774 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1775 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1776 Starting and ending an update |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1777 ***********************************************************************/ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1778 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1779 /* Start an update of frame F. This function is installed as a hook |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1780 for update_begin, i.e. it is called when update_begin is called. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1781 This function is called prior to calls to x_update_window_begin for |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1782 each window being updated. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1783 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1784 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1785 x_update_begin (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1786 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1787 { |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1788 #if TARGET_API_MAC_CARBON |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1789 /* During update of a frame, availability of input events is |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1790 periodically checked with ReceiveNextEvent if |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1791 redisplay-dont-pause is nil. That normally flushes window buffer |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1792 changes for every check, and thus screen update looks waving even |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1793 if no input is available. So we disable screen updates during |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1794 update of a frame. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1795 BLOCK_INPUT; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1796 DisableScreenUpdates (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1797 UNBLOCK_INPUT; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1798 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1799 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1800 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1801 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1802 /* Start update of window W. Set the global variable updated_window |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1803 to the window being updated and set output_cursor to the cursor |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1804 position of W. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1805 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1806 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1807 x_update_window_begin (w) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1808 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1809 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1810 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1811 struct mac_display_info *display_info = FRAME_MAC_DISPLAY_INFO (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1812 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1813 updated_window = w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1814 set_output_cursor (&w->cursor); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1815 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1816 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1817 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1818 if (f == display_info->mouse_face_mouse_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1819 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1820 /* Don't do highlighting for mouse motion during the update. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1821 display_info->mouse_face_defer = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1822 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1823 /* If F needs to be redrawn, simply forget about any prior mouse |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1824 highlighting. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1825 if (FRAME_GARBAGED_P (f)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1826 display_info->mouse_face_window = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1827 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1828 #if 0 /* Rows in a current matrix containing glyphs in mouse-face have |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1829 their mouse_face_p flag set, which means that they are always |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1830 unequal to rows in a desired matrix which never have that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1831 flag set. So, rows containing mouse-face glyphs are never |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1832 scrolled, and we don't have to switch the mouse highlight off |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1833 here to prevent it from being scrolled. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1834 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1835 /* Can we tell that this update does not affect the window |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1836 where the mouse highlight is? If so, no need to turn off. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1837 Likewise, don't do anything if the frame is garbaged; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1838 in that case, the frame's current matrix that we would use |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1839 is all wrong, and we will redisplay that line anyway. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1840 if (!NILP (display_info->mouse_face_window) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1841 && w == XWINDOW (display_info->mouse_face_window)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1842 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1843 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1844 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
1845 for (i = 0; i < w->desired_matrix->nrows; ++i) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1846 if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1847 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1848 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1849 if (i < w->desired_matrix->nrows) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1850 clear_mouse_face (display_info); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1851 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1852 #endif /* 0 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1853 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1854 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1855 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1856 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1857 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1858 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1859 /* Draw a vertical window border from (x,y0) to (x,y1) */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1860 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1861 static void |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1862 mac_draw_vertical_window_border (w, x, y0, y1) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1863 struct window *w; |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1864 int x, y0, y1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1865 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1866 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1867 struct face *face; |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1868 |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1869 face = FACE_FROM_ID (f, VERTICAL_BORDER_FACE_ID); |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1870 if (face) |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1871 XSetForeground (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc, |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
1872 face->foreground); |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
1873 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
1874 mac_draw_line (f, f->output_data.mac->normal_gc, x, y0, x, y1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1875 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1876 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1877 /* End update of window W (which is equal to updated_window). |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1878 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1879 Draw vertical borders between horizontally adjacent windows, and |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1880 display W's cursor if CURSOR_ON_P is non-zero. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1881 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1882 MOUSE_FACE_OVERWRITTEN_P non-zero means that some row containing |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1883 glyphs in mouse-face were overwritten. In that case we have to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1884 make sure that the mouse-highlight is properly redrawn. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1885 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1886 W may be a menu bar pseudo-window in case we don't have X toolkit |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1887 support. Such windows don't have a cursor, so don't display it |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
1888 here. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1889 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1890 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1891 x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1892 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1893 int cursor_on_p, mouse_face_overwritten_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1894 { |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1895 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (XFRAME (w->frame)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1896 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1897 if (!w->pseudo_window_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1898 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1899 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1900 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1901 if (cursor_on_p) |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1902 display_and_set_cursor (w, 1, output_cursor.hpos, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1903 output_cursor.vpos, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
1904 output_cursor.x, output_cursor.y); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1905 |
57373
38e45bf0128a
(x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents:
57357
diff
changeset
|
1906 if (draw_window_fringes (w, 1)) |
38e45bf0128a
(x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents:
57357
diff
changeset
|
1907 x_draw_vertical_border (w); |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
1908 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1909 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1910 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1911 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1912 /* If a row with mouse-face was overwritten, arrange for |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1913 XTframe_up_to_date to redisplay the mouse highlight. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1914 if (mouse_face_overwritten_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1915 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1916 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1917 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1918 dpyinfo->mouse_face_window = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1919 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1920 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1921 updated_window = NULL; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1922 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1923 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1924 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1925 /* End update of frame F. This function is installed as a hook in |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1926 update_end. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1927 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1928 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1929 x_update_end (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1930 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1931 { |
56890
e8bafb4b47db
(x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents:
56477
diff
changeset
|
1932 /* Mouse highlight may be displayed again. */ |
e8bafb4b47db
(x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents:
56477
diff
changeset
|
1933 FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0; |
e8bafb4b47db
(x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents:
56477
diff
changeset
|
1934 |
e8bafb4b47db
(x_update_end): Move SetPortWindowPort to inside
Steven Tamm <steventamm@mac.com>
parents:
56477
diff
changeset
|
1935 BLOCK_INPUT; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1936 #if TARGET_API_MAC_CARBON |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1937 EnableScreenUpdates (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
1938 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1939 XFlush (FRAME_MAC_DISPLAY (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1940 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1941 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1942 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1943 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1944 /* This function is called from various places in xdisp.c whenever a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1945 complete update has been performed. The global variable |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1946 updated_window is not available here. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1947 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1948 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1949 XTframe_up_to_date (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1950 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1951 { |
55539
db942c4b4345
macterm.c (x_flush, XTframe_up_to_date): use FRAME_MAC_P
Steven Tamm <steventamm@mac.com>
parents:
55412
diff
changeset
|
1952 if (FRAME_MAC_P (f)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1953 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1954 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1955 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1956 if (dpyinfo->mouse_face_deferred_gc |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1957 || f == dpyinfo->mouse_face_mouse_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1958 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1959 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1960 if (dpyinfo->mouse_face_mouse_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1961 note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1962 dpyinfo->mouse_face_mouse_x, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1963 dpyinfo->mouse_face_mouse_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1964 dpyinfo->mouse_face_deferred_gc = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1965 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1966 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1967 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1968 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1969 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1970 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1971 /* Draw truncation mark bitmaps, continuation mark bitmaps, overlay |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1972 arrow bitmaps, or clear the fringes if no bitmaps are required |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1973 before DESIRED_ROW is made current. The window being updated is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1974 found in updated_window. This function is called from |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1975 update_window_line only if it is known that there are differences |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1976 between bitmaps to be drawn between current row and DESIRED_ROW. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1977 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1978 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1979 x_after_update_window_line (desired_row) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1980 struct glyph_row *desired_row; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1981 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1982 struct window *w = updated_window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1983 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1984 int width, height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1985 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1986 xassert (w); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
1987 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1988 if (!desired_row->mode_line_p && !w->pseudo_window_p) |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
1989 desired_row->redraw_fringe_bitmaps_p = 1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1990 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1991 /* When a window has disappeared, make sure that no rest of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1992 full-width rows stays visible in the internal border. Could |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1993 check here if updated_window is the leftmost/rightmost window, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1994 but I guess it's not worth doing since vertically split windows |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1995 are almost never used, internal border is rarely set, and the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1996 overhead is very small. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1997 if (windows_or_buffers_changed |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1998 && desired_row->full_width_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
1999 && (f = XFRAME (w->frame), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2000 width = FRAME_INTERNAL_BORDER_WIDTH (f), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2001 width != 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2002 && (height = desired_row->visible_height, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2003 height > 0)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2004 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2005 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
2006 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2007 /* Internal border is drawn below the tool bar. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2008 if (WINDOWP (f->tool_bar_window) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2009 && w == XWINDOW (f->tool_bar_window)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2010 y -= width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2011 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2012 BLOCK_INPUT; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2013 mac_clear_area (f, 0, y, width, height); |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2014 mac_clear_area (f, FRAME_PIXEL_WIDTH (f) - width, y, width, height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2015 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2016 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2017 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2018 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2019 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2020 /* Draw the bitmap WHICH in one of the left or right fringes of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2021 window W. ROW is the glyph row for which to display the bitmap; it |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2022 determines the vertical position at which the bitmap has to be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2023 drawn. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2024 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2025 static void |
50097 | 2026 x_draw_fringe_bitmap (w, row, p) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2027 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2028 struct glyph_row *row; |
50097 | 2029 struct draw_fringe_bitmap_params *p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2030 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2031 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2032 Display *display = FRAME_MAC_DISPLAY (f); |
50097 | 2033 struct face *face = p->face; |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2034 int rowY; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2035 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2036 /* Must clip because of partially visible lines. */ |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2037 rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2038 if (p->y < rowY) |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2039 { |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2040 /* Adjust position of "bottom aligned" bitmap on partially |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2041 visible last row. */ |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2042 int oldY = row->y; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2043 int oldVH = row->visible_height; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2044 row->visible_height = p->h; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2045 row->y -= rowY - p->y; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2046 x_clip_to_row (w, row, -1, face->gc); |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2047 row->y = oldY; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2048 row->visible_height = oldVH; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2049 } |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
2050 else |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2051 x_clip_to_row (w, row, -1, face->gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2052 |
53885
693745d24f76
(x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents:
53722
diff
changeset
|
2053 if (p->bx >= 0 && !p->overlay_p) |
50097 | 2054 { |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2055 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2056 /* In case the same realized face is used for fringes and |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2057 for something displayed in the text (e.g. face `region' on |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2058 mono-displays, the fill style may have been changed to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2059 FillSolid in x_draw_glyph_string_background. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2060 if (face->stipple) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2061 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2062 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2063 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2064 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2065 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2066 mac_erase_rectangle (f, face->gc, p->bx, p->by, p->nx, p->ny); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2067 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2068 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2069 if (!face->stipple) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2070 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2071 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2072 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2073 |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2074 if (p->which |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2075 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2076 && p->which < max_fringe_bmp |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2077 #endif |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2078 ) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2079 { |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2080 XGCValues gcv; |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2081 |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2082 XGetGCValues (display, face->gc, GCForeground, &gcv); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2083 XSetForeground (display, face->gc, |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2084 (p->cursor_p |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2085 ? (p->overlay_p ? face->background |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2086 : f->output_data.mac->cursor_pixel) |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2087 : face->foreground)); |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2088 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2089 mac_draw_cg_image (fringe_bmp[p->which], f, face->gc, 0, p->dh, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2090 p->wd, p->h, p->x, p->y, p->overlay_p); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2091 #else |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2092 mac_draw_bitmap (f, face->gc, p->x, p->y, |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2093 p->wd, p->h, p->bits + p->dh, p->overlay_p); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2094 #endif |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
2095 XSetForeground (display, face->gc, gcv.foreground); |
50097 | 2096 } |
2097 | |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2098 mac_reset_clip_rectangles (display, face->gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2099 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2100 |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2101 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2102 static void |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2103 mac_define_fringe_bitmap (which, bits, h, wd) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2104 int which; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2105 unsigned short *bits; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2106 int h, wd; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2107 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2108 int i; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2109 CGDataProviderRef provider; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2110 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2111 if (which >= max_fringe_bmp) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2112 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2113 i = max_fringe_bmp; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2114 max_fringe_bmp = which + 20; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2115 fringe_bmp = (CGImageRef *) xrealloc (fringe_bmp, max_fringe_bmp * sizeof (CGImageRef)); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2116 while (i < max_fringe_bmp) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2117 fringe_bmp[i++] = 0; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2118 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2119 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2120 for (i = 0; i < h; i++) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2121 bits[i] = ~bits[i]; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2122 provider = CGDataProviderCreateWithData (NULL, bits, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2123 sizeof (unsigned short) * h, NULL); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2124 if (provider) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2125 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2126 fringe_bmp[which] = CGImageMaskCreate (wd, h, 1, 1, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2127 sizeof (unsigned short), |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2128 provider, NULL, 0); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2129 CGDataProviderRelease (provider); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2130 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2131 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2132 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2133 static void |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2134 mac_destroy_fringe_bitmap (which) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2135 int which; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2136 { |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2137 if (which >= max_fringe_bmp) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2138 return; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2139 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2140 if (fringe_bmp[which]) |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2141 CGImageRelease (fringe_bmp[which]); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2142 fringe_bmp[which] = 0; |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2143 } |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
2144 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2145 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
2146 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2147 /* This is called when starting Emacs and when restarting after |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2148 suspend. When starting Emacs, no window is mapped. And nothing |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2149 must be done to Emacs's own window if it is suspended (though that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2150 rarely happens). */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2151 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2152 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2153 XTset_terminal_modes () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2154 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2155 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2156 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2157 /* This is called when exiting or suspending Emacs. Exiting will make |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2158 the windows go away, and suspending requires no action. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2159 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2160 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2161 XTreset_terminal_modes () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2162 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2163 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2164 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
2165 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2166 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2167 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2168 Display Iterator |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2169 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2170 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2171 /* Function prototypes of this page. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2172 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2173 static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2174 static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2175 struct charset *, int *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2176 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2177 |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2178 static void |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2179 pcm_init (pcm, count) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2180 XCharStruct *pcm; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2181 int count; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2182 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2183 bzero (pcm, sizeof (XCharStruct) * count); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2184 while (--count >= 0) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2185 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2186 pcm->descent = PCM_INVALID; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2187 pcm++; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2188 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2189 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2190 |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2191 static enum pcm_status |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2192 pcm_get_status (pcm) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2193 XCharStruct *pcm; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2194 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2195 int height = pcm->ascent + pcm->descent; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2196 |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2197 /* Negative height means some special status. */ |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2198 return height >= 0 ? PCM_VALID : height; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2199 } |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2200 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2201 /* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2202 is not contained in the font. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2203 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2204 static INLINE XCharStruct * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2205 x_per_char_metric (font, char2b) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2206 XFontStruct *font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2207 XChar2b *char2b; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2208 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2209 /* The result metric information. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2210 XCharStruct *pcm = NULL; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2211 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2212 xassert (font && char2b); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2213 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2214 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2215 if (font->mac_style) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2216 { |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2217 XCharStruct **row = font->bounds.rows + char2b->byte1; |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2218 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2219 if (*row == NULL) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2220 { |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2221 *row = xmalloc (sizeof (XCharStruct) * 0x100); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2222 pcm_init (*row, 0x100); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2223 } |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2224 pcm = *row + char2b->byte2; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
2225 if (pcm_get_status (pcm) != PCM_VALID) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2226 { |
70071
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
2227 BLOCK_INPUT; |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
2228 mac_query_char_extents (font->mac_style, |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
2229 (char2b->byte1 << 8) + char2b->byte2, |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
2230 NULL, NULL, pcm, NULL); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
2231 UNBLOCK_INPUT; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2232 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2233 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2234 else |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2235 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2236 #endif |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2237 if (font->bounds.per_char != NULL) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2238 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2239 if (font->min_byte1 == 0 && font->max_byte1 == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2240 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2241 /* min_char_or_byte2 specifies the linear character index |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2242 corresponding to the first element of the per_char array, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2243 max_char_or_byte2 is the index of the last character. A |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2244 character with non-zero CHAR2B->byte1 is not in the font. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2245 A character with byte2 less than min_char_or_byte2 or |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2246 greater max_char_or_byte2 is not in the font. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2247 if (char2b->byte1 == 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2248 && char2b->byte2 >= font->min_char_or_byte2 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2249 && char2b->byte2 <= font->max_char_or_byte2) |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2250 pcm = font->bounds.per_char |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2251 + (char2b->byte2 - font->min_char_or_byte2); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2252 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2253 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2254 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2255 /* If either min_byte1 or max_byte1 are nonzero, both |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2256 min_char_or_byte2 and max_char_or_byte2 are less than |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2257 256, and the 2-byte character index values corresponding |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2258 to the per_char array element N (counting from 0) are: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2259 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2260 byte1 = N/D + min_byte1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2261 byte2 = N\D + min_char_or_byte2 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2262 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2263 where: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2264 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2265 D = max_char_or_byte2 - min_char_or_byte2 + 1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2266 / = integer division |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2267 \ = integer modulus */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2268 if (char2b->byte1 >= font->min_byte1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2269 && char2b->byte1 <= font->max_byte1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2270 && char2b->byte2 >= font->min_char_or_byte2 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2271 && char2b->byte2 <= font->max_char_or_byte2) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2272 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
2273 pcm = (font->bounds.per_char |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2274 + ((font->max_char_or_byte2 - font->min_char_or_byte2 + 1) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2275 * (char2b->byte1 - font->min_byte1)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2276 + (char2b->byte2 - font->min_char_or_byte2)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2277 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2278 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2279 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2280 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2281 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2282 /* If the per_char pointer is null, all glyphs between the first |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2283 and last character indexes inclusive have the same |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2284 information, as given by both min_bounds and max_bounds. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2285 if (char2b->byte2 >= font->min_char_or_byte2 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2286 && char2b->byte2 <= font->max_char_or_byte2) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2287 pcm = &font->max_bounds; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2288 } |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2289 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2290 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2291 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2292 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2293 return ((pcm == NULL |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
2294 || (pcm->width == 0 |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
2295 #if 0 /* Show hollow boxes for zero-width glyphs such as combining diacritics. */ |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
2296 && (pcm->rbearing - pcm->lbearing) == 0 |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
2297 #endif |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
2298 )) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2299 ? NULL : pcm); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2300 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2301 |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2302 /* RIF: |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2303 */ |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2304 |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2305 static XCharStruct * |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2306 mac_per_char_metric (font, char2b, font_type) |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2307 XFontStruct *font; |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2308 XChar2b *char2b; |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2309 int font_type; |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2310 { |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2311 return x_per_char_metric (font, char2b); |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2312 } |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2313 |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2314 /* RIF: |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2315 Encode CHAR2B using encoding information from FONT_INFO. CHAR2B is |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2316 the two-byte form of C. Encoding is returned in *CHAR2B. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2317 |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2318 static int |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2319 mac_encode_char (c, char2b, font_info, charset, two_byte_p) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2320 int c; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2321 XChar2b *char2b; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2322 struct font_info *font_info; |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2323 struct charset *charset; |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2324 int *two_byte_p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2325 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2326 XFontStruct *font = font_info->font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2327 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2328 /* FONT_INFO may define a scheme by which to encode byte1 and byte2. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2329 This may be either a program in a special encoder language or a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2330 fixed encoding. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2331 if (font_info->font_encoder) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2332 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2333 /* It's a program. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2334 struct ccl_program *ccl = font_info->font_encoder; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2335 |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
2336 check_ccl_update (ccl); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2337 if (CHARSET_DIMENSION (charset) == 1) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2338 { |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2339 ccl->reg[0] = CHARSET_ID (charset); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2340 ccl->reg[1] = XCHAR2B_BYTE2 (char2b); |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
2341 ccl->reg[2] = -1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2342 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2343 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2344 { |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2345 ccl->reg[0] = CHARSET_ID (charset); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2346 ccl->reg[1] = XCHAR2B_BYTE1 (char2b); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2347 ccl->reg[2] = XCHAR2B_BYTE2 (char2b); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2348 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2349 |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2350 ccl_driver (ccl, NULL, NULL, 0, 0, Qnil); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2351 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2352 /* We assume that MSBs are appropriately set/reset by CCL |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2353 program. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2354 if (font->max_byte1 == 0) /* 1-byte font */ |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2355 STORE_XCHAR2B (char2b, 0, ccl->reg[1]); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2356 else |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2357 STORE_XCHAR2B (char2b, ccl->reg[1], ccl->reg[2]); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2358 } |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2359 else if (font_info->encoding_type) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2360 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2361 /* Fixed encoding scheme. See fontset.h for the meaning of the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2362 encoding numbers. */ |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
2363 unsigned char enc = font_info->encoding_type; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2364 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2365 if ((enc == 1 || enc == 2) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2366 && CHARSET_DIMENSION (charset) == 2) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2367 char2b->byte1 |= 0x80; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2368 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2369 if (enc == 1 || enc == 3) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2370 char2b->byte2 |= 0x80; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2371 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2372 if (enc == 4) |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2373 { |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2374 int code = (char2b->byte1 << 8) | char2b->byte2; |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2375 |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2376 JIS_TO_SJIS (code); |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2377 STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF)); |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
2378 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2379 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2380 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2381 if (two_byte_p) |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2382 *two_byte_p = ((XFontStruct *) (font_info->font))->max_byte1 > 0; |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2383 |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2384 return FONT_TYPE_UNKNOWN; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2385 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2386 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2387 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2388 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2389 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2390 Glyph display |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2391 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2392 |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2393 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
2394 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2395 static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2396 static void x_set_glyph_string_gc P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2397 static void x_draw_glyph_string_background P_ ((struct glyph_string *, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2398 int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2399 static void x_draw_glyph_string_foreground P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2400 static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2401 static void x_draw_glyph_string_box P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2402 static void x_draw_glyph_string P_ ((struct glyph_string *)); |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
2403 static void mac_compute_glyph_string_overhangs P_ ((struct glyph_string *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2404 static void x_set_cursor_gc P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2405 static void x_set_mode_line_face_gc P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2406 static void x_set_mouse_face_gc P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2407 /*static int x_alloc_lighter_color P_ ((struct frame *, Display *, Colormap, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2408 unsigned long *, double, int));*/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2409 static void x_setup_relief_color P_ ((struct frame *, struct relief *, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2410 double, int, unsigned long)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2411 static void x_setup_relief_colors P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2412 static void x_draw_image_glyph_string P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2413 static void x_draw_image_relief P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2414 static void x_draw_image_foreground P_ ((struct glyph_string *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2415 static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2416 int, int, int)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2417 static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
2418 int, int, int, int, int, int, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
2419 Rect *)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2420 static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2421 int, int, int, Rect *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2422 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2423 #if GLYPH_DEBUG |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2424 static void x_check_font P_ ((struct frame *, XFontStruct *)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2425 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2426 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2427 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2428 /* Set S->gc to a suitable GC for drawing glyph string S in cursor |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2429 face. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2430 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2431 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2432 x_set_cursor_gc (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2433 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2434 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2435 if (s->font == FRAME_FONT (s->f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2436 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2437 && s->face->foreground == FRAME_FOREGROUND_PIXEL (s->f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2438 && !s->cmp) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2439 s->gc = s->f->output_data.mac->cursor_gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2440 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2441 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2442 /* Cursor on non-default face: must merge. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2443 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2444 unsigned long mask; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2445 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2446 xgcv.background = s->f->output_data.mac->cursor_pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2447 xgcv.foreground = s->face->background; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2448 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2449 /* If the glyph would be invisible, try a different foreground. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2450 if (xgcv.foreground == xgcv.background) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2451 xgcv.foreground = s->face->foreground; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2452 if (xgcv.foreground == xgcv.background) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2453 xgcv.foreground = s->f->output_data.mac->cursor_foreground_pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2454 if (xgcv.foreground == xgcv.background) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2455 xgcv.foreground = s->face->foreground; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2456 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2457 /* Make sure the cursor is distinct from text in this face. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2458 if (xgcv.background == s->face->background |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2459 && xgcv.foreground == s->face->foreground) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2460 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2461 xgcv.background = s->face->foreground; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2462 xgcv.foreground = s->face->background; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2463 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2464 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2465 IF_DEBUG (x_check_font (s->f, s->font)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2466 xgcv.font = s->font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2467 mask = GCForeground | GCBackground | GCFont; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2468 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2469 if (FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2470 XChangeGC (s->display, FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2471 mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2472 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2473 FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2474 = XCreateGC (s->display, s->window, mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2475 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2476 s->gc = FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2477 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2478 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2479 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2480 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2481 /* Set up S->gc of glyph string S for drawing text in mouse face. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2482 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2483 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2484 x_set_mouse_face_gc (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2485 struct glyph_string *s; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2486 { |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2487 int face_id; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2488 struct face *face; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2489 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2490 /* What face has to be used last for the mouse face? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2491 face_id = FRAME_X_DISPLAY_INFO (s->f)->mouse_face_face_id; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2492 face = FACE_FROM_ID (s->f, face_id); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2493 if (face == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2494 face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2495 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2496 if (s->first_glyph->type == CHAR_GLYPH) |
89709
688136a6cab5
(x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
2497 face_id = FACE_FOR_CHAR (s->f, face, s->first_glyph->u.ch, -1, Qnil); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2498 else |
89709
688136a6cab5
(x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
2499 face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2500 s->face = FACE_FROM_ID (s->f, face_id); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2501 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2502 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2503 /* If font in this face is same as S->font, use it. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2504 if (s->font == s->face->font) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2505 s->gc = s->face->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2506 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2507 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2508 /* Otherwise construct scratch_cursor_gc with values from FACE |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2509 but font FONT. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2510 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2511 unsigned long mask; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2512 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2513 xgcv.background = s->face->background; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2514 xgcv.foreground = s->face->foreground; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2515 IF_DEBUG (x_check_font (s->f, s->font)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2516 xgcv.font = s->font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2517 mask = GCForeground | GCBackground | GCFont; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2518 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2519 if (FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2520 XChangeGC (s->display, FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2521 mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2522 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2523 FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2524 = XCreateGC (s->display, s->window, mask, &xgcv); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2525 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2526 s->gc = FRAME_MAC_DISPLAY_INFO (s->f)->scratch_cursor_gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2527 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2528 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2529 xassert (s->gc != 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2530 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2531 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2532 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2533 /* Set S->gc of glyph string S to a GC suitable for drawing a mode line. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2534 Faces to use in the mode line have already been computed when the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2535 matrix was built, so there isn't much to do, here. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2536 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2537 static INLINE void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2538 x_set_mode_line_face_gc (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2539 struct glyph_string *s; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2540 { |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2541 s->gc = s->face->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2542 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2543 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2544 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2545 /* Set S->gc of glyph string S for drawing that glyph string. Set |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2546 S->stippled_p to a non-zero value if the face of S has a stipple |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2547 pattern. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2548 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2549 static INLINE void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2550 x_set_glyph_string_gc (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2551 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2552 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2553 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2554 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2555 if (s->hl == DRAW_NORMAL_TEXT) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2556 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2557 s->gc = s->face->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2558 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2559 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2560 else if (s->hl == DRAW_INVERSE_VIDEO) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2561 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2562 x_set_mode_line_face_gc (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2563 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2564 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2565 else if (s->hl == DRAW_CURSOR) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2566 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2567 x_set_cursor_gc (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2568 s->stippled_p = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2569 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2570 else if (s->hl == DRAW_MOUSE_FACE) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2571 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2572 x_set_mouse_face_gc (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2573 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2574 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2575 else if (s->hl == DRAW_IMAGE_RAISED |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2576 || s->hl == DRAW_IMAGE_SUNKEN) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2577 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2578 s->gc = s->face->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2579 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2580 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2581 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2582 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2583 s->gc = s->face->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2584 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2585 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2586 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2587 /* GC must have been set. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2588 xassert (s->gc != 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2589 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2590 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2591 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2592 /* Set clipping for output of glyph string S. S may be part of a mode |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2593 line or menu if we don't have X toolkit support. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2594 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2595 static INLINE void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2596 x_set_glyph_string_clipping (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2597 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2598 { |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
2599 Rect rects[MAX_CLIP_RECTS]; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
2600 int n; |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
2601 |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
2602 n = get_glyph_string_clip_rects (s, rects, MAX_CLIP_RECTS); |
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
2603 mac_set_clip_rectangles (s->display, s->gc, rects, n); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2604 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2605 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2606 |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2607 /* RIF: |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2608 Compute left and right overhang of glyph string S. If S is a glyph |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2609 string for a composition, assume overhangs don't exist. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2610 |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2611 static void |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
2612 mac_compute_glyph_string_overhangs (s) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2613 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2614 { |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2615 if (!(s->cmp == NULL |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2616 && s->first_glyph->type == CHAR_GLYPH)) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2617 return; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2618 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2619 if (!s->two_byte_p |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2620 #if USE_ATSUI |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2621 || s->font->mac_style |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2622 #endif |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2623 ) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2624 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2625 XCharStruct cs; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2626 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2627 mac_text_extents_16 (s->font, s->char2b, s->nchars, &cs); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2628 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2629 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2630 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2631 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2632 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2633 Rect r; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2634 MacFontStruct *font = s->font; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2635 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2636 TextFont (font->mac_fontnum); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2637 TextSize (font->mac_fontsize); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2638 TextFace (font->mac_fontface); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2639 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2640 QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2641 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2642 s->right_overhang = r.right > s->width ? r.right - s->width : 0; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2643 s->left_overhang = r.left < 0 ? -r.left : 0; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
2644 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2645 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2646 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2647 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2648 /* Fill rectangle X, Y, W, H with background color of glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2649 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2650 static INLINE void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2651 x_clear_glyph_string_rect (s, x, y, w, h) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2652 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2653 int x, y, w, h; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2654 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2655 mac_erase_rectangle (s->f, s->gc, x, y, w, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2656 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2657 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2658 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2659 /* Draw the background of glyph_string S. If S->background_filled_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2660 is non-zero don't draw it. FORCE_P non-zero means draw the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2661 background even if it wouldn't be drawn normally. This is used |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2662 when a string preceding S draws into the background of S, or S |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2663 contains the first component of a composition. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2664 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2665 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2666 x_draw_glyph_string_background (s, force_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2667 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2668 int force_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2669 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2670 /* Nothing to do if background has already been drawn or if it |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2671 shouldn't be drawn in the first place. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2672 if (!s->background_filled_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2673 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2674 int box_line_width = max (s->face->box_line_width, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2675 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2676 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2677 if (s->stippled_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2678 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2679 /* Fill background with a stipple pattern. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2680 XSetFillStyle (s->display, s->gc, FillOpaqueStippled); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2681 XFillRectangle (s->display, s->window, s->gc, s->x, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2682 s->y + box_line_width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2683 s->background_width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2684 s->height - 2 * box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2685 XSetFillStyle (s->display, s->gc, FillSolid); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2686 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2687 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2688 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2689 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2690 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2691 || s->font_not_found_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2692 || s->extends_to_end_of_line_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2693 || force_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2694 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2695 x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2696 s->background_width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2697 s->height - 2 * box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2698 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2699 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2700 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2701 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2702 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2703 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2704 /* Draw the foreground of glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2705 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2706 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2707 x_draw_glyph_string_foreground (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2708 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2709 { |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2710 int i, x, bg_width; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2711 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2712 /* If first glyph of S has a left box line, start drawing the text |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2713 of S to the right of that box line. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2714 if (s->face->box != FACE_NO_BOX |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2715 && s->first_glyph->left_box_line_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2716 x = s->x + abs (s->face->box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2717 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2718 x = s->x; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2719 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2720 /* Draw characters of S as rectangles if S's font could not be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2721 loaded. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2722 if (s->font_not_found_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2723 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2724 for (i = 0; i < s->nchars; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2725 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2726 struct glyph *g = s->first_glyph + i; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2727 mac_draw_rectangle (s->f, s->gc, x, s->y, |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
2728 g->pixel_width - 1, s->height - 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2729 x += g->pixel_width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2730 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2731 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2732 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2733 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2734 char *char1b = (char *) s->char2b; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2735 int boff = s->font_info->baseline_offset; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2736 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2737 if (s->font_info->vertical_centering) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2738 boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2739 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2740 /* If we can use 8-bit functions, condense S->char2b. */ |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2741 if (!s->two_byte_p |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2742 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2743 && GC_FONT (s->gc)->mac_style == NULL |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2744 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2745 ) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2746 for (i = 0; i < s->nchars; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2747 char1b[i] = s->char2b[i].byte2; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2748 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2749 /* Draw text with XDrawString if background has already been |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2750 filled. Otherwise, use XDrawImageString. (Note that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2751 XDrawImageString is usually faster than XDrawString.) Always |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2752 use XDrawImageString when drawing the cursor so that there is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2753 no chance that characters under a box cursor are invisible. */ |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
2754 if (s->for_overlaps |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2755 || (s->background_filled_p && s->hl != DRAW_CURSOR)) |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2756 bg_width = 0; /* Corresponds to XDrawString. */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2757 else |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2758 bg_width = s->background_width; /* Corresponds to XDrawImageString. */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2759 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2760 if (s->two_byte_p |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
2761 #if USE_ATSUI |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2762 || GC_FONT (s->gc)->mac_style |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2763 #endif |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2764 ) |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
2765 #if USE_CG_TEXT_DRAWING |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2766 if (!s->two_byte_p |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2767 && mac_draw_image_string_cg (s->f, s->gc, x, s->ybase - boff, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2768 s->char2b, s->nchars, bg_width)) |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2769 ; |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2770 else |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2771 #endif |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2772 mac_draw_image_string_16 (s->f, s->gc, x, s->ybase - boff, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2773 s->char2b, s->nchars, bg_width); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2774 else |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2775 mac_draw_image_string (s->f, s->gc, x, s->ybase - boff, |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
2776 char1b, s->nchars, bg_width); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2777 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2778 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2779 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2780 /* Draw the foreground of composite glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2781 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2782 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2783 x_draw_composite_glyph_string_foreground (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2784 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2785 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2786 int i, x; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2787 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2788 /* If first glyph of S has a left box line, start drawing the text |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2789 of S to the right of that box line. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2790 if (s->face->box != FACE_NO_BOX |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2791 && s->first_glyph->left_box_line_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2792 x = s->x + abs (s->face->box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2793 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2794 x = s->x; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2795 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2796 /* S is a glyph string for a composition. S->gidx is the index of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2797 the first character drawn for glyphs of this composition. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2798 S->gidx == 0 means we are drawing the very first character of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2799 this composition. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2800 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2801 /* Draw a rectangle for the composition if the font for the very |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2802 first character of the composition could not be loaded. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2803 if (s->font_not_found_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2804 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2805 if (s->gidx == 0) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2806 mac_draw_rectangle (s->f, s->gc, x, s->y, |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
2807 s->width - 1, s->height - 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2808 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2809 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2810 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2811 for (i = 0; i < s->nchars; i++, ++s->gidx) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2812 mac_draw_string_16 (s->f, s->gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2813 x + s->cmp->offsets[s->gidx * 2], |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2814 s->ybase - s->cmp->offsets[s->gidx * 2 + 1], |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
2815 s->char2b + i, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2816 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2817 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2818 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2819 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2820 #ifdef USE_X_TOOLKIT |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2821 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2822 static struct frame *x_frame_of_widget P_ ((Widget)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2823 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2824 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2825 /* Return the frame on which widget WIDGET is used.. Abort if frame |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2826 cannot be determined. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2827 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2828 static struct frame * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2829 x_frame_of_widget (widget) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2830 Widget widget; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2831 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2832 struct x_display_info *dpyinfo; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2833 Lisp_Object tail; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2834 struct frame *f; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2835 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2836 dpyinfo = x_display_info_for_display (XtDisplay (widget)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2837 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2838 /* Find the top-level shell of the widget. Note that this function |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2839 can be called when the widget is not yet realized, so XtWindow |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2840 (widget) == 0. That's the reason we can't simply use |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2841 x_any_window_to_frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2842 while (!XtIsTopLevelShell (widget)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2843 widget = XtParent (widget); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2844 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2845 /* Look for a frame with that top-level widget. Allocate the color |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2846 on that frame to get the right gamma correction value. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2847 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2848 if (GC_FRAMEP (XCAR (tail)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2849 && (f = XFRAME (XCAR (tail)), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2850 (f->output_data.nothing != 1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2851 && FRAME_X_DISPLAY_INFO (f) == dpyinfo)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2852 && f->output_data.x->widget == widget) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2853 return f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2854 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2855 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2856 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2857 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2858 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2859 /* Allocate the color COLOR->pixel on the screen and display of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2860 widget WIDGET in colormap CMAP. If an exact match cannot be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2861 allocated, try the nearest color available. Value is non-zero |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2862 if successful. This is called from lwlib. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2863 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2864 int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2865 x_alloc_nearest_color_for_widget (widget, cmap, color) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2866 Widget widget; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2867 Colormap cmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2868 XColor *color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2869 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2870 struct frame *f = x_frame_of_widget (widget); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2871 return x_alloc_nearest_color (f, cmap, color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2872 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2873 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2874 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2875 #endif /* USE_X_TOOLKIT */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2876 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2877 #if 0 /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2878 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2879 /* Allocate the color COLOR->pixel on SCREEN of DISPLAY, colormap |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2880 CMAP. If an exact match can't be allocated, try the nearest color |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2881 available. Value is non-zero if successful. Set *COLOR to the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2882 color allocated. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2883 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2884 int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2885 x_alloc_nearest_color (f, cmap, color) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2886 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2887 Colormap cmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2888 XColor *color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2889 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2890 Display *display = FRAME_X_DISPLAY (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2891 Screen *screen = FRAME_X_SCREEN (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2892 int rc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2893 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2894 gamma_correct (f, color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2895 rc = XAllocColor (display, cmap, color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2896 if (rc == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2897 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2898 /* If we got to this point, the colormap is full, so we're going |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2899 to try to get the next closest color. The algorithm used is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2900 a least-squares matching, which is what X uses for closest |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2901 color matching with StaticColor visuals. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2902 int nearest, i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2903 unsigned long nearest_delta = ~0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2904 int ncells = XDisplayCells (display, XScreenNumberOfScreen (screen)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2905 XColor *cells = (XColor *) alloca (ncells * sizeof *cells); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2906 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2907 for (i = 0; i < ncells; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2908 cells[i].pixel = i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2909 XQueryColors (display, cmap, cells, ncells); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2910 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2911 for (nearest = i = 0; i < ncells; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2912 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2913 long dred = (color->red >> 8) - (cells[i].red >> 8); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2914 long dgreen = (color->green >> 8) - (cells[i].green >> 8); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2915 long dblue = (color->blue >> 8) - (cells[i].blue >> 8); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2916 unsigned long delta = dred * dred + dgreen * dgreen + dblue * dblue; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2917 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2918 if (delta < nearest_delta) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2919 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2920 nearest = i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2921 nearest_delta = delta; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2922 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2923 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2924 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2925 color->red = cells[nearest].red; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2926 color->green = cells[nearest].green; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2927 color->blue = cells[nearest].blue; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2928 rc = XAllocColor (display, cmap, color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2929 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2930 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2931 #ifdef DEBUG_X_COLORS |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2932 if (rc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2933 register_color (color->pixel); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2934 #endif /* DEBUG_X_COLORS */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
2935 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2936 return rc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2937 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2938 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2939 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2940 /* Allocate color PIXEL on frame F. PIXEL must already be allocated. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2941 It's necessary to do this instead of just using PIXEL directly to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2942 get color reference counts right. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2943 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2944 unsigned long |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2945 x_copy_color (f, pixel) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2946 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2947 unsigned long pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2948 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2949 XColor color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2950 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2951 color.pixel = pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2952 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2953 XQueryColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2954 XAllocColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2955 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2956 #ifdef DEBUG_X_COLORS |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2957 register_color (pixel); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2958 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2959 return color.pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2960 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2961 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2962 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2963 /* Allocate color PIXEL on display DPY. PIXEL must already be allocated. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2964 It's necessary to do this instead of just using PIXEL directly to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2965 get color reference counts right. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2966 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2967 unsigned long |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2968 x_copy_dpy_color (dpy, cmap, pixel) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2969 Display *dpy; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2970 Colormap cmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2971 unsigned long pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2972 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2973 XColor color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2974 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2975 color.pixel = pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2976 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2977 XQueryColor (dpy, cmap, &color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2978 XAllocColor (dpy, cmap, &color); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2979 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2980 #ifdef DEBUG_X_COLORS |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2981 register_color (pixel); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2982 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2983 return color.pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2984 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2985 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2986 #endif /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
2987 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2988 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2989 /* Brightness beyond which a color won't have its highlight brightness |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2990 boosted. |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2991 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2992 Nominally, highlight colors for `3d' faces are calculated by |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2993 brightening an object's color by a constant scale factor, but this |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2994 doesn't yield good results for dark colors, so for colors who's |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2995 brightness is less than this value (on a scale of 0-255) have to |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2996 use an additional additive factor. |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2997 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2998 The value here is set so that the default menu-bar/mode-line color |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
2999 (grey75) will not have its highlights changed at all. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3000 #define HIGHLIGHT_COLOR_DARK_BOOST_LIMIT 187 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3001 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3002 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3003 /* Allocate a color which is lighter or darker than *COLOR by FACTOR |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3004 or DELTA. Try a color with RGB values multiplied by FACTOR first. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3005 If this produces the same color as COLOR, try a color where all RGB |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3006 values have DELTA added. Return the allocated color in *COLOR. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3007 DISPLAY is the X display, CMAP is the colormap to operate on. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3008 Value is non-zero if successful. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3009 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3010 static int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3011 mac_alloc_lighter_color (f, color, factor, delta) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3012 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3013 unsigned long *color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3014 double factor; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3015 int delta; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3016 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3017 unsigned long new; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3018 long bright; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3019 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3020 /* On Mac, RGB values are 0-255, not 0-65535, so scale delta. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3021 delta /= 256; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3022 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3023 /* Change RGB values by specified FACTOR. Avoid overflow! */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3024 xassert (factor >= 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3025 new = RGB_TO_ULONG (min (0xff, (int) (factor * RED_FROM_ULONG (*color))), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3026 min (0xff, (int) (factor * GREEN_FROM_ULONG (*color))), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3027 min (0xff, (int) (factor * BLUE_FROM_ULONG (*color)))); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3028 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3029 /* Calculate brightness of COLOR. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3030 bright = (2 * RED_FROM_ULONG (*color) + 3 * GREEN_FROM_ULONG (*color) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3031 + BLUE_FROM_ULONG (*color)) / 6; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3032 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3033 /* We only boost colors that are darker than |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3034 HIGHLIGHT_COLOR_DARK_BOOST_LIMIT. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3035 if (bright < HIGHLIGHT_COLOR_DARK_BOOST_LIMIT) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3036 /* Make an additive adjustment to NEW, because it's dark enough so |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3037 that scaling by FACTOR alone isn't enough. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3038 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3039 /* How far below the limit this color is (0 - 1, 1 being darker). */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3040 double dimness = 1 - (double)bright / HIGHLIGHT_COLOR_DARK_BOOST_LIMIT; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3041 /* The additive adjustment. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3042 int min_delta = delta * dimness * factor / 2; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3043 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3044 if (factor < 1) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3045 new = RGB_TO_ULONG (max (0, min (0xff, (int) (RED_FROM_ULONG (*color)) - min_delta)), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3046 max (0, min (0xff, (int) (GREEN_FROM_ULONG (*color)) - min_delta)), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3047 max (0, min (0xff, (int) (BLUE_FROM_ULONG (*color)) - min_delta))); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3048 else |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3049 new = RGB_TO_ULONG (max (0, min (0xff, (int) (min_delta + RED_FROM_ULONG (*color)))), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3050 max (0, min (0xff, (int) (min_delta + GREEN_FROM_ULONG (*color)))), |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3051 max (0, min (0xff, (int) (min_delta + BLUE_FROM_ULONG (*color))))); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3052 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3053 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3054 if (new == *color) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3055 new = RGB_TO_ULONG (max (0, min (0xff, (int) (delta + RED_FROM_ULONG (*color)))), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3056 max (0, min (0xff, (int) (delta + GREEN_FROM_ULONG (*color)))), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3057 max (0, min (0xff, (int) (delta + BLUE_FROM_ULONG (*color))))); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3058 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3059 /* MAC_TODO: Map to palette and retry with delta if same? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3060 /* MAC_TODO: Free colors (if using palette)? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3061 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3062 if (new == *color) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3063 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3064 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3065 *color = new; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3066 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3067 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3068 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3069 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3070 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3071 /* Set up the foreground color for drawing relief lines of glyph |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3072 string S. RELIEF is a pointer to a struct relief containing the GC |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3073 with which lines will be drawn. Use a color that is FACTOR or |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3074 DELTA lighter or darker than the relief's background which is found |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3075 in S->f->output_data.x->relief_background. If such a color cannot |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3076 be allocated, use DEFAULT_PIXEL, instead. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3077 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3078 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3079 x_setup_relief_color (f, relief, factor, delta, default_pixel) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3080 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3081 struct relief *relief; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3082 double factor; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3083 int delta; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3084 unsigned long default_pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3085 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3086 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3087 struct mac_output *di = f->output_data.mac; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3088 unsigned long mask = GCForeground; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3089 unsigned long pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3090 unsigned long background = di->relief_background; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3091 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3092 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3093 /* MAC_TODO: Free colors (if using palette)? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3094 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3095 /* Allocate new color. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3096 xgcv.foreground = default_pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3097 pixel = background; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3098 if (dpyinfo->n_planes != 1 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3099 && mac_alloc_lighter_color (f, &pixel, factor, delta)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3100 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3101 relief->allocated_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3102 xgcv.foreground = relief->pixel = pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3103 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3104 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3105 if (relief->gc == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3106 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3107 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3108 xgcv.stipple = dpyinfo->gray; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3109 mask |= GCStipple; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3110 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3111 relief->gc = XCreateGC (NULL, FRAME_MAC_WINDOW (f), mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3112 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3113 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3114 XChangeGC (NULL, relief->gc, mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3115 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3116 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3117 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3118 /* Set up colors for the relief lines around glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3119 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3120 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3121 x_setup_relief_colors (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3122 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3123 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3124 struct mac_output *di = s->f->output_data.mac; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3125 unsigned long color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3126 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3127 if (s->face->use_box_color_for_shadows_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3128 color = s->face->box_color; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3129 else if (s->first_glyph->type == IMAGE_GLYPH |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3130 && s->img->pixmap |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3131 && !IMAGE_BACKGROUND_TRANSPARENT (s->img, s->f, 0)) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3132 color = IMAGE_BACKGROUND (s->img, s->f, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3133 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3134 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3135 XGCValues xgcv; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3136 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3137 /* Get the background color of the face. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3138 XGetGCValues (s->display, s->gc, GCBackground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3139 color = xgcv.background; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3140 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3141 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3142 if (di->white_relief.gc == 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3143 || color != di->relief_background) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3144 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3145 di->relief_background = color; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3146 x_setup_relief_color (s->f, &di->white_relief, 1.2, 0x8000, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3147 WHITE_PIX_DEFAULT (s->f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3148 x_setup_relief_color (s->f, &di->black_relief, 0.6, 0x4000, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3149 BLACK_PIX_DEFAULT (s->f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3150 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3151 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3152 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3153 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3154 /* Draw a relief on frame F inside the rectangle given by LEFT_X, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3155 TOP_Y, RIGHT_X, and BOTTOM_Y. WIDTH is the thickness of the relief |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3156 to draw, it must be >= 0. RAISED_P non-zero means draw a raised |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3157 relief. LEFT_P non-zero means draw a relief on the left side of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3158 the rectangle. RIGHT_P non-zero means draw a relief on the right |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3159 side of the rectangle. CLIP_RECT is the clipping rectangle to use |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3160 when drawing. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3161 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3162 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3163 x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3164 raised_p, top_p, bot_p, left_p, right_p, clip_rect) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3165 struct frame *f; |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3166 int left_x, top_y, right_x, bottom_y, width; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3167 int top_p, bot_p, left_p, right_p, raised_p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3168 Rect *clip_rect; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3169 { |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3170 Display *dpy = FRAME_MAC_DISPLAY (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3171 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3172 GC gc; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3173 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3174 if (raised_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3175 gc = f->output_data.mac->white_relief.gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3176 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3177 gc = f->output_data.mac->black_relief.gc; |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3178 mac_set_clip_rectangles (dpy, gc, clip_rect, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3179 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3180 /* Top. */ |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3181 if (top_p) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3182 for (i = 0; i < width; ++i) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3183 mac_draw_line (f, gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3184 left_x + i * left_p, top_y + i, |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
3185 right_x + 1 - i * right_p, top_y + i); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3186 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3187 /* Left. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3188 if (left_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3189 for (i = 0; i < width; ++i) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3190 mac_draw_line (f, gc, |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
3191 left_x + i, top_y + i, left_x + i, bottom_y - i + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3192 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3193 mac_reset_clip_rectangles (dpy, gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3194 if (raised_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3195 gc = f->output_data.mac->black_relief.gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3196 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3197 gc = f->output_data.mac->white_relief.gc; |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3198 mac_set_clip_rectangles (dpy, gc, clip_rect, 1); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3199 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3200 /* Bottom. */ |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3201 if (bot_p) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3202 for (i = 0; i < width; ++i) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3203 mac_draw_line (f, gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3204 left_x + i * left_p, bottom_y - i, |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
3205 right_x + 1 - i * right_p, bottom_y - i); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3206 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3207 /* Right. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3208 if (right_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3209 for (i = 0; i < width; ++i) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3210 mac_draw_line (f, gc, |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
3211 right_x - i, top_y + i + 1, right_x - i, bottom_y - i); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3212 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3213 mac_reset_clip_rectangles (dpy, gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3214 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3215 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3216 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3217 /* Draw a box on frame F inside the rectangle given by LEFT_X, TOP_Y, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3218 RIGHT_X, and BOTTOM_Y. WIDTH is the thickness of the lines to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3219 draw, it must be >= 0. LEFT_P non-zero means draw a line on the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3220 left side of the rectangle. RIGHT_P non-zero means draw a line |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3221 on the right side of the rectangle. CLIP_RECT is the clipping |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3222 rectangle to use when drawing. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3223 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3224 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3225 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3226 left_p, right_p, clip_rect) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3227 struct glyph_string *s; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3228 int left_x, top_y, right_x, bottom_y, width, left_p, right_p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3229 Rect *clip_rect; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3230 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3231 XGCValues xgcv; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3232 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
3233 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
3234 XSetForeground (s->display, s->gc, s->face->box_color); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3235 mac_set_clip_rectangles (s->display, s->gc, clip_rect, 1); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3236 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3237 /* Top. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3238 mac_fill_rectangle (s->f, s->gc, left_x, top_y, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3239 right_x - left_x + 1, width); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3240 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3241 /* Left. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3242 if (left_p) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3243 mac_fill_rectangle (s->f, s->gc, left_x, top_y, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3244 width, bottom_y - top_y + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3245 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3246 /* Bottom. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3247 mac_fill_rectangle (s->f, s->gc, left_x, bottom_y - width + 1, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3248 right_x - left_x + 1, width); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3249 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3250 /* Right. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3251 if (right_p) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3252 mac_fill_rectangle (s->f, s->gc, right_x - width + 1, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3253 top_y, width, bottom_y - top_y + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3254 |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
3255 XSetForeground (s->display, s->gc, xgcv.foreground); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3256 mac_reset_clip_rectangles (s->display, s->gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3257 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3258 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3259 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3260 /* Draw a box around glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3261 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3262 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3263 x_draw_glyph_string_box (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3264 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3265 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3266 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3267 int left_p, right_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3268 struct glyph *last_glyph; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3269 Rect clip_rect; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3270 |
59655
369714ad80ed
(x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents:
59586
diff
changeset
|
3271 last_x = ((s->row->full_width_p && !s->w->pseudo_window_p) |
369714ad80ed
(x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents:
59586
diff
changeset
|
3272 ? WINDOW_RIGHT_EDGE_X (s->w) |
369714ad80ed
(x_draw_glyph_string_box): Fix last_x for full width rows.
Kim F. Storm <storm@cua.dk>
parents:
59586
diff
changeset
|
3273 : window_box_right (s->w, s->area)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3274 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3275 /* The glyph that may have a right box line. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3276 last_glyph = (s->cmp || s->img |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3277 ? s->first_glyph |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3278 : s->first_glyph + s->nchars - 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3279 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3280 width = abs (s->face->box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3281 raised_p = s->face->box == FACE_RAISED_BOX; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3282 left_x = s->x; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3283 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3284 ? last_x - 1 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3285 : min (last_x, s->x + s->background_width) - 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3286 top_y = s->y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3287 bottom_y = top_y + s->height - 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3288 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3289 left_p = (s->first_glyph->left_box_line_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3290 || (s->hl == DRAW_MOUSE_FACE |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3291 && (s->prev == NULL |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3292 || s->prev->hl != s->hl))); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3293 right_p = (last_glyph->right_box_line_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3294 || (s->hl == DRAW_MOUSE_FACE |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3295 && (s->next == NULL |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3296 || s->next->hl != s->hl))); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3297 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3298 get_glyph_string_clip_rect (s, &clip_rect); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3299 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3300 if (s->face->box == FACE_SIMPLE_BOX) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3301 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3302 left_p, right_p, &clip_rect); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3303 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3304 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3305 x_setup_relief_colors (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3306 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3307 width, raised_p, 1, 1, left_p, right_p, &clip_rect); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3308 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3309 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3310 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3311 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3312 /* Draw foreground of image glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3313 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3314 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3315 x_draw_image_foreground (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3316 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3317 { |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3318 int x = s->x; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3319 int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3320 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3321 /* If first glyph of S has a left box line, start drawing it to the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3322 right of that line. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3323 if (s->face->box != FACE_NO_BOX |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3324 && s->first_glyph->left_box_line_p |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3325 && s->slice.x == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3326 x += abs (s->face->box_line_width); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3327 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3328 /* If there is a margin around the image, adjust x- and y-position |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3329 by that margin. */ |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3330 if (s->slice.x == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3331 x += s->img->hmargin; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3332 if (s->slice.y == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3333 y += s->img->vmargin; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3334 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3335 if (s->img->pixmap) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3336 { |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
3337 x_set_glyph_string_clipping (s); |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
3338 |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3339 #if USE_CG_DRAWING |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3340 mac_draw_cg_image (s->img->data.ptr_val, |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3341 s->f, s->gc, s->slice.x, s->slice.y, |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3342 s->slice.width, s->slice.height, x, y, 1); |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3343 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3344 if (s->img->mask) |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3345 #if !USE_CG_DRAWING |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3346 mac_copy_area_with_mask (s->img->pixmap, s->img->mask, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3347 s->f, s->gc, s->slice.x, s->slice.y, |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
3348 s->slice.width, s->slice.height, x, y); |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3349 #else |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3350 ; |
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3351 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3352 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3353 { |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3354 #if !USE_CG_DRAWING |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3355 mac_copy_area (s->img->pixmap, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3356 s->f, s->gc, s->slice.x, s->slice.y, |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
3357 s->slice.width, s->slice.height, x, y); |
69512
eafd737138ea
(XCreatePixmap) [!WORDS_BIG_ENDIAN && USE_CG_DRAWING]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69488
diff
changeset
|
3358 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3359 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3360 /* When the image has a mask, we can expect that at |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3361 least part of a mouse highlight or a block cursor will |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3362 be visible. If the image doesn't have a mask, make |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3363 a block cursor visible by drawing a rectangle around |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3364 the image. I believe it's looking better if we do |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3365 nothing here for mouse-face. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3366 if (s->hl == DRAW_CURSOR) |
45197
0b6da8b7d7ac
(x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents:
45111
diff
changeset
|
3367 { |
0b6da8b7d7ac
(x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents:
45111
diff
changeset
|
3368 int r = s->img->relief; |
0b6da8b7d7ac
(x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents:
45111
diff
changeset
|
3369 if (r < 0) r = -r; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3370 mac_draw_rectangle (s->f, s->gc, x - r, y - r, |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
3371 s->slice.width + r*2 - 1, |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
3372 s->slice.height + r*2 - 1); |
45197
0b6da8b7d7ac
(x_draw_image_foreground, x_draw_image_foreground_1):
Kim F. Storm <storm@cua.dk>
parents:
45111
diff
changeset
|
3373 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3374 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3375 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3376 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3377 /* Draw a rectangle if image could not be loaded. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3378 mac_draw_rectangle (s->f, s->gc, x, y, |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
3379 s->slice.width - 1, s->slice.height - 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3380 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3381 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3382 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3383 /* Draw a relief around the image glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3384 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3385 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3386 x_draw_image_relief (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3387 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3388 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3389 int x0, y0, x1, y1, thick, raised_p; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3390 Rect r; |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3391 int x = s->x; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3392 int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3393 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3394 /* If first glyph of S has a left box line, start drawing it to the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3395 right of that line. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3396 if (s->face->box != FACE_NO_BOX |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3397 && s->first_glyph->left_box_line_p |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3398 && s->slice.x == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3399 x += abs (s->face->box_line_width); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3400 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3401 /* If there is a margin around the image, adjust x- and y-position |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3402 by that margin. */ |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3403 if (s->slice.x == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3404 x += s->img->hmargin; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3405 if (s->slice.y == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3406 y += s->img->vmargin; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3407 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3408 if (s->hl == DRAW_IMAGE_SUNKEN |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3409 || s->hl == DRAW_IMAGE_RAISED) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3410 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3411 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3412 raised_p = s->hl == DRAW_IMAGE_RAISED; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3413 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3414 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3415 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3416 thick = abs (s->img->relief); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3417 raised_p = s->img->relief > 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3418 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3419 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3420 x0 = x - thick; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3421 y0 = y - thick; |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3422 x1 = x + s->slice.width + thick - 1; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3423 y1 = y + s->slice.height + thick - 1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3424 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3425 x_setup_relief_colors (s); |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3426 get_glyph_string_clip_rect (s, &r); |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3427 x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3428 s->slice.y == 0, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3429 s->slice.y + s->slice.height == s->img->height, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3430 s->slice.x == 0, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3431 s->slice.x + s->slice.width == s->img->width, |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3432 &r); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3433 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3434 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3435 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3436 /* Draw part of the background of glyph string S. X, Y, W, and H |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3437 give the rectangle to draw. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3438 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3439 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3440 x_draw_glyph_string_bg_rect (s, x, y, w, h) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3441 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3442 int x, y, w, h; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3443 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3444 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3445 if (s->stippled_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3446 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3447 /* Fill background with a stipple pattern. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3448 XSetFillStyle (s->display, s->gc, FillOpaqueStippled); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3449 XFillRectangle (s->display, s->window, s->gc, x, y, w, h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3450 XSetFillStyle (s->display, s->gc, FillSolid); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3451 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3452 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3453 #endif /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3454 x_clear_glyph_string_rect (s, x, y, w, h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3455 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3456 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3457 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3458 /* Draw image glyph string S. |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3459 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3460 s->y |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3461 s->x +------------------------- |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3462 | s->face->box |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3463 | |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3464 | +------------------------- |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3465 | | s->img->margin |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3466 | | |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3467 | | +------------------- |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3468 | | | the image |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3469 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3470 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3471 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3472 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3473 x_draw_image_glyph_string (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3474 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3475 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3476 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3477 int box_line_hwidth = abs (s->face->box_line_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3478 int box_line_vwidth = max (s->face->box_line_width, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3479 int height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3480 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3481 height = s->height - 2 * box_line_vwidth; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3482 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3483 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3484 /* Fill background with face under the image. Do it only if row is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3485 taller than image or if image has a clip mask to reduce |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3486 flickering. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3487 s->stippled_p = s->face->stipple != 0; |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3488 if (height > s->slice.height |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3489 || s->img->hmargin |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3490 || s->img->vmargin |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3491 || s->img->mask |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3492 || s->img->pixmap == 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3493 || s->width != s->background_width) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3494 { |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3495 x = s->x; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3496 if (s->first_glyph->left_box_line_p |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3497 && s->slice.x == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3498 x += box_line_hwidth; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3499 |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3500 y = s->y; |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3501 if (s->slice.y == 0) |
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
3502 y += box_line_vwidth; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3503 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3504 x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3505 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3506 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3507 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3508 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3509 /* Draw the foreground. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3510 x_draw_image_foreground (s); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3511 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3512 /* If we must draw a relief around the image, do it. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3513 if (s->img->relief |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3514 || s->hl == DRAW_IMAGE_RAISED |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3515 || s->hl == DRAW_IMAGE_SUNKEN) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3516 x_draw_image_relief (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3517 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3518 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3519 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3520 /* Draw stretch glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3521 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3522 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3523 x_draw_stretch_glyph_string (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3524 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3525 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3526 xassert (s->first_glyph->type == STRETCH_GLYPH); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3527 s->stippled_p = s->face->stipple != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3528 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3529 if (s->hl == DRAW_CURSOR |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3530 && !x_stretch_cursor_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3531 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3532 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3533 as wide as the stretch glyph. */ |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3534 int width, background_width = s->background_width; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3535 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3536 |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3537 if (x < left_x) |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3538 { |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3539 background_width -= left_x - x; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3540 x = left_x; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3541 } |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3542 width = min (FRAME_COLUMN_WIDTH (s->f), background_width); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3543 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3544 /* Draw cursor. */ |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3545 x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3546 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3547 /* Clear rest using the GC of the original non-cursor face. */ |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3548 if (width < background_width) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3549 { |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3550 int y = s->y; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3551 int w = background_width - width, h = s->height; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3552 Rect r; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3553 GC gc; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3554 |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3555 x += width; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3556 if (s->row->mouse_face_p |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3557 && cursor_in_mouse_face_p (s->w)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3558 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3559 x_set_mouse_face_gc (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3560 gc = s->gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3561 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3562 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3563 gc = s->face->gc; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3564 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3565 get_glyph_string_clip_rect (s, &r); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3566 mac_set_clip_rectangles (s->display, gc, &r, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3567 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3568 #if 0 /* MAC_TODO: stipple */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3569 if (s->face->stipple) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3570 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3571 /* Fill background with a stipple pattern. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3572 XSetFillStyle (s->display, gc, FillOpaqueStippled); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3573 XFillRectangle (s->display, s->window, gc, x, y, w, h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3574 XSetFillStyle (s->display, gc, FillSolid); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3575 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3576 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3577 #endif /* MAC_TODO */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3578 mac_erase_rectangle (s->f, gc, x, y, w, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3579 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3580 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3581 else if (!s->background_filled_p) |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3582 { |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3583 int background_width = s->background_width; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3584 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3585 |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3586 if (x < left_x) |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3587 { |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3588 background_width -= left_x - x; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3589 x = left_x; |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3590 } |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3591 if (background_width > 0) |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3592 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height); |
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
3593 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3594 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3595 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3596 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3597 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3598 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3599 /* Draw glyph string S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3600 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3601 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3602 x_draw_glyph_string (s) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3603 struct glyph_string *s; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3604 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3605 int relief_drawn_p = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3606 |
59718
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
3607 /* If S draws into the background of its successor that does not |
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
3608 draw a cursor, draw the background of the successor first so that |
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
3609 S can draw into it. This makes S->next use XDrawString instead |
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
3610 of XDrawImageString. */ |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
3611 if (s->next && s->right_overhang && !s->for_overlaps |
59718
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
3612 && s->next->hl != DRAW_CURSOR) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3613 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3614 xassert (s->next->img == NULL); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3615 x_set_glyph_string_gc (s->next); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3616 x_set_glyph_string_clipping (s->next); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3617 x_draw_glyph_string_background (s->next, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3618 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3619 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3620 /* Set up S->gc, set clipping and draw S. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3621 x_set_glyph_string_gc (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3622 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3623 /* Draw relief (if any) in advance for char/composition so that the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3624 glyph string can be drawn over it. */ |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
3625 if (!s->for_overlaps |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3626 && s->face->box != FACE_NO_BOX |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3627 && (s->first_glyph->type == CHAR_GLYPH |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3628 || s->first_glyph->type == COMPOSITE_GLYPH)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3629 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3630 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3631 x_set_glyph_string_clipping (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3632 x_draw_glyph_string_background (s, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3633 x_draw_glyph_string_box (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3634 x_set_glyph_string_clipping (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3635 relief_drawn_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3636 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3637 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3638 x_set_glyph_string_clipping (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3639 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3640 switch (s->first_glyph->type) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3641 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3642 case IMAGE_GLYPH: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3643 x_draw_image_glyph_string (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3644 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3645 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3646 case STRETCH_GLYPH: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3647 x_draw_stretch_glyph_string (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3648 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3649 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3650 case CHAR_GLYPH: |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
3651 if (s->for_overlaps) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3652 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3653 else |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3654 x_draw_glyph_string_background (s, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3655 x_draw_glyph_string_foreground (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3656 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3657 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3658 case COMPOSITE_GLYPH: |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
3659 if (s->for_overlaps || s->gidx > 0) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3660 s->background_filled_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3661 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3662 x_draw_glyph_string_background (s, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3663 x_draw_composite_glyph_string_foreground (s); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3664 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3665 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3666 default: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3667 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3668 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3669 |
65892
41fc0bf568be
Rename member for_overlaps_p in struct glyph_string to for_overlaps.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65822
diff
changeset
|
3670 if (!s->for_overlaps) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3671 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3672 /* Draw underline. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3673 if (s->face->underline_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3674 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3675 unsigned long h = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3676 unsigned long dy = s->height - h; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3677 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3678 if (s->face->underline_defaulted_p) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3679 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3680 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3681 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3682 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3683 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3684 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3685 XSetForeground (s->display, s->gc, s->face->underline_color); |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3686 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3687 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3688 XSetForeground (s->display, s->gc, xgcv.foreground); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3689 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3690 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3691 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3692 /* Draw overline. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3693 if (s->face->overline_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3694 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3695 unsigned long dy = 0, h = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3696 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3697 if (s->face->overline_color_defaulted_p) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3698 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3699 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3700 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3701 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3702 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3703 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3704 XSetForeground (s->display, s->gc, s->face->overline_color); |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3705 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3706 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3707 XSetForeground (s->display, s->gc, xgcv.foreground); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3708 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3709 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3710 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3711 /* Draw strike-through. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3712 if (s->face->strike_through_p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3713 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3714 unsigned long h = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3715 unsigned long dy = (s->height - h) / 2; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3716 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3717 if (s->face->strike_through_color_defaulted_p) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3718 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3719 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3720 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3721 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3722 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3723 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3724 XSetForeground (s->display, s->gc, s->face->strike_through_color); |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3725 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3726 s->width, h); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3727 XSetForeground (s->display, s->gc, xgcv.foreground); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3728 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3729 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3730 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3731 /* Draw relief if not yet drawn. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3732 if (!relief_drawn_p && s->face->box != FACE_NO_BOX) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3733 x_draw_glyph_string_box (s); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3734 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3735 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3736 /* Reset clipping. */ |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
3737 mac_reset_clip_rectangles (s->display, s->gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3738 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3739 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3740 /* Shift display to make room for inserted glyphs. */ |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3741 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3742 void |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3743 mac_shift_glyphs_for_insert (f, x, y, width, height, shift_by) |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3744 struct frame *f; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3745 int x, y, width, height, shift_by; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3746 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3747 mac_scroll_area (f, f->output_data.mac->normal_gc, |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3748 x, y, width, height, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
3749 x + shift_by, y); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3750 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3751 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3752 /* Delete N glyphs at the nominal cursor position. Not implemented |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3753 for X frames. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3754 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3755 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3756 x_delete_glyphs (n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3757 register int n; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3758 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3759 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3760 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3761 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3762 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3763 /* Clear entire frame. If updating_frame is non-null, clear that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3764 frame. Otherwise clear the selected frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3765 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3766 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3767 x_clear_frame () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3768 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3769 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3770 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3771 if (updating_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3772 f = updating_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3773 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3774 f = SELECTED_FRAME (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3775 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3776 /* Clearing the frame will erase any cursor, so mark them all as no |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3777 longer visible. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3778 mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3779 output_cursor.hpos = output_cursor.vpos = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3780 output_cursor.x = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3781 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3782 /* We don't set the output cursor here because there will always |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3783 follow an explicit cursor_to. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3784 BLOCK_INPUT; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3785 mac_clear_window (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3786 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3787 /* We have to clear the scroll bars, too. If we have changed |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3788 colors or something like that, then they should be notified. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3789 x_scroll_bar_clear (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3790 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3791 XFlush (FRAME_MAC_DISPLAY (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3792 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3793 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3794 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3795 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3796 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3797 /* Invert the middle quarter of the frame for .15 sec. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3798 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3799 /* We use the select system call to do the waiting, so we have to make |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3800 sure it's available. If it isn't, we just won't do visual bells. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3801 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3802 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3803 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3804 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3805 /* Subtract the `struct timeval' values X and Y, storing the result in |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3806 *RESULT. Return 1 if the difference is negative, otherwise 0. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3807 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3808 static int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3809 timeval_subtract (result, x, y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3810 struct timeval *result, x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3811 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3812 /* Perform the carry for the later subtraction by updating y. This |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3813 is safer because on some systems the tv_sec member is unsigned. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3814 if (x.tv_usec < y.tv_usec) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3815 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3816 int nsec = (y.tv_usec - x.tv_usec) / 1000000 + 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3817 y.tv_usec -= 1000000 * nsec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3818 y.tv_sec += nsec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3819 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3820 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3821 if (x.tv_usec - y.tv_usec > 1000000) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3822 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3823 int nsec = (y.tv_usec - x.tv_usec) / 1000000; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3824 y.tv_usec += 1000000 * nsec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3825 y.tv_sec -= nsec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3826 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3827 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3828 /* Compute the time remaining to wait. tv_usec is certainly |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3829 positive. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3830 result->tv_sec = x.tv_sec - y.tv_sec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3831 result->tv_usec = x.tv_usec - y.tv_usec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3832 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3833 /* Return indication of whether the result should be considered |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3834 negative. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3835 return x.tv_sec < y.tv_sec; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3836 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3837 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3838 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3839 XTflash (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3840 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3841 { |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3842 /* Get the height not including a menu bar widget. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3843 int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3844 /* Height of each line to flash. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3845 int flash_height = FRAME_LINE_HEIGHT (f); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3846 /* These will be the left and right margins of the rectangles. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3847 int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3848 int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3849 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3850 int width; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3851 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3852 /* Don't flash the area between a scroll bar and the frame |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3853 edge it is next to. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3854 switch (FRAME_VERTICAL_SCROLL_BAR_TYPE (f)) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3855 { |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3856 case vertical_scroll_bar_left: |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3857 flash_left += VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3858 break; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3859 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3860 case vertical_scroll_bar_right: |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3861 flash_right -= VERTICAL_SCROLL_BAR_WIDTH_TRIM; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3862 break; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3863 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3864 default: |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3865 break; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3866 } |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3867 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3868 width = flash_right - flash_left; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3869 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3870 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3871 |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3872 /* If window is tall, flash top and bottom line. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3873 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3874 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3875 mac_invert_rectangle (f, flash_left, |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3876 (FRAME_INTERNAL_BORDER_WIDTH (f) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3877 + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3878 width, flash_height); |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3879 mac_invert_rectangle (f, flash_left, |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3880 (height - flash_height |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3881 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3882 width, flash_height); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3883 } |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3884 else |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3885 /* If it is short, flash it all. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3886 mac_invert_rectangle (f, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3887 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3888 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3889 x_flush (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3890 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3891 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3892 struct timeval wakeup; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3893 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3894 EMACS_GET_TIME (wakeup); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3895 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3896 /* Compute time to wait until, propagating carry from usecs. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3897 wakeup.tv_usec += 150000; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3898 wakeup.tv_sec += (wakeup.tv_usec / 1000000); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3899 wakeup.tv_usec %= 1000000; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3900 |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3901 /* Keep waiting until past the time wakeup or any input gets |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3902 available. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3903 while (! detect_input_pending ()) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3904 { |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3905 struct timeval current; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3906 struct timeval timeout; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3907 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3908 EMACS_GET_TIME (current); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3909 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3910 /* Break if result would be negative. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3911 if (timeval_subtract (¤t, wakeup, current)) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3912 break; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3913 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3914 /* How long `select' should wait. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3915 timeout.tv_sec = 0; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3916 timeout.tv_usec = 10000; |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3917 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3918 /* Try to wait that long--but we might wake up sooner. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3919 select (0, NULL, NULL, NULL, &timeout); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3920 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3921 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3922 |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3923 /* If window is tall, flash top and bottom line. */ |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3924 if (height > 3 * FRAME_LINE_HEIGHT (f)) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3925 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3926 mac_invert_rectangle (f, flash_left, |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3927 (FRAME_INTERNAL_BORDER_WIDTH (f) |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3928 + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)), |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3929 width, flash_height); |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3930 mac_invert_rectangle (f, flash_left, |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3931 (height - flash_height |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3932 - FRAME_INTERNAL_BORDER_WIDTH (f)), |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3933 width, flash_height); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3934 } |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3935 else |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3936 /* If it is short, flash it all. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
3937 mac_invert_rectangle (f, flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), |
65822
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3938 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3939 |
00a8cdae2968
(mac_invert_rectangle): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65772
diff
changeset
|
3940 x_flush (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3941 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3942 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3943 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3944 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3945 #endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3946 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3947 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3948 /* Make audible bell. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3949 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3950 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3951 XTring_bell () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3952 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3953 struct frame *f = SELECTED_FRAME (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
3954 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3955 #if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3956 if (visible_bell) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3957 XTflash (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3958 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3959 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3960 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3961 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3962 SysBeep (1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3963 XFlush (FRAME_MAC_DISPLAY (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3964 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3965 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3966 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3967 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3968 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3969 /* Specify how many text lines, from the top of the window, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3970 should be affected by insert-lines and delete-lines operations. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3971 This, and those operations, are used only within an update |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3972 that is bounded by calls to x_update_begin and x_update_end. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3973 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
3974 static void |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3975 XTset_terminal_window (n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3976 register int n; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3977 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3978 /* This function intentionally left blank. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3979 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3980 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3981 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3982 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3983 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3984 Line Dance |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3985 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3986 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3987 /* Perform an insert-lines or delete-lines operation, inserting N |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3988 lines or deleting -N lines at vertical position VPOS. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3989 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3990 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3991 x_ins_del_lines (vpos, n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3992 int vpos, n; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3993 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3994 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3995 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3996 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3997 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3998 /* Scroll part of the display as described by RUN. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
3999 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4000 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4001 x_scroll_run (w, run) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4002 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4003 struct run *run; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4004 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4005 struct frame *f = XFRAME (w->frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4006 int x, y, width, height, from_y, to_y, bottom_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4007 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4008 /* Get frame-relative bounding box of the text display area of W, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4009 without mode lines. Include in this box the left and right |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
4010 fringe of W. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4011 window_box (w, -1, &x, &y, &width, &height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4012 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4013 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4014 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4015 bottom_y = y + height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4016 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4017 if (to_y < from_y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4018 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4019 /* Scrolling up. Make sure we don't copy part of the mode |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4020 line at the bottom. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4021 if (from_y + run->height > bottom_y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4022 height = bottom_y - from_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4023 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4024 height = run->height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4025 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4026 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4027 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4028 /* Scolling down. Make sure we don't copy over the mode line. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4029 at the bottom. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4030 if (to_y + run->height > bottom_y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4031 height = bottom_y - to_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4032 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4033 height = run->height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4034 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4035 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4036 BLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4037 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4038 /* Cursor off. Will be switched on again in x_update_window_end. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4039 updated_window = w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4040 x_clear_cursor (w); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4041 |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4042 mac_scroll_area (f, f->output_data.mac->normal_gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4043 x, from_y, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4044 width, height, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4045 x, to_y); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4046 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4047 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4048 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4049 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4050 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4051 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4052 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4053 Exposure Events |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4054 ***********************************************************************/ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4055 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4056 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4057 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4058 frame_highlight (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4059 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4060 { |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4061 OSErr err; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4062 ControlRef root_control; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4063 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4064 BLOCK_INPUT; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4065 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4066 if (err == noErr) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4067 ActivateControl (root_control); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4068 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4069 x_update_cursor (f, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4070 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4071 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4072 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4073 frame_unhighlight (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4074 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4075 { |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4076 OSErr err; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4077 ControlRef root_control; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4078 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4079 BLOCK_INPUT; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4080 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4081 if (err == noErr) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4082 DeactivateControl (root_control); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4083 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4084 x_update_cursor (f, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4085 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4086 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4087 /* The focus has changed. Update the frames as necessary to reflect |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4088 the new situation. Note that we can't change the selected frame |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4089 here, because the Lisp code we are interrupting might become confused. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4090 Each event gets marked with the frame in which it occurred, so the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4091 Lisp code can tell when the switch took place by examining the events. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4092 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4093 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4094 x_new_focus_frame (dpyinfo, frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4095 struct x_display_info *dpyinfo; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4096 struct frame *frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4097 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4098 struct frame *old_focus = dpyinfo->x_focus_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4099 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4100 if (frame != dpyinfo->x_focus_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4101 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4102 /* Set this before calling other routines, so that they see |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4103 the correct value of x_focus_frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4104 dpyinfo->x_focus_frame = frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4105 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4106 if (old_focus && old_focus->auto_lower) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4107 x_lower_frame (old_focus); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4108 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4109 #if 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4110 selected_frame = frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4111 XSETFRAME (XWINDOW (selected_frame->selected_window)->frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4112 selected_frame); |
51048
7ac9c3bea5ea
(Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50701
diff
changeset
|
4113 Fselect_window (selected_frame->selected_window, Qnil); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4114 choose_minibuf_frame (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4115 #endif /* ! 0 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4116 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4117 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4118 pending_autoraise_frame = dpyinfo->x_focus_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4119 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4120 pending_autoraise_frame = 0; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
4121 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
4122 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
4123 if (frame) |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
4124 mac_set_font_info_for_selection (frame, DEFAULT_FACE_ID, 0); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
4125 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4126 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4127 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4128 x_frame_rehighlight (dpyinfo); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4129 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4130 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4131 /* Handle FocusIn and FocusOut state changes for FRAME. |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4132 If FRAME has focus and there exists more than one frame, puts |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4133 a FOCUS_IN_EVENT into *BUFP. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4134 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4135 static void |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4136 mac_focus_changed (type, dpyinfo, frame, bufp) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4137 int type; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4138 struct mac_display_info *dpyinfo; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4139 struct frame *frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4140 struct input_event *bufp; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4141 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4142 if (type == activeFlag) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4143 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4144 if (dpyinfo->x_focus_event_frame != frame) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4145 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4146 x_new_focus_frame (dpyinfo, frame); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4147 dpyinfo->x_focus_event_frame = frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4148 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4149 /* Don't stop displaying the initial startup message |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4150 for a switch-frame event we don't need. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4151 if (GC_NILP (Vterminal_frame) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4152 && GC_CONSP (Vframe_list) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4153 && !GC_NILP (XCDR (Vframe_list))) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4154 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4155 bufp->kind = FOCUS_IN_EVENT; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4156 XSETFRAME (bufp->frame_or_window, frame); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4157 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4158 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4159 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4160 else |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4161 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4162 if (dpyinfo->x_focus_event_frame == frame) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4163 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4164 dpyinfo->x_focus_event_frame = 0; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4165 x_new_focus_frame (dpyinfo, 0); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4166 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4167 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4168 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4169 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4170 /* The focus may have changed. Figure out if it is a real focus change, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4171 by checking both FocusIn/Out and Enter/LeaveNotify events. |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4172 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4173 Returns FOCUS_IN_EVENT event in *BUFP. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4174 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4175 static void |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4176 x_detect_focus_change (dpyinfo, event, bufp) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4177 struct mac_display_info *dpyinfo; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4178 EventRecord *event; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4179 struct input_event *bufp; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4180 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4181 struct frame *frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4182 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4183 frame = mac_window_to_frame ((WindowPtr) event->message); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4184 if (! frame) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4185 return; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4186 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4187 /* On Mac, this is only called from focus events, so no switch needed. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4188 mac_focus_changed ((event->modifiers & activeFlag), |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4189 dpyinfo, frame, bufp); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4190 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4191 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4192 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4193 /* Handle an event saying the mouse has moved out of an Emacs frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4194 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4195 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4196 x_mouse_leave (dpyinfo) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4197 struct x_display_info *dpyinfo; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4198 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4199 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4200 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4201 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4202 /* The focus has changed, or we have redirected a frame's focus to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4203 another frame (this happens when a frame uses a surrogate |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4204 mini-buffer frame). Shift the highlight as appropriate. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4205 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4206 The FRAME argument doesn't necessarily have anything to do with which |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4207 frame is being highlighted or un-highlighted; we only use it to find |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4208 the appropriate X display info. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4209 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4210 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4211 XTframe_rehighlight (frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4212 struct frame *frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4213 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4214 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4215 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4216 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4217 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4218 x_frame_rehighlight (dpyinfo) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4219 struct x_display_info *dpyinfo; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4220 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4221 struct frame *old_highlight = dpyinfo->x_highlight_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4222 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4223 if (dpyinfo->x_focus_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4224 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4225 dpyinfo->x_highlight_frame |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4226 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4227 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4228 : dpyinfo->x_focus_frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4229 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4230 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4231 FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4232 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4233 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4234 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4235 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4236 dpyinfo->x_highlight_frame = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4237 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4238 if (dpyinfo->x_highlight_frame != old_highlight) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4239 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4240 if (old_highlight) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4241 frame_unhighlight (old_highlight); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4242 if (dpyinfo->x_highlight_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4243 frame_highlight (dpyinfo->x_highlight_frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4244 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4245 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4246 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4247 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4248 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4249 /* Convert a keysym to its name. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4250 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4251 char * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4252 x_get_keysym_name (keysym) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4253 int keysym; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4254 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4255 char *value; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4256 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4257 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4258 #if 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4259 value = XKeysymToString (keysym); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4260 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4261 value = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4262 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4263 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4264 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4265 return value; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4266 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4267 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4268 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4269 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4270 /* Function to report a mouse movement to the mainstream Emacs code. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4271 The input handler calls this. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4272 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4273 We have received a mouse movement event, which is given in *event. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4274 If the mouse is over a different glyph than it was last time, tell |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4275 the mainstream emacs code by setting mouse_moved. If not, ask for |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4276 another motion event, so we can check again the next time it moves. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4277 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4278 static Point last_mouse_motion_position; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4279 static Lisp_Object last_mouse_motion_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4280 |
66080
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4281 static int |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4282 note_mouse_movement (frame, pos) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4283 FRAME_PTR frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4284 Point *pos; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4285 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4286 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (frame); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4287 #if TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4288 Rect r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4289 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4290 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4291 last_mouse_movement_time = TickCount () * (1000 / 60); /* to milliseconds */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4292 last_mouse_motion_position = *pos; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4293 XSETFRAME (last_mouse_motion_frame, frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4294 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4295 #if TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4296 if (!PtInRect (*pos, GetWindowPortBounds (FRAME_MAC_WINDOW (frame), &r))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4297 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4298 if (!PtInRect (*pos, &FRAME_MAC_WINDOW (frame)->portRect)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4299 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4300 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4301 if (frame == dpyinfo->mouse_face_mouse_frame) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4302 /* This case corresponds to LeaveNotify in X11. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4303 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4304 /* If we move outside the frame, then we're certainly no |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4305 longer on any text in the frame. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4306 clear_mouse_face (dpyinfo); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4307 dpyinfo->mouse_face_mouse_frame = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4308 if (!dpyinfo->grabbed) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4309 rif->define_frame_cursor (frame, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4310 frame->output_data.mac->nontext_cursor); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4311 } |
66080
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4312 return 1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4313 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4314 /* Has the mouse moved off the glyph it was on at the last sighting? */ |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
4315 if (frame != last_mouse_glyph_frame |
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
4316 || !PtInRect (*pos, &last_mouse_glyph)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4317 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4318 frame->mouse_moved = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4319 last_mouse_scroll_bar = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4320 note_mouse_highlight (frame, pos->h, pos->v); |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4321 /* Remember which glyph we're now on. */ |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4322 remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph); |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
4323 last_mouse_glyph_frame = frame; |
66080
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4324 return 1; |
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4325 } |
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4326 |
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
4327 return 0; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4328 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4329 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4330 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4331 /************************************************************************ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4332 Mouse Face |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4333 ************************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4334 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
4335 /* MAC TODO: This should be called from somewhere (or removed) ++KFS */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4336 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4337 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4338 redo_mouse_highlight () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4339 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4340 if (!NILP (last_mouse_motion_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4341 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4342 note_mouse_highlight (XFRAME (last_mouse_motion_frame), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4343 last_mouse_motion_position.h, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4344 last_mouse_motion_position.v); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4345 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4346 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4347 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4348 static struct frame * |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4349 mac_focus_frame (dpyinfo) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4350 struct mac_display_info *dpyinfo; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4351 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4352 if (dpyinfo->x_focus_frame) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4353 return dpyinfo->x_focus_frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4354 else |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4355 /* Mac version may get events, such as a menu bar click, even when |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4356 all the frames are invisible. In this case, we regard the |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4357 event came to the selected frame. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4358 return SELECTED_FRAME (); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4359 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
4360 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
4361 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4362 /* Return the current position of the mouse. |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4363 *FP should be a frame which indicates which display to ask about. |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4364 |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4365 If the mouse movement started in a scroll bar, set *FP, *BAR_WINDOW, |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4366 and *PART to the frame, window, and scroll bar part that the mouse |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4367 is over. Set *X and *Y to the portion and whole of the mouse's |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4368 position on the scroll bar. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4369 |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4370 If the mouse movement started elsewhere, set *FP to the frame the |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4371 mouse is on, *BAR_WINDOW to nil, and *X and *Y to the character cell |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4372 the mouse is over. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4373 |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4374 Set *TIME to the server time-stamp for the time at which the mouse |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4375 was at this position. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4376 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4377 Don't store anything if we don't have a valid set of values to report. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4378 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4379 This clears the mouse_moved flag, so we can wait for the next mouse |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4380 movement. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4381 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4382 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4383 XTmouse_position (fp, insist, bar_window, part, x, y, time) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4384 FRAME_PTR *fp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4385 int insist; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4386 Lisp_Object *bar_window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4387 enum scroll_bar_part *part; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4388 Lisp_Object *x, *y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4389 unsigned long *time; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4390 { |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4391 FRAME_PTR f1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4392 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4393 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4394 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4395 if (! NILP (last_mouse_scroll_bar) && insist == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4396 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4397 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4398 { |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4399 Lisp_Object frame, tail; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4400 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4401 /* Clear the mouse-moved flag for every frame on this display. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4402 FOR_EACH_FRAME (tail, frame) |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4403 XFRAME (frame)->mouse_moved = 0; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4404 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4405 last_mouse_scroll_bar = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4406 |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4407 if (FRAME_MAC_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4408 && FRAME_LIVE_P (last_mouse_frame)) |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4409 f1 = last_mouse_frame; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4410 else |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4411 f1 = mac_focus_frame (FRAME_MAC_DISPLAY_INFO (*fp)); |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4412 |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4413 if (f1) |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4414 { |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4415 /* Ok, we found a frame. Store all the values. |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4416 last_mouse_glyph is a rectangle used to reduce the |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4417 generation of mouse events. To not miss any motion |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4418 events, we must divide the frame into rectangles of the |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4419 size of the smallest character that could be displayed |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4420 on it, i.e. into the same rectangles that matrices on |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4421 the frame are divided into. */ |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4422 Point mouse_pos; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4423 |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4424 SetPortWindowPort (FRAME_MAC_WINDOW (f1)); |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4425 GetMouse (&mouse_pos); |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4426 remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v, |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4427 &last_mouse_glyph); |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
4428 last_mouse_glyph_frame = f1; |
66033
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4429 |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4430 *bar_window = Qnil; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4431 *part = 0; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4432 *fp = f1; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4433 XSETINT (*x, mouse_pos.h); |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4434 XSETINT (*y, mouse_pos.v); |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4435 *time = last_mouse_movement_time; |
ce2c44ba9ef1
(note_mouse_movement): Add call to remember_mouse_glyph.
Kim F. Storm <storm@cua.dk>
parents:
66005
diff
changeset
|
4436 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4437 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4438 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4439 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4440 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4441 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4442 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4443 /************************************************************************ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4444 Toolkit scroll bars |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4445 ************************************************************************/ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4446 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4447 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4448 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4449 static pascal void scroll_bar_timer_callback P_ ((EventLoopTimerRef, void *)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4450 static OSStatus install_scroll_bar_timer P_ ((void)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4451 static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4452 static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4453 static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4454 struct input_event *)); |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4455 static OSStatus get_control_part_bounds P_ ((ControlHandle, ControlPartCode, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4456 Rect *)); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4457 static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4458 ControlPartCode, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4459 struct input_event *)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4460 static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4461 struct input_event *)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4462 static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *, |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4463 Point, struct input_event *)); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4464 static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4465 int, int, int)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4466 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4467 /* Last scroll bar part sent in x_scroll_bar_handle_*. */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4468 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4469 static int last_scroll_bar_part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4470 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4471 static EventLoopTimerRef scroll_bar_timer; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4472 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4473 static int scroll_bar_timer_event_posted_p; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4474 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4475 #define SCROLL_BAR_FIRST_DELAY 0.5 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4476 #define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4477 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4478 static pascal void |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4479 scroll_bar_timer_callback (timer, data) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4480 EventLoopTimerRef timer; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4481 void *data; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4482 { |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
4483 OSStatus err; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
4484 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
4485 err = mac_post_mouse_moved_event (); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4486 if (err == noErr) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4487 scroll_bar_timer_event_posted_p = 1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4488 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4489 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4490 static OSStatus |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4491 install_scroll_bar_timer () |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4492 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4493 static EventLoopTimerUPP scroll_bar_timer_callbackUPP = NULL; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4494 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4495 if (scroll_bar_timer_callbackUPP == NULL) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4496 scroll_bar_timer_callbackUPP = |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4497 NewEventLoopTimerUPP (scroll_bar_timer_callback); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4498 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4499 if (scroll_bar_timer == NULL) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4500 /* Mac OS X and CarbonLib 1.5 and later allow us to specify |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4501 kEventDurationForever as delays. */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4502 return |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4503 InstallEventLoopTimer (GetCurrentEventLoop (), |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4504 kEventDurationForever, kEventDurationForever, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4505 scroll_bar_timer_callbackUPP, NULL, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4506 &scroll_bar_timer); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4507 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4508 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4509 static OSStatus |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4510 set_scroll_bar_timer (delay) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4511 EventTimerInterval delay; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4512 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4513 if (scroll_bar_timer == NULL) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4514 install_scroll_bar_timer (); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4515 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4516 scroll_bar_timer_event_posted_p = 0; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4517 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4518 return SetEventLoopTimerNextFireTime (scroll_bar_timer, delay); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4519 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4520 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4521 static int |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4522 control_part_code_to_scroll_bar_part (part_code) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4523 ControlPartCode part_code; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4524 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4525 switch (part_code) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4526 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4527 case kControlUpButtonPart: return scroll_bar_up_arrow; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4528 case kControlDownButtonPart: return scroll_bar_down_arrow; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4529 case kControlPageUpPart: return scroll_bar_above_handle; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4530 case kControlPageDownPart: return scroll_bar_below_handle; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4531 case kControlIndicatorPart: return scroll_bar_handle; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4532 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4533 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4534 return -1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4535 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4536 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4537 static void |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4538 construct_scroll_bar_click (bar, part, bufp) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4539 struct scroll_bar *bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4540 int part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4541 struct input_event *bufp; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4542 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4543 bufp->kind = SCROLL_BAR_CLICK_EVENT; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4544 bufp->frame_or_window = bar->window; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4545 bufp->arg = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4546 bufp->part = part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4547 bufp->code = 0; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4548 XSETINT (bufp->x, 0); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4549 XSETINT (bufp->y, 0); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4550 bufp->modifiers = 0; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4551 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4552 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4553 static OSStatus |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4554 get_control_part_bounds (ch, part_code, rect) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4555 ControlHandle ch; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4556 ControlPartCode part_code; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4557 Rect *rect; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4558 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4559 RgnHandle region = NewRgn (); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4560 OSStatus err; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4561 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4562 err = GetControlRegion (ch, part_code, region); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4563 if (err == noErr) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4564 GetRegionBounds (region, rect); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4565 DisposeRgn (region); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4566 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4567 return err; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4568 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4569 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4570 static void |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4571 x_scroll_bar_handle_press (bar, part_code, bufp) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4572 struct scroll_bar *bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4573 ControlPartCode part_code; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4574 struct input_event *bufp; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4575 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4576 int part = control_part_code_to_scroll_bar_part (part_code); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4577 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4578 if (part < 0) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4579 return; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4580 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4581 if (part != scroll_bar_handle) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4582 { |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4583 construct_scroll_bar_click (bar, part, bufp); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4584 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4585 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4586 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4587 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4588 last_scroll_bar_part = part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4589 bar->dragging = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4590 tracked_scroll_bar = bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4591 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4592 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4593 static void |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4594 x_scroll_bar_handle_release (bar, bufp) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4595 struct scroll_bar *bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4596 struct input_event *bufp; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4597 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4598 if (last_scroll_bar_part != scroll_bar_handle |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4599 || !GC_NILP (bar->dragging)) |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4600 construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4601 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4602 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4603 set_scroll_bar_timer (kEventDurationForever); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4604 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4605 last_scroll_bar_part = -1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4606 bar->dragging = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4607 tracked_scroll_bar = NULL; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4608 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4609 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4610 static void |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4611 x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4612 WindowPtr win; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4613 struct scroll_bar *bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4614 Point mouse_pos; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4615 struct input_event *bufp; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4616 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4617 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4618 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4619 if (last_scroll_bar_part == scroll_bar_handle) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4620 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4621 int top, top_range; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4622 Rect r; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4623 |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4624 get_control_part_bounds (SCROLL_BAR_CONTROL_HANDLE (bar), |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4625 kControlIndicatorPart, &r); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4626 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4627 if (GC_NILP (bar->dragging)) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4628 XSETINT (bar->dragging, mouse_pos.v - r.top); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4629 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4630 top = mouse_pos.v - XINT (bar->dragging) - XINT (bar->track_top); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4631 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4632 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch)) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4633 + .5; |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4634 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4635 if (top < 0) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4636 top = 0; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4637 if (top > top_range) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4638 top = top_range; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4639 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4640 construct_scroll_bar_click (bar, scroll_bar_handle, bufp); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4641 XSETINT (bufp->x, top); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4642 XSETINT (bufp->y, top_range); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4643 } |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
4644 else |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4645 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4646 ControlPartCode part_code; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4647 int unhilite_p = 0, part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4648 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4649 if (ch != FindControlUnderMouse (mouse_pos, win, &part_code)) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4650 unhilite_p = 1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4651 else |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4652 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4653 part = control_part_code_to_scroll_bar_part (part_code); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4654 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4655 switch (last_scroll_bar_part) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4656 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4657 case scroll_bar_above_handle: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4658 case scroll_bar_below_handle: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4659 if (part != scroll_bar_above_handle |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4660 && part != scroll_bar_below_handle) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4661 unhilite_p = 1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4662 break; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4663 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4664 case scroll_bar_up_arrow: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4665 case scroll_bar_down_arrow: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4666 if (part != scroll_bar_up_arrow |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4667 && part != scroll_bar_down_arrow) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4668 unhilite_p = 1; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4669 break; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4670 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4671 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4672 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4673 if (unhilite_p) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4674 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4675 else if (part != last_scroll_bar_part |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4676 || scroll_bar_timer_event_posted_p) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4677 { |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4678 construct_scroll_bar_click (bar, part, bufp); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4679 last_scroll_bar_part = part; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4680 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4681 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4682 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4683 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4684 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4685 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4686 /* Set the thumb size and position of scroll bar BAR. We are currently |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4687 displaying PORTION out of a whole WHOLE, and our position POSITION. */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4688 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4689 static void |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4690 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4691 struct scroll_bar *bar; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4692 int portion, position, whole; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4693 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4694 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
69113
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4695 int value, viewsize, maximum; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4696 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4697 if (XINT (bar->track_height) == 0) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4698 return; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4699 |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4700 if (whole == 0) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4701 value = 0, viewsize = 1, maximum = 0; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4702 else |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4703 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4704 value = position; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4705 viewsize = portion; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4706 maximum = max (0, whole - portion); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4707 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4708 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4709 BLOCK_INPUT; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4710 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4711 if (GetControlViewSize (ch) != viewsize |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4712 || GetControl32BitValue (ch) != value |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4713 || GetControl32BitMaximum (ch) != maximum) |
69113
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4714 { |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4715 /* Temporarily hide the scroll bar to avoid multiple redraws. */ |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4716 SetControlVisibility (ch, false, false); |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4717 |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4718 SetControl32BitMaximum (ch, maximum); |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4719 SetControl32BitValue (ch, value); |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4720 SetControlViewSize (ch, viewsize); |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4721 |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4722 SetControlVisibility (ch, true, true); |
eb6e7cc98bbf
(x_set_toolkit_scroll_bar_thumb): Don't set control
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69099
diff
changeset
|
4723 } |
69099
9547db029a2a
(GC_CLIP_REGION): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69061
diff
changeset
|
4724 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4725 UNBLOCK_INPUT; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4726 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4727 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4728 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4729 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
4730 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
4731 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4732 /************************************************************************ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4733 Scroll bars, general |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4734 ************************************************************************/ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4735 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4736 /* Create a scroll bar and return the scroll bar vector for it. W is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4737 the Emacs window on which to create the scroll bar. TOP, LEFT, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4738 WIDTH and HEIGHT are the pixel coordinates and dimensions of the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4739 scroll bar. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4740 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4741 static struct scroll_bar * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4742 x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4743 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4744 int top, left, width, height, disp_top, disp_height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4745 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4746 struct frame *f = XFRAME (w->frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4747 struct scroll_bar *bar |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4748 = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4749 Rect r; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4750 ControlHandle ch; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4751 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4752 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4753 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4754 r.left = left; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4755 r.top = disp_top; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4756 r.right = left + width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4757 r.bottom = disp_top + disp_height; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4758 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4759 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4760 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4761 #endif |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
4762 #if TARGET_API_MAC_CARBON |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4763 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4764 #if USE_TOOLKIT_SCROLL_BARS |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4765 false, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4766 #else |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4767 width < disp_height, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4768 #endif |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4769 0, 0, 0, kControlScrollBarProc, (long) bar); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4770 #else |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4771 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4772 0, 0, 0, scrollBarProc, (long) bar); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4773 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4774 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4775 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4776 XSETWINDOW (bar->window, w); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4777 XSETINT (bar->top, top); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4778 XSETINT (bar->left, left); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4779 XSETINT (bar->width, width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4780 XSETINT (bar->height, height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4781 XSETINT (bar->start, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4782 XSETINT (bar->end, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4783 bar->dragging = Qnil; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4784 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4785 bar->track_top = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4786 bar->track_height = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4787 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4788 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4789 /* Add bar to its frame's list of scroll bars. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4790 bar->next = FRAME_SCROLL_BARS (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4791 bar->prev = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4792 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4793 if (!NILP (bar->next)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4794 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4795 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4796 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4797 return bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4798 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4799 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4800 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4801 /* Draw BAR's handle in the proper position. |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4802 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4803 If the handle is already drawn from START to END, don't bother |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4804 redrawing it, unless REBUILD is non-zero; in that case, always |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4805 redraw it. (REBUILD is handy for drawing the handle after expose |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4806 events.) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4807 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4808 Normally, we want to constrain the start and end of the handle to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4809 fit inside its rectangle, but if the user is dragging the scroll |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4810 bar handle, we want to let them drag it down all the way, so that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4811 the bar's top is as far down as it goes; otherwise, there's no way |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4812 to move to the very end of the buffer. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4813 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4814 #ifndef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4815 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4816 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4817 x_scroll_bar_set_handle (bar, start, end, rebuild) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4818 struct scroll_bar *bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4819 int start, end; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4820 int rebuild; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4821 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4822 int dragging = ! NILP (bar->dragging); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4823 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4824 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4825 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4826 int length = end - start; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4827 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4828 /* If the display is already accurate, do nothing. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4829 if (! rebuild |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4830 && start == XINT (bar->start) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4831 && end == XINT (bar->end)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4832 return; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4833 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4834 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4835 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4836 /* Make sure the values are reasonable, and try to preserve the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4837 distance between start and end. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4838 if (start < 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4839 start = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4840 else if (start > top_range) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4841 start = top_range; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4842 end = start + length; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4843 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4844 if (end < start) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4845 end = start; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4846 else if (end > top_range && ! dragging) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4847 end = top_range; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4848 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4849 /* Store the adjusted setting in the scroll bar. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4850 XSETINT (bar->start, start); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4851 XSETINT (bar->end, end); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4852 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4853 /* Clip the end position, just for display. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4854 if (end > top_range) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4855 end = top_range; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4856 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4857 /* Draw bottom positions VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4858 top positions, to make sure the handle is always at least that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4859 many pixels tall. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4860 end += VERTICAL_SCROLL_BAR_MIN_HANDLE; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4861 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4862 SetControlMinimum (ch, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4863 /* Don't inadvertently activate deactivated scroll bars */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4864 if (GetControlMaximum (ch) != -1) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4865 SetControlMaximum (ch, top_range + VERTICAL_SCROLL_BAR_MIN_HANDLE |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4866 - (end - start)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4867 SetControlValue (ch, start); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4868 #if TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4869 SetControlViewSize (ch, end - start); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4870 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4871 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4872 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4873 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4874 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4875 #endif /* !USE_TOOLKIT_SCROLL_BARS */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4876 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4877 /* Destroy scroll bar BAR, and set its Emacs window's scroll bar to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4878 nil. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4879 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4880 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4881 x_scroll_bar_remove (bar) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4882 struct scroll_bar *bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4883 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4884 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4885 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4886 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4887 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4888 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4889 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4890 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4891 /* Destroy the Mac scroll bar control */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4892 DisposeControl (SCROLL_BAR_CONTROL_HANDLE (bar)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4893 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4894 /* Disassociate this scroll bar from its window. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4895 XWINDOW (bar->window)->vertical_scroll_bar = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4896 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4897 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4898 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4899 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4900 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4901 /* Set the handle of the vertical scroll bar for WINDOW to indicate |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4902 that we are displaying PORTION characters out of a total of WHOLE |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4903 characters, starting at POSITION. If WINDOW has no scroll bar, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4904 create one. */ |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4905 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4906 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4907 XTset_vertical_scroll_bar (w, portion, whole, position) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4908 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4909 int portion, whole, position; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4910 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4911 struct frame *f = XFRAME (w->frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4912 struct scroll_bar *bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4913 int top, height, left, sb_left, width, sb_width, disp_top, disp_height; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4914 int window_y, window_height; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4915 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4916 /* Get window dimensions. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4917 window_box (w, -1, 0, &window_y, 0, &window_height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4918 top = window_y; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4919 width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4920 height = window_height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4921 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4922 /* Compute the left edge of the scroll bar area. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4923 left = WINDOW_SCROLL_BAR_AREA_X (w); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4924 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4925 /* Compute the width of the scroll bar which might be less than |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4926 the width of the area reserved for the scroll bar. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4927 if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0) |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4928 sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4929 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4930 sb_width = width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4931 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4932 /* Compute the left edge of the scroll bar. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4933 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4934 sb_left = left; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4935 else |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
4936 sb_left = left + width - sb_width; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4937 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4938 /* Adjustments according to Inside Macintosh to make it look nice */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4939 disp_top = top; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4940 disp_height = height; |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4941 #ifdef MAC_OS8 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4942 if (disp_top == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4943 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4944 disp_top = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4945 disp_height++; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4946 } |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4947 else if (disp_top == FRAME_PIXEL_HEIGHT (f) - 16) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4948 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4949 disp_top++; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4950 disp_height--; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4951 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4952 |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
4953 if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4954 sb_left++; |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4955 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4956 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4957 /* Does the scroll bar exist yet? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4958 if (NILP (w->vertical_scroll_bar)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4959 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4960 BLOCK_INPUT; |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4961 mac_clear_area (f, left, top, width, height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4962 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4963 bar = x_scroll_bar_create (w, top, sb_left, sb_width, height, disp_top, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4964 disp_height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4965 XSETVECTOR (w->vertical_scroll_bar, bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4966 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4967 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4968 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4969 /* It may just need to be moved and resized. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4970 ControlHandle ch; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4971 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4972 bar = XSCROLL_BAR (w->vertical_scroll_bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4973 ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4974 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4975 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4976 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4977 /* If already correctly positioned, do nothing. */ |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4978 if (!(XINT (bar->left) == sb_left |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4979 && XINT (bar->top) == top |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4980 && XINT (bar->width) == sb_width |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4981 && XINT (bar->height) == height)) |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
4982 { |
64424
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
4983 /* Since toolkit scroll bars are smaller than the space reserved |
feba2f2d875e
(x_bitmap_icon, x_make_frame_visible): Remove declarations.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64313
diff
changeset
|
4984 for them on the frame, we have to clear "under" them. */ |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
4985 mac_clear_area (f, left, top, width, height); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4986 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4987 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4988 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
4989 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4990 HideControl (ch); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4991 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4992 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4993 disp_height); |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4994 #ifndef USE_TOOLKIT_SCROLL_BARS |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4995 if (sb_width < disp_height) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
4996 ShowControl (ch); |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
4997 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
4998 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
4999 /* Remember new settings. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5000 XSETINT (bar->left, sb_left); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5001 XSETINT (bar->top, top); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5002 XSETINT (bar->width, sb_width); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5003 XSETINT (bar->height, height); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5004 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5005 bar->track_top = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5006 bar->track_height = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5007 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5008 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5009 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5010 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5011 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5012 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5013 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5014 if (NILP (bar->track_top)) |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5015 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5016 if (sb_width >= disp_height) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5017 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5018 XSETINT (bar->track_top, 0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5019 XSETINT (bar->track_height, 0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5020 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5021 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5022 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5023 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5024 Rect r0, r1; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5025 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5026 BLOCK_INPUT; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5027 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5028 SetControl32BitMinimum (ch, 0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5029 SetControl32BitMaximum (ch, 1); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5030 SetControlViewSize (ch, 1); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5031 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5032 /* Move the scroll bar thumb to the top. */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5033 SetControl32BitValue (ch, 0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5034 get_control_part_bounds (ch, kControlIndicatorPart, &r0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5035 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5036 /* Move the scroll bar thumb to the bottom. */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5037 SetControl32BitValue (ch, 1); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5038 get_control_part_bounds (ch, kControlIndicatorPart, &r1); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5039 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5040 UnionRect (&r0, &r1, &r0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5041 XSETINT (bar->track_top, r0.top); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5042 XSETINT (bar->track_height, r0.bottom - r0.top); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5043 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5044 /* Don't show the scroll bar if its height is not enough to |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5045 display the scroll bar thumb. */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5046 if (r0.bottom - r0.top > 0) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5047 ShowControl (ch); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5048 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5049 UNBLOCK_INPUT; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5050 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
5051 } |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5052 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5053 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5054 #else /* not USE_TOOLKIT_SCROLL_BARS */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5055 /* Set the scroll bar's current state, unless we're currently being |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5056 dragged. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5057 if (NILP (bar->dragging)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5058 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5059 int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5060 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5061 if (whole == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5062 x_scroll_bar_set_handle (bar, 0, top_range, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5063 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5064 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5065 int start = ((double) position * top_range) / whole; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5066 int end = ((double) (position + portion) * top_range) / whole; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5067 x_scroll_bar_set_handle (bar, start, end, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5068 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5069 } |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5070 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5071 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5072 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5073 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5074 /* The following three hooks are used when we're doing a thorough |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5075 redisplay of the frame. We don't explicitly know which scroll bars |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5076 are going to be deleted, because keeping track of when windows go |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5077 away is a real pain - "Can you say set-window-configuration, boys |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5078 and girls?" Instead, we just assert at the beginning of redisplay |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5079 that *all* scroll bars are to be removed, and then save a scroll bar |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5080 from the fiery pit when we actually redisplay its window. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5081 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5082 /* Arrange for all scroll bars on FRAME to be removed at the next call |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5083 to `*judge_scroll_bars_hook'. A scroll bar may be spared if |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5084 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5085 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5086 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5087 XTcondemn_scroll_bars (frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5088 FRAME_PTR frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5089 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5090 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5091 while (! NILP (FRAME_SCROLL_BARS (frame))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5092 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5093 Lisp_Object bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5094 bar = FRAME_SCROLL_BARS (frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5095 FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5096 XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5097 XSCROLL_BAR (bar)->prev = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5098 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5099 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5100 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5101 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5102 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5103 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5104 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5105 /* Un-mark WINDOW's scroll bar for deletion in this judgment cycle. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5106 Note that WINDOW isn't necessarily condemned at all. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5107 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5108 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5109 XTredeem_scroll_bar (window) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5110 struct window *window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5111 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5112 struct scroll_bar *bar; |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5113 struct frame *f; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5114 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5115 /* We can't redeem this window's scroll bar if it doesn't have one. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5116 if (NILP (window->vertical_scroll_bar)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5117 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5118 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5119 bar = XSCROLL_BAR (window->vertical_scroll_bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5120 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5121 /* Unlink it from the condemned list. */ |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5122 f = XFRAME (WINDOW_FRAME (window)); |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5123 if (NILP (bar->prev)) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5124 { |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5125 /* If the prev pointer is nil, it must be the first in one of |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5126 the lists. */ |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5127 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5128 /* It's not condemned. Everything's fine. */ |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5129 return; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5130 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5131 window->vertical_scroll_bar)) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5132 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5133 else |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5134 /* If its prev pointer is nil, it must be at the front of |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5135 one or the other! */ |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5136 abort (); |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5137 } |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5138 else |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5139 XSCROLL_BAR (bar->prev)->next = bar->next; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5140 |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5141 if (! NILP (bar->next)) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5142 XSCROLL_BAR (bar->next)->prev = bar->prev; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5143 |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5144 bar->next = FRAME_SCROLL_BARS (f); |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5145 bar->prev = Qnil; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5146 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5147 if (! NILP (bar->next)) |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5148 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5149 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5150 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5151 /* Remove all scroll bars on FRAME that haven't been saved since the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5152 last call to `*condemn_scroll_bars_hook'. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5153 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5154 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5155 XTjudge_scroll_bars (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5156 FRAME_PTR f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5157 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5158 Lisp_Object bar, next; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5159 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5160 bar = FRAME_CONDEMNED_SCROLL_BARS (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5161 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5162 /* Clear out the condemned list now so we won't try to process any |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5163 more events on the hapless scroll bars. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5164 FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5165 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5166 for (; ! NILP (bar); bar = next) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5167 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5168 struct scroll_bar *b = XSCROLL_BAR (bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5169 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5170 x_scroll_bar_remove (b); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5171 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5172 next = b->next; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5173 b->next = b->prev = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5174 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5175 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5176 /* Now there should be no references to the condemned scroll bars, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5177 and they should get garbage-collected. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5178 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5179 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5180 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5181 /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind |
45803
9484de301252
Rename enum event_kind items.
Pavel Janík <Pavel@Janik.cz>
parents:
45197
diff
changeset
|
5182 is set to something other than NO_EVENT, it is enqueued. |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5183 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5184 This may be called from a signal handler, so we have to ignore GC |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5185 mark bits. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5186 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5187 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5188 x_scroll_bar_handle_click (bar, part_code, er, bufp) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5189 struct scroll_bar *bar; |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5190 ControlPartCode part_code; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5191 EventRecord *er; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5192 struct input_event *bufp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5193 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5194 int win_y, top_range; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5195 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5196 if (! GC_WINDOWP (bar->window)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5197 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5198 |
45803
9484de301252
Rename enum event_kind items.
Pavel Janík <Pavel@Janik.cz>
parents:
45197
diff
changeset
|
5199 bufp->kind = SCROLL_BAR_CLICK_EVENT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5200 bufp->frame_or_window = bar->window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5201 bufp->arg = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5202 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5203 bar->dragging = Qnil; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5204 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5205 switch (part_code) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5206 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5207 case kControlUpButtonPart: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5208 bufp->part = scroll_bar_up_arrow; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5209 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5210 case kControlDownButtonPart: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5211 bufp->part = scroll_bar_down_arrow; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5212 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5213 case kControlPageUpPart: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5214 bufp->part = scroll_bar_above_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5215 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5216 case kControlPageDownPart: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5217 bufp->part = scroll_bar_below_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5218 break; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
5219 #if TARGET_API_MAC_CARBON |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5220 default: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5221 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5222 case kControlIndicatorPart: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5223 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5224 if (er->what == mouseDown) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5225 bar->dragging = make_number (0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5226 XSETVECTOR (last_mouse_scroll_bar, bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5227 bufp->part = scroll_bar_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5228 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5229 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5230 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5231 win_y = XINT (bufp->y) - XINT (bar->top); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5232 top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (0/*dummy*/, XINT (bar->height)); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5233 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5234 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5235 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5236 win_y -= 24; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5237 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5238 if (! NILP (bar->dragging)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5239 win_y -= XINT (bar->dragging); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5240 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5241 if (win_y < 0) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5242 win_y = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5243 if (win_y > top_range) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5244 win_y = top_range; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5245 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5246 XSETINT (bufp->x, win_y); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5247 XSETINT (bufp->y, top_range); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5248 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5249 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5250 #ifndef USE_TOOLKIT_SCROLL_BARS |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5251 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5252 /* Handle some mouse motion while someone is dragging the scroll bar. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5253 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5254 This may be called from a signal handler, so we have to ignore GC |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5255 mark bits. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5256 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5257 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5258 x_scroll_bar_note_movement (bar, y_pos, t) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5259 struct scroll_bar *bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5260 int y_pos; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5261 Time t; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5262 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5263 FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5264 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5265 last_mouse_movement_time = t; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5266 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5267 f->mouse_moved = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5268 XSETVECTOR (last_mouse_scroll_bar, bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5269 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5270 /* If we're dragging the bar, display it. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5271 if (! GC_NILP (bar->dragging)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5272 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5273 /* Where should the handle be now? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5274 int new_start = y_pos - 24; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5275 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5276 if (new_start != XINT (bar->start)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5277 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5278 int new_end = new_start + (XINT (bar->end) - XINT (bar->start)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5279 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5280 x_scroll_bar_set_handle (bar, new_start, new_end, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5281 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5282 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5283 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5284 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
5285 #endif /* !USE_TOOLKIT_SCROLL_BARS */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5286 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5287 /* Return information to the user about the current position of the mouse |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5288 on the scroll bar. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5289 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5290 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5291 x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5292 FRAME_PTR *fp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5293 Lisp_Object *bar_window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5294 enum scroll_bar_part *part; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5295 Lisp_Object *x, *y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5296 unsigned long *time; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5297 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5298 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5299 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5300 #if TARGET_API_MAC_CARBON |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5301 WindowPtr wp = GetControlOwner (ch); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5302 #else |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5303 WindowPtr wp = (*ch)->contrlOwner; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5304 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5305 Point mouse_pos; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5306 struct frame *f = mac_window_to_frame (wp); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5307 int win_y, top_range; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5308 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
5309 SetPortWindowPort (wp); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5310 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5311 GetMouse (&mouse_pos); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5312 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5313 win_y = mouse_pos.v - XINT (bar->top); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5314 top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5315 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5316 win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5317 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5318 win_y -= 24; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5319 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5320 if (! NILP (bar->dragging)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5321 win_y -= XINT (bar->dragging); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5322 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5323 if (win_y < 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5324 win_y = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5325 if (win_y > top_range) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5326 win_y = top_range; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5327 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5328 *fp = f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5329 *bar_window = bar->window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5330 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5331 if (! NILP (bar->dragging)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5332 *part = scroll_bar_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5333 else if (win_y < XINT (bar->start)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5334 *part = scroll_bar_above_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5335 else if (win_y < XINT (bar->end) + VERTICAL_SCROLL_BAR_MIN_HANDLE) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5336 *part = scroll_bar_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5337 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5338 *part = scroll_bar_below_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5339 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5340 XSETINT (*x, win_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5341 XSETINT (*y, top_range); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5342 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5343 f->mouse_moved = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5344 last_mouse_scroll_bar = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5345 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5346 *time = last_mouse_movement_time; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5347 } |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5348 |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5349 |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5350 /* The screen has been cleared so we may have changed foreground or |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5351 background colors, and the scroll bars may need to be redrawn. |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5352 Clear out the scroll bars, and ask for expose events, so we can |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5353 redraw them. */ |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5354 |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5355 void |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5356 x_scroll_bar_clear (f) |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5357 FRAME_PTR f; |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5358 { |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5359 XTcondemn_scroll_bars (f); |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5360 XTjudge_scroll_bars (f); |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5361 } |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
5362 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5363 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5364 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5365 Text Cursor |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5366 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5367 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5368 /* Set clipping for output in glyph row ROW. W is the window in which |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5369 we operate. GC is the graphics context to set clipping in. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5370 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5371 ROW may be a text row or, e.g., a mode line. Text rows must be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5372 clipped to the interior of the window dedicated to text display, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5373 mode lines must be clipped to the whole window. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5374 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5375 static void |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5376 x_clip_to_row (w, row, area, gc) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5377 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5378 struct glyph_row *row; |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5379 int area; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5380 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5381 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5382 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5383 Rect clip_rect; |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5384 int window_x, window_y, window_width; |
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5385 |
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5386 window_box (w, area, &window_x, &window_y, &window_width, 0); |
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5387 |
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5388 clip_rect.left = window_x; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5389 clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5390 clip_rect.top = max (clip_rect.top, window_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5391 clip_rect.right = clip_rect.left + window_width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5392 clip_rect.bottom = clip_rect.top + row->visible_height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5393 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
5394 mac_set_clip_rectangles (FRAME_MAC_DISPLAY (f), gc, &clip_rect, 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5395 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5396 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5397 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5398 /* Draw a hollow box cursor on window W in glyph row ROW. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5399 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5400 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5401 x_draw_hollow_cursor (w, row) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5402 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5403 struct glyph_row *row; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5404 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5405 struct frame *f = XFRAME (WINDOW_FRAME (w)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5406 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5407 Display *dpy = FRAME_MAC_DISPLAY (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5408 int x, y, wd, h; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5409 XGCValues xgcv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5410 struct glyph *cursor_glyph; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5411 GC gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5412 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5413 /* Get the glyph the cursor is on. If we can't tell because |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5414 the current matrix is invalid or such, give up. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5415 cursor_glyph = get_phys_cursor_glyph (w); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5416 if (cursor_glyph == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5417 return; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5418 |
59748
1df465faf1df
(x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Kim F. Storm <storm@cua.dk>
parents:
59718
diff
changeset
|
5419 /* Compute frame-relative coordinates for phys cursor. */ |
71021
a86a3503e350
(x_draw_stretch_glyph_string): Fix problems with invisible
Kim F. Storm <storm@cua.dk>
parents:
70874
diff
changeset
|
5420 get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5421 wd = w->phys_cursor_width; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5422 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5423 /* The foreground of cursor_gc is typically the same as the normal |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5424 background color, which can cause the cursor box to be invisible. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5425 xgcv.foreground = f->output_data.mac->cursor_pixel; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5426 if (dpyinfo->scratch_cursor_gc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5427 XChangeGC (dpy, dpyinfo->scratch_cursor_gc, GCForeground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5428 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5429 dpyinfo->scratch_cursor_gc = XCreateGC (dpy, FRAME_MAC_WINDOW (f), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5430 GCForeground, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5431 gc = dpyinfo->scratch_cursor_gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5432 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5433 /* Set clipping, draw the rectangle, and reset clipping again. */ |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5434 x_clip_to_row (w, row, TEXT_AREA, gc); |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5435 mac_draw_rectangle (f, gc, x, y, wd, h - 1); |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
5436 mac_reset_clip_rectangles (dpy, gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5437 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5438 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5439 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5440 /* Draw a bar cursor on window W in glyph row ROW. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5441 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5442 Implementation note: One would like to draw a bar cursor with an |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5443 angle equal to the one given by the font property XA_ITALIC_ANGLE. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5444 Unfortunately, I didn't find a font yet that has this property set. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5445 --gerd. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5446 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5447 static void |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5448 x_draw_bar_cursor (w, row, width, kind) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5449 struct window *w; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5450 struct glyph_row *row; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5451 int width; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5452 enum text_cursor_kinds kind; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5453 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5454 struct frame *f = XFRAME (w->frame); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5455 struct glyph *cursor_glyph; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5456 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5457 /* If cursor is out of bounds, don't draw garbage. This can happen |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5458 in mini-buffer windows when switching between echo area glyphs |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5459 and mini-buffer. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5460 cursor_glyph = get_phys_cursor_glyph (w); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5461 if (cursor_glyph == NULL) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5462 return; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5463 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5464 /* If on an image, draw like a normal cursor. That's usually better |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5465 visible than drawing a bar, esp. if the image is large so that |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5466 the bar might not be in the window. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5467 if (cursor_glyph->type == IMAGE_GLYPH) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5468 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5469 struct glyph_row *row; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5470 row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5471 draw_phys_cursor_glyph (w, row, DRAW_CURSOR); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5472 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5473 else |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5474 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5475 Display *dpy = FRAME_MAC_DISPLAY (f); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5476 Window window = FRAME_MAC_WINDOW (f); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5477 GC gc = FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5478 unsigned long mask = GCForeground | GCBackground; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5479 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5480 XGCValues xgcv; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5481 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5482 /* If the glyph's background equals the color we normally draw |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5483 the bar cursor in, the bar cursor in its normal color is |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5484 invisible. Use the glyph's foreground color instead in this |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5485 case, on the assumption that the glyph's colors are chosen so |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5486 that the glyph is legible. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5487 if (face->background == f->output_data.mac->cursor_pixel) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5488 xgcv.background = xgcv.foreground = face->foreground; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5489 else |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5490 xgcv.background = xgcv.foreground = f->output_data.mac->cursor_pixel; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5491 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5492 if (gc) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5493 XChangeGC (dpy, gc, mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5494 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5495 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5496 gc = XCreateGC (dpy, window, mask, &xgcv); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5497 FRAME_MAC_DISPLAY_INFO (f)->scratch_cursor_gc = gc; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5498 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5499 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5500 if (width < 0) |
47138
4a0541418bc5
(x_specified_cursor_type): Remove prototype.
Kim F. Storm <storm@cua.dk>
parents:
47030
diff
changeset
|
5501 width = FRAME_CURSOR_WIDTH (f); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5502 width = min (cursor_glyph->pixel_width, width); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5503 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5504 w->phys_cursor_width = width; |
58403
c936fa56eb60
(x_clip_to_row): Add area arg. Callers changed.
Kim F. Storm <storm@cua.dk>
parents:
57783
diff
changeset
|
5505 x_clip_to_row (w, row, TEXT_AREA, gc); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5506 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5507 if (kind == BAR_CURSOR) |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5508 mac_fill_rectangle (f, gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5509 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5510 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5511 width, row->height); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5512 else |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5513 mac_fill_rectangle (f, gc, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5514 WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5515 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y + |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5516 row->height - width), |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5517 cursor_glyph->pixel_width, |
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5518 width); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5519 |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
5520 mac_reset_clip_rectangles (dpy, gc); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5521 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5522 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5523 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5524 |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5525 /* RIF: Define cursor CURSOR on frame F. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5526 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5527 static void |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5528 mac_define_frame_cursor (f, cursor) |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5529 struct frame *f; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5530 Cursor cursor; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5531 { |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
5532 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
5533 |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
5534 if (dpyinfo->x_focus_frame == f) |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
5535 SetThemeCursor (cursor); |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5536 } |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5537 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5538 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5539 /* RIF: Clear area on frame F. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5540 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5541 static void |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5542 mac_clear_frame_area (f, x, y, width, height) |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5543 struct frame *f; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5544 int x, y, width, height; |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5545 { |
66110
479c8c41d179
(MAC_WINDOW_NORMAL_GC): Remove macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66080
diff
changeset
|
5546 mac_clear_area (f, x, y, width, height); |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5547 } |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5548 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5549 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5550 /* RIF: Draw cursor on window W. */ |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5551 |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5552 static void |
50243
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5553 mac_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5554 struct window *w; |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5555 struct glyph_row *glyph_row; |
50243
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5556 int x, y; |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5557 int cursor_type, cursor_width; |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5558 int on_p, active_p; |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5559 { |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5560 if (on_p) |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5561 { |
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5562 w->phys_cursor_type = cursor_type; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5563 w->phys_cursor_on_p = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5564 |
53606
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5565 if (glyph_row->exact_window_width_line_p |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5566 && w->phys_cursor.hpos >= glyph_row->used[TEXT_AREA]) |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5567 { |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5568 glyph_row->cursor_in_fringe_p = 1; |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5569 draw_fringe_bitmap (w, glyph_row, 0); |
96c29ac603e8
(x_update_window_end): Call draw_window_fringes.
Kim F. Storm <storm@cua.dk>
parents:
53579
diff
changeset
|
5570 } |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5571 else |
50243
3fb54e5a7201
(struct redisplay_interface): Add active_p argument to
Kim F. Storm <storm@cua.dk>
parents:
50222
diff
changeset
|
5572 switch (cursor_type) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5573 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5574 case HOLLOW_BOX_CURSOR: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5575 x_draw_hollow_cursor (w, glyph_row); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5576 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5577 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5578 case FILLED_BOX_CURSOR: |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
5579 draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5580 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5581 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5582 case BAR_CURSOR: |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5583 x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5584 break; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5585 |
47138
4a0541418bc5
(x_specified_cursor_type): Remove prototype.
Kim F. Storm <storm@cua.dk>
parents:
47030
diff
changeset
|
5586 case HBAR_CURSOR: |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5587 x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5588 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5589 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5590 case NO_CURSOR: |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
5591 w->phys_cursor_width = 0; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5592 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5593 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5594 default: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5595 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5596 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5597 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5598 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5599 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5600 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5601 /* Icons. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5602 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5603 #if 0 /* MAC_TODO: no icon support yet. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5604 int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5605 x_bitmap_icon (f, icon) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5606 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5607 Lisp_Object icon; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5608 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5609 HANDLE hicon; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5610 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5611 if (FRAME_W32_WINDOW (f) == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5612 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5613 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5614 if (NILP (icon)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5615 hicon = LoadIcon (hinst, EMACS_CLASS); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5616 else if (STRINGP (icon)) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
5617 hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5618 LR_DEFAULTSIZE | LR_LOADFROMFILE); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5619 else if (SYMBOLP (icon)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5620 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5621 LPCTSTR name; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5622 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5623 if (EQ (icon, intern ("application"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5624 name = (LPCTSTR) IDI_APPLICATION; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5625 else if (EQ (icon, intern ("hand"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5626 name = (LPCTSTR) IDI_HAND; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5627 else if (EQ (icon, intern ("question"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5628 name = (LPCTSTR) IDI_QUESTION; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5629 else if (EQ (icon, intern ("exclamation"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5630 name = (LPCTSTR) IDI_EXCLAMATION; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5631 else if (EQ (icon, intern ("asterisk"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5632 name = (LPCTSTR) IDI_ASTERISK; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5633 else if (EQ (icon, intern ("winlogo"))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5634 name = (LPCTSTR) IDI_WINLOGO; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5635 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5636 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5637 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5638 hicon = LoadIcon (NULL, name); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5639 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5640 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5641 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5642 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5643 if (hicon == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5644 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5645 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5646 PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5647 (LPARAM) hicon); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5648 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5649 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5650 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5651 #endif /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5652 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5653 /************************************************************************ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5654 Handling X errors |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5655 ************************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5656 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5657 /* Display Error Handling functions not used on W32. Listing them here |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5658 helps diff stay in step when comparing w32term.c with xterm.c. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5659 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5660 x_error_catcher (display, error) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5661 x_catch_errors (dpy) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5662 x_catch_errors_unwind (old_val) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5663 x_check_errors (dpy, format) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5664 x_had_errors_p (dpy) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5665 x_clear_errors (dpy) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5666 x_uncatch_errors (dpy, count) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5667 x_trace_wire () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5668 x_connection_signal (signalnum) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5669 x_connection_closed (dpy, error_message) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5670 x_error_quitter (display, error) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5671 x_error_handler (display, error) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5672 x_io_error_quitter (display) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5673 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5674 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5675 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5676 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5677 /* Changing the font of the frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5678 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5679 /* Give frame F the font named FONTNAME as its default font, and |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5680 return the full name of that font. FONTNAME may be a wildcard |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5681 pattern; in that case, we choose some font that fits the pattern. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5682 The return value shows which font we chose. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5683 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5684 Lisp_Object |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5685 x_new_font (f, fontname) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5686 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5687 register char *fontname; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5688 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5689 struct font_info *fontp |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5690 = FS_LOAD_FONT (f, fontname); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5691 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5692 if (!fontp) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5693 return Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5694 |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5695 if (FRAME_FONT (f) == (XFontStruct *) (fontp->font)) |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5696 /* This font is already set in frame F. There's nothing more to |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5697 do. */ |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5698 return build_string (fontp->full_name); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5699 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5700 FRAME_FONT (f) = (XFontStruct *) (fontp->font); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5701 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5702 FRAME_FONTSET (f) = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5703 |
59325
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
5704 FRAME_COLUMN_WIDTH (f) = fontp->average_width; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
5705 FRAME_SPACE_WIDTH (f) = fontp->space_width; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5706 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f)); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5707 |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5708 compute_fringe_widths (f, 1); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5709 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5710 /* Compute the scroll bar width in character columns. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5711 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5712 { |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5713 int wid = FRAME_COLUMN_WIDTH (f); |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
5714 FRAME_CONFIG_SCROLL_BAR_COLS (f) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5715 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5716 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5717 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5718 { |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5719 int wid = FRAME_COLUMN_WIDTH (f); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5720 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5721 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5722 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5723 /* Now make the frame display the given font. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5724 if (FRAME_MAC_WINDOW (f) != 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5725 { |
45848 | 5726 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc, |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5727 FRAME_FONT (f)); |
45848 | 5728 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->reverse_gc, |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5729 FRAME_FONT (f)); |
45848 | 5730 XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->cursor_gc, |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5731 FRAME_FONT (f)); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5732 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
5733 /* Don't change the size of a tip frame; there's no point in |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
5734 doing it because it's done in Fx_show_tip, and it leads to |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
5735 problems because the tip frame has no widget. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5736 if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5737 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5738 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5739 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5740 return build_string (fontp->full_name); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5741 } |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5742 |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5743 /* Give frame F the fontset named FONTSETNAME as its default fontset, |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5744 and return the full name of that fontset. FONTSETNAME may be a |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5745 wildcard pattern; in that case, we choose some fontset that fits |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5746 the pattern. FONTSETNAME may be a font name for ASCII characters; |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5747 in that case, we create a fontset from that font name. |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5748 |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5749 The return value shows which fontset we chose. |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5750 If FONTSETNAME specifies the default fontset, return Qt. |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5751 If an ASCII font in the specified fontset can't be loaded, return |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
5752 Qnil. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5753 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5754 Lisp_Object |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5755 x_new_fontset (f, fontsetname) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5756 struct frame *f; |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5757 Lisp_Object fontsetname; |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5758 { |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5759 int fontset = fs_query_fontset (fontsetname, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5760 Lisp_Object result; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5761 |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5762 if (fontset > 0 && FRAME_FONTSET(f) == fontset) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5763 /* This fontset is already set in frame F. There's nothing more |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5764 to do. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5765 return fontset_name (fontset); |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5766 else if (fontset == 0) |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5767 /* The default fontset can't be the default font. */ |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5768 return Qt; |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5769 |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5770 if (fontset > 0) |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5771 result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5772 else |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5773 result = x_new_font (f, SDATA (fontsetname)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5774 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5775 if (!STRINGP (result)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5776 /* Can't load ASCII font. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5777 return Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5778 |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5779 if (fontset < 0) |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5780 fontset = new_fontset_from_font_name (result); |
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5781 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5782 /* Since x_new_font doesn't update any fontset information, do it now. */ |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
5783 FRAME_FONTSET (f) = fontset; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5784 |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
5785 return fontset_name (fontset); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5786 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5787 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5788 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5789 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5790 TODO: W32 Input Methods |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5791 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5792 /* Listing missing functions from xterm.c helps diff stay in step. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5793 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5794 xim_destroy_callback (xim, client_data, call_data) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5795 xim_open_dpy (dpyinfo, resource_name) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5796 struct xim_inst_t |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5797 xim_instantiate_callback (display, client_data, call_data) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5798 xim_initialize (dpyinfo, resource_name) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5799 xim_close_dpy (dpyinfo) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5800 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5801 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5802 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5803 |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5804 void |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5805 mac_get_window_bounds (f, inner, outer) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5806 struct frame *f; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5807 Rect *inner, *outer; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5808 { |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5809 #if TARGET_API_MAC_CARBON |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5810 GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowContentRgn, inner); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5811 GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowStructureRgn, outer); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5812 #else /* not TARGET_API_MAC_CARBON */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5813 RgnHandle region = NewRgn (); |
57373
38e45bf0128a
(x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents:
57357
diff
changeset
|
5814 |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5815 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowContentRgn, region); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5816 *inner = (*region)->rgnBBox; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5817 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowStructureRgn, region); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5818 *outer = (*region)->rgnBBox; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5819 DisposeRgn (region); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5820 #endif /* not TARGET_API_MAC_CARBON */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5821 } |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5822 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5823 |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
5824 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5825 /* Calculate the absolute position in frame F |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5826 from its current recorded position values and gravity. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5827 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5828 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5829 x_calc_absolute_position (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5830 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5831 { |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5832 int width_diff = 0, height_diff = 0; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5833 int flags = f->size_hint_flags; |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5834 Rect inner, outer; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5835 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5836 /* We have nothing to do if the current position |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5837 is already for the top-left corner. */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5838 if (! ((flags & XNegative) || (flags & YNegative))) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5839 return; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5840 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5841 /* Find the offsets of the outside upper-left corner of |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5842 the inner window, with respect to the outer window. */ |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5843 mac_get_window_bounds (f, &inner, &outer); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5844 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5845 width_diff = (outer.right - outer.left) - (inner.right - inner.left); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5846 height_diff = (outer.bottom - outer.top) - (inner.bottom - inner.top); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5847 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5848 /* Treat negative positions as relative to the leftmost bottommost |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5849 position that fits on the screen. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5850 if (flags & XNegative) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5851 f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5852 - width_diff |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5853 - FRAME_PIXEL_WIDTH (f) |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5854 + f->left_pos); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5855 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5856 if (flags & YNegative) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5857 f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5858 - height_diff |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5859 - FRAME_PIXEL_HEIGHT (f) |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5860 + f->top_pos); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5861 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5862 /* The left_pos and top_pos |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5863 are now relative to the top and left screen edges, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5864 so the flags should correspond. */ |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5865 f->size_hint_flags &= ~ (XNegative | YNegative); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5866 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5867 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5868 /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5869 to really change the position, and 0 when calling from |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5870 x_make_frame_visible (in that case, XOFF and YOFF are the current |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5871 position values). It is -1 when calling from x_set_frame_parameters, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5872 which means, do adjust for borders but don't change the gravity. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5873 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5874 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5875 x_set_offset (f, xoff, yoff, change_gravity) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5876 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5877 register int xoff, yoff; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5878 int change_gravity; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5879 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5880 if (change_gravity > 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5881 { |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5882 f->top_pos = yoff; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5883 f->left_pos = xoff; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5884 f->size_hint_flags &= ~ (XNegative | YNegative); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5885 if (xoff < 0) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5886 f->size_hint_flags |= XNegative; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5887 if (yoff < 0) |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5888 f->size_hint_flags |= YNegative; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5889 f->win_gravity = NorthWestGravity; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5890 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5891 x_calc_absolute_position (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5892 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5893 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5894 x_wm_set_size_hint (f, (long) 0, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5895 |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5896 #if TARGET_API_MAC_CARBON |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5897 MoveWindowStructure (FRAME_MAC_WINDOW (f), f->left_pos, f->top_pos); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5898 /* If the title bar is completely outside the screen, adjust the |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5899 position. */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5900 ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn, |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5901 kWindowConstrainMoveRegardlessOfFit |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5902 | kWindowConstrainAllowPartial, NULL, NULL); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5903 x_real_positions (f, &f->left_pos, &f->top_pos); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5904 #else |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5905 { |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5906 Rect inner, outer, screen_rect, dummy; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5907 RgnHandle region = NewRgn (); |
57373
38e45bf0128a
(x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents:
57357
diff
changeset
|
5908 |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5909 mac_get_window_bounds (f, &inner, &outer); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5910 f->x_pixels_diff = inner.left - outer.left; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5911 f->y_pixels_diff = inner.top - outer.top; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5912 MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff, |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5913 f->top_pos + f->y_pixels_diff, false); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5914 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5915 /* If the title bar is completely outside the screen, adjust the |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5916 position. The variable `outer' holds the title bar rectangle. |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5917 The variable `inner' holds slightly smaller one than `outer', |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5918 so that the calculation of overlapping may not become too |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5919 strict. */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5920 GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn, region); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5921 outer = (*region)->rgnBBox; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5922 DisposeRgn (region); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5923 inner = outer; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5924 InsetRect (&inner, 8, 8); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5925 screen_rect = qd.screenBits.bounds; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5926 screen_rect.top += GetMBarHeight (); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5927 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5928 if (!SectRect (&inner, &screen_rect, &dummy)) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5929 { |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5930 if (inner.right <= screen_rect.left) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5931 f->left_pos = screen_rect.left; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5932 else if (inner.left >= screen_rect.right) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5933 f->left_pos = screen_rect.right - (outer.right - outer.left); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5934 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5935 if (inner.bottom <= screen_rect.top) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5936 f->top_pos = screen_rect.top; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5937 else if (inner.top >= screen_rect.bottom) |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5938 f->top_pos = screen_rect.bottom - (outer.bottom - outer.top); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5939 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5940 MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff, |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5941 f->top_pos + f->y_pixels_diff, false); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5942 } |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5943 } |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
5944 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5945 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5946 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5947 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5948 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5949 /* Call this to change the size of frame F's x-window. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5950 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5951 for this size change and subsequent size changes. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5952 Otherwise we leave the window gravity unchanged. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5953 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5954 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5955 x_set_window_size (f, change_gravity, cols, rows) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5956 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5957 int change_gravity; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5958 int cols, rows; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5959 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5960 int pixelwidth, pixelheight; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5961 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5962 BLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5963 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5964 check_frame_size (f, &rows, &cols); |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5965 f->scroll_bar_actual_width |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5966 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5967 |
50097 | 5968 compute_fringe_widths (f, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5969 |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5970 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5971 pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5972 |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
5973 f->win_gravity = NorthWestGravity; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5974 x_wm_set_size_hint (f, (long) 0, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5975 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5976 SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0); |
60623
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
5977 #if TARGET_API_MAC_CARBON |
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
5978 if (f->output_data.mac->hourglass_control) |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5979 { |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5980 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5981 mac_prepare_for_quickdraw (f); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5982 #endif |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5983 MoveControl (f->output_data.mac->hourglass_control, |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5984 pixelwidth - HOURGLASS_WIDTH, 0); |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
5985 } |
60623
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
5986 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5987 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5988 /* Now, strictly speaking, we can't be sure that this is accurate, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5989 but the window manager will get around to dealing with the size |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5990 change request eventually, and we'll hear how it went when the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5991 ConfigureNotify event gets here. |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
5992 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5993 We could just not bother storing any of this information here, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5994 and let the ConfigureNotify event set everything up, but that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5995 might be kind of confusing to the Lisp code, since size changes |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5996 wouldn't be reported in the frame parameters until some random |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5997 point in the future when the ConfigureNotify event arrives. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5998 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
5999 We pass 1 for DELAY since we can't run Lisp code inside of |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6000 a BLOCK_INPUT. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6001 change_frame_size (f, rows, cols, 0, 1, 0); |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6002 FRAME_PIXEL_WIDTH (f) = pixelwidth; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6003 FRAME_PIXEL_HEIGHT (f) = pixelheight; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6004 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6005 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6006 receive in the ConfigureNotify event; if we get what we asked |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6007 for, then the event won't cause the screen to become garbaged, so |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6008 we have to make sure to do it here. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6009 SET_FRAME_GARBAGED (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6010 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6011 XFlush (FRAME_X_DISPLAY (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6012 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6013 /* If cursor was outside the new size, mark it as off. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6014 mark_window_cursors_off (XWINDOW (f->root_window)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6015 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6016 /* Clear out any recollection of where the mouse highlighting was, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6017 since it might be in a place that's outside the new frame size. |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6018 Actually checking whether it is outside is a pain in the neck, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6019 so don't try--just let the highlighting be done afresh with new size. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6020 cancel_mouse_face (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6021 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6022 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6023 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6024 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6025 /* Mouse warping. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6026 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6027 void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6028 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6029 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6030 x_set_mouse_position (f, x, y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6031 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6032 int x, y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6033 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6034 int pix_x, pix_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6035 |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6036 pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6037 pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6038 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6039 if (pix_x < 0) pix_x = 0; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6040 if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6041 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6042 if (pix_y < 0) pix_y = 0; |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
6043 if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6044 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6045 x_set_mouse_pixel_position (f, pix_x, pix_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6046 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6047 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6048 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6049 x_set_mouse_pixel_position (f, pix_x, pix_y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6050 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6051 int pix_x, pix_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6052 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6053 #if 0 /* MAC_TODO: CursorDeviceMoveTo is non-Carbon */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6054 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6055 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6056 XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6057 0, 0, 0, 0, pix_x, pix_y); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6058 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6059 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6060 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6061 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6062 /* focus shifting, raising and lowering. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6063 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6064 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6065 x_focus_on_frame (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6066 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6067 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6068 #if 0 /* This proves to be unpleasant. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6069 x_raise_frame (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6070 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6071 #if 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6072 /* I don't think that the ICCCM allows programs to do things like this |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6073 without the interaction of the window manager. Whatever you end up |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6074 doing with this code, do it to x_unfocus_frame too. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6075 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6076 RevertToPointerRoot, CurrentTime); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6077 #endif /* ! 0 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6078 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6079 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6080 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6081 x_unfocus_frame (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6082 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6083 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6084 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6085 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6086 /* Raise frame F. */ |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
6087 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6088 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6089 x_raise_frame (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6090 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6091 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6092 if (f->async_visible) |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6093 { |
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6094 BLOCK_INPUT; |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
6095 BringToFront (FRAME_MAC_WINDOW (f)); |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6096 UNBLOCK_INPUT; |
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6097 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6098 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6099 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6100 /* Lower frame F. */ |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
6101 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6102 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6103 x_lower_frame (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6104 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6105 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6106 if (f->async_visible) |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6107 { |
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6108 BLOCK_INPUT; |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
6109 SendBehind (FRAME_MAC_WINDOW (f), NULL); |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6110 UNBLOCK_INPUT; |
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
6111 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6112 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6113 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6114 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6115 XTframe_raise_lower (f, raise_flag) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6116 FRAME_PTR f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6117 int raise_flag; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6118 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6119 if (raise_flag) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6120 x_raise_frame (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6121 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6122 x_lower_frame (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6123 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6124 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6125 /* Change of visibility. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6126 |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6127 static void |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6128 mac_handle_visibility_change (f) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6129 struct frame *f; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6130 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6131 WindowPtr wp = FRAME_MAC_WINDOW (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6132 int visible = 0, iconified = 0; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6133 struct input_event buf; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6134 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6135 if (IsWindowVisible (wp)) |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6136 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6137 if (IsWindowCollapsed (wp)) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6138 iconified = 1; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6139 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6140 visible = 1; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6141 } |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6142 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6143 if (!f->async_visible && visible) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6144 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6145 if (f->iconified) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6146 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6147 /* wait_reading_process_output will notice this and update |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6148 the frame's display structures. If we were made |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6149 invisible, we should not set garbaged, because that stops |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6150 redrawing on Update events. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6151 SET_FRAME_GARBAGED (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6152 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6153 EVENT_INIT (buf); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6154 buf.kind = DEICONIFY_EVENT; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6155 XSETFRAME (buf.frame_or_window, f); |
71135
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
6156 buf.arg = Qnil; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6157 kbd_buffer_store_event (&buf); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6158 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6159 else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list))) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6160 /* Force a redisplay sooner or later to update the |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6161 frame titles in case this is the second frame. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6162 record_asynch_buffer_change (); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6163 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6164 else if (f->async_visible && !visible) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6165 if (iconified) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6166 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6167 EVENT_INIT (buf); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6168 buf.kind = ICONIFY_EVENT; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6169 XSETFRAME (buf.frame_or_window, f); |
71135
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
6170 buf.arg = Qnil; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6171 kbd_buffer_store_event (&buf); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6172 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6173 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6174 f->async_visible = visible; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6175 f->async_iconified = iconified; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6176 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6177 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6178 /* This tries to wait until the frame is really visible. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6179 However, if the window manager asks the user where to position |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6180 the frame, this will return before the user finishes doing that. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6181 The frame will not actually be visible at that time, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6182 but it will become visible later when the window manager |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6183 finishes with it. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6184 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6185 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6186 x_make_frame_visible (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6187 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6188 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6189 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6190 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6191 if (! FRAME_VISIBLE_P (f)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6192 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6193 /* We test FRAME_GARBAGED_P here to make sure we don't |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6194 call x_set_offset a second time |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6195 if we get to x_make_frame_visible a second time |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6196 before the window gets really visible. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6197 if (! FRAME_ICONIFIED_P (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6198 && ! f->output_data.mac->asked_for_visible) |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6199 { |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6200 #if TARGET_API_MAC_CARBON |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6201 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6202 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6203 struct frame *sf = SELECTED_FRAME (); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6204 if (!FRAME_MAC_P (sf)) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6205 RepositionWindow (FRAME_MAC_WINDOW (f), NULL, |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6206 kWindowCenterOnMainScreen); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6207 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6208 RepositionWindow (FRAME_MAC_WINDOW (f), |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6209 FRAME_MAC_WINDOW (sf), |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6210 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6211 kWindowCascadeStartAtParentWindowScreen |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6212 #else |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6213 kWindowCascadeOnParentWindowScreen |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6214 #endif |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6215 ); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6216 x_real_positions (f, &f->left_pos, &f->top_pos); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6217 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6218 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6219 #endif |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6220 x_set_offset (f, f->left_pos, f->top_pos, 0); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6221 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6222 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6223 f->output_data.mac->asked_for_visible = 1; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6224 |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6225 CollapseWindow (FRAME_MAC_WINDOW (f), false); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6226 ShowWindow (FRAME_MAC_WINDOW (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6227 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6228 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6229 XFlush (FRAME_MAC_DISPLAY (f)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6230 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6231 /* Synchronize to ensure Emacs knows the frame is visible |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6232 before we do anything else. We do this loop with input not blocked |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6233 so that incoming events are handled. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6234 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6235 Lisp_Object frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6236 int count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6237 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6238 /* This must come after we set COUNT. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6239 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6240 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6241 XSETFRAME (frame, f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6242 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6243 /* Wait until the frame is visible. Process X events until a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6244 MapNotify event has been seen, or until we think we won't get a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6245 MapNotify at all.. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6246 for (count = input_signal_count + 10; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6247 input_signal_count < count && !FRAME_VISIBLE_P (f);) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6248 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6249 /* Force processing of queued events. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6250 x_sync (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6251 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6252 /* Machines that do polling rather than SIGIO have been |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6253 observed to go into a busy-wait here. So we'll fake an |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6254 alarm signal to let the handler know that there's something |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6255 to be read. We used to raise a real alarm, but it seems |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6256 that the handler isn't always enabled here. This is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6257 probably a bug. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6258 if (input_polling_used ()) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6259 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6260 /* It could be confusing if a real alarm arrives while |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6261 processing the fake one. Turn it off and let the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6262 handler reset it. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6263 extern void poll_for_input_1 P_ ((void)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6264 int old_poll_suppress_count = poll_suppress_count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6265 poll_suppress_count = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6266 poll_for_input_1 (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6267 poll_suppress_count = old_poll_suppress_count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6268 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6269 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6270 /* See if a MapNotify event has been processed. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6271 FRAME_SAMPLE_VISIBILITY (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6272 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6273 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6274 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6275 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6276 /* Change from mapped state to withdrawn state. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6277 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6278 /* Make the frame visible (mapped and not iconified). */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6279 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6280 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6281 x_make_frame_invisible (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6282 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6283 { |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6284 /* A deactivate event does not occur when the last visible frame is |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6285 made invisible. So if we clear the highlight here, it will not |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6286 be rehighlighted when it is made visible. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6287 #if 0 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6288 /* Don't keep the highlight on an invisible frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6289 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6290 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6291 #endif |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6292 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6293 BLOCK_INPUT; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6294 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6295 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6296 that the current position of the window is user-specified, rather than |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6297 program-specified, so that when the window is mapped again, it will be |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6298 placed at the same location, without forcing the user to position it |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6299 by hand again (they have already done that once for this window.) */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6300 x_wm_set_size_hint (f, (long) 0, 1); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
6301 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6302 HideWindow (FRAME_MAC_WINDOW (f)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6303 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6304 UNBLOCK_INPUT; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6305 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6306 #if !USE_CARBON_EVENTS |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6307 mac_handle_visibility_change (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6308 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6309 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6310 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6311 /* Change window state from mapped to iconified. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6312 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6313 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6314 x_iconify_frame (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6315 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6316 { |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6317 OSErr err; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6318 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6319 /* A deactivate event does not occur when the last visible frame is |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6320 iconified. So if we clear the highlight here, it will not be |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6321 rehighlighted when it is deiconified. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6322 #if 0 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6323 /* Don't keep the highlight on an invisible frame. */ |
46798 | 6324 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) |
6325 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; | |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6326 #endif |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6327 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6328 if (f->async_iconified) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6329 return; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6330 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6331 BLOCK_INPUT; |
46798 | 6332 |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6333 FRAME_SAMPLE_VISIBILITY (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6334 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6335 if (! FRAME_VISIBLE_P (f)) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6336 ShowWindow (FRAME_MAC_WINDOW (f)); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6337 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6338 err = CollapseWindow (FRAME_MAC_WINDOW (f), true); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6339 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6340 UNBLOCK_INPUT; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6341 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6342 if (err != noErr) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6343 error ("Can't notify window manager of iconification"); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6344 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6345 #if !USE_CARBON_EVENTS |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6346 mac_handle_visibility_change (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
6347 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6348 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6349 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6350 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6351 /* Free X resources of frame F. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6352 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6353 void |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6354 x_free_frame_resources (f) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6355 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6356 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6357 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6358 WindowPtr wp = FRAME_MAC_WINDOW (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6359 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6360 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6361 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
6362 if (wp != tip_window) |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
6363 remove_window_handler (wp); |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
6364 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6365 DisposeWindow (wp); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6366 if (wp == tip_window) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6367 /* Neither WaitNextEvent nor ReceiveNextEvent receives `window |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6368 closed' event. So we reset tip_window here. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
6369 tip_window = NULL; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6370 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6371 free_frame_menubar (f); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6372 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6373 if (FRAME_FACE_CACHE (f)) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6374 free_frame_faces (f); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6375 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6376 x_free_gcs (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6377 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6378 if (FRAME_SIZE_HINTS (f)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6379 xfree (FRAME_SIZE_HINTS (f)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6380 |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
6381 #if TARGET_API_MAC_CARBON |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
6382 if (FRAME_FILE_NAME (f)) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
6383 xfree (FRAME_FILE_NAME (f)); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
6384 #endif |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
6385 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6386 xfree (f->output_data.mac); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6387 f->output_data.mac = NULL; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6388 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6389 if (f == dpyinfo->x_focus_frame) |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6390 { |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6391 dpyinfo->x_focus_frame = 0; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6392 #if USE_MAC_FONT_PANEL |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6393 mac_set_font_info_for_selection (NULL, DEFAULT_FACE_ID, 0); |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6394 #endif |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
6395 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6396 if (f == dpyinfo->x_focus_event_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6397 dpyinfo->x_focus_event_frame = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6398 if (f == dpyinfo->x_highlight_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6399 dpyinfo->x_highlight_frame = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6400 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6401 if (f == dpyinfo->mouse_face_mouse_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6402 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6403 dpyinfo->mouse_face_beg_row |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6404 = dpyinfo->mouse_face_beg_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6405 dpyinfo->mouse_face_end_row |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6406 = dpyinfo->mouse_face_end_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6407 dpyinfo->mouse_face_window = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6408 dpyinfo->mouse_face_deferred_gc = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6409 dpyinfo->mouse_face_mouse_frame = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6410 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6411 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6412 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6413 } |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6414 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6415 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6416 /* Destroy the X window of frame F. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6417 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6418 void |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6419 x_destroy_window (f) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6420 struct frame *f; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6421 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6422 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6423 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6424 x_free_frame_resources (f); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6425 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6426 dpyinfo->reference_count--; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6427 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6428 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6429 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6430 /* Setting window manager hints. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6431 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6432 /* Set the normal size hints for the window manager, for frame F. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6433 FLAGS is the flags word to use--or 0 meaning preserve the flags |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6434 that the window now has. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6435 If USER_POSITION is nonzero, we set the USPosition |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6436 flag (this is useful when FLAGS is 0). */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6437 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6438 x_wm_set_size_hint (f, flags, user_position) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6439 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6440 long flags; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6441 int user_position; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6442 { |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6443 int base_width, base_height, width_inc, height_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6444 int min_rows = 0, min_cols = 0; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6445 XSizeHints *size_hints; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6446 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6447 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6448 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6449 width_inc = FRAME_COLUMN_WIDTH (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6450 height_inc = FRAME_LINE_HEIGHT (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6451 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6452 check_frame_size (f, &min_rows, &min_cols); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6453 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6454 size_hints = FRAME_SIZE_HINTS (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6455 if (size_hints == NULL) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6456 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6457 size_hints = FRAME_SIZE_HINTS (f) = xmalloc (sizeof (XSizeHints)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6458 bzero (size_hints, sizeof (XSizeHints)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6459 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6460 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6461 size_hints->flags |= PResizeInc | PMinSize | PBaseSize ; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6462 size_hints->width_inc = width_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6463 size_hints->height_inc = height_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6464 size_hints->min_width = base_width + min_cols * width_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6465 size_hints->min_height = base_height + min_rows * height_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6466 size_hints->base_width = base_width; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6467 size_hints->base_height = base_height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6468 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6469 if (flags) |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6470 size_hints->flags = flags; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6471 else if (user_position) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6472 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6473 size_hints->flags &= ~ PPosition; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6474 size_hints->flags |= USPosition; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
6475 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6476 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6477 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6478 #if 0 /* MAC_TODO: hide application instead of iconify? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6479 /* Used for IconicState or NormalState */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6480 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6481 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6482 x_wm_set_window_state (f, state) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6483 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6484 int state; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6485 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6486 #ifdef USE_X_TOOLKIT |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6487 Arg al[1]; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6488 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6489 XtSetArg (al[0], XtNinitialState, state); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6490 XtSetValues (f->output_data.x->widget, al, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6491 #else /* not USE_X_TOOLKIT */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6492 Window window = FRAME_X_WINDOW (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6493 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6494 f->output_data.x->wm_hints.flags |= StateHint; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6495 f->output_data.x->wm_hints.initial_state = state; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6496 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6497 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6498 #endif /* not USE_X_TOOLKIT */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6499 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6500 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6501 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6502 x_wm_set_icon_pixmap (f, pixmap_id) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6503 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6504 int pixmap_id; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6505 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6506 Pixmap icon_pixmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6507 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6508 #ifndef USE_X_TOOLKIT |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6509 Window window = FRAME_X_WINDOW (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6510 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6511 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6512 if (pixmap_id > 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6513 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6514 icon_pixmap = x_bitmap_pixmap (f, pixmap_id); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6515 f->output_data.x->wm_hints.icon_pixmap = icon_pixmap; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6516 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6517 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6518 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6519 /* It seems there is no way to turn off use of an icon pixmap. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6520 The following line does it, only if no icon has yet been created, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6521 for some window managers. But with mwm it crashes. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6522 Some people say it should clear the IconPixmapHint bit in this case, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6523 but that doesn't work, and the X consortium said it isn't the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6524 right thing at all. Since there is no way to win, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6525 best to explicitly give up. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6526 #if 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6527 f->output_data.x->wm_hints.icon_pixmap = None; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6528 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6529 return; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6530 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6531 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6532 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6533 #ifdef USE_X_TOOLKIT /* same as in x_wm_set_window_state. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6534 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6535 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6536 Arg al[1]; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6537 XtSetArg (al[0], XtNiconPixmap, icon_pixmap); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6538 XtSetValues (f->output_data.x->widget, al, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6539 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6540 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6541 #else /* not USE_X_TOOLKIT */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
6542 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6543 f->output_data.x->wm_hints.flags |= IconPixmapHint; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6544 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6545 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6546 #endif /* not USE_X_TOOLKIT */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6547 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6548 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6549 #endif /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6550 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6551 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6552 x_wm_set_icon_position (f, icon_x, icon_y) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6553 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6554 int icon_x, icon_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6555 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6556 #if 0 /* MAC_TODO: no icons on Mac */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6557 #ifdef USE_X_TOOLKIT |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6558 Window window = XtWindow (f->output_data.x->widget); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6559 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6560 Window window = FRAME_X_WINDOW (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6561 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6562 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6563 f->output_data.x->wm_hints.flags |= IconPositionHint; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6564 f->output_data.x->wm_hints.icon_x = icon_x; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6565 f->output_data.x->wm_hints.icon_y = icon_y; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6566 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6567 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6568 #endif /* MAC_TODO */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6569 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6570 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6571 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6572 /*********************************************************************** |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6573 XLFD Pattern Match |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6574 ***********************************************************************/ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6575 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6576 /* An XLFD pattern is divided into blocks delimited by '*'. This |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6577 structure holds information for each block. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6578 struct xlfdpat_block |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6579 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6580 /* Length of the pattern string in this block. Non-zero except for |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6581 the first and the last blocks. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6582 int len; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6583 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6584 /* Pattern string except the last character in this block. The last |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6585 character is replaced with NUL in order to use it as a |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6586 sentinel. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6587 unsigned char *pattern; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6588 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6589 /* Last character of the pattern string. Must not be '?'. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6590 unsigned char last_char; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6591 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6592 /* One of the tables for the Boyer-Moore string search. It |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6593 specifies the number of positions to proceed for each character |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6594 with which the match fails. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6595 int skip[256]; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6596 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6597 /* The skip value for the last character in the above `skip' is |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6598 assigned to `infinity' in order to simplify a loop condition. |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6599 The original value is saved here. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6600 int last_char_skip; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6601 }; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6602 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6603 struct xlfdpat |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6604 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6605 /* Normalized pattern string. "Normalized" means that capital |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6606 letters are lowered, blocks are not empty except the first and |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6607 the last ones, and trailing '?'s in a block that is not the last |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6608 one are moved to the next one. The last character in each block |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6609 is replaced with NUL. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6610 unsigned char *buf; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6611 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6612 /* Number of characters except '*'s and trailing '?'s in the |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6613 normalized pattern string. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6614 int nchars; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6615 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6616 /* Number of trailing '?'s in the normalized pattern string. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6617 int trailing_anychars; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6618 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6619 /* Number of blocks and information for each block. The latter is |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6620 NULL if the pattern is exact (no '*' or '?' in it). */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6621 int nblocks; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6622 struct xlfdpat_block *blocks; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6623 }; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6624 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6625 static void |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6626 xlfdpat_destroy (pat) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6627 struct xlfdpat *pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6628 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6629 if (pat) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6630 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6631 if (pat->buf) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6632 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6633 if (pat->blocks) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6634 xfree (pat->blocks); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6635 xfree (pat->buf); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6636 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6637 xfree (pat); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6638 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6639 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6640 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6641 static struct xlfdpat * |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6642 xlfdpat_create (pattern) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6643 char *pattern; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6644 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6645 struct xlfdpat *pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6646 int nblocks, i, skip; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6647 unsigned char last_char, *p, *q, *anychar_head; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6648 struct xlfdpat_block *blk; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6649 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6650 pat = xmalloc (sizeof (struct xlfdpat)); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6651 pat->buf = xmalloc (strlen (pattern) + 1); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6652 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6653 /* Normalize the pattern string and store it to `pat->buf'. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6654 nblocks = 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6655 anychar_head = NULL; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6656 q = pat->buf; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6657 last_char = '\0'; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6658 for (p = pattern; *p; p++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6659 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6660 unsigned char c = *p; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6661 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6662 if (c == '*') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6663 if (last_char == '*') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6664 /* ...a** -> ...a* */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6665 continue; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6666 else |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6667 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6668 if (last_char == '?') |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6669 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6670 if (anychar_head > pat->buf && *(anychar_head - 1) == '*') |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6671 /* ...*??* -> ...*?? */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6672 continue; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6673 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6674 /* ...a??* -> ...a*?? */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6675 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6676 *anychar_head++ = '*'; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6677 c = '?'; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6678 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
6679 } |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6680 nblocks++; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6681 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6682 else if (c == '?') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6683 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6684 if (last_char != '?') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6685 anychar_head = q; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6686 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6687 else |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6688 /* On Mac OS X 10.3, tolower also converts non-ASCII |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6689 characters for some locales. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6690 if (isascii (c)) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6691 c = tolower (c); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6692 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6693 *q++ = last_char = c; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6694 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6695 *q = '\0'; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6696 nblocks++; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6697 pat->nblocks = nblocks; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6698 if (last_char != '?') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6699 pat->trailing_anychars = 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6700 else |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6701 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6702 pat->trailing_anychars = q - anychar_head; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6703 q = anychar_head; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6704 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6705 pat->nchars = q - pat->buf - (nblocks - 1); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6706 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6707 if (anychar_head == NULL && nblocks == 1) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6708 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6709 /* The pattern is exact. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6710 pat->blocks = NULL; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6711 return pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6712 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6713 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6714 pat->blocks = xmalloc (sizeof (struct xlfdpat_block) * nblocks); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6715 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6716 /* Divide the normalized pattern into blocks. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6717 p = pat->buf; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6718 for (blk = pat->blocks; blk < pat->blocks + nblocks - 1; blk++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6719 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6720 blk->pattern = p; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6721 while (*p != '*') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6722 p++; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6723 blk->len = p - blk->pattern; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6724 p++; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6725 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6726 blk->pattern = p; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6727 blk->len = q - blk->pattern; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6728 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6729 /* Setup a table for the Boyer-Moore string search. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6730 for (blk = pat->blocks; blk < pat->blocks + nblocks; blk++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6731 if (blk->len != 0) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6732 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6733 blk->last_char = blk->pattern[blk->len - 1]; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6734 blk->pattern[blk->len - 1] = '\0'; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6735 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6736 for (skip = 1; skip < blk->len; skip++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6737 if (blk->pattern[blk->len - skip - 1] == '?') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6738 break; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6739 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6740 for (i = 0; i < 256; i++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6741 blk->skip[i] = skip; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6742 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6743 p = blk->pattern + (blk->len - skip); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6744 while (--skip > 0) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6745 blk->skip[*p++] = skip; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6746 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6747 blk->last_char_skip = blk->skip[blk->last_char]; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6748 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6749 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6750 return pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6751 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6752 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6753 static INLINE int |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6754 xlfdpat_exact_p (pat) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6755 struct xlfdpat *pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6756 { |
65643
44af31946762
(xlfdpat_block_match_1): Fix assertion.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65346
diff
changeset
|
6757 return pat->blocks == NULL; |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6758 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6759 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6760 /* Return the first string in STRING + 0, ..., STRING + START_MAX such |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6761 that the pattern in *BLK matches with its prefix. Return NULL |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6762 there is no such strings. STRING must be lowered in advance. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6763 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6764 static char * |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6765 xlfdpat_block_match_1 (blk, string, start_max) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6766 struct xlfdpat_block *blk; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6767 unsigned char *string; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6768 int start_max; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6769 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6770 int start, infinity; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6771 unsigned char *p, *s; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6772 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6773 xassert (blk->len > 0); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6774 xassert (start_max + blk->len <= strlen (string)); |
65643
44af31946762
(xlfdpat_block_match_1): Fix assertion.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65346
diff
changeset
|
6775 xassert (blk->last_char != '?'); |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6776 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6777 /* See the comments in the function `boyer_moore' (search.c) for the |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6778 use of `infinity'. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6779 infinity = start_max + blk->len + 1; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6780 blk->skip[blk->last_char] = infinity; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6781 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6782 start = 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6783 do |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6784 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6785 /* Check the last character of the pattern. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6786 s = string + blk->len - 1; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6787 do |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6788 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6789 start += blk->skip[*(s + start)]; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6790 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6791 while (start <= start_max); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6792 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6793 if (start < infinity) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6794 /* Couldn't find the last character. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6795 return NULL; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6796 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6797 /* No less than `infinity' means we could find the last |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6798 character at `s[start - infinity]'. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6799 start -= infinity; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6800 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6801 /* Check the remaining characters. We prefer making no-'?' |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6802 cases faster because the use of '?' is really rare. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6803 p = blk->pattern; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6804 s = string + start; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6805 do |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6806 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6807 while (*p++ == *s++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6808 ; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6809 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6810 while (*(p - 1) == '?'); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6811 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6812 if (*(p - 1) == '\0') |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6813 /* Matched. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6814 return string + start; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6815 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6816 /* Didn't match. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6817 start += blk->last_char_skip; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6818 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6819 while (start <= start_max); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6820 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6821 return NULL; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6822 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6823 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6824 #define xlfdpat_block_match(b, s, m) \ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6825 ((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6826 : xlfdpat_block_match_1 (b, s, m)) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6827 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6828 /* Check if XLFD pattern PAT, which is generated by `xfldpat_create', |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6829 matches with STRING. STRING must be lowered in advance. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6830 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6831 static int |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6832 xlfdpat_match (pat, string) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6833 struct xlfdpat *pat; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6834 unsigned char *string; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6835 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6836 int str_len, nblocks, i, start_max; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6837 struct xlfdpat_block *blk; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6838 unsigned char *s; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6839 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6840 xassert (pat->nblocks > 0); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6841 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6842 if (xlfdpat_exact_p (pat)) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6843 return strcmp (pat->buf, string) == 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6844 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6845 /* The number of the characters in the string must not be smaller |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6846 than that in the pattern. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6847 str_len = strlen (string); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6848 if (str_len < pat->nchars + pat->trailing_anychars) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6849 return 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6850 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6851 /* Chop off the trailing '?'s. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6852 str_len -= pat->trailing_anychars; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6853 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6854 /* The last block. When it is non-empty, it must match at the end |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6855 of the string. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6856 nblocks = pat->nblocks; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6857 blk = pat->blocks + (nblocks - 1); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6858 if (nblocks == 1) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6859 /* The last block is also the first one. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6860 return (str_len == blk->len |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6861 && (blk->len == 0 || xlfdpat_block_match (blk, string, 0))); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6862 else if (blk->len != 0) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6863 if (!xlfdpat_block_match (blk, string + (str_len - blk->len), 0)) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6864 return 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6865 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6866 /* The first block. When it is non-empty, it must match at the |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6867 beginning of the string. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6868 blk = pat->blocks; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6869 if (blk->len != 0) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6870 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6871 s = xlfdpat_block_match (blk, string, 0); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6872 if (s == NULL) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6873 return 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6874 string = s + blk->len; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6875 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6876 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6877 /* The rest of the blocks. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6878 start_max = str_len - pat->nchars; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6879 for (i = 1, blk++; i < nblocks - 1; i++, blk++) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6880 { |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6881 s = xlfdpat_block_match (blk, string, start_max); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6882 if (s == NULL) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6883 return 0; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6884 start_max -= s - string; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6885 string = s + blk->len; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6886 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6887 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6888 return 1; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6889 } |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6890 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6891 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
6892 /*********************************************************************** |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6893 Fonts |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6894 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6895 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6896 /* Return a pointer to struct font_info of font FONT_IDX of frame F. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6897 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6898 struct font_info * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6899 x_get_font_info (f, font_idx) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6900 FRAME_PTR f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6901 int font_idx; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6902 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6903 return (FRAME_MAC_FONT_TABLE (f) + font_idx); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6904 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6905 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6906 /* the global font name table */ |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
6907 static char **font_name_table = NULL; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
6908 static int font_name_table_size = 0; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
6909 static int font_name_count = 0; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6910 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6911 /* Alist linking font family names to Font Manager font family |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6912 references (which can also be used as QuickDraw font IDs). We use |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6913 an alist because hash tables are not ready when the terminal frame |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6914 for Mac OS Classic is created. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6915 static Lisp_Object fm_font_family_alist; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
6916 #if USE_ATSUI |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6917 /* Hash table linking font family names to ATSU font IDs. */ |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
6918 static Lisp_Object atsu_font_id_hash; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
6919 static Lisp_Object Vmac_atsu_font_table; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
6920 extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
6921 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
6922 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6923 /* Alist linking character set strings to Mac text encoding and Emacs |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6924 coding system. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6925 static Lisp_Object Vmac_charset_info_alist; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6926 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6927 static Lisp_Object |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6928 create_text_encoding_info_alist () |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6929 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6930 Lisp_Object result = Qnil, rest; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6931 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6932 for (rest = Vmac_charset_info_alist; CONSP (rest); rest = XCDR (rest)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6933 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6934 Lisp_Object charset_info = XCAR (rest); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6935 Lisp_Object charset, coding_system, text_encoding; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6936 Lisp_Object existing_info; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6937 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6938 if (!(CONSP (charset_info) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6939 && STRINGP (charset = XCAR (charset_info)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6940 && CONSP (XCDR (charset_info)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6941 && INTEGERP (text_encoding = XCAR (XCDR (charset_info))) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6942 && CONSP (XCDR (XCDR (charset_info))) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6943 && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info)))))) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6944 continue; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6945 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6946 existing_info = assq_no_quit (text_encoding, result); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6947 if (NILP (existing_info)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6948 result = Fcons (list3 (text_encoding, coding_system, charset), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6949 result); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
6950 else |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6951 if (NILP (Fmember (charset, XCDR (XCDR (existing_info))))) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6952 XSETCDR (XCDR (existing_info), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6953 Fcons (charset, XCDR (XCDR (existing_info)))); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6954 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6955 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6956 return result; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6957 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6958 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6959 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6960 static void |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6961 decode_mac_font_name (name, size, coding_system) |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
6962 char *name; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
6963 int size; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6964 Lisp_Object coding_system; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6965 { |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
6966 struct coding_system coding; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6967 char *buf, *p; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6968 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6969 if (!NILP (coding_system) && !NILP (Fcoding_system_p (coding_system))) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6970 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6971 for (p = name; *p; p++) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6972 if (!isascii (*p) || iscntrl (*p)) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6973 break; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6974 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6975 if (*p) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6976 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6977 setup_coding_system (coding_system, &coding); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6978 coding.src_multibyte = 0; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6979 coding.dst_multibyte = 1; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6980 coding.mode |= CODING_MODE_LAST_BLOCK; |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6981 coding.dst_bytes = size; |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6982 coding.destination = (unsigned char *) alloca (coding.dst_bytes); |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6983 |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6984 decode_coding_c_string (&coding, name, strlen (name), Qnil); |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6985 bcopy (coding.destination, name, min (coding.produced, size)); |
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
6986 name[min (coding.produced, size)] = '\0'; |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6987 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6988 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6989 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6990 /* If there's just one occurrence of '-' in the family name, it is |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6991 replaced with '_'. (More than one occurrence of '-' means a |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6992 "FOUNDRY-FAMILY-CHARSET"-style name.) */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6993 p = strchr (name, '-'); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6994 if (p && strchr (p + 1, '-') == NULL) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6995 *p = '_'; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6996 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
6997 for (p = name; *p; p++) |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6998 /* On Mac OS X 10.3, tolower also converts non-ASCII characters |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
6999 for some locales. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7000 if (isascii (*p)) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7001 *p = tolower (*p); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7002 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7003 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7004 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7005 static char * |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7006 mac_to_x_fontname (name, size, style, charset) |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
7007 char *name; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
7008 int size; |
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
7009 Style style; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7010 char *charset; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7011 { |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7012 Str31 foundry, cs; |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7013 Str255 family; |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7014 char xf[256], *result; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7015 unsigned char *p; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7016 |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7017 if (sscanf (name, "%31[^-]-%255[^-]-%31s", foundry, family, cs) == 3) |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7018 charset = cs; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7019 else |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7020 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7021 strcpy(foundry, "Apple"); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7022 strcpy(family, name); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7023 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7024 |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7025 sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s", |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7026 style & bold ? "bold" : "medium", style & italic ? 'i' : 'r', |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
7027 size, size * 10, size ? 72 : 0, size ? 72 : 0, size * 10, charset); |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7028 |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7029 result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); |
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7030 sprintf (result, "-%s-%s-%s", foundry, family, xf); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7031 for (p = result; *p; p++) |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7032 /* On Mac OS X 10.3, tolower also converts non-ASCII characters |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7033 for some locales. */ |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7034 if (isascii (*p)) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7035 *p = tolower (*p); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7036 return result; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7037 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7038 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7039 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7040 /* Parse fully-specified and instantiated X11 font spec XF, and store |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7041 the results to FAMILY, *SIZE, *STYLE, and CHARSET. Return 1 if the |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7042 parsing succeeded, and 0 otherwise. For FAMILY and CHARSET, the |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7043 caller must allocate at least 256 and 32 bytes respectively. For |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7044 ordinary Mac fonts, the value stored to FAMILY should just be their |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7045 names, like "monaco", "Taipei", etc. Fonts converted from the GNU |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7046 intlfonts collection contain their charset designation in their |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7047 names, like "ETL-Fixed-iso8859-1", "ETL-Fixed-koi8-r", etc. Both |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7048 types of font names are handled accordingly. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7049 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7050 const int kDefaultFontSize = 12; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7051 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7052 static int |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7053 parse_x_font_name (xf, family, size, style, charset) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7054 char *xf, *family; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7055 int *size; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7056 Style *style; |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7057 char *charset; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7058 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7059 Str31 foundry, weight; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7060 int point_size, avgwidth; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7061 char slant[2], *p; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7062 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7063 if (sscanf (xf, "-%31[^-]-%255[^-]-%31[^-]-%1[^-]-%*[^-]-%*[^-]-%d-%d-%*[^-]-%*[^-]-%*c-%d-%31s", |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7064 foundry, family, weight, slant, size, |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7065 &point_size, &avgwidth, charset) != 8 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7066 && sscanf (xf, "-%31[^-]-%255[^-]-%31[^-]-%1[^-]-%*[^-]--%d-%d-%*[^-]-%*[^-]-%*c-%d-%31s", |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7067 foundry, family, weight, slant, size, |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7068 &point_size, &avgwidth, charset) != 8) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7069 return 0; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7070 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7071 if (*size == 0) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7072 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7073 if (point_size > 0) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7074 *size = point_size / 10; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7075 else if (avgwidth > 0) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7076 *size = avgwidth / 10; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7077 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7078 if (*size == 0) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7079 *size = kDefaultFontSize; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7080 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7081 *style = normal; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7082 if (strcmp (weight, "bold") == 0) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7083 *style |= bold; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7084 if (*slant == 'i') |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7085 *style |= italic; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7086 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7087 if (NILP (Fassoc (build_string (charset), Vmac_charset_info_alist))) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7088 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7089 int foundry_len = strlen (foundry), family_len = strlen (family); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7090 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7091 if (foundry_len + family_len + strlen (charset) + 2 < sizeof (Str255)) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7092 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7093 /* Like sprintf (family, "%s-%s-%s", foundry, family, charset), |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7094 but take overlap into account. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7095 memmove (family + foundry_len + 1, family, family_len); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7096 memcpy (family, foundry, foundry_len); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7097 family[foundry_len] = '-'; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7098 family[foundry_len + 1 + family_len] = '-'; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7099 strcpy (family + foundry_len + 1 + family_len + 1, charset); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7100 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7101 else |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7102 return 0; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7103 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7104 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7105 for (p = family; *p; p++) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7106 /* On Mac OS X 10.3, tolower also converts non-ASCII characters |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7107 for some locales. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7108 if (isascii (*p)) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7109 *p = tolower (*p); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7110 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7111 return 1; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7112 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7113 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7114 |
45848 | 7115 static void |
7116 add_font_name_table_entry (char *font_name) | |
7117 { | |
7118 if (font_name_table_size == 0) | |
7119 { | |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7120 font_name_table_size = 256; |
45848 | 7121 font_name_table = (char **) |
7122 xmalloc (font_name_table_size * sizeof (char *)); | |
7123 } | |
7124 else if (font_name_count + 1 >= font_name_table_size) | |
7125 { | |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7126 font_name_table_size *= 2; |
45848 | 7127 font_name_table = (char **) |
7128 xrealloc (font_name_table, | |
7129 font_name_table_size * sizeof (char *)); | |
7130 } | |
7131 | |
7132 font_name_table[font_name_count++] = font_name; | |
7133 } | |
7134 | |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7135 static void |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7136 add_mac_font_name (name, size, style, charset) |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7137 char *name; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7138 int size; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7139 Style style; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7140 char *charset; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7141 { |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7142 if (size > 0) |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7143 add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset)); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7144 else |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7145 { |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7146 add_font_name_table_entry (mac_to_x_fontname (name, 0, style, charset)); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7147 add_font_name_table_entry (mac_to_x_fontname (name, 0, italic, charset)); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7148 add_font_name_table_entry (mac_to_x_fontname (name, 0, bold, charset)); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7149 add_font_name_table_entry (mac_to_x_fontname (name, 0, italic | bold, |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7150 charset)); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7151 } |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7152 } |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7153 |
45848 | 7154 /* Sets up the table font_name_table to contain the list of all fonts |
7155 in the system the first time the table is used so that the Resource | |
7156 Manager need not be accessed every time this information is | |
7157 needed. */ | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7158 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7159 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7160 init_font_name_table () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7161 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7162 #if TARGET_API_MAC_CARBON |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7163 FMFontFamilyIterator ffi; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7164 FMFontFamilyInstanceIterator ffii; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7165 FMFontFamily ff; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7166 Lisp_Object text_encoding_info_alist; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7167 struct gcpro gcpro1; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7168 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7169 text_encoding_info_alist = create_text_encoding_info_alist (); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7170 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7171 #if USE_ATSUI |
67000
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
7172 #if USE_CG_TEXT_DRAWING |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
7173 init_cg_text_anti_aliasing_threshold (); |
e99c1fd37bcd
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66841
diff
changeset
|
7174 #endif |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7175 if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7176 text_encoding_info_alist))) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7177 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7178 OSErr err; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7179 struct Lisp_Hash_Table *h; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7180 unsigned hash_code; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7181 ItemCount nfonts, i; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7182 ATSUFontID *font_ids = NULL; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7183 Ptr name; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7184 ByteCount name_len; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7185 Lisp_Object family; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7186 |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7187 atsu_font_id_hash = |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7188 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7189 make_float (DEFAULT_REHASH_SIZE), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7190 make_float (DEFAULT_REHASH_THRESHOLD), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7191 Qnil, Qnil, Qnil);; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7192 h = XHASH_TABLE (atsu_font_id_hash); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7193 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7194 err = ATSUFontCount (&nfonts); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7195 if (err == noErr) |
70071
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7196 { |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7197 font_ids = xmalloc (sizeof (ATSUFontID) * nfonts); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7198 err = ATSUGetFontIDs (font_ids, nfonts, NULL); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7199 } |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7200 if (err == noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7201 for (i = 0; i < nfonts; i++) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7202 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7203 err = ATSUFindFontName (font_ids[i], kFontFamilyName, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7204 kFontMacintoshPlatform, kFontNoScript, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7205 kFontNoLanguage, 0, NULL, &name_len, NULL); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7206 if (err != noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7207 continue; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7208 name = xmalloc (name_len + 1); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7209 name[name_len] = '\0'; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7210 err = ATSUFindFontName (font_ids[i], kFontFamilyName, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7211 kFontMacintoshPlatform, kFontNoScript, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7212 kFontNoLanguage, name_len, name, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7213 NULL, NULL); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7214 if (err == noErr) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7215 { |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7216 FMFontFamily ff; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7217 FMFontStyle style = normal; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7218 |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7219 decode_mac_font_name (name, name_len + 1, Qnil); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7220 family = make_unibyte_string (name, name_len); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7221 FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7222 Fputhash (make_unibyte_string ((char *)(font_ids + i), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7223 sizeof (ATSUFontID)), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7224 Fcons (QCfamily, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7225 list5 (family, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7226 QCweight, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7227 style & bold ? Qbold : Qnormal, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7228 QCslant, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7229 style & italic ? Qitalic : Qnormal)), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7230 Vmac_atsu_font_table); |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7231 if (*name != '.' |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7232 && hash_lookup (h, family, &hash_code) < 0) |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7233 { |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7234 add_mac_font_name (name, 0, normal, "iso10646-1"); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7235 hash_put (h, family, long_to_cons (font_ids[i]), |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7236 hash_code); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7237 } |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7238 } |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7239 xfree (name); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7240 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7241 if (font_ids) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7242 xfree (font_ids); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7243 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7244 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7245 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7246 /* Create a dummy instance iterator here to avoid creating and |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7247 destroying it in the loop. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7248 if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7249 return; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7250 /* Create an iterator to enumerate the font families. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7251 if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7252 != noErr) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7253 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7254 FMDisposeFontFamilyInstanceIterator (&ffii); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7255 return; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7256 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7257 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7258 GCPRO1 (text_encoding_info_alist); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7259 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7260 while (FMGetNextFontFamily (&ffi, &ff) == noErr) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7261 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7262 Str255 name; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7263 FMFont font; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7264 FMFontStyle style; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7265 FMFontSize size; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7266 TextEncoding encoding; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7267 TextEncodingBase sc; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7268 Lisp_Object text_encoding_info, family; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7269 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7270 if (FMGetFontFamilyName (ff, name) != noErr) |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7271 continue; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7272 p2cstr (name); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7273 if (*name == '.') |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7274 continue; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7275 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7276 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7277 continue; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7278 sc = GetTextEncodingBase (encoding); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7279 text_encoding_info = assq_no_quit (make_number (sc), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7280 text_encoding_info_alist); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7281 if (NILP (text_encoding_info)) |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7282 text_encoding_info = assq_no_quit (make_number (kTextEncodingMacRoman), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7283 text_encoding_info_alist); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7284 decode_mac_font_name (name, sizeof (name), |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7285 XCAR (XCDR (text_encoding_info))); |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7286 family = build_string (name); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7287 if (!NILP (Fassoc (family, fm_font_family_alist))) |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7288 continue; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7289 fm_font_family_alist = Fcons (Fcons (family, make_number (ff)), |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7290 fm_font_family_alist); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7291 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7292 /* Point the instance iterator at the current font family. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7293 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7294 continue; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7295 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7296 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7297 == noErr) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7298 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7299 Lisp_Object rest = XCDR (XCDR (text_encoding_info)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7300 |
65643
44af31946762
(xlfdpat_block_match_1): Fix assertion.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65346
diff
changeset
|
7301 if (size > 0 || style == normal) |
44af31946762
(xlfdpat_block_match_1): Fix assertion.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65346
diff
changeset
|
7302 for (; !NILP (rest); rest = XCDR (rest)) |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7303 add_mac_font_name (name, size, style, SDATA (XCAR (rest))); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7304 } |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7305 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7306 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7307 UNGCPRO; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7308 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7309 /* Dispose of the iterators. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7310 FMDisposeFontFamilyIterator (&ffi); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7311 FMDisposeFontFamilyInstanceIterator (&ffii); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7312 #else /* !TARGET_API_MAC_CARBON */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7313 GrafPtr port; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7314 SInt16 fontnum, old_fontnum; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7315 int num_mac_fonts = CountResources('FOND'); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7316 int i, j; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7317 Handle font_handle, font_handle_2; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7318 short id, scriptcode; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7319 ResType type; |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7320 Str255 name; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7321 struct FontAssoc *fat; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7322 struct AsscEntry *assc_entry; |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7323 Lisp_Object text_encoding_info_alist, text_encoding_info, family; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7324 struct gcpro gcpro1; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7325 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7326 GetPort (&port); /* save the current font number used */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7327 old_fontnum = port->txFont; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7328 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7329 text_encoding_info_alist = create_text_encoding_info_alist (); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7330 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7331 GCPRO1 (text_encoding_info_alist); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7332 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7333 for (i = 1; i <= num_mac_fonts; i++) /* get all available fonts */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7334 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7335 font_handle = GetIndResource ('FOND', i); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7336 if (!font_handle) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7337 continue; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7338 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7339 GetResInfo (font_handle, &id, &type, name); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7340 GetFNum (name, &fontnum); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7341 p2cstr (name); |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7342 if (fontnum == 0 || *name == '.') |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7343 continue; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7344 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7345 TextFont (fontnum); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7346 scriptcode = FontToScript (fontnum); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7347 text_encoding_info = assq_no_quit (make_number (scriptcode), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7348 text_encoding_info_alist); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7349 if (NILP (text_encoding_info)) |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7350 text_encoding_info = assq_no_quit (make_number (smRoman), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7351 text_encoding_info_alist); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7352 decode_mac_font_name (name, sizeof (name), |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7353 XCAR (XCDR (text_encoding_info))); |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7354 family = build_string (name); |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7355 if (!NILP (Fassoc (family, fm_font_family_alist))) |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7356 continue; |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7357 fm_font_family_alist = Fcons (Fcons (family, make_number (fontnum)), |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7358 fm_font_family_alist); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7359 do |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7360 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7361 HLock (font_handle); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7362 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7363 if (GetResourceSizeOnDisk (font_handle) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7364 >= sizeof (struct FamRec)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7365 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7366 fat = (struct FontAssoc *) (*font_handle |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7367 + sizeof (struct FamRec)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7368 assc_entry |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7369 = (struct AsscEntry *) (*font_handle |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7370 + sizeof (struct FamRec) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7371 + sizeof (struct FontAssoc)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7372 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7373 for (j = 0; j <= fat->numAssoc; j++, assc_entry++) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7374 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7375 Lisp_Object rest = XCDR (XCDR (text_encoding_info)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7376 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7377 for (; !NILP (rest); rest = XCDR (rest)) |
70149
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7378 add_mac_font_name (name, assc_entry->fontSize, |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7379 assc_entry->fontStyle, |
6188dfce9d77
(x_per_char_metric): Return NULL if glyph width is 0.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70071
diff
changeset
|
7380 SDATA (XCAR (rest))); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7381 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7382 } |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7383 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7384 HUnlock (font_handle); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7385 font_handle_2 = GetNextFOND (font_handle); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7386 ReleaseResource (font_handle); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7387 font_handle = font_handle_2; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7388 } |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7389 while (ResError () == noErr && font_handle); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7390 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7391 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7392 UNGCPRO; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7393 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7394 TextFont (old_fontnum); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7395 #endif /* !TARGET_API_MAC_CARBON */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7396 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7397 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7398 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7399 void |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7400 mac_clear_font_name_table () |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7401 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7402 int i; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7403 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7404 for (i = 0; i < font_name_count; i++) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7405 xfree (font_name_table[i]); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7406 xfree (font_name_table); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7407 font_name_table = NULL; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7408 font_name_table_size = font_name_count = 0; |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7409 fm_font_family_alist = Qnil; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7410 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7411 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7412 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7413 enum xlfd_scalable_field_index |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7414 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7415 XLFD_SCL_PIXEL_SIZE, |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7416 XLFD_SCL_POINT_SIZE, |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7417 XLFD_SCL_AVGWIDTH, |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7418 XLFD_SCL_LAST |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7419 }; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7420 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7421 static int xlfd_scalable_fields[] = |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7422 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7423 6, /* PIXEL_SIZE */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7424 7, /* POINT_SIZE */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7425 11, /* AVGWIDTH */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7426 -1 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7427 }; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7428 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7429 static Lisp_Object |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7430 mac_do_list_fonts (pattern, maxnames) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7431 char *pattern; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7432 int maxnames; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7433 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7434 int i, n_fonts = 0; |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7435 Lisp_Object font_list = Qnil; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7436 struct xlfdpat *pat; |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7437 char *scaled, *ptr; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7438 int scl_val[XLFD_SCL_LAST], *field, *val; |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7439 int exact; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7440 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7441 if (font_name_table == NULL) /* Initialize when first used. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7442 init_font_name_table (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
7443 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7444 for (i = 0; i < XLFD_SCL_LAST; i++) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7445 scl_val[i] = -1; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7446 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7447 /* If the pattern contains 14 dashes and one of PIXEL_SIZE, |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7448 POINT_SIZE, and AVGWIDTH fields is explicitly specified, scalable |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7449 fonts are scaled according to the specified size. */ |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7450 ptr = pattern; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7451 i = 0; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7452 field = xlfd_scalable_fields; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7453 val = scl_val; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7454 if (*ptr == '-') |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7455 do |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7456 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7457 ptr++; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7458 if (i == *field) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7459 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7460 if ('0' <= *ptr && *ptr <= '9') |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7461 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7462 *val = *ptr++ - '0'; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7463 while ('0' <= *ptr && *ptr <= '9' && *val < 10000) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7464 *val = *val * 10 + *ptr++ - '0'; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7465 if (*ptr != '-') |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7466 *val = -1; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7467 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7468 field++; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7469 val++; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7470 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7471 ptr = strchr (ptr, '-'); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7472 i++; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7473 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7474 while (ptr && i < 14); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7475 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7476 if (i == 14 && ptr == NULL) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7477 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7478 if (scl_val[XLFD_SCL_PIXEL_SIZE] < 0) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7479 scl_val[XLFD_SCL_PIXEL_SIZE] = |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7480 (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE] / 10 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7481 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH] / 10 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7482 : -1)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7483 if (scl_val[XLFD_SCL_POINT_SIZE] < 0) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7484 scl_val[XLFD_SCL_POINT_SIZE] = |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7485 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7486 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH] |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7487 : -1)); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7488 if (scl_val[XLFD_SCL_AVGWIDTH] < 0) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7489 scl_val[XLFD_SCL_AVGWIDTH] = |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7490 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7491 : (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE] |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7492 : -1)); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7493 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7494 else |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7495 scl_val[XLFD_SCL_PIXEL_SIZE] = -1; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7496 |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7497 pat = xlfdpat_create (pattern); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7498 if (pat == NULL) |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7499 return Qnil; |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7500 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7501 exact = xlfdpat_exact_p (pat); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7502 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7503 for (i = 0; i < font_name_count; i++) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7504 { |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7505 if (xlfdpat_match (pat, font_name_table[i])) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7506 { |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7507 font_list = Fcons (build_string (font_name_table[i]), font_list); |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
7508 if (exact || (maxnames > 0 && ++n_fonts >= maxnames)) |
59041
b978ab01b88e
(mac_do_list_fonts): Fix memory leak
Steven Tamm <steventamm@mac.com>
parents:
59034
diff
changeset
|
7509 break; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7510 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7511 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 |
62944
35f25c15b8c2
(mac_to_x_fontname, mac_do_list_fonts): Set XLFD
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62281
diff
changeset
|
7512 && (ptr = strstr (font_name_table[i], "-0-0-0-0-m-0-"))) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7513 { |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7514 int former_len = ptr - font_name_table[i]; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7515 |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7516 scaled = xmalloc (strlen (font_name_table[i]) + 20 + 1); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7517 memcpy (scaled, font_name_table[i], former_len); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7518 sprintf (scaled + former_len, |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
7519 "-%d-%d-72-72-m-%d-%s", |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7520 scl_val[XLFD_SCL_PIXEL_SIZE], |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7521 scl_val[XLFD_SCL_POINT_SIZE], |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7522 scl_val[XLFD_SCL_AVGWIDTH], |
62944
35f25c15b8c2
(mac_to_x_fontname, mac_do_list_fonts): Set XLFD
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62281
diff
changeset
|
7523 ptr + sizeof ("-0-0-0-0-m-0-") - 1); |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7524 |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7525 if (xlfdpat_match (pat, scaled)) |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7526 { |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7527 font_list = Fcons (build_string (scaled), font_list); |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7528 xfree (scaled); |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
7529 if (exact || (maxnames > 0 && ++n_fonts >= maxnames)) |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7530 break; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7531 } |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7532 else |
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7533 xfree (scaled); |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7534 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7535 } |
59034
2dd8aacd82ce
* term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents:
58634
diff
changeset
|
7536 |
65346
88cf9abcfe60
(struct xlfdpat_block, struct xlfdpat): New structs.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65110
diff
changeset
|
7537 xlfdpat_destroy (pat); |
59034
2dd8aacd82ce
* term/mac-win.el (encoding-vector, mac-font-encoder-list)
Steven Tamm <steventamm@mac.com>
parents:
58634
diff
changeset
|
7538 |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7539 return font_list; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7540 } |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7541 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7542 /* Return a list of names of available fonts matching PATTERN on frame F. |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7543 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7544 Frame F null means we have not yet created any frame on Mac, and |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7545 consult the first display in x_display_list. MAXNAMES sets a limit |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7546 on how many fonts to match. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7547 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7548 Lisp_Object |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7549 x_list_fonts (f, pattern, size, maxnames) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7550 struct frame *f; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7551 Lisp_Object pattern; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7552 int size, maxnames; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7553 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7554 Lisp_Object list = Qnil, patterns, tem, key; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7555 struct mac_display_info *dpyinfo |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7556 = f ? FRAME_MAC_DISPLAY_INFO (f) : x_display_list; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7557 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7558 xassert (size <= 0); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7559 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7560 patterns = Fassoc (pattern, Valternate_fontname_alist); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7561 if (NILP (patterns)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7562 patterns = Fcons (pattern, Qnil); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7563 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7564 for (; CONSP (patterns); patterns = XCDR (patterns)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7565 { |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7566 pattern = XCAR (patterns); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7567 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7568 if (!STRINGP (pattern)) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7569 continue; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7570 |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
7571 tem = XCAR (XCDR (dpyinfo->name_list_element)); |
46169
36989d5089ee
2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46168
diff
changeset
|
7572 key = Fcons (pattern, make_number (maxnames)); |
36989d5089ee
2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46168
diff
changeset
|
7573 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7574 list = Fassoc (key, tem); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7575 if (!NILP (list)) |
46169
36989d5089ee
2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46168
diff
changeset
|
7576 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7577 list = Fcdr_safe (list); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7578 /* We have a cashed list. Don't have to get the list again. */ |
46169
36989d5089ee
2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46168
diff
changeset
|
7579 goto label_cached; |
36989d5089ee
2002-07-03 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46168
diff
changeset
|
7580 } |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7581 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7582 BLOCK_INPUT; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7583 list = mac_do_list_fonts (SDATA (pattern), maxnames); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7584 UNBLOCK_INPUT; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7585 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7586 /* MAC_TODO: add code for matching outline fonts here */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7587 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7588 /* Now store the result in the cache. */ |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
7589 XSETCAR (XCDR (dpyinfo->name_list_element), |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7590 Fcons (Fcons (key, list), |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
7591 XCAR (XCDR (dpyinfo->name_list_element)))); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7592 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7593 label_cached: |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7594 if (NILP (list)) continue; /* Try the remaining alternatives. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7595 } |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7596 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7597 return list; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7598 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7599 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7600 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7601 #if GLYPH_DEBUG |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7602 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7603 /* Check that FONT is valid on frame F. It is if it can be found in F's |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7604 font table. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7605 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7606 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7607 x_check_font (f, font) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7608 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7609 XFontStruct *font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7610 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7611 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7612 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7613 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7614 xassert (font != NULL); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7615 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7616 for (i = 0; i < dpyinfo->n_fonts; i++) |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7617 if (dpyinfo->font_table[i].name |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7618 && font == dpyinfo->font_table[i].font) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7619 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7620 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7621 xassert (i < dpyinfo->n_fonts); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7622 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7623 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7624 #endif /* GLYPH_DEBUG != 0 */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7625 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7626 /* Set *W to the minimum width, *H to the minimum font height of FONT. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7627 Note: There are (broken) X fonts out there with invalid XFontStruct |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7628 min_bounds contents. For example, handa@etl.go.jp reports that |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7629 "-adobe-courier-medium-r-normal--*-180-*-*-m-*-iso8859-1" fonts |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7630 have font->min_bounds.width == 0. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7631 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7632 static INLINE void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7633 x_font_min_bounds (font, w, h) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7634 MacFontStruct *font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7635 int *w, *h; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7636 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7637 *h = FONT_HEIGHT (font); |
59325
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
7638 *w = font->min_bounds.width; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7639 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7640 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7641 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7642 /* Compute the smallest character width and smallest font height over |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7643 all fonts available on frame F. Set the members smallest_char_width |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7644 and smallest_font_height in F's x_display_info structure to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7645 the values computed. Value is non-zero if smallest_font_height or |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7646 smallest_char_width become smaller than they were before. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7647 |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7648 static int |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7649 x_compute_min_glyph_bounds (f) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7650 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7651 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7652 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7653 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7654 MacFontStruct *font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7655 int old_width = dpyinfo->smallest_char_width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7656 int old_height = dpyinfo->smallest_font_height; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7657 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7658 dpyinfo->smallest_font_height = 100000; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7659 dpyinfo->smallest_char_width = 100000; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7660 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7661 for (i = 0; i < dpyinfo->n_fonts; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7662 if (dpyinfo->font_table[i].name) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7663 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7664 struct font_info *fontp = dpyinfo->font_table + i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7665 int w, h; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7666 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7667 font = (MacFontStruct *) fontp->font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7668 xassert (font != (MacFontStruct *) ~0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7669 x_font_min_bounds (font, &w, &h); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7670 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7671 dpyinfo->smallest_font_height = min (dpyinfo->smallest_font_height, h); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7672 dpyinfo->smallest_char_width = min (dpyinfo->smallest_char_width, w); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7673 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7674 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7675 xassert (dpyinfo->smallest_char_width > 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7676 && dpyinfo->smallest_font_height > 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7677 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7678 return (dpyinfo->n_fonts == 1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7679 || dpyinfo->smallest_char_width < old_width |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7680 || dpyinfo->smallest_font_height < old_height); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7681 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7682 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7683 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7684 /* Determine whether given string is a fully-specified XLFD: all 14 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7685 fields are present, none is '*'. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7686 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7687 static int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7688 is_fully_specified_xlfd (char *p) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7689 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7690 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7691 char *q; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7692 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7693 if (*p != '-') |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7694 return 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7695 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7696 for (i = 0; i < 13; i++) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7697 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7698 q = strchr (p + 1, '-'); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7699 if (q == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7700 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7701 if (q - p == 2 && *(p + 1) == '*') |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7702 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7703 p = q; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7704 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7705 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7706 if (strchr (p + 1, '-') != NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7707 return 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7708 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7709 if (*(p + 1) == '*' && *(p + 2) == '\0') |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7710 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7711 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7712 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7713 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7714 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7715 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7716 /* XLoadQueryFont creates and returns an internal representation for a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7717 font in a MacFontStruct struct. There is really no concept |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7718 corresponding to "loading" a font on the Mac. But we check its |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7719 existence and find the font number and all other information for it |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7720 and store them in the returned MacFontStruct. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7721 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7722 static MacFontStruct * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7723 XLoadQueryFont (Display *dpy, char *fontname) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7724 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7725 int size; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7726 char *name; |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7727 Str255 family; |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
7728 Str31 charset; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7729 SInt16 fontnum; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7730 #if USE_ATSUI |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7731 static ATSUFontID font_id; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7732 ATSUStyle mac_style = NULL; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7733 #endif |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7734 Style fontface; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7735 #if TARGET_API_MAC_CARBON |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7736 TextEncoding encoding; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7737 int scriptcode; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7738 #else |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7739 short scriptcode; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7740 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7741 MacFontStruct *font; |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7742 XCharStruct *space_bounds = NULL, *pcm; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7743 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7744 if (is_fully_specified_xlfd (fontname)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7745 name = fontname; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7746 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7747 { |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7748 Lisp_Object matched_fonts; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7749 |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7750 matched_fonts = mac_do_list_fonts (fontname, 1); |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7751 if (NILP (matched_fonts)) |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7752 return NULL; |
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
7753 name = SDATA (XCAR (matched_fonts)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7754 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7755 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7756 if (parse_x_font_name (name, family, &size, &fontface, charset) == 0) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7757 return NULL; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7758 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7759 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7760 if (strcmp (charset, "iso10646-1") == 0) /* XXX */ |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7761 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7762 OSErr err; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7763 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7764 kATSUQDBoldfaceTag, kATSUQDItalicTag}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7765 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7766 sizeof (Boolean), sizeof (Boolean)}; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7767 static Fixed size_fixed; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7768 static Boolean bold_p, italic_p; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7769 ATSUAttributeValuePtr values[] = {&font_id, &size_fixed, |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7770 &bold_p, &italic_p}; |
68145
d88b44855af3
[USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67788
diff
changeset
|
7771 ATSUFontFeatureType types[] = {kAllTypographicFeaturesType, |
d88b44855af3
[USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67788
diff
changeset
|
7772 kDiacriticsType}; |
d88b44855af3
[USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67788
diff
changeset
|
7773 ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector, |
d88b44855af3
[USE_ATSUI] (atsu_get_text_layout_with_text_ptr)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67788
diff
changeset
|
7774 kDecomposeDiacriticsSelector}; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7775 Lisp_Object font_id_cons; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7776 FMFontStyle style; |
65910
a53616277ba6
(GC_CLIP_REGION): New macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65892
diff
changeset
|
7777 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7778 font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)), |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7779 atsu_font_id_hash, Qnil); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7780 if (NILP (font_id_cons)) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7781 return NULL; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7782 font_id = cons_to_long (font_id_cons); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7783 size_fixed = Long2Fix (size); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7784 bold_p = (fontface & bold) != 0; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7785 italic_p = (fontface & italic) != 0; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7786 err = ATSUCreateStyle (&mac_style); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7787 if (err != noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7788 return NULL; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7789 err = ATSUSetFontFeatures (mac_style, sizeof (types) / sizeof (types[0]), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7790 types, selectors); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7791 if (err != noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7792 return NULL; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7793 err = ATSUSetAttributes (mac_style, sizeof (tags) / sizeof (tags[0]), |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7794 tags, sizes, values); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7795 if (err != noErr) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7796 return NULL; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7797 err = FMGetFontFamilyInstanceFromFont (font_id, &fontnum, &style); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7798 if (err != noErr) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7799 fontnum = -1; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7800 scriptcode = kTextEncodingMacUnicode; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7801 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7802 else |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7803 #endif |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7804 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7805 Lisp_Object tmp = Fassoc (build_string (family), fm_font_family_alist); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7806 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7807 if (NILP (tmp)) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7808 return NULL; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7809 fontnum = XINT (XCDR (tmp)); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7810 #if TARGET_API_MAC_CARBON |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7811 if (FMGetFontFamilyTextEncoding (fontnum, &encoding) != noErr) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7812 return NULL; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7813 scriptcode = GetTextEncodingBase (encoding); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7814 #else |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7815 scriptcode = FontToScript (fontnum); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7816 #endif |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7817 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7818 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7819 font = (MacFontStruct *) xmalloc (sizeof (struct MacFontStruct)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7820 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7821 font->mac_fontnum = fontnum; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7822 font->mac_fontsize = size; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7823 font->mac_fontface = fontface; |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7824 font->mac_scriptcode = scriptcode; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7825 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7826 font->mac_style = mac_style; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7827 #if USE_CG_TEXT_DRAWING |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7828 font->cg_font = NULL; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7829 font->cg_glyphs = NULL; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7830 #endif |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7831 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7832 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7833 /* Apple Japanese (SJIS) font is listed as both |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7834 "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0" |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7835 (Roman script) in init_font_name_table (). The latter should be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
7836 treated as a one-byte font. */ |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7837 if (scriptcode == smJapanese && strcmp (charset, "jisx0201.1976-0") == 0) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7838 font->mac_scriptcode = smRoman; |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
7839 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7840 font->full_name = mac_to_x_fontname (family, size, fontface, charset); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
7841 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7842 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7843 if (font->mac_style) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7844 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7845 OSErr err; |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7846 UniChar c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7847 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7848 font->min_byte1 = 0; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7849 font->max_byte1 = 0xff; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7850 font->min_char_or_byte2 = 0; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7851 font->max_char_or_byte2 = 0xff; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7852 |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7853 font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7854 bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7855 font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7856 pcm_init (font->bounds.rows[0], 0x100); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7857 |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7858 #if USE_CG_TEXT_DRAWING |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7859 if (fontnum != -1) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7860 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7861 FMFontStyle style; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7862 ATSFontRef ats_font; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7863 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7864 err = FMGetFontFromFontFamilyInstance (fontnum, fontface, |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7865 &font_id, &style); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7866 /* Use CG text drawing if italic/bold is not synthesized. */ |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7867 if (err == noErr && style == fontface) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7868 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7869 ats_font = FMGetATSFontRefFromFont (font_id); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7870 font->cg_font = CGFontCreateWithPlatformFont (&ats_font); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7871 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
7872 } |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7873 |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7874 if (font->cg_font) |
70071
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7875 { |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7876 font->cg_glyphs = xmalloc (sizeof (CGGlyph) * 0x100); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7877 bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100); |
84e6726893ef
(XCreateGC, x_per_char_metric, xlfdpat_create)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69964
diff
changeset
|
7878 } |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7879 #endif |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7880 space_bounds = font->bounds.rows[0] + 0x20; |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7881 err = mac_query_char_extents (font->mac_style, 0x20, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7882 &font->ascent, &font->descent, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7883 space_bounds, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7884 #if USE_CG_TEXT_DRAWING |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7885 (font->cg_glyphs ? font->cg_glyphs + 0x20 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7886 : NULL) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7887 #else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7888 NULL |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7889 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7890 ); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7891 if (err != noErr) |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7892 { |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7893 mac_unload_font (&one_mac_display_info, font); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7894 return NULL; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7895 } |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7896 |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
7897 pcm = font->bounds.rows[0]; |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7898 for (c = 0x21; c <= 0xff; c++) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7899 { |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7900 if (c == 0xad) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7901 /* Soft hyphen is not supported in ATSUI. */ |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7902 continue; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7903 else if (c == 0x7f) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7904 { |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7905 c = 0x9f; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7906 continue; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7907 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7908 |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7909 mac_query_char_extents (font->mac_style, c, NULL, NULL, pcm + c, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7910 #if USE_CG_TEXT_DRAWING |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7911 (font->cg_glyphs ? font->cg_glyphs + c |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7912 : NULL) |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
7913 #else |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7914 NULL |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7915 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7916 ); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7917 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7918 #if USE_CG_TEXT_DRAWING |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7919 if (font->cg_glyphs && font->cg_glyphs[c] == 0) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7920 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7921 /* Don't use CG text drawing if font substitution occurs in |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7922 ASCII or Latin-1 characters. */ |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7923 CGFontRelease (font->cg_font); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7924 font->cg_font = NULL; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7925 xfree (font->cg_glyphs); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7926 font->cg_glyphs = NULL; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7927 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
7928 #endif |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7929 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7930 } |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7931 else |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7932 #endif |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7933 { |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7934 GrafPtr port; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7935 SInt16 old_fontnum, old_fontsize; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7936 Style old_fontface; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7937 FontInfo the_fontinfo; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7938 int is_two_byte_font; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7939 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7940 /* Save the current font number used. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7941 GetPort (&port); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7942 #if TARGET_API_MAC_CARBON |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7943 old_fontnum = GetPortTextFont (port); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7944 old_fontsize = GetPortTextSize (port); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7945 old_fontface = GetPortTextFace (port); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7946 #else |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7947 old_fontnum = port->txFont; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7948 old_fontsize = port->txSize; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7949 old_fontface = port->txFace; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7950 #endif |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7951 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7952 TextFont (fontnum); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7953 TextSize (size); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7954 TextFace (fontface); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7955 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7956 GetFontInfo (&the_fontinfo); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7957 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7958 font->ascent = the_fontinfo.ascent; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7959 font->descent = the_fontinfo.descent; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7960 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7961 is_two_byte_font = (font->mac_scriptcode == smJapanese |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7962 || font->mac_scriptcode == smTradChinese |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7963 || font->mac_scriptcode == smSimpChinese |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7964 || font->mac_scriptcode == smKorean); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7965 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7966 if (is_two_byte_font) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7967 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7968 int char_width; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7969 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7970 font->min_byte1 = 0xa1; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7971 font->max_byte1 = 0xfe; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7972 font->min_char_or_byte2 = 0xa1; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7973 font->max_char_or_byte2 = 0xfe; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7974 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7975 /* Use the width of an "ideographic space" of that font |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7976 because the_fontinfo.widMax returns the wrong width for |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7977 some fonts. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7978 switch (font->mac_scriptcode) |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7979 { |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7980 case smJapanese: |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7981 font->min_byte1 = 0x81; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7982 font->max_byte1 = 0xfc; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7983 font->min_char_or_byte2 = 0x40; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7984 font->max_char_or_byte2 = 0xfc; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7985 char_width = StringWidth("\p\x81\x40"); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7986 break; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7987 case smTradChinese: |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7988 font->min_char_or_byte2 = 0x40; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7989 char_width = StringWidth("\p\xa1\x40"); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7990 break; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7991 case smSimpChinese: |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7992 char_width = StringWidth("\p\xa1\xa1"); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7993 break; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7994 case smKorean: |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7995 char_width = StringWidth("\p\xa1\xa1"); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
7996 break; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
7997 } |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7998 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
7999 font->bounds.per_char = NULL; |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8000 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8001 if (fontface & italic) |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8002 font->max_bounds.rbearing = char_width + 1; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8003 else |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8004 font->max_bounds.rbearing = char_width; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8005 font->max_bounds.lbearing = 0; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8006 font->max_bounds.width = char_width; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8007 font->max_bounds.ascent = the_fontinfo.ascent; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8008 font->max_bounds.descent = the_fontinfo.descent; |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8009 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8010 font->min_bounds = font->max_bounds; |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
8011 } |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8012 else |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8013 { |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8014 int c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8015 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8016 font->min_byte1 = font->max_byte1 = 0; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8017 font->min_char_or_byte2 = 0x20; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8018 font->max_char_or_byte2 = 0xff; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8019 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8020 font->bounds.per_char = |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8021 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1)); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8022 bzero (font->bounds.per_char, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8023 sizeof (XCharStruct) * (0xff - 0x20 + 1)); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8024 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8025 space_bounds = font->bounds.per_char; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8026 mac_query_char_extents (NULL, 0x20, &font->ascent, &font->descent, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8027 space_bounds, NULL); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8028 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8029 for (c = 0x21, pcm = space_bounds + 1; c <= 0xff; c++, pcm++) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8030 mac_query_char_extents (NULL, c, NULL, NULL, pcm, NULL); |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8031 } |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8032 |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8033 /* Restore previous font number, size and face. */ |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8034 TextFont (old_fontnum); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8035 TextSize (old_fontsize); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8036 TextFace (old_fontface); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
8037 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8038 |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8039 if (space_bounds) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8040 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8041 int c; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8042 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8043 font->min_bounds = font->max_bounds = *space_bounds; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8044 for (c = 0x21, pcm = space_bounds + 1; c <= 0x7f; c++, pcm++) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8045 if (pcm->width > 0) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8046 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8047 font->min_bounds.lbearing = min (font->min_bounds.lbearing, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8048 pcm->lbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8049 font->min_bounds.rbearing = min (font->min_bounds.rbearing, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8050 pcm->rbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8051 font->min_bounds.width = min (font->min_bounds.width, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8052 pcm->width); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8053 font->min_bounds.ascent = min (font->min_bounds.ascent, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8054 pcm->ascent); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8055 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8056 font->max_bounds.lbearing = max (font->max_bounds.lbearing, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8057 pcm->lbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8058 font->max_bounds.rbearing = max (font->max_bounds.rbearing, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8059 pcm->rbearing); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8060 font->max_bounds.width = max (font->max_bounds.width, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8061 pcm->width); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8062 font->max_bounds.ascent = max (font->max_bounds.ascent, |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8063 pcm->ascent); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8064 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8065 if ( |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8066 #if USE_ATSUI |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8067 font->mac_style == NULL && |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8068 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8069 font->max_bounds.width == font->min_bounds.width |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8070 && font->min_bounds.lbearing >= 0 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8071 && font->max_bounds.rbearing <= font->max_bounds.width) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8072 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8073 /* Fixed width and no overhangs. */ |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8074 xfree (font->bounds.per_char); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8075 font->bounds.per_char = NULL; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8076 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8077 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8078 |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8079 #if !defined (MAC_OS8) || USE_ATSUI |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8080 /* AppKit and WebKit do some adjustment to the heights of Courier, |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8081 Helvetica, and Times. This only works on the environments where |
69061
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8082 srcCopy text transfer mode is never used. */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8083 if ( |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8084 #ifdef MAC_OS8 /* implies USE_ATSUI */ |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8085 font->mac_style && |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8086 #endif |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8087 (strcmp (family, "courier") == 0 || strcmp (family, "helvetica") == 0 |
783439580869
(mac_draw_string_common): Remove arg MODE. New arg
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68770
diff
changeset
|
8088 || strcmp (family, "times") == 0)) |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8089 font->ascent += (font->ascent + font->descent) * .15 + 0.5; |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8090 #endif |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8091 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8092 return font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8093 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8094 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8095 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8096 void |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8097 mac_unload_font (dpyinfo, font) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8098 struct mac_display_info *dpyinfo; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8099 XFontStruct *font; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8100 { |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8101 xfree (font->full_name); |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
8102 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
8103 if (font->mac_style) |
67733
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8104 { |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8105 int i; |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8106 |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8107 for (i = font->min_byte1; i <= font->max_byte1; i++) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8108 if (font->bounds.rows[i]) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8109 xfree (font->bounds.rows[i]); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8110 xfree (font->bounds.rows); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8111 ATSUDisposeStyle (font->mac_style); |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8112 } |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8113 else |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8114 #endif |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8115 if (font->bounds.per_char) |
330ac31a0c82
(mac_per_char_metric): Add prototype.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67672
diff
changeset
|
8116 xfree (font->bounds.per_char); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8117 #if USE_CG_TEXT_DRAWING |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8118 if (font->cg_font) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8119 CGFontRelease (font->cg_font); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8120 if (font->cg_glyphs) |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8121 xfree (font->cg_glyphs); |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8122 #endif |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8123 xfree (font); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8124 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8125 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8126 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8127 /* Load font named FONTNAME of the size SIZE for frame F, and return a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8128 pointer to the structure font_info while allocating it dynamically. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8129 If SIZE is 0, load any size of font. |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8130 If loading is failed, return NULL. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8131 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8132 struct font_info * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8133 x_load_font (f, fontname, size) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8134 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8135 register char *fontname; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8136 int size; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8137 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8138 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8139 Lisp_Object font_names; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8140 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8141 /* Get a list of all the fonts that match this name. Once we |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8142 have a list of matching fonts, we compare them against the fonts |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8143 we already have by comparing names. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8144 font_names = x_list_fonts (f, build_string (fontname), size, 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8145 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8146 if (!NILP (font_names)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8147 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8148 Lisp_Object tail; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8149 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8150 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8151 for (i = 0; i < dpyinfo->n_fonts; i++) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8152 for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8153 if (dpyinfo->font_table[i].name |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8154 && (!strcmp (dpyinfo->font_table[i].name, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
8155 SDATA (XCAR (tail))) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8156 || !strcmp (dpyinfo->font_table[i].full_name, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
8157 SDATA (XCAR (tail))))) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8158 return (dpyinfo->font_table + i); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8159 } |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8160 else |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8161 return NULL; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8162 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8163 /* Load the font and add it to the table. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8164 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8165 struct MacFontStruct *font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8166 struct font_info *fontp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8167 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8168 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8169 fontname = (char *) SDATA (XCAR (font_names)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8170 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8171 BLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8172 font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8173 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8174 if (!font) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8175 return NULL; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8176 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8177 /* Find a free slot in the font table. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8178 for (i = 0; i < dpyinfo->n_fonts; ++i) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8179 if (dpyinfo->font_table[i].name == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8180 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8181 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8182 /* If no free slot found, maybe enlarge the font table. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8183 if (i == dpyinfo->n_fonts |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8184 && dpyinfo->n_fonts == dpyinfo->font_table_size) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8185 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8186 int sz; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8187 dpyinfo->font_table_size = max (16, 2 * dpyinfo->font_table_size); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8188 sz = dpyinfo->font_table_size * sizeof *dpyinfo->font_table; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8189 dpyinfo->font_table |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8190 = (struct font_info *) xrealloc (dpyinfo->font_table, sz); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8191 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8192 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8193 fontp = dpyinfo->font_table + i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8194 if (i == dpyinfo->n_fonts) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8195 ++dpyinfo->n_fonts; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8196 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8197 /* Now fill in the slots of *FONTP. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8198 BLOCK_INPUT; |
52742
7f9bdf6cf89b
(x_load_font): Clear all members of FONTP before start filling them.
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
8199 bzero (fontp, sizeof (*fontp)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8200 fontp->font = font; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8201 fontp->font_idx = i; |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
8202 fontp->charset = -1; /* fs_load_font sets it. */ |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8203 fontp->name = (char *) xmalloc (strlen (fontname) + 1); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8204 bcopy (fontname, fontp->name, strlen (fontname) + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8205 |
59325
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8206 if (font->min_bounds.width == font->max_bounds.width) |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8207 { |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8208 /* Fixed width font. */ |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8209 fontp->average_width = fontp->space_width = font->min_bounds.width; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8210 } |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8211 else |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8212 { |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8213 XChar2b char2b; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8214 XCharStruct *pcm; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8215 |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8216 char2b.byte1 = 0x00, char2b.byte2 = 0x20; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8217 pcm = mac_per_char_metric (font, &char2b, 0); |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8218 if (pcm) |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8219 fontp->space_width = pcm->width; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8220 else |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8221 fontp->space_width = FONT_WIDTH (font); |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8222 |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8223 if (pcm) |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8224 { |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8225 int width = pcm->width; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8226 for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++) |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8227 if ((pcm = mac_per_char_metric (font, &char2b, 0)) != NULL) |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8228 width += pcm->width; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8229 fontp->average_width = width / 95; |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8230 } |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8231 else |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8232 fontp->average_width = FONT_WIDTH (font); |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8233 } |
68eaccfa130a
* macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
Steven Tamm <steventamm@mac.com>
parents:
59199
diff
changeset
|
8234 |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8235 fontp->full_name = (char *) xmalloc (strlen (font->full_name) + 1); |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
8236 bcopy (font->full_name, fontp->full_name, strlen (font->full_name) + 1); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8237 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8238 fontp->size = font->max_bounds.width; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8239 fontp->height = FONT_HEIGHT (font); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8240 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8241 /* For some font, ascent and descent in max_bounds field is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8242 larger than the above value. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8243 int max_height = font->max_bounds.ascent + font->max_bounds.descent; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8244 if (max_height > fontp->height) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8245 fontp->height = max_height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8246 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8247 |
89960
d79ab6afded5
macterm.c (mac_encode_char): Add charset argument and update
Steven Tamm <steventamm@mac.com>
parents:
89956
diff
changeset
|
8248 /* MAC_TODO: The script encoding is irrelevant in unicode? */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8249 /* The slot `encoding' specifies how to map a character |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8250 code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8251 the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8252 (0:0x2020..0x7F7F, 1:0xA0A0..0xFFFF, 3:0x20A0..0x7FFF, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8253 2:0xA020..0xFF7F). For the moment, we don't know which charset |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
8254 uses this font. So, we set information in fontp->encoding_type |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8255 which is never used by any charset. If mapping can't be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8256 decided, set FONT_ENCODING_NOT_DECIDED. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8257 if (font->mac_scriptcode == smJapanese) |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
8258 fontp->encoding_type = 4; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8259 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8260 { |
90248
c8c3c8dbe333
(mac_encode_char): Call ccl_driver with the last arg Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90242
diff
changeset
|
8261 fontp->encoding_type |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8262 = (font->max_byte1 == 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8263 /* 1-byte font */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8264 ? (font->min_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8265 ? (font->max_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8266 ? 0 /* 0x20..0x7F */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8267 : FONT_ENCODING_NOT_DECIDED) /* 0x20..0xFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8268 : 1) /* 0xA0..0xFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8269 /* 2-byte font */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8270 : (font->min_byte1 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8271 ? (font->max_byte1 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8272 ? (font->min_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8273 ? (font->max_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8274 ? 0 /* 0x2020..0x7F7F */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8275 : FONT_ENCODING_NOT_DECIDED) /* 0x2020..0x7FFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8276 : 3) /* 0x20A0..0x7FFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8277 : FONT_ENCODING_NOT_DECIDED) /* 0x20??..0xA0?? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8278 : (font->min_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8279 ? (font->max_char_or_byte2 < 0x80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8280 ? 2 /* 0xA020..0xFF7F */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8281 : FONT_ENCODING_NOT_DECIDED) /* 0xA020..0xFFFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8282 : 1))); /* 0xA0A0..0xFFFF */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8283 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8284 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8285 #if 0 /* MAC_TODO: fill these out with more reasonably values */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8286 fontp->baseline_offset |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8287 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8288 ? (long) value : 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8289 fontp->relative_compose |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8290 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8291 ? (long) value : 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8292 fontp->default_ascent |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8293 = (XGetFontProperty (font, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8294 ? (long) value : 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8295 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8296 fontp->baseline_offset = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8297 fontp->relative_compose = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8298 fontp->default_ascent = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8299 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8300 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8301 /* Set global flag fonts_changed_p to non-zero if the font loaded |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8302 has a character with a smaller width than any other character |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8303 before, or if the font loaded has a smaller height than any |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8304 other font loaded before. If this happens, it will make a |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8305 glyph matrix reallocation necessary. */ |
64102
09d72bda30b9
(mac_draw_vertical_window_border): Use foreground of
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64084
diff
changeset
|
8306 fonts_changed_p |= x_compute_min_glyph_bounds (f); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8307 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8308 return fontp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8309 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8310 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8311 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8312 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8313 /* Return a pointer to struct font_info of a font named FONTNAME for |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8314 frame F. If no such font is loaded, return NULL. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8315 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8316 struct font_info * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8317 x_query_font (f, fontname) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8318 struct frame *f; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8319 register char *fontname; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8320 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8321 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8322 int i; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8323 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8324 for (i = 0; i < dpyinfo->n_fonts; i++) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8325 if (dpyinfo->font_table[i].name |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8326 && (!strcmp (dpyinfo->font_table[i].name, fontname) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8327 || !strcmp (dpyinfo->font_table[i].full_name, fontname))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8328 return (dpyinfo->font_table + i); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8329 return NULL; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8330 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8331 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8332 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8333 /* Find a CCL program for a font specified by FONTP, and set the member |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8334 `encoder' of the structure. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8335 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8336 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8337 x_find_ccl_program (fontp) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8338 struct font_info *fontp; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8339 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8340 Lisp_Object list, elt; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8341 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8342 for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCDR (list)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8343 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8344 elt = XCAR (list); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8345 if (CONSP (elt) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8346 && STRINGP (XCAR (elt)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8347 && (fast_c_string_match_ignore_case (XCAR (elt), fontp->name) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8348 >= 0)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8349 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8350 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8351 if (! NILP (list)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8352 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8353 struct ccl_program *ccl |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8354 = (struct ccl_program *) xmalloc (sizeof (struct ccl_program)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8355 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8356 if (setup_ccl_program (ccl, XCDR (elt)) < 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8357 xfree (ccl); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8358 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8359 fontp->font_encoder = ccl; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8360 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8361 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8362 |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8363 #if USE_MAC_FONT_PANEL |
71135
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
8364 /* Whether Font Panel has been shown before. The first call to font |
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
8365 panel functions (FPIsFontPanelVisible, SetFontInfoForSelection) is |
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
8366 slow. This variable is used for deferring such a call as much as |
a40a279936e8
(mac_handle_visibility_change): Set buf.arg to Qnil.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71065
diff
changeset
|
8367 possible. */ |
71065
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8368 static int font_panel_shown_p = 0; |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8369 |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8370 int |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8371 mac_font_panel_visible_p () |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8372 { |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8373 return font_panel_shown_p && FPIsFontPanelVisible (); |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8374 } |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8375 |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8376 OSStatus |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8377 mac_show_hide_font_panel () |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8378 { |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8379 font_panel_shown_p = 1; |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8380 |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8381 return FPShowHideFontPanel (); |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8382 } |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8383 |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8384 OSStatus |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8385 mac_set_font_info_for_selection (f, face_id, c) |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8386 struct frame *f; |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8387 int face_id, c; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8388 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8389 OSStatus err; |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8390 EventTargetRef target = NULL; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8391 XFontStruct *font = NULL; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8392 |
71065
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8393 if (!mac_font_panel_visible_p ()) |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8394 return noErr; |
380e4a856f30
(font_panel_shown_p) [USE_MAC_FONT_PANEL]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71021
diff
changeset
|
8395 |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8396 if (f) |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8397 { |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8398 target = GetWindowEventTarget (FRAME_MAC_WINDOW (f)); |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8399 |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8400 if (FRAME_FACE_CACHE (f) && CHAR_VALID_P (c, 0)) |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8401 { |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8402 struct face *face; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8403 |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8404 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c); |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8405 face = FACE_FROM_ID (f, face_id); |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8406 font = face->font; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8407 } |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8408 } |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8409 |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8410 if (font == NULL) |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8411 err = SetFontInfoForSelection (kFontSelectionATSUIType, 0, NULL, target); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8412 else |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8413 { |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8414 if (font->mac_fontnum != -1) |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8415 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8416 FontSelectionQDStyle qd_style; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8417 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8418 qd_style.version = kFontSelectionQDStyleVersionZero; |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8419 qd_style.instance.fontFamily = font->mac_fontnum; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8420 qd_style.instance.fontStyle = font->mac_fontface; |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8421 qd_style.size = font->mac_fontsize; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8422 qd_style.hasColor = false; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8423 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8424 err = SetFontInfoForSelection (kFontSelectionQDType, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8425 1, &qd_style, target); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8426 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8427 else |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8428 err = SetFontInfoForSelection (kFontSelectionATSUIType, |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8429 1, &font->mac_style, target); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8430 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8431 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8432 return err; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8433 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8434 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8435 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8436 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8437 /* The Mac Event loop code */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8438 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
8439 #if !TARGET_API_MAC_CARBON |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8440 #include <Events.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8441 #include <Quickdraw.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8442 #include <Balloons.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8443 #include <Devices.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8444 #include <Fonts.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8445 #include <Gestalt.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8446 #include <Menus.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8447 #include <Processes.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8448 #include <Sound.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8449 #include <ToolUtils.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8450 #include <TextUtils.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8451 #include <Dialogs.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8452 #include <Script.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8453 #include <Types.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8454 #include <Resources.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8455 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8456 #if __MWERKS__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8457 #include <unix.h> |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8458 #endif |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
8459 #endif /* ! TARGET_API_MAC_CARBON */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8460 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8461 #define M_APPLE 128 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8462 #define I_ABOUT 1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8463 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8464 #define WINDOW_RESOURCE 128 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8465 #define TERM_WINDOW_RESOURCE 129 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8466 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8467 #define DEFAULT_NUM_COLS 80 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8468 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8469 #define MIN_DOC_SIZE 64 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8470 #define MAX_DOC_SIZE 32767 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8471 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8472 #define EXTRA_STACK_ALLOC (256 * 1024) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8473 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8474 #define ARGV_STRING_LIST_ID 129 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8475 #define ABOUT_ALERT_ID 128 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8476 #define RAM_TOO_LARGE_ALERT_ID 129 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8477 |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8478 /* Contains the string "reverse", which is a constant for mouse button emu.*/ |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8479 Lisp_Object Qreverse; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8480 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8481 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8482 /* Modifier associated with the control key, or nil to ignore. */ |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8483 Lisp_Object Vmac_control_modifier; |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8484 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8485 /* Modifier associated with the option key, or nil to ignore. */ |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
8486 Lisp_Object Vmac_option_modifier; |
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
8487 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8488 /* Modifier associated with the command key, or nil to ignore. */ |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8489 Lisp_Object Vmac_command_modifier; |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8490 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8491 /* Modifier associated with the function key, or nil to ignore. */ |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8492 Lisp_Object Vmac_function_modifier; |
46798 | 8493 |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8494 /* True if the option and command modifiers should be used to emulate |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8495 a three button mouse */ |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8496 Lisp_Object Vmac_emulate_three_button_mouse; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8497 |
46798 | 8498 #if USE_CARBON_EVENTS |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8499 /* Non-zero if the mouse wheel button (i.e. button 4) should map to |
46798 | 8500 mouse-2, instead of mouse-3. */ |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8501 int mac_wheel_button_is_mouse_2; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8502 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8503 /* If non-zero, the Mac "Command" key is passed on to the Mac Toolbox |
46860
8b7ade57211d
2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46856
diff
changeset
|
8504 for processing before Emacs sees it. */ |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8505 int mac_pass_command_to_system; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8506 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8507 /* If non-zero, the Mac "Control" key is passed on to the Mac Toolbox |
46860
8b7ade57211d
2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46856
diff
changeset
|
8508 for processing before Emacs sees it. */ |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8509 int mac_pass_control_to_system; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8510 #endif |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8511 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8512 /* Points to the variable `inev' in the function XTread_socket. It is |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
8513 used for passing an input event to the function back from |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
8514 Carbon/Apple event handlers. */ |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8515 static struct input_event *read_socket_inev = NULL; |
46798 | 8516 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8517 Point saved_menu_event_location; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8518 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8519 /* Apple Events */ |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8520 #if USE_CARBON_EVENTS |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8521 static Lisp_Object Qhicommand; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8522 #ifdef MAC_OSX |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8523 extern Lisp_Object Qwindow; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8524 static Lisp_Object Qtoolbar_switch_mode; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8525 #endif |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8526 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8527 extern Lisp_Object Qfont; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8528 static Lisp_Object Qpanel_closed, Qselection; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
8529 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8530 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8531 static TSMDocumentID tsm_document_id; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8532 static Lisp_Object Qtext_input; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8533 static Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8534 static Lisp_Object Vmac_ts_active_input_overlay; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8535 extern Lisp_Object Qbefore_string; |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8536 static Lisp_Object Vmac_ts_script_language_on_focus; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8537 static ScriptLanguageRecord saved_ts_language; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8538 static Component saved_ts_component; |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8539 #endif |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8540 #endif |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8541 extern int mac_ready_for_apple_events; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8542 extern Lisp_Object Qundefined; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8543 extern void init_apple_event_handler P_ ((void)); |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8544 extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID, |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8545 Lisp_Object *, Lisp_Object *, |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
8546 Lisp_Object *)); |
67788
114d965dfb60
Don't include sys/param.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67733
diff
changeset
|
8547 extern OSErr init_coercion_handler P_ ((void)); |
46798 | 8548 |
8549 /* Drag and Drop */ | |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
8550 OSErr install_drag_handler P_ ((WindowRef)); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
8551 void remove_drag_handler P_ ((WindowRef)); |
46798 | 8552 |
8553 #if USE_CARBON_EVENTS | |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
8554 #ifdef MAC_OSX |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8555 extern void init_service_handler (); |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
8556 static Lisp_Object Qservice, Qpaste, Qperform; |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
8557 #endif |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8558 /* Window Event Handler */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8559 static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8560 EventRef, void *); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8561 #endif |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
8562 OSErr install_window_handler (WindowPtr); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8563 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8564 extern void init_emacs_passwd_dir (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8565 extern int emacs_main (int, char **, char **); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8566 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8567 extern void initialize_applescript(); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8568 extern void terminate_applescript(); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8569 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8570 static unsigned int |
46798 | 8571 #if USE_CARBON_EVENTS |
8572 mac_to_emacs_modifiers (UInt32 mods) | |
8573 #else | |
8574 mac_to_emacs_modifiers (EventModifiers mods) | |
8575 #endif | |
8576 { | |
8577 unsigned int result = 0; | |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8578 if (mods & shiftKey) |
46798 | 8579 result |= shift_modifier; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8580 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8581 /* Deactivated to simplify configuration: |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8582 if Vmac_option_modifier is non-NIL, we fully process the Option |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8583 key. Otherwise, we only process it if an additional Ctrl or Command |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8584 is pressed. That way the system may convert the character to a |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8585 composed one. |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8586 if ((mods & optionKey) && |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8587 (( !NILP(Vmac_option_modifier) || |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8588 ((mods & cmdKey) || (mods & controlKey))))) */ |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8589 |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
8590 if (!NILP (Vmac_option_modifier) && (mods & optionKey)) { |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8591 Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value); |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8592 if (INTEGERP(val)) |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8593 result |= XUINT(val); |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
8594 } |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8595 if (!NILP (Vmac_command_modifier) && (mods & cmdKey)) { |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8596 Lisp_Object val = Fget(Vmac_command_modifier, Qmodifier_value); |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8597 if (INTEGERP(val)) |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8598 result |= XUINT(val); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8599 } |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8600 if (!NILP (Vmac_control_modifier) && (mods & controlKey)) { |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8601 Lisp_Object val = Fget(Vmac_control_modifier, Qmodifier_value); |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8602 if (INTEGERP(val)) |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8603 result |= XUINT(val); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8604 } |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8605 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8606 #ifdef MAC_OSX |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8607 if (!NILP (Vmac_function_modifier) && (mods & kEventKeyModifierFnMask)) { |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8608 Lisp_Object val = Fget(Vmac_function_modifier, Qmodifier_value); |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8609 if (INTEGERP(val)) |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8610 result |= XUINT(val); |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8611 } |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8612 #endif |
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
8613 |
46798 | 8614 return result; |
8615 } | |
8616 | |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8617 static int |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8618 mac_get_emulated_btn ( UInt32 modifiers ) |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8619 { |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8620 int result = 0; |
55583
21f88361795c
Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents:
55539
diff
changeset
|
8621 if (!NILP (Vmac_emulate_three_button_mouse)) { |
21f88361795c
Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents:
55539
diff
changeset
|
8622 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); |
56277
fd126130c3cd
macterm.c (mac_get_emulated_btn)
Steven Tamm <steventamm@mac.com>
parents:
56271
diff
changeset
|
8623 if (modifiers & cmdKey) |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8624 result = cmdIs3 ? 2 : 1; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8625 else if (modifiers & optionKey) |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
8626 result = cmdIs3 ? 1 : 2; |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8627 } |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8628 return result; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8629 } |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8630 |
46798 | 8631 #if USE_CARBON_EVENTS |
8632 /* Obtains the event modifiers from the event ref and then calls | |
8633 mac_to_emacs_modifiers. */ | |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
8634 static UInt32 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8635 mac_event_to_emacs_modifiers (EventRef eventRef) |
46798 | 8636 { |
8637 UInt32 mods = 0; | |
8638 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, | |
8639 sizeof (UInt32), NULL, &mods); | |
55583
21f88361795c
Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents:
55539
diff
changeset
|
8640 if (!NILP (Vmac_emulate_three_button_mouse) && |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8641 GetEventClass(eventRef) == kEventClassMouse) |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8642 { |
56277
fd126130c3cd
macterm.c (mac_get_emulated_btn)
Steven Tamm <steventamm@mac.com>
parents:
56271
diff
changeset
|
8643 mods &= ~(optionKey | cmdKey); |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8644 } |
46798 | 8645 return mac_to_emacs_modifiers (mods); |
8646 } | |
8647 | |
8648 /* Given an event ref, return the code to use for the mouse button | |
8649 code in the emacs input_event. */ | |
8650 static int | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8651 mac_get_mouse_btn (EventRef ref) |
46798 | 8652 { |
8653 EventMouseButton result = kEventMouseButtonPrimary; | |
8654 GetEventParameter (ref, kEventParamMouseButton, typeMouseButton, NULL, | |
8655 sizeof (EventMouseButton), NULL, &result); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8656 switch (result) |
46798 | 8657 { |
8658 case kEventMouseButtonPrimary: | |
55583
21f88361795c
Various fixes to support USE_LSB_TAG with carbon emacs. Mostly fixing
Steven Tamm <steventamm@mac.com>
parents:
55539
diff
changeset
|
8659 if (NILP (Vmac_emulate_three_button_mouse)) |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8660 return 0; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8661 else { |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8662 UInt32 mods = 0; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8663 GetEventParameter (ref, kEventParamKeyModifiers, typeUInt32, NULL, |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8664 sizeof (UInt32), NULL, &mods); |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8665 return mac_get_emulated_btn(mods); |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
8666 } |
46798 | 8667 case kEventMouseButtonSecondary: |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8668 return mac_wheel_button_is_mouse_2 ? 2 : 1; |
46798 | 8669 case kEventMouseButtonTertiary: |
8670 case 4: /* 4 is the number for the mouse wheel button */ | |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
8671 return mac_wheel_button_is_mouse_2 ? 1 : 2; |
46798 | 8672 default: |
8673 return 0; | |
8674 } | |
8675 } | |
8676 | |
8677 /* Normally, ConvertEventRefToEventRecord will correctly handle all | |
8678 events. However the click of the mouse wheel is not converted to a | |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8679 mouseDown or mouseUp event. Likewise for dead key down events. |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8680 This calls ConvertEventRef, but then checks to see if it is a mouse |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8681 up/down, or a dead key down carbon event that has not been |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8682 converted, and if so, converts it by hand (to be picked up in the |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8683 XTread_socket loop). */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8684 static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) |
46798 | 8685 { |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8686 OSStatus err; |
46798 | 8687 Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8688 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8689 if (result) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8690 return result; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8691 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8692 switch (GetEventClass (eventRef)) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8693 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8694 case kEventClassMouse: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8695 switch (GetEventKind (eventRef)) |
46798 | 8696 { |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8697 case kEventMouseDown: |
46798 | 8698 eventRec->what = mouseDown; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8699 result = 1; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8700 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8701 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8702 case kEventMouseUp: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8703 eventRec->what = mouseUp; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8704 result = 1; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8705 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8706 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8707 default: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8708 break; |
46798 | 8709 } |
63794
0ddaa52824cd
[USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last change.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63461
diff
changeset
|
8710 break; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8711 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8712 case kEventClassKeyboard: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8713 switch (GetEventKind (eventRef)) |
46798 | 8714 { |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8715 case kEventRawKeyDown: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8716 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8717 unsigned char char_codes; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8718 UInt32 key_code; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8719 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8720 err = GetEventParameter (eventRef, kEventParamKeyMacCharCodes, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8721 typeChar, NULL, sizeof (char), |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8722 NULL, &char_codes); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8723 if (err == noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8724 err = GetEventParameter (eventRef, kEventParamKeyCode, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8725 typeUInt32, NULL, sizeof (UInt32), |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8726 NULL, &key_code); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8727 if (err == noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8728 { |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8729 eventRec->what = keyDown; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8730 eventRec->message = char_codes | ((key_code & 0xff) << 8); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8731 result = 1; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8732 } |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8733 } |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8734 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8735 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8736 default: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8737 break; |
46798 | 8738 } |
63794
0ddaa52824cd
[USE_CARBON_EVENTS] (mac_convert_event_ref): Fix last change.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63461
diff
changeset
|
8739 break; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8740 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8741 default: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8742 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8743 } |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8744 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8745 if (result) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8746 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8747 /* Need where and when. */ |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
8748 UInt32 mods = 0; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8749 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8750 GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8751 NULL, sizeof (Point), NULL, &eventRec->where); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8752 /* Use two step process because new event modifiers are 32-bit |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8753 and old are 16-bit. Currently, only loss is NumLock & Fn. */ |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8754 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8755 NULL, sizeof (UInt32), NULL, &mods); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8756 eventRec->modifiers = mods; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8757 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8758 eventRec->when = EventTimeToTicks (GetEventTime (eventRef)); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8759 } |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
8760 |
46798 | 8761 return result; |
8762 } | |
8763 | |
8764 #endif | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8765 |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
8766 #ifdef MAC_OS8 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8767 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8768 do_get_menus (void) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8769 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8770 Handle menubar_handle; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8771 MenuHandle menu_handle; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8772 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8773 menubar_handle = GetNewMBar (128); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8774 if(menubar_handle == NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8775 abort (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8776 SetMenuBar (menubar_handle); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8777 DrawMenuBar (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8778 |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8779 #if !TARGET_API_MAC_CARBON |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8780 menu_handle = GetMenuHandle (M_APPLE); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8781 if(menu_handle != NULL) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8782 AppendResMenu (menu_handle,'DRVR'); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8783 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8784 abort (); |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8785 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8786 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8787 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8788 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8789 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8790 do_init_managers (void) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8791 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8792 #if !TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8793 InitGraf (&qd.thePort); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8794 InitFonts (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8795 FlushEvents (everyEvent, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8796 InitWindows (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8797 InitMenus (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8798 TEInit (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8799 InitDialogs (NULL); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8800 #endif /* !TARGET_API_MAC_CARBON */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8801 InitCursor (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8802 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8803 #if !TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8804 /* set up some extra stack space for use by emacs */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8805 SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8806 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8807 /* MaxApplZone must be called for AppleScript to execute more |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8808 complicated scripts */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8809 MaxApplZone (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8810 MoreMasters (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8811 #endif /* !TARGET_API_MAC_CARBON */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8812 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8813 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8814 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8815 do_check_ram_size (void) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8816 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8817 SInt32 physical_ram_size, logical_ram_size; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8818 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8819 if (Gestalt (gestaltPhysicalRAMSize, &physical_ram_size) != noErr |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8820 || Gestalt (gestaltLogicalRAMSize, &logical_ram_size) != noErr |
53579
862b91168878
(do_check_ram_size): Don't hardcode the lisp address space size.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53475
diff
changeset
|
8821 || physical_ram_size > (1 << VALBITS) |
862b91168878
(do_check_ram_size): Don't hardcode the lisp address space size.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53475
diff
changeset
|
8822 || logical_ram_size > (1 << VALBITS)) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8823 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8824 StopAlert (RAM_TOO_LARGE_ALERT_ID, NULL); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8825 exit (1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8826 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8827 } |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
8828 #endif /* MAC_OS8 */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8829 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8830 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8831 do_window_update (WindowPtr win) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8832 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
8833 struct frame *f = mac_window_to_frame (win); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
8834 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8835 BeginUpdate (win); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8836 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8837 /* The tooltip has been drawn already. Avoid the SET_FRAME_GARBAGED |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8838 below. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8839 if (win != tip_window) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8840 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8841 if (f->async_visible == 0) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8842 { |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8843 /* Update events may occur when a frame gets iconified. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8844 #if 0 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8845 f->async_visible = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8846 f->async_iconified = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8847 SET_FRAME_GARBAGED (f); |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8848 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8849 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8850 else |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8851 { |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8852 Rect r; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8853 #if TARGET_API_MAC_CARBON |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8854 RgnHandle region = NewRgn (); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8855 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8856 GetPortVisibleRegion (GetWindowPort (win), region); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8857 GetRegionBounds (region, &r); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8858 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8859 UpdateControls (win, region); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8860 DisposeRgn (region); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8861 #else |
60623
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
8862 r = (*win->visRgn)->rgnBBox; |
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
8863 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8864 UpdateControls (win, win->visRgn); |
60623
5a3fa411c713
(activate_scroll_bars, deactivate_scroll_bars): Remove functions and
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60611
diff
changeset
|
8865 #endif |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
8866 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8867 } |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8868 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
8869 EndUpdate (win); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8870 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8871 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8872 static int |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8873 is_emacs_window (WindowPtr win) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8874 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8875 Lisp_Object tail, frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8876 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8877 if (!win) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8878 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8879 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8880 FOR_EACH_FRAME (tail, frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8881 if (FRAME_MAC_P (XFRAME (frame))) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8882 if (FRAME_MAC_WINDOW (XFRAME (frame)) == win) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8883 return 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8884 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8885 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8886 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8887 |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
8888 #if USE_MAC_TSM |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8889 static OSStatus |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8890 mac_tsm_resume () |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8891 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8892 OSStatus err; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8893 ScriptLanguageRecord slrec, *slptr = NULL; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8894 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8895 err = ActivateTSMDocument (tsm_document_id); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8896 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8897 if (err == noErr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8898 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8899 if (EQ (Vmac_ts_script_language_on_focus, Qt)) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8900 slptr = &saved_ts_language; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8901 else if (CONSP (Vmac_ts_script_language_on_focus) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8902 && INTEGERP (XCAR (Vmac_ts_script_language_on_focus)) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8903 && INTEGERP (XCDR (Vmac_ts_script_language_on_focus))) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8904 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8905 slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus)); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8906 slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus)); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8907 slptr = &slrec; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8908 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8909 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8910 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8911 if (slptr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8912 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8913 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8914 err = SetDefaultInputMethodOfClass (saved_ts_component, slptr, |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8915 kKeyboardInputMethodClass); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8916 #else |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8917 err = SetDefaultInputMethod (saved_ts_component, slptr); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8918 #endif |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8919 if (err == noErr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8920 err = SetTextServiceLanguage (slptr); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8921 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8922 /* Seems to be needed on Mac OS X 10.2. */ |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8923 if (err == noErr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8924 KeyScript (slptr->fScript | smKeyForceKeyScriptMask); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8925 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8926 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8927 return err; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8928 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8929 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8930 static OSStatus |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8931 mac_tsm_suspend () |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8932 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8933 OSStatus err; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8934 ScriptLanguageRecord slrec, *slptr = NULL; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8935 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8936 if (EQ (Vmac_ts_script_language_on_focus, Qt)) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8937 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8938 err = GetTextServiceLanguage (&saved_ts_language); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8939 if (err == noErr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8940 slptr = &saved_ts_language; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8941 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8942 else if (CONSP (Vmac_ts_script_language_on_focus) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8943 && INTEGERP (XCAR (Vmac_ts_script_language_on_focus)) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8944 && INTEGERP (XCDR (Vmac_ts_script_language_on_focus))) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8945 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8946 slrec.fScript = XINT (XCAR (Vmac_ts_script_language_on_focus)); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8947 slrec.fLanguage = XINT (XCDR (Vmac_ts_script_language_on_focus)); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8948 slptr = &slrec; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8949 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8950 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8951 if (slptr) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8952 { |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8953 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8954 GetDefaultInputMethodOfClass (&saved_ts_component, slptr, |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8955 kKeyboardInputMethodClass); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8956 #else |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8957 GetDefaultInputMethod (&saved_ts_component, slptr); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8958 #endif |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8959 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8960 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8961 err = DeactivateTSMDocument (tsm_document_id); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8962 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8963 return err; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8964 } |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
8965 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8966 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8967 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8968 do_apple_menu (SInt16 menu_item) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8969 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8970 #if !TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8971 Str255 item_name; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8972 SInt16 da_driver_refnum; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8973 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8974 if (menu_item == I_ABOUT) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8975 NoteAlert (ABOUT_ALERT_ID, NULL); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8976 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8977 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8978 GetMenuItemText (GetMenuHandle (M_APPLE), menu_item, item_name); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8979 da_driver_refnum = OpenDeskAcc (item_name); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8980 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8981 #endif /* !TARGET_API_MAC_CARBON */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8982 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8983 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8984 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8985 do_menu_choice (SInt32 menu_choice) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8986 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8987 SInt16 menu_id, menu_item; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8988 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8989 menu_id = HiWord (menu_choice); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8990 menu_item = LoWord (menu_choice); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
8991 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8992 switch (menu_id) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8993 { |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8994 case 0: |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8995 break; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
8996 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8997 case M_APPLE: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8998 do_apple_menu (menu_item); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
8999 break; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9000 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9001 default: |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9002 { |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
9003 struct frame *f = mac_focus_frame (&one_mac_display_info); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9004 MenuHandle menu = GetMenuHandle (menu_id); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9005 if (menu) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9006 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9007 UInt32 refcon; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9008 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9009 GetMenuItemRefCon (menu, menu_item, &refcon); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9010 menubar_selection_callback (f, refcon); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9011 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9012 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9013 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9014 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9015 HiliteMenu (0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9016 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9017 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9018 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9019 /* Handle drags in size box. Based on code contributed by Ben |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9020 Mesander and IM - Window Manager A. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9021 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9022 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9023 do_grow_window (WindowPtr w, EventRecord *e) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9024 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9025 Rect limit_rect; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9026 int rows, columns, width, height; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
9027 struct frame *f = mac_window_to_frame (w); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9028 XSizeHints *size_hints = FRAME_SIZE_HINTS (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9029 int min_width = MIN_DOC_SIZE, min_height = MIN_DOC_SIZE; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9030 #if TARGET_API_MAC_CARBON |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9031 Rect new_rect; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9032 #else |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9033 long grow_size; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9034 #endif |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9035 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9036 if (size_hints->flags & PMinSize) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9037 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9038 min_width = size_hints->min_width; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9039 min_height = size_hints->min_height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9040 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9041 SetRect (&limit_rect, min_width, min_height, MAX_DOC_SIZE, MAX_DOC_SIZE); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9042 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9043 #if TARGET_API_MAC_CARBON |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9044 if (!ResizeWindow (w, e->where, &limit_rect, &new_rect)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9045 return; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9046 height = new_rect.bottom - new_rect.top; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9047 width = new_rect.right - new_rect.left; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9048 #else |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9049 grow_size = GrowWindow (w, e->where, &limit_rect); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9050 /* see if it really changed size */ |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9051 if (grow_size == 0) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9052 return; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9053 height = HiWord (grow_size); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9054 width = LoWord (grow_size); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9055 #endif |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9056 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9057 if (width != FRAME_PIXEL_WIDTH (f) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9058 || height != FRAME_PIXEL_HEIGHT (f)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9059 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9060 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9061 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9062 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9063 x_set_window_size (f, 0, columns, rows); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9064 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9065 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9066 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9067 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9068 /* Handle clicks in zoom box. Calculation of "standard state" based |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9069 on code in IM - Window Manager A and code contributed by Ben |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9070 Mesander. The standard state of an Emacs window is 80-characters |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9071 wide (DEFAULT_NUM_COLS) and as tall as will fit on the screen. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9072 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9073 static void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9074 do_zoom_window (WindowPtr w, int zoom_in_or_out) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9075 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9076 Rect zoom_rect, port_rect; |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9077 int columns, rows, width, height; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
9078 struct frame *f = mac_window_to_frame (w); |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
9079 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9080 #if TARGET_API_MAC_CARBON |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9081 Point standard_size; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9082 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9083 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9084 standard_size.v = dpyinfo->height; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9085 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9086 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9087 zoom_in_or_out = inZoomIn; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9088 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9089 { |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9090 /* Adjust the standard size according to character boundaries. */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9091 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9092 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9093 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9094 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9095 standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9096 GetWindowBounds (w, kWindowContentRgn, &port_rect); |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9097 if (IsWindowInStandardState (w, &standard_size, &zoom_rect) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9098 && port_rect.left == zoom_rect.left |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9099 && port_rect.top == zoom_rect.top) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9100 zoom_in_or_out = inZoomIn; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9101 else |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9102 zoom_in_or_out = inZoomOut; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9103 } |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9104 |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9105 ZoomWindowIdeal (w, zoom_in_or_out, &standard_size); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9106 #else /* not TARGET_API_MAC_CARBON */ |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9107 GrafPtr save_port; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9108 Point top_left; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9109 int w_title_height; |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
9110 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9111 GetPort (&save_port); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9112 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
9113 SetPortWindowPort (w); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9114 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9115 /* Clear window to avoid flicker. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9116 EraseRect (&(w->portRect)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9117 if (zoom_in_or_out == inZoomOut) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9118 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9119 SetPt (&top_left, w->portRect.left, w->portRect.top); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9120 LocalToGlobal (&top_left); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9121 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9122 /* calculate height of window's title bar */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9123 w_title_height = top_left.v - 1 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9124 - (**((WindowPeek) w)->strucRgn).rgnBBox.top + GetMBarHeight (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9125 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9126 /* get maximum height of window into zoom_rect.bottom - zoom_rect.top */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9127 zoom_rect = qd.screenBits.bounds; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9128 zoom_rect.top += w_title_height; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9129 InsetRect (&zoom_rect, 8, 4); /* not too tight */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9130 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9131 zoom_rect.right = zoom_rect.left |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
9132 + FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9133 |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9134 /* Adjust the standard size according to character boundaries. */ |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9135 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9136 zoom_rect.bottom = |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9137 zoom_rect.top + FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9138 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9139 (**((WStateDataHandle) ((WindowPeek) w)->dataHandle)).stdState |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9140 = zoom_rect; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9141 } |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9142 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
9143 ZoomWindow (w, zoom_in_or_out, f == mac_focus_frame (dpyinfo)); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9144 |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9145 SetPort (save_port); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9146 #endif /* not TARGET_API_MAC_CARBON */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9147 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9148 /* retrieve window size and update application values */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9149 #if TARGET_API_MAC_CARBON |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9150 GetWindowPortBounds (w, &port_rect); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9151 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9152 port_rect = w->portRect; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9153 #endif |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9154 height = port_rect.bottom - port_rect.top; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9155 width = port_rect.right - port_rect.left; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9156 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9157 if (width != FRAME_PIXEL_WIDTH (f) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9158 || height != FRAME_PIXEL_HEIGHT (f)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9159 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9160 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9161 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9162 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9163 change_frame_size (f, rows, columns, 0, 1, 0); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9164 SET_FRAME_GARBAGED (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9165 cancel_mouse_face (f); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9166 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9167 FRAME_PIXEL_WIDTH (f) = width; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9168 FRAME_PIXEL_HEIGHT (f) = height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9169 } |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
9170 x_real_positions (f, &f->left_pos, &f->top_pos); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9171 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9172 |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9173 void |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9174 mac_store_apple_event (class, id, desc) |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9175 Lisp_Object class, id; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9176 const AEDesc *desc; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9177 { |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9178 struct input_event buf; |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9179 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9180 EVENT_INIT (buf); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9181 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9182 buf.kind = MAC_APPLE_EVENT; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9183 buf.x = class; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9184 buf.y = id; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9185 XSETFRAME (buf.frame_or_window, |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9186 mac_focus_frame (&one_mac_display_info)); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9187 /* Now that Lisp object allocations are protected by BLOCK_INPUT, it |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9188 is safe to use them during read_socket_hook. */ |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9189 buf.arg = mac_aedesc_to_lisp (desc); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9190 kbd_buffer_store_event (&buf); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9191 } |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9192 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9193 #if TARGET_API_MAC_CARBON |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9194 static OSStatus |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9195 mac_store_event_ref_as_apple_event (class, id, class_key, id_key, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9196 event, num_params, names, types) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9197 AEEventClass class; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9198 AEEventID id; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9199 Lisp_Object class_key, id_key; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9200 EventRef event; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9201 UInt32 num_params; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9202 EventParamName *names; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9203 EventParamType *types; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9204 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9205 OSStatus err = eventNotHandledErr; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9206 Lisp_Object binding; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9207 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9208 mac_find_apple_event_spec (class, id, &class_key, &id_key, &binding); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9209 if (!NILP (binding) && !EQ (binding, Qundefined)) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9210 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9211 if (INTEGERP (binding)) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9212 err = XINT (binding); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9213 else |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9214 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9215 AppleEvent apple_event; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9216 err = create_apple_event_from_event_ref (event, num_params, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9217 names, types, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9218 &apple_event); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9219 if (err == noErr) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9220 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9221 mac_store_apple_event (class_key, id_key, &apple_event); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9222 AEDisposeDesc (&apple_event); |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9223 /* Post a harmless event so as to wake up from |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9224 ReceiveNextEvent. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9225 mac_post_mouse_moved_event (); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9226 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9227 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9228 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9229 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9230 return err; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9231 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9232 |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9233 void |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9234 mac_store_drag_event (window, mouse_pos, modifiers, desc) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9235 WindowRef window; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9236 Point mouse_pos; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9237 SInt16 modifiers; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9238 const AEDesc *desc; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9239 { |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9240 struct input_event buf; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9241 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9242 EVENT_INIT (buf); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9243 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9244 buf.kind = DRAG_N_DROP_EVENT; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9245 buf.modifiers = mac_to_emacs_modifiers (modifiers); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9246 buf.timestamp = TickCount () * (1000 / 60); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9247 XSETINT (buf.x, mouse_pos.h); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9248 XSETINT (buf.y, mouse_pos.v); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9249 XSETFRAME (buf.frame_or_window, mac_window_to_frame (window)); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9250 buf.arg = mac_aedesc_to_lisp (desc); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9251 kbd_buffer_store_event (&buf); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9252 } |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9253 #endif |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9254 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9255 #if USE_CARBON_EVENTS |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9256 static pascal OSStatus |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9257 mac_handle_command_event (next_handler, event, data) |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9258 EventHandlerCallRef next_handler; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9259 EventRef event; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9260 void *data; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9261 { |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9262 OSStatus result, err; |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9263 HICommand command; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9264 static EventParamName names[] = {kEventParamDirectObject, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9265 kEventParamKeyModifiers}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9266 static EventParamType types[] = {typeHICommand, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9267 typeUInt32}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9268 int num_params = sizeof (names) / sizeof (names[0]); |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9269 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9270 result = CallNextEventHandler (next_handler, event); |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9271 if (result != eventNotHandledErr) |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9272 return result; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9273 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9274 err = GetEventParameter (event, kEventParamDirectObject, typeHICommand, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9275 NULL, sizeof (HICommand), NULL, &command); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9276 |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9277 if (err != noErr || command.commandID == 0) |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9278 return eventNotHandledErr; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9279 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9280 /* A HICommand event is mapped to an Apple event whose event class |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9281 symbol is `hicommand' and event ID is its command ID. */ |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9282 err = mac_store_event_ref_as_apple_event (0, command.commandID, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9283 Qhicommand, Qnil, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9284 event, num_params, names, types); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9285 return err == noErr ? noErr : eventNotHandledErr; |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9286 } |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9287 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9288 static OSErr |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9289 init_command_handler () |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9290 { |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9291 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9292 static EventHandlerUPP handle_command_eventUPP = NULL; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9293 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9294 if (handle_command_eventUPP == NULL) |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9295 handle_command_eventUPP = NewEventHandlerUPP (mac_handle_command_event); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9296 return InstallApplicationEventHandler (handle_command_eventUPP, |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9297 GetEventTypeCount (specs), specs, |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9298 NULL, NULL); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9299 } |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9300 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9301 static pascal OSStatus |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9302 mac_handle_window_event (next_handler, event, data) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9303 EventHandlerCallRef next_handler; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9304 EventRef event; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9305 void *data; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9306 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9307 WindowPtr wp; |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9308 OSStatus result, err; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9309 UInt32 attributes; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9310 XSizeHints *size_hints; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9311 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9312 err = GetEventParameter (event, kEventParamDirectObject, typeWindowRef, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9313 NULL, sizeof (WindowPtr), NULL, &wp); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9314 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9315 return eventNotHandledErr; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9316 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9317 switch (GetEventKind (event)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9318 { |
59384
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9319 case kEventWindowUpdate: |
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9320 result = CallNextEventHandler (next_handler, event); |
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9321 if (result != eventNotHandledErr) |
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9322 return result; |
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9323 |
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9324 do_window_update (wp); |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
9325 return noErr; |
59384
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
9326 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9327 case kEventWindowBoundsChanging: |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9328 result = CallNextEventHandler (next_handler, event); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9329 if (result != eventNotHandledErr) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9330 return result; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9331 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9332 err = GetEventParameter (event, kEventParamAttributes, typeUInt32, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9333 NULL, sizeof (UInt32), NULL, &attributes); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9334 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9335 break; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9336 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9337 size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9338 if ((attributes & kWindowBoundsChangeUserResize) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9339 && ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9340 == (PResizeInc | PBaseSize | PMinSize))) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9341 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9342 Rect bounds; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9343 int width, height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9344 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9345 err = GetEventParameter (event, kEventParamCurrentBounds, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9346 typeQDRectangle, NULL, sizeof (Rect), |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9347 NULL, &bounds); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9348 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9349 break; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9350 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9351 width = bounds.right - bounds.left; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9352 height = bounds.bottom - bounds.top; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9353 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9354 if (width < size_hints->min_width) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9355 width = size_hints->min_width; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9356 else |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9357 width = size_hints->base_width |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9358 + (int) ((width - size_hints->base_width) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9359 / (float) size_hints->width_inc + .5) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9360 * size_hints->width_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9361 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9362 if (height < size_hints->min_height) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9363 height = size_hints->min_height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9364 else |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9365 height = size_hints->base_height |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9366 + (int) ((height - size_hints->base_height) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9367 / (float) size_hints->height_inc + .5) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9368 * size_hints->height_inc; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9369 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9370 bounds.right = bounds.left + width; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9371 bounds.bottom = bounds.top + height; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9372 SetEventParameter (event, kEventParamCurrentBounds, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9373 typeQDRectangle, sizeof (Rect), &bounds); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9374 return noErr; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9375 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9376 break; |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9377 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9378 case kEventWindowShown: |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9379 case kEventWindowHidden: |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9380 case kEventWindowExpanded: |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9381 case kEventWindowCollapsed: |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9382 result = CallNextEventHandler (next_handler, event); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9383 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9384 mac_handle_visibility_change (mac_window_to_frame (wp)); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9385 return noErr; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9386 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9387 break; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9388 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9389 #ifdef MAC_OSX |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9390 case kEventWindowToolbarSwitchMode: |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9391 result = CallNextEventHandler (next_handler, event); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9392 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9393 static EventParamName names[] = {kEventParamDirectObject, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9394 kEventParamWindowMouseLocation, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9395 kEventParamKeyModifiers, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9396 kEventParamMouseButton, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9397 kEventParamClickCount, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9398 kEventParamMouseChord}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9399 static EventParamType types[] = {typeWindowRef, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9400 typeQDPoint, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9401 typeUInt32, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9402 typeMouseButton, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9403 typeUInt32, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9404 typeUInt32}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9405 int num_params = sizeof (names) / sizeof (names[0]); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9406 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9407 err = mac_store_event_ref_as_apple_event (0, 0, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9408 Qwindow, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9409 Qtoolbar_switch_mode, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9410 event, num_params, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9411 names, types); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9412 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9413 return err == noErr ? noErr : result; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9414 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9415 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9416 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9417 case kEventWindowFocusAcquired: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9418 result = CallNextEventHandler (next_handler, event); |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
9419 err = mac_tsm_resume (); |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9420 return err == noErr ? noErr : result; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9421 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9422 case kEventWindowFocusRelinquish: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9423 result = CallNextEventHandler (next_handler, event); |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
9424 err = mac_tsm_suspend (); |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9425 return err == noErr ? noErr : result; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9426 #endif |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9427 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9428 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9429 return eventNotHandledErr; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9430 } |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9431 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9432 static pascal OSStatus |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9433 mac_handle_mouse_event (next_handler, event, data) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9434 EventHandlerCallRef next_handler; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9435 EventRef event; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9436 void *data; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9437 { |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9438 OSStatus result, err; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9439 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9440 switch (GetEventKind (event)) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9441 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9442 case kEventMouseWheelMoved: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9443 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9444 WindowPtr wp; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9445 struct frame *f; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9446 EventMouseWheelAxis axis; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9447 SInt32 delta; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9448 Point point; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9449 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9450 result = CallNextEventHandler (next_handler, event); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9451 if (result != eventNotHandledErr || read_socket_inev == NULL) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9452 return result; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9453 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9454 err = GetEventParameter (event, kEventParamWindowRef, typeWindowRef, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9455 NULL, sizeof (WindowRef), NULL, &wp); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9456 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9457 break; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9458 |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9459 f = mac_window_to_frame (wp); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9460 if (f != mac_focus_frame (&one_mac_display_info)) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9461 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9462 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9463 err = GetEventParameter (event, kEventParamMouseWheelAxis, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9464 typeMouseWheelAxis, NULL, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9465 sizeof (EventMouseWheelAxis), NULL, &axis); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9466 if (err != noErr || axis != kEventMouseWheelAxisY) |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9467 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9468 |
69301
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9469 err = GetEventParameter (event, kEventParamMouseWheelDelta, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9470 typeSInt32, NULL, sizeof (SInt32), |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9471 NULL, &delta); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9472 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9473 break; |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9474 err = GetEventParameter (event, kEventParamMouseLocation, |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9475 typeQDPoint, NULL, sizeof (Point), |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9476 NULL, &point); |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9477 if (err != noErr) |
9082ca3ebeed
(get_control_part_bounds): Fix type of return value.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69113
diff
changeset
|
9478 break; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9479 read_socket_inev->kind = WHEEL_EVENT; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9480 read_socket_inev->code = 0; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9481 read_socket_inev->modifiers = |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9482 (mac_event_to_emacs_modifiers (event) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9483 | ((delta < 0) ? down_modifier : up_modifier)); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9484 SetPortWindowPort (wp); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9485 GlobalToLocal (&point); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9486 XSETINT (read_socket_inev->x, point.h); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9487 XSETINT (read_socket_inev->y, point.v); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9488 XSETFRAME (read_socket_inev->frame_or_window, f); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9489 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9490 return noErr; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9491 } |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9492 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9493 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9494 default: |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9495 break; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9496 } |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9497 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9498 return eventNotHandledErr; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9499 } |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9500 |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9501 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9502 static pascal OSStatus |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9503 mac_handle_font_event (next_handler, event, data) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9504 EventHandlerCallRef next_handler; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9505 EventRef event; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9506 void *data; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9507 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9508 OSStatus result, err; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9509 Lisp_Object id_key; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9510 int num_params; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9511 EventParamName *names; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9512 EventParamType *types; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9513 static EventParamName names_sel[] = {kEventParamATSUFontID, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9514 kEventParamATSUFontSize, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9515 kEventParamFMFontFamily, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9516 kEventParamFMFontSize, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9517 kEventParamFontColor}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9518 static EventParamType types_sel[] = {typeATSUFontID, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9519 typeATSUSize, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9520 typeFMFontFamily, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9521 typeFMFontSize, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9522 typeFontColor}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9523 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9524 result = CallNextEventHandler (next_handler, event); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9525 if (result != eventNotHandledErr) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9526 return result; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9527 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9528 switch (GetEventKind (event)) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9529 { |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9530 case kEventFontPanelClosed: |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9531 id_key = Qpanel_closed; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9532 num_params = 0; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9533 names = NULL; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9534 types = NULL; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9535 break; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9536 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9537 case kEventFontSelection: |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9538 id_key = Qselection; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9539 num_params = sizeof (names_sel) / sizeof (names_sel[0]); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9540 names = names_sel; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9541 types = types_sel; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9542 break; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9543 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9544 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9545 err = mac_store_event_ref_as_apple_event (0, 0, Qfont, id_key, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9546 event, num_params, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9547 names, types); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9548 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9549 return err == noErr ? noErr : eventNotHandledErr; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9550 } |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9551 #endif |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9552 |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9553 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9554 static pascal OSStatus |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9555 mac_handle_text_input_event (next_handler, event, data) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9556 EventHandlerCallRef next_handler; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9557 EventRef event; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9558 void *data; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9559 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9560 OSStatus result, err = noErr; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9561 Lisp_Object id_key = Qnil; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9562 int num_params; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9563 EventParamName *names; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9564 EventParamType *types; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9565 static UInt32 seqno_uaia = 0; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9566 static EventParamName names_uaia[] = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9567 {kEventParamTextInputSendComponentInstance, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9568 kEventParamTextInputSendRefCon, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9569 kEventParamTextInputSendSLRec, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9570 kEventParamTextInputSendFixLen, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9571 kEventParamTextInputSendText, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9572 kEventParamTextInputSendUpdateRng, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9573 kEventParamTextInputSendHiliteRng, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9574 kEventParamTextInputSendClauseRng, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9575 kEventParamTextInputSendPinRng, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9576 kEventParamTextInputSendTextServiceEncoding, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9577 kEventParamTextInputSendTextServiceMacEncoding, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9578 EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9579 static EventParamType types_uaia[] = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9580 {typeComponentInstance, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9581 typeLongInteger, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9582 typeIntlWritingCode, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9583 typeLongInteger, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9584 typeUnicodeText, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9585 typeTextRangeArray, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9586 typeTextRangeArray, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9587 typeOffsetArray, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9588 typeTextRange, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9589 typeUInt32, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9590 typeUInt32, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9591 typeUInt32}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9592 static EventParamName names_ufke[] = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9593 {kEventParamTextInputSendComponentInstance, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9594 kEventParamTextInputSendRefCon, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9595 kEventParamTextInputSendSLRec, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9596 kEventParamTextInputSendText}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9597 static EventParamType types_ufke[] = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9598 {typeComponentInstance, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9599 typeLongInteger, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9600 typeIntlWritingCode, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9601 typeUnicodeText}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9602 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9603 result = CallNextEventHandler (next_handler, event); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9604 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9605 switch (GetEventKind (event)) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9606 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9607 case kEventTextInputUpdateActiveInputArea: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9608 id_key = Qupdate_active_input_area; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9609 num_params = sizeof (names_uaia) / sizeof (names_uaia[0]); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9610 names = names_uaia; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9611 types = types_uaia; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9612 SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9613 typeUInt32, sizeof (UInt32), &seqno_uaia); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9614 seqno_uaia++; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9615 break; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9616 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9617 case kEventTextInputUnicodeForKeyEvent: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9618 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9619 EventRef kbd_event; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9620 UInt32 actual_size, modifiers, mapped_modifiers; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9621 UniChar code; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9622 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9623 err = GetEventParameter (event, kEventParamTextInputSendKeyboardEvent, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9624 typeEventRef, NULL, sizeof (EventRef), NULL, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9625 &kbd_event); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9626 if (err == noErr) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9627 err = GetEventParameter (kbd_event, kEventParamKeyModifiers, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9628 typeUInt32, NULL, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9629 sizeof (UInt32), NULL, &modifiers); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9630 if (err == noErr) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9631 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9632 mapped_modifiers = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9633 (NILP (Vmac_control_modifier) ? 0 : controlKey) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9634 | (NILP (Vmac_option_modifier) ? 0 : optionKey) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9635 | (NILP (Vmac_command_modifier) ? 0 : cmdKey); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9636 #ifdef MAC_OSX |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9637 mapped_modifiers |= |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9638 (NILP (Vmac_function_modifier) ? 0 : kEventKeyModifierFnMask); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9639 #endif |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9640 if (modifiers & mapped_modifiers) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9641 /* There're mapped modifier keys. Process it in |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9642 XTread_socket. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9643 return eventNotHandledErr; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9644 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9645 if (err == noErr) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9646 err = GetEventParameter (kbd_event, kEventParamKeyUnicodes, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9647 typeUnicodeText, NULL, 0, &actual_size, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9648 NULL); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9649 if (err == noErr) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9650 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9651 if (actual_size == sizeof (UniChar)) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9652 err = GetEventParameter (kbd_event, kEventParamKeyUnicodes, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9653 typeUnicodeText, NULL, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9654 sizeof (UniChar), NULL, &code); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9655 if (err == noErr && code < 0x80) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9656 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9657 /* ASCII character. Process it in XTread_socket. */ |
71241
11061a67f09a
[USE_MAC_TSM] (mac_handle_text_input_event): Exclude 0x7f from ASCII range.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71178
diff
changeset
|
9658 if (read_socket_inev && code >= 0x20 && code <= 0x7e) |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9659 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9660 struct frame *f = mac_focus_frame (&one_mac_display_info); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9661 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9662 read_socket_inev->kind = ASCII_KEYSTROKE_EVENT; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9663 read_socket_inev->code = code; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9664 read_socket_inev->modifiers = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9665 (extra_keyboard_modifiers |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9666 & (meta_modifier | alt_modifier |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9667 | hyper_modifier | super_modifier)); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9668 XSETFRAME (read_socket_inev->frame_or_window, f); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9669 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9670 return eventNotHandledErr; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9671 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9672 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9673 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9674 /* Non-ASCII keystrokes without mapped modifiers are processed |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9675 at the Lisp level. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9676 id_key = Qunicode_for_key_event; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9677 num_params = sizeof (names_ufke) / sizeof (names_ufke[0]); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9678 names = names_ufke; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9679 types = types_ufke; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9680 break; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9681 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9682 case kEventTextInputOffsetToPos: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9683 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9684 struct frame *f; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9685 struct window *w; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9686 Point p; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9687 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9688 if (!OVERLAYP (Vmac_ts_active_input_overlay)) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9689 return eventNotHandledErr; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9690 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9691 /* Strictly speaking, this is not always correct because |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9692 previous events may change some states about display. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9693 if (NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string))) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9694 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9695 /* Active input area is displayed in the echo area. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9696 w = XWINDOW (echo_area_window); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9697 f = WINDOW_XFRAME (w); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9698 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9699 else |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9700 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9701 /* Active input area is displayed around the current point. */ |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9702 f = SELECTED_FRAME (); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9703 w = XWINDOW (f->selected_window); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9704 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9705 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9706 p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9707 + WINDOW_LEFT_FRINGE_WIDTH (w)); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9708 p.v = (WINDOW_TO_FRAME_PIXEL_Y (w, w->cursor.y) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9709 + FONT_BASE (FRAME_FONT (f))); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9710 SetPortWindowPort (FRAME_MAC_WINDOW (f)); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9711 LocalToGlobal (&p); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9712 err = SetEventParameter (event, kEventParamTextInputReplyPoint, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9713 typeQDPoint, sizeof (typeQDPoint), &p); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9714 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9715 break; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9716 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9717 default: |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9718 abort (); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9719 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9720 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9721 if (!NILP (id_key)) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9722 err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9723 event, num_params, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9724 names, types); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9725 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9726 return err == noErr ? noErr : result; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9727 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9728 #endif |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9729 |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9730 #ifdef MAC_OSX |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9731 OSStatus |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
9732 mac_store_service_event (event) |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9733 EventRef event; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9734 { |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9735 OSStatus err; |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9736 Lisp_Object id_key; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9737 int num_params; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9738 EventParamName *names; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9739 EventParamType *types; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9740 static EventParamName names_pfm[] = {kEventParamServiceMessageName, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9741 kEventParamServiceUserData}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9742 static EventParamType types_pfm[] = {typeCFStringRef, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9743 typeCFStringRef}; |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9744 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9745 switch (GetEventKind (event)) |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9746 { |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9747 case kEventServicePaste: |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9748 id_key = Qpaste; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9749 num_params = 0; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9750 names = NULL; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9751 types = NULL; |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9752 break; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9753 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9754 case kEventServicePerform: |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9755 id_key = Qperform; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9756 num_params = sizeof (names_pfm) / sizeof (names_pfm[0]); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9757 names = names_pfm; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9758 types = types_pfm; |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9759 break; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9760 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9761 default: |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9762 abort (); |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9763 } |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9764 |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
9765 err = mac_store_event_ref_as_apple_event (0, 0, Qservice, id_key, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9766 event, num_params, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9767 names, types); |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9768 |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9769 return err; |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9770 } |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9771 #endif /* MAC_OSX */ |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9772 #endif /* USE_CARBON_EVENTS */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9773 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9774 |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
9775 OSErr |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9776 install_window_handler (window) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9777 WindowPtr window; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9778 { |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
9779 OSErr err = noErr; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9780 #if USE_CARBON_EVENTS |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9781 EventTypeSpec specs_window[] = |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9782 {{kEventClassWindow, kEventWindowUpdate}, |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9783 {kEventClassWindow, kEventWindowBoundsChanging}, |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9784 {kEventClassWindow, kEventWindowShown}, |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9785 {kEventClassWindow, kEventWindowHidden}, |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
9786 {kEventClassWindow, kEventWindowExpanded}, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9787 {kEventClassWindow, kEventWindowCollapsed}, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9788 #ifdef MAC_OSX |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9789 {kEventClassWindow, kEventWindowToolbarSwitchMode}, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9790 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9791 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9792 {kEventClassWindow, kEventWindowFocusAcquired}, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9793 {kEventClassWindow, kEventWindowFocusRelinquish}, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9794 #endif |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9795 }; |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9796 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9797 static EventHandlerUPP handle_window_eventUPP = NULL; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9798 static EventHandlerUPP handle_mouse_eventUPP = NULL; |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9799 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9800 EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed}, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9801 {kEventClassFont, kEventFontSelection}}; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9802 static EventHandlerUPP handle_font_eventUPP = NULL; |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9803 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9804 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9805 EventTypeSpec specs_text_input[] = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9806 {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea}, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9807 {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9808 {kEventClassTextInput, kEventTextInputOffsetToPos}}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9809 static EventHandlerUPP handle_text_input_eventUPP = NULL; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9810 #endif |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9811 |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9812 if (handle_window_eventUPP == NULL) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9813 handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9814 if (handle_mouse_eventUPP == NULL) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9815 handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9816 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9817 if (handle_font_eventUPP == NULL) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9818 handle_font_eventUPP = NewEventHandlerUPP (mac_handle_font_event); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9819 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9820 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9821 if (handle_text_input_eventUPP == NULL) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9822 handle_text_input_eventUPP = |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9823 NewEventHandlerUPP (mac_handle_text_input_event); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9824 #endif |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9825 err = InstallWindowEventHandler (window, handle_window_eventUPP, |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9826 GetEventTypeCount (specs_window), |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9827 specs_window, NULL, NULL); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9828 if (err == noErr) |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9829 err = InstallWindowEventHandler (window, handle_mouse_eventUPP, |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9830 GetEventTypeCount (specs_mouse), |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
9831 specs_mouse, NULL, NULL); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9832 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9833 if (err == noErr) |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9834 err = InstallWindowEventHandler (window, handle_font_eventUPP, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9835 GetEventTypeCount (specs_font), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9836 specs_font, NULL, NULL); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
9837 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9838 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9839 if (err == noErr) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9840 err = InstallWindowEventHandler (window, handle_text_input_eventUPP, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9841 GetEventTypeCount (specs_text_input), |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9842 specs_text_input, window, NULL); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9843 #endif |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
9844 #endif |
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
9845 if (err == noErr) |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9846 err = install_drag_handler (window); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9847 |
59189
60ffced08532
* term/mac-win.el: Require x-dnd.
Steven Tamm <steventamm@mac.com>
parents:
59146
diff
changeset
|
9848 return err; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9849 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
9850 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
9851 void |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
9852 remove_window_handler (window) |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
9853 WindowPtr window; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
9854 { |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9855 remove_drag_handler (window); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
9856 } |
46798 | 9857 |
9858 | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9859 #if __profile__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9860 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9861 profiler_exit_proc () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9862 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9863 ProfilerDump ("\pEmacs.prof"); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9864 ProfilerTerm (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9865 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9866 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9867 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9868 /* These few functions implement Emacs as a normal Mac application |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9869 (almost): set up the heap and the Toolbox, handle necessary system |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9870 events plus a few simple menu events. They also set up Emacs's |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9871 access to functions defined in the rest of this file. Emacs uses |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9872 function hooks to perform all its terminal I/O. A complete list of |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9873 these functions appear in termhooks.h. For what they do, read the |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9874 comments there and see also w32term.c and xterm.c. What's |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9875 noticeably missing here is the event loop, which is normally |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9876 present in most Mac application. After performing the necessary |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9877 Mac initializations, main passes off control to emacs_main |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9878 (corresponding to main in emacs.c). Emacs_main calls XTread_socket |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9879 (defined further below) to read input. This is where |
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
9880 WaitNextEvent/ReceiveNextEvent is called to process Mac events. */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9881 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
9882 #ifdef MAC_OS8 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9883 #undef main |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9884 int |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9885 main (void) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9886 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9887 #if __profile__ /* is the profiler on? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9888 if (ProfilerInit(collectDetailed, bestTimeBase, 5000, 200)) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9889 exit(1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9890 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9891 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9892 #if __MWERKS__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9893 /* set creator and type for files created by MSL */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9894 _fcreator = 'EMAx'; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9895 _ftype = 'TEXT'; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9896 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9897 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9898 do_init_managers (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9899 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9900 do_get_menus (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9901 |
53651
c7d570b7ba42
(main) [USE_LSB_TAG]: Don't range check the ram.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53606
diff
changeset
|
9902 #ifndef USE_LSB_TAG |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9903 do_check_ram_size (); |
53651
c7d570b7ba42
(main) [USE_LSB_TAG]: Don't range check the ram.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53606
diff
changeset
|
9904 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9905 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9906 init_emacs_passwd_dir (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9907 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9908 init_environ (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9909 |
67788
114d965dfb60
Don't include sys/param.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67733
diff
changeset
|
9910 init_coercion_handler (); |
114d965dfb60
Don't include sys/param.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67733
diff
changeset
|
9911 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9912 initialize_applescript (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9913 |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
9914 init_apple_event_handler (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9915 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9916 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9917 char **argv; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9918 int argc = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9919 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9920 /* set up argv array from STR# resource */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9921 get_string_list (&argv, ARGV_STRING_LIST_ID); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9922 while (argv[argc]) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9923 argc++; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9924 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9925 /* free up AppleScript resources on exit */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9926 atexit (terminate_applescript); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9927 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9928 #if __profile__ /* is the profiler on? */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9929 atexit (profiler_exit_proc); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9930 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9931 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9932 /* 3rd param "envp" never used in emacs_main */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9933 (void) emacs_main (argc, argv, 0); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9934 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9935 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9936 /* Never reached - real exit in Fkill_emacs */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9937 return 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9938 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9939 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9940 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9941 /* Table for translating Mac keycode to X keysym values. Contributed |
60611
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9942 by Sudhir Shenoy. |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9943 Mapping for special keys is now identical to that in Apple X11 |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9944 except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>) |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9945 on the right of the Cmd key on laptops, and fn + `enter' (-> |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9946 <linefeed>). */ |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9947 static unsigned char keycode_to_xkeysym_table[] = { |
49504
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9948 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9949 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9950 /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9951 |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9952 /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/, |
60611
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9953 /*0x34*/ 0x8d /*enter on laptops*/, 0x1b /*escape*/, 0, 0, |
49504
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9954 /*0x38*/ 0, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9955 /*0x3C*/ 0, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9956 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9957 /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/, |
60611
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9958 /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x0b /*clear*/, |
49504
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9959 /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9960 /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9961 |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9962 /*0x50*/ 0, 0xbd /*kp-=*/, 0xb0 /*kp-0*/, 0xb1 /*kp-1*/, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9963 /*0x54*/ 0xb2 /*kp-2*/, 0xb3 /*kp-3*/, 0xb4 /*kp-4*/, 0xb5 /*kp-5*/, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9964 /*0x58*/ 0xb6 /*kp-6*/, 0xb7 /*kp-7*/, 0, 0xb8 /*kp-8*/, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9965 /*0x5C*/ 0xb9 /*kp-9*/, 0, 0, 0, |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9966 |
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9967 /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
9968 /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/, |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
9969 /*0x68*/ 0, 0xca /*f13*/, 0xcd /*f16*/, 0xcb /*f14*/, |
60611
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9970 /*0x6C*/ 0, 0xc7 /*f10*/, 0x0a /*fn+enter on laptops*/, 0xc9 /*f12*/, |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9971 |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9972 /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/, |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9973 /*0x74*/ 0x55 /*pgup*/, 0xff /*delete*/, 0xc1 /*f4*/, 0x57 /*end*/, |
4536f307a219
(keycode_to_xkeysym_table): Change mapping so that it coincide with
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60364
diff
changeset
|
9974 /*0x78*/ 0xbf /*f2*/, 0x56 /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/, |
49504
0ffb4e489776
2003-01-28 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Andrew Choi <akochoi@shaw.ca>
parents:
49346
diff
changeset
|
9975 /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9976 }; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9977 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9978 |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
9979 static int |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9980 keycode_to_xkeysym (int keyCode, int *xKeySym) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9981 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9982 *xKeySym = keycode_to_xkeysym_table [keyCode & 0x7f]; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9983 return *xKeySym != 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9984 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
9985 |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
9986 #ifdef MAC_OSX |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
9987 /* Table for translating Mac keycode with the laptop `fn' key to that |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
9988 without it. Destination symbols in comments are keys on US |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
9989 keyboard, and they may not be the same on other types of keyboards. |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
9990 If the destination is identical to the source (f1 ... f12), it |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
9991 doesn't map `fn' key to a modifier. */ |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
9992 static unsigned char fn_keycode_to_keycode_table[] = { |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9993 /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9994 /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9995 /*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9996 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9997 /*0x30*/ 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9998 /*0x34*/ 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
9999 /*0x38*/ 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10000 /*0x3C*/ 0, 0, 0, 0, |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10001 |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10002 /*0x40*/ 0, 0x2f /*kp-. -> '.'*/, 0, 0x23 /*kp-* -> 'p'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10003 /*0x44*/ 0, 0x2c /*kp-+ -> '/'*/, 0, 0x16 /*clear -> '6'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10004 /*0x48*/ 0, 0, 0, 0x1d /*kp-/ -> '0'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10005 /*0x4C*/ 0x24 /*kp-enter -> return*/, 0, 0x29 /*kp-- -> ';'*/, 0, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10006 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10007 /*0x50*/ 0, 0x1b /*kp-= -> '-'*/, 0x2e /*kp-0 -> 'm'*/, 0x26 /*kp-1 -> 'j'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10008 /*0x54*/ 0x28 /*kp-2 -> 'k'*/, 0x25 /*kp-3 -> 'l'*/, 0x20 /*kp-4 -> 'u'*/, 0x22 /*kp-5 ->'i'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10009 /*0x58*/ 0x1f /*kp-6 -> 'o'*/, 0x1a /*kp-7 -> '7'*/, 0, 0x1c /*kp-8 -> '8'*/, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10010 /*0x5C*/ 0x19 /*kp-9 -> '9'*/, 0, 0, 0, |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10011 |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10012 /*0x60*/ 0x60 /*f5 = f5*/, 0x61 /*f6 = f6*/, 0x62 /*f7 = f7*/, 0x63 /*f3 = f3*/, |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10013 /*0x64*/ 0x64 /*f8 = f8*/, 0x65 /*f9 = f9*/, 0, 0x67 /*f11 = f11*/, |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10014 /*0x68*/ 0, 0, 0, 0, |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10015 /*0x6C*/ 0, 0x6d /*f10 = f10*/, 0, 0x6f /*f12 = f12*/, |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10016 |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10017 /*0x70*/ 0, 0, 0, 0x7b /*home -> left*/, |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10018 /*0x74*/ 0x7e /*pgup -> up*/, 0x33 /*delete -> backspace*/, 0x76 /*f4 = f4*/, 0x7c /*end -> right*/, |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10019 /*0x78*/ 0x78 /*f2 = f2*/, 0x7d /*pgdown -> down*/, 0x7a /*f1 = f1*/, 0, |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10020 /*0x7C*/ 0, 0, 0, 0 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10021 }; |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10022 #endif /* MAC_OSX */ |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
10023 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10024 #if !USE_CARBON_EVENTS |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10025 static RgnHandle mouse_region = NULL; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10026 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10027 Boolean |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10028 mac_wait_next_event (er, sleep_time, dequeue) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10029 EventRecord *er; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10030 UInt32 sleep_time; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10031 Boolean dequeue; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10032 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10033 static EventRecord er_buf = {nullEvent}; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10034 UInt32 target_tick, current_tick; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10035 EventMask event_mask; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10036 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10037 if (mouse_region == NULL) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10038 mouse_region = NewRgn (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10039 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10040 event_mask = everyEvent; |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
10041 if (!mac_ready_for_apple_events) |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10042 event_mask -= highLevelEventMask; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10043 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10044 current_tick = TickCount (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10045 target_tick = current_tick + sleep_time; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10046 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10047 if (er_buf.what == nullEvent) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10048 while (!WaitNextEvent (event_mask, &er_buf, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10049 target_tick - current_tick, mouse_region)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10050 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10051 current_tick = TickCount (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10052 if (target_tick <= current_tick) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10053 return false; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10054 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10055 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10056 *er = er_buf; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10057 if (dequeue) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10058 er_buf.what = nullEvent; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10059 return true; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10060 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10061 #endif /* not USE_CARBON_EVENTS */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10062 |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10063 #if TARGET_API_MAC_CARBON |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10064 OSStatus |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10065 mac_post_mouse_moved_event () |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10066 { |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10067 EventRef event = NULL; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10068 OSStatus err; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10069 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10070 err = CreateEvent (NULL, kEventClassMouse, kEventMouseMoved, 0, |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10071 kEventAttributeNone, &event); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10072 if (err == noErr) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10073 { |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10074 Point mouse_pos; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10075 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10076 GetMouse (&mouse_pos); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10077 LocalToGlobal (&mouse_pos); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10078 err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint, |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10079 sizeof (Point), &mouse_pos); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10080 } |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10081 if (err == noErr) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10082 { |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10083 UInt32 modifiers = GetCurrentKeyModifiers (); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10084 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10085 err = SetEventParameter (event, kEventParamKeyModifiers, typeUInt32, |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10086 sizeof (UInt32), &modifiers); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10087 } |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10088 if (err == noErr) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10089 err = PostEventToQueue (GetCurrentEventQueue (), event, |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10090 kEventPriorityStandard); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10091 if (event) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10092 ReleaseEvent (event); |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10093 |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10094 return err; |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10095 } |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10096 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10097 static void |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10098 mac_set_unicode_keystroke_event (code, buf) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10099 UniChar code; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10100 struct input_event *buf; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10101 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10102 int charset_id, c1, c2; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10103 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10104 if (code < 0x80) |
90456
fcea7075c583
(mac_set_unicode_keystroke_event): Don't use MAKE_CHAR.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90428
diff
changeset
|
10105 buf->kind = ASCII_KEYSTROKE_EVENT; |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10106 else |
90456
fcea7075c583
(mac_set_unicode_keystroke_event): Don't use MAKE_CHAR.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90428
diff
changeset
|
10107 buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT; |
fcea7075c583
(mac_set_unicode_keystroke_event): Don't use MAKE_CHAR.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
90428
diff
changeset
|
10108 buf->code = code; |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10109 } |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10110 #endif |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10111 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10112 /* Emacs calls this whenever it wants to read an input event from the |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10113 user. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10114 int |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10115 XTread_socket (sd, expected, hold_quit) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10116 int sd, expected; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10117 struct input_event *hold_quit; |
54165
88d1b7a60637
(XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents:
54150
diff
changeset
|
10118 { |
88d1b7a60637
(XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg.
Kim F. Storm <storm@cua.dk>
parents:
54150
diff
changeset
|
10119 struct input_event inev; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10120 int count = 0; |
46798 | 10121 #if USE_CARBON_EVENTS |
10122 EventRef eventRef; | |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10123 EventTargetRef toolbox_dispatcher; |
46798 | 10124 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10125 EventRecord er; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10126 struct mac_display_info *dpyinfo = &one_mac_display_info; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10127 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10128 if (interrupt_input_blocked) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10129 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10130 interrupt_input_pending = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10131 return -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10132 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10133 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10134 interrupt_input_pending = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10135 BLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10136 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10137 /* So people can tell when we have read the available input. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10138 input_signal_count++; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10139 |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
10140 ++handling_signal; |
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
10141 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10142 #if USE_CARBON_EVENTS |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10143 toolbox_dispatcher = GetEventDispatcherTarget (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10144 |
69433
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
10145 while ( |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
10146 #if USE_CG_DRAWING |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
10147 mac_prepare_for_quickdraw (NULL), |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
10148 #endif |
a8fd29f179b0
(mac_draw_rectangle, x_draw_glyph_string_foreground)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69369
diff
changeset
|
10149 !ReceiveNextEvent (0, NULL, kEventDurationNoWait, |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10150 kEventRemoveFromQueue, &eventRef)) |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10151 #else /* !USE_CARBON_EVENTS */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10152 while (mac_wait_next_event (&er, 0, true)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10153 #endif /* !USE_CARBON_EVENTS */ |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10154 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10155 int do_help = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10156 struct frame *f; |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10157 unsigned long timestamp; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10158 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10159 EVENT_INIT (inev); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10160 inev.kind = NO_EVENT; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10161 inev.arg = Qnil; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10162 |
46798 | 10163 #if USE_CARBON_EVENTS |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10164 timestamp = GetEventTime (eventRef) / kEventDurationMillisecond; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10165 #else |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10166 timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10167 #endif |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10168 |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10169 #if USE_CARBON_EVENTS |
46798 | 10170 /* Handle new events */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10171 if (!mac_convert_event_ref (eventRef, &er)) |
63461
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10172 { |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10173 /* There used to be a handler for the kEventMouseWheelMoved |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10174 event here. But as of Mac OS X 10.4, this kind of event |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10175 is not directly posted to the main event queue by |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10176 two-finger scrolling on the trackpad. Instead, some |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10177 private event is posted and it is converted to a wheel |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10178 event by the default handler for the application target. |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10179 The converted one can be received by a Carbon event |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10180 handler installed on a window target. */ |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10181 read_socket_inev = &inev; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10182 SendEventToEventTarget (eventRef, toolbox_dispatcher); |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10183 read_socket_inev = NULL; |
8aa0953a6870
(mac_compute_glyph_string_overhangs): Don't set
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
63098
diff
changeset
|
10184 } |
46798 | 10185 else |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10186 #endif /* USE_CARBON_EVENTS */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10187 switch (er.what) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10188 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10189 case mouseDown: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10190 case mouseUp: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10191 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10192 WindowPtr window_ptr; |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
10193 ControlPartCode part_code; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10194 int tool_bar_p = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10195 |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10196 #if USE_CARBON_EVENTS |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10197 /* This is needed to send mouse events like aqua window |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10198 buttons to the correct handler. */ |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10199 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10200 != eventNotHandledErr) |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10201 break; |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10202 #endif |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
10203 last_mouse_glyph_frame = 0; |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10204 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10205 if (dpyinfo->grabbed && last_mouse_frame |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10206 && FRAME_LIVE_P (last_mouse_frame)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10207 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10208 window_ptr = FRAME_MAC_WINDOW (last_mouse_frame); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10209 part_code = inContent; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10210 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10211 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10212 { |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10213 part_code = FindWindow (er.where, &window_ptr); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10214 if (tip_window && window_ptr == tip_window) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10215 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10216 HideWindow (tip_window); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10217 part_code = FindWindow (er.where, &window_ptr); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10218 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10219 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10220 |
66181
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10221 if (er.what != mouseDown && |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10222 (part_code != inContent || dpyinfo->grabbed == 0)) |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10223 break; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10224 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10225 switch (part_code) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10226 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10227 case inMenuBar: |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10228 f = mac_focus_frame (dpyinfo); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10229 saved_menu_event_location = er.where; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10230 inev.kind = MENU_BAR_ACTIVATE_EVENT; |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10231 XSETFRAME (inev.frame_or_window, f); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10232 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10233 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10234 case inContent: |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10235 if ( |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10236 #if TARGET_API_MAC_CARBON |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10237 FrontNonFloatingWindow () |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10238 #else |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10239 FrontWindow () |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10240 #endif |
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
10241 != window_ptr) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10242 SelectWindow (window_ptr); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10243 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10244 { |
62281
9df01a686e3c
[USE_TOOLKIT_SCROLL_BARS] (get_control_part_bounds):
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
62103
diff
changeset
|
10245 ControlPartCode control_part_code; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10246 ControlHandle ch; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10247 Point mouse_loc = er.where; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10248 #ifdef MAC_OSX |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10249 ControlKind control_kind; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10250 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10251 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10252 f = mac_window_to_frame (window_ptr); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10253 /* convert to local coordinates of new window */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10254 SetPortWindowPort (window_ptr); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10255 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10256 GlobalToLocal (&mouse_loc); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10257 #if TARGET_API_MAC_CARBON |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10258 ch = FindControlUnderMouse (mouse_loc, window_ptr, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10259 &control_part_code); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10260 #ifdef MAC_OSX |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10261 if (ch) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10262 GetControlKind (ch, &control_kind); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10263 #endif |
46798 | 10264 #else |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10265 control_part_code = FindControl (mouse_loc, window_ptr, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10266 &ch); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10267 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10268 |
46798 | 10269 #if USE_CARBON_EVENTS |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10270 inev.code = mac_get_mouse_btn (eventRef); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10271 inev.modifiers = mac_event_to_emacs_modifiers (eventRef); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10272 #else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10273 inev.code = mac_get_emulated_btn (er.modifiers); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10274 inev.modifiers = mac_to_emacs_modifiers (er.modifiers); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10275 #endif |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10276 XSETINT (inev.x, mouse_loc.h); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10277 XSETINT (inev.y, mouse_loc.v); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10278 |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10279 if ((dpyinfo->grabbed && tracked_scroll_bar) |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10280 || (ch != 0 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10281 #ifndef USE_TOOLKIT_SCROLL_BARS |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10282 /* control_part_code becomes kControlNoPart if |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10283 a progress indicator is clicked. */ |
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10284 && control_part_code != kControlNoPart |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10285 #else /* USE_TOOLKIT_SCROLL_BARS */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10286 #ifdef MAC_OSX |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10287 && control_kind.kind == kControlKindScrollBar |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10288 #endif /* MAC_OSX */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10289 #endif /* USE_TOOLKIT_SCROLL_BARS */ |
69964
321089786c7b
Don't include gnu.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69773
diff
changeset
|
10290 )) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10291 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10292 struct scroll_bar *bar; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10293 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10294 if (dpyinfo->grabbed && tracked_scroll_bar) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10295 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10296 bar = tracked_scroll_bar; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10297 #ifndef USE_TOOLKIT_SCROLL_BARS |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10298 control_part_code = kControlIndicatorPart; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10299 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10300 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10301 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10302 bar = (struct scroll_bar *) GetControlReference (ch); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10303 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10304 /* Make the "Ctrl-Mouse-2 splits window" work |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10305 for toolkit scroll bars. */ |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10306 if (er.modifiers & controlKey) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10307 x_scroll_bar_handle_click (bar, control_part_code, |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10308 &er, &inev); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10309 else if (er.what == mouseDown) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10310 x_scroll_bar_handle_press (bar, control_part_code, |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10311 &inev); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10312 else |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10313 x_scroll_bar_handle_release (bar, &inev); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10314 #else /* not USE_TOOLKIT_SCROLL_BARS */ |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10315 x_scroll_bar_handle_click (bar, control_part_code, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10316 &er, &inev); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10317 if (er.what == mouseDown |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10318 && control_part_code == kControlIndicatorPart) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10319 tracked_scroll_bar = bar; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10320 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10321 tracked_scroll_bar = NULL; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10322 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10323 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10324 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10325 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10326 Lisp_Object window; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10327 int x = mouse_loc.h; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10328 int y = mouse_loc.v; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10329 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10330 window = window_from_coordinates (f, x, y, 0, 0, 0, 1); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10331 if (EQ (window, f->tool_bar_window)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10332 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10333 if (er.what == mouseDown) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10334 handle_tool_bar_click (f, x, y, 1, 0); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10335 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10336 handle_tool_bar_click (f, x, y, 0, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10337 inev.modifiers); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10338 tool_bar_p = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10339 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10340 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10341 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10342 XSETFRAME (inev.frame_or_window, f); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10343 inev.kind = MOUSE_CLICK_EVENT; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10344 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10345 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10346 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10347 if (er.what == mouseDown) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10348 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10349 dpyinfo->grabbed |= (1 << inev.code); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10350 last_mouse_frame = f; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10351 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10352 if (!tool_bar_p) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10353 last_tool_bar_item = -1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10354 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10355 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10356 { |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10357 if ((dpyinfo->grabbed & (1 << inev.code)) == 0) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10358 /* If a button is released though it was not |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10359 previously pressed, that would be because |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10360 of multi-button emulation. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10361 dpyinfo->grabbed = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10362 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10363 dpyinfo->grabbed &= ~(1 << inev.code); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10364 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10365 |
66181
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10366 /* Ignore any mouse motion that happened before |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10367 this event; any subsequent mouse-movement Emacs |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10368 events should reflect only motion after the |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10369 ButtonPress. */ |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10370 if (f != 0) |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10371 f->mouse_moved = 0; |
dc3ff6945eb2
(note_mouse_movement): Use PtInRect.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66110
diff
changeset
|
10372 |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10373 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10374 if (inev.kind == MOUSE_CLICK_EVENT) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10375 #endif |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10376 switch (er.what) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10377 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10378 case mouseDown: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10379 inev.modifiers |= down_modifier; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10380 break; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10381 case mouseUp: |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10382 inev.modifiers |= up_modifier; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10383 break; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10384 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10385 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10386 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10387 |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10388 case inDrag: |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10389 #if TARGET_API_MAC_CARBON |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10390 case inProxyIcon: |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10391 if (IsWindowPathSelectClick (window_ptr, &er)) |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10392 { |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10393 WindowPathSelect (window_ptr, NULL, NULL); |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10394 break; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
10395 } |
70384
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10396 if (part_code == inProxyIcon |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10397 && (TrackWindowProxyDrag (window_ptr, er.where) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10398 != errUserWantsToDragWindow)) |
a5899b40fd69
(XTread_socket) [TARGET_API_MAC_CARBON]: Try window
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70304
diff
changeset
|
10399 break; |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10400 DragWindow (window_ptr, er.where, NULL); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10401 #else /* not TARGET_API_MAC_CARBON */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10402 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10403 #endif /* not TARGET_API_MAC_CARBON */ |
56271
98f2b9da67f0
macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents:
56146
diff
changeset
|
10404 /* Update the frame parameters. */ |
98f2b9da67f0
macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents:
56146
diff
changeset
|
10405 { |
98f2b9da67f0
macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents:
56146
diff
changeset
|
10406 struct frame *f = mac_window_to_frame (window_ptr); |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10407 |
56271
98f2b9da67f0
macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents:
56146
diff
changeset
|
10408 if (f && !f->async_iconified) |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10409 x_real_positions (f, &f->left_pos, &f->top_pos); |
56271
98f2b9da67f0
macterm.c (XTread_socket): Correctly set the frame position
Steven Tamm <steventamm@mac.com>
parents:
56146
diff
changeset
|
10410 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10411 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10412 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10413 case inGoAway: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10414 if (TrackGoAway (window_ptr, er.where)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10415 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10416 inev.kind = DELETE_WINDOW_EVENT; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10417 XSETFRAME (inev.frame_or_window, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10418 mac_window_to_frame (window_ptr)); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10419 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10420 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10421 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10422 /* window resize handling added --ben */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10423 case inGrow: |
57357
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10424 do_grow_window (window_ptr, &er); |
05fe2d3ca439
macfns.c (mac_get_window_bounds): Add extern.
Steven Tamm <steventamm@mac.com>
parents:
56890
diff
changeset
|
10425 break; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10426 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10427 /* window zoom handling added --ben */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10428 case inZoomIn: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10429 case inZoomOut: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10430 if (TrackBox (window_ptr, er.where, part_code)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10431 do_zoom_window (window_ptr, part_code); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10432 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10433 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10434 default: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10435 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10436 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10437 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10438 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10439 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10440 case updateEvt: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10441 #if USE_CARBON_EVENTS |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10442 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10443 != eventNotHandledErr) |
46860
8b7ade57211d
2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46856
diff
changeset
|
10444 break; |
59384
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
10445 #else |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10446 do_window_update ((WindowPtr) er.message); |
59384
a1edc5959dcf
* macfns.c: Include sys/param.h.
Steven Tamm <steventamm@mac.com>
parents:
59325
diff
changeset
|
10447 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10448 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10449 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10450 case osEvt: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10451 #if USE_CARBON_EVENTS |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10452 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10453 != eventNotHandledErr) |
46860
8b7ade57211d
2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46856
diff
changeset
|
10454 break; |
46798 | 10455 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10456 switch ((er.message >> 24) & 0x000000FF) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10457 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10458 case suspendResumeMessage: |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
10459 #if USE_MAC_TSM |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
10460 if (er.message & resumeFlag) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
10461 mac_tsm_resume (); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10462 else |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
10463 mac_tsm_suspend (); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
10464 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10465 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10466 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10467 case mouseMovedMessage: |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10468 #if !USE_CARBON_EVENTS |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10469 SetRectRgn (mouse_region, er.where.h, er.where.v, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10470 er.where.h + 1, er.where.v + 1); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10471 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10472 previous_help_echo_string = help_echo_string; |
66080
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
10473 help_echo_string = Qnil; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10474 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10475 if (dpyinfo->grabbed && last_mouse_frame |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10476 && FRAME_LIVE_P (last_mouse_frame)) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10477 f = last_mouse_frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10478 else |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10479 f = dpyinfo->x_focus_frame; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10480 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10481 if (dpyinfo->mouse_face_hidden) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10482 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10483 dpyinfo->mouse_face_hidden = 0; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10484 clear_mouse_face (dpyinfo); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10485 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10486 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10487 if (f) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10488 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10489 WindowPtr wp = FRAME_MAC_WINDOW (f); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10490 Point mouse_pos = er.where; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10491 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10492 SetPortWindowPort (wp); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10493 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10494 GlobalToLocal (&mouse_pos); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10495 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10496 if (dpyinfo->grabbed && tracked_scroll_bar) |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10497 #ifdef USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10498 x_scroll_bar_handle_drag (wp, tracked_scroll_bar, |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10499 mouse_pos, &inev); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10500 #else /* not USE_TOOLKIT_SCROLL_BARS */ |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10501 x_scroll_bar_note_movement (tracked_scroll_bar, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10502 mouse_pos.v |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10503 - XINT (tracked_scroll_bar->top), |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10504 er.when * (1000 / 60)); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10505 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10506 else |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10507 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10508 /* Generate SELECT_WINDOW_EVENTs when needed. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10509 if (mouse_autoselect_window) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10510 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10511 Lisp_Object window; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10512 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10513 window = window_from_coordinates (f, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10514 mouse_pos.h, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10515 mouse_pos.v, |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10516 0, 0, 0, 0); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10517 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10518 /* Window will be selected only when it is |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10519 not selected now and last mouse movement |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10520 event was not in it. Minibuffer window |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10521 will be selected iff it is active. */ |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10522 if (WINDOWP (window) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10523 && !EQ (window, last_window) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10524 && !EQ (window, selected_window)) |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10525 { |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10526 inev.kind = SELECT_WINDOW_EVENT; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10527 inev.frame_or_window = window; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10528 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10529 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10530 last_window=window; |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10531 } |
66080
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
10532 if (!note_mouse_movement (f, &mouse_pos)) |
abad34f080c4
(note_mouse_movement, XTread_socket): Apply 2005-10-14 changes for
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66049
diff
changeset
|
10533 help_echo_string = previous_help_echo_string; |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10534 } |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10535 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10536 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10537 /* If the contents of the global variable |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10538 help_echo_string has changed, generate a |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10539 HELP_EVENT. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10540 if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10541 do_help = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10542 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10543 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10544 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10545 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10546 case activateEvt: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10547 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10548 WindowPtr window_ptr = (WindowPtr) er.message; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10549 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10550 #if USE_CARBON_EVENTS |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10551 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10552 != eventNotHandledErr) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10553 break; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10554 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10555 if (window_ptr == tip_window) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10556 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10557 HideWindow (tip_window); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10558 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10559 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10560 |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10561 if (!is_emacs_window (window_ptr)) |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10562 break; |
57373
38e45bf0128a
(x_update_window_end): Fix flicker on vertical line between
Kim F. Storm <storm@cua.dk>
parents:
57357
diff
changeset
|
10563 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10564 if ((er.modifiers & activeFlag) != 0) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10565 { |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10566 /* A window has been activated */ |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10567 Point mouse_loc = er.where; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10568 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10569 x_detect_focus_change (dpyinfo, &er, &inev); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10570 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10571 SetPortWindowPort (window_ptr); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10572 GlobalToLocal (&mouse_loc); |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10573 /* Window-activated event counts as mouse movement, |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10574 so update things that depend on mouse position. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10575 note_mouse_movement (mac_window_to_frame (window_ptr), |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10576 &mouse_loc); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10577 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10578 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10579 { |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10580 /* A window has been deactivated */ |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10581 #if USE_TOOLKIT_SCROLL_BARS |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10582 if (dpyinfo->grabbed && tracked_scroll_bar) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10583 { |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10584 struct input_event event; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10585 |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10586 EVENT_INIT (event); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10587 event.kind = NO_EVENT; |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10588 x_scroll_bar_handle_release (tracked_scroll_bar, &event); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10589 if (event.kind != NO_EVENT) |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10590 { |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10591 event.timestamp = timestamp; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10592 kbd_buffer_store_event_hold (&event, hold_quit); |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10593 count++; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10594 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10595 } |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
10596 #endif |
56278
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10597 dpyinfo->grabbed = 0; |
3d525d0266de
macterm.c (do_window_activate, do_window_deactivate): Remove.
Steven Tamm <steventamm@mac.com>
parents:
56277
diff
changeset
|
10598 |
61574
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10599 x_detect_focus_change (dpyinfo, &er, &inev); |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10600 |
d3c53b9d1828
(x_autoselect_window_p): Remove variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61555
diff
changeset
|
10601 f = mac_window_to_frame (window_ptr); |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10602 if (f == dpyinfo->mouse_face_mouse_frame) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10603 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10604 /* If we move outside the frame, then we're |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10605 certainly no longer on any text in the |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10606 frame. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10607 clear_mouse_face (dpyinfo); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10608 dpyinfo->mouse_face_mouse_frame = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10609 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10610 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10611 /* Generate a nil HELP_EVENT to cancel a help-echo. |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10612 Do it only if there's something to cancel. |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10613 Otherwise, the startup message is cleared when the |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10614 mouse leaves the frame. */ |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10615 if (any_help_event_p) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10616 do_help = -1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10617 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10618 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10619 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10620 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10621 case keyDown: |
70735
d0bad3102124
(XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70563
diff
changeset
|
10622 case keyUp: |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10623 case autoKey: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10624 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10625 int keycode = (er.message & keyCodeMask) >> 8; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10626 int xkeysym; |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10627 static SInt16 last_key_script = -1; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10628 SInt16 current_key_script; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10629 UInt32 modifiers = er.modifiers, mapped_modifiers; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10630 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10631 mapped_modifiers = |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10632 (NILP (Vmac_control_modifier) ? 0 : controlKey) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10633 | (NILP (Vmac_option_modifier) ? 0 : optionKey) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10634 | (NILP (Vmac_command_modifier) ? 0 : cmdKey); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10635 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10636 #if USE_CARBON_EVENTS && defined (MAC_OSX) |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10637 mapped_modifiers |= |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10638 (NILP (Vmac_function_modifier) ? 0 : kEventKeyModifierFnMask); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10639 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10640 GetEventParameter (eventRef, kEventParamKeyModifiers, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10641 typeUInt32, NULL, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10642 sizeof (UInt32), NULL, &modifiers); |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10643 #endif |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10644 mapped_modifiers &= modifiers; |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10645 |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10646 #if USE_CARBON_EVENTS && defined (MAC_OSX) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10647 /* When using Carbon Events, we need to pass raw keyboard |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10648 events to the TSM ourselves. If TSM handles it, it |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10649 will pass back noErr, otherwise it will pass back |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10650 "eventNotHandledErr" and we can process it |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10651 normally. */ |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10652 if (!(mapped_modifiers |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10653 & ~(mac_pass_command_to_system ? cmdKey : 0) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10654 & ~(mac_pass_control_to_system ? controlKey : 0))) |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10655 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10656 OSStatus err; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10657 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10658 read_socket_inev = &inev; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10659 err = SendEventToEventTarget (eventRef, toolbox_dispatcher); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10660 read_socket_inev = NULL; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10661 if (err != eventNotHandledErr) |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10662 break; |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10663 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10664 #endif |
70735
d0bad3102124
(XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70563
diff
changeset
|
10665 if (er.what == keyUp) |
d0bad3102124
(XTread_socket) [TARGET_API_MAC_CARBON && MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70563
diff
changeset
|
10666 break; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10667 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10668 ObscureCursor (); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10669 |
69773
9dd22c1de682
(XTread_socket): Initialize variable `f' before its use.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69660
diff
changeset
|
10670 f = mac_focus_frame (dpyinfo); |
9dd22c1de682
(XTread_socket): Initialize variable `f' before its use.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69660
diff
changeset
|
10671 |
69660
bc015cae7e3e
(XTread_socket): Don't let key-press clear mouse face
Kim F. Storm <storm@cua.dk>
parents:
69512
diff
changeset
|
10672 if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) |
bc015cae7e3e
(XTread_socket): Don't let key-press clear mouse face
Kim F. Storm <storm@cua.dk>
parents:
69512
diff
changeset
|
10673 && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10674 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10675 clear_mouse_face (dpyinfo); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10676 dpyinfo->mouse_face_hidden = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10677 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10678 |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10679 current_key_script = GetScriptManagerVariable (smKeyScript); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10680 if (last_key_script != current_key_script) |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10681 { |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10682 struct input_event event; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10683 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10684 EVENT_INIT (event); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10685 event.kind = LANGUAGE_CHANGE_EVENT; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10686 event.arg = Qnil; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10687 event.code = current_key_script; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10688 event.timestamp = timestamp; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10689 kbd_buffer_store_event (&event); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10690 count++; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10691 last_key_script = current_key_script; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10692 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10693 |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10694 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10695 if (inev.kind != NO_EVENT) |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10696 break; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10697 #endif |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
10698 |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10699 #ifdef MAC_OSX |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10700 if (mapped_modifiers & kEventKeyModifierFnMask |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10701 && keycode <= 0x7f |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10702 && fn_keycode_to_keycode_table[keycode]) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10703 keycode = fn_keycode_to_keycode_table[keycode]; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10704 #endif |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10705 if (keycode_to_xkeysym (keycode, &xkeysym)) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10706 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10707 inev.kind = NON_ASCII_KEYSTROKE_EVENT; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10708 inev.code = 0xff00 | xkeysym; |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10709 #ifdef MAC_OSX |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10710 if (modifiers & kEventKeyModifierFnMask |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10711 && keycode <= 0x7f |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10712 && fn_keycode_to_keycode_table[keycode] == keycode) |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10713 modifiers &= ~kEventKeyModifierFnMask; |
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10714 #endif |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
10715 } |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10716 else if (mapped_modifiers) |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10717 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10718 /* translate the keycode back to determine the |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10719 original key */ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10720 #ifdef MAC_OSX |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10721 static SInt16 last_key_layout_id = 0; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10722 static Handle uchr_handle = (Handle)-1; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10723 SInt16 current_key_layout_id = |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10724 GetScriptVariable (current_key_script, smScriptKeys); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10725 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10726 if (uchr_handle == (Handle)-1 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10727 || last_key_layout_id != current_key_layout_id) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10728 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10729 uchr_handle = GetResource ('uchr', current_key_layout_id); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10730 last_key_layout_id = current_key_layout_id; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10731 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10732 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10733 if (uchr_handle) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10734 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10735 OSStatus status; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10736 UInt16 key_action = er.what - keyDown; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10737 UInt32 modifier_key_state = |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10738 (modifiers & ~mapped_modifiers) >> 8; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10739 UInt32 keyboard_type = LMGetKbdType (); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10740 SInt32 dead_key_state = 0; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10741 UniChar code; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10742 UniCharCount actual_length; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10743 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10744 status = UCKeyTranslate ((UCKeyboardLayout *)*uchr_handle, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10745 keycode, key_action, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10746 modifier_key_state, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10747 keyboard_type, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10748 kUCKeyTranslateNoDeadKeysMask, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10749 &dead_key_state, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10750 1, &actual_length, &code); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10751 if (status == noErr && actual_length == 1) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10752 mac_set_unicode_keystroke_event (code, &inev); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10753 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10754 #endif /* MAC_OSX */ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10755 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10756 if (inev.kind == NO_EVENT) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10757 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10758 /* This code comes from Keyboard Resource, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10759 Appendix C of IM - Text. This is necessary |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10760 since shift is ignored in KCHR table |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10761 translation when option or command is pressed. |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10762 It also does not translate correctly |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10763 control-shift chars like C-% so mask off shift |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10764 here also. */ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10765 /* Mask off modifier keys that are mapped to some |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10766 Emacs modifiers. */ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10767 int new_modifiers = er.modifiers & ~mapped_modifiers; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10768 /* set high byte of keycode to modifier high byte*/ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10769 int new_keycode = keycode | new_modifiers; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10770 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10771 unsigned long some_state = 0; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10772 UInt32 new_char_code; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10773 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10774 new_char_code = KeyTranslate (kchr_ptr, new_keycode, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10775 &some_state); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10776 if (new_char_code == 0) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10777 /* Seems like a dead key. Append up-stroke. */ |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10778 new_char_code = KeyTranslate (kchr_ptr, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10779 new_keycode | 0x80, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10780 &some_state); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10781 if (new_char_code) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10782 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10783 inev.kind = ASCII_KEYSTROKE_EVENT; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10784 inev.code = new_char_code & 0xff; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10785 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10786 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10787 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10788 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10789 if (inev.kind == NO_EVENT) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10790 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10791 inev.kind = ASCII_KEYSTROKE_EVENT; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10792 inev.code = er.message & charCodeMask; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10793 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10794 |
70874
acd53b4b2285
(fn_keycode_to_keycode_table, XTread_socket) [MAC_OSX]:
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70854
diff
changeset
|
10795 inev.modifiers = mac_to_emacs_modifiers (modifiers); |
70854
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10796 inev.modifiers |= (extra_keyboard_modifiers |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10797 & (meta_modifier | alt_modifier |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10798 | hyper_modifier | super_modifier)); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10799 XSETFRAME (inev.frame_or_window, f); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10800 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10801 #if TARGET_API_MAC_CARBON |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10802 if (inev.kind == ASCII_KEYSTROKE_EVENT |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10803 && inev.code >= 0x80 && inev.modifiers) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10804 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10805 OSStatus err; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10806 TextEncoding encoding = kTextEncodingMacRoman; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10807 TextToUnicodeInfo ttu_info; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10808 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10809 UpgradeScriptInfoToTextEncoding (current_key_script, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10810 kTextLanguageDontCare, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10811 kTextRegionDontCare, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10812 NULL, &encoding); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10813 err = CreateTextToUnicodeInfoByEncoding (encoding, &ttu_info); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10814 if (err == noErr) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10815 { |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10816 UniChar code; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10817 Str255 pstr; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10818 ByteCount unicode_len; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10819 |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10820 pstr[0] = 1; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10821 pstr[1] = inev.code; |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10822 err = ConvertFromPStringToUnicode (ttu_info, pstr, |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10823 sizeof (UniChar), |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10824 &unicode_len, &code); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10825 if (err == noErr && unicode_len == sizeof (UniChar)) |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10826 mac_set_unicode_keystroke_event (code, &inev); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10827 DisposeTextToUnicodeInfo (&ttu_info); |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10828 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10829 } |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10830 #endif |
6384ae23d84a
(fn_keycode_to_xkeysym_table, convert_fn_keycode): Remove.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70766
diff
changeset
|
10831 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10832 break; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10833 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10834 case kHighLevelEvent: |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10835 AEProcessAppleEvent (&er); |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10836 break; |
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10837 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10838 default: |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10839 break; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10840 } |
46798 | 10841 #if USE_CARBON_EVENTS |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10842 ReleaseEvent (eventRef); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10843 #endif |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10844 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10845 if (inev.kind != NO_EVENT) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10846 { |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
10847 inev.timestamp = timestamp; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10848 kbd_buffer_store_event_hold (&inev, hold_quit); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10849 count++; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10850 } |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10851 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10852 if (do_help |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10853 && !(hold_quit && hold_quit->kind != NO_EVENT)) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10854 { |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10855 Lisp_Object frame; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10856 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10857 if (f) |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10858 XSETFRAME (frame, f); |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10859 else |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10860 frame = Qnil; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10861 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10862 if (do_help > 0) |
46860
8b7ade57211d
2002-08-11 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46856
diff
changeset
|
10863 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10864 any_help_event_p = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10865 gen_help_event (help_echo_string, frame, help_echo_window, |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10866 help_echo_object, help_echo_pos); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10867 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10868 else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10869 { |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10870 help_echo_string = Qnil; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10871 gen_help_event (Qnil, frame, Qnil, Qnil, 0); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10872 } |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10873 count++; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10874 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10875 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10876 } |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10877 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10878 /* If the focus was just given to an autoraising frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10879 raise it now. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10880 /* ??? This ought to be able to handle more than one such frame. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10881 if (pending_autoraise_frame) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10882 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10883 x_raise_frame (pending_autoraise_frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10884 pending_autoraise_frame = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10885 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10886 |
65110
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10887 #if !USE_CARBON_EVENTS |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10888 /* Check which frames are still visible. We do this here because |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10889 there doesn't seem to be any direct notification from the Window |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10890 Manager that the visibility of a window has changed (at least, |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10891 not in all cases). */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10892 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10893 Lisp_Object tail, frame; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10894 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10895 FOR_EACH_FRAME (tail, frame) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10896 { |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10897 struct frame *f = XFRAME (frame); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10898 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10899 /* The tooltip has been drawn already. Avoid the |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10900 SET_FRAME_GARBAGED in mac_handle_visibility_change. */ |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10901 if (EQ (frame, tip_frame)) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10902 continue; |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10903 |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10904 if (FRAME_MAC_P (f)) |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10905 mac_handle_visibility_change (f); |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10906 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10907 } |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10908 #endif |
ac7314b59792
(mac_copy_area, mac_copy_area_with_mask): Restore background color.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64770
diff
changeset
|
10909 |
68770
4eb8cd48f0ef
(mac_define_frame_cursor): Don't change pointer shape
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
68651
diff
changeset
|
10910 --handling_signal; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10911 UNBLOCK_INPUT; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10912 return count; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10913 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10914 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10915 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10916 /* Need to override CodeWarrior's input function so no conversion is |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10917 done on newlines Otherwise compiled functions in .elc files will be |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10918 read incorrectly. Defined in ...:MSL C:MSL |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10919 Common:Source:buffer_io.c. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10920 #ifdef __MWERKS__ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10921 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10922 __convert_to_newlines (unsigned char * p, size_t * n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10923 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10924 #pragma unused(p,n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10925 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10926 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10927 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10928 __convert_from_newlines (unsigned char * p, size_t * n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10929 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10930 #pragma unused(p,n) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10931 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10932 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10933 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10934 #ifdef MAC_OS8 |
47634 | 10935 void |
10936 make_mac_terminal_frame (struct frame *f) | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10937 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10938 Lisp_Object frame; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10939 Rect r; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10940 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10941 XSETFRAME (frame, f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10942 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10943 f->output_method = output_mac; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10944 f->output_data.mac = (struct mac_output *) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10945 xmalloc (sizeof (struct mac_output)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10946 bzero (f->output_data.mac, sizeof (struct mac_output)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
10947 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10948 XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10949 |
51198
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
10950 FRAME_COLS (f) = 96; |
f8e097cae353
Make (several) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51048
diff
changeset
|
10951 FRAME_LINES (f) = 4; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10952 |
53722
4f64eb1ea148
Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents:
53651
diff
changeset
|
10953 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; |
4f64eb1ea148
Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents:
53651
diff
changeset
|
10954 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right; |
4f64eb1ea148
Move setting of scroll bars from make_mac_frame to
Steven Tamm <steventamm@mac.com>
parents:
53651
diff
changeset
|
10955 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10956 FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10957 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10958 f->output_data.mac->cursor_pixel = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10959 f->output_data.mac->border_pixel = 0x00ff00; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10960 f->output_data.mac->mouse_pixel = 0xff00ff; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10961 f->output_data.mac->cursor_foreground_pixel = 0x0000ff; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10962 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10963 f->output_data.mac->text_cursor = kThemeIBeamCursor; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10964 f->output_data.mac->nontext_cursor = kThemeArrowCursor; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10965 f->output_data.mac->modeline_cursor = kThemeArrowCursor; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10966 f->output_data.mac->hand_cursor = kThemePointingHandCursor; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10967 f->output_data.mac->hourglass_cursor = kThemeWatchCursor; |
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
10968 f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10969 |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10970 FRAME_FONTSET (f) = -1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10971 f->output_data.mac->explicit_parent = 0; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10972 f->left_pos = 8; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10973 f->top_pos = 32; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10974 f->border_width = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10975 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10976 f->internal_border_width = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10977 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10978 f->auto_raise = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10979 f->auto_lower = 1; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10980 |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10981 f->new_text_cols = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10982 f->new_text_lines = 0; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
10983 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10984 SetRect (&r, f->left_pos, f->top_pos, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10985 f->left_pos + FRAME_PIXEL_WIDTH (f), |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10986 f->top_pos + FRAME_PIXEL_HEIGHT (f)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10987 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10988 BLOCK_INPUT; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10989 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10990 if (!(FRAME_MAC_WINDOW (f) = |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10991 NewCWindow (NULL, &r, "\p", true, dBoxProc, |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10992 (WindowPtr) -1, 1, (long) f->output_data.mac))) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10993 abort (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10994 /* so that update events can find this mac_output struct */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10995 f->output_data.mac->mFP = f; /* point back to emacs frame */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10996 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
10997 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10998 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
10999 x_make_gc (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
11000 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11001 /* Need to be initialized for unshow_buffer in window.c. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11002 selected_window = f->selected_window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11003 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11004 Fmodify_frame_parameters (frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11005 Fcons (Fcons (Qfont, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11006 build_string ("-*-monaco-medium-r-*--*-90-*-*-*-*-mac-roman")), Qnil)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11007 Fmodify_frame_parameters (frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11008 Fcons (Fcons (Qforeground_color, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11009 build_string ("black")), Qnil)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11010 Fmodify_frame_parameters (frame, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11011 Fcons (Fcons (Qbackground_color, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11012 build_string ("white")), Qnil)); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11013 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11014 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11015 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11016 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11017 /*********************************************************************** |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11018 Initialization |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11019 ***********************************************************************/ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11020 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11021 int mac_initialized = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11022 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11023 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11024 mac_initialize_display_info () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11025 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11026 struct mac_display_info *dpyinfo = &one_mac_display_info; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11027 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11028 bzero (dpyinfo, sizeof (*dpyinfo)); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11029 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11030 #ifdef MAC_OSX |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11031 dpyinfo->mac_id_name |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
11032 = (char *) xmalloc (SCHARS (Vinvocation_name) |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
11033 + SCHARS (Vsystem_name) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11034 + 2); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11035 sprintf (dpyinfo->mac_id_name, "%s@%s", |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46169
diff
changeset
|
11036 SDATA (Vinvocation_name), SDATA (Vsystem_name)); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11037 #else |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11038 dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11039 strcpy (dpyinfo->mac_id_name, "Mac Display"); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11040 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11041 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11042 dpyinfo->reference_count = 0; |
66431
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
11043 dpyinfo->resx = 72.0; |
8ee33d677ac7
(last_mouse_glyph_frame): New var.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66181
diff
changeset
|
11044 dpyinfo->resy = 72.0; |
56146
5e784b2ea638
* macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55851
diff
changeset
|
11045 #ifdef MAC_OSX |
5e784b2ea638
* macfns.c (Fx_display_color_cells): Do not limit return value to 256.
Jan Djärv <jan.h.d@swipnet.se>
parents:
55851
diff
changeset
|
11046 /* HasDepth returns true if it is possible to have a 32 bit display, |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11047 but this may not be what is actually used. Mac OSX can do better. */ |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11048 dpyinfo->color_p = 1; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11049 dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11050 dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11051 dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11052 #else |
56348
550df8e67006
* macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents:
56278
diff
changeset
|
11053 { |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11054 GDHandle main_device_handle = LMGetMainDevice(); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11055 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11056 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11057 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11058 if (HasDepth (main_device_handle, dpyinfo->n_planes, |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11059 gdDevType, dpyinfo->color_p)) |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11060 break; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11061 dpyinfo->height = (**main_device_handle).gdRect.bottom; |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11062 dpyinfo->width = (**main_device_handle).gdRect.right; |
56348
550df8e67006
* macterm.c (mac_initialize_display_info): Use CGGetActiveDisplayList
Jan Djärv <jan.h.d@swipnet.se>
parents:
56278
diff
changeset
|
11063 } |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11064 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11065 dpyinfo->grabbed = 0; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11066 dpyinfo->root_window = NULL; |
54150
6c8849d06ab3
Inserting Yamomotosan's changes for MacOSX image support, better support
Steven Tamm <steventamm@mac.com>
parents:
53956
diff
changeset
|
11067 dpyinfo->image_cache = make_image_cache (); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11068 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11069 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11070 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11071 dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11072 dpyinfo->mouse_face_window = Qnil; |
55851
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
11073 dpyinfo->mouse_face_overlay = Qnil; |
f1d6a507dcfd
Support Tooltips with the Carbon emacs port.
Steven Tamm <steventamm@mac.com>
parents:
55583
diff
changeset
|
11074 dpyinfo->mouse_face_hidden = 0; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11075 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11076 |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11077 |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11078 static XrmDatabase |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11079 mac_make_rdb (xrm_option) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11080 char *xrm_option; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11081 { |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11082 XrmDatabase database; |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11083 |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11084 database = xrm_get_preference_database (NULL); |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11085 if (xrm_option) |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11086 xrm_merge_string_database (database, xrm_option); |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11087 |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11088 return database; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11089 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11090 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11091 struct mac_display_info * |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11092 mac_term_init (display_name, xrm_option, resource_name) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11093 Lisp_Object display_name; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11094 char *xrm_option; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11095 char *resource_name; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11096 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11097 struct mac_display_info *dpyinfo; |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11098 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11099 BLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11100 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11101 if (!mac_initialized) |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11102 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11103 mac_initialize (); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11104 mac_initialized = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11105 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11106 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11107 if (x_display_list) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11108 error ("Sorry, this version can only handle one display"); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11109 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11110 mac_initialize_display_info (); |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11111 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11112 dpyinfo = &one_mac_display_info; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11113 |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11114 dpyinfo->xrdb = mac_make_rdb (xrm_option); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11115 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11116 /* Put this display on the chain. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11117 dpyinfo->next = x_display_list; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11118 x_display_list = dpyinfo; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11119 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11120 /* Put it on x_display_name_list. */ |
60635
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11121 x_display_name_list = Fcons (Fcons (display_name, |
e45b939c1d93
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
60623
diff
changeset
|
11122 Fcons (Qnil, dpyinfo->xrdb)), |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11123 x_display_name_list); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11124 dpyinfo->name_list_element = XCAR (x_display_name_list); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11125 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11126 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11127 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11128 return dpyinfo; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11129 } |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11130 /* Get rid of display DPYINFO, assuming all frames are already gone. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11131 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11132 void |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11133 x_delete_display (dpyinfo) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11134 struct mac_display_info *dpyinfo; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11135 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11136 int i; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11137 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11138 /* Discard this display from x_display_name_list and x_display_list. |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11139 We can't use Fdelq because that can quit. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11140 if (! NILP (x_display_name_list) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11141 && EQ (XCAR (x_display_name_list), dpyinfo->name_list_element)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11142 x_display_name_list = XCDR (x_display_name_list); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11143 else |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11144 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11145 Lisp_Object tail; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11146 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11147 tail = x_display_name_list; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11148 while (CONSP (tail) && CONSP (XCDR (tail))) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11149 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11150 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element)) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11151 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11152 XSETCDR (tail, XCDR (XCDR (tail))); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11153 break; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11154 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11155 tail = XCDR (tail); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11156 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11157 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11158 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11159 if (x_display_list == dpyinfo) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11160 x_display_list = dpyinfo->next; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11161 else |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11162 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11163 struct x_display_info *tail; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11164 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11165 for (tail = x_display_list; tail; tail = tail->next) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11166 if (tail->next == dpyinfo) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11167 tail->next = tail->next->next; |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11168 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11169 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11170 /* Free the font names in the font table. */ |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11171 for (i = 0; i < dpyinfo->n_fonts; i++) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11172 if (dpyinfo->font_table[i].name) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11173 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11174 if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11175 xfree (dpyinfo->font_table[i].full_name); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11176 xfree (dpyinfo->font_table[i].name); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11177 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11178 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11179 if (dpyinfo->font_table->font_encoder) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11180 xfree (dpyinfo->font_table->font_encoder); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11181 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11182 xfree (dpyinfo->font_table); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11183 xfree (dpyinfo->mac_id_name); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11184 |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11185 if (x_display_list == 0) |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11186 { |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11187 mac_clear_font_name_table (); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11188 bzero (dpyinfo, sizeof (*dpyinfo)); |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11189 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11190 } |
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11191 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11192 |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11193 #ifdef MAC_OSX |
47634 | 11194 void |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11195 mac_check_bundle() |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11196 { |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11197 extern int inhibit_window_system; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11198 extern int noninteractive; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11199 CFBundleRef appsBundle; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11200 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11201 /* No need to test if already -nw*/ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11202 if (inhibit_window_system || noninteractive) |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11203 return; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11204 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11205 appsBundle = CFBundleGetMainBundle(); |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11206 if (appsBundle != NULL) |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11207 { |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11208 CFStringRef cfBI = CFSTR("CFBundleIdentifier"); |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11209 CFTypeRef res = CFBundleGetValueForInfoDictionaryKey(appsBundle, cfBI); |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11210 /* We found the bundle identifier, now we know we are valid. */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11211 if (res != NULL) |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11212 { |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11213 CFRelease(res); |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11214 return; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11215 } |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11216 } |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11217 /* MAC_TODO: Have this start the bundled executable */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11218 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11219 /* For now, prevent the fatal error by bringing it up in the terminal */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11220 inhibit_window_system = 1; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11221 } |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11222 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11223 void |
47634 | 11224 MakeMeTheFrontProcess () |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11225 { |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11226 ProcessSerialNumber psn; |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11227 OSErr err; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
11228 |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11229 err = GetCurrentProcess (&psn); |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11230 if (err == noErr) |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11231 (void) SetFrontProcess (&psn); |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11232 } |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11233 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11234 /***** Code to handle C-g testing *****/ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11235 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11236 /* Contains the Mac modifier formed from quit_char */ |
63098
08adf0b46c71
* macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode
Jan Djärv <jan.h.d@swipnet.se>
parents:
62944
diff
changeset
|
11237 int mac_quit_char_modifiers = 0; |
08adf0b46c71
* macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode
Jan Djärv <jan.h.d@swipnet.se>
parents:
62944
diff
changeset
|
11238 int mac_quit_char_keycode; |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11239 extern int quit_char; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11240 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11241 static void |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11242 mac_determine_quit_char_modifiers() |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11243 { |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11244 /* Todo: Determine modifiers from quit_char. */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11245 UInt32 qc_modifiers = ctrl_modifier; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11246 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11247 /* Map modifiers */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11248 mac_quit_char_modifiers = 0; |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11249 if (qc_modifiers & ctrl_modifier) mac_quit_char_modifiers |= controlKey; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
11250 if (qc_modifiers & shift_modifier) mac_quit_char_modifiers |= shiftKey; |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11251 if (qc_modifiers & alt_modifier) mac_quit_char_modifiers |= optionKey; |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11252 } |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11253 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11254 static void |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11255 init_quit_char_handler () |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11256 { |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11257 /* TODO: Let this support keys other the 'g' */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11258 mac_quit_char_keycode = 5; |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11259 /* Look at <architecture/adb_kb_map.h> for details */ |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11260 /* http://gemma.apple.com/techpubs/mac/Toolbox/Toolbox-40.html#MARKER-9-184*/ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
11261 |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11262 mac_determine_quit_char_modifiers(); |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11263 } |
64276
0a062d2d75f3
Don't include stdlib.h or composite.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
64102
diff
changeset
|
11264 #endif /* MAC_OSX */ |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11265 |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11266 static void |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11267 init_menu_bar () |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11268 { |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11269 #ifdef MAC_OSX |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11270 OSErr err; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11271 MenuRef menu; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11272 MenuItemIndex menu_index; |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11273 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11274 err = GetIndMenuItemWithCommandID (NULL, kHICommandQuit, 1, |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11275 &menu, &menu_index); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11276 if (err == noErr) |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11277 SetMenuItemCommandKey (menu, menu_index, false, 0); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11278 #if USE_CARBON_EVENTS |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11279 EnableMenuCommand (NULL, kHICommandPreferences); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11280 err = GetIndMenuItemWithCommandID (NULL, kHICommandPreferences, 1, |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11281 &menu, &menu_index); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11282 if (err == noErr) |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11283 { |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11284 SetMenuItemCommandKey (menu, menu_index, false, 0); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11285 InsertMenuItemTextWithCFString (menu, NULL, |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11286 0, kMenuItemAttrSeparator, 0); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11287 InsertMenuItemTextWithCFString (menu, CFSTR ("About Emacs"), |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11288 0, 0, kHICommandAbout); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11289 } |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11290 #endif /* USE_CARBON_EVENTS */ |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11291 #else /* !MAC_OSX */ |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11292 #if USE_CARBON_EVENTS |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11293 SetMenuItemCommandID (GetMenuHandle (M_APPLE), I_ABOUT, kHICommandAbout); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11294 #endif |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11295 #endif |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11296 } |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11297 |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11298 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11299 static void |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11300 init_tsm () |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11301 { |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11302 static InterfaceTypeList types = {kUnicodeDocument}; |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11303 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11304 NewTSMDocument (sizeof (types) / sizeof (types[0]), types, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11305 &tsm_document_id, 0); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11306 } |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11307 #endif |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11308 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11309 /* Set up use of X before we make the first connection. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11310 |
50360
0cebe62850bc
Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents:
50344
diff
changeset
|
11311 extern frame_parm_handler mac_frame_parm_handlers[]; |
0cebe62850bc
Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents:
50344
diff
changeset
|
11312 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11313 static struct redisplay_interface x_redisplay_interface = |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11314 { |
50360
0cebe62850bc
Remove unnecessary extern declarations.
Kim F. Storm <storm@cua.dk>
parents:
50344
diff
changeset
|
11315 mac_frame_parm_handlers, |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11316 x_produce_glyphs, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11317 x_write_glyphs, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11318 x_insert_glyphs, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11319 x_clear_end_of_line, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11320 x_scroll_run, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11321 x_after_update_window_line, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11322 x_update_window_begin, |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11323 x_update_window_end, |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11324 x_cursor_to, |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11325 x_flush, |
58634
95d38c47c806
* keyboard.c: Don't undef SIGIO
Steven Tamm <steventamm@mac.com>
parents:
58403
diff
changeset
|
11326 0, /* flush_display_optional */ |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11327 x_clear_window_mouse_face, |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11328 x_get_glyph_overhangs, |
50097 | 11329 x_fix_overlapping_area, |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
11330 x_draw_fringe_bitmap, |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11331 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11332 mac_define_fringe_bitmap, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11333 mac_destroy_fringe_bitmap, |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11334 #else |
53885
693745d24f76
(x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents:
53722
diff
changeset
|
11335 0, /* define_fringe_bitmap */ |
693745d24f76
(x_draw_fringe_bitmap): Copy unadapted code from
Kim F. Storm <storm@cua.dk>
parents:
53722
diff
changeset
|
11336 0, /* destroy_fringe_bitmap */ |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11337 #endif |
50157
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
11338 mac_per_char_metric, |
203d5a0f77a8
The following changes consolidate some of the gui-independent
Kim F. Storm <storm@cua.dk>
parents:
50097
diff
changeset
|
11339 mac_encode_char, |
59718
d4cb255b034d
* dispextern.h (struct glyph_string): New members clip_head and
Steven Tamm <steventamm@mac.com>
parents:
59655
diff
changeset
|
11340 mac_compute_glyph_string_overhangs, |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11341 x_draw_glyph_string, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11342 mac_define_frame_cursor, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11343 mac_clear_frame_area, |
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11344 mac_draw_window_cursor, |
50344
31cf5b909af7
(x_redisplay_interface): Add missing entry for
Andreas Schwab <schwab@suse.de>
parents:
50247
diff
changeset
|
11345 mac_draw_vertical_window_border, |
50222
90e10bfd8bfa
* macterm.c: Remove consolidated defines and code.
Kim F. Storm <storm@cua.dk>
parents:
50157
diff
changeset
|
11346 mac_shift_glyphs_for_insert |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11347 }; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11348 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11349 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11350 mac_initialize () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11351 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11352 rif = &x_redisplay_interface; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11353 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11354 clear_frame_hook = x_clear_frame; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11355 ins_del_lines_hook = x_ins_del_lines; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11356 delete_glyphs_hook = x_delete_glyphs; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11357 ring_bell_hook = XTring_bell; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11358 reset_terminal_modes_hook = XTreset_terminal_modes; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11359 set_terminal_modes_hook = XTset_terminal_modes; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11360 update_begin_hook = x_update_begin; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11361 update_end_hook = x_update_end; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11362 set_terminal_window_hook = XTset_terminal_window; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11363 read_socket_hook = XTread_socket; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11364 frame_up_to_date_hook = XTframe_up_to_date; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11365 mouse_position_hook = XTmouse_position; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11366 frame_rehighlight_hook = XTframe_rehighlight; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11367 frame_raise_lower_hook = XTframe_raise_lower; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11368 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11369 set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11370 condemn_scroll_bars_hook = XTcondemn_scroll_bars; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11371 redeem_scroll_bar_hook = XTredeem_scroll_bar; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11372 judge_scroll_bars_hook = XTjudge_scroll_bars; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11373 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11374 scroll_region_ok = 1; /* we'll scroll partial frames */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11375 char_ins_del_ok = 1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11376 line_ins_del_ok = 1; /* we'll just blt 'em */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11377 fast_clear_end_of_line = 1; /* X does this well */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11378 memory_below_frame = 0; /* we don't remember what scrolls |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11379 off the bottom */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11380 baud_rate = 19200; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11381 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11382 last_tool_bar_item = -1; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11383 any_help_event_p = 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49504
diff
changeset
|
11384 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11385 /* Try to use interrupt input; if we can't, then start polling. */ |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11386 Fset_input_mode (Qt, Qnil, Qt, Qnil); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11387 |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
11388 BLOCK_INPUT; |
46121 | 11389 |
11390 #if TARGET_API_MAC_CARBON | |
11391 | |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11392 #if USE_CARBON_EVENTS |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11393 #ifdef MAC_OSX |
46798 | 11394 init_service_handler (); |
48739
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11395 |
9f54273b7ff1
Added code to check for pressing of quit_char in the Carbon Event Queue
Steven Tamm <steventamm@mac.com>
parents:
48625
diff
changeset
|
11396 init_quit_char_handler (); |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11397 #endif /* MAC_OSX */ |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11398 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11399 init_command_handler (); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11400 |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11401 init_menu_bar (); |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11402 |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11403 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11404 init_tsm (); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11405 #endif |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11406 #endif /* USE_CARBON_EVENTS */ |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11407 |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
11408 #ifdef MAC_OSX |
67788
114d965dfb60
Don't include sys/param.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67733
diff
changeset
|
11409 init_coercion_handler (); |
114d965dfb60
Don't include sys/param.h.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67733
diff
changeset
|
11410 |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11411 init_apple_event_handler (); |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11412 |
46856
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11413 if (!inhibit_window_system) |
eba75fedd593
2002-08-10 Andrew Choi <akochoi@shaw.ca>
Andrew Choi <akochoi@shaw.ca>
parents:
46805
diff
changeset
|
11414 MakeMeTheFrontProcess (); |
46121 | 11415 #endif |
60364
de784812b4d4
[TARGET_API_MAC_CARBON && !MAC_OSX]: Define USE_CARBON_EVENTS to 1.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
59899
diff
changeset
|
11416 #endif |
69488
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11417 |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11418 #if USE_CG_DRAWING |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11419 mac_init_fringe (); |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11420 #endif |
72158718da16
(mac_initialize) [USE_CG_DRAWING]: Call mac_init_fringe.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
69433
diff
changeset
|
11421 |
57425
0867872551d9
macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow
Steven Tamm <steventamm@mac.com>
parents:
57373
diff
changeset
|
11422 UNBLOCK_INPUT; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11423 } |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11424 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11425 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11426 void |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11427 syms_of_macterm () |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11428 { |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11429 #if 0 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11430 staticpro (&x_error_message_string); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11431 x_error_message_string = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11432 #endif |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11433 |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11434 Qcontrol = intern ("control"); staticpro (&Qcontrol); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11435 Qmeta = intern ("meta"); staticpro (&Qmeta); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11436 Qalt = intern ("alt"); staticpro (&Qalt); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11437 Qhyper = intern ("hyper"); staticpro (&Qhyper); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11438 Qsuper = intern ("super"); staticpro (&Qsuper); |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
11439 Qmodifier_value = intern ("modifier-value"); |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11440 staticpro (&Qmodifier_value); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11441 |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11442 Fput (Qcontrol, Qmodifier_value, make_number (ctrl_modifier)); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11443 Fput (Qmeta, Qmodifier_value, make_number (meta_modifier)); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11444 Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11445 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11446 Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
11447 |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11448 #if USE_CARBON_EVENTS |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11449 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); |
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11450 #ifdef MAC_OSX |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11451 Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11452 staticpro (&Qtoolbar_switch_mode); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11453 #if USE_MAC_FONT_PANEL |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11454 Qpanel_closed = intern ("panel-closed"); staticpro (&Qpanel_closed); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11455 Qselection = intern ("selection"); staticpro (&Qselection); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11456 #endif |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11457 |
70563
fc3c18e2c3b9
(Qservice) [MAC_OSX]: Rename from Qservices. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70496
diff
changeset
|
11458 Qservice = intern ("service"); staticpro (&Qservice); |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11459 Qpaste = intern ("paste"); staticpro (&Qpaste); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11460 Qperform = intern ("perform"); staticpro (&Qperform); |
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11461 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11462 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11463 Qtext_input = intern ("text-input"); staticpro (&Qtext_input); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11464 Qupdate_active_input_area = intern ("update-active-input-area"); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11465 staticpro (&Qupdate_active_input_area); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11466 Qunicode_for_key_event = intern ("unicode-for-key-event"); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11467 staticpro (&Qunicode_for_key_event); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11468 #endif |
67458
e6e566aad553
(Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67101
diff
changeset
|
11469 #endif |
61786
223bdb2c3b9a
(handling_window_update, terminate_flag): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61658
diff
changeset
|
11470 |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11471 #ifdef MAC_OSX |
49015
c49640262de0
* macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
Steven Tamm <steventamm@mac.com>
parents:
49003
diff
changeset
|
11472 Fprovide (intern ("mac-carbon"), Qnil); |
59146
9bde7721ad0f
* dispextern.h: Change HAVE_CARBON to MAC_OS.
Steven Tamm <steventamm@mac.com>
parents:
59041
diff
changeset
|
11473 #endif |
49015
c49640262de0
* macterm.c (syms_of_macterm): Provide the feature "mac-carbon" to
Steven Tamm <steventamm@mac.com>
parents:
49003
diff
changeset
|
11474 |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11475 staticpro (&Qreverse); |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11476 Qreverse = intern ("reverse"); |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11477 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11478 staticpro (&x_display_name_list); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11479 x_display_name_list = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11480 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11481 staticpro (&last_mouse_scroll_bar); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11482 last_mouse_scroll_bar = Qnil; |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11483 |
66005
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
11484 staticpro (&fm_font_family_alist); |
f455f022b799
(PER_CHAR_METRIC): Remove unused macro.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65910
diff
changeset
|
11485 fm_font_family_alist = Qnil; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11486 |
65772
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
11487 #if USE_ATSUI |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
11488 staticpro (&atsu_font_id_hash); |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
11489 atsu_font_id_hash = Qnil; |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
11490 #endif |
797dc38b416e
(mac_draw_string_common, x_per_char_metric)
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
65643
diff
changeset
|
11491 |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11492 /* We don't yet support this, but defining this here avoids whining |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11493 from cus-start.el and other places, like "M-x set-variable". */ |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11494 DEFVAR_BOOL ("x-use-underline-position-properties", |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11495 &x_use_underline_position_properties, |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11496 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11497 nil means ignore them. If you encounter fonts with bogus |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11498 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11499 to 4.1, set this to nil. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11500 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11501 NOTE: Not supported on Mac yet. */); |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11502 x_use_underline_position_properties = 0; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11503 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11504 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11505 doc: /* If not nil, Emacs uses toolkit scroll bars. */); |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
11506 #ifdef USE_TOOLKIT_SCROLL_BARS |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11507 Vx_toolkit_scroll_bars = Qt; |
62103
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
11508 #else |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
11509 Vx_toolkit_scroll_bars = Qnil; |
2d42fd79f829
(toolkit_scroll_bar_interaction): Remove unused
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61786
diff
changeset
|
11510 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11511 |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11512 staticpro (&last_mouse_motion_frame); |
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11513 last_mouse_motion_frame = Qnil; |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
11514 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11515 /* Variables to configure modifier key assignment. */ |
66841
b633b787c04d
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): New function.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66818
diff
changeset
|
11516 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11517 DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier, |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11518 doc: /* *Modifier key assumed when the Mac control key is pressed. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11519 The value can be `control', `meta', `alt', `hyper', or `super' for the |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11520 respective modifier. The default is `control'. */); |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11521 Vmac_control_modifier = Qcontrol; |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11522 |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
11523 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11524 doc: /* *Modifier key assumed when the Mac alt/option key is pressed. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11525 The value can be `control', `meta', `alt', `hyper', or `super' for the |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11526 respective modifier. If the value is nil then the key will act as the |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11527 normal Mac control modifier, and the option key can be used to compose |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11528 characters depending on the chosen Mac keyboard setting. */); |
57783
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
11529 Vmac_option_modifier = Qnil; |
4cb8cebc3255
2004-10-28 Will <will@glozer.net>
John Wiegley <johnw@newartisans.com>
parents:
57425
diff
changeset
|
11530 |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11531 DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier, |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11532 doc: /* *Modifier key assumed when the Mac command key is pressed. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11533 The value can be `control', `meta', `alt', `hyper', or `super' for the |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11534 respective modifier. The default is `meta'. */); |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11535 Vmac_command_modifier = Qmeta; |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11536 |
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11537 DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier, |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11538 doc: /* *Modifier key assumed when the Mac function key is pressed. |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11539 The value can be `control', `meta', `alt', `hyper', or `super' for the |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11540 respective modifier. Note that remapping the function key may lead to |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11541 unexpected results for some keys on non-US/GB keyboards. */); |
66818
d85a089fce11
macterm.c (backtranslate_modified_keycode): New function to
Steven Tamm <steventamm@mac.com>
parents:
66431
diff
changeset
|
11542 Vmac_function_modifier = Qnil; |
46798 | 11543 |
55025
5cbecea4d4ad
(x_draw_relief_rect): Add top_p and bot_p args.
Kim F. Storm <storm@cua.dk>
parents:
54366
diff
changeset
|
11544 DEFVAR_LISP ("mac-emulate-three-button-mouse", |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11545 &Vmac_emulate_three_button_mouse, |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11546 doc: /* *Specify a way of three button mouse emulation. |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11547 The value can be nil, t, or the symbol `reverse'. |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11548 nil means that no emulation should be done and the modifiers should be |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11549 placed on the mouse-1 event. |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11550 t means that when the option-key is held down while pressing the mouse |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11551 button, the click will register as mouse-2 and while the command-key |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11552 is held down, the click will register as mouse-3. |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11553 The symbol `reverse' means that the option-key will register for |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11554 mouse-3 and the command-key will register for mouse-2. */); |
53956
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11555 Vmac_emulate_three_button_mouse = Qnil; |
922b1cbf208b
(Vmac_emulate_three_button_mouse): New variable for
Steven Tamm <steventamm@mac.com>
parents:
53935
diff
changeset
|
11556 |
46798 | 11557 #if USE_CARBON_EVENTS |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11558 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11559 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3. |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11560 Otherwise, the right click will be treated as mouse-2 and the wheel |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11561 button will be mouse-3. */); |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11562 mac_wheel_button_is_mouse_2 = 1; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11563 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11564 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11565 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */); |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11566 mac_pass_command_to_system = 1; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11567 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11568 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11569 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */); |
67666
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11570 mac_pass_control_to_system = 1; |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11571 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11572 #endif |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11573 |
037431c17fba
(mac_do_receive_drag): Drag-and-drop items are now
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67458
diff
changeset
|
11574 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11575 doc: /* *If non-nil, allow anti-aliasing. |
59586
2f6084ef9fec
(syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents:
59585
diff
changeset
|
11576 The text will be rendered using Core Graphics text rendering which |
2f6084ef9fec
(syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix.
Kim F. Storm <storm@cua.dk>
parents:
59585
diff
changeset
|
11577 may anti-alias the text. */); |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
11578 #if USE_CG_DRAWING |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
11579 mac_use_core_graphics = 1; |
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
11580 #else |
67672
ea51bc4acb2e
(syms_of_macterm) <mac-allow-anti-aliasing>: Fix unintended default
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67666
diff
changeset
|
11581 mac_use_core_graphics = 0; |
70304
085795461ed0
(mac_draw_line, mac_draw_line_to_pixmap): Adjust
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70149
diff
changeset
|
11582 #endif |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11583 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11584 /* Register an entry for `mac-roman' so that it can be used when |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11585 creating the terminal frame on Mac OS 9 before loading |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11586 term/mac-win.elc. */ |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11587 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist, |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11588 doc: /* Alist of Emacs character sets vs text encodings and coding systems. |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11589 Each entry should be of the form: |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11590 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11591 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM) |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11592 |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11593 where CHARSET-NAME is a string used in font names to identify the |
67101
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11594 charset, TEXT-ENCODING is a TextEncodingBase value in Mac, and |
f7f6ee6060c8
(Qcontrol): Rename from Qctrl. All uses changed.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
67000
diff
changeset
|
11595 CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */); |
61658
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11596 Vmac_charset_info_alist = |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11597 Fcons (list3 (build_string ("mac-roman"), |
38a086380ddc
(Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
61615
diff
changeset
|
11598 make_number (smRoman), Qnil), Qnil); |
70496
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11599 |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11600 #if USE_ATSUI |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11601 DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table, |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11602 doc: /* Hash table of ATSU font IDs vs plist of attributes and values. |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11603 Each font ID is represented as a four-byte string in native byte |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11604 order. */); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11605 Vmac_atsu_font_table = |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11606 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11607 make_float (DEFAULT_REHASH_SIZE), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11608 make_float (DEFAULT_REHASH_THRESHOLD), |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11609 Qnil, Qnil, Qnil); |
8b2250961fcc
(XLoadQueryFont) [USE_ATSUI]: Set FMFontFamily value
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
70384
diff
changeset
|
11610 #endif |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11611 #if USE_MAC_TSM |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11612 DEFVAR_LISP ("mac-ts-active-input-overlay", &Vmac_ts_active_input_overlay, |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11613 doc: /* Overlay used to display Mac TSM active input area. */); |
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11614 Vmac_ts_active_input_overlay = Qnil; |
71359
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11615 |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11616 DEFVAR_LISP ("mac-ts-script-language-on-focus", &Vmac_ts_script_language_on_focus, |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11617 doc: /* *How to change Mac TSM script/language when a frame gets focus. |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11618 If the value is t, the input script and language are restored to those |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11619 used in the last focus frame. If the value is a pair of integers, the |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11620 input script and language codes, which are defined in the Script |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11621 Manager, are set to its car and cdr parts, respectively. Otherwise, |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11622 Emacs doesn't set them and thus follows the system default behavior. */); |
4df3a065ee9b
(do_app_resume, do_app_suspend): Remove functions.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71241
diff
changeset
|
11623 Vmac_ts_script_language_on_focus = Qnil; |
71178
d098ef877d70
(tsm_document_id) [USE_MAC_TSM]: New variable.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
71135
diff
changeset
|
11624 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
diff
changeset
|
11625 } |
52401 | 11626 |
11627 /* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b | |
11628 (do not change this comment) */ |