HardcoreProcessing/ 40755 1750 1750 0 6774226054 12760 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/ 40755 1750 1750 0 6774204324 15206 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/licence/ 40755 1750 1750 0 6774207372 16616 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/licence/COPYING 100644 1750 1750 36073 6774207506 17776 0 ustar anoq anoq
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
HardcoreProcessing/MLAbstractUI/licence/COPYING.lib 100644 1750 1750 56206 6774207506 20543 0 ustar anoq anoq
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 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.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, 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 library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, 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 companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, 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 library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete 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 distribute a copy of this License along with the
Library.
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 Library or any portion
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
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 Library, 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 Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you 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.
If distribution of 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 satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. 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.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library 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.
9. 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 Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
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.
11. 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 Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library 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 Library.
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.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library 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.
13. The Free Software Foundation may publish revised and/or new
versions of the Library 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 Library
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 Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
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
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "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
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. 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 LIBRARY 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
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
HardcoreProcessing/MLAbstractUI/docs/ 40755 1750 1750 0 6774204370 16137 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/docs/tex/ 40755 1750 1750 0 6774207462 16744 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/docs/tex/MLAbstractUIDoc.tex 100644 1750 1750 21625 6774207506 22470 0 ustar anoq anoq \documentclass[a4paper,final,10pt]{article}
\title{ML::AbstractUI Documentation}
\author{\'{A}NOQ of the Sun, Hardcore Processing
\footnote{\copyright 1999 \'{A}NOQ of the Sun (alias Johnny Andersen)} }
\begin{document}
\maketitle
\section*{Introduction}
With UI standing for user interface, then by definition,
ML::AbstractUI is a UI-concept independent UI-API in
\verb'Standard ML' currently with crossplatform classical windowing
system implementations for \verb'WindowsNT/95/98', \verb'Linux/X-Windows' and
other Unixes. (yes, that's a long definition... :).
It is all distributed under the GNU General Public Library Licence (\verb'LGPL'),
which (in short) allows you to build commercial applications with it, as long
as you distribute all the sourcecode and copyrightnotices for ML::AbstractUI
in unmodified form along with your software.
There is also a GUI builder, called \verb'The Construct', available for
ML::AbstractUI on this homepage.
It is concievable that ML::AbstractUI will
be merged with \verb"Stuart Croy's" \verb'VisualML' toolkit.
(\verb'http://www.tardis.ed.ac.uk/~skc/VisualML.htmld/').
This document gives a little overview of the current release
and it also outlines my current ideas about how everything should have been :).
\section*{User Interfaces in ML::AbstractUI}
User Interfaces in ML::AbstractUI is represented as a directed
graph. This graph is the client interface for creating and
manipulating user interfaces.
Such a UI-graph can be created
and manipulated interactively using \verb'The Construct'. This
is actually recommended for building user interfaces, since
\verb'The Construct' will help you to
avoid mixing user interface code with application logic.
\subsection*{The Graph API}
When building user interfaces from within an ML program you can
use the DGNodes structure. It is defined in
HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGNodes.sml
in the distribution. The most useful functions in this structure
has also got convenient infix operators defined in the structure
DHShorthand in the file
HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGShorthand.sml.
You must of course call open DGShorthand before you can use
these operators.
All necessary nodes are created by using other parts of the implementation.
Specifically, you must always begin constructing a user interface
by creating a MasterNode. This is done with the call uiCore.createMasterNode ().
You create nodes for user interface controls you need by calling
Reg.createA "Window". The
argument Window here is the name of the user interface control
to be created. For a list of the currently available controls, you should
start \verb'The Construct' and look at the buttons in the \verb'UI Palette'
window. Alternatively you might call Reg.registered () to get a
string list with the names of available controls.
To create the actual user interface you must first connect the nodes
correctly. All nodes created as above has a node connected to it
of type Children. To form a valid user interface, the
Children node of MasterNode must be connected to
any Window controls that you need and the Children
nodes of these windows must in turn be connected to the other
user interface controls that you want in those windows.
This means that you must be able to obtain the Children node
connected from another node. This can be done by a call similar to
val childrenNode = DGNodes.singleConnectedToType fromNode "Children" or
more conveniently using the corresponding shorthand operator
val childrenNode = fromNode +: "Children".
Now, to connect a node to a Children node you can either call
DGNodes.connect childrenNode toNode or use the shorthand operator
childrenNode \verb'~+' toNode. The \verb'~+' operator returns the node
given as the left operand so that you may connect multiple nodes to the
same node very conveniently like this fromNode \verb'~+' node1
\verb'~+' node2 \verb'~+' node3.
This should allow you to build an entire user interface (however still unconfigured).
When done the actual user interface is constructed when you call
uiCore.createGUI masterNode. Afterwards you should
just leave the application running by calling
uiCore.runGUI app.
All the code that you have written for creating the user interface, starting
with the creation of the MasterNode and until the call to uiCore.runGUI app
should be put into a function of type unit -> unit. You should pass
this function (let's call it f here) as an argument to uiCore.runApp f.
This will start Concurrent ML correctly on the X-Windows/eXene
platform.
\subsection*{Setting up the user interface using protocols}
To produce useful user interfaces you will need to configure
your graph and setup eventhandlers etc. This is done by using
protocols. Each node in the graph created contains a protocol.
Nodes like the Children node described above is what will be referred
to as a parameter node for a UI-control (or for the MasterNode).
Each UI-control has several different parameternodes, such as
PosX, PosY, EditableText etc. The Children
node only has a Null protocol with no methods, but most
other nodes have a useful protocol. For instance the position and
size nodes have a protocol for reading and writing an integer and
so on. To find out which parameternodes a given UI-control supports,
you should start \verb'The Construct', create the UI-control in
question and look at the \verb'Protocol accessor' window.
Alternatively you can call the DGNodes.connected function
to get a list of all the nodes connected to a node.
Protocols are implemented in structures which all begins with P
for protocol. Examples are PString, PInt and PIntDrawable.
These structures contain the methods that constitutes the protocols.
Some common protocols are defined in
HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGPCommon.
Some more special protocols are defined under
HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/.
All methods in all protocols take the protocol itself as
the first argument and any additional arguments as appropriate.
For example, calling the write method in the protocol
PString is done like this: PString.write protocol "Some string".
To obtain the protocol for a node you will have to typecast the
node into the correct protocol type. For convenience, all protocols
have a structure with the name of the protocol structure prefixed with
DG for directed graph. This structure has a method called p
for obtaining the protocol from a node. An example of typecasting
a node to it's string protocol is val stringProtocol = DGPString.p someNode.
A more compact way of writing to a string protocol in a node would be like this:
PString.write (DGPString.p node) "Some string", but it may be a
good thing to keep a typecasted protocol around if you are going to call
many methods in the same parameter node. This will most likely be the case
if you are using the drawing protocol or a PStrings protocol
for the lines in a listbox.
\subsection*{Useful protocols}
The single valued protocols are PString, PInt,
PReal and PBool. They all have a write
method and a read method of the
appropriate types for reading and writing a single value. They
also have the methods addChangedNotifier,
removeChangedNotifier and doNotifyChanged for adding
event handlers for when the value changes. The event handlers
generally have type DGNodes.t -> TypeOfTheValueChanged -> unit.
The addChangedNotifier returns a notifier ID that you can
use later for removing your notifier by calling removeChangedNotifier.
The method doNotifyChanged just calls all registered notifiers in
the node with the arguments given.
Other useful protocols include the PStrings protocol used in the
TextLines node on the listbox. This protocol has methods like
clear, count, add, remove, insertAt
and deleteAt.
Then there are the notification protocols PNotify and
PPointerButtonNotify which have the methods addNotifier,
removeNotifier and doNotify similar to the methods in the
single valued protocols. Lastly there's the PIntDrawable
which is currently an incomplete (but very useful) drawing protocol using
integer coordinates. It is currently not implemented on the
MLWorks/Windows platform.
\section*{Future work}
There are a few things which I will try to give a very high priority:
\begin{itemize}
\item Destruction of the implemented GUI controls is not yet implemented
and when closing a window you get unexpected behaviour. This will be
fixed ASAP.
\item The way to implement UI-controls is currently far from optimal.
\item There must be complete support for hierarchies of UI-controls.
\item The currently implemented GUI-controls are not entirely complete and
because of this, the controls still differ a little between the platforms.
This will fix itself as the implementation evolves :)
\item Popupmenus are really a must. Preferably radial ones...
\end{itemize}
As for further plans, it depends on what I will need and what you
will need. I will be very happy to recieve requests for certain features
that you might need. And of course, bugreports are highly encouraged :)
\end{document}
HardcoreProcessing/MLAbstractUI/docs/html/ 40755 1750 1750 0 6774207462 17110 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/docs/html/MLAbstractUIDoc.html 100644 1750 1750 24727 6774207506 23006 0 ustar anoq anoq
Hardcore Processing - homepage
ML::ABSTRACTUI DOCUMENTATION
Introduction
With UI standing for user interface, then by definition,
ML::AbstractUI is a UI-concept independent UI-API in
Standard ML currently with crossplatform classical windowing
system implementations for 'WindowsNT/95/98', 'Linux/X-Windows' and
other Unixes. (yes, that's a long definition... :).
It is all distributed under the GNU General Public Library Licence (LGPL),
which (in short) allows you to build commercial applications with it, as long
as you distribute all the sourcecode and copyrightnotices for ML::AbstractUI
in unmodified form along with your software.
There is also a GUI builder, called The Construct, available for
ML::AbstractUI on this homepage.
It is concievable that ML::AbstractUI will
be merged with "Stuart Croy's" 'VisualML' toolkit.
(\verb'http://www.tardis.ed.ac.uk/~skc/VisualML.htmld/').
This document gives a little overview of the current release
and it also outlines my current ideas about how everything should have been :).
User Interfaces in ML::AbstractUI
User Interfaces in ML::AbstractUI is represented as a directed
graph. This graph is the client interface for creating and
manipulating user interfaces.
Such a UI-graph can be created
and manipulated interactively using The Construct. This
is actually recommended for building user interfaces, since
The Construct will help you to
avoid mixing user interface code with application logic.
The Graph API
When building user interfaces from within an ML program you can
use the DGNodes structure. It is defined in
\verb'HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGNodes.sml'
in the distribution. The most useful functions in this structure
has also got convenient infix operators defined in the structure
DHShorthand in the file
\verb'HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGShorthand.sml'.
You must of course call 'open DGShorthand' before you can use
these operators.
All necessary nodes are created by using other parts of the implementation.
Specifically, you must always begin constructing a user interface
by creating a 'MasterNode'. This is done with the call \verb'uiCore.createMasterNode ()'.
You create nodes for user interface controls you need by calling
\verb'Reg.createA "Window"'. The
argument 'Window' here is the name of the user interface control
to be created. For a list of the currently available controls, you should
start The Construct and look at the buttons in the 'UI Palette'
window. Alternatively you might call \verb'Reg.registered ()' to get a
string list with the names of available controls.
To create the actual user interface you must first connect the nodes
correctly. All nodes created as above has a node connected to it
of type 'Children'. To form a valid user interface, the
'Children' node of 'MasterNode' must be connected to
any 'Window' controls that you need and the 'Children'
nodes of these windows must in turn be connected to the other
user interface controls that you want in those windows.
This means that you must be able to obtain the 'Children' node
connected from another node. This can be done by a call similar to
\verb'val childrenNode = DGNodes.singleConnectedToType fromNode "Children"' or
more conveniently using the corresponding shorthand operator
'val childrenNode = fromNode +: "Children"'.
Now, to connect a node to a 'Children' node you can either call
\verb'DGNodes.connect childrenNode toNode' or use the shorthand operator
'childrenNode ~+ toNode'. The '~+' operator returns the node
given as the left operand so that you may connect multiple nodes to the
same node very conveniently like this 'fromNode ~+ node1 ~+ node2 ~+ node3'.
This should allow you to build an entire user interface (however still unconfigured).
When done the actual user interface is constructed when you call
\verb'uiCore.createGUI masterNode'. Afterwards you should
just leave the application running by calling
\verb'uiCore.runGUI app'.
All the code that you have written for creating the user interface, starting
with the creation of the 'MasterNode' and until the call to \verb'uiCore.runGUI app'
should be put into a function of type 'unit -> unit'. You should pass
this function (let's call it f here) as an argument to 'uiCore.runApp f'.
This will start 'Concurrent ML' correctly on the 'X-Windows/eXene'
platform.
Setting up the user interface using protocols
To produce useful user interfaces you will need to configure
your graph and setup eventhandlers etc. This is done by using
protocols. Each node in the graph created contains a protocol.
Nodes like the 'Children' node described above is what will be referred
to as a parameter node for a UI-control (or for the 'MasterNode').
Each UI-control has several different parameternodes, such as
'PosX', 'PosY', 'EditableText' etc. The 'Children'
node only has a 'Null' protocol with no methods, but most
other nodes have a useful protocol. For instance the position and
size nodes have a protocol for reading and writing an integer and
so on. To find out which parameternodes a given UI-control supports,
you should start The Construct, create the UI-control in
question and look at the 'Protocol accessor' window.
Alternatively you can call the \verb'DGNodes.connected' function
to get a list of all the nodes connected to a node.
Protocols are implemented in structures which all begins with 'P'
for protocol. Examples are 'PString', 'PInt' and 'PIntDrawable'.
These structures contain the methods that constitutes the protocols.
Some common protocols are defined in
'HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGPCommon'.
Some more special protocols are defined under
'HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/'.
All methods in all protocols take the protocol itself as
the first argument and any additional arguments as appropriate.
For example, calling the 'write' method in the protocol
'PString' is done like this: \verb'PString.write protocol "Some string"'.
To obtain the protocol for a node you will have to typecast the
node into the correct protocol type. For convenience, all protocols
have a structure with the name of the protocol structure prefixed with
'DG' for directed graph. This structure has a method called p
for obtaining the protocol from a node. An example of typecasting
a node to it's string protocol is \verb'val stringProtocol = DGPString.p someNode'.
A more compact way of writing to a string protocol in a node would be like this:
\verb'PString.write (DGPString.p node) "Some string"', but it may be a
good thing to keep a typecasted protocol around if you are going to call
many methods in the same parameter node. This will most likely be the case
if you are using the drawing protocol or a 'PStrings' protocol
for the lines in a listbox.
Useful protocols
The single valued protocols are 'PString', 'PInt',
'PReal' and 'PBool'. They all have a 'write'
method and a 'read' method of the
appropriate types for reading and writing a single value. They
also have the methods 'addChangedNotifier',
'removeChangedNotifier' and 'doNotifyChanged' for adding
event handlers for when the value changes. The event handlers
generally have type 'DGNodes.t -> TypeOfTheValueChanged -> unit'.
The 'addChangedNotifier' returns a notifier ID that you can
use later for removing your notifier by calling 'removeChangedNotifier'.
The method 'doNotifyChanged' just calls all registered notifiers in
the node with the arguments given.
Other useful protocols include the 'PStrings' protocol used in the
'TextLines' node on the listbox. This protocol has methods like
'clear', 'count', 'add', 'remove', 'insertAt'
and 'deleteAt'.
Then there are the notification protocols 'PNotify' and
'PPointerButtonNotify' which have the methods 'addNotifier',
'removeNotifier' and 'doNotify' similar to the methods in the
single valued protocols. Lastly there's the 'PIntDrawable'
which is currently an incomplete (but very useful) drawing protocol using
integer coordinates. It is currently not implemented on the
'MLWorks/Windows' platform.
Future work
There are a few things which I will try to give a very high priority:
- Destruction of the implemented GUI controls is not yet implemented
and when closing a window you get unexpected behaviour. This will be
fixed ASAP.
- The way to implement UI-controls is currently far from optimal.
- There must be complete support for hierarchies of UI-controls.
- The currently implemented GUI-controls are not entirely complete and
because of this, the controls still differ a little between the platforms.
This will fix itself as the implementation evolves :)
- Popupmenus are really a must. Preferably radial ones...
As for further plans, it depends on what I will need and what you
will need. I will be very happy to recieve requests for certain features
that you might need. And of course, bugreports are highly encouraged :)
HardcoreProcessing/MLAbstractUI/docs/postscript/ 40755 1750 1750 0 6774207462 20356 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/docs/postscript/MLAbstractUIDoc.ps 100644 1750 1750 210672 6774207507 23747 0 ustar anoq anoq %!PS-Adobe-2.0
%%Creator: dvips(k) 5.82 Copyright 1998 Radical Eye Software
%%Title: MLAbstractUIDoc.dvi
%%Pages: 4
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -o MLAbstractUIDoc.ps MLAbstractUIDoc.dvi
%DVIPSParameters: dpi=600, compressed
%DVIPSSource: TeX output 1999.09.28:2042
%%BeginProcSet: texc.pro
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
N/FBB[0 0 0 0]N/nn 0 N/IE 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
/BitMaps X/BuildChar{CharBuilder}N/Encoding IE N end A{/foo setfont}2
array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
1000 div/DVImag X/IE 256 array N 2 string 0 1 255{IE S A 360 add 36 4
index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
(LaserWriter 16/600)]{A length product length le{A length product exch 0
exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
%%EndProcSet
TeXDict begin 39158280 55380996 1000 600 600 (MLAbstractUIDoc.dvi)
@start
%DVIPSBitmapFont: Fa cmsy10 10 1
/Fa 1 16 df15
D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fb cmr8 8 26
/Fb 26 122 df<13E0EA01F01203A2EA07E0EA0FC0EA1F00121E5A5A12E012400C0C72AD
23>19 D<13031307130E131C1338137013F0EA01E013C01203EA0780A2EA0F00A2121EA3
5AA45AA512F8A25AAB7EA21278A57EA47EA37EA2EA0780A2EA03C0120113E0EA00F01370
1338131C130E1307130310437AB11B>40 D<12C07E12707E7E7E120FEA0780120313C0EA
01E0A2EA00F0A21378A3133CA4131EA5131FA2130FAB131FA2131EA5133CA41378A313F0
A2EA01E0A2EA03C013801207EA0F00120E5A5A5A5A5A10437CB11B>I<130C133C137CEA
03FC12FFEAFC7C1200B3B113FE387FFFFEA2172C7AAB23>49 D57 D<4A7E4A7EA34A7EA24A7EA3EC1BF81419A2EC30FCA2EC70FEEC607EA24A7E
A349486C7EA2010380EC000FA201066D7EA3496D7EA2011FB57EA29038180001496D7EA3
49147EA201E0147F4980A20001ED1F801203000716C0D80FF0EC3FE0D8FFFC0103B5FCA2
302F7EAE35>65 D<90387FFFF0A201001300147EB3AD123812FEA314FE5C1278387001F8
6C485A381E07E03807FF80D801FCC7FC1C2E7DAC24>74 D78 DI81
D<90383F80303901FFF0703807C07C390F000EF0001E13074813034813011400127000F0
1470A315307EA26C1400127E127FEA3FE013FE381FFFE06C13FC6C13FF00011480D8003F
13E013039038003FF0EC07F81401140015FC157C12C0153CA37EA215787E6C14706C14F0
6CEB01E039F78003C039E3F00F0038E07FFE38C00FF01E2F7CAD27>83
D<13FF000713C0380F01F0381C00F8003F137C80A2143F001E7FC7FCA4EB07FF137F3801
FE1FEA07F0EA1FC0EA3F80EA7F00127E00FE14065AA3143F7E007E137F007FEBEF8C391F
83C7FC390FFF03F83901FC01E01F207D9E23>97 D99
D<15F8141FA214011400ACEB0FE0EB7FF83801F81E3803E0073807C003380F8001EA1F00
481300123E127EA25AA9127C127EA2003E13017EEB8003000F13073903E00EFC3A01F03C
FFC038007FF090391FC0F800222F7EAD27>II<
EB03F0EB0FFCEB3E1EEB7C3F13F8EA01F0A23803E00C1400AAB512E0A23803E000B3A648
7E387FFF80A2182F7FAE16>I104
DI
108 D<3807C0FE39FFC3FF809038C703E0390FDE01F0EA07F8496C7EA25BA25BB2486C48
7E3AFFFE1FFFC0A2221E7E9D27>110 DI<380781F8
38FF87FEEB8E3FEA0F9CEA07B813B0EBF01EEBE000A45BB0487EB5FCA2181E7E9D1C>
114 D<3801FE183807FFB8381E01F8EA3C00481378481338A21418A27E7EB41300EA7FF0
6CB4FC6C13C06C13F0000113F838001FFC130138C0007E143EA26C131EA27EA26C133CA2
6C137838FF01F038E3FFC000C0130017207E9E1C>I<1360A413E0A312011203A2120712
1FB512F0A23803E000AF1418A714383801F03014703800F860EB3FE0EB0F80152A7FA81B
>II<3AFFFC01FFC0A23A0FE0007E00000714
7C1538000314306D137000011460A26C6C5BA2EBFC01017C5BEB7E03013E90C7FCA2EB1F
06A2148EEB0F8CA2EB07D8A2EB03F0A36D5AA26D5AA2495AA2130391C8FC1278EAFC06A2
5B131CEA7838EA7070EA3FE0EA0F80222B7F9C25>121 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fc cmsy6 6 1
/Fc 1 4 df<136013701360A20040132000E0137038F861F0387E67E0381FFF803807FE
00EA00F0EA07FE381FFF80387E67E038F861F038E060700040132000001300A213701360
14157B9620>3 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fd cmbx12 12 22
/Fd 22 118 df65 D71
D73 D80 D83
D<003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2007E180300
7C1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437CC24E>II<903801FFE0011F13FE01
7F6D7E48B612E03A03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA
00F090C7FCA40203B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381FFE00
485A5B127F5B12FF5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007
EBFFF86CECE01FC66CEB8007D90FFCC9FC322F7DAD36>97 D99 D101 DIII<137C48B4FC4813804813C0A24813E0A56C13C0A26C13
806C1300EA007C90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520>I108 D<90397F8007FEB590383FFF8092
B512E0028114F8913987F03FFC91388F801F000390399F000FFE6C139E14BC02F86D7E5C
A25CA35CB3A7B60083B512FEA5372D7CAC3E>110 DI<90397FC00FF8B590B57E02C314E002CF14F89139DFC03FFC91
39FF001FFE000301FCEB07FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF3FFC
ACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913806E4913006E495A9139DFC07FFC02
CFB512F002C314C002C091C7FCED1FF092C9FCADB67EA536407DAC3E>I<90387F807FB5
3881FFE0028313F0028F13F8ED8FFC91389F1FFE000313BE6C13BC14F8A214F0ED0FFC91
38E007F8ED01E092C7FCA35CB3A5B612E0A5272D7DAC2E>114 D<90391FFC038090B512
87000314FF120F381FF003383FC00049133F48C7121F127E00FE140FA215077EA27F01E0
90C7FC13FE387FFFF014FF6C14C015F06C14FC6C800003806C15806C7E010F14C0EB003F
020313E0140000F0143FA26C141F150FA27EA26C15C06C141FA26DEB3F8001E0EB7F0090
38F803FE90B55A00FC5CD8F03F13E026E007FEC7FC232F7CAD2C>III E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fe cmtt10 10 42
/Fe 42 127 df39
D<147814FCAF007FB612F0B712F8A46C15F0C700FCC7FCAF147825267DAB2C>43
D<007FB6FCB71280A46C150021067B9B2C>45 D<121FEA3F80EA7FC0EAFFE0A5EA7FC0EA
3F80EA1F000B0B708A2C>I<1507ED0F80151FA2153F16005D157E15FE5D14015D14035D
A214075D140F5D141F5D143F92C7FC5C147E14FE5CA213015C13035C13075C130F5C131F
5CA2133F91C8FC5B137E13FE5B12015B12035B12075BA2120F5B121F5B123F90C9FC5A12
7E12FE5AA25A127821417BB92C>I<000FB512FE4880A35D0180C8FCADEB83FE90389FFF
8090B512E015F8819038FE03FE9038F000FF01C07F49EB3F8090C7121F6C15C0C8120FA2
ED07E0A4123C127EB4FC150F16C0A248141F007EEC3F80007FEC7F006C6C5B6D485A391F
F80FFC6CB55A6C5C000114C06C6C90C7FCEB0FF823347CB22C>53
D
56 DI<121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA
1F00C7FCAE121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F000B2470A32C>I<02FF13
700107EBE0F84913F9013F13FD4913FFEBFF813901FE007F4848131FD807F0130F150748
5A491303485A150148C7FCA25A007EEC00F01600A212FE5AAB7E127EA3007F15F06CEC01
F8A26C7EA26C6C13036D14F06C6C130716E0D803FC131F6C6CEB3FC03A00FF81FF806DB5
12006D5B010F5B6D13F00100138025357DB32C>67 D<903901FC038090390FFF87C04913
EF017F13FF90B6FC4813073803FC01497E4848137F4848133F49131F121F5B003F140F90
C7FCA2127EED078092C7FCA212FE5AA8913803FFF84A13FCA27E007E6D13F89138000FC0
A36C141FA27F121F6D133F120F6D137F6C7E6C6C13FF6D5A3801FF076C90B5FC6D13EF01
1F13CF6DEB0780D901FCC7FC26357DB32C>71 D<007FB512F8B612FCA36C14F839000FC0
00B3B3A5007FB512F8B612FCA36C14F81E3379B22C>73 D<387FFFE0B57EA36C5BD803F0
C8FCB3AE16F0ED01F8A8007FB6FCB7FCA36C15F025337DB22C>76
DII<007F
B512C0B612F88115FF6C15802603F00013C0153FED0FE0ED07F0A2150316F81501A61503
16F01507A2ED0FE0ED3FC015FF90B61280160015FC5D15C001F0C8FCB0387FFF80B57EA3
6C5B25337EB22C>80 D<90381FF80790B5EA0F804814CF000714FF5A381FF01F383FC003
497E48C7FC007E147F00FE143F5A151FA46CEC0F00007E91C7FC127F7FEA3FE0EA1FFCEB
FFC06C13FC0003EBFFC06C14F06C6C7F01077F9038007FFEEC07FF02001380153FED1FC0
A2ED0FE0A20078140712FCA56CEC0FC0A26CEC1F806D133F01E0EB7F009038FE01FF90B5
5A5D00F914F0D8F83F13C0D8700790C7FC23357CB32C>83 D<007FB612FCB712FEA43AFC
007E007EA70078153CC71400B3AF90383FFFFCA2497F6D5BA227337EB22C>I<3B7FFF80
3FFFC0B56C4813E0A36C496C13C03B03F00001F800B3AF6D130300015DA26D130700005D
6D130F017F495A6D6C485AECE0FF6DB5C7FC6D5B010313F86D5B9038003F802B3480B22C
>III<3A3FFF03FFE04849
13F0148714076C6D13E03A01F800FE007F0000495A13FE017E5BEB7F03013F5B1487011F
5B14CF010F5B14FF6D5BA26D90C7FCA26D5AA26D5AA2497EA2497EA2497F81EB0FCF81EB
1FC7EC87F0EB3F83EC03F8EB7F01017E7FEBFE00497F0001147E49137F00038049148015
1FD87FFEEBFFFC6D5AB514FE6C15FC497E27337EB22C>I<3801FFF0000713FE001F6D7E
15E048809038C01FF81407EC01FC381F80000006C77EC8127EA3ECFFFE131F90B5FC1203
120F48EB807E383FF800EA7FC090C7FC12FE5AA47E007F14FEEB8003383FE01F6CB612FC
6C15FE6C14BF0001EBFE1F3A003FF007FC27247CA32C>97 D<903803FFE0011F13F8017F
13FE48B5FC48804848C6FCEA0FF0485A49137E4848131890C9FC5A127EA25AA8127EA212
7F6C140F6DEB1F806C7E6D133F6C6CEB7F003907FE03FF6CB55A6C5C6C6C5B011F13E001
0390C7FC21247AA32C>99 DII104 D<1307EB1FC0A2497EA36D5AA20107C7FC90C8FCA7
387FFFC080B5FC7EA2EA0007B3A8007FB512FCB612FEA36C14FC1F3479B32C>I107
D<387FFFE0B57EA37EEA0003B3B3A5007FB61280B712C0A36C158022337BB22C>I<3A7F
83F007E09039CFFC1FF83AFFDFFE3FFCD87FFF13FF91B57E3A07FE1FFC3E01FCEBF83F49
6C487E01F013E001E013C0A301C01380B33B7FFC3FF87FF0027F13FFD8FFFE6D13F8D87F
FC4913F0023F137F2D2481A32C>I<397FF01FE039FFF87FFC9038F9FFFE01FB7F6CB6FC
00019038F03F80ECC01F02807FEC000F5B5BA25BB3267FFFE0B5FCB500F11480A36C01E0
140029247FA32C>II<397FF01FE039FFF8FFF801FB13FE90B6FC6C158000019038
F07FC09138801FE091380007F049EB03F85BED01FC491300A216FE167EA816FE6D14FCA2
ED01F86D13036DEB07F0150F9138801FE09138E07FC091B51280160001FB5B01F813F8EC
3FC091C8FCAD387FFFE0B57EA36C5B27367FA32C>I114 D<90387FF8700003B512F8120F5A5A387FC00F
387E00034813015AA36CEB00F0007F140013F0383FFFC06C13FE6CEBFF80000314E0C66C
13F8010113FCEB0007EC00FE0078147F00FC143F151F7EA26C143F6D133E6D13FE9038F0
07FC90B5FC15F815E000F8148039701FFC0020247AA32C>I<131E133FA9007FB6FCB712
80A36C1500D8003FC8FCB1ED03C0ED07E0A5EC800F011FEB1FC0ECE07F6DB51280160001
035B6D13F89038003FE0232E7EAD2C>I<3A7FF003FF80486C487FA3007F7F0001EB000F
B3A3151FA2153F6D137F3900FE03FF90B7FC6D15807F6D13CF902603FE07130029247FA3
2C>I119 D<3A3FFF03FFF048018713
F8A36C010313F03A00FC007E005D90387E01F8013F5BEB1F83EC87E090380FCFC0903807
EF80EB03FF6D90C7FC5C6D5A147C14FE130180903803EF80903807CFC0EB0FC7EC83E090
381F01F0013F7FEB7E00017C137C49137E0001803A7FFF01FFFC1483B514FE6C15FC1401
27247EA32C>I<3A7FFF01FFFCB5008113FE148314816C010113FC3A03E0000F806C7E15
1F6D140012005D6D133E137C017E137E013E137CA2013F13FC6D5BA2EB0F815DA2EB07C1
ECC3E0A2EB03E3ECE7C0130114F75DEB00FFA292C7FC80A2143EA2147E147CA214FC5CA2
EA0C01003F5BEA7F83EB87E0EA7E0F495A387FFF806C90C8FC6C5A6C5AEA07E027367EA3
2C>I<01F81370D803FE13F8380FFF0148138748EBCFF0397F9FFFE0D8FF0F13C0D8FC07
138039F803FE00387000F81D0A79B22C>126 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Ff cmr10 10 66
/Ff 66 123 df11
DI<001C131C007F137F39FF80FF80A26D13C0A3007F137F001C131C
00001300A40001130101801380A20003130301001300485B00061306000E130E485B485B
485B006013601A197DB92A>34 D<121C127FEAFF80A213C0A3127F121C1200A412011380
A2120313005A1206120E5A5A5A12600A1979B917>39 D<146014E0EB01C0EB0380EB0700
130E131E5B5BA25B485AA2485AA212075B120F90C7FCA25A121EA2123EA35AA65AB2127C
A67EA3121EA2121F7EA27F12077F1203A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0
EB00E01460135278BD20>I<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A213
7C133C133E131EA2131F7FA21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B13
1EA2133E133C137C1378A25BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>
I<15301578B3A6007FB812F8B912FCA26C17F8C80078C8FCB3A6153036367BAF41>43
D<121C127FEAFF80A213C0A3127F121C1200A412011380A2120313005A1206120E5A5A5A
12600A19798817>II<121C127FEAFF80A5EA7F00121C09097988
17>I<150C151E153EA2153C157CA2157815F8A215F01401A215E01403A215C01407A215
80140FA215005CA2141E143EA2143C147CA2147814F8A25C1301A25C1303A2495AA25C13
0FA291C7FC5BA2131E133EA2133C137CA2137813F8A25B1201A25B1203A25B1207A25B12
0FA290C8FC5AA2121E123EA2123C127CA2127812F8A25A12601F537BBD2A>I49
DII<1538A2157815F8
A2140114031407A2140F141F141B14331473146314C313011483EB030313071306130C13
1C131813301370136013C01201EA038013005A120E120C5A123812305A12E0B712F8A3C7
3803F800AB4A7E0103B512F8A325397EB82A>I<121C127FEAFF80A5EA7F00121CC7FCB2
121C127FEAFF80A5EA7F00121C092479A317>58 D<007FB812F8B912FCA26C17F8CCFCAE
007FB812F8B912FCA26C17F836167B9F41>61 D<130EEB3F80497EA56D5A010EC7FC90C8
FCA81306A4130E130CA6131CA35BA213785BA21201485A1207485A485A123F48C8FCA200
FE14F0EC01F8EC03FCA41401EC00F8007E1438007F14706C14E0391F8003C0390FC01F00
3803FFFC38007FE01E3B7CA927>I<1538A3157CA315FEA34A7EA34A6C7EA202077FEC06
3FA2020E7FEC0C1FA2021C7FEC180FA202387FEC3007A202707FEC6003A202C07F1501A2
D901807F81A249C77F167FA20106810107B6FCA24981010CC7121FA2496E7EA3496E7EA3
496E7EA213E0707E1201486C81D80FFC02071380B56C90B512FEA3373C7DBB3E>65
DI<913A01FF800180020FEBE003027F13F8903A01FF807E07903A03
FC000F0FD90FF0EB039F4948EB01DFD93F80EB00FF49C8127F01FE153F12014848151F48
48150FA248481507A2485A1703123F5B007F1601A35B00FF93C7FCAD127F6DED0180A312
3F7F001F160318006C7E5F6C7E17066C6C150E6C6C5D00001618017F15386D6C5CD91FE0
5C6D6CEB03C0D903FCEB0F80902701FF803FC7FC9039007FFFFC020F13F002011380313D
7BBA3C>III<
B812F8A30001903880001F6C90C71201EE00FC177C173C171CA2170CA4170E1706A2ED01
80A21700A41503A21507151F91B5FCA3EC001F15071503A21501A692C8FCAD4813C0B612
C0A32F397DB836>III
I76 DIIII<
B612FEEDFFE016F8000190388007FE6C90C76C7EEE3FC0707E707E707EA2707EA283A65F
A24C5AA24C5A4C5AEE3F8004FFC8FCED07FC91B512E05E9138000FF0ED03F8ED00FE8270
7E707EA2161F83A583A6F00180A217F8160F1803486D01071400B66D6C5A040113069338
00FE0ECAEA3FFCEF07F0393B7DB83D>82 DI<003FB812E0A3D9C003EB001F273E0001FE13
0348EE01F00078160000701770A300601730A400E01738481718A4C71600B3B0913807FF
80011FB612E0A335397DB83C>III<
B5D8FC07B5D8F001B5FCA30007902780001FFEC7EA1FF86C48C7D80FF8EC07E000010307
ED03C01B807F6C6F6C1500A26E5F017F6E6C1406A280013F4A6C5CA280011F4A6D5BEE06
7FA26D6C010E6D5BEE0C3FA26D6C011C6D5BEE181FA26D6C6F5BEE300FA26D6C6F485AEE
6007A26D6C4CC7FC9338C003FCA203805D913B7F818001FE06A203C1150EDA3FC3C7EAFF
0CA203E3151CDA1FE6EC7F98A215F6DA0FFCEC3FF0A302075E4B141FA202035E4B140FA2
02015E4B1407A2020093C8FC4B80503B7EB855>I<007FB590383FFFFCA3C601F8010713
80D97FE0D903FCC7FC013FEC01F06D6C5C5F6D6C5C6D6C13034CC8FC6D6C1306160E6D6C
5B6DEB8018163891387FC0306E6C5A16E06E6C5A91380FF18015FB6EB4C9FC5D14036E7E
A26E7F6F7EA24B7E15DF9138019FF09138038FF8150F91380607FC91380E03FE140C4A6C
7EEC38000230804A6D7E14E04A6D7E49486D7E130391C76C7E01066E7E130E010C6E7E01
1C1401013C8101FE822607FF80010713E0B500E0013FEBFF80A339397EB83E>II97 DIII
I<147E903803FF8090380FC1E0EB1F8790383F0FF0137EA213FCA23901F803C091C7FCAD
B512FCA3D801F8C7FCB3AB487E387FFFF8A31C3B7FBA19>IIIIIII<2703F00FF0EB
1FE000FFD93FFCEB7FF8913AF03F01E07E903BF1C01F83803F3D0FF3800FC7001F802603
F70013CE01FE14DC49D907F8EB0FC0A2495CA3495CB3A3486C496CEB1FE0B500C1B50083
B5FCA340257EA445>I<3903F00FF000FFEB3FFCECF03F9039F1C01F803A0FF3800FC038
03F70013FE496D7EA25BA35BB3A3486C497EB500C1B51280A329257EA42E>II<3903F01FE000FFEB7FF89038F1E07E9039F3801F803A0FF7000FC0D803FEEB07
E049EB03F04914F849130116FC150016FEA3167FAA16FEA3ED01FCA26DEB03F816F06D13
076DEB0FE001F614C09039F7803F009038F1E07E9038F0FFF8EC1FC091C8FCAB487EB512
C0A328357EA42E>II<3807E01F00FFEB7FC09038E1E3E09038E387F0380FE707EA03
E613EE9038EC03E09038FC0080491300A45BB3A2487EB512F0A31C257EA421>II<1318A51338A313
78A313F8120112031207001FB5FCB6FCA2D801F8C7FCB215C0A93800FC011580EB7C0301
7E13006D5AEB0FFEEB01F81A347FB220>III<
B53A1FFFE03FFEA3260FF8009038000FF86C48017EEB03E018C00003023EEB0180A26C6C
013FEB0300A36C6CEC8006156FA2017E9038EFC00C15C7A2D93F016D5A15830281EBF038
D91F831430150102C3EBF87090260FC6001360A2D907E66D5A02EC137CA2D903FCEB7F80
4A133FA2010192C7FC4A7FA20100141E4A130E0260130C37257EA33C>III<003FB512FCA2EB8003D83E0013F800
3CEB07F00038EB0FE012300070EB1FC0EC3F800060137F150014FE495AA2C6485A495AA2
495A495A495AA290387F000613FEA2485A485A0007140E5B4848130C4848131CA2484813
3C48C7127C48EB03FC90B5FCA21F247EA325>I E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fg cmbx12 14.4 22
/Fg 22 120 df58
D<171F4D7E4D7EA24D7EA34C7FA24C7FA34C7FA34C7FA24C7FA34C8083047F80167E8304
FE804C7E03018116F8830303814C7E03078116E083030F814C7E031F81168083033F8293
C77E4B82157E8403FE824B800201835D840203834B800207835D844AB87EA24A83A3DA3F
80C88092C97E4A84A2027E8202FE844A82010185A24A820103854A82010785A24A82010F
855C011F717FEBFFFCB600F8020FB712E0A55B547BD366>65 D70 D
73 D76
DI85
D97
DI<913801FFF8021FEBFF8091B612F0010315FC010F9038C00FFE903A1FFE0001
FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2486F138091C7FC486F1300705A48
92C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C6D15C07E6E140F6CEE1F806C6DEC
3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF0010390B55A01001580023F49C7FC
020113E033387CB63C>I<4DB47E0407B5FCA5EE001F1707B3A4913801FFE0021F13FC91
B6FC010315C7010F9038E03FE74990380007F7D97FFC0101B5FC49487F4849143F484980
485B83485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37EA26C7F5F6C6D5C7E6C6D5C6C
6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07FCF6D90B5128F0101ECFE0FD9
003F13F8020301C049C7FC41547CD24B>I<913803FFC0023F13FC49B6FC010715C04901
817F903A3FFC007FF849486D7E49486D7E4849130F48496D7E48178048497F18C0488191
C7FC4817E0A248815B18F0A212FFA490B8FCA318E049CAFCA6127FA27F7EA218E06CEE01
F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F806D6CECFF00D91FFEEB03FE
903A0FFFC03FF8010390B55A010015C0021F49C7FC020113F034387CB63D>II<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90
C8FCADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>105
D107
D110 D<913801FFE0021F13FE91B612C0010315F0010F9038807FFC903A1FFC
000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A147F48834890C86C7EA24883A248
486F7EA3007F1880A400FF18C0AC007F1880A3003F18006D5DA26C5FA26C5F6E147F6C5F
6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7FC903A0FFF807FFC6D90B55A01
0015C0023F91C8FC020113E03A387CB643>I<90397FE003FEB590380FFF80033F13E04B
13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC07FECE78014EF150014EE02FEEB
3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F367CB537>114
D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE0130148487F4980
127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF16C06C15F06C
816C816C81C681013F1580010F15C01300020714E0EC003F030713F015010078EC007F00
F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FEEB01FE9039FF
C00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<143EA6147EA414
FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003FFEC8FCB3A9EE
07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B021F5B0203
13802A4D7ECB34>II119 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fh cmsy8 8 2
/Fh 2 14 df<130C131EA50060EB01800078130739FC0C0FC0007FEB3F80393F8C7F0038
07CCF83801FFE038007F80011EC7FCEB7F803801FFE03807CCF8383F8C7F397F0C3F8000
FCEB0FC039781E078000601301000090C7FCA5130C1A1D7C9E23>3
D
13 D E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fi cmr12 12 30
/Fi 30 118 df<131F1480133F137FA2EBFF00485A485A5B485A485A138048C7FC123E12
3C5A12E0124011126CC431>19 D<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413
E013C0A312011380120313005A1206120E5A5A5A12600B1D78891B>44
D<143014F013011303131F13FFB5FC13E713071200B3B3B0497E497E007FB6FCA3204278
C131>49 DI<14FF010713E0011F13F8
90387F00FE01FC133FD801F0EB1F804848EB0FC049EB07E00007EC03F048481301A290C7
13F8481400A47FA26D130116F07F6C6CEB03E013FC6C6CEB07C09039FF800F806C9038C0
1F006CEBF03EECF87839007FFEF090383FFFC07F01077F6D13F8497F90381E7FFFD97C1F
1380496C13C02601E00313E048486C13F000079038007FF84848EB3FFC48C7120F003EEC
07FE150148140016FF167F48153FA2161FA56C151E007C153EA2007E153C003E157C6C15
F86DEB01F06C6CEB03E06C6CEB07C0D803F8EB1F80C6B4EBFF0090383FFFFC010F13F001
01138028447CC131>56 D<14FF010713E0011F13F890387F80FC9038FC007E48487F4848
EB1F804848EB0FC0000FEC07E0485AED03F0485A16F8007F140190C713FCA25AA216FE15
00A516FFA46C5CA36C7E5D121F7F000F5C6C6C130E150C6C6C131C6C6C5BD8007C5B9038
3F01E090390FFF80FE903801FE0090C8FC150116FCA4ED03F8A216F0D80F801307486C14
E0486C130F16C0ED1F80A249EB3F0049137E001EC75A001C495A000F495A3907E01FE06C
B51280C649C7FCEB1FF028447CC131>I<16C04B7EA34B7EA34B7EA34B7EA3ED19FEA3ED
30FFA203707FED607FA203E07FEDC03FA2020180ED801FA2DA03007F160FA20206801607
A24A6D7EA34A6D7EA34A6D7EA20270810260147FA202E08191B7FCA249820280C7121FA2
49C87F170FA20106821707A2496F7EA3496F7EA3496F7EA201788313F8486C83D80FFF03
037FB500E0027FEBFFC0A342477DC649>65 D72 D78
DIII<49B41303010FEBE007013F13F8
9039FE00FE0FD801F8131FD807E0EB079F49EB03DF48486DB4FC48C8FC4881003E81127E
82127C00FC81A282A37E82A27EA26C6C91C7FC7F7FEA3FF813FE381FFFE06C13FE6CEBFF
E06C14FC6C14FF6C15C0013F14F0010F80010180D9001F7F14019138001FFF0303138081
6F13C0167F163F161F17E000C0150FA31607A37EA36C16C0160F7E17806C151F6C16006C
5D6D147ED8FBC05CD8F9F0495AD8F07C495A90393FC00FE0D8E00FB51280010149C7FC39
C0003FF02B487BC536>83 D97 DII<167FED3FFFA315018182B3EC7F809038
03FFF090380FC07C90383F000E017E1307496D5AD803F87F48487F5B000F81485AA2485A
A2127FA290C8FC5AAB7E7FA2123FA26C7EA2000F5D7F6C6C5B00035C6C6C9038077F806C
6C010E13C0013F011C13FE90380FC0F8903803FFE09026007F0013002F467DC436>IIIIII109 D<3901FC01FE00FF903807FFC091381E
07F091383801F8000701707F0003EBE0002601FDC07F5C01FF147F91C7FCA25BA35BB3A8
486CECFF80B5D8F83F13FEA32F2C7DAB36>II<3901FC03FC00FF90380FFF8091383C07E091387001F83A07FDE000FE00030180137F
D801FFEC3F8091C7EA1FC04915E049140F17F0160717F8160317FCA3EE01FEABEE03FCA3
EE07F8A217F0160F6D15E0EE1FC06D143F17806EEB7E00D9FDC05B9039FCF003F891383C
0FE091381FFF80DA03FCC7FC91C9FCAE487EB512F8A32F3F7DAB36>I<3903F803F000FF
EB1FFCEC3C3EEC707F0007EBE0FF3803F9C000015B13FBEC007E153C01FF13005BA45BB3
A748B4FCB512FEA3202C7DAB26>114 D<90383FE0183901FFFC383907E01F78390F0003
F8001E1301481300007C1478127800F81438A21518A27EA27E6C6C13006C7E13FC383FFF
E06C13FC6C13FF6C14C06C14E0C614F0011F13F81300EC0FFC140300C0EB01FE1400157E
7E153EA27EA36C143C6C147C15786C14F86CEB01F039F38003E039F1F00F8039E07FFE00
38C00FF01F2E7DAC26>I<1306A5130EA4131EA3133E137EA213FE12011207001FB512F0
B6FCA2C648C7FCB3A4150CAA017E131C017F1318A26D133890381F8030ECC070903807E0
E0903801FFC09038007F001E3E7EBC26>II E
%EndDVIPSBitmapFont
%DVIPSBitmapFont: Fj cmr17 17.28 19
/Fj 19 118 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F00C7FCB3B3A2120FEA
3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C3E74BD24>58 D<170FA34D7EA24D7EA34D
7EA34D7EA34C7F17DFA29338039FFC178FA29338070FFE1707040F7FEE0E03A2041E80EE
1C01A2043C80EE3800A24C80187FA24C80183FA24B4880181F0303814C130FA203078193
C71207A24B81030E80A24B8284A24B8284A24B82197F03F0824B153FA20201834B151FA2
02038392B8FCA24A83A292C91207020E8385A24A8485023C84023882A20278840270177F
A202F0844A173FA24948841A1FA24948841A0FA249CB7F1A074985865B496C85497E4848
6C4D7F000F01F8051F13F0B60407B612F0A45C657DE463>65 D68
D73 D76 DI85 D97 DI<4AB47E
020F13F8023F13FE9139FF007F80D903FCEB07E0D907F0EB01F0D91FE0EB007849488049
488049C87E48485D4915FF00034B138048485CA2485AA2485AA2003F6F130049EC007C94
C7FC127FA35B12FFAD127F7FA4123F7FA2001FEE01C07F000F16036D168012076C6C1507
6D160000015E6C6C151E6D6C5C6D6C5C6D6C5CD90FF8495AD903FCEB07C0903A00FF803F
8091263FFFFEC7FC020F13F80201138032417CBF3A>I101 D<133C13FF487F487FA66C5B6C90C7FC13
3C90C8FCB3A2EB03C0EA07FF127FA41201EA007FA2133FB3B3AC497E497EB612E0A41B5F
7DDE23>105 D109 DII<9039078003F8D807FFEB0FFFB5013F13C092387C0FE0913881F01F9238E03F
F00001EB838039007F8700148FEB3F8E029CEB1FE0EE0FC00298EB030002B890C7FCA214
B014F0A25CA55CB3B0497EEBFFF8B612FCA42C3F7CBE33>114 D<9139FFE00180010FEB
FC03017FEBFF073A01FF001FCFD803F8EB03EFD807E0EB01FF48487F4848147F48C8123F
003E151F007E150F127CA200FC1507A316037EA27E7F6C7E6D91C7FC13F8EA3FFE381FFF
F06CEBFF806C14F86C14FF6C15C06C6C14F0011F80010714FED9007F7F02031480DA003F
13C01503030013E0167F00E0ED1FF0160F17F86C15071603A36C1501A37EA26C16F01603
7E17E06D14076DEC0FC06D1580D8FDF0141FD8F8F8EC7F00013E14FC3AF01FC00FF80107
B512E0D8E001148027C0003FF8C7FC2D417DBF34>I<1438A71478A414F8A31301A31303
A21307130F131FA2137F13FF1203000F90B6FCB8FCA3260007F8C8FCB3AE17E0AE6D6CEB
01C0A316036D6C148016076D6C14006E6C5A91383FC01E91381FF07C6EB45A020313E091
38007F802B597FD733>II E
%EndDVIPSBitmapFont
end
%%EndProlog
%%BeginSetup
%%Feature: *Resolution 600dpi
TeXDict begin
%%PaperSize: A4
%%EndSetup
%%Page: 1 1
1 0 bop 947 880 a Fj(ML::AbstractUI)43 b(Do)t(cumen)l(tation)1017
1096 y Fi(\023)1005 1121 y(ANOQ)33 b(of)f(the)h(Sun,)g(Hardcore)g(Pro)s
(cessing)2739 1085 y Fh(\003)1455 1316 y Fi(Septem)m(b)s(er)g(28,)f
(1999)440 1798 y Fg(In)l(tro)t(duction)440 1980 y Ff(With)24
b(UI)g(standing)f(for)f(user)h(in)n(terface,)h(then)f(b)n(y)g
(de\014nition,)i(ML::AbstractUI)e(is)g(a)g(UI-)440 2080
y(concept)g(indep)r(enden)n(t)i(UI-API)e(in)g Fe(Standard)41
b(ML)22 b Ff(curren)n(tly)h(with)h(crossplatform)d(clas-)440
2179 y(sical)d(windo)n(wing)f(system)h(implemen)n(tations)h(for)f
Fe(WindowsNT/95/98)o Ff(,)d Fe(Linux/X-Windows)440 2279
y Ff(and)28 b(other)g(Unixes.)40 b(\(y)n(es,)28 b(that's)h(a)f(long)g
(de\014nition...)40 b(:\).)g(It)29 b(is)f(all)h(distributed)f(under)440
2379 y(the)d(GNU)g(General)e(Public)h(Library)f(Licence)h(\()p
Fe(LGPL)p Ff(\),)f(whic)n(h)i(\(in)f(short\))g(allo)n(ws)f(y)n(ou)g(to)
440 2478 y(build)30 b(commercial)f(applications)f(with)i(it,)h(as)e
(long)g(as)g(y)n(ou)g(distribute)h(all)f(the)h(source-)440
2578 y(co)r(de)j(and)g(cop)n(yrigh)n(tnotices)e(for)i(ML::AbstractUI)g
(in)g(unmo)r(di\014ed)h(form)f(along)f(with)440 2678
y(y)n(our)26 b(soft)n(w)n(are.)565 2777 y(There)17 b(is)i(also)e(a)h
(GUI)h(builder,)h(called)e Fe(The)42 b(Construct)p Ff(,)17
b(a)n(v)-5 b(ailable)17 b(for)h(ML::AbstractUI)440 2877
y(on)27 b(this)h(homepage.)565 2976 y(It)i(is)g(conciev)-5
b(able)30 b(that)g(ML::AbstractUI)g(will)h(b)r(e)g(merged)e(with)i
Fe(Stuart)41 b(Croy's)440 3076 y(VisualML)c Ff(to)r(olkit.)76
b(\()p Fe(http://www.tardis)o(.ed)o(.a)o(c.)o(uk/)o(~s)o(kc/)o(Vi)o(su)
o(alM)o(L.)o(htm)o(ld)o(/)p Ff(\).)440 3176 y(This)27
b(do)r(cumen)n(t)g(giv)n(es)f(a)h(little)g(o)n(v)n(erview)e(of)i(the)h
(curren)n(t)e(release)f(and)i(it)h(also)d(outlines)440
3275 y(m)n(y)i(curren)n(t)g(ideas)g(ab)r(out)h(ho)n(w)f(ev)n(erything)f
(should)h(ha)n(v)n(e)g(b)r(een)h(:\).)440 3550 y Fg(User)46
b(In)l(terfaces)g(in)f(ML::AbstractUI)440 3732 y Ff(User)39
b(In)n(terfaces)g(in)h(ML::AbstractUI)f(is)h(represen)n(ted)e(as)h(a)g
(directed)h(graph.)71 b(This)440 3831 y(graph)26 b(is)i(the)g(clien)n
(t)g(in)n(terface)f(for)g(creating)f(and)i(manipulating)f(user)g(in)n
(terfaces.)565 3931 y(Suc)n(h)18 b(a)g(UI-graph)f(can)h(b)r(e)h
(created)e(and)i(manipulated)f(in)n(teractiv)n(ely)f(using)h
Fe(The)43 b(Construct)p Ff(.)440 4031 y(This)23 b(is)g(actually)g
(recommended)f(for)h(building)g(user)g(in)n(terfaces,)g(since)g
Fe(The)42 b(Construct)440 4130 y Ff(will)28 b(help)g(y)n(ou)f(to)g(a)n
(v)n(oid)f(mixing)i(user)e(in)n(terface)h(co)r(de)h(with)g(application)
f(logic.)440 4363 y Fd(The)38 b(Graph)g(API)440 4516
y Ff(When)19 b(building)g(user)f(in)n(terfaces)f(from)h(within)i(an)e
(ML)g(program)f(y)n(ou)g(can)i(use)f(the)h(DGN-)440 4615
y(o)r(des)f(structure.)33 b(It)19 b(is)f(de\014ned)h(in)g(HardcorePro)r
(cessing/GraphT)-7 b(o)r(olkit/sr)o(cSML/Dire)o(ctedGraph/DGNo)r
(des.sml)440 4715 y(in)23 b(the)h(distribution.)35 b(The)24
b(most)f(useful)g(functions)h(in)f(this)g(structure)g(has)g(also)f(got)
g(con-)440 4815 y(v)n(enien)n(t)29 b(in\014x)h(op)r(erators)e
(de\014ned)i(in)h(the)f(structure)f(DHShorthand)h(in)g(the)g(\014le)g
(Hard-)440 4914 y(corePro)r(cessing/GraphT)-7 b(o)r(olkit/srcSML/Dir)o
(ectedGraph/DGShor)o(thand.sml.)33 b(Y)-7 b(ou)440 5014
y(m)n(ust)28 b(of)f(course)g(call)g(op)r(en)g(DGShorthand)h(b)r(efore)f
(y)n(ou)g(can)h(use)f(these)h(op)r(erators.)565 5114
y(All)e(necessary)f(no)r(des)h(are)f(created)g(b)n(y)h(using)g(other)g
(parts)f(of)i(the)f(implemen)n(tation.)440 5213 y(Sp)r(eci\014cally)-7
b(,)40 b(y)n(ou)c(m)n(ust)i(alw)n(a)n(ys)d(b)r(egin)i(constructing)g(a)
f(user)h(in)n(terface)g(b)n(y)f(creating)p 440 5282 1146
4 v 531 5344 a Fc(\003)587 5365 y Fb(c)567 5367 y Fh(\015)p
Fb(1999)811 5350 y(\023)802 5367 y(ANOQ)23 b(of)h(the)g(Sun)g(\(alias)g
(Johnn)n(y)h(Andersen\))1851 5662 y Ff(1)p eop
%%Page: 2 2
2 1 bop 440 531 a Ff(a)36 b(MasterNo)r(de.)62 b(This)36
b(is)h(done)f(with)g(the)h(call)f(uiCore.createMasterNo)r(de)e(\(\).)63
b(Y)-7 b(ou)440 631 y(create)28 b(no)r(des)g(for)g(user)h(in)n(terface)
f(con)n(trols)f(y)n(ou)h(need)g(b)n(y)h(calling)f(Reg.createA)g("Win-)
440 731 y(do)n(w".)61 b(The)36 b(argumen)n(t)f(Windo)n(w)h(here)f(is)h
(the)h(name)f(of)g(the)g(user)f(in)n(terface)h(con)n(trol)440
830 y(to)f(b)r(e)g(created.)57 b(F)-7 b(or)34 b(a)h(list)g(of)f(the)h
(curren)n(tly)f(a)n(v)-5 b(ailable)34 b(con)n(trols,)g(y)n(ou)g(should)
h(start)440 930 y Fe(The)42 b(Construct)28 b Ff(and)i(lo)r(ok)g(at)h
(the)g(buttons)h(in)f(the)g Fe(UI)43 b(Palette)28 b Ff(windo)n(w.)46
b(Alterna-)440 1029 y(tiv)n(ely)36 b(y)n(ou)f(migh)n(t)h(call)g
(Reg.registered)e(\(\))j(to)f(get)f(a)h(string)f(list)i(with)f(the)h
(names)e(of)440 1129 y(a)n(v)-5 b(ailable)26 b(con)n(trols.)565
1229 y(T)-7 b(o)20 b(create)g(the)i(actual)e(user)g(in)n(terface)h(y)n
(ou)f(m)n(ust)h(\014rst)g(connect)g(the)g(no)r(des)g(correctly)-7
b(.)440 1328 y(All)23 b(no)r(des)g(created)f(as)g(ab)r(o)n(v)n(e)f(has)
i(a)f(no)r(de)h(connected)f(to)h(it)g(of)g(t)n(yp)r(e)g(Children.)35
b(T)-7 b(o)23 b(form)440 1428 y(a)30 b(v)-5 b(alid)30
b(user)f(in)n(terface,)h(the)h(Children)f(no)r(de)g(of)g(MasterNo)r(de)
f(m)n(ust)h(b)r(e)h(connected)e(to)440 1528 y(an)n(y)h(Windo)n(w)i(con)
n(trols)d(that)j(y)n(ou)e(need)i(and)f(the)g(Children)h(no)r(des)f(of)g
(these)g(windo)n(ws)440 1627 y(m)n(ust)26 b(in)h(turn)f(b)r(e)h
(connected)f(to)g(the)h(other)f(user)f(in)n(terface)h(con)n(trols)e
(that)j(y)n(ou)e(w)n(an)n(t)h(in)440 1727 y(those)h(windo)n(ws.)565
1826 y(This)32 b(means)g(that)h(y)n(ou)f(m)n(ust)h(b)r(e)g(able)f(to)h
(obtain)f(the)h(Children)g(no)r(de)g(connected)440 1926
y(from)e(another)g(no)r(de.)49 b(This)32 b(can)f(b)r(e)h(done)g(b)n(y)f
(a)g(call)g(similar)g(to)h(v)-5 b(al)31 b(c)n(hildrenNo)r(de)h(=)440
2026 y(DGNo)r(des.singleConnectedT)-7 b(oT)n(yp)r(e)32
b(fromNo)r(de)h("Children")f(or)g(more)g(con)n(v)n(enien)n(tly)440
2125 y(using)g(the)g(corresp)r(onding)e(shorthand)i(op)r(erator)e(v)-5
b(al)32 b(c)n(hildrenNo)r(de)g(=)g(fromNo)r(de)g(+:)440
2225 y("Children".)565 2325 y(No)n(w,)48 b(to)c(connect)g(a)h(no)r(de)f
(to)g(a)h(Children)f(no)r(de)h(y)n(ou)e(can)h(either)h(call)f(DGN-)440
2424 y(o)r(des.connect)26 b(c)n(hildrenNo)r(de)f(toNo)r(de)h(or)g(use)g
(the)g(shorthand)f(op)r(erator)g(c)n(hildrenNo)r(de)440
2524 y Fe(~+)h Ff(toNo)r(de.)37 b(The)27 b Fe(~+)g Ff(op)r(erator)e
(returns)h(the)i(no)r(de)f(giv)n(en)f(as)h(the)g(left)h(op)r(erand)f
(so)f(that)440 2623 y(y)n(ou)32 b(ma)n(y)h(connect)f(m)n(ultiple)i(no)r
(des)f(to)g(the)g(same)g(no)r(de)g(v)n(ery)f(con)n(v)n(enien)n(tly)f
(lik)n(e)i(this)440 2723 y(fromNo)r(de)27 b Fe(~+)g Ff(no)r(de1)g
Fe(~+)g Ff(no)r(de2)g Fe(~+)g Ff(no)r(de3.)565 2823 y(This)36
b(should)g(allo)n(w)g(y)n(ou)g(to)g(build)h(an)g(en)n(tire)f(user)g(in)
n(terface)g(\(ho)n(w)n(ev)n(er)e(still)j(un-)440 2922
y(con\014gured\).)80 b(When)43 b(done)f(the)g(actual)g(user)f(in)n
(terface)h(is)g(constructed)g(when)g(y)n(ou)440 3022
y(call)34 b(uiCore.createGUI)f(masterNo)r(de.)58 b(Afterw)n(ards)33
b(y)n(ou)h(should)g(just)i(lea)n(v)n(e)d(the)i(ap-)440
3122 y(plication)g(running)g(b)n(y)f(calling)h(uiCore.runGUI)f(app.)60
b(All)35 b(the)h(co)r(de)f(that)g(y)n(ou)g(ha)n(v)n(e)440
3221 y(written)f(for)f(creating)f(the)i(user)f(in)n(terface,)i
(starting)d(with)i(the)g(creation)f(of)g(the)h(Mas-)440
3321 y(terNo)r(de)27 b(and)g(un)n(til)g(the)h(call)f(to)g
(uiCore.runGUI)f(app)h(should)g(b)r(e)h(put)f(in)n(to)g(a)g(function)
440 3421 y(of)33 b(t)n(yp)r(e)h(unit)g(->)g(unit.)55
b(Y)-7 b(ou)33 b(should)g(pass)g(this)h(function)g(\(let's)g(call)f(it)
h(f)g(here\))f(as)g(an)440 3520 y(argumen)n(t)28 b(to)i(uiCore.runApp)f
(f.)42 b(This)30 b(will)f(start)g(Concurren)n(t)f(ML)i(correctly)e(on)h
(the)440 3620 y(X-Windo)n(ws/eXene)e(platform.)440 3852
y Fd(Setting)36 b(up)i(the)g(user)f(in)m(terface)g(using)g(proto)s
(cols)440 4005 y Ff(T)-7 b(o)37 b(pro)r(duce)g(useful)h(user)f(in)n
(terfaces)g(y)n(ou)g(will)g(need)h(to)f(con\014gure)g(y)n(our)f(graph)h
(and)440 4105 y(setup)g(ev)n(en)n(thandlers)d(etc.)63
b(This)37 b(is)f(done)g(b)n(y)g(using)g(proto)r(cols.)61
b(Eac)n(h)35 b(no)r(de)h(in)h(the)440 4205 y(graph)j(created)g(con)n
(tains)g(a)g(proto)r(col.)75 b(No)r(des)41 b(lik)n(e)g(the)g(Children)g
(no)r(de)g(describ)r(ed)440 4304 y(ab)r(o)n(v)n(e)f(is)h(what)g(will)g
(b)r(e)g(referred)f(to)h(as)g(a)f(parameter)g(no)r(de)h(for)g(a)f
(UI-con)n(trol)g(\(or)440 4404 y(for)e(the)h(MasterNo)r(de\).)69
b(Eac)n(h)37 b(UI-con)n(trol)g(has)h(sev)n(eral)f(di\013eren)n(t)h
(parameterno)r(des,)440 4504 y(suc)n(h)h(as)f(P)n(osX,)g(P)n(osY,)g
(EditableT)-7 b(ext)39 b(etc.)71 b(The)39 b(Children)g(no)r(de)g(only)g
(has)f(a)h(Null)440 4603 y(proto)r(col)33 b(with)i(no)e(metho)r(ds,)j
(but)f(most)f(other)g(no)r(des)g(ha)n(v)n(e)e(a)i(useful)h(proto)r
(col.)55 b(F)-7 b(or)440 4703 y(instance)36 b(the)g(p)r(osition)g(and)g
(size)g(no)r(des)f(ha)n(v)n(e)g(a)h(proto)r(col)f(for)g(reading)g(and)h
(writing)440 4802 y(an)h(in)n(teger)f(and)g(so)g(on.)65
b(T)-7 b(o)36 b(\014nd)i(out)e(whic)n(h)h(parameterno)r(des)e(a)i(giv)n
(en)f(UI-con)n(trol)440 4902 y(supp)r(orts,)i(y)n(ou)d(should)g(start)g
Fe(The)43 b(Construct)p Ff(,)34 b(create)h(the)h(UI-con)n(trol)f(in)h
(question)440 5002 y(and)f(lo)r(ok)g(at)h(the)g Fe(Protocol)k(accessor)
32 b Ff(windo)n(w.)61 b(Alternativ)n(ely)35 b(y)n(ou)g(can)g(call)g
(the)440 5101 y(DGNo)r(des.connected)27 b(function)h(to)e(get)h(a)f
(list)h(of)g(all)g(the)g(no)r(des)f(connected)h(to)g(a)f(no)r(de.)565
5201 y(Proto)r(cols)18 b(are)i(implemen)n(ted)i(in)f(structures)f(whic)
n(h)g(all)h(b)r(egins)g(with)g(P)f(for)g(proto)r(col.)440
5301 y(Examples)33 b(are)f(PString,)i(PIn)n(t)g(and)f(PIn)n(tDra)n(w)n
(able.)53 b(These)33 b(structures)g(con)n(tain)g(the)440
5400 y(metho)r(ds)j(that)g(constitutes)f(the)h(proto)r(cols.)59
b(Some)35 b(common)g(proto)r(cols)f(are)h(de\014ned)1851
5662 y(2)p eop
%%Page: 3 3
3 2 bop 440 531 a Ff(in)31 b(HardcorePro)r(cessing/GraphT)-7
b(o)r(olkit/sr)o(cSML/Pr)o(oto)q(cols/)o(DGPCommon.)41
b(Some)440 631 y(more)18 b(sp)r(ecial)g(proto)r(cols)f(are)g(de\014ned)
i(under)f(HardcorePro)r(cessing/MLAbstractUI/srcSML/UIP)o(ro)o(to)r
(cols/)o(.)565 731 y(All)35 b(metho)r(ds)g(in)h(all)e(proto)r(cols)g
(tak)n(e)g(the)i(proto)r(col)d(itself)j(as)e(the)i(\014rst)e(argumen)n
(t)440 830 y(and)g(an)n(y)f(additional)h(argumen)n(ts)f(as)g
(appropriate.)55 b(F)-7 b(or)33 b(example,)j(calling)d(the)i(write)440
930 y(metho)r(d)27 b(in)g(the)g(proto)r(col)e(PString)h(is)g(done)g
(lik)n(e)h(this:)36 b(PString.write)26 b(proto)r(col)f("Some)440
1029 y(string".)565 1129 y(T)-7 b(o)32 b(obtain)g(the)i(proto)r(col)d
(for)i(a)f(no)r(de)h(y)n(ou)f(will)h(ha)n(v)n(e)e(to)i(t)n(yp)r(ecast)g
(the)g(no)r(de)g(in)n(to)440 1229 y(the)d(correct)d(proto)r(col)i(t)n
(yp)r(e.)42 b(F)-7 b(or)28 b(con)n(v)n(enience,)h(all)f(proto)r(cols)g
(ha)n(v)n(e)g(a)h(structure)g(with)440 1328 y(the)i(name)g(of)f(the)i
(proto)r(col)d(structure)h(pre\014xed)h(with)g(DG)g(for)g(directed)f
(graph.)45 b(This)440 1428 y(structure)34 b(has)h(a)f(metho)r(d)h
(called)g(p)g(for)f(obtaining)g(the)i(proto)r(col)d(from)i(a)f(no)r
(de.)59 b(An)440 1528 y(example)36 b(of)h(t)n(yp)r(ecasting)f(a)g(no)r
(de)h(to)f(it's)h(string)f(proto)r(col)g(is)g(v)-5 b(al)37
b(stringProto)r(col)d(=)440 1627 y(DGPString.p)28 b(someNo)r(de.)565
1727 y(A)37 b(more)g(compact)f(w)n(a)n(y)g(of)h(writing)g(to)g(a)g
(string)g(proto)r(col)f(in)h(a)g(no)r(de)g(w)n(ould)g(b)r(e)440
1826 y(lik)n(e)f(this:)54 b(PString.write)34 b(\(DGPString.p)j(no)r
(de\))f("Some)f(string",)i(but)g(it)f(ma)n(y)f(b)r(e)i(a)440
1926 y(go)r(o)r(d)28 b(thing)i(to)e(k)n(eep)h(a)g(t)n(yp)r(ecasted)f
(proto)r(col)g(around)g(if)h(y)n(ou)g(are)f(going)f(to)i(call)g(man)n
(y)440 2026 y(metho)r(ds)i(in)f(the)h(same)f(parameter)f(no)r(de.)46
b(This)30 b(will)h(most)f(lik)n(ely)g(b)r(e)h(the)g(case)e(if)i(y)n(ou)
440 2125 y(are)26 b(using)i(the)f(dra)n(wing)f(proto)r(col)h(or)f(a)h
(PStrings)g(proto)r(col)f(for)h(the)g(lines)h(in)g(a)f(listb)r(o)n(x.)
440 2358 y Fd(Useful)38 b(proto)s(cols)440 2511 y Ff(The)26
b(single)f(v)-5 b(alued)25 b(proto)r(cols)f(are)h(PString,)g(PIn)n(t,)h
(PReal)e(and)i(PBo)r(ol.)35 b(They)25 b(all)h(ha)n(v)n(e)440
2611 y(a)35 b(write)g(metho)r(d)h(and)g(a)f(read)f(metho)r(d)i(of)f
(the)h(appropriate)e(t)n(yp)r(es)h(for)g(reading)g(and)440
2710 y(writing)h(a)g(single)g(v)-5 b(alue.)62 b(They)36
b(also)g(ha)n(v)n(e)f(the)h(metho)r(ds)h(addChangedNoti\014er,)g(re-)
440 2810 y(mo)n(v)n(eChangedNoti\014er)21 b(and)i(doNotifyChanged)g
(for)g(adding)g(ev)n(en)n(t)g(handlers)f(for)h(when)440
2910 y(the)i(v)-5 b(alue)25 b(c)n(hanges.)34 b(The)25
b(ev)n(en)n(t)g(handlers)f(generally)f(ha)n(v)n(e)g(t)n(yp)r(e)i(DGNo)r
(des.t)h(->)f(T)n(yp)r(e-)440 3009 y(OfTheV)-7 b(alueChanged)20
b(->)g(unit.)35 b(The)20 b(addChangedNoti\014er)g(returns)f(a)h
(noti\014er)g(ID)h(that)440 3109 y(y)n(ou)27 b(can)h(use)g(later)f(for)
h(remo)n(ving)e(y)n(our)h(noti\014er)h(b)n(y)g(calling)f(remo)n(v)n
(eChangedNoti\014er.)440 3208 y(The)e(metho)r(d)f(doNotifyChanged)g
(just)h(calls)f(all)g(registered)f(noti\014ers)h(in)h(the)f(no)r(de)h
(with)440 3308 y(the)j(argumen)n(ts)e(giv)n(en.)565 3408
y(Other)j(useful)i(proto)r(cols)d(include)j(the)f(PStrings)f(proto)r
(col)g(used)h(in)g(the)h(T)-7 b(extLines)440 3507 y(no)r(de)29
b(on)f(the)h(listb)r(o)n(x.)40 b(This)29 b(proto)r(col)e(has)h(metho)r
(ds)h(lik)n(e)f(clear,)g(coun)n(t,)h(add,)g(remo)n(v)n(e,)440
3607 y(insertA)n(t)f(and)f(deleteA)n(t.)565 3707 y(Then)33
b(there)h(are)f(the)h(noti\014cation)f(proto)r(cols)g(PNotify)g(and)h
(PP)n(oin)n(terButtonNo-)440 3806 y(tify)e(whic)n(h)g(ha)n(v)n(e)e(the)
i(metho)r(ds)g(addNoti\014er,)g(remo)n(v)n(eNoti\014er)e(and)h
(doNotify)h(similar)440 3906 y(to)27 b(the)h(metho)r(ds)f(in)h(the)f
(single)g(v)-5 b(alued)27 b(proto)r(cols.)35 b(Lastly)27
b(there's)g(the)g(PIn)n(tDra)n(w)n(able)440 4005 y(whic)n(h)33
b(is)g(curren)n(tly)f(an)h(incomplete)g(\(but)h(v)n(ery)e(useful\))h
(dra)n(wing)f(proto)r(col)g(using)g(in-)440 4105 y(teger)e(co)r
(ordinates.)45 b(It)31 b(is)g(curren)n(tly)f(not)g(implemen)n(ted)i(on)
e(the)h(ML)-9 b(W)i(orks/Windo)n(ws)440 4205 y(platform.)440
4479 y Fg(F)c(uture)44 b(w)l(ork)440 4661 y Ff(There)27
b(are)g(a)g(few)h(things)f(whic)n(h)h(I)f(will)h(try)g(to)f(giv)n(e)g
(a)g(v)n(ery)f(high)i(priorit)n(y:)565 4844 y Fa(\017)41
b Ff(Destruction)26 b(of)g(the)g(implemen)n(ted)h(GUI)f(con)n(trols)f
(is)h(not)g(y)n(et)g(implemen)n(ted)h(and)648 4943 y(when)h(closing)g
(a)g(windo)n(w)g(y)n(ou)g(get)g(unexp)r(ected)h(b)r(eha)n(viour.)39
b(This)29 b(will)f(b)r(e)h(\014xed)648 5043 y(ASAP)-7
b(.)565 5209 y Fa(\017)41 b Ff(The)27 b(w)n(a)n(y)g(to)g(implemen)n(t)h
(UI-con)n(trols)e(is)i(curren)n(tly)e(far)h(from)h(optimal.)565
5375 y Fa(\017)41 b Ff(There)27 b(m)n(ust)g(b)r(e)h(complete)g(supp)r
(ort)f(for)g(hierarc)n(hies)f(of)i(UI-con)n(trols.)1851
5662 y(3)p eop
%%Page: 4 4
4 3 bop 565 531 a Fa(\017)41 b Ff(The)36 b(curren)n(tly)g(implemen)n
(ted)h(GUI-con)n(trols)e(are)h(not)g(en)n(tirely)g(complete)h(and)648
631 y(b)r(ecause)i(of)h(this,)k(the)c(con)n(trols)f(still)h(di\013er)g
(a)g(little)g(b)r(et)n(w)n(een)g(the)h(platforms.)648
731 y(This)27 b(will)h(\014x)g(itself)g(as)f(the)h(implemen)n(tation)f
(ev)n(olv)n(es)f(:\))565 897 y Fa(\017)41 b Ff(P)n(opupmen)n(us)26
b(are)h(really)f(a)h(m)n(ust.)37 b(Preferably)26 b(radial)h(ones...)565
1079 y(As)e(for)f(further)h(plans,)h(it)f(dep)r(ends)h(on)f(what)g(I)g
(will)g(need)g(and)g(what)g(y)n(ou)g(will)g(need.)440
1179 y(I)e(will)g(b)r(e)g(v)n(ery)e(happ)n(y)h(to)h(reciev)n(e)e
(requests)h(for)g(certain)g(features)g(that)h(y)n(ou)f(migh)n(t)g
(need.)440 1279 y(And)28 b(of)g(course,)e(bugrep)r(orts)h(are)f(highly)
i(encouraged)d(:\))1851 5662 y(4)p eop
%%Trailer
end
userdict /end-hook known{end-hook}if
%%EOF
HardcoreProcessing/MLAbstractUI/srcSML/ 40755 1750 1750 0 6774225722 16356 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/sources.cm 100644 1750 1750 2415 6774226076 20464 0 ustar anoq anoq Group is
cml.cm
cml-lib.cm
/usr/local/devtools/ML/SMLNJ/src/eXene/lib/sources.cm
../../ErrorHandling/srcSML/sources.cm
../../TypeNeutral/srcSML/sources.cm
../../GraphToolkit/srcSML/sources.cm
../../CommonFunctions/srcSML/sources.cm
../../Geometry/srcSML/sources.cm
UIProtocols/PDrawable.sml
UIProtocols/PNotifiers.sml
UIProtocols/UIProtocols.sml
Core/Portable/uiCore.sml
Core/Portable/uiCore_sig.sml
Core/Portable/uiRegister.sml
Core/Portable/GenericTypes.sml
Core/Portable/HierarchyCore.sml
Core/SMLNJeXene/EXeneCore.sml
Core/SMLNJeXene/EXeneDisplayNode.sml
Core/SMLNJeXene/EXeneDrawableNode.sml
Core/SMLNJeXene/EXeneToPortable.sml
Core/SMLNJeXene/EXeneColor.sml
LFNeutral/LFNHierarchy.sml
LFNeutral/LFNGeometry.sml
LFNeutral/LFNSimpleText.sml
LFNeutral/LFNMiscNotify.sml
LFNeutral/LFNPointerNotify.sml
LFNeutral/LFNMisc.sml
Components/SMLNJeXene/EXeneWindow.sml
Components/SMLNJeXene/EXeneGeneric.sml
Components/SMLNJeXene/EXeneRegistered.sml
Components/Portable/PortableButton.sml
Components/Portable/PortableToggleButton.sml
Components/Portable/PortableListBox.sml
Components/Portable/PortableTextField.sml
Components/Portable/PortableTextLabel.sml
Components/Portable/PortableScrollBar.sml
Components/Portable/GenericLF.sml
CommonGraphNodes/Portable/ParameterNodes.sml
(*smlnj-lib.cm*)
HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/ 40755 1750 1750 0 6774225626 20603 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/PDrawable.sml 100644 1750 1750 13165 6774226076 23304 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgprotocols";*)
(*require "$.typeneutralwinnt.classes";*)
(*require "$.gtwinnt.protocolutils";*)
(*require "$.geometrywinnt.simplegeom2d";*)
functor FPIntDrawableT(type 'a method) =
struct
(* These are some primitive GUI types *)
type point = IPoint2D.t
type line = ILine2D.t
type rect = IRect2D.t
type color = {r : real, g : real, b : real}
type t =
{drawLine : (line -> unit) method,
drawRect : (rect -> unit) method,
fillRect : (rect -> unit) method,
setFGColor : (color -> unit) method,
drawText : (point -> string -> unit) method,
textHeight : (string -> int) method,
textWidth : (string -> int) method,
charPositions : (string -> int list) method}
end
(* This is a drawable protocol for integer coordinates.
The Right Thing (TM) is of course real coordinates. *)
functor FPIntDrawable() =
struct
structure T1 = FPIntDrawableT(type 'a method = 'a PMethod.t)
structure T2 = FPIntDrawableT(type 'a method = 'a)
type t = T1.t
type default = unit
structure P =
FClass(type newType = t
val className = "Integer drawable")
fun stdImpl _ =
let
fun doNothing _ = ()
in
{drawLine = doNothing,
drawRect = doNothing,
fillRect = doNothing,
setFGColor = doNothing,
drawText = fn _ => fn _ => (),
textHeight = fn _ => 0,
textWidth = fn _ => 0,
charPositions = fn _ => nil} : T2.t
end
fun createStd init =
let
val {drawLine, drawRect,
fillRect, setFGColor,
drawText, textHeight,
textWidth, charPositions} = stdImpl init
in
{drawLine = ref drawLine,
drawRect = ref drawRect,
fillRect = ref fillRect,
setFGColor = ref setFGColor,
drawText = ref drawText,
textHeight = ref textHeight,
textWidth = ref textWidth,
charPositions = ref charPositions} : t
end
fun replaceImpl ({drawLine, drawRect,
fillRect, setFGColor,
drawText, textHeight,
textWidth, charPositions} : t)
({drawLine = newDrawLine,
drawRect = newDrawRect,
fillRect = newFillRect,
setFGColor = newSetFGColor,
drawText = newDrawText,
textHeight = newTextHeight,
textWidth = newTextWidth,
charPositions = newCharPositions} : T2.t) =
(drawLine := newDrawLine;
drawRect := newDrawRect;
fillRect := newFillRect;
setFGColor := newSetFGColor;
drawText := newDrawText;
textHeight := newTextHeight;
textWidth := newTextWidth;
charPositions := newCharPositions)
fun replaceWithStd (prot : t) =
replaceImpl prot (stdImpl ())
(* The actual protocol for the user. This protocol is still very incomplete... *)
fun drawLine ({drawLine, ...} : t) theLine = (PMethod.execute drawLine) theLine
fun drawRect ({drawRect, ...} : t) theRect = (PMethod.execute drawRect) theRect
fun fillRect ({fillRect, ...} : t) theRect = (PMethod.execute fillRect) theRect
fun setFGColor ({setFGColor, ...} : t) theColor = (PMethod.execute setFGColor) theColor
fun drawText ({drawText, ...} : t) aPos theText = (PMethod.execute drawText) aPos theText
fun textHeight ({textHeight, ...} : t) theText = (PMethod.execute textHeight) theText
fun textWidth ({textWidth, ...} : t) theText = (PMethod.execute textWidth) theText
fun charPositions ({charPositions, ...} : t) theText = (PMethod.execute charPositions) theText
end
structure PIntDrawable = FPIntDrawable ()
structure DGPIntDrawable = FDGProtocols(PIntDrawable)
HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/PNotifiers.sml 100644 1750 1750 11507 6774226076 23523 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgprotocols";*)
(*require "$.gtwinnt.dgpcommon";*)
(*require "$.gtwinnt.dgnodes";*)
(*require "$.typeneutralwinnt.classes";*)
(*require "$.gtwinnt.protocolutils";*)
(*require "$.gtwinnt.dgnotifygeneral";*)
(*require "$.basis.__list";*)
(*require "$.geometrywinnt.simplegeom2d";*)
(* FIXME: Move this to a more general place *)
functor FPNotifyT(type 'a method type notifyParam) =
struct
(* These are some primitive notification types *)
(* FIXME: More general? *)
type notifyID = unit ref
type t =
{addNotifier : ((DGNodes.t -> notifyParam -> unit) -> notifyID) method,
doNotify : (DGNodes.t -> notifyParam -> unit) method,
removeNotifier : (notifyID -> unit) method}
end
(* This is a drawable protocol for integer coordinates.
The Right Thing (TM) is of course real coordinates. *)
(* FIXME: Make a general parametrized notify functor... *)
functor FPNotify(type notifyParam val className : string) =
struct
structure T1 = FPNotifyT(type 'a method = 'a PMethod.t
type notifyParam = notifyParam)
structure T2 = FPNotifyT(type 'a method = 'a
type notifyParam = notifyParam)
type t = T1.t
type default = unit
structure P =
FClass(type newType = t
val className = className)
val stdImpl = DGNotifyGeneral.stdImpl
fun createStd init =
let
val {addNotifier, removeNotifier,
doNotify} = stdImpl init
in
{addNotifier = ref addNotifier,
removeNotifier = ref removeNotifier,
doNotify = ref doNotify} : t
end
fun replaceImpl ({addNotifier, removeNotifier,
doNotify} : t)
({addNotifier = newAddNotifier,
removeNotifier = newRemoveNotifier,
doNotify = newDoNotify} : T2.t) =
(addNotifier := newAddNotifier;
removeNotifier := newRemoveNotifier;
doNotify := newDoNotify)
fun replaceWithStd (prot : t) =
replaceImpl prot (stdImpl ())
(* The actual protocol for the user. *)
fun addNotifier ({addNotifier, ...} : t) theNotifier = (PMethod.execute addNotifier) theNotifier
fun removeNotifier ({removeNotifier, ...} : t) theID = (PMethod.execute removeNotifier) theID
fun doNotify ({doNotify, ...} : t) sender param = (PMethod.execute doNotify) sender param
end
(* FIXME: Move this to a more specific place *)
structure PPointerButtonNotify =
FPNotify (type notifyParam = {button : int,
point : IPoint2D.t}
val className = "PointerButtonNotify")
structure DGPPointerButtonNotify = FDGProtocols(PPointerButtonNotify)
structure PStringNotify =
FPNotify (type notifyParam = string
val className = "StringNotify")
structure DGPStringNotify = FDGProtocols(PStringNotify)
structure PBoolNotify =
FPNotify (type notifyParam = bool
val className = "BoolNotify")
structure DGPBoolNotify = FDGProtocols(PBoolNotify)
structure PNotify =
FPNotify (type notifyParam = unit
val className = "Notify")
structure DGPNotify = FDGProtocols(PNotify)
HardcoreProcessing/MLAbstractUI/srcSML/UIProtocols/UIProtocols.sml 100644 1750 1750 11564 6774226076 23666 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgprotocols";*)
(*require "$.typeneutralwinnt.classes";*)
(*require "$.gtwinnt.protocolutils";*)
(*require "$.basis.__list";*)
(*require "$.collectionswinnt.simplesets";*)
(* FIXME: Consider creating a more general protocol for fixed-size
arrays instead of this. I will first have to examine what this
protocol really needs to do though... *)
functor FPItemSelectionsT(type 'a method) =
struct
type t = {isSelectedAt : (int -> bool) method,
selectAt : (int -> unit) method,
deselectAll : (unit -> unit) method,
count : (unit -> int) method}
end
functor FPItemSelections(val className : string) =
struct
(* Most of this is a standard ritual for implementing
protocols. It's quite ugly :(
I'd say that protocol implementaions like these are quite
similar to a virtual method table of an object in an OO-language.
But with this, methods can be overrided at any time at runtime... *)
structure T1 = FPItemSelectionsT(type 'a method = 'a PMethod.t)
structure T2 = FPItemSelectionsT(type 'a method = 'a)
type t = T1.t
type default = int list
structure P =
FClass(type newType = t
val className = className)
fun stdImpl (init : default) =
let
val a = ref nil
fun doIsSelectedAt index =
SimpleSets.contains index (!a)
fun doCount () = 0
fun doDeselectAll () =
a := nil
fun doSelectAt index =
if SimpleSets.contains index (!a) then
()
else
a := index::(!a)
in
{isSelectedAt = doIsSelectedAt,
selectAt = doSelectAt,
deselectAll = doDeselectAll,
count = doCount} : T2.t
end
fun createStd init =
let
val {isSelectedAt, selectAt, deselectAll, count} = stdImpl init
in
{isSelectedAt = ref isSelectedAt,
selectAt = ref selectAt,
deselectAll = ref deselectAll,
count = ref count} : t
end
fun replaceImpl ({isSelectedAt, selectAt,
deselectAll, count} : t)
({isSelectedAt = newIsSelectedAt,
selectAt = newSelectAt,
deselectAll = newDeselectAll,
count = newCount} : T2.t) =
(isSelectedAt := newIsSelectedAt;
selectAt := newSelectAt;
deselectAll := newDeselectAll;
count := newCount)
fun replaceWithStd (prot : t) =
replaceImpl prot (stdImpl nil) (* FIXME: Read and transfer values... *)
(* The actual protocol for the user *)
fun isSelectedAt ({isSelectedAt, ...} : t) index =
(PMethod.execute isSelectedAt) index
fun selectAt ({selectAt, ...} : t) index =
(PMethod.execute selectAt) index
fun count ({count, ...} : t) =
(PMethod.execute count) ()
fun deselectAll ({deselectAll, ...} : t) =
(PMethod.execute deselectAll) ()
end
structure PItemSelections =
FPItemSelections(val className = "ItemSelections")
structure DGPItemSelections = FDGProtocols(PItemSelections)
HardcoreProcessing/MLAbstractUI/srcSML/Core/ 40755 1750 1750 0 6774225647 17254 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/ 40755 1750 1750 0 6774225641 21016 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/uiCore.sml 100644 1750 1750 5542 6774226076 23067 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgnodes";*)
(*require "$.gtwinnt.dgpcommon";*)
(*require "uiregister";*)
(*require "$.basis.__list";*)
(*require "uicore_sig";*)
(* FIXME: Add dictionary for allowed UI-tasks (and maybe attributes) in the system.
This can be used for error-checking *)
functor uiFCore(NativeCore : UI_NATIVE_CORE) :> UI_CORE =
struct
fun doCreate node =
let
val createNode = DGNodes.singleConnectedToType node "Create"
val protocol = DGPBool.p createNode
in
PBool.write protocol true
end
val runGUI = NativeCore.runGUI
val runApp = NativeCore.runApp
val createMasterNode = NativeCore.createMasterNode
fun createGUI node =
let
val childrenNode =
DGNodes.singleConnectedToType
node "Children"
val children =
DGNodes.connected childrenNode
in
List.app (fn n => (doCreate n; createGUI n)) children
end
end
signature UI_PLUGIN =
sig
(* Currently the widgets are just expected to register themselves, but
widgets should ideally be loaded dynamically somehow... :) *)
val construct : unit -> DGNodes.t
end
HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/uiCore_sig.sml 100644 1750 1750 3630 6774226076 23725 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgnodes";*)
signature UI_NATIVE_CORE =
sig
val createMasterNode : unit -> DGNodes.t
val runGUI : DGNodes.t -> unit
val runApp : (unit -> unit) -> unit
end
signature UI_CORE =
sig
include UI_NATIVE_CORE
val createGUI : DGNodes.t -> unit
end
HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/uiRegister.sml 100644 1750 1750 6700 6774226076 23760 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.collectionswinnt.dictionary";*)
(*require "$.gtwinnt.dgnodes";*)
(* For internal use - this is where the imperative data are stored *)
structure uiRegistered =
struct
type action = unit -> unit
val actiond = ref (StringDict.empty : action StringDict.t)
type constructor = unit -> DGNodes.t
val guiClassD = ref (StringDict.empty : constructor StringDict.t)
val dummyGUIClassD = ref (StringDict.empty : constructor StringDict.t)
end
signature UI_REGISTER =
sig
type t
val register : string -> t -> unit
val find : string -> t option
val registered : unit -> string list
end
functor uiRegister(type theType val dictionary : (theType StringDict.t) ref) : UI_REGISTER =
struct
type t = theType
fun register name element =
dictionary := StringDict.insert (!dictionary) name element
fun find name =
StringDict.lookup (!dictionary) name
fun registered () =
StringDict.fold
(fn ((name, _), result) => name::result)
nil
(!dictionary)
(*
fun debug () =
StringDict.fold
(fn ((name, (class, _)), _) =>
(print ("Classname: " ^ name ^ " attributes: ");
Excn.checkedExec (uiImplAttrGUIClass.get class "")
((nil, nil), uiAbsSyn.uiDesc (uiAbsSyn.uiTasks (nil), nil, nil))
(GN.T.I(0));
print "\n"))
() (!gcd)*)
end
structure uiRegActions =
uiRegister(type theType = uiRegistered.action
val dictionary = uiRegistered.actiond)
structure uiRegGUIClass =
uiRegister(type theType = uiRegistered.constructor
val dictionary = uiRegistered.guiClassD)
structure DummyReg =
uiRegister(type theType = uiRegistered.constructor
val dictionary = uiRegistered.dummyGUIClassD)
HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/GenericTypes.sml 100644 1750 1750 6202 6774226076 24234 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FGenUI() =
struct
type point = IPoint2D.t
type rect = IRect2D.t
type basicIn =
{invalidateRect : rect -> unit,
getArea : unit -> rect}
(* FIXME: Look into this... do something
which supports UNICODE, WideString, follows
all the standards etc... *)
datatype KeyData =
KeyString of string
| KeyCode of int
type basicOut =
{redraw : PIntDrawable.t -> rect list -> unit,
pointerDown : {button : int, point : point} -> unit,
pointerValue : {button : int, point : point, value : real} -> unit,
pointerUp : {button : int, point : point} -> unit,
pointerMove : {point : point} -> unit,
keyPress : {symbol : KeyData} -> unit}
type bInternal =
{node : DGNodes.t,
getArea : unit -> rect,
redraw : rect list -> unit,
pointerDown : {button : int, point : point} -> unit,
pointerValue : {button : int, point : point, value : real} -> unit,
pointerUp : {button : int, point : point} -> unit,
pointerMove : {point : point} -> unit,
keyPress : {symbol : KeyData} -> unit}
end
structure GenUI = FGenUI()
signature GENERIC_UI_CONTROL =
sig
(* FIXME: rect should be the redraw rect *)
(* Creates the generic control using the integer drawable protocol. *)
val constructInt : DGNodes.t -> ISize2D.t ->
(GenUI.basicIn -> GenUI.basicOut) ->
unit
end
HardcoreProcessing/MLAbstractUI/srcSML/Core/Portable/HierarchyCore.sml 100644 1750 1750 7176 6774226076 24375 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FHierarchyCore() =
struct
fun prepareForChildren () =
let
val children = ref nil
fun registerChild newChild =
children :=
newChild::(!children)
in
{children = children, registerChild = registerChild}
end
fun handleDraw drawControl children rects =
let
(* A simple UI-control refresher... *)
fun doRedraw ({getArea, redraw, ...} : GenUI.bInternal) =
let
val (area as {x = oX, y = oY, w, h}) =
getArea()
fun validateRect r =
let
val (intR as {x, y, w, h}) =
IRect2D.intersect area r
in
if intR = IRect2D.zeroValue then
NONE
else
SOME({x = x - oX, y = y - oY, w = w, h = h})
end
val validRects =
List.mapPartial validateRect rects
(* FIXME: A naive union per child
of all refresh rects for just a
little better performance
- but we still more! *)
val childUnion =
foldl
(fn (a, b) => IRect2D.union a b)
IRect2D.zeroValue
validRects
in
if childUnion = IRect2D.zeroValue then
()
else
redraw [childUnion]
end
in
(drawControl rects;(* Background... *)
List.app doRedraw children)
end
end
structure HierarchyCore = FHierarchyCore()
HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/ 40755 1750 1750 0 6774225650 21116 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/EXeneCore.sml 100644 1750 1750 6537 6774226076 23563 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
signature UI_EXENE_CORE =
sig
include UI_NATIVE_CORE
end
functor FEXeneCore() :> UI_EXENE_CORE =
struct
structure EXB = EXeneBase
val XDisplayName = ""
(* Add eXene native information to the graph *)
fun createNativeInfo display screen graphNode =
let
val nativeNode = EXeneDisplay.create display screen
val _ = DGNodes.connect graphNode nativeNode
in
DGPEXeneDisplay.p nativeNode
end
fun createMasterNode () =
let
val (graphNode, _) = ParamName.create "MasterNode"
(* FIXME: Close display again after use! How is another issue... *)
val display = (EXB.openDisplay (XDisplayName, NONE))
handle EXB.BadAddr s => (
print (s ^ "\n");
RunCML.shutdown OS.Process.failure)
(* Choose the current X default screen for this MasterNode *)
val screen = EXB.defaultScreenOf display
(* Add eXene native information to the graph *)
val _ = createNativeInfo display screen graphNode
in
graphNode
end
val emptyMb = Mailbox.mailbox()
(* Waiting to receive mail in an empty mailbox
will hopefully make the thread sleep... *)
fun runGUI masterNode =
(Mailbox.recv emptyMb; ())
(*while true do ()*) (* FIXME: Sleep? *)
(* For encapsulating CML on the SMLNJ/eXene platform *)
fun runApp f =
let
val _ = XDebug.init []
val _ = RunCML.doit(
fn() => (XDebug.xspawn("ML::AbstractUI application", f); ()),
SOME(Time.fromMilliseconds 20))
in
()
end
end
structure EXeneCore = FEXeneCore()
HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/EXeneDisplayNode.sml 100644 1750 1750 7444 6774226076 25104 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPEXeneDisplay() =
struct
(* NOTICE: This is not implemented with PMethod like other protocols... *)
type t = {readDisplay : unit -> EXeneBase.display,
readScreen : unit -> EXeneBase.screen}
type default = EXeneBase.display * EXeneBase.screen
structure P =
FClass(type newType = t
val className = "EXene display")
fun createStd ((disp, scrn) : default) =
{readDisplay = (fn () => disp),
readScreen = (fn () => scrn)}
fun readDisplay ({readDisplay, ...} : t) = readDisplay ()
fun readScreen ({readScreen, ...} : t) = readScreen ()
end
structure PEXeneDisplay = FPEXeneDisplay ()
structure DGPEXeneDisplay = FDGProtocols(PEXeneDisplay)
functor FEXeneDisplay() =
struct
fun create display screen =
let
val protocol = PEXeneDisplay.P.create
(PEXeneDisplay.createStd
(display, screen))
in
(* FIXME: Maybe this should not be the direct masternode? *)
DGNodes.create "EXene display" protocol
end
fun getNativeProtocol graphNode =
let
val nativeNode = DGNodes.singleConnectedToType
graphNode "EXene display"
in
DGPEXeneDisplay.p nativeNode
end
fun getNativeDisplay graphNode =
PEXeneDisplay.readDisplay (getNativeProtocol graphNode)
fun getNativeScreen graphNode =
PEXeneDisplay.readScreen (getNativeProtocol graphNode)
end
structure EXeneDisplay = FEXeneDisplay()
(* This is an attempt at a more general native eXene node *)
functor PFEXeneNative(type nativeType (* FIXME: Create (or find) this! *)
val nativeName : string) (* :> P_EXENE_NATIVE *) =
struct
(* NOTICE: This is not implemented with PMethod like other protocols... *)
type t = {readNative : unit -> nativeType}
type default = nativeType
structure P =
FClass(type newType = t
val className = nativeName)
fun createStd (init : default) =
{readNative = fn () => init}
fun readNative ({readNative} : t) = readNative ()
end
HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/EXeneDrawableNode.sml 100644 1750 1750 14134 6774226076 25232 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FEXeneDrawableNode() =
struct
structure G = Geometry
structure DR = Drawing
structure EXB = EXeneBase
fun add graphNode eXeneDrawable eXeneDisplay eXeneScreen getArea =
let
val pen = ref DR.defaultPen
val currentFont = (* 9x15 *)
ref (Font.openFont eXeneDisplay "6x10") (* FIXME: Font names... *)
fun doSetFGColor c =
pen := DR.updatePen
((!pen), [DR.PV_Foreground (EXeneColor.toEXene eXeneScreen c)])
(* FIXME: Offset? *)
fun doDrawText {x, y} theText =
let
val {x = offsetX, y = offsetY, w, h} = getArea ()
in
DR.drawString eXeneDrawable
(!pen) (!currentFont)
(G.PT{x = x + offsetX, y = y + offsetY}, theText)
end
(* FIXME: Make fontHeight similar to eXene? *)
fun doTextHeight theText =
let
val {ascent, descent} =
Font.fontHt (!currentFont) (* FIXME: Not textHeight *)
in
ascent + descent (* FIXME: Is this even remotely correct? *)
end
fun doTextWidth theText =
Font.textWidth (!currentFont) theText
fun doCharPositions theText =
Font.charPositions (!currentFont) theText
fun doDrawLine {x1, y1, x2, y2} =
let
val {x = offsetX, y = offsetY, ...} = getArea ()
in
Drawing.drawSeg eXeneDrawable (!pen)
(G.LINE(G.PT{x = x1 + offsetX, y = y1 + offsetY},
G.PT{x = x2 + offsetX, y = y2 + offsetY}))
end
fun doDrawRect {x, y, w, h} =
let
val {x = offsetX, y = offsetY, ...} = getArea ()
in
if w < 1 then
if w < 0 then
print "Width is negative in drawRect function!"
else ()
else if h < 1 then
if h < 0 then
print "Height is negative in drawRect function!"
else ()
else
Drawing.drawRect eXeneDrawable (!pen)
(G.RECT{x = x + offsetX, y = y + offsetY,
wid = w - 1, ht = h - 1})
(* NOTICE: eXene (and X) rects are 1 pixel bigger *)
end
fun doFillRect {x, y, w, h} =
let
val {x = offsetX, y = offsetY, ...} = getArea ()
in
if w < 0 then
print "Width is negative in drawRect function!"
else if h < 0 then
print "Height is negative in drawRect function!"
else
Drawing.fillRect eXeneDrawable (!pen)
(G.RECT{x = x + offsetX, y = y + offsetY,
wid = w, ht = h})
end
val protocol = PIntDrawable.createStd ()
val _ = PIntDrawable.replaceImpl protocol
{drawLine = doDrawLine,
drawRect = doDrawRect,
fillRect = doFillRect,
setFGColor = doSetFGColor,
drawText = doDrawText,
textHeight = doTextHeight,
textWidth = doTextWidth,
charPositions = doCharPositions}
val newNode = DGNodes.create "Integer drawable"
(PIntDrawable.P.create protocol)
val _ = DGNodes.connect graphNode newNode
(* FIXME: This is just temporary... I'm setting the
default color here... *)
val _ = PIntDrawable.setFGColor protocol {r = 1.0, g = 1.0, b = 1.0}
in
protocol
end
fun getNativeProtocol graphNode =
let
val nativeNode = DGNodes.singleConnectedToType
graphNode "Integer drawable"
in
DGPIntDrawable.p nativeNode
end
end
structure EXeneDrawableNode = FEXeneDrawableNode()
structure ParamDrawableNode = EXeneDrawableNode (* FIXME: ??? *)
HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/EXeneToPortable.sml 100644 1750 1750 3424 6774226076 24736 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
structure GenericUIControl = FEXeneGeneric()
structure uiCore = uiFCore(EXeneCore)
(* FIXME: Apply the uiFCreate functor here with uiPWinNative as argument *)
HardcoreProcessing/MLAbstractUI/srcSML/Core/SMLNJeXene/EXeneColor.sml 100644 1750 1750 4336 6774226076 23744 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FEXeneColor() =
struct
structure EXB = EXeneBase
type t = {r : real, g : real, b : real}
val maxColor = Real.fromInt 65535
(* Converts a real [0, 1] color component to eXene color component *)
fun cCompToX color =
Word.fromInt (Real.round (color * maxColor))
(* Converts RGB real [0, 1] colors to eXene colors *)
fun toEXene eXeneScreen {r, g, b} =
EXB.colorOfScr eXeneScreen
(EXB.CMS_RGB{red = cCompToX r,
green = cCompToX g,
blue = cCompToX b})
end
structure EXeneColor = FEXeneColor()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/ 40755 1750 1750 0 6774225665 20220 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNHierarchy.sml 100644 1750 1750 4363 6774226076 23313 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgnodes";*)
functor FLFNHierarchy() =
struct
fun parentNode graphNode =
let
val halfParentNode =
DGNodes.singleReverseConnectedFromType
graphNode "Children"
in
hd (DGNodes.reverseConnected halfParentNode)
end
fun firstParentOfType node typeName =
let
val pNode = parentNode node
in
if DGNodes.typeName pNode = typeName then
pNode
else
firstParentOfType pNode typeName
end
end
structure LFNHierarchy = FLFNHierarchy()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNGeometry.sml 100644 1750 1750 5234 6774226076 23166 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "$.gtwinnt.dgpcommon";*)
functor FLFNGeometry() =
struct
open DGShorthand
fun setSizeX graphNode value =
let
val sizeX = graphNode +: "SizeX"
val sizeXP = DGPInt.p sizeX
val _ = PInt.write sizeXP value
in () end
fun setSizeY graphNode value =
let
val sizeY = graphNode +: "SizeY"
val sizeYP = DGPInt.p sizeY
val _ = PInt.write sizeYP value
in () end
fun setPosX graphNode value =
let
val posX = graphNode +: "PosX"
val posXP = DGPInt.p posX
val _ = PInt.write posXP value
in () end
fun setPosY graphNode value =
let
val posY = graphNode +: "PosY"
val posYP = DGPInt.p posY
val _ = PInt.write posYP value
in () end
fun placeAt graphNode {x, y} =
(setPosX graphNode x;
setPosY graphNode y)
end
structure LFNGeometry = FLFNGeometry()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNSimpleText.sml 100644 1750 1750 4226 6774226076 23471 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "$.gtwinnt.dgpcommon";*)
functor FLFNSimpleText() =
struct
open DGShorthand
fun setText graphNode value =
let
val label = graphNode +: "Text"
val _ = PString.write (DGPString.p label) value
in () end
fun setEditableText graphNode value =
let
val label = graphNode +: "EditableText"
val _ = PString.write (DGPString.p label) value
in () end
end
structure LFNSimpleText = FLFNSimpleText()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNMiscNotify.sml 100644 1750 1750 14104 6774226076 23473 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "pnotifiers";*)
(*require "$.gtwinnt.dgpcommon";*)
functor FLFNMiscNotify() =
struct
local
open DGShorthand
(* NOTICE: The functions in LFNMiscNotify will possibly
be moved elsewhere... *)
(* FIXME: Use higher-order functions here and put it in
a general place... *)
fun addStringNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val anID = PStringNotify.addNotifier
(DGPStringNotify.p notifyNode)
value
in (graphNode, anID) end
fun removeStringNotifier graphNode notifyName anID =
let
val notifyNode = graphNode +: notifyName
val _ = PStringNotify.removeNotifier
(DGPStringNotify.p notifyNode)
anID
in () end
fun addStringChangedNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val anID = PString.addChangedNotifier
(DGPString.p notifyNode)
value
in (graphNode, anID) end
fun removeStringChangedNotifier graphNode notifyName anID =
let
val notifyNode = graphNode +: notifyName
val _ = PString.removeChangedNotifier
(DGPString.p notifyNode)
anID
in () end
fun addBoolNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val anID = PBoolNotify.addNotifier
(DGPBoolNotify.p notifyNode)
value
in (graphNode, anID) end
fun removeBoolNotifier graphNode notifyName anID =
let
val notifyNode = graphNode +: notifyName
val _ = PBoolNotify.removeNotifier
(DGPBoolNotify.p notifyNode)
anID
in () end
fun addBoolChangedNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val anID = PBool.addChangedNotifier
(DGPBool.p notifyNode)
value
in (graphNode, anID) end
fun removeBoolChangedNotifier graphNode notifyName anID =
let
val notifyNode = graphNode +: notifyName
val _ = PBool.removeChangedNotifier
(DGPBool.p notifyNode)
anID
in () end
fun addNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val anID = PNotify.addNotifier
(DGPNotify.p notifyNode)
value
in (graphNode, anID) end
fun removeNotifier graphNode notifyName anID =
let
val notifyNode = graphNode +: notifyName
val _ = PNotify.removeNotifier
(DGPNotify.p notifyNode)
anID
in () end
in
fun addActionNotifier graphNode value =
addNotifier graphNode "OnAction" value
fun removeActionNotifier graphNode anID =
removeNotifier graphNode "OnAction" anID
fun addTextChangedNotifier graphNode value =
addStringChangedNotifier graphNode "Text" value
fun removeTextChangedNotifier graphNode anID =
removeStringChangedNotifier graphNode "Text" anID
fun addEditableTextChangedNotifier graphNode value =
addStringChangedNotifier graphNode "EditableText" value
fun removeEditableTextChangedNotifier graphNode anID =
removeStringChangedNotifier graphNode "EditableText" anID
fun addFocusChangedNotifier graphNode value =
addBoolChangedNotifier graphNode "HasFocus" value
fun removeFocusChangedNotifier graphNode anID =
removeBoolChangedNotifier graphNode "HasFocus" anID
fun addToggleValueChangedNotifier graphNode value =
addBoolChangedNotifier graphNode "ToggleValue" value
fun removeToggleValueChangedNotifier graphNode anID =
removeBoolChangedNotifier graphNode "ToggleValue" anID
end
end
structure LFNMiscNotify = FLFNMiscNotify()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNPointerNotify.sml 100644 1750 1750 4367 6774226077 24213 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "$.gtwinnt.dgpcommon";*)
(*require "pnotifiers";*)
functor FLFNPointerNotify() =
struct
local
open DGShorthand
fun addNotifier graphNode notifyName value =
let
val notifyNode = graphNode +: notifyName
val _ = PPointerButtonNotify.addNotifier
(DGPPointerButtonNotify.p notifyNode)
value
in () end
in
fun addPointerDownNotifier graphNode value =
addNotifier graphNode "OnPointerDown" value
end
end
structure LFNPointerNotify = FLFNPointerNotify()
HardcoreProcessing/MLAbstractUI/srcSML/LFNeutral/LFNMisc.sml 100644 1750 1750 4673 6774226077 22275 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "$.gtwinnt.dgpcommon";*)
functor FLFNMisc() =
struct
open DGShorthand
(* NOTICE: The functions in LFNMisc will possibly
be moved elsewhere... *)
fun createControl graphNode =
let
val createNode = graphNode +: "Create"
val _ = PBool.write (DGPBool.p createNode) true
in () end
fun setVisible graphNode value =
let
val createNode = graphNode +: "Visible"
val _ = PBool.write (DGPBool.p createNode) value
in () end
fun setFocusControlNode graphNode value =
let
val focusControlNode = graphNode +: "FocusControl"
val _ = PDGNode.write (DGPDGNode.p focusControlNode) value
in () end
end
structure LFNMisc = FLFNMisc()
HardcoreProcessing/MLAbstractUI/srcSML/Components/ 40755 1750 1750 0 6774225705 20504 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/ 40755 1750 1750 0 6774225707 22256 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableButton.sml 100644 1750 1750 12350 6774226077 26056 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPortableButton(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "Button"
fun construct () =
let
val text = "Text"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val textProt =
DGPString.add nameNode text ("", nameNode)
val actionNProt =
DGPNotify.add
nameNode "OnAction" ()
fun overrideText invalidateF =
let
fun newWriteText inh value =
if value = PString.read textProt then
inh value
else
(inh value; invalidateF ())
val {write = writeText, ...} = textProt
in
PMethod.override1Arg writeText newWriteText
end
fun genericConstruct {invalidateRect, getArea} =
let
(* FIXME: Make this a boolean node... *)
val buttonPressed = ref false
fun doPointerDown {button, point} =
if !buttonPressed then
()
else
(buttonPressed := true;
PNotify.doNotify actionNProt nameNode ();
invalidateRect (ParamRect.getRect nameNode))
fun doPointerUp {button, point} =
if !buttonPressed then
(buttonPressed := false;
invalidateRect (ParamRect.getRect nameNode))
else ()
fun doRedraw dp rects =
let
val r = ParamRect.getRect nameNode
val drawFrame =
if !buttonPressed then
GenericLF.drawFrameIn
else
GenericLF.drawFrameOut
in
(drawFrame dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawCenteredText dp r (PString.read textProt))
end
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
val _ = overrideText invalidate
in
{redraw = doRedraw,
pointerDown = doPointerDown,
pointerUp = doPointerUp,
pointerValue = (fn _ => ()),
pointerMove = (fn _ => ()),
keyPress = (fn _ => ())}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 100, h = 18}
genericConstruct
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableToggleButton.sml 100644 1750 1750 12637 6774226077 27230 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPortableToggleButton(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "ToggleButton"
fun construct () =
let
val text = "Text"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val textProt =
DGPString.add nameNode text ("", nameNode)
val toggleValueProt =
DGPBool.add nameNode "ToggleValue" (false, nameNode)
fun overrideText invalidateF =
let
fun newWriteText inh value =
if value = PString.read textProt then
inh value
else
(inh value; invalidateF ())
val {write = writeText, ...} = textProt
in
PMethod.override1Arg writeText newWriteText
end
fun genericConstruct {invalidateRect, getArea} =
let
(* FIXME: Make this a boolean node... *)
val buttonPressed = ref false
val _ = PBool.addChangedNotifier toggleValueProt
(fn _ => fn _ =>
invalidateRect
(ParamRect.getRect nameNode))
fun doPointerDown {button, point} =
if !buttonPressed then
()
else
(buttonPressed := true;
PBool.write toggleValueProt
(not (PBool.read toggleValueProt)))
fun doPointerUp {button, point} =
if !buttonPressed then
(buttonPressed := false)
else ()
fun doRedraw dp rects =
let
val r = ParamRect.getRect nameNode
val drawFrame =
if PBool.read toggleValueProt then
GenericLF.drawFrameIn
else
GenericLF.drawFrameOut
in
(drawFrame dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawCenteredText dp r (PString.read textProt))
end
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
val _ = overrideText invalidate
in
{redraw = doRedraw,
pointerDown = doPointerDown,
pointerUp = doPointerUp,
pointerValue = (fn _ => ()),
pointerMove = (fn _ => ()),
keyPress = (fn _ => ())}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 100, h = 18}
genericConstruct
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableListBox.sml 100644 1750 1750 30334 6774226077 26171 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.mlabstractuiwinnt.uiregister";*)
(*require "$.gtwinnt.dgshorthand";*)
functor FPortableListBox(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "ListBox"
(* FIXME: We should access a global dictionary instead to
get the user's look & feel... *)
structure PortableScrollBar = FPortableScrollBar(DummyReg)
fun construct () =
let
val textlines = "TextLines"
val selectableItems = "SelectableItems"
val doubleClick = "OnDoubleClick"
val click = "OnClick"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val textlinesProt =
DGPStrings.add nameNode textlines (nil, nameNode)
val selectableItemsProt =
DGPItemSelections.add nameNode selectableItems nil
val clickNProt =
DGPPointerButtonNotify.add nameNode click ()
val doubleClickNProt =
DGPPointerButtonNotify.add nameNode doubleClick ()
val hasFocusProt =
DGPBool.add nameNode "HasFocus" (false, nameNode)
fun overrideTextLines invalidateF =
(* Notice: Actually we don't override -
we just add a notifier *)
PStrings.addChangedNotifier
textlinesProt (fn _ => invalidateF)
fun overrideSelectableItems invalidateF =
let
val {count, selectAt, deselectAll, isSelectedAt} =
selectableItemsProt
fun doCount () =
PStrings.count textlinesProt
fun newSelectAt inh index =
if (PMethod.execute count) () <= index orelse
index < 0 then
Excn.eRaiseGeneric
("RANGE",
"Index out of range " ^
"in PItemSelections.selectAt")
else if (!isSelectedAt) index then
()
else
(inh index;
invalidateF ())
in
(PMethod.replace count doCount;
PMethod.override1Arg selectAt newSelectAt;
PMethod.wrap1Arg deselectAll invalidateF)
end
fun genericConstruct {invalidateRect, getArea} =
let
val textTop = 4
fun doRedraw dp rects =
let
val (r as {x, y, w, h}) =
ParamRect.getRect nameNode
val textMargin = 4
val scrollBarWidth = 18
val height = PIntDrawable.textHeight dp "yX"
val linesCnt = PStrings.count textlinesProt
fun drawItem index yPos =
let
val r = {x = textMargin, y = yPos,
w = w - textMargin - textMargin,
h = height}
val _ = if PItemSelections.isSelectedAt
selectableItemsProt
index then
GenericLF.drawBackground dp r
{r = 0.4, g = 0.4, b = 0.4}
else ()
in
GenericLF.drawCenteredYText dp
{x = textMargin, y = yPos,
w = w - textMargin - textMargin,
h = height}
(PStrings.readAt textlinesProt index)
end
fun drawItems index yPos =
if index < linesCnt andalso
yPos + height < h - textTop then
(drawItem index yPos;
drawItems (index + 1) (yPos + height))
else ()
(* FIXME: Communicate with scrollbar control *)
(*fun calcRel space room occupied =
if room > occupied then
space
else
(space * room) div occupied
fun drawScrollBar r =
let
val {x, y, w, h} = IRect2D.inset r 2
val relRect =
{x = x, y = y, w = w,
h = calcRel h (h div height) linesCnt}
in
(GenericLF.drawBackground dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawFrameIn dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawBackground dp relRect {r = 0.4, g = 0.4, b = 0.4};
GenericLF.drawFrameOut dp relRect {r = 0.4, g = 0.4, b = 0.4})
end *)
val _ = map (fn re =>
GenericLF.drawBackground dp re
{r = 0.5, g = 0.5, b = 0.5})
rects
in
(GenericLF.drawEditFrameIn dp r {r = 0.3, g = 0.4, b = 0.5};
drawItems 0 textTop)
end
(* FIXME: Make this standard? *)
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
fun deselectAll () =
PItemSelections.deselectAll
selectableItemsProt
fun selectItemAt {x, y} =
let
val dp = ParamDrawableNode.getNativeProtocol nameNode
val height = PIntDrawable.textHeight dp "yX"
val index = if y >= textTop then
(y - textTop) div height
else ~1
val lines = PItemSelections.count
selectableItemsProt
in
if index >= 0 andalso index < lines then
PItemSelections.selectAt
selectableItemsProt index
else ()
end
val selecting = ref false
fun doPointerDown {button, point} =
if button = 1 then
(deselectAll ();
selectItemAt point;
selecting := true)
else
()
fun doPointerMove {point} =
if !selecting then
selectItemAt point
else ()
fun doPointerUp {button, point} =
if button = 1 then
selecting := false
else ()
val _ = overrideSelectableItems invalidate
val _ = overrideTextLines invalidate
in
{redraw = doRedraw,
pointerDown = doPointerDown,
pointerUp = doPointerUp,
pointerValue = (fn _ => ()),
pointerMove = doPointerMove,
keyPress = (fn _ => ())}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 150, h = 150}
genericConstruct
(* Adding a scrollbar... *)
open DGShorthand
val scrollBar = PortableScrollBar.construct ()
(* FIXME: Make an addChild method in LFNHierarchy... *)
val children = nameNode +: "Children"
val _ = children ~+ scrollBar
fun onListboxSizeXChange sender value =
let
val scrollBarWidth =
PInt.read (DGPInt.p (scrollBar +: "SizeX"))
in
LFNGeometry.setPosX scrollBar
(value - scrollBarWidth)
end
fun onListboxSizeYChange sender value =
LFNGeometry.setSizeY scrollBar value
val sizeXNode = nameNode +: "SizeX"
val sizeXProt = DGPInt.p sizeXNode
val _ = PInt.addChangedNotifier sizeXProt
onListboxSizeXChange
val sizeYNode = nameNode +: "SizeY"
val sizeYProt = DGPInt.p sizeYNode
val _ = PInt.addChangedNotifier sizeYProt
onListboxSizeYChange
val _ = onListboxSizeXChange nameNode
(PInt.read (DGPInt.p (nameNode +: "SizeX")))
fun onCreateControl sender value =
if value then
LFNMisc.createControl scrollBar
else ()
val createNode = nameNode +: "Create"
val createProt = DGPBool.p createNode
val _ = PBool.addChangedNotifier createProt onCreateControl
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableTextField.sml 100644 1750 1750 33505 6774226077 26500 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPortableTextField(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "TextField"
fun construct () =
let
val etext = "EditableText"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val etextProt =
DGPString.add nameNode etext ("", nameNode)
val hasFocusProt =
DGPBool.add nameNode "HasFocus" (false, nameNode)
fun overrideHasFocus invalidateF cursorPos =
let
fun newWriteHasFocus inherited value =
let
(* Set focusControlNode...
Watch out for infinite mutual recursion! *)
fun doWrite value =
let
val topNode =
LFNHierarchy.firstParentOfType
nameNode "Window"
in
LFNMisc.setFocusControlNode
topNode value
end
in
if PBool.read hasFocusProt = value then
()
else
let
val maxCursor = String.size (PString.read etextProt)
in
(inherited value;(* First store new value *)
case value of
true =>
(if maxCursor < (!cursorPos) then
cursorPos := maxCursor
else ();
doWrite (SOME(nameNode)))
| false =>
doWrite NONE;
invalidateF ())
end
end
val {write = writeHasFocus, ...} = hasFocusProt
(* FIXME: ? To make sure that the owner
window is told if we get focus... *)
val _ = PBool.write hasFocusProt false
in
PMethod.override1Arg
writeHasFocus
newWriteHasFocus
end
fun overrideEText invalidateF cursorPos =
let
fun newWriteEText inh value =
if value = PString.read etextProt then
inh value
else
(* FIXME: Make this better/more efficient? *)
(if String.size value < (!cursorPos) then
PBool.write hasFocusProt false
(* to avoid cursor out of range *)
else ();
inh value;
invalidateF ())
val {write = writeEText, ...} = etextProt
in
PMethod.override1Arg writeEText newWriteEText
end
fun genericConstruct {invalidateRect, getArea} =
let
val cursorPos = ref 0
val cursorStart = 4
fun calcCursorX dp cp eText =
let
val s = Substring.substring
(eText, 0, cp)
in
PIntDrawable.textWidth dp
(Substring.string s)
end
fun doRedraw dp rects =
let
val r = ParamRect.getRect nameNode
val (r4 as {x, y, w, h}) = IRect2D.inset r 4
val cp = !cursorPos (* FIXME: It's not even thread safe when reading the cursorPos before eText (example: erase char... *)
val eText = PString.read etextProt
val _ = map (fn re =>
GenericLF.drawBackground dp re
{r = 0.5, g = 0.5, b = 0.5})
rects
val _ = GenericLF.drawEditFrameIn dp r {r = 0.3, g = 0.4, b = 0.5}
val _ = GenericLF.drawCenteredYText dp r4 eText
in
(* FIXME: Invert text? XOR? *)
if PBool.read hasFocusProt then
GenericLF.drawCursor dp
{x = (calcCursorX dp cp eText) + x,
y = y, w = 2, h = h}
else
()
end
(* FIXME: Make this standard? *)
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
fun placeCursor {x, y} =
let
val ss = Substring.all (PString.read etextProt)
val placed = ref false
val px = x - cursorStart
val dp = ParamDrawableNode.getNativeProtocol nameNode
fun checkPlace () =
if !placed then ()
else
cursorPos := Substring.size ss
fun placeClosest d1 d2 index =
(if d1 < (~d2) then
cursorPos := index
else
cursorPos := index + 1;
placed := true)
fun foldPlace (c, (s, d, i)) =
if !placed then (s, d, i)
else
let
val newS = s ^ (Char.toString c)
val newDist =
px - (PIntDrawable.textWidth
dp newS)
in
if newDist < 0 then
(placeClosest d newDist i;
(s, d, i))
else
(newS, newDist, i + 1)
end
in
if px <= 0 then
cursorPos := 0
else
(Substring.foldl foldPlace ("", px, 0) ss;
checkPlace ())
end
fun pointerDown {button, point} =
(PBool.write hasFocusProt true;
placeCursor point;
invalidate ())
(* f : substring -> string *)
fun updateEText f afterF =
(PString.write etextProt
(f (Substring.all (PString.read etextProt)));
afterF ())
fun moveCursor towardsRight =
cursorPos := (!cursorPos) + towardsRight
fun boundedMoveCursor towardsRight =
let
val newPos = (!cursorPos) + towardsRight
val sz = String.size (PString.read etextProt)
in
if newPos < 0 then
cursorPos := 0
else if newPos > sz then
cursorPos := sz
else
cursorPos := newPos
end
(* FIXME: Portable??? *)
fun isErase c =
(c = #"\^H")
fun isKill c =
(c = #"\^X")
fun insertEText inString oldSS =
let
val (left, right) =
Substring.splitAt
(oldSS, !cursorPos)
val inSS = Substring.all inString
(* It's not safe to set cursor before updating eText *)
(*val _ = moveCursor 1*)
in
Substring.concat
[left, inSS, right]
end
fun eraseETextChar oldSS =
let
val (left, right) =
Substring.splitAt
(oldSS, !cursorPos)
val newLeft =
Substring.slice
(left, 0, SOME((Substring.size left) - 1))
val _ = moveCursor (~1)
in
Substring.concat
[newLeft, right]
end
fun handleChar c =
if Char.isPrint c then
updateEText
(insertEText (Char.toString c))
(fn () => moveCursor 1)
else if isErase c andalso
(!cursorPos) > 0 then
updateEText eraseETextChar (fn () => ())
else ()
(* FIXME: Portable??? *)
fun handleCode 147 =
boundedMoveCursor 1 (* Arrow right *)
| handleCode 148 =
boundedMoveCursor (~1) (* Arrow left *)
| handleCode _ = ()
fun keyPress {symbol} = (* FIXME: symbol *)
(case symbol of
GenUI.KeyString(sym) =>
(Substring.app
handleChar
(Substring.all sym))
| GenUI.KeyCode(code) =>
(handleCode code);
invalidate ()) (* FIXME: Only invalidate if necessary... *)
val _ = overrideHasFocus invalidate cursorPos
val _ = overrideEText invalidate cursorPos
in
{redraw = doRedraw,
pointerDown = pointerDown,
pointerUp = (fn _ => ()),
pointerValue = (fn _ => ()),
pointerMove = (fn _ => ()),
keyPress = keyPress}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 100, h = 18}
genericConstruct
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableTextLabel.sml 100644 1750 1750 10334 6774226077 26467 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPortableTextLabel(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "TextLabel"
fun construct () =
let
val text = "Text"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val textProt =
DGPString.add nameNode text ("", nameNode)
fun overrideText invalidateF =
let
fun newWriteText inh value =
if value = PString.read textProt then
inh value
else
(inh value; invalidateF ())
val {write = writeText, ...} = textProt
in
PMethod.override1Arg writeText newWriteText
end
fun genericConstruct {invalidateRect, getArea} =
let
fun doRedraw dp rects =
let
val r = ParamRect.getRect nameNode
val r4 = IRect2D.inset r 4
in
(GenericLF.drawFrameIn dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawCenteredYText dp r4 (PString.read textProt))
end
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
val _ = overrideText invalidate
in
{redraw = doRedraw,
pointerDown = (fn _ => ()),
pointerUp = (fn _ => ()),
pointerValue = (fn _ => ()),
pointerMove = (fn _ => ()),
keyPress = (fn _ => ())}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 100, h = 18}
genericConstruct
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/PortableScrollBar.sml 100644 1750 1750 13444 6774226077 26473 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FPortableScrollBar(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
val name = "ScrollBar"
fun construct () =
let
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add parameter nodes to the graph *)
val scrollRangeProt =
DGPInt.add nameNode "ScrollRange" (100, nameNode)
val scrollRangeUsedProt =
DGPInt.add nameNode "ScrollRangeUsed" (100, nameNode)
val scrollValueProt = (* FIXME: ScrollPos??? *)
DGPInt.add nameNode "ScrollValue" (0, nameNode)
val clickNProt =
DGPPointerButtonNotify.add nameNode "OnClick" ()
val doubleClickNProt =
DGPPointerButtonNotify.add nameNode "OnDoubleClick" ()
fun genericConstruct {invalidateRect, getArea} =
let
fun doRedraw dp rects =
let
val r = ParamRect.getRect nameNode
val edgeWidth = 2
val {x, y, w, h} = IRect2D.inset r edgeWidth
val range = PInt.read scrollRangeProt
val used = PInt.read scrollRangeUsedProt
val value = PInt.read scrollValueProt
(* FIXME: Generalize to horiz/vert by
exchaning x<->y and w<->h *)
val barHeight =
if range > used then
h
else
(h * range) div used
val barPos = edgeWidth + (value * h) div range
val relRect = {x = x, y = barPos,
w = w, h = barHeight}
in
(GenericLF.drawFrameIn dp r {r = 0.3, g = 0.4, b = 0.5};
GenericLF.drawBackground dp relRect {r = 0.4, g = 0.4, b = 0.4};
GenericLF.drawFrameOut dp relRect {r = 0.4, g = 0.4, b = 0.4})
end
(* FIXME: Make this standard? *)
fun invalidate () =
let
val {w, h, x, y} = getArea ()
in
invalidateRect {x = 0, y = 0, w = w, h = h}
end
fun doPointerDown {button, point} =
()
fun doPointerMove {point} =
()
fun doPointerUp {button, point} =
()
fun wrapInt {write, read, addChangedNotifier,
removeChangedNotifier, doNotifyChanged} f =
PMethod.wrap1Arg write invalidate
val _ = wrapInt scrollRangeProt invalidate
val _ = wrapInt scrollRangeUsedProt invalidate
val _ = wrapInt scrollValueProt invalidate
in
{redraw = doRedraw,
pointerDown = doPointerDown,
pointerUp = doPointerUp,
pointerValue = (fn _ => ()),
pointerMove = doPointerMove,
keyPress = (fn _ => ())}
end
val _ = GenericUIControl.constructInt
nameNode
{w = 18, h = 150}
genericConstruct
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/Portable/GenericLF.sml 100644 1750 1750 12436 6774226077 24715 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FGenericLF() =
struct
fun drawBackground dp r c =
let
val _ = PIntDrawable.setFGColor dp c
val _ = PIntDrawable.fillRect dp r
in
()
end
fun lighten {r, g, b} =
let
fun l v =
if v + 0.3 > 1.0 then
1.0
else v + 0.3
in
{r = l r, g = l g, b = l b}
end
fun darken {r, g, b} =
let
fun d v =
if v - 0.3 < 0.0 then
0.0
else v - 0.3
in
{r = d r, g = d g, b = d b}
end
fun drawLitFrame dp {x, y, w, h} upperLeft lowerRight =
let
(* Lines are different to draw than rects... *)
val w = w - 1
val h = h - 1
(* Upper left edges *)
val _ = PIntDrawable.setFGColor dp upperLeft
val _ = PIntDrawable.drawLine dp {x1 = x, y1 = y,
x2 = x + w, y2 = y}
val _ = PIntDrawable.drawLine dp {x1 = x, y1 = y,
x2 = x, y2 = y + h}
(* Lower right edges *)
val _ = PIntDrawable.setFGColor dp lowerRight
val _ = PIntDrawable.drawLine dp {x1 = x, y1 = y + h,
x2 = x + w, y2 = y + h}
val _ = PIntDrawable.drawLine dp {x1 = x + w, y1 = y,
x2 = x + w, y2 = y + h}
in
()
end
fun drawFrameOut dp r c =
drawLitFrame dp r
(lighten c)
(darken c)
fun drawFrameIn dp r c =
drawLitFrame dp r
(darken c)
(lighten c)
fun drawEditFrame f dp r c =
(f dp r c;
PIntDrawable.setFGColor dp {r = 0.0, g = 0.0, b = 0.0};
PIntDrawable.drawRect dp (IRect2D.inset r 1))
val drawEditFrameIn =
drawEditFrame drawFrameIn
val drawEditFrameOut =
drawEditFrame drawFrameOut
(* FIXME: XOR? Invert text? *)
fun drawCursor dp r =
drawBackground dp r
{r = 1.0, g = 1.0, b = 1.0}
fun clipLetters dp theText w =
let
val poss = PIntDrawable.charPositions dp theText
fun clipIt (cPos::rest, index) =
if cPos > w then
Substring.string
(Substring.substring
(theText, 0, index))
else
clipIt (rest, index + 1)
| clipIt (nil, _) = theText
in
clipIt (poss, 0)
end
fun centerX dp theText x w =
let
val textW = PIntDrawable.textWidth dp theText
in
x + (w div 2) - (textW div 2)
end
fun centerY dp theText y h =
let
val textH = PIntDrawable.textHeight dp theText
in
y + (h div 2) + (textH div 2)
end
fun drawCenteredText dp {x, y, w, h} theText =
(PIntDrawable.setFGColor dp
{r = 0.0, g = 0.0, b = 0.0};
PIntDrawable.drawText dp
{x = centerX dp theText x w, (* FIXME: Offset? *)
y = centerY dp theText y h}
theText)
fun drawCenteredYText dp {x, y, w, h} theText =
(PIntDrawable.setFGColor dp
{r = 0.0, g = 0.0, b = 0.0};
PIntDrawable.drawText dp
{x = x, (* FIXME: Offset? *)
y = centerY dp theText y h}
(clipLetters dp theText w))
end
structure GenericLF = FGenericLF()
HardcoreProcessing/MLAbstractUI/srcSML/Components/SMLNJeXene/ 40755 1750 1750 0 6774225707 22356 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/Components/SMLNJeXene/EXeneGeneric.sml 100644 1750 1750 33162 6774226077 25517 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*structure PEXeneGeneric = PFEXeneNative(type nativeType = (EXeneWin.window * Interact.in_env)
val nativeName = "EXene generic")
structure DGPEXeneGeneric = FDGProtocols(PEXeneGeneric)
functor FEXeneGenericUtil() =
struct
fun create native =
let
val protocol = PEXeneGeneric.P.create
{readNative = (fn () => native)}
in
DGNodes.create "EXene generic" protocol
end
fun getNativeProtocol graphNode =
let
val nativeNode = DGNodes.singleConnectedToType
graphNode "EXene generic"
in
DGPEXeneGeneric.p nativeNode
end
fun getNativeWindow graphNode =
PEXeneGeneric.readNative (getNativeProtocol graphNode)
end
structure EXeneGenericUtil = FEXeneGenericUtil() *)
functor FEXeneGeneric() : GENERIC_UI_CONTROL =
struct
structure DR = Drawing
structure EW = EXeneWin
structure EXB = EXeneBase
structure Geom = Geometry
structure Inte = Interact
val name = "Generic"
fun constructInt nameNode {w, h} basicF =
let
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add position and size parameter nodes to the graph *)
val {protPosX, protPosY, protSizeX, protSizeY,
getArea} =
ParamRect.addRect nameNode
{x = 0, y = 0, w = w, h = h}
val visibilityProt = DGPBool.add nameNode "Visible" (true, nameNode)
val pointerDownNProt =
DGPPointerButtonNotify.add
nameNode "OnPointerDown" ()
(* Add eXene native information to the graph *)
(* FIXME: Move the registerChild, invalidateRect and getOffsetTotal
to the pass-along parameters in the generic UI-control *)
fun createNativeInfo window inEnv
registerChild invalidateRect
getOffsetTotal graphNode =
let
val nativeNode = EXeneWindowUtil.create
(window, inEnv, registerChild,
invalidateRect, getOffsetTotal)
val _ = DGNodes.connect graphNode nativeNode
in
DGPEXeneWindow.p nativeNode
end
fun overrideGeom invalidateRect =
let
(* Notice that this invalidate rect is without offset...
maybe this code belongs in the control's parent? *)
fun min (a, b) = if a < b then a else b
fun max (a, b) = if a > b then a else b
fun diff (a, b) = if a < b then b - a else a - b
(* FIXME: Some higher order magic and/or a few extra
functions in IRect2D would be good here... *)
fun newWritePosX inh value =
let
val oldValue = PInt.read protPosX
in
if value = oldValue then
inh value
else
(inh value;
invalidateRect {x = min (value, oldValue),
y = PInt.read protPosY,
w = PInt.read protSizeX + diff (value, oldValue),
h = PInt.read protSizeY})
end
fun newWritePosY inh value =
let
val oldValue = PInt.read protPosY
in
if value = oldValue then
inh value
else
(inh value;
(* FIXME: Invalidate 2 rects instead? *)
invalidateRect {y = min (value, oldValue),
x = PInt.read protPosX,
h = PInt.read protSizeY + diff (value, oldValue),
w = PInt.read protSizeX})
end
fun newWriteSizeX inh value =
let
val {x, y, w, h} = getArea ()
in
if value = w then
inh value
else
(inh value;
(* FIXME: Invalidate 2 rects instead? *)
invalidateRect {x = x, y = y,
w = max (value, w), h = h})
end
fun newWriteSizeY inh value =
let
val {x, y, w, h} = getArea ()
in
if value = h then
inh value
else
(inh value;
invalidateRect {x = x, y = y,
w = w, h = max (value, h)})
end
val {write = writePosX, ...} = protPosX
val {write = writePosY, ...} = protPosY
val {write = writeSizeX, ...} = protSizeX
val {write = writeSizeY, ...} = protSizeY
in
(PMethod.override1Arg writePosX newWritePosX;
PMethod.override1Arg writePosY newWritePosY;
PMethod.override1Arg writeSizeX newWriteSizeX;
PMethod.override1Arg writeSizeY newWriteSizeY)
end
fun nativeCreate () =
let
val {x, y, w, h} = getArea ()
val parentNode = LFNHierarchy.parentNode nameNode
(* FIXME: RegisterChildAtParent, invalidateRect and
getOffsetParent should be moved to the
pass-on parameters...
So parentNode above should really be
firstParentOfType... *)
val (window, inEnv, registerChildAtParent,
invalidateRect, getOffsetParent) =
EXeneWindowUtil.getNativeWindow parentNode
val screen = EW.screenOfWin window
val display = EW.displayOfWin window
val {children, registerChild} =
HierarchyCore.prepareForChildren ()
(* No offset on the top-level window... *)
fun getOffsetTotal () =
let
val {x = offPX, y = offPY} = getOffsetParent ()
val {x = offMyX, y = offMyY, ...} = getArea ()
in
{x = offMyX + offPX, y = offMyY + offPY}
end
(* Calculate offset for drawable... *)
(* FIXME: Also in EXeneWindow - make more general *)
fun getDrawableArea () =
let
val {w, h, ...} = getArea ()
val {x = offX, y = offY} = getOffsetTotal ()
in
{x = offX, y = offY, w = w, h = h}
end
val dp = EXeneDrawableNode.add nameNode
(DR.drawableOfWin window)
display screen getDrawableArea
fun doInvalidateRect {x, y, w, h} =
let
(* FIXME: Now we don't need to accumulate
invalidateRect calls do we?
Make this and getOffsetTotal more general *)
val {x = offsetX, y = offsetY, ...} = getArea ()
in
invalidateRect
{x = x + offsetX, y = y + offsetY,
w = w, h = h}
end
val {redraw, pointerDown, pointerUp,
pointerValue, pointerMove, keyPress} =
basicF {invalidateRect = doInvalidateRect,
getArea = getArea}
fun myPointerDown param =
PPointerButtonNotify.doNotify
pointerDownNProt nameNode param
(* All widgets can assume a blank background *)
fun drawBackground rects =
map (fn r =>
GenericLF.drawBackground dp r
{r = 0.3, g = 0.4, b = 0.5})
rects
fun redrawControl rects =
(drawBackground rects;
redraw dp rects)
fun doRedraw rects =
HierarchyCore.handleDraw
redrawControl
(!children) rects
fun doPointerDown param =
(pointerDown param;
myPointerDown param)
val _ = registerChildAtParent
{node = nameNode,
getArea = getArea,
redraw = doRedraw,
pointerDown = doPointerDown,
pointerUp = pointerUp,
pointerValue = pointerValue,
pointerMove = pointerMove,
keyPress = keyPress}
fun textChanged value =
()(* FIXME: uiWinUtil.setText win value *)
(* Override writeText... *)
(*val _ = writeText := textChanged*)
(* FIXME: Event handler on close *)
(*val _ = w.addMessageHandler
(nativeHandle, w.WM_CLOSE,
fn _ => (w.destroyWindow nativeHandle;
raise Excn.eRaiseGeneric
("AUI_QUIT", "Application quitted!");
SOME w.nullWord))*)
val _ = createNativeInfo
window inEnv
registerChild
doInvalidateRect
getOffsetTotal
nameNode
val _ = doInvalidateRect
{x = 0, y = 0, w = w, h = h}
(* Notice that this invalidate rect is without offset...
maybe this code belongs in the control's parent? *)
val _ = overrideGeom invalidateRect
in
()
end
val _ = ParamCreate.setup nameNode nativeCreate (fn _ => ())
in
()
end
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/SMLNJeXene/EXeneRegistered.sml 100644 1750 1750 4742 6774226077 26222 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Native eXene UI controls *)
structure EXeneWindow = FEXeneWindow(uiRegGUIClass);
(* Portable UI controls *)
structure PortableButton = FPortableButton(uiRegGUIClass);
structure PortableToggleButton = FPortableToggleButton(uiRegGUIClass);
structure PortableListBox = FPortableListBox(uiRegGUIClass);
structure PortableTextLabel = FPortableTextLabel(uiRegGUIClass);
structure PortableTextField = FPortableTextField(uiRegGUIClass);
structure PortableScrollBar = FPortableScrollBar(uiRegGUIClass);
(*structure uiWinGroupBox = uiFWinGroupBox(uiRegGUIClass);*)
(*structure uiWinTextLines = uiFWinTextLines(uiRegGUIClass);*)
structure Reg =
struct
exception Error
fun createA value =
case uiRegGUIClass.find value of
NONE => raise Error
| SOME(constr) => (constr ())
fun registered () =
uiRegGUIClass.registered ()
end
HardcoreProcessing/MLAbstractUI/srcSML/Components/SMLNJeXene/EXeneWindow.sml 100644 1750 1750 66740 6774226077 25422 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
structure PEXeneWindow = PFEXeneNative(type nativeType = (EXeneWin.window * Interact.in_env *
(GenUI.bInternal -> unit) *
(IRect2D.t -> unit) *
(unit -> IPoint2D.t))
val nativeName = "EXene window")
structure DGPEXeneWindow = FDGProtocols(PEXeneWindow)
functor FEXeneWindowUtil() =
struct
fun create native =
let
val protocol = PEXeneWindow.P.create
{readNative = (fn () => native)}
in
DGNodes.create "EXene window" protocol
end
fun getNativeProtocol graphNode =
let
val nativeNode = DGNodes.singleConnectedToType
graphNode "EXene window"
in
DGPEXeneWindow.p nativeNode
end
fun getNativeWindow graphNode =
PEXeneWindow.readNative (getNativeProtocol graphNode)
end
structure EXeneWindowUtil = FEXeneWindowUtil()
functor FEXeneWindow(Reg : UI_REGISTER
where type t = uiRegGUIClass.t) : UI_PLUGIN =
struct
structure EW = EXeneWin
structure EXB = EXeneBase
structure Geom = Geometry
structure Inte = Interact
structure DR = Drawing
val name = "Window"
fun construct () =
let
val text = "Text"
val (nameNode, _) = ParamName.create name
(* FIXME: Notifications should really be done through the connections -
unless it is considered illegal for the user to connect
stuff to size, text, create, native etc.
Maybe I should just add connection constraints?
Or notifications for stateinfo nodes? *)
(* Add position and size parameter nodes to the graph *)
val {protPosX, protPosY, protSizeX, protSizeY,
getArea = getWindowArea} =
ParamRect.addRect nameNode
{x = 0, y = 0, w = 400, h = 400}
val visibilityProt = DGPBool.add nameNode "Visible" (true, nameNode)
val textProt =
DGPString.add nameNode "Text" ("", nameNode)
val focusControlProt =
DGPDGNode.add nameNode "FocusControl" (NONE, nameNode)
val pointerDownNProt =
DGPPointerButtonNotify.add
nameNode "OnPointerDown" ()
(* Add eXene native information to the graph *)
(* FIXME: Move the registerChild, invalidateRect and getOffsetTotal
to the pass-along parameters in the generic UI-control *)
fun createNativeInfo window inEnv
registerChild invalidateRect
getOffsetTotal graphNode =
let
val nativeNode = EXeneWindowUtil.create
(window, inEnv, registerChild,
invalidateRect, getOffsetTotal)
val _ = DGNodes.connect graphNode nativeNode
in
DGPEXeneWindow.p nativeNode
end
fun nativeCreate () =
let
val {x, y, w, h} = getWindowArea ()
val masterNode = LFNHierarchy.parentNode nameNode
val screen = EXeneDisplay.getNativeScreen masterNode
val winSize = Geom.SIZE{wid=w, ht=h}
val minSize = Geom.SIZE{wid=0, ht=0} (* FIXME: ... *)
val winPos = Geom.PT{x = x, y = y}
val (win, inEnv) =
EW.createSimpleTopWin screen
{geom = Geom.WGEOM{pos=winPos, sz=winSize, border=1},
border = EXeneColor.toEXene screen {r = 0.0, g = 0.0, b = 0.0},
backgrnd = EXeneColor.toEXene screen {r = 0.3, g = 0.4, b = 0.5}}
val display = EW.displayOfWin win
fun changeFocus value NONE = ()
| changeFocus value (SOME(aControl)) =
let
val valueNodes = DGNodes.connected aControl
fun changeIt valueNode =
if DGNodes.typeName valueNode = "HasFocus" then
PBool.write (DGPBool.p valueNode) value
else ()
in
List.app changeIt valueNodes
end
fun newWriteFocusControl inh NONE =
(changeFocus false (PDGNode.read focusControlProt);
inh NONE)
| newWriteFocusControl inh (SOME(newControl)) =
(changeFocus false (PDGNode.read focusControlProt);
inh (SOME(newControl));
changeFocus true (SOME(newControl)))
val {write = writeFocusControl, ...} =
focusControlProt
val _ = PMethod.override1Arg
writeFocusControl
newWriteFocusControl
fun textChanged value =
EXeneWin.setWMProperties win
{argv = SMLofNJ.getArgs(),
win_name = SOME value,
icon_name = SOME value,
size_hints =
[ICCC.HINT_PPosition,
ICCC.HINT_PSize,
ICCC.HINT_PMinSize minSize],
wm_hints = [],
class_hints = SOME{res_name= name, (* name is "Window" here *)
res_class= name}
}
val _ = textChanged (PString.read textProt)
fun fromEXene (Geom.RECT{x, y, wid, ht}) =
{x = x, y = y, w = wid, h = ht}
(* NOTICE: Not used... *)
fun toEXene {x, y, w, h} =
Geom.RECT{x = x, y = y, wid = w, ht = h}
val {children, registerChild} =
HierarchyCore.prepareForChildren ()
(* No offset on the top-level window... *)
fun getOffsetTotal () = {x = 0, y = 0}
(* Calculate offset for drawable... *)
(* FIXME: Also in EXeneGeneric - make it more general *)
fun getDrawableArea () =
let
val {x, y, w, h} = getWindowArea ()
val {x = offX, y = offY} = getOffsetTotal ()
in
{x = offX, y = offY, w = w, h = h}
end
val dp = EXeneDrawableNode.add nameNode
(DR.drawableOfWin win)
display screen getDrawableArea
(* All widgets can assume a blank background *)
fun myRedraw rects =
map (fn r =>
GenericLF.drawBackground dp r
{r = 0.3, g = 0.4, b = 0.5})
rects
val {write = writePosX, ...} = protPosX
val {write = writePosY, ...} = protPosY
val {write = writeSizeX, ...} = protSizeX
val {write = writeSizeY, ...} = protSizeY
val oldWritePosX = !writePosX
val oldWritePosY = !writePosY
val oldWriteSizeX = !writeSizeX
val oldWriteSizeY = !writeSizeY
(* FIXME: Make an area node which implements
the PosX, PosY, SizeX and SizeY nodes...?
But then there's the override issue... *)
fun newWritePosX inherited value =
(EW.moveWin win
(Geom.PT{x = value,
y = PInt.read protPosY});
inherited value)
fun newWritePosY inherited value =
(EW.moveWin win
(Geom.PT{x = PInt.read protPosX,
y = value});
inherited value)
fun newWriteSizeX inherited value =
(EW.resizeWin win
(Geom.SIZE{wid = value,
ht = PInt.read protSizeY});
inherited value)
fun newWriteSizeY inherited value =
(EW.resizeWin win
(Geom.SIZE{wid = PInt.read protSizeX,
ht = value});
inherited value)
val _ = PMethod.override1Arg
writePosX
newWritePosX
val _ = PMethod.override1Arg
writePosY
newWritePosY
val _ = PMethod.override1Arg
writeSizeX
newWriteSizeX
val _ = PMethod.override1Arg
writeSizeY
newWriteSizeY
fun handleCmd (Inte.CI_Redraw(_)) =
Excn.eRaiseBug "Redraw should not be sent to command thread!"
| handleCmd (Inte.CI_Resize(rect)) =
let
val {x, y, w, h} = fromEXene rect
in
(oldWritePosX x; oldWritePosY y;
oldWriteSizeX w; oldWriteSizeY h)
end
| handleCmd (Inte.CI_ChildBirth(win)) =
print "Window child birth "
| handleCmd (Inte.CI_ChildDeath(win)) =
print "Window child death "
| handleCmd (Inte.CI_OwnDeath) =
print "Window own death "
fun myPointerDown param =
PPointerButtonNotify.doNotify
pointerDownNProt nameNode param
fun myPointerUp _ = ()
fun myPointerValue _ = ()
fun myPointerMove _ = ()
datatype inputMsg =
InKey of Inte.kbd_msg
| InMouse of Inte.mouse_msg
fun getGetArea
({getArea, ...} : GenUI.bInternal) =
getArea
fun getNode
({node, ...} : GenUI.bInternal) =
node
fun getPointerDown
({pointerDown, ...} : GenUI.bInternal) =
pointerDown
fun getPointerUp
({pointerUp, ...} : GenUI.bInternal) =
pointerUp
fun getPointerMove
({pointerMove, ...} : GenUI.bInternal) =
pointerMove
fun getPointerValue
({pointerValue, ...} : GenUI.bInternal) =
pointerValue
fun checkHit (thePoint as {x, y}) theChild hitF =
let
val (area as {x = offsetX,
y = offsetY, ...}) =
getGetArea theChild ()
val newPoint = {x = x - offsetX,
y = y - offsetY}
in
if IRect2D.containsPoint area thePoint then
(hitF newPoint; true)
else
false
end
fun checkDispatch checkDispatchChild dispatchOtherwise =
let
fun checkIt nil =
dispatchOtherwise ()
| checkIt (aChild::rest) =
if checkDispatchChild aChild then
()
else
checkIt rest
in
checkIt (!children)
end
fun doDispatch paramToPoint replaceParamPoint
getF otherwise param =
let
fun checkChild theChild =
checkHit
(paramToPoint param)
theChild
(fn newPoint =>
(getF theChild)
(replaceParamPoint param newPoint))
in
checkDispatch
checkChild
(fn () => otherwise param)
end
fun generalPointerValue otherwise param =
doDispatch
(fn {button, point, value} => point)
(fn {button, point, value} =>
fn newPoint =>
{button = button,
point = newPoint,
value = value})
getPointerValue
otherwise
param
fun generalPointerUpDown getF otherwise param =
doDispatch
(fn {button, point} => point)
(fn {button, point} =>
fn newPoint =>
{button = button,
point = newPoint})
getF
otherwise
param
val generalPointerUp =
generalPointerUpDown getPointerUp
val generalPointerDown =
generalPointerUpDown getPointerDown
fun generalPointerMove otherwise param =
doDispatch
(fn {point} => point)
(fn {point} =>
fn newPoint =>
{point = newPoint})
getPointerMove
otherwise
param
val doPointerValue =
generalPointerValue
myPointerValue
val doPointerDown =
generalPointerDown
myPointerDown
val doPointerUp =
generalPointerUp
myPointerUp
val doPointerMove =
generalPointerMove
myPointerMove
fun handleMouseUpDown doPointerF value
{but, pt, scr_pt(* FIXME: , state*), time} =
let
val Inte.MButton(button) = but
val Geom.PT{x, y} = pt
val thePoint = {x = x, y = y}
(* FIXME: Add time... *)
val _ = doPointerValue
{button = button,
value = value,
point = thePoint}
val _ = doPointerF
{button = button,
point = thePoint}
in () end
val handleMouseDown =
handleMouseUpDown doPointerDown 1.0
val handleMouseUp =
handleMouseUpDown doPointerUp 0.0
fun handleMouseMotion
{pt, scr_pt(* FIXME: , state*), time} =
let
val Geom.PT{x, y} = pt
val thePoint = {x = x, y = y}
(* FIXME: Add time... *)
in
doPointerMove
{point = thePoint}
end
fun handleKeyPress {symbol} =
let
(* FIXME: Should I pass the event
all the way down the child chain
rather than sending directly
to the inner focused control? *)
fun doPress control ({node, keyPress, ...} : GenUI.bInternal) =
if node = control then
keyPress {symbol = symbol}
else ()
in
case PDGNode.read focusControlProt of
NONE => ()
| SOME(control) =>
List.app (doPress control) (!children)
end
fun defLookup keysym modkeyState =
Inte.lookupString
Inte.defaultTranslation
(keysym, modkeyState)
fun mylookup keysym modkeyState =
case keysym of
Inte.KEYSYM(sym) =>
if sym = 65363 then (* Arrow right *)
GenUI.KeyCode 147 (* FIXME: ... *)
else if sym = 65361 then (* Arrow left *)
GenUI.KeyCode 148 (* FIXME: ... *)
else
GenUI.KeyString(
defLookup keysym modkeyState)
| _ =>
GenUI.KeyString(
defLookup keysym modkeyState)
fun handleInput (InKey(Inte.KEY_Press(keysym, modkeyState))) =
((handleKeyPress
{symbol = mylookup keysym modkeyState})
handle KeysymNotFound => ())
| handleInput (InKey(_)) = ()
| handleInput (InMouse(Inte.MOUSE_Down
{but, pt, scr_pt, state, time})) =
handleMouseDown
{but = but, pt = pt, scr_pt = scr_pt, time = time}
| handleInput (InMouse(Inte.MOUSE_FirstDown
{but, pt, scr_pt, time})) =
handleMouseDown
{but = but, pt = pt, scr_pt = scr_pt, time = time}
| handleInput (InMouse(Inte.MOUSE_Up
{but, pt, scr_pt, state, time})) =
handleMouseUp
{but = but, pt = pt, scr_pt = scr_pt, time = time}
| handleInput (InMouse(Inte.MOUSE_LastUp
{but, pt, scr_pt, time})) =
handleMouseUp
{but = but, pt = pt, scr_pt = scr_pt, time = time}
| handleInput (InMouse(Inte.MOUSE_Motion
{pt, scr_pt, time})) =
handleMouseMotion
{pt = pt, scr_pt = scr_pt, time = time}
| handleInput (InMouse(_)) = ()
(* Create asynchronous communication channels *)
val inputMb = Mailbox.mailbox()
val drawMb = Mailbox.mailbox ()
val cmdMb = Mailbox.mailbox()
(* Setup dispatch thread to avoid locking up
input thread when handling the drawing etc. *)
val Inte.InEnv{k, m, ci, ...} = inEnv
fun invalidateRect rect =
Mailbox.send(drawMb, [rect])
(* Dispatchers *)
fun dispCmd msg =
let
val msgBody = Inte.msgBodyOf msg
in
case msgBody of
(Inte.CI_Redraw(rects)) =>
Mailbox.send(drawMb, map fromEXene rects)
| _ =>
Mailbox.send(cmdMb, msgBody)
end
fun dispMouse msg =
Mailbox.send(inputMb, InMouse(Inte.msgBodyOf msg))
fun dispKey msg =
Mailbox.send(inputMb, InKey(Inte.msgBodyOf msg))
val cmdEvt = CML.wrap (ci, dispCmd)
val keyEvt = CML.wrap (k, dispKey)
val mouseEvt = CML.wrap (m, dispMouse)
fun dispLoop () =
(CML.select [cmdEvt, keyEvt, mouseEvt];
dispLoop ())
val _ = CML.spawn dispLoop
(* Setup drawing thread - merge all redraw rects *)
fun checkDrawMore rects =
case Mailbox.recvPoll drawMb of
NONE =>
(HierarchyCore.handleDraw
myRedraw (!children) rects;
drawLoop ())
| SOME(moreRects) =>
checkDrawMore (moreRects@rects)
and drawLoop () =
checkDrawMore (Mailbox.recv drawMb)
val _ = CML.spawn drawLoop
(* Setup command thread *)
fun cmdLoop () =
(handleCmd(Mailbox.recv cmdMb);
cmdLoop ())
val _ = CML.spawn cmdLoop
(* Setup input thread *)
fun inputLoop () =
(handleInput(Mailbox.recv inputMb);
inputLoop ())
val _ = CML.spawn inputLoop
(* Override writeText... *)
val {write = writeText, ...} = textProt
(* FIXME: Override read to read from eXene window rather
than just reading from own stored data? *)
val _ = PMethod.wrap1Arg
writeText
(fn () => textChanged
(PString.read textProt))
(* FIXME: Is this necessary here? *)
val _ = EXeneWin.mapWin win
(* FIXME: Event handler on close *)
(*val _ = w.addMessageHandler
(nativeHandle, w.WM_CLOSE,
fn _ => (w.destroyWindow nativeHandle;
raise Excn.eRaiseGeneric
("AUI_QUIT", "Application quitted!");
SOME w.nullWord))*)
val _ = createNativeInfo
win inEnv
registerChild
invalidateRect
getOffsetTotal
nameNode
val _ = invalidateRect
{x = 0, y = 0, w = w, h = h}
in
()
end
val _ = ParamCreate.setup nameNode nativeCreate (fn _ => ())
in
nameNode
end
val _ = Reg.register name construct
end
HardcoreProcessing/MLAbstractUI/srcSML/CommonGraphNodes/ 40755 1750 1750 0 6774225736 21566 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/CommonGraphNodes/Portable/ 40755 1750 1750 0 6774225740 23331 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/srcSML/CommonGraphNodes/Portable/ParameterNodes.sml 100644 1750 1750 12637 6774226077 27111 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.typeneutralwinnt.classes";*)
(*require "uiprotocols";*)
(*require "$.gtwinnt.dgnodes";*)
(*require "$.gtwinnt.dgpcommon";*)
(*require "pnotifiers";*)
functor FParamCreate() =
struct
fun createCreateNode nameNode constr destr =
let
val (prot as {write, ...}) = PBool.createStd (false, nameNode)
val writeF = !write
fun newWrite value =
if PBool.read prot = value then
()
else
case value of
true => (constr (); writeF true)
| false => (destr (); writeF false)
(* Override default write method *)
val _ = write := newWrite
in
(* Create the graph node *)
DGNodes.create "Create" (PBool.P.create prot)
end
fun setup graphNode constr destr =
DGNodes.connect graphNode
(createCreateNode graphNode constr destr)
end
structure ParamCreate = FParamCreate()
functor FParamDefaultInteger(val nodePreName : string) =
struct
fun add graphNode name default =
let
val prot = PInt.createStd default
val node = DGNodes.create name (PInt.P.create prot)
val _ = DGNodes.connect graphNode node
in
prot
end
fun addXY graphNode defX defY =
let
val protX = add graphNode (nodePreName ^ "X") (defX, graphNode)
val protY = add graphNode (nodePreName ^ "Y") (defY, graphNode)
in (protX, protY) end
fun get graphNode name =
let
val valueNodes = DGNodes.connected graphNode
fun readIt valueNode =
PInt.read (DGPInt.p valueNode)
fun findIt (valueNode, result) =
if DGNodes.typeName valueNode = name then
readIt valueNode
else result
in
foldl findIt 0 valueNodes
end
fun getXY graphNode =
(get graphNode (nodePreName ^ "X"),
get graphNode (nodePreName ^ "Y"))
end
structure ParamSize = FParamDefaultInteger(val nodePreName = "Size")
structure ParamPos = FParamDefaultInteger(val nodePreName = "Pos")
structure ParamInt = FParamDefaultInteger(val nodePreName = "")
functor FParamRect() =
struct
(* This is relative to the parent's coordinatesystem. *)
fun addRect graphNode {x, y, w, h} =
let
val (protSizeX, protSizeY) =
ParamSize.addXY graphNode w h
val (protPosX, protPosY) =
ParamPos.addXY graphNode x y
fun getArea () =
{x = PInt.read protPosX, y = PInt.read protPosY,
w = PInt.read protSizeX, h = PInt.read protSizeY}
in
{protSizeX = protSizeX, protSizeY = protSizeY,
protPosX = protPosX, protPosY = protPosY,
getArea = getArea}
end
(* FIXME: This is relative to the control's own
coordinate system...
(currently used by the drawing routines) *)
fun getRect graphNode =
let
val (x, y) = ParamPos.getXY graphNode
val (w, h) = ParamSize.getXY graphNode
in
{x = 0, y = 0, w = w, h = h}
end
end
structure ParamRect = FParamRect()
functor FParamName() =
struct
fun create name =
let
val childrenNode = DGNodes.create "Children" (PNull.P.create ())
(* FIXME: Sender = self? *)
val prot = PString.createStd (name, childrenNode)
val node = DGNodes.create name (PString.P.create prot)
val _ = DGNodes.connect node childrenNode
in
(node, prot)
end
end
structure ParamName = FParamName()
HardcoreProcessing/MLAbstractUI/credits/ 40755 1750 1750 0 6774207507 16651 5 ustar anoq anoq HardcoreProcessing/MLAbstractUI/credits/credits.txt 100644 1750 1750 147 6774207507 21126 0 ustar anoq anoq John H. Reppy: Helped me out with eXene and fixed bugs in both eXene
and ML::AbstractUI
HardcoreProcessing/MLAbstractUIDemos/ 40755 1750 1750 0 6774225344 16203 5 ustar anoq anoq HardcoreProcessing/MLAbstractUIDemos/srcSML/ 40755 1750 1750 0 6774225361 17345 5 ustar anoq anoq HardcoreProcessing/MLAbstractUIDemos/srcSML/HyperDemo/ 40755 1750 1750 0 6774225400 21233 5 ustar anoq anoq HardcoreProcessing/MLAbstractUIDemos/srcSML/HyperDemo/HyperDemo.sml 100644 1750 1750 12540 6774226076 23775 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API in Standard ML with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gnLibwinnt.gn";*)
(*require "$.gnlibwinnt.gnmlworks";*)
(*require "$.mlabstractuiwinnt.uiregister";*)
(*require "$.mlabstractuiwinnt.uiwindowstoportable";*)
(*require "$.gtwinnt.dgnodes";*)
(*require "$.gtwinnt.dgshorthand";*)
(*require "$.typeneutralprotocols.simpleprotocols";*)
(*require "$.mlabstractuiwinnt.winwindow";*)
(*require "uiwingroupbox";*)
(*require "$.mlabstractuiwinnt.winbutton";*)
(*require "$.mlabstractuiwinnt.winlistbox";*)
(*require "uiwintextfield";
(*require "uiwintextlines";*)
(*require "uiwintextlabel";*)
(*require "uitreeview";*)*)
(*require "$.basis.__text_io";*)
(*require "$.basis.__int";*)
(* test data *)
structure HyperDemo =
struct
open DGShorthand
exception Error
fun createGraph () =
let
(* Create the nodes *)
val master = uiCore.createMasterNode ()
val win = Reg.createA "Window"
val button = Reg.createA "Button"
val button2 = Reg.createA "Button"
val visButton = Reg.createA "Button"
val listbox = Reg.createA "ListBox"
val scrollbar = Reg.createA "ScrollBar"
(* Get the Children nodes *)
val masterCh = master +: "Children"
val winCh = win +: "Children"
(* Connect the nodes *)
val _ = masterCh ~+ win
val _ = winCh ~+ button
~+ button2
~+ visButton
~+ listbox
~+ scrollbar
(* Initialize data *)
(* FIXME: Implement a keepProtocolConnectionUpdated thingy... *)
val buttonLabel = button +: "Text"
val buttonLabelP = DGPString.p buttonLabel
val _ = PString.write buttonLabelP "Static"
val _ = LFNSimpleText.setText button2 "Clear listbox"
val _ = LFNSimpleText.setText visButton "Visibility"
val _ = LFNSimpleText.setText win "ML::AbstractUI Demo"
val scrRange = scrollbar +: "ScrollRange"
val _ = PInt.write (DGPInt.p scrRange) 100
val scrRangeU = scrollbar +: "ScrollRangeUsed"
val _ = PInt.write (DGPInt.p scrRangeU) 135
val _ = LFNGeometry.setPosX button2 150
val _ = LFNGeometry.setPosX visButton 250
val _ = LFNGeometry.setPosX scrollbar 300
val _ = LFNGeometry.setPosY scrollbar 50
val _ = LFNGeometry.setPosY listbox 50
val listboxLines = listbox +: "TextLines"
val listboxLinesP = DGPStrings.p listboxLines
val listboxVis = listbox +: "Visible"
val listboxVisP = DGPBool.p listboxVis
val cnt = ref 0
fun actionF _ () =
(cnt := (!cnt) + 1;
PStrings.insertAt listboxLinesP 0 "line...";
PString.write buttonLabelP ("Dynamic " ^ Int.toString (!cnt)))
fun clearAction _ () =
PStrings.clear listboxLinesP
fun visibleAction _ () =
PBool.write listboxVisP (not (PBool.read listboxVisP))
(* Setup actions *)
val _ = LFNMiscNotify.addActionNotifier button actionF
val _ = LFNMiscNotify.addActionNotifier button2 clearAction
val _ = LFNMiscNotify.addActionNotifier visButton visibleAction
in
master
end
fun theApp () =
let
val graph = createGraph ()
val _ = Excn.checkedExec uiCore.createGUI graph ()
in
uiCore.runGUI graph
end
fun doIt () =
uiCore.runApp theApp
end
(*fun deliver () =
MLWorks.Deliver.deliver ("HyperDemo.exe", HyperDemo.doIt, MLWorks.Deliver.WINDOWS);*)
HardcoreProcessing/MLAbstractUIDemos/srcSML/HyperDemo/sources.cm 100644 1750 1750 100 6774226076 23315 0 ustar anoq anoq Group is
../../../MLAbstractUI/srcSML/sources.cm
HyperDemo.sml
HardcoreProcessing/MLAbstractUIDemos/srcSML/CreateDemo/ 40755 1750 1750 0 6774225400 21347 5 ustar anoq anoq HardcoreProcessing/MLAbstractUIDemos/srcSML/CreateDemo/CreateDemo.sml 100644 1750 1750 12073 6774226076 24226 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API in Standard ML with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gnLibwinnt.gn";*)
(*require "$.gnlibwinnt.gnmlworks";*)
(*require "$.mlabstractuiwinnt.uiregister";*)
(*require "$.mlabstractuiwinnt.uiwindowstoportable";*)
(*require "$.gtwinnt.dhnodes";*)
(*require "$.typeneutralprotocols.simpleprotocols";*)
(*require "$.mlabstractuiwinnt.winwindow";*)
(*require "uiwingroupbox";*)
(*require "$.mlabstractuiwinnt.winbutton";*)
(*require "$.mlabstractuiwinnt.winlistbox";*)
(*require "uiwintextfield";
(*require "uiwintextlines";*)
(*require "uiwintextlabel";*)
(*require "uitreeview";*)*)
(*require "$.basis.__text_io";*)
(*require "$.basis.__int";*)
(* test data *)
structure CreateDemo =
struct
exception Error
fun createGraph () =
let
open DGShorthand
(* Create the nodes *)
val master = uiCore.createMasterNode ()
val win = Reg.createA "Window"
val button = Reg.createA "Button"
val textField = Reg.createA "TextField"
(* Get the Children nodes *)
val masterCh = master +: "Children"
val winCh = win +: "Children"
(*val createListbox = case uiRegGUIClass.find "ListBox" of
NONE => raise Error
| SOME(constr) => constr *)
(* Connect the nodes *)
val _ = masterCh ~+ win
val _ = winCh ~+ button ~+ textField
val _ = LFNGeometry.setSizeX win 800
val _ = LFNGeometry.setSizeY win 600
val _ = LFNSimpleText.setText win ("ML::AbstractUI creates listboxes")
val _ = LFNGeometry.setPosX textField 100
val _ = LFNSimpleText.setEditableText textField "100"
val _ = LFNSimpleText.setText button "Create!"
fun createOne toGo =
let
val listbox = Reg.createA "ListBox"
val _ = winCh ~+ listbox
val _ = LFNGeometry.setPosY listbox (toGo * 4 + 20)
val _ = LFNGeometry.setPosX listbox (toGo * 4)
val _ = LFNMisc.createControl listbox
val listboxLines = listbox +: "TextLines"
val listboxLinesP = DGPStrings.p listboxLines
val _ = PStrings.add listboxLinesP ("listbox " ^ (Int.toString toGo))
val _ = PStrings.add listboxLinesP "---"
val _ = PStrings.add listboxLinesP "with 3 textlines..."
in
if toGo > 0 then
createOne (toGo - 1)
else ()
end
fun doCreate _ () =
case Int.fromString
(PString.read
(DGPString.p
(textField +: "EditableText"))) of
NONE => ()
| SOME(number) =>
createOne number
val _ = LFNMiscNotify.addActionNotifier button doCreate
in
master
end
fun theApp () =
let
val graph = createGraph ()
val _ = Excn.checkedExec uiCore.createGUI graph ()
in
uiCore.runGUI graph
end
fun doIt () =
uiCore.runApp theApp
end
(*fun deliverCreateTest () =
MLWorks.Deliver.deliver ("CreateDemo.exe", uiCreateExample.doIt, MLWorks.Deliver.WINDOWS);
*)
HardcoreProcessing/MLAbstractUIDemos/srcSML/CreateDemo/sources.cm 100644 1750 1750 101 6774226076 23432 0 ustar anoq anoq Group is
../../../MLAbstractUI/srcSML/sources.cm
CreateDemo.sml
HardcoreProcessing/MLAbstractUIDemos/srcSML/ListboxLinesDemo/ 40755 1750 1750 0 6774225400 22563 5 ustar anoq anoq HardcoreProcessing/MLAbstractUIDemos/srcSML/ListboxLinesDemo/ListboxLinesDemo.sml 100644 1750 1750 10717 6774226076 26661 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API in Standard ML with a crossplatform implementation.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.gnLibwinnt.gn";*)
(*require "$.gnlibwinnt.gnmlworks";*)
(*require "uiregister";*)
(*require "uiwindowstoportable";*)
(*require "$.gtwinnt.dhnodes";*)
(*require "$.typeneutralprotocols.simpleprotocols";*)
(*require "winwindow";*)
(*require "uiwingroupbox";*)
(*require "winbutton";*)
(*require "winlistbox";*)
(*require "uiwintextfield";
(*require "uiwintextlines";*)
(*require "uiwintextlabel";*)
(*require "uitreeview";*)*)
(*require "$.basis.__text_io";*)
(*require "$.basis.__int";*)
(* test data *)
structure ListboxLinesDemo =
struct
exception Error
val count = ref ~1000
fun init value =
count := ~value
fun createGraph () =
let
open DGShorthand
val master = uiCore.createMasterNode ()
val win = Reg.createA "Window"
val listbox = Reg.createA "ListBox"
val button = Reg.createA "Button"
val textField = Reg.createA "TextField"
(* Get the Children nodes *)
val masterCh = master +: "Children"
val winCh = win +: "Children"
val _ = masterCh ~+ win
val _ = winCh ~+ listbox ~+ button ~+ textField
val _ = LFNGeometry.setSizeX win 200
val _ = LFNGeometry.setSizeY win 200
val total = ~(!count)
val _ = LFNSimpleText.setText win ("ML::AbstractUI adds listboxlines")
val listboxLines = listbox +: "TextLines"
val listboxLinesP = DGPStrings.p listboxLines
val _ = LFNGeometry.setPosX textField 100
val _ = LFNGeometry.setPosY listbox 20
val _ = LFNSimpleText.setEditableText textField "100"
val _ = LFNSimpleText.setText button "Create!"
fun createOne toGo =
let
val _ = PStrings.add listboxLinesP ("Line number: " ^ (Int.toString toGo))
in
if toGo > 0 then
createOne (toGo - 1)
else ()
end
fun doCreate _ () =
case Int.fromString
(PString.read
(DGPString.p
(textField +: "EditableText"))) of
NONE => ()
| SOME(number) =>
createOne number
val _ = LFNMiscNotify.addActionNotifier button doCreate
in
master
end
fun theApp () =
let
val graph = createGraph ()
val _ = Excn.checkedExec uiCore.createGUI graph ()
in
uiCore.runGUI graph
end
fun doIt () =
uiCore.runApp theApp
end
(*fun deliverLinesTest () =
MLWorks.Deliver.deliver ("ListboxLinesDemo.exe", ListboxLinesDemo.doIt, MLWorks.Deliver.WINDOWS);
*)
HardcoreProcessing/MLAbstractUIDemos/srcSML/ListboxLinesDemo/sources.cm 100644 1750 1750 107 6774226076 24654 0 ustar anoq anoq Group is
../../../MLAbstractUI/srcSML/sources.cm
ListboxLinesDemo.sml
HardcoreProcessing/README_MLAbstractUI.txt 100644 1750 1750 711 6774207647 17053 0 ustar anoq anoq The licence for this software is found in
HardcoreProcessing/MLAbstractUI/licence/
The documentation is found in
HardcoreProcessing/MLAbstractUI/docs/
Credits are listed in
HardcoreProcessing/MLAbstractUI/credits/
The source code is spread out into multiple directories
HardcoreProcessing//srcSML/
When creating projects using ML::AbstractUI,
this file is the main project file to include:
HardcoreProcessing/MLAbstractUI/srcSML/sources.cm HardcoreProcessing/Collections/ 40755 1750 1750 0 6774225424 15236 5 ustar anoq anoq HardcoreProcessing/Collections/srcSML/ 40755 1750 1750 0 6774225426 16403 5 ustar anoq anoq HardcoreProcessing/Collections/srcSML/sources.cm 100644 1750 1750 270 6774226076 20465 0 ustar anoq anoq Group is
../../OrderedTypes/srcSML/sources.cm
Tree_sig.sml
Tree.sml
SearchTree_sig.sml
SearchTree.sml
Dictionary_sig.sml
Dictionary.sml
SimpleSets_sig.sml
SimpleSets.sml
smlnj-lib.cm
HardcoreProcessing/Collections/srcSML/Dictionary.sml 100644 1750 1750 12567 6774226076 21357 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "dictionary_sig.sml";*)
(*require "order_sig.sml";*)
(*require "stringorder.sml";*)
(*require "tree.sml";*)
(*require "searchtree.sml";*)
(*require "gntestutil_sig.sml";*)
(*require "gntestutil.sml";*)
(*require "$.basis.__list";*)
(* General functor for dictionaries. It requires
a structure with an ordered type as key. *)
functor FDictionary (Key : ORDER) :>
DICTIONARY where type key = Key.t =
struct
structure Stree = FSearchTree (Key)
exception NotImplemented
type key = Key.t
type 'a t = 'a Stree.t
val empty = Tree.empty
fun lookup tree key =
Stree.lookup tree key
fun insert tree key item =
Stree.insert tree key item
fun update tree key f =
Stree.update tree key f
fun delete tree key =
Stree.delete tree key
val size = Tree.size
(* Now all the really powerful functions :) *)
(* Notice that the dicionary module is not required to
keep any particular ordering of the items.
That's why there's only one fold function.
Also notice that the fold function is NOT a tree fold
but a linear fold similar to that of a list.
Also notice that mapToList may return the elements
in any order, but you could use mapToList for
generating a list of (key * sortinfo), then sort
that list and retrieve the dictionary data
by using the keys and the lookup function.
That's how mapSort is implemented... *)
fun map f dict =
Stree.map f dict
fun filter f dict =
Stree.filter f dict
fun fold f init dict =
Stree.fold f init dict
fun mapToList f dict =
fold (fn (a, b) => (f a)::b) nil dict
fun sort compare itemList =
if true then
raise NotImplemented
else
itemList (* FIXME: Make a general sort routine somewhere *)
(* FIXME: Maybe a gnOrder.compare would be ideal to use here... *)
fun mapSort f compare dict =
List.map f (sort compare (mapToList (fn a => a) dict))
end
structure StringDict = FDictionary(StringOrder)
(*structure TestDictionary :> GN_TESTER =
struct
structure dict = FDictionary(StringOrder);
fun sizeEmpty () =
let
val a = dict.empty
val b = dict.insert a "abc" 5
val c = dict.insert b "def" 10
val d = dict.insert c "ghi" 15
val e = dict.insert d "b" 7
in
(dict.size a = 0) andalso (dict.size b = 1) andalso
(dict.size d = 3) andalso (dict.size e = 4)
end
fun lookupInsert () =
let
val a = dict.empty
val b = dict.insert a "abc" 5
val c = dict.insert b "def" 10
val d = dict.insert c "ghi" 15
val e = dict.insert d "b" 7
val tb =
case dict.lookup b "abc" of
NONE => ~1
| SOME(x) => x
val tc1 =
case dict.lookup c "abc" of
NONE => ~1
| SOME(x) => x
val tc2 =
case dict.lookup c "def" of
NONE => ~1
| SOME(x) => x
in
(dict.lookup a "" = NONE) andalso
(dict.lookup a "nothing" = NONE) andalso
(dict.lookup b "nothing" = NONE) andalso
(dict.lookup c "nothing" = NONE) andalso
(dict.lookup d "nothing" = NONE) andalso
(dict.lookup e "nothing" = NONE) andalso
(dict.lookup e "" = NONE) andalso
(tb = 5) andalso (tc1 = 5) andalso (tc2 = 10)
end
fun test () =
gnTU.doTest [("sizeEmpty", sizeEmpty),
("lookupInsert", lookupInsert)]
end*)
HardcoreProcessing/Collections/srcSML/Dictionary_sig.sml 100644 1750 1750 5632 6774226076 22174 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Signature for dictionaries *)
signature DICTIONARY =
sig
type 'a t
type key
val empty : 'a t
val lookup : 'a t -> key -> 'a option
val insert : 'a t -> key -> 'a -> 'a t
val update : 'a t -> key -> ('a -> 'a) -> 'a t
val delete : 'a t -> key -> 'a t
val size : 'a t -> int
(* Now all the really powerful functions :) *)
(* Notice that the dicionary module is not required to
keep any particular ordering of the items.
That's why there's only one fold function.
Also notice that the fold function is NOT a tree fold
but a linear fold similar to that of a list.
Also notice that mapToList may return the elements
in any order, but you could use mapToList for
generating a list of (key * sortinfo), then sort
that list and retrieve the dictionary data
by using the keys and the lookup function.
That's how mapSort is implemented... *)
val map : (key * 'a -> 'b) -> 'a t -> 'b t
val filter : (key * 'a -> bool) -> 'a t -> 'a t
val fold : ((key * 'a) * 'b -> 'b) -> 'b -> 'a t -> 'b
val mapSort : (key * 'a -> 'b) ->
(((key * 'a) * (key * 'a)) -> order) ->
'a t -> 'b list
val mapToList : (key * 'a -> 'b) -> 'a t -> 'b list
end
HardcoreProcessing/Collections/srcSML/SearchTree.sml 100644 1750 1750 10602 6774226076 21263 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "order_sig.sml";*)
(*require "searchtree_sig.sml";*)
(*require "tree.sml";*)
(*require "$.basis.__list";*)
(* This is a general seach tree functor. It requires
a structure with an ordered datatype as the key *)
functor FSearchTree (Key : ORDER) : SEARCH_TREE =
struct
exception Insert (* FIXME: Must be a general exception *)
exception Delete (* FIXME: ... *)
type key = Key.t
type 'a t = (key * 'a) Tree.t
fun lookup Tree.leaf _ = NONE
| lookup (Tree.node((foundKey, item), t1, t2)) key =
case Key.compare (key, foundKey) of
GREATER => (lookup t1 key)
| EQUAL => SOME (item)
| LESS => (lookup t2 key)
(* General internal function used for implementing
other functions of the structure *)
fun mapNode f Tree.leaf _ = (f Tree.leaf)
| mapNode f (n as Tree.node(e as (foundKey, _), t1, t2)) key =
case Key.compare (key, foundKey) of
GREATER => (Tree.node (e, mapNode f t1 key, t2))
| EQUAL => (f n)
| LESS => (Tree.node (e, t1, mapNode f t2 key))
fun fInsert value Tree.leaf =
Tree.node (value, Tree.leaf, Tree.leaf)
| fInsert _ (Tree.node (_, _, _)) = raise Insert
fun insert tree key item =
mapNode (fInsert (key, item)) tree key
fun fUpdate f Tree.leaf = Tree.leaf
| fUpdate f (Tree.node ((foundKey, item), t1, t2)) =
Tree.node ((foundKey, f item), t1, t2)
fun update tree key f =
mapNode (fUpdate f) tree key
fun fDelete (Tree.leaf) key NONE = raise Delete
| fDelete (Tree.leaf) key (SOME(carry)) = carry
| fDelete (Tree.node(e as (foundKey, _), t1, t2)) key carry =
case Key.compare (key, foundKey) of
GREATER => (Tree.node (e, fDelete t1 key carry, t2))
| EQUAL => (fDelete t1 key (SOME(t2)))
| LESS => (Tree.node (e, t1, fDelete t2 key carry))
(* Delete the item associated with a given key *)
fun delete tree key = fDelete tree key NONE
fun map f Tree.leaf = Tree.leaf
| map f (Tree.node (e as (k, _), t1, t2)) =
Tree.node ((k, f e), map f t1, map f t2)
(* Notice: This is NOT a tree fold but a linear
fold similar to fold on a list.
I use an inorder fold but the user may not
rely on any particular ordering of the fold. *)
fun fold f acc tree =
Tree.inFold f acc tree
(* filter reconstructs the searchtree, since this
is easiest to implement. *)
fun fFilter f (element, acc) =
if f element then
element::acc
else
acc
fun fBuild ((key, value), accTree) =
insert accTree key value
fun filter f tree =
List.foldl fBuild Tree.empty (fold (fFilter f) nil tree)
end
HardcoreProcessing/Collections/srcSML/SearchTree_sig.sml 100644 1750 1750 5470 6774226076 22114 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Signature for binary search trees *)
signature SEARCH_TREE =
sig
(* t is the treetype and 'a is the type
of elements in the tree *)
type 'a t
(* type of search key for the tree *)
type key
(* Get the item associated with a particular key
in a tree. The item is returned as an option
if it is found *)
val lookup : 'a t -> key -> 'a option
(* Insert new key + item in the tree. An exception
is raised if the key already exists. *)
val insert : 'a t -> key -> 'a -> 'a t
(* FIXME: Describe this... *)
val update : 'a t -> key -> ('a -> 'a) -> 'a t
(* Delete the item associated with a given key *)
val delete : 'a t -> key -> 'a t
(* Now all the really powerful functions :) *)
(* Notice that the searchtree module is not required to
keep any particular ordering of the items.
That's why there's only one fold function.
Also notice that the fold function is NOT a tree fold
but a linear fold similar to that of a list. *)
val map : (key * 'a -> 'b) -> 'a t -> 'b t
val filter : (key * 'a -> bool) -> 'a t -> 'a t
val fold : ((key * 'a) * 'b -> 'b) -> 'b -> 'a t -> 'b
end
HardcoreProcessing/Collections/srcSML/SimpleSets.sml 100644 1750 1750 3662 6774226076 21316 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "simplesets_sig.sml";*)
(*require "$.basis.__list.sml";*)
(* Simple set operations, where the sets are simply lists *)
functor FSimpleSets() :> SIMPLE_SETS =
struct
fun contains str elements =
List.exists (fn a => a = str) elements
end
structure SimpleSets = FSimpleSets()
HardcoreProcessing/Collections/srcSML/SimpleSets_sig.sml 100644 1750 1750 3417 6774226076 22156 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Simple set operations, where the sets are simply lists *)
signature SIMPLE_SETS =
sig
val contains : ''a -> ''a list -> bool
end
HardcoreProcessing/Collections/srcSML/Tree_sig.sml 100644 1750 1750 4601 6774226076 20761 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Signature for tree datatype. It only has one structure
(gnTree) which is used to _implement_ various kinds of
trees. gnTree should not be used directly. This signature
only exists because gnTree may be required as functor
arguments. *)
signature TREE =
sig
datatype 'a t =
leaf
| node of 'a * 'a t * 'a t
val empty : 'a t
val treeFold : ('a -> 'b -> 'b -> 'b) -> 'b -> 'a t -> 'b
val map : ('a -> 'b) -> 'a t -> 'b t
type ('a, 'b) foldFnc = ('a * 'b -> 'b) -> 'b -> 'a t -> 'b
(* These are linear folds (inorder, preorder and postorder) *)
val inFold : ('a, 'b) foldFnc
val preFold : ('a, 'b) foldFnc
val postFold : ('a, 'b) foldFnc
val size : 'a t -> int
val depth : 'a t -> int
end
HardcoreProcessing/Collections/srcSML/Tree.sml 100644 1750 1750 6446 6774226076 20130 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "tree_sig.sml";*)
(*require "$.basis.__int.sml";*)
(* Structure for tree datatype. It is used to _implement_
various kinds of trees but should not be used directly *)
structure Tree : TREE =
struct
datatype 'a t =
leaf
| node of 'a * 'a t * 'a t
val empty = leaf
fun treeFold _ a leaf = a
| treeFold f a (node (elem, t1, t2)) =
(f elem (treeFold f a t1) (treeFold f a t2))
fun map f leaf = leaf
| map f (node (e, t1, t2)) =
node (f e, map f t1, map f t2)
(* Notice: These linear folds (inorder, preorder, postorder)
similar to foldl foldr on a list. *)
(* I considered to add an accumulation argument to
the treeFold function to allow for implementation
of preorder, inorder and postorder folds, but as far as
I can see this would always be inefficient with
strict evaluation.
And using foldl f init (treeFold preorder ...)
would not be ideal either... *)
type ('a, 'b) foldFnc = ('a * 'b -> 'b) -> 'b -> 'a t -> 'b
fun inFold f acc leaf =
acc
| inFold f acc (node (e, t1, t2)) =
inFold f (f (e, inFold f acc t1)) t2
fun preFold f acc leaf =
acc
| preFold f acc (node (e, t1, t2)) =
preFold f (preFold f (f (e, acc)) t1) t2
fun postFold f acc leaf =
acc
| postFold f acc (node (e, t1, t2)) =
f (e, postFold f (postFold f acc t1) t2)
fun fSize _ ts1 ts2 =
(1 + ts1 + ts2)
fun size tree =
(treeFold fSize 0 tree)
fun fDepth _ ts1 ts2 =
(1 + Int.max (ts1, ts2))
fun depth tree =
(treeFold fDepth 0 tree)
end
HardcoreProcessing/CommonFunctions/ 40755 1750 1750 0 6774225446 16105 5 ustar anoq anoq HardcoreProcessing/CommonFunctions/srcSML/ 40755 1750 1750 0 6774225502 17241 5 ustar anoq anoq HardcoreProcessing/CommonFunctions/srcSML/Util.sml 100644 1750 1750 5417 6774226076 21006 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "util_sig";*)
structure Util : UTIL =
struct
(* A "finally" clause for handling exceptions (similar to those
found in Java and Borland's "Delphi" Pascal dialect)
ought to be part of StandardML in my opinion... *)
(* But, alas, it is not - so I had to write this method *)
fun finalize body final =
((body ())
handle e => (final ();raise e)
before (ignore (final ())))
end
(*structure TestUtil :> GN_TESTER =
struct
fun finalize () =
let
val result1 = ref(false)
val result2 = ref(false)
val result3 = ref(false)
val _ = (gnUtil.finalize
(fn () => raise Match)
(fn () => result1 := true))
handle Match => (result2 := true)
val result4 = gnUtil.finalize
(fn () => 4)
(fn () => result3 := true)
in
!result1 andalso !result2 andalso
!result3 andalso (result4 = 4)
end
fun test () =
gnTU.doTest [("finalize", finalize)]
end
*)
HardcoreProcessing/CommonFunctions/srcSML/Util_sig.sml 100644 1750 1750 3717 6774226076 21651 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
signature UTIL =
sig
(* A "finally" clause for handling exceptions (similar to those
found in Java and Borland's "Delphi" Pascal dialect)
ought to be part of StandardML in my opinion... *)
(* But, alas, it is not - so I had to write this method *)
val finalize : (unit -> 'a) -> (unit -> 'b) -> 'a
end
HardcoreProcessing/CommonFunctions/srcSML/sources.cm 100644 1750 1750 143 6774226076 21327 0 ustar anoq anoq Group is
(*../../../HcPGeneralLib/srcSML/testUtil/sources.cm*)
Util_sig.sml
Util.sml
smlnj-lib.cm
HardcoreProcessing/CompatibilityLayer/ 40755 1750 1750 0 6774225517 16571 5 ustar anoq anoq HardcoreProcessing/CompatibilityLayer/srcSML/ 40755 1750 1750 0 6774225521 17727 5 ustar anoq anoq HardcoreProcessing/CompatibilityLayer/srcSML/sources.cm 100644 1750 1750 45 6774226076 21775 0 ustar anoq anoq Group is
CompSMLNJ.sml
smlnj-lib.cm
HardcoreProcessing/CompatibilityLayer/srcSML/CompSMLNJ.sml 100644 1750 1750 5563 6774226076 22262 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* This structure is not in SML/NJ, so it will be emulated... *)
structure IntVector : MONO_VECTOR =
struct
type vector = int Vector.vector
type elem = int
val maxLen = Vector.maxLen
val fromList = Vector.fromList
val tabulate = Vector.tabulate
val length = Vector.length
val sub = Vector.sub
val extract = Vector.extract
val concat = Vector.concat
val mapi = Vector.mapi
val map = Vector.map
val appi = Vector.appi
val app = Vector.app
val foldli = Vector.foldli
val foldri = Vector.foldri
val foldl = Vector.foldl
val foldr = Vector.foldr
end
(* This structure is not in SML/NJ, so it will be emulated... *)
structure StringVector : MONO_VECTOR =
struct
type vector = string Vector.vector
type elem = string
val maxLen = Vector.maxLen
val fromList = Vector.fromList
val tabulate = Vector.tabulate
val length = Vector.length
val sub = Vector.sub
val extract = Vector.extract
val concat = Vector.concat
val mapi = Vector.mapi
val map = Vector.map
val appi = Vector.appi
val app = Vector.app
val foldli = Vector.foldli
val foldri = Vector.foldri
val foldl = Vector.foldl
val foldr = Vector.foldr
end
HardcoreProcessing/ErrorHandling/ 40755 1750 1750 0 6774225535 15521 5 ustar anoq anoq HardcoreProcessing/ErrorHandling/srcSML/ 40755 1750 1750 0 6774225547 16667 5 ustar anoq anoq HardcoreProcessing/ErrorHandling/srcSML/sources.cm 100644 1750 1750 176 6774226076 20752 0 ustar anoq anoq Group is
Exceptions/Exceptions_sig.sml
Exceptions/Exceptions.sml
ErrorReporter_sig.sml
CommonErrorReporters.sml
smlnj-lib.cm
HardcoreProcessing/ErrorHandling/srcSML/ErrorReporter_sig.sml 100644 1750 1750 3407 6774226076 23161 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
signature ERROR_REPORTER =
sig
val bug : string -> unit
val error : string -> unit
val warning : string -> unit
end
HardcoreProcessing/ErrorHandling/srcSML/CommonErrorReporters.sml 100644 1750 1750 3677 6774226076 23664 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "errorreporter_sig";*)
functor FErrorStdOut() :> ERROR_REPORTER =
struct
exception Error
exception Bug
fun bug msg = (print (msg ^ "\n"); raise Bug)
fun error msg = (print (msg ^ "\n"); raise Error)
fun warning msg = print (msg ^ "\n")
end
structure ErrorStdOut = FErrorStdOut()
HardcoreProcessing/ErrorHandling/srcSML/Exceptions/ 40755 1750 1750 0 6774225550 21002 5 ustar anoq anoq HardcoreProcessing/ErrorHandling/srcSML/Exceptions/sources.cm 100644 1750 1750 124 6774226076 23064 0 ustar anoq anoq Group is
../testUtil/sources.cm
gnExceptions_sig.sml
gnExceptions.sml
smlnj-lib.cm
HardcoreProcessing/ErrorHandling/srcSML/Exceptions/Exceptions.sml 100644 1750 1750 7053 6774226076 23746 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "exceptions_sig";*)
(*require "$.basis.__text_io.sml";*)
structure Excn : EXCN =
struct
datatype t =
generic
| bug
| notImplemented
exception Generic of (t * string * string) list
fun eRaise value =
raise Generic([value])
fun eRaiseBug value =
eRaise (bug, "", value)
fun eRaiseGeneric (valueType, value) =
eRaise (generic, valueType, value)
fun eRaiseNotImplemented value =
eRaise (notImplemented, "", value)
fun reRaise (Generic(values)) newValue =
raise Generic(newValue::values)
| reRaise _ newValue =
raise Generic(newValue::[(bug, "",
"Excn.reRaise used with an exception which is not of type Generic!")])
fun outputValues f nil =
()
| outputValues f ((eType, eTypeStr, eMsg)::values) =
(case eType of
generic => f ("Generic exception of type " ^ eTypeStr ^ " raised: ")
| bug => f "Software bug: "
| notImplemented => f "Feature has not yet been implemented: ";
f eMsg; f "\n")
fun output f (Generic(values)) =
outputValues f values
| output f _ =
f "Software bug: Excn.output used with an exception which is not of type Generic!"
fun checkedExecOutF outF f arg failValue =
(f arg)
handle
(e as Generic(_)) =>
(output outF e;
failValue)
(* FIXME: Define the behaviour of checedExec better! *)
| e => (outF
("Software bug: Unanticipated exception " ^
"of type: " ^ (exnName e) ^ " raised "^
"with the following message: " ^ (exnMessage e));
failValue)
fun checkedExec f arg failValue =
checkedExecOutF
(fn str => TextIO.output (TextIO.stdErr, str))
f arg failValue
end
HardcoreProcessing/ErrorHandling/srcSML/Exceptions/Exceptions_sig.sml 100644 1750 1750 4403 6774226076 24604 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
signature EXCN =
sig
datatype t =
generic
| bug
| notImplemented
(* The excpetion data should be treated as being opaque
- i.e.: DO NOT TOUCH! *)
exception Generic of (t * string * string) list
val eRaise : (t * string * string) -> 'a
val eRaiseBug : string -> 'a
val eRaiseGeneric : string * string -> 'a
val eRaiseNotImplemented : string -> 'a
val reRaise : exn -> (t * string * string) -> 'a
val output : (string -> unit) -> exn -> unit
val checkedExecOutF : (string -> unit) -> ('a -> 'b) -> 'a -> 'b -> 'b
val checkedExec : ('a -> 'b) -> 'a -> 'b -> 'b
end
HardcoreProcessing/GraphToolkit/ 40755 1750 1750 0 6774225563 15373 5 ustar anoq anoq HardcoreProcessing/GraphToolkit/srcSML/ 40755 1750 1750 0 6774225603 16531 5 ustar anoq anoq HardcoreProcessing/GraphToolkit/srcSML/Protocols/ 40755 1750 1750 0 6774225575 20525 5 ustar anoq anoq HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGPCommon.sml 100644 1750 1750 36171 6774226076 23147 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "dgnotifygeneral";*)
(*require "dgprotocols";*)
(*require "dgnodes";*)
(*require "$.typeneutral.classes";*)
(*require "protocolutils";*)
(*require "$.basis.__list";*)
(*require "$.basis.__real";*)
structure PNull =
struct
type t = unit
type default = unit
structure P =
FClass(type newType = t
val className = "NULL")
fun createStd () = ()
end
(*structure PStringRO =
struct
type t = (unit -> string) PMethod.t
structure P =
FClass(type newType = t
val className = "String (readonly)")
fun value prot = (PMethod.execute prot) ()
end*)
functor FT(type tType type 'a method) =
struct
type t = (unit -> tType) method
end
functor FPValueRO(type theType val className : string) =
struct
structure T1 = FT(type tType = theType
type 'a method = 'a PMethod.t)
structure T2 = FT(type tType = theType
type 'a method = 'a)
type t = T1.t
type default = theType
structure P =
FClass(type newType = t
val className = className)
fun stdImpl (init : default) =
(fn () => init) : T2.t
fun createStd init =
ref (stdImpl init) : t
fun read prot = (PMethod.execute prot) ()
end
structure PStringRO =
FPValueRO(type theType = string
val className = "String (readonly)")
functor FT(type tType type 'a method) =
struct
type t = {read : (unit -> tType) method,
write : (tType -> unit) method,
(* Notice: notifier methods can't be overridden *)
addChangedNotifier : (DGNodes.t -> tType -> unit) ->
DGNotifyGeneral.notifyID,
removeChangedNotifier : DGNotifyGeneral.notifyID -> unit,
doNotifyChanged : DGNodes.t -> tType -> unit}
end
functor FPValue(type theType
val className : string
val isEqual : (theType * theType) -> bool) =
struct
(* Most of this is a standard ritual for implementing
protocols. It's quite ugly :(
I'd say that protocol implementaions like these are quite
similar to a virtual method table of an object in an OO-language.
But with this, methods can be overrided at any time at runtime... *)
structure T1 = FT(type tType = theType
type 'a method = 'a PMethod.t)
structure T2 = FT(type tType = theType
type 'a method = 'a)
type t = T1.t
type default = theType * DGNodes.t
structure P =
FClass(type newType = t
val className = className)
fun stdImpl ((init, defSender) : default) =
let
val {addNotifier, removeNotifier, doNotify} =
DGNotifyGeneral.stdImpl ()
val a = ref init
fun doRead () = !a
fun doWrite newValue =
if isEqual (!a, newValue) then
()
else
(a := newValue;
doNotify defSender newValue)
in
{read = doRead, write = doWrite,
addChangedNotifier = addNotifier,
removeChangedNotifier = removeNotifier,
doNotifyChanged = doNotify} : T2.t
end
fun createStd init =
let
val {read, write, addChangedNotifier,
removeChangedNotifier, doNotifyChanged} = stdImpl init
in
{read = ref read, write = ref write,
addChangedNotifier = addChangedNotifier,
removeChangedNotifier = removeChangedNotifier,
doNotifyChanged = doNotifyChanged} : t
end
fun replaceImpl ({read, write, addChangedNotifier,
removeChangedNotifier, doNotifyChanged} : t)
({read = newRead, write = newWrite}) =
(read := newRead; write := newWrite)
fun replaceWithStd defSender (prot as {read, doNotifyChanged, ...} : t) =
let
val init = (!read) ()
val a = ref init
fun doRead () = !a
fun doWrite newValue =
(* FIXME: Check if the value changed? *)
(a := newValue;
doNotifyChanged defSender newValue)
in
replaceImpl prot {write = doWrite, read = doRead}
end
(* The actual protocol for the user *)
fun read ({read, ...} : t) =
(PMethod.execute read) ()
fun write ({write, ...} : t) newValue =
(PMethod.execute write) newValue
fun addChangedNotifier ({addChangedNotifier, ...} : t) newValue =
addChangedNotifier newValue
fun removeChangedNotifier ({removeChangedNotifier, ...} : t) anID =
removeChangedNotifier anID
fun doNotifyChanged ({doNotifyChanged, ...} : t) sender value =
doNotifyChanged sender value
end
structure PString =
FPValue(type theType = string
val className = "String"
val isEqual = (op=))
structure PInt =
FPValue(type theType = int
val className = "Int"
val isEqual = (op=))
structure PReal =
FPValue(type theType = real
val className = "Real"
val isEqual = Real.==)
structure PBool =
FPValue(type theType = bool
val className = "Bool"
val isEqual = (op=))
structure PDGNode =
FPValue(type theType = (DGNodes.t option)
val className = "DGNode option"
val isEqual = (op=))
functor FT(type tType type 'a method) =
struct
type t = {add : (tType -> unit) method,
insertAt : (int -> tType -> unit) method,
remove : (unit -> unit) method,
deleteAt : (int -> unit) method,
writeAt : (int -> tType -> unit) method,
count : (unit -> int) method,
readAt : (int -> tType) method,
clear : (unit -> unit) method,
readList : (unit -> tType list) method,
(* Notice: notifier methods can't be overridden *)
addChangedNotifier : (DGNodes.t -> unit -> unit) ->
DGNotifyGeneral.notifyID,
removeChangedNotifier : DGNotifyGeneral.notifyID -> unit,
doNotifyChanged : DGNodes.t -> unit -> unit}
end
functor FPValues(type theType val className : string) =
struct
structure T1 = FT(type tType = theType
type 'a method = 'a PMethod.t)
structure T2 = FT(type tType = theType
type 'a method = 'a)
type t = T1.t
type default = (theType list) * DGNodes.t
structure P =
FClass(type newType = t
val className = className)
fun stdImpl (init : theType list, defSender) =
let
val {doNotify, addNotifier, removeNotifier} =
DGNotifyGeneral.stdImpl ()
(* FIXME: Add exceptions etc. *)
val a = ref init
fun doReadAt index =
List.nth (!a, index)
fun doAdd value =
(a := (!a) @ [value];
doNotify defSender ())
fun doCount () =
length (!a)
fun doClear () =
(a := nil;
doNotify defSender ())
fun doWriteAt index newValue =
let
fun foldF (e, (cnt, acc)) =
if cnt = index then
(cnt + 1, newValue::acc)
else
(cnt + 1, e::acc)
val (_, result) = foldr foldF (0, nil) (!a)
in
(a := result;
doNotify defSender ())
end
fun doDeleteAt index =
let
fun foldF (e, (cnt, acc)) =
if cnt = index then
(cnt + 1, acc)
else
(cnt + 1, e::acc)
val (_, result) = foldr foldF (0, nil) (!a)
in
(a := result;
doNotify defSender ())
end
fun doInsertAt index newValue =
let
fun ins cnt nil =
[newValue]
| ins cnt (e::rest) =
if cnt = index then
newValue::e::rest
else
e::(ins (cnt + 1) rest)
in
(a := ins 0 (!a);
doNotify defSender ())
end
fun doRemove () =
(a := rev (tl (rev (!a)));
doNotify defSender ())
fun doReadList () = !a
in
{add = doAdd,
insertAt = doInsertAt,
remove = doRemove,
deleteAt = doDeleteAt,
writeAt = doWriteAt,
count = doCount,
readAt = doReadAt,
clear = doClear,
readList = doReadList,
doNotifyChanged = doNotify,
addChangedNotifier = addNotifier,
removeChangedNotifier = removeNotifier} : T2.t
end
fun createStd (init as (_, defSender)) =
let
val {add,
insertAt,
remove,
deleteAt,
writeAt,
count,
readAt,
clear,
readList,
addChangedNotifier,
removeChangedNotifier,
doNotifyChanged} = stdImpl init
in
{add = ref add,
insertAt = ref insertAt,
remove = ref remove,
deleteAt = ref deleteAt,
writeAt = ref writeAt,
count = ref count,
readAt = ref readAt,
clear = ref clear,
readList = ref readList,
addChangedNotifier = addChangedNotifier,
removeChangedNotifier = removeChangedNotifier,
doNotifyChanged = doNotifyChanged}
end
fun replaceImpl ({add, insertAt, remove, deleteAt, writeAt,
count, readAt, clear, readList,
addChangedNotifier, removeChangedNotifier,
doNotifyChanged} : t)
({add = newAdd, insertAt = newInsertAt,
remove = newRemove, deleteAt = newDeleteAt,
writeAt = newWriteAt, count = newCount,
readAt = newReadAt, clear = newClear,
readList = newReadList}) =
(add := newAdd; insertAt := newInsertAt;
remove := newRemove; deleteAt := newDeleteAt;
writeAt := newWriteAt; count := newCount;
readAt := newReadAt; clear := newClear;
readList := newReadList)
fun replaceWithStd (prot as {readList, ...} : t) defSender =
let
val {add, insertAt, remove, deleteAt,
writeAt, count, readAt, clear,
readList, ...} = stdImpl ((!readList) (), defSender)
in
replaceImpl prot
{add = add, insertAt = insertAt, remove = remove,
deleteAt = deleteAt, writeAt = writeAt,
count = count, readAt = readAt, clear = clear,
readList = readList}
end
(* The actual protocol for the user *)
fun readAt ({readAt, ...} : t) index =
(PMethod.execute readAt) index
fun writeAt ({writeAt, ...} : t) index newValue =
(PMethod.execute writeAt) index newValue
fun remove ({remove, ...} : t) =
(PMethod.execute remove) ()
fun clear ({clear, ...} : t) =
(PMethod.execute clear) ()
fun add ({add, ...} : t) newValue =
(PMethod.execute add) newValue
fun insertAt ({insertAt, ...} : t) index newValue =
(PMethod.execute insertAt) index newValue
fun deleteAt ({deleteAt, ...} : t) index =
(PMethod.execute deleteAt) index
fun count ({count, ...} : t) =
(PMethod.execute count) ()
fun clear ({clear, ...} : t) =
(PMethod.execute clear) ()
fun readList ({readList, ...} : t) =
(PMethod.execute readList) ()
fun addChangedNotifier ({addChangedNotifier, ...} : t) newValue =
addChangedNotifier newValue
fun removeChangedNotifier ({removeChangedNotifier, ...} : t) anID =
removeChangedNotifier anID
fun doNotifyChanged (prot as ({doNotifyChanged, ...} : t)) sender =
doNotifyChanged sender ()
end
structure PStrings =
FPValues(type theType = string
val className = "Strings")
structure PInts =
FPValues(type theType = int
val className = "Ints")
structure PReals =
FPValues(type theType = real
val className = "Reals")
structure PBools =
FPValues(type theType = bool
val className = "Bools")
structure DGPNull = FDGProtocols(PNull)
structure DGPStringRO = FDGProtocols(PStringRO)
structure DGPString = FDGProtocols(PString)
structure DGPInt = FDGProtocols(PInt)
structure DGPReal = FDGProtocols(PReal)
structure DGPBool = FDGProtocols(PBool)
structure DGPDGNode = FDGProtocols(PDGNode)
structure DGPStrings = FDGProtocols(PStrings)
structure DGPInts = FDGProtocols(PInts)
structure DGPReals = FDGProtocols(PReals)
structure DGPBools = FDGProtocols(PBools)
HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGProtocols.sml 100644 1750 1750 5471 6774226076 23542 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* This is an attempt to minimize the verbosity required
for calling methods in the protocol of a node. *)
(*require "dgnodes";*)
(*require "$.typeneutralwinnt.classes";*)
(*require "dgprotocols_sig";*)
functor FDGProtocols(Protocol : PROTOCOL_BASIC) =
struct
type t = DGNodes.t
fun p aNode =
DGNodes.protocol Protocol.P.c aNode
(*fun e aNode method =
method (DGNodes.protocol TypedProtocol.c aNode)*)
(* Consequences of using either DGNodesProtocols.e or .p *)
(* e: val _ = (DGPString.e aNode PString.write) "value" *)
(* p: val _ = PString.write (DGPString.p aNode) "value" *)
(* I think using p is clearly most readable... And using p also
allows me to make the typecast once and use the obtained typed
protocol many times afterwards... *)
(* And this is for adding a protocol-parameter-node to a
graph node with a default initial value *)
fun add graphNode typeName default =
let
val prot = Protocol.createStd default
val node = DGNodes.create typeName (Protocol.P.create prot)
val _ = DGNodes.connect graphNode node
in
prot
end
end
HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGProtocols_sig.sml 100644 1750 1750 3467 6774226076 24407 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "classes";*)
signature PROTOCOL_BASIC =
sig
type t
type default
val createStd : default -> t
structure P : CLASS
sharing type P.t = t
end
HardcoreProcessing/GraphToolkit/srcSML/Protocols/DGNotifyGeneral.sml 100644 1750 1750 5567 6774226076 24332 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.basis.__list";*)
(*require "dgnodes";*)
functor FDGNotifyGeneral() =
struct
type notifyID = unit ref
type 'a notifiers = ((DGNodes.t -> 'a -> unit) * notifyID) list
fun stdImpl init =
let
val notifierList = ref nil
fun doAddNotifier notifier =
let
val newID = ref ()
val _ = notifierList :=
(notifier, newID)::(!notifierList)
in
newID
end
fun doRemoveNotifier theID =
notifierList :=
List.mapPartial
(fn (n, foundID) =>
if theID = foundID then
NONE
else
SOME(n, foundID))
(!notifierList)
fun doDoNotify sender param =
List.app
(fn (n, _) => n sender param)
(!notifierList)
in
{addNotifier = doAddNotifier,
removeNotifier = doRemoveNotifier,
doNotify = doDoNotify}
end
end
structure DGNotifyGeneral = FDGNotifyGeneral()
HardcoreProcessing/GraphToolkit/srcSML/Protocols/ProtocolUtils.sml 100644 1750 1750 7200 6774226076 24155 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* FIXME: Remove this completely?
If not - then use this instead of the old HcPGeneralLib *)
functor FPMethod() =
struct
type 'a t = 'a ref
fun execute (m : 'a t) = !m
val exec = execute
fun override1Arg virtualM f =
let
val inherited = !virtualM
fun overridden a =
f inherited a
in
virtualM := overridden
end
fun override2Args virtualM f =
let
val inherited = !virtualM
fun overridden a b =
f inherited a b
in
virtualM := overridden
end
fun override3Args virtualM f =
let
val inherited = !virtualM
fun overridden a b c =
f inherited a b c
in
virtualM := overridden
end
fun override4Args virtualM f =
let
val inherited = !virtualM
fun overridden a b c d =
f inherited a b c d
in
virtualM := overridden
end
fun replace virtualM f =
virtualM := f
fun wrap1Arg virtualM f =
let
val inherited = !virtualM
fun overridden a =
f (inherited a)
in
virtualM := overridden
end
fun wrap2Args virtualM f =
let
val inherited = !virtualM
fun overridden a b =
f (inherited a b)
in
virtualM := overridden
end
fun wrap3Args virtualM f =
let
val inherited = !virtualM
fun overridden a b c =
f (inherited a b c)
in
virtualM := overridden
end
fun wrap4Args virtualM f =
let
val inherited = !virtualM
fun overridden a b c d =
f (inherited a b c d)
in
virtualM := overridden
end
end
structure PMethod = FPMethod()
HardcoreProcessing/GraphToolkit/srcSML/sources.cm 100644 1750 1750 557 6774226076 20626 0 ustar anoq anoq Group is
../../ErrorHandling/srcSML/sources.cm
../../TypeNeutral/srcSML/sources.cm
../../CommonFunctions/srcSML/sources.cm
../../MiscStrings/srcSML/sources.cm
DirectedGraph/DGShorthand.sml
DirectedGraph/DGNodes.sml
Protocols/DGPCommon.sml
Protocols/DGProtocols.sml
Protocols/DGProtocols_sig.sml
Protocols/DGNotifyGeneral.sml
Protocols/ProtocolUtils.sml
smlnj-lib.cm
HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/ 40755 1750 1750 0 6774225605 21240 5 ustar anoq anoq HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGNodes.sml 100644 1750 1750 23571 6774226076 23370 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* FIXME: This implementation could still use some tidying up... *)
(*require "$.errorhandling.commonerrorreporters";*)
(*require "$.errorhandling.errorreporter_sig";*)
(*require "$.typeneutralwinnt.classes";*)
(*require "$.miscstringswinnt.stringres";*)
(*require "$.basis.__string";*)
(*require "$.basis.__list";*)
signature DG_NODES =
sig
eqtype t
(* FIXME: Later we want to be able to remove notifiers again *)
type notifyID = unit ref
val create : string -> ClassesImpl.object -> t
val typeName : t -> string
val protocol : (ClassesImpl.object -> 'a) -> t -> 'a
val protocolName : t -> string
val isConnected : t -> t -> bool
val connect : t -> t -> unit
val disconnect : t -> t -> unit
val connected : t -> t list
val connectedToType : t -> string -> t list
val singleConnectedToType : t -> string -> t
val reverseConnected : t -> t list
val reverseConnectedFromType : t -> string -> t list
val singleReverseConnectedFromType : t -> string -> t
(* Notifications *)
val addConnectNotify : t -> (t -> unit) -> notifyID
val addDisconnectNotify : t -> t -> (t -> unit) -> notifyID
end
(* NOTICE: The error function in Err is expected to raise
an exception in this functor *)
functor FDGNodes(Err : ERROR_REPORTER) :> DG_NODES =
struct
(* FIXME: Later we want to be able to remove notifiers again *)
type notifyID = unit ref
(* Private convenience functions for named values *)
(* For a list-fold operation *)
fun pRemoveNodeNotifiers theNode ((a, b), (values, notifiers)) =
if a = theNode then (values, SOME(b))
else ((a, b)::values, notifiers)
fun pRemoveNode theNode (a, values) =
if a = theNode then values
else a::values
(* FIXME: More general? *)
type 'a notifiers = (('a -> unit) * notifyID) list
(* The datatype for nodes in the hypergraph *)
datatype t =
node of {typeName : StringRes.t,
protocol : ClassesImpl.object,
(* FIXME: Add info about how nodes may be connected *)
(* List of possible connections *)
(* FIXME: Add a dictionary for connection types *)
connections : ((t * (t notifiers)) list ref) *
((t notifiers) ref),
(* List of nodes being reverse connected from an attr. *)
(* FIXME: Add a dictionary for connection types *)
reverseConnections : (t list) ref} ref
(* notifyConnected *)
(* private convenience functions for accessing data in the node type *)
fun pNodeRec matchF (node(value)) = matchF(!value)
val pConnections =
pNodeRec (fn {connections, ...} => connections)
val pReverseConnections =
pNodeRec (fn {reverseConnections, ...} =>
reverseConnections)
(* Function for reading node name *)
fun typeName theNode =
StringRes.value (pNodeRec (fn {typeName, ...} => typeName) theNode)
(* Typecast to the specific protocol type for this node *)
fun protocol typeCastF theNode =
typeCastF (pNodeRec (fn {protocol, ...} => protocol) theNode)
fun protocolName theNode =
ClassesImpl.className
(pNodeRec (fn {protocol, ...} => protocol) theNode)
(* Node constructor - used directly only by node implementors *)
fun create typeName protocol =
node(ref {typeName = StringRes.create typeName,
protocol = protocol,
connections = (ref nil, ref nil),
reverseConnections = ref nil})
(* Function for making notifications *)
fun doNotify notifiers theNode =
List.app (fn (notifier, _) => notifier theNode) notifiers
(* Private convenience functions for making connections internally *)
fun pConnect thisNode toNode =
let
val (nodes, notifiers) =
pConnections thisNode
in
(* FIXME: Also check if the node exists! *)
(nodes := (toNode, nil)::(!nodes);
doNotify (!notifiers))
end
fun pDisconnect thisNode toNode =
let
val (nodes, _) =
pConnections thisNode
val (newNodes, notifiers) = foldl (pRemoveNodeNotifiers toNode) (nil, NONE) (!nodes)
val _ = nodes := newNodes
in
case notifiers of
NONE => (Err.error ("Cannot disconnect because there is no connection from " ^
(typeName thisNode) ^ " to " ^ (typeName toNode));
fn _ => ())
| SOME(notifiers) => doNotify notifiers
end
fun pReverseConnect thisNode toNode =
let
val revConn = pReverseConnections toNode
in
revConn := thisNode::(!revConn)
end
fun pReverseDisconnect thisNode toNode =
let
val revConn = pReverseConnections toNode
in
revConn := rev (foldl (pRemoveNode thisNode) nil (!revConn))
end
fun pDoConnect fc rc thisNode toNode =
let
val performNotify = fc thisNode toNode
val _ = rc thisNode toNode
in
performNotify toNode
end
val connect = pDoConnect pConnect pReverseConnect
val disconnect = pDoConnect pDisconnect pReverseDisconnect
fun connected thisNode =
let
val (nodes, _) =
(pConnections thisNode)
in
map (fn (aNode, _) => aNode) (!nodes)
end
fun reverseConnected theNode =
let
val revConn = pReverseConnections theNode
in
!revConn
end
(* FIXME: Implement more efficiently with a dictionary *)
fun pToType f thisNode theType =
let
val nodes = f thisNode
(* FIXME: This would have been a constant time seach
with a dictionary implemented as a hashtable *)
fun findIt (aNode, result) =
if typeName aNode = theType then
aNode::result
else result
in
foldl findIt nil nodes
end
val connectedToType =
pToType connected
val reverseConnectedFromType =
pToType reverseConnected
fun pSingleToType f msgConn thisNode theType =
let
val nodes = f thisNode theType
in
if length nodes = 1 then
hd nodes
(* FIXME: Make better error msg *)
else (Err.error(msgConn ^ " from " ^
(typeName thisNode) ^ " to " ^
theType ^ " is not a single connection");
hd nodes) (* Notice an exception should be raised from Err.error *)
end
val singleConnectedToType =
pSingleToType connectedToType "Connection"
val singleReverseConnectedFromType =
pSingleToType
reverseConnectedFromType
"Reverse connection"
fun isConnected thisNode toNode =
let
val (nodes, _) =
pConnections thisNode
fun contains nil = false
| contains ((a, _)::rest) =
if a = toNode then true
else contains rest
in
contains (!nodes)
end
(* Notifications *)
fun pAddNotify notify notifiers =
let
val ID = ref ()
val _ = notifiers := (notify, ID)::(!notifiers)
in
ID
end
fun addConnectNotify thisNode notify =
let
val (_, notifiers) =
pConnections thisNode
in
pAddNotify notify notifiers
end
fun addDisconnectNotify thisNode removableNode notify =
let
val (nodes, _) =
pConnections thisNode
val ID = ref ()
fun addIt (aNode, notifiers) =
if aNode = removableNode then
(aNode, (notify, ID)::notifiers)
else
(aNode, notifiers)
val _ = nodes := map addIt (!nodes)
in
ID
end
end
structure DGNodes = FDGNodes(ErrorStdOut)
HardcoreProcessing/GraphToolkit/srcSML/DirectedGraph/DGShorthand.sml 100644 1750 1750 6345 6774226076 24232 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "dgnodes";*)
infix 5 ~+;
infix 5 ~-;
infix 5 ~<+;
infix 5 ~<-;
infix 4 +:;
infix 4 +#;
(*infix 4 +@;*)
infix 4 -:;
infix 4 -#;
(*infix 4 -@;*)
functor FDGShorthand() =
struct
(* Modifiers - begins with a ; *)
fun (thisNode ~+ toNode) =
(DGNodes.connect thisNode toNode; thisNode)
fun (thisNode ~- toNode) =
(DGNodes.disconnect thisNode toNode; thisNode)
fun (thisNode ~<+ notify) =
(DGNodes.addConnectNotify thisNode notify; thisNode)
fun (thisNode ~<- (removableNode, notify)) =
(DGNodes.addDisconnectNotify thisNode removableNode notify; thisNode)
(* FIXME: Perhaps the functions in DGNodes could be made more modular/atomic
to allow for more flexible infix operators? It might return
functional dictionaries or somesuch... *)
(* Connect accessors - begins with a + *)
fun (thisNode +: theType) =
DGNodes.singleConnectedToType thisNode theType
fun (thisNode +# theType) =
DGNodes.connectedToType thisNode theType
(* FIXME: This should be a unary operator with precedence *)
fun +@ thisNode =
DGNodes.connected thisNode
(* Disconnect accessors - begins with a - *)
fun (thisNode -: theType) =
DGNodes.singleReverseConnectedFromType thisNode theType
fun (thisNode -# theType) =
DGNodes.reverseConnectedFromType thisNode theType
(* FIXME: This should be a unary operator with precedence *)
fun -@ thisNode =
DGNodes.reverseConnected thisNode
end
structure DGShorthand = FDGShorthand()
HardcoreProcessing/MiscStrings/ 40755 1750 1750 0 6774225762 15232 5 ustar anoq anoq HardcoreProcessing/MiscStrings/srcSML/ 40755 1750 1750 0 6774225765 16400 5 ustar anoq anoq HardcoreProcessing/MiscStrings/srcSML/sources.cm 100644 1750 1750 133 6774226077 20453 0 ustar anoq anoq Group is
../../Collections/srcSML/sources.cm
StringRes_sig.sml
StringRes.sml
smlnj-lib.cm
HardcoreProcessing/MiscStrings/srcSML/StringRes.sml 100644 1750 1750 5741 6774226077 21136 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.basis.__string";*)
(*require "$.collectionswinnt.dictionary";*)
(*require "stringres_sig";*)
(*require "$.orderedtypeswinnt.order_sig";*)
(* This is a ressource manager for strings. It minimizes storage
requirements for strings in the system. *)
functor FStringRes() :> STRING_RES =
struct
type t = string ref
fun compareInternal (value1, value2) =
String.compare (!value1, !value2)
structure KeyInternal : ORDER =
struct
type t = string ref
val compare = compareInternal
end
structure D = FDictionary(KeyInternal);
val compare = compareInternal
val dict = ref(D.empty : t D.t) (* FIXME: Does global references work? *)
fun create newString =
let
val newRef = ref(newString)
in
case D.lookup (!dict) newRef of
NONE => (dict := D.insert (!dict) newRef newRef; newRef)
| SOME(foundRef) => foundRef
end
(* Used only for very temporary strings - like
when searching in a dictionary *)
fun createTmp newString = ref newString
fun value stringRef =
!stringRef
end
structure StringRes = FStringRes()
structure NamedValues = FDictionary(StringRes) (* FIXME: Should this be here? *)
(* FIXME: NamedValuesRes? or StringResDict? *)
(* FIXME: Should NamedValues even exist? *)
HardcoreProcessing/MiscStrings/srcSML/StringRes_sig.sml 100644 1750 1750 3772 6774226077 22002 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* This is a ressource manager for strings. It minimizes storage
requirements for strings in the system. *)
signature STRING_RES =
sig
type t
val create : string -> t
val value : t -> string
val compare : (t * t) -> order
(* Used only for very temporary strings - like
when searching in a dictionary *)
val createTmp : string -> t
end
HardcoreProcessing/OrderedTypes/ 40755 1750 1750 0 6774225776 15403 5 ustar anoq anoq HardcoreProcessing/OrderedTypes/srcSML/ 40755 1750 1750 0 6774226001 16524 5 ustar anoq anoq HardcoreProcessing/OrderedTypes/srcSML/StringOrder.sml 100644 1750 1750 3600 6774226077 21614 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.basis.__string.sml";*)
(*require "order_sig.sml";*)
(* The string type as an ordered type *)
functor FStringOrder() : ORDER =
struct
type t = string
val compare = String.compare
end
structure StringOrder = FStringOrder()
HardcoreProcessing/OrderedTypes/srcSML/IntegerOrder.sml 100644 1750 1750 3573 6774226077 21754 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.basis.__int.sml";*)
(*require "order_sig.sml";*)
(* The integer type as an ordered type *)
functor FIntegerOrder() : ORDER =
struct
type t = int
val compare = Int.compare
end
structure IntegerOrder = FIntegerOrder()
HardcoreProcessing/OrderedTypes/srcSML/Order_sig.sml 100644 1750 1750 3420 6774226077 21267 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(* Signature for ordered data. *)
signature ORDER =
sig
type t
(* compares 2 datavalues *)
val compare : t * t -> order
end
HardcoreProcessing/OrderedTypes/srcSML/sources.cm 100644 1750 1750 106 6774226077 20617 0 ustar anoq anoq Group is
Order_sig.sml
StringOrder.sml
IntegerOrder.sml
smlnj-lib.cm
HardcoreProcessing/Geometry/ 40755 1750 1750 0 6774226012 14545 5 ustar anoq anoq HardcoreProcessing/Geometry/srcSML/ 40755 1750 1750 0 6774226016 15714 5 ustar anoq anoq HardcoreProcessing/Geometry/srcSML/SimpleGeom2D.sml 100644 1750 1750 11241 6774226077 21003 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
functor FIPoint2D() =
struct
type t = {x : int, y : int}
end
structure IPoint2D = FIPoint2D()
functor FILine2D() =
struct
type t = {x1 : int, y1 : int, x2 : int, y2 : int}
end
structure ILine2D = FILine2D()
functor FISize2D() =
struct
type t = {w : int, h : int}
end
structure ISize2D = FISize2D()
functor FIRect2D() =
struct
(* Public types and values *)
type t = {x : int, y : int, w : int, h : int}
val zeroValue = {x = 0, y = 0, w = 0, h = 0}
(* Private stuff *)
fun contains1D {min, max, check} =
check >= min andalso check < max (* Notice width... *)
fun max (a, b) =
if a > b then a else b
fun min (a, b) =
if a < b then a else b
fun intersect1D {p1, s1, p2, s2} =
{min = max (p1, p2),
max = min (p1 + s1, p2 + s2)}
fun union1D {p1, s1, p2, s2} =
{min = min (p1, p2),
max = max (p1 + s1, p2 + s2)}
(* Public functions *)
fun isZero {x, y, w, h} =
w <= 0 orelse h <= 0
(* If the rectangle gets zero extent - zeroValue is returned *)
fun inset {x, y, w, h} amount =
let
val result =
{x = x + amount, y = y + amount,
w = w - (amount * 2), h = h - (amount * 2)}
in
if isZero result then
zeroValue
else
result
end
(* A point on the boudary of a rectangle is also
considered to be contained in the rectangle. *)
fun containsPoint {x, y, w, h} {x = px, y = py} =
contains1D {min = x, max = x + w, check = px} andalso
contains1D {min = y, max = y + h, check = py}
(* Returns zeroValue for empty intersections
i.e. intersections with zero or less height or width. *)
fun intersect {x, y, w, h}
{x = x2, y = y2, w = w2, h = h2} =
let
val {min = minx, max = maxx} =
intersect1D {p1 = x, s1 = w, p2 = x2, s2 = w2}
val {min = miny, max = maxy} =
intersect1D {p1 = y, s1 = h, p2 = y2, s2 = h2}
val width = maxx - minx
val height = maxy - miny
in
if width <= 0 orelse height <= 0 then
zeroValue
else
{x = minx, y = miny, w = width, h = height}
end
fun union (r1 as {x, y, w, h})
(r2 as {x = x2, y = y2, w = w2, h = h2}) =
if isZero r1 then
if isZero r2 then
zeroValue
else r2
else if isZero r2 then
r1
else
let
val {min = minx, max = maxx} =
union1D {p1 = x, s1 = w, p2 = x2, s2 = w2}
val {min = miny, max = maxy} =
union1D {p1 = y, s1 = h, p2 = y2, s2 = h2}
val width = maxx - minx
val height = maxy - miny
in
{x = minx, y = miny, w = width, h = height}
end
end
structure IRect2D = FIRect2D()
HardcoreProcessing/Geometry/srcSML/sources.cm 100644 1750 1750 50 6774226077 17757 0 ustar anoq anoq Group is
SimpleGeom2D.sml
smlnj-lib.cm
HardcoreProcessing/ParsingToolkit/ 40755 1750 1750 0 6774226040 15724 5 ustar anoq anoq HardcoreProcessing/ParsingToolkit/srcSML/ 40755 1750 1750 0 6774226042 17071 5 ustar anoq anoq HardcoreProcessing/ParsingToolkit/srcSML/sources.cm 100644 1750 1750 121 6774226077 21154 0 ustar anoq anoq Group is
LexMisc.sml
LexError_sig.sml
LexError.sml
LexErrorMsg.sml
smlnj-lib.cm
HardcoreProcessing/ParsingToolkit/srcSML/LexError.sml 100644 1750 1750 4715 6774226077 21464 0 ustar anoq anoq (*
This file is part of ML::AbstractUI - an abstract user interface
API with a crossplatform implementation in Standard ML.
Copyright (C) 1999 ANOQ of the Sun (alias Johnny Andersen).
E-mail: anoq@HardcoreProcessing.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
As a special exception, if you do not do anything which is not in
the spirit of the GNU Library General Public License, you are not
required to physically compile this software into a separate library,
since this is generally not possible with current Stanard ML compilers.
However if you do something which is not in the spirit of the
GNU Library General Public License you will have to follow the
licence perpetually - thus disallowing you to use it for any
commercial purposes at all.
If you are interested in a warranty or commercial support for this
software, contact Hardcore Processing
for more information.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*)
(*require "$.basis.__text_io";*)
(*require "$.basis.__int";*)
(*require "lexerror_sig";*)
functor FLexError() :> LEX_ERROR =
struct
val vCurrentPos = ref 0
fun currentPos () =
!vCurrentPos
fun moveCurrentPos delta =
vCurrentPos := currentPos () + delta
fun error msg = print ("Error at line " ^
Int.toString (currentPos ()) ^
" position " ^
Int.toString (currentPos ()) ^
": " ^ msg ^ ";")
fun warning msg = print ("Warning at line " ^
Int.toString (currentPos ()) ^
" position " ^
Int.toString (currentPos ()) ^
": " ^ msg ^ ";")
fun reset () =
vCurrentPos := 0
end
structure LexError = FLexError()
HardcoreProcessing/ParsingToolkit/srcSML/LexErrorMsg.sml 100644 1750 1750 3034 6774226077 22124 0 ustar anoq anoq (*require "$.basis.__text_io";*)
(*require "$.basis.__int";*)
(* This file is only a slightly modified version of one of the
example sourcefiles from Andrew W. Appel's book
"Modern Compiler Implementation in ML"
I will write something else later... *)
signature ERRORMSG =
sig
val commentNest : int ref
val anyErrors : bool ref
val fileName : string ref
val lineNum : int ref
val linePos : int list ref
val sourceStream : TextIO.instream ref
val error : int -> string -> unit
exception Error
val impossible : string -> 'a (* raises Error *)
val reset : unit -> unit
end
structure ErrorMsg : ERRORMSG =
struct
val commentNest = ref 0
val anyErrors = ref false
val fileName = ref ""
val lineNum = ref 1
val linePos = ref [1]
val sourceStream = ref TextIO.stdIn
fun reset() = (commentNest := 0;
anyErrors:=false;
fileName:="";
lineNum:=1;
linePos:=[1];
sourceStream:=TextIO.stdIn)
exception Error (* FIXME: Must be a general exception *)
fun error pos (msg:string) =
let fun look(a::rest,n) =
if a