emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114835: * xterm.h (struct x_output): For 'black_rel


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r114835: * xterm.h (struct x_output): For 'black_relief' and 'white_relief'
Date: Tue, 29 Oct 2013 05:59:57 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114835
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-10-29 09:55:25 +0400
message:
  * xterm.h (struct x_output): For 'black_relief' and 'white_relief'
  fields, drop 'allocated_p' member and use -1 for uninitialized value.
  * w32term.h (struct w32_output): Similarly but do not use -1 because...
  * xfaces.c (unload_color) [HAVE_X_WINDOWS]: ...this function is a no-op
  on MS-Windows anyway.
  (free_face_colors): Define only if HAVE_X_WINDOWS and...
  (free_realized_face): ...adjust user.
  * xfns.c (Fx_create_frame, x_create_tip_frame): Initialize black and
  white relief pixels to -1.
  * xterm.c (x_setup_relief_color, x_free_frame_resources): Adjust users.
  * w32term.c (w32_setup_relief_color, x_free_frame_resources): Likewise.
  * dispextern.h (unload_color): Move prototype under HAVE_X_WINDOWS.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/dispextern.h               
dispextern.h-20091113204419-o5vbwnq5f7feedwu-218
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
  src/w32term.h                  w32term.h-20091113204419-o5vbwnq5f7feedwu-954
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
  src/xfns.c                     xfns.c-20091113204419-o5vbwnq5f7feedwu-274
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
  src/xterm.h                    xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-28 21:19:38 +0000
+++ b/src/ChangeLog     2013-10-29 05:55:25 +0000
@@ -1,3 +1,18 @@
+2013-10-29  Dmitry Antipov  <address@hidden>
+
+       * xterm.h (struct x_output): For 'black_relief' and 'white_relief'
+       fields, drop 'allocated_p' member and use -1 for uninitialized value.
+       * w32term.h (struct w32_output): Similarly but do not use -1 because...
+       * xfaces.c (unload_color) [HAVE_X_WINDOWS]: ...this function is a no-op
+       on MS-Windows anyway.
+       (free_face_colors): Define only if HAVE_X_WINDOWS and...
+       (free_realized_face): ...adjust user.
+       * xfns.c (Fx_create_frame, x_create_tip_frame): Initialize black and
+       white relief pixels to -1.
+       * xterm.c (x_setup_relief_color, x_free_frame_resources): Adjust users.
+       * w32term.c (w32_setup_relief_color, x_free_frame_resources): Likewise.
+       * dispextern.h (unload_color): Move prototype under HAVE_X_WINDOWS.
+
 2013-10-28  Paul Eggert  <address@hidden>
 
        * dispextern.h, image.c (x_bitmap_height, x_bitmap_width): Now static.

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2013-10-28 21:19:38 +0000
+++ b/src/dispextern.h  2013-10-29 05:55:25 +0000
@@ -3328,6 +3328,7 @@
 /* Defined in xfaces.c */
 
 #ifdef HAVE_X_WINDOWS
+void unload_color (struct frame *, unsigned long);
 void x_free_colors (struct frame *, unsigned long *, int);
 #endif
 
@@ -3339,7 +3340,6 @@
 unsigned long load_color (struct frame *, struct face *, Lisp_Object,
                           enum lface_attribute_index);
 #endif
-void unload_color (struct frame *, unsigned long);
 char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
                         int *);
 void prepare_face_for_display (struct frame *, struct face *);

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-10-18 12:57:44 +0000
+++ b/src/w32term.c     2013-10-29 05:55:25 +0000
@@ -1596,10 +1596,7 @@
   xgcv.foreground = default_pixel;
   pixel = background;
   if (w32_alloc_lighter_color (f, &pixel, factor, delta))
-    {
-      relief->allocated_p = 1;
-      xgcv.foreground = relief->pixel = pixel;
-    }
+    xgcv.foreground = relief->pixel = pixel;
 
   if (relief->gc == 0)
     {
@@ -6001,17 +5998,6 @@
 
   free_frame_menubar (f);
 
-  unload_color (f, FRAME_FOREGROUND_PIXEL (f));
-  unload_color (f, FRAME_BACKGROUND_PIXEL (f));
-  unload_color (f, f->output_data.w32->cursor_pixel);
-  unload_color (f, f->output_data.w32->cursor_foreground_pixel);
-  unload_color (f, f->output_data.w32->border_pixel);
-  unload_color (f, f->output_data.w32->mouse_pixel);
-  if (f->output_data.w32->white_relief.allocated_p)
-    unload_color (f, f->output_data.w32->white_relief.pixel);
-  if (f->output_data.w32->black_relief.allocated_p)
-    unload_color (f, f->output_data.w32->black_relief.pixel);
-
   if (FRAME_FACE_CACHE (f))
     free_frame_faces (f);
 

=== modified file 'src/w32term.h'
--- a/src/w32term.h     2013-10-18 12:57:44 +0000
+++ b/src/w32term.h     2013-10-29 05:55:25 +0000
@@ -376,7 +376,6 @@
   {
     XGCValues *gc;
     unsigned long pixel;
-    int allocated_p;
   }
   black_relief, white_relief;
 

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2013-10-28 21:19:38 +0000
+++ b/src/xfaces.c      2013-10-29 05:55:25 +0000
@@ -1293,30 +1293,28 @@
   face->foreground = load_color (f, face, fg, LFACE_FOREGROUND_INDEX);
 }
 
+#ifdef HAVE_X_WINDOWS
 
 /* Free color PIXEL on frame F.  */
 
 void
 unload_color (struct frame *f, long unsigned int pixel)
 {
-#ifdef HAVE_X_WINDOWS
   if (pixel != -1)
     {
       block_input ();
       x_free_colors (f, &pixel, 1);
       unblock_input ();
     }
-#endif
 }
 
-
 /* Free colors allocated for FACE.  */
 
 static void
 free_face_colors (struct frame *f, struct face *face)
 {
-/* PENDING(NS): need to do something here? */
-#ifdef HAVE_X_WINDOWS
+  /* PENDING(NS): need to do something here? */
+
   if (face->colors_copied_bitwise_p)
     return;
 
@@ -1363,8 +1361,9 @@
     }
 
   unblock_input ();
+}
+
 #endif /* HAVE_X_WINDOWS */
-}
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
@@ -4039,8 +4038,9 @@
              face->gc = 0;
              unblock_input ();
            }
-
+#ifdef HAVE_X_WINDOWS
          free_face_colors (f, face);
+#endif /* HAVE_X_WINDOWS */
          x_destroy_bitmap (f, face->stipple);
        }
 #endif /* HAVE_WINDOW_SYSTEM */

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2013-10-18 12:57:44 +0000
+++ b/src/xfns.c        2013-10-29 05:55:25 +0000
@@ -2880,6 +2880,8 @@
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
 #endif /* USE_TOOLKIT_SCROLL_BARS */
+  f->output_data.x->white_relief.pixel = -1;
+  f->output_data.x->black_relief.pixel = -1;
 
   fset_icon_name (f,
                  x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
@@ -4824,6 +4826,9 @@
   f->output_data.x->scroll_bar_top_shadow_pixel = -1;
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
 #endif /* USE_TOOLKIT_SCROLL_BARS */
+  f->output_data.x->white_relief.pixel = -1;
+  f->output_data.x->black_relief.pixel = -1;
+
   fset_icon_name (f, Qnil);
   FRAME_DISPLAY_INFO (f) = dpyinfo;
   f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-10-18 12:57:44 +0000
+++ b/src/xterm.c       2013-10-29 05:55:25 +0000
@@ -1774,11 +1774,10 @@
   /* Free previously allocated color.  The color cell will be reused
      when it has been freed as many times as it was allocated, so this
      doesn't affect faces using the same colors.  */
-  if (relief->gc
-      && relief->allocated_p)
+  if (relief->gc && relief->pixel != -1)
     {
       x_free_colors (f, &relief->pixel, 1);
-      relief->allocated_p = 0;
+      relief->pixel = -1;
     }
 
   /* Allocate new color.  */
@@ -1786,10 +1785,7 @@
   pixel = background;
   if (dpyinfo->n_planes != 1
       && x_alloc_lighter_color (f, dpy, cmap, &pixel, factor, delta))
-    {
-      relief->allocated_p = 1;
-      xgcv.foreground = relief->pixel = pixel;
-    }
+    xgcv.foreground = relief->pixel = pixel;
 
   if (relief->gc == 0)
     {
@@ -9338,9 +9334,9 @@
       if (f->output_data.x->scroll_bar_bottom_shadow_pixel != -1)
        unload_color (f, f->output_data.x->scroll_bar_bottom_shadow_pixel);
 #endif /* USE_TOOLKIT_SCROLL_BARS */
-      if (f->output_data.x->white_relief.allocated_p)
+      if (f->output_data.x->white_relief.pixel != -1)
        unload_color (f, f->output_data.x->white_relief.pixel);
-      if (f->output_data.x->black_relief.allocated_p)
+      if (f->output_data.x->black_relief.pixel != -1)
        unload_color (f, f->output_data.x->black_relief.pixel);
 
       x_free_gcs (f);

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2013-10-18 12:57:44 +0000
+++ b/src/xterm.h       2013-10-29 05:55:25 +0000
@@ -605,7 +605,6 @@
   {
     GC gc;
     unsigned long pixel;
-    int allocated_p;
   }
   black_relief, white_relief;
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]