aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2001-10-24 17:16:52 +0000
committerMiles Bader2001-10-24 17:16:52 +0000
commit0ff7c0d413d922c3ae7db173ac1a658bde2a4252 (patch)
tree5813a3fa44e378ece317235db70ea95ad7e28505 /src
parentc533fe40ec6edba64d577cce1372646829e305ce (diff)
downloademacs-0ff7c0d413d922c3ae7db173ac1a658bde2a4252.tar.gz
emacs-0ff7c0d413d922c3ae7db173ac1a658bde2a4252.zip
(struct image): Add `background', `background_valid', and
`background_transparent' fields. (image_background, image_background_transparent): New declarations. (IMAGE_BACKGROUND, IMAGE_BACKGROUND_TRANSPARENT): New macros.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index f737b54109e..db3b8efecb4 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1985,6 +1985,22 @@ struct image
1985 unsigned long *colors; 1985 unsigned long *colors;
1986 int ncolors; 1986 int ncolors;
1987 1987
1988 /* A single `background color' for this image, for the use of anyone that
1989 cares about such a thing. Only valid if the `background_valid' field
1990 is true. This should generally be accessed by calling the accessor
1991 macro `IMAGE_BACKGROUND', which will heuristically calculate a value
1992 if necessary. */
1993 unsigned long background;
1994
1995 /* True if this image has a `transparent' background -- that is, is
1996 uses an image mask. The accessor macro for this is
1997 `IMAGE_BACKGROUND_TRANSPARENT'. */
1998 unsigned background_transparent : 1;
1999
2000 /* True if the `background' and `background_transparent' fields are
2001 valid, respectively. */
2002 unsigned background_valid : 1, background_transparent_valid : 1;
2003
1988 /* Width and height of the image. */ 2004 /* Width and height of the image. */
1989 int width, height; 2005 int width, height;
1990 2006
@@ -2268,6 +2284,10 @@ void forall_images_in_image_cache P_ ((struct frame *,
2268int valid_image_p P_ ((Lisp_Object)); 2284int valid_image_p P_ ((Lisp_Object));
2269void prepare_image_for_display P_ ((struct frame *, struct image *)); 2285void prepare_image_for_display P_ ((struct frame *, struct image *));
2270int lookup_image P_ ((struct frame *, Lisp_Object)); 2286int lookup_image P_ ((struct frame *, Lisp_Object));
2287unsigned long image_background P_ ((struct image *, struct frame *,
2288 XImage *ximg));
2289int image_background_transparent P_ ((struct image *, struct frame *,
2290 XImage *mask));
2271extern Lisp_Object tip_frame; 2291extern Lisp_Object tip_frame;
2272extern Window tip_window; 2292extern Window tip_window;
2273EXFUN (Fx_show_tip, 6); 2293EXFUN (Fx_show_tip, 6);
@@ -2276,6 +2296,24 @@ extern void start_hourglass P_ ((void));
2276extern void cancel_hourglass P_ ((void)); 2296extern void cancel_hourglass P_ ((void));
2277extern int display_hourglass_p; 2297extern int display_hourglass_p;
2278 2298
2299/* Returns the background color of IMG, calculating one heuristically if
2300 necessary. If non-zero, XIMG is an existing XImage object to use for
2301 the heuristic. */
2302
2303#define IMAGE_BACKGROUND(img, f, ximg) \
2304 ((img)->background_valid \
2305 ? (img)->background \
2306 : image_background (img, f, ximg))
2307
2308/* Returns true if IMG has a `transparent' background, using heuristics
2309 to decide if necessary. If non-zero, MASK is an existing XImage
2310 object to use for the heuristic. */
2311
2312#define IMAGE_BACKGROUND_TRANSPARENT(img, f, mask) \
2313 ((img)->background_transparent_valid \
2314 ? (img)->background_transparent \
2315 : image_background_transparent (img, f, mask))
2316
2279#endif /* HAVE_WINDOW_SYSTEM */ 2317#endif /* HAVE_WINDOW_SYSTEM */
2280 2318
2281 2319