}
static gboolean
-pgtk_make_frame_visible_wait_for_map_event_cb (GtkWidget * widget,
- GdkEventAny * event,
+pgtk_make_frame_visible_wait_for_map_event_cb (GtkWidget *widget,
+ GdkEventAny *event,
gpointer user_data)
{
int *foundptr = user_data;
/* Fill rectangle X, Y, W, H with background color of glyph string S. */
static void
-x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h)
+pgtk_clear_glyph_string_rect (struct glyph_string *s, int x, int y,
+ int w, int h)
{
pgtk_fill_rectangle (s->f, s->xgcv.background, x, y, w, h,
(s->first_glyph->type != STRETCH_GLYPH
contains the first component of a composition. */
static void
-x_draw_glyph_string_background (struct glyph_string *s, bool force_p)
+pgtk_draw_glyph_string_background (struct glyph_string *s, bool force_p)
{
/* Nothing to do if background has already been drawn or if it
shouldn't be drawn in the first place. */
|| s->font_not_found_p
|| s->extends_to_end_of_line_p || force_p)
{
- x_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
- s->background_width,
- s->height - 2 * box_line_width);
+ pgtk_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
+ s->background_width,
+ s->height - 2 * box_line_width);
s->background_filled_p = true;
}
}
/* Draw the foreground of glyph string S. */
static void
-x_draw_glyph_string_foreground (struct glyph_string *s)
+pgtk_draw_glyph_string_foreground (struct glyph_string *s)
{
int i, x;
/* Draw the foreground of composite glyph string S. */
static void
-x_draw_composite_glyph_string_foreground (struct glyph_string *s)
+pgtk_draw_composite_glyph_string_foreground (struct glyph_string *s)
{
int i, j, x;
struct font *font = s->font;
/* Draw the foreground of glyph string S for glyphless characters. */
static void
-x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
+pgtk_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
{
struct glyph *glyph = s->first_glyph;
unsigned char2b[8];
#define HIGHLIGHT_COLOR_DARK_BOOST_LIMIT 48000
-/* Allocate a color which is lighter or darker than *PIXEL by FACTOR
- or DELTA. Try a color with RGB values multiplied by FACTOR first.
- If this produces the same color as PIXEL, try a color where all RGB
- values have DELTA added. Return the allocated color in *PIXEL.
- DISPLAY is the X display, CMAP is the colormap to operate on.
- Value is non-zero if successful. */
+/* Compute a color which is lighter or darker than *PIXEL by FACTOR or
+ DELTA. Try a color with RGB values multiplied by FACTOR first. If
+ this produces the same color as PIXEL, try a color where all RGB
+ values have DELTA added. Return the computed color in *PIXEL. F
+ is the frame to act on. */
-static bool
-x_alloc_lighter_color (struct frame *f, unsigned long *pixel, double factor,
- int delta)
+static void
+pgtk_compute_lighter_color (struct frame *f, unsigned long *pixel,
+ double factor, int delta)
{
Emacs_Color color, new;
long bright;
- bool success_p;
/* Get RGB color values. */
color.pixel = *pixel;
}
}
- /* Try to allocate the color. */
- new.pixel = new.red >> 8 << 16 | new.green >> 8 << 8 | new.blue >> 8;
- success_p = true;
- if (success_p)
+ new.pixel = (new.red >> 8 << 16
+ | new.green >> 8 << 8
+ | new.blue >> 8);
+
+ if (new.pixel == *pixel)
{
- if (new.pixel == *pixel)
- {
- /* If we end up with the same color as before, try adding
- delta to the RGB values. */
- new.red = min (0xffff, delta + color.red);
- new.green = min (0xffff, delta + color.green);
- new.blue = min (0xffff, delta + color.blue);
- new.pixel =
- new.red >> 8 << 16 | new.green >> 8 << 8 | new.blue >> 8;
- success_p = true;
- }
- else
- success_p = true;
- *pixel = new.pixel;
+ /* If we end up with the same color as before, try adding
+ delta to the RGB values. */
+ new.red = min (0xffff, delta + color.red);
+ new.green = min (0xffff, delta + color.green);
+ new.blue = min (0xffff, delta + color.blue);
+ new.pixel = (new.red >> 8 << 16
+ | new.green >> 8 << 8
+ | new.blue >> 8);
}
- return success_p;
+ *pixel = new.pixel;
}
static void
-x_fill_trapezoid_for_relief (struct frame *f, unsigned long color, int x,
- int y, int width, int height, int top_p)
+pgtk_fill_trapezoid_for_relief (struct frame *f, unsigned long color, int x,
+ int y, int width, int height, int top_p)
{
cairo_t *cr;
};
static void
-x_erase_corners_for_relief (struct frame *f, unsigned long color, int x,
- int y, int width, int height, double radius,
- double margin, int corners)
+pgtk_erase_corners_for_relief (struct frame *f, unsigned long color, int x,
+ int y, int width, int height, double radius,
+ double margin, int corners)
{
cairo_t *cr;
int i;
pgtk_end_cr_clip (f);
}
-/* Set up the foreground color for drawing relief lines of glyph
- string S. RELIEF is a pointer to a struct relief containing the GC
- with which lines will be drawn. Use a color that is FACTOR or
- DELTA lighter or darker than the relief's background which is found
- in S->f->output_data.pgtk->relief_background. If such a color cannot
- be allocated, use DEFAULT_PIXEL, instead. */
-
static void
pgtk_setup_relief_color (struct frame *f, struct relief *relief, double factor,
int delta, unsigned long default_pixel)
/* Allocate new color. */
xgcv.foreground = default_pixel;
pixel = background;
- if (x_alloc_lighter_color (f, &pixel, factor, delta))
- xgcv.foreground = relief->pixel = pixel;
+ pgtk_compute_lighter_color (f, &pixel, factor, delta);
+ xgcv.foreground = relief->pixel = pixel;
relief->xgcv = xgcv;
}
/* Set up colors for the relief lines around glyph string S. */
-
static void
pgtk_setup_relief_colors (struct glyph_string *s)
{
}
}
-
static void
pgtk_set_clip_rectangles (struct frame *f, cairo_t *cr,
XRectangle *rectangles, int n)
when drawing. */
static void
-x_draw_relief_rect (struct frame *f,
- int left_x, int top_y, int right_x, int bottom_y,
- int hwidth, int vwidth, bool raised_p, bool top_p,
- bool bot_p, bool left_p, bool right_p,
- XRectangle * clip_rect)
+pgtk_draw_relief_rect (struct frame *f,
+ int left_x, int top_y, int right_x, int bottom_y,
+ int hwidth, int vwidth, bool raised_p, bool top_p,
+ bool bot_p, bool left_p, bool right_p,
+ XRectangle * clip_rect)
{
unsigned long top_left_color, bottom_right_color;
int corners = 0;
pgtk_fill_rectangle (f, top_left_color, left_x, top_y,
right_x + 1 - left_x, hwidth, false);
else
- x_fill_trapezoid_for_relief (f, top_left_color, left_x, top_y,
- right_x + 1 - left_x, hwidth, 1);
+ pgtk_fill_trapezoid_for_relief (f, top_left_color, left_x, top_y,
+ right_x + 1 - left_x, hwidth, 1);
}
if (bot_p)
{
bottom_y + 1 - hwidth, right_x + 1 - left_x,
hwidth, false);
else
- x_fill_trapezoid_for_relief (f, bottom_right_color,
- left_x, bottom_y + 1 - hwidth,
- right_x + 1 - left_x, hwidth, 0);
+ pgtk_fill_trapezoid_for_relief (f, bottom_right_color,
+ left_x, bottom_y + 1 - hwidth,
+ right_x + 1 - left_x, hwidth, 0);
}
if (left_p && vwidth > 1)
pgtk_fill_rectangle (f, bottom_right_color, left_x, top_y,
pgtk_fill_rectangle (f, bottom_right_color, left_x, top_y,
right_x + 1 - left_x, 1, false);
if (corners)
- {
- x_erase_corners_for_relief (f, FRAME_BACKGROUND_PIXEL (f), left_x,
- top_y, right_x - left_x + 1,
- bottom_y - top_y + 1, 6, 1, corners);
- }
+ pgtk_erase_corners_for_relief (f, FRAME_BACKGROUND_PIXEL (f), left_x,
+ top_y, right_x - left_x + 1,
+ bottom_y - top_y + 1, 6, 1, corners);
pgtk_end_cr_clip (f);
}
rectangle to use when drawing. */
static void
-x_draw_box_rect (struct glyph_string *s,
- int left_x, int top_y, int right_x, int bottom_y, int hwidth,
- int vwidth, bool left_p, bool right_p,
- XRectangle * clip_rect)
+pgtk_draw_box_rect (struct glyph_string *s, int left_x,
+ int top_y, int right_x, int bottom_y, int hwidth,
+ int vwidth, bool left_p, bool right_p,
+ XRectangle * clip_rect)
{
unsigned long foreground_backup;
/* Draw a box around glyph string S. */
static void
-x_draw_glyph_string_box (struct glyph_string *s)
+pgtk_draw_glyph_string_box (struct glyph_string *s)
{
int hwidth, vwidth, left_x, right_x, top_y, bottom_y, last_x;
bool raised_p, left_p, right_p;
get_glyph_string_clip_rect (s, &clip_rect);
if (s->face->box == FACE_SIMPLE_BOX)
- x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth,
- vwidth, left_p, right_p, &clip_rect);
+ pgtk_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth,
+ vwidth, left_p, right_p, &clip_rect);
else
{
pgtk_setup_relief_colors (s);
- x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth,
- vwidth, raised_p, true, true, left_p, right_p,
- &clip_rect);
+ pgtk_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth,
+ vwidth, raised_p, true, true, left_p, right_p,
+ &clip_rect);
}
}
static void
-x_get_scale_factor (int *scale_x, int *scale_y)
-{
- *scale_x = *scale_y = 1;
-}
-
-static void
-x_draw_horizontal_wave (struct frame *f, unsigned long color, int x, int y,
- int width, int height, int wave_length)
+pgtk_draw_horizontal_wave (struct frame *f, unsigned long color, int x, int y,
+ int width, int height, int wave_length)
{
cairo_t *cr;
double dx = wave_length, dy = height - 1;
pgtk_end_cr_clip (f);
}
-/*
- Draw a wavy line under S. The wave fills wave_height pixels from y0.
-
- x0 wave_length = 2
- --
- y0 * * * * *
- |* * * * * * * * *
- wave_height = 3 | * * * *
-
-*/
static void
-x_draw_underwave (struct glyph_string *s, unsigned long color)
+pgtk_draw_underwave (struct glyph_string *s, unsigned long color)
{
- /* Adjust for scale/HiDPI. */
- int scale_x, scale_y;
-
- x_get_scale_factor (&scale_x, &scale_y);
+ int wave_height = 3, wave_length = 2;
- int wave_height = 3 * scale_y, wave_length = 2 * scale_x;
-
- x_draw_horizontal_wave (s->f, color, s->x, s->ybase - wave_height + 3,
- s->width, wave_height, wave_length);
+ pgtk_draw_horizontal_wave (s->f, color, s->x, s->ybase - wave_height + 3,
+ s->width, wave_height, wave_length);
}
/* Draw a relief around the image glyph string S. */
static void
-x_draw_image_relief (struct glyph_string *s)
+pgtk_draw_image_relief (struct glyph_string *s)
{
int x1, y1, thick;
bool raised_p, top_p, bot_p, left_p, right_p;
pgtk_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
- x_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p,
- top_p, bot_p, left_p, right_p, &r);
+ pgtk_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p,
+ top_p, bot_p, left_p, right_p, &r);
}
/* Draw part of the background of glyph string S. X, Y, W, and H
give the rectangle to draw. */
static void
-x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w,
- int h)
+pgtk_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w,
+ int h)
{
if (s->stippled_p)
{
fill_background (s, x, y, w, h);
}
else
- x_clear_glyph_string_rect (s, x, y, w, h);
+ pgtk_clear_glyph_string_rect (s, x, y, w, h);
}
static void
-x_cr_draw_image (struct frame *f, Emacs_GC *gc, cairo_pattern_t *image,
- int src_x, int src_y, int width, int height,
- int dest_x, int dest_y, bool overlay_p)
+pgtk_cr_draw_image (struct frame *f, Emacs_GC *gc, cairo_pattern_t *image,
+ int src_x, int src_y, int width, int height,
+ int dest_x, int dest_y, bool overlay_p)
{
cairo_t *cr = pgtk_begin_cr_clip (f);
/* Draw foreground of image glyph string S. */
static void
-x_draw_image_foreground (struct glyph_string *s)
+pgtk_draw_image_foreground (struct glyph_string *s)
{
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
{
cairo_t *cr = pgtk_begin_cr_clip (s->f);
pgtk_set_glyph_string_clipping (s, cr);
- x_cr_draw_image (s->f, &s->xgcv, s->img->cr_data,
- s->slice.x, s->slice.y, s->slice.width, s->slice.height,
- x, y, true);
+ pgtk_cr_draw_image (s->f, &s->xgcv, s->img->cr_data,
+ s->slice.x, s->slice.y, s->slice.width, s->slice.height,
+ x, y, true);
if (!s->img->mask)
{
/* When the image has a mask, we can expect that at
*/
static void
-x_draw_image_glyph_string (struct glyph_string *s)
+pgtk_draw_image_glyph_string (struct glyph_string *s)
{
int box_line_hwidth = max (s->face->box_vertical_line_width, 0);
int box_line_vwidth = max (s->face->box_horizontal_line_width, 0);
if (s->slice.y == 0)
y += box_line_vwidth;
- x_draw_glyph_string_bg_rect (s, x, y, width, height);
+ pgtk_draw_glyph_string_bg_rect (s, x, y, width, height);
}
s->background_filled_p = true;
}
/* Draw the foreground. */
- x_draw_image_foreground (s);
+ pgtk_draw_image_foreground (s);
/* If we must draw a relief around the image, do it. */
if (s->img->relief
|| s->hl == DRAW_IMAGE_RAISED
|| s->hl == DRAW_IMAGE_SUNKEN)
- x_draw_image_relief (s);
+ pgtk_draw_image_relief (s);
}
/* Draw stretch glyph string S. */
static void
-x_draw_stretch_glyph_string (struct glyph_string *s)
+pgtk_draw_stretch_glyph_string (struct glyph_string *s)
{
eassert (s->first_glyph->type == STRETCH_GLYPH);
x -= width;
/* Draw cursor. */
- x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
+ pgtk_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
/* Clear rest using the GC of the original non-cursor face. */
if (width < background_width)
x = text_left_x;
}
if (background_width > 0)
- x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
+ pgtk_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
}
s->background_filled_p = true;
pgtk_set_glyph_string_gc (next);
pgtk_set_glyph_string_clipping (next, cr);
if (next->first_glyph->type == STRETCH_GLYPH)
- x_draw_stretch_glyph_string (next);
+ pgtk_draw_stretch_glyph_string (next);
else
- x_draw_glyph_string_background (next, true);
+ pgtk_draw_glyph_string_background (next, true);
next->num_clips = 0;
pgtk_end_cr_clip (next->f);
}
{
pgtk_set_glyph_string_clipping (s, cr);
- x_draw_glyph_string_background (s, true);
- x_draw_glyph_string_box (s);
+ pgtk_draw_glyph_string_background (s, true);
+ pgtk_draw_glyph_string_box (s);
pgtk_set_glyph_string_clipping (s, cr);
relief_drawn_p = true;
}
switch (s->first_glyph->type)
{
case IMAGE_GLYPH:
- x_draw_image_glyph_string (s);
+ pgtk_draw_image_glyph_string (s);
break;
case XWIDGET_GLYPH:
break;
case STRETCH_GLYPH:
- x_draw_stretch_glyph_string (s);
+ pgtk_draw_stretch_glyph_string (s);
break;
case CHAR_GLYPH:
if (s->for_overlaps)
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, false);
- x_draw_glyph_string_foreground (s);
+ pgtk_draw_glyph_string_background (s, false);
+ pgtk_draw_glyph_string_foreground (s);
break;
case COMPOSITE_GLYPH:
&& !s->first_glyph->u.cmp.automatic))
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, true);
- x_draw_composite_glyph_string_foreground (s);
+ pgtk_draw_glyph_string_background (s, true);
+ pgtk_draw_composite_glyph_string_foreground (s);
break;
case GLYPHLESS_GLYPH:
if (s->for_overlaps)
s->background_filled_p = true;
else
- x_draw_glyph_string_background (s, true);
- x_draw_glyphless_glyph_string_foreground (s);
+ pgtk_draw_glyph_string_background (s, true);
+ pgtk_draw_glyphless_glyph_string_foreground (s);
break;
default:
{
/* Draw relief if not yet drawn. */
if (!relief_drawn_p && s->face->box != FACE_NO_BOX)
- x_draw_glyph_string_box (s);
+ pgtk_draw_glyph_string_box (s);
/* Draw underline. */
if (s->face->underline)
if (s->face->underline == FACE_UNDER_WAVE)
{
if (s->face->underline_defaulted_p)
- x_draw_underwave (s, s->xgcv.foreground);
+ pgtk_draw_underwave (s, s->xgcv.foreground);
else
{
- x_draw_underwave (s, s->face->underline_color);
+ pgtk_draw_underwave (s, s->face->underline_color);
}
}
else if (s->face->underline == FACE_UNDER_LINE)
cairo_save (cr);
pgtk_set_glyph_string_clipping_exactly (s, prev, cr);
if (prev->first_glyph->type == CHAR_GLYPH)
- x_draw_glyph_string_foreground (prev);
+ pgtk_draw_glyph_string_foreground (prev);
else
- x_draw_composite_glyph_string_foreground (prev);
+ pgtk_draw_composite_glyph_string_foreground (prev);
prev->hl = save;
prev->num_clips = 0;
cairo_restore (cr);
cairo_save (cr);
pgtk_set_glyph_string_clipping_exactly (s, next, cr);
if (next->first_glyph->type == CHAR_GLYPH)
- x_draw_glyph_string_foreground (next);
+ pgtk_draw_glyph_string_foreground (next);
else
- x_draw_composite_glyph_string_foreground (next);
+ pgtk_draw_composite_glyph_string_foreground (next);
cairo_restore (cr);
next->hl = save;
next->num_clips = 0;
/* Draw a hollow box cursor on window W in glyph row ROW. */
static void
-x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
+pgtk_draw_hollow_cursor (struct window *w, struct glyph_row *row)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
int x, y, wd, h;
}
/* Set clipping, draw the rectangle, and reset clipping again. */
pgtk_clip_to_row (w, row, TEXT_AREA, cr);
- pgtk_draw_rectangle (f, FRAME_X_OUTPUT (f)->cursor_color, x, y, wd, h - 1, false);
+ pgtk_draw_rectangle (f, FRAME_X_OUTPUT (f)->cursor_color,
+ x, y, wd, h - 1, false);
pgtk_end_cr_clip (f);
}
--gerd. */
static void
-x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width,
+pgtk_draw_bar_cursor (struct window *w, struct glyph_row *row, int width,
enum text_cursor_kinds kind)
{
struct frame *f = XFRAME (w->frame);
int cursor_width, bool on_p, bool active_p)
{
struct frame *f = XFRAME (w->frame);
+
if (on_p)
{
w->phys_cursor_type = cursor_type;
switch (cursor_type)
{
case HOLLOW_BOX_CURSOR:
- x_draw_hollow_cursor (w, glyph_row);
+ pgtk_draw_hollow_cursor (w, glyph_row);
break;
case FILLED_BOX_CURSOR:
break;
case BAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
+ pgtk_draw_bar_cursor (w, glyph_row, cursor_width, BAR_CURSOR);
break;
case HBAR_CURSOR:
- x_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
+ pgtk_draw_bar_cursor (w, glyph_row, cursor_width, HBAR_CURSOR);
break;
case NO_CURSOR:
cairo_clip (cr);
}
-static void
-pgtk_cr_draw_image (struct frame *f, Emacs_GC * gc, cairo_pattern_t * image,
- int src_x, int src_y, int width, int height,
- int dest_x, int dest_y, bool overlay_p)
-{
- cairo_t *cr = pgtk_begin_cr_clip (f);
-
- if (overlay_p)
- cairo_rectangle (cr, dest_x, dest_y, width, height);
- else
- {
- pgtk_set_cr_source_with_gc_background (f, gc, false);
- cairo_rectangle (cr, dest_x, dest_y, width, height);
- cairo_fill_preserve (cr);
- }
- cairo_translate (cr, dest_x - src_x, dest_y - src_y);
-
- cairo_surface_t *surface;
- cairo_pattern_get_surface (image, &surface);
- cairo_format_t format = cairo_image_surface_get_format (surface);
- if (format != CAIRO_FORMAT_A8 && format != CAIRO_FORMAT_A1)
- {
- cairo_set_source (cr, image);
- cairo_fill (cr);
- }
- else
- {
- pgtk_set_cr_source_with_gc_foreground (f, gc, false);
- cairo_clip (cr);
- cairo_mask (cr, image);
- }
-
- pgtk_end_cr_clip (f);
-}
-
static void
pgtk_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
struct draw_fringe_bitmap_params *p)
if (p->bx >= 0 && !p->overlay_p)
{
- /* In case the same realized face is used for fringes and
- for something displayed in the text (e.g. face `region' on
+ /* In case the same realized face is used for fringes and for
+ something displayed in the text (e.g. face `region' on
mono-displays, the fill style may have been changed to
- FillSolid in x_draw_glyph_string_background. */
+ FillSolid in pgtk_draw_glyph_string_background. */
if (face->stipple)
{
fill_background_by_face (f, face, p->bx, p->by, p->nx, p->ny);
static void
hourglass_cb (struct atimer *timer)
{
- /*NOP*/}
+
+}
static void
pgtk_show_hourglass (struct frame *f)
struct pgtk_output *x = FRAME_X_OUTPUT (f);
if (x->hourglass_widget != NULL)
gtk_widget_destroy (x->hourglass_widget);
- x->hourglass_widget = gtk_event_box_new (); /* gtk_event_box is GDK_INPUT_ONLY. */
+
+ /* This creates a GDK_INPUT_ONLY window. */
+ x->hourglass_widget = gtk_event_box_new ();
gtk_widget_set_has_window (x->hourglass_widget, true);
gtk_fixed_put (GTK_FIXED (FRAME_GTK_WIDGET (f)), x->hourglass_widget, 0, 0);
gtk_widget_show (x->hourglass_widget);
gdk_window_set_cursor (gtk_widget_get_window (x->hourglass_widget),
x->hourglass_cursor);
- /* For cursor animation, we receive signals, set pending_signals, and dispatch. */
+ /* For cursor animation, we receive signals, set pending_signals,
+ and wait for the signal handler to run. */
if (hourglass_enter_count++ == 0)
{
struct timespec ts = make_timespec (0, 50 * 1000 * 1000);
pgtk_default_font_parameter,
};
-static void
-pgtk_redraw_scroll_bars (struct frame *f)
-{
-}
-
void
pgtk_clear_frame (struct frame *f)
-/* --------------------------------------------------------------------------
- External (hook): Erase the entire frame
- -------------------------------------------------------------------------- */
{
- /* comes on initial frame because we have
- after-make-frame-functions = select-frame */
if (!FRAME_DEFAULT_FACE (f))
return;
- /* mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); */
+ mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
block_input ();
-
pgtk_clear_area (f, 0, 0, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
-
- /* as of 2006/11 or so this is now needed */
- pgtk_redraw_scroll_bars (f);
unblock_input ();
}
-/* Invert the middle quarter of the frame for .15 sec. */
-
static void
recover_from_visible_bell (struct atimer *timer)
{
FRAME_X_OUTPUT (f)->atimer_visible_bell = NULL;
}
+/* Invert the middle quarter of the frame for .15 sec. */
+
static void
pgtk_flash (struct frame *f)
{
int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f);
int height = FRAME_CR_SURFACE_DESIRED_HEIGHT (f);
- cairo_surface_t *surface =
- cairo_surface_create_similar (surface_orig, CAIRO_CONTENT_COLOR_ALPHA,
- width, height);
+ cairo_surface_t *surface
+ = cairo_surface_create_similar (surface_orig, CAIRO_CONTENT_COLOR_ALPHA,
+ width, height);
cairo_t *cr = cairo_create (surface);
cairo_set_source_surface (cr, surface_orig, 0, 0);
and X window of the scroll bar in BAR. */
static void
-x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
+pgtk_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
{
const char *scroll_bar_name = SCROLL_BAR_NAME;
}
static void
-x_create_horizontal_toolkit_scroll_bar (struct frame *f,
- struct scroll_bar *bar)
+pgtk_create_horizontal_toolkit_scroll_bar (struct frame *f,
+ struct scroll_bar *bar)
{
const char *scroll_bar_name = SCROLL_BAR_HORIZONTAL_NAME;
scroll bar. */
static struct scroll_bar *
-x_scroll_bar_create (struct window *w, int top, int left,
- int width, int height, bool horizontal)
+pgtk_scroll_bar_create (struct window *w, int top, int left,
+ int width, int height, bool horizontal)
{
struct frame *f = XFRAME (w->frame);
struct scroll_bar *bar
block_input ();
if (horizontal)
- x_create_horizontal_toolkit_scroll_bar (f, bar);
+ pgtk_create_horizontal_toolkit_scroll_bar (f, bar);
else
- x_create_toolkit_scroll_bar (f, bar);
+ pgtk_create_toolkit_scroll_bar (f, bar);
XSETWINDOW (bar->window, w);
bar->top = top;
nil. */
static void
-x_scroll_bar_remove (struct scroll_bar *bar)
+pgtk_scroll_bar_remove (struct scroll_bar *bar)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
block_input ();
unblock_input ();
}
- bar = x_scroll_bar_create (w, top, left, width, max (height, 1), false);
+ bar = pgtk_scroll_bar_create (w, top, left, width, max (height, 1), false);
}
else
{
unblock_input ();
}
- bar = x_scroll_bar_create (w, top, left, width, height, true);
+ bar = pgtk_scroll_bar_create (w, top, left, width, height, true);
}
else
{
{
struct scroll_bar *b = XSCROLL_BAR (bar);
- x_scroll_bar_remove (b);
+ pgtk_scroll_bar_remove (b);
next = b->next;
b->next = b->prev = Qnil;
Lisp code can tell when the switch took place by examining the events. */
static void
-x_new_focus_frame (struct pgtk_display_info *dpyinfo, struct frame *frame)
+pgtk_new_focus_frame (struct pgtk_display_info *dpyinfo, struct frame *frame)
{
struct frame *old_focus = dpyinfo->x_focus_frame;
/* doesn't work on wayland */
a FOCUS_IN_EVENT into *BUFP. */
static void
-x_focus_changed (gboolean is_enter, int state,
- struct pgtk_display_info *dpyinfo, struct frame *frame,
- union buffered_input_event *bufp)
+pgtk_focus_changed (gboolean is_enter, int state,
+ struct pgtk_display_info *dpyinfo, struct frame *frame,
+ union buffered_input_event *bufp)
{
if (is_enter)
{
if (dpyinfo->x_focus_event_frame != frame)
{
- x_new_focus_frame (dpyinfo, frame);
+ pgtk_new_focus_frame (dpyinfo, frame);
dpyinfo->x_focus_event_frame = frame;
/* Don't stop displaying the initial startup message
if (dpyinfo->x_focus_event_frame == frame)
{
dpyinfo->x_focus_event_frame = 0;
- x_new_focus_frame (dpyinfo, 0);
+ pgtk_new_focus_frame (dpyinfo, NULL);
bufp->ie.kind = FOCUS_OUT_EVENT;
XSETFRAME (bufp->ie.frame_or_window, frame);
gpointer *user_data)
{
union buffered_input_event inev;
- struct frame *frame =
- pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+ struct frame *frame
+ = pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+
if (frame == NULL)
return FALSE;
+
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
struct frame *focus_frame = dpyinfo->x_focus_frame;
int focus_state
if (event->crossing.detail != GDK_NOTIFY_INFERIOR
&& event->crossing.focus && !(focus_state & FOCUS_EXPLICIT))
- x_focus_changed (TRUE, FOCUS_IMPLICIT, dpyinfo, frame, &inev);
+ pgtk_focus_changed (TRUE, FOCUS_IMPLICIT, dpyinfo, frame, &inev);
if (inev.ie.kind != NO_EVENT)
evq_enqueue (&inev);
return TRUE;
gpointer *user_data)
{
union buffered_input_event inev;
- struct frame *frame =
- pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+ struct frame *frame
+ = pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+
if (frame == NULL)
return FALSE;
+
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
struct frame *focus_frame = dpyinfo->x_focus_frame;
int focus_state
if (event->crossing.detail != GDK_NOTIFY_INFERIOR
&& event->crossing.focus && !(focus_state & FOCUS_EXPLICIT))
- x_focus_changed (FALSE, FOCUS_IMPLICIT, dpyinfo, frame, &inev);
+ pgtk_focus_changed (FALSE, FOCUS_IMPLICIT, dpyinfo, frame, &inev);
if (frame)
{
}
static gboolean
-focus_in_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+focus_in_event (GtkWidget *widget, GdkEvent *event, gpointer *user_data)
{
union buffered_input_event inev;
- struct frame *frame =
- pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+ struct frame *frame
+ = pgtk_any_window_to_frame (gtk_widget_get_window (widget));
if (frame == NULL)
return TRUE;
inev.ie.kind = NO_EVENT;
inev.ie.arg = Qnil;
- x_focus_changed (TRUE, FOCUS_EXPLICIT,
- FRAME_DISPLAY_INFO (frame), frame, &inev);
+ pgtk_focus_changed (TRUE, FOCUS_EXPLICIT,
+ FRAME_DISPLAY_INFO (frame), frame, &inev);
if (inev.ie.kind != NO_EVENT)
evq_enqueue (&inev);
}
static gboolean
-focus_out_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+focus_out_event (GtkWidget *widget, GdkEvent *event, gpointer *user_data)
{
union buffered_input_event inev;
- struct frame *frame =
- pgtk_any_window_to_frame (gtk_widget_get_window (widget));
+ struct frame *frame
+ = pgtk_any_window_to_frame (gtk_widget_get_window (widget));
if (frame == NULL)
return TRUE;
inev.ie.kind = NO_EVENT;
inev.ie.arg = Qnil;
- x_focus_changed (FALSE, FOCUS_EXPLICIT,
- FRAME_DISPLAY_INFO (frame), frame, &inev);
+ pgtk_focus_changed (FALSE, FOCUS_EXPLICIT,
+ FRAME_DISPLAY_INFO (frame), frame, &inev);
if (inev.ie.kind != NO_EVENT)
evq_enqueue (&inev);
static cairo_status_t
pgtk_cr_accumulate_data (void *closure, const unsigned char *data,
- unsigned int length)
+ unsigned int length)
{
Lisp_Object *acc = (Lisp_Object *) closure;
unblock_input ();
}
-
-
Lisp_Object
pgtk_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type)
{
return CALLN (Fapply, intern ("concat"), Fnreverse (acc));
}
-
void
init_pgtkterm (void)
{