Author: maustin
Date: Thu Oct 27 06:40:57 2005
New Revision: 10293
Added:
trunk/libraries/inertia/
trunk/libraries/inertia/LICENSE.txt (contents, props changed)
trunk/libraries/inertia/Makefile (contents, props changed)
trunk/libraries/inertia/README.txt (contents, props changed)
trunk/libraries/inertia/inertia-events.dylan (contents, props changed)
trunk/libraries/inertia/inertia-exports.dylan (contents, props changed)
trunk/libraries/inertia/inertia-geometry.dylan (contents, props changed)
trunk/libraries/inertia/inertia-gl-utils.dylan (contents, props changed)
trunk/libraries/inertia/inertia-main.dylan (contents, props changed)
trunk/libraries/inertia/inertia-shapes.dylan (contents, props changed)
trunk/libraries/inertia/inertia-widgets.dylan (contents, props changed)
trunk/libraries/inertia/inertia.dev (contents, props changed)
trunk/libraries/inertia/inertia.dylan (contents, props changed)
trunk/libraries/inertia/inertia.layout (contents, props changed)
trunk/libraries/inertia/inertia.lid (contents, props changed)
trunk/libraries/inertia/tests/
trunk/libraries/inertia/tests/inertia-test-exports.dylan (contents, props
changed)
trunk/libraries/inertia/tests/inertia-test-main.dylan (contents, props
changed)
trunk/libraries/inertia/tests/inertia-test.lid (contents, props changed)
Log:
Job: 7269
Initial add of directory libraries/inertia
Added: trunk/libraries/inertia/LICENSE.txt
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/LICENSE.txt Thu Oct 27 06:40:57 2005
@@ -0,0 +1,23 @@
+Copyright (c) 2005, Mike L. Austin
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
Added: trunk/libraries/inertia/Makefile
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/Makefile Thu Oct 27 06:40:57 2005
@@ -0,0 +1,22 @@
+INSTALLPATH=$(shell d2c --compiler-info | grep _DCI_D2C_DYLAN_USER_DIR | \
+ sed 's/_DCI_D2C_DYLAN_USER_DIR=//' | sed 's/\/dylan-user//' |
sed s'/ //g')
+
+LIBTOOL=libtool
+LIDFILE=inertia.lid
+
+tests/inertia-test: tests/inertia-test-exports.dylan
tests/inertia-test-main.dylan inertia.lib.du
+ (cd tests; d2c -L.. inertia-test.lid)
+
+inertia.lib.du: inertia.lid inertia-exports.dylan inertia-gl-utils.dylan
inertia-geometry.dylan \
+ inertia-shapes.dylan inertia-events.dylan
inertia-widgets.dylan inertia-main.dylan
+ d2c inertia.lid
+
+clean:
+ rm -f *.mak *.lib.du *.lo *.o *.la *.a *.c
+ (cd tests; rm -f *.mak *.lib.du *.lo *.o *.la *.a *.c inertia-test.exe)
+
+install: inertia.lib.du
+ $(LIBTOOL) --mode=install /usr/bin/install -c libinertia-dylan.la
$(INSTALLPATH)/libinertia-dylan.la
+ $(LIBTOOL) --finish $(INSTALLPATH)
+ /usr/bin/install -c inertia.lib.du $(INSTALLPATH)/inertia.lib.du
+
Added: trunk/libraries/inertia/README.txt
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/README.txt Thu Oct 27 06:40:57 2005
@@ -0,0 +1,39 @@
+library: inertia
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+
+INTRODUCTION
+------------
+
+Inertia is a vector UI library written in Dylan. It's a concept I've been
+pursuing, in other incarnations, for the past few years. Development
+started in October 2005, so this is a very early release. I'm open to any
+comments or suggestions.
+
+To compile inertia, you may need to edit inertia-main.dylan, and change
+the c-include line that imports glu.h. This is a temporary fix since I
+could not get gluTessCallback() to register a callback without crashing.
+
+
+BUILDING INERTIA
+----------------
+
+Building is simple on un*x or cygwin:
+
+make
+make install
+
+If you want to see a quick demo, run the test program:
+
+tests/inertia-test
+
+
+MISCELLANIOUS
+-------------
+
+You can find related mockups and other implementations of inertia here:
+
+http://www.mike-austin.com/interface-design/index.html
+
Added: trunk/libraries/inertia/inertia-events.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-events.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,116 @@
+module: inertia-shapes
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+define class <event> (<object>)
+end;
+
+define class <mouse-event> (<event>)
+ slot origin :: <point>, init-keyword: origin:;
+end;
+
+define class <mouse-down-event> (<mouse-event>)
+end;
+
+define class <mouse-up-event> (<mouse-event>)
+end;
+
+define class <mouse-motion-event> (<mouse-event>)
+end;
+
+define class <mouse-drag-event> (<mouse-event>)
+end;
+
+define class <mouse-gripper-event> (<mouse-event>)
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+// event method definitions
+//
----------------------------------------------------------------------------------------------
//
+
+define method send-event (shape :: <shape>, event :: <mouse-event>, button ::
<integer>) => (result :: <shape>)
+ //format-out ("send-event (<shape>, <mouse-event>)\n");
+ block (return)
+ for (child in shape.children)
+ let x = event.origin.point-x - child.origin.point-x;
+ let y = event.origin.point-y - child.origin.point-y;
+
+ let angle = -child.z-angle * ($PI / 180.0);
+ let new-x = (x) * cos (angle) - (y) * sin (angle);
+ let new-y = (x) * sin (angle) + (y) * cos (angle);
+
+ let new-origin = make (<point>, x: new-x, y: new-y);
+
+ //if (new-x > 50.0 & new-x < 60.0 & new-y > -5 & new-y < 5)
+ if (((new-x / child.z-scale > 50.0) & (new-x / child.z-scale < 60.0))
+ & (new-y > -5 & new-y < 5))
+ if (instance? (event, <mouse-down-event>))
+ format-out ("gripper\n");
+ child.mouse-mode := #"gripper";
+ event.origin := new-origin;
+ //return (send-event (child, event));
+ return (child);
+ end;
+ end;
+
+ if (contains-point? (child, new-origin / child.z-scale))
+ return (send-event (child, make (object-class (event), origin:
new-origin), button));
+ end;
+ end;
+
+ on-mouse-event (shape, event, 0);
+ shape;
+ end;
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method send-event (screen :: <screen>, event :: <mouse-event>, button
:: <integer>)
+ screen.mouse-origin := event.origin;
+ next-method ();
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-down-event>,
button :: <integer>)
+ *grabbed-shape* := next-method (screen, event, button);
+ *grabbed-shape*.first-mouse := event.origin - *grabbed-shape*.origin;
+ //*grabbed-shape*.first-mouse := event.origin -
*grabbed-shape*.screen-origin;
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-down-event>,
button == $GLUT-RIGHT-BUTTON)
+ *menu*.origin := event.origin - *menu*.extent / 2.0;
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-up-event>,
button :: <integer>)
+ *grabbed-shape*.mouse-mode := #"normal";
+ on-mouse-event (*grabbed-shape*, event, 0);
+ let shape = *grabbed-shape*;
+ *grabbed-shape* := #f;
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-drag-event>,
button :: <integer>)
+ if (*grabbed-shape*.mouse-mode == #"gripper")
+ //let delta = event.origin - *grabbed-shape*.origin;
+ let delta = event.origin - *grabbed-shape*.screen-origin;
+
+ block ()
+ *grabbed-shape*.z-angle := atan2 (delta.point-y, delta.point-x) / ($PI /
180.0);
+ exception (<error>)
+ // Don't care if x and y are both 0
+ end;
+ *grabbed-shape*.z-scale := point-length (delta) / 50.0;
+ else
+ *grabbed-shape*.origin := event.origin - *grabbed-shape*.first-mouse;
+ end;
+ on-mouse-event (*grabbed-shape*, event, 0);
+ *grabbed-shape*;
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-drag-event>,
button == $GLUT-RIGHT-BUTTON)
+end;
+
+define method send-event (screen :: <screen>, event :: <mouse-up-event>,
button == $GLUT-RIGHT-BUTTON)
+ *menu*.origin := *screen*.origin;
+end;
+
Added: trunk/libraries/inertia/inertia-exports.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-exports.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,95 @@
+module: dylan-user
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+define library inertia
+ use common-dylan;
+ use random;
+ use io;
+ use transcendental;
+ use opengl;
+ use melange-support;
+
+ export inertia-geometry;
+ export inertia-shapes;
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define module inertia
+ use common-dylan;
+ use simple-io;
+ use opengl;
+ use opengl-glu;
+ use opengl-glut;
+ use melange-support;
+ use inertia-geometry;
+ use inertia-shapes;
+
+ export *tess-object*, *screen*, *menu*;
+end;
+
+define module inertia-gl-utils
+ use common-dylan;
+ use simple-io;
+ use opengl;
+ use opengl-glu;
+ use opengl-glut;
+ use melange-support;
+
+ // export as, element, element-setter;
+ export glutxBitmapString, glutxBitmapLength;
+end;
+
+define module inertia-geometry
+ use common-dylan, exclude: {format-to-string};
+ use transcendental;
+ use format;
+ use print;
+ use opengl;
+
+ export
+ <point>,
+ point-x, point-y, point-x-setter, point-y-setter,
+ point-length;
+end;
+
+define module inertia-shapes
+ use common-dylan;
+ use transcendental;
+ use random;
+ use simple-io;
+ use melange-support;
+ use opengl;
+ use opengl-glu;
+ use opengl-glut;
+ use inertia;
+ use inertia-gl-utils;
+ use inertia-geometry;
+
+ export
+ <shape>,
+ add-child, contains-point?, send-event,
+ draw-shape, draw-content, draw-outline,
+ <polygon>, <spinning-polygon>,
+ <rectangle>,
+ <screen>,
+ mouse-origin, mouse-origin-setter,
+ <shape-menu>,
+ <shape-editor>,
+ <push-button>;
+
+ export
+ <event>,
+ <mouse-event>,
+ <mouse-down-event>,
+ <mouse-up-event>,
+ <mouse-motion-event>,
+ <mouse-drag-event>,
+ <mouse-gripper-event>;
+
+ export timer;
+end;
+
Added: trunk/libraries/inertia/inertia-geometry.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-geometry.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,53 @@
+module: inertia-geometry
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
+// inertia-geometry.dylan
+//
+
+define class <point> (<object>)
+ slot point-x :: <double-float> = 0.0, init-keyword: x:;
+ slot point-y :: <double-float> = 0.0, init-keyword: y:;
+end;
+
+define method \+ (point :: <point>, other :: <point>) => (result :: <point>)
+ make (<point>, x: point.point-x + other.point-x, y: point.point-y +
other.point-y);
+end;
+
+define method \- (point :: <point>, other :: <point>) => (result :: <point>)
+ make (<point>, x: point.point-x - other.point-x, y: point.point-y -
other.point-y);
+end;
+
+define method \* (point :: <point>, scalar :: <double-float>) => (result ::
<point>)
+ make (<point>, x: point.point-x * scalar, y: point.point-y * scalar);
+end;
+
+define method \/ (point :: <point>, scalar :: <double-float>) => (result ::
<point>)
+ make (<point>, x: point.point-x / scalar, y: point.point-y / scalar);
+end;
+
+define method point-length (point :: <point>)
+ sqrt (point.point-x ^ 2 + point.point-y ^ 2);
+end;
+
+define method print-object (point :: <point>, stream :: <stream>) => ()
+ format (stream, "here\n");
+end;
+
+/*
+define method point-x (point :: <point>) => (<integer>)
+ point.x;
+end;
+
+define method point-y (point :: <point>) => (<integer>)
+ point.y;
+end;
+*/
+
+//define method point-x-setter (point :: <point>, x :: <double-float>) => ()
+// point.point-x := x;
+//end;
+
Added: trunk/libraries/inertia/inertia-gl-utils.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-gl-utils.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,50 @@
+module: inertia-gl-utils
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
+// inertia-gl-utils.dylan
+//
+
+define method as (type == <GLdouble*>, collection :: <collection>)
+ => (result :: <GLdouble*>)
+ let double* = make (<GLdouble*>, element-count: collection.size);
+ for (i from 0, value in collection)
+ double*[i] := value;
+ end;
+ double*;
+end;
+
+define method element (double* :: <GLdouble*>, index :: <integer>, #key
default = 0.0)
+ => (result :: <GLdouble>)
+//let x = double*.size;
+// if (index < pointer.size)
+ default := pointer-value (double*, index: index);
+// else
+// format-out ("*** element (<GLdouble*>): index out of range");
+// default;
+// end;
+ default;
+end;
+
+define method element-setter (value :: <GLdouble>, pointer :: <GLdouble*>,
index :: <integer>)
+ => (result :: <GLdouble>)
+ pointer-value (pointer, index: index) := value;
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method glutxBitmapString (font :: <machine-pointer>, string :: <string>)
+ for (char in string)
+ glutBitmapCharacter (font, as(<integer>, char));
+ end;
+end;
+
+define method glutxBitmapLength (font :: <machine-pointer>, string :: <string>)
+ reduce (method (width, char)
+ width + glutBitmapWidth (font, as(<integer>, char));
+ end, 0, string);
+end;
+
Added: trunk/libraries/inertia/inertia-main.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-main.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,105 @@
+module: inertia
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
+// inertia-mail.dylan
+//
+
+c-include("/usr/include/w32api/GL/glu.h");
+
+define variable reshape :: <function> = callback-method (width :: <integer>,
height :: <integer>) => ();
+//define variable reshape = callback-method (width :: <integer>, height ::
<integer>) => ();
+ glMatrixMode ($GL-PROJECTION);
+ glLoadIdentity ();
+ //gluPerspective (60.0, as(<double-float>, width) / as(<double-float>,
height), 0.5, 10.0);
+ gluOrtho2D (0.0, as(<double-float>, width), as(<double-float>, height),
0.0);
+ glMatrixMode ($GL-MODELVIEW);
+ glViewport (0, 0, width, height);
+end;
+
+define variable display :: <function> = callback-method () => ();
+ //format-out ("display\n");
+ glClear ($GL-COLOR-BUFFER-BIT + $GL-DEPTH-BUFFER-BIT);
+ glLoadIdentity ();
+ glTranslate (0.375, 0.375, 0.0);
+
+ glColor (0.0, 0.0, 0.0, 1.0);
+
+ draw-shape (*screen*);
+
+ glutSwapBuffers ();
+end;
+
+define variable *button* = 0;
+
+define variable mouse-callback :: <function> = callback-method (button ::
<integer>,
+ state :: <integer>, x :: <integer>, y ::
<integer>) => ();
+ let origin = make (<point>, x: as(<double-float>, x), y: as(<double-float>,
y));
+ *button* := button;
+
+ if (state == $GLUT-DOWN)
+ send-event (*screen*, make (<mouse-down-event>, origin: origin), button);
+ elseif (state == $GLUT-UP)
+ send-event (*screen*, make (<mouse-up-event>, origin: origin), button);
+ end;
+ glutPostRedisplay ();
+end;
+
+define variable passive-motion :: <function> = callback-method (x ::
<integer>, y :: <integer>) => ();
+ let origin = make (<point>, x: as(<double-float>, x), y: as(<double-float>,
y));
+ send-event (*screen*, make (<mouse-motion-event>, origin: origin), *button*);
+end;
+
+define variable motion-callback :: <function> = callback-method (x ::
<integer>, y :: <integer>) => ();
+ let origin = make (<point>, x: as(<double-float>, x), y: as(<double-float>,
y));
+ send-event (*screen*, make (<mouse-drag-event>, origin: origin), *button*);
+ glutPostRedisplay ();
+end;
+
+define variable polygon-begin :: <function> = callback-method (mode ::
<integer>) => ();
+end;
+
+begin
+ glut-init ();
+ glutInitDisplayMode ($GLUT-RGBA + $GLUT-DEPTH + $GLUT-DOUBLE +
$GLUT-STENCIL);
+
+ glutInitWindowPosition (200, 100);
+ glutInitWindowSize (800, 600);
+ glutCreateWindow ("Dylan Inertia");
+
+ glutDisplayFunc (display);
+ glutReshapeFunc (reshape);
+ glutPassiveMotionFunc (passive-motion);
+ glutMouseFunc (mouse-callback);
+ glutMotionFunc (motion-callback);
+
+ //gluTessCallback (*tess-object*, $GLU-BEGIN, polygon-begin);
+ //gluTessCallback (*tess-object*, $GLU-VERTEX, polygon-vertex);
+ //gluTessCallback (*tess-object*, $GLU-END, polygon-end);
+
+ glClearColor (1.0s0, 1.0s0, 1.0s0, 1.0s0);
+
+ glEnable ($GL-BLEND); glBlendFunc ($GL-SRC-ALPHA, $GL-ONE-MINUS-SRC-ALPHA);
+ glEnable ($GL-LINE-SMOOTH); glLineWidth (1.5s0);
+
+ define variable *tess-object* = gluNewTess ();
+
+ call-out ("gluTessCallback", void:, ptr: *tess-object*.raw-value, int:
100100, ptr: c-expr( ptr: "glBegin"));
+ call-out ("gluTessCallback", void:, ptr: *tess-object*.raw-value, int:
100101, ptr: c-expr( ptr: "glVertex3dv"));
+ call-out ("gluTessCallback", void:, ptr: *tess-object*.raw-value, int:
100102, ptr: c-expr( ptr: "glEnd"));
+
+ define variable *screen* = make (<screen>, width: 800.0, height: 600.0);
+ define variable *menu* = make (<shape-menu>, x: 100.0, y: 100.0, width:
100.0, height: 180.0);
+ define variable *editor* = make (<shape-editor>, width: 500.0, height:
500.0);
+
+ add-child (*editor*, make (<polygon>, x: 200.0, y: 200.0));
+ add-child (*editor*, make (<spinning-polygon>, x: 300.0, y: 300.0));
+ add-child (*editor*, make (<rectangle>, x: 400.0, y: 400.0));
+ add-child (*editor*, make (<push-button>, caption: "Press Me"));
+ add-child (*screen*, *editor*);
+ add-child (*screen*, *menu*);
+end;
+
Added: trunk/libraries/inertia/inertia-shapes.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-shapes.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,459 @@
+module: inertia-shapes
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
----------------------------------------------------------------------------------------------
//
+// all class definitions
+//
----------------------------------------------------------------------------------------------
//
+
+define variable *angle* = 0.0;
+define variable *grabbed-shape* = #f;
+
+define variable timer :: <function> = callback-method (n :: <integer>) => ();
+ glutTimerFunc (n, timer, n);
+ *angle* := *angle* + 1;
+ glutPostRedisplay ();
+end;
+
+define class <shape> (<object>)
+ slot delegate :: subclass(<shape>), init-keyword: delegate:;
+ slot children = make (<deque>);
+ slot parent :: false-or (<shape>);
+ slot origin = make(<point>, x: 0.0, y: 0.0);
+ slot extent = make(<point>, x: 100.0, y: 100.0);
+ virtual slot point-x :: <double-float>;
+ virtual slot point-y :: <double-float>;
+ slot z-angle :: <double-float> = 0.0;
+ slot z-scale :: <double-float> = 1.0;
+ slot first-mouse;
+ slot mouse-mode = #"normal";
+ slot line-width = 3.0;
+ slot fill-color = vector (random-float (0.5) + 0.5, random-float (0.5) +
0.5, random-float (0.5) + 0.5, 0.9);
+ slot line-color = vector (0.0, 0.0, 0.0, 1.0);
+end;
+
+define method class-name (shape :: <shape>) "<shape>" end;
+
+define class <container> (<shape>)
+end;
+
+define class <polygon> (<shape>)
+ slot data = #[
+ #[0.0, 0.0, 0.0], #[15.0, 50.0, 0.0], #[0.0, 100.0, 0.0], #[50.0,
85.0, 0.0],
+ #[ 100.0, 100.0, 0.0], #[ 85.0, 50.0, 0.0], #[100.0, 0.0, 0.0],
#[50.0, 15.0, 0.0]
+ ];
+ slot data2 = #[
+ #[-50.0, -50.0, 0.0], #[-35.0, 0.0, 0.0], #[-50.0, 50.0, 0.0], #[0.0,
35.0, 0.0],
+ #[ 50.0, 50.0, 0.0], #[ 35.0, 0.0, 0.0], #[50.0, -50.0, 0.0], #[0.0,
-35.0, 0.0]
+ ];
+ slot vertices;
+end;
+
+define class <spinning-polygon> (<polygon>)
+end;
+
+define method class-name (polygon :: <polygon>) "<polygon>" end;
+
+define class <rectangle> (<shape>)
+end;
+
+define method class-name (rectangle :: <rectangle>) "<rectangle>" end;
+
+define class <screen> (<rectangle>)
+ inherited slot fill-color = vector (1.0, 1.0, 1.0, 1.0);
+ slot mouse-origin :: <point>;
+end;
+
+define method class-name (screen :: <screen>) "<screen>" end;
+
+define class <shape-menu-center> (<rectangle>)
+ inherited slot fill-color = vector (0.5, 0.5, 0.5, 0.9);
+ inherited slot line-width = 1.0;
+ keyword width: = 120.0;
+ keyword height: = 120.0;
+end;
+
+define class <shape-menu> (<rectangle>)
+ inherited slot fill-color = vector (0.5, 0.5, 0.5, 0.9);
+ inherited slot line-width = 1.0;
+end;
+
+define method initialize (menu :: <shape-menu>, #rest init-args, #key) => ()
+// apply (next-method, init-args);
+ next-method ();
+ add-child (menu, make (<shape-menu-center>, x: menu.extent.point-x / 2.0 -
60.0, y: menu.extent.point-y / 2.0 - 60.0));
+end;
+
+define method class-name (menu :: <shape-menu>) "<shape-menu>" end;
+
+//
----------------------------------------------------------------------------------------------
//
+// shape methods definitions
+//
----------------------------------------------------------------------------------------------
//
+
+define method point-x (shape :: <shape>) => (result :: <double-float>)
+ shape.origin.point-x;
+end;
+
+define method point-x-setter (value :: <double-float>, shape :: <shape>) =>
(result :: <double-float>)
+ shape.origin.point-x := value;
+end;
+
+define method point-y (shape :: <shape>) => (result :: <double-float>)
+ shape.origin.point-y;
+end;
+
+define method point-y-setter (value :: <double-float>, shape :: <shape>) =>
(result :: <double-float>)
+ shape.origin.point-y := value;
+end;
+
+define method screen-origin (shape :: <shape>)
+ shape.origin + shape.parent.screen-origin;
+end;
+
+define method screen-origin (screen :: <screen>)
+ screen.origin;
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method add-child (shape :: <shape>, child :: <shape>) => ()
+ child.parent := shape;
+ shape.children := add! (shape.children, child);
+end;
+
+define method draw-shape (shape :: <shape>) => ()
+ glPushMatrix ();
+ glTranslate (shape.origin.point-x, shape.origin.point-y, 0.0);
+ //glTranslate (shape.extent.point-x / 2.0, shape.extent.point-y / 2.0,
0.0);
+ glRotate (shape.z-angle, 0.0, 0.0, 1.0);
+ //glTranslate (-shape.extent.point-x / 2.0, -shape.extent.point-y / 2.0,
0.0);
+
+ glPushMatrix ();
+ glClearStencil( #x0 );
+ glClear( $GL-STENCIL-BUFFER-BIT );
+ glEnable( $GL-STENCIL-TEST );
+ glStencilFunc( $GL-ALWAYS, #x1, #x1 );
+ glStencilOp( $GL-REPLACE, $GL-REPLACE, $GL-REPLACE );
+
+ glScale (shape.z-scale, shape.z-scale, 0.0);
+
+ glColor (shape.fill-color[0], shape.fill-color[1], shape.fill-color[2],
shape.fill-color[3]);
+ draw-content (shape, if (slot-initialized? (shape, delegate))
shape.delegate else shape end);
+
+ glStencilFunc( $GL-EQUAL, #x1, #x1 );
+ glStencilOp( $GL-KEEP, $GL-KEEP, $GL-KEEP );
+
+ draw-effects (shape);
+
+ for (i from shape.children.size - 1 to 0 by -1)
+ //for (child in shape.children using reverse-iteration-protocol)
+ let child = shape.children[i];
+ draw-shape (child);
+ end;
+
+ glDisable( $GL-STENCIL-TEST );
+
+ glColor (shape.fill-color[0], shape.fill-color[1], shape.fill-color[2],
shape.fill-color[3]);
+ draw-overlay (shape, if (slot-initialized? (shape, delegate))
shape.delegate else shape end);
+
+ glLineWidth (as(<single-float>, shape.line-width));
+ glColor (shape.line-color[0], shape.line-color[1], shape.line-color[2],
shape.line-color[3]);
+ draw-outline (shape);
+ glPopMatrix ();
+
+ draw-grabber (shape);
+ glPopMatrix ();
+end;
+
+define method draw-effects (shape :: <shape>)
+ glBegin ($GL-QUADS);
+ glColor (1.0, 1.0, 1.0, 0.6); glVertex ( 0.0,
0.0, 0.0);
+ glColor (1.0, 1.0, 1.0, 0.0); glVertex ( 0.0,
shape.extent.point-y / 2.0, 0.0);
+ glColor (1.0, 1.0, 1.0, 0.0); glVertex (shape.extent.point-x,
shape.extent.point-y / 2.0, 0.0);
+ glColor (1.0, 1.0, 1.0, 0.6); glVertex (shape.extent.point-x,
0.0, 0.0);
+
+ glColor (0.0, 0.0, 0.0, 0.0); glVertex ( 0.0,
shape.extent.point-y / 2.0, 0.0);
+ glColor (0.0, 0.0, 0.0, 0.15); glVertex ( 0.0,
shape.extent.point-y, 0.0);
+ glColor (0.0, 0.0, 0.0, 0.15); glVertex (shape.extent.point-x,
shape.extent.point-y, 0.0);
+ glColor (0.0, 0.0, 0.0, 0.0); glVertex (shape.extent.point-x,
shape.extent.point-y / 2.0, 0.0);
+ glEnd ();
+end;
+
+define method draw-grabber (shape :: <shape>)
+ glColor (0.0, 0.0, 0.0);
+
+ glLineWidth (1.0s0);
+ glBegin ($GL-LINES);
+ glVertex (0.0, 0.0);
+ glVertex (50.0 * shape.z-scale, 0.0);
+ glEnd ();
+
+ glBegin ($GL-QUADS);
+ glVertex (50.0 * shape.z-scale + 0.0, -5.0);
+ glVertex (50.0 * shape.z-scale + 0.0, 5.0);
+ glVertex (50.0 * shape.z-scale + 10.0, 5.0);
+ glVertex (50.0 * shape.z-scale + 10.0, -5.0);
+ glEnd ();
+end;
+
+define constant $PI = 3.14159;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method draw-content (shape :: <shape>, delegate :: <shape>) => () end;
+
+define method draw-overlay (shape :: <shape>, delegate :: <shape>) => () end;
+
+define method draw-outline (shape :: <shape>) => ()
+end;
+
+define method contains-point? (shape :: <shape>, point :: <point>) => (result
:: <boolean>)
+ #f
+end;
+
+define method on-mouse-event (shape :: <shape>, event :: <mouse-event>, button)
+ format-out ("%= %= %=\n", event, event.origin, shape.class-name);
+end;
+
+define method on-mouse-event (shape :: <shape>, event :: <mouse-down-event>,
button)
+ next-method ();
+end;
+
+define method on-mouse-event (shape :: <shape>, event :: <mouse-up-event>,
button)
+ next-method ();
+end;
+
+define method on-mouse-event (shape :: <shape>, event :: <mouse-drag-event>,
button)
+ next-method ();
+end;
+
+define method on-mouse-event (shape :: <shape>, event ::
<mouse-gripper-event>, button)
+ next-method ();
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+// polygon methods definitions
+//
----------------------------------------------------------------------------------------------
//
+
+//define method make (polygon == <polygon>, #rest init-args, #key) => (polygon
:: <object>)
+ //let polygon = apply (next-method, init-args);
+define method initialize (polygon :: <polygon>, #rest init-args, #key x = 0.0,
y = 0.0) => ()
+ apply (next-method, init-args);
+ format-out ("initialize (<polygon>)\n");
+ polygon.origin.point-x := x;
+ polygon.origin.point-y := y;
+ polygon.z-angle := 5.0;
+
+ polygon.vertices := map (method (vertex) as(<GLdouble*>, vertex) end,
polygon.data);
+end;
+
+define method draw-content (shape :: <shape>, polygon :: <polygon>) => ()
+ gluBeginPolygon (*tess-object*);
+ for (vertex in polygon.vertices)
+ gluTessVertex (*tess-object*, vertex, as(<GLvoid*>, vertex));
+ end;
+ gluEndPolygon (*tess-object*);
+end;
+
+define method draw-outline (polygon :: <polygon>) => ()
+ glBegin ($GL-LINE-LOOP);
+ for (vertex in polygon.vertices)
+ glVertex (vertex[0], vertex[1], vertex[2]);
+ end;
+ glEnd ();
+end;
+
+define constant $X = 0;
+define constant $Y = 1;
+define constant $Z = 2;
+
+define method contains-point? (polygon :: <polygon>, point :: <point>) =>
(result :: <boolean>)
+ let x = point.point-x; let y = point.point-y;
+ let v = polygon.data;
+ let inside :: <boolean> = #f;
+
+ for (i :: <integer> from 0 below v.size)
+ let j :: <integer> = if (i = v.size - 1) 0 else i + 1 end;
+ if (((v[i][$Y] <= y) & (v[j][$Y] > y)) | ((v[i][$Y] > y) & (v[j][$Y] <=
y)))
+ let vt = (y - v[i][$Y]) / (v[j][$Y] - v[i][$Y]);
+ if (x < v[i][$X] + vt * (v[j][$X] - v[i][$X]))
+ inside := ~inside;
+ end;
+ end;
+ end;
+
+ inside;
+end;
+
+define variable *polygon* = 0;
+define variable *speed* = 10;
+
+define variable xtimer = callback-method (n :: <integer>) => ();
+ if (*speed* > 0.01)
+ glutTimerFunc (n, xtimer, n);
+ *polygon*.z-angle := *polygon*.z-angle + *speed*;
+ *speed* := *speed* * 0.9;
+ glutPostRedisplay ();
+ else
+ *speed* := 10;
+ end;
+end;
+
+define method on-mouse-event (polygon :: <spinning-polygon>, event ::
<mouse-down-event>, button)
+ next-method ();
+ *polygon* := polygon;
+ glutTimerFunc (10, xtimer, 10);
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+// rectangle methods definitions
+//
----------------------------------------------------------------------------------------------
//
+
+define method initialize (rectangle :: <rectangle>, #rest init-args,
+ #key x = 0.0, y = 0.0, width = 100.0, height =
100.0) => ()
+ apply (next-method, init-args);
+ format-out ("initialize (<rectangle>)\n");
+ rectangle.origin.point-x := x;
+ rectangle.origin.point-y := y;
+ rectangle.extent.point-x := width;
+ rectangle.extent.point-y := height;
+end;
+
+define method draw-content (shape :: <shape>, rectangle :: <rectangle>) => ()
+ let width/2 = shape.extent.point-x / 2.0;
+ let height/2 = shape.extent.point-y / 2.0;
+
+ glBegin ($GL-QUADS);
+ glVertex ( 0.0, 0.0);
+ glVertex ( 0.0, shape.extent.point-y);
+ glVertex (shape.extent.point-x, shape.extent.point-y);
+ glVertex (shape.extent.point-x, 0.0);
+ glEnd ();
+end;
+
+define method draw-outline (rectangle :: <rectangle>) => ()
+ let width/2 = rectangle.extent.point-x / 2.0;
+ let height/2 = rectangle.extent.point-y / 2.0;
+ let shape = rectangle;
+
+ glBegin ($GL-LINE-LOOP);
+ glVertex ( 0.0, 0.0);
+ glVertex ( 0.0, shape.extent.point-y);
+ glVertex (shape.extent.point-x, shape.extent.point-y);
+ glVertex (shape.extent.point-x, 0.0);
+ glEnd ();
+end;
+
+define method contains-point? (rectangle :: <rectangle>, point :: <point>) =>
(result :: <boolean>)
+ let width/2 = rectangle.extent.point-x / 2.0;
+ let height/2 = rectangle.extent.point-y / 2.0;
+
+ (point.point-x > 0 & point.point-x < rectangle.extent.point-x)
+ & (point.point-y > 0 & point.point-y < rectangle.extent.point-y);
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+// shape-menu methods definitions
+//
----------------------------------------------------------------------------------------------
//
+
+define method draw-content (shape :: <shape>, menu :: <shape-menu-center>)
+ let radius = 60.0;
+
+ glPushMatrix ();
+ glTranslate (shape.extent.point-x / 2.0, shape.extent.point-y / 2.0, 0.0);
+ glBegin ($GL-TRIANGLE-FAN);
+ glVertex (0.0, 0.0, 0.0);
+ for (angle from 0 to $PI * 2 by $PI / 20.0)
+ glVertex (cos (angle) * radius, sin (angle) * radius, 0.0);
+ end;
+ glVertex (cos (0) * radius, sin (0) * radius, 0.0);
+ glEnd ();
+
+ glLineWidth (2.0s0);
+ glColor (1.0, 1.0, 1.0, 0.7);
+
+ glBegin ($GL-LINE-LOOP);
+ for (angle from 0 to $PI * 2 by $PI / 20.0)
+ glVertex (cos (angle) * radius, sin (angle) * radius, 0.0);
+ end;
+ glEnd ();
+
+ glBegin ($GL-TRIANGLE-FAN);
+ glVertex (0.0, 0.0, 0.0);
+ for (angle from 0 to $PI * 2 by $PI / 20.0)
+ glVertex (cos (angle) * 5.0, sin (angle) * 5.0, 0.0);
+ end;
+ glVertex (cos (0) * 5.0, sin (0) * 5.0, 0.0);
+ glEnd ();
+
+ glBegin ($GL-LINE-LOOP);
+ for (angle from 0 to $PI * 2 by $PI / 20.0)
+ glVertex (cos (angle) * 5.0, sin (angle) * 5.0, 0.0);
+ end;
+ glEnd ();
+
+ glBegin ($GL-LINES);
+ glVertex ( cos ($PI * (1.0 / 4.0)) * radius, sin ($PI * (1.0 / 4.0)) *
radius);
+ glVertex (-cos ($PI * (1.0 / 4.0)) * radius, -sin ($PI * (1.0 / 4.0)) *
radius);
+ glVertex ( cos ($PI * (3.0 / 4.0)) * radius, sin ($PI * (3.0 / 4.0)) *
radius);
+ glVertex (-cos ($PI * (3.0 / 4.0)) * radius, -sin ($PI * (3.0 / 4.0)) *
radius);
+ glEnd ();
+ glPopMatrix ();
+end;
+
+define method draw-overlay (shape :: <shape>, menu :: <shape-menu-center>) =>
()
+ next-method ();
+ let radius = 60.0;
+ glPushMatrix ();
+ glTranslate (shape.extent.point-x / 2.0, shape.extent.point-y / 2.0, 0.0);
+
+ glColor (1.0, 1.0, 1.0, 1.0);
+
+ draw-centered-string ( 0, -40 + 5, "Cut");
+ draw-centered-string (-35, 0 + 5, "Copy");
+ draw-centered-string ( 35, 0 + 5, "Paste");
+ draw-centered-string ( 0, 40 + 5, "Clone");
+ glPopMatrix ();
+end;
+
+define method draw-effects (menu :: <shape-menu-center>)
+end;
+
+define method draw-outline (menu :: <shape-menu-center>) => ()
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method draw-overlay (shape :: <shape>, menu :: <shape-menu>) => ()
+ next-method ();
+ let radius = 60.0;
+ glPushMatrix ();
+ glTranslate (shape.extent.point-x / 2.0, shape.extent.point-y / 2.0, 0.0);
+
+ glColor (1.0, 1.0, 1.0, 1.0);
+ //draw-centered-string (0, -50 + 7, "Bring to Front");
+ draw-centered-string (0, -75 + 5, "Bring Forward");
+ draw-centered-string (0, 75 + 5, "Send Backward");
+ //draw-centered-string (0, 50 + 7, "Send to Back");
+ glPopMatrix ();
+end;
+
+define method draw-effects (menu :: <shape-menu>)
+end;
+
+define method draw-outline (menu :: <shape-menu>) => ()
+end;
+
+define method draw-centered-string (x, y, string :: <string>)
+ local draw-string (x, y, string)
+ let width :: <integer> = glutxBitmapLength ($GLUT-BITMAP-HELVETICA-12,
string);
+ glRasterPos (round/ (-width, 2.0) + x, y);
+ glutxBitmapString ($GLUT-BITMAP-HELVETICA-12, string);
+ end;
+
+ draw-string (x, y, string);
+ draw-string (x + 1, y, string);
+end;
+
Added: trunk/libraries/inertia/inertia-widgets.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia-widgets.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,58 @@
+module: inertia-shapes
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
+// inertia-widgets
+//
+
+define class <widget> (<rectangle>)
+end;
+
+define class <shape-editor> (<widget>)
+ inherited slot line-width = 1.0;
+ //inherited slot fill-color = vector (1.0, 1.0, 1.0, 1.0);
+ inherited slot line-color = vector (0.25, 0.25, 0.25, 1.0);
+end;
+
+define class <label> (<widget>)
+end;
+
+define class <button> (<widget>)
+end;
+
+define class <push-button> (<button>)
+ inherited slot line-width = 1.0;
+ inherited slot fill-color = vector (0.9, 0.9, 0.9, 1.0);
+ inherited slot line-color = vector (0.4, 0.4, 0.4, 1.0);
+ //inherited slot extent = make (<point>, x: 100.0, y: 25.0);
+ keyword width: = 100.0;
+ keyword height: = 25.0;
+ slot caption :: <string> = "", init-keyword: caption:;
+end;
+
+define method class-name (button :: <push-button>) "<push-button>" end;
+
+//
----------------------------------------------------------------------------------------------
//
+
+define method draw-overlay (shape :: <shape>, menu :: <push-button>)
+ next-method ();
+ glColor (0.0, 0.0, 0.0, 1.0);
+ glPushMatrix ();
+ glTranslate (shape.extent.point-x / 2.0, shape.extent.point-y / 2.0, 0.0);
+ draw-centered-string (0, 5, shape.caption);
+ glPopMatrix ();
+end;
+
+define method xsend-event
+ (shape :: <shape-editor>, event :: <mouse-event>, button :: <integer>)
+ => (result :: <shape>)
+ format-out ("send-event (<shape-editor>)\n");
+ shape;
+end;
+
+define method xdraw-shape (editor :: <shape-editor>) => ()
+end;
+
Added: trunk/libraries/inertia/inertia.dev
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia.dev Thu Oct 27 06:40:57 2005
@@ -0,0 +1,157 @@
+[Project]
+FileName=inertia.dev
+Name=inertia
+UnitCount=12
+Type=1
+Ver=1
+ObjFiles=
+Includes=
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Compiler=
+CppCompiler=
+Linker=
+IsCpp=1
+Icon=
+ExeOutput=
+ObjectOutput=
+OverrideOutput=0
+OverrideOutputName=
+HostApplication=
+Folders=tests
+CommandLine=
+UseCustomMakefile=0
+CustomMakefile=
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=0000000000000000000000
+
+[Unit1]
+FileName=inertia-exports.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+AutoIncBuildNr=0
+
+[Unit2]
+FileName=inertia-geometry.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit3]
+FileName=inertia-shapes.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit4]
+FileName=inertia.lid
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit5]
+FileName=tests\inertia-test.lid
+Folder=tests
+Compile=0
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit6]
+FileName=tests\inertia-test-exports.dylan
+Folder=tests
+Compile=0
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit7]
+FileName=tests\inertia-test-main.dylan
+Folder=tests
+Compile=0
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit8]
+FileName=inertia-gl-utils.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit9]
+FileName=Makefile
+Folder=inertia
+Compile=0
+Link=0
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit10]
+FileName=inertia-main.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit11]
+FileName=inertia-events.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit12]
+FileName=inertia-widgets.dylan
+Folder=
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
Added: trunk/libraries/inertia/inertia.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia.dylan Thu Oct 27 06:40:57 2005
@@ -0,0 +1,46 @@
+module: dylan-user
+
+define library inertia
+ use /* library */ dylan;
+ use /* library */ opengl;
+ export /* module */ inertia-geometry;
+ export /* module */ inertia-views;
+end;
+
+define module inertia-geometry
+ use /* module */ dylan;
+ use /* module */ opengl;
+
+ export /* classes */ <point>;
+end;
+
+define module inertia-views
+ use /* module */ inertia-geometry;
+ use /* module */ dylan;
+ use /* module */ system;
+ use /* module */ opengl;
+ use /* module */ opengl-glu;
+ use /* module */ opengl-glut;
+
+ export /* classes */ <view>, <screen>;
+ export /* methods */ add-child, draw-view;
+end;
+
+//
----------------------------------------------------------------------------------------------
//
+// main
+//
----------------------------------------------------------------------------------------------
//
+/*
+begin
+ glut-init ();
+ glutInitDisplayMode ($GLUT-RGB + $GLUT-DEPTH + $GLUT-DOUBLE);
+
+ glutInitWindowPosition (0, 0);
+ glutInitWindowSize (512, 512);
+ glutCreateWindow ("Dylan Balls3D");
+
+ glutDisplayFunc (draw);
+ glutReshapeFunc (reshape);
+
+ glutMainLoop ();
+end;
+*/
Added: trunk/libraries/inertia/inertia.layout
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia.layout Thu Oct 27 06:40:57 2005
@@ -0,0 +1,87 @@
+[Editor_0]
+CursorCol=1
+CursorRow=1
+TopLine=1
+LeftChar=1
+Open=1
+Top=0
+[Editor_1]
+CursorCol=1
+CursorRow=6
+TopLine=1
+LeftChar=1
+Open=1
+Top=0
+[Editor_2]
+CursorCol=1
+CursorRow=6
+TopLine=1
+LeftChar=1
+Open=1
+Top=0
+[Editor_3]
+CursorCol=1
+CursorRow=9
+TopLine=1
+LeftChar=1
+Open=0
+Top=0
+[Editor_4]
+CursorCol=1
+CursorRow=5
+TopLine=1
+LeftChar=1
+Open=0
+Top=0
+[Editor_5]
+CursorCol=11
+CursorRow=1
+TopLine=1
+LeftChar=1
+Open=0
+Top=0
+[Editor_6]
+CursorCol=12
+CursorRow=1
+TopLine=1
+LeftChar=1
+Open=0
+Top=0
+[Editors]
+Order=0,7,1,10,9,2,11
+Focused=11
+[Editor_7]
+Open=1
+Top=0
+CursorCol=1
+CursorRow=6
+TopLine=1
+LeftChar=1
+[Editor_8]
+Open=0
+Top=0
+CursorCol=1
+CursorRow=11
+TopLine=1
+LeftChar=1
+[Editor_10]
+CursorCol=1
+CursorRow=2
+TopLine=1
+LeftChar=1
+Open=1
+Top=0
+[Editor_9]
+Open=1
+Top=0
+CursorCol=1
+CursorRow=6
+TopLine=1
+LeftChar=1
+[Editor_11]
+Open=1
+Top=1
+CursorCol=1
+CursorRow=6
+TopLine=1
+LeftChar=1
Added: trunk/libraries/inertia/inertia.lid
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/inertia.lid Thu Oct 27 06:40:57 2005
@@ -0,0 +1,9 @@
+library: inertia
+files: inertia-exports
+ inertia-gl-utils
+ inertia-geometry
+ inertia-shapes
+ inertia-widgets
+ inertia-events
+ inertia-main
+
Added: trunk/libraries/inertia/tests/inertia-test-exports.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/tests/inertia-test-exports.dylan Thu Oct 27
06:40:57 2005
@@ -0,0 +1,20 @@
+module: dylan-user
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+define library inertia-test
+ use common-dylan;
+ use opengl;
+ use inertia;
+end;
+
+define module inertia-test
+ use common-dylan;
+ use opengl;
+ use opengl-glut;
+ use simple-io;
+ use inertia-shapes;
+end;
+
Added: trunk/libraries/inertia/tests/inertia-test-main.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/tests/inertia-test-main.dylan Thu Oct 27
06:40:57 2005
@@ -0,0 +1,36 @@
+module: inertia-test
+synopsis: Core UI shapes
+author: Mike Austin
+copyright: Copyright (C) 2005 Mike L. Austin. All rights reserved.
+license: MIT/BSD, see LICENCE.txt for details
+
+//
+// inertia-test.dylan
+//
+
+define method make-from-string (string == #"<polygon>", #rest args) => (object
:: <object>)
+ apply (make, <polygon>, args);
+end;
+
+begin
+ format-out ("%=\n", make-from-string (as(<symbol>, "<polygon>")));
+
+ glutMainLoop ();
+end;
+
+
+define class <ship> (<object>)
+ slot state = #"exploding";
+end;
+
+define method draw-actor (ship :: <ship>, state == #"normal") => ()
+ format-out ("normal");
+end;
+
+define method draw-actor (ship :: <ship>, state == #"exploding") => ()
+ format-out ("exploding");
+end;
+
+let ship = make (<ship>);
+draw-actor (ship, ship.state);
+
Added: trunk/libraries/inertia/tests/inertia-test.lid
==============================================================================
--- (empty file)
+++ trunk/libraries/inertia/tests/inertia-test.lid Thu Oct 27 06:40:57 2005
@@ -0,0 +1,5 @@
+library: inertia-test
+executable: inertia-test
+files: inertia-test-exports
+ inertia-test-main
+
--
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter
|