mirror of
https://github.com/LMMS/lmms.git
synced 2025-12-23 22:58:33 -05:00
Remove FLP import, revert to GPLv2+ only (#2904)
This commit is contained in:
681
LICENSE.txt
681
LICENSE.txt
@@ -1,6 +1,3 @@
|
||||
This program and almost all plug-ins are licensed under the GNU General Public
|
||||
License, either version 2 or any later version.
|
||||
------------------------------------------------------------------------------
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
@@ -340,681 +337,3 @@ 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.
|
||||
==============================================================================
|
||||
The FLP Import plug-in is licensed under the GNU General Public License,
|
||||
either version 3 or any later version.
|
||||
------------------------------------------------------------------------------
|
||||
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>.
|
||||
|
||||
@@ -32,7 +32,7 @@ Features
|
||||
* Many powerful instrument and effect-plugins out of the box
|
||||
* Full user-defined track-based automation and computer-controlled automation sources
|
||||
* Compatible with many standards such as SoundFont2, VST(i), LADSPA, GUS Patches, and full MIDI support
|
||||
* Import of MIDI and FLP (FL Studio®/Fruityloops® Project) files
|
||||
* MIDI file importing
|
||||
|
||||
Building
|
||||
---------
|
||||
|
||||
@@ -179,7 +179,6 @@ private:
|
||||
|
||||
|
||||
friend class EnvelopeAndLfoView;
|
||||
friend class FlpImport;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ public:
|
||||
SoundFontFile,
|
||||
PatchFile,
|
||||
MidiFile,
|
||||
FlpFile,
|
||||
VstPluginFile,
|
||||
UnknownFile,
|
||||
NumFileTypes
|
||||
@@ -228,7 +227,6 @@ private:
|
||||
static QPixmap * s_soundfontFilePixmap;
|
||||
static QPixmap * s_vstPluginFilePixmap;
|
||||
static QPixmap * s_midiFilePixmap;
|
||||
static QPixmap * s_flpFilePixmap;
|
||||
static QPixmap * s_unknownFilePixmap;
|
||||
|
||||
QString m_path;
|
||||
|
||||
@@ -202,7 +202,6 @@ private:
|
||||
ComboBoxModel m_arpModeModel;
|
||||
|
||||
|
||||
friend class FlpImport;
|
||||
friend class InstrumentTrack;
|
||||
friend class InstrumentFunctionArpeggioView;
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ private:
|
||||
|
||||
|
||||
friend class InstrumentSoundShapingView;
|
||||
friend class FlpImport;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -268,7 +268,6 @@ private:
|
||||
friend class InstrumentTrackView;
|
||||
friend class InstrumentTrackWindow;
|
||||
friend class NotePlayHandle;
|
||||
friend class FlpImport;
|
||||
friend class InstrumentMiscView;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -19,7 +19,6 @@ ADD_SUBDIRECTORY(DualFilter)
|
||||
ADD_SUBDIRECTORY(dynamics_processor)
|
||||
ADD_SUBDIRECTORY(Eq)
|
||||
ADD_SUBDIRECTORY(Flanger)
|
||||
ADD_SUBDIRECTORY(flp_import)
|
||||
ADD_SUBDIRECTORY(HydrogenImport)
|
||||
ADD_SUBDIRECTORY(kicker)
|
||||
ADD_SUBDIRECTORY(ladspa_browser)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
INCLUDE_DIRECTORIES(unrtf)
|
||||
|
||||
# Enable C++11
|
||||
ADD_DEFINITIONS(-std=c++0x)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
ENDIF()
|
||||
|
||||
BUILD_PLUGIN(flpimport FlpImport.cpp unrtf.cpp FlpImport.h)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* FlpImport.h - support for importing FLP-files
|
||||
*
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLP_IMPORT_H
|
||||
#define _FLP_IMPORT_H
|
||||
|
||||
#include <QString>
|
||||
#include <QPair>
|
||||
#include <QVector>
|
||||
|
||||
#include "ImportFilter.h"
|
||||
#include "Note.h"
|
||||
|
||||
|
||||
|
||||
class instrument;
|
||||
struct FL_Channel;
|
||||
|
||||
class FlpImport : public ImportFilter
|
||||
{
|
||||
public:
|
||||
FlpImport( const QString & _file );
|
||||
virtual ~FlpImport();
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
virtual bool tryImport( TrackContainer* tc );
|
||||
|
||||
void processPluginParams( FL_Channel * _ch );
|
||||
|
||||
inline int readInt( int _bytes )
|
||||
{
|
||||
int c, value = 0;
|
||||
do
|
||||
{
|
||||
c = readByte();
|
||||
if( c == -1 )
|
||||
{
|
||||
return( -1 );
|
||||
}
|
||||
value = ( value << 8 ) | c;
|
||||
} while( --_bytes );
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline int32_t read32LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
value |= readByte() << 16;
|
||||
value |= readByte() << 24;
|
||||
return( value );
|
||||
}
|
||||
inline int32_t read16LE()
|
||||
{
|
||||
int value = readByte();
|
||||
value |= readByte() << 8;
|
||||
return( value );
|
||||
}
|
||||
|
||||
inline int32_t readID()
|
||||
{
|
||||
return( read32LE() );
|
||||
}
|
||||
|
||||
inline void skip( int _bytes )
|
||||
{
|
||||
while( _bytes > 0 )
|
||||
{
|
||||
readByte();
|
||||
--_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* unrtf.cpp - integration of UnRTF
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of LMMS - http://lmms.io
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QBuffer>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// unrtf-stuff
|
||||
#include "defs.h"
|
||||
#include "main.h"
|
||||
#include "html.h"
|
||||
#include "word.h"
|
||||
#include "hash.h"
|
||||
#include "convert.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
int lineno = 0;
|
||||
#define inline_mode 0
|
||||
#define debug_mode 0
|
||||
#define nopict_mode 1
|
||||
#define verbose_mode 0
|
||||
#define simple_mode 0
|
||||
#define no_remap_mode 0
|
||||
|
||||
QString outstring;
|
||||
short numchar_table;
|
||||
OutputPersonality * op = NULL;
|
||||
|
||||
|
||||
// include unrtf-source
|
||||
#include "attr.c"
|
||||
#include "convert.c"
|
||||
#include "error.c"
|
||||
#include "hash.c"
|
||||
#include "html.c"
|
||||
#include "ur_malloc.c"
|
||||
#include "output.c"
|
||||
#include "parse.c"
|
||||
#include "util.c"
|
||||
#include "word.c"
|
||||
|
||||
}
|
||||
@@ -1,677 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: attr
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Aug 01
|
||||
* Purpose: Character attribute stack.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 01 Aug 01, tuorfa@yahoo.com: moved code over from convert.c
|
||||
* 06 Aug 01, tuorfa@yahoo.com: added several font attributes.
|
||||
* 18 Sep 01, tuorfa@yahoo.com: added AttrStack (stack of stacks) paradigm
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: fixed fore/background_begin error
|
||||
* and updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "ur_malloc.h"
|
||||
#include "defs.h"
|
||||
#include "error.h"
|
||||
#include "attr.h"
|
||||
#include "main.h"
|
||||
|
||||
extern void starting_body();
|
||||
extern void starting_text();
|
||||
|
||||
extern QString outstring;
|
||||
|
||||
extern int simulate_allcaps;
|
||||
extern int simulate_smallcaps;
|
||||
|
||||
|
||||
#define MAX_ATTRS (10000)
|
||||
|
||||
|
||||
/* For each RTF text block (the text within braces) we must keep
|
||||
* an AttrStack which is a stack of attributes and their optional
|
||||
* parameter. Since RTF text blocks are nested, these make up a
|
||||
* stack of stacks. And, since RTF text blocks inherit attributes
|
||||
* from parent blocks, all new AttrStacks do the same from
|
||||
* their parent AttrStack.
|
||||
*/
|
||||
typedef struct _stack {
|
||||
unsigned char attr_stack[MAX_ATTRS];
|
||||
char *attr_stack_params[MAX_ATTRS];
|
||||
int tos;
|
||||
struct _stack *next;
|
||||
} AttrStack;
|
||||
|
||||
static AttrStack *stack_of_stacks = NULL;
|
||||
static AttrStack *stack_of_stacks_top = NULL;
|
||||
|
||||
|
||||
void attr_clear_all()
|
||||
{
|
||||
stack_of_stacks = NULL;
|
||||
stack_of_stacks_top = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_express_begin
|
||||
* Purpose: Print the HTML for beginning an attribute.
|
||||
* Args: Attribute number, optional string parameter.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_express_begin (int attr, const char* param) {
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString().sprintf("%s", op->bold_begin);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString().sprintf("%s", op->italic_begin);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's <u> */
|
||||
case ATTR_THICK_UL:
|
||||
case ATTR_WAVE_UL:
|
||||
case ATTR_DASH_UL:
|
||||
case ATTR_DOT_UL:
|
||||
case ATTR_DOT_DASH_UL:
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString().sprintf("%s", op->underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString().sprintf("%s", op->dbl_underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
op_begin_std_fontsize (op, atoi (param));
|
||||
break;
|
||||
|
||||
case ATTR_FONTFACE:
|
||||
outstring+=QString().sprintf(op->font_begin,param);
|
||||
break;
|
||||
|
||||
case ATTR_FOREGROUND:
|
||||
outstring+=QString().sprintf(op->foreground_begin, param);
|
||||
break;
|
||||
|
||||
case ATTR_BACKGROUND:
|
||||
if (!simple_mode)
|
||||
outstring+=QString().sprintf(op->background_begin,param);
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString().sprintf("%s", op->superscript_begin);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString().sprintf("%s", op->subscript_begin);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString().sprintf("%s", op->strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString().sprintf("%s", op->dbl_strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
outstring+=QString().sprintf(op->expand_begin, param);
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString().sprintf("%s", op->outline_begin);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString().sprintf("%s", op->shadow_begin);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString().sprintf("%s", op->emboss_begin);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString().sprintf("%s", op->engrave_begin);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
if (op->simulate_all_caps)
|
||||
simulate_allcaps = true;
|
||||
break;
|
||||
|
||||
case ATTR_SMALLCAPS:
|
||||
if (op->simulate_small_caps)
|
||||
simulate_smallcaps = true;
|
||||
else {
|
||||
if (op->small_caps_begin)
|
||||
outstring+=QString().sprintf("%s", op->small_caps_begin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_express_end
|
||||
* Purpose: Print HTML to complete an attribute.
|
||||
* Args: Attribute number.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_express_end (int attr, char *param)
|
||||
{
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString().sprintf("%s", op->bold_end);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString().sprintf("%s", op->italic_end);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's </u> */
|
||||
case ATTR_THICK_UL:
|
||||
case ATTR_WAVE_UL:
|
||||
case ATTR_DASH_UL:
|
||||
case ATTR_DOT_UL:
|
||||
case ATTR_DOT_DASH_UL:
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString().sprintf("%s", op->underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString().sprintf("%s", op->dbl_underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
op_end_std_fontsize (op, atoi (param));
|
||||
break;
|
||||
|
||||
case ATTR_FONTFACE:
|
||||
outstring+=QString().sprintf("%s", op->font_end);
|
||||
break;
|
||||
|
||||
case ATTR_FOREGROUND:
|
||||
outstring+=QString().sprintf("%s", op->foreground_end);
|
||||
break;
|
||||
case ATTR_BACKGROUND:
|
||||
if (!simple_mode)
|
||||
outstring+=QString().sprintf("%s", op->background_end);
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString().sprintf("%s", op->superscript_end);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString().sprintf("%s", op->subscript_end);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString().sprintf("%s", op->strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString().sprintf("%s", op->dbl_strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString().sprintf("%s", op->outline_end);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString().sprintf("%s", op->shadow_end);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString().sprintf("%s", op->emboss_end);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString().sprintf("%s", op->engrave_end);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
outstring+=QString().sprintf("%s", op->expand_end);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
if (op->simulate_all_caps)
|
||||
simulate_allcaps = false;
|
||||
break;
|
||||
|
||||
case ATTR_SMALLCAPS:
|
||||
if (op->simulate_small_caps)
|
||||
simulate_smallcaps = false;
|
||||
else {
|
||||
if (op->small_caps_end)
|
||||
outstring+=QString().sprintf("%s", op->small_caps_end);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_push
|
||||
* Purpose: Pushes an attribute onto the current attribute stack.
|
||||
* Args: Attribute number, optional string parameter.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_push(int attr, const char* param)
|
||||
{
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler("No stack to push attribute onto");
|
||||
return;
|
||||
}
|
||||
|
||||
if (stack->tos >= MAX_ATTRS) {
|
||||
fprintf(stderr, "Too many attributes!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make sure it's understood we're in the <body> section. */
|
||||
/* KLUDGE */
|
||||
starting_body();
|
||||
starting_text();
|
||||
|
||||
++stack->tos;
|
||||
stack->attr_stack[stack->tos] = attr;
|
||||
if (param)
|
||||
stack->attr_stack_params[stack->tos] = my_strdup(param);
|
||||
else
|
||||
stack->attr_stack_params[stack->tos] = NULL;
|
||||
|
||||
attr_express_begin(attr, param);
|
||||
}
|
||||
|
||||
#if 1 /* daved 0.20.2 */
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_get_param
|
||||
* Purpose: Reads an attribute from the current attribute stack.
|
||||
* Args: Attribute number
|
||||
* Returns: string.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
attr_get_param(int attr)
|
||||
{
|
||||
int i;
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler("No stack to get attribute from");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
i=stack->tos;
|
||||
while (i>=0)
|
||||
{
|
||||
if(stack->attr_stack [i] == attr)
|
||||
{
|
||||
if(stack->attr_stack_params [i] != NULL)
|
||||
return stack->attr_stack_params [i];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_copy_all
|
||||
* Purpose: Routine to copy all attributes from one stack to another.
|
||||
* Args: Two stacks.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attrstack_copy_all (AttrStack *src, AttrStack *dest)
|
||||
{
|
||||
int i;
|
||||
int total;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(src);
|
||||
CHECK_PARAM_NOT_NULL(dest);
|
||||
|
||||
total = src->tos + 1;
|
||||
|
||||
for (i=0; i<total; i++)
|
||||
{
|
||||
int attr=src->attr_stack [i];
|
||||
char *param=src->attr_stack_params [i];
|
||||
|
||||
dest->attr_stack[i] = attr;
|
||||
if (param)
|
||||
dest->attr_stack_params[i] = my_strdup (param);
|
||||
else
|
||||
dest->attr_stack_params[i] = NULL;
|
||||
}
|
||||
|
||||
dest->tos = src->tos;
|
||||
}
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_unexpress_all
|
||||
* Purpose: Routine to un-express all attributes heretofore applied,
|
||||
* without removing any from the stack.
|
||||
* Args: Stack whost contents should be unexpressed.
|
||||
* Returns: None.
|
||||
* Notes: This is needed by attrstack_push, but also for \cell, which
|
||||
* often occurs within a brace group, yet HTML uses <td></td>
|
||||
* which clear attribute info within that block.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attrstack_unexpress_all (AttrStack *stack)
|
||||
{
|
||||
int i;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(stack);
|
||||
|
||||
i=stack->tos;
|
||||
while (i>=0)
|
||||
{
|
||||
int attr=stack->attr_stack [i];
|
||||
char *param=stack->attr_stack_params [i];
|
||||
|
||||
attr_express_end (attr, param);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_push
|
||||
* Purpose: Creates a new attribute stack, pushes it onto the stack
|
||||
* of stacks, performs inheritance from previous stack.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
void
|
||||
attrstack_push ()
|
||||
{
|
||||
AttrStack *new_stack;
|
||||
AttrStack *prev_stack;
|
||||
|
||||
new_stack = (AttrStack*) my_malloc (sizeof (AttrStack));
|
||||
memset ((void*) new_stack, 0, sizeof (AttrStack));
|
||||
|
||||
prev_stack = stack_of_stacks_top;
|
||||
|
||||
if (!stack_of_stacks) {
|
||||
stack_of_stacks = new_stack;
|
||||
} else {
|
||||
stack_of_stacks_top->next = new_stack;
|
||||
}
|
||||
stack_of_stacks_top = new_stack;
|
||||
new_stack->tos = -1;
|
||||
|
||||
if (prev_stack) {
|
||||
attrstack_unexpress_all (prev_stack);
|
||||
attrstack_copy_all (prev_stack, new_stack);
|
||||
attrstack_express_all ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_pop
|
||||
* Purpose: Removes and undoes the effect of the top attribute of
|
||||
* the current AttrStack.
|
||||
* Args: The top attribute's number, for verification.
|
||||
* Returns: Success/fail flag.
|
||||
*=======================================================================*/
|
||||
|
||||
int
|
||||
attr_pop (int attr)
|
||||
{
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
|
||||
if (!stack) {
|
||||
warning_handler ("no stack to pop attribute from");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(stack->tos>=0 && stack->attr_stack[stack->tos]==attr)
|
||||
{
|
||||
char *param = stack->attr_stack_params [stack->tos];
|
||||
|
||||
attr_express_end (attr, param);
|
||||
|
||||
if (param) my_free(param);
|
||||
|
||||
stack->tos--;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_read
|
||||
* Purpose: Reads but leaves in place the top attribute of the top
|
||||
* attribute stack.
|
||||
* Args: None.
|
||||
* Returns: Attribute number.
|
||||
*=======================================================================*/
|
||||
|
||||
int
|
||||
attr_read() {
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler ("no stack to read attribute from");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(stack->tos>=0)
|
||||
{
|
||||
int attr = stack->attr_stack [stack->tos];
|
||||
return attr;
|
||||
}
|
||||
else
|
||||
return ATTR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_drop_all
|
||||
* Purpose: Undoes all attributes that an AttrStack contains.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_drop_all ()
|
||||
{
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler ("no stack to drop all attributes from");
|
||||
return;
|
||||
}
|
||||
|
||||
while (stack->tos>=0)
|
||||
{
|
||||
char *param=stack->attr_stack_params [stack->tos];
|
||||
if (param) my_free(param);
|
||||
stack->tos--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_drop
|
||||
* Purpose: Removes the top AttrStack from the stack of stacks, undoing
|
||||
* all attributes that it had in it.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attrstack_drop ()
|
||||
{
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
AttrStack *prev_stack;
|
||||
if (!stack) {
|
||||
warning_handler ("no attr-stack to drop");
|
||||
return;
|
||||
}
|
||||
|
||||
attr_pop_all ();
|
||||
|
||||
prev_stack = stack_of_stacks;
|
||||
while(prev_stack && prev_stack->next && prev_stack->next != stack)
|
||||
prev_stack = prev_stack->next;
|
||||
|
||||
if (prev_stack) {
|
||||
stack_of_stacks_top = prev_stack;
|
||||
prev_stack->next = NULL;
|
||||
} else {
|
||||
stack_of_stacks_top = NULL;
|
||||
stack_of_stacks = NULL;
|
||||
}
|
||||
my_free ((char*) stack);
|
||||
|
||||
attrstack_express_all ();
|
||||
}
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_pop_all
|
||||
* Purpose: Routine to undo all attributes heretofore applied,
|
||||
* also reversing the order in which they were applied.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_pop_all()
|
||||
{
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler ("no stack to pop from");
|
||||
return;
|
||||
}
|
||||
|
||||
while (stack->tos>=0) {
|
||||
int attr=stack->attr_stack [stack->tos];
|
||||
char *param=stack->attr_stack_params [stack->tos];
|
||||
attr_express_end (attr,param);
|
||||
if (param) my_free(param);
|
||||
stack->tos--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_express_all
|
||||
* Purpose: Routine to re-express all attributes heretofore applied.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
* Notes: This is needed by attrstack_push, but also for \cell, which
|
||||
* often occurs within a brace group, yet HTML uses <td></td>
|
||||
* which clear attribute info within that block.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attrstack_express_all() {
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
int i;
|
||||
|
||||
if (!stack) {
|
||||
warning_handler ("no stack to pop from");
|
||||
return;
|
||||
}
|
||||
|
||||
i=0;
|
||||
while (i<=stack->tos)
|
||||
{
|
||||
int attr=stack->attr_stack [i];
|
||||
char *param=stack->attr_stack_params [i];
|
||||
attr_express_begin (attr, param);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_pop_dump
|
||||
* Purpose: Routine to un-express all attributes heretofore applied.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
* Notes: This is needed for \cell, which often occurs within a
|
||||
* brace group, yet HTML uses <td></td> which clear attribute
|
||||
* info within that block.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
attr_pop_dump() {
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
int i;
|
||||
|
||||
if (!stack) return;
|
||||
|
||||
i=stack->tos;
|
||||
while (i>=0)
|
||||
{
|
||||
int attr=stack->attr_stack [i];
|
||||
attr_pop (attr);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: attr
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Aug 2001
|
||||
* Purpose: Definitions for attribute stack module.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 01 Aug 01, tuorfa@yahoo.com: moved code over from convert.c
|
||||
* 06 Aug 01, tuorfa@yahoo.com: added several attributes
|
||||
* 18 Sep 01, tuorfa@yahoo.com: updates for AttrStack paradigm
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _ATTR
|
||||
#define _ATTR
|
||||
|
||||
|
||||
enum {
|
||||
ATTR_NONE=0,
|
||||
ATTR_BOLD, ATTR_ITALIC,
|
||||
|
||||
ATTR_UNDERLINE, ATTR_DOUBLE_UL, ATTR_WORD_UL,
|
||||
|
||||
ATTR_THICK_UL, ATTR_WAVE_UL,
|
||||
|
||||
ATTR_DOT_UL, ATTR_DASH_UL, ATTR_DOT_DASH_UL, ATTR_2DOT_DASH_UL,
|
||||
|
||||
ATTR_FONTSIZE, ATTR_STD_FONTSIZE,
|
||||
ATTR_FONTFACE,
|
||||
ATTR_FOREGROUND, ATTR_BACKGROUND,
|
||||
ATTR_CAPS,
|
||||
ATTR_SMALLCAPS,
|
||||
|
||||
ATTR_SHADOW,
|
||||
ATTR_OUTLINE,
|
||||
ATTR_EMBOSS,
|
||||
ATTR_ENGRAVE,
|
||||
|
||||
ATTR_SUPER, ATTR_SUB,
|
||||
ATTR_STRIKE,
|
||||
ATTR_DBL_STRIKE,
|
||||
|
||||
ATTR_EXPAND
|
||||
/* ATTR_CONDENSE */
|
||||
};
|
||||
|
||||
|
||||
|
||||
extern void attr_clear_all();
|
||||
|
||||
extern void attr_push_core (int attr, char* param);
|
||||
|
||||
extern void attr_pop_core (int attr);
|
||||
|
||||
extern void attr_push(int attr, const char* param);
|
||||
|
||||
extern void attrstack_push();
|
||||
extern void attrstack_drop();
|
||||
extern void attrstack_express_all();
|
||||
|
||||
extern int attr_pop(int attr);
|
||||
|
||||
extern int attr_read();
|
||||
|
||||
extern void attr_drop_all ();
|
||||
|
||||
extern void attr_pop_all();
|
||||
|
||||
extern void attr_pop_dump();
|
||||
|
||||
#if 1 /* daved 0.20.2 */
|
||||
|
||||
char * attr_get_param(int attr);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
||||
|
||||
/*===========================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
===========================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: convert
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 19 Sep 2001
|
||||
* Purpose: Definitions for the conversion module
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 31 Mar 05, by daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _CONVERT
|
||||
|
||||
enum {
|
||||
CHARSET_ANSI=1,
|
||||
CHARSET_MAC,
|
||||
CHARSET_CP437,
|
||||
CHARSET_CP850,
|
||||
};
|
||||
|
||||
#ifndef _WORD
|
||||
#include "word.h"
|
||||
#endif
|
||||
|
||||
extern void word_print (Word*, QString & _s);
|
||||
|
||||
#if 1 /* daved 0.19.6 - support for multiple char number->output tables */
|
||||
extern short numchar_table;
|
||||
#define FONTROMAN_TABLE 0
|
||||
#define FONTSYMBOL_TABLE 1
|
||||
#define FONTGREEK_TABLE 2
|
||||
#endif
|
||||
|
||||
#define _CONVERT
|
||||
#endif
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: defs.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Sept 2000
|
||||
* Purpose: Basic definitions plus externs for UnRTF
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 21 Oct 00, tuorfa@yahoo.com: moved program version to this file
|
||||
* 08 Apr 01, tuorfa@yahoo.com: updated usage info.
|
||||
* 08 Sep 01, tuorfa@yahoo.com: added UnRTF.
|
||||
* 19 Sep 01, tuorfa@yahoo.com: added PROGRAM_WEBSITE.
|
||||
* 09 Oct 03, daved@physiol.usyd.edu.au: changed to GNU website
|
||||
* 17 Feb 04, marcossamaral@terra.com.br: changed some information
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 17 Dec 07, daved@physiol.usyd.edu.au: added --noremap to usage - from
|
||||
* David Santinoli
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#define PROGRAM_WEBSITE "http://www.gnu.org/software/unrtf/unrtf.html"
|
||||
|
||||
|
||||
/* Select the language for reporting of file creation/modificaton dates */
|
||||
#define ENGLISH
|
||||
#if 0
|
||||
#define FRANCAIS
|
||||
#define ITALIANO
|
||||
#define PORTUGUES /* amaral - 0.19.4 */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef true /* daved 0.19.0 */
|
||||
#define true (1)
|
||||
#endif
|
||||
#ifndef false /* daved 0.19.0 */
|
||||
#define false (0)
|
||||
#endif
|
||||
#if 1 /* daved - 0.19.4 */
|
||||
#define SKIP_ONE_WORD 2
|
||||
#endif
|
||||
|
||||
|
||||
#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--noremap] [--html] [--text] [--vt] [--latex] [-t html|text|vt|latex] <filename>"
|
||||
|
||||
|
||||
/* Default names for RTF's default fonts */
|
||||
#define FONTNIL_STR "Times,TimesRoman,TimesNewRoman"
|
||||
#define FONTROMAN_STR "Times,Palatino"
|
||||
#define FONTSWISS_STR "Helvetica,Arial"
|
||||
#define FONTMODERN_STR "Courier,Verdana"
|
||||
#define FONTSCRIPT_STR "Cursive,ZapfChancery"
|
||||
#define FONTDECOR_STR "ZapfChancery"
|
||||
#define FONTTECH_STR "Symbol"
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: error
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Sep 00
|
||||
* Purpose: Management of errors and warnings, when reporting
|
||||
* the source code file/line is not necessary.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes
|
||||
* 10 Oct 00, tuorfa@yahoo.com: added usage()
|
||||
* 15 Oct 00, tuorfa@yahoo.com: improved output readability
|
||||
* 22 Sep 01, tuorfa@yahoo.com: removed mention of line number in handlers
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
|
||||
* 25 Sep 04, st001906@hrz1.hrz.tu-darmstadt.de: added stdlib.h for djgpp
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 22 Aug 05, ax2groin@arbornet.org: added lineno to error_handler
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: usage
|
||||
* Purpose: Prints usage information and exits with an error.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
usage ()
|
||||
{
|
||||
fprintf(stderr, "Usage: %s\n", USAGE);
|
||||
exit(-3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: error_handler
|
||||
* Purpose: Prints error message and other useful info, then exits.
|
||||
* Args: Message.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
error_handler (const char* message)
|
||||
{
|
||||
#if 1
|
||||
fprintf(stderr, "Error (line %d): %s\n", lineno, message);
|
||||
#else
|
||||
fprintf(stderr, "Error: %s\n", message);
|
||||
#endif
|
||||
exit(10);
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: warning_handler
|
||||
* Purpose: Prints useful info to stderr, but doesn't exit.
|
||||
* Args: Message.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
warning_handler (const char* message)
|
||||
{
|
||||
fprintf(stderr, "Warning: %s\n", message);
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: error.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Sept 2000
|
||||
* Purpose: Macros to be executed at the start of a function,
|
||||
* when reporting source code file/line is useful.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#define CHECK_PARAM_NOT_NULL(XX) { if ((XX)==NULL) { fprintf (stderr, "internal error: null pointer param in %s at %d\n", __FILE__, __LINE__); exit (1); }}
|
||||
|
||||
#define CHECK_MALLOC_SUCCESS(XX) { if ((XX)==NULL) { fprintf (stderr, "internal error: cannot allocate memory in %s at %d\n", __FILE__, __LINE__); exit (1); }}
|
||||
|
||||
|
||||
extern void usage(void);
|
||||
extern void error_handler (const char*);
|
||||
extern void warning_handler (const char*);
|
||||
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: hash
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Sep 00
|
||||
* Purpose: Word-hash management. Words are put into a hash and an
|
||||
* identifier is returned. This is used to save us from
|
||||
* doing multiple mallocs for recurring strings such as
|
||||
* 'the' and \par. This is not a big issue under Unix,
|
||||
* but it is under other OSes and anyway, waste not want not.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 08 Apr 01, tuorfa@yahoo.com: check for out of memory after malloc.
|
||||
* 21 Apr 01, tuorfa@yahoo.com: signed to conversion unsigned bug
|
||||
* 03 Aug 01, tuorfa@yahoo.com: fixes for using 16-bit compiler
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: some type fixes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requsted by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats function
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include "main.h"
|
||||
#include "ur_malloc.h"
|
||||
|
||||
|
||||
typedef struct _hi {
|
||||
struct _hi *next;
|
||||
char *str;
|
||||
unsigned long value;
|
||||
} hashItem;
|
||||
|
||||
|
||||
/* Index by first char of string */
|
||||
static hashItem *hash2[256];
|
||||
static unsigned long hash_length[256];
|
||||
static unsigned long hash_value=0;
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: hash_init
|
||||
* Purpose: Clear the hash table.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
hash_init ()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<256; i++) {
|
||||
hash2[i]=NULL;
|
||||
hash_length[i]=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: hash_stats
|
||||
* Purpose: Return the number of words stored. This is all words,
|
||||
* including commands to RTF, NOT the number of printed words in
|
||||
* a given document.
|
||||
* Args: None.
|
||||
* Returns: Number of words stored.
|
||||
*=======================================================================*/
|
||||
|
||||
unsigned long
|
||||
hash_stats ()
|
||||
{
|
||||
int i;
|
||||
unsigned long total=0;
|
||||
for (i=0; i<256; i++) {
|
||||
total += hash_length[i];
|
||||
}
|
||||
return(total);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: hashitem_new
|
||||
* Purpose: Creates a new linked list item for the hash table.
|
||||
* Args: String.
|
||||
* Returns: hashItem.
|
||||
*=======================================================================*/
|
||||
|
||||
static hashItem *
|
||||
hashitem_new (char *str)
|
||||
{
|
||||
hashItem *hi;
|
||||
unsigned long i;
|
||||
|
||||
hi=(hashItem*) my_malloc(sizeof(hashItem));
|
||||
if (!hi)
|
||||
error_handler("Out of memory");
|
||||
memset ((void*)hi, 0, sizeof (hashItem));
|
||||
|
||||
hi->str = my_strdup(str);
|
||||
|
||||
i = *str;
|
||||
if (i=='\\') i=str[1];
|
||||
i <<= 24;
|
||||
hi->value = i | (hash_value++ & 0xffffff);
|
||||
hi->next = NULL;
|
||||
|
||||
#if 0
|
||||
if (debug_mode) {
|
||||
printf ("<!-- storing val %08lx str %s -->\n",
|
||||
hi->value, hi->str);
|
||||
}
|
||||
#endif
|
||||
|
||||
return hi;
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: hash_get_index
|
||||
* Purpose: Given a string, returns the "index" i.e. the word identifier.
|
||||
* Args: String.
|
||||
* Returns: Index.
|
||||
*=======================================================================*/
|
||||
|
||||
unsigned long
|
||||
hash_get_index (char *str)
|
||||
{
|
||||
#if 1 /* daved - 0.19.1 */
|
||||
unsigned short index;
|
||||
unsigned char ch;
|
||||
#else
|
||||
int index;
|
||||
char ch;
|
||||
#endif
|
||||
hashItem *hi;
|
||||
|
||||
#if 1 /* daved - 0.19.1 */
|
||||
ch = (unsigned char)*str;
|
||||
#else
|
||||
ch = *str;
|
||||
#endif
|
||||
if (ch=='\\' && *(str+1))
|
||||
ch = *(str+1);
|
||||
index = ch;
|
||||
hi = hash2[index];
|
||||
while (hi) {
|
||||
if (!strcmp(hi->str,str))
|
||||
return hi->value;
|
||||
hi=hi->next;
|
||||
}
|
||||
/* not in hash */
|
||||
hi = hashitem_new (str);
|
||||
hi->next = hash2[index];
|
||||
hash2[index] = hi;
|
||||
++hash_length [index];
|
||||
return hi->value;
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: hash_get_string
|
||||
|
||||
* Purpose: Given the index (word identifier) returns the word string.
|
||||
* Args: Index.
|
||||
* Returns: String, or NULL if not found.
|
||||
*=======================================================================*/
|
||||
|
||||
char*
|
||||
hash_get_string (unsigned long value)
|
||||
{
|
||||
int index;
|
||||
hashItem *hi;
|
||||
|
||||
index = value >> 24;
|
||||
hi = hash2[index];
|
||||
while (hi) {
|
||||
if (hi->value == value)
|
||||
return hi->str;
|
||||
hi=hi->next;
|
||||
}
|
||||
warning_handler("Word not in hash");
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: hash.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Sept 2000
|
||||
* Purpose: Definitions for the hash module.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats()
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
extern void hash_init (void);
|
||||
extern unsigned long hash_stats (void);
|
||||
extern unsigned long hash_get_index (char *);
|
||||
extern char* hash_get_string (unsigned long );
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: html
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 19 Sep 01
|
||||
* Purpose: Definitions for the HTML output personality
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _HTML
|
||||
|
||||
|
||||
extern OutputPersonality* html_init(void);
|
||||
|
||||
|
||||
#define _HTML
|
||||
#endif
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: main.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Sept 2000
|
||||
* Purpose: Externs for main.c.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 15 Oct 00, tuorfa@yahoo.com: removed echo_mode extern
|
||||
* 19 Sep 01, tuorfa@yahoo.com: added output personality
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
extern int lineno;
|
||||
|
||||
|
||||
#ifndef _OUTPUT
|
||||
#include "output.h"
|
||||
#endif
|
||||
|
||||
extern OutputPersonality *op;
|
||||
|
||||
|
||||
@@ -1,478 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: output
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 18 Sep 01
|
||||
* Purpose: Generalized output module
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 22 Sep 01, tuorfa@yahoo.com: addition of functions to change font size
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
|
||||
* 25 Sep 04, st001906@hrz1.hrz.tu-darmstadt.de: added stdlib.h for djgpp
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes in STDOUT
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 17 Dec 07, daved@physiol.usyd.edu.au: added support for --noremap from
|
||||
* David Santinoli
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "ur_malloc.h"
|
||||
#include "defs.h"
|
||||
#include "error.h"
|
||||
#include "output.h"
|
||||
#include "main.h"
|
||||
#include "convert.h"
|
||||
|
||||
|
||||
extern QString outstring;
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_create
|
||||
* Purpose: Creates a blank output personality.
|
||||
* Args: None.
|
||||
* Returns: Output personality struct.
|
||||
*=======================================================================*/
|
||||
|
||||
OutputPersonality*
|
||||
op_create ()
|
||||
{
|
||||
OutputPersonality* new_op;
|
||||
|
||||
new_op = (OutputPersonality*) my_malloc (sizeof(OutputPersonality));
|
||||
if (!new_op)
|
||||
error_handler ("cannot allocate output personality");
|
||||
|
||||
memset ((void*) new_op, 0, sizeof (OutputPersonality));
|
||||
return new_op;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_free
|
||||
* Purpose: Deallocates an output personality, but none of the strings
|
||||
* it points to since they are usually constants.
|
||||
* Args: OutputPersonality.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
op_free (OutputPersonality *op)
|
||||
{
|
||||
CHECK_PARAM_NOT_NULL(op);
|
||||
|
||||
my_free ((char*) op);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_translate_char
|
||||
* Purpose: Performs a translation of a character in the context of
|
||||
* a given output personality.
|
||||
* Args: OutputPersonality, character set#, character.
|
||||
* Returns: String.
|
||||
*=======================================================================*/
|
||||
|
||||
const char *
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch, int ntable)
|
||||
#else
|
||||
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch)
|
||||
#endif
|
||||
{
|
||||
short start;
|
||||
const char *result=NULL;
|
||||
#if 1 /* daved - 0.20.5 */
|
||||
static char output_buffer[2]={ 0, 0 };
|
||||
#endif
|
||||
|
||||
CHECK_PARAM_NOT_NULL(op);
|
||||
|
||||
#if 1 /* daved - 0.20.5 */
|
||||
if (no_remap_mode == true && ch < 256)
|
||||
{
|
||||
output_buffer[0]=ch;
|
||||
result=output_buffer;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
/* if we are seeking a character from a symbol font we can
|
||||
be below 0x80
|
||||
*/
|
||||
if(ntable == FONTSYMBOL_TABLE)
|
||||
{
|
||||
start = op->symbol_first_char;
|
||||
|
||||
if(ch >= start && ch <= op->symbol_last_char)
|
||||
result = op->symbol_translation_table[ch - start];
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if 1 /* daved - 0.20.3 */
|
||||
if(ntable == FONTGREEK_TABLE)
|
||||
{
|
||||
start = op->greek_first_char;
|
||||
|
||||
if(ch >= start && ch <= op->greek_last_char)
|
||||
result = op->greek_translation_table[ch - start];
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
if (ch >= 0x20 && ch < 0x80) {
|
||||
result = op->ascii_translation_table [ch - 0x20];
|
||||
}
|
||||
else
|
||||
if (charset != CHARSET_ANSI &&
|
||||
charset != CHARSET_MAC &&
|
||||
charset != CHARSET_CP437 &&
|
||||
charset != CHARSET_CP850)
|
||||
error_handler ("invalid character set value, cannot translate character");
|
||||
else
|
||||
switch (charset) {
|
||||
case CHARSET_ANSI:
|
||||
if (codepage != NULL && op->unisymbol_print != NULL && codepage->cp)
|
||||
{
|
||||
if(0)
|
||||
printf("<CODEPAGE CHAR %d>", codepage->chars[ch - 0x80]);
|
||||
if (codepage->chars[ch - 0x80]) {
|
||||
if(0)
|
||||
printf("<UNIPRINTING>");
|
||||
result = op->unisymbol_print(codepage->chars[ch - 0x80]);
|
||||
}
|
||||
}
|
||||
if(!result)
|
||||
{
|
||||
start = op->ansi_first_char;
|
||||
if (ch >= start &&
|
||||
ch <= op->ansi_last_char)
|
||||
result = op->ansi_translation_table [ch-start];
|
||||
}
|
||||
break;
|
||||
case CHARSET_MAC:
|
||||
start = op->mac_first_char;
|
||||
if (ch >= start &&
|
||||
ch <= op->mac_last_char)
|
||||
result = op->mac_translation_table [ch-start];
|
||||
break;
|
||||
case CHARSET_CP437:
|
||||
start = op->cp437_first_char;
|
||||
if (ch >= start &&
|
||||
ch <= op->cp437_last_char)
|
||||
result = op->cp437_translation_table [ch-start];
|
||||
break;
|
||||
case CHARSET_CP850:
|
||||
start = op->cp850_first_char;
|
||||
if (ch >= start &&
|
||||
ch <= op->cp850_last_char)
|
||||
result = op->cp850_translation_table [ch-start];
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_begin_std_fontsize
|
||||
* Purpose: Prints whatever is necessary to perform a change in the
|
||||
* current font size.
|
||||
* Args: OutputPersonality, desired size.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
op_begin_std_fontsize (OutputPersonality *op, int size)
|
||||
{
|
||||
size = ( size * 3 ) / 2;
|
||||
int found_std_expr = false;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(op);
|
||||
|
||||
/* Look for an exact match with a standard point size.
|
||||
*/
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_begin);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* If no exact match, try to write out a change to the
|
||||
* exact point size.
|
||||
*/
|
||||
if (!found_std_expr) {
|
||||
if (op->fontsize_begin) {
|
||||
char expr[16];
|
||||
sprintf (expr, "%d", size);
|
||||
outstring+=QString().sprintf(op->fontsize_begin, expr);
|
||||
} else {
|
||||
/* If we cannot write out a change for the exact
|
||||
* point size, we must approximate to a standard
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_begin);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_begin);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_begin) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_begin);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_begin)
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_begin);
|
||||
else
|
||||
if (op->fontsize14_begin)
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_begin);
|
||||
else
|
||||
if (op->fontsize10_begin)
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_begin);
|
||||
else
|
||||
if (op->fontsize18_begin)
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_begin);
|
||||
else
|
||||
if (op->fontsize8_begin)
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_begin);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_end_std_fontsize
|
||||
* Purpose: Prints whatever is necessary to perform a change in the
|
||||
* current font size.
|
||||
* Args: OutputPersonality, desired size.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
op_end_std_fontsize (OutputPersonality *op, int size)
|
||||
{
|
||||
int found_std_expr = false;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(op);
|
||||
|
||||
/* Look for an exact match with a standard point size.
|
||||
*/
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_end);
|
||||
found_std_expr = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* If no exact match, try to write out a change to the
|
||||
* exact point size.
|
||||
*/
|
||||
if (!found_std_expr) {
|
||||
if (op->fontsize_end) {
|
||||
char expr[16];
|
||||
sprintf (expr, "%d", size);
|
||||
outstring+=QString().sprintf(op->fontsize_end, expr);
|
||||
} else {
|
||||
/* If we cannot write out a change for the exact
|
||||
* point size, we must approximate to a standard
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize24_end);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize36_end);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_end) {
|
||||
outstring+=QString().sprintf("%s", op->fontsize48_end);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_end)
|
||||
outstring+=QString().sprintf("%s", op->fontsize12_end);
|
||||
else
|
||||
if (op->fontsize14_end)
|
||||
outstring+=QString().sprintf("%s", op->fontsize14_end);
|
||||
else
|
||||
if (op->fontsize10_end)
|
||||
outstring+=QString().sprintf("%s", op->fontsize10_end);
|
||||
else
|
||||
if (op->fontsize18_end)
|
||||
outstring+=QString().sprintf("%s", op->fontsize18_end);
|
||||
else
|
||||
if (op->fontsize8_end)
|
||||
outstring+=QString().sprintf("%s", op->fontsize8_end);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,312 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: output
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 18 Sep 01
|
||||
* Purpose: Definitions for the generalized output module
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _OUTPUT
|
||||
|
||||
typedef struct {
|
||||
int cp;
|
||||
unsigned short chars[128];
|
||||
} CodepageInfo;
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *comment_begin;
|
||||
const char *comment_end;
|
||||
|
||||
const char *document_begin;
|
||||
const char *document_end;
|
||||
|
||||
const char *header_begin;
|
||||
const char *header_end;
|
||||
|
||||
const char *document_title_begin;
|
||||
const char *document_title_end;
|
||||
|
||||
char *document_keywords_begin;
|
||||
char *document_keywords_end;
|
||||
|
||||
const char *document_author_begin;
|
||||
const char *document_author_end;
|
||||
|
||||
const char *document_changedate_begin;
|
||||
const char *document_changedate_end;
|
||||
|
||||
const char *body_begin;
|
||||
const char *body_end;
|
||||
|
||||
char *word_begin;
|
||||
char *word_end;
|
||||
|
||||
const char *paragraph_begin;
|
||||
const char *paragraph_end;
|
||||
|
||||
const char *center_begin;
|
||||
const char *center_end;
|
||||
|
||||
const char *align_left_begin;
|
||||
const char *align_left_end;
|
||||
|
||||
const char *align_right_begin;
|
||||
const char *align_right_end;
|
||||
|
||||
const char *justify_begin;
|
||||
const char *justify_end;
|
||||
|
||||
const char *forced_space;
|
||||
const char *line_break;
|
||||
const char *page_break;
|
||||
|
||||
const char *hyperlink_begin;
|
||||
const char *hyperlink_end;
|
||||
|
||||
const char *imagelink_begin;
|
||||
const char *imagelink_end;
|
||||
|
||||
const char *table_begin;
|
||||
const char *table_end;
|
||||
|
||||
const char *table_row_begin;
|
||||
const char *table_row_end;
|
||||
|
||||
const char *table_cell_begin;
|
||||
const char *table_cell_end;
|
||||
|
||||
/* Character attributes */
|
||||
const char *font_begin;
|
||||
const char *font_end;
|
||||
|
||||
const char *fontsize_begin;
|
||||
const char *fontsize_end;
|
||||
|
||||
/* standard font sizes are optional */
|
||||
const char *fontsize8_begin;
|
||||
const char *fontsize8_end;
|
||||
|
||||
const char *fontsize10_begin;
|
||||
const char *fontsize10_end;
|
||||
|
||||
const char *fontsize12_begin;
|
||||
const char *fontsize12_end;
|
||||
|
||||
const char *fontsize14_begin;
|
||||
const char *fontsize14_end;
|
||||
|
||||
const char *fontsize18_begin;
|
||||
const char *fontsize18_end;
|
||||
|
||||
const char *fontsize24_begin;
|
||||
const char *fontsize24_end;
|
||||
|
||||
char *fontsize36_begin;
|
||||
char *fontsize36_end;
|
||||
|
||||
char *fontsize48_begin;
|
||||
char *fontsize48_end;
|
||||
|
||||
const char *smaller_begin;
|
||||
const char *smaller_end;
|
||||
|
||||
const char *bigger_begin;
|
||||
const char *bigger_end;
|
||||
|
||||
const char *foreground_begin;
|
||||
const char *foreground_end;
|
||||
|
||||
const char *background_begin;
|
||||
const char *background_end;
|
||||
|
||||
const char *bold_begin;
|
||||
const char *bold_end;
|
||||
|
||||
const char *italic_begin;
|
||||
const char *italic_end;
|
||||
|
||||
const char *underline_begin;
|
||||
const char *underline_end;
|
||||
|
||||
const char *dbl_underline_begin;
|
||||
const char *dbl_underline_end;
|
||||
|
||||
const char *superscript_begin;
|
||||
const char *superscript_end;
|
||||
|
||||
const char *subscript_begin;
|
||||
const char *subscript_end;
|
||||
|
||||
const char *strikethru_begin;
|
||||
const char *strikethru_end;
|
||||
|
||||
const char *dbl_strikethru_begin;
|
||||
const char *dbl_strikethru_end;
|
||||
|
||||
const char *emboss_begin;
|
||||
const char *emboss_end;
|
||||
|
||||
const char *engrave_begin;
|
||||
const char *engrave_end;
|
||||
|
||||
const char *shadow_begin;
|
||||
const char *shadow_end;
|
||||
|
||||
const char *outline_begin;
|
||||
const char *outline_end;
|
||||
|
||||
char *small_caps_begin;
|
||||
char *small_caps_end;
|
||||
|
||||
const char *pointlist_begin;
|
||||
const char *pointlist_end;
|
||||
|
||||
const char *pointlist_item_begin;
|
||||
const char *pointlist_item_end;
|
||||
|
||||
const char *numericlist_begin;
|
||||
const char *numericlist_end;
|
||||
|
||||
const char *numericlist_item_begin;
|
||||
const char *numericlist_item_end;
|
||||
|
||||
const char *expand_begin;
|
||||
const char *expand_end;
|
||||
|
||||
char *toc_entry_begin;
|
||||
char *toc_entry_end;
|
||||
|
||||
char *index_entry_begin;
|
||||
char *index_entry_end;
|
||||
|
||||
/* XX These should really be replaced by references
|
||||
* to one of the charsets.
|
||||
*/
|
||||
struct {
|
||||
const char *bullet;
|
||||
const char *left_quote;
|
||||
const char *right_quote;
|
||||
const char *left_dbl_quote;
|
||||
const char *right_dbl_quote;
|
||||
const char *nonbreaking_space;
|
||||
const char *emdash;
|
||||
const char *endash;
|
||||
const char *lessthan;
|
||||
const char *greaterthan;
|
||||
const char *amp;
|
||||
const char *copyright;
|
||||
const char *trademark;
|
||||
char *nonbreaking_hyphen;
|
||||
char *optional_hyphen;
|
||||
} chars;
|
||||
|
||||
const char **ascii_translation_table;
|
||||
|
||||
int simulate_small_caps : 1;
|
||||
int simulate_all_caps : 1;
|
||||
int simulate_word_underline : 1;
|
||||
|
||||
const char **ansi_translation_table;
|
||||
short ansi_first_char;
|
||||
short ansi_last_char;
|
||||
const char **cp437_translation_table;
|
||||
short cp437_first_char;
|
||||
short cp437_last_char;
|
||||
const char **cp850_translation_table;
|
||||
short cp850_first_char;
|
||||
short cp850_last_char;
|
||||
const char **mac_translation_table;
|
||||
short mac_first_char;
|
||||
short mac_last_char;
|
||||
#if 1 /* daved 0.20.0 */
|
||||
unsigned int unisymbol1_first_char;
|
||||
unsigned int unisymbol1_last_char;
|
||||
const char **unisymbol1_translation_table;
|
||||
unsigned int unisymbol2_first_char;
|
||||
unsigned int unisymbol2_last_char;
|
||||
const char **unisymbol2_translation_table;
|
||||
unsigned int unisymbol3_first_char;
|
||||
unsigned int unisymbol3_last_char;
|
||||
const char **unisymbol3_translation_table;
|
||||
unsigned int unisymbol4_first_char;
|
||||
unsigned int unisymbol4_last_char;
|
||||
const char **unisymbol4_translation_table;
|
||||
#else
|
||||
#if 1 /* daved 0.19.4 unicode support */
|
||||
short unisymbol1_first_char;
|
||||
short unisymbol1_last_char;
|
||||
char **unisymbol1_translation_table;
|
||||
short unisymbol2_first_char;
|
||||
short unisymbol2_last_char;
|
||||
char **unisymbol2_translation_table;
|
||||
short unisymbol3_first_char;
|
||||
short unisymbol3_last_char;
|
||||
char **unisymbol3_translation_table;
|
||||
#endif
|
||||
#if 1 /* daved 0.19.5 more unicode support */
|
||||
short unisymbol4_first_char;
|
||||
short unisymbol4_last_char;
|
||||
char **unisymbol4_translation_table;
|
||||
#endif
|
||||
#endif
|
||||
#if 1 /* daved 0.19.5 SYMBOL font support */
|
||||
short symbol_first_char;
|
||||
short symbol_last_char;
|
||||
const char **symbol_translation_table;
|
||||
#endif
|
||||
#if 1 /* daved 0.20.3 GREEK font support */
|
||||
short greek_first_char;
|
||||
short greek_last_char;
|
||||
const char **greek_translation_table;
|
||||
#endif
|
||||
|
||||
char *(*unisymbol_print) (unsigned short);
|
||||
|
||||
void (*write_set_foreground) (int,int,int);
|
||||
}
|
||||
OutputPersonality;
|
||||
|
||||
|
||||
extern OutputPersonality* op_create(void);
|
||||
extern void op_free (OutputPersonality*);
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
extern const char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int, int);
|
||||
#else
|
||||
extern char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int);
|
||||
#endif
|
||||
|
||||
extern void op_begin_std_fontsize (OutputPersonality*, int);
|
||||
extern void op_end_std_fontsize (OutputPersonality*, int);
|
||||
|
||||
|
||||
#define _OUTPUT
|
||||
#endif
|
||||
|
||||
@@ -1,472 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001 Zachary Thayer Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The author is reachable by electronic mail at tuorfa@yahoo.com.
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: parse
|
||||
* Author name: Zach Smith
|
||||
* Create date: 01 Sep 00
|
||||
* Purpose: Parsing of the RTF file into a structure of Word objects.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 15 Oct 00, tuorfa@yahoo.com: parse.c created with functions taken from word.c
|
||||
* 15 Oct 00, tuorfa@yahoo.com: backslash before newline is now \par
|
||||
* 08 Apr 01, tuorfa@yahoo.com: removed limit on word length
|
||||
* 03 Aug 01, tuorfa@yahoo.com: added input buffering
|
||||
* 19 Sep 01, tuorfa@yahoo.com: cleaned up read_word()
|
||||
* 22 Sep 01, tuorfa@yahoo.com: moved word_dump() to word.c
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 08 Sep 03, daved@physiol.usyd.edu.au: type fixes; ANSI C fixes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_CTYPE_H
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
#include "parse.h"
|
||||
#include "ur_malloc.h"
|
||||
#include "main.h"
|
||||
#include "error.h"
|
||||
#include "word.h"
|
||||
#include "hash.h"
|
||||
|
||||
|
||||
|
||||
/* local to getchar stuff */
|
||||
#if 0 /* daved - 0.19.0 */
|
||||
static int ungot_char=-1;
|
||||
static int ungot_char2=-1;
|
||||
static int ungot_char3=-1;
|
||||
#else
|
||||
static int ungot_char = -1;
|
||||
static int ungot_char2 = -1;
|
||||
static int ungot_char3 = -1;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: my_unget_char
|
||||
* Purpose: My own unget routine, handling up to 3 ungot characters.
|
||||
* Args: Character.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
static void my_unget_char (int ch)
|
||||
{
|
||||
if (ungot_char>=0 && ungot_char2>=0 && ungot_char3>=0)
|
||||
error_handler("More than 3 ungot chars");
|
||||
|
||||
ungot_char3 = ungot_char2;
|
||||
ungot_char2 = ungot_char;
|
||||
ungot_char = ch;
|
||||
}
|
||||
|
||||
|
||||
static int last_returned_ch=0;
|
||||
|
||||
|
||||
#define READ_BUF_LEN 2048
|
||||
static int buffer_size = 0;
|
||||
static char *read_buf = NULL;
|
||||
static int read_buf_end = 0;
|
||||
static int read_buf_index = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: my_getchar
|
||||
* Purpose: Gets a character: either an ungot one, or a buffered one.
|
||||
* Args: Input file.
|
||||
* Returns: Character, or EOF.
|
||||
*=======================================================================*/
|
||||
|
||||
static int my_getchar (QBuffer* f)
|
||||
{
|
||||
int ch;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(f);
|
||||
|
||||
if (ungot_char>=0) {
|
||||
ch = ungot_char;
|
||||
#if 0 /* daved - 0.19.0 */
|
||||
ungot_char=ungot_char2;
|
||||
ungot_char2=ungot_char3;
|
||||
ungot_char3=-1;
|
||||
#else
|
||||
ungot_char = ungot_char2;
|
||||
ungot_char2 = ungot_char3;
|
||||
ungot_char3 = -1;
|
||||
#endif
|
||||
last_returned_ch = ch;
|
||||
if(ch > 255)
|
||||
{
|
||||
fprintf(stderr, "returning bad ch = '%c' (0%o)\n",
|
||||
ch, ch);
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
do {
|
||||
if (read_buf_index >= read_buf_end) {
|
||||
if (!read_buf) {
|
||||
buffer_size = READ_BUF_LEN;
|
||||
read_buf = my_malloc (buffer_size);
|
||||
if (!read_buf) {
|
||||
buffer_size /= 4;
|
||||
read_buf = my_malloc (buffer_size);
|
||||
if (!read_buf)
|
||||
error_handler("Cannot allocate read buffer");
|
||||
}
|
||||
}
|
||||
read_buf_end = f->read(read_buf, buffer_size);
|
||||
read_buf_index = 0;
|
||||
if (!read_buf_end)
|
||||
return EOF;
|
||||
}
|
||||
ch = read_buf [read_buf_index++];
|
||||
|
||||
if (ch=='\n') {
|
||||
lineno++;
|
||||
/* Convert \(newline) into \par here */
|
||||
if (last_returned_ch=='\\') {
|
||||
my_unget_char (' ');
|
||||
my_unget_char ('r');
|
||||
my_unget_char ('a');
|
||||
ch = 'p';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (ch=='\r' /* || ch=='\n' */ );
|
||||
|
||||
if (ch=='\t') ch = ' ';
|
||||
|
||||
last_returned_ch = ch;
|
||||
if(ch > 255)
|
||||
{
|
||||
fprintf(stderr,"returning bad ch '%c' (0%o)\n", ch, ch);
|
||||
exit(1);
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
/* local to read_word */
|
||||
static char *input_str = NULL;
|
||||
static unsigned long current_max_length = 1;
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: expand_word_buffer
|
||||
* Purpose: Expands the buffer used to store an incoming word.
|
||||
* This allows us to remove the limit on word length.
|
||||
* Args: None.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
static int
|
||||
expand_word_buffer ()
|
||||
{
|
||||
char *new_ptr;
|
||||
unsigned long old_length;
|
||||
if (!input_str)
|
||||
error_handler("No input buffer allocated");
|
||||
old_length = current_max_length;
|
||||
current_max_length *= 2;
|
||||
new_ptr = my_malloc (current_max_length);
|
||||
if (!new_ptr)
|
||||
error_handler("Out of memory while resizing buffer");
|
||||
|
||||
memcpy (new_ptr, input_str, old_length);
|
||||
my_free(input_str);
|
||||
input_str = new_ptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: read_word
|
||||
* Purpose: The core of the parser, this reads a word.
|
||||
* Args: Input file.
|
||||
* Returns: Number of characters in the word, or zero.
|
||||
* Note: The word buffer is static and local to this file.
|
||||
*=======================================================================*/
|
||||
|
||||
static int
|
||||
read_word (QBuffer*f)
|
||||
{
|
||||
#if 0 /* daved - 0.19.0 */
|
||||
int ch, ch2, ix=0;
|
||||
#else
|
||||
int ch, ch2;
|
||||
unsigned long ix=0;
|
||||
#endif
|
||||
int have_whitespace=false;
|
||||
int is_control_word=false;
|
||||
int has_numeric_param=false; /* if is_control_word==true */
|
||||
int need_unget=false;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(f);
|
||||
|
||||
current_max_length = 10; /* XX */
|
||||
|
||||
/* Get some storage for a word.
|
||||
*/
|
||||
input_str = my_malloc (current_max_length);
|
||||
if (!input_str)
|
||||
error_handler("Cannot allocate word storage");
|
||||
|
||||
do {
|
||||
ch = my_getchar(f);
|
||||
}
|
||||
while (ch=='\n');
|
||||
|
||||
if (ch==' ')
|
||||
{
|
||||
/* Compress multiple space chars down to one.
|
||||
*/
|
||||
while (ch == ' ') {
|
||||
ch = my_getchar(f);
|
||||
have_whitespace=true;
|
||||
}
|
||||
if (have_whitespace) {
|
||||
my_unget_char (ch);
|
||||
input_str[0]=' ';
|
||||
input_str[1]=0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
switch(ch)
|
||||
{
|
||||
case EOF:
|
||||
return 0;
|
||||
|
||||
case '\\':
|
||||
ch2 = my_getchar(f);
|
||||
|
||||
/* Look for two-character command words.
|
||||
*/
|
||||
switch (ch2)
|
||||
{
|
||||
case '\n':
|
||||
strcpy (input_str, "\\par");
|
||||
return 4;
|
||||
case '~':
|
||||
case '{':
|
||||
case '}':
|
||||
case '\\':
|
||||
case '_':
|
||||
case '-':
|
||||
input_str[0] = '\\';
|
||||
input_str[1] = ch2;
|
||||
input_str[2] = 0;
|
||||
return 2;
|
||||
case '\'':
|
||||
/* Preserve \'## expressions (hex char exprs) for later.
|
||||
*/
|
||||
input_str[0]='\\';
|
||||
input_str[1]='\'';
|
||||
ix=2;
|
||||
if(ix==current_max_length) {
|
||||
if (!expand_word_buffer ())
|
||||
error_handler("Word too long");
|
||||
}
|
||||
ch = my_getchar(f);
|
||||
input_str[ix++]=ch;
|
||||
if(ix==current_max_length) {
|
||||
if (!expand_word_buffer ())
|
||||
error_handler("Word too long");
|
||||
}
|
||||
ch = my_getchar(f);
|
||||
input_str[ix++]=ch;
|
||||
if(ix==current_max_length) {
|
||||
if (!expand_word_buffer ())
|
||||
error_handler("Word too long");
|
||||
}
|
||||
input_str[ix]=0;
|
||||
return ix;
|
||||
}
|
||||
|
||||
is_control_word=true;
|
||||
ix=1;
|
||||
input_str[0]=ch;
|
||||
ch=ch2;
|
||||
break;
|
||||
|
||||
case '\t':
|
||||
/* In RTF, a tab char is the same as \tab.
|
||||
*/
|
||||
strcpy (input_str, "\\tab");
|
||||
return 4;
|
||||
|
||||
case '{':
|
||||
case '}':
|
||||
case ';':
|
||||
input_str[0]=ch;
|
||||
input_str[1]=0;
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
while (ch!=EOF)
|
||||
{
|
||||
/* Several chars always ends a word, and we need to save them.
|
||||
*/
|
||||
if (ch=='\t' || ch=='{' || ch=='}' || ch=='\\') {
|
||||
need_unget=true;
|
||||
break;
|
||||
}
|
||||
|
||||
/* A newline always ends a command word; we don't save it.
|
||||
* A newline is ignored if this is not a command word.
|
||||
*/
|
||||
if (ch=='\n') {
|
||||
if (is_control_word)
|
||||
break;
|
||||
ch = my_getchar(f);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* A semicolon always ends a command word; we do save it.
|
||||
* A semicolon never ends a regular word.
|
||||
*/
|
||||
if (ch==';') {
|
||||
if (is_control_word) {
|
||||
need_unget=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* In this parser, a space character terminates
|
||||
* any word, and if it does not follow a command,
|
||||
* then it is a word in itself.
|
||||
*/
|
||||
if (ch==' ') {
|
||||
if (!is_control_word)
|
||||
need_unget=true;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Identify a control word's numeric parameter.
|
||||
*/
|
||||
if (is_control_word) {
|
||||
if (!has_numeric_param && (isdigit(ch) || ch=='-'))
|
||||
has_numeric_param = true;
|
||||
else
|
||||
if (has_numeric_param && !isdigit(ch)) {
|
||||
if (ch!=' ')
|
||||
need_unget=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
input_str[ix++] = ch;
|
||||
if (ix==current_max_length) {
|
||||
if (!expand_word_buffer ())
|
||||
error_handler("Word too long");
|
||||
}
|
||||
ch = my_getchar (f);
|
||||
}
|
||||
|
||||
if (need_unget)
|
||||
my_unget_char(ch);
|
||||
|
||||
input_str[ix]=0;
|
||||
return ix;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: word_read
|
||||
* Purpose: This is the recursive metareader which pieces together the
|
||||
* structure of Word objects.
|
||||
* Args: Input file.
|
||||
* Returns: Tree of Word objects.
|
||||
*=======================================================================*/
|
||||
|
||||
Word *
|
||||
word_read (QBuffer* f) {
|
||||
Word * prev_word = NULL;
|
||||
Word * first_word = NULL;
|
||||
Word * new_word = NULL; /* temp */
|
||||
|
||||
CHECK_PARAM_NOT_NULL(f);
|
||||
|
||||
do {
|
||||
if (!read_word(f))
|
||||
return first_word;
|
||||
|
||||
if (input_str[0] == '{') {
|
||||
/* Process subwords */
|
||||
|
||||
/* Create a dummy word to point to a sublist */
|
||||
new_word = word_new(NULL);
|
||||
if (!new_word)
|
||||
error_handler("Cannot allocate word");
|
||||
|
||||
/* Get the sublist */
|
||||
new_word->child = word_read(f);
|
||||
|
||||
} else if (input_str[0] == '}') {
|
||||
return first_word;
|
||||
} else {
|
||||
new_word = word_new(input_str);
|
||||
}
|
||||
|
||||
if (prev_word)
|
||||
prev_word->next = new_word;
|
||||
|
||||
if (!first_word)
|
||||
first_word = new_word;
|
||||
|
||||
prev_word = new_word;
|
||||
|
||||
/* Free up the memory allocated by read_word. */
|
||||
my_free(input_str);
|
||||
input_str = NULL;
|
||||
} while (1);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: parse.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 15 Oct 2000
|
||||
* Purpose: Definitions and externs for parse.c.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 15 Oct 00, tuorfa@yahoo.com: parse.h created with functions taken from word.c
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#ifndef _WORD
|
||||
#include "word.h"
|
||||
#endif
|
||||
|
||||
|
||||
extern Word *word_read(QBuffer*);
|
||||
|
||||
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: malloc
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Aug 01
|
||||
* Purpose: Memory management. Allows us to keep track of how
|
||||
* much memory is being used.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 14 Aug 01, tuorfa@yahoo.com: added Turbo C support.
|
||||
* 16 Aug 01, Lars Unger <l.unger@tu-bs.de>: added Amiga/GCC support.
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 28 Sep 01, tuorfa@yahoo.com: removed Turbo C support.
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include "ur_malloc.h"
|
||||
|
||||
static unsigned long count=0;
|
||||
|
||||
/*========================================================================
|
||||
* Name: my_malloc
|
||||
* Purpose: Internal version of malloc necessary for record keeping.
|
||||
* Args: Amount.
|
||||
* Returns: Pointer.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
my_malloc (unsigned long size) {
|
||||
char *ptr;
|
||||
|
||||
ptr = (char *) malloc (size);
|
||||
if (ptr)
|
||||
count += size;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/*========================================================================
|
||||
* Name: my_free
|
||||
* Purpose: Internal version of free necessary for record keeping.
|
||||
* Args: Pointer.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
my_free (char* ptr) {
|
||||
CHECK_PARAM_NOT_NULL(ptr);
|
||||
|
||||
free (ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: total_malloced
|
||||
* Purpose: Returns total amount of memory thus far allocated. Called at
|
||||
* the end of main() when in debug mode.
|
||||
* Args: None.
|
||||
* Returns: Amount.
|
||||
*=======================================================================*/
|
||||
|
||||
unsigned long
|
||||
total_malloced (void) {
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: my_strdup
|
||||
* Purpose: Internal version of strdup necessary for record keeping.
|
||||
* Args: String.
|
||||
* Returns: String.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
my_strdup (const char *src) {
|
||||
unsigned long len;
|
||||
char *ptr;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(src);
|
||||
|
||||
len = strlen(src);
|
||||
ptr = my_malloc (len+1);
|
||||
if (!ptr)
|
||||
error_handler ("out of memory in strdup()");
|
||||
|
||||
strcpy (ptr, src);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: malloc
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Aug 2001
|
||||
* Purpose: Definitions for memory management.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
extern char * my_malloc (unsigned long);
|
||||
extern void my_free (char*);
|
||||
extern unsigned long total_malloced (void);
|
||||
extern char * my_strdup (const char*);
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: util
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Aug 01
|
||||
* Purpose: Utility functions.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_CTYPE_H
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: h2toi
|
||||
* Purpose: Converts a 2-digit hexadecimal value to an unsigned integer.
|
||||
* Args: String.
|
||||
* Returns: Integer.
|
||||
*=======================================================================*/
|
||||
|
||||
/* Convert a two-char hexadecimal expression to an integer */
|
||||
int
|
||||
h2toi (char *s) {
|
||||
int tmp;
|
||||
int ch;
|
||||
tmp = tolower(*s++);
|
||||
if (tmp>'9') tmp-=('a'-10);
|
||||
else tmp-='0';
|
||||
ch=16*tmp;
|
||||
tmp = tolower(*s++);
|
||||
if (tmp>'9') tmp-=('a'-10);
|
||||
else tmp-='0';
|
||||
ch+=tmp;
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: util
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Aug 2001
|
||||
* Purpose: Definitions for util module.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
extern int h2toi (char *);
|
||||
@@ -1,217 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: word
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 01 Sep 00
|
||||
* Purpose: Management of Word objects, which contain strings
|
||||
* as well as other Words.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 14 Oct 00, tuorfa@yahoo.com: fixed \fs bug (# is 2X the point size).
|
||||
* 14 Oct 00, tuorfa@yahoo.com: fixed table data printing.
|
||||
* 14 Oct 00, tuorfa@yahoo.com: protection against null entries in \info
|
||||
* 14 Oct 00, tuorfa@yahoo.com: fixed printing of <body> again
|
||||
* 14 Oct 00, tuorfa@yahoo.com: fixed closure of tables
|
||||
* 15 Oct 00, tuorfa@yahoo.com: fixed font attributes preceding <tr><td>
|
||||
* 15 Oct 00, tuorfa@yahoo.com: attributes now continue if >1 \cell in group
|
||||
* 15 Oct 00, tuorfa@yahoo.com: fixed font-size bug, lack of </head>
|
||||
* 7 Nov 00, tuorfa@yahoo.com: fixed \'## translatin bug
|
||||
* 8 Apr 01, tuorfa@yahoo.com: added check for out of memory after malloc
|
||||
* 21 Apr 01, tuorfa@yahoo.com: bug fixes regarding author, date
|
||||
* 21 Apr 01, tuorfa@yahoo.com: added paragraph alignment
|
||||
* 21 Apr 01, tuorfa@yahoo.com: fix for words getting lost after \par
|
||||
* 24 Jul 01, tuorfa@yahoo.com: moved conversion code to convert.c
|
||||
* 22 Sep 01, tuorfa@yahoo.com: moved word_dump to here from parse.c
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 11 Jan 07, jasp00@users.sourceforge.net: optimized unsafe loop
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_CTYPE_H
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef LMMS_HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "defs.h"
|
||||
#include "parse.h"
|
||||
#include "ur_malloc.h"
|
||||
#include "main.h"
|
||||
#include "error.h"
|
||||
#include "word.h"
|
||||
#include "hash.h"
|
||||
|
||||
|
||||
/* For word_dump */
|
||||
static int indent_level=0;
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: word_string
|
||||
* Purpose: Obtains the string of a Word object. This involves accessing
|
||||
* the Word hash.
|
||||
* Args: Word*.
|
||||
* Returns: String.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
word_string (Word *w) {
|
||||
char *str;
|
||||
CHECK_PARAM_NOT_NULL(w);
|
||||
if (w->hash_index) str = hash_get_string (w->hash_index);
|
||||
else str = NULL;
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: word_new
|
||||
* Purpose: Instantiates a new Word object.
|
||||
* Args: String.
|
||||
* Returns: Word*.
|
||||
*=======================================================================*/
|
||||
|
||||
Word *
|
||||
word_new (char *str) {
|
||||
Word * w;
|
||||
|
||||
w = (Word *) my_malloc(sizeof(Word));
|
||||
if (!w)
|
||||
error_handler ("out of memory");
|
||||
memset ((void*) w, 0, sizeof(Word));
|
||||
if (!w) error_handler ("cannot allocate a Word");
|
||||
|
||||
if (str) w->hash_index = hash_get_index (str);
|
||||
else w->hash_index = 0;
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: word_free
|
||||
* Purpose: Deallocates a Word object. This is only called at the end of
|
||||
* main(), after everything is processed and output complete.
|
||||
* Args: Word.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void word_free (Word *w) {
|
||||
Word *prev;
|
||||
Word *w2;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(w);
|
||||
|
||||
while (w) {
|
||||
w2 = w->child;
|
||||
if (w2)
|
||||
word_free(w2);
|
||||
|
||||
prev = w;
|
||||
w = w->next;
|
||||
my_free((char*) prev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: print_indentation
|
||||
* Purpose: Prints padding for the word_dump routine.
|
||||
* Args: Identation level.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
static void
|
||||
print_indentation (int level)
|
||||
{
|
||||
if (level) {
|
||||
/* indent in multiples of 2 */
|
||||
level = (level >> 1) + (level & 1);
|
||||
while (level-- > 0)
|
||||
printf (". ");
|
||||
} else {
|
||||
printf ("\n-----------------------------------------------------------------------\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: word_dump
|
||||
* Purpose: Recursive diagnostic routine to print out a tree of words.
|
||||
* Args: Word tree.
|
||||
* Returns: None.
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
word_dump (Word *w)
|
||||
{
|
||||
char *s;
|
||||
|
||||
CHECK_PARAM_NOT_NULL(w);
|
||||
|
||||
printf ("\n");
|
||||
indent_level += 2;
|
||||
print_indentation (indent_level);
|
||||
|
||||
while (w) {
|
||||
s = word_string (w);
|
||||
if (s) {
|
||||
printf ("\"%s\" ", s);
|
||||
} else {
|
||||
if (w->child) {
|
||||
word_dump (w->child);
|
||||
printf ("\n");
|
||||
print_indentation (indent_level);
|
||||
}
|
||||
else
|
||||
warning_handler ("Word object has no string and no children");
|
||||
}
|
||||
w = w->next;
|
||||
}
|
||||
|
||||
indent_level -= 2;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*=============================================================================
|
||||
GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
Copyright (C) 2000,2001,2004 by Zachary Smith
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
|
||||
=============================================================================*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Module name: word.h
|
||||
* Author name: Zachary Smith
|
||||
* Create date: 1 Sept 2000
|
||||
* Purpose: Definitions for Word class.
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _WORD
|
||||
#define _WORD
|
||||
|
||||
class QBuffer;
|
||||
|
||||
typedef struct _w {
|
||||
unsigned long hash_index;
|
||||
struct _w * next;
|
||||
struct _w * child;
|
||||
} Word;
|
||||
|
||||
extern Word* word_new (char*);
|
||||
extern void word_free (Word*);
|
||||
extern Word* word_read (QBuffer*);
|
||||
extern char* word_string (Word*);
|
||||
extern void word_dump (Word*);
|
||||
extern void word_print_html (Word*);
|
||||
|
||||
#define _WORD
|
||||
#endif
|
||||
@@ -191,7 +191,7 @@ bool DataFile::validate( QString extension )
|
||||
extension == "xpf" || extension == "xml" ||
|
||||
( extension == "xiz" && ! pluginFactory->pluginSupportingExtension(extension).isNull()) ||
|
||||
extension == "sf2" || extension == "pat" || extension == "mid" ||
|
||||
extension == "flp" || extension == "dll"
|
||||
extension == "dll"
|
||||
) )
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ImportFilter.cpp - base-class for all import-filters (MIDI, FLP etc)
|
||||
* ImportFilter.cpp - base-class for all import-filters
|
||||
*
|
||||
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
|
||||
@@ -1170,8 +1170,6 @@ void Song::importProject()
|
||||
ConfigManager::inst()->userProjectsDir(),
|
||||
tr("MIDI sequences") +
|
||||
" (*.mid *.midi *.rmi);;" +
|
||||
tr("FL Studio projects") +
|
||||
" (*.flp);;" +
|
||||
tr("Hydrogen projects") +
|
||||
" (*.h2song);;" +
|
||||
tr("All file types") +
|
||||
|
||||
@@ -478,9 +478,6 @@ void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me )
|
||||
embed::getIconPixmap( "vst_plugin_file" ), this );
|
||||
break;
|
||||
case FileItem::MidiFile:
|
||||
// don't allow dragging FLP-files as FLP import filter clears project
|
||||
// without asking
|
||||
// case fileItem::FlpFile:
|
||||
new StringPairDrag( "importedproject", f->fullName(),
|
||||
embed::getIconPixmap( "midi_file" ), this );
|
||||
break;
|
||||
@@ -568,11 +565,6 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it )
|
||||
}
|
||||
|
||||
case FileItem::ImportAsProject:
|
||||
if( f->type() == FileItem::FlpFile &&
|
||||
!gui->mainWindow()->mayChangeProject(true) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
ImportFilter::import( f->fullName(),
|
||||
Engine::getSong() );
|
||||
break;
|
||||
@@ -853,7 +845,6 @@ QPixmap * FileItem::s_sampleFilePixmap = NULL;
|
||||
QPixmap * FileItem::s_soundfontFilePixmap = NULL;
|
||||
QPixmap * FileItem::s_vstPluginFilePixmap = NULL;
|
||||
QPixmap * FileItem::s_midiFilePixmap = NULL;
|
||||
QPixmap * FileItem::s_flpFilePixmap = NULL;
|
||||
QPixmap * FileItem::s_unknownFilePixmap = NULL;
|
||||
|
||||
|
||||
@@ -918,12 +909,6 @@ void FileItem::initPixmaps( void )
|
||||
"midi_file", 16, 16 ) );
|
||||
}
|
||||
|
||||
if( s_flpFilePixmap == NULL )
|
||||
{
|
||||
s_flpFilePixmap = new QPixmap( embed::getIconPixmap(
|
||||
"midi_file", 16, 16 ) );
|
||||
}
|
||||
|
||||
if( s_unknownFilePixmap == NULL )
|
||||
{
|
||||
s_unknownFilePixmap = new QPixmap( embed::getIconPixmap(
|
||||
@@ -951,9 +936,6 @@ void FileItem::initPixmaps( void )
|
||||
case MidiFile:
|
||||
setIcon( 0, *s_midiFilePixmap );
|
||||
break;
|
||||
case FlpFile:
|
||||
setIcon( 0, *s_flpFilePixmap );
|
||||
break;
|
||||
case UnknownFile:
|
||||
default:
|
||||
setIcon( 0, *s_unknownFilePixmap );
|
||||
@@ -997,11 +979,6 @@ void FileItem::determineFileType( void )
|
||||
m_type = MidiFile;
|
||||
m_handling = ImportAsProject;
|
||||
}
|
||||
else if( ext == "flp" )
|
||||
{
|
||||
m_type = FlpFile;
|
||||
m_handling = ImportAsProject;
|
||||
}
|
||||
else if( ext == "dll" )
|
||||
{
|
||||
m_type = VstPluginFile;
|
||||
|
||||
@@ -108,7 +108,7 @@ MainWindow::MainWindow() :
|
||||
sideBar->appendTab( new FileBrowser(
|
||||
confMgr->userProjectsDir() + "*" +
|
||||
confMgr->factoryProjectsDir(),
|
||||
"*.mmp *.mmpz *.xml *.mid *.flp",
|
||||
"*.mmp *.mmpz *.xml *.mid",
|
||||
tr( "My Projects" ),
|
||||
embed::getIconPixmap( "project_file" ).transformed( QTransform().rotate( 90 ) ),
|
||||
splitter, false, true ) );
|
||||
|
||||
Reference in New Issue
Block a user