#include "intervals.h"
#include "process.h"
#include "atimer.h"
+#include "keymap.h"
#include "coding.h"
#ifdef HAVE_UNISTD_H
/* Mac version of XClearArea. */
-static void
+void
XClearArea (display, w, x, y, width, height, exposures)
Display *display;
WindowPtr w;
}
+#if 0
/* Convert a pair of local coordinates to global (screen) coordinates.
Assume graphic port has been properly set. */
static void
*h = p.h;
*v = p.v;
}
-
+#endif
/* Mac replacement for XCopyArea: used only for scrolling. */
Rect src_r, dest_r;
SetPort (w);
+#if 0
mac_set_colors (gc);
+#endif
SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
+#if 0
/* Need to use global coordinates and screenBits since src and dest
areas overlap in general. */
local_to_global_coord (&src_r.left, &src_r.top);
local_to_global_coord (&dest_r.right, &dest_r.bottom);
CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0);
+#else
+ /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid
+ color mapping in CopyBits. Otherwise, it will be slow. */
+ ForeColor (blackColor);
+ BackColor (whiteColor);
+ CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
+
+ mac_set_colors (gc);
+#endif
}
/* Change the mouse pointer according to what is under X/Y. */
map = Fget_text_property (make_number (glyph->charpos),
Qlocal_map, glyph->object);
- if (!NILP (Fkeymapp (map)))
+ if (KEYMAPP (map))
cursor = f->output_data.mac->nontext_cursor;
else
{
map = Fget_text_property (make_number (glyph->charpos),
Qkeymap, glyph->object);
- if (!NILP (Fkeymapp (map)))
+ if (KEYMAPP (map))
cursor = f->output_data.mac->nontext_cursor;
}
}
clear_mouse_face (dpyinfo)
struct mac_display_info *dpyinfo;
{
- if (tip_frame)
+ if (!NILP (tip_frame))
return;
if (! NILP (dpyinfo->mouse_face_window))
#ifdef HAVE_X11R6
destroy.callback = xim_destroy_callback;
destroy.client_data = (XPointer)dpyinfo;
- /* This isn't prptotyped in OSF 5.0. */
+ /* This isn't prototyped in OSF 5.0. */
XSetIMValues (xim, XNDestroyCallback, &destroy, NULL);
#endif
}
case smJapanese:
strcpy(cs, "jisx0208.1983-sjis");
break;
+ case -smJapanese:
+ /* Each Apple Japanese font is entered into the font table
+ twice: once as a jisx0208.1983-sjis font and once as a
+ jisx0201.1976-0 font. The latter can be used to display
+ the ascii charset and katakana-jisx0201 charset. A
+ negative script code signals that the name of this latter
+ font is being built. */
+ strcpy(cs, "jisx0201.1976-0");
+ break;
case smKorean:
strcpy(cs, "ksc5601.1989-0");
break;
if (strcmp (cs, "big5-0") == 0 || strcmp (cs, "gb2312.1980-0") == 0
|| strcmp (cs, "jisx0208.1983-sjis") == 0
+ || strcmp (cs, "jisx0201.1976-0") == 0
|| strcmp (cs, "ksc5601.1989-0") == 0 || strcmp (cs, "mac-roman") == 0)
strcpy(mf, family);
else
font_name_table = (char **)
xmalloc (font_name_table_size * sizeof (char *));
}
- else if (font_name_count >= font_name_table_size)
+ else if (font_name_count >= font_name_table_size ||
+ /* fonts in Japanese scripts require two
+ entries. */
+ scriptcode == smJapanese &&
+ font_name_count + 1 >= font_name_table_size)
{
font_name_table_size += 16;
font_name_table = (char **)
assc_entry->fontSize,
assc_entry->fontStyle,
scriptcode);
+ /* Both jisx0208.1983-sjis and jisx0201.1976-0 parts
+ are contained in Apple Japanese (SJIS) font. */
+ if (smJapanese == scriptcode)
+ {
+ font_name_table[font_name_count++]
+ = mac_to_x_fontname (name,
+ assc_entry->fontSize,
+ assc_entry->fontStyle,
+ -smJapanese);
+ }
}
}
font->mac_fontface = fontface;
font->mac_scriptcode = FontToScript (fontnum);
+ /* Apple Japanese (SJIS) font is listed as both
+ "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0"
+ (Roman script) in init_font_name_table(). The latter should be
+ treated as a one-byte font. */
+ {
+ char cs[32];
+
+ if (sscanf (name,
+ "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
+ cs) == 1
+ && 0 == strcmp (cs, "jisx0201.1976-0"))
+ font->mac_scriptcode = smRoman;
+ }
+
is_two_byte_font = font->mac_scriptcode == smJapanese ||
font->mac_scriptcode == smTradChinese ||
font->mac_scriptcode == smSimpChinese ||
#define ARGV_STRING_LIST_ID 129
#define ABOUT_ALERT_ID 128
+#define RAM_TOO_LARGE_ALERT_ID 129
Boolean terminate_flag = false;
}
+static void
+do_check_ram_size (void)
+{
+ SInt32 physical_ram_size, logical_ram_size;
+
+ if (Gestalt (gestaltPhysicalRAMSize, &physical_ram_size) != noErr
+ || Gestalt (gestaltLogicalRAMSize, &logical_ram_size) != noErr
+ || physical_ram_size > 256 * 1024 * 1024
+ || logical_ram_size > 256 * 1024 * 1024)
+ {
+ StopAlert (RAM_TOO_LARGE_ALERT_ID, NULL);
+ exit (1);
+ }
+}
+
+
static void
do_window_update (WindowPtr win)
{
mac_output *mwp = (mac_output *) GetWRefCon (FrontWindow ());
struct frame *f = mwp->mFP;
+ SetCursor (&qd.arrow);
+
if (f)
{
x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f);
do_app_suspend ();
break;
- case mouseMovedMessage:
+ case mouseMovedMessage: /* never reached */
do_mouse_moved (erp->where);
break;
}
if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
fs.name) &&
- mac_to_unix_pathname (path_name, unix_path_name, 255))
+ mac_to_posix_pathname (path_name, unix_path_name, 255))
drag_and_drop_file_list = Fcons (build_string (unix_path_name),
drag_and_drop_file_list);
}
do_get_menus ();
+ do_check_ram_size ();
+
init_emacs_passwd_dir ();
init_environ ();
if (NILP (Fboundp (Qmac_ready_for_drag_n_drop)))
event_mask -= highLevelEventMask;
- if (WaitNextEvent (event_mask, &er, (expected ? app_sleep_time : 0L), NULL))
+ while (WaitNextEvent (event_mask, &er, 0L, NULL) && numchars > 0)
switch (er.what)
{
case mouseDown:
mouse_tracking_in_progress = mouse_tracking_none;
tracked_scroll_bar = NULL;
count++;
+ bufp++;
+ numchars--;
break;
}
bufp->kind = menu_bar_activate_event;
XSETFRAME (bufp->frame_or_window, f);
count++;
+ bufp++;
+ numchars--;
}
break;
}
count++;
+ bufp++;
+ numchars--;
}
break;
XSETFRAME (bufp->frame_or_window,
((mac_output *) GetWRefCon (window_ptr))->mFP);
count++;
+ bufp++;
+ numchars--;
}
break;
bufp->timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
count++;
+ bufp++;
+ numchars--;
break;
case kHighLevelEvent:
InvalRect (&(wp->portRect));
count++;
+ bufp++;
+ numchars--;
}
default: