Skip to content

Commit

Permalink
Remove end-of-line whitespace in all .dylan files (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgay authored Feb 2, 2024
2 parents 573be03 + bb12067 commit 87533c5
Show file tree
Hide file tree
Showing 1,227 changed files with 11,032 additions and 11,033 deletions.
30 changes: 15 additions & 15 deletions sources/app/flying-squares/duim-gl.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND

define open abstract class <gl-pane> (<drawing-pane>)
define open abstract class <gl-pane> (<drawing-pane>)
slot pane-gl-initialized? :: <boolean> = #f;
slot pane-gl-context = #f;
end class;

define open generic handle-initialize-scene
define open generic handle-initialize-scene
(pane :: <gl-pane>, medium :: <medium>) => ();
define open generic handle-repaint-scene
define open generic handle-repaint-scene
(pane :: <gl-pane>, medium :: <medium>) => ();

define method handle-initialize-scene
(pane :: <gl-pane>, medium :: <medium>) => ()
define method handle-initialize-scene
(pane :: <gl-pane>, medium :: <medium>) => ()
end method;

define method handle-repaint-scene
(pane :: <gl-pane>, medium :: <medium>) => ()
define method handle-repaint-scene
(pane :: <gl-pane>, medium :: <medium>) => ()
end method;

define method handle-repaint
Expand All @@ -36,7 +36,7 @@ define method handle-repaint
pane-gl-context(pane) := ghRC;
wglMakeCurrent(dc, ghRC);
handle-initialize-scene(pane, medium);
pane-gl-initialized?(pane) := #t;
pane-gl-initialized?(pane) := #t;
end;
wglMakeCurrent(dc, pane-gl-context(pane));
handle-repaint-scene(pane, medium);
Expand All @@ -60,15 +60,15 @@ define method setup-pixel-format (hdc :: <HDC>)
ppfd.nVersion-value := 1;
ppfd.dwFlags-value := logior($PFD-DRAW-TO-WINDOW, $PFD-SUPPORT-OPENGL,
$PFD-DOUBLEBUFFER);
ppfd.dwLayerMask-value := $PFD-MAIN-PLANE;
ppfd.dwLayerMask-value := $PFD-MAIN-PLANE;
// TODO: This stuff needs to be parameterisable when making GL panes...
ppfd.iPixelType-value := $PFD-TYPE-RGBA;
// ppfd.iPixelType-value := $PFD-TYPE-COLORINDEX;
ppfd.cColorBits-value := 8;
ppfd.cDepthBits-value := 16;
ppfd.cAccumBits-value := 0;
ppfd.cStencilBits-value := 0;
let pixelformat = ChoosePixelFormat(hdc, ppfd);
// ppfd.iPixelType-value := $PFD-TYPE-COLORINDEX;
ppfd.cColorBits-value := 8;
ppfd.cDepthBits-value := 16;
ppfd.cAccumBits-value := 0;
ppfd.cStencilBits-value := 0;
let pixelformat = ChoosePixelFormat(hdc, ppfd);
SetPixelFormat(hdc, pixelformat, ppfd);
end;
end method;
30 changes: 15 additions & 15 deletions sources/app/flying-squares/flying-squares.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ define constant $gray-specular = make-v4(0.2, 0.2, 0.2, 0.5);
// define constant $blue-diffuse = make-v4(0.0, 0.0, 1.0, 1.0);

define constant *colors*
= vector($red-specular, $green-specular, $purple-specular,
= vector($red-specular, $green-specular, $purple-specular,
$orange-specular, $yellow-specular);

define variable *angle* :: <single-float> = 90.0;
Expand All @@ -178,15 +178,15 @@ define variable *squares* :: <stretchy-object-vector> = make(<stretchy-vector>);
define sealed class <square> (<object>)
constant slot r :: <v3>, init-function: method () make-v3(0.0, 0.0, 0.0) end;
constant slot p :: <v3>, init-function: method () make-v3(0.0, 0.0, 0.0) end;
constant slot r0 :: <simple-object-vector>,
init-function:
method ()
make(<simple-object-vector>, size: $number-rows * $number-columns)
constant slot r0 :: <simple-object-vector>,
init-function:
method ()
make(<simple-object-vector>, size: $number-rows * $number-columns)
end;
slot c;
end class;
define method initialize (s :: <square>, #key i, j, #all-keys)

define method initialize (s :: <square>, #key i, j, #all-keys)
s.r.x := (i - $number-columns / 2.0) * $sw + rnd(-$sw / 4.0, $sw / 4.0);
s.r.y := (j - $number-rows / 2.0) * $sh + rnd(-$sh / 4.0, $sh / 4.0);
s.r.z := rnd(0.25, 0.50);
Expand Down Expand Up @@ -239,7 +239,7 @@ define function initialize-grid () => ()
j :: <integer> from 0)
for (si :: <square> in *squares*)
if (si ~== sj)
si.r0[j] := distance*(si.r.x * $sw, si.r.y * $sh, 0.0,
si.r0[j] := distance*(si.r.x * $sw, si.r.y * $sh, 0.0,
sj.r.x * $sw, sj.r.y * $sh, 0.0);
end if;
end for;
Expand All @@ -264,7 +264,7 @@ define function move-squares () => ()
for (sj :: <square> in *squares*,
r0ij in si.r0)
if (sj ~== si)
let dj :: <single-float>
let dj :: <single-float>
= unit-vector-and-distance(rh, si.r, sj.r);
vadd(dp, vmul-s(rh, -$kl * (dj - r0ij)));
end if;
Expand Down Expand Up @@ -292,11 +292,11 @@ define variable *latitude* :: <double-float> = 60.0d0;
define variable *latitude-bump* :: <double-float> = 2.5d0;
define variable *longitude* :: <double-float> = 30.0d0;
define variable *radius* :: <double-float> = $near-plane + 1.5d0;

define constant $logo-plane = 1;
define constant $solid-cylinder = 2;

define class <flying-squares-pane> (<gl-pane>)
define class <flying-squares-pane> (<gl-pane>)
end class;

define function build-logo-plane () => ()
Expand Down Expand Up @@ -378,7 +378,7 @@ define function update-flying-squares (pane :: <flying-squares-pane>) => ()
end
end function update-flying-squares;

define method handle-initialize-scene
define method handle-initialize-scene
(pane :: <flying-squares-pane>, medium :: <medium>) => ()
next-method();
let ambient-properties = make-v4(0.7, 0.7, 0.7, 1.0);
Expand All @@ -404,7 +404,7 @@ define method handle-initialize-scene
function: method ()
let frame = sheet-frame(pane);
while(#t)
sleep(1.0 / 60.0);
sleep(1.0 / 60.0);
with-lock (frame.lock)
call-in-frame(frame, update-flying-squares, pane);
wait-for(frame.update-notification)
Expand All @@ -423,7 +423,7 @@ define function polar-view (radius :: <double-float>, twist :: <double-float>,
glTranslated(0.0d0, 0.0d0, -radius);
glRotated( -twist, 0.0d0, 0.0d0, 1.0d0);
glRotated( -latitude, 1.0d0, 0.0d0, 0.0d0);
glRotated( longitude, 0.0d0, 0.0d0, 1.0d0);
glRotated( longitude, 0.0d0, 0.0d0, 1.0d0);
end function polar-view;

// define constant $light0-position = make-v4(0.0, 0.0, -1.0, 1.0);
Expand All @@ -443,7 +443,7 @@ define function draw-light () => ()
*/
end function draw-light;

define method handle-repaint-scene
define method handle-repaint-scene
(pane :: <flying-squares-pane>, medium :: <medium>) => ()
// Draw scene...
glClear(logior($GL-COLOR-BUFFER-BIT, $GL-DEPTH-BUFFER-BIT));
Expand Down
2 changes: 1 addition & 1 deletion sources/app/gctest/gctest.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ define method bash-one
nexti;
end method;

define method bash-it
define method bash-it
(start :: <integer>, num :: <integer>, thread :: <string>) => ()
let vec = make(<vector>, size: $vector-size);
let i :: <integer> = start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ define function generate-runtime
end;
end function;



/// Main program

begin
Expand Down
46 changes: 23 additions & 23 deletions sources/app/plonker/frame.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ define method keyboard-instrument-setter
select-midi-instrument
(keyboard-midi-device(keyboard), keyboard-midi-channel(keyboard),
instrument);
name
name
end method;

define method keyboard-instruments
define method keyboard-instruments
(keyboard :: <keyboard>) => (instruments :: <list>)
let instruments = #();
do-midi-instruments(method (instrument) instruments := pair(midi-name(instrument), instruments) end);
reverse!(instruments);
end method;

define method keyboard-play-note
define method keyboard-play-note
(keyboard :: <keyboard>, note :: <integer>) => ()
midi-on
(keyboard-midi-device(keyboard), keyboard-midi-channel(keyboard),
keyboard-base-note(keyboard) + note,
keyboard-volume(keyboard));
end method;

define method keyboard-release-note
define method keyboard-release-note
(keyboard :: <keyboard>, note :: <integer>) => ()
midi-off
(keyboard-midi-device(keyboard), keyboard-midi-channel(keyboard),
Expand All @@ -58,11 +58,11 @@ end method;
define method keyboard-volume-update
(keyboard :: <keyboard>, vol :: <integer>) => ()
send-midi-message
(keyboard-midi-device(keyboard), $MIDI-parameter,
(keyboard-midi-device(keyboard), $MIDI-parameter,
keyboard-midi-channel(keyboard), 7 /* $midi-volume-parameter */, vol);
end method;

define method keyboard-bend-note
define method keyboard-bend-note
(keyboard :: <keyboard>, bend :: <integer>) => ()
midi-pitch-bend
(keyboard-midi-device(keyboard), keyboard-midi-channel(keyboard),
Expand All @@ -72,7 +72,7 @@ end method;
define method keyboard-balance
(keyboard :: <keyboard>, balance :: <integer>) => ()
send-midi-message
(keyboard-midi-device(keyboard), $MIDI-parameter,
(keyboard-midi-device(keyboard), $MIDI-parameter,
keyboard-midi-channel(keyboard), $midi-balance-parameter, balance);
end method;

Expand Down Expand Up @@ -126,7 +126,7 @@ define frame <keyboard-frame> (<simple-frame>)
children:
vector(make(<menu-button>,
label: "New Keyboard",
activate-callback:
activate-callback:
method (#rest args)
spawn-keyboard-frame();
end)));
Expand All @@ -135,36 +135,36 @@ define frame <keyboard-frame> (<simple-frame>)
make(<option-box>,
documentation: "Instrument",
items: keyboard-instruments(frame-model(frame)),
scroll-bars: #"vertical",
scroll-bars: #"vertical",
accepts-focus?: #f,
value-changed-callback:
method (pane :: <option-box>)
keyboard-instrument(frame-model(sheet-frame(pane)))
keyboard-instrument(frame-model(sheet-frame(pane)))
:= gadget-value(pane);
frame-input-focus(frame) := keyboard-pane(frame);
end);

pane keyboard-pane (frame)
frame-input-focus(frame)
:= make(<keyboard-pane>,
activate-callback:
:= make(<keyboard-pane>,
activate-callback:
method (sheet :: <keyboard-pane>, note :: <integer>) => ()
keyboard-play-note(frame-model(sheet-frame(sheet)), note);
end,
deactivate-callback:
deactivate-callback:
method (sheet :: <keyboard-pane>, note :: <integer>) => ()
keyboard-release-note(frame-model(sheet-frame(sheet)), note);
end,
key-map-callback:
method (sheet :: <keyboard-pane>, key :: <symbol>)
method (sheet :: <keyboard-pane>, key :: <symbol>)
=> (note :: false-or(<integer>))
qwerty-key-map(key)
end);

pane volume-pane (frame)
make(<slider>,
make(<slider>,
documentation: "Volume",
orientation: #"vertical",
orientation: #"vertical",
value-range: range(from: 127, to: 0, by: -1),
value: 127,
accepts-focus?: #f,
Expand All @@ -175,9 +175,9 @@ define frame <keyboard-frame> (<simple-frame>)
end);

pane pitch-bend-pane (frame)
make(<slider>,
make(<slider>,
documentation: "Pitch bend",
orientation: #"vertical",
orientation: #"vertical",
value-range: range(from: #x3FFF, to: 1, by: -1),
value: #x2000,
accepts-focus?: #f,
Expand All @@ -188,10 +188,10 @@ define frame <keyboard-frame> (<simple-frame>)
end);

pane balance-pane (frame)
make(<slider>,
make(<slider>,
documentation: "Balance",
orientation: #"horizontal",
value-range:
orientation: #"horizontal",
value-range:
range(from: $midi-balance-full-left, to: $midi-balance-full-right),
value: $midi-balance-central,
accepts-focus?: #f,
Expand Down Expand Up @@ -222,7 +222,7 @@ define frame <keyboard-frame> (<simple-frame>)
menu-bar (frame)
make(<menu-bar>,
children: vector(file-menu(frame)));

layout (frame)
main-layout(frame);

Expand All @@ -242,7 +242,7 @@ define method keyboard-frame (#key channel = #f)
*next-free-channel* := *next-free-channel* + 1;
// with-open-midi-device (dev)
let state = make(<keyboard>, midi-device: dev, midi-channel: channel);
let frame = make(<keyboard-frame>,
let frame = make(<keyboard-frame>,
title: format-to-string("MIDI channel %s", channel-no),
model: state,
width: 540, height: 190);
Expand Down
Loading

0 comments on commit 87533c5

Please sign in to comment.