Article 13193 of alt.sources:
Path: nntpd.lkg.dec.com!lead.zk3.dec.com!crl.dec.com!pa.dec.com!decwrl!news.bu.edu!lll-winken.llnl.gov!nntp.coast.net!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!metro!metro!unsw.edu.au!mettw
From: mettw@nntp.unsw.EDU.AU (Matthew Parry)
Newsgroups: alt.sources
Subject: LibFractus [1/1]
Date: 13 Feb 1996 04:57:07 GMT
Organization: University of New South Wales
Lines: 1714
Message-ID: <4fp5n3$85k@mirv.unsw.edu.au>
NNTP-Posting-Host: newt.phys.unsw.edu.au
X-Newsreader: TIN [version 1.2 PL2]


#!/bin/sh
# This is a shell archive (produced by GNU shar 4.0).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1996-02-13 15:34 EST by <mettw@newt.phys.unsw.edu.au>.
# Source directory was `/usr/users/grp01/mettw/src/fractus/LibFractus-0.1'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   1518 -rw-r--r-- LibFractus-0.1/src/fractus.c
#   2003 -rw-r--r-- LibFractus-0.1/src/point.c
#   1216 -rw-r--r-- LibFractus-0.1/src/Makefile
#   6738 -rw-r--r-- LibFractus-0.1/src/window.c
#   1063 -rw-r--r-- LibFractus-0.1/src/clear-screen.c
#   1121 -rw-r--r-- LibFractus-0.1/src/general.h
#   2868 -rw-r--r-- LibFractus-0.1/src/line.c
#   2259 -rw-r--r-- LibFractus-0.1/src/turtle.c
#   1247 -rw-r--r-- LibFractus-0.1/examples/Makefile
#   1531 -rw-r--r-- LibFractus-0.1/examples/sierpinski.c
#   1626 -rw-r--r-- LibFractus-0.1/examples/clear_sierpinski.c
#   1637 -rw-r--r-- LibFractus-0.1/examples/mondrian.c
#   1631 -rw-r--r-- LibFractus-0.1/examples/alt_mondrian.c
#   1628 -rw-r--r-- LibFractus-0.1/include/fractus.h
#   1435 -rw-r--r-- LibFractus-0.1/Makefile
#   1261 -rw-r--r-- LibFractus-0.1/README
#  17976 -rw------- LibFractus-0.1/COPYING
#
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo 'WARNING: not restoring timestamps'
fi
rm -f 1231235999 $$.touch
#
# ============= LibFractus-0.1/src/fractus.c ==============
if test ! -d 'LibFractus-0.1'; then
  echo 'x - creating directory LibFractus-0.1'
  mkdir 'LibFractus-0.1'
fi
if test ! -d 'LibFractus-0.1/src'; then
  echo 'x - creating directory LibFractus-0.1/src'
  mkdir 'LibFractus-0.1/src'
fi
if test -f 'LibFractus-0.1/src/fractus.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/fractus.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/fractus.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/fractus.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
#include <fractus.h>
#include "general.h"
#include <stdio.h>
#include <string.h>
X
void fr_window();
void fr_check_input();
X
X
void
fr_manager (int *argc, char *argv[], frd_fn_pointer fri_fractal_function)
{
X  fr_check_input ();
X
X  fr_window (argc, argv);
X
X  while (1)
X    {
X      fr_handle_events ();
X      while (! XPending (fri_display))
X	{
X	  fri_fractal_function ();
X	}
X    }
X
}
X
X
int
fr_error (char *frii_buf)
{
X  printf ("LibFractus: fr_check_input: %s\n", frii_buf);
X  return 1;
}
X
void
fr_check_input (void)
{
X  int frii_exit = 0;
X
X  if (frii_exit)
X    exit (1);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/fractus.c' &&
  chmod 0644 'LibFractus-0.1/src/fractus.c' ||
  echo 'restore of LibFractus-0.1/src/fractus.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/fractus.c'`"
  test 1518 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/fractus.c: original size 1518, current size $shar_count"
fi
# ============= LibFractus-0.1/src/point.c ==============
if test -f 'LibFractus-0.1/src/point.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/point.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/point.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/point.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
#include <fractus.h>
#include "general.h"
X
int
fr_point (double fri_x, double fri_y)
{
X  int fri_xp, fri_yp;
X
X  if (frg_custom.co_ords == CARTESIAN)
X    {
X      if (fri_x < frg_custom.x1 || fri_x > frg_custom.x2 
X	  || fri_y < frg_custom.y1 || fri_y > frg_custom.y2)
X	{
X	  puts ("LibFractus: fr_point: Parameter out of range");
X	  return 1;
X	}
X      fri_xp = (int) ((fri_x - frg_custom.x1) / (frg_custom.x1 - frg_custom.x2)
X		      * frg_custom.width);
X      fri_yp = (int) ((fri_y - frg_custom.y1) / (frg_custom.y1 - frg_custom.y2)
X                      * frg_custom.height);
X    }
X  else if (frg_custom.co_ords == PIXEL)
X    {
X      fri_xp = (int) fri_x;
X      fri_yp = (int) fri_y;
X      if (fri_xp < 0 || fri_xp > frg_custom.width || fri_yp < 0 
X	  || fri_yp > frg_custom.height)
X	{
X          puts ("LibFractus: fr_point: Parameter out of range");
X          return 1;
X        }
X    }
X  else
X    {
X      puts ("LibFractus: fr_point: Polar co-ords not implemented");
X      exit (1);
X    }
X
X  XDrawPoint (fri_display, fri_window, fri_gc, fri_xp, fri_yp);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/point.c' &&
  chmod 0644 'LibFractus-0.1/src/point.c' ||
  echo 'restore of LibFractus-0.1/src/point.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/point.c'`"
  test 2003 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/point.c: original size 2003, current size $shar_count"
fi
# ============= LibFractus-0.1/src/Makefile ==============
if test -f 'LibFractus-0.1/src/Makefile' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/Makefile (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/Makefile (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/Makefile' &&
X
#   Copyright (C) 1996 Matthew Parry 
#   <mettw@newt.phys.unsw.edu.au>
#   <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X 
CC = gcc
X
AR = ar
X
AROPS = ruv
X
RANLIB = ranlib
X
SRC = fractus.c point.c window.c clear-screen.c turtle.c line.c
X
OBJS = fractus.o point.o window.o clear-screen.o turtle.o line.o
X
all: $(OBJS)
X	rm -f libFractus.a
X	$(AR) $(AROPS) libFractus.a $(OBJS)
X	$(RANLIB) libFractus.a
X
clean:
X	rm -f *.o
X
X
$(OBJS): ../include/fractus.h
X	$(CC) -c $*.c -I../include
X
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/Makefile' &&
  chmod 0644 'LibFractus-0.1/src/Makefile' ||
  echo 'restore of LibFractus-0.1/src/Makefile failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/Makefile'`"
  test 1216 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/Makefile: original size 1216, current size $shar_count"
fi
# ============= LibFractus-0.1/src/window.c ==============
if test -f 'LibFractus-0.1/src/window.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/window.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/window.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/window.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
#include <fractus.h>
#include "general.h"
#include <stdio.h>
X
X
void
fr_window (int argc, char *argv[])
{
X  unsigned int fri_border_width = 1;
X  int fri_backing_store = NotUseful;
X  int fri_xpos, fri_ypos, fri_width, fri_height;
X  int fri_foreground_pixel, fri_background_pixel, fri_border_pixel;
X  char *fri_disp = NULL;
X  char *fri_geometry = NULL;
X  char *fri_foreground = "black";
X  char *fri_background = "white";
X  Colormap fri_colourmap;
X  Status fri_status;
X  Visual fri_visual;
X  XColor fri_foreground_def, fri_background_def, fri_border_def;
X  XColor  fri_foreground_exact, fri_background_exact, fri_border_exact;
X  XGCValues fri_xgcvalues;
X  XSetWindowAttributes fri_xsw_attribs;
X
X
X  fri_display = XOpenDisplay (fri_disp);
X  if (!(fri_display))
X    {
X      puts ("LibFractus: fr_window: Cannot open display");
X      exit (1);
X    }
X
X  fri_colourmap = XDefaultColormap (fri_display, DefaultScreen (fri_display));
X    
X  fri_status = XAllocNamedColor (fri_display, fri_colourmap, fri_foreground,
X				 &fri_foreground_def, &fri_foreground_exact);
X  fri_foreground_pixel = fri_status ? fri_foreground_def.pixel : WhitePixel (fri_display, DefaultScreen (fri_display));
X
X  fri_status = XAllocNamedColor (fri_display, fri_colourmap, fri_background,
X				 &fri_background_def, &fri_background_exact);
X  fri_background_pixel = fri_status ? fri_background_def.pixel : BlackPixel (fri_display, DefaultScreen (fri_display));
X
X  fri_xpos = 0;
X  fri_ypos = 0;
X  fri_width = frg_custom.width;
X  fri_height = frg_custom.height;
X  XParseGeometry (fri_geometry, &fri_xpos, &fri_ypos,
X		  (unsigned int *) &fri_width, (unsigned int *) &fri_height);
X 
X  fri_xsw_attribs.backing_store = fri_backing_store;
X  fri_xsw_attribs.event_mask = ExposureMask | StructureNotifyMask;
X  fri_xsw_attribs.background_pixel = fri_background_pixel;
X  fri_xsw_attribs.border_pixel = fri_border_pixel;
X  fri_window = XCreateWindow (fri_display, 
X			      RootWindow (fri_display, 
X					  DefaultScreen (fri_display)),
X			      fri_xpos, fri_ypos, fri_width, fri_height, 
X			      fri_border_width, 
X			      DefaultDepth (fri_display, 
X					    DefaultScreen (fri_display)), 
X			      InputOutput, &fri_visual, (CWEventMask | 
X						     CWBackingStore | 
X						     CWBorderPixel | 
X						     CWBackPixel), 
X			      &fri_xsw_attribs);
X
X  XChangeProperty (fri_display, fri_window, XA_WM_NAME, XA_STRING, 8,
X		   PropModeReplace, (unsigned char *) frg_custom.program_name,
X		   strlen (frg_custom.program_name));
X
X  XMapWindow (fri_display, fri_window);
X                
X  fri_xgcvalues.foreground = fri_foreground_pixel;
X  fri_xgcvalues.plane_mask = fri_foreground_pixel ^ fri_background_pixel;
X  fri_gc = XCreateGC (fri_display, fri_window, (GCForeground | GCFunction
X						| GCPlaneMask | GCFillStyle |
X						GCGraphicsExposures),
X		      &fri_xgcvalues);
X  
}
X
X
X
void 
fr_handle_events ()
{
X  XEvent fri_xevent;
X  XExposeEvent *fri_exp_event;
X  XConfigureEvent *fri_conf_event;
X
X  XNextEvent(fri_display, &fri_xevent);
X  switch (fri_xevent.type) {
X    /* Keyboard Events */
X  case KeyPress:
X    puts ("fr_handle_events: KeyPress");
X  case KeyRelease:
X    puts ("fr_handle_events: KeyRelease");
X
X    /* Pointer events */
X  case ButtonPress:
X    puts ("fr_handle_events: ButtonPress");
X  case ButtonRelease:
X    puts ("fr_handle_events: ButtonRelease");
X  case MotionNotify:
X    puts ("fr_handle_events: MotionNotify");
X
X    /* Window crossing events */
X  case EnterNotify:
X    puts ("fr_handle_events: EnterNotify");
X  case LeaveNotify:
X    puts ("fr_handle_events: LeaveNotify");
X
X    /*Input focus events */
X  case FocusIn:
X    puts ("fr_handle_events: FocusIn");
X  case FocusOut:
X    puts ("fr_handle_events: FocusOut");
X
X    /* Keymap state notification event */
X  case KeymapNotify:
X    puts ("fr_handle_events: KeymapNotify");
X
X    /* Exposure events */
X  case Expose:
X    puts ("fr_handle_events: Exposure");
X    fri_exp_event = (XExposeEvent *) &fri_xevent;
X    while (fri_exp_event->count)
X      {
X	XNextEvent(fri_display, &fri_xevent);	    
X	fri_exp_event = (XExposeEvent *) &fri_xevent;
X      }
X    break;
X  case GraphicsExpose:
X    puts ("fr_handle_events: GraphicsExpose");
X  case NoExpose:
X    puts ("fr_handle_events: NoExpose");
X
X    /* Structure control events */
X  case CirculateRequest:
X    puts ("fr_handle_events: CirculateRequest");
X  case ConfigureRequest:
X    puts ("fr_handle_events: ConfigureRequest");
X  case MapRequest:
X    puts ("fr_handle_events: MapRequest");
X  case ResizeRequest:
X    puts ("fr_handle_events: ResizeRequest");
X
X    /* Window state notification events */
X  case CirculateNotify:
X    puts ("fr_handle_events: CirculateNotify");
X  case ConfigureNotify:
X    puts ("fr_handle_events: ConfigureNotify");
X    fri_conf_event = (XConfigureEvent *)&fri_xevent;
X    break;
X  case CreateNotify:
X    puts ("fr_handle_events: CreateNotify");
X  case DestroyNotify:
X    puts ("fr_handle_events: DestroyNotify");
X  case GravityNotify:
X    puts ("fr_handle_events: GravityNotify");
X  case MapNotify:
X    puts ("fr_handle_events: MapNotify");
X  case ReparentNotify:
X    puts ("fr_handle_events: ReparentNotify");
X  case UnmapNotify:
X    puts ("fr_handle_events: UnmapNotify");
X  case VisibilityNotify:
X    puts ("fr_handle_events: VisibilityNotify");
X
X    /* Colormap state notification event */
X  case ColormapNotify:
X    puts ("fr_handle_events: ColormapNotify");
X
X    /* Client communication events */
X  case ClientMessage:
X    puts ("fr_handle_events: ClientMessage");
X  case PropertyNotify:
X    puts ("fr_handle_events: PropertyNotify");
X  case SelectionClear:
X    puts ("fr_handle_events: SelectionClear");
X  case SelectionNotify:
X    puts ("fr_handle_events: SelectionNotify");
X  case SelectionRequest:
X    puts ("fr_handle_events: SelectionRequest");
X    break;
X  default:
X  }
X  
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/window.c' &&
  chmod 0644 'LibFractus-0.1/src/window.c' ||
  echo 'restore of LibFractus-0.1/src/window.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/window.c'`"
  test 6738 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/window.c: original size 6738, current size $shar_count"
fi
# ============= LibFractus-0.1/src/clear-screen.c ==============
if test -f 'LibFractus-0.1/src/clear-screen.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/clear-screen.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/clear-screen.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/clear-screen.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
#include <fractus.h>
#include "general.h"
X
X
void
fr_clear_screen (void)
{
X  XClearWindow (fri_display, fri_window);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/clear-screen.c' &&
  chmod 0644 'LibFractus-0.1/src/clear-screen.c' ||
  echo 'restore of LibFractus-0.1/src/clear-screen.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/clear-screen.c'`"
  test 1063 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/clear-screen.c: original size 1063, current size $shar_count"
fi
# ============= LibFractus-0.1/src/general.h ==============
if test -f 'LibFractus-0.1/src/general.h' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/general.h (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/general.h (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/general.h' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
X
#ifndef GENERAL_H
#define GENERAL_H
X
X
Window fri_window;
X
Display *fri_display;
X
GC fri_gc;
X               
void fr_handle_events      (void);
X      
X
#endif /* GENERAL_H */
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/general.h' &&
  chmod 0644 'LibFractus-0.1/src/general.h' ||
  echo 'restore of LibFractus-0.1/src/general.h failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/general.h'`"
  test 1121 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/general.h: original size 1121, current size $shar_count"
fi
# ============= LibFractus-0.1/src/line.c ==============
if test -f 'LibFractus-0.1/src/line.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/line.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/line.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/line.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
#include <fractus.h>
#include "general.h"
X
X
X              
int
fr_line (double fri_x1, double fri_y1, double fri_x2, double fri_y2)
{
X  
X  int fri_xp1, fri_yp1, fri_xp2, fri_yp2;
X
X  if (frg_custom.co_ords == CARTESIAN)
X    {
X      if (fri_x1 < frg_custom.x1 || fri_x1 > frg_custom.x2
X          || fri_y1 < frg_custom.y1 || fri_y1 > frg_custom.y2)
X        {
X          puts ("LibFractus: fr_line: Parameter out of range");
X          return 1;
X        }
X      if (fri_x2 < frg_custom.x1 || fri_x2 > frg_custom.x2
X          || fri_y2 < frg_custom.y1 || fri_y2 > frg_custom.y2)
X        {
X          puts ("LibFractus: fr_line: Parameter out of range");
X          return 1;
X        }
X
X      fri_xp1 = (int) ((fri_x1 - frg_custom.x1) /
X		       (frg_custom.x1 - frg_custom.x2) * frg_custom.width);
X      fri_yp1 = (int) ((fri_y1 - frg_custom.y1) /
X		       (frg_custom.y1 - frg_custom.y2) * frg_custom.height);
X      fri_xp2 = (int) ((fri_x2 - frg_custom.x1) /
X		       (frg_custom.x1 - frg_custom.x2) * frg_custom.width);
X      fri_yp2 = (int) ((fri_y2 - frg_custom.y1) /
X		       (frg_custom.y1 - frg_custom.y2) * frg_custom.height);
X    }
X  else if (frg_custom.co_ords == PIXEL)
X    {
X      fri_xp1 = (int) fri_x1;
X      fri_yp1 = (int) fri_y1;
X      if (fri_xp1 < 0 || fri_xp1 > frg_custom.width || fri_yp1 < 0
X	  || fri_yp1 > frg_custom.height)
X        {
X          puts ("LibFractus: fr_line: Parameter out of range");
X          return 1;
X        }
X      fri_xp2 = (int) fri_x2;
X      fri_yp2 = (int) fri_y2;
X      if (fri_xp2 < 0 || fri_xp2 > frg_custom.width || fri_yp2 < 0
X	  || fri_yp2 > frg_custom.height)
X        {
X          puts ("LibFractus: fr_line: Parameter out of range");
X          return 1;
X        }
X    }
X  else
X    {
X      puts ("LibFractus: fr_line: Polar co-ords not implemented");
X      exit (1);
X    }
X          
X
X    XDrawLine (fri_display, fri_window, fri_gc, fri_xp1, fri_yp1,
X		fri_xp2, fri_yp2);
X 
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/line.c' &&
  chmod 0644 'LibFractus-0.1/src/line.c' ||
  echo 'restore of LibFractus-0.1/src/line.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/line.c'`"
  test 2868 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/line.c: original size 2868, current size $shar_count"
fi
# ============= LibFractus-0.1/src/turtle.c ==============
if test -f 'LibFractus-0.1/src/turtle.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/src/turtle.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/src/turtle.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/src/turtle.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
#include <fractus.h>
#include "general.h"
X
X
int fri_turtle[2];
X              
int
fr_turtle (frd_turtle fri_up_or_down, double fri_x, double fri_y)
{
X  
X  int fri_xp, fri_yp;
X
X  if (frg_custom.co_ords == CARTESIAN)
X    {
X      if (fri_x < frg_custom.x1 || fri_x > frg_custom.x2
X          || fri_y < frg_custom.y1 || fri_y > frg_custom.y2)
X        {
X          puts ("LibFractus: fr_turtle: Parameter out of range");
X          return 1;
X        }
X      fri_xp = (int) ((fri_x - frg_custom.x1) / (frg_custom.x1 - frg_custom.x2)
X                      * frg_custom.width);
X      fri_yp = (int) ((fri_y - frg_custom.y1) / (frg_custom.y1 - frg_custom.y2)
X                      * frg_custom.height);
X    }
X  else if (frg_custom.co_ords == PIXEL)
X    {
X      fri_xp = (int) fri_x;
X      fri_yp = (int) fri_y;
X      if (fri_xp < 0 || fri_xp > frg_custom.width || fri_yp < 0
X	  || fri_yp > frg_custom.height)
X        {
X          puts ("LibFractus: fr_turtle: Parameter out of range");
X          return 1;
X        }
X    }
X  else
X    {
X      puts ("LibFractus: fr_turtle: Polar co-ords not implemented");
X      exit (1);
X    }
X          
X
X
X  if (fri_up_or_down == PenDown)
X    XDrawLine (fri_display, fri_window, fri_gc, fri_turtle[0], fri_turtle[1],
X		fri_xp, fri_yp);
X
X  fri_turtle[0] = fri_xp;
X  fri_turtle[1] = fri_yp;
X 
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/src/turtle.c' &&
  chmod 0644 'LibFractus-0.1/src/turtle.c' ||
  echo 'restore of LibFractus-0.1/src/turtle.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/src/turtle.c'`"
  test 2259 -eq "$shar_count" ||
    echo "LibFractus-0.1/src/turtle.c: original size 2259, current size $shar_count"
fi
# ============= LibFractus-0.1/examples/Makefile ==============
if test ! -d 'LibFractus-0.1/examples'; then
  echo 'x - creating directory LibFractus-0.1/examples'
  mkdir 'LibFractus-0.1/examples'
fi
if test -f 'LibFractus-0.1/examples/Makefile' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/examples/Makefile (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/examples/Makefile (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/examples/Makefile' &&
#   This is a generic makefile for compiling LibFractus
#   programs.  If you move the library and header file then
#   change the LDOPS and INCLUDE variables.
X
X
#   Copyright (C) 1996 Matthew Parry 
#   <mettw@newt.phys.unsw.edu.au>
#   <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X 
CC=gcc
X
LDOPS =  -L../src
X
LD = -lFractus -lX11 
X
INCLUDE = -I../include
X
DEF_BIN = mondrian alt_mondrian sierpinski clear_sierpinski
X
clean:
X	rm -f *.o $(DEF_BIN)
X
X.c:
X	$(CC) -DFUNCPROTO $< -o $@ $(INCLUDE) $(LDOPS) $(LD)
X
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/examples/Makefile' &&
  chmod 0644 'LibFractus-0.1/examples/Makefile' ||
  echo 'restore of LibFractus-0.1/examples/Makefile failed'
  shar_count="`wc -c < 'LibFractus-0.1/examples/Makefile'`"
  test 1247 -eq "$shar_count" ||
    echo "LibFractus-0.1/examples/Makefile: original size 1247, current size $shar_count"
fi
# ============= LibFractus-0.1/examples/sierpinski.c ==============
if test -f 'LibFractus-0.1/examples/sierpinski.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/examples/sierpinski.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/examples/sierpinski.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/examples/sierpinski.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
#include <fractus.h>
#include <stdlib.h>
#include <time.h>
X
void fractal ();
int x, y, cx[3], cy[3];
X
int
main (int argc, char *argv[])
{
X
X  cx[0] = 50;
X  cy[0] = 750;
X  cx[1] = 750;
X  cy[1] = 750;
X  cx[2] = 400;
X  cy[2] = 50;
X  x = cx[0];
X  y = cy[0];
X
X  frg_custom.program_name = "Sierpinski's sieve";
X  frg_custom.co_ords = PIXEL;
X  frg_custom.width = 800;
X  frg_custom.height = 800;
X
X  srand (time (NULL));
X
X  fr_manager (&argc, argv, fractal);
X
X
}
X
void
fractal (void)
{
X  int i;
X
X  i = rand() % 3;
X  x = (x + cx[i])/2;
X  y = (y + cy[i])/2;
X  fr_point ((double) x, (double) y);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/examples/sierpinski.c' &&
  chmod 0644 'LibFractus-0.1/examples/sierpinski.c' ||
  echo 'restore of LibFractus-0.1/examples/sierpinski.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/examples/sierpinski.c'`"
  test 1531 -eq "$shar_count" ||
    echo "LibFractus-0.1/examples/sierpinski.c: original size 1531, current size $shar_count"
fi
# ============= LibFractus-0.1/examples/clear_sierpinski.c ==============
if test -f 'LibFractus-0.1/examples/clear_sierpinski.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/examples/clear_sierpinski.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/examples/clear_sierpinski.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/examples/clear_sierpinski.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
#include <fractus.h>
#include <stdlib.h>
#include <time.h>
X
void fractal ();
int x, y, cx[3], cy[3], ii;
X
int
main (int argc, char *argv[])
{
X
X  ii = 0;
X  cx[0] = 50;
X  cy[0] = 750;
X  cx[1] = 750;
X  cy[1] = 750;
X  cx[2] = 400;
X  cy[2] = 50;
X  x = cx[0];
X  y = cy[0];
X
X  frg_custom.program_name = "Sierpinski's sieve";
X  frg_custom.co_ords = PIXEL;
X  frg_custom.width = 800;
X  frg_custom.height = 800;
X
X  srand (time (NULL));
X
X  fr_manager (&argc, argv, fractal);
X
X
}
X
void
fractal (void)
{
X  int i;
X
X  ii ++;
X  i = rand() % 3;
X  x = (x + cx[i])/2;
X  y = (y + cy[i])/2;
X
X  if (ii == 10000)
X    {
X      ii = 0;
X      fr_clear_screen ();
X    }
X  fr_point ((double) x, (double) y);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/examples/clear_sierpinski.c' &&
  chmod 0644 'LibFractus-0.1/examples/clear_sierpinski.c' ||
  echo 'restore of LibFractus-0.1/examples/clear_sierpinski.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/examples/clear_sierpinski.c'`"
  test 1626 -eq "$shar_count" ||
    echo "LibFractus-0.1/examples/clear_sierpinski.c: original size 1626, current size $shar_count"
fi
# ============= LibFractus-0.1/examples/mondrian.c ==============
if test -f 'LibFractus-0.1/examples/mondrian.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/examples/mondrian.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/examples/mondrian.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/examples/mondrian.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
#include <fractus.h>
#include <stdlib.h>
#include <time.h>
X
void fractal ();
int x, y, i, ii;
X
int
main (int argc, char *argv[])
{
X
X  frg_custom.program_name = "Artwork by Mondrian";
X  frg_custom.co_ords = PIXEL;
X  frg_custom.width = 800;
X  frg_custom.height = 800;
X
X  srandom (time (NULL));
X
X  x = (random () % 700) + 50;
X  y = (random () % 700) + 50;
X  ii = 0;
X  i = 0;
X  
X  fr_turtle (PenUp, (double) x, (double) y);
X
X  fr_manager (&argc, argv, fractal);
X
}
X
void
fractal (void)
{
X
X  if (ii < 90)
X    {
X      ii++;
X
X      if (i)
X	{
X	  x = (random () % 700) + 50;
X	  i --;
X	}
X      else
X	{
X	  y = (random () % 700) + 50;
X	  i ++;
X	}
X    }
X
X  fr_turtle (PenDown, (double) x, (double) y);
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/examples/mondrian.c' &&
  chmod 0644 'LibFractus-0.1/examples/mondrian.c' ||
  echo 'restore of LibFractus-0.1/examples/mondrian.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/examples/mondrian.c'`"
  test 1637 -eq "$shar_count" ||
    echo "LibFractus-0.1/examples/mondrian.c: original size 1637, current size $shar_count"
fi
# ============= LibFractus-0.1/examples/alt_mondrian.c ==============
if test -f 'LibFractus-0.1/examples/alt_mondrian.c' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/examples/alt_mondrian.c (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/examples/alt_mondrian.c (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/examples/alt_mondrian.c' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
#include <fractus.h>
#include <stdlib.h>
#include <time.h>
X
void fractal ();
int i, ii;
X
int
main (int argc, char *argv[])
{
X
X  frg_custom.program_name = "Artwork by Mondrian";
X  frg_custom.co_ords = PIXEL;
X  frg_custom.width = 800;
X  frg_custom.height = 800;
X
X  srandom (time (NULL));
X
X  ii = 0;
X  i = 0;
X
X  fr_manager (&argc, argv, fractal);
X
}
X
void
fractal (void)
{
X  int x1, x2, y1, y2;
X
X  if (ii < 300)
X    {
X      ii++;
X      x1 = (random () % 650) + 50;
X      y1 = (random () % 650) + 50;
X      if (i)
X	{
X	  x2 = x1 + 50;
X	  y2 = y1;
X	  i--;
X	}
X      else
X	{
X	  x2 = x1;
X	  y2 = y1 + 50;
X	  i++;
X	}
X
X      fr_line ((double) x1, (double) y1, (double) x2, (double) y2);
X    }
X
}
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/examples/alt_mondrian.c' &&
  chmod 0644 'LibFractus-0.1/examples/alt_mondrian.c' ||
  echo 'restore of LibFractus-0.1/examples/alt_mondrian.c failed'
  shar_count="`wc -c < 'LibFractus-0.1/examples/alt_mondrian.c'`"
  test 1631 -eq "$shar_count" ||
    echo "LibFractus-0.1/examples/alt_mondrian.c: original size 1631, current size $shar_count"
fi
# ============= LibFractus-0.1/include/fractus.h ==============
if test ! -d 'LibFractus-0.1/include'; then
  echo 'x - creating directory LibFractus-0.1/include'
  mkdir 'LibFractus-0.1/include'
fi
if test -f 'LibFractus-0.1/include/fractus.h' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/include/fractus.h (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/include/fractus.h (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/include/fractus.h' &&
/*  LibFractus - A library of functions usefull for fractal programs.
X    Copyright (C) 1996 Matthew Parry 
X    <mettw@newt.phys.unsw.edu.au>
X    <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X              
*/
X
X
X
#ifndef FRACTUS_H
#define FRACTUS_H
X
#include <X11/Xatom.h>
#include <X11/Xlib.h>
X
#define Pi 3.1415926535898
X
typedef void (*frd_fn_pointer)();
X
typedef enum {PenUp, PenDown} frd_turtle;
X
typedef enum {PIXEL, CARTESIAN, POLAR} frd_co_ords;
X
struct { char *program_name;
X	 frd_co_ords co_ords;
X	 unsigned int width;
X	 unsigned int height;
X	 double x1;
X	 double x2;
X	 double y1;
X	 double y2;
X	 double r;
X       } frg_custom;
X
X
void      fr_manager       (int*, 
X			    char**,
X			    frd_fn_pointer);
X
int       fr_point         (double,
X			    double);
X
void      fr_clear_screen  ();
X
int       fr_turtle        (frd_turtle,
X			    double,
X			    double);
X
#endif /* FRACTUS_H */
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/include/fractus.h' &&
  chmod 0644 'LibFractus-0.1/include/fractus.h' ||
  echo 'restore of LibFractus-0.1/include/fractus.h failed'
  shar_count="`wc -c < 'LibFractus-0.1/include/fractus.h'`"
  test 1628 -eq "$shar_count" ||
    echo "LibFractus-0.1/include/fractus.h: original size 1628, current size $shar_count"
fi
# ============= LibFractus-0.1/Makefile ==============
if test -f 'LibFractus-0.1/Makefile' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/Makefile (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/Makefile (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/Makefile' &&
X
#   Copyright (C) 1996 Matthew Parry 
#   <mettw@newt.phys.unsw.edu.au>
#   <URL:http://www.phys.unsw.edu.au/~mettw/>                                 
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X 
DISTDIR = LibFractus-0.1
X
DISTSRC = Makefile README COPYING
X
X
all:
X	cd src; make
X
clean:
X	cd examples; make clean
X	cd src; make clean
X	rm -f *.o
X
distclean: clean
X	rm -f examples/*~ src/*~ include/*~ ./*~
X	rm -f src/libFractus.a
X	rm -fr $(DISTDIR)*
X
makedistdir: 
X	mkdir $(DISTDIR)
X	cp -r src  $(DISTDIR)
X	cp -r examples $(DISTDIR)
X	cp -r include $(DISTDIR)
X	cp $(DISTSRC) $(DISTDIR)
X
dist: distclean makedistdir
X	tar cvf $(DISTDIR).tar $(DISTDIR)
X	gzip $(DISTDIR).tar
X	rm -fr $(DISTDIR)
X
shar:  distclean makedistdir
X	shar $(DISTDIR) > $(DISTDIR).shar
X	rm -fr $(DISTDIR)
X
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/Makefile' &&
  chmod 0644 'LibFractus-0.1/Makefile' ||
  echo 'restore of LibFractus-0.1/Makefile failed'
  shar_count="`wc -c < 'LibFractus-0.1/Makefile'`"
  test 1435 -eq "$shar_count" ||
    echo "LibFractus-0.1/Makefile: original size 1435, current size $shar_count"
fi
# ============= LibFractus-0.1/README ==============
if test -f 'LibFractus-0.1/README' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/README (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/README (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/README' &&
X
X                            LibFractus
X                            ----------
X
Copyright (c) 1996 Matthew Parry
<mettw@newt.phys.unsw.edu.au>
<URL:http://www.phys.unsw.edu.au/~mettw/>
X
This Library is distributed under the terms of the GNU General Public 
License as published by the Free Software Foundation; either version 2, 
or (at your option) any later version. The license is given in the 
file COPYING.
X
----
X
The purpose of this library is to provide a set of functions that
will easily allow the production of fractals of any kind in an
XX11 environment. 
X
At the moment there are only a (very) basic set of graphics functions
(There are enough to create all types of fractal though).  If the way
I've set up the function fr_manager seems strange, it's because I'm
eventually going to redo the library with Athena widgets and have an
idea of how I want it to work with them.  
X
I've written it with libX11.a at the moment because I don't know how 
to use Athena widgets well (or even X11) and I have no idea at all 
how to use the DisplayArea widget.  This is mainly an exercise for me 
to learn all this stuff.
X
For documantation have a look at how I've written the examples, I
wrote these to check that the functions are working properly.
X
Matthew.
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/README' &&
  chmod 0644 'LibFractus-0.1/README' ||
  echo 'restore of LibFractus-0.1/README failed'
  shar_count="`wc -c < 'LibFractus-0.1/README'`"
  test 1261 -eq "$shar_count" ||
    echo "LibFractus-0.1/README: original size 1261, current size $shar_count"
fi
# ============= LibFractus-0.1/COPYING ==============
if test -f 'LibFractus-0.1/COPYING' && test X"$1" != X"-c"; then
  echo 'x - skipping LibFractus-0.1/COPYING (File already exists)'
else
  echo 'x - extracting LibFractus-0.1/COPYING (text)'
  sed 's/^X//' << 'SHAR_EOF' > 'LibFractus-0.1/COPYING' &&
X		    GNU GENERAL PUBLIC LICENSE
X		       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X                          675 Mass Ave, Cambridge, MA 02139, USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X			    Preamble
X
X  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.
X
X  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.
X
X  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
X
X  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
X
X  The precise terms and conditions for copying, distribution and
modification follow.
X
X		    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".
X
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
X
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    b) You must cause any work that you distribute or publish, that in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying that you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X
These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
X
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
X
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
X
X  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
X
X    a) Accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of Sections
X    1 and 2 above on a medium customarily used for software interchange; or,
X
X    b) Accompany it with a written offer, valid for at least three
X    years, to give any third party, for a charge no more than your
X    cost of physically performing source distribution, a complete
X    machine-readable copy of the corresponding source code, to be
X    distributed under the terms of Sections 1 and 2 above on a medium
X    customarily used for software interchange; or,
X
X    c) Accompany it with the information you received as to the offer
X    to distribute corresponding source code.  (This alternative is
X    allowed only for noncommercial distribution and only if you
X    received the program in object code or executable form with such
X    an offer, in accord with Subsection b above.)
X
The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
X
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
X
X  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
X
X  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
X
X  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
X
X  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
X
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
X
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
X
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
X
X  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.
X
X  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
X
Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
X
X  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
X
X			    NO WARRANTY
X
X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
X
X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
X
X		     END OF TERMS AND CONDITIONS
X
X	    How to Apply These Terms to Your New Programs
X
X  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
X
X  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the program's name and a brief idea of what it does.>
X    Copyright (C) 19yy  <name of author>
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X
Also add information on how to contact you by electronic and paper mail.
X
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
X
X    Gnomovision version 69, Copyright (C) 19yy name of author
X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
X    This is free software, and you are welcome to redistribute it
X    under certain conditions; type `show c' for details.
X
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
X
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
X  `Gnomovision' (which makes passes at compilers) written by James Hacker.
X
X  <signature of Ty Coon>, 1 April 1989
X  Ty Coon, President of Vice
X
This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.
SHAR_EOF
  $shar_touch -am 0213153496 'LibFractus-0.1/COPYING' &&
  chmod 0600 'LibFractus-0.1/COPYING' ||
  echo 'restore of LibFractus-0.1/COPYING failed'
  shar_count="`wc -c < 'LibFractus-0.1/COPYING'`"
  test 17976 -eq "$shar_count" ||
    echo "LibFractus-0.1/COPYING: original size 17976, current size $shar_count"
fi
exit 0




