aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-01-14 15:19:55 +0000
committerJim Blandy1993-01-14 15:19:55 +0000
commitcf177271a6a7fc36a9a320484d2561b798fa693a (patch)
tree9eb710f4c7e76a66af96bbb3ded9a71e48028c9e /src
parentb1d1124bde4989e228d79e5576def676ee8ee57c (diff)
downloademacs-cf177271a6a7fc36a9a320484d2561b798fa693a.tar.gz
emacs-cf177271a6a7fc36a9a320484d2561b798fa693a.zip
* xfns.c (Fx_create_frame): After mapping the frame, call
SET_FRAME_GARBAGED, not just plain FRAME_GARBAGED. * xfns.c (Qvertical_scrollbars): New symbol. Use it as the name of the parameter which decides whether or not the frame has scrollbars, instead of Qvertical_scrollbar. (Fx_create_frame): Adjusted accordingly. (syms_of_xfns): Initialize and staticpro Qvertical_scrollbars. (x_set_vertical_scrollbar): Renamed to x_set_vertical_scrollbars. (x_frame_parms): Adjusted accordingly. * xterm.h (CHAR_TO_PIXEL_WIDTH, CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_WIDTH, PIXEL_TO_CHAR_HEIGHT): Rewritten, using: (CHAR_TO_PIXEL_ROW, CHAR_TO_PIXEL_COL, PIXEL_TO_CHAR_ROW, PIXEL_TO_CHAR_COL): New macros. * xfns.c [not HAVE_X11] (Fx_create_frame): Use the PIXEL_TO_CHAR_{HEIGHT,WIDTH} macros to figure the frame's character size, and the CHAR_TO_PIXEL* macros for vice versa. * xterm.c (XTwrite_glyphs, XTclear_end_of_line, stufflines, scraplines, dumprectangle, pixel_to_glyph_coords, x_draw_box, clear_cursor, x_display_bar_cursor, x_draw_single_glyph, x_set_mouse_position): Use the CHAR_TO_PIXEL_* macros. * xfns.c (x_set_name): To request that the modelines be redrawn, execute the statement "update_mode_lines = 1;" instead of the silly statement "update_mode_lines;". * xfns.c (x_set_vertical_scrollbars): Don't try to set the X window's size if the frame's X window hasn't been created yet. * xfns.c (x_figure_window_size): Set the frame's vertical_scrollbar_extra field before trying to calculate its pixel dimensions. * xfns.c (x_window): When calling x_implicitly_set_name for the sake of drawing the name for the first time, remember to clear and set the frame's explicit_name member as well as its name member. (Fx_create_frame): Set the frame's explicit_name member if the user specified the name explicitly. * xfns.c (Fx_get_resource): Add CLASS argument, to give class of ATTRIBUTE. [not HAVE_X11]: Change definition of Fx_get_resource macro accordingly. (x_get_arg): Add CLASS argument, to give the class of ATTRIBUTE. Pass it along to Fx_get_resource. (x_figure_window_size, x_icon): Pass new argument to x_get_arg. (x_default_parameter): Add XCLASS argument, to give the class of XPROP. Pass it along to x_get_arg. (Fx_create_frame): Pass new args to x_get_arg and x_default_parameter. * xfns.c (Fx_create_frame): Use the same resource names and classes as xterm and Emacs 18.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c256
1 files changed, 148 insertions, 108 deletions
diff --git a/src/xfns.c b/src/xfns.c
index ec95aba0461..cb5aaca7af7 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,5 +1,5 @@
1/* Functions for the X window system. 1/* Functions for the X window system.
2 Copyright (C) 1989, 1992 Free Software Foundation. 2 Copyright (C) 1989, 1992, 1993 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -246,6 +246,7 @@ Lisp_Object Qsuppress_icon;
246Lisp_Object Qsuppress_initial_map; 246Lisp_Object Qsuppress_initial_map;
247Lisp_Object Qtop; 247Lisp_Object Qtop;
248Lisp_Object Qundefined_color; 248Lisp_Object Qundefined_color;
249Lisp_Object Qvertical_scrollbars;
249Lisp_Object Qwindow_id; 250Lisp_Object Qwindow_id;
250Lisp_Object Qx_frame_parameter; 251Lisp_Object Qx_frame_parameter;
251 252
@@ -336,7 +337,7 @@ void x_set_internal_border_width ();
336void x_explicitly_set_name (); 337void x_explicitly_set_name ();
337void x_set_autoraise (); 338void x_set_autoraise ();
338void x_set_autolower (); 339void x_set_autolower ();
339void x_set_vertical_scrollbar (); 340void x_set_vertical_scrollbars ();
340 341
341static struct x_frame_parm_table x_frame_parms[] = 342static struct x_frame_parm_table x_frame_parms[] =
342{ 343{
@@ -352,7 +353,7 @@ static struct x_frame_parm_table x_frame_parms[] =
352 "name", x_explicitly_set_name, 353 "name", x_explicitly_set_name,
353 "autoraise", x_set_autoraise, 354 "autoraise", x_set_autoraise,
354 "autolower", x_set_autolower, 355 "autolower", x_set_autolower,
355 "vertical-scrollbar", x_set_vertical_scrollbar, 356 "vertical-scrollbars", x_set_vertical_scrollbars,
356}; 357};
357 358
358/* Attach the `x-frame-parameter' properties to 359/* Attach the `x-frame-parameter' properties to
@@ -947,7 +948,7 @@ x_set_name (f, name, explicit)
947 /* If we're switching from explicit to implicit, we had better 948 /* If we're switching from explicit to implicit, we had better
948 update the mode lines and thereby update the title. */ 949 update the mode lines and thereby update the title. */
949 if (f->explicit_name && NILP (name)) 950 if (f->explicit_name && NILP (name))
950 update_mode_lines; 951 update_mode_lines = 1;
951 952
952 f->explicit_name = ! NILP (name); 953 f->explicit_name = ! NILP (name);
953 } 954 }
@@ -1030,7 +1031,7 @@ x_set_autolower (f, arg, oldval)
1030} 1031}
1031 1032
1032void 1033void
1033x_set_vertical_scrollbar (f, arg, oldval) 1034x_set_vertical_scrollbars (f, arg, oldval)
1034 struct frame *f; 1035 struct frame *f;
1035 Lisp_Object arg, oldval; 1036 Lisp_Object arg, oldval;
1036{ 1037{
@@ -1038,7 +1039,12 @@ x_set_vertical_scrollbar (f, arg, oldval)
1038 { 1039 {
1039 FRAME_HAS_VERTICAL_SCROLLBARS (f) = ! NILP (arg); 1040 FRAME_HAS_VERTICAL_SCROLLBARS (f) = ! NILP (arg);
1040 1041
1041 x_set_window_size (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 1042 /* We set this parameter before creating the X window for the
1043 frame, so we can get the geometry right from the start.
1044 However, if the window hasn't been created yet, we shouldn't
1045 call x_set_window_size. */
1046 if (FRAME_X_WINDOW (f))
1047 x_set_window_size (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
1042 } 1048 }
1043} 1049}
1044 1050
@@ -1282,23 +1288,25 @@ The value is a list (FONT FG-COLOR BG-COLOR).")
1282extern char *x_get_string_resource (); 1288extern char *x_get_string_resource ();
1283extern XrmDatabase x_load_resources (); 1289extern XrmDatabase x_load_resources ();
1284 1290
1285DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 1, 3, 0, 1291DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 2, 4, 0,
1286 "Retrieve the value of ATTRIBUTE from the X defaults database.\n\ 1292 "Return the value of ATTRIBUTE, of class CLASS, from the X defaults database.\n\
1287This uses `Emacs' as the class and `INSTANCE.ATTRIBUTE' as the key,\n\ 1293This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the\n\
1288where INSTANCE is the name under which Emacs was invoked.\n\ 1294class, where INSTANCE is the name under which Emacs was invoked.\n\
1289\n\ 1295\n\
1290The optional arguments COMPONENT and SUBCLASS add to the key and the\n\ 1296The optional arguments COMPONENT and SUBCLASS add to the key and the\n\
1291class, respectively. You must specify both of them or neither.\n\ 1297class, respectively. You must specify both of them or neither.\n\
1292If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\ 1298If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'\n\
1293and the class is `Emacs.SUBCLASS'.") 1299and the class is `Emacs.CLASS.SUBCLASS'.")
1294 (attribute, component, subclass) 1300 (attribute, class, component, subclass)
1295 Lisp_Object attribute, component, subclass; 1301 Lisp_Object attribute, class, component, subclass;
1296{ 1302{
1297 register char *value; 1303 register char *value;
1298 char *name_key; 1304 char *name_key;
1299 char *class_key; 1305 char *class_key;
1300 1306
1301 CHECK_STRING (attribute, 0); 1307 CHECK_STRING (attribute, 0);
1308 CHECK_STRING (class, 0);
1309
1302 if (!NILP (component)) 1310 if (!NILP (component))
1303 CHECK_STRING (component, 1); 1311 CHECK_STRING (component, 1);
1304 if (!NILP (subclass)) 1312 if (!NILP (subclass))
@@ -1308,30 +1316,42 @@ and the class is `Emacs.SUBCLASS'.")
1308 1316
1309 if (NILP (component)) 1317 if (NILP (component))
1310 { 1318 {
1311 name_key = (char *) alloca (XSTRING (invocation_name)->size + 1 1319 /* Allocate space for the components, the dots which separate them,
1312 + XSTRING (attribute)->size + 1); 1320 and the final '\0'. */
1321 name_key = (char *) alloca (XSTRING (invocation_name)->size
1322 + XSTRING (attribute)->size
1323 + 2);
1324 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
1325 + XSTRING (class)->size
1326 + 2);
1313 1327
1314 sprintf (name_key, "%s.%s", 1328 sprintf (name_key, "%s.%s",
1315 XSTRING (invocation_name)->data, 1329 XSTRING (invocation_name)->data,
1316 XSTRING (attribute)->data); 1330 XSTRING (attribute)->data);
1317 class_key = EMACS_CLASS; 1331 sprintf (class_key, "%s.%s",
1332 EMACS_CLASS,
1333 XSTRING (class)->data);
1318 } 1334 }
1319 else 1335 else
1320 { 1336 {
1321 name_key = (char *) alloca (XSTRING (invocation_name)->size + 1 1337 name_key = (char *) alloca (XSTRING (invocation_name)->size
1322 + XSTRING (component)->size + 1 1338 + XSTRING (component)->size
1323 + XSTRING (attribute)->size + 1); 1339 + XSTRING (attribute)->size
1340 + 3);
1324 1341
1325 class_key = (char *) alloca (sizeof (EMACS_CLASS) 1342 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
1326 + XSTRING (class)->size + 1); 1343 + XSTRING (class)->size
1344 + XSTRING (subclass)->size
1345 + 3);
1327 1346
1328 sprintf (name_key, "%s.%s.%s", 1347 sprintf (name_key, "%s.%s.%s",
1329 XSTRING (invocation_name)->data, 1348 XSTRING (invocation_name)->data,
1330 XSTRING (component)->data, 1349 XSTRING (component)->data,
1331 XSTRING (attribute)->data); 1350 XSTRING (attribute)->data);
1332 /* This used to have invocation_name instead of EMACS_CLASS, 1351 sprintf (class_key, "%s.%s",
1333 but the doc string seems to say it should be EMACS_CLASS. */ 1352 EMACS_CLASS,
1334 sprintf (class_key, "%s.%s", EMACS_CLASS, XSTRING (class)->data); 1353 XSTRING (class)->data,
1354 XSTRING (subclass)->data);
1335 } 1355 }
1336 1356
1337 value = x_get_string_resource (xrdb, name_key, class_key); 1357 value = x_get_string_resource (xrdb, name_key, class_key);
@@ -1369,7 +1389,8 @@ The defaults are specified in the file `~/.Xdefaults'.")
1369 return (Qnil); 1389 return (Qnil);
1370} 1390}
1371 1391
1372#define Fx_get_resource(attribute, name, class) Fx_get_default(attribute) 1392#define Fx_get_resource(attribute, class, component, subclass) \
1393 Fx_get_default(attribute)
1373 1394
1374#endif /* X10 */ 1395#endif /* X10 */
1375 1396
@@ -1382,7 +1403,7 @@ enum resource_types
1382/* Return the value of parameter PARAM. 1403/* Return the value of parameter PARAM.
1383 1404
1384 First search ALIST, then Vdefault_frame_alist, then the X defaults 1405 First search ALIST, then Vdefault_frame_alist, then the X defaults
1385 database, using ATTRIBUTE as the attribute name. 1406 database, using ATTRIBUTE as the attribute name and CLASS as its class.
1386 1407
1387 Convert the resource to the type specified by desired_type. 1408 Convert the resource to the type specified by desired_type.
1388 1409
@@ -1391,9 +1412,10 @@ enum resource_types
1391 and don't let it get stored in any lisp-visible variables! */ 1412 and don't let it get stored in any lisp-visible variables! */
1392 1413
1393static Lisp_Object 1414static Lisp_Object
1394x_get_arg (alist, param, attribute, type) 1415x_get_arg (alist, param, attribute, class, type)
1395 Lisp_Object alist, param; 1416 Lisp_Object alist, param;
1396 char *attribute; 1417 char *attribute;
1418 char *class;
1397 enum resource_types type; 1419 enum resource_types type;
1398{ 1420{
1399 register Lisp_Object tem; 1421 register Lisp_Object tem;
@@ -1406,7 +1428,9 @@ x_get_arg (alist, param, attribute, type)
1406 1428
1407 if (attribute) 1429 if (attribute)
1408 { 1430 {
1409 tem = Fx_get_resource (build_string (attribute), Qnil, Qnil); 1431 tem = Fx_get_resource (build_string (attribute),
1432 build_string (class),
1433 Qnil, Qnil);
1410 1434
1411 if (NILP (tem)) 1435 if (NILP (tem))
1412 return Qunbound; 1436 return Qunbound;
@@ -1447,17 +1471,18 @@ x_get_arg (alist, param, attribute, type)
1447 If that is not found either, use the value DEFLT. */ 1471 If that is not found either, use the value DEFLT. */
1448 1472
1449static Lisp_Object 1473static Lisp_Object
1450x_default_parameter (f, alist, prop, deflt, xprop, type) 1474x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
1451 struct frame *f; 1475 struct frame *f;
1452 Lisp_Object alist; 1476 Lisp_Object alist;
1453 Lisp_Object prop; 1477 Lisp_Object prop;
1454 Lisp_Object deflt; 1478 Lisp_Object deflt;
1455 char *xprop; 1479 char *xprop;
1480 char *xclass;
1456 enum resource_types type; 1481 enum resource_types type;
1457{ 1482{
1458 Lisp_Object tem; 1483 Lisp_Object tem;
1459 1484
1460 tem = x_get_arg (alist, prop, xprop, type); 1485 tem = x_get_arg (alist, prop, xprop, xclass, type);
1461 if (EQ (tem, Qunbound)) 1486 if (EQ (tem, Qunbound))
1462 tem = deflt; 1487 tem = deflt;
1463 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); 1488 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil));
@@ -1544,8 +1569,8 @@ x_figure_window_size (f, parms)
1544 f->display.x->top_pos = 1; 1569 f->display.x->top_pos = 1;
1545 f->display.x->left_pos = 1; 1570 f->display.x->left_pos = 1;
1546 1571
1547 tem0 = x_get_arg (parms, Qheight, 0, number); 1572 tem0 = x_get_arg (parms, Qheight, 0, 0, number);
1548 tem1 = x_get_arg (parms, Qwidth, 0, number); 1573 tem1 = x_get_arg (parms, Qwidth, 0, 0, number);
1549 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) 1574 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound))
1550 { 1575 {
1551 CHECK_NUMBER (tem0, 0); 1576 CHECK_NUMBER (tem0, 0);
@@ -1557,11 +1582,15 @@ x_figure_window_size (f, parms)
1557 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) 1582 else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
1558 error ("Must specify *both* height and width"); 1583 error ("Must specify *both* height and width");
1559 1584
1585 f->display.x->vertical_scrollbar_extra =
1586 (FRAME_HAS_VERTICAL_SCROLLBARS (f)
1587 ? VERTICAL_SCROLLBAR_PIXEL_WIDTH (f)
1588 : 0);
1560 f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); 1589 f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
1561 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); 1590 f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
1562 1591
1563 tem0 = x_get_arg (parms, Qtop, 0, number); 1592 tem0 = x_get_arg (parms, Qtop, 0, 0, number);
1564 tem1 = x_get_arg (parms, Qleft, 0, number); 1593 tem1 = x_get_arg (parms, Qleft, 0, 0, number);
1565 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound)) 1594 if (! EQ (tem0, Qunbound) && ! EQ (tem1, Qunbound))
1566 { 1595 {
1567 CHECK_NUMBER (tem0, 0); 1596 CHECK_NUMBER (tem0, 0);
@@ -1653,9 +1682,11 @@ x_window (f)
1653 the X server hasn't been told. */ 1682 the X server hasn't been told. */
1654 { 1683 {
1655 Lisp_Object name = f->name; 1684 Lisp_Object name = f->name;
1685 int explicit = f->explicit_name;
1656 1686
1657 f->name = Qnil; 1687 f->name = Qnil;
1658 x_implicitly_set_name (f, name, Qnil); 1688 f->explicit_name = 0;
1689 x_set_name (f, name, explicit);
1659 } 1690 }
1660 1691
1661 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), 1692 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f),
@@ -1679,8 +1710,8 @@ x_icon (f, parms)
1679 1710
1680 /* Set the position of the icon. Note that twm groups all 1711 /* Set the position of the icon. Note that twm groups all
1681 icons in an icon window. */ 1712 icons in an icon window. */
1682 icon_x = x_get_arg (parms, Qicon_left, 0, number); 1713 icon_x = x_get_arg (parms, Qicon_left, 0, 0, number);
1683 icon_y = x_get_arg (parms, Qicon_top, 0, number); 1714 icon_y = x_get_arg (parms, Qicon_top, 0, 0, number);
1684 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) 1715 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
1685 { 1716 {
1686 CHECK_NUMBER (icon_x, 0); 1717 CHECK_NUMBER (icon_x, 0);
@@ -1696,7 +1727,8 @@ x_icon (f, parms)
1696 1727
1697 /* Start up iconic or window? */ 1728 /* Start up iconic or window? */
1698 x_wm_set_window_state (f, 1729 x_wm_set_window_state (f,
1699 (EQ (x_get_arg (parms, Qiconic_startup, 0, boolean), 1730 (EQ (x_get_arg (parms, Qiconic_startup,
1731 0, 0, boolean),
1700 Qt) 1732 Qt)
1701 ? IconicState 1733 ? IconicState
1702 : NormalState)); 1734 : NormalState));
@@ -1815,13 +1847,13 @@ be shared by the new frame.")
1815 if (x_current_display == 0) 1847 if (x_current_display == 0)
1816 error ("X windows are not in use or not initialized"); 1848 error ("X windows are not in use or not initialized");
1817 1849
1818 name = x_get_arg (parms, Qname, "Title", string); 1850 name = x_get_arg (parms, Qname, "title", "Title", string);
1819 if (EQ (name, Qunbound) || NILP (name)) 1851 if (XTYPE (name) != Lisp_String
1820 name = build_string (x_id_name); 1852 && ! EQ (name, Qunbound)
1821 if (XTYPE (name) != Lisp_String) 1853 && ! NILP (name))
1822 error ("x-create-frame: name parameter must be a string"); 1854 error ("x-create-frame: name parameter must be a string");
1823 1855
1824 tem = x_get_arg (parms, Qminibuffer, 0, symbol); 1856 tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol);
1825 if (EQ (tem, Qnone) || NILP (tem)) 1857 if (EQ (tem, Qnone) || NILP (tem))
1826 f = make_frame_without_minibuffer (Qnil); 1858 f = make_frame_without_minibuffer (Qnil);
1827 else if (EQ (tem, Qonly)) 1859 else if (EQ (tem, Qonly))
@@ -1837,9 +1869,18 @@ be shared by the new frame.")
1837 /* Note that X Windows does support scrollbars. */ 1869 /* Note that X Windows does support scrollbars. */
1838 FRAME_CAN_HAVE_SCROLLBARS (f) = 1; 1870 FRAME_CAN_HAVE_SCROLLBARS (f) = 1;
1839 1871
1840 /* Set the name; the functions to which we pass f expect the 1872 /* Set the name; the functions to which we pass f expect the name to
1841 name to be set. */ 1873 be set. */
1842 f->name = name; 1874 if (EQ (name, Qunbound) || NILP (name))
1875 {
1876 f->name = build_string (x_id_name);
1877 f->explicit_name = 0;
1878 }
1879 else
1880 {
1881 f->name = name;
1882 f->explicit_name = 1;
1883 }
1843 1884
1844 XSET (frame, Lisp_Frame, f); 1885 XSET (frame, Lisp_Frame, f);
1845 f->output_method = output_x_window; 1886 f->output_method = output_x_window;
@@ -1851,27 +1892,27 @@ be shared by the new frame.")
1851 1892
1852 /* Extract the window parameters from the supplied values 1893 /* Extract the window parameters from the supplied values
1853 that are needed to determine window geometry. */ 1894 that are needed to determine window geometry. */
1854 x_default_parameter (f, parms, Qfont, 1895 x_default_parameter (f, parms, Qfont, build_string ("9x15"),
1855 build_string ("9x15"), "font", string); 1896 "font", "Font", string);
1856 x_default_parameter (f, parms, Qbackground_color, 1897 x_default_parameter (f, parms, Qborder_width, make_number (2),
1857 build_string ("white"), "background", string); 1898 "borderwidth", "BorderWidth", number);
1858 x_default_parameter (f, parms, Qborder_width, 1899 /* This defaults to 2 in order to match xterm. */
1859 make_number (2), "BorderWidth", number); 1900 x_default_parameter (f, parms, Qinternal_border_width, make_number (2),
1860 /* This defaults to 2 in order to match XTerms. */ 1901 "internalBorderWidth", "BorderWidth", number);
1861 x_default_parameter (f, parms, Qinternal_border_width, 1902 x_default_parameter (f, parms, Qvertical_scrollbars, Qt,
1862 make_number (2), "InternalBorderWidth", number); 1903 "verticalScrollbars", "Scrollbars", boolean);
1863 x_default_parameter (f, parms, Qvertical_scrollbar,
1864 Qt, "VerticalScrollbars", boolean);
1865 1904
1866 /* Also do the stuff which must be set before the window exists. */ 1905 /* Also do the stuff which must be set before the window exists. */
1867 x_default_parameter (f, parms, Qforeground_color, 1906 x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
1868 build_string ("black"), "foreground", string); 1907 "foreground", "Foreground", string);
1869 x_default_parameter (f, parms, Qmouse_color, 1908 x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
1870 build_string ("black"), "mouse", string); 1909 "background", "Background", string);
1871 x_default_parameter (f, parms, Qcursor_color, 1910 x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
1872 build_string ("black"), "cursor", string); 1911 "pointerColor", "Foreground", string);
1873 x_default_parameter (f, parms, Qborder_color, 1912 x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
1874 build_string ("black"), "border", string); 1913 "cursorColor", "Foreground", string);
1914 x_default_parameter (f, parms, Qborder_color, build_string ("black"),
1915 "borderColor", "BorderColor", string);
1875 1916
1876 f->display.x->parent_desc = ROOT_WINDOW; 1917 f->display.x->parent_desc = ROOT_WINDOW;
1877 window_prompting = x_figure_window_size (f, parms); 1918 window_prompting = x_figure_window_size (f, parms);
@@ -1882,10 +1923,13 @@ be shared by the new frame.")
1882 1923
1883 /* We need to do this after creating the X window, so that the 1924 /* We need to do this after creating the X window, so that the
1884 icon-creation functions can say whose icon they're describing. */ 1925 icon-creation functions can say whose icon they're describing. */
1885 x_default_parameter (f, parms, Qicon_type, Qnil, "IconType", symbol); 1926 x_default_parameter (f, parms, Qicon_type, Qnil,
1927 "iconType", "IconType", symbol);
1886 1928
1887 x_default_parameter (f, parms, Qauto_raise, Qnil, "AutoRaise", boolean); 1929 x_default_parameter (f, parms, Qauto_raise, Qnil,
1888 x_default_parameter (f, parms, Qauto_lower, Qnil, "AutoLower", boolean); 1930 "autoRaise", "AutoRaiseLower", boolean);
1931 x_default_parameter (f, parms, Qauto_lower, Qnil,
1932 "autoLower", "AutoRaiseLower", boolean);
1889 1933
1890 /* Dimensions, especially f->height, must be done via change_frame_size. 1934 /* Dimensions, especially f->height, must be done via change_frame_size.
1891 Change will not be effected unless different from the current 1935 Change will not be effected unless different from the current
@@ -1898,11 +1942,11 @@ be shared by the new frame.")
1898 x_wm_set_size_hint (f, window_prompting); 1942 x_wm_set_size_hint (f, window_prompting);
1899 UNBLOCK_INPUT; 1943 UNBLOCK_INPUT;
1900 1944
1901 tem = x_get_arg (parms, Qunsplittable, 0, boolean); 1945 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
1902 f->no_split = minibuffer_only || EQ (tem, Qt); 1946 f->no_split = minibuffer_only || EQ (tem, Qt);
1903 1947
1904 /* Make the window appear on the frame and enable display. */ 1948 /* Make the window appear on the frame and enable display. */
1905 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, boolean), Qt)) 1949 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt))
1906 x_make_frame_visible (f); 1950 x_make_frame_visible (f);
1907 1951
1908 return frame; 1952 return frame;
@@ -1923,7 +1967,7 @@ be shared by the new frame.")
1923 1967
1924 name = Fassq (Qname, parms); 1968 name = Fassq (Qname, parms);
1925 1969
1926 tem = x_get_arg (parms, Qminibuffer, 0, symbol); 1970 tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol);
1927 if (EQ (tem, Qnone)) 1971 if (EQ (tem, Qnone))
1928 f = make_frame_without_minibuffer (Qnil); 1972 f = make_frame_without_minibuffer (Qnil);
1929 else if (EQ (tem, Qonly)) 1973 else if (EQ (tem, Qonly))
@@ -1960,34 +2004,34 @@ be shared by the new frame.")
1960 /* Extract some window parameters from the supplied values. 2004 /* Extract some window parameters from the supplied values.
1961 These are the parameters that affect window geometry. */ 2005 These are the parameters that affect window geometry. */
1962 2006
1963 tem = x_get_arg (parms, Qfont, "BodyFont", string); 2007 tem = x_get_arg (parms, Qfont, "BodyFont", 0, string);
1964 if (EQ (tem, Qunbound)) 2008 if (EQ (tem, Qunbound))
1965 tem = build_string ("9x15"); 2009 tem = build_string ("9x15");
1966 x_set_font (f, tem, Qnil); 2010 x_set_font (f, tem, Qnil);
1967 x_default_parameter (f, parms, Qborder_color, 2011 x_default_parameter (f, parms, Qborder_color,
1968 build_string ("black"), "Border", string); 2012 build_string ("black"), "Border", 0, string);
1969 x_default_parameter (f, parms, Qbackground_color, 2013 x_default_parameter (f, parms, Qbackground_color,
1970 build_string ("white"), "Background", string); 2014 build_string ("white"), "Background", 0, string);
1971 x_default_parameter (f, parms, Qforeground_color, 2015 x_default_parameter (f, parms, Qforeground_color,
1972 build_string ("black"), "Foreground", string); 2016 build_string ("black"), "Foreground", 0, string);
1973 x_default_parameter (f, parms, Qmouse_color, 2017 x_default_parameter (f, parms, Qmouse_color,
1974 build_string ("black"), "Mouse", string); 2018 build_string ("black"), "Mouse", 0, string);
1975 x_default_parameter (f, parms, Qcursor_color, 2019 x_default_parameter (f, parms, Qcursor_color,
1976 build_string ("black"), "Cursor", string); 2020 build_string ("black"), "Cursor", 0, string);
1977 x_default_parameter (f, parms, Qborder_width, 2021 x_default_parameter (f, parms, Qborder_width,
1978 make_number (2), "BorderWidth", number); 2022 make_number (2), "BorderWidth", 0, number);
1979 x_default_parameter (f, parms, Qinternal_border_width, 2023 x_default_parameter (f, parms, Qinternal_border_width,
1980 make_number (4), "InternalBorderWidth", number); 2024 make_number (4), "InternalBorderWidth", 0, number);
1981 x_default_parameter (f, parms, Qauto_raise, 2025 x_default_parameter (f, parms, Qauto_raise,
1982 Qnil, "AutoRaise", boolean); 2026 Qnil, "AutoRaise", 0, boolean);
1983 2027
1984 hscroll = EQ (x_get_arg (parms, Qhorizontal_scroll_bar, 0, boolean), Qt); 2028 hscroll = EQ (x_get_arg (parms, Qhorizontal_scroll_bar, 0, 0, boolean), Qt);
1985 vscroll = EQ (x_get_arg (parms, Qvertical_scroll_bar, 0, boolean), Qt); 2029 vscroll = EQ (x_get_arg (parms, Qvertical_scroll_bar, 0, 0, boolean), Qt);
1986 2030
1987 if (f->display.x->internal_border_width < 0) 2031 if (f->display.x->internal_border_width < 0)
1988 f->display.x->internal_border_width = 0; 2032 f->display.x->internal_border_width = 0;
1989 2033
1990 tem = x_get_arg (parms, Qwindow_id, 0, number); 2034 tem = x_get_arg (parms, Qwindow_id, 0, 0, number);
1991 if (!EQ (tem, Qunbound)) 2035 if (!EQ (tem, Qunbound))
1992 { 2036 {
1993 WINDOWINFO_TYPE wininfo; 2037 WINDOWINFO_TYPE wininfo;
@@ -2003,10 +2047,8 @@ be shared by the new frame.")
2003 free (children); 2047 free (children);
2004 UNBLOCK_INPUT; 2048 UNBLOCK_INPUT;
2005 2049
2006 height = (wininfo.height - 2 * f->display.x->internal_border_width) 2050 height = PIXEL_TO_CHAR_HEIGHT (f, wininfo.height);
2007 / FONT_HEIGHT (f->display.x->font); 2051 width = PIXEL_TO_CHAR_WIDTH (f, wininfo.width);
2008 width = (wininfo.width - 2 * f->display.x->internal_border_width)
2009 / FONT_WIDTH (f->display.x->font);
2010 f->display.x->left_pos = wininfo.x; 2052 f->display.x->left_pos = wininfo.x;
2011 f->display.x->top_pos = wininfo.y; 2053 f->display.x->top_pos = wininfo.y;
2012 FRAME_SET_VISIBILITY (f, wininfo.mapped != 0); 2054 FRAME_SET_VISIBILITY (f, wininfo.mapped != 0);
@@ -2015,29 +2057,29 @@ be shared by the new frame.")
2015 } 2057 }
2016 else 2058 else
2017 { 2059 {
2018 tem = x_get_arg (parms, Qparent_id, 0, number); 2060 tem = x_get_arg (parms, Qparent_id, 0, 0, number);
2019 if (!EQ (tem, Qunbound)) 2061 if (!EQ (tem, Qunbound))
2020 { 2062 {
2021 CHECK_NUMBER (tem, 0); 2063 CHECK_NUMBER (tem, 0);
2022 parent = (Window) XINT (tem); 2064 parent = (Window) XINT (tem);
2023 } 2065 }
2024 f->display.x->parent_desc = parent; 2066 f->display.x->parent_desc = parent;
2025 tem = x_get_arg (parms, Qheight, 0, number); 2067 tem = x_get_arg (parms, Qheight, 0, 0, number);
2026 if (EQ (tem, Qunbound)) 2068 if (EQ (tem, Qunbound))
2027 { 2069 {
2028 tem = x_get_arg (parms, Qwidth, 0, number); 2070 tem = x_get_arg (parms, Qwidth, 0, 0, number);
2029 if (EQ (tem, Qunbound)) 2071 if (EQ (tem, Qunbound))
2030 { 2072 {
2031 tem = x_get_arg (parms, Qtop, 0, number); 2073 tem = x_get_arg (parms, Qtop, 0, 0, number);
2032 if (EQ (tem, Qunbound)) 2074 if (EQ (tem, Qunbound))
2033 tem = x_get_arg (parms, Qleft, 0, number); 2075 tem = x_get_arg (parms, Qleft, 0, 0, number);
2034 } 2076 }
2035 } 2077 }
2036 /* Now TEM is Qunbound if no edge or size was specified. 2078 /* Now TEM is Qunbound if no edge or size was specified.
2037 In that case, we must do rubber-banding. */ 2079 In that case, we must do rubber-banding. */
2038 if (EQ (tem, Qunbound)) 2080 if (EQ (tem, Qunbound))
2039 { 2081 {
2040 tem = x_get_arg (parms, Qgeometry, 0, number); 2082 tem = x_get_arg (parms, Qgeometry, 0, 0, number);
2041 x_rubber_band (f, 2083 x_rubber_band (f,
2042 &f->display.x->left_pos, &f->display.x->top_pos, 2084 &f->display.x->left_pos, &f->display.x->top_pos,
2043 &width, &height, 2085 &width, &height,
@@ -2050,37 +2092,33 @@ be shared by the new frame.")
2050 { 2092 {
2051 /* Here if at least one edge or size was specified. 2093 /* Here if at least one edge or size was specified.
2052 Demand that they all were specified, and use them. */ 2094 Demand that they all were specified, and use them. */
2053 tem = x_get_arg (parms, Qheight, 0, number); 2095 tem = x_get_arg (parms, Qheight, 0, 0, number);
2054 if (EQ (tem, Qunbound)) 2096 if (EQ (tem, Qunbound))
2055 error ("Height not specified"); 2097 error ("Height not specified");
2056 CHECK_NUMBER (tem, 0); 2098 CHECK_NUMBER (tem, 0);
2057 height = XINT (tem); 2099 height = XINT (tem);
2058 2100
2059 tem = x_get_arg (parms, Qwidth, 0, number); 2101 tem = x_get_arg (parms, Qwidth, 0, 0, number);
2060 if (EQ (tem, Qunbound)) 2102 if (EQ (tem, Qunbound))
2061 error ("Width not specified"); 2103 error ("Width not specified");
2062 CHECK_NUMBER (tem, 0); 2104 CHECK_NUMBER (tem, 0);
2063 width = XINT (tem); 2105 width = XINT (tem);
2064 2106
2065 tem = x_get_arg (parms, Qtop, 0, number); 2107 tem = x_get_arg (parms, Qtop, 0, 0, number);
2066 if (EQ (tem, Qunbound)) 2108 if (EQ (tem, Qunbound))
2067 error ("Top position not specified"); 2109 error ("Top position not specified");
2068 CHECK_NUMBER (tem, 0); 2110 CHECK_NUMBER (tem, 0);
2069 f->display.x->left_pos = XINT (tem); 2111 f->display.x->left_pos = XINT (tem);
2070 2112
2071 tem = x_get_arg (parms, Qleft, 0, number); 2113 tem = x_get_arg (parms, Qleft, 0, 0, number);
2072 if (EQ (tem, Qunbound)) 2114 if (EQ (tem, Qunbound))
2073 error ("Left position not specified"); 2115 error ("Left position not specified");
2074 CHECK_NUMBER (tem, 0); 2116 CHECK_NUMBER (tem, 0);
2075 f->display.x->top_pos = XINT (tem); 2117 f->display.x->top_pos = XINT (tem);
2076 } 2118 }
2077 2119
2078 pixelwidth = (width * FONT_WIDTH (f->display.x->font) 2120 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, width);
2079 + 2 * f->display.x->internal_border_width 2121 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, height);
2080 + (!NILP (vscroll) ? VSCROLL_WIDTH : 0));
2081 pixelheight = (height * FONT_HEIGHT (f->display.x->font)
2082 + 2 * f->display.x->internal_border_width
2083 + (!NILP (hscroll) ? HSCROLL_HEIGHT : 0));
2084 2122
2085 BLOCK_INPUT; 2123 BLOCK_INPUT;
2086 FRAME_X_WINDOW (f) 2124 FRAME_X_WINDOW (f)
@@ -2108,16 +2146,16 @@ be shared by the new frame.")
2108 2146
2109 /* Now override the defaults with all the rest of the specified 2147 /* Now override the defaults with all the rest of the specified
2110 parms. */ 2148 parms. */
2111 tem = x_get_arg (parms, Qunsplittable, 0, boolean); 2149 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
2112 f->no_split = minibuffer_only || EQ (tem, Qt); 2150 f->no_split = minibuffer_only || EQ (tem, Qt);
2113 2151
2114 /* Do not create an icon window if the caller says not to */ 2152 /* Do not create an icon window if the caller says not to */
2115 if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, boolean), Qt) 2153 if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, 0, boolean), Qt)
2116 || f->display.x->parent_desc != ROOT_WINDOW) 2154 || f->display.x->parent_desc != ROOT_WINDOW)
2117 { 2155 {
2118 x_text_icon (f, iconidentity); 2156 x_text_icon (f, iconidentity);
2119 x_default_parameter (f, parms, Qicon_type, Qnil, 2157 x_default_parameter (f, parms, Qicon_type, Qnil,
2120 "BitmapIcon", symbol); 2158 "BitmapIcon", 0, symbol);
2121 } 2159 }
2122 2160
2123 /* Tell the X server the previously set values of the 2161 /* Tell the X server the previously set values of the
@@ -2137,9 +2175,9 @@ be shared by the new frame.")
2137 2175
2138 /* Make the window appear on the frame and enable display. */ 2176 /* Make the window appear on the frame and enable display. */
2139 2177
2140 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, boolean), Qt)) 2178 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt))
2141 x_make_window_visible (f); 2179 x_make_window_visible (f);
2142 FRAME_GARBAGED (f); 2180 SET_FRAME_GARBAGED (f);
2143 2181
2144 return frame; 2182 return frame;
2145#endif /* X10 */ 2183#endif /* X10 */
@@ -3782,6 +3820,8 @@ syms_of_xfns ()
3782 staticpro (&Qtop); 3820 staticpro (&Qtop);
3783 Qundefined_color = intern ("undefined-color"); 3821 Qundefined_color = intern ("undefined-color");
3784 staticpro (&Qundefined_color); 3822 staticpro (&Qundefined_color);
3823 Qvertical_scrollbars = intern ("vertical-scrollbars");
3824 staticpro (&Qvertical_scrollbars);
3785 Qwindow_id = intern ("window-id"); 3825 Qwindow_id = intern ("window-id");
3786 staticpro (&Qwindow_id); 3826 staticpro (&Qwindow_id);
3787 Qx_frame_parameter = intern ("x-frame-parameter"); 3827 Qx_frame_parameter = intern ("x-frame-parameter");