bug-mit-scheme
[Top][All Lists]
Advanced

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

Re: [Bug-mit-scheme] x11 graphics doesn't quite work.


From: Matt Birkholz
Subject: Re: [Bug-mit-scheme] x11 graphics doesn't quite work.
Date: Wed, 23 Jan 2019 22:49:25 -0700
User-agent: Evolution 3.30.1-1build1

Hang on. I'm having trouble with graphics-set-clip-rectangle.

I can break on entry to the trampoline, Scm_x_graphics_set_clip_rectangle, and see 4 nice flonums on the stack, but when I step into x_graphics_set_clip_rectangle I find only half the arguments are correct. Somehow they do not make it through the shim.

So you might not want to pull the trigger on 10.1.5 just yet. I'm still trying to figure out how assigning a double to a float can go so wrong. Any clues will be much appreciated!

SCM
Scm_x_graphics_set_clip_rectangle (void)
{
  /* Declare. */
  struct xwindow * xw;
  float x_left;
  float y_bottom;
  float x_right;
  float y_top;

  /* Init. */
  check_number_of_args (6);
  xw = (struct xwindow *) arg_pointer (2);
  x_left = arg_double (3);
  y_bottom = arg_double (4);
  x_right = arg_double (5);
  y_top = arg_double (6);

  /* Call. */
  callout_seal (&Scm_continue_x_graphics_set_clip_rectangle);
  x_graphics_set_clip_rectangle (xw, x_left, y_bottom, x_right, y_top);

  /* Save. */
  callout_unseal (&Scm_continue_x_graphics_set_clip_rectangle);

  return callout_continue (&Scm_continue_x_graphics_set_clip_rectangle);
}

On Wed, 2019-01-23 at 22:08 -0700, Matt Birkholz wrote:
I have 5 more commits, 6 total.

cc175b7ef x11: Fix x-graphics-vdc-extent and x-graphics-set-clip-rectangle.

This is the old patch from a couple days ago.

63d7afa52 x11: Rename device type to "x".

This just gets the manual and new device type into sync.  I did not implement caseless name comparison (to recognize 'X) nor multiple names/devices (to match 'x11).

b0ea100a3 x11: Link to deprecated (runtime x-graphics) bindings when loaded.

This gets the global bindings assigned after (load-option 'x11).  When the deprecated package finally disappears, the x11 option can export its own globals (or become a "library" to be imported?).

51fecb2c8 runtime.pkg: Trim old, unnecessary package exports.
69096876b x11: Punt import-x11.
e847e7db3 x11 version 1.3

These are just cleanups and a version increment and not really necessary for the release-10 branch.

On Sun, 2019-01-20 at 17:42 -0800, Chris Hanson wrote:
Just let me know what needs to be cherry-picked and I'll pull it in and generate another release.

On Sun, Jan 20, 2019 at 11:51 AM Matt Birkholz <address@hidden> wrote:
x-graphics-set-clip-rectangle now accepts floats.  x-graphics-vdc-
extent (graphics-coordinate-limits) should be fixed too.

I'm working on eliminating the need for import-x11.  That and the name
change (X to X11) are leftovers from when x-graphics and x11-graphics
were supposed to co-exist.

Chris: I can backport my patches to the release-10 branch if that would
be helpful.

On Sat, 2019-01-19 at 21:26 -0500, Gerald Jay Sussman wrote:
> This matters to me, since I use MIT/GNU Scheme for teaching.
> Here is a transcript of bad behavior.  I installed the 10.1.4
> system on my Ubuntu 16.04 laptop using the standard instructions
> published on the GNU web page.  I am running under EMACS.
>
> The first thing to notice is that I had to load the x11-screen
> option.
> This is OK, but even after that, I had to (import-x11), which is not
> in
> the manual.  That is an odd thing to need, given that the x11 type is
> specified in the reference manual.
>
> But, accepting that, I still had bad results.  Apparently
> graphics-set-clip-rectangle and graphics-coordinate-limits both lose
> badly.  Please fix x11 graphics.  I need it!
>
> -------------------------------------------------------
>
> MIT/GNU Scheme running under GNU/Linux
>
> Copyright (C) 2019 Massachusetts Institute of Technology
> This is free software; see the source for copying conditions. There
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> Image saved on Sunday January 6, 2019 at 6:10:24 PM
>   Release 10.1.4    || Microcode 15.3 || Runtime 15.7 || SF 4.41
>   LIAR/x86-64 4.118
>
> (enumerate-graphics-types)
> ;Value: ()
>
> (load-option 'x11-screen)
> ;Loading "make.scm"...
> ;  Loading "make.scm"...
> ;    Loading "x11-unx.pkd"... done
> ;;; ... Many files loaded!
> ;  Loading "x11-key.com"... done
> ;  Loading "x11-command.com"... done
> ;... done
> ;Value: x11-screen
>
> (enumerate-graphics-types)
> ;Value: (#[graphics-type 12 x11])
>
> (define foo
>   (make-window/X11 400 400 0 0))
> ;Unbound variable: make-window/x11
>
> (import-x11)
> ;Unspecified return value
>
> (define foo
>   (make-graphics-device 'x11
>                         #f
>                         (x-geometry-string 0 0 400 400)
>                         #t))
> ;Unspecified return value
>
> (x-graphics/disable-keyboard-focus foo)
> ;Unspecified return value
>
> (x-graphics/set-input-hint foo #f)
> ;Unspecified return value
>
> (x-graphics/map-window foo)
> ;Unspecified return value
>
> (x-graphics/flush foo)
> ;Unspecified return value
>
> (graphics-operation foo 'set-background-color "black")
> ;Unspecified return value
>
> (graphics-operation foo 'set-foreground-color "green")
> ;Unspecified return value
>
> (graphics-clear foo)
> ;Unspecified return value
>
> (graphics-operation foo 'set-mouse-color "orange")
> ;Unspecified return value
>
> (graphics-clear foo)
> ;Unspecified return value
>
> (graphics-operation foo 'set-window-name "foosh")
> ;Unspecified return value
>
> (graphics-set-coordinate-limits foo 0 (- (- 400 1)) (- 400 1) 0)
> ;Unspecified return value
>
> (call-with-values
>     (lambda ()
>       (graphics-device-coordinate-limits foo))
>   list)
> ;Value: (0 399 399 0)
>
> (graphics-draw-point foo 178 -193)
> ;Unspecified return value
>
> (graphics-set-clip-rectangle foo 0.0 0.0 1.0 1.0)
> ;The object 0., passed as the third argument to c-call, is not the
> ;correct type.
> ;Quit!
>
> (call-with-values (lambda () (graphics-coordinate-limits foo))
>   list)
> ;The procedure #[compiled-procedure 13 ("x11-graphics" #x2) #x1a
> ;#x36528da] has been called with 1 argument; it requires exactly 2
> ;arguments.
>
> _______________________________________________
> Bug-MIT-Scheme mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-mit-scheme


_______________________________________________
Bug-MIT-Scheme mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-mit-scheme
_______________________________________________
Bug-MIT-Scheme mailing list
address@hidden

https://lists.gnu.org/mailman/listinfo/bug-mit-scheme


reply via email to

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