changeset 28690:01a3287bb747

(x_set_line_spacing): New function. (Fx_create_frame): Set line spacing from resources. (Qline_spacing): New variable. (syms_of_xfns): Initialize Qline_spacing.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 24 Apr 2000 13:56:04 +0000
parents 8bf7396f359d
children 26fdeb2124f0
files src/xfns.c
diffstat 1 files changed, 51 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Mon Apr 24 13:55:28 2000 +0000
+++ b/src/xfns.c	Mon Apr 24 13:56:04 2000 +0000
@@ -236,7 +236,7 @@
 Lisp_Object Quser_size;
 extern Lisp_Object Qdisplay;
 Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
-Lisp_Object Qscreen_gamma;
+Lisp_Object Qscreen_gamma, Qline_spacing;
 
 /* The below are defined in frame.c.  */
 
@@ -740,6 +740,7 @@
 
 static void x_create_im P_ ((struct frame *));
 void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
+static void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
 void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -775,30 +776,31 @@
 
 static struct x_frame_parm_table x_frame_parms[] =
 {
-  "auto-raise", x_set_autoraise,
-  "auto-lower", x_set_autolower,
-  "background-color", x_set_background_color,
-  "border-color", x_set_border_color,
-  "border-width", x_set_border_width,
-  "cursor-color", x_set_cursor_color,
-  "cursor-type", x_set_cursor_type,
-  "font", x_set_font,
-  "foreground-color", x_set_foreground_color,
-  "icon-name", x_set_icon_name,
-  "icon-type", x_set_icon_type,
-  "internal-border-width", x_set_internal_border_width,
-  "menu-bar-lines", x_set_menu_bar_lines,
-  "mouse-color", x_set_mouse_color,
-  "name", x_explicitly_set_name,
-  "scroll-bar-width", x_set_scroll_bar_width,
-  "title", x_set_title,
-  "unsplittable", x_set_unsplittable,
-  "vertical-scroll-bars", x_set_vertical_scroll_bars,
-  "visibility", x_set_visibility,
-  "tool-bar-lines", x_set_tool_bar_lines,
-  "scroll-bar-foreground", x_set_scroll_bar_foreground,
-  "scroll-bar-background", x_set_scroll_bar_background,
-  "screen-gamma", x_set_screen_gamma
+  "auto-raise",			x_set_autoraise,
+  "auto-lower",			x_set_autolower,
+  "background-color",		x_set_background_color,
+  "border-color",		x_set_border_color,
+  "border-width",		x_set_border_width,
+  "cursor-color",		x_set_cursor_color,
+  "cursor-type",		x_set_cursor_type,
+  "font",			x_set_font,
+  "foreground-color",		x_set_foreground_color,
+  "icon-name",			x_set_icon_name,
+  "icon-type",			x_set_icon_type,
+  "internal-border-width",	x_set_internal_border_width,
+  "menu-bar-lines",		x_set_menu_bar_lines,
+  "mouse-color",		x_set_mouse_color,
+  "name",			x_explicitly_set_name,
+  "scroll-bar-width",		x_set_scroll_bar_width,
+  "title",			x_set_title,
+  "unsplittable",		x_set_unsplittable,
+  "vertical-scroll-bars",	x_set_vertical_scroll_bars,
+  "visibility",			x_set_visibility,
+  "tool-bar-lines",		x_set_tool_bar_lines,
+  "scroll-bar-foreground",	x_set_scroll_bar_foreground,
+  "scroll-bar-background",	x_set_scroll_bar_background,
+  "screen-gamma",		x_set_screen_gamma,
+  "line-spacing",		x_set_line_spacing
 };
 
 /* Attach the `x-frame-parameter' properties to
@@ -1288,6 +1290,26 @@
 
 
 
+/* Change the `line-spacing' frame parameter of frame F.  OLD_VALUE is
+   the previous value of that parameter, NEW_VALUE is the new value.  */
+
+static void
+x_set_line_spacing (f, new_value, old_value)
+     struct frame *f;
+     Lisp_Object new_value, old_value;
+{
+  if (NILP (new_value))
+    f->extra_line_spacing = 0;
+  else if (NATNUMP (new_value))
+    f->extra_line_spacing = XFASTINT (new_value);
+  else
+    Fsignal (Qerror, Fcons (build_string ("Illegal line-spacing"),
+			    Fcons (new_value, Qnil)));
+  if (FRAME_VISIBLE_P (f))
+    redraw_frame (f);
+}
+
+
 /* Change the `screen-gamma' frame parameter of frame F.  OLD_VALUE is
    the previous value of that parameter, NEW_VALUE is the new value.  */
 
@@ -4022,6 +4044,8 @@
 		       "borderColor", "BorderColor", RES_TYPE_STRING);
   x_default_parameter (f, parms, Qscreen_gamma, Qnil,
 		       "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
+  x_default_parameter (f, parms, Qline_spacing, Qnil,
+		       "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
 
   x_default_scroll_bar_color_parameter (f, parms, Qscroll_bar_foreground,
 					"scrollBarForeground",
@@ -10127,6 +10151,8 @@
   staticpro (&Qscroll_bar_background);
   Qscreen_gamma = intern ("screen-gamma");
   staticpro (&Qscreen_gamma);
+  Qline_spacing = intern ("line-spacing");
+  staticpro (&Qline_spacing);
   /* This is the end of symbol initialization.  */
 
   /* Text property `display' should be nonsticky by default.  */