aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorAlexander Gramiak2019-05-09 09:37:50 -0600
committerAlexander Gramiak2019-05-10 17:26:12 -0600
commit616ce44ac53f08bf447cbc032f4bb10cd65c0b70 (patch)
tree99e0fca55271fabf5e81819f95c19e484a5fa90b /src/image.c
parent6bfc5fc6c4dfbed4b07528b64414fb04675cdf79 (diff)
downloademacs-616ce44ac53f08bf447cbc032f4bb10cd65c0b70.tar.gz
emacs-616ce44ac53f08bf447cbc032f4bb10cd65c0b70.zip
Convert Free_Pixmap macro into terminal hook
* src/termhooks.h (terminal) [HAVE_WINDOW_SYSTEM]: New terminal hook free_pixmap. * src/image.c: Replace Free_Pixmap with free_pixmap. * src/msdos.h (FRAME_X_DISPLAY): * src/nsgui.h (Display): * src/nsterm.h (FRAME_NS_DISPLAY, FRAME_X_DISPLAY, FRAME_X_SCREEN) (FRAME_X_VISUAL): * src/w32term.h (FRAME_X_DISPLAY): Remove unused X-compatibility macros and typedefs. * src/nsterm.m: * src/w32term.c: * src/xterm.c: Implement and set free_pixmap hook.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/image.c b/src/image.c
index e8cb4341773..0779594989a 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1221,26 +1221,6 @@ four_corners_best (XImagePtr_or_DC ximg, int *corners,
1221 return best; 1221 return best;
1222} 1222}
1223 1223
1224/* Portability macros */
1225
1226#ifdef HAVE_NTGUI
1227
1228#define Free_Pixmap(display, pixmap) \
1229 DeleteObject (pixmap)
1230
1231#elif defined (HAVE_NS)
1232
1233#define Free_Pixmap(display, pixmap) \
1234 ns_release_object (pixmap)
1235
1236#else
1237
1238#define Free_Pixmap(display, pixmap) \
1239 XFreePixmap (display, pixmap)
1240
1241#endif /* !HAVE_NTGUI && !HAVE_NS */
1242
1243
1244/* Return the `background' field of IMG. If IMG doesn't have one yet, 1224/* Return the `background' field of IMG. If IMG doesn't have one yet,
1245 it is guessed heuristically. If non-zero, XIMG is an existing 1225 it is guessed heuristically. If non-zero, XIMG is an existing
1246 XImage object (or device context with the image selected on W32) to 1226 XImage object (or device context with the image selected on W32) to
@@ -1328,7 +1308,7 @@ image_clear_image_1 (struct frame *f, struct image *img, int flags)
1328 { 1308 {
1329 if (img->pixmap) 1309 if (img->pixmap)
1330 { 1310 {
1331 Free_Pixmap (FRAME_X_DISPLAY (f), img->pixmap); 1311 FRAME_TERMINAL (f)->free_pixmap (f, img->pixmap);
1332 img->pixmap = NO_PIXMAP; 1312 img->pixmap = NO_PIXMAP;
1333 /* NOTE (HAVE_NS): background color is NOT an indexed color! */ 1313 /* NOTE (HAVE_NS): background color is NOT an indexed color! */
1334 img->background_valid = 0; 1314 img->background_valid = 0;
@@ -1347,7 +1327,7 @@ image_clear_image_1 (struct frame *f, struct image *img, int flags)
1347 { 1327 {
1348 if (img->mask) 1328 if (img->mask)
1349 { 1329 {
1350 Free_Pixmap (FRAME_X_DISPLAY (f), img->mask); 1330 FRAME_TERMINAL (f)->free_pixmap (f, img->mask);
1351 img->mask = NO_PIXMAP; 1331 img->mask = NO_PIXMAP;
1352 img->background_transparent_valid = 0; 1332 img->background_transparent_valid = 0;
1353 } 1333 }