diff options
| author | Jim Blandy | 1992-10-31 05:41:49 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-10-31 05:41:49 +0000 |
| commit | a6605e5ccaf78d2bd65d7bb5528a06d5e3dfc1db (patch) | |
| tree | 1bbf375b6d4f3129583eddd2960d76cdc9956afc /src | |
| parent | ded34426d50233ec8021adec03a893d33452dc51 (diff) | |
| download | emacs-a6605e5ccaf78d2bd65d7bb5528a06d5e3dfc1db.tar.gz emacs-a6605e5ccaf78d2bd65d7bb5528a06d5e3dfc1db.zip | |
* xfns.c (x_decode_color, Fx_color_display_p): x_screen_planes is
an int, not a Lisp_Object.
(x_set_mouse_color): Give separate error messages for the
different cursors we try to set.
(Fx_geometry): Declare STRING to be a Lisp_Object.
(Fx_create_frame): No need to use XSET to assign NAME to f->name;
they're both Lisp_Objects.
(adjust_scrollbars): Use XINT to access w->hscroll.
(Fx_open_connection): x_screen_count, x_release, x_screen_height,
x_screen_height_mm, x_screen_width, x_screen_width_mm,
x_save_under, and x_screen_planes are integers, not Lisp_Objects.
(syms_of_xfns): x_mouse_x, x_mouse_y, and mouse_buffer_offset are
integers, not Lisp_Objects.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/xfns.c b/src/xfns.c index cca8ac8449b..d4588266b29 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -602,7 +602,7 @@ x_decode_color (arg, def) | |||
| 602 | return WHITE_PIX_DEFAULT; | 602 | return WHITE_PIX_DEFAULT; |
| 603 | 603 | ||
| 604 | #ifdef HAVE_X11 | 604 | #ifdef HAVE_X11 |
| 605 | if (XFASTINT (x_screen_planes) == 1) | 605 | if (x_screen_planes == 1) |
| 606 | return def; | 606 | return def; |
| 607 | #else | 607 | #else |
| 608 | if (DISPLAY_CELLS == 1) | 608 | if (DISPLAY_CELLS == 1) |
| @@ -886,6 +886,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 886 | } | 886 | } |
| 887 | else | 887 | else |
| 888 | cursor = XCreateFontCursor (x_current_display, XC_xterm); | 888 | cursor = XCreateFontCursor (x_current_display, XC_xterm); |
| 889 | x_check_errors ("bad text pointer cursor: %s"); | ||
| 889 | 890 | ||
| 890 | if (!EQ (Qnil, Vx_nontext_pointer_shape)) | 891 | if (!EQ (Qnil, Vx_nontext_pointer_shape)) |
| 891 | { | 892 | { |
| @@ -895,6 +896,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 895 | } | 896 | } |
| 896 | else | 897 | else |
| 897 | nontext_cursor = XCreateFontCursor (x_current_display, XC_left_ptr); | 898 | nontext_cursor = XCreateFontCursor (x_current_display, XC_left_ptr); |
| 899 | x_check_errors ("bad nontext pointer cursor: %s"); | ||
| 898 | 900 | ||
| 899 | if (!EQ (Qnil, Vx_mode_pointer_shape)) | 901 | if (!EQ (Qnil, Vx_mode_pointer_shape)) |
| 900 | { | 902 | { |
| @@ -1709,6 +1711,7 @@ DEFUN ("x-geometry", Fx_geometry, Sx_geometry, 1, 1, 0, | |||
| 1709 | "Parse an X-style geometry string STRING.\n\ | 1711 | "Parse an X-style geometry string STRING.\n\ |
| 1710 | Returns an alist of the form ((top . TOP), (left . LEFT) ... ).") | 1712 | Returns an alist of the form ((top . TOP), (left . LEFT) ... ).") |
| 1711 | (string) | 1713 | (string) |
| 1714 | Lisp_Object string; | ||
| 1712 | { | 1715 | { |
| 1713 | int geometry, x, y; | 1716 | int geometry, x, y; |
| 1714 | unsigned int width, height; | 1717 | unsigned int width, height; |
| @@ -2069,7 +2072,7 @@ be shared by the new frame.") | |||
| 2069 | 2072 | ||
| 2070 | /* Set the name; the functions to which we pass f expect the | 2073 | /* Set the name; the functions to which we pass f expect the |
| 2071 | name to be set. */ | 2074 | name to be set. */ |
| 2072 | XSET (f->name, Lisp_String, name); | 2075 | f->name = name; |
| 2073 | 2076 | ||
| 2074 | XSET (frame, Lisp_Frame, f); | 2077 | XSET (frame, Lisp_Frame, f); |
| 2075 | f->output_method = output_x_window; | 2078 | f->output_method = output_x_window; |
| @@ -2977,10 +2980,10 @@ adjust_scrollbars (f) | |||
| 2977 | - 2 * (f->display.x->h_scrollbar_height); | 2980 | - 2 * (f->display.x->h_scrollbar_height); |
| 2978 | 2981 | ||
| 2979 | /* Starting position for horizontal slider */ | 2982 | /* Starting position for horizontal slider */ |
| 2980 | if (! w->hscroll) | 2983 | if (! XINT (w->hscroll)) |
| 2981 | pos = 0; | 2984 | pos = 0; |
| 2982 | else | 2985 | else |
| 2983 | pos = (w->hscroll * length) / (w->hscroll + f->width); | 2986 | pos = (XINT (w->hscroll) * length) / (XINT (w->hscroll) + f->width); |
| 2984 | pos = max (0, pos); | 2987 | pos = max (0, pos); |
| 2985 | pos = min (pos, length - 2); | 2988 | pos = min (pos, length - 2); |
| 2986 | 2989 | ||
| @@ -3084,7 +3087,7 @@ DEFUN ("x-color-display-p", Fx_color_display_p, Sx_color_display_p, 0, 0, 0, | |||
| 3084 | "Return t if the X display used currently supports color.") | 3087 | "Return t if the X display used currently supports color.") |
| 3085 | () | 3088 | () |
| 3086 | { | 3089 | { |
| 3087 | if (XINT (x_screen_planes) <= 2) | 3090 | if (x_screen_planes <= 2) |
| 3088 | return Qnil; | 3091 | return Qnil; |
| 3089 | 3092 | ||
| 3090 | switch (screen_visual->class) | 3093 | switch (screen_visual->class) |
| @@ -4408,14 +4411,14 @@ arg XRM_STRING is a string of resources in xrdb format.") | |||
| 4408 | 4411 | ||
| 4409 | x_screen = DefaultScreenOfDisplay (x_current_display); | 4412 | x_screen = DefaultScreenOfDisplay (x_current_display); |
| 4410 | 4413 | ||
| 4411 | x_screen_count = make_number (ScreenCount (x_current_display)); | 4414 | x_screen_count = ScreenCount (x_current_display); |
| 4412 | Vx_vendor = build_string (ServerVendor (x_current_display)); | 4415 | Vx_vendor = build_string (ServerVendor (x_current_display)); |
| 4413 | x_release = make_number (VendorRelease (x_current_display)); | 4416 | x_release = VendorRelease (x_current_display); |
| 4414 | 4417 | ||
| 4415 | x_screen_height = make_number (HeightOfScreen (x_screen)); | 4418 | x_screen_height = HeightOfScreen (x_screen); |
| 4416 | x_screen_height_mm = make_number (HeightMMOfScreen (x_screen)); | 4419 | x_screen_height_mm = HeightMMOfScreen (x_screen); |
| 4417 | x_screen_width = make_number (WidthOfScreen (x_screen)); | 4420 | x_screen_width = WidthOfScreen (x_screen); |
| 4418 | x_screen_width_mm = make_number (WidthMMOfScreen (x_screen)); | 4421 | x_screen_width_mm = WidthMMOfScreen (x_screen); |
| 4419 | 4422 | ||
| 4420 | switch (DoesBackingStore (x_screen)) | 4423 | switch (DoesBackingStore (x_screen)) |
| 4421 | { | 4424 | { |
| @@ -4437,12 +4440,12 @@ arg XRM_STRING is a string of resources in xrdb format.") | |||
| 4437 | } | 4440 | } |
| 4438 | 4441 | ||
| 4439 | if (DoesSaveUnders (x_screen) == True) | 4442 | if (DoesSaveUnders (x_screen) == True) |
| 4440 | x_save_under = Qt; | 4443 | x_save_under = 1; |
| 4441 | else | 4444 | else |
| 4442 | x_save_under = Qnil; | 4445 | x_save_under = 0; |
| 4443 | 4446 | ||
| 4444 | screen_visual = select_visual (x_screen, &n_planes); | 4447 | screen_visual = select_visual (x_screen, &n_planes); |
| 4445 | x_screen_planes = make_number (n_planes); | 4448 | x_screen_planes = n_planes; |
| 4446 | Vx_screen_visual = intern (x_visual_strings [screen_visual->class]); | 4449 | Vx_screen_visual = intern (x_visual_strings [screen_visual->class]); |
| 4447 | 4450 | ||
| 4448 | /* X Atoms used by emacs. */ | 4451 | /* X Atoms used by emacs. */ |
| @@ -4599,15 +4602,15 @@ syms_of_xfns () | |||
| 4599 | 4602 | ||
| 4600 | DEFVAR_INT ("mouse-x-position", &x_mouse_x, | 4603 | DEFVAR_INT ("mouse-x-position", &x_mouse_x, |
| 4601 | "The X coordinate of the mouse position, in characters."); | 4604 | "The X coordinate of the mouse position, in characters."); |
| 4602 | x_mouse_x = Qnil; | 4605 | x_mouse_x = 0; |
| 4603 | 4606 | ||
| 4604 | DEFVAR_INT ("mouse-y-position", &x_mouse_y, | 4607 | DEFVAR_INT ("mouse-y-position", &x_mouse_y, |
| 4605 | "The Y coordinate of the mouse position, in characters."); | 4608 | "The Y coordinate of the mouse position, in characters."); |
| 4606 | x_mouse_y = Qnil; | 4609 | x_mouse_y = 0; |
| 4607 | 4610 | ||
| 4608 | DEFVAR_INT ("mouse-buffer-offset", &mouse_buffer_offset, | 4611 | DEFVAR_INT ("mouse-buffer-offset", &mouse_buffer_offset, |
| 4609 | "The buffer offset of the character under the pointer."); | 4612 | "The buffer offset of the character under the pointer."); |
| 4610 | mouse_buffer_offset = Qnil; | 4613 | mouse_buffer_offset = 0; |
| 4611 | 4614 | ||
| 4612 | DEFVAR_INT ("x-pointer-shape", &Vx_pointer_shape, | 4615 | DEFVAR_INT ("x-pointer-shape", &Vx_pointer_shape, |
| 4613 | "The shape of the pointer when over text."); | 4616 | "The shape of the pointer when over text."); |