changeset 53330:2dfa97148836

(Qimage): Remove extern (now in lisp.h). (QCmap): Declare extern. (make_lispy_position): When position is inside image hot-spot, use hot-spot element as posn element.
author Kim F. Storm <storm@cua.dk>
date Sun, 28 Dec 2003 00:10:41 +0000
parents 9c540a878edf
children db670c1b5944
files src/keyboard.c
diffstat 1 files changed, 27 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sun Dec 28 00:10:12 2003 +0000
+++ b/src/keyboard.c	Sun Dec 28 00:10:41 2003 +0000
@@ -587,7 +587,7 @@
 Lisp_Object Qmenu_bar;
 extern Lisp_Object Qleft_margin, Qright_margin;
 extern Lisp_Object Qleft_fringe, Qright_fringe;
-extern Lisp_Object Qimage;
+extern Lisp_Object QCmap;
 
 Lisp_Object recursive_edit_unwind (), command_loop ();
 Lisp_Object Fthis_command_keys ();
@@ -5024,6 +5024,19 @@
 	  string = marginal_area_string (w, &rx, &ry, &dx, &dy, part, &charpos);
 	  if (STRINGP (string))
 	    object = Fcons (string, make_number (charpos));
+#ifdef HAVE_WINDOW_SYSTEM
+	  else if (IMAGEP (string))
+	    {
+	      Lisp_Object image_map, hotspot;
+	      object = string;
+	      if ((image_map = Fplist_get (XCDR (object), QCmap),
+		   !NILP (image_map))
+		  && (hotspot = find_hot_spot (image_map, dx, dy),
+		      CONSP (hotspot))
+		  && (hotspot = XCDR (hotspot), CONSP (hotspot)))
+		posn = XCAR (hotspot);
+	    }
+#endif
 	}
       else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE)
 	{
@@ -5059,8 +5072,19 @@
 	      if (STRINGP (string))
 		object = Fcons (string,
 				make_number (CHARPOS (p.string_pos)));
-	      else if (CONSP (string) && EQ (XCAR (string), Qimage))
-		object = string;
+#ifdef HAVE_WINDOW_SYSTEM
+	      else if (IMAGEP (string))
+		{
+		  Lisp_Object image_map, hotspot;
+		  object = string;
+		  if ((image_map = Fplist_get (XCDR (object), QCmap),
+		       !NILP (image_map))
+		      && (hotspot = find_hot_spot (image_map, dx, dy),
+			  CONSP (hotspot))
+		      && (hotspot = XCDR (hotspot), CONSP (hotspot)))
+		    posn = XCAR (hotspot);
+		}
+#endif
 	    }
 	}