summaryrefslogtreecommitdiff
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorAlexander Gramiak <agrambot@gmail.com>2019-05-09 22:08:06 -0600
committerAlexander Gramiak <agrambot@gmail.com>2019-05-19 19:50:32 -0600
commitb3d3c0daa49f5cbed7c58c7508d4d36dba3757e5 (patch)
tree72360d5d9cdd8bc9f6ad715128d5452889d0caa3 /src/dispextern.h
parent462b1fd7185ab8866c8db15b6e7a9b865e4d2389 (diff)
downloademacs-b3d3c0daa49f5cbed7c58c7508d4d36dba3757e5.tar.gz
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.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h22
1 files changed, 20 insertions, 2 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;
#define No_Cursor (None)
typedef Pixmap Emacs_Pixmap;
typedef XRectangle Emacs_Rectangle;
+typedef XGCValues Emacs_GC;
#else /* !HAVE_X_WINDOWS */
/* XColor-like struct used by non-X code. */
@@ -59,6 +60,20 @@ typedef struct
int x, y;
unsigned width, height;
} Emacs_Rectangle;
+
+/* XGCValues-like struct used by non-X GUI code. */
+typedef struct
+{
+ unsigned long foreground;
+ unsigned long background;
+} Emacs_GC;
+
+/* Mask values to select foreground/background. */
+/* FIXME: The GC handling in w32 really should be redesigned as to not
+ need these. */
+#define GCForeground 0x01
+#define GCBackground 0x02
+
#endif /* HAVE_X_WINDOWS */
#ifdef MSDOS
@@ -1363,7 +1378,7 @@ struct glyph_string
GC gc;
#endif
#if defined (HAVE_NTGUI)
- XGCValues *gc;
+ Emacs_GC *gc;
HDC hdc;
#endif
@@ -1605,8 +1620,11 @@ struct face
/* If non-zero, this is a GC that we can use without modification for
drawing the characters in this face. */
+# ifdef HAVE_X_WINDOWS
GC gc;
-
+# else
+ Emacs_GC *gc;
+# endif
/* Background stipple or bitmap used for this face. This is
an id as returned from load_pixmap. */
ptrdiff_t stipple;