Separate read and write access to Lisp_Object slots of struct frame.
[bpt/emacs.git] / src / xfns.c
index 8bbb4e1..e92b0e5 100644 (file)
@@ -665,7 +665,7 @@ x_set_tool_bar_position (struct frame *f,
 
 #ifdef USE_GTK
   if (xg_change_toolbar_position (f, new_value))
-    FVAR (f, tool_bar_position) = new_value;
+    FSET (f, tool_bar_position, new_value);
 #endif
 }
 
@@ -1123,9 +1123,9 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   BLOCK_INPUT;
   if (NILP (arg))
     result = x_text_icon (f,
-                         SSDATA ((!NILP (FVAR (f, icon_name))
-                                  ? FVAR (f, icon_name)
-                                  : FVAR (f, name))));
+                         SSDATA ((!NILP (FGET (f, icon_name))
+                                  ? FGET (f, icon_name)
+                                  : FGET (f, name))));
   else
     result = x_bitmap_icon (f, arg);
 
@@ -1152,7 +1152,7 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   else if (!NILP (arg) || NILP (oldval))
     return;
 
-  FVAR (f, icon_name) = arg;
+  FSET (f, icon_name, arg);
 
   if (f->output_data.x->icon_bitmap != 0)
     return;
@@ -1160,11 +1160,11 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
   BLOCK_INPUT;
 
   result = x_text_icon (f,
-                       SSDATA ((!NILP (FVAR (f, icon_name))
-                                ? FVAR (f, icon_name)
-                                : !NILP (FVAR (f, title))
-                                ? FVAR (f, title)
-                                : FVAR (f, name))));
+                       SSDATA ((!NILP (FGET (f, icon_name))
+                                ? FGET (f, icon_name)
+                                : !NILP (FGET (f, title))
+                                ? FGET (f, title)
+                                : FGET (f, name))));
 
   if (result)
     {
@@ -1253,8 +1253,8 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
          UNBLOCK_INPUT;
        }
 
-      if (nlines == 0 && WINDOWP (FVAR (f, menu_bar_window)))
-       clear_glyph_matrix (XWINDOW (FVAR (f, menu_bar_window))->current_matrix);
+      if (nlines == 0 && WINDOWP (FGET (f, menu_bar_window)))
+       clear_glyph_matrix (XWINDOW (FGET (f, menu_bar_window))->current_matrix);
     }
 #endif /* not USE_X_TOOLKIT && not USE_GTK */
   adjust_glyphs (f);
@@ -1352,8 +1352,8 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
           UNBLOCK_INPUT;
         }
 
-      if (WINDOWP (FVAR (f, tool_bar_window)))
-       clear_glyph_matrix (XWINDOW (FVAR (f, tool_bar_window))->current_matrix);
+      if (WINDOWP (FGET (f, tool_bar_window)))
+       clear_glyph_matrix (XWINDOW (FGET (f, tool_bar_window))->current_matrix);
     }
 
     run_window_configuration_change_hook (f);
@@ -1548,7 +1548,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)
        if (text.nitems != bytes)
          error ("Window name too large");
 
-       if (!STRINGP (FVAR (f, icon_name)))
+       if (!STRINGP (FGET (f, icon_name)))
          {
            icon = text;
            encoded_icon_name = encoded_name;
@@ -1556,7 +1556,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)
        else
          {
            /* See the above comment "Note: Encoding strategy".  */
-           icon.value = x_encode_text (FVAR (f, icon_name), coding_system, 0,
+           icon.value = x_encode_text (FGET (f, icon_name), coding_system, 0,
                                        &bytes, &stringp, &do_free_icon_value);
            icon.encoding = (stringp ? XA_STRING
                             : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
@@ -1565,7 +1565,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name)
            if (icon.nitems != bytes)
              error ("Icon name too large");
 
-           encoded_icon_name = ENCODE_UTF_8 (FVAR (f, icon_name));
+           encoded_icon_name = ENCODE_UTF_8 (FGET (f, icon_name));
          }
 
 #ifdef USE_GTK
@@ -1632,7 +1632,7 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
       /* Check for no change needed in this very common case
         before we do any consing.  */
       if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name,
-                  SSDATA (FVAR (f, name))))
+                  SSDATA (FGET (f, name))))
        return;
       name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name);
     }
@@ -1640,15 +1640,15 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
     CHECK_STRING (name);
 
   /* Don't change the name if it's already NAME.  */
-  if (! NILP (Fstring_equal (name, FVAR (f, name))))
+  if (! NILP (Fstring_equal (name, FGET (f, name))))
     return;
 
-  FVAR (f, name) = name;
+  FSET (f, name, name);
 
   /* For setting the frame title, the title parameter should override
      the name parameter.  */
-  if (! NILP (FVAR (f, title)))
-    name = FVAR (f, title);
+  if (! NILP (FGET (f, title)))
+    name = FGET (f, title);
 
   x_set_name_internal (f, name);
 }
@@ -1678,15 +1678,15 @@ static void
 x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
 {
   /* Don't change the title if it's already NAME.  */
-  if (EQ (name, FVAR (f, title)))
+  if (EQ (name, FGET (f, title)))
     return;
 
   update_mode_lines = 1;
 
-  FVAR (f, title) = name;
+  FSET (f, title, name);
 
   if (NILP (name))
-    name = FVAR (f, name);
+    name = FGET (f, name);
   else
     CHECK_STRING (name);
 
@@ -2571,8 +2571,8 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
     int explicit = f->explicit_name;
 
     f->explicit_name = 0;
-    name = FVAR (f, name);
-    FVAR (f, name) = Qnil;
+    name = FGET (f, name);
+    FSET (f, name, Qnil);
     x_set_name (f, name, explicit);
   }
 
@@ -2714,8 +2714,8 @@ x_window (struct frame *f)
     int explicit = f->explicit_name;
 
     f->explicit_name = 0;
-    name = FVAR (f, name);
-    FVAR (f, name) = Qnil;
+    name = FGET (f, name);
+    FSET (f, name, Qnil);
     x_set_name (f, name, explicit);
   }
 
@@ -2791,9 +2791,9 @@ x_icon (struct frame *f, Lisp_Object parms)
         : NormalState));
 #endif
 
-  x_text_icon (f, SSDATA ((!NILP (FVAR (f, icon_name))
-                          ? FVAR (f, icon_name)
-                          : FVAR (f, name))));
+  x_text_icon (f, SSDATA ((!NILP (FGET (f, icon_name))
+                          ? FGET (f, icon_name)
+                          : FGET (f, name))));
 
   UNBLOCK_INPUT;
 }
@@ -3135,11 +3135,11 @@ This function is an internal primitive--use `make-frame' instead.  */)
   f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
 #endif /* USE_TOOLKIT_SCROLL_BARS */
 
-  FVAR (f, icon_name)
-    = x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
-                RES_TYPE_STRING);
-  if (! STRINGP (FVAR (f, icon_name)))
-    FVAR (f, icon_name) = Qnil;
+  FSET (f, icon_name,
+       x_get_arg (dpyinfo, parms, Qicon_name, "iconName", "Title",
+                  RES_TYPE_STRING));
+  if (! STRINGP (FGET (f, icon_name)))
+    FSET (f, icon_name, Qnil);
 
   FRAME_X_DISPLAY_INFO (f) = dpyinfo;
 
@@ -3196,12 +3196,12 @@ This function is an internal primitive--use `make-frame' instead.  */)
      be set.  */
   if (EQ (name, Qunbound) || NILP (name))
     {
-      FVAR (f, name) = build_string (dpyinfo->x_id_name);
+      FSET (f, name, build_string (dpyinfo->x_id_name));
       f->explicit_name = 0;
     }
   else
     {
-      FVAR (f, name) = name;
+      FSET (f, name, name);
       f->explicit_name = 1;
       /* use the frame's title when getting resources for this frame.  */
       specbind (Qx_resource_name, name);
@@ -3340,7 +3340,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
   x_default_parameter (f, parms, Qfullscreen, Qnil,
                        "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
   x_default_parameter (f, parms, Qtool_bar_position,
-                       FVAR (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL);
+                       FGET (f, tool_bar_position), 0, 0, RES_TYPE_SYMBOL);
 
   /* Compute the size of the X window.  */
   window_prompting = x_figure_window_size (f, parms, 1);
@@ -3468,7 +3468,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
   for (tem = parms; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
-      FVAR (f, param_alist) = Fcons (XCAR (tem), FVAR (f, param_alist));
+      FSET (f, param_alist, Fcons (XCAR (tem), FGET (f, param_alist)));
 
   UNGCPRO;
 
@@ -4621,7 +4621,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
   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 */
-  FVAR (f, icon_name) = Qnil;
+  FSET (f, icon_name, Qnil);
   FRAME_X_DISPLAY_INFO (f) = dpyinfo;
   f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
   f->output_data.x->explicit_parent = 0;
@@ -4663,12 +4663,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
      be set.  */
   if (EQ (name, Qunbound) || NILP (name))
     {
-      FVAR (f, name) = build_string (dpyinfo->x_id_name);
+      FSET (f, name, build_string (dpyinfo->x_id_name));
       f->explicit_name = 0;
     }
   else
     {
-      FVAR (f, name) = name;
+      FSET (f, name, name);
       f->explicit_name = 1;
       /* use the frame's title when getting resources for this frame.  */
       specbind (Qx_resource_name, name);