Filewatcher File Search
FTP Search
  
Directory 
  
Content Search 
   
pkg://ifsdaem-1.1-1.src.rpm:94968/ifsdaem.tgz  info  downloads

./ifsdaem-1.1/COPYING100664    764    144       43076  6506244217  12571 0ustar  timousers		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                          675 Mass Ave, Cambridge, MA 02139, USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  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.

  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.

  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.

  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.

  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.

  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.

  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.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  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".

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.

  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.

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.

  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:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

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.

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.

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.

  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:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

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.

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.

  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.

  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.

  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.

  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.

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.

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.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  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.

  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.

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.

  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.

			    NO WARRANTY

  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.

  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.

		     END OF TERMS AND CONDITIONS

	Appendix: How to Apply These Terms to Your New Programs

  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.

  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.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    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.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

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.

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:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

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.
./ifsdaem-1.1/Makefile100664      0      0        2646  6637205731  12662 0ustar  rootrootINCDIR = /usr/lib/qt/include
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LFLAGS = -L/usr/X11/lib/qt/lib -lqt -lm
CC = gcc
MOC = /usr/X11/lib/qt/bin/moc
LSTATIC = /usr/X11/lib/libqt.a -lm -lX11

####### Files

SOURCES = run.cpp parse.cpp farben.cpp ifs_drawer.cpp ifs_utils.cpp \
           ifs_file_editor.cpp ifs_win.cpp
OBJECTS = run.o parse.o farben.o ifs_drawer.o ifs_utils.o ifs_win.o \
      ifs_file_editor.o
OBJ_THERE= ./edit_win/ifs.o ./edit_win/abbildung.o ./edit_win/koordsys.o \
           ./edit_win/qiandsc.o ./edit_win/edit_win.o
OBJMETA = mfile_win.o 
OBJM_THERE=./edit_win/mqiandsc.o ./edit_win/medit_win.o
TARGET	= ifsdaem

####### Implicit rules

.SUFFIXES: .cpp

.cpp.o:
	$(CC) -c $(CFLAGS) -I$(INCDIR) $<

####### Build rules

all: linux_shared

linux_shared: $(OBJECTS) $(OBJMETA)
	cd edit_win; make
	$(CC) $(OBJECTS) $(OBJMETA) $(OBJ_THERE) $(OBJM_THERE) -o $(TARGET) $(LFLAGS)

linux_static: $(OBJECTS) $(OBJMETA)
	cd edit_win; make
	$(CC) $(OBJECTS) $(OBJMETA) $(OBJ_THERE) $(OBJM_THERE) -o $(TARGET) $(LSTATIC)

archiv:
	tar -c -z -f ifsdaem.tgz *

archiv_1:
	zip -9 -r ifsdaem.zip . -i \*

files_1:
	find . -name "*" > FILES

files:	
	ls -l * > FILES

depend:
	@makedepend -I$(INCDIR) $(SOURCES) 2> /dev/null

clean:
	rm -f *.o *.bak *.e *.ESV *.tgz
	cd edit_win; make clean

####### Meta classes

mfile_win.cpp: file_win.h
	$(MOC) -o $@ $<


# DO NOT DELETE THIS LINE -- make depend depends on it.
./ifsdaem-1.1/README100664      0      0        1724  6704440604  12071 0ustar  rootroot------------------  IFS-Daemon Version 1.1 --------------------------

  A program to create easily IFS.
  <Copyright (C) 1998 Timo Hartmann >
  <email: hudson.hartmann@t-online.de>
  
  LINUX-Version for X-Windows
  
  Requires QT-TOOLKIT
  
  Building ifsdaem in 3 easy steps:
  
  1.) Adjust the makefile
        INCDIR for QT,moc,...
  2.) type make
  3.) Copy ifsdaem in /usr/bin (or where you want it to be)
  
--------------------------------------------------------------------  
      
  This 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 opinion) 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.
./ifsdaem-1.1/edit_win/ 40775    764    144           0  6704443453  13214 5ustar  timousers./ifsdaem-1.1/edit_win/abbildung.cpp100664    764    144        7524  6533503556  15755 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */
  
#include "abbildung.hpp"

void abbildung::verkette(abbildung& n1,abbildung& n2)
{
  if(&n1==this)
  {
    abbildung tmp1;
    tmp1.set(n1);
    if(&n2==this)
    {
      abbildung tmp2;
      tmp2.set(n2);
      verkette(tmp1,tmp2);
      return;
    }
    verkette(tmp1,n2);
    return;
  }
  if(&n2==this)
  {
    abbildung tmp2;
    tmp2.set(n2);
    verkette(n1,tmp2);
    return;
  }

  a= n1.a * n2.a + n1.c * n2.b ;
  c= n1.a * n2.c + n1.c * n2.d ;
  b= n1.b * n2.a + n1.d * n2.b ;
  d= n1.b * n2.c + n1.d * n2.d ;
  e= n1.e * n2.a + n1.f * n2.b + n2.e ;
  f= n1.e * n2.c + n1.f * n2.d + n2.f ;
}

int abbildung::umkehr(abbildung& n)
{
  double det;

  det= n.det();

  if(fabs(det)<1e-15) return FALSE;

  a=  n.d / det;
  b=- n.b / det;
  c=- n.c / det;
  d=  n.a / det;
  e=  ( n.f * n.b - n.e * n.d) / det;
  f=- ( n.f * n.a - n.e * n.c) / det;

  return TRUE;
}

int abbildung::fixpunkt(double& d1,double& d2)
{
  double nenner;
  
  nenner=(1-d)*(1-a)-c*b;
  if(fabs(nenner)<1e-12)
  {
    d1=0;
    d2=0;
    return FALSE;
  }
  
  d1=(1-d)*e+f*b;
  d2=(1-a)*f+e*c;
  d1=d1/nenner;
  d2=d2/nenner;

  return TRUE;
}
 

double abbildung::det()
{
  return(a*d-b*c);
}

void abbildung::write()
{
  printf("%.3g %.3g %.3g %.3g",a,b,c,d);
  printf(" , %.3g %.3g\n",e,f);
}

void abbildung::set(abbildung& n)
{
  a=n.a;
  b=n.b;
  c=n.c;
  d=n.d;
  e=n.e;
  f=n.f;
}

void abbildung::null()
{
  a=0;
  b=0;
  c=0;
  d=0;
  e=0;
  f=0;
}

void abbildung::get_trans(double x1,double x2)
{
  get_ident();
  e=x1;
  f=x2;
}

void abbildung::get_rot(double d1)
{
  a=cos(d1);
  b=-sin(d1);
  c=-b;
  d=a;
  e=0;
  f=0;
}

void abbildung::get_spiegx()
{
  null();
  a=-1;
  d=1;
}

void abbildung::get_spiegy()
{
  null();
  a=1;
  d=-1;
}

void abbildung::get_ident()
{
  null();
  a=1;
  d=1;
}

void abbildung::get_scale(double d1,double d2)
{
  null();
  a=d1;
  d=d2;
}

void abbildung::get_scher(double d1,double d2)
{
  get_ident();
  b=d1;
  c=d2;
}

void abbildung::do_it(double &xs,double &ys,double x,double y)
{
  xs=a*x+b*y+e;
  ys=c*x+d*y+f;
}

//-------------

void abb_alternativ::get_from_abb(abbildung& t)
{
  double x2,a,d,b,c,si_,co_;
  
  e=t.e;
  f=t.f;
  
  a=t.a;
  b=t.b;
  c=t.c;
  d=t.d;
  
  x2=a*a+c*c;
  x=sqrt(x2);
  if(fabs(x)<1e-9)
  {
    x=0;
    s=0;
    
    y=sqrt(b*b+d*d);
    
    if(fabs(y)<1e-9)
    {
      y=0;
      rot=0;
      return;
    }
    
    si_=-b/y;
    co_=d/y;
  }else
  {
    s=(b*a+d*c)/x2;
    
    y=(d*a-b*c)/x;
  
    co_=a/x;
    si_=c/x;
  }
  
  rot=asin(si_);
  if(co_<0)
    rot=_PI-rot;
} 


void abb_alternativ::put_in_abb(abbildung &t)
{
  double si_,co_;
  
  si_=sin(rot);
  co_=cos(rot);
  
  t.a=x*co_;
  t.b=-si_*y+s*x*co_;
  t.c=x*si_;
  t.d=s*x*si_+y*co_;
  t.e=e;
  t.f=f;
}


void abb_alternativ::write()
{
  printf("s %.4g , x %.4g , y %.4g , rot %.4g, e %.4g , f %.4g \n",s,x,y,rot*_180dPI,e,f);
}

// -------------------- Zum Testen ----------------
/*
main()
{
  abb_alternativ t1;
  abbildung t2,t3;

  t1.s=6;
  t1.x=0.9;
  t1.y=-0.8;
  t1.rot=-6*_PId180;
  t1.e=0;
  t1.f=0;
  
  t1.put_in_abb(t2);
  t2.write();
  
  t1.get_from_abb(t2);
  t1.write();
}*/
./ifsdaem-1.1/edit_win/abbildung.hpp100664    764    144        3433  6533503252  15746 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _abbcpp0
  #define _abbcpp0

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "../standart.h"

// xs=a*x+b*y+e
// ys=c*x+d*y+f

class abbildung
{
public :

  double a,b,c,d,e,f;
  
  void verkette(abbildung& n1,abbildung& n2);
  int umkehr(abbildung& n);
  void write();
  double det();
  void set(abbildung& n);
  void null();
  void get_trans(double x1,double x2);
  void get_rot(double d1);
  void get_spiegx();
  void get_spiegy();
  void get_ident();
  void get_scale(double d1,double d2);
  void get_scher(double d1,double d2);
  int fixpunkt(double& d1,double& d2);
  
  void do_it(double &xs,double &ys,double x,double y);
};

// erst scheren,dann skalen,dann rotieren,dann verschieben
// (1 0) * (x 0) * ( cos sin) = (a b)
// (s 1)   (0 y)   ( -sin cos )   (c d)

// Das ist die eigentliche Form:
//  (x y) * (a c) + (e f) =(xs ys)
//          (b d)   

class abb_alternativ 
{
  public :
  
  double rot,s,x,y,e,f;

  void get_from_abb(abbildung& t);
  void put_in_abb(abbildung& t);
  void write();
};

#endif
./ifsdaem-1.1/edit_win/Makefile100664      0      0        2064  6637205745  14463 0ustar  rootrootINCDIR = /usr/lib/qt/include
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
LFLAGS = -L/usr/X11/lib/qt/lib -lqt -lm
CC = gcc
MOC = /usr/X11/lib/qt/bin/moc
SHELL =	/bin/sh

####### Files

HEADERS = qiandsc.h edit_win.h 
SOURCES = qiandsc.cpp edit_win.cpp abbildung.cpp ifs.cpp koordsys.cpp
OBJECTS = qiandsc.o edit_win.o abbildung.o ifs.o koordsys.o
SRCMETA = mqiandsc.cpp medit_win.cpp
OBJMETA = mqiandsc.o medit_win.o

####### Implicit rules

.SUFFIXES: .cpp

.cpp.o:
	$(CC) -c $(CFLAGS) -I$(INCDIR) $<

####### Build rules

all: objss

objss: $(OBJECTS) $(OBJMETA)


# zum testen des IFS-Editors
test: $(OBJECTS) $(OBJMETA) run.o
	$(CC) $(OBJECTS) $(OBJMETA) run.o -o test_edit $(LFLAGS)

depend:
	@makedepend -I$(INCDIR) $(SOURCES) 2> /dev/null

showfiles:
	@echo $(HEADERS) $(SOURCES) Makefile

clean:
	rm -f *.o *.bak *.e *.ESV

####### Meta classes

mqiandsc.cpp: qiandsc.h
	$(MOC) -o $@ $<

medit_win.cpp: edit_win.h
	$(MOC) -o $@ $<


# DO NOT DELETE THIS LINE -- make depend depends on it.
./ifsdaem-1.1/edit_win/edit_win.cpp100664    764    144       31125  6534776601  15646 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */


#include "edit_win.h"

draw_area_class::draw_area_class(QWidget *parent,const char *name):QWidget(parent,name)
{
  adult=(edit_win*) parent;
}
  
void draw_area_class::paintEvent(QPaintEvent *)
{
  adult->draw_all();
}

void draw_area_class::mousePressEvent(QMouseEvent* p)
{
  adult->_mousePressEvent(p);
}

void draw_area_class::mouseReleaseEvent(QMouseEvent *p)
{
  adult->_mouseReleaseEvent(p);
}

void draw_area_class::mouseMoveEvent(QMouseEvent *p)
{
  adult->_mouseMoveEvent(p);
}

edit_win::edit_win(QWidget *parent,const char *name) : QWidget(parent,name)
{

  setCaption("IFS-Daemon : Editor");

// Die Einstellungen

  rot_i=new qinpscr("Rot.:",40,this);CHECK_PTR(rot_i);
  transx_i=new qinpscr("Tr. x:",40,this);CHECK_PTR(transx_i);
  transy_i=new qinpscr("Tr. y:",40,this);CHECK_PTR(transy_i);
  schx_i=new qinpscr("Sch.x:",40,this);CHECK_PTR(schx_i);
  scx_i=new qinpscr("Sc. x:",40,this);CHECK_PTR(scx_i);
  scy_i=new qinpscr("Sc. y:",40,this);CHECK_PTR(scy_i);

// Buttons

  clear_b=new QPushButton("clear",this,"t1");CHECK_PTR(clear_b);
  clear_b->resize(40,20);

  add_b=new QPushButton("add",this,"t1");CHECK_PTR(add_b);
  add_b->resize(40,20);

  ifs_b=new QPushButton("test",this,"t1");CHECK_PTR(ifs_b);
  ifs_b->resize(40,20);

  emit_b=new QPushButton("emit",this,"t1");CHECK_PTR(emit_b);
  emit_b->resize(40,20);

// Liste fr abbildungen
 
  auswahl=new QListBox(this,"t1");CHECK_PTR(auswahl);
  auswahl->resize(80,80);

// Das Malfenster
  
  draw_area=new draw_area_class(this);CHECK_PTR(draw_area);
  draw_area->move(0,0);
  draw_area->setBackgroundColor(black);
  
// Einrichten

  ix1=100;
  iy1=100;

  transx_i->set_dx(ix1/100);
  transy_i->set_dx(ix1/100);  // nicht iy1/2, damit das gleichmaessig erscheint
  scx_i->set_dx(0.05);
  scy_i->set_dx(0.05);
  schx_i->set_dx(0.05);

  liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);

  actual_abb=0;
  mouse_was=-1;
  is_ifs=0;

  arrange();

// Ereignisse

  connect(rot_i,SIGNAL(ready()),this,SLOT(change_val()));
  connect(schx_i,SIGNAL(ready()),this,SLOT(change_val()));
  connect(scx_i,SIGNAL(ready()),this,SLOT(change_val()));
  connect(scy_i,SIGNAL(ready()),this,SLOT(change_val()));
  connect(transx_i,SIGNAL(ready()),this,SLOT(change_val()));
  connect(transy_i,SIGNAL(ready()),this,SLOT(change_val()));

  connect(clear_b,SIGNAL(clicked()),this,SLOT(clear_abb()));
  connect(ifs_b,SIGNAL(released()),this,SLOT(test_ifs()));  
  connect(add_b,SIGNAL(clicked()),this,SLOT(add_abb()));  
  connect(emit_b,SIGNAL(clicked()),this,SLOT(do_emit()));    
  
  connect(auswahl,SIGNAL(selected(int)),this,SLOT(new_selected(int)));
}

void edit_win::arrange()
{
  int beginofblock=width()-40-80;
  
  draw_area->resize(beginofblock,height());
  
  rot_i->move(beginofblock,0);
  transx_i->move(beginofblock,20);
  transy_i->move(beginofblock,40);  
  transy_i->move(beginofblock,40);
  schx_i->move(beginofblock,60);
  scx_i->move(beginofblock,80);
  scy_i->move(beginofblock,100);

  add_b->move(beginofblock+5,130);
  ifs_b->move(beginofblock+5,150);
  emit_b->move(beginofblock+5+40+5,130);
  clear_b->move(beginofblock+5+40+5,150);

  auswahl->move(beginofblock+10,195);

  init_koord();
}

void edit_win::clear_abb()
{
  sleep();
  liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);
  auswahl->clear();
  auswahl->repaint();
  draw_all();
}

void edit_win::edit_ifs(my_ifs *toedit)
{
  sleep();

  liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);
  auswahl->clear();

  double x=0,y=0;
  abbildung zw1,zw2,zw3,zw4;
  
  if(toedit->x1==toedit->x2) toedit->init_ifs(x,y,TRUE);

  zw1.null();
  zw1.e=-(toedit->x1+toedit->x2)/2;
  zw1.f=-(toedit->y1+toedit->y2)/2;
  zw1.a=ix1/fabs(toedit->x1-toedit->x2);
  zw1.d=iy1/fabs(toedit->y1-toedit->y2);
  if(zw1.a>zw1.d) {zw1.a=zw1.d;} else zw1.d=zw1.a;
  zw1.e*=zw1.a;
  zw1.f*=zw1.a;
  
  zw2.umkehr(zw1);

  abb_alternativ *t;
  
  for(int i=0;i<toedit->count;i++)
  {
    t=new abb_alternativ();
    CHECK_PTR(t);

    zw3=*toedit->daten[i];

    zw4.verkette(zw2,zw3);
    zw3.verkette(zw4,zw1);      
    t->get_from_abb(zw3);

    actual_abb=liste_abb->count;

    liste_abb->add(t);
  
    init_i(actual_abb);

    QString s;
    s.sprintf("No %d",actual_abb);
    auswahl->insertItem(s);
    auswahl->setCurrentItem(actual_abb);
  }
}

void edit_win::init_koord()
{
  double scx,scy;
  
  scx=draw_area->width();
  scx=scx/ix1;
  
  scy=draw_area->height();
  scy=scy/iy1;
  
  if(scy<scx) scx=scy;
  
  scx*=0.95;
  
  ifs_fenster.set_all(0,0,draw_area->width()/2,draw_area->height()/2,scx,-scx);

  init_kontaktp(actual_abb);
}

void edit_win::draw_koord()
{
  QPainter p;
  p.begin(draw_area);
  p.setPen(white);
  draw_line(ix1/2,iy1/2,-ix1/2,iy1/2,&p);
  draw_line(-ix1/2,iy1/2,-ix1/2,-iy1/2,&p);
  draw_line(-ix1/2,-iy1/2,ix1/2,-iy1/2,&p);
  draw_line(ix1/2,-iy1/2,ix1/2,iy1/2,&p);
  p.end();
}

void edit_win::draw_all()
{
  draw_area->erase();
  draw_koord();

  if(liste_abb->count<=0) return;
  
  QPainter p;
  p.begin(draw_area);
  p.setPen(blue);
  for(int i=0;i<liste_abb->count;i++)
    if(i!=actual_abb) draw_abb(i,&p);
  p.setPen(red);
  draw_abb(actual_abb,&p);
  p.setPen(green);
  draw_kontaktp(&p);
  p.end();

}

void edit_win::draw_abb(unsigned int i,QPainter *p)
{
  abbildung test;
  liste_abb->daten[i]->put_in_abb(test);
  
  double x1,y1,x2,y2;

  test.do_it(x1,y1,ix1/2,iy1/2);
  test.do_it(x2,y2,-ix1/2,iy1/2);
  draw_line(x1,y1,x2,y2,p);

  test.do_it(x1,y1,-ix1/2,-iy1/2);
  draw_line(x1,y1,x2,y2,p);

  test.do_it(x2,y2,ix1/2,-iy1/2);
  draw_line(x1,y1,x2,y2,p);

  test.do_it(x1,y1,ix1/2,iy1/2);
  draw_line(x1,y1,x2,y2,p);
}

void edit_win::draw_kontaktp(QPainter *p)
{
  p->drawLine(kontaktp[0][0],kontaktp[0][1],kontaktp[1][0],kontaktp[1][1]);
  p->drawLine(kontaktp[1][0],kontaktp[1][1],kontaktp[2][0],kontaktp[2][1]);
  
  for(int i=0;i<3;i++)
    p->drawEllipse(kontaktp[i][0]-(_RADIUS_C>>1),
      kontaktp[i][1]-(_RADIUS_C>>1),_RADIUS_C,_RADIUS_C);
}

void edit_win::init_kontaktp(unsigned int i)
{
  if(i>=(unsigned)liste_abb->count) return;

  abbildung test;
  liste_abb->daten[i]->put_in_abb(test);
  
  double x,y,x1,y1;

  x1=-ix1/2+ix1*0.3;
  y1=-iy1/2+iy1*0.3;
  test.do_it(x,y,x1,y1);
  ifs_fenster.abb(x,y,x1,y1);
  kontaktp[0][0]=(int) x1;
  kontaktp[0][1]=(int) y1;
  
  x1=-ix1/2+ix1*0.3;
  y1=-iy1/2+iy1*0.5;
  test.do_it(x,y,x1,y1);
  ifs_fenster.abb(x,y,x1,y1);
  kontaktp[1][0]=(int) x1;
  kontaktp[1][1]=(int) y1;

  x1=-ix1/2+ix1*0.9;
  y1=-iy1/2+iy1*0.5;
  test.do_it(x,y,x1,y1);
  ifs_fenster.abb(x,y,x1,y1);
  kontaktp[2][0]=(int) x1;
  kontaktp[2][1]=(int) y1;
}  

void edit_win::draw_line(double x1,double y1,double x2,double y2,QPainter *p)
{
  double xs,ys;
  int zw1x,zw1y,zw2x,zw2y;
  
  ifs_fenster.abb(x1,y1,xs,ys);
  zw1x=(int)xs;
  zw1y=(int)ys;
  
  ifs_fenster.abb(x2,y2,xs,ys);
  zw2x=(int)xs;
  zw2y=(int)ys;
  
  p->drawLine(zw1x,zw1y,zw2x,zw2y);
}
 
void edit_win::draw_point(double x,double y,QPainter *p)
{
  double xs,ys;
  int zw1x,zw1y;
  
  ifs_fenster.abb(x,y,xs,ys);
  zw1x=(int)xs;
  zw1y=(int)ys;
  
  p->drawPoint(zw1x,zw1y);
} 

edit_win::~edit_win()
{
  sleep();
}

void edit_win::sleep()
{
  delete liste_abb;
  liste_abb=NULL;
  actual_abb=0;
}

void edit_win::change_val()
{
  if(liste_abb->count==0) return;
  
  abb_alternativ *t=liste_abb->daten[actual_abb];
  
  t->rot=rot_i->get_wert()*_PId180;
  t->x=scx_i->get_wert();  
  t->y=scy_i->get_wert();
  t->s=schx_i->get_wert();
  t->e=transx_i->get_wert();  
  t->f=transy_i->get_wert();

  liste_abb->change(actual_abb);

  init_kontaktp(actual_abb);
  draw_all();
}

void edit_win::init_i(unsigned int i)
{
  if(i>=(unsigned)liste_abb->count) return;
  
  abb_alternativ *t=liste_abb->daten[actual_abb];
  
  rot_i->set_wert(t->rot*_180dPI);
  scx_i->set_wert(t->x);  
  scy_i->set_wert(t->y);
  schx_i->set_wert(t->s);
  transx_i->set_wert(t->e);
  transy_i->set_wert(t->f);

  init_kontaktp(actual_abb);
  draw_all();
}

void edit_win::add_abb()
{
  abb_alternativ *t;
  
  t=new abb_alternativ();
  CHECK_PTR(t);
  
  t->x=0.5;
  t->y=0.5;
  t->rot=0;
  t->e=0;
  t->f=0;
  t->s=0;

  actual_abb=liste_abb->count;

  liste_abb->add(t);

  init_i(actual_abb);

  QString s;
  s.sprintf("No %d",actual_abb);
  auswahl->insertItem(s);
  auswahl->setCurrentItem(actual_abb);
}

void edit_win::new_selected(int i)
{
  actual_abb=i;
  init_i(i);
}

void edit_win::resizeEvent(QResizeEvent*)
{
  arrange();
}

void edit_win::_mousePressEvent(QMouseEvent* p)
{
  if(liste_abb->count<=0) return;
  if(p->button()!=1) return;
  int i;
  for(i=0;i<3;i++)
    if(sqr(p->x()-kontaktp[i][0])+sqr(p->y()-kontaktp[i][1])
      <=sqr(_RADIUS_C)) break;
  if(i==3) return;
  mouse_was=i;
  mouse_abb=*liste_abb->daten[actual_abb];
  for(i=0;i<3;i++)
  {
    oldp[i][0]=kontaktp[i][0];
    oldp[i][1]=kontaktp[i][1];
  }
}

void edit_win::_mouseReleaseEvent(QMouseEvent *)
{
  mouse_was=-1;
}

void edit_win::_mouseMoveEvent(QMouseEvent *p)
{
  if(mouse_was==-1) return;

  abb_alternativ *t;
  
  t=liste_abb->daten[actual_abb];

  if(mouse_was==0)
  {
#if 0
    double h2,h1,d1,d2,dx1,dx2,dy1,dy2;
  
    dx1=oldp[0][0]-oldp[1][0];
    dy1=oldp[0][1]-oldp[1][1];  

    dx2=p->x()-oldp[1][0];
    dy2=p->y()-oldp[1][1];

    dx1=dx1/ifs_fenster.scalex;
    dy1=dy1/ifs_fenster.scaley;
       
    dx2=dx2/ifs_fenster.scalex;
    dy2=dy2/ifs_fenster.scaley;

    d1=sqrt(dx1*dx1+dy1*dy1);
    d2=sqrt(dx2*dx2+dy2*dy2);

    if(fabs(d1)<1e-9) return;
    
    t->y=mouse_abb.y*d2/d1;

////////////////////////////

    dx1=oldp[2][0]-oldp[1][0];
    dy1=oldp[2][1]-oldp[1][1];

    dx1=dx1/ifs_fenster.scalex;
    dy1=dy1/ifs_fenster.scaley;
    d1=sqrt(dx1*dx1+dy1*dy1);
 
    h1=(dx1*dx2+dy1*dy2)/d1;

    dx2=oldp[0][0]-oldp[1][0];
    dy2=oldp[0][1]-oldp[1][1];

    dx2=dx2/ifs_fenster.scalex;
    dy2=dy2/ifs_fenster.scaley;
    d2=sqrt(dx2*dx2+dy2*dy2);

    h2=(dx1*dx2+dy1*dy2)/d1;

    t->y=mouse_abb.y*h2/h1;

    init_i(actual_abb);
    liste_abb->change(actual_abb);
#endif
  }

  if(mouse_was==1)
  {
    double dx,dy;
    
    dx=p->x()-oldp[1][0];
    dy=p->y()-oldp[1][1];
    
    dx=dx/ifs_fenster.scalex;
    dy=dy/ifs_fenster.scaley;
    
    t->e=mouse_abb.e+dx;
    t->f=mouse_abb.f+dy;

    init_i(actual_abb);    
    liste_abb->change(actual_abb);
  }

  if(mouse_was==2)
  {
    double dx1,dy1,dx2,dy2,l1,l2,alpha1,alpha2;
    
    dx1=p->x()-oldp[1][0];
    dy1=p->y()-oldp[1][1];
    
    dx2=oldp[2][0]-oldp[1][0];
    dy2=oldp[2][1]-oldp[1][1];
   
    dx1=dx1/ifs_fenster.scalex;
    dy1=dy1/ifs_fenster.scaley;
       
    dx2=dx2/ifs_fenster.scalex;
    dy2=dy2/ifs_fenster.scaley;
    
    l1=sqr(dx1)+sqr(dy1);
    l2=sqr(dx2)+sqr(dy2);

    if(fabs(l1)<1e-12) return;
    if(fabs(l2)<1e-12) return;

    l1=sqrt(l1);
    l2=sqrt(l2);

    alpha1=acos(dx1/l1);
    if(dy1<0) alpha1=2*_PI-alpha1;
    alpha2=acos(dx2/l2);
    if(dy2<0) alpha2=2*_PI-alpha2;

    alpha1=alpha1-alpha2;
    
    t->rot=mouse_abb.rot+alpha1;
    l1=l1/l2;
    t->x=mouse_abb.x*l1;
    t->y=mouse_abb.y*l1;    

    init_i(actual_abb);    
    liste_abb->change(actual_abb);
  }
}

void edit_win::test_ifs()
{
  if(is_ifs==0)
  {
    is_ifs=1;
    timer_id=startTimer(1);
  } else 
  {
    is_ifs=0;
    killTimer(timer_id);
  }
}

void edit_win::timerEvent(QTimerEvent*)
{
  do_test_ifs();
}

void edit_win::do_test_ifs()
{
  if(liste_abb->count==0) return;
  
  if(liste_abb->ifs->is_ready==FALSE)
  {
    liste_abb->ifs->init_startp();
    liste_abb->ifs->daten[0]->fixpunkt(xr,yr);
  }

  QPainter p;
  p.begin(draw_area);
  p.setPen(yellow);

  for(int i=0;i<100;i++)
  {
    liste_abb->ifs->render(xr,yr,xr,yr);
    draw_point(xr,yr,&p);
  }
  p.end();
}

void edit_win::do_emit()
{
  emit ifs_ready();
}

my_ifs* edit_win::get_ifs()
{
  if(liste_abb->count==0) return NULL;
    
  my_ifs *ifs=new my_ifs();CHECK_PTR(ifs);
  
  for(int i=0;i<liste_abb->count;i++)
  {
    abbildung *test=new abbildung();CHECK_PTR(test);
    liste_abb->daten[i]->put_in_abb(*test);
    ifs->add(test,0);
  }
  ifs->init_startp();
  
  ifs->x1=-ix1/2;
  ifs->x2=-iy1/2;
  ifs->y1=ix1/2;
  ifs->y2=iy1/2;
  
  return ifs;
}

./ifsdaem-1.1/edit_win/ifs.cpp100664      0      0       10140  6637206104  14310 0ustar  rootroot/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */
  
#include "ifs.hpp"

abb_alt_handler::abb_alt_handler()
{
  count=0;
  daten=NULL;;

  ifs=new my_ifs();CHECK_PTR(ifs);
}

abb_alt_handler::~abb_alt_handler()
{
  if(ifs!=NULL) delete ifs;
  ifs=NULL;count=0;
  
  if(daten==NULL) return;
  for(int i=0;i<count;i++)
    if(daten[i]!=NULL) delete daten[i];
  free(daten);
  daten=NULL;
}

void abb_alt_handler::add(abb_alternativ *p)
{
  count++;
  daten=(abb_alternativ**)realloc(daten,count*sizeof(abb_alternativ*));
  CHECK_PTR(daten);
  daten[count-1]=p;

  abbildung *t1=new abbildung();
  p->put_in_abb(*t1);
  ifs->add(t1,10);
}

void abb_alt_handler::change(unsigned int i)
{
  if(i>=(unsigned)count) return;
  daten[i]->put_in_abb(*ifs->daten[i]);
  ifs->is_ready=FALSE;
}

//****************

my_ifs::my_ifs()
{
  daten=NULL;
  p=NULL;
  startp=NULL;

  count=0;

  x1=x2=y1=y2=0;

  is_ready=FALSE;
}

my_ifs::~my_ifs()
{
  for(int i=0;i<count;i++)
    delete daten[i];

  if(daten!=NULL) free(daten);
  if(p!=NULL) free(p);
  if(startp!=NULL) free(startp);
  
  count=0;is_ready=FALSE;
}

void my_ifs::add(abbildung *res,double p1)
{
  count++;
  
  daten=(abbildung**)realloc(daten,count*sizeof(abbildung*));CHECK_PTR(daten);
  p=(double*)realloc(p,count*sizeof(double));CHECK_PTR(p);
  startp=(double*) realloc(startp,count*sizeof(double));CHECK_PTR(startp);
  
  daten[count-1]=res;
  p[count-1]=p1;

  is_ready=FALSE;
}

void my_ifs::init_p()
{
  double d;
  
  for(int i=0;i<count;i++)
  {
    p[i]=fabs(daten[i]->det());
  }

  for(int j=0;j<2;j++)
  {
    d=0;

    for(int i=0;i<count;i++)
      if(p[i]<1e-6) p[i]=0.01;

    for(int i=0;i<count;i++)
      d+=p[i];
    
    for(int i=0;i<count;i++)
      p[i]=p[i]/d;
  }
}

void my_ifs::check_p()
{
  for(int i=0;i<count;i++)
    if(p[i]<0)
    {
      init_p();return;
    } 

  double d=0;
  for(int i=0;i<count;i++)
    d+=p[i];
    
  if(fabs(d-1)>1e-4)
  {
    init_p();return;
  }
}

void my_ifs::init_startp()
{
  double d=0;
 
  check_p();
  
  for(int i=0;i<count;i++)
  {
    d+=p[i];
    startp[i]=d;  // eher endp
  }
}

int my_ifs::check_ifs()
{
  if(count==0) return FALSE;
  for(int i=0;i<count;i++)
  {
    if(fabs(daten[i]->a)>=1) return FALSE;
    if(fabs(daten[i]->b)>=1) return FALSE;
    if(fabs(daten[i]->c)>=1) return FALSE;
    if(fabs(daten[i]->d)>=1) return FALSE;
    if(fabs(daten[i]->det())>=1) return FALSE;
  }
  return TRUE;
}

int my_ifs::init_ifs(double& x,double& y,int test)
{
  if(check_ifs()==FALSE) return FALSE;
  init_startp();
  daten[0]->fixpunkt(x,y);
  is_ready=TRUE;
  if(test) get_grenzen(x,y);
  return TRUE;
}

void my_ifs::get_grenzen(double x,double y)
{
  x1=1e7;
  x2=-1e7;
  y1=1e7;
  y2=-1e7;

  for(int i=0;i<2000;i++)
  {
    if(x<x1) x1=x;
    if(x>x2) x2=x;
    if(y<y1) y1=y;
    if(y>y2) y2=y;
    render(x,y,x,y);
  }
  
  double mx=(x1+x2)/2,my=(y1+y2)/2;
  x1=mx+(x1-mx)*1.1;
  x2=mx+(x2-mx)*1.1;
  y1=my+(y1-my)*1.1;
  y2=my+(y2-my)*1.1;
}

void my_ifs::render(double& xs,double& ys,double x,double y)
{
  unsigned int i=(unsigned)random_();

  if(i<(unsigned)count) {daten[i]->do_it(xs,ys,x,y);} else{xs=0,ys=0;}
}

void my_ifs::render(double& xs,double& ys,double x,double y,unsigned int i)
{
  if(i<(unsigned)count) {daten[i]->do_it(xs,ys,x,y);} else{xs=0,ys=0;}
}

int my_ifs::random_()
{
  double p=((double)random())/RAND_MAX;
  
  for(int i=0;i<count;i++)
    if(p<startp[i]) return i;
  return count-1; // im Zweifelsfall
}

./ifsdaem-1.1/edit_win/ifs.hpp100664    764    144        3275  6511675577  14624 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _ifs_hpp
  #define _ifs_hpp

#include "abbildung.hpp"

typedef double my_point[2];

#define cp_my_point(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];}

class my_ifs;

class abb_alt_handler
{
public:
  abb_alternativ **daten;
  int count;
  my_ifs *ifs;

  abb_alt_handler();
  ~abb_alt_handler();

  void add(abb_alternativ *p);
  void change(unsigned int i);
};

class my_ifs
{
public :
  abbildung **daten;
  double *p;
  double *startp;
  double x1,y1,x2,y2;
  int count,is_ready;
  
  my_ifs();
  ~my_ifs();

  void add(abbildung *res,double p1);
  void init_p();       // Intern
  void check_p();      // Intern
  void init_startp();  // Intern                
  int check_ifs();     // intern
  void render(double& xs,double& ys,double x,double y);
  void render(double& xs,double& ys,double x,double y,unsigned int i);
  int random_();

  int init_ifs(double& x,double& y,int test); //Das aufrufen
  void get_grenzen(double x,double y);
};

#endif
./ifsdaem-1.1/edit_win/edit_win.h100664    764    144        5517  6534771507  15301 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _edit_win_h
  #define _edit_win_h

#include <qlistbox.h>
#include <qpainter.h>
#include "qiandsc.h"
#include "ifs.hpp"
#include "koordsys.hpp"

#define _RADIUS_C 5

class draw_area_class;

class edit_win : public QWidget
{
  Q_OBJECT

public slots :
  void change_val();
  void add_abb();
  void new_selected(int i);
  void test_ifs();
  void do_emit();
  void clear_abb();
signals:
  void ifs_ready();
protected :
  void resizeEvent(QResizeEvent*);
  void timerEvent(QTimerEvent*);
public :
  qinpscr *rot_i,*transx_i,*transy_i,*schx_i,*scx_i,*scy_i;  // Scrolleisten
  QPushButton *clear_b,*add_b,*ifs_b,*emit_b;       // Buttons
  draw_area_class *draw_area;  // Das Fenster
  QListBox *auswahl;     // Die Liste

  double ix1,iy1; // Das IFS-Fenster, Zentrum : (0,0) ; Groesse : (ix1,ix2)
  int kontaktp[3][2];  // Die Mauspunkte
  int oldp[3][2];      // Fuer Maus
  koordsys ifs_fenster; // das Koordinatensystem

  abb_alt_handler *liste_abb; // die Abbildungen
  abb_alternativ mouse_abb;  // Fuer Maus
  
  int actual_abb;  // Wo sind wir?
  int mouse_was;    // fuer Maus
  int is_ifs;   // fuer testen
  int timer_id; // fuer testen
  double xr,yr; // fuer testen

  edit_win(QWidget *parent,const char *name=0);
  ~edit_win();

  void arrange();
  void init_koord();
  void draw_line(double x1,double y1,double x2,double y2,QPainter *p);
  void draw_point(double x,double y,QPainter *p);
  void draw_koord();
  void init_i(unsigned int i);
  void draw_all();
  void draw_abb(unsigned int i,QPainter *p);
  void draw_kontaktp(QPainter *p);
  void init_kontaktp(unsigned int i);
  void do_test_ifs();
  void edit_ifs(my_ifs *toedit);

  void sleep();

  void _mousePressEvent(QMouseEvent* p);
  void _mouseReleaseEvent(QMouseEvent *p);
  void _mouseMoveEvent(QMouseEvent *p);

  my_ifs * get_ifs();
};

class draw_area_class : public QWidget
{
protected:
  void paintEvent(QPaintEvent *);
  void mousePressEvent(QMouseEvent* p);
  void mouseReleaseEvent(QMouseEvent *p);
  void mouseMoveEvent(QMouseEvent *p);
public :
  edit_win *adult;
  draw_area_class(QWidget *parent,const char *name=0);
};

#endif
./ifsdaem-1.1/edit_win/qiandsc.h100664    764    144        3062  6511675624  15110 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _qtand_
  #define _qtand_

#include <qapp.h>
#include <qwidget.h>
#include <qpushbt.h>
#include <qlined.h>
#include <qlabel.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

class qinputandscroll : public QWidget
{
  Q_OBJECT

  protected :
  
  void resizeEvent(QResizeEvent *);

public slots :

  void input_ev();
  void scrollr_ev();
  void scrolll_ev();

signals :
  void ready();

  public :

  double wert,dx;

  QPushButton *schl,*schr;
  QLineEdit *input;

  qinputandscroll(QWidget *parent,const char *name=0);

  void set_wert(double d);
  void set_dx(double d);
  double get_wert(){return wert;}
  virtual void arrange();
};

class qinpscr : public qinputandscroll
{
public :
  QLabel *namel;
  int laenge;
  
  qinpscr(char *s,int i,QWidget *parent);
  void arrange();
};

#endif
./ifsdaem-1.1/edit_win/qiandsc.cpp100664    764    144        5425  6511675546  15453 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */
  
#include "qiandsc.h"

qinputandscroll::qinputandscroll(QWidget *parent,const char *name):QWidget(parent,name)
{
  resize(80,20);
  
  schl=new QPushButton("<",this,"t1");CHECK_PTR(schl);
  schl->setGeometry(0,0,20,20);
    
  schr=new QPushButton(">",this,"t1");CHECK_PTR(schr);
  schr->setGeometry(80-20,0,20,20);

  input=new QLineEdit(this,"t1");CHECK_PTR(input);
  input->setGeometry(20,0,80-40,20);
  input->setMaxLength(15);
  input->setText("0");

  connect(schl,SIGNAL(clicked()),this,SLOT(scrolll_ev()));
  connect(schr,SIGNAL(clicked()),this,SLOT(scrollr_ev()));
  connect(input,SIGNAL(returnPressed()),this,SLOT(input_ev()));

  wert=0;dx=1;
}

void qinputandscroll::arrange()
{
  input->resize(width()-2*schl->width(),height());
  schr->move(width()-schr->width(),0);
}

void qinputandscroll::set_wert(double d)
{
  char buf[20];
  sprintf(buf,"%.6g",d);
  input->setText(buf);
  wert=d;
}

void qinputandscroll::set_dx(double d)
{
  dx=d;
}

void qinputandscroll::scrolll_ev()
{
  wert-=dx;
  set_wert(wert);
  emit ready();
}

void qinputandscroll::scrollr_ev()
{
  wert+=dx;
  set_wert(wert);
  emit ready();
}

void qinputandscroll::input_ev()
{
  char *c,*zw;
  c=(char *)input->text();
  
  double d=strtod(c,&zw);

  if( ((long)(zw-c))!=(long)strlen(c))
  {
    set_wert(wert);
  } else wert=d;
  emit ready();
}

void qinputandscroll::resizeEvent(QResizeEvent *)
{
  arrange();
}

//***********************************

qinpscr::qinpscr(char *s,int i,QWidget *parent) : qinputandscroll(parent)
{
  setMinimumSize(120,20);
  namel= new QLabel(this,"t1");CHECK_PTR(namel);
  namel->setText(s);
  namel->setGeometry(0,0,i,20);
  laenge=i;
  
  arrange();
}

void qinpscr::arrange()
{
  schl->move(laenge,0);
  input->move(laenge+schl->width(),0);
  input->resize(width()-2*schl->width()-laenge,height());
  schr->move(width()-schr->width(),0);
}

/*
main(int argc,char **argv)
{
  QApplication a(argc,argv);
  qinputandscroll test(NULL);
  
  test.setGeometry(10,10,80,20);
  
  a.setMainWidget(&test);
  test.show();
  
  return a.exec();
}
*/
./ifsdaem-1.1/edit_win/koordsys.cpp100664    764    144        2631  6511675535  15700 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "koordsys.hpp"

koordsys::koordsys()
{
  scalex=1;
  scaley=1;
  centx=0;
  centy=0;
}

void koordsys::set_scale(double x,double y)
{
  scalex=x;
  scaley=y;
}

void koordsys::set_cent(double x,double y)
{
  centx=x;
  centy=y;
}

void koordsys::set_all(double oldx,double oldy,double nx,double ny,double scx,double scy)
{
  scalex=scx;
  scaley=scy;
  
  centx=nx-oldx*scalex;
  centy=ny-oldy*scaley;
}

void koordsys::abb(double x,double y,double& x1,double& y1)
{
  x1=x*scalex;
  y1=y*scaley;
  x1+=centx;
  y1+=centy;
}

void koordsys::inv(double x,double y,double& x1,double& y1)
{
  x1=x-centx;
  y1=y-centy;
  x1=x1/scalex;
  y1=y1/scaley;
}

./ifsdaem-1.1/edit_win/koordsys.hpp100664    764    144        2306  6511675605  15702 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _K_O_S_
  #define _K_O_S_

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

class koordsys 
{
public :
  double scalex,scaley,centx,centy;

  koordsys();
  
  void set_scale(double x,double y);
  void set_cent(double x,double y);
  void set_all(double oldx,double oldy,double nx,double ny,double scx,double scy);


  void abb(double x,double y,double& x1,double& y1);
  void inv(double x,double y,double& x1,double& y1);
};

#endif
./ifsdaem-1.1/edit_win/mqiandsc.cpp100664    764    144        3576  6511676002  15621 0ustar  timousers/****************************************************************************
** qinputandscroll meta object code from reading C++ file 'qiandsc.h'
**
** Created: Sun Apr 5 14:41:38 1998
**      by: The Qt Meta Object Compiler ($Revision: 2.14 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#if !defined(Q_MOC_OUTPUT_REVISION)
#define Q_MOC_OUTPUT_REVISION 2
#elif Q_MOC_OUTPUT_REVISION != 2
#error Moc format conflict - please regenerate all moc files
#endif

#include <qmetaobj.h>
#include "qiandsc.h"


const char *qinputandscroll::className() const
{
    return "qinputandscroll";
}

QMetaObject *qinputandscroll::metaObj = 0;

void qinputandscroll::initMetaObject()
{
    if ( metaObj )
	return;
    if ( strcmp(QWidget::className(), "QWidget") != 0 )
	badSuperclassWarning("qinputandscroll","QWidget");
    if ( !QWidget::metaObject() )
	QWidget::initMetaObject();
    typedef void(qinputandscroll::*m1_t0)();
    typedef void(qinputandscroll::*m1_t1)();
    typedef void(qinputandscroll::*m1_t2)();
    m1_t0 v1_0 = &qinputandscroll::input_ev;
    m1_t1 v1_1 = &qinputandscroll::scrollr_ev;
    m1_t2 v1_2 = &qinputandscroll::scrolll_ev;
    QMetaData *slot_tbl = new QMetaData[3];
    slot_tbl[0].name = "input_ev()";
    slot_tbl[1].name = "scrollr_ev()";
    slot_tbl[2].name = "scrolll_ev()";
    slot_tbl[0].ptr = *((QMember*)&v1_0);
    slot_tbl[1].ptr = *((QMember*)&v1_1);
    slot_tbl[2].ptr = *((QMember*)&v1_2);
    typedef void(qinputandscroll::*m2_t0)();
    m2_t0 v2_0 = &qinputandscroll::ready;
    QMetaData *signal_tbl = new QMetaData[1];
    signal_tbl[0].name = "ready()";
    signal_tbl[0].ptr = *((QMember*)&v2_0);
    metaObj = new QMetaObject( "qinputandscroll", "QWidget",
	slot_tbl, 3,
	signal_tbl, 1 );
}

// SIGNAL ready
void qinputandscroll::ready()
{
    activate_signal( "ready()" );
}
./ifsdaem-1.1/edit_win/main.prj100644    764    144         431  6533502117  14717 0ustar  timousers#
# xwpe - project-file: main.prj
# createted by xwpe version Version 1.4.2
#
 

CMP=	gcc
CMPFLAGS=	-g -I/usr/X11/lib/qt/include
LDFLAGS=	
EXENAME=	a.out
CMPSWTCH=	gnu
CMPMESSAGE=	'${?*:warning:}\"${FILE}\", line ${LINE}:* at or near * \"${COLUMN=AFTER}\"'

FILES=	  

install:
	 
./ifsdaem-1.1/edit_win/medit_win.cpp100664    764    144        4375  6534774154  16013 0ustar  timousers/****************************************************************************
** edit_win meta object code from reading C++ file 'edit_win.h'
**
** Created: Tue Jun 2 15:04:44 1998
**      by: The Qt Meta Object Compiler ($Revision: 2.14 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#if !defined(Q_MOC_OUTPUT_REVISION)
#define Q_MOC_OUTPUT_REVISION 2
#elif Q_MOC_OUTPUT_REVISION != 2
#error Moc format conflict - please regenerate all moc files
#endif

#include <qmetaobj.h>
#include "edit_win.h"


const char *edit_win::className() const
{
    return "edit_win";
}

QMetaObject *edit_win::metaObj = 0;

void edit_win::initMetaObject()
{
    if ( metaObj )
	return;
    if ( strcmp(QWidget::className(), "QWidget") != 0 )
	badSuperclassWarning("edit_win","QWidget");
    if ( !QWidget::metaObject() )
	QWidget::initMetaObject();
    typedef void(edit_win::*m1_t0)();
    typedef void(edit_win::*m1_t1)();
    typedef void(edit_win::*m1_t2)(int);
    typedef void(edit_win::*m1_t3)();
    typedef void(edit_win::*m1_t4)();
    typedef void(edit_win::*m1_t5)();
    m1_t0 v1_0 = &edit_win::change_val;
    m1_t1 v1_1 = &edit_win::add_abb;
    m1_t2 v1_2 = &edit_win::new_selected;
    m1_t3 v1_3 = &edit_win::test_ifs;
    m1_t4 v1_4 = &edit_win::do_emit;
    m1_t5 v1_5 = &edit_win::clear_abb;
    QMetaData *slot_tbl = new QMetaData[6];
    slot_tbl[0].name = "change_val()";
    slot_tbl[1].name = "add_abb()";
    slot_tbl[2].name = "new_selected(int)";
    slot_tbl[3].name = "test_ifs()";
    slot_tbl[4].name = "do_emit()";
    slot_tbl[5].name = "clear_abb()";
    slot_tbl[0].ptr = *((QMember*)&v1_0);
    slot_tbl[1].ptr = *((QMember*)&v1_1);
    slot_tbl[2].ptr = *((QMember*)&v1_2);
    slot_tbl[3].ptr = *((QMember*)&v1_3);
    slot_tbl[4].ptr = *((QMember*)&v1_4);
    slot_tbl[5].ptr = *((QMember*)&v1_5);
    typedef void(edit_win::*m2_t0)();
    m2_t0 v2_0 = &edit_win::ifs_ready;
    QMetaData *signal_tbl = new QMetaData[1];
    signal_tbl[0].name = "ifs_ready()";
    signal_tbl[0].ptr = *((QMember*)&v2_0);
    metaObj = new QMetaObject( "edit_win", "QWidget",
	slot_tbl, 6,
	signal_tbl, 1 );
}

// SIGNAL ifs_ready
void edit_win::ifs_ready()
{
    activate_signal( "ifs_ready()" );
}
./ifsdaem-1.1/edit_win/run.cpp100664    764    144        2056  6511675557  14634 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "edit_win.h"
#include <qapp.h>

main(int argc,char **argv)
{
  QApplication a(argc,argv);
  edit_win test(NULL);
  
  test.setGeometry(10,10,300,300);

  QObject::connect(&a,SIGNAL(lastWindowClosed()),&a,SLOT(quit()));
  
  a.setMainWidget(&test);
  test.show();
  
  return a.exec();
}

./ifsdaem-1.1/edit_win/edit_win.prj100664    764    144        1156  6511457332  15630 0ustar  timousers#
# xwpe - project-file: edit_win.prj
# createted by xwpe version Version 1.4.2
#
 

CMP=	gcc
CMPFLAGS=	-g
LDFLAGS=	
EXENAME=	test_edit
CMPSWTCH=	gnu
CMPMESSAGE=	'${?*:warning:}\"${FILE}\", line ${LINE}:* at or near * \"${COLUMN=AFTER}\"'

FILES=	/usr/programm/ifsdaem/edit_win/abbildung.cpp  \
	/usr/programm/ifsdaem/edit_win/edit_win.cpp /usr/programm/ifsdaem/edit_win/ifs.cpp  \
	/usr/programm/ifsdaem/edit_win/koordsys.cpp /usr/programm/ifsdaem/edit_win/medit_win.cpp  \
	/usr/programm/ifsdaem/edit_win/mqiandsc.cpp /usr/programm/ifsdaem/edit_win/qiandsc.cpp  \
	/usr/programm/ifsdaem/edit_win/run.cpp   

install:
	 
./ifsdaem-1.1/edit_win/edit_win1.h100644      0      0         414  6637731352  15030 0ustar  rootroot#include <qlistbox.h>
#include <qpainter.h>

#include "qiandsc.h"
#include "ifs.hpp"
#include "koordsys.hpp"

class tool_bar_class
{
  qinpscr *rotate_i,*transx_i,*scher_i,*scalex_i,*scaley_i;
  QListBox *die_abbildungen;
  QPushButton *clear_b,*add_b,*ifs_b,*emit_b;
./ifsdaem-1.1/example.gif100644    764    144       43351  6512351661  13651 0ustar  timousersGIF87a%23456678		9

::;

<=>>?@ABBCDEFFGHIJJ  K!!L""M##N$$N%%O&&P''Q((R))R**S++T,,U--V..V//W00X11Y22Z33[44[55\66]77^88_99_::`;;a<<b==c>>c??d@@eAAfBBgCCgDDhEEiFFjGGkHHkIIlJJmKKnLLoMMoNNpOOqPPrQQsRRsSStTTuUUvVVwWWwXXxYYyZZz[[{\\{]]|^^}__~``aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~µöķŸŹƺǻȼɽɾʿ,%H*\ȰÇ#JHŋ3jȱǏ CIɓ(Hɲ@\<i̛"K$XώD	(":b))b`ӫ
Hr`bx˓&"ª=CK
c]
aZT2SVb-A@0	Ma1*/hqsQ	A
pB/|0]t@$HʈD3
V5k)C
%; @oȚdˁDL@C8Yʎ.(LP@%\€3AP'_J0L Бȡ/@aEn@XhBQAS%LGHR<Cmw8@Q+<IZ9`/EL$t@9:^|AB!΀O@hbnQܡAK_QF	A0K)PP@A1-z/`(H@FA|1`*:p e\O@bw`Ql@xZ$@m5đLht!G@!pA
P6q	u%xñZTF$Bi- "8:
Od@	$1D;1Z00eC,X쥬r&FS
,XuD$nLaAH`E*ԠZ*  |pV(5E
p#lpDQ@(FSADw[T0F0RF3 ]l`&4ΐ*DjA`_bP9XJ(:B3vQ%bXЀF*;BFgt
g\Hh\q@	a8=A+x!){ 
EXl  LA8(d6Aʀ:D!ؐt` 8$a
xB`8a% B`
x+TG.1@7P&nTb8JQDLh >m!XTLsHԁ7p0`nX	Veu:*Akf dp0p>
.B>ى)"@ OA@|lȠځ(Z!P: RЃQ :^8"A
s
 xRЃ:\
8üR,TB( $@G0cA`db
6@d"() Q1(P͂x@
/(LU:i@30`)@@A?`PB@If0HQH+lj!+H&N4xBH(WpL9
EAVaYB0xGP@xr1DoHb@	n=
"XЂ(} s@U yFN$f젂	xV)7;H5(Nj
p
@ @@ &L0	9R@
 K(HD`_U(A9@^E$!
bPIpV'*P(L 0:	SPZ lHC$^Nx0#``Cj
y
x@`
Tpes&F`	]` -0	p!TJ]CL**h!x Ѐ,Xbvч(($pa[$CSvE\A^#	x:BP;.A
 |HF# /A K@a60B
?^ 
AXP& @Q
U'2
@$D@a
{Ȝ@8|lpU $fHm
J BC7
ICxAH;İ/.hQP ,\B!@B"73TJ`4w p)-DptNAq`.QEp1$:Z

P?a$(^(`ɌAC|Zdlc8PA@Ʌ-\ ^	Pnâ)LkBpb p	}0D60A'``2 JЃN@İ?A e`
OZ0^0p jy	: [A5X
I40M@CP	0Y@5
60E!@b`
Ph0G/`j 4p T@FPl$u\J )r7@\
@E/p&B/!j:
`p[\
pC`Q(P_0@RpjrREp0a76 @Yw!:0U[p xM`%@pHZP+S4|P0	R0
ZGNp	?@3	MΤ"P'`:Mpz 
w0@
;! )0	`Pep%]Ch>`MR0Q3`KPpMI0
@D12Ġ	vg>R;0<E>/^
<7a6P`j``mpc	dT	Pigb +}X1
Tp<N$7`
mI] mVLOPv@`d@z"H0	j30f  #6:raD^4^kjukza	@U`@Y8pt@PtA`c0uspP[@c{wOMt^^
Onp3
P b	14P#0\tiPwNi:@\@bd	]@	0-Px5^
!* [W	hp ;`XeҒ0M:P6v[	yIbQ~`.
6pRr
42TMPE
=q,Pp~0
PCPYpB0'p!0wd/!`P+ i
`	w	V0@_`C
Iy`{:wFJ{C`
peP2P67TP
R}@?*N9,0;p_ 
ɐ@>P50R7-9i*phm W p4@,ډG^P
Ffm	>_uy;p0"pd@:aN P%W
ah0"K*K$W0qF+rPx 1HW0%) N PLЯ!zP KaZ0JY pdP	uj.:
}W0p2pV:
ѥJ;`q^y0@"PVP&p@]8@˒w[8@
`{%Qog`p
1@*|
zI@G!(!Rct@X- Q= 1@1"RPpwU08L	+U
	q`#.p	g0	v&IF p&0|8=^DTpgC P`t	

U16@Pa
=j[qZ 30XTIm
t@4pUԯaW	|]GpETPQQ1$\J7U*@ZP\pd
 U`ڹ|m`
'pqq"aП!`Dp>P^4E@$`P0`KT^pny,SpF
 CA@0@X0Q00@k.	PU`QlVv`6"p@`7 
;+00t0TJ@"@O~}cTU`>$YP@$0AC~E
LDPD@0^p-!`
WKZ%L( %@V`i Bmp/?hAL#i'L@8m)^
$Tw
`P80
ct@oz"8 ,-pop%P
z/PP # BP~dP]X&Jo02	 |P+Y[#
KP
NVp}O`.P~Re`@W# ;`-Xy a:iY0հK},
XDp	:-0",PApvTPb})0Pr^h"w-IP2@0Pj.0qP	@+1
h2C <p@'p@@@#n	 AK0;= 
`0U@5$SP	;p=BQCP1'00P6J@G  z>gCE0Fhlr Z
}'
0l:?PBgja`Np	0
J`A{ Px
R`M o; 'le3V ^P
=Pf
x4 A@APq`q
h$#=: i
r~I@"d'<<aJI_9r!4B)]ʍ2#\C:0ၔAĄЅ39`ٲG'
n.Yc,*_!wpS$aD'^
!&9a.] U_7:4S5px((Nl4eΟ1bBCD'F
6|j	(U+͏D`	'rp󇏌V,A#{g.>dd1ؤ0z4p
GF8,l1(P84+(1"`C!dh
#BI'\@XB򠂮J@O$92
Gi˘4Av aɀ 
ADh%Z0nn@P!,v#Kv
06a68xh!+D0pI أ?0J2HK#hrXÙ
iΰ!Sb@8b3@j#A
()f.$h@!%dB>ޠÎRh:a6-̀d!#"
*8NF{NpDt
 ؈x#6[0!=FX"p0!#~"v0 $Hd,`@l`NX
Af'#F	!4@c|UŒA46'уa9fB>l%-E<`!rȣu(\ AA%Pd
LnADNLYVV%p@ܥX/D IcuD@|8@u0OC2{?B`Hpb8B JZPjж-"15X1A
p! @Lt4!AX$*0xt8B<`@"`28\ /<BK	?ʀ/ T\hC
¤D<P`K2"!T@ΐE+!6$N0	C
T% a	9ؐH!

m`q	*pA5nWʘXP`	'09AC0
EȄ(ЉVrHZd8C@Ł@Fx
/Pŗ|pI,0=C-@@P48`xpD.4Z+QH|IAgȁh`i0"6%~4$a>1@p`!~0~4a*`BE`S.:
b@DP<,B?&х=pG70M<8è+#B%QI/1AK	gR B
@
(@EH`KG)LQ54Ӊ4@)ޠH%	zp|3pxC>2ƀ	a+QQPYd@62 @
,O8	E 
]=k)	WE%500G'DaJfA`J@*,(V:@0.p"
=hFMdd/taG&0A|8D
$#A%F (
*&V<kћPz
A5t`)Xi3x# ?ڡ.4`AԆThB#a>0+A9Mr. lDR
Z@@!$0t
((#$=?c 	
(	
3p+@DOth ,q Dp&p/8Lh+`C>@
k(ΰ9ljB@0aE X
@/Pམ8!VH(x` 3$0@
#h"iCAt(
6HTCU(@h ,gh@x9B0prpy^ 	90c*P
"DGp[+(1@90"[Ei=P	CX(
:H? qBxP	
0@0
Q:H&6r)h.L00s2S="HHPLPi%P= ( )h&(R
$
h6/|
P4x+1'060x$XX%*0?7Z(x 
)O &?89؈P:R0>U!"7pHVF(\A)4H˘C
X`8OhAȁx`Lc2@+?G&zD`2Ѐ(h -'+XYHI@2(8P>hX@*3		
, CL(p	@-}h@p
48Ё8@h<h`kB`Pp @BXIPY@ &Pt/B`8X	LL.d%s	+`Hᘁ1Xp(k K1PA U40(H8<	0f|P$P%H{i#E 6, 
q%)X@5p,pHMP 0Ѝ(**	7;x:X˄MX1
Fr8:MڊhGUOp(
p3yч·8	,!&>VhV	 !`0yhU`3X@"X./)}P6TlS
@:5?h$PF8jw0%@h-X!7P+
ɇ48#v
x6
 Ix	 %<K PT`XMa@&2]2 : +aHIp!"5r "30x'{K#v+@+2"x+X? 8MHY&ekWG$X-	BERx	 (p5qJ8L6"68*5P/XY)H?؁L.؀=؄0PxqZ8?]*>(;-hA(؀pȇD@=E8"P0`<hOp0
`C*\Ђ0$؃OXG=-8ox
 B跗PFp8F`3ȃJX480"x'À+h	8 `_(:`bFx08604M(8="0T}z:!h@V3%6;9HDpB@\XU0%H
8	H*0X@LʹV8%z	r	H-54;+P"cx(E?spo,@,(](6
	E&
hX	 N8X@U3':p1H@Rzhu	?0';hmdd	P3PDP&(4Hu!18pDD,h"B1Ѐ0&(
g31.pl8H%F?ۀ8!xM؀>P,`xړ&3Ѐ!0}8`(HI85)+P$*`\pi0PV80؁`% 2;X)A](PGX
h6OAXv8^0@*pZM@0`> H);X1p*XHh,&x% 't"(<~>@C@z0D|7:m(v {Q\@&*2?vu)(<EH*~hRx($pxOHU4+R,[p3 :?&0'@,JP.qkM`2X"x Pnxj0C(|P*	4(( H F6hP'(-'
/`;tr:؃	ȂCh!`@>3fl5(^gȂxSh+gF	xBX*`WX2`M')&hPU (䇈 EPjD_ $5`"XB`?ȂxP(L F4ZhP+ X[_G&5ȂLe6>P$xiORȀn ,+Yh_H /Ȁ8pŝ'z}~hI"@[(Iؓ33HLH	xE  q*EPwK)=iXt-%5`ޫMSО`"`H#PwЅ;,(1,%E+p3`)0H8'
X=Ce3؂.Op9$X$`x@ȕ2:yׁ PM0F]&8І6(@*|.##DX ĈC	b"G,idA(S0/pC;yӆOxi	"	&!Q>
 `%"A%ڴjGn8rFYyc-=E_t5QBazI]dCH@8OX\0`-$
X]?yvb6.z0LD`Ɏ6\.Pp
BtP'gճp4%ℭ:78+`0%qji'@_*0AEK!M`XPPPhBDG`i@C!m@pc$qkAG32
cC1a08LQ (q#R,Q) n-V\_m\DEb2sF`lB@
L@G
 ?FxQ~p.*J/
>H	k\
eP)LX.XӅ~@B#!RTIqP@萍~]P
1$*$PFp8?@<O2=Bf	Gq#U@A
iP
?pC"IEx@GE}rP9p2(QH"bCI2p@ $xPz1%T!@pa
@"K<@%`F	Hg$QC?pq[S;_+H`S2<Y,|B
T@+VDX@R`2
Pp]qS70u(AAC
Hp	
D
uTV\2DLaT0RtL !yi2`
p"t D&g0HpMh+`8 p.ID,`;v$
6B
JVrY H
Z@	Lb`HPi@	
%пI} ,LH
$  81X
  p0#PHD P8AµT\B
d
)\.PkA$ RD	DFp	eh8p)aUD" =TLEg|nx2*1`a}B"܀8B 1<`*@
$0cOeDv$!F
Vpxȃ@D0B#
gc0((ZhpH@"?a
;-<`F
D"Dd1A uaB@,(6x\ڱ"$8V"?ґ1 X+aN=RЀ}j`QX҈
v` $AA	P$!	)2	,K%D0` B$bAх@B00,]4P-DcIpqT^xEX@
$1"
0@L*J1B&)HCD"q&@
q	:$`@V:V2"<p6`^˪3*,ЄIm0CZAPH@30u p.Ddl	,P1  )`	zHA1dM" Z@
R\<v !`X^t_
?&
rpA KB( 4GL Mx"`	q@L`H`@+& 	_+$6`؂@XxpL&hB$-8j\@`&VMrnXx<I@ALhpB
B<PMpVA!h02|(>p%b*tƠ|0;gW 2
`b81,q8
ehra%lr@L<'TYl 8	@7p*0@3P+](D
np!c01l	+-Ϣ<IܐC"(P> F	 
@
F0S(#Ѓaw0 X
Mp@	:HB^0@ah@dp:/|	$AEߪŸ$@l0p.,B,\XDY`4x!$|<1|Au
#
#\ @% @Ap'pA<C)0	DĀU$|T@P


@!Ѐ&
0/C,u@D(A8@Ej	,, ?l"Ah@"Cd042l`]@*BD@%@zxppC<,9.A*h*C-L B+A0@c;T4<Ȁ/I,`	I(8Bd@@Lmz`\D@"o%B3D8xȀ@h$P@X@L@P@?ph!/,tCA\p
	aYxA0@.
$|8P"%'H@HX5&j4d	!$HH@A*A@x@
l`4AG
0܂ ̀4'T ]AP'B`TMԀ@@H窼D4@4TB[@Y&{0A$	 A$RD(J(A'T`@x(AA
x@	@x@"\*?*A!ā)LPH
@e]@(ǕOhD0@؁%?($δL$@"h@ R@ T@@d?H2?	LH
A<B]|tiB4_Le@
@?0dfA \C- @ |@ԁ"d$(B6"DB9ЁX~@'tg@"hx"k؀&$lA"؂`@AD4 `'@#%DDA,!|@Y|@BhADxOD<;t`œ@HC@XD@	P6g6C|eP~>C-| &x!D ȁA\@lJ$A$"<l#D́ ؙP4B0B'	T0fJŚ2%X́"N@
TAR'A	88@+R	|%A"<*v`"84 AD\D@A$hAhrI́,B&
\d%a$%0hB(Hl@pA<eJ@@<jDؔD@,Rb)lB
T lA@ ApZ@&H|Jd(?dC&QD	xPA<$
,(lT@|.{ƀp
<Ce<A)tB!PaxāxDԀrя$0.\Ax<&D&/B(# 4dOD4
(¥-87̂+*:8A(@8B@sVRA4$PP4X"H@ %?HDB3HA
Ԁ9PK8D@
=
X @wt@-$@?0XAhA@8\h
04>A A&UgY@ OnA0h	
A&p\0ȁ <&	(?A
<!x*l?3%
JA@-5H B0u@c-@	Av0?`4 Ll
V1g BܳMhAR
!	*?w t@\B#IL
hɀ@(YwlÁ#5!)B	0@S!@X@
B-A/'X8\AP<)\€l>/<(蚨)A$$g$To@ jTH IT(AAʒBu(dDh&AX%Ptp@$:T/AdAlqD, DbP`@&؃%⪆,FM#p-(s!(@
>)A)Vi@
(é$&! PpA
L`<ɌP |¤@@l&|	0@7DX@@
e\%wC\
X@
A%t\ A'|H|(Dd,h@BmBl#?T$0,@4$b>@&\$l@AVH3\|,|@A%>3C-G@ɺ7!@dh@x 2A%TB At(@l!C&TaCA3]bJ
M%Jplyf-AndE#]!zd&Ztՙ2f0ɞafVB]P<Ժ3 т"lbwAm&9CO$rԧ
1HRg\W'*55<xqQa]QJ@<Tܡ$?)(N㊑4߿@APq-DA҂IP`LC3 !ƌ	x,!&P&?!1K
hIBp`A8RY2&9dPb #
  %nGHh#MPD|0
NCq>0*$F(yb(ΰ<fYR0H 0:PNh#
?$,A聄+x
ONl)X!*q%<*\8!P
8?plU>xA

l!0@HE*a)zX@ pBf`~X. 	\Mwrp`#
8_+BH
D8D
9	0u9NM-DX|5TD.(A†+xbKvU00b,h:G8DvAXPdCLA2`C#Hy1ȡ!28+C*4@C)@hD'x@
 @`϶)q(c`embހc0?Gy(8D3;acC'h?@{EH;#>I$ X`4C 7!3Q):00AA`JC<K`Įp+P,.!@v	TL[	qddCP>&GD%vYKtE)NUE-n]ƀ;./ifsdaem-1.1/farben.cpp100664    764    144        4212  6511675424  13450 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "farben.hpp"

my_farben::my_farben()
{
  daten=NULL;
  von_wo=NULL;
  count=0;
}

my_farben::~my_farben()
{
  clear();
}

void my_farben::clear()
{
  if(daten!=NULL) free(daten);
  if(von_wo!=NULL) free(von_wo);
  daten=NULL;
  count=0;
  von_wo=NULL;
}

void my_farben::add(unsigned int a,int r,int g,int b)
{
  count++;
  daten=(unsigned char*) realloc(daten,count*3*sizeof(unsigned char));
  von_wo=(unsigned int*) realloc(von_wo,count*sizeof(unsigned int));
  CHECK_PTR(daten);
  CHECK_PTR(von_wo);

  daten[(count-1)*3]=r;
  daten[(count-1)*3+1]=g;
  daten[(count-1)*3+2]=b;

  if(count==1) {von_wo[0]=0;} 
    else {von_wo[(count-1)]=von_wo[(count-2)]+a;}
}

void my_farben::get(unsigned int a,int& r,int& g,int& b)
{
  int i;
  
  if(count==0) 
  {
    r=0;
    g=0;
    b=0;
    return;
  }

  for(i=0;i<count;i++)
    if(a<von_wo[i]) break;

  if(i==count)
  {
    r=daten[(count-1)*3];
    g=daten[(count-1)*3+1];
    b=daten[(count-1)*3+2];
    return;
  }
  
  i--;
  
  long l1=a-von_wo[i];
  long l2=von_wo[i+1]-von_wo[i];
  
  unsigned char dx[3],x[3];
  
  for(int j=0;j<3;j++)
  {
    dx[j]=daten[(i+1)*3+j]-daten[i*3+j];
    x[j]=daten[i*3+j];
  }
  
  r=x[0]+(dx[0]*l1)/l2;
  g=x[1]+(dx[1]*l1)/l2;
  b=x[2]+(dx[2]*l1)/l2;
}

// ---------------------------zum Testen----------------

/*

main()
{
  my_farben t;
  int r,g,b;
  
  t.get(10,r,g,b);
  
  printf("%d %d %d\n",r,g,b);
}

*/
./ifsdaem-1.1/farben.hpp100664    764    144        2140  6511675377  13462 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#ifndef _farben_hpp
#define _farben_hpp

#include <stdio.h>
#include <stdlib.h>
#include <qobject.h>

class my_farben
{
public :

  unsigned char *daten;
  unsigned int *von_wo;
  int count;

  my_farben();
  ~my_farben();

  void clear();
  void add(unsigned int a,int r,int g,int b);

  void get(unsigned int a,int& r,int& g,int& b);
};

#endif
./ifsdaem-1.1/file_win.h100664    764    144       13365  6534775312  13507 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */


#ifndef _fwin_H
#define _fwin_H

#include <qwidget.h>
#include <qmenubar.h>
#include <qmlined.h>
#include <qpushbt.h>
#include <qlistbox.h>
#include <qbttngrp.h>
#include <qradiobt.h>
#include <qpainter.h>
#include <qpen.h>
#include <qcolor.h>
#include <qapp.h>
#include <qfile.h>
#include <qfiledlg.h>
#include <qkeycode.h>
#include <qpopmenu.h>
#include <qtstream.h>
#include <qmsgbox.h>
#include <qimage.h>
#include <qcombo.h>

#include "standart.h"
#include "parse.hpp"
#include "./edit_win/edit_win.h"
#include "farben.hpp"

class ifs_handler;
class ifs_drawer;
class configuration;
class ifs_win;

//--------------------------------------

class ifs_file_editor:public QWidget
{
  Q_OBJECT

public :  

  ifs_file_editor(QWidget *parent=NULL,const char *name=NULL);
  ~ifs_file_editor();

public slots:

  void load();
  void load( const char *fileName );
  void save_as();
  void create();
  void save();

  void do_paste();
  void savegrafik();
  void open_ifs_edit();
  void do_compile();
  
protected:

  void resizeEvent( QResizeEvent * );
  void closeEvent(QCloseEvent *);

public:

// Andere Fenster :

  edit_win *ifs_edit;
  ifs_drawer *draw_area;
  ifs_win *ifs_commando;

// Config :

  configuration *config;

private:

  char *f_name;

  QMenuBar  *menu;
  QMultiLineEdit *editor;

  void save(const char *fileName);  
  void GNU();

  friend ifs_win;

};
extern ifs_file_editor *master;

//--------------------------------------
// Warnung : ruft master->config in constructor auf
// muss deshalb nach config kommen
class ifs_win : public QWidget
{
  Q_OBJECT
public:

  ifs_win( QWidget *parent=0, const char *name=0 );
 ~ifs_win();

public slots:

  void do_compile();
  void was_nehmen_ev(int );
  void do_run();
  void draw_art_ev(int);
  void selected_ev(int);
  void how_much_ev();
  void accept_ifs();
  void combo_ev(int i);
  void do_edit();

protected:

  void resizeEvent( QResizeEvent * );

private:

  int was_nehmen_int;  // 0: auswahl, 1: buffer
  int draw_art_int;    // 0 : exakt, 1:zufall
  int which_selected;  // die Liste
  int is_changed;      // ifs_drawer -> den Speicher neu
  int how_much_int;    // Wieviel mal den alg. durchlaufen
 
  QListBox *select;
  QPushButton *run_b,*edit_b;
  QButtonGroup *was_nehmen,*draw_art;
  qinpscr *how_much;
  QComboBox *combo_list;

  ifs_handler *list_of_ifs;
  my_ifs *zwischenablage;

  void save(const char *fileName );
  void arrange();

  friend ifs_file_editor;

};

//-----------------------------

class ifs_drawer : public QWidget
{

protected:

  void paintEvent(QPaintEvent *);
  void resizeEvent(QResizeEvent*);
  void closeEvent(QCloseEvent*);

public :

  my_ifs *todraw;
  int zustand;
  koordsys ifs_fenster;
  my_ifs *zw_ifs;
  
  unsigned int *int_buffer;
  char *buf1,*buf2,*buf3;
  double xz,yz;
  int mem_x,mem_y;
  long buf_size;

  double xz1,yz1;

  ifs_drawer(QWidget *parent=0,const char *name=0);
  ~ifs_drawer();
  
  void init_zustand(int i);
  void init_zufall();
  void init_determ();

  void make_koord();

  void sleep(); // Befreit Speicher
  void draw_zufall(QPainter *p);
  void do_zufall(long int howmuch);
  void draw_zufall_xy(int x1,int y1,QPainter *p);

  int access_read(int x,int y);
  void access_write(int x,int y);
  void prepare_buffers();

  void do_determ(int howmuch);
  void draw_determ(QPainter *p);

  void set_all(my_ifs *p,int zu,int test);
  void do_it(long how_much);

  void savegrafik(const char *ffname);

};

//-------------------------------------------------

class ifs_handler
{
public :
  my_ifs ** liste;
  int count;
  
  ifs_handler();
  ~ifs_handler();

  void add(my_ifs *p);
};

class ifs_parser: public  parse_data
{
public :

  ifs_handler *write_to;
  QListBox *write_to1;
  QMultiLineEdit *get_from;
  int x,y;

  ifs_parser();

  void set_write_to(ifs_handler *p,QListBox *p1);
  void set_get_from(QMultiLineEdit *p);

  int parse();
  int parse_ifs();

  int get_one_char();
};

//----------------------

#define daten_t_raw 0

class daten_inhalt
{
 protected :
  
  int type;
  
 private:
  
  daten_inhalt *next;
  
 public :
  
  daten_inhalt();
  virtual ~daten_inhalt();

  void set_next(daten_inhalt *n);
  daten_inhalt *get_next();
  void add(daten_inhalt *p);

  int get_type() {return type;};
};

class daten_speicher
{
 private:

  daten_inhalt *first,*last; 
  int count;

 public :

  daten_speicher();
  ~daten_speicher();

  void add(daten_inhalt *p);
  daten_inhalt *get(int i);

  int howmuch() {return count;};
};

//----------------------

#define daten_t_farben 1

class farben_inhalt : public daten_inhalt
{
 private:
 
  my_farben *inhalt;
  char *fname;
 
public:

  farben_inhalt();
  ~farben_inhalt();
  
// fr s wird neu speicher geholt
  void set(my_farben *p,char *s);

  my_farben* get_inhalt() {return inhalt;};
  const char *get_name() {return (const char*)fname;};
};

class configuration
{
  daten_speicher liste_der_farben;
public :

  int aktuelle_farb_tafel;

  configuration();
  ~configuration();

  void init_farb_tafel();
  void get_farbe(long i,QColor *p);
  void init_combo(QComboBox *p);
};

#endif
./ifsdaem-1.1/file_win.prj100664    764    144        1577  6511207500  14015 0ustar  timousers#
# xwpe - project-file: file_win.prj
# createted by xwpe version Version 1.4.2
#
 

CMP=	gcc
CMPFLAGS=	-g -I/usr/include/qt
LDFLAGS=	-lm -lqt
EXENAME=	ifsdaem
CMPSWTCH=	gnu
CMPMESSAGE=	'${?*:warning:}\"${FILE}\", line ${LINE}:* at or near * \"${COLUMN=AFTER}\"'

FILES=	/usr/programm/ifsdaem/ifs_drawer.cpp  \
	/usr/programm/ifsdaem/ifs_file_editor.cpp /usr/programm/ifsdaem/ifs_utils.cpp /usr/programm/ifsdaem/ifs_win.cpp  \
	/usr/programm/ifsdaem/edit_win/edit_win.cpp /usr/programm/ifsdaem/edit_win/medit_win.cpp  \
	/usr/programm/ifsdaem/edit_win/koordsys.cpp /usr/programm/ifsdaem/mfile_win.cpp /usr/programm/ifsdaem/parse.cpp  \
	/usr/programm/ifsdaem/edit_win/qiandsc.cpp /usr/programm/ifsdaem/edit_win/mqiandsc.cpp /usr/programm/ifsdaem/run.cpp  \
	/usr/programm/ifsdaem/farben.cpp /usr/programm/ifsdaem/edit_win/abbildung.cpp  \
	/usr/programm/ifsdaem/edit_win/ifs.cpp   

install:
	 
./ifsdaem-1.1/fract.ifs100664    764    144       20244  6636723555  13343 0ustar  timousers
;a few IFS from fractint :

binary { 
    0.5 0 0 0.5 0 0 0.3333
    0.5 0 0 0.5 0.5 0 0.3333
    0 -0.5 0.5 0 1 0.5 0.3334
  }

coral { 
  .307692 -.531469 -.461538 -.293706  5.401953 8.655175 .40
  .307692 -.076923  .153846 -.447552 -1.295248 4.152990 .15
  .000000  .545455  .692308 -.195804 -4.893637 7.269794 .45
  }

crystal { 
  .696970 -.481061 -.393939 -.662879 2.147003 10.310288 .747826
  .090909 -.443182  .515152 -.094697 4.286558  2.925762 .252174
  }

dragon { 
  .824074 .281482 -.212346  .864198 -1.882290 -0.110607 .787473
  .088272 .520988 -.463889 -.377778  0.785360  8.095795 .212527
  }

fern {
    0	 0    0  .16 0	 0 .01
   .85	.04 -.04 .85 0 1.6 .85
   .2  -.26  .23 .22 0 1.6 .07
  -.15	.28  .26 .24 0 .44 .07
  }

floor { 
  .0 -.5  .5 .0 -1.732366 3.366182 .333333
  .5  .0  .0 .5 -0.027891 5.014877 .333333
  .0  .5 -.5 .0  1.620804 3.310401 .333333
  }

koch3 { 
  .307692 -.000000  .000000  .294118  4.119164 1.604278 .151515
  .192308 -.205882  .653846  .088235 -0.688840 5.978916 .253788
  .192308  .205882 -.653846  .088235  0.668580 5.962514 .253788
  .307692 -.000000  .000000  .294118 -4.136530 1.604278 .151515
  .384615 -.000000  .000000 -.294118 -0.007718 2.941176 .189394
  }

spiral { 
   .787879 -.424242 .242424 .859848  1.758647 1.408065 .895652
  -.121212  .257576 .151515 .053030 -6.721654 1.377236 .052174
   .181818 -.136364 .090909 .181818  6.086107 1.568035 .052174
  }

swirl5 { 
   .745455 -.459091  .406061  .887121 1.460279 0.691072 .912675
  -.424242 -.065152 -.175758 -.218182 3.809567 6.741476 .087325
  }

tree { 
    0	 0   0	.5   0	 0  .05
  .42 -.42  .42 .42  0	.2  .4
  .42  .42 -.42 .42  0	.2  .4
   .1	 0   0	.1   0	.2  .15
  }

zigzag2 { ; -6.85 -0.15 6.85 10.14
  -.632407 -.614815 -.545370 .659259 3.840822 1.282321 .888128
  -.036111  .444444  .210185 .037037 2.071081 8.330552 .111872
  }


Sierptri1 { 
  .5  0  0  .5	0  0  .333
  .5  0  0  .5	0  1  .333
  .5  0  0  .5	1  1  .334
  }

; von Mir:

Sierptri2 { 
  .5  0  0  .5	0  0  .333
  .5  0  0  .5	1  0  .333
  .5  0  0  .5	0.5  1 .334
  }

Spirale { 
   0.8   -0.27  0.41   0.97 0.24 -0.14 0.95
   0.2   0      0      -0.2 0.72 0.24 0.5
  }

Seltsam { 
  -0.503  -0.326  0.326   -0.503  0   0    0.333
  -0.503  0.326  -0.326   -0.503  0.5 0.5  0.333
  0.245   -0.548  0.548   0.245   0   0    0.334
 }

Blatt { 
  0.35  0.35  -0.35 0.35  0.4  -0.2  0.25
  0.35  -0.35  0.35  0.35  -0.4 -0.2 0.25
  0.5   0     0     0.5   0     0.3  0.25
  0.5   0     0     0.5   0    -0.3  0.25
  }

Koch { 
  0.3333 0 0 0.3333 0 0     0.25
  0.3333 0 0 0.3333 0.6666 0    0.25
  0.1667 -0.2887 0.2887 0.1667 0.3333 0     0.25
  0.1667 0.2887 -0.2887 0.1667 0.5 0.2887   0.25
}

Schwamm { ; nicht so schn
  0.333 0 0 0.333 0.0   0      0.125
  0.333 0 0 0.333 0.333 0      0.125
  0.333 0 0 0.333 0.667 0      0.125
  0.333 0 0 0.333 0     0.667  0.125
  0.333 0 0 0.333 0.333 0.667  0.125
  0.333 0 0 0.333 0.667 0.667  0.125
  0.333 0 0 0.333 0     0.333  0.125
  0.333 0 0 0.333 0.667 0.333  0.125
  }

Schere { 
  0 0.5 0.5 0 0 0  0.333
  0 -0.5 -0.5 0 12 6 0.333
  0.5 0 0 0.5 3 1.5 0.334
  }

MeinFarn 
{ 
  0.18018 -0.3333 0.21712 0.23 3.279 0.03153 0.16
  -0.20248 0.30833 0.26059 0.24167 4.80991 0.757 0.16
  0.725 0 0 0.725 1.1 3.3 0.67
  0 0 0 0.35 4 0 0.01
}

Spiess { 
  0.5 0 0 0.5 0 0  0.333
  0.5 0 0 0.5 0.5 0  0.333
  0.5 0 0 -0.5 0 1 0.334
  }

b301_1Mod {
  -0.5 0 0 -0.5 0.5 1 0.333
  0.5 0 0 -0.5 0 0.5  0.333
  -0.5 0 0 -0.5 1 0.5 0.334
  }

b301_1 { 
  -0.5 0 0 -0.5 0.5 1 0.333
  -0.5 0 0 0.5 0.5 0  0.333
  -0.5 0 0 -0.5 1 0.5 0.334
  }

b301_2 { 
  0 -0.5 0.5 0 0.5 0.5 0.333
  0 0.5 -0.5 0 0 0.5   0.333
  -0.5 0 0 -0.5 1  0.5 0.334
  }

b301_10Mod { 
0 -0.5 0.5 0 0.5 0.5 0.333
0 0.5 -0.5 0 0 0.5   0.333
-0.5 0 0 0.5 1  0    0.334
}

b301_9 { 
  0.5 0 0 -0.5 0.5 0.5  0.333
  -0.5 0 0 0.5 0.5 0.5  0.333
  0.5 0 0 0.5 0 0       0.334
 }

b118 { 
  0.48351 -0.59381 0.29175 0.50309 2.18722 -0.48639 0.5
  0.49 -0.62 0.36 0.52 1.99 1.98 0.5
  }

Stern { 
  0.333 0 0 0.333  0.333 0     0.1666
  0.333 0 0 0.333  1     0     0.1666
  0.333 0 0 0.333  0     0.666 0.1666
  0.333 0 0 0.333  1.333 0.666 0.1666
  0.333 0 0 0.333  0.333 1.333 0.1666
  0.333 0 0 0.333  1     1.333 0.1666
  }

berg1 { ; eine fraktale Interpolationskurve
  0.5000 0.0000 0.5000 0.5000 0.0000 0.0000 0.5000
  0.5000 0.0000 -0.5000 0.5000 0.5000 0.5000 0.5000
  }

Sierptri3 { 
0.5 0 0 0.5 -24.8976 24.8976 0.314197
0.5 0 0 0.5 24.8976 24.8976 0.314197
0.5 0 0 0.5 -2.22045e-16 -25.5279 0.314197
0.168421 0.131579 -0.131579 0.168421 -3.15159 16.0731 0.0574084
}


Blattno1 { 
  0.288462 -0.317308 0.317308 0.288462 -32.7485 -27.4854 0.153579
  0.326923 0.336538 -0.336538 0.326923 29.8246 -26.3158 0.183847
  0.634615 0 0 0.634615 -1.16959 -18.7135 0.336345
  0.625 0 0 0.625 -1.75439 9.35673 0.32623
  }

Graete { 
  -0.319478 0.384621 -0.384621 -0.319478 -9.44669 -22.6721 0.308051
  0.734273 -0.149656 0.149656 0.734273 4.04858 14.305 0.691949
  }

Riss_im_Raum { 
  0.457746 -0.211268 0.211268 0.457746 -16.5869 -8.50611 0.28902
  -0.337874 0.714899 -0.714899 -0.337874 14.0351 7.44285 0.71098
  }


Weihnachtsbaum { 
  0.492044 0.183848 -0.183848 0.492044 -21.3965 -14.5191 0.348558
  0.49799 -0.190814 0.190814 0.49799 21.3965 -15.2832 0.359292
  0.480892 -0 0 0.480892 5.67851e-18 25.0263 0.29215
  }

Kreuz { 
  0.412518 -0.0625866 0.0625866 0.412518 -15.4044 7.95892 0.199707
  0.0297911 -0.771761 0.771761 0.0297911 7.44544 -15.4044 0.684283
  0.279749 -0.151223 0.151223 0.279749 16.1746 19.7689 0.11601
  }

Freggel { 
  -0.613169 0.24828 -0.24828 -0.613169 -7.72631 17.1854 0.429863
  0.497076 0.577354 -0.577354 0.497076 5.91802 1.31512 0.570137
  }

Horse {
  -0.0675428 0.493133 -0.493133 -0.0675428 -5.05834 12.5771 0.277499
  0.513251 0.617738 -0.617738 0.513251 -18.8212 0.344948 0.722501
  }

Kaefer{
  0.445207 -0.598645 0.598645 0.445207 -0.860462 -2.29456 0.498514
  0.469078 0.582981 -0.582981 0.469078 15.7751 12.9069 0.501486
  }

Galaxie1 { 
  -0.427561 0.86498 -0.86498 -0.427561 3.12055 5.11573 0.647572
  0.14922 -0.687476 0.687476 0.14922 -1 0 0.344229
  0.0792079 -0.0742574 0.0742574 0.0792079 -37.7414 30.6649 0.00819938
  }

Roll {
  0.5 -0 0 0.5 -12.123 8.27912 0.254289
  0.717681 -0.466978 0.466978 0.717681 0.295683 -1.18273 0.745711
  }

Altes_Pergament{ 
  0.5 -0 0 0.5 -12.123 8.27912 0.211919
  0.0071538 -0.964181 0.964181 0.0071538 -1.18273 -5.32229 0.788081
  }

Rotor { 
  0.5 -0 0 0.5 -12.123 8.27912 0.234537
  -0.490179 -0.75872 0.75872 -0.490179 -1.18273 -5.32229 0.765463
  }

Federbueschel { ; -30.8038 -30.3934 47.2087 30.0883 
  0.5 -0 0 0.5 -12.123 8.27912 0.296425
  0.501616 -0.463815 0.463815 0.501616 20.4021 -1.7741 0.553417
  0.045419 0.352957 -0.352957 0.045419 -17.4453 -12.7144 0.150159
  }

Strange {
  0.578313 -0.391566 0.391566 0.578313 -13.384 15.9161 0.594913
  0.295181 -0.313253 0.313253 0.295181 19.5334 8.31977 0.225953
  -0.383234 0.00212318 -0.00212318 -0.383234 -7.23458 -28.5766 0.179134
  }
Ammonit {
  0.67732 0.458356 -0.458356 0.67732 -11.2136 1.44692 0.629151
  -0.0132534 0.28386 -0.28386 -0.0132534 28.5766 22.0655 0.0759586
  0.49981 -0.252368 0.252368 0.49981 10.1284 -30.747 0.294891
  }

xmasstree {
  0.675281 -0.000640601 0.000640601 0.675281 -0.723458 16.2778 0.538769
  0.32769 -0.297556 0.361091 0.270032 -32.9173 -23.1507 0.231493
  0.235257 0.372962 -0.372962 0.235257 30.0235 -27.1297 0.229738
  }

filledxmasstree {
  0.675281 -0.000640601 0.000640601 0.675281 -0.723458 16.2778 0.415917
  0.32769 -0.297556 0.361091 0.270032 -32.9173 -23.1507 0.178708
  0.235257 0.372962 -0.372962 0.235257 30.0235 -27.1297 0.177353
  0.5 -0 0 0.5 -0.361729 -27.1297 0.228023
  }

verwaschen_sierp {
  0.5 -0 0 0.5 -1.29955 22.0923 0.205009
  -0.48517 0.85678 -0.85678 -0.48517 3.24886 0.974659 0.794991
  }

noch_ein_farn {
  0.108696 -0.378261 0.378261 0.108696 -19.2333 -25.4711 0.181854
  0.106825 0.402721 -0.402721 0.106825 15.3346 -22.872 0.203808
  0.713043 -0.0695652 0.0695652 0.713043 -5.45809 16.3743 0.602598
  0 -0.0279026 0 0.399026 -2.59909 -26.5107 0.0117404
  }

undnocheinfarn {
  -0.108696 -0.378261 -0.378261 0.108696 -19.2333 -25.4711 0.181853
  0.106825 0.402721 -0.402721 0.106825 15.3346 -22.872 0.203808
  0.713043 -0.0695652 0.0695652 0.713043 -5.45809 16.3743 0.602598
  0 -0.0279026 0 0.399026 -2.59909 -26.5107 0.0117404
  }
./ifsdaem-1.1/ifs_drawer.cpp100664    764    144       16034  6534772070  14365 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "file_win.h"

ifs_drawer::ifs_drawer(QWidget *parent,const char *name=0) : QWidget(parent,name)
{
  todraw=NULL;
  int_buffer=NULL;
  zustand=-1;
  mem_x=-1;
  mem_y=-1;
  buf1=NULL;
  buf2=NULL;
  zw_ifs=NULL;

  setCaption("IFS-Daemon : Picture");
  
  setBackgroundColor(black);
}

ifs_drawer::~ifs_drawer()
{
  sleep();
}

void ifs_drawer::closeEvent(QCloseEvent*)
{
  sleep();
  hide();
}

void ifs_drawer::sleep()
{
  if(int_buffer!=NULL) free(int_buffer);
  if(buf1!=NULL) free(buf1);
  if(buf2!=NULL) free(buf2);
  if(zw_ifs!=NULL) delete zw_ifs;
  buf1=NULL;
  buf2=NULL;
  int_buffer=NULL;
  zw_ifs=NULL;
  zustand=-1;
  todraw=NULL;
  mem_x=-1;
  mem_y=-1;
}

void ifs_drawer::set_all(my_ifs *p,int i,int test)
{
  if(zustand!=i)
  {
    sleep();
  }

  if((zustand!=i)||(p!=todraw))
  {
    todraw=p;
    init_zustand(i);
  }else if(test) init_zustand(i);
}


void ifs_drawer::init_zustand(int i)
{
  if(todraw!=NULL) 
  {
    if(todraw->x1==todraw->x2) // Gendert
      {todraw->init_ifs(xz1,yz1,TRUE);} else // Die Grenzen werden gesetzt;
         todraw->init_ifs(xz1,yz1,FALSE);
  }
  
  zustand=i;

  make_koord();
  
  if(i==0)
  {
    init_determ();
  }
  if(i==1)
  {
    init_zufall();
  }
}

void ifs_drawer::init_determ()
{
  long x1=width();
  long y1=height();
  
  if((mem_x==-1)||(mem_x!=x1)||(mem_y!=y1))
  {
    if(buf1!=NULL) free(buf1);
    if(buf2!=NULL) free(buf2);

    buf_size=((x1*y1)/8) +1;
    buf1=(char *)malloc(buf_size);
    buf2=(char *)malloc(buf_size);
    CHECK_PTR(buf1);CHECK_PTR(buf2);
    mem_x=x1;
    mem_y=y1;
  }

  if(zw_ifs!=NULL) delete zw_ifs;
  zw_ifs=new my_ifs();CHECK_PTR(zw_ifs);

  abbildung zw1,zw2;
  zw1.null();
  zw1.a=ifs_fenster.scalex;
  zw1.d=ifs_fenster.scaley;
  zw1.e=ifs_fenster.centx;
  zw1.f=ifs_fenster.centy;
  zw2.umkehr(zw1);

  if(todraw==NULL)
  {
    printf("Strange error %s %d\n",__FILE__,__LINE__);
  }

  for(int i=0;i<todraw->count;i++)
  {
    abbildung *test=new abbildung();CHECK_PTR(test);
    *test=*todraw->daten[i];
    test->verkette(zw2,*test);
    test->verkette(*test,zw1);
    zw_ifs->add(test,0);
  }

  prepare_buffers();
}

void ifs_drawer::init_zufall()
{
  long x1=width();
  long y1=height();
  
  if((mem_x==-1)||(mem_x!=x1)||(mem_y!=y1))
  {
    if(int_buffer!=NULL) free(int_buffer);
    int_buffer=(unsigned int *)malloc(x1*y1*sizeof(unsigned int));
    CHECK_PTR(int_buffer);
    mem_x=x1;
    mem_y=y1;
  }
  memset(int_buffer,0,x1*y1*sizeof(unsigned int));
}

void ifs_drawer::draw_zufall_xy(int x1,int y1,QPainter *p)
{
  long x=x1,y=y1;
  unsigned int i=int_buffer[y*((long)width())+x];
  
  if(i==0)
  {
    p->setPen(black);
  }else
  {
    QColor col;
    master->config->get_farbe(i,&col);
    p->setPen(col);
  }

  p->drawPoint(x1,y1);
}

void ifs_drawer::draw_zufall(QPainter *p)
{
  for(int x=0;x<mem_x;x++)
    for(int y=0;y<mem_y;y++)
      draw_zufall_xy(x,y,p);
}

void ifs_drawer::draw_determ(QPainter *p)
{
  for(int x=0;x<mem_x;x++)
    for(int y=0;y<mem_y;y++)
    {
      if(access_read(x,y)==1) {p->setPen(white);} else p->setPen(black);
      p->drawPoint(x,y);
    }
}

void ifs_drawer::make_koord()
{
  if(todraw==NULL) return;

  if(todraw->x1==todraw->x2)
  {
    printf("Warning : IFS not installed\n");
    todraw->x1=todraw->y1=-50;
    todraw->x2=todraw->y2=50;
  }

  double scx,scy;
  
  scx=width();
  scx=scx/fabs(todraw->x1-todraw->x2);
  
  scy=height();
  scy=scy/fabs(todraw->y1-todraw->y2);
  
  if(scy<scx) scx=scy;
  
  ifs_fenster.set_all((todraw->x1+todraw->x2)/2,(todraw->y1+todraw->y2)/2,
     width()/2,height()/2,scx,-scx);
}

void ifs_drawer::paintEvent(QPaintEvent *)
{
  QPainter p;
  
  p.begin(this);
 
  if(zustand==1) draw_zufall(&p);
  if(zustand==0) draw_determ(&p);
 
  p.end();
}

void ifs_drawer::savegrafik(const char *ffname)
{
  QPainter p;

  if(zustand==0)
  {
    QPixmap pm(size());
    
    if(p.begin(&pm)==FALSE)
    {
      printf("Error: saving %s\n",ffname);
    } else
    {
      draw_determ(&p);
      p.end();

      pm.save(ffname,"BMP");
    }
  }
  if(zustand==1)
  {
    QPixmap pm(size());
    
    if(p.begin(&pm)==FALSE)
    {
      printf("Error: saving %s\n",ffname);
    }else
    {
      draw_zufall(&p);
      p.end();

      pm.save(ffname,"BMP");
    }
  }
}

void ifs_drawer::resizeEvent(QResizeEvent*)
{
  init_zustand(zustand);
  repaint();
}

void ifs_drawer::do_zufall(long int howmuch)
{
  if(todraw==NULL) return;

  if(todraw->is_ready==FALSE)
    if(todraw->init_ifs(xz1,yz1,FALSE)==FALSE)
    {
      printf("IFS bad\n");
      return;
    }

  int xs,ys;
  double x1,y1;

  for(long i=0;i<howmuch;i++)
  {
    todraw->render(xz1,yz1,xz1,yz1);
    ifs_fenster.abb(xz1,yz1,x1,y1);
    xs=(int) x1;
    ys=(int) y1;
      
    if(!((xs<0)||(xs>=mem_x)||(ys<0)||(ys>=mem_y)) )
      int_buffer[ys*((long)width())+xs]++;
  }
}

void ifs_drawer::do_determ(int howmuch)
{
  double x,y,x1,y1;
  int zw,i;

  if(zw_ifs==NULL) return;
  if(zw_ifs->is_ready==FALSE);
    if(zw_ifs->init_ifs(x,y,FALSE)==FALSE)
    {
      printf("bad IFS\n");
      return;
    }

  for(int jj=0;jj<howmuch;jj++)
  {
    memset(buf2,0,buf_size);
    for(x=0;x<mem_x;x++)
      for(y=0;y<mem_y;y++)
      {
  	  zw=access_read((int)x,(int)y);
          if(zw==0) continue;
 	  for(i=0;i<zw_ifs->count;i++)
	  {
	    x1=x * zw_ifs->daten[i]->a + y * zw_ifs->daten[i]->b + zw_ifs->daten[i]->e;
	    y1=x * zw_ifs->daten[i]->c + y * zw_ifs->daten[i]->d + zw_ifs->daten[i]->f;
	    if((x1<0)||(x1>=mem_x)) break;
	    if((y1<0)||(y1>=mem_y)) break;
	    access_write((int)x1,(int)y1);
	  }
      }
    buf3=buf2;
    buf2=buf1;
    buf1=buf3;
  }
}

void ifs_drawer::do_it(long howmuch)
{
  if(zustand==0) do_determ(howmuch);
  if(zustand==1) do_zufall(howmuch*1000);
}

int ifs_drawer::access_read(int x,int y)   /* Ohne range-checking */
{
  long l;
  char zw;

  l=y*((long)mem_x)+x;

  zw=buf1[l/8];
  zw=zw & (1 << (l%8) );
  if(zw!=0) return(1);
  return(0);
}

void ifs_drawer::access_write(int x,int y)
{
  long l;
  char zw;

  l=y*((long)mem_x)+x;

  zw=buf2[l/8];
  zw=zw | (1 << (l%8) );
  buf2[l/8]=zw;
}

void ifs_drawer::prepare_buffers()
{
  int i;

  memset(buf1,0,buf_size);
  memset(buf2,0,buf_size);

  buf3=buf2;
  buf2=buf1;

  for(i=0;i<mem_x;i++)
  {
    access_write(i,5);
    access_write(i,mem_y-5);
  }
  for(i=0;i<mem_y;i++)
  {
    access_write(5,i);
    access_write(mem_x-5,i);
  }
  buf2=buf3;
}

./ifsdaem-1.1/ifs_file_editor.cpp100664    764    144       12461  6511675440  15364 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "file_win.h"

ifs_file_editor *master;

ifs_file_editor::ifs_file_editor( QWidget * parent , const char * name )
    : QWidget( parent, name )
{
  master=this;

  f_name=new char[100];CHECK_PTR(f_name);

  editor = new QMultiLineEdit( this, "edit" );
  CHECK_PTR(editor);

  setCaption("IFS-Daemon : File-Editor");
  strcpy(f_name,"noname.ifs");

//---------------------

  config=new configuration();CHECK_PTR(config);

  ifs_edit=new edit_win(NULL);CHECK_PTR(ifs_edit);
  ifs_edit->setGeometry(80,80,300,300);
  ifs_edit->hide();

  draw_area=new ifs_drawer();
  CHECK_PTR(draw_area);
  draw_area->setGeometry(20,90,300,300);
  draw_area->hide();

  ifs_commando=new ifs_win();CHECK_PTR(ifs_commando);
  ifs_commando->setGeometry(120,50,300,300);
  ifs_commando->hide();

  connect(ifs_edit,SIGNAL(ifs_ready()),ifs_commando,SLOT(accept_ifs()));

//-----------------------

  menu = new QMenuBar( this, "menu" );
  CHECK_PTR(menu);
    
  QPopupMenu * file = new QPopupMenu();
  QPopupMenu * other = new QPopupMenu();
  CHECK_PTR( file );CHECK_PTR(other);

  menu->insertItem( "&File", file );
  menu->insertItem( "&IFS",other);

  file->insertItem( "&New",   this, SLOT(create()), 0 );
  file->insertItem( "&Open",  this, SLOT(load()),   ALT+Key_O );
  file->insertItem( "&Save",  this, SLOT(save()),   ALT+Key_S );
  file->insertItem( "S&ave as",this,SLOT(save_as()),0);
  file->insertItem( "Save bmp",this,SLOT(savegrafik()),0);
  file->insertSeparator();
  file->insertItem( "&Quit", qApp,  SLOT(quit()),   ALT+Key_Q );

  other->insertItem("&Compile",this,SLOT(do_compile()),ALT+Key_C);
  other->insertItem("&Paste Buffer",this,SLOT(do_paste()),0);
  other->insertItem("IFS-&Editor",this,SLOT(open_ifs_edit()));

//---------------
  GNU();
}

ifs_file_editor::~ifs_file_editor()
{
  delete []f_name;
}

void ifs_file_editor::load()
{
  QString fn = QFileDialog::getOpenFileName(NULL,"*.ifs");
  if ( !fn.isEmpty() ) 
  load( fn );
}

void ifs_file_editor::load( const char *fileName )
{
  QFile f( fileName );

  if ( !f.open( IO_ReadOnly ) )
    return;

  editor->setAutoUpdate( FALSE );
  editor->clear();

  QTextStream t(&f);
  while ( !t.eof() ) 
  {
    QString s = t.readLine();
    editor->append( s );
  }
  f.close();

  editor->setAutoUpdate( TRUE );
  editor->repaint();

  strcpy(f_name,fileName);
}

void ifs_file_editor::save()
{
  save(f_name);
}


void ifs_file_editor::create()
{
  editor->clear();
}

void ifs_file_editor::save_as()
{
  QString fn = QFileDialog::getSaveFileName(NULL,"*.ifs");
  if ( !fn.isEmpty() )
  save(fn);
}

void ifs_file_editor::save(const char *fileName)
{
  QFile f(fileName);
  
  if(!f.open(IO_WriteOnly)) return;
  
  QString s(256);
  
  for(int i=0;i<editor->numLines();i++)
  {
    s=editor->textLine(i);
    
    f.writeBlock((const char *) s,s.length());
    f.putch('\n');
  }
  
  f.close();
}

void ifs_file_editor::resizeEvent( QResizeEvent * )
{
  editor->setGeometry( 0, menu->height(),
    width(), height() - menu->height() );
}

void ifs_file_editor::closeEvent(QCloseEvent *)
{
// do nothing
}

//-----------

void ifs_file_editor::GNU()
{
  QMessageBox::message("IFS-Daemon",
  "Version 1.1 Copyright (C) 1998 Timo Hartmann\n"\
  "IFS-Daemon comes with ABSOLUTELY NO WARRANTY.\n"\
  "This is free software, and you are welcome to\n"\
  "redistribute it under certain conditions.\n"\
  "It is published under the terms of the\n"\
  "GNU General Public License version 2.0 or later.\n"\
  "See `README` and `COPYING`.");
}

void ifs_file_editor::do_paste()
{
  if(ifs_commando->zwischenablage==NULL) return;

  editor->setAutoUpdate( FALSE );

  QString str;
  str.sprintf("buffer {");

  editor->insertLine(str);

  for(int i=0;i<ifs_commando->zwischenablage->count;i++)
  {
    QString str;
    str.sprintf("  %.6g %.6g %.6g %.6g %.6g %.6g %.6g",
         ifs_commando->zwischenablage->daten[i]->a,
         ifs_commando->zwischenablage->daten[i]->b,
         ifs_commando->zwischenablage->daten[i]->c,
         ifs_commando->zwischenablage->daten[i]->d,
         ifs_commando->zwischenablage->daten[i]->e,
         ifs_commando->zwischenablage->daten[i]->f,
         ifs_commando->zwischenablage->p[i]);
    editor->insertLine(str);
  }
  editor->insertLine("  }");

  editor->setAutoUpdate( TRUE );
  editor->repaint();
}

void ifs_file_editor::savegrafik()
{
  if(draw_area->zustand==-1) return;
  QString fn=QFileDialog::getSaveFileName(NULL,"*.bmp");
  if(fn.isEmpty()) return;
  draw_area->savegrafik(fn);
}

void ifs_file_editor::open_ifs_edit()
{
  ifs_edit->show();
}

void ifs_file_editor::do_compile()
{
  ifs_commando->do_compile();
  ifs_commando->show();
}
./ifsdaem-1.1/ifs_utils.cpp100664    764    144       17046  6534774306  14251 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "file_win.h"

ifs_handler::ifs_handler()
{
  count=0;
  liste=NULL;
}

ifs_handler::~ifs_handler()
{
  for(int i=0;i<count;i++)
    delete liste[i];
  free(liste);
}

void ifs_handler::add(my_ifs *p)
{
  if(p==NULL) return;
  count++;
  liste=(my_ifs**)realloc(liste,count*sizeof(my_ifs*));
  CHECK_PTR(liste);
  liste[count-1]=p;
}

//--------------------------------

ifs_parser::ifs_parser()
{
  write_to=NULL;
  get_from=NULL;
  x=0;
  y=0;
}

void ifs_parser::set_write_to(ifs_handler *p,QListBox *p1)
{
  write_to=p;write_to1=p1;
}

void ifs_parser::set_get_from(QMultiLineEdit *p)
{
  get_from=p;
}

int ifs_parser::get_one_char()
{
  char *c;
  int zw;

  if(y+1>get_from->numLines()) return EOF;
  if(x+1>(int)strlen((char*)get_from->textLine(y))) 
  {
    x=0;
    y++;
    zw='\n';
  }else
  {
    c=(char *)get_from->textLine(y);
    zw=(unsigned char) c[x];
    x++;
  }

  check_if_line(zw);
  return zw;
}

int ifs_parser::parse()
{
  int i;
  for(;;)
  {
    i=get_next_token_n1();
    if(i==EOF) return TRUE;

    if(i==tk_semi)
    {
      while((i=get()!='\n')&&(i!=EOF));
      continue;
    }

    if((i!=tk_string)&&(i!=tk_zahl)&&(i!=tk_trenn)) return FALSE;
    
    if(parse_ifs()==FALSE) return FALSE;
  }
}

int ifs_parser::parse_ifs()
{
  char *c;
  int i;
  my_ifs *ret;
  double p;
  
  c=parse_string_n2();

  i=get_next_token_n2();

  if(i==tk_kla)
  {
    c=parse_string_n2();
    if(strcmp(c,"(3D")!=0)         // "(3d" ,weil mkla direkt danach kommen knnte
      if(strcmp(c,"(3d")!=0) return FALSE;
    for(;;)
    {
      i=get();
      if(i=='}') return TRUE;
      if(i==EOF) return FALSE;
    }
  }

  write_to1->insertItem(c);

  for(;;)
  {
    i=get_next_token_n1();
    if(i==tk_semi)
    {
      while((i=get()!='\n')&&(i!=EOF));
      continue;
    }
    if(i==tk_mkla) break;
    return FALSE;
  }
  get();
  
  ret=new my_ifs();CHECK_PTR(ret);
  
  for(;;)
  {
    i=get_next_token_n2();
    if(i==tk_mklz) 
    {
      get();
      break;
    }
    if(i==tk_zend)
    {
      get();
      continue;
    }
    if(i==tk_semi)
    {
      for(;;)
      {
        i=get();
        if(i=='\n') break;
        if(i==EOF) break;
      }
      continue;
    }
    if(i==EOF) return FALSE;
        
    abbildung *test=new abbildung();CHECK_PTR(test);
    
    test->a=parse_double(i);if(i==FALSE) return FALSE;
    test->b=parse_double(i);if(i==FALSE) return FALSE;
    test->c=parse_double(i);if(i==FALSE) return FALSE;
    test->d=parse_double(i);if(i==FALSE) return FALSE;
    test->e=parse_double(i);if(i==FALSE) return FALSE;
    test->f=parse_double(i);if(i==FALSE) return FALSE;
    p=parse_double(i);if(i==FALSE) return FALSE;
    
    i=get_next_token_n2();
    if(i==tk_semi)
    {
      for(;;)
      {
        i=get();
        if(i=='\n') break;
        if(i==EOF) break;
      }
    } else if(parse_token(tk_zend)==FALSE) return FALSE;
    
    ret->add(test,p);
  }

  write_to->add(ret);
  return TRUE;
}

/* Format :

1.) name {  <- Wichtig : gleiche Zeile
  0 0 0 0 0 0 0
  }  <- Wichtig : neue Zeile
  
2.) name { ; x1 y1 x2 y2
 0 0 0 0 0 0 0
 }

3.) name (3D) { ... } wird nicht gelesen

Kommentare mit ;
*/

//--------------------------------------------------------------------

daten_inhalt::daten_inhalt()
{
  next=NULL;
  type=daten_t_raw;
}

daten_inhalt::~daten_inhalt()
{
  if(next!=NULL) delete next;
}

void daten_inhalt::set_next(daten_inhalt *n)
{
  if(next!=0)
  {
    printf("daten_inhalt::warining @doppeltbelegt\n");
  }
  next=n;
}

void daten_inhalt::add(daten_inhalt *p)
{
  if(next!=NULL) {next->add(p);} else next=p;
}

daten_inhalt *daten_inhalt::get_next()
{
  return next;
}

//---------------

daten_speicher::daten_speicher()
{
  first=last=NULL;
  count=0;
}

daten_speicher::~daten_speicher()
{
  if(first!=NULL) 
  {
    delete first;
  }

  last=NULL;
  first=NULL;
  count=0;
}

void daten_speicher::add(daten_inhalt *p)
{
  if(p==NULL)
  {
    printf("daten_speicher::warning @p==NULL\n");
  } 

  count++;
  
  if(last==NULL)
  {
    first=last=p;
  }else
  {
    last->set_next(p);
    last=p;
  }
}

daten_inhalt * daten_speicher::get(int i)
{
  if((i<0)||(i>=count)) return NULL;
  
  daten_inhalt *dummy=first;
  for(int j=0;j<i;j++)
    dummy=dummy->get_next();

  return dummy;
}

//-------------------------------------------

farben_inhalt::farben_inhalt() : daten_inhalt()
{
  inhalt=NULL;
  fname=NULL;
  type=daten_t_farben;
}

farben_inhalt::~farben_inhalt()
{
  if(inhalt!=NULL) delete inhalt;
  if(fname!=NULL) free(fname);
  fname=NULL;
  inhalt=NULL;
}

void farben_inhalt::set(my_farben *p,char *s)
{
  if((inhalt!=NULL)||(fname!=NULL))
  {
    printf("farben_inhalt::warning @doppeltbelegt\n");
    delete inhalt;
    free(fname);
  }
  inhalt=p;
  if(s!=NULL)
  {
    fname=(char *)malloc(strlen(s)+3);
    CHECK_PTR(s);
    strcpy(fname,s);
  }else fname=NULL;
}

configuration::configuration()
{
  init_farb_tafel();
  aktuelle_farb_tafel=3;
}

void configuration::init_farb_tafel()
{
  my_farben *t1;
  farben_inhalt *t2;

//---------------

  t1=new my_farben();CHECK_PTR(t1);
  t2=new farben_inhalt();CHECK_PTR(t2);
  
  t1->add(0,50,0,0);
  t1->add(255,255,0,0);
  t1->add(255,255,255,0);
  t1->add(255,0,255,0);
  t1->add(255,0,255,255);
  t1->add(255,0,0,255); 
  
  t2->set(t1,"default 1");

  liste_der_farben.add(t2);

//----------

  t1=new my_farben();CHECK_PTR(t1);
  t2=new farben_inhalt();CHECK_PTR(t2);
  
  t1->add(0,50,0,0);
  t1->add(500,255,0,0);
  t1->add(500,0,255,0);
  t1->add(500,0,0,255);  
  
  t2->set(t1,"default 2");
  liste_der_farben.add(t2);

//-----------------

  t1=new my_farben();CHECK_PTR(t1);
  t2=new farben_inhalt();CHECK_PTR(t2);
  
  t1->add(0,50,50,50);
  t1->add(500,255,255,255);
  
  t2->set(t1,"grey-shade");
  liste_der_farben.add(t2);

//----------------

  t1=new my_farben();CHECK_PTR(t1);
  t2=new farben_inhalt();CHECK_PTR(t2);
  
  t1->add(0,50,50,0);
  t1->add(200,255,255,0);
  
  t2->set(t1,"yellow-shade");
  liste_der_farben.add(t2);

//-------------------

  t1=new my_farben();CHECK_PTR(t1);
  t2=new farben_inhalt();CHECK_PTR(t2);
  
  t1->add(0,0,0,50);
  t1->add(255,255,255,255);
  
  t2->set(t1,"blue-white-shade");
  liste_der_farben.add(t2);
}

void configuration::get_farbe(long i,QColor *pcol)
{
  if(aktuelle_farb_tafel==-1){*pcol=white;return;}
 
  farben_inhalt *p;
  p=(farben_inhalt*)liste_der_farben.get(aktuelle_farb_tafel);
  if(p==NULL)
  {
    printf("Strange Error @configuration::getfarbe\n");
    return;
  }

  int r,g,b;
  (p->get_inhalt())->get(i,r,g,b);
  pcol->setRgb(r,g,b);
}

void configuration::init_combo(QComboBox *p)
{
  if(p==NULL) return;

  p->insertItem("bare white");

  for(int i=0;i<liste_der_farben.howmuch();i++)
  {
    farben_inhalt *t;
    t=(farben_inhalt*) liste_der_farben.get(i);
    if(t==NULL)
    {
      printf("init_combo : strange error\n");
      continue;
    }
    p->insertItem(t->get_name());
  }
}
./ifsdaem-1.1/ifs_win.cpp100664    764    144       13663  6534775634  13714 0ustar  timousers/*  <Copyright (C) 1998 Timo Hartmann >
  
  This 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 opinion) 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.

  See "COPYING" and "README" for more details. */

#include "file_win.h"

ifs_win::ifs_win( QWidget * parent , const char * name )
    : QWidget( parent, name )
{
//*****************

  setCaption("IFS-Daemon : control");

  list_of_ifs=NULL;
  was_nehmen_int=0;
  zwischenablage=NULL;
  draw_art_int=1;
  which_selected=0;
  how_much_int=500;
  is_changed=TRUE;

//********************

  select=new QListBox(this,"List");CHECK_PTR(select);
  select->resize(150,250);

  was_nehmen=new QButtonGroup(this,"was");CHECK_PTR(was_nehmen);
  was_nehmen->resize(80,60);
  was_nehmen->setTitle("IFS");

  run_b=new QPushButton("run",this,"rb");CHECK_PTR(run_b);
  run_b->resize(60,20);
    
  edit_b=new QPushButton("edit",this,"rb");CHECK_PTR(edit_b);
  edit_b->resize(60,20);

  QRadioButton *rb=new QRadioButton(was_nehmen);CHECK_PTR(rb);
  rb->setText("list");
  rb->setGeometry(5,15,70,15);
  rb->setChecked(TRUE);

  rb=new QRadioButton(was_nehmen);CHECK_PTR(rb);
  rb->setText("buffer");
  rb->setGeometry(5,40,70,15);

  draw_art=new QButtonGroup(this,"was");CHECK_PTR(draw_art);
  draw_art->resize(80,60);
  draw_art->setTitle("method");
    
  rb=new QRadioButton(draw_art);CHECK_PTR(rb);
  rb->setText("determin.");
  rb->setGeometry(5,15,70,15);

  rb=new QRadioButton(draw_art);CHECK_PTR(rb);
  rb->setText("random");
  rb->setGeometry(5,40,70,15);
  rb->setChecked(TRUE);

  how_much=new qinpscr("account",43,this);CHECK_PTR(how_much);
  how_much->resize(140,20);
  how_much->set_dx(10);
  how_much->set_wert(how_much_int);

  combo_list=new QComboBox(FALSE,this,"combo");
  CHECK_PTR(combo_list);
  combo_list->resize(140,20);

//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx  
  master->config->init_combo(combo_list);
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  combo_list->setCurrentItem(master->config->aktuelle_farb_tafel+1);

  connect(was_nehmen,SIGNAL(clicked(int)),this,SLOT(was_nehmen_ev(int)));
  connect(draw_art,SIGNAL(clicked(int)),this,SLOT(draw_art_ev(int)));
  connect(select,SIGNAL(selected(int)),this,SLOT(selected_ev(int)));
  connect(how_much,SIGNAL(ready()),this,SLOT(how_much_ev()));
  connect(run_b,SIGNAL(clicked()),this,SLOT(do_run()));
  connect(edit_b,SIGNAL(clicked()),this,SLOT(do_edit()));
  connect(combo_list,SIGNAL(activated(int)),this,SLOT(combo_ev(int)));

  arrange();
}

ifs_win::~ifs_win()
{
  if(list_of_ifs!=NULL) delete list_of_ifs;
  if(zwischenablage!=NULL) delete zwischenablage;
}

void ifs_win::combo_ev(int i)
{
  master->config->aktuelle_farb_tafel=i-1;
  master->draw_area->repaint();
}

void ifs_win::do_compile()
{
  if(list_of_ifs!=NULL) delete list_of_ifs;
  select->clear();

  list_of_ifs = new ifs_handler();
  CHECK_PTR(list_of_ifs);

  ifs_parser hallo;
 
  hallo.set_get_from(master->editor);
  hallo.set_write_to(list_of_ifs,select);
  
  if(hallo.parse()!=TRUE)
  {
    master->editor->setCursorPosition(hallo.y,hallo.x);

    QString str;
    str.sprintf("Error while compiling \n Line %d , Col %d",hallo.y,hallo.x);

    QMessageBox::message("Error",str);

    delete list_of_ifs;
    list_of_ifs=NULL;

    select->clear();

    return;
  }

  which_selected=0;
}
  
void ifs_win::was_nehmen_ev(int i)
{
  was_nehmen_int=i;
}

void ifs_win::draw_art_ev(int i)
{
  draw_art_int=i;
}

void ifs_win::selected_ev(int i)
{
  which_selected=i;
  was_nehmen_int=0;

  QRadioButton *p;
  p=(QRadioButton*)was_nehmen->find(0);
  if(p==NULL) return;
  
  p->setChecked(TRUE);

  p=(QRadioButton*)was_nehmen->find(1);
  if(p==NULL) return;
  
  p->setChecked(FALSE);
}

void ifs_win::how_much_ev()
{
  how_much_int=(int)how_much->get_wert();
  if(how_much_int<1)
  {
    how_much_int=1;
    how_much->set_wert(1);
  }
}

void ifs_win::resizeEvent( QResizeEvent * )
{
  arrange();
}

void ifs_win::arrange()
{
  select->move(5,5);
  select->resize(width()-10-how_much->width(),height()-10);

  run_b->move(width()-run_b->width()-10,10);
  edit_b->move(width()-edit_b->width()*2-20,10);
  was_nehmen->move(width()-was_nehmen->width()-10,10+30);
  draw_art->move(width()-draw_art->width()-10,    10+30+70);
  how_much->move(width()-how_much->width(),        10+30+150);
  combo_list->move(width()-combo_list->width()-2,10+30+150+30);
}

void ifs_win::accept_ifs()
{
  if(zwischenablage!=NULL) delete zwischenablage;
  zwischenablage=master->ifs_edit->get_ifs();
  is_changed=TRUE;
}

void ifs_win::do_edit()
{
  if(was_nehmen_int!=0) return;
  if(which_selected+1>list_of_ifs->count) return;
 
  edit_win *t;
  t=master->ifs_edit;
 
  t->show();
  t->edit_ifs(list_of_ifs->liste[which_selected]);
}

void ifs_win::do_run()
{
  if((list_of_ifs==NULL)&&(was_nehmen_int==0)) return;

  if(was_nehmen_int==0)
  {
    if(which_selected+1>list_of_ifs->count) return;
  } 

  if(was_nehmen_int==1)
  {
    if(zwischenablage==NULL) return;
  }

  ifs_drawer *draw_area=master->draw_area;

  draw_area->show();
  
  if(was_nehmen_int==0)
  {
    draw_area->set_all(list_of_ifs->liste[which_selected],draw_art_int,is_changed);
  }else draw_area->set_all(zwischenablage,draw_art_int,is_changed);

  is_changed=FALSE;

  printf("Begin calc\n");

  if(draw_art_int==0)
  {
    if (how_much_int>20) 
    {
      how_much_int=20;
      how_much->set_wert(20);
    }
  }
    
  draw_area->do_it(how_much_int);

  printf("End calc\n");

  draw_area->repaint();
}

./ifsdaem-1.1/ifsdaem100755      0      0      273727  6704443340  12623 0ustar  rootrootELF4"4 (444ԀԀ   p/lib/ld-linux.so.1Zlj/gC%WK4,Er[2z+dxw k_`{D:'c3vms>f^QLMi.*n~$	&5!HB9G7N;(6YIS
ahJq#U?u0<|b@Fpy
=Po}\teR")81]TXVO-A8+H%FXMh| ȲGJزF>#(FW`(kHsXBhx3
sA lس &"	H@"	'(b"	:8TXHyXhx+"	"ȴ,=شqK&Zoh "	(P"	
"	 8~#HAX(b hh6yx%d0+"	n#ȵ>صkY"	{0|J1(8H<+"	L'"	mXY~h2eȶض#;KO\gf~8HXJhK"	
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2009 MARUHN Internet Solutions