Migrate to Emacs_GC
* ../src/xfaces.c (x_create_gc, x_free_gc): * ../src/pgtkterm.h (struct pgtk_output, struct pgtk_output): * ../src/pgtkterm.c (x_set_cursor_gc, x_set_mouse_face_gc) (x_setup_relief_color, x_draw_image_foreground_1) (x_draw_image_foreground) (pgtk_cr_draw_image, pgtk_draw_fringe_bitmap) (pgtk_begin_cr_clip, pgtk_set_cr_source_with_gc_foreground) (pgtk_set_cr_source_with_gc_background): * ../src/pgtkgui.h: * ../src/dispextern.h (struct glyph_string): clean up XGCValues emulation XGCValues, GC 廃止。 Emacs_GC に統一。
This commit is contained in:
parent
f4920a6883
commit
330a346ca7
5 changed files with 17 additions and 36 deletions
|
@ -1402,7 +1402,7 @@ struct glyph_string
|
|||
HDC hdc;
|
||||
#endif
|
||||
#if defined (HAVE_PGTK)
|
||||
XGCValues xgcv;
|
||||
Emacs_GC xgcv;
|
||||
#endif
|
||||
|
||||
/* A pointer to the first glyph in the string. This glyph
|
||||
|
|
|
@ -43,26 +43,7 @@ typedef unichar XChar2b;
|
|||
(*(chp) & 0x00ff)
|
||||
|
||||
|
||||
/* XXX: xfaces requires these structures, but the question is are we
|
||||
forced to use them? */
|
||||
typedef struct _XGCValues
|
||||
{
|
||||
unsigned long foreground;
|
||||
unsigned long background;
|
||||
void *font;
|
||||
} XGCValues;
|
||||
|
||||
typedef XGCValues * GC;
|
||||
|
||||
#define GCForeground 0x01
|
||||
#define GCBackground 0x02
|
||||
#define GCFont 0x03
|
||||
|
||||
typedef void *Pixmap;
|
||||
|
||||
typedef void *Cursor;
|
||||
|
||||
#define No_Cursor (0)
|
||||
typedef void *Emacs_Cursor;
|
||||
|
||||
typedef void * Color;
|
||||
typedef int Window;
|
||||
|
|
|
@ -754,7 +754,7 @@ x_set_cursor_gc (struct glyph_string *s)
|
|||
else
|
||||
{
|
||||
/* Cursor on non-default face: must merge. */
|
||||
XGCValues xgcv;
|
||||
Emacs_GC xgcv;
|
||||
|
||||
PGTK_TRACE("x_set_cursor_gc: 2.");
|
||||
xgcv.background = FRAME_X_OUTPUT(s->f)->cursor_color;
|
||||
|
@ -815,7 +815,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
|
|||
{
|
||||
/* Otherwise construct scratch_cursor_gc with values from FACE
|
||||
except for FONT. */
|
||||
XGCValues xgcv;
|
||||
Emacs_GC xgcv;
|
||||
|
||||
xgcv.background = s->face->background;
|
||||
xgcv.foreground = s->face->foreground;
|
||||
|
@ -1433,7 +1433,7 @@ static void
|
|||
x_setup_relief_color (struct frame *f, struct relief *relief, double factor,
|
||||
int delta, unsigned long default_pixel)
|
||||
{
|
||||
XGCValues xgcv;
|
||||
Emacs_GC xgcv;
|
||||
struct pgtk_output *di = FRAME_X_OUTPUT(f);
|
||||
unsigned long pixel;
|
||||
unsigned long background = di->relief_background;
|
||||
|
@ -3107,7 +3107,7 @@ pgtk_clip_to_row (struct window *w, struct glyph_row *row,
|
|||
}
|
||||
|
||||
static void
|
||||
pgtk_cr_draw_image (struct frame *f, GC gc, cairo_pattern_t *image,
|
||||
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)
|
||||
{
|
||||
|
@ -3198,7 +3198,7 @@ pgtk_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fr
|
|||
PGTK_TRACE("which: %d, max_fringe_bmp: %d.", p->which, max_fringe_bmp);
|
||||
if (p->which && p->which < max_fringe_bmp)
|
||||
{
|
||||
XGCValues gcv;
|
||||
Emacs_GC gcv;
|
||||
|
||||
PGTK_TRACE("cursor_p=%d.", p->cursor_p);
|
||||
PGTK_TRACE("overlay_p_p=%d.", p->overlay_p);
|
||||
|
@ -6356,14 +6356,14 @@ pgtk_end_cr_clip (struct frame *f)
|
|||
}
|
||||
|
||||
void
|
||||
pgtk_set_cr_source_with_gc_foreground (struct frame *f, XGCValues *gc)
|
||||
pgtk_set_cr_source_with_gc_foreground (struct frame *f, Emacs_GC *gc)
|
||||
{
|
||||
PGTK_TRACE("pgtk_set_cr_source_with_gc_foreground: %08lx", gc->foreground);
|
||||
pgtk_set_cr_source_with_color(f, gc->foreground);
|
||||
}
|
||||
|
||||
void
|
||||
pgtk_set_cr_source_with_gc_background (struct frame *f, XGCValues *gc)
|
||||
pgtk_set_cr_source_with_gc_background (struct frame *f, Emacs_GC *gc)
|
||||
{
|
||||
PGTK_TRACE("pgtk_set_cr_source_with_gc_background: %08lx", gc->background);
|
||||
pgtk_set_cr_source_with_color(f, gc->background);
|
||||
|
|
|
@ -255,7 +255,7 @@ struct pgtk_output
|
|||
mapped to display an hourglass cursor. */
|
||||
GtkWidget *hourglass_widget;
|
||||
|
||||
XGCValues cursor_xgcv;
|
||||
Emacs_GC cursor_xgcv;
|
||||
|
||||
/* lord knows why Emacs needs to know about our Window ids.. */
|
||||
Window window_desc, parent_desc;
|
||||
|
@ -349,7 +349,7 @@ struct pgtk_output
|
|||
/* Relief GCs, colors etc. */
|
||||
struct relief
|
||||
{
|
||||
XGCValues xgcv;
|
||||
Emacs_GC xgcv;
|
||||
unsigned long pixel;
|
||||
}
|
||||
black_relief, white_relief;
|
||||
|
@ -542,8 +542,8 @@ extern int pgtk_select (int nfds, fd_set *readfds, fd_set *writefds,
|
|||
/* Cairo related functions implemented in pgtkterm.c */
|
||||
extern cairo_t *pgtk_begin_cr_clip (struct frame *f);
|
||||
extern void pgtk_end_cr_clip (struct frame *f);
|
||||
extern void pgtk_set_cr_source_with_gc_foreground (struct frame *f, XGCValues *gc);
|
||||
extern void pgtk_set_cr_source_with_gc_background (struct frame *f, XGCValues *gc);
|
||||
extern void pgtk_set_cr_source_with_gc_foreground (struct frame *f, Emacs_GC *gc);
|
||||
extern void pgtk_set_cr_source_with_gc_background (struct frame *f, Emacs_GC *gc);
|
||||
extern void pgtk_set_cr_source_with_color (struct frame *f, unsigned long color);
|
||||
extern void pgtk_cr_draw_frame (cairo_t *cr, struct frame *f);
|
||||
extern void pgtk_cr_destroy_surface(struct frame *f);
|
||||
|
|
|
@ -578,18 +578,18 @@ x_free_gc (struct frame *f, Emacs_GC *gc)
|
|||
#ifdef HAVE_PGTK
|
||||
/* PGTK emulation of GCs */
|
||||
|
||||
static GC
|
||||
static Emacs_GC *
|
||||
x_create_gc (struct frame *f,
|
||||
unsigned long mask,
|
||||
XGCValues *xgcv)
|
||||
Emacs_GC *xgcv)
|
||||
{
|
||||
GC gc = xmalloc (sizeof *gc);
|
||||
Emacs_GC *gc = xmalloc (sizeof *gc);
|
||||
*gc = *xgcv;
|
||||
return gc;
|
||||
}
|
||||
|
||||
static void
|
||||
x_free_gc (struct frame *f, GC gc)
|
||||
x_free_gc (struct frame *f, Emacs_GC *gc)
|
||||
{
|
||||
xfree (gc);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue