diff options
| author | Alexander Gramiak | 2019-05-09 22:08:06 -0600 |
|---|---|---|
| committer | Alexander Gramiak | 2019-05-19 19:50:32 -0600 |
| commit | b3d3c0daa49f5cbed7c58c7508d4d36dba3757e5 (patch) | |
| tree | 72360d5d9cdd8bc9f6ad715128d5452889d0caa3 | |
| parent | 462b1fd7185ab8866c8db15b6e7a9b865e4d2389 (diff) | |
| download | emacs-b3d3c0daa49f5cbed7c58c7508d4d36dba3757e5.tar.gz emacs-b3d3c0daa49f5cbed7c58c7508d4d36dba3757e5.zip | |
Introduce Emacs_GC struct and typedef
* src/dispextern.h [HAVE_X_WINDOWS]: Alias Emacs_GC to XGCValues.
[!HAVE_X_WINDOWS]: Define Emacs_GC, GCForeground, and GCBackground.
* src/nsgui.h:
* src/w32gui.h:Remove obsolete XGCValues, GC, GCForeground,
GCBackground, and GCFont definitions.
* src/w32fns.c (w32_make_gc): Do not set unused font field.
* src/w32term.c: Use Emacs_GC over XGCValues. Do not set unused font
field.
* src/xfaces.c: Use Emacs_GC over XGCValues and GC.
| -rw-r--r-- | src/dispextern.h | 22 | ||||
| -rw-r--r-- | src/nsgui.h | 19 | ||||
| -rw-r--r-- | src/w32fns.c | 7 | ||||
| -rw-r--r-- | src/w32gui.h | 13 | ||||
| -rw-r--r-- | src/w32term.c | 83 | ||||
| -rw-r--r-- | src/w32term.h | 8 | ||||
| -rw-r--r-- | src/xfaces.c | 34 |
7 files changed, 82 insertions, 104 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 2077f891d10..05e09301b06 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -40,6 +40,7 @@ typedef Cursor Emacs_Cursor; | |||
| 40 | #define No_Cursor (None) | 40 | #define No_Cursor (None) |
| 41 | typedef Pixmap Emacs_Pixmap; | 41 | typedef Pixmap Emacs_Pixmap; |
| 42 | typedef XRectangle Emacs_Rectangle; | 42 | typedef XRectangle Emacs_Rectangle; |
| 43 | typedef XGCValues Emacs_GC; | ||
| 43 | #else /* !HAVE_X_WINDOWS */ | 44 | #else /* !HAVE_X_WINDOWS */ |
| 44 | 45 | ||
| 45 | /* XColor-like struct used by non-X code. */ | 46 | /* XColor-like struct used by non-X code. */ |
| @@ -59,6 +60,20 @@ typedef struct | |||
| 59 | int x, y; | 60 | int x, y; |
| 60 | unsigned width, height; | 61 | unsigned width, height; |
| 61 | } Emacs_Rectangle; | 62 | } Emacs_Rectangle; |
| 63 | |||
| 64 | /* XGCValues-like struct used by non-X GUI code. */ | ||
| 65 | typedef struct | ||
| 66 | { | ||
| 67 | unsigned long foreground; | ||
| 68 | unsigned long background; | ||
| 69 | } Emacs_GC; | ||
| 70 | |||
| 71 | /* Mask values to select foreground/background. */ | ||
| 72 | /* FIXME: The GC handling in w32 really should be redesigned as to not | ||
| 73 | need these. */ | ||
| 74 | #define GCForeground 0x01 | ||
| 75 | #define GCBackground 0x02 | ||
| 76 | |||
| 62 | #endif /* HAVE_X_WINDOWS */ | 77 | #endif /* HAVE_X_WINDOWS */ |
| 63 | 78 | ||
| 64 | #ifdef MSDOS | 79 | #ifdef MSDOS |
| @@ -1363,7 +1378,7 @@ struct glyph_string | |||
| 1363 | GC gc; | 1378 | GC gc; |
| 1364 | #endif | 1379 | #endif |
| 1365 | #if defined (HAVE_NTGUI) | 1380 | #if defined (HAVE_NTGUI) |
| 1366 | XGCValues *gc; | 1381 | Emacs_GC *gc; |
| 1367 | HDC hdc; | 1382 | HDC hdc; |
| 1368 | #endif | 1383 | #endif |
| 1369 | 1384 | ||
| @@ -1605,8 +1620,11 @@ struct face | |||
| 1605 | 1620 | ||
| 1606 | /* If non-zero, this is a GC that we can use without modification for | 1621 | /* If non-zero, this is a GC that we can use without modification for |
| 1607 | drawing the characters in this face. */ | 1622 | drawing the characters in this face. */ |
| 1623 | # ifdef HAVE_X_WINDOWS | ||
| 1608 | GC gc; | 1624 | GC gc; |
| 1609 | 1625 | # else | |
| 1626 | Emacs_GC *gc; | ||
| 1627 | # endif | ||
| 1610 | /* Background stipple or bitmap used for this face. This is | 1628 | /* Background stipple or bitmap used for this face. This is |
| 1611 | an id as returned from load_pixmap. */ | 1629 | an id as returned from load_pixmap. */ |
| 1612 | ptrdiff_t stipple; | 1630 | ptrdiff_t stipple; |
diff --git a/src/nsgui.h b/src/nsgui.h index 592e21f60af..87c06e68a22 100644 --- a/src/nsgui.h +++ b/src/nsgui.h | |||
| @@ -76,25 +76,6 @@ typedef unichar XChar2b; | |||
| 76 | /* Used in xdisp.c when comparing faces and frame colors. */ | 76 | /* Used in xdisp.c when comparing faces and frame colors. */ |
| 77 | extern unsigned long ns_color_index_to_rgba(int idx, struct frame *f); | 77 | extern unsigned long ns_color_index_to_rgba(int idx, struct frame *f); |
| 78 | 78 | ||
| 79 | /* XXX: xfaces requires these structures, but the question is are we | ||
| 80 | forced to use them? */ | ||
| 81 | typedef struct _XGCValues | ||
| 82 | { | ||
| 83 | unsigned long foreground; | ||
| 84 | unsigned long background; | ||
| 85 | #ifdef __OBJC__ | ||
| 86 | struct ns_font *font; | ||
| 87 | #else | ||
| 88 | void *font; | ||
| 89 | #endif | ||
| 90 | } XGCValues; | ||
| 91 | |||
| 92 | typedef XGCValues * GC; | ||
| 93 | |||
| 94 | #define GCForeground 0x01 | ||
| 95 | #define GCBackground 0x02 | ||
| 96 | #define GCFont 0x03 | ||
| 97 | |||
| 98 | #ifdef __OBJC__ | 79 | #ifdef __OBJC__ |
| 99 | typedef id Emacs_Pixmap; | 80 | typedef id Emacs_Pixmap; |
| 100 | #else | 81 | #else |
diff --git a/src/w32fns.c b/src/w32fns.c index d74e968d379..bb74fcc1640 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -5559,22 +5559,19 @@ w32_icon (struct frame *f, Lisp_Object parms) | |||
| 5559 | static void | 5559 | static void |
| 5560 | w32_make_gc (struct frame *f) | 5560 | w32_make_gc (struct frame *f) |
| 5561 | { | 5561 | { |
| 5562 | XGCValues gc_values; | 5562 | Emacs_GC gc_values; |
| 5563 | 5563 | ||
| 5564 | block_input (); | 5564 | block_input (); |
| 5565 | 5565 | ||
| 5566 | /* Create the GC's of this frame. | 5566 | /* Create the GC's of this frame. |
| 5567 | Note that many default values are used. */ | 5567 | Note that many default values are used. */ |
| 5568 | 5568 | ||
| 5569 | /* Normal video */ | ||
| 5570 | gc_values.font = FRAME_FONT (f); | ||
| 5571 | |||
| 5572 | /* Cursor has cursor-color background, background-color foreground. */ | 5569 | /* Cursor has cursor-color background, background-color foreground. */ |
| 5573 | gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); | 5570 | gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); |
| 5574 | gc_values.background = f->output_data.w32->cursor_pixel; | 5571 | gc_values.background = f->output_data.w32->cursor_pixel; |
| 5575 | f->output_data.w32->cursor_gc | 5572 | f->output_data.w32->cursor_gc |
| 5576 | = XCreateGC (NULL, FRAME_W32_WINDOW (f), | 5573 | = XCreateGC (NULL, FRAME_W32_WINDOW (f), |
| 5577 | (GCFont | GCForeground | GCBackground), | 5574 | (GCForeground | GCBackground), |
| 5578 | &gc_values); | 5575 | &gc_values); |
| 5579 | 5576 | ||
| 5580 | /* Reliefs. */ | 5577 | /* Reliefs. */ |
diff --git a/src/w32gui.h b/src/w32gui.h index 69b6a556ff0..5e1730b92c7 100644 --- a/src/w32gui.h +++ b/src/w32gui.h | |||
| @@ -27,21 +27,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 27 | #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) | 27 | #define local_alloc(n) (HeapAlloc (local_heap, HEAP_ZERO_MEMORY, (n))) |
| 28 | #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p)))) | 28 | #define local_free(p) (HeapFree (local_heap, 0, ((LPVOID) (p)))) |
| 29 | 29 | ||
| 30 | /* Emulate X GC's by keeping color and font info in a structure. */ | ||
| 31 | typedef struct _XGCValues | ||
| 32 | { | ||
| 33 | COLORREF foreground; | ||
| 34 | COLORREF background; | ||
| 35 | struct font *font; | ||
| 36 | } XGCValues; | ||
| 37 | |||
| 38 | #define GCForeground 0x01 | ||
| 39 | #define GCBackground 0x02 | ||
| 40 | #define GCFont 0x03 | ||
| 41 | |||
| 42 | typedef HBITMAP Emacs_Pixmap; | 30 | typedef HBITMAP Emacs_Pixmap; |
| 43 | 31 | ||
| 44 | typedef XGCValues * GC; | ||
| 45 | typedef HWND Window; | 32 | typedef HWND Window; |
| 46 | typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */ | 33 | typedef HDC Display; /* HDC so it doesn't conflict with xpm lib. */ |
| 47 | typedef HCURSOR Emacs_Cursor; | 34 | typedef HCURSOR Emacs_Cursor; |
diff --git a/src/w32term.c b/src/w32term.c index 5c492b3fa99..4a93b2a4043 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -237,23 +237,21 @@ record_event (char *locus, int type) | |||
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | static void | 239 | static void |
| 240 | XChangeGC (void *ignore, XGCValues *gc, unsigned long mask, | 240 | XChangeGC (void *ignore, Emacs_GC *gc, unsigned long mask, |
| 241 | XGCValues *xgcv) | 241 | Emacs_GC *egc) |
| 242 | { | 242 | { |
| 243 | if (mask & GCForeground) | 243 | if (mask & GCForeground) |
| 244 | gc->foreground = xgcv->foreground; | 244 | gc->foreground = egc->foreground; |
| 245 | if (mask & GCBackground) | 245 | if (mask & GCBackground) |
| 246 | gc->background = xgcv->background; | 246 | gc->background = egc->background; |
| 247 | if (mask & GCFont) | ||
| 248 | gc->font = xgcv->font; | ||
| 249 | } | 247 | } |
| 250 | 248 | ||
| 251 | XGCValues * | 249 | Emacs_GC * |
| 252 | XCreateGC (void *ignore, HWND wignore, unsigned long mask, XGCValues *xgcv) | 250 | XCreateGC (void *ignore, HWND wignore, unsigned long mask, Emacs_GC *egc) |
| 253 | { | 251 | { |
| 254 | XGCValues *gc = xzalloc (sizeof (XGCValues)); | 252 | Emacs_GC *gc = xzalloc (sizeof (*gc)); |
| 255 | 253 | ||
| 256 | XChangeGC (ignore, gc, mask, xgcv); | 254 | XChangeGC (ignore, gc, mask, egc); |
| 257 | 255 | ||
| 258 | return gc; | 256 | return gc; |
| 259 | } | 257 | } |
| @@ -396,7 +394,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) | |||
| 396 | 394 | ||
| 397 | /* Draw a hollow rectangle at the specified position. */ | 395 | /* Draw a hollow rectangle at the specified position. */ |
| 398 | static void | 396 | static void |
| 399 | w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y, | 397 | w32_draw_rectangle (HDC hdc, Emacs_GC *gc, int x, int y, |
| 400 | int width, int height) | 398 | int width, int height) |
| 401 | { | 399 | { |
| 402 | HBRUSH hb, oldhb; | 400 | HBRUSH hb, oldhb; |
| @@ -906,38 +904,37 @@ w32_set_cursor_gc (struct glyph_string *s) | |||
| 906 | else | 904 | else |
| 907 | { | 905 | { |
| 908 | /* Cursor on non-default face: must merge. */ | 906 | /* Cursor on non-default face: must merge. */ |
| 909 | XGCValues xgcv; | 907 | Emacs_GC egc; |
| 910 | unsigned long mask; | 908 | unsigned long mask; |
| 911 | 909 | ||
| 912 | xgcv.background = s->f->output_data.w32->cursor_pixel; | 910 | egc.background = s->f->output_data.w32->cursor_pixel; |
| 913 | xgcv.foreground = s->face->background; | 911 | egc.foreground = s->face->background; |
| 914 | 912 | ||
| 915 | /* If the glyph would be invisible, try a different foreground. */ | 913 | /* If the glyph would be invisible, try a different foreground. */ |
| 916 | if (xgcv.foreground == xgcv.background) | 914 | if (egc.foreground == egc.background) |
| 917 | xgcv.foreground = s->face->foreground; | 915 | egc.foreground = s->face->foreground; |
| 918 | if (xgcv.foreground == xgcv.background) | 916 | if (egc.foreground == egc.background) |
| 919 | xgcv.foreground = s->f->output_data.w32->cursor_foreground_pixel; | 917 | egc.foreground = s->f->output_data.w32->cursor_foreground_pixel; |
| 920 | if (xgcv.foreground == xgcv.background) | 918 | if (egc.foreground == egc.background) |
| 921 | xgcv.foreground = s->face->foreground; | 919 | egc.foreground = s->face->foreground; |
| 922 | 920 | ||
| 923 | /* Make sure the cursor is distinct from text in this face. */ | 921 | /* Make sure the cursor is distinct from text in this face. */ |
| 924 | if (xgcv.background == s->face->background | 922 | if (egc.background == s->face->background |
| 925 | && xgcv.foreground == s->face->foreground) | 923 | && egc.foreground == s->face->foreground) |
| 926 | { | 924 | { |
| 927 | xgcv.background = s->face->foreground; | 925 | egc.background = s->face->foreground; |
| 928 | xgcv.foreground = s->face->background; | 926 | egc.foreground = s->face->background; |
| 929 | } | 927 | } |
| 930 | 928 | ||
| 931 | IF_DEBUG (w32_check_font (s->f, s->font)); | 929 | IF_DEBUG (w32_check_font (s->f, s->font)); |
| 932 | xgcv.font = s->font; | 930 | mask = GCForeground | GCBackground; |
| 933 | mask = GCForeground | GCBackground | GCFont; | ||
| 934 | 931 | ||
| 935 | if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc) | 932 | if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc) |
| 936 | XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc, | 933 | XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc, |
| 937 | mask, &xgcv); | 934 | mask, &egc); |
| 938 | else | 935 | else |
| 939 | FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc | 936 | FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc |
| 940 | = XCreateGC (NULL, FRAME_W32_WINDOW (s->f), mask, &xgcv); | 937 | = XCreateGC (NULL, FRAME_W32_WINDOW (s->f), mask, &egc); |
| 941 | 938 | ||
| 942 | s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc; | 939 | s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc; |
| 943 | } | 940 | } |
| @@ -972,21 +969,20 @@ w32_set_mouse_face_gc (struct glyph_string *s) | |||
| 972 | { | 969 | { |
| 973 | /* Otherwise construct scratch_cursor_gc with values from FACE | 970 | /* Otherwise construct scratch_cursor_gc with values from FACE |
| 974 | but font FONT. */ | 971 | but font FONT. */ |
| 975 | XGCValues xgcv; | 972 | Emacs_GC egc; |
| 976 | unsigned long mask; | 973 | unsigned long mask; |
| 977 | 974 | ||
| 978 | xgcv.background = s->face->background; | 975 | egc.background = s->face->background; |
| 979 | xgcv.foreground = s->face->foreground; | 976 | egc.foreground = s->face->foreground; |
| 980 | IF_DEBUG (w32_check_font (s->f, s->font)); | 977 | IF_DEBUG (w32_check_font (s->f, s->font)); |
| 981 | xgcv.font = s->font; | 978 | mask = GCForeground | GCBackground; |
| 982 | mask = GCForeground | GCBackground | GCFont; | ||
| 983 | 979 | ||
| 984 | if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc) | 980 | if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc) |
| 985 | XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc, | 981 | XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc, |
| 986 | mask, &xgcv); | 982 | mask, &egc); |
| 987 | else | 983 | else |
| 988 | FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc | 984 | FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc |
| 989 | = XCreateGC (NULL, FRAME_W32_WINDOW (s->f), mask, &xgcv); | 985 | = XCreateGC (NULL, FRAME_W32_WINDOW (s->f), mask, &egc); |
| 990 | 986 | ||
| 991 | s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc; | 987 | s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc; |
| 992 | } | 988 | } |
| @@ -1551,7 +1547,7 @@ static void | |||
| 1551 | w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, | 1547 | w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, |
| 1552 | int delta, COLORREF default_pixel) | 1548 | int delta, COLORREF default_pixel) |
| 1553 | { | 1549 | { |
| 1554 | XGCValues xgcv; | 1550 | Emacs_GC egc; |
| 1555 | struct w32_output *di = f->output_data.w32; | 1551 | struct w32_output *di = f->output_data.w32; |
| 1556 | unsigned long mask = GCForeground; | 1552 | unsigned long mask = GCForeground; |
| 1557 | COLORREF pixel; | 1553 | COLORREF pixel; |
| @@ -1563,22 +1559,21 @@ w32_setup_relief_color (struct frame *f, struct relief *relief, double factor, | |||
| 1563 | /* TODO: Free colors (if using palette)? */ | 1559 | /* TODO: Free colors (if using palette)? */ |
| 1564 | 1560 | ||
| 1565 | /* Allocate new color. */ | 1561 | /* Allocate new color. */ |
| 1566 | xgcv.foreground = default_pixel; | 1562 | egc.foreground = default_pixel; |
| 1567 | pixel = background; | 1563 | pixel = background; |
| 1568 | if (w32_alloc_lighter_color (f, &pixel, factor, delta)) | 1564 | if (w32_alloc_lighter_color (f, &pixel, factor, delta)) |
| 1569 | xgcv.foreground = relief->pixel = pixel; | 1565 | egc.foreground = relief->pixel = pixel; |
| 1570 | 1566 | ||
| 1571 | xgcv.font = NULL; /* avoid compiler warnings */ | ||
| 1572 | if (relief->gc == 0) | 1567 | if (relief->gc == 0) |
| 1573 | { | 1568 | { |
| 1574 | #if 0 /* TODO: stipple */ | 1569 | #if 0 /* TODO: stipple */ |
| 1575 | xgcv.stipple = dpyinfo->gray; | 1570 | egc.stipple = dpyinfo->gray; |
| 1576 | mask |= GCStipple; | 1571 | mask |= GCStipple; |
| 1577 | #endif | 1572 | #endif |
| 1578 | relief->gc = XCreateGC (NULL, FRAME_W32_WINDOW (f), mask, &xgcv); | 1573 | relief->gc = XCreateGC (NULL, FRAME_W32_WINDOW (f), mask, &egc); |
| 1579 | } | 1574 | } |
| 1580 | else | 1575 | else |
| 1581 | XChangeGC (NULL, relief->gc, mask, &xgcv); | 1576 | XChangeGC (NULL, relief->gc, mask, &egc); |
| 1582 | } | 1577 | } |
| 1583 | 1578 | ||
| 1584 | 1579 | ||
| @@ -1627,7 +1622,7 @@ w32_draw_relief_rect (struct frame *f, | |||
| 1627 | RECT *clip_rect) | 1622 | RECT *clip_rect) |
| 1628 | { | 1623 | { |
| 1629 | int i; | 1624 | int i; |
| 1630 | XGCValues gc; | 1625 | Emacs_GC gc; |
| 1631 | HDC hdc = get_frame_dc (f); | 1626 | HDC hdc = get_frame_dc (f); |
| 1632 | 1627 | ||
| 1633 | if (raised_p) | 1628 | if (raised_p) |
| @@ -2286,7 +2281,7 @@ w32_draw_stretch_glyph_string (struct glyph_string *s) | |||
| 2286 | /* Clear rest using the GC of the original non-cursor face. */ | 2281 | /* Clear rest using the GC of the original non-cursor face. */ |
| 2287 | if (width < background_width) | 2282 | if (width < background_width) |
| 2288 | { | 2283 | { |
| 2289 | XGCValues *gc = s->face->gc; | 2284 | Emacs_GC *gc = s->face->gc; |
| 2290 | int y = s->y; | 2285 | int y = s->y; |
| 2291 | int w = background_width - width, h = s->height; | 2286 | int w = background_width - width, h = s->height; |
| 2292 | RECT r; | 2287 | RECT r; |
diff --git a/src/w32term.h b/src/w32term.h index f1373beb81c..729e8d0fd49 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -142,7 +142,7 @@ struct w32_display_info | |||
| 142 | int smallest_font_height; | 142 | int smallest_font_height; |
| 143 | 143 | ||
| 144 | /* Reusable Graphics Context for drawing a cursor in a non-default face. */ | 144 | /* Reusable Graphics Context for drawing a cursor in a non-default face. */ |
| 145 | XGCValues *scratch_cursor_gc; | 145 | Emacs_GC *scratch_cursor_gc; |
| 146 | 146 | ||
| 147 | /* Information about the range of text currently shown in | 147 | /* Information about the range of text currently shown in |
| 148 | mouse-face. */ | 148 | mouse-face. */ |
| @@ -308,7 +308,7 @@ struct w32_output | |||
| 308 | HPALETTE old_palette; | 308 | HPALETTE old_palette; |
| 309 | 309 | ||
| 310 | /* Here are the Graphics Contexts for the default font. */ | 310 | /* Here are the Graphics Contexts for the default font. */ |
| 311 | XGCValues *cursor_gc; /* cursor drawing */ | 311 | Emacs_GC *cursor_gc; /* cursor drawing */ |
| 312 | 312 | ||
| 313 | /* The window used for this frame. | 313 | /* The window used for this frame. |
| 314 | May be zero while the frame object is being created | 314 | May be zero while the frame object is being created |
| @@ -388,7 +388,7 @@ struct w32_output | |||
| 388 | /* Relief GCs, colors etc. */ | 388 | /* Relief GCs, colors etc. */ |
| 389 | struct relief | 389 | struct relief |
| 390 | { | 390 | { |
| 391 | XGCValues *gc; | 391 | Emacs_GC *gc; |
| 392 | unsigned long pixel; | 392 | unsigned long pixel; |
| 393 | } | 393 | } |
| 394 | black_relief, white_relief; | 394 | black_relief, white_relief; |
| @@ -805,7 +805,7 @@ typedef struct tagTRACKMOUSEEVENT | |||
| 805 | struct image; | 805 | struct image; |
| 806 | struct face; | 806 | struct face; |
| 807 | 807 | ||
| 808 | XGCValues *XCreateGC (void *, HWND, unsigned long, XGCValues *); | 808 | Emacs_GC *XCreateGC (void *, HWND, unsigned long, Emacs_GC *); |
| 809 | 809 | ||
| 810 | typedef DWORD (WINAPI * ClipboardSequence_Proc) (void); | 810 | typedef DWORD (WINAPI * ClipboardSequence_Proc) (void); |
| 811 | typedef BOOL (WINAPI * AppendMenuW_Proc) ( | 811 | typedef BOOL (WINAPI * AppendMenuW_Proc) ( |
diff --git a/src/xfaces.c b/src/xfaces.c index a8fdca70c9e..d211ec8c460 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -513,12 +513,12 @@ x_free_gc (struct frame *f, GC gc) | |||
| 513 | #ifdef HAVE_NTGUI | 513 | #ifdef HAVE_NTGUI |
| 514 | /* W32 emulation of GCs */ | 514 | /* W32 emulation of GCs */ |
| 515 | 515 | ||
| 516 | static GC | 516 | static Emacs_GC * |
| 517 | x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv) | 517 | x_create_gc (struct frame *f, unsigned long mask, Emacs_GC *egc) |
| 518 | { | 518 | { |
| 519 | GC gc; | 519 | Emacs_GC *gc; |
| 520 | block_input (); | 520 | block_input (); |
| 521 | gc = XCreateGC (NULL, FRAME_W32_WINDOW (f), mask, xgcv); | 521 | gc = XCreateGC (NULL, FRAME_W32_WINDOW (f), mask, egc); |
| 522 | unblock_input (); | 522 | unblock_input (); |
| 523 | IF_DEBUG (++ngcs); | 523 | IF_DEBUG (++ngcs); |
| 524 | return gc; | 524 | return gc; |
| @@ -528,7 +528,7 @@ x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv) | |||
| 528 | /* Free GC which was used on frame F. */ | 528 | /* Free GC which was used on frame F. */ |
| 529 | 529 | ||
| 530 | static void | 530 | static void |
| 531 | x_free_gc (struct frame *f, GC gc) | 531 | x_free_gc (struct frame *f, Emacs_GC *gc) |
| 532 | { | 532 | { |
| 533 | IF_DEBUG ((--ngcs, eassert (ngcs >= 0))); | 533 | IF_DEBUG ((--ngcs, eassert (ngcs >= 0))); |
| 534 | xfree (gc); | 534 | xfree (gc); |
| @@ -539,18 +539,18 @@ x_free_gc (struct frame *f, GC gc) | |||
| 539 | #ifdef HAVE_NS | 539 | #ifdef HAVE_NS |
| 540 | /* NS emulation of GCs */ | 540 | /* NS emulation of GCs */ |
| 541 | 541 | ||
| 542 | static GC | 542 | static Emacs_GC * |
| 543 | x_create_gc (struct frame *f, | 543 | x_create_gc (struct frame *f, |
| 544 | unsigned long mask, | 544 | unsigned long mask, |
| 545 | XGCValues *xgcv) | 545 | Emacs_GC *egc) |
| 546 | { | 546 | { |
| 547 | GC gc = xmalloc (sizeof *gc); | 547 | Emacs_GC *gc = xmalloc (sizeof *gc); |
| 548 | *gc = *xgcv; | 548 | *gc = *egc; |
| 549 | return gc; | 549 | return gc; |
| 550 | } | 550 | } |
| 551 | 551 | ||
| 552 | static void | 552 | static void |
| 553 | x_free_gc (struct frame *f, GC gc) | 553 | x_free_gc (struct frame *f, Emacs_GC *gc) |
| 554 | { | 554 | { |
| 555 | xfree (gc); | 555 | xfree (gc); |
| 556 | } | 556 | } |
| @@ -4140,25 +4140,25 @@ prepare_face_for_display (struct frame *f, struct face *face) | |||
| 4140 | 4140 | ||
| 4141 | if (face->gc == 0) | 4141 | if (face->gc == 0) |
| 4142 | { | 4142 | { |
| 4143 | XGCValues xgcv; | 4143 | Emacs_GC egc; |
| 4144 | unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures; | 4144 | unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures; |
| 4145 | 4145 | ||
| 4146 | xgcv.foreground = face->foreground; | 4146 | egc.foreground = face->foreground; |
| 4147 | xgcv.background = face->background; | 4147 | egc.background = face->background; |
| 4148 | #ifdef HAVE_X_WINDOWS | 4148 | #ifdef HAVE_X_WINDOWS |
| 4149 | xgcv.graphics_exposures = False; | 4149 | egc.graphics_exposures = False; |
| 4150 | #endif | 4150 | #endif |
| 4151 | 4151 | ||
| 4152 | block_input (); | 4152 | block_input (); |
| 4153 | #ifdef HAVE_X_WINDOWS | 4153 | #ifdef HAVE_X_WINDOWS |
| 4154 | if (face->stipple) | 4154 | if (face->stipple) |
| 4155 | { | 4155 | { |
| 4156 | xgcv.fill_style = FillOpaqueStippled; | 4156 | egc.fill_style = FillOpaqueStippled; |
| 4157 | xgcv.stipple = image_bitmap_pixmap (f, face->stipple); | 4157 | egc.stipple = image_bitmap_pixmap (f, face->stipple); |
| 4158 | mask |= GCFillStyle | GCStipple; | 4158 | mask |= GCFillStyle | GCStipple; |
| 4159 | } | 4159 | } |
| 4160 | #endif | 4160 | #endif |
| 4161 | face->gc = x_create_gc (f, mask, &xgcv); | 4161 | face->gc = x_create_gc (f, mask, &egc); |
| 4162 | if (face->font) | 4162 | if (face->font) |
| 4163 | font_prepare_for_face (f, face); | 4163 | font_prepare_for_face (f, face); |
| 4164 | unblock_input (); | 4164 | unblock_input (); |