typedef Cursor Emacs_Cursor;
#define No_Cursor (None)
typedef Pixmap Emacs_Pixmap;
-
+typedef XRectangle Emacs_Rectangle;
#else /* !HAVE_X_WINDOWS */
/* XColor-like struct used by non-X code. */
/* Accommodate X's usage of None as a null resource ID. */
#define No_Cursor (NULL)
+
+/* XRectangle-like struct used by non-X GUI code. */
+typedef struct
+{
+ int x, y;
+ unsigned width, height;
+} Emacs_Rectangle;
#endif /* HAVE_X_WINDOWS */
#ifdef MSDOS
#ifdef HAVE_WINDOW_SYSTEM
/* Non-NULL means the current clipping area. This is temporarily
set while exposing a region. Coordinates are frame-relative. */
- XRectangle *clip;
+ const Emacs_Rectangle *clip;
#endif
};
int, int, bool, int);
extern void expose_frame (struct frame *, int, int, int, int);
-extern bool gui_intersect_rectangles (XRectangle *, XRectangle *, XRectangle *);
+extern bool gui_intersect_rectangles (const Emacs_Rectangle *,
+ const Emacs_Rectangle *,
+ Emacs_Rectangle *);
#endif /* HAVE_WINDOW_SYSTEM */
extern void note_mouse_highlight (struct frame *, int, int);
typedef int Window;
-
-/* Some sort of attempt to normalize rectangle handling. Seems a bit
- much for what is accomplished. */
-typedef struct {
- int x, y;
- unsigned width, height;
-} XRectangle;
-
#ifndef __OBJC__
#if defined (__LP64__) && __LP64__
typedef double CGFloat;
#define NativeRectangle NSRect
-#define CONVERT_TO_XRECT(xr, nr) \
+#define CONVERT_TO_EMACS_RECT(xr, nr) \
((xr).x = (nr).origin.x, \
(xr).y = (nr).origin.y, \
(xr).width = (nr).size.width, \
(xr).height = (nr).size.height)
-#define CONVERT_FROM_XRECT(xr, nr) \
+#define CONVERT_FROM_EMACS_RECT(xr, nr) \
((nr).origin.x = (xr).x, \
(nr).origin.y = (xr).y, \
(nr).size.width = (xr).width, \
int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;
int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
- XRectangle wave_clip, string_clip, final_clip;
+ Emacs_Rectangle wave_clip, string_clip, final_clip;
RECT w32_final_clip, w32_string_clip;
HPEN hp, oldhp;
wave_clip.height = wave_height;
get_glyph_string_clip_rect (s, &w32_string_clip);
- CONVERT_TO_XRECT (string_clip, w32_string_clip);
+ CONVERT_TO_EMACS_RECT (string_clip, w32_string_clip);
if (!gui_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
return;
hp = CreatePen (PS_SOLID, thickness, color);
oldhp = SelectObject (s->hdc, hp);
- CONVERT_FROM_XRECT (final_clip, w32_final_clip);
+ CONVERT_FROM_EMACS_RECT (final_clip, w32_final_clip);
w32_set_clip_rectangle (s->hdc, &w32_final_clip);
/* Draw the waves */
int
get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int n)
{
- XRectangle r;
+ Emacs_Rectangle r;
if (n <= 0)
return 0;
take the intersection with the rectangle of the cursor. */
if (s->for_overlaps & OVERLAPS_ERASED_CURSOR)
{
- XRectangle rc, r_save = r;
+ Emacs_Rectangle rc, r_save = r;
rc.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (s->w, s->w->phys_cursor.x);
rc.y = s->w->phys_cursor.y;
if (s->row->clip)
{
- XRectangle r_save = r;
+ Emacs_Rectangle r_save = r;
if (! gui_intersect_rectangles (&r_save, s->row->clip, &r))
r.width = 0;
if ((s->for_overlaps & OVERLAPS_BOTH) == 0
|| ((s->for_overlaps & OVERLAPS_BOTH) == OVERLAPS_BOTH && n == 1))
{
-#ifdef CONVERT_FROM_XRECT
- CONVERT_FROM_XRECT (r, *rects);
+#ifdef CONVERT_FROM_EMACS_RECT
+ CONVERT_FROM_EMACS_RECT (r, *rects);
#else
*rects = r;
#endif
multiple clipping rectangles, we exclude the row of the glyph
string from the clipping rectangle. This is to avoid drawing
the same text on the environment with anti-aliasing. */
-#ifdef CONVERT_FROM_XRECT
- XRectangle rs[2];
+#ifdef CONVERT_FROM_EMACS_RECT
+ Emacs_Rectangle rs[2];
#else
- XRectangle *rs = rects;
+ Emacs_Rectangle *rs = rects;
#endif
int i = 0, row_y = WINDOW_TO_FRAME_PIXEL_Y (s->w, s->row->y);
}
n = i;
-#ifdef CONVERT_FROM_XRECT
+#ifdef CONVERT_FROM_EMACS_RECT
for (i = 0; i < n; i++)
- CONVERT_FROM_XRECT (rs[i], rects[i]);
+ CONVERT_FROM_EMACS_RECT (rs[i], rects[i]);
#endif
return n;
}
which intersects rectangle R. R is in window-relative coordinates. */
static void
-expose_area (struct window *w, struct glyph_row *row, XRectangle *r,
+expose_area (struct window *w, struct glyph_row *row, const Emacs_Rectangle *r,
enum glyph_row_area area)
{
struct glyph *first = row->glyphs[area];
true if mouse-face was overwritten. */
static bool
-expose_line (struct window *w, struct glyph_row *row, XRectangle *r)
+expose_line (struct window *w, struct glyph_row *row, const Emacs_Rectangle *r)
{
eassert (row->enabled_p);
expose_overlaps (struct window *w,
struct glyph_row *first_overlapping_row,
struct glyph_row *last_overlapping_row,
- XRectangle *r)
+ const Emacs_Rectangle *r)
{
struct glyph_row *row;
/* Return true if W's cursor intersects rectangle R. */
static bool
-phys_cursor_in_rect_p (struct window *w, XRectangle *r)
+phys_cursor_in_rect_p (struct window *w, const Emacs_Rectangle *r)
{
- XRectangle cr, result;
+ Emacs_Rectangle cr, result;
struct glyph *cursor_glyph;
struct glyph_row *row;
mouse-face. */
static bool
-expose_window (struct window *w, XRectangle *fr)
+expose_window (struct window *w, const Emacs_Rectangle *fr)
{
struct frame *f = XFRAME (w->frame);
- XRectangle wr, r;
+ Emacs_Rectangle wr, r;
bool mouse_face_overwritten_p = false;
/* If window is not yet fully initialized, do nothing. This can
true if the exposure overwrites mouse-face. */
static bool
-expose_window_tree (struct window *w, XRectangle *r)
+expose_window_tree (struct window *w, const Emacs_Rectangle *r)
{
struct frame *f = XFRAME (w->frame);
bool mouse_face_overwritten_p = false;
void
expose_frame (struct frame *f, int x, int y, int w, int h)
{
- XRectangle r;
+ Emacs_Rectangle r;
bool mouse_face_overwritten_p = false;
TRACE ((stderr, "expose_frame "));
empty. */
bool
-gui_intersect_rectangles (XRectangle *r1, XRectangle *r2, XRectangle *result)
+gui_intersect_rectangles (const Emacs_Rectangle *r1, const Emacs_Rectangle *r2,
+ Emacs_Rectangle *result)
{
- XRectangle *left, *right;
- XRectangle *upper, *lower;
+ const Emacs_Rectangle *left, *right;
+ const Emacs_Rectangle *upper, *lower;
bool intersection_p = false;
/* Rearrange so that R1 is the left-most rectangle. */