diff options
| author | Jason Rumney | 2000-11-10 22:15:52 +0000 |
|---|---|---|
| committer | Jason Rumney | 2000-11-10 22:15:52 +0000 |
| commit | 767b1ff036dbf9a84b3535e7a621c4e5dc07a512 (patch) | |
| tree | b7aef1141b060667a97aaff49dc1c083b31b2b52 /src | |
| parent | 02f593f3d0c929553d017f6b2c25bdffd6db80dd (diff) | |
| download | emacs-767b1ff036dbf9a84b3535e7a621c4e5dc07a512.tar.gz emacs-767b1ff036dbf9a84b3535e7a621c4e5dc07a512.zip | |
(Qw32_charset_hangeul): Rename to match w32 headers.
(Qw32_charset_vietnamese): New symbol.
(xlfd_charset_of_font): New function.
(w32_load_system_font): Use it.
(x_to_w32_charset): Use Fassoc to find charset info. Special case
when Vw32_charset_info_alist is nil to ensure default face always
has font. Use Fcar and Fcdr for safety.
(w32_to_x_charset): Use Vw32_charset_info_alist for mappings.
(w32_codepage_for_font): Use xlfd_charset_of_font. Use new
pseudo-codepages for special cases.
(w32_to_x_font): New parameter to allow charset portion to be
specified where there is many to one mapping. Callers changed.
(w32_list_fonts): Avoid listing fonts that won't display.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 470 |
1 files changed, 321 insertions, 149 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 405694397f8..a0bd2b67451 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -276,7 +276,7 @@ Lisp_Object Qw32_charset_ansi; | |||
| 276 | Lisp_Object Qw32_charset_default; | 276 | Lisp_Object Qw32_charset_default; |
| 277 | Lisp_Object Qw32_charset_symbol; | 277 | Lisp_Object Qw32_charset_symbol; |
| 278 | Lisp_Object Qw32_charset_shiftjis; | 278 | Lisp_Object Qw32_charset_shiftjis; |
| 279 | Lisp_Object Qw32_charset_hangul; | 279 | Lisp_Object Qw32_charset_hangeul; |
| 280 | Lisp_Object Qw32_charset_gb2312; | 280 | Lisp_Object Qw32_charset_gb2312; |
| 281 | Lisp_Object Qw32_charset_chinesebig5; | 281 | Lisp_Object Qw32_charset_chinesebig5; |
| 282 | Lisp_Object Qw32_charset_oem; | 282 | Lisp_Object Qw32_charset_oem; |
| @@ -292,6 +292,7 @@ Lisp_Object Qw32_charset_russian; | |||
| 292 | Lisp_Object Qw32_charset_arabic; | 292 | Lisp_Object Qw32_charset_arabic; |
| 293 | Lisp_Object Qw32_charset_greek; | 293 | Lisp_Object Qw32_charset_greek; |
| 294 | Lisp_Object Qw32_charset_hebrew; | 294 | Lisp_Object Qw32_charset_hebrew; |
| 295 | Lisp_Object Qw32_charset_vietnamese; | ||
| 295 | Lisp_Object Qw32_charset_thai; | 296 | Lisp_Object Qw32_charset_thai; |
| 296 | Lisp_Object Qw32_charset_johab; | 297 | Lisp_Object Qw32_charset_johab; |
| 297 | Lisp_Object Qw32_charset_mac; | 298 | Lisp_Object Qw32_charset_mac; |
| @@ -427,7 +428,7 @@ x_window_to_frame (dpyinfo, wdesc) | |||
| 427 | if (f->output_data.w32->busy_window == wdesc) | 428 | if (f->output_data.w32->busy_window == wdesc) |
| 428 | return f; | 429 | return f; |
| 429 | 430 | ||
| 430 | /* NTEMACS_TODO: Check tooltips when supported. */ | 431 | /* TODO: Check tooltips when supported. */ |
| 431 | if (FRAME_W32_WINDOW (f) == wdesc) | 432 | if (FRAME_W32_WINDOW (f) == wdesc) |
| 432 | return f; | 433 | return f; |
| 433 | } | 434 | } |
| @@ -557,7 +558,7 @@ x_create_bitmap_from_file (f, file) | |||
| 557 | Lisp_Object file; | 558 | Lisp_Object file; |
| 558 | { | 559 | { |
| 559 | return -1; | 560 | return -1; |
| 560 | #if 0 /* NTEMACS_TODO : bitmap support */ | 561 | #if 0 /* TODO : bitmap support */ |
| 561 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 562 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 562 | unsigned int width, height; | 563 | unsigned int width, height; |
| 563 | HBITMAP bitmap; | 564 | HBITMAP bitmap; |
| @@ -611,7 +612,7 @@ x_create_bitmap_from_file (f, file) | |||
| 611 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); | 612 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); |
| 612 | 613 | ||
| 613 | return id; | 614 | return id; |
| 614 | #endif /* NTEMACS_TODO */ | 615 | #endif /* TODO */ |
| 615 | } | 616 | } |
| 616 | 617 | ||
| 617 | /* Remove reference to bitmap with id number ID. */ | 618 | /* Remove reference to bitmap with id number ID. */ |
| @@ -690,7 +691,7 @@ struct x_frame_parm_table | |||
| 690 | void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 691 | void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 691 | }; | 692 | }; |
| 692 | 693 | ||
| 693 | /* NTEMACS_TODO: Native Input Method support; see x_create_im. */ | 694 | /* TODO: Native Input Method support; see x_create_im. */ |
| 694 | void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 695 | void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 695 | static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 696 | static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| 696 | void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); | 697 | void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); |
| @@ -2036,7 +2037,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 2036 | && mask_color == FRAME_BACKGROUND_PIXEL (f)) | 2037 | && mask_color == FRAME_BACKGROUND_PIXEL (f)) |
| 2037 | f->output_data.w32->mouse_pixel = FRAME_FOREGROUND_PIXEL (f); | 2038 | f->output_data.w32->mouse_pixel = FRAME_FOREGROUND_PIXEL (f); |
| 2038 | 2039 | ||
| 2039 | #if 0 /* NTEMACS_TODO : cursor changes */ | 2040 | #if 0 /* TODO : cursor changes */ |
| 2040 | BLOCK_INPUT; | 2041 | BLOCK_INPUT; |
| 2041 | 2042 | ||
| 2042 | /* It's not okay to crash if the user selects a screwy cursor. */ | 2043 | /* It's not okay to crash if the user selects a screwy cursor. */ |
| @@ -2152,7 +2153,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 2152 | UNBLOCK_INPUT; | 2153 | UNBLOCK_INPUT; |
| 2153 | 2154 | ||
| 2154 | update_face_from_frame_parameter (f, Qmouse_color, arg); | 2155 | update_face_from_frame_parameter (f, Qmouse_color, arg); |
| 2155 | #endif /* NTEMACS_TODO */ | 2156 | #endif /* TODO */ |
| 2156 | } | 2157 | } |
| 2157 | 2158 | ||
| 2158 | void | 2159 | void |
| @@ -5360,8 +5361,28 @@ DEFUN ("w32-focus-frame", Fw32_focus_frame, Sw32_focus_frame, 1, 1, 0, | |||
| 5360 | } | 5361 | } |
| 5361 | 5362 | ||
| 5362 | 5363 | ||
| 5364 | /* Return the charset portion of a font name. */ | ||
| 5365 | char * xlfd_charset_of_font (char * fontname) | ||
| 5366 | { | ||
| 5367 | char *charset, *encoding; | ||
| 5368 | |||
| 5369 | encoding = strrchr(fontname, '-'); | ||
| 5370 | if (!encoding) | ||
| 5371 | return NULL; | ||
| 5372 | |||
| 5373 | *encoding = 0; | ||
| 5374 | charset = strrchr(fontname, '-'); | ||
| 5375 | *encoding = '-'; | ||
| 5376 | |||
| 5377 | if (!charset || strcmp(charset, "-*-*") == 0) | ||
| 5378 | return NULL; | ||
| 5379 | |||
| 5380 | return charset + 1; | ||
| 5381 | } | ||
| 5382 | |||
| 5363 | struct font_info *w32_load_bdf_font (struct frame *f, char *fontname, | 5383 | struct font_info *w32_load_bdf_font (struct frame *f, char *fontname, |
| 5364 | int size, char* filename); | 5384 | int size, char* filename); |
| 5385 | BOOL w32_to_x_font (LOGFONT * lplf, char * lpxstr, int len, char * charset); | ||
| 5365 | 5386 | ||
| 5366 | struct font_info * | 5387 | struct font_info * |
| 5367 | w32_load_system_font (f,fontname,size) | 5388 | w32_load_system_font (f,fontname,size) |
| @@ -5411,7 +5432,7 @@ w32_load_system_font (f,fontname,size) | |||
| 5411 | 5432 | ||
| 5412 | /* Load the font and add it to the table. */ | 5433 | /* Load the font and add it to the table. */ |
| 5413 | { | 5434 | { |
| 5414 | char *full_name, *encoding; | 5435 | char *full_name, *encoding, *charset; |
| 5415 | XFontStruct *font; | 5436 | XFontStruct *font; |
| 5416 | struct font_info *fontp; | 5437 | struct font_info *fontp; |
| 5417 | LOGFONT lf; | 5438 | LOGFONT lf; |
| @@ -5504,9 +5525,11 @@ w32_load_system_font (f,fontname,size) | |||
| 5504 | fontp->name = (char *) xmalloc (strlen (fontname) + 1); | 5525 | fontp->name = (char *) xmalloc (strlen (fontname) + 1); |
| 5505 | bcopy (fontname, fontp->name, strlen (fontname) + 1); | 5526 | bcopy (fontname, fontp->name, strlen (fontname) + 1); |
| 5506 | 5527 | ||
| 5528 | charset = xlfd_charset_of_font (fontname); | ||
| 5529 | |||
| 5507 | /* Work out the font's full name. */ | 5530 | /* Work out the font's full name. */ |
| 5508 | full_name = (char *)xmalloc (100); | 5531 | full_name = (char *)xmalloc (100); |
| 5509 | if (full_name && w32_to_x_font (&lf, full_name, 100)) | 5532 | if (full_name && w32_to_x_font (&lf, full_name, 100, charset)) |
| 5510 | fontp->full_name = full_name; | 5533 | fontp->full_name = full_name; |
| 5511 | else | 5534 | else |
| 5512 | { | 5535 | { |
| @@ -5668,63 +5691,68 @@ LONG | |||
| 5668 | x_to_w32_charset (lpcs) | 5691 | x_to_w32_charset (lpcs) |
| 5669 | char * lpcs; | 5692 | char * lpcs; |
| 5670 | { | 5693 | { |
| 5671 | Lisp_Object rest; | 5694 | Lisp_Object this_entry, w32_charset; |
| 5672 | 5695 | ||
| 5673 | /* Look through w32-charset-info-alist for the character set. | 5696 | /* Look through w32-charset-info-alist for the character set. |
| 5674 | Format of each entry is | 5697 | Format of each entry is |
| 5675 | (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). | 5698 | (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). |
| 5676 | */ | 5699 | */ |
| 5677 | for (rest = Vw32_charset_info_alist; CONSP (rest); rest = XCDR (rest)) | 5700 | this_entry = Fassoc (build_string(lpcs), Vw32_charset_info_alist); |
| 5678 | { | ||
| 5679 | Lisp_Object this_entry = XCAR (rest); | ||
| 5680 | char * x_charset = XSTRING (XCAR (this_entry))->data; | ||
| 5681 | 5701 | ||
| 5682 | if (strnicmp (lpcs, x_charset, strlen(x_charset)) == 0) | 5702 | if (NILP(this_entry)) |
| 5683 | { | 5703 | { |
| 5684 | Lisp_Object w32_charset = XCAR (XCDR (this_entry)); | 5704 | /* At startup, we want iso8859-1 fonts to come up properly. */ |
| 5685 | // Translate Lisp symbol to number. | 5705 | if (stricmp(lpcs, "iso8859-1") == 0) |
| 5686 | if (w32_charset == Qw32_charset_ansi) | 5706 | return ANSI_CHARSET; |
| 5687 | return ANSI_CHARSET; | 5707 | else |
| 5688 | if (w32_charset == Qw32_charset_symbol) | 5708 | return DEFAULT_CHARSET; |
| 5689 | return SYMBOL_CHARSET; | 5709 | } |
| 5690 | if (w32_charset == Qw32_charset_shiftjis) | 5710 | |
| 5691 | return SHIFTJIS_CHARSET; | 5711 | w32_charset = Fcar (Fcdr (this_entry)); |
| 5692 | if (w32_charset == Qw32_charset_hangul) | 5712 | |
| 5693 | return HANGEUL_CHARSET; | 5713 | // Translate Lisp symbol to number. |
| 5694 | if (w32_charset == Qw32_charset_chinesebig5) | 5714 | if (w32_charset == Qw32_charset_ansi) |
| 5695 | return CHINESEBIG5_CHARSET; | 5715 | return ANSI_CHARSET; |
| 5696 | if (w32_charset == Qw32_charset_gb2312) | 5716 | if (w32_charset == Qw32_charset_symbol) |
| 5697 | return GB2312_CHARSET; | 5717 | return SYMBOL_CHARSET; |
| 5698 | if (w32_charset == Qw32_charset_oem) | 5718 | if (w32_charset == Qw32_charset_shiftjis) |
| 5699 | return OEM_CHARSET; | 5719 | return SHIFTJIS_CHARSET; |
| 5720 | if (w32_charset == Qw32_charset_hangeul) | ||
| 5721 | return HANGEUL_CHARSET; | ||
| 5722 | if (w32_charset == Qw32_charset_chinesebig5) | ||
| 5723 | return CHINESEBIG5_CHARSET; | ||
| 5724 | if (w32_charset == Qw32_charset_gb2312) | ||
| 5725 | return GB2312_CHARSET; | ||
| 5726 | if (w32_charset == Qw32_charset_oem) | ||
| 5727 | return OEM_CHARSET; | ||
| 5700 | #ifdef JOHAB_CHARSET | 5728 | #ifdef JOHAB_CHARSET |
| 5701 | if (w32_charset == Qw32_charset_johab) | 5729 | if (w32_charset == Qw32_charset_johab) |
| 5702 | return JOHAB_CHARSET; | 5730 | return JOHAB_CHARSET; |
| 5703 | if (w32_charset == Qw32_charset_easteurope) | 5731 | if (w32_charset == Qw32_charset_easteurope) |
| 5704 | return EASTEUROPE_CHARSET; | 5732 | return EASTEUROPE_CHARSET; |
| 5705 | if (w32_charset == Qw32_charset_turkish) | 5733 | if (w32_charset == Qw32_charset_turkish) |
| 5706 | return TURKISH_CHARSET; | 5734 | return TURKISH_CHARSET; |
| 5707 | if (w32_charset == Qw32_charset_baltic) | 5735 | if (w32_charset == Qw32_charset_baltic) |
| 5708 | return BALTIC_CHARSET; | 5736 | return BALTIC_CHARSET; |
| 5709 | if (w32_charset == Qw32_charset_russian) | 5737 | if (w32_charset == Qw32_charset_russian) |
| 5710 | return RUSSIAN_CHARSET; | 5738 | return RUSSIAN_CHARSET; |
| 5711 | if (w32_charset == Qw32_charset_arabic) | 5739 | if (w32_charset == Qw32_charset_arabic) |
| 5712 | return ARABIC_CHARSET; | 5740 | return ARABIC_CHARSET; |
| 5713 | if (w32_charset == Qw32_charset_greek) | 5741 | if (w32_charset == Qw32_charset_greek) |
| 5714 | return GREEK_CHARSET; | 5742 | return GREEK_CHARSET; |
| 5715 | if (w32_charset == Qw32_charset_hebrew) | 5743 | if (w32_charset == Qw32_charset_hebrew) |
| 5716 | return HEBREW_CHARSET; | 5744 | return HEBREW_CHARSET; |
| 5717 | if (w32_charset == Qw32_charset_thai) | 5745 | if (w32_charset == Qw32_charset_vietnamese) |
| 5718 | return THAI_CHARSET; | 5746 | return VIETNAMESE_CHARSET; |
| 5719 | if (w32_charset == Qw32_charset_mac) | 5747 | if (w32_charset == Qw32_charset_thai) |
| 5720 | return MAC_CHARSET; | 5748 | return THAI_CHARSET; |
| 5749 | if (w32_charset == Qw32_charset_mac) | ||
| 5750 | return MAC_CHARSET; | ||
| 5721 | #endif /* JOHAB_CHARSET */ | 5751 | #endif /* JOHAB_CHARSET */ |
| 5722 | #ifdef UNICODE_CHARSET | 5752 | #ifdef UNICODE_CHARSET |
| 5723 | if (w32_charset == Qw32_charset_unicode) | 5753 | if (w32_charset == Qw32_charset_unicode) |
| 5724 | return UNICODE_CHARSET; | 5754 | return UNICODE_CHARSET; |
| 5725 | #endif | 5755 | #endif |
| 5726 | } | ||
| 5727 | } | ||
| 5728 | 5756 | ||
| 5729 | return DEFAULT_CHARSET; | 5757 | return DEFAULT_CHARSET; |
| 5730 | } | 5758 | } |
| @@ -5735,54 +5763,156 @@ w32_to_x_charset (fncharset) | |||
| 5735 | int fncharset; | 5763 | int fncharset; |
| 5736 | { | 5764 | { |
| 5737 | static char buf[16]; | 5765 | static char buf[16]; |
| 5766 | Lisp_Object charset_type; | ||
| 5738 | 5767 | ||
| 5739 | /* NTEMACS_TODO: use w32-charset-info-alist. Multiple matches | ||
| 5740 | are possible, so this will require more than just a rewrite of | ||
| 5741 | this function. w32_to_x_font is the only user of this function, | ||
| 5742 | and that will require rewriting too, and its users. */ | ||
| 5743 | switch (fncharset) | 5768 | switch (fncharset) |
| 5744 | { | 5769 | { |
| 5745 | /* ansi is considered iso8859-1, as most modern ansi fonts are. */ | 5770 | case ANSI_CHARSET: |
| 5746 | case ANSI_CHARSET: return "iso8859-1"; | 5771 | /* Handle startup case of w32-charset-info-alist not |
| 5747 | case DEFAULT_CHARSET: return "ascii-*"; | 5772 | being set up yet. */ |
| 5748 | case SYMBOL_CHARSET: return "ms-symbol"; | 5773 | if (NILP(Vw32_charset_info_alist)) |
| 5749 | case SHIFTJIS_CHARSET: return "jisx0208-sjis"; | 5774 | return "iso8859-1"; |
| 5750 | case HANGEUL_CHARSET: return "ksc5601.1987-*"; | 5775 | charset_type = Qw32_charset_ansi; |
| 5751 | case GB2312_CHARSET: return "gb2312-*"; | 5776 | break; |
| 5752 | case CHINESEBIG5_CHARSET: return "big5-*"; | 5777 | case DEFAULT_CHARSET: |
| 5753 | case OEM_CHARSET: return "ms-oem"; | 5778 | charset_type = Qw32_charset_default; |
| 5779 | break; | ||
| 5780 | case SYMBOL_CHARSET: | ||
| 5781 | charset_type = Qw32_charset_symbol; | ||
| 5782 | break; | ||
| 5783 | case SHIFTJIS_CHARSET: | ||
| 5784 | charset_type = Qw32_charset_shiftjis; | ||
| 5785 | break; | ||
| 5786 | case HANGEUL_CHARSET: | ||
| 5787 | charset_type = Qw32_charset_hangeul; | ||
| 5788 | break; | ||
| 5789 | case GB2312_CHARSET: | ||
| 5790 | charset_type = Qw32_charset_gb2312; | ||
| 5791 | break; | ||
| 5792 | case CHINESEBIG5_CHARSET: | ||
| 5793 | charset_type = Qw32_charset_chinesebig5; | ||
| 5794 | break; | ||
| 5795 | case OEM_CHARSET: | ||
| 5796 | charset_type = Qw32_charset_oem; | ||
| 5797 | break; | ||
| 5754 | 5798 | ||
| 5755 | /* More recent versions of Windows (95 and NT4.0) define more | 5799 | /* More recent versions of Windows (95 and NT4.0) define more |
| 5756 | character sets. */ | 5800 | character sets. */ |
| 5757 | #ifdef EASTEUROPE_CHARSET | 5801 | #ifdef EASTEUROPE_CHARSET |
| 5758 | case EASTEUROPE_CHARSET: return "iso8859-2"; | 5802 | case EASTEUROPE_CHARSET: |
| 5759 | case TURKISH_CHARSET: return "iso8859-9"; | 5803 | charset_type = Qw32_charset_easteurope; |
| 5760 | case BALTIC_CHARSET: return "iso8859-4"; | 5804 | break; |
| 5761 | 5805 | case TURKISH_CHARSET: | |
| 5762 | /* W95 with international support but not IE4 often has the | 5806 | charset_type = Qw32_charset_turkish; |
| 5763 | KOI8-R codepage but not ISO8859-5. */ | 5807 | break; |
| 5808 | case BALTIC_CHARSET: | ||
| 5809 | charset_type = Qw32_charset_baltic; | ||
| 5810 | break; | ||
| 5764 | case RUSSIAN_CHARSET: | 5811 | case RUSSIAN_CHARSET: |
| 5765 | if (!IsValidCodePage(28595) && IsValidCodePage(20886)) | 5812 | charset_type = Qw32_charset_russian; |
| 5766 | return "koi8-r"; | 5813 | break; |
| 5767 | else | 5814 | case ARABIC_CHARSET: |
| 5768 | return "iso8859-5"; | 5815 | charset_type = Qw32_charset_arabic; |
| 5769 | case ARABIC_CHARSET: return "iso8859-6"; | 5816 | break; |
| 5770 | case GREEK_CHARSET: return "iso8859-7"; | 5817 | case GREEK_CHARSET: |
| 5771 | case HEBREW_CHARSET: return "iso8859-8"; | 5818 | charset_type = Qw32_charset_greek; |
| 5772 | case VIETNAMESE_CHARSET: return "viscii1.1-*"; | 5819 | break; |
| 5773 | case THAI_CHARSET: return "tis620-*"; | 5820 | case HEBREW_CHARSET: |
| 5774 | case MAC_CHARSET: return "mac-*"; | 5821 | charset_type = Qw32_charset_hebrew; |
| 5775 | case JOHAB_CHARSET: return "ksc5601.1992-*"; | 5822 | break; |
| 5776 | 5823 | case VIETNAMESE_CHARSET: | |
| 5824 | charset_type = Qw32_charset_vietnamese; | ||
| 5825 | break; | ||
| 5826 | case THAI_CHARSET: | ||
| 5827 | charset_type = Qw32_charset_thai; | ||
| 5828 | break; | ||
| 5829 | case MAC_CHARSET: | ||
| 5830 | charset_type = Qw32_charset_mac; | ||
| 5831 | break; | ||
| 5832 | case JOHAB_CHARSET: | ||
| 5833 | charset_type = Qw32_charset_johab; | ||
| 5834 | break; | ||
| 5777 | #endif | 5835 | #endif |
| 5778 | 5836 | ||
| 5779 | #ifdef UNICODE_CHARSET | 5837 | #ifdef UNICODE_CHARSET |
| 5780 | case UNICODE_CHARSET: return "iso10646-unicode"; | 5838 | case UNICODE_CHARSET: |
| 5839 | charset_type = Qw32_charset_unicode; | ||
| 5840 | break; | ||
| 5781 | #endif | 5841 | #endif |
| 5842 | default: | ||
| 5843 | /* Encode numerical value of unknown charset. */ | ||
| 5844 | sprintf (buf, "*-#%u", fncharset); | ||
| 5845 | return buf; | ||
| 5782 | } | 5846 | } |
| 5783 | /* Encode numerical value of unknown charset. */ | 5847 | |
| 5784 | sprintf (buf, "*-#%u", fncharset); | 5848 | { |
| 5785 | return buf; | 5849 | Lisp_Object rest; |
| 5850 | char * best_match = NULL; | ||
| 5851 | |||
| 5852 | /* Look through w32-charset-info-alist for the character set. | ||
| 5853 | Prefer ISO codepages, and prefer lower numbers in the ISO | ||
| 5854 | range. Only return charsets for codepages which are installed. | ||
| 5855 | |||
| 5856 | Format of each entry is | ||
| 5857 | (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). | ||
| 5858 | */ | ||
| 5859 | for (rest = Vw32_charset_info_alist; CONSP (rest); rest = XCDR (rest)) | ||
| 5860 | { | ||
| 5861 | char * x_charset; | ||
| 5862 | Lisp_Object w32_charset; | ||
| 5863 | Lisp_Object codepage; | ||
| 5864 | |||
| 5865 | Lisp_Object this_entry = XCAR (rest); | ||
| 5866 | |||
| 5867 | /* Skip invalid entries in alist. */ | ||
| 5868 | if (!CONSP (this_entry) || !STRINGP (XCAR (this_entry)) | ||
| 5869 | || !CONSP (XCDR (this_entry)) | ||
| 5870 | || !SYMBOLP (XCAR (XCDR (this_entry)))) | ||
| 5871 | continue; | ||
| 5872 | |||
| 5873 | x_charset = XSTRING (XCAR (this_entry))->data; | ||
| 5874 | w32_charset = XCAR (XCDR (this_entry)); | ||
| 5875 | codepage = XCDR (XCDR (this_entry)); | ||
| 5876 | |||
| 5877 | /* Look for Same charset and a valid codepage (or non-int | ||
| 5878 | which means ignore). */ | ||
| 5879 | if (w32_charset == charset_type | ||
| 5880 | && (!INTEGERP (codepage) || codepage == CP_DEFAULT | ||
| 5881 | || IsValidCodePage (XINT (codepage)))) | ||
| 5882 | { | ||
| 5883 | /* If we don't have a match already, then this is the | ||
| 5884 | best. */ | ||
| 5885 | if (!best_match) | ||
| 5886 | best_match = x_charset; | ||
| 5887 | /* If this is an ISO codepage, and the best so far isn't, | ||
| 5888 | then this is better. */ | ||
| 5889 | else if (stricmp (best_match, "iso") != 0 | ||
| 5890 | && stricmp (x_charset, "iso") == 0) | ||
| 5891 | best_match = x_charset; | ||
| 5892 | /* If both are ISO8859 codepages, choose the one with the | ||
| 5893 | lowest number in the encoding field. */ | ||
| 5894 | else if (stricmp (best_match, "iso8859-") == 0 | ||
| 5895 | && stricmp (x_charset, "iso8859-") == 0) | ||
| 5896 | { | ||
| 5897 | int best_enc = atoi (best_match + 8); | ||
| 5898 | int this_enc = atoi (x_charset + 8); | ||
| 5899 | if (this_enc > 0 && this_enc < best_enc) | ||
| 5900 | best_match = x_charset; | ||
| 5901 | } | ||
| 5902 | } | ||
| 5903 | } | ||
| 5904 | |||
| 5905 | /* If no match, encode the numeric value. */ | ||
| 5906 | if (!best_match) | ||
| 5907 | { | ||
| 5908 | sprintf (buf, "*-#%u", fncharset); | ||
| 5909 | return buf; | ||
| 5910 | } | ||
| 5911 | |||
| 5912 | strncpy(buf, best_match, 15); | ||
| 5913 | buf[15] = '\0'; | ||
| 5914 | return buf; | ||
| 5915 | } | ||
| 5786 | } | 5916 | } |
| 5787 | 5917 | ||
| 5788 | 5918 | ||
| @@ -5792,15 +5922,21 @@ w32_to_x_charset (fncharset) | |||
| 5792 | int | 5922 | int |
| 5793 | w32_codepage_for_font (char *fontname) | 5923 | w32_codepage_for_font (char *fontname) |
| 5794 | { | 5924 | { |
| 5795 | Lisp_Object codepage; | 5925 | Lisp_Object codepage, entry; |
| 5796 | char charset_str[20], *charset, *end; | 5926 | char *charset_str, *charset, *end; |
| 5797 | 5927 | ||
| 5798 | /* Extract charset part of font string. */ | 5928 | if (NILP (Vw32_charset_info_alist)) |
| 5799 | if (sscanf (fontname, | ||
| 5800 | "-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%19s", | ||
| 5801 | charset_str) < 1) | ||
| 5802 | return CP_DEFAULT; | 5929 | return CP_DEFAULT; |
| 5803 | 5930 | ||
| 5931 | /* Extract charset part of font string. */ | ||
| 5932 | charset = xlfd_charset_of_font (fontname); | ||
| 5933 | |||
| 5934 | if (!charset) | ||
| 5935 | return CP_INVALID; | ||
| 5936 | |||
| 5937 | charset_str = (char *) alloca (strlen (charset)); | ||
| 5938 | strcpy (charset_str, charset); | ||
| 5939 | |||
| 5804 | /* Remove leading "*-". */ | 5940 | /* Remove leading "*-". */ |
| 5805 | if (strncmp ("*-", charset_str, 2) == 0) | 5941 | if (strncmp ("*-", charset_str, 2) == 0) |
| 5806 | charset = charset_str + 2; | 5942 | charset = charset_str + 2; |
| @@ -5815,20 +5951,29 @@ w32_codepage_for_font (char *fontname) | |||
| 5815 | *end = '\0'; | 5951 | *end = '\0'; |
| 5816 | } | 5952 | } |
| 5817 | 5953 | ||
| 5818 | codepage = Fcdr (Fcdr (Fassoc (build_string(charset), | 5954 | entry = Fassoc (build_string(charset), Vw32_charset_info_alist); |
| 5819 | Vw32_charset_info_alist))); | 5955 | if (NILP (entry)) |
| 5820 | if (INTEGERP (codepage)) | 5956 | return CP_INVALID; |
| 5957 | |||
| 5958 | codepage = Fcdr (Fcdr (entry)); | ||
| 5959 | |||
| 5960 | if (NILP (codepage)) | ||
| 5961 | return CP_8BIT; | ||
| 5962 | else if (XFASTINT (codepage) == XFASTINT (Qt)) | ||
| 5963 | return CP_UNICODE; | ||
| 5964 | else if (INTEGERP (codepage)) | ||
| 5821 | return XINT (codepage); | 5965 | return XINT (codepage); |
| 5822 | else | 5966 | else |
| 5823 | return CP_DEFAULT; | 5967 | return CP_INVALID; |
| 5824 | } | 5968 | } |
| 5825 | 5969 | ||
| 5826 | 5970 | ||
| 5827 | BOOL | 5971 | BOOL |
| 5828 | w32_to_x_font (lplogfont, lpxstr, len) | 5972 | w32_to_x_font (lplogfont, lpxstr, len, specific_charset) |
| 5829 | LOGFONT * lplogfont; | 5973 | LOGFONT * lplogfont; |
| 5830 | char * lpxstr; | 5974 | char * lpxstr; |
| 5831 | int len; | 5975 | int len; |
| 5976 | char * specific_charset; | ||
| 5832 | { | 5977 | { |
| 5833 | char* fonttype; | 5978 | char* fonttype; |
| 5834 | char *fontname; | 5979 | char *fontname; |
| @@ -5902,8 +6047,9 @@ w32_to_x_font (lplogfont, lpxstr, len) | |||
| 5902 | ((lplogfont->lfPitchAndFamily & 0x3) == VARIABLE_PITCH) | 6047 | ((lplogfont->lfPitchAndFamily & 0x3) == VARIABLE_PITCH) |
| 5903 | ? 'p' : 'c', /* spacing */ | 6048 | ? 'p' : 'c', /* spacing */ |
| 5904 | width_pixels, /* avg width */ | 6049 | width_pixels, /* avg width */ |
| 5905 | w32_to_x_charset (lplogfont->lfCharSet) /* charset registry | 6050 | specific_charset ? specific_charset |
| 5906 | and encoding*/ | 6051 | : w32_to_x_charset (lplogfont->lfCharSet) |
| 6052 | /* charset registry and encoding */ | ||
| 5907 | ); | 6053 | ); |
| 5908 | 6054 | ||
| 5909 | lpxstr[len - 1] = 0; /* just to be sure */ | 6055 | lpxstr[len - 1] = 0; /* just to be sure */ |
| @@ -6121,7 +6267,7 @@ int xlfd_strip_height (char *fontname) | |||
| 6121 | *write_to = '-'; | 6267 | *write_to = '-'; |
| 6122 | write_to++; | 6268 | write_to++; |
| 6123 | } | 6269 | } |
| 6124 | /* If the pixel height field is at the end (partial xfld), | 6270 | /* If the pixel height field is at the end (partial xlfd), |
| 6125 | return now. */ | 6271 | return now. */ |
| 6126 | else | 6272 | else |
| 6127 | return pixel_height; | 6273 | return pixel_height; |
| @@ -6288,6 +6434,7 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 6288 | { | 6434 | { |
| 6289 | char buf[100]; | 6435 | char buf[100]; |
| 6290 | Lisp_Object width = Qnil; | 6436 | Lisp_Object width = Qnil; |
| 6437 | char *charset = NULL; | ||
| 6291 | 6438 | ||
| 6292 | /* Truetype fonts do not report their true metrics until loaded */ | 6439 | /* Truetype fonts do not report their true metrics until loaded */ |
| 6293 | if (FontType != RASTER_FONTTYPE) | 6440 | if (FontType != RASTER_FONTTYPE) |
| @@ -6317,7 +6464,18 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 6317 | lplf->elfLogFont.lfHeight = -lplf->elfLogFont.lfHeight; | 6464 | lplf->elfLogFont.lfHeight = -lplf->elfLogFont.lfHeight; |
| 6318 | } | 6465 | } |
| 6319 | 6466 | ||
| 6320 | if (!w32_to_x_font (&(lplf->elfLogFont), buf, 100)) | 6467 | if (!NILP (*(lpef->pattern))) |
| 6468 | { | ||
| 6469 | charset = xlfd_charset_of_font (XSTRING(*(lpef->pattern))->data); | ||
| 6470 | |||
| 6471 | /* Ensure that charset is valid for this font. */ | ||
| 6472 | if (charset | ||
| 6473 | && (x_to_w32_charset (charset) != lplf->elfLogFont.lfCharSet)) | ||
| 6474 | charset = NULL; | ||
| 6475 | } | ||
| 6476 | |||
| 6477 | /* TODO: List all relevant charsets if charset not specified. */ | ||
| 6478 | if (!w32_to_x_font (&(lplf->elfLogFont), buf, 100, charset)) | ||
| 6321 | return (0); | 6479 | return (0); |
| 6322 | 6480 | ||
| 6323 | if (NILP (*(lpef->pattern)) | 6481 | if (NILP (*(lpef->pattern)) |
| @@ -6439,9 +6597,20 @@ w32_list_fonts (FRAME_PTR f, Lisp_Object pattern, int size, int maxnames ) | |||
| 6439 | for (; CONSP (patterns); patterns = XCDR (patterns)) | 6597 | for (; CONSP (patterns); patterns = XCDR (patterns)) |
| 6440 | { | 6598 | { |
| 6441 | enumfont_t ef; | 6599 | enumfont_t ef; |
| 6600 | int codepage; | ||
| 6442 | 6601 | ||
| 6443 | tpat = XCAR (patterns); | 6602 | tpat = XCAR (patterns); |
| 6444 | 6603 | ||
| 6604 | if (!STRINGP (tpat)) | ||
| 6605 | continue; | ||
| 6606 | |||
| 6607 | /* Avoid expensive EnumFontFamilies functions if we are not | ||
| 6608 | going to be able to output one of these anyway. */ | ||
| 6609 | codepage = w32_codepage_for_font (XSTRING (tpat)->data); | ||
| 6610 | if (codepage != CP_8BIT && codepage != CP_UNICODE | ||
| 6611 | && codepage != CP_DEFAULT && !IsValidCodePage(codepage)) | ||
| 6612 | continue; | ||
| 6613 | |||
| 6445 | /* See if we cached the result for this particular query. | 6614 | /* See if we cached the result for this particular query. |
| 6446 | The cache is an alist of the form: | 6615 | The cache is an alist of the form: |
| 6447 | ((PATTERN (FONTNAME . WIDTH) ...) ...) | 6616 | ((PATTERN (FONTNAME . WIDTH) ...) ...) |
| @@ -6464,8 +6633,7 @@ w32_list_fonts (FRAME_PTR f, Lisp_Object pattern, int size, int maxnames ) | |||
| 6464 | /* Use EnumFontFamiliesEx where it is available, as it knows | 6633 | /* Use EnumFontFamiliesEx where it is available, as it knows |
| 6465 | about character sets. Fall back to EnumFontFamilies for | 6634 | about character sets. Fall back to EnumFontFamilies for |
| 6466 | older versions of NT that don't support the 'Ex function. */ | 6635 | older versions of NT that don't support the 'Ex function. */ |
| 6467 | x_to_w32_font (STRINGP (tpat) ? XSTRING (tpat)->data : | 6636 | x_to_w32_font (XSTRING (tpat)->data, &ef.logfont); |
| 6468 | NULL, &ef.logfont); | ||
| 6469 | { | 6637 | { |
| 6470 | LOGFONT font_match_pattern; | 6638 | LOGFONT font_match_pattern; |
| 6471 | HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); | 6639 | HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); |
| @@ -6726,7 +6894,7 @@ w32_find_ccl_program (fontp) | |||
| 6726 | DEFUN ("w32-find-bdf-fonts", Fw32_find_bdf_fonts, Sw32_find_bdf_fonts, | 6894 | DEFUN ("w32-find-bdf-fonts", Fw32_find_bdf_fonts, Sw32_find_bdf_fonts, |
| 6727 | 1, 1, 0, | 6895 | 1, 1, 0, |
| 6728 | "Return a list of BDF fonts in DIR, suitable for appending to\n\ | 6896 | "Return a list of BDF fonts in DIR, suitable for appending to\n\ |
| 6729 | w32-bdf-filename-alist. Fonts which do not contain an xfld description\n\ | 6897 | w32-bdf-filename-alist. Fonts which do not contain an xlfd description\n\ |
| 6730 | will not be included in the list. DIR may be a list of directories.") | 6898 | will not be included in the list. DIR may be a list of directories.") |
| 6731 | (directory) | 6899 | (directory) |
| 6732 | Lisp_Object directory; | 6900 | Lisp_Object directory; |
| @@ -7731,7 +7899,7 @@ x_clear_image (f, img) | |||
| 7731 | struct frame *f; | 7899 | struct frame *f; |
| 7732 | struct image *img; | 7900 | struct image *img; |
| 7733 | { | 7901 | { |
| 7734 | #if 0 /* NTEMACS_TODO: W32 image support */ | 7902 | #if 0 /* TODO: W32 image support */ |
| 7735 | 7903 | ||
| 7736 | if (img->pixmap) | 7904 | if (img->pixmap) |
| 7737 | { | 7905 | { |
| @@ -7779,7 +7947,7 @@ x_alloc_image_color (f, img, color_name, dflt) | |||
| 7779 | Lisp_Object color_name; | 7947 | Lisp_Object color_name; |
| 7780 | unsigned long dflt; | 7948 | unsigned long dflt; |
| 7781 | { | 7949 | { |
| 7782 | #if 0 /* NTEMACS_TODO: allocing colors. */ | 7950 | #if 0 /* TODO: allocing colors. */ |
| 7783 | XColor color; | 7951 | XColor color; |
| 7784 | unsigned long result; | 7952 | unsigned long result; |
| 7785 | 7953 | ||
| @@ -8092,7 +8260,7 @@ forall_images_in_image_cache (f, fn) | |||
| 8092 | W32 support code | 8260 | W32 support code |
| 8093 | ***********************************************************************/ | 8261 | ***********************************************************************/ |
| 8094 | 8262 | ||
| 8095 | #if 0 /* NTEMACS_TODO: W32 specific image code. */ | 8263 | #if 0 /* TODO: W32 specific image code. */ |
| 8096 | 8264 | ||
| 8097 | static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int, | 8265 | static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int, |
| 8098 | XImage **, Pixmap *)); | 8266 | XImage **, Pixmap *)); |
| @@ -8113,7 +8281,7 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) | |||
| 8113 | XImage **ximg; | 8281 | XImage **ximg; |
| 8114 | Pixmap *pixmap; | 8282 | Pixmap *pixmap; |
| 8115 | { | 8283 | { |
| 8116 | #if 0 /* NTEMACS_TODO: Image support for W32 */ | 8284 | #if 0 /* TODO: Image support for W32 */ |
| 8117 | Display *display = FRAME_W32_DISPLAY (f); | 8285 | Display *display = FRAME_W32_DISPLAY (f); |
| 8118 | Screen *screen = FRAME_X_SCREEN (f); | 8286 | Screen *screen = FRAME_X_SCREEN (f); |
| 8119 | Window window = FRAME_W32_WINDOW (f); | 8287 | Window window = FRAME_W32_WINDOW (f); |
| @@ -8681,7 +8849,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 8681 | if (!NILP (value)) | 8849 | if (!NILP (value)) |
| 8682 | background = x_alloc_image_color (f, img, value, background); | 8850 | background = x_alloc_image_color (f, img, value, background); |
| 8683 | 8851 | ||
| 8684 | #if 0 /* NTEMACS_TODO : Port image display to W32 */ | 8852 | #if 0 /* TODO : Port image display to W32 */ |
| 8685 | BLOCK_INPUT; | 8853 | BLOCK_INPUT; |
| 8686 | img->pixmap | 8854 | img->pixmap |
| 8687 | = XCreatePixmapFromBitmapData (FRAME_W32_DISPLAY (f), | 8855 | = XCreatePixmapFromBitmapData (FRAME_W32_DISPLAY (f), |
| @@ -8784,7 +8952,7 @@ xbm_load (f, img) | |||
| 8784 | else | 8952 | else |
| 8785 | bits = XBOOL_VECTOR (data)->data; | 8953 | bits = XBOOL_VECTOR (data)->data; |
| 8786 | 8954 | ||
| 8787 | #if 0 /* NTEMACS_TODO : W32 XPM code */ | 8955 | #if 0 /* TODO : W32 XPM code */ |
| 8788 | /* Create the pixmap. */ | 8956 | /* Create the pixmap. */ |
| 8789 | depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); | 8957 | depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); |
| 8790 | img->pixmap | 8958 | img->pixmap |
| @@ -8794,7 +8962,7 @@ xbm_load (f, img) | |||
| 8794 | img->width, img->height, | 8962 | img->width, img->height, |
| 8795 | foreground, background, | 8963 | foreground, background, |
| 8796 | depth); | 8964 | depth); |
| 8797 | #endif /* NTEMACS_TODO */ | 8965 | #endif /* TODO */ |
| 8798 | 8966 | ||
| 8799 | if (img->pixmap) | 8967 | if (img->pixmap) |
| 8800 | success_p = 1; | 8968 | success_p = 1; |
| @@ -9057,7 +9225,7 @@ xpm_load (f, img) | |||
| 9057 | #endif /* HAVE_XPM != 0 */ | 9225 | #endif /* HAVE_XPM != 0 */ |
| 9058 | 9226 | ||
| 9059 | 9227 | ||
| 9060 | #if 0 /* NTEMACS_TODO : Color tables on W32. */ | 9228 | #if 0 /* TODO : Color tables on W32. */ |
| 9061 | /*********************************************************************** | 9229 | /*********************************************************************** |
| 9062 | Color table | 9230 | Color table |
| 9063 | ***********************************************************************/ | 9231 | ***********************************************************************/ |
| @@ -9249,14 +9417,14 @@ colors_in_color_table (n) | |||
| 9249 | return colors; | 9417 | return colors; |
| 9250 | } | 9418 | } |
| 9251 | 9419 | ||
| 9252 | #endif /* NTEMACS_TODO */ | 9420 | #endif /* TODO */ |
| 9253 | 9421 | ||
| 9254 | 9422 | ||
| 9255 | /*********************************************************************** | 9423 | /*********************************************************************** |
| 9256 | Algorithms | 9424 | Algorithms |
| 9257 | ***********************************************************************/ | 9425 | ***********************************************************************/ |
| 9258 | 9426 | ||
| 9259 | #if 0 /* NTEMACS_TODO : W32 versions of low level algorithms */ | 9427 | #if 0 /* TODO : W32 versions of low level algorithms */ |
| 9260 | static void x_laplace_write_row P_ ((struct frame *, long *, | 9428 | static void x_laplace_write_row P_ ((struct frame *, long *, |
| 9261 | int, XImage *, int)); | 9429 | int, XImage *, int)); |
| 9262 | static void x_laplace_read_row P_ ((struct frame *, Colormap, | 9430 | static void x_laplace_read_row P_ ((struct frame *, Colormap, |
| @@ -9313,7 +9481,7 @@ x_laplace (f, img) | |||
| 9313 | struct frame *f; | 9481 | struct frame *f; |
| 9314 | struct image *img; | 9482 | struct image *img; |
| 9315 | { | 9483 | { |
| 9316 | #if 0 /* NTEMACS_TODO : W32 version */ | 9484 | #if 0 /* TODO : W32 version */ |
| 9317 | Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); | 9485 | Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); |
| 9318 | XImage *ximg, *oimg; | 9486 | XImage *ximg, *oimg; |
| 9319 | XColor *in[3]; | 9487 | XColor *in[3]; |
| @@ -9391,7 +9559,7 @@ x_laplace (f, img) | |||
| 9391 | free_color_table (); | 9559 | free_color_table (); |
| 9392 | 9560 | ||
| 9393 | UNBLOCK_INPUT; | 9561 | UNBLOCK_INPUT; |
| 9394 | #endif /* NTEMACS_TODO */ | 9562 | #endif /* TODO */ |
| 9395 | } | 9563 | } |
| 9396 | 9564 | ||
| 9397 | 9565 | ||
| @@ -9408,7 +9576,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 9408 | struct image *img; | 9576 | struct image *img; |
| 9409 | Lisp_Object how; | 9577 | Lisp_Object how; |
| 9410 | { | 9578 | { |
| 9411 | #if 0 /* NTEMACS_TODO : W32 version */ | 9579 | #if 0 /* TODO : W32 version */ |
| 9412 | Display *dpy = FRAME_W32_DISPLAY (f); | 9580 | Display *dpy = FRAME_W32_DISPLAY (f); |
| 9413 | XImage *ximg, *mask_img; | 9581 | XImage *ximg, *mask_img; |
| 9414 | int x, y, rc, look_at_corners_p; | 9582 | int x, y, rc, look_at_corners_p; |
| @@ -9500,7 +9668,7 @@ x_build_heuristic_mask (f, img, how) | |||
| 9500 | XDestroyImage (ximg); | 9668 | XDestroyImage (ximg); |
| 9501 | 9669 | ||
| 9502 | UNBLOCK_INPUT; | 9670 | UNBLOCK_INPUT; |
| 9503 | #endif /* NTEMACS_TODO */ | 9671 | #endif /* TODO */ |
| 9504 | 9672 | ||
| 9505 | return 1; | 9673 | return 1; |
| 9506 | } | 9674 | } |
| @@ -11626,7 +11794,7 @@ selected frame. Value is VALUE.") | |||
| 11626 | (prop, value, frame) | 11794 | (prop, value, frame) |
| 11627 | Lisp_Object frame, prop, value; | 11795 | Lisp_Object frame, prop, value; |
| 11628 | { | 11796 | { |
| 11629 | #if 0 /* NTEMACS_TODO : port window properties to W32 */ | 11797 | #if 0 /* TODO : port window properties to W32 */ |
| 11630 | struct frame *f = check_x_frame (frame); | 11798 | struct frame *f = check_x_frame (frame); |
| 11631 | Atom prop_atom; | 11799 | Atom prop_atom; |
| 11632 | 11800 | ||
| @@ -11643,7 +11811,7 @@ selected frame. Value is VALUE.") | |||
| 11643 | XFlush (FRAME_W32_DISPLAY (f)); | 11811 | XFlush (FRAME_W32_DISPLAY (f)); |
| 11644 | UNBLOCK_INPUT; | 11812 | UNBLOCK_INPUT; |
| 11645 | 11813 | ||
| 11646 | #endif /* NTEMACS_TODO */ | 11814 | #endif /* TODO */ |
| 11647 | 11815 | ||
| 11648 | return value; | 11816 | return value; |
| 11649 | } | 11817 | } |
| @@ -11656,7 +11824,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP.") | |||
| 11656 | (prop, frame) | 11824 | (prop, frame) |
| 11657 | Lisp_Object prop, frame; | 11825 | Lisp_Object prop, frame; |
| 11658 | { | 11826 | { |
| 11659 | #if 0 /* NTEMACS_TODO : port window properties to W32 */ | 11827 | #if 0 /* TODO : port window properties to W32 */ |
| 11660 | 11828 | ||
| 11661 | struct frame *f = check_x_frame (frame); | 11829 | struct frame *f = check_x_frame (frame); |
| 11662 | Atom prop_atom; | 11830 | Atom prop_atom; |
| @@ -11669,7 +11837,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP.") | |||
| 11669 | /* Make sure the property is removed when we return. */ | 11837 | /* Make sure the property is removed when we return. */ |
| 11670 | XFlush (FRAME_W32_DISPLAY (f)); | 11838 | XFlush (FRAME_W32_DISPLAY (f)); |
| 11671 | UNBLOCK_INPUT; | 11839 | UNBLOCK_INPUT; |
| 11672 | #endif /* NTEMACS_TODO */ | 11840 | #endif /* TODO */ |
| 11673 | 11841 | ||
| 11674 | return prop; | 11842 | return prop; |
| 11675 | } | 11843 | } |
| @@ -11684,7 +11852,7 @@ value.") | |||
| 11684 | (prop, frame) | 11852 | (prop, frame) |
| 11685 | Lisp_Object prop, frame; | 11853 | Lisp_Object prop, frame; |
| 11686 | { | 11854 | { |
| 11687 | #if 0 /* NTEMACS_TODO : port window properties to W32 */ | 11855 | #if 0 /* TODO : port window properties to W32 */ |
| 11688 | 11856 | ||
| 11689 | struct frame *f = check_x_frame (frame); | 11857 | struct frame *f = check_x_frame (frame); |
| 11690 | Atom prop_atom; | 11858 | Atom prop_atom; |
| @@ -11725,7 +11893,7 @@ value.") | |||
| 11725 | 11893 | ||
| 11726 | return prop_value; | 11894 | return prop_value; |
| 11727 | 11895 | ||
| 11728 | #endif /* NTEMACS_TODO */ | 11896 | #endif /* TODO */ |
| 11729 | return Qnil; | 11897 | return Qnil; |
| 11730 | } | 11898 | } |
| 11731 | 11899 | ||
| @@ -11764,7 +11932,7 @@ static void hide_busy_cursor P_ ((void)); | |||
| 11764 | void | 11932 | void |
| 11765 | start_busy_cursor () | 11933 | start_busy_cursor () |
| 11766 | { | 11934 | { |
| 11767 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ | 11935 | #if 0 /* TODO: cursor shape changes. */ |
| 11768 | EMACS_TIME delay; | 11936 | EMACS_TIME delay; |
| 11769 | int secs, usecs = 0; | 11937 | int secs, usecs = 0; |
| 11770 | 11938 | ||
| @@ -11820,7 +11988,7 @@ static void | |||
| 11820 | show_busy_cursor (timer) | 11988 | show_busy_cursor (timer) |
| 11821 | struct atimer *timer; | 11989 | struct atimer *timer; |
| 11822 | { | 11990 | { |
| 11823 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ | 11991 | #if 0 /* TODO: cursor shape changes. */ |
| 11824 | /* The timer implementation will cancel this timer automatically | 11992 | /* The timer implementation will cancel this timer automatically |
| 11825 | after this function has run. Set busy_cursor_atimer to null | 11993 | after this function has run. Set busy_cursor_atimer to null |
| 11826 | so that we know the timer doesn't have to be canceled. */ | 11994 | so that we know the timer doesn't have to be canceled. */ |
| @@ -11871,7 +12039,7 @@ show_busy_cursor (timer) | |||
| 11871 | static void | 12039 | static void |
| 11872 | hide_busy_cursor () | 12040 | hide_busy_cursor () |
| 11873 | { | 12041 | { |
| 11874 | #if 0 /* NTEMACS_TODO: cursor shape changes. */ | 12042 | #if 0 /* TODO: cursor shape changes. */ |
| 11875 | if (busy_cursor_shown_p) | 12043 | if (busy_cursor_shown_p) |
| 11876 | { | 12044 | { |
| 11877 | Lisp_Object rest, frame; | 12045 | Lisp_Object rest, frame; |
| @@ -11926,7 +12094,7 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 11926 | struct w32_display_info *dpyinfo; | 12094 | struct w32_display_info *dpyinfo; |
| 11927 | Lisp_Object parms; | 12095 | Lisp_Object parms; |
| 11928 | { | 12096 | { |
| 11929 | #if 0 /* NTEMACS_TODO : w32 version */ | 12097 | #if 0 /* TODO : w32 version */ |
| 11930 | struct frame *f; | 12098 | struct frame *f; |
| 11931 | Lisp_Object frame, tem; | 12099 | Lisp_Object frame, tem; |
| 11932 | Lisp_Object name; | 12100 | Lisp_Object name; |
| @@ -12152,11 +12320,11 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 12152 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; | 12320 | FRAME_W32_DISPLAY_INFO (f)->reference_count++; |
| 12153 | 12321 | ||
| 12154 | return unbind_to (count, frame); | 12322 | return unbind_to (count, frame); |
| 12155 | #endif /* NTEMACS_TODO */ | 12323 | #endif /* TODO */ |
| 12156 | return Qnil; | 12324 | return Qnil; |
| 12157 | } | 12325 | } |
| 12158 | 12326 | ||
| 12159 | 12327 | #ifdef TODO /* Tooltip support not complete. */ | |
| 12160 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | 12328 | DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, |
| 12161 | "Show STRING in a \"tooltip\" window on frame FRAME.\n\ | 12329 | "Show STRING in a \"tooltip\" window on frame FRAME.\n\ |
| 12162 | A tooltip window is a small X window displaying a string.\n\ | 12330 | A tooltip window is a small X window displaying a string.\n\ |
| @@ -12296,7 +12464,7 @@ DY added (default is -5).") | |||
| 12296 | 12464 | ||
| 12297 | /* Move the tooltip window where the mouse pointer is. Resize and | 12465 | /* Move the tooltip window where the mouse pointer is. Resize and |
| 12298 | show it. */ | 12466 | show it. */ |
| 12299 | #if 0 /* NTEMACS_TODO : W32 specifics */ | 12467 | #if 0 /* TODO : W32 specifics */ |
| 12300 | BLOCK_INPUT; | 12468 | BLOCK_INPUT; |
| 12301 | XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, | 12469 | XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, |
| 12302 | &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask); | 12470 | &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask); |
| @@ -12315,7 +12483,7 @@ DY added (default is -5).") | |||
| 12315 | root_x, root_y - height, width, height); | 12483 | root_x, root_y - height, width, height); |
| 12316 | XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 12484 | XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
| 12317 | UNBLOCK_INPUT; | 12485 | UNBLOCK_INPUT; |
| 12318 | #endif /* NTEMACS_TODO */ | 12486 | #endif /* TODO */ |
| 12319 | 12487 | ||
| 12320 | /* Draw into the window. */ | 12488 | /* Draw into the window. */ |
| 12321 | w->must_be_updated_p = 1; | 12489 | w->must_be_updated_p = 1; |
| @@ -12362,6 +12530,7 @@ Value is t is tooltip was open, nil otherwise.") | |||
| 12362 | 12530 | ||
| 12363 | return unbind_to (count, deleted_p ? Qt : Qnil); | 12531 | return unbind_to (count, deleted_p ? Qt : Qnil); |
| 12364 | } | 12532 | } |
| 12533 | #endif | ||
| 12365 | 12534 | ||
| 12366 | 12535 | ||
| 12367 | 12536 | ||
| @@ -12551,7 +12720,7 @@ DEFUN ("w32-select-font", Fw32_select_font, Sw32_select_font, 0, 1, 0, | |||
| 12551 | SelectObject (hdc, oldobj); | 12720 | SelectObject (hdc, oldobj); |
| 12552 | ReleaseDC (FRAME_W32_WINDOW (f), hdc); | 12721 | ReleaseDC (FRAME_W32_WINDOW (f), hdc); |
| 12553 | 12722 | ||
| 12554 | if (!ChooseFont (&cf) || !w32_to_x_font (&lf, buf, 100)) | 12723 | if (!ChooseFont (&cf) || !w32_to_x_font (&lf, buf, 100, NULL)) |
| 12555 | return Qnil; | 12724 | return Qnil; |
| 12556 | 12725 | ||
| 12557 | return build_string (buf); | 12726 | return build_string (buf); |
| @@ -13178,7 +13347,7 @@ and codepages. Each entry should be of the form:\n\ | |||
| 13178 | where CHARSET_NAME is a string used in font names to identify the charset,\n\ | 13347 | where CHARSET_NAME is a string used in font names to identify the charset,\n\ |
| 13179 | WINDOWS_CHARSET is a symbol that can be one of:\n\ | 13348 | WINDOWS_CHARSET is a symbol that can be one of:\n\ |
| 13180 | w32-charset-ansi, w32-charset-default, w32-charset-symbol,\n\ | 13349 | w32-charset-ansi, w32-charset-default, w32-charset-symbol,\n\ |
| 13181 | w32-charset-shiftjis, w32-charset-hangul, w32-charset-gb2312,\n\ | 13350 | w32-charset-shiftjis, w32-charset-hangeul, w32-charset-gb2312,\n\ |
| 13182 | w32-charset-chinesebig5, " | 13351 | w32-charset-chinesebig5, " |
| 13183 | #ifdef JOHAB_CHARSET | 13352 | #ifdef JOHAB_CHARSET |
| 13184 | "w32-charset-johab, w32-charset-hebrew,\n\ | 13353 | "w32-charset-johab, w32-charset-hebrew,\n\ |
| @@ -13202,8 +13371,8 @@ versions of Windows) characters."); | |||
| 13202 | Qw32_charset_symbol = intern ("w32-charset-symbol"); | 13371 | Qw32_charset_symbol = intern ("w32-charset-symbol"); |
| 13203 | staticpro (&Qw32_charset_shiftjis); | 13372 | staticpro (&Qw32_charset_shiftjis); |
| 13204 | Qw32_charset_shiftjis = intern ("w32-charset-shiftjis"); | 13373 | Qw32_charset_shiftjis = intern ("w32-charset-shiftjis"); |
| 13205 | staticpro (&Qw32_charset_hangul); | 13374 | staticpro (&Qw32_charset_hangeul); |
| 13206 | Qw32_charset_hangul = intern ("w32-charset-hangul"); | 13375 | Qw32_charset_hangeul = intern ("w32-charset-hangeul"); |
| 13207 | staticpro (&Qw32_charset_chinesebig5); | 13376 | staticpro (&Qw32_charset_chinesebig5); |
| 13208 | Qw32_charset_chinesebig5 = intern ("w32-charset-chinesebig5"); | 13377 | Qw32_charset_chinesebig5 = intern ("w32-charset-chinesebig5"); |
| 13209 | staticpro (&Qw32_charset_gb2312); | 13378 | staticpro (&Qw32_charset_gb2312); |
| @@ -13214,7 +13383,7 @@ versions of Windows) characters."); | |||
| 13214 | #ifdef JOHAB_CHARSET | 13383 | #ifdef JOHAB_CHARSET |
| 13215 | { | 13384 | { |
| 13216 | static int w32_extra_charsets_defined = 1; | 13385 | static int w32_extra_charsets_defined = 1; |
| 13217 | DEFVAR_BOOL ("w32-extra-charsets-defined", w32_extra_charsets_defined, ""); | 13386 | DEFVAR_BOOL ("w32-extra-charsets-defined", &w32_extra_charsets_defined, ""); |
| 13218 | 13387 | ||
| 13219 | staticpro (&Qw32_charset_johab); | 13388 | staticpro (&Qw32_charset_johab); |
| 13220 | Qw32_charset_johab = intern ("w32-charset-johab"); | 13389 | Qw32_charset_johab = intern ("w32-charset-johab"); |
| @@ -13232,6 +13401,8 @@ versions of Windows) characters."); | |||
| 13232 | Qw32_charset_greek = intern ("w32-charset-greek"); | 13401 | Qw32_charset_greek = intern ("w32-charset-greek"); |
| 13233 | staticpro (&Qw32_charset_hebrew); | 13402 | staticpro (&Qw32_charset_hebrew); |
| 13234 | Qw32_charset_hebrew = intern ("w32-charset-hebrew"); | 13403 | Qw32_charset_hebrew = intern ("w32-charset-hebrew"); |
| 13404 | staticpro (&Qw32_charset_vietnamese); | ||
| 13405 | Qw32_charset_vietnamese = intern ("w32-charset-vietnamese"); | ||
| 13235 | staticpro (&Qw32_charset_thai); | 13406 | staticpro (&Qw32_charset_thai); |
| 13236 | Qw32_charset_thai = intern ("w32-charset-thai"); | 13407 | Qw32_charset_thai = intern ("w32-charset-thai"); |
| 13237 | staticpro (&Qw32_charset_mac); | 13408 | staticpro (&Qw32_charset_mac); |
| @@ -13243,14 +13414,14 @@ versions of Windows) characters."); | |||
| 13243 | { | 13414 | { |
| 13244 | static int w32_unicode_charset_defined = 1; | 13415 | static int w32_unicode_charset_defined = 1; |
| 13245 | DEFVAR_BOOL ("w32-unicode-charset-defined", | 13416 | DEFVAR_BOOL ("w32-unicode-charset-defined", |
| 13246 | w32_unicode_charset_defined, ""); | 13417 | &w32_unicode_charset_defined, ""); |
| 13247 | 13418 | ||
| 13248 | staticpro (&Qw32_charset_unicode); | 13419 | staticpro (&Qw32_charset_unicode); |
| 13249 | Qw32_charset_unicode = intern ("w32-charset-unicode"); | 13420 | Qw32_charset_unicode = intern ("w32-charset-unicode"); |
| 13250 | #endif | 13421 | #endif |
| 13251 | 13422 | ||
| 13252 | defsubr (&Sx_get_resource); | 13423 | defsubr (&Sx_get_resource); |
| 13253 | #if 0 /* NTEMACS_TODO: Port to W32 */ | 13424 | #if 0 /* TODO: Port to W32 */ |
| 13254 | defsubr (&Sx_change_window_property); | 13425 | defsubr (&Sx_change_window_property); |
| 13255 | defsubr (&Sx_delete_window_property); | 13426 | defsubr (&Sx_delete_window_property); |
| 13256 | defsubr (&Sx_window_property); | 13427 | defsubr (&Sx_window_property); |
| @@ -13309,7 +13480,7 @@ versions of Windows) characters."); | |||
| 13309 | set_frame_fontset_func = x_set_font; | 13480 | set_frame_fontset_func = x_set_font; |
| 13310 | check_window_system_func = check_w32; | 13481 | check_window_system_func = check_w32; |
| 13311 | 13482 | ||
| 13312 | #if 0 /* NTEMACS_TODO Image support for W32 */ | 13483 | #if 0 /* TODO Image support for W32 */ |
| 13313 | /* Images. */ | 13484 | /* Images. */ |
| 13314 | Qxbm = intern ("xbm"); | 13485 | Qxbm = intern ("xbm"); |
| 13315 | staticpro (&Qxbm); | 13486 | staticpro (&Qxbm); |
| @@ -13373,13 +13544,14 @@ versions of Windows) characters."); | |||
| 13373 | defsubr (&Simagep); | 13544 | defsubr (&Simagep); |
| 13374 | defsubr (&Slookup_image); | 13545 | defsubr (&Slookup_image); |
| 13375 | #endif | 13546 | #endif |
| 13376 | #endif /* NTEMACS_TODO */ | 13547 | #endif /* TODO */ |
| 13377 | 13548 | ||
| 13378 | busy_cursor_atimer = NULL; | 13549 | busy_cursor_atimer = NULL; |
| 13379 | busy_cursor_shown_p = 0; | 13550 | busy_cursor_shown_p = 0; |
| 13380 | 13551 | #ifdef TODO /* Tooltip support not complete. */ | |
| 13381 | defsubr (&Sx_show_tip); | 13552 | defsubr (&Sx_show_tip); |
| 13382 | defsubr (&Sx_hide_tip); | 13553 | defsubr (&Sx_hide_tip); |
| 13554 | #endif | ||
| 13383 | staticpro (&tip_timer); | 13555 | staticpro (&tip_timer); |
| 13384 | tip_timer = Qnil; | 13556 | tip_timer = Qnil; |
| 13385 | 13557 | ||
| @@ -13393,7 +13565,7 @@ init_xfns () | |||
| 13393 | image_types = NULL; | 13565 | image_types = NULL; |
| 13394 | Vimage_types = Qnil; | 13566 | Vimage_types = Qnil; |
| 13395 | 13567 | ||
| 13396 | #if 0 /* NTEMACS_TODO : Image support for W32 */ | 13568 | #if 0 /* TODO : Image support for W32 */ |
| 13397 | define_image_type (&xbm_type); | 13569 | define_image_type (&xbm_type); |
| 13398 | define_image_type (&gs_type); | 13570 | define_image_type (&gs_type); |
| 13399 | define_image_type (&pbm_type); | 13571 | define_image_type (&pbm_type); |
| @@ -13417,7 +13589,7 @@ init_xfns () | |||
| 13417 | #if HAVE_PNG | 13589 | #if HAVE_PNG |
| 13418 | define_image_type (&png_type); | 13590 | define_image_type (&png_type); |
| 13419 | #endif | 13591 | #endif |
| 13420 | #endif /* NTEMACS_TODO */ | 13592 | #endif /* TODO */ |
| 13421 | } | 13593 | } |
| 13422 | 13594 | ||
| 13423 | #undef abort | 13595 | #undef abort |