mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Use new virtual terminal control
This commit is contained in:
parent
5b707edbdb
commit
4d8f7b95a5
26 changed files with 33 additions and 5151 deletions
|
|
@ -53,7 +53,6 @@
|
|||
@echo Clean up components output directories
|
||||
|
||||
@del /Q /S components\chsdet\lib\*.*
|
||||
@del /Q /S components\CmdLine\lib\*.*
|
||||
@del /Q /S components\dcpcrypt\lib\*.*
|
||||
@del /Q /S components\doublecmd\lib\*.*
|
||||
@del /Q /S components\gifanim\lib\*.*
|
||||
|
|
@ -61,5 +60,6 @@
|
|||
@del /Q /S components\multithreadprocs\lib\*.*
|
||||
@del /Q /S components\viewer\lib\*.*
|
||||
@del /Q /S components\synunihighlighter\lib\*.*
|
||||
@del /Q /S components\virtualterminal\lib\*.*
|
||||
|
||||
@echo Done.
|
||||
2
clean.sh
2
clean.sh
|
|
@ -5,7 +5,6 @@ rm -f units/*/*
|
|||
|
||||
# Clean up components output directories
|
||||
rm -rf components/chsdet/lib/*
|
||||
rm -rf components/CmdLine/lib/*
|
||||
rm -rf components/dcpcrypt/lib/*
|
||||
rm -rf components/doublecmd/lib/*
|
||||
rm -rf components/gifanim/lib/*
|
||||
|
|
@ -13,6 +12,7 @@ rm -rf components/KASToolBar/lib/*
|
|||
rm -rf components/multithreadprocs/lib/*
|
||||
rm -rf components/viewer/lib/*
|
||||
rm -rf components/synunihighlighter/lib/*
|
||||
rm -rf components/virtualterminal/lib/*
|
||||
|
||||
# Clean up all temporary files
|
||||
find . -iname '*.compiled' -delete
|
||||
|
|
|
|||
|
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
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 that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser 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 as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="6"/>
|
||||
<General>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<ActiveEditorIndexAtStart Value="1"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
<Language Value=""/>
|
||||
<CharSet Value=""/>
|
||||
</VersionInfo>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="8">
|
||||
<Unit0>
|
||||
<Filename Value="CmdLineExample.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="CmdLineExample"/>
|
||||
<CursorPos X="27" Y="11"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="148"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="wnmainform.pas"/>
|
||||
<ComponentName Value="WMainForm"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<ResourceFilename Value="wnmainform.lrs"/>
|
||||
<UnitName Value="wnmainform"/>
|
||||
<CursorPos X="63" Y="113"/>
|
||||
<TopLine Value="63"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<UsageCount Value="148"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\ucmdline.pas"/>
|
||||
<UnitName Value="ucmdline"/>
|
||||
<CursorPos X="48" Y="1083"/>
|
||||
<TopLine Value="146"/>
|
||||
<UsageCount Value="4"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="wnmainform.lfm"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="46"/>
|
||||
<SyntaxHighlighter Value="LFM"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="tcmdbox.lrs"/>
|
||||
<CursorPos X="17" Y="1"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="13"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="ucmdline.pas"/>
|
||||
<UnitName Value="ucmdline"/>
|
||||
<CursorPos X="8" Y="30"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="30"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="..\uflowcharteditor.pas"/>
|
||||
<UnitName Value="uflowcharteditor"/>
|
||||
<CursorPos X="25" Y="1039"/>
|
||||
<TopLine Value="1015"/>
|
||||
<UsageCount Value="16"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<UnitName Value="uCmdBox"/>
|
||||
<CursorPos X="45" Y="1488"/>
|
||||
<TopLine Value="1448"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<UsageCount Value="48"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit7>
|
||||
</Units>
|
||||
<JumpHistory Count="17" HistoryIndex="16">
|
||||
<Position1>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="994" Column="6" TopLine="964"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="309" Column="26" TopLine="278"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="229" Column="66" TopLine="203"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="1349" Column="47" TopLine="1312"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="1532" Column="69" TopLine="1495"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="1557" Column="68" TopLine="1520"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="2159" Column="45" TopLine="2122"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="2160" Column="48" TopLine="2123"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="2162" Column="50" TopLine="2125"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="2174" Column="31" TopLine="2144"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="2181" Column="34" TopLine="2144"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="308" Column="1" TopLine="271"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="174" Column="93" TopLine="159"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="1491" Column="34" TopLine="1454"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="86" Column="1" TopLine="49"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="165" Column="32" TopLine="128"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<Caret Line="850" Column="20" TopLine="829"/>
|
||||
</Position17>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<CodeGeneration>
|
||||
<Checks>
|
||||
<RangeChecks Value="True"/>
|
||||
<OverflowChecks Value="True"/>
|
||||
</Checks>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<StripSymbols Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="2">
|
||||
<Item1>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item2>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
program CmdLineExample;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms
|
||||
{ add your units here }, wnmainform;
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TWMainForm, WMainForm);
|
||||
Application.Run;
|
||||
end.
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<Package Version="4">
|
||||
<PathDelim Value="\"/>
|
||||
<Name Value="cmdbox"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="C:\Dokumente und Einstellungen\Nilius\Desktop\laz\CmdLine\"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Files Count="1">
|
||||
<Item1>
|
||||
<Filename Value="ucmdbox.pas"/>
|
||||
<HasRegisterProc Value="True"/>
|
||||
<UnitName Value="uCmdBox"/>
|
||||
</Item1>
|
||||
</Files>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FCL"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item2>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
</UsageOptions>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
</PublishOptions>
|
||||
</Package>
|
||||
</CONFIG>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{ This file was automatically created by Lazarus. Do not edit!
|
||||
This source is only used to compile and install the package.
|
||||
}
|
||||
|
||||
unit cmdbox;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uCmdBox, LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterUnit('uCmdBox', @uCmdBox.Register);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterPackage('cmdbox', @Register);
|
||||
end.
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
Hello
|
||||
This is a little Demo for TCmdBox
|
||||
You can type commands while this text is written here !
|
||||
Available commands :
|
||||
|
||||
* help : Short list for all commands
|
||||
* stop : Stops me from reading this text...
|
||||
* pause : Interrupts me
|
||||
* resume : Continues at the last position pause was called...
|
||||
* start : Restarts reading this text..
|
||||
* clear : Clears the output buffer
|
||||
* clearhistory : clears history buffer for previous input
|
||||
* exit : Exits the program
|
||||
|
||||
A few details to TCmdBox...
|
||||
|
||||
To put TCmdBox into Inputmode use (example)
|
||||
|
||||
CmdBox.StartRead(clRed,clBlack,'>',clSilver,clBlack);
|
||||
|
||||
If you give a string parameter to StartRead, it will be displayed directly before the input and will follow it.
|
||||
|
||||
Input is received through an Event called OnInput.
|
||||
Changes can be watched by the programm by OnInputChange.
|
||||
|
||||
To keep TCmdBox in Inputmode just call StartRead in OnInput again.
|
||||
|
||||
If you resize the application or use splitter in the middle you notice lines are wrapped, there is no fixed or limited line width.
|
||||
|
||||
Input is also saved in a history list with limited to HistoryMax entries including current input.
|
||||
|
||||
Output content by using:
|
||||
|
||||
CmdBox.Write('Text');
|
||||
|
||||
or
|
||||
|
||||
CmdBox.Writeln('Text...');
|
||||
|
||||
These calls are supposed to be Threadsafe !
|
||||
|
||||
You can use all font and background colors possible on the Operating System, for example
|
||||
|
||||
CmdBox.TextColor(clRed);
|
||||
CmdBox.TextBackGround(clSilver);
|
||||
|
||||
or
|
||||
|
||||
CmdBox.TextColors(clRed,clSilver);
|
||||
|
||||
The background color of the last character in a line determines the background color of the rest of the line.
|
||||
|
||||
The component should be able to show correct UTF8 codes of any kind (up to the whole 21 bits), therefore:
|
||||
|
||||
€, ä, ö,ü
|
||||
|
||||
should be correctly written as Euro, Ae, Oe, Ue (the last three are german) if you have selected a UTF8 capable Font and LCL-Interface.
|
||||
|
||||
I hope you can use the component, if you find bugs or have suggestions contact me by email : kccmp@gmx.de
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
LazarusResources.Add('TCmdBox','XPM',[
|
||||
'/* XPM */'#13#10'static char *tcmdbox[] = {'#13#10'/* width height num_color'
|
||||
+'s chars_per_pixel */'#13#10'" 24 24 8 1",'#13#10'/*'
|
||||
+' colors */'#13#10'"` c #C0C0C0",'#13#10'". c #000000",'#13#10'"# c #000000"'
|
||||
+','#13#10'"a c #000000",'#13#10'"b c #000000",'#13#10'"c c #000000",'#13#10
|
||||
+'"d c #000000",'#13#10'"e c #000000",'#13#10'/* pixels */'#13#10'"``````````'
|
||||
+'``````````````",'#13#10'"`......................`",'#13#10'"`..`...`....`..'
|
||||
+'``...``.`",'#13#10'"`.`..`.`....`..`.`.`...`",'#13#10'"`.`.....`..```.``..`'
|
||||
+'...`",'#13#10'"`.`..`..`..`.`.`.`.`...`",'#13#10'"`..`.....`.`.`.``...``.`"'
|
||||
+','#13#10'"`......................`",'#13#10'"`......................`",'#13
|
||||
+#10'"`......................`",'#13#10'"`......................`",'#13#10'"`'
|
||||
+'......................`",'#13#10'"`.````.................`",'#13#10'"`.....'
|
||||
+'.................`",'#13#10'"`......................`",'#13#10'"`..........'
|
||||
+'............`",'#13#10'"`......................`",'#13#10'"`...............'
|
||||
+'.......`",'#13#10'"`......................`",'#13#10'"`....................'
|
||||
+'..`",'#13#10'"`......................`",'#13#10'"`......................`",'
|
||||
+#13#10'"`......................`",'#13#10'"````````````````````````"'#13#10
|
||||
+'};'#13#10
|
||||
]);
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/* XPM */
|
||||
static char *tcmdbox[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 24 24 8 1",
|
||||
/* colors */
|
||||
"` c #C0C0C0",
|
||||
". c #000000",
|
||||
"# c #000000",
|
||||
"a c #000000",
|
||||
"b c #000000",
|
||||
"c c #000000",
|
||||
"d c #000000",
|
||||
"e c #000000",
|
||||
/* pixels */
|
||||
"````````````````````````",
|
||||
"`......................`",
|
||||
"`..`...`....`..``...``.`",
|
||||
"`.`..`.`....`..`.`.`...`",
|
||||
"`.`.....`..```.``..`...`",
|
||||
"`.`..`..`..`.`.`.`.`...`",
|
||||
"`..`.....`.`.`.``...``.`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`.````.................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"`......................`",
|
||||
"````````````````````````"
|
||||
};
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,137 +0,0 @@
|
|||
object WMainForm: TWMainForm
|
||||
Left = 319
|
||||
Height = 480
|
||||
Top = 337
|
||||
Width = 720
|
||||
ActiveControl = CmdBox
|
||||
Caption = 'TCmdBox Example Application'
|
||||
ClientHeight = 480
|
||||
ClientWidth = 720
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.25'
|
||||
object RightPanel: TPanel
|
||||
Left = 579
|
||||
Height = 480
|
||||
Width = 141
|
||||
Align = alRight
|
||||
ClientHeight = 480
|
||||
ClientWidth = 141
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 16
|
||||
Height = 14
|
||||
Top = 8
|
||||
Width = 35
|
||||
Caption = 'History'
|
||||
ParentColor = False
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 440
|
||||
Width = 109
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'End Programm'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 0
|
||||
end
|
||||
object HistoryList: TListBox
|
||||
Left = 16
|
||||
Height = 285
|
||||
Top = 24
|
||||
Width = 109
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
TabOrder = 1
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 315
|
||||
Width = 109
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'Clear'
|
||||
OnClick = Button2Click
|
||||
TabOrder = 2
|
||||
end
|
||||
object CbSetCaret: TComboBox
|
||||
Left = 16
|
||||
Height = 21
|
||||
Top = 397
|
||||
Width = 109
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Caret-Line'
|
||||
'Caret-Sub-Bar'
|
||||
'Caret-Big-Bar'
|
||||
)
|
||||
OnChange = CbSetCaretChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 3
|
||||
Text = 'Caret-Line'
|
||||
end
|
||||
object Button3: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 353
|
||||
Width = 109
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Caption = 'Process'
|
||||
OnClick = Button3Click
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Left = 574
|
||||
Height = 480
|
||||
Width = 5
|
||||
Align = alRight
|
||||
Beveled = True
|
||||
ResizeAnchor = akRight
|
||||
end
|
||||
object CmdBox: TCmdBox
|
||||
Height = 480
|
||||
Width = 574
|
||||
Align = alClient
|
||||
CaretColor = 33023
|
||||
CaretType = cartUser
|
||||
CaretWidth = 1
|
||||
CaretHeight = 13
|
||||
CaretYShift = 3
|
||||
OnInput = CmdBoxInput
|
||||
LineCount = 1000
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clSilver
|
||||
Font.Height = -16
|
||||
Font.Name = 'Arial'
|
||||
Font.Pitch = fpVariable
|
||||
BackGroundColor = clNavy
|
||||
TabWidth = 60
|
||||
PassWordChar = '*'
|
||||
HistoryMax = 10
|
||||
InputSelColor = clPurple
|
||||
InputSelBackGround = clSilver
|
||||
CaretInterval = 500
|
||||
GraphicalCharacterWidth = 10
|
||||
AutoFollow = True
|
||||
end
|
||||
object ReaderTimer: TTimer
|
||||
Interval = 700
|
||||
OnTimer = ReaderTimerTimer
|
||||
left = 66
|
||||
top = 75
|
||||
end
|
||||
object ProcessTimer: TTimer
|
||||
Enabled = False
|
||||
Interval = 100
|
||||
OnTimer = ProcessTimerTimer
|
||||
left = 104
|
||||
top = 75
|
||||
end
|
||||
end
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
|
||||
|
||||
LazarusResources.Add('TWMainForm','FORMDATA',[
|
||||
'TPF0'#10'TWMainForm'#9'WMainForm'#4'Left'#3'?'#1#6'Height'#3#224#1#3'Top'#3
|
||||
+'Q'#1#5'Width'#3#208#2#13'ActiveControl'#7#6'CmdBox'#7'Caption'#6#27'TCmdBox'
|
||||
+' Example Application'#12'ClientHeight'#3#224#1#11'ClientWidth'#3#208#2#8'On'
|
||||
+'Create'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#8'Position'#7#14'po'
|
||||
+'ScreenCenter'#10'LCLVersion'#6#6'0.9.25'#0#6'TPanel'#10'RightPanel'#4'Left'
|
||||
+#3'C'#2#6'Height'#3#224#1#5'Width'#3#141#0#5'Align'#7#7'alRight'#12'ClientHe'
|
||||
+'ight'#3#224#1#11'ClientWidth'#3#141#0#8'TabOrder'#2#0#0#6'TLabel'#6'Label1'
|
||||
+#4'Left'#2#16#6'Height'#2#14#3'Top'#2#8#5'Width'#2'#'#7'Caption'#6#7'History'
|
||||
+#11'ParentColor'#8#0#0#7'TButton'#7'Button1'#4'Left'#2#16#6'Height'#2#25#3'T'
|
||||
+'op'#3#184#1#5'Width'#2'm'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0
|
||||
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#12'End Programm'#7'OnClick'#7
|
||||
+#12'Button1Click'#8'TabOrder'#2#0#0#0#8'TListBox'#11'HistoryList'#4'Left'#2
|
||||
+#16#6'Height'#3#29#1#3'Top'#2#24#5'Width'#2'm'#7'Anchors'#11#5'akTop'#6'akLe'
|
||||
+'ft'#7'akRight'#8'akBottom'#0#8'TabOrder'#2#1#0#0#7'TButton'#7'Button2'#4'Le'
|
||||
+'ft'#2#16#6'Height'#2#25#3'Top'#3';'#1#5'Width'#2'm'#7'Anchors'#11#6'akLeft'
|
||||
+#7'akRight'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#5'C'
|
||||
+'lear'#7'OnClick'#7#12'Button2Click'#8'TabOrder'#2#2#0#0#9'TComboBox'#10'CbS'
|
||||
+'etCaret'#4'Left'#2#16#6'Height'#2#21#3'Top'#3#141#1#5'Width'#2'm'#7'Anchors'
|
||||
+#11#6'akLeft'#7'akRight'#8'akBottom'#0#16'AutoCompleteText'#11#22'cbactEndOf'
|
||||
+'LineComplete'#20'cbactSearchAscending'#0#10'ItemHeight'#2#13#9'ItemIndex'#2
|
||||
+#0#13'Items.Strings'#1#6#10'Caret-Line'#6#13'Caret-Sub-Bar'#6#13'Caret-Big-B'
|
||||
+'ar'#0#8'OnChange'#7#16'CbSetCaretChange'#5'Style'#7#14'csDropDownList'#8'Ta'
|
||||
+'bOrder'#2#3#4'Text'#6#10'Caret-Line'#0#0#7'TButton'#7'Button3'#4'Left'#2#16
|
||||
+#6'Height'#2#25#3'Top'#3'a'#1#5'Width'#2'm'#7'Anchors'#11#6'akLeft'#7'akRigh'
|
||||
+'t'#8'akBottom'#0#7'Caption'#6#7'Process'#7'OnClick'#7#12'Button3Click'#8'Ta'
|
||||
+'bOrder'#2#4#0#0#0#9'TSplitter'#9'Splitter1'#4'Left'#3'>'#2#6'Height'#3#224#1
|
||||
+#5'Width'#2#5#5'Align'#7#7'alRight'#7'Beveled'#9#12'ResizeAnchor'#7#7'akRigh'
|
||||
+'t'#0#0#7'TCmdBox'#6'CmdBox'#6'Height'#3#224#1#5'Width'#3'>'#2#5'Align'#7#8
|
||||
+'alClient'#10'CaretColor'#4#255#128#0#0#9'CaretType'#7#8'cartUser'#10'CaretW'
|
||||
+'idth'#2#1#11'CaretHeight'#2#13#11'CaretYShift'#2#3#7'OnInput'#7#11'CmdBoxIn'
|
||||
+'put'#9'LineCount'#3#232#3#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'
|
||||
+#7#8'clSilver'#11'Font.Height'#2#240#9'Font.Name'#6#5'Arial'#10'Font.Pitch'#7
|
||||
+#10'fpVariable'#15'BackGroundColor'#7#6'clNavy'#8'TabWidth'#2'<'#12'PassWord'
|
||||
+'Char'#6#1'*'#10'HistoryMax'#2#10#13'InputSelColor'#7#8'clPurple'#18'InputSe'
|
||||
+'lBackGround'#7#8'clSilver'#13'CaretInterval'#3#244#1#23'GraphicalCharacterW'
|
||||
+'idth'#2#10#10'AutoFollow'#9#0#0#6'TTimer'#11'ReaderTimer'#8'Interval'#3#188
|
||||
+#2#7'OnTimer'#7#16'ReaderTimerTimer'#4'left'#2'B'#3'top'#2'K'#0#0#6'TTimer'
|
||||
+#12'ProcessTimer'#7'Enabled'#8#8'Interval'#2'd'#7'OnTimer'#7#17'ProcessTimer'
|
||||
+'Timer'#4'left'#2'h'#3'top'#2'K'#0#0#0#10'TWMainForm'#9'WMainForm'#4'Left'#3
|
||||
+'?'#1#6'Height'#3#224#1#3'Top'#3'Q'#1#5'Width'#3#208#2#13'ActiveControl'#7#6
|
||||
+'CmdBox'#7'Caption'#6#27'TCmdBox Example Application'#12'ClientHeight'#3#224
|
||||
+#1#11'ClientWidth'#3#208#2#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11'Fo'
|
||||
+'rmDestroy'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.25'#0#6
|
||||
+'TPanel'#10'RightPanel'#4'Left'#3'C'#2#6'Height'#3#224#1#5'Width'#3#141#0#5
|
||||
+'Align'#7#7'alRight'#12'ClientHeight'#3#224#1#11'ClientWidth'#3#141#0#8'TabO'
|
||||
+'rder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#16#6'Height'#2#14#3'Top'#2#8#5'Wi'
|
||||
+'dth'#2'#'#7'Caption'#6#7'History'#11'ParentColor'#8#0#0#7'TButton'#7'Button'
|
||||
+'1'#4'Left'#2#16#6'Height'#2#25#3'Top'#3#184#1#5'Width'#2'm'#7'Anchors'#11#6
|
||||
+'akLeft'#7'akRight'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#4#7'Captio'
|
||||
+'n'#6#12'End Programm'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#0#0#8'T'
|
||||
+'ListBox'#11'HistoryList'#4'Left'#2#16#6'Height'#3#29#1#3'Top'#2#24#5'Width'
|
||||
+#2'm'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'TabOrder'#2
|
||||
+#1#0#0#7'TButton'#7'Button2'#4'Left'#2#16#6'Height'#2#25#3'Top'#3';'#1#5'Wid'
|
||||
+'th'#2'm'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#25'BorderSpacing.'
|
||||
+'InnerBorder'#2#4#7'Caption'#6#5'Clear'#7'OnClick'#7#12'Button2Click'#8'TabO'
|
||||
+'rder'#2#2#0#0#9'TComboBox'#10'CbSetCaret'#4'Left'#2#16#6'Height'#2#21#3'Top'
|
||||
+#3#141#1#5'Width'#2'm'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#16'A'
|
||||
+'utoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#10
|
||||
+'ItemHeight'#2#13#9'ItemIndex'#2#0#13'Items.Strings'#1#6#10'Caret-Line'#6#13
|
||||
+'Caret-Sub-Bar'#6#13'Caret-Big-Bar'#0#8'OnChange'#7#16'CbSetCaretChange'#5'S'
|
||||
+'tyle'#7#14'csDropDownList'#8'TabOrder'#2#3#4'Text'#6#10'Caret-Line'#0#0#7'T'
|
||||
+'Button'#7'Button3'#4'Left'#2#16#6'Height'#2#25#3'Top'#3'a'#1#5'Width'#2'm'#7
|
||||
+'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#7'Process'#7'On'
|
||||
+'Click'#7#12'Button3Click'#8'TabOrder'#2#4#0#0#0#9'TSplitter'#9'Splitter1'#4
|
||||
,'Left'#3'>'#2#6'Height'#3#224#1#5'Width'#2#5#5'Align'#7#7'alRight'#7'Beveled'
|
||||
+#9#12'ResizeAnchor'#7#7'akRight'#0#0#7'TCmdBox'#6'CmdBox'#6'Height'#3#224#1#5
|
||||
+'Width'#3'>'#2#5'Align'#7#8'alClient'#10'CaretColor'#4#255#128#0#0#9'CaretTy'
|
||||
+'pe'#7#8'cartUser'#10'CaretWidth'#2#1#11'CaretHeight'#2#13#11'CaretYShift'#2
|
||||
+#3#7'OnInput'#7#11'CmdBoxInput'#9'LineCount'#3#232#3#12'Font.CharSet'#7#12'A'
|
||||
+'NSI_CHARSET'#10'Font.Color'#7#8'clSilver'#11'Font.Height'#2#240#9'Font.Name'
|
||||
+#6#5'Arial'#10'Font.Pitch'#7#10'fpVariable'#15'BackGroundColor'#7#6'clNavy'#8
|
||||
+'TabWidth'#2'<'#12'PassWordChar'#6#1'*'#10'HistoryMax'#2#10#13'InputSelColor'
|
||||
+#7#8'clPurple'#18'InputSelBackGround'#7#8'clSilver'#13'CaretInterval'#3#244#1
|
||||
+#23'GraphicalCharacterWidth'#2#10#10'AutoFollow'#9#0#0#6'TTimer'#11'ReaderTi'
|
||||
+'mer'#8'Interval'#3#188#2#7'OnTimer'#7#16'ReaderTimerTimer'#4'left'#2'B'#3't'
|
||||
+'op'#2'K'#0#0#6'TTimer'#12'ProcessTimer'#7'Enabled'#8#8'Interval'#2'd'#7'OnT'
|
||||
+'imer'#7#17'ProcessTimerTimer'#4'left'#2'h'#3'top'#2'K'#0#0#0
|
||||
]);
|
||||
|
|
@ -1,239 +0,0 @@
|
|||
{ Copyright (C) 2007 Julian Schutsch
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
This Software is GPL, not LGPL as the libary it uses !
|
||||
|
||||
Changelog
|
||||
10.8.2007 : Added "Buttons" Unit to avoid "TButton" missing error on 0.9.22 (Linux)
|
||||
|
||||
}
|
||||
unit wnmainform;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Graphics, Dialogs, ExtCtrls,LCLType,
|
||||
ucmdbox, StdCtrls, Controls, Buttons;
|
||||
|
||||
type
|
||||
|
||||
{ TWMainForm }
|
||||
|
||||
TWMainForm = class(TForm)
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
Button3: TButton;
|
||||
CmdBox: TCmdBox;
|
||||
CbSetCaret: TComboBox;
|
||||
Label1: TLabel;
|
||||
HistoryList: TListBox;
|
||||
RightPanel: TPanel;
|
||||
Splitter1: TSplitter;
|
||||
ReaderTimer: TTimer;
|
||||
ProcessTimer: TTimer;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure Button3Click(Sender: TObject);
|
||||
procedure CmdBoxInput(ACmdBox: TCmdBox; Input: String);
|
||||
procedure CbSetCaretChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ProcessTimerTimer(Sender: TObject);
|
||||
procedure ReaderTimerTimer(Sender: TObject);
|
||||
private
|
||||
TextPosition : Integer;
|
||||
DText : TStringList;
|
||||
Rdpw : Boolean;
|
||||
FProcess : Integer;
|
||||
end;
|
||||
|
||||
var WMainForm: TWMainForm;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
{ TWMainForm }
|
||||
|
||||
procedure TWMainForm.ReaderTimerTimer(Sender: TObject);
|
||||
var i:Integer;
|
||||
begin
|
||||
CmdBox.TextColors(clRed,clNavy);
|
||||
for i:=0 to 0 do
|
||||
begin
|
||||
if TextPosition<DText.Count then
|
||||
begin
|
||||
CmdBox.ClearLine;
|
||||
CmdBox.Writeln(DText[TextPosition]);
|
||||
Inc(TextPosition);
|
||||
end;
|
||||
if TextPosition>=DText.Count then
|
||||
begin
|
||||
CmdBox.ClearLine;
|
||||
CmdBox.TextColor(clYellow);
|
||||
CmdBox.Writeln(#27#10#196);
|
||||
TextPosition := 0;
|
||||
ReaderTimer.Enabled := False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
DoubleBuffered := True;
|
||||
DText := TStringList.Create;
|
||||
if FileExists('demotext.txt') then DText.LoadFromFile('demotext.txt');
|
||||
CmdBox.StartRead(clRed,clNavy,'>',clYellow,clNavy);
|
||||
CmdBox.TextColors(clWhite,clNavy);
|
||||
CmdBox.Writeln(#27#218#27#10#191);
|
||||
CmdBox.Writeln(#27#179'Type "help" to see a short list of available commands.'#27#10#179);
|
||||
CmdBox.Writeln(#27#217#27#10#217);
|
||||
end;
|
||||
|
||||
procedure TWMainForm.CmdBoxInput(ACmdBox: TCmdBox; Input: String);
|
||||
var i:Integer;
|
||||
begin
|
||||
if rdpw then
|
||||
begin
|
||||
CmdBox.TextColors(clLime,clBlue);
|
||||
CmdBox.Writeln('Your Secret Password : '+Input);
|
||||
CmdBox.TextColors(clSilver,clNavy);
|
||||
rdpw:=false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
rdpw:=false;
|
||||
Input:=LowerCase(Input);
|
||||
if Input='help' then
|
||||
begin
|
||||
CmdBox.TextColors(clLime,clNavy);
|
||||
CmdBox.Writeln(#27#218#27#197#128#0#27#194#27#10#191);
|
||||
CmdBox.Writeln(#27#179' Command'#27#33#128#0#27#179' Explanation'#27#10#179);
|
||||
CmdBox.Writeln(#27#195#27#197#128#0#27#198#27#10#180);
|
||||
CmdBox.Writeln(#27#179' help'#27#33#128#0#27#179' Gives this list of Commands'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' clear'#27#33#128#0#27#179' Clears the Content of CmdBox'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' start'#27#33#128#0#27#179' Outputs the Content of Demotext.txt from the beginning'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' stop'#27#33#128#0#27#179' Stops output and resets to Start'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' pause'#27#33#128#0#27#179' Interrupts output'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' resume'#27#33#128#0#27#179' Resumes output from the last position'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' clearhistory'#27#33#128#0#27#179' Clears all history entries'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' readpwd'#27#33#128#0#27#179' Read a Password (just as a test)'#27#10#179);
|
||||
CmdBox.Writeln(#27#179' exit'#27#33#128#0#27#179' Exit program'#27#10#179);
|
||||
CmdBox.Writeln(#27#217#27#197#128#0#27#193#27#10#217);
|
||||
CmdBox.TextColor(clSilver);
|
||||
end else
|
||||
if Input='readpwd' then
|
||||
begin
|
||||
rdpw:=true;
|
||||
end else
|
||||
if Input='clearhistory' then
|
||||
begin
|
||||
CmdBox.TextColor(clYellow);
|
||||
CmdBox.Writeln('Clear History...');
|
||||
CmdBox.TextColor(clSilver);
|
||||
CmdBox.ClearHistory;
|
||||
end else
|
||||
if Input='start' then
|
||||
begin
|
||||
TextPosition:=0;
|
||||
ReaderTimer.Enabled:=true;
|
||||
CmdBox.TextColors(clLime,clBlue);
|
||||
CmdBox.Writeln('Start...');
|
||||
end else if Input='stop' then
|
||||
begin
|
||||
TextPosition:=0;
|
||||
ReaderTimer.Enabled:=false;
|
||||
CmdBox.TextColors(clRed,clBlue);
|
||||
CmdBox.Writeln('Stop...');
|
||||
end else if Input='pause' then
|
||||
begin
|
||||
ReaderTimer.Enabled:=false;
|
||||
CmdBox.TextColors(clPurple,clBlue);
|
||||
CmdBox.Writeln('Pause...');
|
||||
end else if Input='resume' then
|
||||
begin
|
||||
ReaderTimer.Enabled:=true;
|
||||
CmdBox.TextColors(clGreen,clBlue);
|
||||
CmdBox.Writeln('Continue...');
|
||||
end else if Input='clear' then
|
||||
begin
|
||||
CmdBox.Clear;
|
||||
end else if Input='exit' then close else
|
||||
begin
|
||||
CmdBox.TextColors(clYellow,ClRed);
|
||||
CmdBox.Writeln('Invalid Command!');
|
||||
end;
|
||||
end;
|
||||
if rdpw then CmdBox.StartReadPassWord(clYellow,clNavy,'Pwd:',clLime,clNavy) else
|
||||
CmdBox.StartRead(clRed,clNavy,'>',clYellow,clNavy);
|
||||
HistoryList.Clear;
|
||||
for i:=0 to CmdBox.HistoryCount-1 do HistoryList.Items.Add(CmdBox.History[i]);
|
||||
end;
|
||||
|
||||
procedure TWMainForm.CbSetCaretChange(Sender: TObject);
|
||||
begin
|
||||
case cbSetCaret.ItemIndex of
|
||||
0:CmdBox.CaretType := cartLine;
|
||||
1:CmdBox.CaretType := cartSubBar;
|
||||
2:CmdBox.CaretType := cartBigBar;
|
||||
end;
|
||||
CmdBox.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.Button2Click(Sender: TObject);
|
||||
begin
|
||||
CmdBox.ClearHistory;
|
||||
HistoryList.Clear;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.Button3Click(Sender: TObject);
|
||||
begin
|
||||
FProcess:=0;
|
||||
ProcessTimer.Enabled:=True;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.Button1Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
DText.Free;
|
||||
end;
|
||||
|
||||
procedure TWMainForm.ProcessTimerTimer(Sender: TObject);
|
||||
begin
|
||||
if FProcess=100 then
|
||||
begin
|
||||
CmdBox.ClearLine;
|
||||
ProcessTimer.Enabled:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CmdBox.TextColors(clRed,clBlue);
|
||||
CmdBox.Write('Processing ['+IntToStr(FProcess)+'%]'#13);
|
||||
end;
|
||||
Inc(FProcess);
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I wnmainform.lrs}
|
||||
|
||||
end.
|
||||
|
||||
|
|
@ -7,7 +7,6 @@ rem This script is called from ..\build.bat.
|
|||
|
||||
pushd components
|
||||
lazbuild chsdet\chsdet.lpk %DC_ARCH%
|
||||
lazbuild CmdLine\cmdbox.lpk %DC_ARCH%
|
||||
lazbuild multithreadprocs\multithreadprocslaz.lpk %DC_ARCH%
|
||||
lazbuild dcpcrypt\dcpcrypt.lpk %DC_ARCH%
|
||||
lazbuild doublecmd\doublecmd_common.lpk %DC_ARCH%
|
||||
|
|
@ -15,4 +14,5 @@ lazbuild KASToolBar\kascomp.lpk %DC_ARCH%
|
|||
lazbuild viewer\viewerpackage.lpk %DC_ARCH%
|
||||
lazbuild gifanim\pkg_gifanim.lpk %DC_ARCH%
|
||||
lazbuild synunihighlighter\synuni.lpk %DC_ARCH%
|
||||
lazbuild virtualterminal\virtualterminal.lpk %DC_ARCH%
|
||||
popd
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ fi
|
|||
basedir=$(pwd)
|
||||
cd components
|
||||
$lazbuild chsdet/chsdet.lpk $DC_ARCH
|
||||
$lazbuild CmdLine/cmdbox.lpk $DC_ARCH
|
||||
$lazbuild multithreadprocs/multithreadprocslaz.lpk $DC_ARCH
|
||||
$lazbuild dcpcrypt/dcpcrypt.lpk $DC_ARCH
|
||||
$lazbuild doublecmd/doublecmd_common.lpk $DC_ARCH
|
||||
|
|
@ -33,6 +32,7 @@ $lazbuild KASToolBar/kascomp.lpk $DC_ARCH
|
|||
$lazbuild viewer/viewerpackage.lpk $DC_ARCH
|
||||
$lazbuild gifanim/pkg_gifanim.lpk $DC_ARCH
|
||||
$lazbuild synunihighlighter/synuni.lpk $DC_ARCH
|
||||
$lazbuild virtualterminal/virtualterminal.lpk $DC_ARCH
|
||||
cd $basedir
|
||||
|
||||
# Remove temporary file
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ const
|
|||
CommonComponents: array[1..9] of String =
|
||||
(
|
||||
'components\chsdet\chsdet.lpk',
|
||||
'components\CmdLine\cmdbox.lpk',
|
||||
'components\multithreadprocs\multithreadprocslaz.lpk',
|
||||
'components\dcpcrypt\dcpcrypt.lpk',
|
||||
'components\doublecmd\doublecmd_common.lpk',
|
||||
'components\KASToolBar\kascomp.lpk',
|
||||
'components\viewer\viewerpackage.lpk',
|
||||
'components\gifanim\pkg_gifanim.lpk',
|
||||
'components\synunihighlighter\synuni.lpk'
|
||||
'components\synunihighlighter\synuni.lpk',
|
||||
'components\virtualterminal\virtualterminal.lpk'
|
||||
);
|
||||
|
||||
CommonPlugins: array[1..8] of String =
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ rem Copy needed files
|
|||
copy windows\doublecmd.iss %BUILD_PACK_DIR%\
|
||||
|
||||
rem Copy libraries
|
||||
copy windows\lib\%CPU_TARGET%\*.dll %BUILD_DC_TMP_DIR%\
|
||||
copy windows\lib\%CPU_TARGET%\*.dll %BUILD_DC_TMP_DIR%\
|
||||
copy windows\lib\%CPU_TARGET%\winpty-agent.exe %BUILD_DC_TMP_DIR%\
|
||||
|
||||
cd /D %BUILD_DC_TMP_DIR%
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ copy multiarc.ini %DC_INSTALL_DIR%\
|
|||
copy pinyin.tbl %DC_INSTALL_DIR%\
|
||||
rem Copy libraries
|
||||
copy *.dll %DC_INSTALL_DIR%\
|
||||
copy winpty-agent.exe %DC_INSTALL_DIR%\
|
||||
|
||||
rem copy plugins
|
||||
rem WCX
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ end;"/>
|
|||
<MinVersion Major="1" Minor="4" Valid="True"/>
|
||||
</Item6>
|
||||
<Item7>
|
||||
<PackageName Value="cmdbox"/>
|
||||
<PackageName Value="VirtualTerminal"/>
|
||||
</Item7>
|
||||
<Item8>
|
||||
<PackageName Value="KASComp"/>
|
||||
|
|
|
|||
|
|
@ -473,7 +473,9 @@ object frmMain: TfrmMain
|
|||
Align = alBottom
|
||||
AutoSnap = False
|
||||
OnCanResize = ConsoleSplitterCanResize
|
||||
OnMoved = ConsoleSplitterMoved
|
||||
ResizeAnchor = akBottom
|
||||
ResizeStyle = rsLine
|
||||
Visible = False
|
||||
end
|
||||
object pnlCommand: TPanel
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ interface
|
|||
uses
|
||||
ufavoritetabs, Graphics, Forms, Menus, Controls, StdCtrls, ExtCtrls, ActnList,
|
||||
Buttons, SysUtils, Classes, SynEdit, LCLType, ComCtrls, LResources,
|
||||
KASToolBar, KASComboBox, uCmdBox, uFilePanelSelect, uBriefFileView,
|
||||
KASToolBar, KASComboBox, uFilePanelSelect, uBriefFileView, VTEmuCtl, VTEmuPty,
|
||||
uFileView, uFileSource, uFileViewNotebook, uFile, LCLVersion, KASToolPanel,
|
||||
uOperationsManager, uFileSourceOperation, uDrivesList, uTerminal, DCClassesUtf8,
|
||||
uOperationsManager, uFileSourceOperation, uDrivesList, DCClassesUtf8,
|
||||
DCXmlConfig, uDrive, uDriveWatcher, uDCVersion, uMainCommands, uFormCommands,
|
||||
uOperationsPanel, KASToolItems, uKASToolItemsExtended, uCmdLineParams, uOSForms
|
||||
{$IF DEFINED(LCLQT)}
|
||||
|
|
@ -561,6 +561,7 @@ type
|
|||
{%H-}MousePos: TPoint; var {%H-}Handled: Boolean);
|
||||
procedure btnF8MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
{%H-}Shift: TShiftState; X, Y: Integer);
|
||||
procedure ConsoleSplitterMoved(Sender: TObject);
|
||||
procedure dskToolButtonMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure FormKeyUp( Sender: TObject; var {%H-}Key: Word; Shift: TShiftState) ;
|
||||
|
|
@ -678,7 +679,6 @@ type
|
|||
procedure OnUniqueInstanceMessage(Sender: TObject; Params: TCommandLineParams);
|
||||
procedure tbPasteClick(Sender: TObject);
|
||||
procedure AllProgressOnUpdateTimer(Sender: TObject);
|
||||
procedure OnCmdBoxInput(ACmdBox: TCmdBox; AInput: String);
|
||||
{$IF (DEFINED(LCLQT) or DEFINED(LCLQT5)) and not DEFINED(MSWINDOWS)}
|
||||
private
|
||||
QEventHook: QObject_hookH;
|
||||
|
|
@ -696,7 +696,7 @@ type
|
|||
HiddenToTray: Boolean;
|
||||
HidingTrayIcon: Boolean; // @true if the icon is in the process of hiding
|
||||
nbLeft, nbRight: TFileViewNotebook;
|
||||
cmdConsole: TCmdBox;
|
||||
cmdConsole: TVirtualTerminal;
|
||||
FCommands: TMainCommands;
|
||||
FInitializedView: Boolean;
|
||||
{en
|
||||
|
|
@ -909,7 +909,7 @@ type
|
|||
|
||||
var
|
||||
frmMain: TfrmMain;
|
||||
Cons: TConsoleThread = nil;
|
||||
Cons: TCustomPtyDevice = nil;
|
||||
|
||||
implementation
|
||||
|
||||
|
|
@ -1239,6 +1239,11 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ConsoleSplitterMoved(Sender: TObject);
|
||||
begin
|
||||
nbConsole.Height := nbConsole.Height + nbConsole.Tag - pnlCommand.Height;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.dskToolButtonMouseDown(Sender: TObject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
|
|
@ -1347,7 +1352,7 @@ begin
|
|||
// ConsoleSplitter is trying to resize pnlCommand,
|
||||
// so NewSize is the new size of pnlCommand.
|
||||
// Instead, resize nbConsole by the same difference.
|
||||
nbConsole.Height := nbConsole.Height + NewSize - pnlCommand.Height;
|
||||
nbConsole.Tag := NewSize;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ConvertToolbarBarConfig(BarFileName: String);
|
||||
|
|
@ -4625,7 +4630,7 @@ begin
|
|||
if (fspDirectAccess in FileView.FileSource.GetProperties) then
|
||||
begin
|
||||
if gTermWindow and Assigned(Cons) then
|
||||
Cons.Terminal.SetCurrentDir(FileView.CurrentPath);
|
||||
Cons.SetCurrentDir(FileView.CurrentPath);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -5117,48 +5122,23 @@ begin
|
|||
end; // if Destination<>tclNone then
|
||||
end;
|
||||
|
||||
procedure TfrmMain.OnCmdBoxInput(ACmdBox: TCmdBox; AInput: String);
|
||||
begin
|
||||
Cons.Terminal.Write_pty(AInput + LineEnding);
|
||||
ACmdBox.StartRead(clWhite, clBlack, ACmdBox.Hint, clWhite, clBlack);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ToggleConsole;
|
||||
begin
|
||||
if gTermWindow then
|
||||
begin
|
||||
if not Assigned(cmdConsole) then
|
||||
begin
|
||||
cmdConsole:= TCmdBox.Create(pgConsole);
|
||||
cmdConsole:= TVirtualTerminal.Create(pgConsole);
|
||||
cmdConsole.Parent:= pgConsole;
|
||||
cmdConsole.Align:= alClient;
|
||||
cmdConsole.AutoFollow:= True;
|
||||
cmdConsole.LineCount:= 256;
|
||||
cmdConsole.ShowHint:= False;
|
||||
cmdConsole.CaretType:= cartSubBar;
|
||||
cmdConsole.OnInput:= @OnCmdBoxInput;
|
||||
ShowScrollBar(cmdConsole.Handle, SB_Horz, False);
|
||||
cmdConsole.Hint:= Format(fmtCommandPath, [GetComputerNetName]);
|
||||
end;
|
||||
FontOptionsToFont(gFonts[dcfConsole], cmdConsole.Font); //We set the font here because if we're coming back from configuration the font in options, we'll later pass here to affect that font if ever displayed.
|
||||
if gCmdLine then
|
||||
begin
|
||||
cmdConsole.Tag := 0;
|
||||
cmdConsole.StopRead;
|
||||
end
|
||||
else if cmdConsole.Tag = 0 then
|
||||
begin
|
||||
cmdConsole.Tag := MaxInt;
|
||||
cmdConsole.Writeln(EmptyStr);
|
||||
cmdConsole.StartRead(clWhite, clBlack, cmdConsole.Hint, clWhite, clBlack);
|
||||
end;
|
||||
if not Assigned(Cons) then
|
||||
begin
|
||||
Cons:= CreateConsoleThread;
|
||||
Cons.ColsCount:= 80;
|
||||
Cons.RowsCount:= cmdConsole.LineCount;
|
||||
Cons.CmdBox:= cmdConsole;
|
||||
Cons.Start;
|
||||
Cons:= TPtyDevice.Create(Self);
|
||||
cmdConsole.PtyDevice:= Cons;
|
||||
Cons.Connected:= True;
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
|
@ -5570,8 +5550,10 @@ begin
|
|||
|
||||
VK_PAUSE:
|
||||
begin
|
||||
{
|
||||
if gTermWindow and Assigned(Cons) then
|
||||
Cons.Terminal.SendBreak_pty();
|
||||
}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -5821,7 +5803,7 @@ begin
|
|||
if SameText(ExcludeBackPathDelimiter(ActiveFrame.CurrentPath), sDir) then
|
||||
begin
|
||||
if gTermWindow and Assigned(Cons) then
|
||||
Cons.Terminal.SetCurrentDir(sDir);
|
||||
Cons.SetCurrentDir(sDir);
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
|
@ -5849,7 +5831,7 @@ begin
|
|||
if gTermWindow and Assigned(Cons) then
|
||||
begin
|
||||
sCmd:= ReplaceEnvVars(sCmd);
|
||||
Cons.Terminal.Write_pty(sCmd + sLineBreak)
|
||||
Cons.WriteStr(sCmd + sLineBreak)
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
@ -6543,7 +6525,7 @@ begin
|
|||
if (fspDirectAccess in ActiveFrame.FileSource.GetProperties) then
|
||||
begin
|
||||
if gTermWindow and Assigned(Cons) then
|
||||
Cons.Terminal.SetCurrentDir(ActiveFrame.CurrentPath);
|
||||
Cons.SetCurrentDir(ActiveFrame.CurrentPath);
|
||||
end;
|
||||
|
||||
edtCommand.Visible := True;
|
||||
|
|
|
|||
|
|
@ -1,614 +0,0 @@
|
|||
{
|
||||
Double Commander
|
||||
-------------------------------------------------------------------------
|
||||
Terminal emulator implementation.
|
||||
|
||||
Copyright (C) 2008 Dmitry Kolomiets (B4rr4cuda@rambler.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
}
|
||||
|
||||
unit uUnixTerm;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, BaseUnix,
|
||||
ExtCtrls, LCLProc, cwstring,
|
||||
LCLType, Graphics, termio, uTerminal, uOSUtils;
|
||||
|
||||
{$IF NOT DEFINED(DARWIN)}
|
||||
{$LINKLIB util} // under Linux and BSD forkpty is situated in libutil.so library
|
||||
{$ENDIF}
|
||||
|
||||
const clib = 'c';
|
||||
C_stdin = 0;
|
||||
C_stdout = 1;
|
||||
C_stderr = 2;
|
||||
|
||||
|
||||
const
|
||||
{c_cc characters}
|
||||
CDISABLE = 255;
|
||||
|
||||
//key // xterm default bindings
|
||||
CINTR = 003; // ^C
|
||||
CQUIT = 034; // ^\
|
||||
CERASE = 177; // ^?
|
||||
CKILL = 025; // ^U
|
||||
CEOF = 004; // ^D
|
||||
CSTART = 021; // ^Q
|
||||
CSTOP = 023; // ^S
|
||||
CSUSP = 032; // ^Z
|
||||
CREPRINT = 022; // ^R
|
||||
CWERASE = 027; // ^W
|
||||
CLNEXT = 026; // ^V
|
||||
CDISCARD = 017; // ^O
|
||||
|
||||
//disabled
|
||||
CTIME = 0;
|
||||
CMIN = 1;
|
||||
CSWTC = CDISABLE;
|
||||
CEOL = CDISABLE;
|
||||
CEOL2 = CDISABLE;
|
||||
|
||||
|
||||
|
||||
const CSIList=
|
||||
'@'+ // Вставить N пустых символов.
|
||||
'A'+ //Переместить курсор вверх на N рядов.
|
||||
'B'+ //Переместить курсор вниз на N рядов.
|
||||
'C'+ //Переместить курсор вправо на N столбцов.
|
||||
'D'+ //Переместить курсор влево на N столбцов.
|
||||
'E'+ //Переместить курсор вниз на N рядов, в столбец #1.
|
||||
'F'+ //Переместить курсор вверх на N рядов, в столбец #1.
|
||||
'G'+ //Переместить курсор в указанный столбец текущего ряда.
|
||||
'H'+ //Переместить курсор в указанный ряд и столбец (начало в 1,1).
|
||||
'J'+ //"Очистить" экран (по умолчанию от курсора до конца экрана). ESC [ 1 J: "очистить" от начала столбца до курсора. ESC [ 2 J: "очистить" весь экран.
|
||||
'K'+ //"Очистить" строку (по умолчанию от курсора до ее конца). ESC [ 1 K: "очистить" от начала строки до курсора. ESC [ 2 K: "очистить" всю строку.
|
||||
'L'+ //Вставить N пустых строк.
|
||||
'M'+ //Удалить N строк.
|
||||
'P'+ //Удалить (со смещением в строке) N символов в текущей строке.
|
||||
'X'+ //"Очистить" (без смещения в строке) N символов в текущей строке.
|
||||
'a'+ //Переместить курсор вправо на N столбцов.
|
||||
'c'+ //Ответить ESC [ ? 6 c: `Я являюсь VT102'.
|
||||
'd'+ //Переместить курсор в указанный ряд текущего столбца.
|
||||
'e'+ //Переместить курсор вниз на N рядов.
|
||||
'f'+ //Переместить курсор в указанный ряд и столбец.
|
||||
'g'+ //Без параметров: "очистить" текущую позицию табуляции. ESC [ 3 g: удалить все позиции табуляции.
|
||||
'h'+ //Режим установки
|
||||
'l'+ //Режим сброса
|
||||
'm'+ //Установка атрибутов
|
||||
'n'+ //Отчет о статусе
|
||||
'q'+ //Установить режимы работы индикаторов на клавиатуре. ESC [ 0 q: выключить все индикаторы ESC [ 1 q: включить индикатор "Scroll Lock" ESC [ 2 q: включить индикатор "Num Lock" ESC [ 3 q: включить индикатор "Caps Lock"
|
||||
'r'+ //Установить область прокрутки; параметрами будут верхний и нижний ряды.
|
||||
's'+ //Сохранить местоположение курсора.
|
||||
'u'; //Восстановить местоположение курсора.
|
||||
//'`'+ //Переместить курсор в указанный столбец текущего ряда.
|
||||
|
||||
|
||||
|
||||
const
|
||||
NCCS = 32;
|
||||
|
||||
type
|
||||
|
||||
Pwinsize = ^winsize;
|
||||
winsize = record
|
||||
ws_row : word;
|
||||
ws_col : word;
|
||||
ws_xpixel : word;
|
||||
ws_ypixel : word;
|
||||
end;
|
||||
|
||||
|
||||
__pid_t = longint;
|
||||
|
||||
Pcc_t = ^cc_t;
|
||||
cc_t = char;
|
||||
|
||||
Pspeed_t = ^speed_t;
|
||||
speed_t = dword;
|
||||
|
||||
Ptcflag_t = ^tcflag_t;
|
||||
tcflag_t = dword;
|
||||
|
||||
Ptermios = ^termios;
|
||||
termios = record
|
||||
c_iflag : tcflag_t;
|
||||
c_oflag : tcflag_t;
|
||||
c_cflag : tcflag_t;
|
||||
c_lflag : tcflag_t;
|
||||
c_line : cc_t;
|
||||
c_cc : array[0..(NCCS)-1] of cc_t;
|
||||
c_ispeed : speed_t;
|
||||
c_ospeed : speed_t;
|
||||
end;
|
||||
|
||||
type
|
||||
{ TUnixTerm }
|
||||
|
||||
TUnixTerm = class(TTerminal)
|
||||
private
|
||||
FCols,Frows:integer;
|
||||
//---------------------
|
||||
//---------------------
|
||||
public
|
||||
//---------------------
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
{ \\---------------------}
|
||||
function Read_Pty(var str:String; const timeout: longint=10): longint; override; // Read info from pty
|
||||
function Fork_pty(const rows,cols:integer; const cmd:String; const params:String=''):System.THandle; override; //Create new pty and start cmd
|
||||
function Write_pty(const str:String):boolean; override; //write str to pty
|
||||
//---------------------
|
||||
function SendBreak_pty():boolean; override; // ^C
|
||||
function SendSignal_pty(Sig:Cint):boolean; override;
|
||||
function SetScreenSize(aCols,aRows:integer):boolean; override;
|
||||
function SetCurrentDir(const NewDir: String): Boolean; override;
|
||||
//---------------------
|
||||
function KillShell:LongInt; override;
|
||||
function CSI_GetTaskId(const buf:String):integer; override; //get index of sequence in CSILast list
|
||||
end;
|
||||
|
||||
{ TConThread }
|
||||
|
||||
TUnixConThread = class(TConsoleThread)
|
||||
private
|
||||
procedure AddSymbol;
|
||||
procedure CSIProc(NCode, Param: integer; ExParam: integer=0);
|
||||
procedure CSI_CaretTo(Y, X: integer);
|
||||
procedure CSI_Colors(const Param: integer);
|
||||
procedure WriteS(const s: String);
|
||||
protected
|
||||
procedure Execute; override;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
function forkpty(__amaster:Plongint; __name:Pchar; __termp:Ptermios; __winp:Pwinsize):longint;cdecl;external clib name 'forkpty';
|
||||
function setenv(__name:Pchar; __value:Pchar; __replace:longint):longint;cdecl;external clib name 'setenv';
|
||||
function execl(__path:Pchar; __arg:Pchar):longint;cdecl;varargs;external clib name 'execl';
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
DCUnix, uDebug;
|
||||
|
||||
{ TUnixConThread }
|
||||
|
||||
procedure TUnixConThread.WriteS(const s:String);
|
||||
begin
|
||||
if not assigned(FOut) then exit;
|
||||
//Form1.CmdBox1.StopRead;
|
||||
FOut.Write(s);
|
||||
//Form1.CmdBox1.StartRead(clWhite,clBlack,'',clWhite,clBlack);
|
||||
end;
|
||||
|
||||
|
||||
procedure TUnixConThread.CSI_Colors(const Param:integer);
|
||||
begin
|
||||
if not assigned(FOut) then exit;
|
||||
with FOut do
|
||||
begin
|
||||
case Param of
|
||||
0: TextColors(clWhite,clBlack);// сбросить все атрибуты в их значения по умолчанию
|
||||
1: ;// установить жирный шрифт
|
||||
2: ;// установить более яркий (имитированное цветом на цветном дисплее)
|
||||
4: ;// установить подчеркивание (имитированное цветом на цветном дисплее);
|
||||
//цвета, используемые для имитации затемнения или подчеркивания, устанавливаются
|
||||
//при помощи ESC ] ...
|
||||
5: ;// включить мерцание
|
||||
7: ;// включить режим инвертированного видео
|
||||
10: ;// сбросить выбранное распределение, флаги управления экраном
|
||||
//и переключить метафлаг
|
||||
11: ;// выбрать null-распределение, установить флаг управления экраном,
|
||||
//сбросить переключатель метафлага.
|
||||
12: ;// выбрать null-распределение, установить флаг управления экраном,
|
||||
//включить переключатель метафлага. Переключение метафлага
|
||||
//задает переключение старшего бита в байте
|
||||
//до его трансформации согласно таблице распределения.
|
||||
21: ;// включить режим нормальной интенсивности (несовместимо с ECMA-48)
|
||||
22: ;// выключить режим нормальной интенсивности
|
||||
24: ;// выключить подчеркивание
|
||||
25: ;// выключить мерцание
|
||||
27: ;// выключить инвертированное видео
|
||||
30:TextColor(clGray) ;// установить черный цвет символов
|
||||
31:TextColor(clRed) ;// установить красный цвет символов
|
||||
32:TextColor($0024F947) ;// установить зеленый цвет символов
|
||||
33:TextColor($003A85CF) ;// установить коричневый цвет символов
|
||||
34:TextColor(clBlue) ;// установить синий цвет символов
|
||||
35:TextColor(clPurple) ;// установить сиреневый цвет символов
|
||||
36:TextColor(clSkyBlue) ;// установить голубой цвет символов
|
||||
37:TextColor(clWhite);// установить белый цвет символов
|
||||
38:TextColor(clWhite);// включить подчеркивание, установить цвет символов по умолчанию
|
||||
39:TextColor(clWhite) ;// выключить подчеркивание, установить цвет символов по умолчанию
|
||||
40:TextBackground(clBlack) ;// установить черный цвет фона
|
||||
41:TextBackground(clRed) ;// установить красный цвет фона
|
||||
42:TextBackground(clGreen) ;// установить зеленый цвет фона
|
||||
43:TextBackground(clRed) ;// установить коричневый цвет фона
|
||||
44:TextBackground(clBlue) ;// установить синий цвет фона
|
||||
45:TextBackground(clPurple) ;// установить сиреневый цвет фона
|
||||
46:TextBackground(clSkyBlue) ;// установить голубой цвет фона
|
||||
47:TextBackground(clWhite) ;// установить белый цвет фона
|
||||
49:TextBackground(clBlack) ;// установить цвет фона по умолчанию
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TUnixConThread.CSI_CaretTo(Y,X:integer); //хз x y или y x. Надо проверить.
|
||||
begin
|
||||
DCDebug(' Y: '+inttostr(Y)+' X: '+inttostr(X));
|
||||
//Fout.OutY:=Y;
|
||||
//Fout.OutX:=X;
|
||||
end;
|
||||
|
||||
procedure TUnixConThread.CSIProc(NCode, Param:integer; ExParam:integer=0);
|
||||
begin
|
||||
//DCDebug('Code:'+Inttostr(NCode)+' Param: '+inttostr(Param));
|
||||
case NCode of
|
||||
9:CSI_CaretTo(Param,ExParam);
|
||||
24:CSI_Colors(Param);
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TUnixConThread.Create;
|
||||
begin
|
||||
inherited Create(true);
|
||||
System.InitCriticalSection(FLock);
|
||||
Fterm:=TUnixTerm.Create;
|
||||
FRowsCount:=50;
|
||||
FColsCount:=100;
|
||||
end;
|
||||
|
||||
destructor TUnixConThread.Destroy;
|
||||
begin
|
||||
FreeAndNil(fTerm);
|
||||
System.DoneCriticalSection(FLock);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
||||
procedure TUnixConThread.Execute;
|
||||
begin
|
||||
FShell:=GetShell;
|
||||
if length(FShell)=0 then FShell:='/bin/bash';
|
||||
if Assigned(fterm) then Fterm.Fork_pty(FRowsCount,FColsCount,FShell);
|
||||
while true do
|
||||
begin
|
||||
if Assigned(fterm) then
|
||||
begin
|
||||
if Fterm.Read_Pty(fbuf,0)>0 then
|
||||
Synchronize(@AddSymbol)
|
||||
else
|
||||
Sleep(1);
|
||||
end else break;
|
||||
end;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
procedure TUnixConThread.AddSymbol;
|
||||
var SeqCode,SeqPrm,i,x:integer;
|
||||
es,s:String;
|
||||
esnow,CSINow:boolean;
|
||||
begin
|
||||
|
||||
s:='';
|
||||
es:='';
|
||||
esnow:=false;
|
||||
CSInow:=false;
|
||||
|
||||
for i:=1 to length(fbuf) do
|
||||
begin
|
||||
//разбор
|
||||
//------------------------------------------------------
|
||||
if esnow then
|
||||
begin
|
||||
//------------------------------------------------------
|
||||
if CSINow then
|
||||
begin
|
||||
//Пытаемся определить управляющий символ CSI последовательности
|
||||
SeqCode:=(fTerm.CSI_GetTaskId(es));
|
||||
if SeqCode>0 then
|
||||
begin
|
||||
//разбор управляющей последовательности.
|
||||
//------------------------------------------------------
|
||||
WriteS(s);
|
||||
s:='';
|
||||
delete(es,1,1);
|
||||
delete(es,length(es),1);
|
||||
x:=pos(';',es);
|
||||
while x>0 do
|
||||
begin
|
||||
if tryStrToInt(copy(es,1,x-1),SeqPrm) then
|
||||
begin
|
||||
CSIProc(SeqCode,SeqPrm);
|
||||
delete(es,1,x);
|
||||
x:=pos(';',es);
|
||||
end
|
||||
else
|
||||
begin
|
||||
WriteS(copy(es,1,x-1));
|
||||
delete(es,1,x);
|
||||
x:=pos(';',es);
|
||||
end;
|
||||
end;
|
||||
if es<>'' then
|
||||
begin
|
||||
if tryStrToInt(es,SeqPrm) then
|
||||
CSIProc(SeqCode,SeqPrm)
|
||||
else
|
||||
WriteS(es);
|
||||
end;
|
||||
//------------------------------------------------------
|
||||
|
||||
es:='';
|
||||
esnow:=false;
|
||||
CSINow:=False;
|
||||
end
|
||||
else
|
||||
es:=es+fbuf[i];
|
||||
end
|
||||
else
|
||||
es:=es+fbuf[i];
|
||||
//------------------------------------------------------
|
||||
end;
|
||||
|
||||
//Начало управляющей последовательности
|
||||
if (fbuf[i]=#155) or ((fbuf[i]=#27)) then
|
||||
begin
|
||||
esnow:=true;
|
||||
//Начало CSI последовательности
|
||||
if (i<length(fbuf)) and (fbuf[i+1]='[') then
|
||||
CSINow:=true;
|
||||
end;
|
||||
|
||||
|
||||
//выбор чарсета. Неактуально....
|
||||
if fbuf[i]='%' then
|
||||
continue;
|
||||
|
||||
//удалить последний символ
|
||||
if fbuf[i]=#8 then
|
||||
s:=copy(s,1,length(s)-1);
|
||||
|
||||
//simple text or control symbols (Nither CSI nor escape sequenses)
|
||||
if (esnow=false) and ((fbuf[i]>#31) or (fbuf[i]=#13) or (fbuf[i]=#10)) then
|
||||
begin
|
||||
if fbuf[i]=#10 then
|
||||
begin
|
||||
if s<>'' then
|
||||
if Assigned(FOut) then
|
||||
FOut.Write(s+#10);
|
||||
s:='';
|
||||
|
||||
continue;
|
||||
end;
|
||||
if (fbuf[i]=#13) then
|
||||
if Assigned(FOut) then FOut.Write(#13);
|
||||
|
||||
s:=s+fbuf[i];
|
||||
end;
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
end;
|
||||
|
||||
|
||||
if s<>'' then
|
||||
begin
|
||||
if Assigned(FOut) then FOut.Write(s);
|
||||
end;
|
||||
|
||||
end;
|
||||
//------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
{ TUnixTerm }
|
||||
|
||||
function TUnixTerm.CSI_GetTaskId(const buf:String):integer;
|
||||
var Rez,L,R,M:integer;
|
||||
begin
|
||||
result:=0;
|
||||
if buf='' then exit;
|
||||
|
||||
if buf[length(buf)]='`' then
|
||||
begin
|
||||
result:=length(CSIList)+1;
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
||||
//бинарный поиск
|
||||
L:=0;
|
||||
R:=Length(CSIList);
|
||||
while (L<=R) do
|
||||
begin
|
||||
M:=(L+R) div 2;
|
||||
Rez:=CompareChar(CSIList[M],buf[length(buf)],1);
|
||||
if Rez=0 then
|
||||
begin
|
||||
Result:=M;
|
||||
exit;
|
||||
end
|
||||
else
|
||||
if Rez<0 then
|
||||
L:=M+1
|
||||
else
|
||||
R:=M-1;
|
||||
end;
|
||||
|
||||
result:=0;
|
||||
end;
|
||||
|
||||
function TUnixTerm.Fork_pty(const rows, cols: integer; const cmd:String; const params:String=''): System.THandle;
|
||||
var ws:TWinSize;
|
||||
ChildPid:System.THandle;
|
||||
begin
|
||||
FCols:=cols;
|
||||
Frows:=rows;
|
||||
ws.ws_row:=rows;
|
||||
ws.ws_col:=cols;
|
||||
ws.ws_xpixel:=0;
|
||||
ws.ws_ypixel:=0;
|
||||
ChildPid:=forkpty(@Fpty,nil,nil,@ws);
|
||||
|
||||
if ChildPid<0 then
|
||||
begin
|
||||
Result:=-1;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if ChildPid=0 then
|
||||
begin
|
||||
//Child
|
||||
FileCloseOnExecAll;
|
||||
setenv('TERM', 'linux', 1);
|
||||
execl(pchar(cmd), pchar(params), nil);
|
||||
|
||||
//если execl не сработал и новый процесс не подменил форкнутый, то ошибка
|
||||
fpWrite(C_stderr, pchar('execl() failed. Command: '+ cmd),length('execl() failed. Command: '+ cmd));
|
||||
fpExit(127); // error exec'ing
|
||||
end;
|
||||
FChildPid:=ChildPid;
|
||||
Result:=ChildPid;
|
||||
end;
|
||||
|
||||
|
||||
function TUnixTerm.Read_Pty(var str:String; const timeout:longint=10):longint;
|
||||
var ifs:TFdSet;
|
||||
BytesRead:longint;
|
||||
buf:array [0..512] of char;
|
||||
begin
|
||||
|
||||
Result:=0;
|
||||
if Fpty<0 then exit;
|
||||
//check if pty has new info for us
|
||||
fpFD_ZERO(ifs);
|
||||
fpFD_SET(Fpty,ifs);
|
||||
if FPSelect(fpty+1,@ifs,nil,nil,timeout)<=0 then exit;
|
||||
bytesread := fpread(fpty, buf, 512);
|
||||
|
||||
result:=bytesread;
|
||||
str:='';
|
||||
if bytesread <= 0 then exit;
|
||||
str:=copy(buf,0,BytesRead);
|
||||
end;
|
||||
|
||||
function TUnixTerm.Write_pty(const str: String): boolean;
|
||||
var BytesWritten:TSize; i:integer;
|
||||
begin
|
||||
i:=1;
|
||||
result:=true;
|
||||
while i<=length(str) do
|
||||
begin
|
||||
BytesWritten:=fpwrite(Fpty,str[i],length(str[i]));
|
||||
result:=result and (BytesWritten>0);
|
||||
i:=i+1;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TUnixTerm.SendBreak_pty(): boolean;
|
||||
begin
|
||||
result:=SendSignal_pty(CINTR);
|
||||
end;
|
||||
|
||||
function TUnixTerm.SendSignal_pty(Sig: Cint): boolean;
|
||||
var BytesWritten:TSize;
|
||||
begin
|
||||
BytesWritten:=fpwrite(Fpty,Sig,sizeof(sig));
|
||||
Result := (BytesWritten>0);
|
||||
end;
|
||||
|
||||
function TUnixTerm.SetScreenSize(aCols, aRows: integer): boolean;
|
||||
var ws:TWinSize;
|
||||
begin
|
||||
ws.ws_row:=aRows;
|
||||
ws.ws_col:=aCols;
|
||||
ws.ws_xpixel:=0;
|
||||
ws.ws_ypixel:=0;
|
||||
|
||||
if FpIOCtl(Fpty,TIOCSWINSZ,@ws)=0 then
|
||||
begin
|
||||
Result:=true;
|
||||
FCols:=aCols;
|
||||
Frows:=aRows;
|
||||
end
|
||||
else Result:=false;
|
||||
end;
|
||||
|
||||
function TUnixTerm.SetCurrentDir(const NewDir: String): Boolean;
|
||||
begin
|
||||
Result:= Write_pty(' cd "' + NewDir + '"' + #13);
|
||||
end;
|
||||
|
||||
function TUnixTerm.KillShell: LongInt;
|
||||
begin
|
||||
//FchildPid must be >0 in other case all processes in this group will be killed
|
||||
if FChildPid>0 then
|
||||
result:=fpkill(FChildPid,SIGKILL)
|
||||
else
|
||||
result:=-1;
|
||||
end;
|
||||
|
||||
constructor TUnixTerm.Create;
|
||||
var tio:termio.termios;
|
||||
begin
|
||||
TCGetAttr(Fpty,tio);
|
||||
tio.c_iflag:=BRKINT or IGNPAR or ICRNL or IXON;
|
||||
tio.c_oflag:=OPOST or ONLCR;
|
||||
tio.c_cflag:=CS8 or CREAD;
|
||||
tio.c_lflag:=ISIG or ICANON or IEXTEN or ECHO or ECHOE or ECHOK or ECHOKE or ECHOCTL;
|
||||
|
||||
tio.c_cc[VINTR]:=CINTR;
|
||||
tio.c_cc[VQUIT]:=CQUIT;
|
||||
tio.c_cc[VERASE]:=CERASE;
|
||||
tio.c_cc[VKILL]:=CKILL;
|
||||
tio.c_cc[VSTART]:=CSTART;
|
||||
tio.c_cc[VSTOP]:=CSTOP;
|
||||
tio.c_cc[VSUSP]:=CSUSP;
|
||||
tio.c_cc[VREPRINT]:=CREPRINT;
|
||||
tio.c_cc[VDISCARD]:=CDISCARD;
|
||||
tio.c_cc[VWERASE]:=CWERASE;
|
||||
tio.c_cc[VLNEXT]:=CLNEXT;
|
||||
tio.c_cc[VEOF]:=CEOF;
|
||||
tio.c_cc[VEOL]:=CEOL;
|
||||
tio.c_cc[VEOL2]:=CEOL2;
|
||||
{$IF DEFINED(LINUX)}
|
||||
tio.c_cc[VSWTC]:=CSWTC;
|
||||
{$ENDIF}
|
||||
tio.c_cc[VMIN]:=CMIN;
|
||||
tio.c_cc[VTIME]:=CTIME;
|
||||
|
||||
TCSetAttr(Fpty,TCSANOW,tio);
|
||||
end;
|
||||
|
||||
destructor TUnixTerm.Destroy;
|
||||
begin
|
||||
KillShell;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
end.
|
||||
{// thr.Terminal.Write_pty(#27+'[21~'); //F10
|
||||
// thr.Terminal.Write_pty(#27+'[D'); //Left
|
||||
// thr.Terminal.Write_pty(#27+'[3~'); //delete
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
{
|
||||
Double Commander
|
||||
-------------------------------------------------------------------------
|
||||
Terminal emulator abstract class
|
||||
|
||||
Copyright (C) 2009-2010 Koblov Alexander (Alexx2000@mail.ru)
|
||||
|
||||
Based on terminal emulator implementation
|
||||
Copyright (C) 2008 Dmitry Kolomiets (B4rr4cuda@rambler.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit uTerminal;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, uCmdBox;
|
||||
|
||||
type
|
||||
Cint = Integer;
|
||||
|
||||
{ TTerminal }
|
||||
|
||||
TTerminal = class
|
||||
protected
|
||||
FChildPid: THandle;
|
||||
Fpty: LongInt;
|
||||
public
|
||||
{en
|
||||
Read info from pty
|
||||
}
|
||||
function Read_pty(var Output: String; const TimeOut: LongInt = 10): LongInt; virtual; abstract;
|
||||
{en
|
||||
Create new pty and start cmd
|
||||
}
|
||||
function Fork_pty(const RowCount, ColCount: Integer; const Command: String; const Params: String = ''): THandle; virtual; abstract;
|
||||
{en
|
||||
Write string to pty
|
||||
}
|
||||
function Write_pty(const Input: String): Boolean; virtual; abstract;
|
||||
//---------------------
|
||||
function SendBreak_pty(): Boolean; virtual; abstract; // ^C
|
||||
function SendSignal_pty(Sig: Cint): Boolean; virtual; abstract;
|
||||
function SetScreenSize(ColCount, RowCount: Integer): Boolean; virtual; abstract;
|
||||
function SetCurrentDir(const NewDir: String): Boolean; virtual; abstract;
|
||||
//---------------------
|
||||
function KillShell: LongInt; virtual; abstract;
|
||||
function CSI_GetTaskId(const buf:String):integer; virtual; abstract; //get index of sequence in CSILast list
|
||||
//---------------------}
|
||||
property ShellPid: THandle read FChildPid;
|
||||
property PtyPid: LongInt read Fpty;
|
||||
end;
|
||||
|
||||
{ TConsoleThread }
|
||||
|
||||
TConsoleThread = class(TThread)
|
||||
protected
|
||||
FLock: System.TRTLCriticalSection;
|
||||
FTerm: TTerminal;
|
||||
FBuf: String;
|
||||
FRowsCount,
|
||||
FColsCount: Integer;
|
||||
FOut: TCmdBox;
|
||||
FShell: String;
|
||||
public
|
||||
property Terminal: TTerminal read FTerm;
|
||||
property RowsCount: Integer read FRowsCount write FRowsCount;
|
||||
property ColsCount: Integer read FColsCount write FColsCount;
|
||||
property CmdBox: TCmdBox read FOut write FOut;
|
||||
property Shell: String read FShell write FShell;
|
||||
end;
|
||||
|
||||
function CreateConsoleThread: TConsoleThread;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
{$IF DEFINED(WINDOWS)}
|
||||
uWinTerm;
|
||||
{$ELSEIF DEFINED(UNIX)}
|
||||
uUnixTerm;
|
||||
{$ENDIF}
|
||||
|
||||
function CreateConsoleThread: TConsoleThread;
|
||||
{$IF DEFINED(WINDOWS)}
|
||||
begin
|
||||
Result:= TWinConThread.Create;
|
||||
end;
|
||||
{$ELSEIF DEFINED(UNIX)}
|
||||
begin
|
||||
Result:= TUnixConThread.Create;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
||||
|
|
@ -1,290 +0,0 @@
|
|||
{
|
||||
Double Commander
|
||||
-------------------------------------------------------------------------
|
||||
Terminal emulator implementation for Windows
|
||||
|
||||
Copyright (C) 2009-2010 Koblov Alexander (Alexx2000@mail.ru)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
}
|
||||
|
||||
unit uWinTerm;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Windows, uTerminal;
|
||||
|
||||
{$IF FPC_FULLVERSION < 30000}
|
||||
type
|
||||
TStartupInfoW = TStartupInfo;
|
||||
{$ENDIF}
|
||||
|
||||
type
|
||||
|
||||
{ TWinTerm }
|
||||
|
||||
TWinTerm = class(TTerminal)
|
||||
private
|
||||
FConsoleWindow: HWND;
|
||||
FSecurityAttributes: TSecurityAttributes;
|
||||
FStartupInfo: TStartupInfoW;
|
||||
FProcessInformation: TProcessInformation;
|
||||
PipeStdInRead,
|
||||
PipeStdInWrite,
|
||||
PipeStdOutRead,
|
||||
PipeStdOutWrite: THandle;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
//---------------------
|
||||
function Read_Pty(var Output: String; const TimeOut: LongInt = 10): LongInt; override; // Read info from pty
|
||||
function Fork_pty(const RowCount, ColCount: Integer; const Command: String; const Params: String=''): THandle; override;//Create new pty and start cmd
|
||||
function Write_pty(const Input: String): Boolean; override; //write str to pty
|
||||
//---------------------
|
||||
function SendBreak_pty(): Boolean; override; // ^C
|
||||
function SendSignal_pty(Sig: Cint): Boolean; override;
|
||||
function SetScreenSize(ColCount, RowCount: Integer): Boolean; override;
|
||||
function SetCurrentDir(const NewDir: String): Boolean; override;
|
||||
//---------------------
|
||||
function KillShell: LongInt; override;
|
||||
function CSI_GetTaskId(const buf:String):integer; override;
|
||||
end;
|
||||
|
||||
{ TWinConThread }
|
||||
|
||||
TWinConThread = class(TConsoleThread)
|
||||
private
|
||||
procedure AddSymbol;
|
||||
protected
|
||||
procedure Execute; override;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
LazUTF8, JwaWinCon, DCConvertEncoding, uOSUtils;
|
||||
|
||||
{ TWinTerm }
|
||||
|
||||
constructor TWinTerm.Create;
|
||||
begin
|
||||
if not isConsole then
|
||||
begin
|
||||
AllocConsole();
|
||||
FConsoleWindow:= GetConsoleWindow();
|
||||
ShowWindow(FConsoleWindow, SW_HIDE);
|
||||
end;
|
||||
end;
|
||||
|
||||
destructor TWinTerm.Destroy;
|
||||
begin
|
||||
KillShell;
|
||||
if not isConsole then
|
||||
FreeConsole();
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TWinTerm.Read_Pty(var Output: String; const timeout: LongInt): LongInt;
|
||||
var
|
||||
I: Integer;
|
||||
dwRead, BufSize, DesBufSize: DWORD;
|
||||
Res: Boolean;
|
||||
pcOutput: PChar;
|
||||
begin
|
||||
try
|
||||
BufSize:= 0;
|
||||
dwRead:= 0;
|
||||
Output:= EmptyStr;
|
||||
repeat
|
||||
for I:= 0 to 9 do
|
||||
begin
|
||||
Res:= PeekNamedPipe(PipeStdOutRead, nil, 0, nil, @DesBufSize, nil);
|
||||
Res:= Res and (DesBufSize > 0);
|
||||
if Res then Break;
|
||||
Sleep(TimeOut);
|
||||
end;
|
||||
if Res then
|
||||
begin
|
||||
if DesBufSize > BufSize then
|
||||
begin
|
||||
GetMem(pcOutput, DesBufSize);
|
||||
BufSize:= DesBufSize;
|
||||
end;
|
||||
Res:= ReadFile(PipeStdOutRead, pcOutput^, BufSize, dwRead, nil);
|
||||
end;
|
||||
until not Res;
|
||||
except
|
||||
end;
|
||||
if dwRead > 0 then
|
||||
begin
|
||||
Output:= ConsoleToUTF8(Copy(pcOutput, 1, dwRead));
|
||||
FreeMem(pcOutput);
|
||||
end;
|
||||
Result:= dwRead;
|
||||
end;
|
||||
|
||||
function TWinTerm.Fork_pty(const RowCount, ColCount: Integer; const Command: String;
|
||||
const Params: String): THandle;
|
||||
var
|
||||
hTmp1, hTmp2: THandle;
|
||||
begin
|
||||
ZeroMemory(@FSecurityAttributes, SizeOf(FSecurityAttributes));
|
||||
FSecurityAttributes.nLength:= SizeOf(FSecurityAttributes);
|
||||
FSecurityAttributes.bInheritHandle:= True;
|
||||
FSecurityAttributes.lpSecurityDescriptor:= nil;
|
||||
|
||||
// create input/output pipes
|
||||
CreatePipe(PipeStdInRead, PipeStdInWrite, @FSecurityAttributes, 0);
|
||||
CreatePipe(PipeStdOutRead, PipeStdOutWrite, @FSecurityAttributes, 0);
|
||||
|
||||
DuplicateHandle(GetCurrentProcess(), PipeStdInWrite, GetCurrentProcess(), @hTmp1, 0, False, DUPLICATE_SAME_ACCESS);
|
||||
DuplicateHandle(GetCurrentProcess(), PipeStdOutRead, GetCurrentProcess(), @hTmp2, 0, False, DUPLICATE_SAME_ACCESS);
|
||||
|
||||
CloseHandle(PipeStdInWrite);
|
||||
CloseHandle(PipeStdOutRead);
|
||||
|
||||
PipeStdInWrite:= hTmp1;
|
||||
PipeStdOutRead:= hTmp2;
|
||||
|
||||
ZeroMemory(@FStartupInfo, SizeOf(FStartupInfo));
|
||||
FStartupInfo.cb:= SizeOf(FStartupInfo);
|
||||
with FStartupInfo do
|
||||
begin
|
||||
dwFlags:= STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES;
|
||||
wShowWindow:= SW_HIDE;
|
||||
hStdInput:= PipeStdInRead;
|
||||
hStdOutput:= PipeStdOutWrite;
|
||||
hStdError:= PipeStdOutWrite;
|
||||
end;
|
||||
|
||||
ZeroMemory(@FProcessInformation, SizeOf(FProcessInformation));
|
||||
|
||||
CreateProcessW(nil,
|
||||
PWideChar(CeUtf8ToUtf16(Command)), // command line
|
||||
nil, // process security attributes
|
||||
nil, // primary thread security attributes
|
||||
TRUE, // handles are inherited
|
||||
0, // creation flags
|
||||
nil, // use parent's environment
|
||||
nil, // use parent's current directory
|
||||
FStartupInfo, // STARTUPINFO pointer
|
||||
FProcessInformation); // receives PROCESS_INFORMATION
|
||||
|
||||
Result:= FProcessInformation.hProcess;
|
||||
end;
|
||||
|
||||
function TWinTerm.Write_pty(const Input: String): Boolean;
|
||||
var
|
||||
dwWritten, BufSize: DWORD;
|
||||
pcCommand: PChar;
|
||||
begin
|
||||
pcCommand:= PChar(UTF8ToConsole(Input));
|
||||
BufSize:= Length(pcCommand);
|
||||
Result:= WriteFile(PipeStdInWrite, pcCommand^, BufSize, dwWritten, nil);
|
||||
Result:= Result and (BufSize = dwWritten);
|
||||
end;
|
||||
|
||||
function TWinTerm.SendBreak_pty(): Boolean;
|
||||
begin
|
||||
Result:= SendSignal_pty(CTRL_C_EVENT);
|
||||
end;
|
||||
|
||||
function TWinTerm.SendSignal_pty(Sig: Cint): Boolean;
|
||||
begin
|
||||
SetConsoleCtrlHandler(nil, True);
|
||||
Result:= GenerateConsoleCtrlEvent(Sig, 0);
|
||||
end;
|
||||
|
||||
function TWinTerm.SetScreenSize(ColCount, RowCount: Integer): Boolean;
|
||||
begin
|
||||
Result:= False;
|
||||
end;
|
||||
|
||||
function TWinTerm.SetCurrentDir(const NewDir: String): Boolean;
|
||||
begin
|
||||
Result:= Write_pty('cd /D "' + NewDir + '"' + #13#10);
|
||||
end;
|
||||
|
||||
function TWinTerm.KillShell: LongInt;
|
||||
begin
|
||||
try
|
||||
CloseHandle(PipeStdInRead);
|
||||
CloseHandle(PipeStdInWrite);
|
||||
CloseHandle(PipeStdOutRead);
|
||||
CloseHandle(PipeStdOutWrite);
|
||||
CloseHandle(FProcessInformation.hThread);
|
||||
CloseHandle(FProcessInformation.hProcess);
|
||||
Result := 0;
|
||||
except
|
||||
Result := -1;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TWinTerm.CSI_GetTaskId(const buf:String):integer;
|
||||
begin
|
||||
Result := 0; // Dummy
|
||||
end;
|
||||
|
||||
{ TWinConThread }
|
||||
|
||||
procedure TWinConThread.AddSymbol;
|
||||
begin
|
||||
if Assigned(FOut) then
|
||||
FOut.Write(FBuf);
|
||||
end;
|
||||
|
||||
procedure TWinConThread.Execute;
|
||||
begin
|
||||
FShell:= GetShell;
|
||||
if Length(FShell) = 0 then
|
||||
FShell:= RunTermCmd;
|
||||
if Assigned(FTerm) then
|
||||
FTerm.Fork_pty(FRowsCount, FColsCount, FShell);
|
||||
while True do
|
||||
begin
|
||||
if Assigned(FTerm) then
|
||||
begin
|
||||
if FTerm.Read_pty(FBuf, 0) > 0 then
|
||||
Synchronize(@AddSymbol)
|
||||
else
|
||||
Sleep(1);
|
||||
end else Break;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TWinConThread.Create;
|
||||
begin
|
||||
inherited Create(True);
|
||||
System.InitCriticalSection(FLock);
|
||||
FTerm:= TWinTerm.Create;
|
||||
FRowsCount:= 50;
|
||||
FColsCount:= 100;
|
||||
end;
|
||||
|
||||
destructor TWinConThread.Destroy;
|
||||
begin
|
||||
FreeAndNil(FTerm);
|
||||
System.DoneCriticalSection(FLock);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue