aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorPo Lu2022-05-20 02:27:06 +0000
committerPo Lu2022-05-20 02:28:29 +0000
commit8a7d8bb04b38ba9849b60d63c9fcfd36856eb424 (patch)
treeb105fcf9b03deeae53d07fcbd14ec9d0609bd6ca /src/image.c
parent9d557d4d4adf68ca15ca9aaa48470133544ede26 (diff)
downloademacs-8a7d8bb04b38ba9849b60d63c9fcfd36856eb424.tar.gz
emacs-8a7d8bb04b38ba9849b60d63c9fcfd36856eb424.zip
Implement `cross-disabled-images' on Haiku
* src/haiku_draw_support.cc (be_draw_cross_on_pixmap_1) (be_draw_cross_on_pixmap): New functions. * src/haiku_support.h: Update prototypes. * src/image.c (image_pixmap_draw_cross, image_disable_image): Implement drawing cross on Haiku.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/image.c b/src/image.c
index 18e9e72d83c..058c1755704 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6307,7 +6307,7 @@ image_edge_detection (struct frame *f, struct image *img,
6307} 6307}
6308 6308
6309 6309
6310#if defined HAVE_X_WINDOWS || defined USE_CAIRO 6310#if defined HAVE_X_WINDOWS || defined USE_CAIRO || defined HAVE_HAIKU
6311static void 6311static void
6312image_pixmap_draw_cross (struct frame *f, Emacs_Pixmap pixmap, 6312image_pixmap_draw_cross (struct frame *f, Emacs_Pixmap pixmap,
6313 int x, int y, unsigned int width, unsigned int height, 6313 int x, int y, unsigned int width, unsigned int height,
@@ -6341,9 +6341,11 @@ image_pixmap_draw_cross (struct frame *f, Emacs_Pixmap pixmap,
6341 XDrawLine (dpy, pixmap, gc, x, y, x + width - 1, y + height - 1); 6341 XDrawLine (dpy, pixmap, gc, x, y, x + width - 1, y + height - 1);
6342 XDrawLine (dpy, pixmap, gc, x, y + height - 1, x + width - 1, y); 6342 XDrawLine (dpy, pixmap, gc, x, y + height - 1, x + width - 1, y);
6343 XFreeGC (dpy, gc); 6343 XFreeGC (dpy, gc);
6344#endif /* HAVE_X_WINDOWS */ 6344#elif HAVE_HAIKU
6345 be_draw_cross_on_pixmap (pixmap, x, y, width, height, color);
6346#endif
6345} 6347}
6346#endif /* HAVE_X_WINDOWS || USE_CAIRO */ 6348#endif /* HAVE_X_WINDOWS || USE_CAIRO || HAVE_HAIKU */
6347 6349
6348/* Transform image IMG on frame F so that it looks disabled. */ 6350/* Transform image IMG on frame F so that it looks disabled. */
6349 6351
@@ -6385,25 +6387,23 @@ image_disable_image (struct frame *f, struct image *img)
6385 { 6387 {
6386#ifndef HAVE_NTGUI 6388#ifndef HAVE_NTGUI
6387#ifndef HAVE_NS /* TODO: NS support, however this not needed for toolbars */ 6389#ifndef HAVE_NS /* TODO: NS support, however this not needed for toolbars */
6388#ifndef HAVE_HAIKU
6389 6390
6390#ifndef USE_CAIRO 6391#if !defined USE_CAIRO && !defined HAVE_HAIKU
6391#define CrossForeground(f) BLACK_PIX_DEFAULT (f) 6392#define CrossForeground(f) BLACK_PIX_DEFAULT (f)
6392#define MaskForeground(f) WHITE_PIX_DEFAULT (f) 6393#define MaskForeground(f) WHITE_PIX_DEFAULT (f)
6393#else /* USE_CAIRO */ 6394#else /* USE_CAIRO || HAVE_HAIKU */
6394#define CrossForeground(f) 0 6395#define CrossForeground(f) 0
6395#define MaskForeground(f) PIX_MASK_DRAW 6396#define MaskForeground(f) PIX_MASK_DRAW
6396#endif /* USE_CAIRO */ 6397#endif /* USE_CAIRO || HAVE_HAIKU */
6397 6398
6398#ifndef USE_CAIRO 6399#if !defined USE_CAIRO && !defined HAVE_HAIKU
6399 image_sync_to_pixmaps (f, img); 6400 image_sync_to_pixmaps (f, img);
6400#endif /* !USE_CAIRO */ 6401#endif /* !USE_CAIRO && !HAVE_HAIKU */
6401 image_pixmap_draw_cross (f, img->pixmap, 0, 0, img->width, img->height, 6402 image_pixmap_draw_cross (f, img->pixmap, 0, 0, img->width, img->height,
6402 CrossForeground (f)); 6403 CrossForeground (f));
6403 if (img->mask) 6404 if (img->mask)
6404 image_pixmap_draw_cross (f, img->mask, 0, 0, img->width, img->height, 6405 image_pixmap_draw_cross (f, img->mask, 0, 0, img->width, img->height,
6405 MaskForeground (f)); 6406 MaskForeground (f));
6406#endif /* !HAVE_HAIKU */
6407#endif /* !HAVE_NS */ 6407#endif /* !HAVE_NS */
6408#else 6408#else
6409 HDC hdc, bmpdc; 6409 HDC hdc, bmpdc;