Mercurial > hg > xemacs-beta
comparison src/objects-msw.c @ 5015:d95c102a96d3
cleanups for specifier font stages, from ben-unicode-internal (preparation for eliminating shadowed warnings)
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-08 Ben Wing <ben@xemacs.org>
* faces.c:
* faces.c (face_property_matching_instance):
* faces.c (ensure_face_cachel_contains_charset):
* faces.h (FACE_FONT):
* lisp.h:
* lisp.h (enum font_specifier_matchspec_stages):
* objects-msw.c:
* objects-msw.c (mswindows_font_spec_matches_charset):
* objects-msw.c (mswindows_find_charset_font):
* objects-tty.c:
* objects-tty.c (tty_font_spec_matches_charset):
* objects-tty.c (tty_find_charset_font):
* objects-xlike-inc.c:
* objects-xlike-inc.c (XFUN):
* objects-xlike-inc.c (xft_find_charset_font):
* objects.c:
* objects.c (font_instantiate):
* objects.c (FROB):
* specifier.c:
* specifier.c (charset_matches_specifier_tag_set_p):
* specifier.c (call_charset_predicate):
* specifier.c (define_specifier_tag):
* specifier.c (Fdefine_specifier_tag):
* specifier.c (setup_charset_initial_specifier_tags):
* specifier.c (specifier_instance_from_inst_list):
* specifier.c (FROB):
* specifier.c (vars_of_specifier):
* specifier.h:
Rename the specifier-font-matching stages in preparation for
eliminating shadowed warnings, some other related fixes from
ben-unicode-internal.
1. Rename raw enums:
initial -> STAGE_INITIAL
final -> STAGE_FINAL
impossible -> NUM_MATCHSPEC_STAGES
2. Move `enum font_specifier_matchspec_stages' from
specifier.h to lisp.h.
3. Whitespace changes to match coding standards.
4. Eliminate unused second argument STAGE in charset predicates
that don't use it -- the code that calls the charset predicates
is now smart enough to supply the right number of arguments
automatically.
5. Add some long(ish) comments and authorial notices, esp. in
objects.c.
6. In specifier.c, change Vcharset_tag_lists from a vector over
leading bytes to a hash table over charsets. This change is
unnecessary currently but doesn't hurt and will be required
when we merge in Unicode-internal.
7. In specifier.c, extract out the code that calls charset predicates
into a function call_charset_predicate().
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 08 Feb 2010 16:51:25 -0600 |
parents | 3c3c1d139863 |
children | 2ade80e8c640 |
comparison
equal
deleted
inserted
replaced
5014:c2e0c3af5fe3 | 5015:d95c102a96d3 |
---|---|
1 /* mswindows-specific Lisp objects. | 1 /* mswindows-specific Lisp objects. |
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Board of Trustees, University of Illinois. | 3 Copyright (C) 1995 Board of Trustees, University of Illinois. |
4 Copyright (C) 1995 Tinker Systems. | 4 Copyright (C) 1995 Tinker Systems. |
5 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing. | 5 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2010 Ben Wing. |
6 Copyright (C) 1995 Sun Microsystems, Inc. | 6 Copyright (C) 1995 Sun Microsystems, Inc. |
7 Copyright (C) 1997 Jonathan Harris. | 7 Copyright (C) 1997 Jonathan Harris. |
8 | 8 |
9 This file is part of XEmacs. | 9 This file is part of XEmacs. |
10 | 10 |
25 | 25 |
26 /* Synched up with: Not in FSF. */ | 26 /* Synched up with: Not in FSF. */ |
27 | 27 |
28 /* Authorship: | 28 /* Authorship: |
29 | 29 |
30 Jamie Zawinski, Chuck Thompson, Ben Wing | 30 This file created by Jonathan Harris, November 1997 for 21.0; based |
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0. | 31 heavily on objects-x.c (see authorship there). Much further work |
32 by Ben Wing. | |
32 */ | 33 */ |
33 | 34 |
34 /* This function Mule-ized by Ben Wing, 3-24-02. */ | 35 /* This function Mule-ized by Ben Wing, 3-24-02. */ |
35 | 36 |
36 /* TODO: palette handling */ | 37 /* TODO: palette handling */ |
2014 return !qxestrcasecmp (XSTRING_DATA (charset_registry), font_charset); | 2015 return !qxestrcasecmp (XSTRING_DATA (charset_registry), font_charset); |
2015 } | 2016 } |
2016 | 2017 |
2017 /* | 2018 /* |
2018 | 2019 |
2020 #### The following comment is old and probably not applicable any longer. | |
2021 | |
2019 1. handle standard mapping and inheritance vectors properly in Face-frob-property. | 2022 1. handle standard mapping and inheritance vectors properly in Face-frob-property. |
2020 2. finish impl of mswindows-charset-registry. | 2023 2. finish impl of mswindows-charset-registry. |
2021 3. see if everything works under fixup, now that i copied the stuff over. | 2024 3. see if everything works under fixup, now that i copied the stuff over. |
2022 4. consider generalizing Face-frob-property to frob-specifier. | 2025 4. consider generalizing Face-frob-property to frob-specifier. |
2023 5. maybe extract some of the flets out of Face-frob-property as useful specifier frobbing. | 2026 5. maybe extract some of the flets out of Face-frob-property as useful specifier frobbing. |
2182 const Ibyte *nonreloc, | 2185 const Ibyte *nonreloc, |
2183 Lisp_Object reloc, | 2186 Lisp_Object reloc, |
2184 Bytecount offset, Bytecount length, | 2187 Bytecount offset, Bytecount length, |
2185 enum font_specifier_matchspec_stages stage) | 2188 enum font_specifier_matchspec_stages stage) |
2186 { | 2189 { |
2187 return stage ? | 2190 return stage == STAGE_FINAL ? |
2188 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc, | 2191 mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc, |
2189 reloc, offset, length) | 2192 reloc, offset, length) |
2190 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc, | 2193 : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc, |
2191 reloc, offset, length); | 2194 reloc, offset, length); |
2192 } | 2195 } |
2204 | 2207 |
2205 /* If FONT specifies a particular charset, this will only list fonts with | 2208 /* If FONT specifies a particular charset, this will only list fonts with |
2206 that charset; otherwise, it will list fonts with all charsets. */ | 2209 that charset; otherwise, it will list fonts with all charsets. */ |
2207 fontlist = mswindows_font_list (font, device, Qnil); | 2210 fontlist = mswindows_font_list (font, device, Qnil); |
2208 | 2211 |
2209 if (!stage) | 2212 if (stage == STAGE_INITIAL) |
2210 { | 2213 { |
2211 LIST_LOOP (fonttail, fontlist) | 2214 LIST_LOOP (fonttail, fontlist) |
2212 { | 2215 { |
2213 if (mswindows_font_spec_matches_charset_stage_1 | 2216 if (mswindows_font_spec_matches_charset_stage_1 |
2214 (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) | 2217 (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1)) |