changeset 5074:8af6a32b170d

Modify XLIKE_get_gc's prototype src/ChangeLog addition: 2010-02-24 Didier Verna <didier@xemacs.org> Modify XLIKE_get_gc's prototype. * redisplay-xlike-inc.c (XLIKE_get_gc): Take a frame instead of a device as first argument. * redisplay-xlike-inc.c (XLIKE_output_string): Update caller. * redisplay-xlike-inc.c (XLIKE_output_pixmap): Ditto. * redisplay-xlike-inc.c (XLIKE_output_blank): Ditto. * redisplay-xlike-inc.c (XLIKE_output_horizontal_line): Ditto. * redisplay-xlike-inc.c (XLIKE_clear_region): Ditto. * redisplay-xlike-inc.c (XLIKE_output_eol_cursor): Ditto. * console-gtk.h (gtk_get_gc): Take a frame instead of a device as first argument. * gtk-glue.c (face_to_gc): Update caller.
author Didier Verna <didier@lrde.epita.fr>
date Wed, 24 Feb 2010 15:45:20 +0100
parents 78a3c171a427
children 868a9ffcc37b
files src/ChangeLog src/console-gtk.h src/gtk-glue.c src/redisplay-output.c src/redisplay-xlike-inc.c
diffstat 5 files changed, 46 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Feb 24 11:08:30 2010 +0100
+++ b/src/ChangeLog	Wed Feb 24 15:45:20 2010 +0100
@@ -1,3 +1,18 @@
+2010-02-24  Didier Verna  <didier@xemacs.org>
+
+	Modify XLIKE_get_gc's prototype.
+	* redisplay-xlike-inc.c (XLIKE_get_gc): Take a frame instead of a
+	device as first argument.
+	* redisplay-xlike-inc.c (XLIKE_output_string): Update caller.
+	* redisplay-xlike-inc.c (XLIKE_output_pixmap): Ditto.
+	* redisplay-xlike-inc.c (XLIKE_output_blank): Ditto.
+	* redisplay-xlike-inc.c (XLIKE_output_horizontal_line): Ditto.
+	* redisplay-xlike-inc.c (XLIKE_clear_region): Ditto.
+	* redisplay-xlike-inc.c (XLIKE_output_eol_cursor): Ditto.
+	* console-gtk.h (gtk_get_gc):  Take a frame instead of a device as
+	first argument.
+	* gtk-glue.c (face_to_gc): Update caller.
+
 2010-02-24  Didier Verna  <didier@xemacs.org>
 
 	* glyphs.c: Clarify comment about potential_pixmap_file_instantiator.
--- a/src/console-gtk.h	Wed Feb 24 11:08:30 2010 +0100
+++ b/src/console-gtk.h	Wed Feb 24 15:45:20 2010 +0100
@@ -64,7 +64,8 @@
 		      int start_pixpos, int width, face_index findex,
 		      int cursor, int cursor_start, int cursor_width,
 		      int cursor_height);
-GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
+GdkGC *gtk_get_gc (struct frame *f,
+		   Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
 		   Lisp_Object bg_pmap, Lisp_Object lwidth);
 
 int gtk_initialize_frame_menubar (struct frame *f);
--- a/src/gtk-glue.c	Wed Feb 24 11:08:30 2010 +0100
+++ b/src/gtk-glue.c	Wed Feb 24 15:45:20 2010 +0100
@@ -208,17 +208,18 @@
 static GdkGC *
 face_to_gc (Lisp_Object face)
 {
-  Lisp_Object device = Fselected_device (Qnil);
+  Lisp_Object frame = Fselected_frame (Qnil);
 
-  return (gtk_get_gc (XDEVICE (device),
+  return (gtk_get_gc (XFRAME (frame),
 		      Fspecifier_instance (Fget (face, Qfont, Qnil),
-					   device, Qnil, Qnil),
+					   frame, Qnil, Qnil),
 		      Fspecifier_instance (Fget (face, Qforeground, Qnil),
-					   device, Qnil, Qnil),
+					   frame, Qnil, Qnil),
 		      Fspecifier_instance (Fget (face, Qbackground, Qnil),
-					   device, Qnil, Qnil),
+					   frame, Qnil, Qnil),
 		      Fspecifier_instance (Fget (face, Qbackground_pixmap,
-						 Qnil), device, Qnil, Qnil),
+						 Qnil),
+					   frame, Qnil, Qnil),
 		      Qnil));
 }
 
--- a/src/redisplay-output.c	Wed Feb 24 11:08:30 2010 +0100
+++ b/src/redisplay-output.c	Wed Feb 24 15:45:20 2010 +0100
@@ -1804,8 +1804,8 @@
   if (UNBOUNDP (background_pixmap))
     background_pixmap = Qnil;
 
-  DEVMETH (d, clear_region,
-	   (locale, d, f, findex, x, y, width, height, fcolor, bcolor, background_pixmap));
+  DEVMETH (d, clear_region, (locale, d, f, findex, x, y, width, height,
+			     fcolor, bcolor, background_pixmap));
 }
 
 /****************************************************************************
--- a/src/redisplay-xlike-inc.c	Wed Feb 24 11:08:30 2010 +0100
+++ b/src/redisplay-xlike-inc.c	Wed Feb 24 15:45:20 2010 +0100
@@ -812,7 +812,7 @@
 
 /* Called as gtk_get_gc from gtk-glue.c */
 
-XLIKE_GC XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
+XLIKE_GC XLIKE_get_gc (struct frame *f, Lisp_Object font, Lisp_Object fg, 
 		       Lisp_Object bg, Lisp_Object bg_pmap,
 		       Lisp_Object lwidth);
 
@@ -822,9 +822,10 @@
  Given a number of parameters return a GC with those properties.
  ****************************************************************************/
 XLIKE_GC
-XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
+XLIKE_get_gc (struct frame *f, Lisp_Object font, Lisp_Object fg, 
 	      Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth)
 {
+  struct device *d = XDEVICE (f->device);
   XLIKE_GCVALUES gcv;
   unsigned long mask;
 
@@ -1076,7 +1077,7 @@
        && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
     bgc = 0;
   else
-    bgc = XLIKE_get_gc (d, Qnil, cachel->foreground, cachel->background,
+    bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
 			bg_pmap, Qnil);
 
   if (bgc)
@@ -1157,7 +1158,7 @@
 	  fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
 	  bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
 #endif
-	  gc = XLIKE_get_gc (d, font, cursor_cachel->foreground,
+	  gc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
 			     cursor_cachel->background, Qnil, Qnil);
 	}
       else if (cachel->dim)
@@ -1179,7 +1180,7 @@
 	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1);
 	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
 #endif
-	  gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background,
+	  gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
 			     Qdim, Qnil);
 	}
       else
@@ -1188,7 +1189,7 @@
 	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0);
 	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
 #endif
-	  gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background,
+	  gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
 			     Qnil, Qnil);
 	}
 #ifdef USE_XFT
@@ -1462,7 +1463,7 @@
 	    {
 	      XLIKE_RECTANGLE clip_box;
 	      XLIKE_GC cgc;
-	      cgc = XLIKE_get_gc (d, font, cursor_cachel->foreground,
+	      cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
 				  cursor_cachel->background, Qnil, Qnil);
 
 	      clip_box.x = 0;
@@ -1534,12 +1535,12 @@
 
       if (!NILP (bar_cursor_value))
 	{
-	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
+	  gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil,
 			     make_int (bar_width));
 	}
       else
 	{
-	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background,
+	  gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
 			     Qnil, Qnil, Qnil);
 	}
 
@@ -1728,7 +1729,7 @@
 			    get_builtin_face_cache_index
 			    (w, Vtext_cursor_face));
 
-      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+      gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
 
       if (cursor_width > db->xpos + dga->width - cursor_start)
 	cursor_width = db->xpos + dga->width - cursor_start;
@@ -1872,10 +1873,10 @@
     bg_pmap = Qnil;
 
   if (NILP (bg_pmap))
-    gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+    gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
 		       Qnil, Qnil, Qnil);
   else
-    gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
+    gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
 		       WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap,
 		       Qnil);
 
@@ -1897,7 +1898,7 @@
 			   (WINDOW_FACE_CACHEL (w, rb->findex),
 			    Vcharset_ascii));
 
-      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+      gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
 
       cursor_y = dl->ypos - fi->ascent;
       cursor_height = fi->height;
@@ -1915,7 +1916,7 @@
 	    {
 	      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
 
-	      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background,
+	      gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
 				 Qnil, Qnil, make_int (bar_width));
 	      XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1,
 			       cursor_y, cursor_start + bar_width - 1,
@@ -1959,7 +1960,7 @@
   /* First clear the area not covered by the line. */
   if (height - rb->object.hline.thickness > 0)
     {
-      gc = XLIKE_get_gc (d, Qnil,
+      gc = XLIKE_get_gc (f, Qnil,
 			 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
 			 Qnil, Qnil, Qnil);
 
@@ -1977,7 +1978,7 @@
   }
 #else /* THIS_IS_X */
   /* Now draw the line. */
-  gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+  gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
 		     Qnil, Qnil, Qnil);
 
   if (ypos2 < ypos1)
@@ -2008,7 +2009,7 @@
 
   if (!UNBOUNDP (background_pixmap))
     {
-      gc = XLIKE_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
+      gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor, background_pixmap, Qnil);
     }
 
   if (gc)
@@ -2054,7 +2055,7 @@
   if (NILP (w->text_cursor_visible_p))
     return;
 
-  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+  gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
 
   default_face_font_info (window, &defascent, 0, 0, &defheight, 0);
 
@@ -2078,7 +2079,7 @@
 	{
 	  int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
 
-	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
+	  gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil,
 			     make_int (bar_width));
 	  XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
 			   x + bar_width - 1, cursor_y + cursor_height - 1);