static int is_emacs_window (WindowPtr);
-extern int image_ascent (struct image *, struct face *);
int x_bitmap_icon (struct frame *, Lisp_Object);
void x_make_frame_visible (struct frame *);
Display *display; /* not used */
Pixmap pixmap;
{
- DisposeGWorld (pixmap);
+ DisposeGWorld (pixmap);
}
int x, y0, y1;
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
-
+
XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
f->output_data.mac->normal_gc, x, y0, x, y1);
}
: face->foreground);
gcv.background = face->background;
- mac_draw_bitmap (display, window, &gcv, p->x, p->y,
+ mac_draw_bitmap (display, window, &gcv, p->x, p->y,
p->wd, p->h, bits, p->overlay_p);
}
static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
int, int, int));
static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
- int, int, int, int, Rect *));
+ int, int, int, int, int, int,
+ Rect *));
static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
int, int, int, Rect *));
static void
x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
- raised_p, left_p, right_p, clip_rect)
+ raised_p, top_p, bot_p, left_p, right_p, clip_rect)
struct frame *f;
- int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p;
+ int left_x, top_y, right_x, bottom_y, width;
+ int top_p, bot_p, left_p, right_p, raised_p;
Rect *clip_rect;
{
Display *dpy = FRAME_MAC_DISPLAY (f);
mac_set_clip_rectangle (dpy, window, clip_rect);
/* Top. */
- for (i = 0; i < width; ++i)
- XDrawLine (dpy, window, gc,
- left_x + i * left_p, top_y + i,
- right_x - i * right_p, top_y + i);
+ if (top_p)
+ for (i = 0; i < width; ++i)
+ XDrawLine (dpy, window, gc,
+ left_x + i * left_p, top_y + i,
+ right_x - i * right_p, top_y + i);
/* Left. */
if (left_p)
clip_rect);
/* Bottom. */
- for (i = 0; i < width; ++i)
- XDrawLine (dpy, window, gc,
- left_x + i * left_p, bottom_y - i,
- right_x - i * right_p, bottom_y - i);
+ if (bot_p)
+ for (i = 0; i < width; ++i)
+ XDrawLine (dpy, window, gc,
+ left_x + i * left_p, bottom_y - i,
+ right_x - i * right_p, bottom_y - i);
/* Right. */
if (right_p)
{
x_setup_relief_colors (s);
x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
- width, raised_p, left_p, right_p, &clip_rect);
+ width, raised_p, 1, 1, left_p, right_p, &clip_rect);
}
}
x_draw_image_foreground (s)
struct glyph_string *s;
{
- int x;
- int y = s->ybase - image_ascent (s->img, s->face);
+ int x = s->x;
+ int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
/* If first glyph of S has a left box line, start drawing it to the
right of that line. */
if (s->face->box != FACE_NO_BOX
- && s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
- else
- x = s->x;
+ && s->first_glyph->left_box_line_p
+ && s->slice.x == 0)
+ x += abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
- x += s->img->hmargin;
- y += s->img->vmargin;
+ if (s->slice.x == 0)
+ x += s->img->hmargin;
+ if (s->slice.y == 0)
+ y += s->img->vmargin;
if (s->img->pixmap)
{
CONVERT_TO_XRECT (clip_rect, nr);
image_rect.x = x;
image_rect.y = y;
- image_rect.width = s->img->width;
- image_rect.height = s->img->height;
+ image_rect.width = s->slice.width;
+ image_rect.height = s->slice.height;
if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask,
- s->window, s->gc, r.x - x, r.y - y,
+ s->window, s->gc,
+ s->slice.x + r.x - x, s->slice.y + r.y - y,
r.width, r.height, r.x, r.y);
}
else
CONVERT_TO_XRECT (clip_rect, nr);
image_rect.x = x;
image_rect.y = y;
- image_rect.width = s->img->width;
- image_rect.height = s->img->height;
+ image_rect.width = s->slice.width;
+ image_rect.height = s->slice.height;
if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
mac_copy_area (s->display, s->img->pixmap, s->window, s->gc,
- r.x - x, r.y - y, r.width, r.height, r.x, r.y);
+ s->slice.x + r.x - x, s->slice.y + r.y - y,
+ r.width, r.height, r.x, r.y);
/* When the image has a mask, we can expect that at
least part of a mouse highlight or a block cursor will
{
int r = s->img->relief;
if (r < 0) r = -r;
- mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r,
- s->img->width + r*2 - 1, s->img->height + r*2 - 1);
+ mac_draw_rectangle (s->display, s->window, s->gc,
+ x - r, y - r,
+ s->slice.width + r*2 - 1,
+ s->slice.height + r*2 - 1);
}
}
}
else
/* Draw a rectangle if image could not be loaded. */
mac_draw_rectangle (s->display, s->window, s->gc, x, y,
- s->img->width - 1, s->img->height - 1);
+ s->slice.width - 1, s->slice.height - 1);
}
{
int x0, y0, x1, y1, thick, raised_p;
Rect r;
- int x;
- int y = s->ybase - image_ascent (s->img, s->face);
+ int x = s->x;
+ int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
/* If first glyph of S has a left box line, start drawing it to the
right of that line. */
if (s->face->box != FACE_NO_BOX
- && s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
- else
- x = s->x;
+ && s->first_glyph->left_box_line_p
+ && s->slice.x == 0)
+ x += abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
- x += s->img->hmargin;
- y += s->img->vmargin;
+ if (s->slice.x == 0)
+ x += s->img->hmargin;
+ if (s->slice.y == 0)
+ y += s->img->vmargin;
if (s->hl == DRAW_IMAGE_SUNKEN
|| s->hl == DRAW_IMAGE_RAISED)
x0 = x - thick;
y0 = y - thick;
- x1 = x + s->img->width + thick - 1;
- y1 = y + s->img->height + thick - 1;
+ x1 = x + s->slice.width + thick - 1;
+ y1 = y + s->slice.height + thick - 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
- x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r);
+ x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
+ s->slice.y == 0,
+ s->slice.y + s->slice.height == s->img->height,
+ s->slice.x == 0,
+ s->slice.x + s->slice.width == s->img->width,
+ &r);
}
struct glyph_string *s;
Pixmap pixmap;
{
- int x;
- int y = s->ybase - s->y - image_ascent (s->img, s->face);
+ int x = 0;
+ int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
/* If first glyph of S has a left box line, start drawing it to the
right of that line. */
if (s->face->box != FACE_NO_BOX
- && s->first_glyph->left_box_line_p)
- x = abs (s->face->box_line_width);
- else
- x = 0;
+ && s->first_glyph->left_box_line_p
+ && s->slice.x == 0)
+ x += abs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
- x += s->img->hmargin;
- y += s->img->vmargin;
+ if (s->slice.x == 0)
+ x += s->img->hmargin;
+ if (s->slice.y == 0)
+ y += s->img->vmargin;
if (s->img->pixmap)
{
if (s->img->mask)
mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap,
s->img->mask, pixmap, s->gc,
- 0, 0, s->img->width, s->img->height,
+ s->slice.x, s->slice.y,
+ s->slice.width, s->slice.height,
x, y);
else
{
mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc,
- 0, 0, s->img->width, s->img->height, x, y);
+ s->slice.x, s->slice.y,
+ s->slice.width, s->slice.height,
+ x, y);
/* When the image has a mask, we can expect that at
least part of a mouse highlight or a block cursor will
int r = s->img->relief;
if (r < 0) r = -r;
mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r,
- s->img->width + r*2 - 1,
- s->img->height + r*2 - 1);
+ s->slice.width + r*2 - 1,
+ s->slice.height + r*2 - 1);
}
}
}
else
/* Draw a rectangle if image could not be loaded. */
mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y,
- s->img->width - 1, s->img->height - 1);
+ s->slice.width - 1, s->slice.height - 1);
}
taller than image or if image has a clip mask to reduce
flickering. */
s->stippled_p = s->face->stipple != 0;
- if (height > s->img->height
+ if (height > s->slice.height
|| s->img->hmargin
|| s->img->vmargin
|| s->img->mask
|| s->img->pixmap == 0
|| s->width != s->background_width)
{
- if (box_line_hwidth && s->first_glyph->left_box_line_p)
- x = s->x + box_line_hwidth;
- else
- x = s->x;
+ x = s->x;
+ if (s->first_glyph->left_box_line_p
+ && s->slice.x == 0)
+ x += box_line_hwidth;
- y = s->y + box_line_vwidth;
+ y = s->y;
+ if (s->slice.y == 0)
+ y += box_line_vwidth;
if (s->img->mask)
{
/* x is to the right of the last glyph in the row. */
rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
- /* Shouldn't this be a pixel value?
+ /* Shouldn't this be a pixel value?
WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
++KFS */
rect->right = WINDOW_RIGHT_EDGE_COL (w);
if (button_event->what == mouseDown)
handle_tool_bar_click (f, x, y, 1, 0);
else
- handle_tool_bar_click (f, x, y, 0,
+ handle_tool_bar_click (f, x, y, 0,
x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f),
button_event->modifiers));
}
if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
{
int wid = FRAME_COLUMN_WIDTH (f);
- FRAME_CONFIG_SCROLL_BAR_COLS (f)
+ FRAME_CONFIG_SCROLL_BAR_COLS (f)
= (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
}
else
break;
case smKorean:
coding_system = Qeuc_kr;
- break;
+ break;
default:
return;
}
if (fast_string_match (pattern_regex, fontname) >= 0)
{
font_list = Fcons (fontname, font_list);
-
+
n_fonts++;
if (maxnames > 0 && n_fonts >= maxnames)
break;
if (modifiers & controlKey)
result = cmdIs3 ? 2 : 1;
else if (modifiers & optionKey)
- result = cmdIs3 ? 1 : 2;
+ result = cmdIs3 ? 1 : 2;
}
return result;
}
switch (result)
{
case kEventMouseButtonPrimary:
- if (Vmac_emulate_three_button_mouse == Qnil)
+ if (Vmac_emulate_three_button_mouse == Qnil)
return 0;
else {
UInt32 mods = 0;
switch (part_code)
{
case inMenuBar:
- if (er.what == mouseDown)
+ if (er.what == mouseDown)
{
struct frame *f = ((mac_output *)
GetWRefCon (FrontWindow ()))->mFP;
else
mouse_tracking_in_progress = mouse_tracking_none;
window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1);
-
+
if (EQ (window, mwp->mFP->tool_bar_window))
{
if (er.what == mouseDown)
case inDrag:
#if TARGET_API_MAC_CARBON
- if (er.what == mouseDown)
+ if (er.what == mouseDown)
{
BitMap bm;
-
+
GetQDGlobalsScreenBits (&bm);
DragWindow (window_ptr, er.where, &bm.bounds);
}
/* window resize handling added --ben */
case inGrow:
- if (er.what == mouseDown)
+ if (er.what == mouseDown)
{
do_grow_window(window_ptr, &er);
break;
useful for non-standard keyboard layouts. */);
Vmac_reverse_ctrl_meta = Qnil;
- DEFVAR_LISP ("mac-emulate-three-button-mouse",
+ DEFVAR_LISP ("mac-emulate-three-button-mouse",
&Vmac_emulate_three_button_mouse,
doc: /* t means that when the option-key is held down while pressing the
- mouse button, the click will register as mouse-2 and while the
+ mouse button, the click will register as mouse-2 and while the
command-key is held down, the click will register as mouse-3.
'reverse means that the the option-key will register for mouse-3
and the command-key will register for mouse-2. nil means that