[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/macterm.c [emacs-unicode-2]
From: |
Steven Tamm |
Subject: |
[Emacs-diffs] Changes to emacs/src/macterm.c [emacs-unicode-2] |
Date: |
Wed, 04 Aug 2004 18:10:38 -0400 |
Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.47.2.6 emacs/src/macterm.c:1.47.2.7
*** emacs/src/macterm.c:1.47.2.6 Fri Jul 23 04:30:41 2004
--- emacs/src/macterm.c Wed Aug 4 06:04:39 2004
***************
*** 82,88 ****
--- 82,90 ----
#include "window.h"
#include "intervals.h"
#include "composite.h"
+ #include "character.h"
#include "coding.h"
+ #include "ccl.h"
/* Set of macros that handle mapping of Mac modifier keys to emacs. */
#define macCtrlKey (NILP (Vmac_reverse_ctrl_meta) ? controlKey : \
***************
*** 1527,1533 ****
/* Function prototypes of this page. */
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
! static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *));
/* Return a pointer to per-char metric information in FONT of a
--- 1529,1536 ----
/* Function prototypes of this page. */
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
! static int mac_encode_char P_ ((int, XChar2b *, struct font_info *,
! struct charset *, int *));
/* Return a pointer to per-char metric information in FONT of a
***************
*** 1630,1642 ****
the two-byte form of C. Encoding is returned in *CHAR2B. */
static int
! mac_encode_char (c, char2b, font_info, two_byte_p)
int c;
XChar2b *char2b;
struct font_info *font_info;
int *two_byte_p;
{
- int charset = CHAR_CHARSET (c);
XFontStruct *font = font_info->font;
/* FONT_INFO may define a scheme by which to encode byte1 and byte2.
--- 1633,1645 ----
the two-byte form of C. Encoding is returned in *CHAR2B. */
static int
! mac_encode_char (c, char2b, font_info, charset, two_byte_p)
int c;
XChar2b *char2b;
struct font_info *font_info;
+ struct charset *charset;
int *two_byte_p;
{
XFontStruct *font = font_info->font;
/* FONT_INFO may define a scheme by which to encode byte1 and byte2.
***************
*** 1649,1662 ****
if (CHARSET_DIMENSION (charset) == 1)
{
! ccl->reg[0] = charset;
! ccl->reg[1] = char2b->byte2;
}
else
{
! ccl->reg[0] = charset;
! ccl->reg[1] = char2b->byte1;
! ccl->reg[2] = char2b->byte2;
}
ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
--- 1652,1666 ----
if (CHARSET_DIMENSION (charset) == 1)
{
! ccl->reg[0] = CHARSET_ID (charset);
! ccl->reg[1] = XCHAR2B_BYTE2 (char2b);
! ccl->reg[2] = -1;
}
else
{
! ccl->reg[0] = CHARSET_ID (charset);
! ccl->reg[1] = XCHAR2B_BYTE1 (char2b);
! ccl->reg[2] = XCHAR2B_BYTE2 (char2b);
}
ccl_driver (ccl, NULL, NULL, 0, 0, NULL);
***************
*** 1664,1678 ****
/* We assume that MSBs are appropriately set/reset by CCL
program. */
if (font->max_byte1 == 0) /* 1-byte font */
! char2b->byte1 = 0, char2b->byte2 = ccl->reg[1];
else
! char2b->byte1 = ccl->reg[1], char2b->byte2 = ccl->reg[2];
}
! else if (font_info->encoding[charset])
{
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
! int enc = font_info->encoding[charset];
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
--- 1668,1682 ----
/* We assume that MSBs are appropriately set/reset by CCL
program. */
if (font->max_byte1 == 0) /* 1-byte font */
! STORE_XCHAR2B (char2b, 0, ccl->reg[1]);
else
! STORE_XCHAR2B (char2b, ccl->reg[1], ccl->reg[2]);
}
! else if (font_info->encoding_type)
{
/* Fixed encoding scheme. See fontset.h for the meaning of the
encoding numbers. */
! unsigned char enc = font_info->encoding_type;
if ((enc == 1 || enc == 2)
&& CHARSET_DIMENSION (charset) == 2)
***************
*** 1681,1686 ****
--- 1685,1691 ----
if (enc == 1 || enc == 3)
char2b->byte2 |= 0x80;
+ /*
if (enc == 4)
{
int sjis1, sjis2;
***************
*** 1689,1694 ****
--- 1694,1700 ----
char2b->byte1 = sjis1;
char2b->byte2 = sjis2;
}
+ */
}
if (two_byte_p)
***************
*** 4943,4953 ****
register char *fontname;
{
struct font_info *fontp
! = FS_LOAD_FONT (f, 0, fontname, -1);
if (!fontp)
return Qnil;
FRAME_FONT (f) = (XFontStruct *) (fontp->font);
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
FRAME_FONTSET (f) = -1;
--- 4949,4964 ----
register char *fontname;
{
struct font_info *fontp
! = FS_LOAD_FONT (f, fontname);
if (!fontp)
return Qnil;
+ if (FRAME_FONT (f) == (XFontStruct *) (fontp->font))
+ /* This font is already set in frame F. There's nothing more to
+ do. */
+ return build_string (fontp->full_name);
+
FRAME_FONT (f) = (XFontStruct *) (fontp->font);
FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
FRAME_FONTSET (f) = -1;
***************
*** 4995,5023 ****
Lisp_Object
x_new_fontset (f, fontsetname)
struct frame *f;
! char *fontsetname;
{
! int fontset = fs_query_fontset (build_string (fontsetname), 0);
Lisp_Object result;
! if (fontset < 0)
! return Qnil;
!
! if (FRAME_FONTSET (f) == fontset)
/* This fontset is already set in frame F. There's nothing more
to do. */
return fontset_name (fontset);
! result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
if (!STRINGP (result))
/* Can't load ASCII font. */
return Qnil;
/* Since x_new_font doesn't update any fontset information, do it now. */
FRAME_FONTSET(f) = fontset;
! return build_string (fontsetname);
}
--- 5006,5040 ----
Lisp_Object
x_new_fontset (f, fontsetname)
struct frame *f;
! Lisp_Object fontsetname;
{
! int fontset = fs_query_fontset (fontsetname, 0);
Lisp_Object result;
! if (fontset > 0 && FRAME_FONTSET(f) == fontset)
/* This fontset is already set in frame F. There's nothing more
to do. */
return fontset_name (fontset);
+ else if (fontset == 0)
+ /* The default fontset can't be the default font. */
+ return Qt;
! if (fontset > 0)
! result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
! else
! result = x_new_font (f, SDATA (fontsetname));
if (!STRINGP (result))
/* Can't load ASCII font. */
return Qnil;
+ if (fontset < 0)
+ fontset = new_fontset_from_font_name (result);
+
/* Since x_new_font doesn't update any fontset information, do it now. */
FRAME_FONTSET(f) = fontset;
! return fontset_name (fontset);
}
***************
*** 5856,5871 ****
return;
}
setup_coding_system (coding_system, &coding);
coding.src_multibyte = 0;
coding.dst_multibyte = 1;
coding.mode |= CODING_MODE_LAST_BLOCK;
! coding.composing = COMPOSITION_DISABLED;
! buf = (char *) alloca (size);
decode_coding (&coding, name, buf, strlen (name), size - 1);
bcopy (buf, name, coding.produced);
name[coding.produced] = '\0';
}
--- 5873,5892 ----
return;
}
+ #if 0
+ /* MAC_TODO: Fix encoding system... */
setup_coding_system (coding_system, &coding);
coding.src_multibyte = 0;
coding.dst_multibyte = 1;
coding.mode |= CODING_MODE_LAST_BLOCK;
! coding.dst_bytes = MAX_MULTsize;
! coding.destination = (char *) alloca (size);
! coding_decode_c_string(&coding, name, strlen(name), qNil);
decode_coding (&coding, name, buf, strlen (name), size - 1);
bcopy (buf, name, coding.produced);
name[coding.produced] = '\0';
+ #endif
}
***************
*** 5957,5962 ****
--- 5978,5985 ----
else
sprintf (mf, "%s-%s-%s", foundry, family, cs);
+ #if 0
+ /* MAC_TODO: Fix coding system to use objects */
if (!NILP (coding_system))
{
setup_coding_system (coding_system, &coding);
***************
*** 5966,5971 ****
--- 5989,5995 ----
encode_coding (&coding, family, mf, strlen (family), sizeof (Str32) -
1);
mf[coding.produced] = '\0';
}
+ #endif
}
***************
*** 6741,6746 ****
--- 6765,6773 ----
fontp->height = max_height;
}
+ #if 0 /* MAC_TODO: fill these out with more reasonably values */
+
+ /* MAC_TODO: The script encoding is irrelevant in unicode? */
/* The slot `encoding' specifies how to map a character
code-points (0x20..0x7F or 0x2020..0x7F7F) of each charset to
the font code-points (0:0x20..0x7F, 1:0xA0..0xFF), or
***************
*** 6777,6783 ****
: 1))); /* 0xA0A0..0xFFFF */
}
- #if 0 /* MAC_TODO: fill these out with more reasonably values */
fontp->baseline_offset
= (XGetFontProperty (font, dpyinfo->Xatom_MULE_BASELINE_OFFSET, &value)
? (long) value : 0);
--- 6804,6809 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/macterm.c [emacs-unicode-2],
Steven Tamm <=