Commits

Jeff Sparkes committed 6466bc9

* console-x-impl.h (DEVICE_X_XFTDRAW): Define, instead of
FRAME_X_FTDRAW.
(struct x_device): Add XftDraw field.
(struct x_frame): Remove XftDraw field.
Move XftDraw from frame to device for improved caching.

* device-x.c (x_delete_device): Free XftDraw here.

* frame-x.c (x_delete_frame): Remove freeing of XftDraw.

* redisplay-xlike-inc.c (XLIKE_output_string): Use
DEVICE_X_XFTDRAW instead of FRAME_X_XFTDRAW when lazily creating
XftDraw structure.

Comments (0)

Files changed (6)

lisp/gtk-widget-accessors.el

 
 (require 'gtk-ffi)
 
-(defconst GTK_TYPE_INVALID 0)
-(defconst GTK_TYPE_NONE 1)
-(defconst GTK_TYPE_CHAR 2)
-(defconst GTK_TYPE_UCHAR 3)
-(defconst GTK_TYPE_BOOL 4)
-(defconst GTK_TYPE_INT 5)
-(defconst GTK_TYPE_UINT 6)
-(defconst GTK_TYPE_LONG 7)
-(defconst GTK_TYPE_ULONG 8)
-(defconst GTK_TYPE_FLOAT 9)
-(defconst GTK_TYPE_DOUBLE 10)
-(defconst GTK_TYPE_STRING 11)
-(defconst GTK_TYPE_ENUM 12)
-(defconst GTK_TYPE_FLAGS 13)
-(defconst GTK_TYPE_BOXED 14)
-(defconst GTK_TYPE_POINTER 15)
-(defconst GTK_TYPE_SIGNAL 16)
-(defconst GTK_TYPE_ARGS 17)
-(defconst GTK_TYPE_CALLBACK 18)
-(defconst GTK_TYPE_C_CALLBACK 19)
-(defconst GTK_TYPE_FOREIGN 20)
-(defconst GTK_TYPE_OBJECT 21)
+(defconst G_TYPE_INVALID 0)
+(defconst G_TYPE_NONE 1)
+(defconst G_TYPE_CHAR 2)
+(defconst G_TYPE_UCHAR 3)
+(defconst G_TYPE_BOOL 4)
+(defconst G_TYPE_INT 5)
+(defconst G_TYPE_UINT 6)
+(defconst G_TYPE_LONG 7)
+(defconst G_TYPE_ULONG 8)
+(defconst G_TYPE_FLOAT 9)
+(defconst G_TYPE_DOUBLE 10)
+(defconst G_TYPE_STRING 11)
+(defconst G_TYPE_ENUM 12)
+(defconst G_TYPE_FLAGS 13)
+(defconst G_TYPE_BOXED 14)
+(defconst G_TYPE_POINTER 15)
+(defconst G_TYPE_SIGNAL 16)
+(defconst G_TYPE_ARGS 17)
+(defconst G_TYPE_CALLBACK 18)
+(defconst G_TYPE_C_CALLBACK 19)
+(defconst G_TYPE_FOREIGN 20)
+(defconst G_TYPE_OBJECT 21)
 
 (defconst gtk-value-accessor-names
   '("INVALID" "NONE" "CHAR" "UCHAR" "BOOL" "INT" "UINT" "LONG" "ULONG" "FLOAT" "DOUBLE"
        "\n"
        (format "\tthe_obj = GTK_%s (XGTK_OBJECT (obj)->object);\n" wrapper)
 
-       (format "\targ.type = gtk_type_from_name (\"%s\");\n" (symbol-name (car arg))))
-;       (format "\targ.type = GTK_TYPE_%s;\n" (or
+       (format "\targ.type = g_type_from_name (\"%s\");\n" (symbol-name (car arg))))
+;       (format "\targ.type = G_TYPE_%s;\n" (or
 ;					       (nth (gtk-fundamental-type (car arg))
 ;						    gtk-value-accessor-names)
 ;					       (case (car arg)
 
       (setq base-arg-type (gtk-fundamental-type (car arg)))
       (cond
-       ((= base-arg-type GTK_TYPE_OBJECT)
+       ((= base-arg-type G_TYPE_OBJECT)
 	(insert
 	 (format "\tGTK_VALUE_OBJECT (arg) = GTK_OBJECT (the_obj->%s);"
 		 (cdr arg))))
-       ((or (= base-arg-type GTK_TYPE_POINTER)
-	    (= base-arg-type GTK_TYPE_BOXED))
+       ((or (= base-arg-type G_TYPE_POINTER)
+	    (= base-arg-type G_TYPE_BOXED))
 	(insert
 	 (format "\tGTK_VALUE_%s (arg) = (void *)the_obj->%s;"
 		 (nth (gtk-fundamental-type (car arg)) gtk-value-accessor-names)
 		 (cdr arg)))))
       (insert
        "\n"
-       "\treturn (gtk_type_to_lisp (&arg));\n"
+       "\treturn (g_type_to_lisp (&arg));\n"
        "}\n\n")
       (push c-func-name func-names))
     func-names))
+2010-06-21  Jeff Sparkes  <jsparkes@gmail.com>
+
+	* console-x-impl.h (DEVICE_X_XFTDRAW): Define, instead of
+	FRAME_X_FTDRAW.
+	(struct x_device): Add XftDraw field.
+	(struct x_frame): Remove XftDraw field.
+	Move XftDraw from frame to device for improved caching.
+
+	* device-x.c (x_delete_device): Free XftDraw here.
+
+	* frame-x.c (x_delete_frame): Remove freeing of XftDraw.
+
+	* redisplay-xlike-inc.c (XLIKE_output_string): Use
+	DEVICE_X_XFTDRAW instead of FRAME_X_XFTDRAW when lazily creating
+	XftDraw structure.
+
 2010-06-13  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* elhash.c:
   /* Used by x_bevel_modeline in redisplay-x.c */
   Pixmap gray_pixmap;
 
+#ifdef HAVE_XFT
+  /* The Xft Drawable wrapper for this device. */
+  /* This is persistent to take advantage of the ability of Xft's glyph
+     cache in the server, and avoid rendering the font again and again... 
+
+     This is created the first time through redisplay, and destroyed when our 
+     connection to the X display is destroyed. */
+  XftDraw *xftDraw;
+#endif
+  
+
   /* Atoms associated with this device. */
   /* allocated in Xatoms_of_device_x */
   Atom Xatom_WM_PROTOCOLS;
 #define DEVICE_XT_APP_SHELL(d) 	(DEVICE_X_DATA (d)->Xt_app_shell)
 #define DEVICE_X_GC_CACHE(d) 	(DEVICE_X_DATA (d)->gc_cache)
 #define DEVICE_X_GRAY_PIXMAP(d) (DEVICE_X_DATA (d)->gray_pixmap)
+#define DEVICE_X_XFTDRAW(d) 	(DEVICE_X_DATA (d)->xftDraw)
 #define DEVICE_X_WM_COMMAND_FRAME(d) (DEVICE_X_DATA (d)->WM_COMMAND_frame)
 #define DEVICE_X_MOUSE_TIMESTAMP(d)  (DEVICE_X_DATA (d)->mouse_timestamp)
 #define DEVICE_X_GLOBAL_MOUSE_TIMESTAMP(d) (DEVICE_X_DATA (d)->global_mouse_timestamp)
 #endif /* XIM_XLIB */
 #endif /* HAVE_XIM */
 
-#ifdef HAVE_XFT
-  /* The Xft Drawable wrapper for this device.
-     #### Should this be per-device, or per-frame? */
-  /* This is persistent to take advantage of the ability of Xft's glyph
-     cache in the server, and avoid rendering the font again and again... 
-
-     This is created the first time through redisplay, and destroyed when our 
-     connection to the X display is destroyed. */
-  XftDraw *xftDraw;
-#endif
-
   /* 1 if the frame is completely visible on the display, 0 otherwise.
      if 0 the frame may have been iconified or may be totally
      or partially hidden by another X window */
 
 #define FRAME_X_GEOM_FREE_ME_PLEASE(f) (FRAME_X_DATA (f)->geom_free_me_please)
 
-#ifdef HAVE_XFT
-#define FRAME_X_XFTDRAW(f)   (FRAME_X_DATA (f)->xftDraw)
-#endif
-
 #define FRAME_X_TOTALLY_VISIBLE_P(f) (FRAME_X_DATA (f)->totally_visible_p)
 #define FRAME_X_TOP_LEVEL_FRAME_P(f) (FRAME_X_DATA (f)->top_level_frame_p)
 
   int checking_free;
 #endif
 
+#ifdef HAVE_XFT
+  /* If we have an XftDraw structure, we need to free it here.
+     We can't ever have an XftDraw without a Display, so we are safe
+     to free it in here, and we avoid too much playing around with the 
+     malloc checking hooks this way. */
+  if (DEVICE_X_XFTDRAW (d)) 
+    {
+      XftDrawDestroy (DEVICE_X_XFTDRAW (d));
+      DEVICE_X_XFTDRAW (d) = NULL;
+    }
+#endif
+
   display = DEVICE_X_DISPLAY (d);
 
   if (display)
   DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
 #endif /* HAVE_CDE */
 
-#ifdef HAVE_XFT
-  /* If we have an XftDraw structure, we need to free it here.
-     We can't ever have an XftDraw without a Display, so we are safe
-     to free it in here, and we avoid too much playing around with the 
-     malloc checking hooks this way. */
-  if (FRAME_X_XFTDRAW (f)) 
-    {
-      XftDrawDestroy (FRAME_X_XFTDRAW (f));
-      FRAME_X_XFTDRAW (f) = NULL;
-    }
-#endif
-
-
   assert (FRAME_X_SHELL_WIDGET (f) != 0);
   dpy = XtDisplay (FRAME_X_SHELL_WIDGET (f));
 

src/redisplay-xlike-inc.c

   XftDraw *xftDraw;
 
   /* Lazily initialize frame's xftDraw member. */
-  if (!FRAME_X_XFTDRAW (f)) {
-    FRAME_X_XFTDRAW (f) = XftDrawCreate (dpy, x_win, visual, cmap);
+  if (!DEVICE_X_XFTDRAW (d)) {
+    DEVICE_X_XFTDRAW (d) = XftDrawCreate (dpy, x_win, visual, cmap);
   }
-  xftDraw = FRAME_X_XFTDRAW (f);
+  xftDraw = DEVICE_X_XFTDRAW (d);
 
   /* #### This will probably cause asserts when passed a Lisp integer for a
      color.  See ca. line 759 this file.