Compare commits

..

34 Commits

Author SHA1 Message Date
Stefan Ginsberg
1e84f2f723 - Implement ExEnterCriticalRegionAndAcquireResourceShared and ExEnterCriticalRegionAndAcquireSharedWaitForExclusive
- Add missing prototypes to the NDK

svn path=/branches/nwin32/; revision=36654
2008-10-05 12:21:55 +00:00
Stefan Ginsberg
bb1039c37a - Register all Win32 callouts/procedures (just stubs for now though)
svn path=/branches/nwin32/; revision=36640
2008-10-04 10:16:39 +00:00
Stefan Ginsberg
ce21e3dfcd - Preliminary work on win32k's internal headers
svn path=/branches/nwin32/; revision=36629
2008-10-02 19:39:28 +00:00
Stefan Ginsberg
d4da6b68f6 - Clean up ntuser.h and review all NtUser* prototypes. Fixed parameters and return types where I could, and added VERIFY tags for stuff needing more research. Untagged routines should now be compatible, or properly mark unknown fields as unknown instead of having ros-specific stuff there
- Move types into ntusrtyp.h
- Disable user32 code which used incompatible types/routines
- Remove PrivateCsrssManualGuiCheck and PrivateCsrssInitialized exports

svn path=/branches/nwin32/; revision=36628
2008-10-02 17:55:06 +00:00
Stefan Ginsberg
a1beed22ff - Remove ntgdibad.h
svn path=/branches/nwin32/; revision=36626
2008-10-02 13:42:49 +00:00
Stefan Ginsberg
b81720add3 - NtGdiInit is called from GdiDllInitialize but doesn't actually do anything -- reflect this in the stub
svn path=/branches/nwin32/; revision=36625
2008-10-02 13:41:41 +00:00
Stefan Ginsberg
b814aff84b - Add missing APIENTRY to ntgdi.h, syscalls are always stdcall.
- Update gdi32 after NtGdiDoPalette change
- Add parameters for NtGdiGetSpoolMessage

svn path=/branches/nwin32/; revision=36624
2008-10-02 13:33:51 +00:00
Stefan Ginsberg
e92190b229 - Fix the last ntgdi.h issue -- MS' ntgdi.h defines 2 NtGdiDoPalette argument types slightly wrong, so we must do so too. Add a note about this in the function as it is just a matter of cast
svn path=/branches/nwin32/; revision=36590
2008-09-29 13:16:17 +00:00
Stefan Ginsberg
2c6183779e - Sync Timo's float changes in winddi.h, ntgdityp.h and ntgdihdl.h to trunk
- Make ntgdi.h more compatible with MS' version -- Define POLYPATBLT and the spooler routines internally, and don't define NtGdiFlushUserBatch outside win32k (not a system call since 2K3)

svn path=/branches/nwin32/; revision=36589
2008-09-29 12:45:22 +00:00
Stefan Ginsberg
39acdd200f - Add missing PsGetThreadTeb
svn path=/branches/nwin32/; revision=36588
2008-09-29 12:05:59 +00:00
Stefan Ginsberg
e73749cba2 - Fix formatting
svn path=/branches/nwin32/; revision=36517
2008-09-25 18:21:20 +00:00
Stefan Ginsberg
6041cbddbc - Delete todo.c. It was a personal scratchpad which wasn't supposed to be committed
svn path=/branches/nwin32/; revision=36516
2008-09-25 18:17:08 +00:00
Stefan Ginsberg
67eb073277 - Implement EngSet/GetLastError
svn path=/branches/nwin32/; revision=36515
2008-09-25 18:15:35 +00:00
Stefan Ginsberg
d208555cc8 - EngCreateEvent: Don't allocate with zero tag
- EngAllocMem: Make sure we get a tag
- Misc cleanup

svn path=/branches/nwin32/; revision=36266
2008-09-16 11:57:24 +00:00
Stefan Ginsberg
eb3dfb8506 - Get gdi32 and user32 to compile again
- Update some system call prototypes and definitions

svn path=/branches/nwin32/; revision=35697
2008-08-27 14:22:38 +00:00
Stefan Ginsberg
d6dcf6c80f - Sync ntgdi.h to trunk, and add missing APIENTRY for a couple of functions
svn path=/branches/nwin32/; revision=35627
2008-08-25 14:04:24 +00:00
Stefan Ginsberg
801dc4bd0a - Put NtUser* stubs into separate files. Still a bit messy, but now there is some form of layout at least.
- Update some function prototypes which changed between XP and 2003

svn path=/branches/nwin32/; revision=35185
2008-08-08 15:42:17 +00:00
Stefan Ginsberg
00158633a4 - Put NtGdi* stubs in separate files.
svn path=/branches/nwin32/; revision=35160
2008-08-07 15:39:03 +00:00
Stefan Ginsberg
c138ef77cf - Move Direct Draw syscall stubs to /ntddraw/
- Make ros ntgdi.h more compatible with the official header (fix two prototypes)

svn path=/branches/nwin32/; revision=35148
2008-08-06 16:55:07 +00:00
Aleksey Bragin
09ff356c6e - Update with 3 more additional (only available in a checked build) syscalls.
svn path=/branches/nwin32/; revision=35031
2008-08-02 11:53:54 +00:00
Stefan Ginsberg
74e5217653 - Silence 600+ warnings by returning something in non-void functions
- Fix some NtUser* prototypes

svn path=/branches/nwin32/; revision=34927
2008-07-29 15:41:03 +00:00
Aleksey Bragin
38c5c13076 - Update syscall table to completely match win2003sp1.
- Add missing stubs.

svn path=/branches/nwin32/; revision=34898
2008-07-28 11:32:04 +00:00
Aleksey Bragin
9a923c7a7d - Implement NtGdiInit(), now loading goes further.
svn path=/branches/nwin32/; revision=34746
2008-07-24 14:37:56 +00:00
Aleksey Bragin
e4ec3e139a - Add Win32 callouts stubs and register them. Boot process now stops due inability to load winsrv.dll.
svn path=/branches/nwin32/; revision=34687
2008-07-22 18:00:23 +00:00
Aleksey Bragin
e21cdd1f5a - Split stubs.c to User and Gdi stubs.c
- Rework stubs into proper declaration stubs (but still without return values, so compilation results in lots of warnings).

svn path=/branches/nwin32/; revision=34686
2008-07-22 17:43:56 +00:00
Aleksey Bragin
17e5293775 - Stub all win32k syscalls, by Olaf Siejka.
svn path=/branches/nwin32/; revision=34684
2008-07-22 16:30:26 +00:00
Aleksey Bragin
a130dca50c - Implement a minimal DriverEntry (the first called function).
- Add a syscall table and register it.
- Further improve win32k.h to actually include all what's needed, and still compile with MSVC just fine (but using ReactOS's psk/ntgdi.h instead of MS's PSDK).
- Doesn't link since 660+ syscalls are not stubbed.
- Some fixes in the VC project file.

svn path=/branches/nwin32/; revision=34681
2008-07-22 11:42:33 +00:00
Aleksey Bragin
265c49bc71 - Merge 34679.
svn path=/branches/nwin32/; revision=34680
2008-07-22 11:26:59 +00:00
Aleksey Bragin
924d215050 - Merge 34676.
svn path=/branches/nwin32/; revision=34677
2008-07-22 10:39:45 +00:00
Aleksey Bragin
9b33d2d77b - Rewrite the header file to achieve better compatibility.
- Add project/solution for compiling with MSVC (it actually compiles and links), the project file is a tweaked rbuild-generated one.

svn path=/branches/nwin32/; revision=34648
2008-07-21 21:37:38 +00:00
Aleksey Bragin
4619502de1 - Commit totally stubbed win32k by Stefan Ginsberg.
svn path=/branches/nwin32/; revision=34646
2008-07-21 21:00:16 +00:00
Aleksey Bragin
09b3cdc303 - Clean unneeded files from win32k module.
svn path=/branches/nwin32/; revision=34645
2008-07-21 20:56:30 +00:00
Aleksey Bragin
ce8dafec6e - Cleanup the branch from unneeded components.
svn path=/branches/nwin32/; revision=34643
2008-07-21 19:45:05 +00:00
Aleksey Bragin
ae8b89458c - Create a place for some additional research work on Win32-subsystem.
svn path=/branches/nwin32/; revision=34639
2008-07-21 15:54:57 +00:00
26039 changed files with 1265471 additions and 8765823 deletions

341
COPYING Normal file
View File

@@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <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 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -2,30 +2,26 @@ ReactOS is available thanks to the work of:
Aleksey Bragin <aleksey at reactos org>
Alex Ionescu <alex.ionescu@reactos.org>
Amine Khaldi <amine.khaldi@reactos.org>
Andrew Greenwood <lists@silverblade.co.uk>
Andrew Munger <waxdragon@gmail.com>
Arindam Das
Art Yerkes <ayerkes@speakeasy.net>
Boudewijn Dekker (Ariadne)
Ariadne
Brandon Turner <turnerb7@msu.edu>
Brian Palmer <brianp@sginet.com>
Cameron M. Gutman <cgutman@reactos.org>
Casper S. Hornstrup <chorns@users.sourceforge.net>
Christoph von Wittich <christoph_vw@reactos.org>
Colin Finck <colin@reactos.org>
Daniel Reimer <reimer.daniel@freenet.de>
David Welch <welch@cwcom.net>
Dmitry Chapyshev <dmitry@reactos.org>
Emanuele Aliberti <ea@iol.it>
Eric Kohl
Eric Kohl <ekohl@rz-online.de>
Eugene Ingerman <geneing@myrealbox.com>
Filip Navara <xnavara@volny.cz>
Frederik Leemans
Ge van Geldorp <ge@gse.nl>
Ged Murphy <gedmurphy@reactos.org>
Gregor Brunmar <gregor brunmar at home se>
Gregor Schneider <grschneider@gmail.com>
Guido de Jong
Gunnar Andre' Dalsnes <hardon@online.no>
Hans Kremer
@@ -33,14 +29,14 @@ Hartmut Birr <hartmut.birr@gmx.de>
Hernan Ochoa
Herve Poussineau <hpoussin@reactos.com>
Iwan Fatahi <i_fatahi@hotmail.com>
James Tabor <james.tabor@reactos.org> <jimtabor.rosdev@gmail.com> <jamestabor_rosdev@yahoo.com>
James B. Tabor <jimtabor.rosdev@gmail.com> <jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net>
Jason Eager
Jason Filby <jasonfilby@yahoo.com>
Jason Weiler
Jean Michault
Jeffrey Morlan <mrnobo1024@yahoo.com>
Jim Noeth
Johannes Anderwald <johannes.anderwald@reactos.org>
Johannes Anderwald <johannes.anderwald@student.tugraz.at>
Jonathan Wilson <jonwil@tpgi.com.au>
Jurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
KJK::Hyperion <noog@libero.it>
@@ -51,7 +47,6 @@ Mark Tempel <mtempel@visi.com>
Mark Weaver <mark@npsl.co.uk>
Martin Fuchs <martin-fuchs@gmx.net>
Marty Dill <mdill@uvic.ca>
Matthias Kupfer <mkupfer@reactos.org>
Matt Pyne
Mike Nordell <"tamlin">
Nathan Woods <npwoods@mess.org>
@@ -60,16 +55,14 @@ Paolo Pantaleo <paolopan@freemail.it>
Peter Ward <dralnix@gmail.com>
Pierre Schweitzer <pschweitzer@reactos.org>
Phillip Susi <phreak@iag.net>
Rafal Harabien <rafalh@reactos.org>
Rex Jolliff <rex@lvcablemodem.com>
Richard Campbell <betam4x@gmail.com>
Robert Bergkvist <fragdance@hotmail.com>
Robert Dickenson <robd@reactos.org>
Royce Mitchell III <royce3@ev1.net>
Samuel Serapión <samdwise51@gmail.com>
Saveliy Tretiakov <saveliyt@mail.ru>
Stefan Ginsberg <stefan.ginsberg@reactos.org>
Steven Edwards <winehacker@gmail.com>
Stefan Ginsberg <stefan__100__@hotmail.com>
Steven Edwards <steven_ed4153@yahoo.com>
Thomas Weidenmueller <w3seek@users.sourceforge.net>
Timo Kreuzer <timo.kreuzer@reactos.org>
Victor Kirhenshtein <sauros@iname.com>

1309
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

80
INSTALL Normal file
View File

@@ -0,0 +1,80 @@
1. Build environment
To build the system you need either mingw32 installed on Windows or a mingw32
cross compiler running on unix. You may obtain MinGW binaries that build
ReactOS from http://www.reactos.org/.
2. Building ReactOS
2.1 Building the binaries
To build ReactOS run 'make' (without the quotes) if you are building on Linux
or 'mingw32-make' if you are building on Windows (or ReactOS) from the top
directory. If you are using RosBE, follow on-screen instructions.
2.2 Building a bootable CD image
To build a bootable CD image run 'make bootcd' (without the quotes) if you are
building on Linux or 'mingw32-make bootcd' if you are building on Windows (or
ReactOS) from the top directory. This will create a CD image with a filename,
ReactOS.iso, in the top directory.
3. Installation
ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
as the active (bootable) partition. The partition on which ReactOS is to be
installed (which may or may not be the bootable partition) must also be
formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
needed.
ReactOS can be installed from the source distribution or from the bootable CD
distribution. The two ways to install ReactOS are explained below.
3.1 Installation from sources
If you don't have an existing ReactOS installation you want to upgrade, then
build a bootable CD as described above. Burn the CD image, boot from it, and
follow the instructions to install ReactOS.
If you have an existing ReactOS installation you want to upgrade, then to
install ReactOS after building it, type 'make install' or
'mingw32-make install'. This will create the directory 'reactos' in the top
directory. Copy the contents of this directory over the existing installation.
If you don't want to copy the files manually every time you run a
'make install' or 'mingw32-make install', then you can specify the directory
where the files are to be copied to during installation.
Set the ROS_INSTALL environment variable. If you are on Windows this could be
done by:
set ROS_INSTALL=c:\reactos
If you are on Linux this could be done by:
export ROS_INSTALL=/mnt/windows/reactos
Now run 'make install' or 'mingw32-make install' to install the files to the
new location.
3.2 Installation from bootable CD distribution
To install ReactOS from the bootable CD distribution, extract the archive
contents. Then burn the CD image, boot from it, and follow instructions.
5. Help
If you run into problems or have suggestions for making ReactOS better, please
visit the address below. Mailing lists are available for a variety of topics,
bugs should be submitted to bugzilla and general chat takes place in the forums,
or #reactos on freenode
http://www.reactos.org/
ReactOS Development Team

504
LGPL.txt Normal file
View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

594
Makefile Normal file
View File

@@ -0,0 +1,594 @@
# Well-known targets:
#
# all (default target)
# This target builds all of ReactOS.
#
# module
# These targets builds a single module. Replace module with the name of
# the module you want to build.
#
# bootcd
# This target builds an ISO (ReactOS.iso) from which ReactOS can be booted
# and installed.
#
# livecd
# This target builds an ISO (ReactOS-Live.iso) from which ReactOS can be
# booted, but not installed.
#
# install
# This target installs all of ReactOS to a location specified by the
# ROS_INSTALL environment variable.
#
# module_install
# These targets installs a single module to a location specified by the
# ROS_INSTALL environment variable. Replace module with the name of the
# module you want to install.
#
# clean
# This target cleans (deletes) all files that are generated when building
# ReactOS.
#
# module_clean
# These targets cleans (deletes) files that are generated when building a
# single module. Replace module with the name of the module you want to
# clean.
#
# depends
# This target does a complete dependency check of the ReactOS codebase.
# This can require several minutes to complete. If you only need to check
# dependencies for a single or few modules then you can use the
# module_depends targets instead. This target can also repair a damaged or
# missing makefile-{ROS_ARCH}.auto if needed.
#
# module_depends
# These targets do a dependency check of individual modules. Replace module
# with the name of the module for which you want to check dependencies.
# This is faster than the depends target which does a complete dependency
# check of the ReactOS codebase.
#
#
# Accepted environment variables:
#
# ROS_ARCH
# This variable specifies the name of the architecture to build ReactOS for.
# The variable defaults to i386.
#
# ROS_PREFIX
# This variable specifies the prefix of the MinGW installation. On Windows
# a prefix is usually not needed, but on linux it is usually "mingw32". If
# not present and no executable named "gcc" can be found, then the prefix is
# assumed to be "mingw32". If your gcc is named i386-mingw32-gcc then set
# ROS_PREFIX to i386-mingw32. Don't include the dash (-) before gcc.
#
# ROS_INTERMEDIATE
# This variable controls where to put intermediate files. Intermediate
# files are generated files that are needed to generate the final
# output files. Examples of intermediate files include *.o, *.a, and
# *.coff. N.B. Don't put a path separator at the end. The variable
# defaults to .\obj-{ROS_ARCH}.
#
# ROS_OUTPUT
# This variable controls where to put output files. Output files are
# generated files that makes up the result of the build process.
# Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
# put a path separator at the end. The variable defaults to .\output-{ROS_ARCH}.
#
# ROS_CDOUTPUT
# This variable controls the name of the ReactOS directory on cdrom.
# The variable defaults to reactos.
# Warning: setting this value may lead to a not bootable/installable cdrom.
#
# ROS_TEMPORARY
# This variable controls where to put temporary files. Temporary files
# are (usually small) generated files that are needed to generate the
# intermediate or final output files. Examples of temporary files include
# *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put
# a path separator at the end. The variable defaults to {ROS_INTERMEDIATE}
# directory.
#
# ROS_INSTALL
# This variable controls where to install output files to when using
# 'make install'. N.B. Don't put a path separator at the end. The variable
# defaults to .\{ROS_CDOUTPUT}.
#
# ROS_BUILDMAP
# This variable controls if map files are to be generated for executable
# output files. Map files have the extension .map. The value can be either
# full (to build map files with assembly code), yes (to build map files
# without source code) or no (to not build any map files). The variable
# defaults to no.
#
# ROS_BUILDNOSTRIP
# This variable controls if non-symbol-stripped versions are to be built
# of executable output files. Non-symbol-stripped executable output files
# have .nostrip added to the filename just before the extension. The value
# can be either yes (to build non-symbol-stripped versions of executable
# output files) or no (to not build non-symbol-stripped versions of
# executable output files). The variable defaults to no.
#
# ROS_LEAN_AND_MEAN
# This variable controls if all binaries should be stripped out of useless
# data added by GCC/LD as well as of RSYM symbol data. Output binary size
# will go from 80 to 40MB, memory usage from 58 to 38MB and the install CD
# from 18 to 13MB. The variable defaults to no.
#
# ROS_RBUILDFLAGS
# Pass parameters to rbuild.
# -v Be verbose.
# -c Clean as you go. Delete generated files as soon as they are not needed anymore.
# -dd Disable automatic dependencies.
# -dm{module} Check only automatic dependencies for this module.
# -hd Disable precompiled headers.
# -mi Let make handle creation of install directories. Rbuild will not generate the directories.
# -ps Generate proxy makefiles in source tree instead of the output tree.
# -ud Disable compilation units.
# -r Input XML
#
# ROS_AUTOMAKE
# Alternate name of makefile.auto
#
# ROS_BUILDENGINE
# The Build engine to be used. The variable defaults to rbuild (RBUILD_TARGET)
#
# check for versions of make that don't have features we need...
# the function "eval" is only available in 3.80+, which happens to be the minimum
# version that has the features we use...
# THIS CHECK IS BORROWED FROM THE "GMSL" PROJECT, AND IS COVERED BY THE GPL LICENSE
# YOU CAN FIND OUT MORE ABOUT GMSL - A VERY COOL PROJECT - AT:
# http://gmsl.sourceforge.net/
__gmsl_have_eval :=
__gmsl_ignore := $(eval __gmsl_have_eval := T)
ifndef __gmsl_have_eval
$(error ReactOS's makefiles use GNU Make 3.80+ features, you have $(MAKE_VERSION), you MUST UPGRADE in order to build ReactOS - Sorry)
endif
# END of code borrowed from GMSL ( http://gmsl.sourceforge.net/ )
.PHONY: all
.PHONY: clean
.PHONY: world
.PHONY: universe
ifneq ($(ROS_ARCH),)
ARCH := $(ROS_ARCH)
else
ARCH := i386
endif
ifeq ($(ROS_AUTOMAKE),)
ROS_AUTOMAKE=makefile.auto
endif
all: $(ROS_AUTOMAKE)
.SUFFIXES:
ifeq ($(HOST),)
ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
export OSTYPE = msys
HOST=mingw32-linux
HOST_CFLAGS+=-fshort-wchar
HOST_CPPFLAGS+=-fshort-wchar
else
HOST=mingw32-windows
endif
else
HOST=mingw32-linux
HOST_CFLAGS+=-fshort-wchar
HOST_CPPFLAGS+=-fshort-wchar
endif
endif
# Default to half-verbose mode
ifeq ($(VERBOSE),no)
Q = @
HALFVERBOSEECHO = no
BUILDNO_QUIET = -q
else
ifeq ($(VERBOSE),full)
Q =
HALFVERBOSEECHO = no
BUILDNO_QUIET =
else
Q = @
HALFVERBOSEECHO = yes
BUILDNO_QUIET = -q
endif
endif
ifeq ($(HOST),mingw32-linux)
QUOTE = "
else
QUOTE =
endif
ifeq ($(HALFVERBOSEECHO),yes)
ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE)
ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE)
ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE)
ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE)
ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE)
ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE)
ECHO_GAS =@echo $(QUOTE)[GAS] $<$(QUOTE)
ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE)
ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE)
ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE)
ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE)
ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE)
ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE)
ECHO_DLLTOOL =@echo $(QUOTE)[DLLTOOL] $@$(QUOTE)
ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE)
ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE)
ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE)
ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE)
ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE)
ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE)
ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE)
ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE)
ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE)
ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE)
ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE)
ECHO_STRIP =@echo $(QUOTE)[STRIP] $@$(QUOTE)
ECHO_RGENSTAT=@echo $(QUOTE)[RGENSTAT] $@$(QUOTE)
else
ECHO_CP =
ECHO_MKDIR =
ECHO_BUILDNO =
ECHO_INVOKE =
ECHO_PCH =
ECHO_CC =
ECHO_GAS =
ECHO_NASM =
ECHO_AR =
ECHO_WINEBLD =
ECHO_WRC =
ECHO_WIDL =
ECHO_BIN2RES =
ECHO_DLLTOOL =
ECHO_LD =
ECHO_NM =
ECHO_OBJDUMP =
ECHO_RBUILD =
ECHO_RSYM =
ECHO_WMC =
ECHO_NCI =
ECHO_CABMAN =
ECHO_CDMAKE =
ECHO_MKHIVE =
ECHO_REGTESTS=
ECHO_TEST =
ECHO_GENDIB =
ECHO_STRIP =
ECHO_RGENSTAT=
endif
# Set host compiler/linker
ifeq ($(HOST_CC),)
HOST_CC = gcc
endif
ifeq ($(HOST_CPP),)
HOST_CPP = g++
endif
host_gcc = $(Q)$(HOST_CC)
host_gpp = $(Q)$(HOST_CPP)
host_ld = $(Q)ld
host_ar = $(Q)ar
host_objcopy = $(Q)objcopy
# Set target compiler/linker
ifneq ($(ROS_PREFIX),)
PREFIX_ := $(ROS_PREFIX)-
else
ifeq ($(HOST),mingw32-linux)
PREFIX_ := mingw32-
else
PREFIX_ :=
endif
endif
ifeq ($(TARGET_CC),)
TARGET_CC = $(PREFIX_)gcc
endif
ifeq ($(TARGET_CPP),)
TARGET_CPP = $(PREFIX_)g++
endif
gcc = $(Q)$(TARGET_CC)
gpp = $(Q)$(TARGET_CPP)
ld = $(Q)$(PREFIX_)ld
nm = $(Q)$(PREFIX_)nm
objdump = $(Q)$(PREFIX_)objdump
ar = $(Q)$(PREFIX_)ar
objcopy = $(Q)$(PREFIX_)objcopy
dlltool = $(Q)$(PREFIX_)dlltool
strip = $(Q)$(PREFIX_)strip
windres = $(Q)$(PREFIX_)windres
# Set utilities
ifeq ($(OSTYPE),msys)
HOST=mingw32-linux
endif
ifeq ($(HOST),mingw32-linux)
ifeq ($(OSTYPE),msys)
export EXEPOSTFIX = .exe
else
export EXEPOSTFIX =
endif
export SEP = /
mkdir = -$(Q)mkdir -p
rm = $(Q)rm -f
cp = $(Q)cp
NUL = /dev/null
else # mingw32-windows
export EXEPOSTFIX = .exe
ROS_EMPTY =
export SEP = \$(ROS_EMPTY)
mkdir = -$(Q)mkdir
rm = $(Q)del /f /q
cp = $(Q)copy /y
NUL = NUL
endif
ifneq ($(ROS_INTERMEDIATE),)
INTERMEDIATE := $(ROS_INTERMEDIATE)
else
INTERMEDIATE := obj-$(ARCH)
endif
INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
ifneq ($(ROS_OUTPUT),)
OUTPUT := $(ROS_OUTPUT)
else
OUTPUT := output-$(ARCH)
endif
OUTPUT_ := $(OUTPUT)$(SEP)
ifneq ($(ROS_CDOUTPUT),)
CDOUTPUT := $(ROS_CDOUTPUT)
else
CDOUTPUT := reactos
endif
CDOUTPUT_ := $(CDOUTPUT)$(SEP)
ifneq ($(ROS_TEMPORARY),)
TEMPORARY := $(ROS_TEMPORARY)
else
TEMPORARY := $(INTERMEDIATE)
endif
TEMPORARY_ := $(TEMPORARY)$(SEP)
ifneq ($(ROS_INSTALL),)
INSTALL := $(ROS_INSTALL)
else
INSTALL := $(CDOUTPUT)
endif
INSTALL_ := $(INSTALL)$(SEP)
RBUILD_FLAGS := -rReactOS-$(ARCH).rbuild -DARCH=$(ARCH)
$(INTERMEDIATE):
$(ECHO_MKDIR)
${mkdir} $@
ifneq ($(INTERMEDIATE),$(OUTPUT))
$(OUTPUT):
$(ECHO_MKDIR)
${mkdir} $@
endif
ifneq ($(TEMPORARY),$(INTERMEDIATE))
ifneq ($(TEMPORARY),$(OUTPUT))
$(TEMPORARY):
$(ECHO_MKDIR)
${mkdir} $@
endif
endif
BUILDNO_H = $(INTERMEDIATE_)include$(SEP)reactos$(SEP)buildno.h
include lib/lib.mak
include tools/tools.mak
-include $(ROS_AUTOMAKE)
PREAUTO := \
$(BIN2C_TARGET) \
$(BIN2RES_TARGET) \
$(BUILDNO_H) \
$(GENDIB_DIB_FILES) \
$(NCI_SERVICE_FILES)
ifeq ($(ARCH),powerpc)
PREAUTO += $(OFW_INTERFACE_SERVICE_FILES) $(PPCMMU_TARGETS)
endif
ifeq ($(ROS_BUILDENGINE),)
ROS_BUILDENGINE=$(RBUILD_TARGET)
endif
$(ROS_AUTOMAKE): $(ROS_BUILDENGINE) $(XMLBUILDFILES) | $(PREAUTO)
${mkdir} $(OUTPUT_)media$(SEP)inf 2>$(NUL)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw
world: all bootcd livecd
universe:
$(MAKE) KDBG=1 DBG=1 \
ROS_AUTOMAKE=makefile-$(ARCH)-kd.auto \
ROS_INSTALL=reactos-$(ARCH)-kd \
ROS_INTERMEDIATE=obj-$(ARCH)-kd \
ROS_OUTPUT=output-$(ARCH)-kd \
world
$(MAKE) KDBG=0 DBG=1 \
ROS_AUTOMAKE=makefile-$(ARCH)-d.auto \
ROS_INSTALL=reactos-$(ARCH)-d \
ROS_INTERMEDIATE=obj-$(ARCH)-d \
ROS_OUTPUT=output-$(ARCH)-d \
world
$(MAKE) KDBG=0 DBG=0 \
ROS_AUTOMAKE=makefile-$(ARCH)-r.auto \
ROS_INSTALL=reactos-$(ARCH)-r \
ROS_INTERMEDIATE=obj-$(ARCH)-r \
ROS_OUTPUT=output-$(ARCH)-r \
world
sysregtest:
$(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)txtmode.cfg
.PHONY: rgenstat
rgenstat: $(RGENSTAT_TARGET)
$(ECHO_RGENSTAT)
$(Q)$(RGENSTAT_TARGET) apistatus.lst apistatus.xml
.PHONY: cb
cb: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) cb
.PHONY: msbuild
msbuild: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msbuild
.PHONY: msbuild_clean
msbuild_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msbuild
.PHONY: depmap
depmap: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) depmap
.PHONY: vreport
vreport:$(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) vreport
.PHONY: msvc
msvc: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msvc
.PHONY: msvc6
msvc6: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs6.00 -voversionconfiguration msvc
.PHONY: msvc7
msvc7: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -voversionconfiguration msvc
.PHONY: msvc71
msvc71: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -voversionconfiguration msvc
.PHONY: msvc8
msvc8: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -voversionconfiguration msvc
.PHONY: msvc9
msvc9: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs9.00 -voversionconfiguration msvc
.PHONY: msvc6_clean
msvc6_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
.PHONY: msvc7_clean
msvc7_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
.PHONY: msvc71_clean
msvc71_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
.PHONY: msvc8_clean
msvc8_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.00 -voversionconfiguration msvc
.PHONY: msvc9_clean
msvc9_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs9.00 -voversionconfiguration msvc
.PHONY: msvc_clean
msvc_clean: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msvc
.PHONY: msvc_clean_all
msvc_clean_all: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.10 -voversionconfiguration msvc
.PHONY: msvc7_install_debug
msvc7_install_debug: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug -voversionconfiguration msvc
.PHONY: msvc7_install_release
msvc7_install_release: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease -voversionconfiguration msvc
.PHONY: msvc7_install_speed
msvc7_install_speed: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed -voversionconfiguration msvc
.PHONY: msvc71_install_debug
msvc71_install_debug: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug -voversionconfiguration msvc
.PHONY: msvc71_install_release
msvc71_install_release: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease -voversionconfiguration msvc
.PHONY: msvc71_install_speed
msvc71_install_speed: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed -voversionconfiguration msvc
.PHONY: msvc8_install_debug
msvc8_install_debug: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug -voversionconfiguration msvc
.PHONY: msvc8_install_release
msvc8_install_release: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease -voversionconfiguration msvc
.PHONY: msvc8_install_speed
msvc8_install_speed: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed -voversionconfiguration msvc
.PHONY: makefile_auto_clean
makefile_auto_clean:
-@$(rm) $(ROS_AUTOMAKE) $(PREAUTO) 2>$(NUL)
.PHONY: clean
clean: makefile_auto_clean
.PHONY: depends
depends: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw

29
README Normal file
View File

@@ -0,0 +1,29 @@
========================
ReactOS Version 0.3.x
Updated Dec 16, 2006
========================
1. What is ReactOS?
ReactOS is an Open Source effort to develop a quality operating system
that is compatible with Windows NT applications and drivers.
The ReactOS project, although currently focused on Windows XP/2003
drivers compatibility, is always keeping an eye toward compatibility with
older version of Windows NT family ( NT 4.0, 2000 (NT 5.0)) and new
Windows NT releases (Vista, etc). Applications (Win32 API) compatibility
focus is Windows XP.
More information is available at http://www.reactos.org/.
2. Building ReactOS
See the INSTALL file for more details.
3. More information
See the media\doc subdirectory for some sparse notes.
4. Who is responsible
See the CREDITS file.

169
ReactOS-arm.rbuild Normal file
View File

@@ -0,0 +1,169 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="config-arm.rbuild">
<xi:fallback>
<xi:include href="config-arm.template.rbuild" />
</xi:fallback>
</xi:include>
<xi:include href="baseaddress.rbuild" />
<define name="__REACTOS__" />
<define name="_ARM_" />
<define name="__arm__" />
<if property="DBG" value="1">
<define name="DBG">1</define>
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
</if>
<include>.</include>
<include>include</include>
<include root="intermediate">include</include>
<include>include/psdk</include>
<include root="intermediate">include/psdk</include>
<include>include/dxsdk</include>
<include root="intermediate">include/dxsdk</include>
<include>include/crt</include>
<include>include/crt/mingw32</include>
<include>include/ddk</include>
<include>include/GL</include>
<include>include/ndk</include>
<include>include/reactos</include>
<include root="intermediate">include/reactos</include>
<include root="intermediate">include/reactos/mc</include>
<include>include/reactos/libs</include>
<include>include/reactos/arm</include>
<property name="WINEBUILD_FLAGS" value="--kill-at"/>
<property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
<if property="SARCH" value="versatile">
<define name="BOARD_CONFIG_VERSATILE"/>
</if>
<if property="OPTIMIZE" value="1">
<compilerflag>-Os</compilerflag>
<compilerflag>-ftracer</compilerflag>
</if>
<if property="OPTIMIZE" value="2">
<compilerflag>-Os</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
<compilerflag>-O1</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<compilerflag>-O2</compilerflag>
</if>
<if property="OPTIMIZE" value="5">
<compilerflag>-O3</compilerflag>
</if>
<compilerflag>-Wno-attributes</compilerflag>
<compilerflag>-fno-strict-aliasing</compilerflag>
<linkerflag>-s</linkerflag>
<linkerflag>-static</linkerflag>
<directory name="media">
<directory name="nls">
<xi:include href="media/nls/nls.rbuild" />
</directory>
</directory>
<directory name="lib">
<directory name="drivers">
<directory name="csq">
<xi:include href="lib/drivers/csq/csq.rbuild" />
</directory>
</directory>
<directory name="debugsup">
<xi:include href="lib/debugsup/debugsup.rbuild" />
</directory>
<directory name="3rdparty">
<directory name="zlib">
<xi:include href="lib/3rdparty/zlib/zlib.rbuild" />
</directory>
</directory>
<directory name="rtl">
<xi:include href="lib/rtl/rtl.rbuild" />
</directory>
<directory name="host">
<directory name="wcsfuncs">
<xi:include href="lib/host/wcsfuncs/wcsfuncs.rbuild" />
</directory>
</directory>
<directory name="inflib">
<xi:include href="lib/inflib/inflib.rbuild" />
</directory>
<directory name="cmlib">
<xi:include href="lib/cmlib/cmlib.rbuild" />
</directory>
<directory name="pseh">
<xi:include href="lib/pseh/pseh.rbuild" />
</directory>
<directory name="rossym">
<xi:include href="lib/rossym/rossym.rbuild" />
</directory>
<directory name="sdk">
<directory name="crt">
<xi:include href="lib/sdk/crt/crt.rbuild" />
<xi:include href="lib/sdk/crt/libcntpr.rbuild" />
</directory>
<directory name="wdmguid">
<xi:include href="lib/sdk/wdmguid/wdmguid.rbuild" />
</directory>
</directory>
</directory>
<directory name="include">
<xi:include href="include/directory.rbuild" />
</directory>
<directory name="tools">
<xi:include href="tools/tools.rbuild" />
</directory>
<directory name="ntoskrnl">
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
</directory>
<directory name="hal">
<directory name="halarm">
<directory name="generic">
<xi:include href="hal/halarm/generic/generic.rbuild" />
</directory>
<directory name="up">
<xi:include href="hal/halarm/up/halup.rbuild" />
</directory>
</directory>
<directory name="hal">
<xi:include href="hal/hal/hal.rbuild" />
</directory>
</directory>
<directory name="boot">
<xi:include href="boot/boot.rbuild" />
</directory>
<directory name="drivers">
<directory name="storage">
<directory name="class">
<directory name="ramdisk">
<xi:include href="drivers/storage/class/ramdisk/ramdisk.rbuild" />
</directory>
</directory>
</directory>
<directory name="filesystems">
<directory name="cdfs">
<xi:include href="drivers/filesystems/cdfs/cdfs.rbuild" />
</directory>
</directory>
<directory name="base">
<directory name="kdcom">
<xi:include href="drivers/base/kdcom/kdcom.rbuild" />
</directory>
<directory name="bootvid">
<xi:include href="drivers/base/bootvid/bootvid.rbuild" />
</directory>
</directory>
</directory>
</project>

69
ReactOS-generic.rbuild Normal file
View File

@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="baseaddress.rbuild" />
<define name="__REACTOS__" />
<if property="DBG" value="1">
<define name="DBG">1</define>
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
</if>
<include>.</include>
<include>include</include>
<include root="intermediate">include</include>
<include>include/psdk</include>
<include root="intermediate">include/psdk</include>
<include>include/dxsdk</include>
<include root="intermediate">include/dxsdk</include>
<include>include/crt</include>
<include>include/crt/mingw32</include>
<include>include/ddk</include>
<include>include/GL</include>
<include>include/ndk</include>
<include>include/reactos</include>
<include root="intermediate">include/reactos</include>
<include root="intermediate">include/reactos/mc</include>
<include>include/reactos/libs</include>
<directory name="base">
<xi:include href="base/base.rbuild" />
</directory>
<directory name="dll">
<xi:include href="dll/dll.rbuild" />
</directory>
<directory name="drivers">
<xi:include href="drivers/drivers.rbuild" />
</directory>
<directory name="hal">
<xi:include href="hal/hal.rbuild" />
</directory>
<directory name="include">
<xi:include href="include/directory.rbuild" />
</directory>
<directory name="lib">
<xi:include href="lib/lib.rbuild" />
</directory>
<directory name="media">
<xi:include href="media/media.rbuild" />
</directory>
<directory name="modules">
<xi:include href="modules/directory.rbuild" />
</directory>
<directory name="ntoskrnl">
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
<!-- <xi:include href="ntoskrnl/ntkrnlmp.rbuild" /> -->
</directory>
<directory name="subsystems">
<xi:include href="subsystems/subsystems.rbuild" />
</directory>
<directory name="tools">
<xi:include href="tools/tools.rbuild" />
</directory>
</group>

42
ReactOS-i386.rbuild Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="config.rbuild">
<xi:fallback>
<xi:include href="config.template.rbuild" />
</xi:fallback>
</xi:include>
<xi:include href="ReactOS-generic.rbuild" />
<define name="_M_IX86" />
<define name="_X86_" />
<define name="__i386__" />
<property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
<if property="OPTIMIZE" value="1">
<compilerflag>-Os</compilerflag>
<compilerflag>-ftracer</compilerflag>
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
</if>
<if property="OPTIMIZE" value="2">
<compilerflag>-Os</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
<compilerflag>-O1</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<compilerflag>-O2</compilerflag>
</if>
<if property="OPTIMIZE" value="5">
<compilerflag>-O3</compilerflag>
</if>
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
<compilerflag>-fno-strict-aliasing</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-Wpointer-arith</compilerflag>
<linkerflag>-enable-stdcall-fixup</linkerflag>
</project>

23
ReactOS-ppc.rbuild Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<project name="ReactOS" makefile="makefile.ppc" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="config-ppc.rbuild">
<xi:fallback>
<xi:include href="config-ppc.template.rbuild" />
</xi:fallback>
</xi:include>
<xi:include href="ReactOS-generic.rbuild" />
<property name="MKHIVE_OPTIONS" value="-be" />
<property name="OFWLDR_LINKFORMAT" value="-L$(INTERMEDIATE)/lib/ppcmmu -lppcmmu_code -nostdlib -nostartfiles -lgcc -Wl,-e,__start -Wl,-Ttext,0xe00000 -N"/>
<property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared"/>
<define name="__MSVCRT__"/>
<compilerflag>-fshort-wchar</compilerflag>
<compilerflag>-fsigned-char</compilerflag>
<compilerflag>-mfull-toc</compilerflag>
<compilerflag>-meabi</compilerflag>
<compilerflag>-O2</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
</project>

0
reactos/apistatus.lst → apistatus.lst Normal file → Executable file
View File

7
base/base.rbuild Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="system">
<xi:include href="system/system.rbuild" />
</directory>
</group>

586
base/system/smss/client.c Normal file
View File

@@ -0,0 +1,586 @@
/* $Id$
*
* client.c - Session Manager client Management
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#include <sm/helper.h>
#define NDEBUG
#include <debug.h>
/* Private ADT */
#define SM_MAX_CLIENT_COUNT 16
#define SM_INVALID_CLIENT_INDEX -1
struct _SM_CLIENT_DIRECTORY
{
RTL_CRITICAL_SECTION Lock;
ULONG Count;
PSM_CLIENT_DATA Client [SM_MAX_CLIENT_COUNT];
PSM_CLIENT_DATA CandidateClient;
} SmpClientDirectory;
/**********************************************************************
* SmInitializeClientManagement/0
*/
NTSTATUS
SmInitializeClientManagement (VOID)
{
DPRINT("SM: %s called\n", __FUNCTION__);
RtlInitializeCriticalSection(& SmpClientDirectory.Lock);
SmpClientDirectory.Count = 0;
RtlZeroMemory (SmpClientDirectory.Client, sizeof SmpClientDirectory.Client);
SmpClientDirectory.CandidateClient = NULL;
return STATUS_SUCCESS;
}
/**********************************************************************
* SmpSetClientInitialized/1
*/
VOID FASTCALL
SmpSetClientInitialized (PSM_CLIENT_DATA Client)
{
DPRINT("SM: %s(%p) called\n", __FUNCTION__, Client);
Client->Flags |= SM_CLIENT_FLAG_INITIALIZED;
}
/**********************************************************************
* SmpGetFirstFreeClientEntry/0 PRIVATE
*
* NOTE: call it holding SmpClientDirectory.Lock only
*/
static INT STDCALL SmpGetFirstFreeClientEntry (VOID)
{
INT ClientIndex = 0;
DPRINT("SM: %s called\n", __FUNCTION__);
if (SmpClientDirectory.Count < SM_MAX_CLIENT_COUNT)
{
for (ClientIndex = 0;
(ClientIndex < SM_MAX_CLIENT_COUNT);
ClientIndex ++)
{
if (NULL == SmpClientDirectory.Client[ClientIndex])
{
DPRINT("SM: %s => %d\n", __FUNCTION__, ClientIndex);
return ClientIndex; // found
}
}
}
return SM_INVALID_CLIENT_INDEX; // full!
}
/**********************************************************************
* SmpLookupClient/1 PRIVATE
*
* DESCRIPTION
* Lookup the subsystem server descriptor (client data) given its
* base image ID.
*
* ARGUMENTS
* SubsystemId: IMAGE_SUBSYSTEM_xxx
*
* RETURN VALUES
* SM_INVALID_CLIENT_INDEX on error;
* otherwise an index in the range (0..SM_MAX_CLIENT_COUNT).
*
* WARNING
* SmpClientDirectory.Lock must be held by the caller.
*/
static INT FASTCALL
SmpLookupClient (USHORT SubsystemId)
{
INT ClientIndex = 0;
DPRINT("SM: %s(%d) called\n", __FUNCTION__, SubsystemId);
if (0 != SmpClientDirectory.Count)
{
for (ClientIndex = 0; (ClientIndex < SM_MAX_CLIENT_COUNT); ClientIndex ++)
{
if (NULL != SmpClientDirectory.Client[ClientIndex])
{
if (SubsystemId == SmpClientDirectory.Client[ClientIndex]->SubsystemId)
{
return ClientIndex;
}
}
}
}
return SM_INVALID_CLIENT_INDEX;
}
/**********************************************************************
* SmpDestroyClientObject/2 PRIVATE
*
* WARNING
* SmpClientDirectory.Lock must be held by the caller.
*/
static NTSTATUS STDCALL
SmpDestroyClientObject (PSM_CLIENT_DATA Client, NTSTATUS DestroyReason)
{
DPRINT("SM:%s(%p,%08lx) called\n", __FUNCTION__, Client, DestroyReason);
/* TODO: send shutdown to the SB port */
NtTerminateProcess (Client->ServerProcess, DestroyReason);
RtlFreeHeap (SmpHeap, 0, Client);
-- SmpClientDirectory.Count;
return STATUS_SUCCESS;
}
/**********************************************************************
* SmBeginClientInitialization/1
*
* DESCRIPTION
* Check if the candidate client matches the begin session
* message from the subsystem process.
*
* ARGUMENTS
* Request: message received by \SmApiPort
* ClientData:
*
* RETURN VALUES
* NTSTATUS
*/
NTSTATUS STDCALL
SmBeginClientInitialization (IN PSM_PORT_MESSAGE Request,
OUT PSM_CLIENT_DATA * ClientData)
{
NTSTATUS Status = STATUS_SUCCESS;
PSM_CONNECT_DATA ConnectData = SmpGetConnectData (Request);
ULONG SbApiPortNameSize = SM_CONNECT_DATA_SIZE(*Request);
INT ClientIndex = SM_INVALID_CLIENT_INDEX;
HANDLE Process;
DPRINT("SM: %s(%p,%p) called\n", __FUNCTION__,
Request, ClientData);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
/*
* Is there a subsystem bootstrap in progress?
*/
if (NULL != SmpClientDirectory.CandidateClient)
{
PROCESS_BASIC_INFORMATION pbi;
OBJECT_ATTRIBUTES ObjectAttributes;
RtlZeroMemory (& pbi, sizeof pbi);
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);
Status = NtOpenProcess(&Process,
PROCESS_ALL_ACCESS,
&ObjectAttributes,
&Request->Header.ClientId);
ASSERT(NT_SUCCESS(Status));
Status = NtQueryInformationProcess (Process,
ProcessBasicInformation,
& pbi,
sizeof pbi,
NULL);
ASSERT(NT_SUCCESS(Status));
{
SmpClientDirectory.CandidateClient->ServerProcessId =
(ULONG) pbi.UniqueProcessId;
}
}
else
{
DPRINT1("SM: %s: subsys booting with no descriptor!\n", __FUNCTION__);
Status = STATUS_NOT_FOUND;
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return Status;
}
/*
* Check if a client for the ID already exist.
*/
if (SM_INVALID_CLIENT_INDEX != SmpLookupClient(ConnectData->SubSystemId))
{
DPRINT("SM: %s: attempt to register again subsystem %d.\n",
__FUNCTION__,
ConnectData->SubSystemId);
// TODO something else to do here?
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return STATUS_UNSUCCESSFUL;
}
/*
* Check if a free entry exists in SmpClientDirectory.Client[].
*/
ClientIndex = SmpGetFirstFreeClientEntry();
if (SM_INVALID_CLIENT_INDEX == ClientIndex)
{
DPRINT("SM: %s: SM_INVALID_CLIENT_INDEX == ClientIndex ", __FUNCTION__);
SmpDestroyClientObject (SmpClientDirectory.CandidateClient, STATUS_NO_MEMORY);
SmpClientDirectory.CandidateClient = NULL;
return STATUS_NO_MEMORY;
}
/* OK! */
DPRINT("SM: %s: registering subsystem ID=%d \n",
__FUNCTION__, ConnectData->SubSystemId);
/*
* Initialize the client data
*/
SmpClientDirectory.CandidateClient->SubsystemId = ConnectData->SubSystemId;
/* SM && DBG auto-initializes; other subsystems are required to call
* SM_API_COMPLETE_SESSION via SMDLL. */
if ((IMAGE_SUBSYSTEM_NATIVE == SmpClientDirectory.CandidateClient->SubsystemId) ||
((USHORT)-1 == SmpClientDirectory.CandidateClient->SubsystemId))
{
SmpSetClientInitialized (SmpClientDirectory.CandidateClient);
}
if (SbApiPortNameSize > 0)
{
/* Only external servers have an SB port */
RtlCopyMemory (SmpClientDirectory.CandidateClient->SbApiPortName,
ConnectData->SbName,
SbApiPortNameSize);
}
/*
* Insert the new descriptor in the
* client directory.
*/
SmpClientDirectory.Client [ClientIndex] = SmpClientDirectory.CandidateClient;
/*
* Increment the number of active subsystems.
*/
++ SmpClientDirectory.Count;
/*
* Notify to the caller the reference to the client data.
*/
if (ClientData)
{
*ClientData = SmpClientDirectory.CandidateClient;
}
/*
* Free the slot for the candidate subsystem.
*/
SmpClientDirectory.CandidateClient = NULL;
/* Done */
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return STATUS_SUCCESS;
}
/**********************************************************************
* SmCompleteClientInitialization/1
*
* DESCRIPTION
* Lookup the subsystem server descriptor given the process ID
* of the subsystem server process.
*/
NTSTATUS STDCALL
SmCompleteClientInitialization (ULONG ProcessId)
{
NTSTATUS Status = STATUS_NOT_FOUND;
INT ClientIndex = SM_INVALID_CLIENT_INDEX;
DPRINT("SM: %s(%lu) called\n", __FUNCTION__, ProcessId);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
if (SmpClientDirectory.Count > 0)
{
for (ClientIndex = 0; ClientIndex < SM_MAX_CLIENT_COUNT; ClientIndex ++)
{
if ((NULL != SmpClientDirectory.Client [ClientIndex]) &&
(ProcessId == SmpClientDirectory.Client [ClientIndex]->ServerProcessId))
{
SmpSetClientInitialized (SmpClientDirectory.Client [ClientIndex]);
Status = STATUS_SUCCESS;
break;
}
}
}
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return Status;
}
/**********************************************************************
* SmpDestroyClientByClientIndex/1 PRIVATE
*/
static NTSTATUS STDCALL
SmpDestroyClientByClientIndex (INT ClientIndex)
{
NTSTATUS Status = STATUS_SUCCESS;
PSM_CLIENT_DATA Client = NULL;
DPRINT("SM: %s(%d) called\n", __FUNCTION__, ClientIndex);
if (SM_INVALID_CLIENT_INDEX == ClientIndex)
{
DPRINT1("SM: %s: SM_INVALID_CLIENT_INDEX == ClientIndex!\n",
__FUNCTION__);
Status = STATUS_NOT_FOUND;
}
else
{
Client = SmpClientDirectory.Client [ClientIndex];
SmpClientDirectory.Client [ClientIndex] = NULL;
if (NULL != Client)
{
Status = SmpDestroyClientObject (Client, STATUS_SUCCESS);
} else {
DPRINT("SM:%s: NULL == Client[%d]!\n", __FUNCTION__,
ClientIndex);
Status = STATUS_UNSUCCESSFUL;
}
}
return Status;
}
/**********************************************************************
* SmpTimeoutCandidateClient/1
*
* DESCRIPTION
* Give the candidate client time to bootstrap and complete
* session initialization. If the client fails in any way,
* drop the pending client and kill the process.
*
* ARGUMENTS
* x: HANDLE for the candidate process.
*
* RETURN VALUE
* NONE.
*/
static VOID STDCALL SmpTimeoutCandidateClient (PVOID x)
{
NTSTATUS Status = STATUS_SUCCESS;
HANDLE CandidateClientProcessHandle = (HANDLE) x;
LARGE_INTEGER TimeOut;
DPRINT("SM: %s(%p) called\n", __FUNCTION__, x);
TimeOut.QuadPart = (LONGLONG) -300000000L; // 30s
Status = NtWaitForSingleObject (CandidateClientProcessHandle,
FALSE,
& TimeOut);
if (STATUS_TIMEOUT == Status)
{
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
if (NULL != SmpClientDirectory.CandidateClient)
{
DPRINT("SM:%s: destroy candidate %p\n", __FUNCTION__,
SmpClientDirectory.CandidateClient);
Status = SmpDestroyClientObject (SmpClientDirectory.CandidateClient,
STATUS_TIMEOUT);
SmpClientDirectory.CandidateClient = NULL;
}
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
}
NtTerminateThread (NtCurrentThread(), Status);
}
/**********************************************************************
* SmpCreateClient/1
*
* DESCRIPTION
* Create a "candidate" client. Client descriptor will enter the
* client directory only at the end of the registration
* procedure. Otherwise, we will kill the associated process.
*
* ARGUMENTS
* ProcessHandle: handle of the subsystem server process.
*
* RETURN VALUE
* NTSTATUS:
* STATUS_SUCCESS if all OK;
* STATUS_DEVICE_BUSY if another SS is still booting;
* STATUS_NO_MEMORY if client descriptor allocation failed;
*
*
*/
NTSTATUS STDCALL
SmCreateClient (PRTL_USER_PROCESS_INFORMATION ProcessInfo, PWSTR ProgramName)
{
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s(%p, %S) called\n", __FUNCTION__, ProcessInfo->ProcessHandle, ProgramName);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
/*
* Check if the candidate client slot is empty.
*/
if (NULL == SmpClientDirectory.CandidateClient)
{
/*
* Check if there exist a free entry in the
* SmpClientDirectory.Client array.
*/
if (SM_INVALID_CLIENT_INDEX == SmpGetFirstFreeClientEntry())
{
DPRINT("SM: %s(%p): out of memory!\n",
__FUNCTION__, ProcessInfo->ProcessHandle);
Status = STATUS_NO_MEMORY;
}
/*
* Allocate the storage for client data
*/
SmpClientDirectory.CandidateClient =
RtlAllocateHeap (SmpHeap,
HEAP_ZERO_MEMORY,
sizeof (SM_CLIENT_DATA));
if (NULL == SmpClientDirectory.CandidateClient)
{
DPRINT("SM: %s(%p): out of memory!\n",
__FUNCTION__, ProcessInfo->ProcessHandle);
Status = STATUS_NO_MEMORY;
}
else
{
DPRINT("SM:%s(%p,%S): candidate is %p\n", __FUNCTION__,
ProcessInfo, ProgramName, SmpClientDirectory.CandidateClient);
/* Initialize the candidate client. */
RtlInitializeCriticalSection(& SmpClientDirectory.CandidateClient->Lock);
SmpClientDirectory.CandidateClient->ServerProcess =
(HANDLE) ProcessInfo->ProcessHandle;
SmpClientDirectory.CandidateClient->ServerProcessId =
(ULONG) ProcessInfo->ClientId.UniqueProcess;
/*
* Copy the program name
*/
RtlCopyMemory (SmpClientDirectory.CandidateClient->ProgramName,
ProgramName,
SM_SB_NAME_MAX_LENGTH);
}
} else {
DPRINT1("SM: %s: CandidateClient %p pending!\n", __FUNCTION__,
SmpClientDirectory.CandidateClient);
Status = STATUS_DEVICE_BUSY;
}
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
/* Create the timeout thread for external subsystems */
if (_wcsicmp (ProgramName, L"Session Manager") && _wcsicmp (ProgramName, L"Debug"))
{
Status = RtlCreateUserThread (NtCurrentProcess(),
NULL,
FALSE,
0,
0,
0,
(PTHREAD_START_ROUTINE) SmpTimeoutCandidateClient,
SmpClientDirectory.CandidateClient->ServerProcess,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM:%s: RtlCreateUserThread() failed (Status=%08lx)\n",
__FUNCTION__, Status);
}
}
return Status;
}
/**********************************************************************
* SmpDestroyClient/1
*
* 1. close any handle
* 2. kill client process
* 3. release resources
*/
NTSTATUS STDCALL
SmDestroyClient (ULONG SubsystemId)
{
NTSTATUS Status = STATUS_SUCCESS;
INT ClientIndex = SM_INVALID_CLIENT_INDEX;
DPRINT("SM: %s(%lu) called\n", __FUNCTION__, SubsystemId);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
ClientIndex = SmpLookupClient (SubsystemId);
if (SM_INVALID_CLIENT_INDEX == ClientIndex)
{
DPRINT1("SM: %s: del req for non existent subsystem (id=%d)\n",
__FUNCTION__, SubsystemId);
return STATUS_NOT_FOUND;
}
Status = SmpDestroyClientByClientIndex (ClientIndex);
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return Status;
}
/* === Utilities for SmQryInfo === */
/**********************************************************************
* SmGetClientBasicInformation/1
*/
NTSTATUS FASTCALL
SmGetClientBasicInformation (PSM_BASIC_INFORMATION i)
{
INT ClientIndex = 0;
INT Index = 0;
DPRINT("SM: %s(%p) called\n", __FUNCTION__, i);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
i->SubSystemCount = SmpClientDirectory.Count;
i->Unused = 0;
if (SmpClientDirectory.Count > 0)
{
for (ClientIndex = 0; (ClientIndex < SM_MAX_CLIENT_COUNT); ClientIndex ++)
{
if ((NULL != SmpClientDirectory.Client [ClientIndex]) &&
(Index < SM_QRYINFO_MAX_SS_COUNT))
{
i->SubSystem[Index].Id = SmpClientDirectory.Client [ClientIndex]->SubsystemId;
i->SubSystem[Index].Flags = SmpClientDirectory.Client [ClientIndex]->Flags;
i->SubSystem[Index].ProcessId = SmpClientDirectory.Client [ClientIndex]->ServerProcessId;
++ Index;
}
}
}
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return STATUS_SUCCESS;
}
/**********************************************************************
* SmGetSubSystemInformation/1
*/
NTSTATUS FASTCALL
SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION i)
{
NTSTATUS Status = STATUS_SUCCESS;
INT ClientIndex = SM_INVALID_CLIENT_INDEX;
DPRINT("SM: %s(%p) called\n", __FUNCTION__, i);
RtlEnterCriticalSection (& SmpClientDirectory.Lock);
ClientIndex = SmpLookupClient (i->SubSystemId);
if (SM_INVALID_CLIENT_INDEX == ClientIndex)
{
Status = STATUS_NOT_FOUND;
}
else
{
i->Flags = SmpClientDirectory.Client [ClientIndex]->Flags;
i->ProcessId = SmpClientDirectory.Client [ClientIndex]->ServerProcessId;
RtlCopyMemory (i->NameSpaceRootNode,
SmpClientDirectory.Client [ClientIndex]->SbApiPortName,
(SM_QRYINFO_MAX_ROOT_NODE * sizeof(i->NameSpaceRootNode[0])));
}
RtlLeaveCriticalSection (& SmpClientDirectory.Lock);
return Status;
}
/* EOF */

184
base/system/smss/debug.c Normal file
View File

@@ -0,0 +1,184 @@
/* $Id$
*
* debug.c - Session Manager debug messages switch and router
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* GLOBALS ***********************************************************/
HANDLE DbgSsApiPort = (HANDLE) 0;
HANDLE DbgUiApiPort = (HANDLE) 0;
HANDLE hSmDbgApiPort = (HANDLE) 0;
/* FUNCTIONS *********************************************************/
static VOID STDCALL
DbgSsApiPortThread (PVOID dummy)
{
NTSTATUS Status = STATUS_SUCCESS;
PORT_MESSAGE Request ;
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
Status = NtListenPort (DbgSsApiPort, & Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
break;
}
/* TODO */
}
NtTerminateThread(NtCurrentThread(),Status);
}
static VOID STDCALL
DbgUiApiPortThread (PVOID dummy)
{
NTSTATUS Status = STATUS_SUCCESS;
PORT_MESSAGE Request;
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
Status = NtListenPort (DbgUiApiPort, & Request);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
break;
}
/* TODO */
}
NtTerminateThread(NtCurrentThread(),Status);
}
static NTSTATUS STDCALL
SmpCreatePT (IN OUT PHANDLE hPort,
IN LPWSTR wcPortName,
IN ULONG ulMaxDataSize,
IN ULONG ulMaxMessageSize,
IN ULONG ulPoolCharge OPTIONAL,
IN VOID (STDCALL * procServingThread)(PVOID) OPTIONAL,
IN OUT PHANDLE phServingThread OPTIONAL)
{
NTSTATUS Status = STATUS_SUCCESS;
UNICODE_STRING PortName = {0};
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE Thread = (HANDLE) 0;
CLIENT_ID Cid = {0, 0};
RtlInitUnicodeString (& PortName, wcPortName);
InitializeObjectAttributes (& ObjectAttributes,
& PortName,
0,
NULL,
NULL);
Status = NtCreatePort (hPort,
& ObjectAttributes,
ulMaxDataSize,
ulMaxMessageSize,
ulPoolCharge);
if(STATUS_SUCCESS != Status)
{
return Status;
}
/* Create thread for DbgSsApiPort */
RtlCreateUserThread(NtCurrentProcess(),
NULL,
FALSE,
0,
0,
0,
(PTHREAD_START_ROUTINE) procServingThread,
hPort,
& Thread,
& Cid);
if((HANDLE) 0 == Thread)
{
NtClose(*hPort);
Status = STATUS_UNSUCCESSFUL;
}
if(NULL != phServingThread)
{
*phServingThread = Thread;
}
return Status;
}
NTSTATUS
SmInitializeDbgSs (VOID)
{
NTSTATUS Status = STATUS_SUCCESS;
HANDLE hDbgSsApiPortThread = (HANDLE) 0;
DPRINT("SM: %s called\n", __FUNCTION__);
/* Self register */
Status = SmRegisterInternalSubsystem (L"Debug",
(USHORT)-1,
& hSmDbgApiPort);
if (!NT_SUCCESS(Status))
{
DPRINT1("DBG:%s: SmRegisterInternalSubsystem failed with Status=%08lx\n",
__FUNCTION__, Status);
return Status;
}
/* Create the \DbgSsApiPort object (LPC) */
Status = SmpCreatePT(& DbgSsApiPort,
SM_DBGSS_PORT_NAME,
0, /* MaxDataSize */
sizeof(PORT_MESSAGE), /* MaxMessageSize */
0, /* PoolCharge */
DbgSsApiPortThread,
& hDbgSsApiPortThread);
if(!NT_SUCCESS(Status))
{
DPRINT("SM: %s: DBGSS port not created\n",__FUNCTION__);
return Status;
}
/* Create the \DbgUiApiPort object (LPC) */
Status = SmpCreatePT(& DbgUiApiPort,
SM_DBGUI_PORT_NAME,
0, /* MaxDataSize */
sizeof(PORT_MESSAGE), /* MaxMessageSize */
0, /* PoolCharge */
DbgUiApiPortThread,
NULL);
if(!NT_SUCCESS(Status))
{
DPRINT("SM: %s: DBGUI port not created\n",__FUNCTION__);
NtClose (hDbgSsApiPortThread);
NtClose (DbgSsApiPort);
return Status;
}
return STATUS_SUCCESS;
}
/* EOF */

81
base/system/smss/init.c Normal file
View File

@@ -0,0 +1,81 @@
/* $Id$
*
* init.c - Session Manager initialization
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
typedef NTSTATUS (* SM_INIT_ROUTINE)(VOID);
struct {
BOOL Required;
SM_INIT_ROUTINE EntryPoint;
PCHAR ErrorMessage;
} InitRoutine [] = {
{TRUE, SmCreateHeap, "create private heap, aborting"},
{TRUE, SmCreateObjectDirectories, "create object directories"},
{TRUE, SmCreateApiPort, "create \\SmApiPort"},
{TRUE, SmCreateEnvironment, "create the system environment"},
{TRUE, SmSetEnvironmentVariables, "set system environment variables"},
{TRUE, SmInitDosDevices, "create dos device links"},
{TRUE, SmRunBootApplications, "run boot applications"},
{TRUE, SmProcessFileRenameList, "process the file rename list"},
{FALSE, SmLoadKnownDlls, "preload system DLLs"},
{TRUE, SmCreatePagingFiles, "create paging files"},
{TRUE, SmInitializeRegistry, "initialize the registry"},
{FALSE, SmUpdateEnvironment, "update environment variables"},
{TRUE, SmInitializeClientManagement, "initialize client management"},
{TRUE, SmLoadSubsystems, "load subsystems"}
};
NTSTATUS
InitSessionManager(VOID)
{
UINT i = 0;
NTSTATUS Status = STATUS_SUCCESS;
for (i=0; i < (sizeof InitRoutine / sizeof InitRoutine[0]); i++)
{
Status = InitRoutine[i].EntryPoint();
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: failed to %s (Status=%lx)\n",
__FUNCTION__,
InitRoutine[i].ErrorMessage,
Status);
if (InitRoutine[i].Required)
{
return(Status);
}
}
}
return(STATUS_SUCCESS);
}
/* EOF */

View File

@@ -0,0 +1,109 @@
/* $Id$
*
* initdosdev.c - Define symbolic links to kernel devices (MS-DOS names).
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
static NTSTATUS STDCALL
SmpDosDevicesQueryRoutine(PWSTR ValueName,
ULONG ValueType,
PVOID ValueData,
ULONG ValueLength,
PVOID Context,
PVOID EntryContext)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DeviceName;
UNICODE_STRING LinkName;
HANDLE LinkHandle;
WCHAR LinkBuffer[80];
NTSTATUS Status;
DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength);
DPRINT("ValueData '%S'\n", (PWSTR)ValueData);
if (ValueType != REG_SZ)
{
return(STATUS_SUCCESS);
}
swprintf(LinkBuffer,
L"\\??\\%s",
ValueName);
RtlInitUnicodeString(&LinkName,
LinkBuffer);
RtlInitUnicodeString(&DeviceName,
(PWSTR)ValueData);
DPRINT("SM: Linking %wZ --> %wZ\n",
&LinkName,
&DeviceName);
/* create symbolic link */
InitializeObjectAttributes(&ObjectAttributes,
&LinkName,
OBJ_PERMANENT|OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtCreateSymbolicLinkObject(&LinkHandle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
&DeviceName);
if (!NT_SUCCESS(Status))
{
DPRINT1("%s: NtCreateSymbolicLink( %wZ --> %wZ ) failed!\n",
__FUNCTION__,
&LinkName,
&DeviceName);
}
NtClose(LinkHandle);
return(Status);
}
NTSTATUS
SmInitDosDevices(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
NTSTATUS Status;
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].QueryRoutine = SmpDosDevicesQueryRoutine;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"\\Session Manager\\DOS Devices",
QueryTable,
NULL,
NULL);
return(Status);
}
/* EOF */

135
base/system/smss/initenv.c Normal file
View File

@@ -0,0 +1,135 @@
/*
* initenv.c - Environment initialization
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* GLOBALS */
PWSTR SmSystemEnvironment = NULL;
/* FUNCTIONS */
NTSTATUS
SmCreateEnvironment(VOID)
{
return RtlCreateEnvironment(FALSE, &SmSystemEnvironment);
}
static NTSTATUS
SmpSetEnvironmentVariable(IN PVOID Context,
IN PWSTR ValueName,
IN PVOID ValueData)
{
UNICODE_STRING EnvVariable;
UNICODE_STRING EnvValue;
RtlInitUnicodeString(&EnvVariable,
ValueName);
RtlInitUnicodeString(&EnvValue,
(PWSTR)ValueData);
return RtlSetEnvironmentVariable(Context,
&EnvVariable,
&EnvValue);
}
static NTSTATUS STDCALL
SmpEnvironmentQueryRoutine(IN PWSTR ValueName,
IN ULONG ValueType,
IN PVOID ValueData,
IN ULONG ValueLength,
IN PVOID Context,
IN PVOID EntryContext)
{
DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength);
if (ValueType != REG_SZ && ValueType != REG_EXPAND_SZ)
return STATUS_SUCCESS;
DPRINT("ValueData '%S'\n", (PWSTR)ValueData);
return SmpSetEnvironmentVariable(Context,ValueName,ValueData);
}
NTSTATUS
SmSetEnvironmentVariables(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
WCHAR ValueBuffer[MAX_PATH];
NTSTATUS Status;
/*
* The following environment variables must be set prior to reading
* other variables from the registry.
*
* Variables (example):
* SystemRoot = "C:\reactos"
* SystemDrive = "C:"
*/
/* Copy system root into value buffer */
wcscpy(ValueBuffer,
SharedUserData->NtSystemRoot);
/* Set SystemRoot = "C:\reactos" */
SmpSetEnvironmentVariable(&SmSystemEnvironment, L"SystemRoot", ValueBuffer);
/* Cut off trailing path */
ValueBuffer[2] = 0;
/* Set SystemDrive = "C:" */
SmpSetEnvironmentVariable(&SmSystemEnvironment, L"SystemDrive", ValueBuffer);
/* Read system environment from the registry. */
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].QueryRoutine = SmpEnvironmentQueryRoutine;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"Session Manager\\Environment",
QueryTable,
&SmSystemEnvironment,
SmSystemEnvironment);
return Status;
}
/**********************************************************************
* Set environment variables from registry
*/
NTSTATUS
SmUpdateEnvironment(VOID)
{
/* TODO */
return STATUS_SUCCESS;
}
/* EOF */

View File

@@ -0,0 +1,47 @@
/* $Id$
*
* initenv.c - Create the SM private heap
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
HANDLE SmpHeap = NULL;
NTSTATUS
SmCreateHeap(VOID)
{
/* Create our own heap */
SmpHeap = RtlCreateHeap(HEAP_GROWABLE,
NULL,
65536,
65536,
NULL,
NULL);
return (NULL == SmpHeap) ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS;
}
/* EOF */

453
base/system/smss/initmv.c Normal file
View File

@@ -0,0 +1,453 @@
/* $Id$
*
* PROJECT: ReactOS Operating System
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/system/smss/initmv.c
* PURPOSE: Process the file rename list.
* PROGRAMMERS: Dmitry Philippov (shedon@mail.ru)
* UPDATE HISTORY:
* Created 13/08/2006
*/
/* INCLUDES ******************************************************************/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
/*++
* @name SmpDeleteFile
*
* The SmpDeleteFile function deletes a specify file.
*
* @param lpFileName
* the name of a file which should be deleted
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
*
* @remarks
* This function is called by SmpMoveFilesQueryRoutine().
*
*
*--*/
NTSTATUS
SmpDeleteFile( IN LPCWSTR lpFileName )
{
FILE_DISPOSITION_INFORMATION FileDispInfo;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING FileNameU;
HANDLE FileHandle;
NTSTATUS Status;
DPRINT("SmpDeleteFile ( %S )\n", lpFileName);
if( !lpFileName )
return (STATUS_INVALID_PARAMETER);
RtlInitUnicodeString(&FileNameU, lpFileName);
InitializeObjectAttributes(&ObjectAttributes,
&FileNameU,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtCreateFile (&FileHandle,
DELETE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtCreateFile() failed (Status %lx)\n", Status);
return (Status);
}
FileDispInfo.DeleteFile = TRUE;
Status = NtSetInformationFile(
FileHandle,
&IoStatusBlock,
&FileDispInfo,
sizeof(FILE_DISPOSITION_INFORMATION),
FileDispositionInformation );
NtClose(FileHandle);
return (Status);
}
/*++
* @name SmpMoveFile
*
* The SmpMoveFile function deletes a specify file.
*
* @param lpExistingFileName
* the name of an existing file which should be removed
*
* @param lpNewFileName
* a new name of an existing file.
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
*
* @remarks
* This function called from the SmpMoveFilesQueryRoutine function.
*
*
*--*/
NTSTATUS
SmpMoveFile( IN LPCWSTR lpExistingFileName,
IN LPCWSTR lpNewFileName
)
{
PFILE_RENAME_INFORMATION FileRenameInfo;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING ExistingFileNameU;
HANDLE FileHandle;
DWORD FileNameSize;
BOOLEAN ReplaceIfExists;
NTSTATUS Status;
if( !lpExistingFileName || !lpNewFileName )
return (STATUS_INVALID_PARAMETER);
DPRINT("SmpMoveFile (%S, %S)\n", lpExistingFileName, lpNewFileName);
RtlInitUnicodeString(&ExistingFileNameU, lpExistingFileName);
InitializeObjectAttributes(&ObjectAttributes,
&ExistingFileNameU,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtCreateFile (&FileHandle,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtCreateFile() failed (Status %lx)\n", Status);
return (Status);
}
FileNameSize = wcslen(lpNewFileName)*sizeof(*lpNewFileName);
FileRenameInfo = RtlAllocateHeap(
RtlGetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(FILE_RENAME_INFORMATION)+FileNameSize);
if( !FileRenameInfo ) {
DPRINT("RtlAllocateHeap failed\n");
NtClose(FileHandle);
return (STATUS_NO_MEMORY);
}
if( L'!' == *lpNewFileName ) {
lpNewFileName++;
FileNameSize -= sizeof(*lpNewFileName);
ReplaceIfExists = TRUE;
}
else {
ReplaceIfExists = FALSE;
}
FileRenameInfo->RootDirectory = NULL;
FileRenameInfo->ReplaceIfExists = ReplaceIfExists;
FileRenameInfo->FileNameLength = FileNameSize;
RtlCopyMemory(FileRenameInfo->FileName, lpNewFileName, FileNameSize);
Status = NtSetInformationFile(
FileHandle,
&IoStatusBlock,
FileRenameInfo,
sizeof(FILE_RENAME_INFORMATION)+FileNameSize,
FileRenameInformation );
RtlFreeHeap(RtlGetProcessHeap(), 0, FileRenameInfo);
/* FIXME: After the FileRenameInformation parameter will be implemented into the fs driver
the following code can be removed */
if( STATUS_NOT_IMPLEMENTED == Status )
{
HANDLE FileHandleNew;
UNICODE_STRING NewFileNameU;
FILE_BASIC_INFORMATION FileBasicInfo;
UCHAR *lpBuffer = NULL;
SIZE_T RegionSize = 0x10000;
LARGE_INTEGER BytesCopied;
BOOL EndOfFileFound;
Status = NtQueryInformationFile(
FileHandle,
&IoStatusBlock,
&FileBasicInfo,
sizeof(FILE_BASIC_INFORMATION),
FileBasicInformation);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtQueryInformationFile() failed (Status %lx)\n", Status);
NtClose(FileHandle);
return (Status);
}
RtlInitUnicodeString(&NewFileNameU, lpNewFileName);
InitializeObjectAttributes(&ObjectAttributes,
&NewFileNameU,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtCreateFile (&FileHandleNew,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE,
ReplaceIfExists ? FILE_OVERWRITE_IF : FILE_CREATE,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtCreateFile() failed (Status %lx)\n", Status);
NtClose(FileHandle);
return (Status);
}
Status = NtAllocateVirtualMemory(
NtCurrentProcess(),
(PVOID *)&lpBuffer,
2,
&RegionSize,
MEM_RESERVE | MEM_COMMIT,
PAGE_READWRITE);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtAllocateVirtualMemory() failed (Status %lx)\n", Status);
NtClose(FileHandle);
SmpDeleteFile(lpNewFileName);
return (Status);
}
BytesCopied.QuadPart = 0;
EndOfFileFound = FALSE;
while( !EndOfFileFound
&& NT_SUCCESS(Status) )
{
Status = NtReadFile(FileHandle,
NULL,
NULL,
NULL,
&IoStatusBlock,
lpBuffer,
RegionSize,
NULL,
NULL);
if( NT_SUCCESS(Status) ) {
Status = NtWriteFile(FileHandleNew,
NULL,
NULL,
NULL,
&IoStatusBlock,
lpBuffer,
IoStatusBlock.Information,
NULL,
NULL);
if( NT_SUCCESS(Status) ) {
BytesCopied.QuadPart += IoStatusBlock.Information;
}
else {
DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
}
}
else {
if( STATUS_END_OF_FILE == Status ) {
EndOfFileFound = TRUE;
Status = STATUS_SUCCESS;
}
else {
DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
}
}
}
NtFreeVirtualMemory(NtCurrentProcess(),
(PVOID *)&lpBuffer,
&RegionSize,
MEM_RELEASE);
Status = NtQueryInformationFile(
FileHandleNew,
&IoStatusBlock,
&FileBasicInfo,
sizeof(FILE_BASIC_INFORMATION),
FileBasicInformation);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtQueryInformationFile() failed (Status %lx)\n", Status);
}
Status = NtSetInformationFile(FileHandleNew,
&IoStatusBlock,
&FileBasicInfo,
sizeof(FILE_BASIC_INFORMATION),
FileBasicInformation);
if( !NT_SUCCESS(Status) ) {
DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
}
NtClose(FileHandleNew);
NtClose(FileHandle);
SmpDeleteFile(lpExistingFileName);
return (Status);
}
NtClose(FileHandle);
return (Status);
}
/*++
* @name SmpMoveFilesQueryRoutine
*
* The SmpMoveFilesQueryRoutine function processes registry entries.
*
* @param ValueName
* The name of the value.
*
* @param ValueType
* The type of the value.
*
* @param ValueData
* The null-terminated data for the value.
*
* @param ValueLength
* The length of ValueData.
*
* @param Context
* NULL
*
* @param EntryContext
* NULL
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
*
* @remarks
*
*
*
*--*/
static NTSTATUS STDCALL
SmpMoveFilesQueryRoutine(IN PWSTR ValueName,
IN ULONG ValueType,
IN PVOID ValueData,
IN ULONG ValueLength,
IN PVOID Context,
IN PVOID EntryContext)
{
NTSTATUS Status;
static LPWSTR FistFileName = NULL;
DPRINT("SmpMoveFilesQueryRoutine() called \n");
DPRINT("ValueData = %S \n", (PWSTR) ValueData);
if( !FistFileName )
{
/* save a first file name */
FistFileName = ValueData;
Status = STATUS_SUCCESS;
}
else
{
if( 0 == *((LPWSTR)ValueData) ) {
/* delete if second file name is absent */
Status = SmpDeleteFile( FistFileName );
} else {
/* remove a file */
Status = SmpMoveFile( FistFileName, (LPCWSTR)ValueData );
}
FistFileName = NULL;
}
return Status;
}
/*++
* @name SmProcessFileRenameList
* @implemented
*
* The SmProcessFileRenameList function moves or deletes files thats have been added to the specify registry key for delayed moving.
*
* @param VOID
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
*
* @remarks
* This function reads the following registry value:
* HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
* This registry value is of type REG_MULTI_SZ. The each operation is specifed as two file names.
* A first name is a source file, a second name is a destination file.
* In the case of deleting operation a second file name must be the empty string.
* For exapmle:
* szxSrcFile\0szxDestFile\0\0 <-- the szxSrcFile file will be renamed to the szxDestFile file
* szxSomeFile\0\0\0 <-- the szxSomeFile file will be removed
* After it will be done, the registry value will be deleted.
*
*
*--*/
NTSTATUS
SmProcessFileRenameList( VOID )
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
NTSTATUS Status;
DPRINT("SmProcessFileRenameList() called\n");
RtlZeroMemory( &QueryTable, sizeof(QueryTable) );
QueryTable[0].Name = L"PendingFileRenameOperations";
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DELETE;
QueryTable[0].DefaultType = REG_NONE;
QueryTable[0].QueryRoutine = SmpMoveFilesQueryRoutine;
Status = RtlQueryRegistryValues(
RTL_REGISTRY_CONTROL,
L"\\Session Manager",
QueryTable,
NULL,
NULL);
if( !NT_SUCCESS(Status) ) {
DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
}
/* FIXME: RtlQueryRegistryValues can return an error status if the PendingFileRenameOperations value
does not exist, in this case smss hungs, therefore we always return STATUS_SUCCESS */
return (STATUS_SUCCESS);
}
/* EOF */

View File

@@ -0,0 +1,89 @@
/* $Id$
*
* initobdir.c - Session Manager object directories
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
static NTSTATUS STDCALL
SmpObjectDirectoryQueryRoutine(PWSTR ValueName,
ULONG ValueType,
PVOID ValueData,
ULONG ValueLength,
PVOID Context,
PVOID EntryContext)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING UnicodeString;
HANDLE WindowsDirectory;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength);
DPRINT("ValueData '%S'\n", (PWSTR)ValueData);
if (ValueType != REG_SZ)
{
return(STATUS_SUCCESS);
}
RtlInitUnicodeString(&UnicodeString,
(PWSTR)ValueData);
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
0,
NULL,
NULL);
Status = ZwCreateDirectoryObject(&WindowsDirectory,
0,
&ObjectAttributes);
return(Status);
}
NTSTATUS
SmCreateObjectDirectories(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
NTSTATUS Status;
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].Name = L"ObjectDirectories";
QueryTable[0].QueryRoutine = SmpObjectDirectoryQueryRoutine;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
SM_REGISTRY_ROOT_NAME,
QueryTable,
NULL,
NULL);
return(Status);
}
/* EOF */

274
base/system/smss/initpage.c Normal file
View File

@@ -0,0 +1,274 @@
/*
* initpage.c -
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
#define GIGABYTE (1024 * 1024 * 1024) /* One Gigabyte */
static NTSTATUS STDCALL
SmpPagingFilesQueryRoutine(PWSTR ValueName,
ULONG ValueType,
PVOID ValueData,
ULONG ValueLength,
PVOID Context,
PVOID EntryContext)
{
UNICODE_STRING FileName;
LARGE_INTEGER InitialSize = {{0, 0}};
LARGE_INTEGER MaximumSize = {{0, 0}};
NTSTATUS Status = STATUS_SUCCESS;
PWSTR p, ValueString = (PWSTR)ValueData;
WCHAR RootDriveLetter[5] = {0};
if (ValueLength > 3 * sizeof(WCHAR) &&
(ValueLength % sizeof(WCHAR) != 0 ||
ValueString[(ValueLength / sizeof(WCHAR)) - 1] != L'\0'))
{
return STATUS_INVALID_PARAMETER;
}
if (ValueType != REG_SZ)
{
return STATUS_INVALID_PARAMETER_2;
}
/*
* Format: "<path>[ <initial_size>[ <maximum_size>]]"
*/
if ((p = wcschr(ValueString, L' ')) != NULL)
{
*p = L'\0';
InitialSize.QuadPart = wcstoul(p + 1, &p, 0) * 256 * 4096;
if (*p == ' ')
{
MaximumSize.QuadPart = wcstoul(p + 1, NULL, 0) * 256 * 4096;
}
else
{
MaximumSize = InitialSize;
}
}
if (!RtlDosPathNameToNtPathName_U (ValueString,
&FileName,
NULL,
NULL))
{
return STATUS_OBJECT_PATH_INVALID;
}
/* If there is only a file name or if initial and max are both 0
* the system will pick the sizes. Then it makes intial the size of phyical memory
* and makes max the size of 1.5 * initial. If there isnt enough free space then it will
* fall back to intial 20% of free space and max 25%. There is a max of 1 gig before
* it doesnt make it bigger. */
if ((InitialSize.QuadPart == 0 && MaximumSize.QuadPart == 0) || p == NULL)
{
FILE_FS_SIZE_INFORMATION FileFsSize;
IO_STATUS_BLOCK IoStatusBlock;
HANDLE hFile;
SYSTEM_BASIC_INFORMATION SysBasicInfo;
UNICODE_STRING NtPathU;
LARGE_INTEGER FreeBytes = {{0, 0}};
OBJECT_ATTRIBUTES ObjectAttributes;
DPRINT("System managed pagefile...\n");
/* Make sure the path that is given for the file actually has the drive in it.
At this point if there is not file name, no sizes will be set therefore no page
file will be created */
if (wcslen(ValueString) <= 3 ||
ValueString[1] != L':' ||
ValueString[2] != L'\\')
{
DPRINT1("Invalid path for pagefile.\n");
goto Cleanup;
}
Status = NtQuerySystemInformation(SystemBasicInformation,
&SysBasicInfo,
sizeof(SysBasicInfo),
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Could not query for physical memory size.\n");
goto Cleanup;
}
DPRINT("PageSize: %d, PhysicalPages: %d, TotalMem: %d\n", SysBasicInfo.PageSize, SysBasicInfo.NumberOfPhysicalPages, (SysBasicInfo.NumberOfPhysicalPages * SysBasicInfo.PageSize) / 1024);
InitialSize.QuadPart = SysBasicInfo.NumberOfPhysicalPages *
SysBasicInfo.PageSize;
MaximumSize.QuadPart = InitialSize.QuadPart * 2;
DPRINT("InitialSize: %I64d PhysicalPages: %lu PageSize: %lu\n",InitialSize.QuadPart,SysBasicInfo.NumberOfPhysicalPages,SysBasicInfo.PageSize);
/* copy the drive letter, the colon and the slash,
tack a null on the end */
RootDriveLetter[0] = ValueString[0];
RootDriveLetter[1] = L':';
RootDriveLetter[2] = L'\\';
RootDriveLetter[3] = L'\0';
DPRINT("Root drive X:\\...\"%S\"\n",RootDriveLetter);
if (!RtlDosPathNameToNtPathName_U(RootDriveLetter,
&NtPathU,
NULL,
NULL))
{
DPRINT1("Invalid path to root of drive\n");
Status = STATUS_OBJECT_PATH_INVALID;
goto Cleanup;
}
InitializeObjectAttributes(&ObjectAttributes,
&NtPathU,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
/* Get a handle to the root to find the free space on the drive */
Status = NtCreateFile(&hFile,
0,
&ObjectAttributes,
&IoStatusBlock,
NULL,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_OPEN,
0,
NULL,
0);
RtlFreeHeap(RtlGetProcessHeap(),
0,
NtPathU.Buffer);
if (!NT_SUCCESS(Status))
{
DPRINT1("Could not open a handle to the volume.\n");
goto Cleanup;
}
Status = NtQueryVolumeInformationFile(hFile,
&IoStatusBlock,
&FileFsSize,
sizeof(FILE_FS_SIZE_INFORMATION),
FileFsSizeInformation);
NtClose(hFile);
if (!NT_SUCCESS(Status))
{
DPRINT1("Querying the volume free space failed!\n");
goto Cleanup;
}
FreeBytes.QuadPart = FileFsSize.BytesPerSector *
FileFsSize.SectorsPerAllocationUnit *
FileFsSize.AvailableAllocationUnits.QuadPart;
DPRINT("Free bytes: %I64d Inital Size based on memory: %I64d \n",FreeBytes.QuadPart,InitialSize.QuadPart);
if (InitialSize.QuadPart > (FreeBytes.QuadPart / 4) || InitialSize.QuadPart == 0)
{
DPRINT("Inital Size took more then 25%% of free space\n");
/* Set by percentage of free space
* intial is 20%, and max is 25% */
InitialSize.QuadPart = FreeBytes.QuadPart / 5;
MaximumSize.QuadPart = FreeBytes.QuadPart / 4;
/* The page file is more then a gig, size it down */
if (InitialSize.QuadPart > GIGABYTE)
{
InitialSize.QuadPart = GIGABYTE;
MaximumSize.QuadPart = GIGABYTE * 1.5;
}
}
}
/* Make sure that max is not smaller then initial */
if (InitialSize.QuadPart > MaximumSize.QuadPart)
{
DPRINT("Max page file size was bigger then inital.\n");
MaximumSize.QuadPart = InitialSize.QuadPart;
}
DPRINT("Creating paging file %wZ with size %I64d KB\n",
&FileName, InitialSize.QuadPart / 1024);
Status = NtCreatePagingFile(&FileName,
&InitialSize,
&MaximumSize,
0);
if (! NT_SUCCESS(Status))
{
PrintString("Creation of paging file %wZ with size %I64d KB failed (status 0x%x)\n",
&FileName, InitialSize.QuadPart / 1024, Status);
}
Cleanup:
RtlFreeHeap(RtlGetProcessHeap(),
0,
FileName.Buffer);
return STATUS_SUCCESS;
}
NTSTATUS
SmCreatePagingFiles(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
NTSTATUS Status;
DPRINT("creating system paging files\n");
/*
* Disable paging file on MiniNT/Live CD.
*/
if (RtlCheckRegistryKey(RTL_REGISTRY_CONTROL, L"MiniNT") == STATUS_SUCCESS)
{
return STATUS_SUCCESS;
}
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].Name = L"PagingFiles";
QueryTable[0].QueryRoutine = SmpPagingFilesQueryRoutine;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"\\Session Manager\\Memory Management",
QueryTable,
NULL,
NULL);
return(Status);
}
/* EOF */

View File

@@ -0,0 +1,41 @@
/* $Id$
*
* initenv.c - Hive loading
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
NTSTATUS
SmInitializeRegistry(VOID)
{
DPRINT("SM: %s: initializing registry\n", __FUNCTION__);
/* Load remaining registry hives */
return NtInitializeRegistry(CM_BOOT_FLAG_SMSS);
}
/* EOF */

153
base/system/smss/initrun.c Normal file
View File

@@ -0,0 +1,153 @@
/* $Id$
*
* initrun.c - Run all programs in the boot execution list
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
//HANDLE Children[2] = {0, 0}; /* csrss, winlogon */
/**********************************************************************
* SmpRunBootAppsQueryRoutine/6
*/
static NTSTATUS STDCALL
SmpRunBootAppsQueryRoutine(PWSTR ValueName,
ULONG ValueType,
PVOID ValueData,
ULONG ValueLength,
PVOID Context,
PVOID EntryContext)
{
WCHAR Description [MAX_PATH];
WCHAR ImageName [MAX_PATH];
WCHAR ImagePath [MAX_PATH];
WCHAR CommandLine [MAX_PATH];
PWSTR p1, p2;
ULONG len;
NTSTATUS Status;
DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength);
DPRINT("ValueData '%S'\n", (PWSTR)ValueData);
if (ValueType != REG_SZ)
{
return(STATUS_SUCCESS);
}
/* Extract the description */
p1 = wcschr((PWSTR)ValueData, L' ');
len = p1 - (PWSTR)ValueData;
memcpy(Description,ValueData, len * sizeof(WCHAR));
Description[len] = 0;
/* Extract the image name */
p1++;
p2 = wcschr(p1, L' ');
if (p2 != NULL)
len = p2 - p1;
else
len = wcslen(p1);
memcpy(ImageName, p1, len * sizeof(WCHAR));
ImageName[len] = 0;
/* Extract the command line */
if (p2 == NULL)
{
CommandLine[0] = 0;
}
else
{
p2++;
wcscpy(CommandLine, p2);
}
DPRINT("Running %S...\n", Description);
DPRINT("ImageName: '%S'\n", ImageName);
DPRINT("CommandLine: '%S'\n", CommandLine);
/* initialize executable path */
wcscpy(ImagePath, L"\\SystemRoot\\system32\\");
wcscat(ImagePath, ImageName);
wcscat(ImagePath, L".exe");
/* Create NT process */
Status = SmCreateUserProcess (ImagePath,
CommandLine,
TRUE, /* wait */
NULL, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: running '$S' failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
return(STATUS_SUCCESS);
}
/**********************************************************************
* SmRunBootApplications/0
*
* DESCRIPTION
*
* Run native applications listed in the registry.
*
* Key:
* \Registry\Machine\SYSTEM\CurrentControlSet\Control\Session Manager
*
* Value (format: "<description> <executable> <command line>":
* BootExecute = "autocheck autochk *"
*/
NTSTATUS
SmRunBootApplications(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
NTSTATUS Status;
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].Name = L"BootExecute";
QueryTable[0].QueryRoutine = SmpRunBootAppsQueryRoutine;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"\\Session Manager",
QueryTable,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("%s: RtlQueryRegistryValues() failed! (Status %lx)\n",
__FUNCTION__,
Status);
}
return(Status);
}
/* EOF */

182
base/system/smss/initss.c Normal file
View File

@@ -0,0 +1,182 @@
/* $Id$
*
* initss.c - Load the subsystems
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* SM handle for its own \SmApiPort */
HANDLE hSmApiPort = (HANDLE) 0;
/* TODO:
*
* a) look if a special option is set for smss.exe in
* HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
*/
/**********************************************************************
* SmRegisterInternalSubsystem/3
*
* DESCRIPTION
* Register with itself for ImageSubsystemId
* (programmatically).
*/
NTSTATUS STDCALL SmRegisterInternalSubsystem (LPWSTR PgmName,
USHORT ImageSubsystemId,
PHANDLE ApiPort)
{
NTSTATUS Status = STATUS_SUCCESS;
RTL_USER_PROCESS_INFORMATION ProcessInfo;
DPRINT("SM: %s(%S,%d) called\n",__FUNCTION__, PgmName, ImageSubsystemId);
RtlZeroMemory (& ProcessInfo, sizeof ProcessInfo);
ProcessInfo.Size = sizeof ProcessInfo;
ProcessInfo.ProcessHandle = (HANDLE) SmSsProcessId;
ProcessInfo.ClientId.UniqueProcess = (HANDLE) SmSsProcessId;
DPRINT("SM: %s: ProcessInfo.ProcessHandle=%p\n",
__FUNCTION__,ProcessInfo.ProcessHandle);
Status = SmCreateClient (& ProcessInfo, PgmName);
if (NT_SUCCESS(Status))
{
UNICODE_STRING SbApiPortName = {0,0,NULL};
RtlInitUnicodeString (& SbApiPortName, L"");
Status = SmConnectApiPort(& SbApiPortName,
(HANDLE) -1, /* internal SS have no SB port */
ImageSubsystemId,
ApiPort);
if(!NT_SUCCESS(Status))
{
DPRINT("SM: %s: SMLIB!SmConnectApiPort failed (Status=0x%08lx)\n",
__FUNCTION__,Status);
return Status;
}
DPRINT("SM:%s: %S self registered\n", __FUNCTION__, PgmName);
}
else
{
DPRINT1("SM: %s: SmCreateClient(%S) failed (Status=0x%08lx)\n",
__FUNCTION__, PgmName, Status);
}
/*
* Note that you don't need to call complete session
* here because connection handling code autocompletes
* the client structure for IMAGE_SUBSYSTEM_NATIVE and
* -1.
*/
return Status;
}
/**********************************************************************
* SmpLoadRequiredSubsystems/0
*/
static NTSTATUS
SmpLoadRequiredSubsystems (VOID)
{
NTSTATUS Status = STATUS_SUCCESS;
WCHAR Data [MAX_PATH + 1];
ULONG DataLength = sizeof Data;
ULONG DataType = 0;
DPRINT("SM: %s called\n", __FUNCTION__);
RtlZeroMemory (Data, DataLength);
Status = SmLookupSubsystem (L"Required",
Data,
& DataLength,
& DataType,
NULL);
if((STATUS_SUCCESS == Status) && (DataLength > sizeof Data[0]))
{
PWCHAR Name = NULL;
ULONG Offset = 0;
for (Name = Data; (Offset < DataLength); )
{
if(L'\0' != *Name)
{
UNICODE_STRING Program;
/* Run the current program */
RtlInitUnicodeString (& Program, Name);
Status = SmExecuteProgram (hSmApiPort, & Program);
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s failed to run '%S' program (Status=0x%08lx)\n",
__FUNCTION__, Name, Status);
}
/* Look for the next program */
while ((L'\0' != *Name) && (Offset < DataLength))
{
++ Name;
++ Offset;
}
}
++ Name;
++ Offset;
}
}
return Status;
}
/**********************************************************************
* SmLoadSubsystems/0
*/
NTSTATUS
SmLoadSubsystems(VOID)
{
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: loading subsystems...\n");
/*
* SM self registers: this also opens hSmApiPort to be used
* in loading required subsystems.
*/
Status = SmRegisterInternalSubsystem (L"Session Manager", IMAGE_SUBSYSTEM_NATIVE, & hSmApiPort);
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s SmRegisterInternalSubsystem failed Status=%08lx\n", __FUNCTION__, Status);
return Status;
}
/* Load Required subsystems (Debug Windows) */
Status = SmpLoadRequiredSubsystems();
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s SmpLoadRequiredSubsystems failed Status=%08lx\n", __FUNCTION__, Status);
return Status;
}
/* done */
DPRINT("SM: done loading subsystems\n");
return Status;
}
/* EOF */

View File

@@ -0,0 +1,258 @@
/* $Id$
*
* initwkdll.c - Load the well known DLLs
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
static NTSTATUS STDCALL
SmpKnownDllsQueryRoutine(PWSTR ValueName,
ULONG ValueType,
PVOID ValueData,
ULONG ValueLength,
PVOID Context,
PVOID EntryContext)
{
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING ImageName;
HANDLE FileHandle;
HANDLE SectionHandle;
NTSTATUS Status;
DPRINT("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength);
DPRINT("ValueData '%S' Context %p EntryContext %p\n", (PWSTR)ValueData, Context, EntryContext);
/* Ignore the 'DllDirectory' value */
if (!_wcsicmp(ValueName, L"DllDirectory"))
return STATUS_SUCCESS;
/* Open the DLL image file */
RtlInitUnicodeString(&ImageName,
ValueData);
InitializeObjectAttributes(&ObjectAttributes,
&ImageName,
OBJ_CASE_INSENSITIVE,
(HANDLE)Context,
NULL);
Status = NtOpenFile(&FileHandle,
SYNCHRONIZE | FILE_EXECUTE | FILE_READ_DATA,
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_READ,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenFile() failed (Status %lx)\n", Status);
return STATUS_SUCCESS;
}
DPRINT("Opened file %wZ successfully\n", &ImageName);
/* Check for valid image checksum */
Status = LdrVerifyImageMatchesChecksum (FileHandle,
0,
0,
0);
if (Status == STATUS_IMAGE_CHECKSUM_MISMATCH)
{
/* Raise a hard error (crash the system/BSOD) */
NtRaiseHardError (Status,
0,
0,
0,
0,
0);
}
else if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to check the image checksum\n");
NtClose(FileHandle);
return STATUS_SUCCESS;
}
InitializeObjectAttributes(&ObjectAttributes,
&ImageName,
OBJ_CASE_INSENSITIVE | OBJ_PERMANENT,
(HANDLE)EntryContext,
NULL);
Status = NtCreateSection(&SectionHandle,
SECTION_ALL_ACCESS,
&ObjectAttributes,
NULL,
PAGE_EXECUTE,
SEC_IMAGE,
FileHandle);
if (NT_SUCCESS(Status))
{
DPRINT("Created section successfully\n");
NtClose(SectionHandle);
}
NtClose(FileHandle);
return STATUS_SUCCESS;
}
NTSTATUS
SmLoadKnownDlls(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING DllDosPath;
UNICODE_STRING DllNtPath;
UNICODE_STRING Name;
HANDLE ObjectDirHandle;
HANDLE FileDirHandle;
HANDLE SymlinkHandle;
NTSTATUS Status;
DPRINT("SM: loading well-known DLLs\n");
DPRINT("SmLoadKnownDlls() called\n");
/* Create 'KnownDlls' object directory */
RtlInitUnicodeString(&Name,
L"\\KnownDlls");
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_PERMANENT | OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
NULL,
NULL);
Status = NtCreateDirectoryObject(&ObjectDirHandle,
DIRECTORY_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateDirectoryObject() failed (Status %lx)\n", Status);
return Status;
}
RtlInitUnicodeString(&DllDosPath, NULL);
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].Name = L"DllDirectory";
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
QueryTable[0].EntryContext = &DllDosPath;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"\\Session Manager\\KnownDlls",
QueryTable,
NULL,
SmSystemEnvironment);
if (!NT_SUCCESS(Status))
{
DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
return Status;
}
DPRINT("DllDosPath: '%wZ'\n", &DllDosPath);
if (!RtlDosPathNameToNtPathName_U(DllDosPath.Buffer,
&DllNtPath,
NULL,
NULL))
{
DPRINT1("RtlDosPathNameToNtPathName_U() failed\n");
return STATUS_OBJECT_NAME_INVALID;
}
DPRINT("DllNtPath: '%wZ'\n", &DllNtPath);
/* Open the dll path directory */
InitializeObjectAttributes(&ObjectAttributes,
&DllNtPath,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenFile(&FileDirHandle,
SYNCHRONIZE | FILE_READ_DATA,
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_READ | FILE_SHARE_WRITE,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_DIRECTORY_FILE);
RtlFreeHeap(RtlGetProcessHeap(),
0,
DllNtPath.Buffer);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenFile failed (Status %lx)\n", Status);
return Status;
}
/* Link 'KnownDllPath' the dll path directory */
RtlInitUnicodeString(&Name,
L"KnownDllPath");
InitializeObjectAttributes(&ObjectAttributes,
&Name,
OBJ_PERMANENT | OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
ObjectDirHandle,
NULL);
Status = NtCreateSymbolicLinkObject(&SymlinkHandle,
SYMBOLIC_LINK_ALL_ACCESS,
&ObjectAttributes,
&DllDosPath);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtCreateSymbolicLink() failed (Status %lx)\n", Status);
return Status;
}
NtClose(SymlinkHandle);
RtlZeroMemory(&QueryTable,
sizeof(QueryTable));
QueryTable[0].QueryRoutine = SmpKnownDllsQueryRoutine;
QueryTable[0].EntryContext = ObjectDirHandle;
Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL,
L"\\Session Manager\\KnownDlls",
QueryTable,
(PVOID)FileDirHandle,
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
}
DPRINT("SmLoadKnownDlls() done\n");
return Status;
}
/* EOF */

59
base/system/smss/print.c Normal file
View File

@@ -0,0 +1,59 @@
/* $Id$
*
* print.c - Print on the blue screen
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
VOID STDCALL DisplayString(LPCWSTR lpwString)
{
UNICODE_STRING us;
RtlInitUnicodeString (&us, lpwString);
NtDisplayString (&us);
}
VOID STDCALL PrintString (char* fmt, ...)
{
char buffer[512];
va_list ap;
UNICODE_STRING UnicodeString;
ANSI_STRING AnsiString;
va_start(ap, fmt);
vsprintf(buffer, fmt, ap);
va_end(ap);
DPRINT1("%s", buffer);
RtlInitAnsiString (&AnsiString, buffer);
RtlAnsiStringToUnicodeString (&UnicodeString,
&AnsiString,
TRUE);
NtDisplayString(&UnicodeString);
RtlFreeUnicodeString (&UnicodeString);
}
/* EOF */

392
base/system/smss/smapi.c Normal file
View File

@@ -0,0 +1,392 @@
/* $Id$
*
* smapi.c - \SmApiPort LPC port message management
*
* Reactos Session Manager
*
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/* GLOBAL VARIABLES *********************************************************/
static HANDLE SmApiPort = INVALID_HANDLE_VALUE;
/* SM API *******************************************************************/
SMAPI(SmInvalid)
{
DPRINT("SM: %s called\n",__FUNCTION__);
Request->SmHeader.Status = STATUS_NOT_IMPLEMENTED;
return STATUS_SUCCESS;
}
/* SM API Table */
typedef NTSTATUS (FASTCALL * SM_PORT_API)(PSM_PORT_MESSAGE);
SM_PORT_API SmApi [] =
{
SmInvalid, /* unused */
SmCompSes, /* smapicomp.c */
SmInvalid, /* obsolete */
SmInvalid, /* unknown */
SmExecPgm, /* smapiexec.c */
SmQryInfo /* smapyqry.c */
};
/* TODO: optimize this address computation (it should be done
* with a macro) */
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE Request)
{
PPORT_MESSAGE PortMessage = (PPORT_MESSAGE) Request;
return (PSM_CONNECT_DATA)(PortMessage + 1);
}
NTSTATUS STDCALL
SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request);
/**********************************************************************
* SmpCallbackServer/2
*
* DESCRIPTION
* The SM calls back a previously connected subsystem process to
* authorize it to bootstrap (initialize). The SM connects to a
* named LPC port which name was sent in the connection data by
* the candidate subsystem server process.
*/
static NTSTATUS
SmpCallbackServer (PSM_PORT_MESSAGE Request,
PSM_CLIENT_DATA ClientData)
{
NTSTATUS Status = STATUS_SUCCESS;
PSM_CONNECT_DATA ConnectData = SmpGetConnectData (Request);
UNICODE_STRING CallbackPortName;
ULONG CallbackPortNameLength = SM_SB_NAME_MAX_LENGTH; /* TODO: compute length */
SB_CONNECT_DATA SbConnectData;
ULONG SbConnectDataLength = sizeof SbConnectData;
SECURITY_QUALITY_OF_SERVICE SecurityQos;
DPRINT("SM: %s called\n", __FUNCTION__);
if ( ((USHORT)-1 == ConnectData->SubSystemId) ||
(IMAGE_SUBSYSTEM_NATIVE == ConnectData->SubSystemId))
{
DPRINT("SM: %s: we do not need calling back SM!\n",
__FUNCTION__);
return STATUS_SUCCESS;
}
RtlCopyMemory (ClientData->SbApiPortName,
ConnectData->SbName,
CallbackPortNameLength);
RtlInitUnicodeString (& CallbackPortName,
ClientData->SbApiPortName);
SecurityQos.Length = sizeof (SecurityQos);
SecurityQos.ImpersonationLevel = SecurityIdentification;
SecurityQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
SecurityQos.EffectiveOnly = TRUE;
SbConnectData.SmApiMax = (sizeof SmApi / sizeof SmApi[0]);
Status = NtConnectPort (& ClientData->SbApiPort,
& CallbackPortName,
&SecurityQos,
NULL,
NULL,
NULL,
& SbConnectData,
& SbConnectDataLength);
return Status;
}
/**********************************************************************
* NAME
* SmpApiConnectedThread/1
*
* DESCRIPTION
* Entry point for the listener thread of LPC port "\SmApiPort".
*/
VOID STDCALL
SmpApiConnectedThread(PVOID pConnectedPort)
{
NTSTATUS Status = STATUS_SUCCESS;
PPORT_MESSAGE Reply = NULL;
SM_PORT_MESSAGE Request;
HANDLE ConnectedPort = * (PHANDLE) pConnectedPort;
DPRINT("SM: %s called\n", __FUNCTION__);
RtlZeroMemory(&Request, sizeof(SM_PORT_MESSAGE));
while (TRUE)
{
DPRINT("SM: %s: waiting for message\n",__FUNCTION__);
Status = NtReplyWaitReceivePort(ConnectedPort,
NULL,
Reply,
(PPORT_MESSAGE) & Request);
if (NT_SUCCESS(Status))
{
DPRINT("SM: %s: message received (type=%d)\n",
__FUNCTION__,
Request.Header.u2.s2.Type);
switch (Request.Header.u2.s2.Type)
{
case LPC_CONNECTION_REQUEST:
SmpHandleConnectionRequest (&Request);
Reply = NULL;
break;
case LPC_DEBUG_EVENT:
// DbgSsHandleKmApiMsg (&Request, 0);
Reply = NULL;
break;
case LPC_PORT_CLOSED:
Reply = NULL;
continue;
default:
if ((Request.SmHeader.ApiIndex) &&
(Request.SmHeader.ApiIndex < (sizeof SmApi / sizeof SmApi[0])))
{
Status = SmApi[Request.SmHeader.ApiIndex](&Request);
Reply = (PPORT_MESSAGE) & Request;
} else {
Request.SmHeader.Status = STATUS_NOT_IMPLEMENTED;
Reply = (PPORT_MESSAGE) & Request;
}
}
} else {
/* LPC failed */
break;
}
}
NtClose (ConnectedPort);
NtTerminateThread (NtCurrentThread(), Status);
}
/**********************************************************************
* NAME
* SmpHandleConnectionRequest/1
*
* ARGUMENTS
* Request: LPC connection request message
*
* REMARKS
* Quoted in http://support.microsoft.com/kb/258060/EN-US/
*/
NTSTATUS STDCALL
SmpHandleConnectionRequest (PSM_PORT_MESSAGE Request)
{
PSM_CONNECT_DATA ConnectData = SmpGetConnectData (Request);
NTSTATUS Status = STATUS_SUCCESS;
BOOL Accept = FALSE;
PSM_CLIENT_DATA ClientData = NULL;
HANDLE hClientDataApiPort = (HANDLE) 0;
PHANDLE ClientDataApiPort = & hClientDataApiPort;
HANDLE hClientDataApiPortThread = (HANDLE) 0;
PHANDLE ClientDataApiPortThread = & hClientDataApiPortThread;
PVOID Context = NULL;
DPRINT("SM: %s called:\n SubSystemID=%d\n SbName=\"%S\"\n",
__FUNCTION__, ConnectData->SubSystemId, ConnectData->SbName);
if(sizeof (SM_CONNECT_DATA) == Request->Header.u1.s1.DataLength)
{
if(IMAGE_SUBSYSTEM_UNKNOWN == ConnectData->SubSystemId)
{
/*
* This is not a call to register an image set,
* but a simple connection request from a process
* that will use the SM API.
*/
DPRINT("SM: %s: simple request\n", __FUNCTION__);
ClientDataApiPort = & hClientDataApiPort;
ClientDataApiPortThread = & hClientDataApiPortThread;
Accept = TRUE;
} else {
DPRINT("SM: %s: request to register an image set\n", __FUNCTION__);
/*
* Reject GUIs classes: only odd subsystem IDs are
* allowed to register here (tty mode images).
*/
if(1 == (ConnectData->SubSystemId % 2))
{
DPRINT("SM: %s: id = %d\n", __FUNCTION__, ConnectData->SubSystemId);
/*
* SmBeginClientInitialization/2 will succeed only if there
* is a candidate client ready.
*/
Status = SmBeginClientInitialization (Request, & ClientData);
if(STATUS_SUCCESS == Status)
{
DPRINT("SM: %s: ClientData = %p\n",
__FUNCTION__, ClientData);
/*
* OK: the client is an environment subsystem
* willing to manage a free image type.
*/
ClientDataApiPort = & ClientData->ApiPort;
ClientDataApiPortThread = & ClientData->ApiPortThread;
/*
* Call back the candidate environment subsystem
* server (use the port name sent in in the
* connection request message).
*/
Status = SmpCallbackServer (Request, ClientData);
if(NT_SUCCESS(Status))
{
DPRINT("SM: %s: SmpCallbackServer OK\n",
__FUNCTION__);
Accept = TRUE;
} else {
DPRINT("SM: %s: SmpCallbackServer failed (Status=%08lx)\n",
__FUNCTION__, Status);
Status = SmDestroyClient (ConnectData->SubSystemId);
}
}
}
}
}
DPRINT("SM: %s: before NtAcceptConnectPort\n", __FUNCTION__);
Status = NtAcceptConnectPort (ClientDataApiPort,
Context,
(PPORT_MESSAGE) Request,
Accept,
NULL,
NULL);
if(Accept)
{
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtAcceptConnectPort() failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
return Status;
} else {
DPRINT("SM: %s: completing conn req\n", __FUNCTION__);
Status = NtCompleteConnectPort (*ClientDataApiPort);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtCompleteConnectPort() failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
return Status;
}
}
Status = STATUS_SUCCESS;
}
DPRINT("SM: %s done\n", __FUNCTION__);
return Status;
}
/**********************************************************************
* NAME
* SmpApiThread/1
*
* DECRIPTION
* Due to differences in LPC implementation between NT and ROS,
* we need a thread to listen to for connection request that
* creates a new thread for each connected port. This is not
* necessary in NT LPC, because server side connected ports are
* never used to receive requests.
*/
VOID STDCALL
SmpApiThread (HANDLE ListeningPort)
{
NTSTATUS Status = STATUS_SUCCESS;
SM_PORT_MESSAGE Request;
DPRINT("SM: %s called\n", __FUNCTION__);
RtlZeroMemory(&Request, sizeof(PORT_MESSAGE));
while (TRUE)
{
Status = NtListenPort (ListeningPort, & Request.Header);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtListenPort() failed! (Status==x%08lx)\n", __FUNCTION__, Status);
break;
}
Status = SmpHandleConnectionRequest (& Request);
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: SmpHandleConnectionRequest failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
break;
}
}
/* Cleanup */
NtClose(ListeningPort);
/* DIE */
NtTerminateThread(NtCurrentThread(), Status);
}
/* LPC PORT INITIALIZATION **************************************************/
/**********************************************************************
* NAME
* SmCreateApiPort/0
*
* DECRIPTION
*/
NTSTATUS
SmCreateApiPort(VOID)
{
OBJECT_ATTRIBUTES ObjectAttributes = {0};
UNICODE_STRING UnicodeString = RTL_CONSTANT_STRING(L"\\SmApiPort");
NTSTATUS Status = STATUS_SUCCESS;
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
0,
NULL,
NULL);
Status = NtCreatePort(&SmApiPort,
&ObjectAttributes,
sizeof(SM_CONNECT_DATA),
sizeof(SM_PORT_MESSAGE),
0);
if (!NT_SUCCESS(Status))
{
return(Status);
}
/*
* Create one thread for the named LPC
* port \SmApiPort
*/
RtlCreateUserThread(NtCurrentProcess(),
NULL,
FALSE,
0,
0,
0,
(PTHREAD_START_ROUTINE)SmpApiConnectedThread,
&SmApiPort,
NULL,
NULL);
//
// On NT LPC, we need a second thread to handle incoming connections
// generated by incoming requests, otherwise the thread handling
// the request will be busy sending the LPC message, without any other
// thread being busy to receive the LPC message.
//
Status = RtlCreateUserThread(NtCurrentProcess(),
NULL,
FALSE,
0,
0,
0,
(PTHREAD_START_ROUTINE)SmpApiConnectedThread,
&SmApiPort,
NULL,
NULL);
return(Status);
}
/* EOF */

View File

@@ -0,0 +1,54 @@
/* $Id$
*
* smapicomp.c - SM_API_COMPLETE_SESSION
*
* Reactos Session Manager
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/**********************************************************************
* SmCompSes/1 API
*/
SMAPI(SmCompSes)
{
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s called\n", __FUNCTION__);
DPRINT("SM: %s: ClientId.UniqueProcess=%p\n",
__FUNCTION__, Request->Header.ClientId.UniqueProcess);
Status = SmCompleteClientInitialization ((ULONG) Request->Header.ClientId.UniqueProcess);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: SmCompleteClientInitialization failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
Request->SmHeader.Status = Status;
return STATUS_SUCCESS;
}
/* EOF */

View File

@@ -0,0 +1,299 @@
/* $Id$
*
* smapiexec.c - SM_API_EXECUTE_PROGRAM
*
* Reactos Session Manager
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
static const WCHAR szSystemDirectory[] = L"\\System32";
/**********************************************************************
* SmCreateUserProcess/5
*
* DESCRIPTION
*
* ARGUMENTS
* ImagePath: absolute path of the image to run;
* CommandLine: arguments and options for ImagePath;
* WaitForIt: TRUE for boot time processes and FALSE for
* subsystems bootstrapping;
* Timeout: optional: used if WaitForIt==TRUE;
* ProcessHandle: optional: a duplicated handle for
the child process (storage provided by the caller).
*
* RETURN VALUE
* NTSTATUS:
*
*/
NTSTATUS STDCALL
SmCreateUserProcess (LPWSTR ImagePath,
LPWSTR CommandLine,
BOOLEAN WaitForIt,
PLARGE_INTEGER Timeout OPTIONAL,
PRTL_USER_PROCESS_INFORMATION UserProcessInfo OPTIONAL)
{
UNICODE_STRING ImagePathString = {0};
UNICODE_STRING CommandLineString = {0};
UNICODE_STRING SystemDirectory = {0};
PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL;
RTL_USER_PROCESS_INFORMATION ProcessInfo = {0};
PRTL_USER_PROCESS_INFORMATION pProcessInfo = & ProcessInfo;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s called\n", __FUNCTION__);
if (NULL != UserProcessInfo)
{
pProcessInfo = UserProcessInfo;
}
RtlInitUnicodeString (& ImagePathString, ImagePath);
RtlInitUnicodeString (& CommandLineString, CommandLine);
SystemDirectory.MaximumLength = (wcslen(SharedUserData->NtSystemRoot) * sizeof(WCHAR)) + sizeof(szSystemDirectory);
SystemDirectory.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
0,
SystemDirectory.MaximumLength);
if (SystemDirectory.Buffer == NULL)
{
Status = STATUS_NO_MEMORY;
DPRINT1("SM: %s: Allocating system directory string failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
return Status;
}
Status = RtlAppendUnicodeToString(& SystemDirectory,
SharedUserData->NtSystemRoot);
if (!NT_SUCCESS(Status))
{
goto FailProcParams;
}
Status = RtlAppendUnicodeToString(& SystemDirectory,
szSystemDirectory);
if (!NT_SUCCESS(Status))
{
goto FailProcParams;
}
Status = RtlCreateProcessParameters(& ProcessParameters,
& ImagePathString,
NULL,
& SystemDirectory,
& CommandLineString,
SmSystemEnvironment,
NULL,
NULL,
NULL,
NULL);
RtlFreeHeap(RtlGetProcessHeap(),
0,
SystemDirectory.Buffer);
if (!NT_SUCCESS(Status))
{
FailProcParams:
DPRINT1("SM: %s: Creating process parameters failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
return Status;
}
Status = RtlCreateUserProcess (& ImagePathString,
OBJ_CASE_INSENSITIVE,
ProcessParameters,
NULL,
NULL,
NULL,
FALSE,
NULL,
NULL,
pProcessInfo);
RtlDestroyProcessParameters (ProcessParameters);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: Running \"%S\" failed (Status=0x%08lx)\n",
__FUNCTION__, ImagePathString.Buffer, Status);
return Status;
}
/*
* It the caller is *not* interested in the child info,
* resume it immediately.
*/
if (NULL == UserProcessInfo)
{
Status = NtResumeThread (ProcessInfo.ThreadHandle, NULL);
if(!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtResumeThread failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
}
/* Wait for process termination */
if (WaitForIt)
{
Status = NtWaitForSingleObject (pProcessInfo->ProcessHandle,
FALSE,
Timeout);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtWaitForSingleObject failed with Status=0x%08lx\n",
__FUNCTION__, Status);
}
}
if (NULL == UserProcessInfo)
{
NtClose(pProcessInfo->ProcessHandle);
NtClose(pProcessInfo->ThreadHandle);
}
return Status;
}
/**********************************************************************
* SmExecPgm/1 API
*/
SMAPI(SmExecPgm)
{
PSM_PORT_MESSAGE_EXECPGM ExecPgm = NULL;
WCHAR Name [SM_EXEXPGM_MAX_LENGTH + 1];
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s called\n",__FUNCTION__);
if(NULL == Request)
{
DPRINT1("SM: %s: Request == NULL!\n", __FUNCTION__);
return STATUS_INVALID_PARAMETER;
}
DPRINT("SM: %s called from CID(%p|%p)\n",
__FUNCTION__, Request->Header.ClientId.UniqueProcess,
Request->Header.ClientId.UniqueThread);
ExecPgm = & Request->Request.ExecPgm;
/* Check if the name lenght is valid */
if((ExecPgm->NameLength > 0) &&
(ExecPgm->NameLength <= SM_EXEXPGM_MAX_LENGTH) &&
TRUE /* TODO: check LPC payload size */)
{
WCHAR Data [MAX_PATH + 1] = {0};
ULONG DataLength = sizeof Data;
ULONG DataType = REG_EXPAND_SZ;
RtlZeroMemory (Name, sizeof Name);
RtlCopyMemory (Name,
ExecPgm->Name,
(sizeof ExecPgm->Name[0] * ExecPgm->NameLength));
DPRINT("SM: %s: Name='%S'\n", __FUNCTION__, Name);
/* Lookup Name in the registry */
Status = SmLookupSubsystem (Name,
Data,
& DataLength,
& DataType,
SmSystemEnvironment /* expand */);
if(NT_SUCCESS(Status))
{
/* Is the subsystem definition non-empty? */
if (DataLength > sizeof Data[0])
{
WCHAR ImagePath [MAX_PATH + 1] = {0};
PWCHAR CommandLine = ImagePath;
RTL_USER_PROCESS_INFORMATION ProcessInfo = {0};
wcscpy (ImagePath, L"\\??\\");
wcscat (ImagePath, Data);
/*
* Look for the beginning of the command line.
*/
for (; (*CommandLine != L'\0') && (*CommandLine != L' ');
CommandLine ++);
for (; *CommandLine == L' '; CommandLine ++)
{
*CommandLine = L'\0';
}
/*
* Create a native process (suspended).
*/
ProcessInfo.Size = sizeof ProcessInfo;
Request->SmHeader.Status =
SmCreateUserProcess(ImagePath,
CommandLine,
FALSE, /* wait */
NULL, /* timeout */
& ProcessInfo);
if (NT_SUCCESS(Request->SmHeader.Status))
{
Status = SmCreateClient (& ProcessInfo, Name);
if (NT_SUCCESS(Status))
{
Status = NtResumeThread (ProcessInfo.ThreadHandle, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: %s: NtResumeThread failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
//Status = SmDestroyClient TODO
}
} else {
DPRINT1("SM: %s: SmCreateClient failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
}
}
else
{
/*
* OK, the definition is empty, but check
* if it is the name of an embedded subsystem.
*/
if(0 == _wcsicmp(L"DEBUG", Name))
{
/*
* Initialize the embedded DBGSS.
*/
Request->SmHeader.Status = SmInitializeDbgSs();
}
else
{
/*
* Badly defined subsystem. Check the registry!
*/
Request->SmHeader.Status = STATUS_NOT_FOUND;
}
}
} else {
/* It couldn't lookup the Name! */
Request->SmHeader.Status = Status;
}
}
return Status;
}
/* EOF */

View File

@@ -0,0 +1,71 @@
/* $Id$
*
* smapiquery.c - SM_API_QUERY_INFORMATION
*
* Reactos Session Manager
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#define NDEBUG
#include <debug.h>
/**********************************************************************
* SmQryInfo/1 API
*/
SMAPI(SmQryInfo)
{
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("SM: %s called\n", __FUNCTION__);
switch (Request->Request.QryInfo.SmInformationClass)
{
case SmBasicInformation:
if(Request->Request.QryInfo.DataLength != sizeof (SM_BASIC_INFORMATION))
{
Request->Reply.QryInfo.DataLength = sizeof (SM_BASIC_INFORMATION);
Request->SmHeader.Status = STATUS_INFO_LENGTH_MISMATCH;
}else{
Request->SmHeader.Status =
SmGetClientBasicInformation (& Request->Reply.QryInfo.BasicInformation);
}
break;
case SmSubSystemInformation:
if(Request->Request.QryInfo.DataLength != sizeof (SM_SUBSYSTEM_INFORMATION))
{
Request->Reply.QryInfo.DataLength = sizeof (SM_SUBSYSTEM_INFORMATION);
Request->SmHeader.Status = STATUS_INFO_LENGTH_MISMATCH;
}else{
Request->SmHeader.Status =
SmGetSubSystemInformation (& Request->Reply.QryInfo.SubSystemInformation);
}
break;
default:
Request->SmHeader.Status = STATUS_NOT_IMPLEMENTED;
break;
}
return Status;
}
/* EOF */

96
base/system/smss/smss.c Normal file
View File

@@ -0,0 +1,96 @@
/* $Id$
*
* smss.c - Session Manager
*
* ReactOS Operating System
*
* --------------------------------------------------------------------
*
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* --------------------------------------------------------------------
*/
#include "smss.h"
#include <reactos/buildno.h>
#define NDEBUG
#include <debug.h>
ULONG SmSsProcessId = 0;
/* Native image's entry point */
NTSTATUS __cdecl _main(int argc,
char *argv[],
char *envp[],
ULONG DebugFlag)
{
NTSTATUS Status = STATUS_SUCCESS;
PROCESS_BASIC_INFORMATION PBI = {0};
/* Lookup yourself */
Status = NtQueryInformationProcess (NtCurrentProcess(),
ProcessBasicInformation,
& PBI,
sizeof PBI,
NULL);
if(NT_SUCCESS(Status))
{
SmSsProcessId = (ULONG) PBI.UniqueProcessId;
}
/* Initialize the system */
Status = InitSessionManager();
/* Watch required subsystems TODO */
#if 0
if (!NT_SUCCESS(Status))
{
int i;
for (i=0; i < (sizeof Children / sizeof Children[0]); i++)
{
if (Children[i])
{
NtTerminateProcess(Children[i],0);
}
}
DPRINT1("SM: Initialization failed!\n");
goto ByeBye;
}
Status = NtWaitForMultipleObjects(((LONG) sizeof(Children) / sizeof(HANDLE)),
Children,
WaitAny,
TRUE, /* alertable */
NULL); /* NULL for infinite */
if (!NT_SUCCESS(Status))
{
DPRINT1("SM: NtWaitForMultipleObjects failed! (Status=0x%08lx)\n", Status);
}
else
{
DPRINT1("SM: Process terminated!\n");
}
ByeBye:
/* Raise a hard error (crash the system/BSOD) */
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
0,0,0,0,0);
// NtTerminateProcess(NtCurrentProcess(), 0);
#endif
return NtTerminateThread(NtCurrentThread(), Status);
}
/* EOF */

116
base/system/smss/smss.h Normal file
View File

@@ -0,0 +1,116 @@
#ifndef _SMSS_H_INCLUDED_
#define _SMSS_H_INCLUDED_
#include <stdio.h>
#define WIN32_NO_STATUS
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
#include <sm/api.h>
#include <sm/helper.h>
/* smss.c */
extern ULONG SmSsProcessId;
/* init.c */
NTSTATUS InitSessionManager(VOID);
/* initheap.c */
extern HANDLE SmpHeap;
NTSTATUS SmCreateHeap(VOID);
/* initenv.c */
extern PWSTR SmSystemEnvironment;
NTSTATUS SmCreateEnvironment(VOID);
NTSTATUS SmSetEnvironmentVariables(VOID);
NTSTATUS SmUpdateEnvironment(VOID);
/* initobdir.c */
NTSTATUS SmCreateObjectDirectories(VOID);
/* initdosdev.c */
NTSTATUS SmInitDosDevices(VOID);
/* initrun.c */
extern HANDLE Children[2];
NTSTATUS SmRunBootApplications(VOID);
/* initmv.c */
NTSTATUS SmProcessFileRenameList(VOID);
/* initwkdll.c */
NTSTATUS SmLoadKnownDlls(VOID);
/* initpage.c */
NTSTATUS SmCreatePagingFiles(VOID);
/* initreg.c */
NTSTATUS SmInitializeRegistry(VOID);
/* initss.c */
NTSTATUS STDCALL SmRegisterInternalSubsystem(LPWSTR,USHORT,PHANDLE);
NTSTATUS SmLoadSubsystems(VOID);
/* smapi.c */
#define SMAPI(n) \
NTSTATUS FASTCALL n (PSM_PORT_MESSAGE Request)
PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE);
NTSTATUS SmCreateApiPort(VOID);
VOID STDCALL SmpApiThread(PVOID);
/* smapiexec.c */
NTSTATUS STDCALL SmCreateUserProcess(LPWSTR ImagePath,
LPWSTR CommandLine,
BOOLEAN WaitForIt,
PLARGE_INTEGER Timeout OPTIONAL,
PRTL_USER_PROCESS_INFORMATION UserProcessInfo OPTIONAL);
NTSTATUS FASTCALL SmExecPgm(PSM_PORT_MESSAGE);
/* smapicomp.c */
NTSTATUS FASTCALL SmCompSes(PSM_PORT_MESSAGE);
/* smapiquery.c */
NTSTATUS FASTCALL SmQryInfo(PSM_PORT_MESSAGE);
/* client.c */
#define SM_CLIENT_FLAG_CANDIDATE 0x8000
#define SM_CLIENT_FLAG_INITIALIZED 0x0001
#define SM_CLIENT_FLAG_REQUIRED 0x0002
typedef struct _SM_CLIENT_DATA
{
RTL_CRITICAL_SECTION Lock;
WCHAR ProgramName [SM_SB_NAME_MAX_LENGTH];
USHORT SubsystemId;
WORD Flags;
WORD Unused;
ULONG ServerProcessId;
HANDLE ServerProcess;
HANDLE ApiPort;
HANDLE ApiPortThread;
HANDLE SbApiPort;
WCHAR SbApiPortName [SM_SB_NAME_MAX_LENGTH];
} SM_CLIENT_DATA, *PSM_CLIENT_DATA;
NTSTATUS SmInitializeClientManagement (VOID);
NTSTATUS STDCALL SmCreateClient (PRTL_USER_PROCESS_INFORMATION,PWSTR);
NTSTATUS STDCALL SmDestroyClient (ULONG);
NTSTATUS STDCALL SmBeginClientInitialization (PSM_PORT_MESSAGE,PSM_CLIENT_DATA*);
NTSTATUS STDCALL SmCompleteClientInitialization (ULONG);
NTSTATUS FASTCALL SmGetClientBasicInformation (PSM_BASIC_INFORMATION);
NTSTATUS FASTCALL SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION);
/* debug.c */
extern HANDLE DbgSsApiPort;
extern HANDLE DbgUiApiPort;
NTSTATUS SmInitializeDbgSs(VOID);
/* print.c */
VOID STDCALL DisplayString(LPCWSTR lpwString);
VOID STDCALL PrintString (char* fmt, ...);
#endif /* _SMSS_H_INCLUDED_ */
/* EOF */

View File

@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="smss" type="nativecui" installbase="system32" installname="smss.exe">
<include base="smss">.</include>
<include base="ReactOS">include/reactos/subsys</include>
<define name="_DISABLE_TIDENTS" />
<library>nt</library>
<library>smlib</library>
<library>ntdll</library>
<pch>smss.h</pch>
<compilationunit name="unit.c">
<file>client.c</file>
<file>debug.c</file>
<file>init.c</file>
<file>initdosdev.c</file>
<file>initenv.c</file>
<file>initheap.c</file>
<file>initmv.c</file>
<file>initobdir.c</file>
<file>initpage.c</file>
<file>initreg.c</file>
<file>initrun.c</file>
<file>initss.c</file>
<file>initwkdll.c</file>
<file>print.c</file>
<file>smapi.c</file>
<file>smapicomp.c</file>
<file>smapiexec.c</file>
<file>smapiquery.c</file>
<file>smss.c</file>
</compilationunit>
<file>smss.rc</file>
</module>

6
base/system/smss/smss.rc Normal file
View File

@@ -0,0 +1,6 @@
/* $Id$ */
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Session Manager\0"
#define REACTOS_STR_INTERNAL_NAME "smss\0"
#define REACTOS_STR_ORIGINAL_FILENAME "smss.exe\0"
#include <reactos/version.rc>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="smss">
<xi:include href="smss/smss.rbuild" />
</directory>
</group>

189
baseaddress.rbuild Normal file
View File

@@ -0,0 +1,189 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<property name="BASEADDRESS_REGTESTS" value="0x07000000" />
<property name="BASEADDRESS_NOTIFYHOOK" value="0x08000000" />
<property name="BASEADDRESS_COMCAT" value="0x20A50000" />
<property name="BASEADDRESS_DEVENUM" value="0x35680000" />
<property name="BASEADDRESS_RSABASE" value="0x35700000" />
<property name="BASEADDRESS_RSAENH" value="0x35780000" />
<property name="BASEADDRESS_LPK" value="0x516C0000" />
<property name="BASEADDRESS_TELEPHON" value="0x58750000" />
<property name="BASEADDRESS_PWRCFG" value="0x587e0000" />
<property name="BASEADDRESS_MMSYS" value="0x588a0000" />
<property name="BASEADDRESS_JOY" value="0x589b0000" />
<property name="BASEADDRESS_UXTHEME" value="0x5ad70000" />
<property name="BASEADDRESS_VDMDBG" value="0x5b0d0000" />
<property name="BASEADDRESS_UNTFS" value="0x5b340000" />
<property name="BASEADDRESS_OBJSEL" value="0x5b400000" />
<property name="BASEADDRESS_UFAT" value="0x5b570000" />
<property name="BASEADDRESS_TAPIUI" value="0x5b770000" />
<property name="BASEADDRESS_UEXT2" value="0x5b7a0000" />
<property name="BASEADDRESS_SLAYER" value="0x5c7e0000" />
<property name="BASEADDRESS_USRMGR" value="0x5c900000" />
<property name="BASEADDRESS_SHIMGVW" value="0x5cb00000" />
<property name="BASEADDRESS_COMMCTRL" value="0x5d090000" />
<property name="BASEADDRESS_DPLAYX" value="0x5e080000" />
<property name="BASEADDRESS_INPUT" value ="0x5e400000" />
<property name="BASEADDRESS_DINPUT" value="0x5f580000" />
<property name="BASEADDRESS_NETID" value="0x5f660000" />
<property name="BASEADDRESS_QEDIT" value="0x611c0000" />
<property name="BASEADDRESS_MODEMUI" value="0x61650000" />
<property name="BASEADDRESS_MAPI32" value="0x62250000" />
<property name="BASEADDRESS_HDWWIZ" value="0x64d40000" />
<property name="BASEADDRESS_TIMEDATE" value="0x64da0000" />
<property name="BASEADDRESS_SYSDM" value="0x64dd0000" />
<property name="BASEADDRESS_NCPL" value="0x64ea0000" />
<property name="BASEADDRESS_MAIN" value="0x64f40000" />
<property name="BASEADDRESS_INTL" value="0x64fb0000" />
<property name="BASEADDRESS_CONSOLE" value="0x6e4d0000" />
<property name="BASEADDRESS_DESK" value="0x65080000" />
<property name="BASEADDRESS_APPWIZ" value="0x65100000" />
<property name="BASEADDRESS_MLANG" value="0x65140000" />
<property name="BASEADDRESS_ACCESS" value="0x65180000" />
<property name="BASEADDRESS_INETMIB1" value="0x666f0000" />
<property name="BASEADDRESS_WSHTCPIP" value="0x677b0000" />
<property name="BASEADDRESS_CRYPT32" value="0x67ab0000" />
<property name="BASEADDRESS_HID" value="0x688f0000" />
<property name="BASEADDRESS_PSXDLL" value="0x68eb0000" />
<property name="BASEADDRESS_PSAPI" value="0x68f70000" />
<property name="BASEADDRESS_KSPROXY" value="0x68f90000" />
<property name="BASEADDRESS_OLEACC" value="0x69640000" />
<property name="BASEADDRESS_WINMM" value="0x697d0000" />
<property name="BASEADDRESS_MSIMG32" value="0x69cc0000" />
<property name="BASEADDRESS_BROWSEUI" value="0x69cd0000" />
<property name="BASEADDRESS_NETPLWIZ" value="0x6a240000" />
<property name="BASEADDRESS_SHELL32" value="0x6a360000" />
<property name="BASEADDRESS_UNICODE" value="0x6b200000" />
<property name="BASEADDRESS_ADVPACK" value="0x6b300000" />
<property name="BASEADDRESS_CONTROL" value="0x6b310000" />
<property name="BASEADDRESS_NCPA" value="0x6b320000" />
<property name="BASEADDRESS_DBGHELP" value="0x6b330000" />
<property name="BASEADDRESS_DINPUT8" value="0x6b340000" />
<property name="BASEADDRESS_DXDIAGN" value="0x6b350000" />
<property name="BASEADDRESS_DSOUND" value="0x6b360000" />
<property name="BASEADDRESS_GLU32" value="0x6b370000" />
<property name="BASEADDRESS_MESA32" value="0x6b380000" />
<property name="BASEADDRESS_OPENGL32" value="0x6b390000" />
<property name="BASEADDRESS_SECUR32" value="0x6b3a0000" />
<property name="BASEADDRESS_SMDLL" value="0x6b3b0000" />
<property name="BASEADDRESS_URLMON" value="0x6b3c0000" />
<property name="BASEADDRESS_SERIALUI" value="0x6b3D0000" />
<property name="BASEADDRESS_HLINK" value="0x6C6E0000" />
<property name="BASEADDRESS_DESKMON" value="0x6d400000" />
<property name="BASEADDRESS_DESKADP" value="0x6d410000" />
<property name="BASEADDRESS_WLDAP32" value="0x6e130000" />
<property name="BASEADDRESS_SCHANNEL" value="0x6e360000" />
<property name="BASEADDRESS_COMPSTUI" value="0x6ec10000" />
<property name="BASEADDRESS_CLB" value="0x6f2b0000" />
<property name="BASEADDRESS_FONTEXT" value="0x6f7b0000" />
<property name="BASEADDRESS_CARDS" value="0x701a0000" />
<property name="BASEADDRESS_WININET" value="0x70200000" />
<property name="BASEADDRESS_WINHTTP" value="0x70c60000" />
<property name="BASEADDRESS_ACLUI" value="0x71550000" />
<property name="BASEADDRESS_DHCPCSVC" value="0x71650000" />
<property name="BASEADDRESS_SHDOCVW" value="0x71700000" />
<property name="BASEADDRESS_MSWSOCK" value="0x71a30000" />
<property name="BASEADDRESS_WSOCK32" value="0x71ab0000" />
<property name="BASEADDRESS_ACLEDIT" value="0x71b70000" />
<property name="BASEADDRESS_NETAPI32" value="0x71c00000" />
<property name="BASEADDRESS_DPLAY" value="0x71e80000" />
<property name="BASEADDRESS_SECURITY" value="0x71f10000" />
<property name="BASEADDRESS_CRYPTUI" value="0x720D0000" />
<property name="BASEADDRESS_WINFAX" value="0x722C0000" />
<property name="BASEADDRESS_WINSCARD" value="0x723d0000" />
<property name="BASEADDRESS_DEVMGR" value="0x72a90000" />
<property name="BASEADDRESS_WDMAUD" value="0x72d20000" />
<property name="BASEADDRESS_WINSPOOL" value="0x72f50000" />
<property name="BASEADDRESS_MSDMO" value="0x73670000" />
<property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" />
<property name="BASEADDRESS_DCIMAN32" value="0x73b10000" />
<property name="BASEADDRESS_LZ32" value="0x73d80000" />
<property name="BASEADDRESS_COREDLL" value="0x73d80000" />
<property name="BASEADDRESS_KSUSER" value="0x73ea0000" />
<property name="BASEADDRESS_ICMP" value="0x741f0000" />
<property name="BASEADDRESS_QUARTZ" value="0x747d0000" />
<property name="BASEADDRESS_USERENV" value="0x74850000" />
<property name="BASEADDRESS_WS2_32" value="0x74aa0000" />
<property name="BASEADDRESS_SYSSETUP" value="0x74a30000" />
<property name="BASEADDRESS_POWRPROF" value="0x74ad0000" />
<property name="BASEADDRESS_MSXML3" value="0x74ae0000" />
<property name="BASEADDRESS_PRINTUI" value="0x74b40000" />
<property name="BASEADDRESS_MMDRV" value="0x74c30000" />
<property name="BASEADDRESS_PDH" value="0x74c70000" />
<property name="BASEADDRESS_OLEDLG" value="0x74d00000" />
<property name="BASEADDRESS_SAMSRV" value="0x74f30000" />
<property name="BASEADDRESS_SAMLIB" value="0x750C0000" />
<property name="BASEADDRESS_CABINET" value="0x75120000" />
<property name="BASEADDRESS_NETCFGX" value="0x755F0000" />
<property name="BASEADDRESS_IPHLPAPI" value="0x75700000" />
<property name="BASEADDRESS_NDDEAPI" value="0x75940000" />
<property name="BASEADDRESS_MSGINA" value="0x75970000" />
<property name="BASEADDRESS_CRYPTNET" value="0x75e60000" />
<property name="BASEADDRESS_RPCRT4" value="0x76000000" />
<property name="BASEADDRESS_SHLWAPI" value="0x76120000" />
<property name="BASEADDRESS_INETCOMM" value="0x76150000" />
<property name="BASEADDRESS_COMCTL32" value="0x76160000" />
<property name="BASEADDRESS_COMDLG32" value="0x76210000" />
<property name="BASEADDRESS_WINSTA" value="0x762F0000" />
<property name="BASEADDRESS_RICHED32" value="0x76340000" />
<property name="BASEADDRESS_D3D8THK" value="0x76340000" />
<property name="BASEADDRESS_RICHED20" value="0x76360000" />
<property name="BASEADDRESS_TWAIN_32" value="0x76380000" />
<property name="BASEADDRESS_IMM32" value="0x76390000" />
<property name="BASEADDRESS_LSASRV" value="0x76540000" />
<property name="BASEADDRESS_MIDIMAP" value="0x76600000" />
<property name="BASEADDRESS_ODBC32" value="0x76660000" />
<property name="BASEADDRESS_MSHTML" value="0x76660000" />
<property name="BASEADDRESS_ODBCCP32" value="0x76380000" />
<property name="BASEADDRESS_WAVEMAP" value="0x76610000" />
<property name="BASEADDRESS_MPR" value="0x76620000" />
<property name="BASEADDRESS_SETUPAPI" value="0x76660000" />
<property name="BASEADDRESS_CRYPTDLL" value="0x76740000" />
<property name="BASEADDRESS_SHFOLDER" value="0x76760000" />
<property name="BASEADDRESS_NTDSAPI" value="0x76780000" />
<property name="BASEADDRESS_NTMARTA" value="0x768A0000" />
<property name="BASEADDRESS_RASDLG" value="0x768d0000" />
<property name="BASEADDRESS_GDIPLUS" value="0x76a00000" />
<property name="BASEADDRESS_ATL" value="0x76a80000" />
<property name="BASEADDRESS_WINTRUST" value="0x76c30000" />
<property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" />
<property name="BASEADDRESS_CLUSAPI" value="0x76d10000" />
<property name="BASEADDRESS_DHCPCSVC" value="0x76d80000" />
<property name="BASEADDRESS_FMIFS" value="0x76df0000" />
<property name="BASEADDRESS_OLEAUT32" value="0x76e00000" />
<property name="BASEADDRESS_TAPI32" value="0x76e60000" />
<property name="BASEADDRESS_RASMAN" value="0x76e90000" />
<property name="BASEADDRESS_RASAPI32" value="0x76ee0000" />
<property name="BASEADDRESS_WTSAPI32" value="0x76f50000" />
<property name="BASEADDRESS_MSVFW32" value="0x76f60000" />
<property name="BASEADDRESS_MSACM32" value="0x77400000" />
<property name="BASEADDRESS_CRTDLL" value="0x77630000" />
<property name="BASEADDRESS_AUTHZ" value="0x77690000" />
<property name="BASEADDRESS_CFGMGR32" value="0x77700000" />
<property name="BASEADDRESS_SENSAPI" value="0x77700000" />
<property name="BASEADDRESS_PACKET" value="0x77780000" />
<property name="BASEADDRESS_MSAFD" value="0x77780000" />
<property name="BASEADDRESS_MSI" value="0x77790000" />
<property name="BASEADDRESS_SNMPAPI" value="0x777a0000" />
<property name="BASEADDRESS_USP10" value="0x777b0000" />
<property name="BASEADDRESS_IPRTPRIO" value="0x777c0000" />
<property name="BASEADDRESS_WS2HELP" value="0x777e0000" />
<property name="BASEADDRESS_WSHIRDA" value="0x777f0000" />
<property name="BASEADDRESS_VERSION" value="0x77a40000" />
<property name="BASEADDRESS_OLE32" value="0x77a50000" />
<property name="BASEADDRESS_OLEPRO32" value="0x77b10000" />
<property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" />
<property name="BASEADDRESS_USER32" value="0x77e30000" />
<property name="BASEADDRESS_GDI32" value="0x77f70000" />
<property name="BASEADDRESS_DNSAPI" value="0x77fb0000" />
<property name="BASEADDRESS_MSVCRT" value="0x78000000" />
<property name="BASEADDRESS_MSVCRT20" value="0x78500000" />
<property name="BASEADDRESS_MSVCRT40" value="0x78700000" />
<property name="BASEADDRESS_MSCOREE" value="0x79000000" />
<property name="BASEADDRESS_KERNEL32" value="0x7c800000" />
<property name="BASEADDRESS_NTDLL" value="0x7c900000" />
<property name="BASEADDRESS_HHCTRL" value="0x7e410000" />
<property name="BASEADDRESS_BEEPMIDI" value="0x7ef0000" />
<property name="BASEADDRESS_FREETYPE" value="0x7f000000" />
</group>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group>
<!--
This file is a template used as a starting point for compile-time
configuration of ReactOS. Make a copy of this file and name it config.rbuild.
Then change the options in config.rbuild. If you don't have a config.rbuild file,
then the defaults in this file, config.template.rbuild, will be used instead.
Boolean options can obtain the values 0 (disabled) or 1 (enabled). String
options can obtain any value specified in the comment before it.
-->
<!--
Sub-architecture (board) to build for. Specify one of:
kurobox versatile
-->
<property name="SARCH" value="versatile" />
<!--
Which CPU ReactOS should be optimized for. Specify one of:
armv5te
See GCC manual for more CPU names and which CPUs GCC can optimize for.
-->
<property name="OARCH" value="armv5te" />
<!--
What level of optimisation to use.
0 = off (will not work)
1 = Default option, optimize for size (-Os) with some additional options
2 = -Os
3 = -O1
4 = -O2
5 = -O3
-->
<property name="OPTIMIZE" value="1" />
<!--
Whether to compile in the integrated kernel debugger.
-->
<property name="KDBG" value="0" />
<!--
Whether to compile for debugging. No compiler optimizations will be
performed.
-->
<property name="DBG" value="1" />
<!--
Whether to compile for debugging with GDB. If you don't use GDB, don't
enable this.
-->
<property name="GDB" value="0" />
<!--
Whether to compile apps/libs with features covered software patents or not.
If you live in a country where software patents are valid/apply, don't
enable this (except they/you purchased a license from the patent owner).
This settings is disabled (0) by default.
-->
<property name="NSWPAT" value="0" />
<!--
Whether to compile with the KD protocol. This will disable support for KDBG
as well as rossym and symbol lookups, and allow WinDBG to connect to ReactOS.
This is currently not fully working, and requires kdcom from Windows 2003 or
TinyKRNL. Booting into debug mode with this flag enabled will result in a
failure to enter GUI mode. Do not enable unless you know what you're doing.
-->
<property name="_WINKD_" value="0" />
</group>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group>
<!--
This file is a template used as a starting point for compile-time
configuration of ReactOS. Make a copy of this file and name it config.rbuild.
Then change the options in config.rbuild. If you don't have a config.rbuild file,
then the defaults in this file, config.template.rbuild, will be used instead.
Boolean options can obtain the values 0 (disabled) or 1 (enabled). String
options can obtain any value specified in the comment before it.
-->
<!--
Sub-architecture to build for. Specify one of:
xbox
-->
<property name="SARCH" value="" />
<!--
Which CPU ReactOS should be optimized for. Specify one of:
i486, i586, pentium, pentium2, pentium3, pentium4, athlon-xp, athlon-mp,
k6-2
See GCC manual for more CPU names and which CPUs GCC can optimize for.
-->
<property name="OARCH" value="" />
<!--
Whether to compile for an uniprocessor or multiprocessor machine.
-->
<property name="MP" value="0" />
<!--
New style kernel debugger
-->
<property name="_WINKD_" value="0" />
<!--
Whether to compile in the integrated kernel debugger.
-->
<property name="KDBG" value="0" />
<!--
Whether to compile for debugging. No compiler optimizations will be
performed.
-->
<property name="DBG" value="1" />
<!--
Whether to compile apps/libs with features covered software patents or not.
If you live in a country where software patents are valid/apply, don't
enable this (except they/you purchased a license from the patent owner).
This settings is disabled (0) by default.
-->
<property name="NSWPAT" value="0" />
</group>

82
config.template.rbuild Normal file
View File

@@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group>
<!--
This file is a template used as a starting point for compile-time
configuration of ReactOS. Make a copy of this file and name it config.rbuild.
Then change the options in config.rbuild. If you don't have a config.rbuild file,
then the defaults in this file, config.template.rbuild, will be used instead.
Boolean options can obtain the values 0 (disabled) or 1 (enabled). String
options can obtain any value specified in the comment before it.
-->
<!--
Sub-architecture to build for. Specify one of:
xbox
-->
<property name="SARCH" value="" />
<!--
Which CPU ReactOS should be optimized for. Specify one of:
i486, i586, pentium, pentium2, pentium3, pentium4, athlon-xp, athlon-mp,
k6-2
See GCC manual for more CPU names and which CPUs GCC can optimize for.
-->
<property name="OARCH" value="pentium" />
<!--
What level of optimisation to use.
0 = off (will not work)
1 = Default option, optimize for size (-Os) with some additional options
2 = -Os
3 = -O1
4 = -O2
5 = -O3
-->
<property name="OPTIMIZE" value="1" />
<!--
Whether to compile in the integrated kernel debugger.
-->
<property name="KDBG" value="1" />
<!--
Whether to compile for debugging. No compiler optimizations will be
performed.
-->
<property name="DBG" value="1" />
<!--
Whether to compile for debugging with GDB. If you don't use GDB, don't
enable this.
-->
<property name="GDB" value="0" />
<!--
Whether to compile apps/libs with features covered software patents or not.
If you live in a country where software patents are valid/apply, don't
enable this (except they/you purchased a license from the patent owner).
This settings is disabled (0) by default.
-->
<property name="NSWPAT" value="0" />
<!--
Whether to compile with the KD protocol. This will disable support for KDBG
as well as rossym and symbol lookups, and allow WinDBG to connect to ReactOS.
This is currently not fully working, and requires kdcom from Windows 2003 or
TinyKRNL. Booting into debug mode with this flag enabled will result in a
failure to enter GUI mode. Do not enable unless you know what you're doing.
-->
<property name="_WINKD_" value="0" />
</group>

30
depmap.xsl Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>ReactOS Dependency Map</title>
</head>
<body>
<h1>ReactOS Dependency Map</h1>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Module Name</th>
<th align="left">Module Location</th>
<th align="left">Other Module Usage</th>
<th align="left">Module Re-Usage</th>
</tr>
<xsl:for-each select="components/component">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="base"/></td>
<td><xsl:value-of select="lib_count"/></td>
<td><xsl:value-of select="ref_count"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

8
dll/3rdparty/3rdparty.rbuild vendored Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
<group xmlns:xi="http://www.w3.org/2001/XInclude">
<directory name="freetype">
<xi:include href="freetype/freetype.rbuild" />
</directory>
</group>

2457
dll/3rdparty/freetype/ChangeLog vendored Normal file

File diff suppressed because it is too large Load Diff

2613
dll/3rdparty/freetype/ChangeLog.20 vendored Normal file

File diff suppressed because it is too large Load Diff

9439
dll/3rdparty/freetype/ChangeLog.21 vendored Normal file

File diff suppressed because it is too large Load Diff

2837
dll/3rdparty/freetype/ChangeLog.22 vendored Normal file

File diff suppressed because it is too large Load Diff

206
dll/3rdparty/freetype/Doxyfile vendored Normal file
View File

@@ -0,0 +1,206 @@
# Doxyfile 1.3.5
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "ReactOS Freetype"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = doxy-doc
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = ../..
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
HAVE_DOT = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = .
FILE_PATTERNS = *.c \
*.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = YES
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 200
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = YES
RTF_HYPERLINKS = YES
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = NO
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../../include
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = YES

203
dll/3rdparty/freetype/Jamfile vendored Normal file
View File

@@ -0,0 +1,203 @@
# FreeType 2 top Jamfile.
#
# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# The HDRMACRO is already defined in FTJam and is used to add
# the content of certain macros to the list of included header
# files.
#
# We can compile FreeType 2 with classic Jam however thanks to
# the following code
#
if ! $(JAM_TOOLSET)
{
rule HDRMACRO
{
# nothing
}
}
# We need to invoke a SubDir rule if the FT2 source directory top is not the
# current directory. This allows us to build FreeType 2 as part of a larger
# project easily.
#
if $(FT2_TOP) != $(DOT)
{
SubDir FT2_TOP ;
}
# The following macros define the include directory, the source directory,
# and the final library name (without library extensions). They can be
# replaced by other definitions when the library is compiled as part of
# a larger project.
#
# Name of FreeType include directory during compilation.
# This is relative to FT2_TOP.
#
FT2_INCLUDE_DIR ?= include ;
# Name of FreeType source directory during compilation.
# This is relative to FT2_TOP.
#
FT2_SRC_DIR ?= src ;
# Name of final library, without extension.
#
FT2_LIB ?= $(LIBPREFIX)freetype ;
# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
# This is prepended to FT2_INCLUDE_DIR. It can be used to specify
# the location of a custom <ft2build.h> which will point to custom
# versions of `ftmodule.h' and `ftoption.h', for example.
#
FT2_BUILD_INCLUDE ?= ;
# The list of modules to compile on any given build of the library.
# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
#
# IMPORTANT: You'll need to change the content of `ftmodule.h' as well
# if you modify this list or provide your own.
#
FT2_COMPONENTS ?= autofit # auto-fitter
base # base component (public APIs)
bdf # BDF font driver
cache # cache sub-system
cff # CFF/CEF font driver
cid # PostScript CID-keyed font driver
gzip # support for gzip-compressed files
lzw # support for LZW-compressed files
pcf # PCF font driver
pfr # PFR/TrueDoc font driver
psaux # common PostScript routines module
pshinter # PostScript hinter module
psnames # PostScript names handling
raster # monochrome rasterizer
smooth # anti-aliased rasterizer
sfnt # SFNT-based format support routines
truetype # TrueType font driver
type1 # PostScript Type 1 font driver
type42 # PostScript Type 42 (embedded TrueType) driver
winfonts # Windows FON/FNT font driver
;
# Don't touch.
#
FT2_INCLUDE = $(FT2_BUILD_INCLUDE)
[ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
# Location of API Reference Documentation
#
if $(DOC_DIR)
{
DOC_DIR = $(DOCDIR:T) ;
}
else
{
DOC_DIR = docs/reference ;
}
# Only used by FreeType developers.
#
if $(DEBUG_HINTER)
{
CCFLAGS += -DDEBUG_HINTER ;
}
# We need `freetype2/include' in the current include path in order to
# compile any part of FreeType 2.
#: updating documentation for upcoming release
HDRS += $(FT2_INCLUDE) ;
# We need to #define FT2_BUILD_LIBRARY so that our sources find the
# internal headers
#
DEFINES += FT2_BUILD_LIBRARY ;
# Uncomment the following line if you want to build individual source files
# for each FreeType 2 module. This is only useful during development, and
# is better defined as an environment variable anyway!
#
# FT2_MULTI = true ;
# The file <freetype/config/ftheader.h> is used to define macros that are
# later used in #include statements. It needs to be parsed in order to
# record these definitions.
#
HDRMACRO [ FT2_SubDir include freetype config ftheader.h ] ;
HDRMACRO [ FT2_SubDir include freetype internal internal.h ] ;
# Now include the Jamfile in `freetype2/src', used to drive the compilation
# of each FreeType 2 component and/or module.
#
SubInclude FT2_TOP $(FT2_SRC_DIR) ;
# Handle the generation of the `ftexport.sym' file which contain the list
# of exported symbols. This can be used on Unix by libtool.
#
SubInclude FT2_TOP $(FT2_SRC_DIR) tools ;
rule GenExportSymbols
{
local apinames = apinames$(SUFEXE) ;
local headers = [ Glob $(2) : *.h ] ;
LOCATE on $(1) = $(ALL_LOCATE_TARGET) ;
APINAMES on $(1) = apinames$(SUFEXE) ;
Depends $(1) : $(apinames) $(headers) ;
GenExportSymbols1 $(1) : $(headers) ;
Clean clean : $(1) ;
}
actions GenExportSymbols1 bind APINAMES
{
$(APINAMES) $(2) > $(1)
}
GenExportSymbols ftexport.sym : include/freetype include/freetype/cache ;
# Test files (hinter debugging). Only used by FreeType developers.
#
if $(DEBUG_HINTER)
{
SubInclude FT2_TOP tests ;
}
rule RefDoc
{
Depends $1 : all ;
NotFile $1 ;
Always $1 ;
}
actions RefDoc
{
python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.3.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h
}
RefDoc refdoc ;
# end of top Jamfile

71
dll/3rdparty/freetype/Jamrules vendored Normal file
View File

@@ -0,0 +1,71 @@
# FreeType 2 JamRules.
#
# Copyright 2001, 2002, 2003 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# This file contains the Jam rules needed to build the FreeType 2 library.
# It is shared by all Jamfiles and is included only once in the build
# process.
#
# Call SubDirHdrs on a list of directories.
#
rule AddSubDirHdrs
{
local x ;
for x in $(<)
{
SubDirHdrs $(x) ;
}
}
# Determine prefix of library file. We must use "libxxxxx" on Unix systems,
# while all other simply use the real name.
#
if $(UNIX)
{
LIBPREFIX ?= lib ;
}
else
{
LIBPREFIX ?= "" ;
}
# FT2_TOP contains the location of the FreeType source directory. You can
# set it to a specific value if you want to compile the library as part of a
# larger project.
#
FT2_TOP ?= $(DOT) ;
# Define a new rule used to declare a sub directory of the Nirvana source
# tree.
#
rule FT2_SubDir
{
if $(FT2_TOP) = $(DOT)
{
return [ FDirName $(<) ] ;
}
else
{
return [ FDirName $(FT2_TOP) $(<) ] ;
}
}
# We also set ALL_LOCATE_TARGET in order to place all object and library
# files in "objs".
#
ALL_LOCATE_TARGET ?= [ FT2_SubDir objs ] ;
# end of Jamrules

34
dll/3rdparty/freetype/Makefile vendored Normal file
View File

@@ -0,0 +1,34 @@
#
# FreeType 2 build system -- top-level Makefile
#
# Copyright 1996-2000, 2002, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# Project names
#
PROJECT := freetype
PROJECT_TITLE := FreeType
# The variable TOP_DIR holds the path to the topmost directory in the project
# engine source hierarchy. If it is not defined, default it to `.'.
#
TOP_DIR ?= .
# The variable OBJ_DIR gives the location where object files and the
# FreeType library are built.
#
OBJ_DIR ?= $(TOP_DIR)/objs
include $(TOP_DIR)/builds/toplevel.mk
# EOF

64
dll/3rdparty/freetype/README vendored Normal file
View File

@@ -0,0 +1,64 @@
Special notes to Unix users
===========================
Please read the file `docs/UPGRADE.UNIX'. It contains important
information regarding the installation of FreeType on Unix systems,
especially GNU based operating systems like GNU/Linux.
FreeType 2's library is called `libfreetype', FreeType 1's library
is called `libttf'. They are *not* compatible!
FreeType 2.3.5
==============
Please read the docs/CHANGES file, it contains IMPORTANT
INFORMATION.
Read the files `docs/INSTALL' for installation instructions.
The FreeType 2 API reference is located in `docs/reference'; use the
file `ft2-doc.html' as the top entry point. Additional
documentation is available as a separate package from our sites. Go
to
http://download.savannah.gnu.org/releases/freetype/
and download one of the following files.
freetype-doc-2.3.5.tar.bz2
freetype-doc-2.3.5.tar.gz
ftdoc235.zip
Bugs
====
Please report bugs by e-mail to `freetype-devel@nongnu.org'. Don't
forget to send a detailed explanation of the problem -- there is
nothing worse than receiving a terse message that only says `it
doesn't work'.
Alternatively, you may submit a bug report at
https://savannah.nongnu.org/bugs/?group=freetype
Enjoy!
The FreeType Team
----------------------------------------------------------------------
Copyright 2006, 2007 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
modified, and distributed under the terms of the FreeType project
license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of README ---

50
dll/3rdparty/freetype/README.CVS vendored Normal file
View File

@@ -0,0 +1,50 @@
The CVS archive doesn't contain pre-built configuration scripts for
UNIXish platforms. To generate them say
sh autogen.sh
which in turn depends on the following packages:
automake (1.9.6)
libtool (1.5.22)
autoconf (2.59c)
The versions given in parentheses are known to work. Newer versions
should work too, of course. Note that autogen.sh also sets up proper
file permissions for the `configure' and auxiliary scripts.
A very common problem is that this script complains that the `aclocal'
program doesn't accept a `--force' option:
generating `configure.ac'
running `aclocal -I . --force'
aclocal: unrecognized option -- `--force'
Try `aclocal --help' for more information.
error while running `aclocal -I . --force'
This means that your version of the automake package is too old.
Please update it before trying to build FreeType.
For static builds which don't use platform specific optimizations, no
configure script is necessary at all; saying
make setup ansi
make
should work on all platforms which have GNU make (or makepp).
----------------------------------------------------------------------
Copyright 2005, 2006, 2007 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
modified, and distributed under the terms of the FreeType project
license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of README.CVS ---

70
dll/3rdparty/freetype/README.ROS vendored Normal file
View File

@@ -0,0 +1,70 @@
CREDITS
The code in this tree is based (it is actually an exact copy with some
ReactOS specific extra files) on the FreeType library, version 2.3.0
It was written and is being maintained by the FreeType team. The projects
website is http://www.freetype.org.
NOTES
Please note that there are two Makefiles in the freetype directory:
- Makefile.freetype which is the original Makefile from the FreeType
distribution
- Makefile which is the ReactOS specific Makefile. It will use the
original Makefile.freetype when needed.
Normally you will just use Makefile and not worry about Makefile.freetype.
There will also be 2 FreeType libraries, lib/freetype/objs/libfreetype.a
and dk/nkm/lib/freetype.a. The second one is the import library for
freetype.dll and is the one that is used in the rest of ReactOS.
lib/freetype/objs/libfreetype.a is a static library which is used to
create the DLL.
PORTING A NEW VERSION
Please note that the procedure below is a one-time only procedure, to be
performed by whoever imports a new FreeType version into the ReactOS
source tree. Once the new version has been committed to CVS all other
developers can just use the normal build procedure.
First, save the old version:
move lib\freetype lib\freetype.old
Unpack the FreeType distribution and copy the files to lib/freetype
(note: without the version number which is present in the pathnames in
the distribution archive).
Setup the FreeType build by copying the correct configuration file:
copy lib\freetype\builds\win32\w32-mingw32.mk lib\freetype\config.mk
Copy the ReactOS specific files from the old directory to the new:
move lib\freetype\Makefile lib\freetype\Makefile.freetype
mkdir lib\freetype\i386
copy lib\freetype.old\rosglue.c lib\freetype
copy lib\freetype.old\i386\setjmplongjmp.s lib\freetype\i386
copy lib\freetype.old\freetype.rc lib\freetype
copy lib\freetype.old\Makefile lib\freetype
copy lib\freetype.old\README.ROS lib\freetype
copy lib\freetype.old\Doxyfile lib\freetype
copy lib\freetype.old\.cvsignore lib\freetype
copy lib\freetype.old\objs\.cvsignore lib\freetype\objs
copy lib\freetype.old\i386\.cvsignore lib\freetype\i386
Next you need to create the freetype.def file. Since this depends on the
"gawk" command, you'll need to have MSYS installed, which is not one of
the normally required packages to build ReactOS. You can get MSYS from the
MinGW site at http://sourceforge.net/projects/mingw. Once you have MSYS
installed you can create the new freetype.def file:
make freetype_def
Well, that's all there is to it. You can delete the old version in
lib\freetype.old. Please adjust the version number in the heading of this
file, so it is obvious to everyone which FreeType version we're using.
After testing, you can commit the new/changed files to CVS. ALthough files
config.mk and freetype.def are generated, they should be included in CVS.
$Id$

61
dll/3rdparty/freetype/autogen.sh vendored Normal file
View File

@@ -0,0 +1,61 @@
#!/bin/sh
# Copyright 2005, 2006, 2007 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
run ()
{
echo "running \`$*'"
eval $*
if test $? != 0 ; then
echo "error while running \`$*'"
exit 1
fi
}
if test ! -f ./builds/unix/configure.raw; then
echo "You must be in the same directory as \`autogen.sh'."
echo "Bootstrapping doesn't work if srcdir != builddir."
exit 1
fi
# This sets freetype_major, freetype_minor, and freetype_patch.
eval `sed -nf version.sed include/freetype/freetype.h`
# We set freetype-patch to an empty value if it is zero.
if test "$freetype_patch" = ".0"; then
freetype_patch=
fi
cd builds/unix
echo "generating \`configure.ac'"
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
< configure.raw > configure.ac
# On MacOS X, the GNU libtool is named `glibtool'.
HOSTOS=`uname`
LIBTOOLIZE=libtoolize
if test "$HOSTOS"x = Darwinx; then
LIBTOOLIZE=glibtoolize
fi
run aclocal -I . --force
run $LIBTOOLIZE --force --copy
run autoconf --force
chmod +x mkinstalldirs
chmod +x install-sh
cd ../..
chmod +x ./configure
# EOF

100
dll/3rdparty/freetype/configure vendored Normal file
View File

@@ -0,0 +1,100 @@
#!/bin/sh
#
# Copyright 2002, 2003, 2004, 2005, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
#
#
# Call the `configure' script located in `builds/unix'.
#
rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
if test "x$GNUMAKE" = x; then
GNUMAKE=make
fi
if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then
echo "GNU make (>= 3.79.1) or makepp (>= 1.19) is required to build FreeType2." >&2
echo "Please try" >&2
echo " \`GNUMAKE=<GNU make command name> $0'." >&2
echo "or >&2"
echo " \`GNUMAKE=\"makepp --norc-substitution\" $0'." >&2
exit 1
fi
fi
# Get `dirname' functionality. This is taken and adapted from autoconf's
# m4sh.m4 (_AS_EXPR_PREPARE, AS_DIRNAME_EXPR, and AS_DIRNAME_SED).
if expr a : '\(a\)' >/dev/null 2>&1; then
ft_expr=expr
else
ft_expr=false
fi
ft2_dir=`(dirname "$0") 2>/dev/null ||
$ft_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
abs_curr_dir=`pwd`
abs_ft2_dir=`cd "$ft2_dir" && pwd`
# build a dummy Makefile if we are not building in the source tree
if test "$abs_curr_dir" != "$abs_ft2_dir"; then
mkdir reference
echo "Copying \`modules.cfg'"
cp $abs_ft2_dir/modules.cfg $abs_curr_dir
echo "Generating \`Makefile'"
echo "TOP_DIR := $abs_ft2_dir" > Makefile
echo "OBJ_DIR := $abs_curr_dir" >> Makefile
echo "OBJ_BUILD := \$(OBJ_DIR)" >> Makefile
echo "DOC_DIR := \$(OBJ_DIR)/reference" >> Makefile
echo "LIBTOOL := \$(OBJ_DIR)/libtool" >> Makefile
echo "ifndef FT2DEMOS" >> Makefile
echo " include \$(TOP_DIR)/Makefile" >> Makefile
echo "else" >> Makefile
echo " TOP_DIR_2 := \$(TOP_DIR)/../ft2demos" >> Makefile
echo " PROJECT := freetype" >> Makefile
echo " CONFIG_MK := \$(OBJ_DIR)/config.mk" >> Makefile
echo " include \$(TOP_DIR_2)/Makefile" >> Makefile
echo "endif" >> Makefile
fi
# call make
CFG=
for x in ${1+"$@"}; do
CFG="$CFG \"$x\""
done
CFG=$CFG $GNUMAKE setup unix
# eof

41
dll/3rdparty/freetype/devel/ft2build.h vendored Normal file
View File

@@ -0,0 +1,41 @@
/***************************************************************************/
/* */
/* ft2build.h */
/* */
/* FreeType 2 build and setup macros. */
/* (Generic version) */
/* */
/* Copyright 1996-2001, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*
* This is a development version of <ft2build.h> that is used
* to build the library in debug mode. Its only difference with
* the reference is that it forces the use of the local `ftoption.h'
* which contains different settings for all configuration macros.
*
* To use it, you must define the environment variable FT2_BUILD_INCLUDE
* to point to the directory containing these two files (`ft2build.h' and
* `ftoption.h'), then invoke Jam as usual.
*/
#ifndef __FT2_BUILD_DEVEL_H__
#define __FT2_BUILD_DEVEL_H__
#define FT_CONFIG_OPTIONS_H <ftoption.h>
#include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_DEVEL_H__ */
/* END */

670
dll/3rdparty/freetype/devel/ftoption.h vendored Normal file
View File

@@ -0,0 +1,670 @@
/***************************************************************************/
/* */
/* ftoption.h (for development) */
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
#include <ft2build.h>
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* USER-SELECTABLE CONFIGURATION MACROS */
/* */
/* This file contains the default configuration macro definitions for */
/* a standard build of the FreeType library. There are three ways to */
/* use this file to build project-specific versions of the library: */
/* */
/* - You can modify this file by hand, but this is not recommended in */
/* cases where you would like to build several versions of the */
/* library from a single source directory. */
/* */
/* - You can put a copy of this file in your build directory, more */
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
/* is the name of a directory that is included _before_ the FreeType */
/* include path during compilation. */
/* */
/* The default FreeType Makefiles and Jamfiles use the build */
/* directory `builds/<system>' by default, but you can easily change */
/* that for your own projects. */
/* */
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
/* locate this file during the build. For example, */
/* */
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
/* #include <freetype/config/ftheader.h> */
/* */
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
/* definitions. */
/* */
/* Note also that you can similarly pre-define the macro */
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
/* that are statically linked to the library at compile time. By */
/* default, this file is <freetype/config/ftmodule.h>. */
/* */
/* We highly recommend using the third method whenever possible. */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
/* the original size; the difference will be that each triplet of */
/* subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
/*************************************************************************/
/* */
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
/* by FreeType to speed up some computations. However, this will create */
/* some problems when compiling the library in strict ANSI mode. */
/* */
/* For this reason, the use of 64-bit integers is normally disabled when */
/* the __STDC__ macro is defined. You can however disable this by */
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
/* */
/* For most compilers, this will only create compilation warnings when */
/* building the library. */
/* */
/* ObNote: The compiler-specific 64-bit integers are detected in the */
/* file `ftconfig.h' either statically or through the */
/* `configure' script on supported platforms. */
/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
/*************************************************************************/
/* */
/* LZW-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `compress' program. This is mostly used to parse many of the PCF */
/* files that come with various X11 distributions. The implementation */
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
/* (see src/lzw/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
#define FT_CONFIG_OPTION_USE_LZW
/*************************************************************************/
/* */
/* Gzip-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `gzip' program. This is mostly used to parse many of the PCF files */
/* that come with XFree86. The implementation uses `zlib' to */
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. See also */
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
/* */
#define FT_CONFIG_OPTION_USE_ZLIB
/*************************************************************************/
/* */
/* ZLib library selection */
/* */
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
/* It allows FreeType's `ftgzip' component to link to the system's */
/* installation of the ZLib library. This is useful on systems like */
/* Unix or VMS where it generally is already available. */
/* */
/* If you let it undefined, the component will use its own copy */
/* of the zlib sources instead. These have been modified to be */
/* included directly within the component and *not* export external */
/* function names. This allows you to link any program with FreeType */
/* _and_ ZLib without linking conflicts. */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/*************************************************************************/
/* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
/* */
/* By default, FreeType 2 is compiled with the `PSNames' module. This */
/* module is in charge of converting a glyph name string into a */
/* Unicode value, or return a Macintosh standard glyph name for the */
/* use with the TrueType `post' table. */
/* */
/* Undefine this macro if you do not want `PSNames' compiled in your */
/* build of FreeType. This has the following effects: */
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* */
/* - The Type 1 driver will not be able to synthetize a Unicode */
/* charmap out of the glyphs found in the fonts. */
/* */
/* You would normally undefine this configuration macro when building */
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
/* */
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Postscript Names to Unicode Values support */
/* */
/* By default, FreeType 2 is built with the `PSNames' module compiled */
/* in. Among other things, the module is used to convert a glyph name */
/* into a Unicode value. This is especially useful in order to */
/* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* through a big table named the `Adobe Glyph List' (AGL). */
/* */
/* Undefine this macro if you do not want the Adobe Glyph List */
/* compiled in your `PSNames' module. The Type 1 driver will not be */
/* able to synthetize a Unicode charmap out of the glyphs found in the */
/* fonts. */
/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
/*************************************************************************/
/* */
/* Support for Mac fonts */
/* */
/* Define this macro if you want support for outline fonts in Mac */
/* format (mac dfont, mac resource, macbinary containing a mac */
/* resource) on non-Mac platforms. */
/* */
/* Note that the `FOND' resource isn't checked. */
/* */
#define FT_CONFIG_OPTION_MAC_FONTS
/*************************************************************************/
/* */
/* Guessing methods to access embedded resource forks */
/* */
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
/* GNU/Linux). */
/* */
/* Resource forks which include fonts data are stored sometimes in */
/* locations which users or developers don't expected. In some cases, */
/* resource forks start with some offset from the head of a file. In */
/* other cases, the actual resource fork is stored in file different */
/* from what the user specifies. If this option is activated, */
/* FreeType tries to guess whether such offsets or different file */
/* names must be used. */
/* */
/* Note that normal, direct access of resource forks is controlled via */
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
/* */
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#endif
/*************************************************************************/
/* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */
/* This allows FreeType to be used with the PostScript language, using */
/* the GhostScript interpreter. */
/* */
/* #define FT_CONFIG_OPTION_INCREMENTAL */
/*************************************************************************/
/* */
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L
/*************************************************************************/
/* */
/* FT_MAX_MODULES */
/* */
/* The maximum number of modules that can be registered in a single */
/* FreeType library object. 32 is the default. */
/* */
#define FT_MAX_MODULES 32
/*************************************************************************/
/* */
/* Debug level */
/* */
/* FreeType can be compiled in debug or trace mode. In debug mode, */
/* errors are reported through the `ftdebug' component. In trace */
/* mode, additional messages are sent to the standard output during */
/* execution. */
/* */
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
/* */
/* Don't define any of these macros to compile in `release' mode! */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
#define FT_DEBUG_LEVEL_ERROR
#define FT_DEBUG_LEVEL_TRACE
/*************************************************************************/
/* */
/* Memory Debugging */
/* */
/* FreeType now comes with an integrated memory debugger that is */
/* capable of detecting simple errors like memory leaks or double */
/* deletes. To compile it within your build of the library, you */
/* should define FT_DEBUG_MEMORY here. */
/* */
/* Note that the memory debugger is only activated at runtime when */
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
#define FT_DEBUG_MEMORY
/*************************************************************************/
/* */
/* Module errors */
/* */
/* If this macro is set (which is _not_ the default), the higher byte */
/* of an error code gives the module in which the error has occurred, */
/* while the lower byte is the real error code. */
/* */
/* Setting this macro makes sense for debugging purposes only, since */
/* it would break source compatibility of certain programs that use */
/* FreeType 2. */
/* */
/* More details can be found in the files ftmoderr.h and fterrors.h. */
/* */
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
/* embedded bitmaps in all formats using the SFNT module (namely */
/* TrueType & OpenType). */
/* */
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
/* load and enumerate the glyph Postscript names in a TrueType or */
/* OpenType file. */
/* */
/* Note that when you do not compile the `PSNames' module by undefining */
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
/* contain additional code used to read the PS Names table from a font. */
/* */
/* (By default, the module uses `PSNames' to extract glyph names.) */
/* */
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
/* access the internal name table in a SFNT-based format like TrueType */
/* or OpenType. The name table contains various strings used to */
/* describe the font, like family name, copyright, version, etc. It */
/* does not contain any glyph name though. */
/* */
/* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftnames.h'. */
/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
/*************************************************************************/
/* */
/* TrueType CMap support */
/* */
/* Here you can fine-tune which TrueType CMap table format shall be */
/* supported. */
#define TT_CONFIG_CMAP_FORMAT_0
#define TT_CONFIG_CMAP_FORMAT_2
#define TT_CONFIG_CMAP_FORMAT_4
#define TT_CONFIG_CMAP_FORMAT_6
#define TT_CONFIG_CMAP_FORMAT_8
#define TT_CONFIG_CMAP_FORMAT_10
#define TT_CONFIG_CMAP_FORMAT_12
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. Note that there are */
/* important patent issues related to the use of the interpreter. */
/* */
/* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */
/* */
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */
/* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */
/* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
/* bytecode interpreter with a huge switch statement, rather than a call */
/* table. This results in smaller and faster code for a number of */
/* architectures. */
/* */
/* Note however that on some compiler/processor combinations, undefining */
/* this macro will generate faster, though larger, code. */
/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
/* TrueType glyph loader to use Apple's definition of how to handle */
/* component offsets in composite glyphs. */
/* */
/* Apple and MS disagree on the default behavior of component offsets */
/* in composites. Apple says that they should be scaled by the scaling */
/* factors in the transformation matrix (roughly, it's more complex) */
/* while MS says they should not. OpenType defines two bits in the */
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://partners.adobe.com/asn/developer/opentype/glyf.html */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
/* and avar tables). This has many similarities to Type 1 Multiple */
/* Masters support. */
/* */
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
/* */
#define TT_CONFIG_OPTION_BDF
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
/* required. */
/* */
#define T1_MAX_DICT_DEPTH 5
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
#define T1_MAX_SUBRS_CALLS 16
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 256
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
/* files into an existing face. Note that if set, the T1 driver will be */
/* unable to produce kerning distances. */
/* */
#undef T1_CONFIG_OPTION_NO_AFM
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of the Multiple Masters font support in the Type 1 */
/* driver. */
/* */
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Compile autofit module with CJK script support. */
/* */
#define AF_CONFIG_OPTION_CJK
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* */
#define AF_CONFIG_OPTION_INDIC
/* */
/*
* Define this variable if you want to keep the layout of internal
* structures that was used prior to FreeType 2.2. This also compiles in
* a few obsolete functions to avoid linking problems on typical Unix
* distributions.
*
* For embedded systems or building a new distribution from scratch, it
* is recommended to disable the macro since it reduces the library's code
* size and activates a few memory-saving optimizations as well.
*/
#undef FT_CONFIG_OPTION_OLD_INTERNALS
/*
* This variable is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#endif
FT_END_HEADER
#endif /* __FTOPTION_H__ */
/* END */

167
dll/3rdparty/freetype/freetype.def vendored Normal file
View File

@@ -0,0 +1,167 @@
LIBRARY freetype
EXPORTS
FTC_CMapCache_Lookup
FTC_CMapCache_New
FTC_ImageCache_Lookup
FTC_ImageCache_LookupScaler
FTC_ImageCache_New
FTC_Manager_Done
FTC_Manager_LookupFace
FTC_Manager_LookupSize
FTC_Manager_New
FTC_Manager_RemoveFaceID
FTC_Manager_Reset
FTC_Node_Unref
FTC_SBitCache_Lookup
FTC_SBitCache_LookupScaler
FTC_SBitCache_New
FT_Activate_Size
FT_Add_Default_Modules
FT_Add_Module
FT_Angle_Diff
FT_Atan2
FT_Attach_File
FT_Attach_Stream
FT_Bitmap_Convert
FT_Bitmap_Copy
FT_Bitmap_Done
FT_Bitmap_Embolden
FT_Bitmap_New
FT_CeilFix
FT_ClassicKern_Free
FT_ClassicKern_Validate
FT_Cos
FT_DivFix
FT_Done_Face
FT_Done_FreeType
FT_Done_Glyph
FT_Done_Library
FT_Done_Size
FT_Face_CheckTrueTypePatents
FT_Face_SetUnpatentedHinting
FT_FloorFix
FT_Get_BDF_Charset_ID
FT_Get_BDF_Property
FT_Get_CMap_Format
FT_Get_CMap_Language_ID
FT_Get_Char_Index
FT_Get_Charmap_Index
FT_Get_First_Char
FT_Get_Glyph
FT_Get_Glyph_Name
FT_Get_Kerning
FT_Get_MM_Var
FT_Get_Module
FT_Get_Multi_Master
FT_Get_Name_Index
FT_Get_Next_Char
FT_Get_PFR_Advance
FT_Get_PFR_Kerning
FT_Get_PFR_Metrics
FT_Get_PS_Font_Info
FT_Get_PS_Font_Private
FT_Get_Postscript_Name
FT_Get_Renderer
FT_Get_Sfnt_Name
FT_Get_Sfnt_Name_Count
FT_Get_Sfnt_Table
FT_Get_SubGlyph_Info
FT_Get_Track_Kerning
FT_Get_TrueType_Engine_Type
FT_Get_WinFNT_Header
FT_GlyphSlot_Embolden
FT_GlyphSlot_Oblique
FT_GlyphSlot_Own_Bitmap
FT_Glyph_Copy
FT_Glyph_Get_CBox
FT_Glyph_Stroke
FT_Glyph_StrokeBorder
FT_Glyph_To_Bitmap
FT_Glyph_Transform
FT_Has_PS_Glyph_Names
FT_Init_FreeType
FT_Library_Version
FT_List_Add
FT_List_Finalize
FT_List_Find
FT_List_Insert
FT_List_Iterate
FT_List_Remove
FT_List_Up
FT_Load_Char
FT_Load_Glyph
FT_Load_Sfnt_Table
FT_Matrix_Invert
FT_Matrix_Multiply
FT_MulDiv
FT_MulFix
FT_New_Face
FT_New_Library
FT_New_Memory_Face
FT_New_Size
FT_OpenType_Free
FT_OpenType_Validate
FT_Open_Face
FT_Outline_Check
FT_Outline_Copy
FT_Outline_Decompose
FT_Outline_Done
FT_Outline_Done_Internal
FT_Outline_Embolden
FT_Outline_GetInsideBorder
FT_Outline_GetOutsideBorder
FT_Outline_Get_BBox
FT_Outline_Get_Bitmap
FT_Outline_Get_CBox
FT_Outline_Get_Orientation
FT_Outline_New
FT_Outline_New_Internal
FT_Outline_Render
FT_Outline_Reverse
FT_Outline_Transform
FT_Outline_Translate
FT_Remove_Module
FT_Render_Glyph
FT_Request_Size
FT_RoundFix
FT_Select_Charmap
FT_Select_Size
FT_Set_Char_Size
FT_Set_Charmap
FT_Set_Debug_Hook
FT_Set_MM_Blend_Coordinates
FT_Set_MM_Design_Coordinates
FT_Set_Pixel_Sizes
FT_Set_Renderer
FT_Set_Transform
FT_Set_Var_Blend_Coordinates
FT_Set_Var_Design_Coordinates
FT_Sfnt_Table_Info
FT_Sin
FT_Stream_OpenGzip
FT_Stream_OpenLZW
FT_Stroker_BeginSubPath
FT_Stroker_ConicTo
FT_Stroker_CubicTo
FT_Stroker_Done
FT_Stroker_EndSubPath
FT_Stroker_Export
FT_Stroker_ExportBorder
FT_Stroker_GetBorderCounts
FT_Stroker_GetCounts
FT_Stroker_LineTo
FT_Stroker_New
FT_Stroker_ParseOutline
FT_Stroker_Rewind
FT_Stroker_Set
FT_Tan
FT_TrueTypeGX_Free
FT_TrueTypeGX_Validate
FT_Vector_From_Polar
FT_Vector_Length
FT_Vector_Polarize
FT_Vector_Rotate
FT_Vector_Transform
FT_Vector_Unit
TT_New_Context
TT_RunIns

107
dll/3rdparty/freetype/freetype.rbuild vendored Normal file
View File

@@ -0,0 +1,107 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="freetype" type="kernelmodedll" entrypoint="0" baseaddress="${BASEADDRESS_FREETYPE}" installbase="system32" installname="freetype.dll" allowwarnings="true">
<importlibrary definition="freetype.def" />
<include base="freetype">include</include>
<define name="_DISABLE_TIDENTS" />
<define name="__NTDRIVER__" />
<define name="__NO_CTYPE_INLINES" />
<define name="FT2_BUILD_LIBRARY" />
<if property="NSWPAT" value="0">
<define name="TT_CONFIG_OPTION_UNPATENTED_HINTING" />
</if>
<if property="NSWPAT" value="1">
<define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
</if>
<library>ntoskrnl</library>
<library>libcntpr</library>
<directory name="i386">
<file>setjmplongjmp.s</file>
</directory>
<directory name="src">
<directory name="base">
<file>ftsystem.c</file>
<file>ftinit.c</file>
<file>ftdebug.c</file>
<file>_ftbase_ros.c</file>
<file>ftbbox.c</file>
<file>ftglyph.c</file>
<file>ftbdf.c</file>
<file>ftbitmap.c</file>
<file>ftgxval.c</file>
<file>ftmm.c</file>
<file>ftotval.c</file>
<file>ftpatent.c</file>
<file>ftpfr.c</file>
<file>ftstroke.c</file>
<file>ftsynth.c</file>
<file>fttype1.c</file>
<file>ftwinfnt.c</file>
</directory>
<directory name="autofit">
<file>autofit.c</file>
</directory>
<directory name="bdf">
<file>bdf.c</file>
</directory>
<directory name="cache">
<file>ftcache.c</file>
</directory>
<directory name="cff">
<file>cff.c</file>
</directory>
<directory name="cid">
<file>type1cid.c</file>
</directory>
<directory name="gxvalid">
<file>gxvalid.c</file>
</directory>
<directory name="gzip">
<file>ftgzip.c</file>
</directory>
<directory name="lzw">
<file>ftlzw.c</file>
</directory>
<directory name="otvalid">
<file>otvalid.c</file>
</directory>
<directory name="pcf">
<file>pcf.c</file>
</directory>
<directory name="pfr">
<file>pfr.c</file>
</directory>
<directory name="psaux">
<file>psaux.c</file>
</directory>
<directory name="pshinter">
<file>pshinter.c</file>
</directory>
<directory name="psnames">
<file>psnames.c</file>
</directory>
<directory name="raster">
<file>raster.c</file>
</directory>
<directory name="sfnt">
<file>sfnt.c</file>
</directory>
<directory name="smooth">
<file>smooth.c</file>
</directory>
<directory name="truetype">
<file>truetype.c</file>
</directory>
<directory name="type1">
<file>type1.c</file>
</directory>
<directory name="type42">
<file>type42.c</file>
</directory>
<directory name="winfonts">
<file>winfnt.c</file>
</directory>
</directory>
<file>rosglue.c</file>
<file>freetype.rc</file>
</module>

8
dll/3rdparty/freetype/freetype.rc vendored Normal file
View File

@@ -0,0 +1,8 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "FreeType font handling library\0"
#define REACTOS_STR_INTERNAL_NAME "freetype\0"
#define REACTOS_STR_ORIGINAL_FILENAME "freetype.dll\0"
#define REACTOS_STR_COMPANY_NAME "ReactOS Development Team/FreeType Team\0"
#define REACTOS_STR_LEGAL_COPYRIGHT "Copyright 1998-2007 ReactOS Team\0"
#define REACTOS_STR_ORIGINAL_COPYRIGHT "Copyright 1996-2007 FreeType Team\0"
#include <reactos/version.rc>

View File

@@ -0,0 +1,91 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: FreeType implementation for ReactOS
* PURPOSE: Implementation of _setjmp/longjmp
* FILE: thirdparty/freetype/i386/setjmplongjmp.s
* PROGRAMMER: Ge van Geldorp (ge@gse.nl)
* NOTES: Copied from glibc.
* I have the feeling this could be implemented using the SEH
* routines, but if it's good enough for glibc it's propably
* good enough for me...
* The MingW headers define jmp_buf to be an array of 16 ints,
* based on the jmp_buf used by MSCVRT. We're using only 6 of
* them, so plenty of space.
*/
#define JB_BX 0
#define JB_SI 1
#define JB_DI 2
#define JB_BP 3
#define JB_SP 4
#define JB_PC 5
#define PCOFF 0
#define JMPBUF 4
/*
* int
* _setjmp(jmp_buf env);
*
* Parameters:
* [ESP+04h] - jmp_buf env
* Registers:
* None
* Returns:
* 0
* Notes:
* Sets up the jmp_buf
*/
.globl __setjmp
__setjmp:
xorl %eax, %eax
movl JMPBUF(%esp), %edx
/* Save registers. */
movl %ebx, (JB_BX*4)(%edx)
movl %esi, (JB_SI*4)(%edx)
movl %edi, (JB_DI*4)(%edx)
leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return. */
movl %ecx, (JB_SP*4)(%edx)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
movl %ecx, (JB_PC*4)(%edx)
movl %ebp, (JB_BP*4)(%edx) /* Save caller's frame pointer. */
ret
#define VAL 8
/*
* void
* longjmp(jmp_buf env, int value);
*
* Parameters:
* [ESP+04h] - jmp_buf setup by _setjmp
* [ESP+08h] - int value to return
* Registers:
* None
* Returns:
* Doesn't return
* Notes:
* Non-local goto
*/
.globl _longjmp
_longjmp:
movl JMPBUF(%esp), %ecx /* User's jmp_buf in %ecx. */
movl VAL(%esp), %eax /* Second argument is return value. */
testl %eax, %eax
jnz 0f
incl %eax
0:
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
/* Restore registers. */
movl (JB_BX*4)(%ecx), %ebx
movl (JB_SI*4)(%ecx), %esi
movl (JB_DI*4)(%ecx), %edi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
/* Jump to saved PC. */
jmp *%edx

View File

@@ -0,0 +1,363 @@
/***************************************************************************/
/* */
/* ftconfig.h */
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This header file contains a number of macro definitions that are used */
/* by the rest of the engine. Most of the macros here are automatically */
/* determined at compile time, and you should not need to change it to */
/* port FreeType, except to compile the library with a non-ANSI */
/* compiler. */
/* */
/* Note however that if some specific modifications are needed, we */
/* advise you to place a modified copy in your build directory. */
/* */
/* The build directory is usually `freetype/builds/<system>', and */
/* contains system-specific files that are always included first when */
/* building the library. */
/* */
/* This ANSI version should stay in `include/freetype/config'. */
/* */
/*************************************************************************/
#ifndef __FTCONFIG_H__
#define __FTCONFIG_H__
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
/* */
/* These macros can be toggled to suit a specific system. The current */
/* ones are defaults used to compile FreeType in an ANSI C environment */
/* (16bit compilers are also supported). Copy this file to your own */
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
/* */
/*************************************************************************/
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
/* `char' type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
#elif FT_UINT_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `int' type!"
#endif
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `long' type!"
#endif
/* Preferred alignment of data */
#define FT_ALIGNMENT 8
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif
/*************************************************************************/
/* */
/* AUTOMATIC CONFIGURATION MACROS */
/* */
/* These macros are computed from the ones defined above. Don't touch */
/* their definition, unless you know precisely what you are doing. No */
/* porter should need to mess with them. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* Mac support */
/* */
/* This is the only necessary change, so it is defined here instead */
/* providing a new configuration file. */
/* */
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
#include "AvailabilityMacros.h"
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
#else
#define FT_MACINTOSH 1
#endif
#endif
/*************************************************************************/
/* */
/* IntN types */
/* */
/* Used to guarantee the size of some specific integers. */
/* */
typedef signed short FT_Int16;
typedef unsigned short FT_UInt16;
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
typedef signed int FT_Int32;
typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
typedef signed long FT_Int32;
typedef unsigned long FT_UInt32;
#else
#error "no 32bit type found -- please check your configuration files"
#endif
/* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
typedef int FT_Fast;
typedef unsigned int FT_UFast;
#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
typedef long FT_Fast;
typedef unsigned long FT_UFast;
#endif
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
/* XXXX: We should probably check the value of __BORLANDC__ in order */
/* to test the compiler version. */
/* this compiler provides the __int64 type */
#define FT_LONG64
#define FT_INT64 __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */
/* Watcom doesn't provide 64-bit data types */
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
#define FT_LONG64
#define FT_INT64 long long int
#elif defined( __GNUC__ )
/* GCC provides the `long long' type */
#define FT_LONG64
#define FT_INT64 long long int
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
/*************************************************************************/
/* */
/* A 64-bit data type will create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable their use if */
/* __STDC__ is defined. You can however ignore this rule by */
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* */
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
#ifdef __STDC__
/* undefine the 64-bit macros in strict ANSI compilation mode */
#undef FT_LONG64
#undef FT_INT64
#endif /* __STDC__ */
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
#define FT_LOCAL_DEF( x ) static x
#else
#ifdef __cplusplus
#define FT_LOCAL( x ) extern "C" x
#define FT_LOCAL_DEF( x ) extern "C" x
#else
#define FT_LOCAL( x ) extern x
#define FT_LOCAL_DEF( x ) x
#endif
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
#ifndef FT_BASE
#ifdef __cplusplus
#define FT_BASE( x ) extern "C" x
#else
#define FT_BASE( x ) extern x
#endif
#endif /* !FT_BASE */
#ifndef FT_BASE_DEF
#ifdef __cplusplus
#define FT_BASE_DEF( x ) x
#else
#define FT_BASE_DEF( x ) x
#endif
#endif /* !FT_BASE_DEF */
#ifndef FT_EXPORT
#ifdef __cplusplus
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#endif /* !FT_EXPORT */
#ifndef FT_EXPORT_DEF
#ifdef __cplusplus
#define FT_EXPORT_DEF( x ) extern "C" x
#else
#define FT_EXPORT_DEF( x ) extern x
#endif
#endif /* !FT_EXPORT_DEF */
#ifndef FT_EXPORT_VAR
#ifdef __cplusplus
#define FT_EXPORT_VAR( x ) extern "C" x
#else
#define FT_EXPORT_VAR( x ) extern x
#endif
#endif /* !FT_EXPORT_VAR */
/* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */
/* */
/* This is special. Within C++, you must specify `extern "C"' for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
/* */
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
/* that contains pointers to callback functions. */
/* */
/* */
/* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl' or `__fastcall' declarations. */
/* */
#ifndef FT_CALLBACK_DEF
#ifdef __cplusplus
#define FT_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_CALLBACK_DEF( x ) static x
#endif
#endif /* FT_CALLBACK_DEF */
#ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C"
#define FT_CALLBACK_TABLE_DEF extern "C"
#else
#define FT_CALLBACK_TABLE extern
#define FT_CALLBACK_TABLE_DEF /* nothing */
#endif
#endif /* FT_CALLBACK_TABLE */
FT_END_HEADER
#endif /* __FTCONFIG_H__ */
/* END */

View File

@@ -0,0 +1,32 @@
/*
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'.
*
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make.
*
*/
FT_USE_MODULE(autofit_module_class)
FT_USE_MODULE(tt_driver_class)
FT_USE_MODULE(t1_driver_class)
FT_USE_MODULE(cff_driver_class)
FT_USE_MODULE(t1cid_driver_class)
FT_USE_MODULE(pfr_driver_class)
FT_USE_MODULE(t42_driver_class)
FT_USE_MODULE(winfnt_driver_class)
FT_USE_MODULE(pcf_driver_class)
FT_USE_MODULE(psaux_module_class)
FT_USE_MODULE(psnames_module_class)
FT_USE_MODULE(pshinter_module_class)
FT_USE_MODULE(ft_raster1_renderer_class)
FT_USE_MODULE(sfnt_module_class)
FT_USE_MODULE(ft_smooth_renderer_class)
FT_USE_MODULE(ft_smooth_lcd_renderer_class)
FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
FT_USE_MODULE(bdf_driver_class)
/* EOF */

View File

@@ -0,0 +1,669 @@
/***************************************************************************/
/* */
/* ftoption.h */
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
#include <ft2build.h>
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* USER-SELECTABLE CONFIGURATION MACROS */
/* */
/* This file contains the default configuration macro definitions for */
/* a standard build of the FreeType library. There are three ways to */
/* use this file to build project-specific versions of the library: */
/* */
/* - You can modify this file by hand, but this is not recommended in */
/* cases where you would like to build several versions of the */
/* library from a single source directory. */
/* */
/* - You can put a copy of this file in your build directory, more */
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
/* is the name of a directory that is included _before_ the FreeType */
/* include path during compilation. */
/* */
/* The default FreeType Makefiles and Jamfiles use the build */
/* directory `builds/<system>' by default, but you can easily change */
/* that for your own projects. */
/* */
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
/* locate this file during the build. For example, */
/* */
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
/* #include <freetype/config/ftheader.h> */
/* */
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
/* definitions. */
/* */
/* Note also that you can similarly pre-define the macro */
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
/* that are statically linked to the library at compile time. By */
/* default, this file is <freetype/config/ftmodule.h>. */
/* */
/* We highly recommend using the third method whenever possible. */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times larger than */
/* the original size; the difference will be that each triplet of */
/* subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
/*************************************************************************/
/* */
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
/* by FreeType to speed up some computations. However, this will create */
/* some problems when compiling the library in strict ANSI mode. */
/* */
/* For this reason, the use of 64-bit integers is normally disabled when */
/* the __STDC__ macro is defined. You can however disable this by */
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
/* */
/* For most compilers, this will only create compilation warnings when */
/* building the library. */
/* */
/* ObNote: The compiler-specific 64-bit integers are detected in the */
/* file `ftconfig.h' either statically or through the */
/* `configure' script on supported platforms. */
/* */
#undef FT_CONFIG_OPTION_FORCE_INT64
/*************************************************************************/
/* */
/* LZW-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `compress' program. This is mostly used to parse many of the PCF */
/* files that come with various X11 distributions. The implementation */
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
/* (see src/lzw/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
#define FT_CONFIG_OPTION_USE_LZW
/*************************************************************************/
/* */
/* Gzip-compressed file support. */
/* */
/* FreeType now handles font files that have been compressed with the */
/* `gzip' program. This is mostly used to parse many of the PCF files */
/* that come with XFree86. The implementation uses `zlib' to */
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
/* */
/* Define this macro if you want to enable this `feature'. See also */
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
/* */
#define FT_CONFIG_OPTION_USE_ZLIB
/*************************************************************************/
/* */
/* ZLib library selection */
/* */
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
/* It allows FreeType's `ftgzip' component to link to the system's */
/* installation of the ZLib library. This is useful on systems like */
/* Unix or VMS where it generally is already available. */
/* */
/* If you let it undefined, the component will use its own copy */
/* of the zlib sources instead. These have been modified to be */
/* included directly within the component and *not* export external */
/* function names. This allows you to link any program with FreeType */
/* _and_ ZLib without linking conflicts. */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
/*************************************************************************/
/* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
/* */
/* By default, FreeType 2 is compiled with the `PSNames' module. This */
/* module is in charge of converting a glyph name string into a */
/* Unicode value, or return a Macintosh standard glyph name for the */
/* use with the TrueType `post' table. */
/* */
/* Undefine this macro if you do not want `PSNames' compiled in your */
/* build of FreeType. This has the following effects: */
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* */
/* - The Type 1 driver will not be able to synthetize a Unicode */
/* charmap out of the glyphs found in the fonts. */
/* */
/* You would normally undefine this configuration macro when building */
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
/* */
#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Postscript Names to Unicode Values support */
/* */
/* By default, FreeType 2 is built with the `PSNames' module compiled */
/* in. Among other things, the module is used to convert a glyph name */
/* into a Unicode value. This is especially useful in order to */
/* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
/* through a big table named the `Adobe Glyph List' (AGL). */
/* */
/* Undefine this macro if you do not want the Adobe Glyph List */
/* compiled in your `PSNames' module. The Type 1 driver will not be */
/* able to synthetize a Unicode charmap out of the glyphs found in the */
/* fonts. */
/* */
#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
/*************************************************************************/
/* */
/* Support for Mac fonts */
/* */
/* Define this macro if you want support for outline fonts in Mac */
/* format (mac dfont, mac resource, macbinary containing a mac */
/* resource) on non-Mac platforms. */
/* */
/* Note that the `FOND' resource isn't checked. */
/* */
#define FT_CONFIG_OPTION_MAC_FONTS
/*************************************************************************/
/* */
/* Guessing methods to access embedded resource forks */
/* */
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
/* GNU/Linux). */
/* */
/* Resource forks which include fonts data are stored sometimes in */
/* locations which users or developers don't expected. In some cases, */
/* resource forks start with some offset from the head of a file. In */
/* other cases, the actual resource fork is stored in file different */
/* from what the user specifies. If this option is activated, */
/* FreeType tries to guess whether such offsets or different file */
/* names must be used. */
/* */
/* Note that normal, direct access of resource forks is controlled via */
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
/* */
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
#endif
/*************************************************************************/
/* */
/* Allow the use of FT_Incremental_Interface to load typefaces that */
/* contain no glyph data, but supply it via a callback function. */
/* This allows FreeType to be used with the PostScript language, using */
/* the GhostScript interpreter. */
/* */
/* #define FT_CONFIG_OPTION_INCREMENTAL */
/*************************************************************************/
/* */
/* The size in bytes of the render pool used by the scan-line converter */
/* to do all of its work. */
/* */
/* This must be greater than 4KByte if you use FreeType to rasterize */
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
/* allocation of the render pool. */
/* */
#define FT_RENDER_POOL_SIZE 16384L
/*************************************************************************/
/* */
/* FT_MAX_MODULES */
/* */
/* The maximum number of modules that can be registered in a single */
/* FreeType library object. 32 is the default. */
/* */
#define FT_MAX_MODULES 32
/*************************************************************************/
/* */
/* Debug level */
/* */
/* FreeType can be compiled in debug or trace mode. In debug mode, */
/* errors are reported through the `ftdebug' component. In trace */
/* mode, additional messages are sent to the standard output during */
/* execution. */
/* */
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
/* */
/* Don't define any of these macros to compile in `release' mode! */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_DEBUG_LEVEL_ERROR */
/* #define FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/
/* */
/* Memory Debugging */
/* */
/* FreeType now comes with an integrated memory debugger that is */
/* capable of detecting simple errors like memory leaks or double */
/* deletes. To compile it within your build of the library, you */
/* should define FT_DEBUG_MEMORY here. */
/* */
/* Note that the memory debugger is only activated at runtime when */
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
/* */
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* #define FT_DEBUG_MEMORY */
/*************************************************************************/
/* */
/* Module errors */
/* */
/* If this macro is set (which is _not_ the default), the higher byte */
/* of an error code gives the module in which the error has occurred, */
/* while the lower byte is the real error code. */
/* */
/* Setting this macro makes sense for debugging purposes only, since */
/* it would break source compatibility of certain programs that use */
/* FreeType 2. */
/* */
/* More details can be found in the files ftmoderr.h and fterrors.h. */
/* */
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
/* embedded bitmaps in all formats using the SFNT module (namely */
/* TrueType & OpenType). */
/* */
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
/* load and enumerate the glyph Postscript names in a TrueType or */
/* OpenType file. */
/* */
/* Note that when you do not compile the `PSNames' module by undefining */
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
/* contain additional code used to read the PS Names table from a font. */
/* */
/* (By default, the module uses `PSNames' to extract glyph names.) */
/* */
#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
/* access the internal name table in a SFNT-based format like TrueType */
/* or OpenType. The name table contains various strings used to */
/* describe the font, like family name, copyright, version, etc. It */
/* does not contain any glyph name though. */
/* */
/* Accessing SFNT names is done through the functions declared in */
/* `freetype/ftnames.h'. */
/* */
#define TT_CONFIG_OPTION_SFNT_NAMES
/*************************************************************************/
/* */
/* TrueType CMap support */
/* */
/* Here you can fine-tune which TrueType CMap table format shall be */
/* supported. */
#define TT_CONFIG_CMAP_FORMAT_0
#define TT_CONFIG_CMAP_FORMAT_2
#define TT_CONFIG_CMAP_FORMAT_4
#define TT_CONFIG_CMAP_FORMAT_6
#define TT_CONFIG_CMAP_FORMAT_8
#define TT_CONFIG_CMAP_FORMAT_10
#define TT_CONFIG_CMAP_FORMAT_12
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
/* a bytecode interpreter in the TrueType driver. Note that there are */
/* important patent issues related to the use of the interpreter. */
/* */
/* By undefining this, you will only compile the code necessary to load */
/* TrueType glyphs without hinting. */
/* */
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. Note that the */
/* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you */
/* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
/* bytecode interpreter with a huge switch statement, rather than a call */
/* table. This results in smaller and faster code for a number of */
/* architectures. */
/* */
/* Note however that on some compiler/processor combinations, undefining */
/* this macro will generate faster, though larger, code. */
/* */
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
/* TrueType glyph loader to use Apple's definition of how to handle */
/* component offsets in composite glyphs. */
/* */
/* Apple and MS disagree on the default behavior of component offsets */
/* in composites. Apple says that they should be scaled by the scaling */
/* factors in the transformation matrix (roughly, it's more complex) */
/* while MS says they should not. OpenType defines two bits in the */
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://partners.adobe.com/asn/developer/opentype/glyf.html */
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
/* and avar tables). This has many similarities to Type 1 Multiple */
/* Masters support. */
/* */
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
/* */
#define TT_CONFIG_OPTION_BDF
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
/* required. */
/* */
#define T1_MAX_DICT_DEPTH 5
/*************************************************************************/
/* */
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
/* calls during glyph loading. */
/* */
#define T1_MAX_SUBRS_CALLS 16
/*************************************************************************/
/* */
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
/* minimum of 16 is required. */
/* */
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
/* */
#define T1_MAX_CHARSTRINGS_OPERANDS 256
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
/* files into an existing face. Note that if set, the T1 driver will be */
/* unable to produce kerning distances. */
/* */
#undef T1_CONFIG_OPTION_NO_AFM
/*************************************************************************/
/* */
/* Define this configuration macro if you want to prevent the */
/* compilation of the Multiple Masters font support in the Type 1 */
/* driver. */
/* */
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* Compile autofit module with CJK script support. */
/* */
#define AF_CONFIG_OPTION_CJK
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* */
/* #define AF_CONFIG_OPTION_INDIC */
/* */
/*
* Define this variable if you want to keep the layout of internal
* structures that was used prior to FreeType 2.2. This also compiles in
* a few obsolete functions to avoid linking problems on typical Unix
* distributions.
*
* For embedded systems or building a new distribution from scratch, it
* is recommended to disable the macro since it reduces the library's code
* size and activates a few memory-saving optimizations as well.
*/
#define FT_CONFIG_OPTION_OLD_INTERNALS
/*
* This variable is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#endif
FT_END_HEADER
#endif /* __FTOPTION_H__ */
/* END */

View File

@@ -1,175 +1,180 @@
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
/* */
/*************************************************************************/
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
#define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/**********************************************************************/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_USHORT_MAX USHRT_MAX
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
#include <stdio.h>
#define FT_FILE FILE
#define ft_fclose fclose
#define ft_fopen fopen
#define ft_fread fread
#define ft_fseek fseek
#define ft_ftell ftell
#define ft_sprintf sprintf
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
#include <stdlib.h>
#define ft_qsort qsort
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
#define ft_scalloc calloc
#define ft_sfree free
#define ft_smalloc malloc
#define ft_srealloc realloc
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
#define ft_strtol strtol
#define ft_getenv getenv
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
#include <stdarg.h>
#endif /* FTSTDLIB_H_ */
/* END */
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */
/* */
/*************************************************************************/
#ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__
#include <stddef.h>
#define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/* IMPORTANT NOTE: We do not define aliases for heap management and */
/* i/o routines (i.e. malloc/free/fopen/fread/...) */
/* since these functions should all be encapsulated */
/* by platform-specific implementations of */
/* `ftsystem.c'. */
/* */
/**********************************************************************/
#include <limits.h>
#define FT_CHAR_BIT CHAR_BIT
#define FT_INT_MAX INT_MAX
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp
#define ft_memcpy memcpy
#define ft_memmove memmove
#define ft_memset memset
#define ft_strcat strcat
#define ft_strcmp strcmp
#define ft_strcpy strcpy
#define ft_strlen strlen
#define ft_strncmp strncmp
#define ft_strncpy strncpy
#define ft_strrchr strrchr
#define ft_strstr strstr
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
#include <stdio.h>
#define FT_FILE FILE
#define ft_fclose fclose
#define ft_fopen fopen
#define ft_fread fread
#define ft_fseek fseek
#define ft_ftell ftell
#define ft_sprintf sprintf
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
#include <stdlib.h>
#define ft_qsort qsort
#define ft_exit exit /* only used to exit from unhandled exceptions */
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
#define ft_scalloc calloc
#define ft_sfree free
#define ft_smalloc malloc
#define ft_srealloc realloc
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
#define ft_atol atol
#define ft_labs labs
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
#include <stdarg.h>
#endif /* __FTSTDLIB_H__ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@@ -1,101 +1,94 @@
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
#ifndef FTBBOX_H_
#define FTBBOX_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm that returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If the font is tricky and the glyph has been loaded with */
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
/* reasonable values for the BBox it is necessary to load the glyph */
/* at a large ppem value (so that the hinting instructions can */
/* properly shift and scale the subglyphs), then extracting the BBox, */
/* which can be eventually converted back to font units. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
/* */
FT_END_HEADER
#endif /* FTBBOX_H_ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2001, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
#ifndef __FTBBOX_H__
#define __FTBBOX_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Computes the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm which returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are walked over to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );
/* */
FT_END_HEADER
#endif /* __FTBBOX_H__ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */

View File

@@ -0,0 +1,200 @@
/***************************************************************************/
/* */
/* ftbdf.h */
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTBDF_H__
#define __FTBDF_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bdf_fonts */
/* */
/* <Title> */
/* BDF Files */
/* */
/* <Abstract> */
/* BDF specific API. */
/* */
/* <Description> */
/* This section contains the declaration of BDF specific functions. */
/* */
/*************************************************************************/
/**********************************************************************
*
* @enum:
* FT_PropertyType
*
* @description:
* A list of BDF property types.
*
* @values:
* BDF_PROPERTY_TYPE_NONE ::
* Value 0 is used to indicate a missing property.
*
* BDF_PROPERTY_TYPE_ATOM ::
* Property is a string atom.
*
* BDF_PROPERTY_TYPE_INTEGER ::
* Property is a 32-bit signed integer.
*
* BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer.
*/
typedef enum BDF_PropertyType_
{
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3
} BDF_PropertyType;
/**********************************************************************
*
* @type:
* BDF_Property
*
* @description:
* A handle to a @BDF_PropertyRec structure to model a given
* BDF/PCF property.
*/
typedef struct BDF_PropertyRec_* BDF_Property;
/**********************************************************************
*
* @struct:
* BDF_PropertyRec
*
* @description:
* This structure models a given BDF/PCF property.
*
* @fields:
* type ::
* The property type.
*
* u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
*
* u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
*
* u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/
typedef struct BDF_PropertyRec_
{
BDF_PropertyType type;
union {
const char* atom;
FT_Int32 integer;
FT_UInt32 cardinal;
} u;
} BDF_PropertyRec;
/**********************************************************************
*
* @function:
* FT_Get_BDF_Charset_ID
*
* @description:
* Retrieves a BDF font character set identity, according to
* the BDF specification.
*
* @input:
* face ::
* A handle to the input face.
*
* @output:
* acharset_encoding ::
* Charset encoding, as a C string, owned by the face.
*
* acharset_registry ::
* Charset registry, as a C string, owned by the face.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
const char* *acharset_registry );
/**********************************************************************
*
* @function:
* FT_Get_BDF_Property
*
* @description:
* Retrieves a BDF property from a BDF or PCF font file.
*
* @input:
* face :: A handle to the input face.
*
* name :: The property name.
*
* @output:
* aproperty :: The property.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the
* font.
*
* In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
const char* prop_name,
BDF_PropertyRec *aproperty );
/* */
FT_END_HEADER
#endif /* __FTBDF_H__ */
/* END */

View File

@@ -1,240 +1,206 @@
/***************************************************************************/
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTBITMAP_H_
#define FTBITMAP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bitmap_handling */
/* */
/* <Title> */
/* Bitmap Handling */
/* */
/* <Abstract> */
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for handling @FT_Bitmap objects. */
/* Note that none of the functions changes the bitmap's `flow' (as */
/* indicated by the sign of the `pitch' field in `FT_Bitmap'). */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Init */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
/* <Note> */
/* A deprecated name for the same function is `FT_Bitmap_New'. */
/* */
FT_EXPORT( void )
FT_Bitmap_Init( FT_Bitmap *abitmap );
/* deprecated */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Copy */
/* */
/* <Description> */
/* Copy a bitmap into another one. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: A handle to the source bitmap. */
/* */
/* <Output> */
/* target :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Embolden */
/* */
/* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */
/* */
/* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */
/* */
/* <InOut> */
/* bitmap :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The current implementation restricts `xStrength' to be less than */
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */
/* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */
/* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */
/* to a bitmap object with depth 8bpp, making the number of used */
/* bytes line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: The source bitmap. */
/* */
/* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */
/* */
/* <Output> */
/* target :: The target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment );
/*************************************************************************/
/* */
/* <Function> */
/* FT_GlyphSlot_Own_Bitmap */
/* */
/* <Description> */
/* Make sure that a glyph slot owns `slot->bitmap'. */
/* */
/* <Input> */
/* slot :: The glyph slot. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* This function is to be used in combination with */
/* @FT_Bitmap_Embolden. */
/* */
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object initialized with @FT_Bitmap_Init. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* bitmap :: The bitmap object to be freed. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
/* */
FT_END_HEADER
#endif /* FTBITMAP_H_ */
/* END */
/***************************************************************************/
/* */
/* ftbitmap.h */
/* */
/* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */
/* bitmaps into 8bpp format (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTBITMAP_H__
#define __FTBITMAP_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bitmap_handling */
/* */
/* <Title> */
/* Bitmap Handling */
/* */
/* <Abstract> */
/* Handling FT_Bitmap objects. */
/* */
/* <Description> */
/* This section contains functions for converting FT_Bitmap objects. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_New */
/* */
/* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */
/* */
/* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */
/* */
FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Copy */
/* */
/* <Description> */
/* Copies an bitmap into another one. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: A handle to the source bitmap. */
/* */
/* <Output> */
/* target :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Embolden */
/* */
/* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */
/* */
/* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */
/* */
/* <InOut> */
/* bitmap :: A handle to the target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The current implementation restricts `xStrength' to be less than */
/* or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call `FT_GlyphSlot_Own_Bitmap' on the slot first. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Convert */
/* */
/* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
/* bitmap object with depth 8bpp, making the number of used bytes per */
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* source :: The source bitmap. */
/* */
/* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */
/* */
/* <Output> */
/* target :: The target bitmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target,
FT_Int alignment );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Bitmap_Done */
/* */
/* <Description> */
/* Destroy a bitmap object created with @FT_Bitmap_New. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* bitmap :: The bitmap object to be freed. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */
/* */
FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap );
/* */
FT_END_HEADER
#endif /* __FTBITMAP_H__ */
/* END */

View File

@@ -0,0 +1,100 @@
/***************************************************************************/
/* */
/* This file defines the structure of the FreeType reference. */
/* It is used by the python script which generates the HTML files. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* general_remarks */
/* */
/* <Title> */
/* General Remarks */
/* */
/* <Sections> */
/* user_allocation */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* core_api */
/* */
/* <Title> */
/* Core API */
/* */
/* <Sections> */
/* version */
/* basic_types */
/* base_interface */
/* glyph_management */
/* mac_specific */
/* sizes_management */
/* header_file_macros */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* format_specific */
/* */
/* <Title> */
/* Format-Specific API */
/* */
/* <Sections> */
/* multiple_masters */
/* truetype_tables */
/* type1_tables */
/* sfnt_names */
/* bdf_fonts */
/* pfr_fonts */
/* winfnt_fonts */
/* font_formats */
/* gasp_table */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* cache_subsystem */
/* */
/* <Title> */
/* Cache Sub-System */
/* */
/* <Sections> */
/* cache_subsystem */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* <Chapter> */
/* support_api */
/* */
/* <Title> */
/* Support API */
/* */
/* <Sections> */
/* computations */
/* list_processing */
/* outline_processing */
/* bitmap_handling */
/* raster */
/* glyph_stroker */
/* system_interface */
/* module_management */
/* gzip */
/* lzw */
/* lcd_filtering */
/* */
/***************************************************************************/

View File

@@ -1,276 +1,239 @@
/***************************************************************************/
/* */
/* fterrdef.h */
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* <Section> */
/* error_code_values */
/* */
/* <Title> */
/* Error Code Values */
/* */
/* <Abstract> */
/* All possible error codes returned by FreeType functions. */
/* */
/* <Description> */
/* The list below is taken verbatim from the file `fterrdef.h' */
/* (loaded automatically by including `FT_FREETYPE_H'). The first */
/* argument of the `FT_ERROR_DEF_' macro is the error label; by */
/* default, the prefix `FT_Err_' gets added so that you get error */
/* names like `FT_Err_Cannot_Open_Resource'. The second argument is */
/* the error code, and the last argument an error string, which is not */
/* used by FreeType. */
/* */
/* Within your application you should *only* use error names and */
/* *never* its numeric values! The latter might (and actually do) */
/* change in forthcoming FreeType versions. */
/* */
/* Macro `FT_NOERRORDEF_' defines `FT_Err_Ok', which is always zero. */
/* See the `Error Enumerations' subsection how to automatically */
/* generate a list of error strings. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Enum> */
/* FT_Err_XXX */
/* */
/*************************************************************************/
/* generic errors */
FT_NOERRORDEF_( Ok, 0x00,
"no error" )
FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
"cannot open resource" )
FT_ERRORDEF_( Unknown_File_Format, 0x02,
"unknown file format" )
FT_ERRORDEF_( Invalid_File_Format, 0x03,
"broken file" )
FT_ERRORDEF_( Invalid_Version, 0x04,
"invalid FreeType version" )
FT_ERRORDEF_( Lower_Module_Version, 0x05,
"module version is too low" )
FT_ERRORDEF_( Invalid_Argument, 0x06,
"invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07,
"unimplemented feature" )
FT_ERRORDEF_( Invalid_Table, 0x08,
"broken table" )
FT_ERRORDEF_( Invalid_Offset, 0x09,
"broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A,
"array allocation size too large" )
FT_ERRORDEF_( Missing_Module, 0x0B,
"missing module" )
FT_ERRORDEF_( Missing_Property, 0x0C,
"missing property" )
/* glyph/character errors */
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
"invalid glyph index" )
FT_ERRORDEF_( Invalid_Character_Code, 0x11,
"invalid character code" )
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
"unsupported glyph image format" )
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
"cannot render this glyph format" )
FT_ERRORDEF_( Invalid_Outline, 0x14,
"invalid outline" )
FT_ERRORDEF_( Invalid_Composite, 0x15,
"invalid composite glyph" )
FT_ERRORDEF_( Too_Many_Hints, 0x16,
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
/* handle errors */
FT_ERRORDEF_( Invalid_Handle, 0x20,
"invalid object handle" )
FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
"invalid library handle" )
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
"invalid module handle" )
FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
"invalid face handle" )
FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
"invalid size handle" )
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
"invalid glyph slot handle" )
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
"invalid charmap handle" )
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
"invalid cache manager handle" )
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
"invalid stream handle" )
/* driver errors */
FT_ERRORDEF_( Too_Many_Drivers, 0x30,
"too many modules" )
FT_ERRORDEF_( Too_Many_Extensions, 0x31,
"too many extensions" )
/* memory errors */
FT_ERRORDEF_( Out_Of_Memory, 0x40,
"out of memory" )
FT_ERRORDEF_( Unlisted_Object, 0x41,
"unlisted object" )
/* stream errors */
FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
"cannot open stream" )
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
"invalid stream seek" )
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
"invalid stream skip" )
FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
"invalid stream read" )
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
"invalid stream operation" )
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
"invalid frame operation" )
FT_ERRORDEF_( Nested_Frame_Access, 0x57,
"nested frame access" )
FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
"invalid frame read" )
/* raster errors */
FT_ERRORDEF_( Raster_Uninitialized, 0x60,
"raster uninitialized" )
FT_ERRORDEF_( Raster_Corrupted, 0x61,
"raster corrupted" )
FT_ERRORDEF_( Raster_Overflow, 0x62,
"raster overflow" )
FT_ERRORDEF_( Raster_Negative_Height, 0x63,
"negative height while rastering" )
/* cache errors */
FT_ERRORDEF_( Too_Many_Caches, 0x70,
"too many registered caches" )
/* TrueType and SFNT errors */
FT_ERRORDEF_( Invalid_Opcode, 0x80,
"invalid opcode" )
FT_ERRORDEF_( Too_Few_Arguments, 0x81,
"too few arguments" )
FT_ERRORDEF_( Stack_Overflow, 0x82,
"stack overflow" )
FT_ERRORDEF_( Code_Overflow, 0x83,
"code overflow" )
FT_ERRORDEF_( Bad_Argument, 0x84,
"bad argument" )
FT_ERRORDEF_( Divide_By_Zero, 0x85,
"division by zero" )
FT_ERRORDEF_( Invalid_Reference, 0x86,
"invalid reference" )
FT_ERRORDEF_( Debug_OpCode, 0x87,
"found debug opcode" )
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
"found ENDF opcode in execution stream" )
FT_ERRORDEF_( Nested_DEFS, 0x89,
"nested DEFS" )
FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
"invalid code range" )
FT_ERRORDEF_( Execution_Too_Long, 0x8B,
"execution context too long" )
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
"too many function definitions" )
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
"too many instruction definitions" )
FT_ERRORDEF_( Table_Missing, 0x8E,
"SFNT font table missing" )
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
"horizontal header (hhea) table missing" )
FT_ERRORDEF_( Locations_Missing, 0x90,
"locations (loca) table missing" )
FT_ERRORDEF_( Name_Table_Missing, 0x91,
"name table missing" )
FT_ERRORDEF_( CMap_Table_Missing, 0x92,
"character map (cmap) table missing" )
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
"horizontal metrics (hmtx) table missing" )
FT_ERRORDEF_( Post_Table_Missing, 0x94,
"PostScript (post) table missing" )
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
"invalid horizontal metrics" )
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
"invalid character map (cmap) format" )
FT_ERRORDEF_( Invalid_PPem, 0x97,
"invalid ppem value" )
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
"invalid vertical metrics" )
FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
"could not find context" )
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
"invalid PostScript (post) table" )
/* CFF, CID, and Type 1 errors */
FT_ERRORDEF_( Syntax_Error, 0xA0,
"opcode syntax error" )
FT_ERRORDEF_( Stack_Underflow, 0xA1,
"argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2,
"ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
"no Unicode glyph name found" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
"glyph too big for hinting" )
/* BDF errors */
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
"`STARTFONT' field missing" )
FT_ERRORDEF_( Missing_Font_Field, 0xB1,
"`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2,
"`SIZE' field missing" )
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
"`FONTBOUNDINGBOX' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
"`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
"`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
"`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
"`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
"`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
"Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
"Font glyphs corrupted or missing fields" )
/* */
/* END */
/***************************************************************************/
/* */
/* fterrdef.h */
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002, 2004, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** LIST OF ERROR CODES/MESSAGES *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
/* including this file. */
/* generic errors */
FT_NOERRORDEF_( Ok, 0x00, \
"no error" )
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
"cannot open resource" )
FT_ERRORDEF_( Unknown_File_Format, 0x02, \
"unknown file format" )
FT_ERRORDEF_( Invalid_File_Format, 0x03, \
"broken file" )
FT_ERRORDEF_( Invalid_Version, 0x04, \
"invalid FreeType version" )
FT_ERRORDEF_( Lower_Module_Version, 0x05, \
"module version is too low" )
FT_ERRORDEF_( Invalid_Argument, 0x06, \
"invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
"unimplemented feature" )
FT_ERRORDEF_( Invalid_Table, 0x08, \
"broken table" )
FT_ERRORDEF_( Invalid_Offset, 0x09, \
"broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A, \
"array allocation size too large" )
/* glyph/character errors */
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
"invalid glyph index" )
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
"invalid character code" )
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
"unsupported glyph image format" )
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
"cannot render this glyph format" )
FT_ERRORDEF_( Invalid_Outline, 0x14, \
"invalid outline" )
FT_ERRORDEF_( Invalid_Composite, 0x15, \
"invalid composite glyph" )
FT_ERRORDEF_( Too_Many_Hints, 0x16, \
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
"invalid pixel size" )
/* handle errors */
FT_ERRORDEF_( Invalid_Handle, 0x20, \
"invalid object handle" )
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
"invalid library handle" )
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
"invalid module handle" )
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
"invalid face handle" )
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
"invalid size handle" )
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
"invalid glyph slot handle" )
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
"invalid charmap handle" )
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
"invalid cache manager handle" )
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
"invalid stream handle" )
/* driver errors */
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
"too many modules" )
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
"too many extensions" )
/* memory errors */
FT_ERRORDEF_( Out_Of_Memory, 0x40, \
"out of memory" )
FT_ERRORDEF_( Unlisted_Object, 0x41, \
"unlisted object" )
/* stream errors */
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
"cannot open stream" )
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
"invalid stream seek" )
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
"invalid stream skip" )
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
"invalid stream read" )
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
"invalid stream operation" )
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
"invalid frame operation" )
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
"nested frame access" )
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
"invalid frame read" )
/* raster errors */
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
"raster uninitialized" )
FT_ERRORDEF_( Raster_Corrupted, 0x61, \
"raster corrupted" )
FT_ERRORDEF_( Raster_Overflow, 0x62, \
"raster overflow" )
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
"negative height while rastering" )
/* cache errors */
FT_ERRORDEF_( Too_Many_Caches, 0x70, \
"too many registered caches" )
/* TrueType and SFNT errors */
FT_ERRORDEF_( Invalid_Opcode, 0x80, \
"invalid opcode" )
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
"too few arguments" )
FT_ERRORDEF_( Stack_Overflow, 0x82, \
"stack overflow" )
FT_ERRORDEF_( Code_Overflow, 0x83, \
"code overflow" )
FT_ERRORDEF_( Bad_Argument, 0x84, \
"bad argument" )
FT_ERRORDEF_( Divide_By_Zero, 0x85, \
"division by zero" )
FT_ERRORDEF_( Invalid_Reference, 0x86, \
"invalid reference" )
FT_ERRORDEF_( Debug_OpCode, 0x87, \
"found debug opcode" )
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
"found ENDF opcode in execution stream" )
FT_ERRORDEF_( Nested_DEFS, 0x89, \
"nested DEFS" )
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
"invalid code range" )
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
"execution context too long" )
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
"too many function definitions" )
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
"too many instruction definitions" )
FT_ERRORDEF_( Table_Missing, 0x8E, \
"SFNT font table missing" )
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
"horizontal header (hhea) table missing" )
FT_ERRORDEF_( Locations_Missing, 0x90, \
"locations (loca) table missing" )
FT_ERRORDEF_( Name_Table_Missing, 0x91, \
"name table missing" )
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
"character map (cmap) table missing" )
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
"horizontal metrics (hmtx) table missing" )
FT_ERRORDEF_( Post_Table_Missing, 0x94, \
"PostScript (post) table missing" )
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
"invalid horizontal metrics" )
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
"invalid character map (cmap) format" )
FT_ERRORDEF_( Invalid_PPem, 0x97, \
"invalid ppem value" )
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
"invalid vertical metrics" )
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
"could not find context" )
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
"invalid PostScript (post) table" )
/* CFF, CID, and Type 1 errors */
FT_ERRORDEF_( Syntax_Error, 0xA0, \
"opcode syntax error" )
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
"argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \
"ignore" )
/* BDF errors */
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
"`STARTFONT' field missing" )
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
"`FONT' field missing" )
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
"`SIZE' field missing" )
FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \
"`CHARS' field missing" )
FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \
"`STARTCHAR' field missing" )
FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \
"`ENCODING' field missing" )
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
"`BBX' field missing" )
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \
"`BBX' too big" )
FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \
"Font header corrupted or missing fields" )
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \
"Font glyphs corrupted or missing fields" )
/* END */

View File

@@ -0,0 +1,206 @@
/***************************************************************************/
/* */
/* fterrors.h */
/* */
/* FreeType error code handling (specification). */
/* */
/* Copyright 1996-2001, 2002, 2004, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This special header file is used to define the handling of FT2 */
/* enumeration constants. It can also be used to generate error message */
/* strings with a small macro trick explained below. */
/* */
/* I - Error Formats */
/* ----------------- */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in ftoption.h in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType 2). You can then use the macro */
/* FT_ERROR_BASE macro to extract the generic error code from an */
/* FT_Error value. */
/* */
/* */
/* II - Error Message strings */
/* -------------------------- */
/* */
/* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */
/* FreeType 2 to save space (most client applications do not use */
/* them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file: */
/* */
/* FT_ERROR_START_LIST :: */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls */
/* (see below). */
/* */
/* FT_ERROR_DEF( e, v, s ) :: */
/* This macro is called to define one single error. */
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
/* `v' is the error numerical value. */
/* `s' is the corresponding error string. */
/* */
/* FT_ERROR_END_LIST :: */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
/* this file. */
/* */
/* Here is a simple example: */
/* */
/* { */
/* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg; */
/* } ft_errors[] = */
/* */
/* #include FT_ERRORS_H */
/* } */
/* */
/*************************************************************************/
#ifndef __FTERRORS_H__
#define __FTERRORS_H__
/* include module base error codes */
#include FT_MODULE_ERRORS_H
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SETUP MACROS *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
#undef FT_NEED_EXTERN_C
#undef FT_ERR_XCAT
#undef FT_ERR_CAT
#define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_'. */
/* */
#ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_
#endif
/* FT_ERR_BASE is used as the base for module-specific errors. */
/* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#ifndef FT_ERR_BASE
#define FT_ERR_BASE FT_Mod_Err_Base
#endif
#else
#undef FT_ERR_BASE
#define FT_ERR_BASE 0
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
/* If FT_ERRORDEF is not defined, we need to define a simple */
/* enumeration type. */
/* */
#ifndef FT_ERRORDEF
#define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
extern "C" {
#endif
#endif /* !FT_ERRORDEF */
/* this macro is used to define an error */
#define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
/* this is only used for <module>_Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
#ifdef FT_ERROR_START_LIST
FT_ERROR_START_LIST
#endif
/* now include the error codes */
#include FT_ERROR_DEFINITIONS_H
#ifdef FT_ERROR_END_LIST
FT_ERROR_END_LIST
#endif
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SIMPLE CLEANUP *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
#ifdef FT_NEED_EXTERN_C
}
#endif
#undef FT_ERROR_START_LIST
#undef FT_ERROR_END_LIST
#undef FT_ERRORDEF
#undef FT_ERRORDEF_
#undef FT_NOERRORDEF_
#undef FT_NEED_EXTERN_C
#undef FT_ERR_CONCAT
#undef FT_ERR_BASE
/* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
#ifndef FT_KEEP_ERR_PREFIX
#undef FT_ERR_PREFIX
#endif
#endif /* __FTERRORS_H__ */
/* END */

View File

@@ -1,129 +1,113 @@
/***************************************************************************/
/* */
/* ftgasp.h */
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTGASP_H_
#define FTGASP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
/***************************************************************************
*
* @section:
* gasp_table
*
* @title:
* Gasp Table
*
* @abstract:
* Retrieving TrueType `gasp' table entries.
*
* @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
* font for specific entries in its `gasp' table, if any. This is
* mainly useful when implementing native TrueType hinting with the
* bytecode interpreter to duplicate the Windows text rendering results.
*/
/*************************************************************************
*
* @enum:
* FT_GASP_XXX
*
* @description:
* A list of values and/or bit-flags returned by the @FT_Get_Gasp
* function.
*
* @values:
* FT_GASP_NO_TABLE ::
* This special value means that there is no GASP table in this face.
* It is up to the client to decide what to do.
*
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation. If this bit
* is not set, no hinting gets applied.
*
* FT_GASP_DO_GRAY ::
* Anti-aliased rendering should be performed at the specified ppem.
* If not set, do monochrome rendering.
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
* If set, smoothing along multiple axes must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
* The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
* used for standard font rasterization only. Independently of that,
* `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
* be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
* `FT_GASP_DO_GRAY' are consequently ignored).
*
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*
* @since:
* 2.3.0
*/
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
*
* @func:
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
*
* @input:
* face :: The source face handle.
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
*
* @since:
* 2.3.0
*/
FT_EXPORT( FT_Int )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
/* */
#endif /* FTGASP_H_ */
/* END */
/***************************************************************************/
/* */
/* ftgasp.h */
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef _FT_GASP_H_
#define _FT_GASP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
/***************************************************************************
*
* @section:
* gasp_table
*
* @title:
* Gasp Table
*
* @abstract:
* Retrieving TrueType `gasp' table entries
*
* @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType
* font for specific entries in their `gasp' table, if any. This is
* mainly useful when implementing native TrueType hinting with the
* bytecode interpreter to duplicate the Windows text rendering results.
*/
/*************************************************************************
*
* @enum:
* FT_GASP_XXX
*
* @description:
* A list of values and/or bit-flags returned by the @FT_Get_Gasp
* function.
*
* @values:
* FT_GASP_NO_TABLE ::
* This special value means that there is no GASP table in this face.
* It is up to the client to decide what to do.
*
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation.
*
* FT_GASP_DO_GRAY ::
* Anti-aliased rendering should be performed at the specified ppem.
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
* Smoothing along multiple axes must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*
* @since:
* 2.3.0
*/
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
*
* @func:
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
*
* @input:
* face :: The source face handle.
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no
* `gasp' table in the face.
*
* @since:
* 2.3.0
*/
FT_EXPORT( FT_Int )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
/* */
#endif /* _FT_GASP_H_ */
/* END */

View File

@@ -1,357 +1,358 @@
/***************************************************************************/
/* */
/* ftgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004-2016 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
#ifndef FTGXVAL_H_
#define FTGXVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gx_validation */
/* */
/* <Title> */
/* TrueTypeGX/AAT Validation */
/* */
/* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/* <Order> */
/* FT_TrueTypeGX_Validate */
/* FT_TrueTypeGX_Free */
/* */
/* FT_ClassicKern_Validate */
/* FT_ClassicKern_Free */
/* */
/* FT_VALIDATE_GX_LENGTH */
/* FT_VALIDATE_GXXXX */
/* FT_VALIDATE_CKERNXXX */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */
/* */
/* */
/*************************************************************************/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/*************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate `feat' table.
*
* FT_VALIDATE_mort ::
* Validate `mort' table.
*
* FT_VALIDATE_morx ::
* Validate `morx' table.
*
* FT_VALIDATE_bsln ::
* Validate `bsln' table.
*
* FT_VALIDATE_just ::
* Validate `just' table.
*
* FT_VALIDATE_kern ::
* Validate `kern' table.
*
* FT_VALIDATE_opbd ::
* Validate `opbd' table.
*
* FT_VALIDATE_trak ::
* Validate `trak' table.
*
* FT_VALIDATE_prop ::
* Validate `prop' table.
*
* FT_VALIDATE_lcar ::
* Validate `lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \
FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \
FT_VALIDATE_just | \
FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \
FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length );
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
/**********************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/**********************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16-bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *ckern_table );
/**********************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );
/* */
FT_END_HEADER
#endif /* FTGXVAL_H_ */
/* END */
/***************************************************************************/
/* */
/* ftgxval.h */
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */
/* */
/***************************************************************************/
#ifndef __FTGXVAL_H__
#define __FTGXVAL_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gx_validation */
/* */
/* <Title> */
/* TrueTypeGX/AAT Validation */
/* */
/* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */
/* */
/* */
/*************************************************************************/
#define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/*************************************************************************
*
* @macro:
* FT_VALIDATE_GX_LENGTH
*
* @description:
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
*
* @enum:
* FT_VALIDATE_GXXXX
*
* @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated.
*
* @values:
* FT_VALIDATE_feat ::
* Validate `feat' table.
*
* FT_VALIDATE_mort ::
* Validate `mort' table.
*
* FT_VALIDATE_morx ::
* Validate `morx' table.
*
* FT_VALIDATE_bsln ::
* Validate `bsln' table.
*
* FT_VALIDATE_just ::
* Validate `just' table.
*
* FT_VALIDATE_kern ::
* Validate `kern' table.
*
* FT_VALIDATE_opbd ::
* Validate `opbd' table.
*
* FT_VALIDATE_trak ::
* Validate `trak' table.
*
* FT_VALIDATE_prop ::
* Validate `prop' table.
*
* FT_VALIDATE_lcar ::
* Validate `lcar' table.
*
* FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar).
*
*/
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \
FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \
FT_VALIDATE_just | \
FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \
FT_VALIDATE_prop | \
FT_VALIDATE_lcar )
/* */
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Validate
*
* @description:
* Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values.
*
* table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed.
*
* @output:
* tables ::
* The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with TrueTypeGX fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length );
/* */
/**********************************************************************
*
* @function:
* FT_TrueTypeGX_Free
*
* @description:
* Free the buffer allocated by TrueTypeGX validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only.
*/
FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table );
/* */
/**********************************************************************
*
* @enum:
* FT_VALIDATE_CKERNXXX
*
* @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid.
*
* @values:
* FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table.
*
* FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table.
*
* FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table.
*/
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/* */
/**********************************************************************
*
* @function:
* FT_ClassicKern_Validate
*
* @description:
* Validate classic (16bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without error
* checking (which can be quite time consuming).
*
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32bit format and the classic 16bit format, while
* FT_ClassicKern_Validate only supports the classic 16bit format.
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values.
*
* @output:
* ckern_table ::
* A pointer to the kern table.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *ckern_table );
/* */
/**********************************************************************
*
* @function:
* FT_ClassicKern_Free
*
* @description:
* Free the buffer allocated by classic Kern validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only.
*/
FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face,
FT_Bytes table );
/* */
FT_END_HEADER
#endif /* __FTGXVAL_H__ */
/* END */

View File

@@ -0,0 +1,102 @@
/***************************************************************************/
/* */
/* ftgzip.h */
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTGZIP_H__
#define __FTGZIP_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* gzip */
/* */
/* <Title> */
/* GZIP Streams */
/* */
/* <Abstract> */
/* Using gzip-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Gzip-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenGzip
*
* @description:
* Open a new stream to parse gzip-compressed font files. This is
* mainly used to support the compressed `*.pcf.gz' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from
* it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* __FTGZIP_H__ */
/* END */

View File

@@ -0,0 +1,331 @@
/***************************************************************************/
/* */
/* ftincrem.h */
/* */
/* FreeType incremental loading (specification). */
/* */
/* Copyright 2002, 2003, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTINCREM_H__
#define __FTINCREM_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/***************************************************************************
*
* @section:
* incremental
*
* @title:
* Incremental Loading
*
* @abstract:
* Custom Glyph Loading.
*
* @description:
* This section contains various functions used to perform so-called
* `incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application,
*
* Apart from that, all other tables are loaded normally from the font
* file. This mode is useful when FreeType is used within another
* engine, e.g., a Postscript Imaging Processor.
*
* To enable this mode, you must use @FT_Open_Face, passing an
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
* @FT_Incremental_Interface value. See the comments for
* @FT_Incremental_InterfaceRec for an example.
*
*/
/***************************************************************************
*
* @type:
* FT_Incremental
*
* @description:
* An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., Postscript interpreters),
* where the glyph data isn't in the font file, or must be overridden by
* different values.
*
* @note:
* It is up to client applications to create and implement @FT_Incremental
* objects, as long as they provide implementations for the methods
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
* and @FT_Incremental_GetGlyphMetricsFunc.
*
* See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType.
*/
typedef struct FT_IncrementalRec_* FT_Incremental;
/***************************************************************************
*
* @struct:
* FT_Incremental_Metrics
*
* @description:
* A small structure used to contain the basic glyph metrics returned
* by the @FT_Incremental_GetGlyphMetricsFunc method.
*
* @fields:
* bearing_x ::
* Left bearing, in font units.
*
* bearing_y ::
* Top bearing, in font units.
*
* advance ::
* Glyph advance, in font units.
*
* @note:
* These correspond to horizontal or vertical metrics depending on the
* value of the `vertical' argument to the function
* @FT_Incremental_GetGlyphMetricsFunc.
*/
typedef struct FT_Incremental_MetricsRec_
{
FT_Long bearing_x;
FT_Long bearing_y;
FT_Long advance;
} FT_Incremental_MetricsRec, *FT_Incremental_Metrics;
/***************************************************************************
*
* @type:
* FT_Incremental_GetGlyphDataFunc
*
* @description:
* A function called by FreeType to access a given glyph's data bytes
* during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
* enabled.
*
* Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within
* the `glyf' table. For Postscript formats, it must correspond to the
* *unencrypted* charstring bytes, without any `lenIV' header. It is
* undefined for any other format.
*
* @input:
* incremental ::
* Handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* @output:
* adata ::
* A structure describing the returned glyph data bytes (which will be
* accessed as a read-only byte block).
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release
* the data bytes.
*
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs.
*/
typedef FT_Error
(*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
FT_UInt glyph_index,
FT_Data* adata );
/***************************************************************************
*
* @type:
* FT_Incremental_FreeGlyphDataFunc
*
* @description:
* A function used to release the glyph data bytes returned by a
* successful call to @FT_Incremental_GetGlyphDataFunc.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* data ::
* A structure describing the glyph data bytes (which will be accessed
* as a read-only byte block).
*/
typedef void
(*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
FT_Data* data );
/***************************************************************************
*
* @type:
* FT_Incremental_GetGlyphMetricsFunc
*
* @description:
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place from
* the glyph images proper.
*
* @input:
* incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client
* application.
*
* glyph_index ::
* Index of relevant glyph.
*
* vertical ::
* If true, return vertical metrics.
*
* ametrics ::
* This parameter is used for both input and output.
* The original glyph metrics, if any, in font units. If metrics are
* not available all the values must be set to zero.
*
* @output:
* ametrics ::
* The replacement glyph metrics in font units.
*
*/
typedef FT_Error
(*FT_Incremental_GetGlyphMetricsFunc)
( FT_Incremental incremental,
FT_UInt glyph_index,
FT_Bool vertical,
FT_Incremental_MetricsRec *ametrics );
/**************************************************************************
*
* @struct:
* FT_Incremental_FuncsRec
*
* @description:
* A table of functions for accessing fonts that load data
* incrementally. Used in @FT_Incremental_InterfaceRec.
*
* @fields:
* get_glyph_data ::
* The function to get glyph data. Must not be null.
*
* free_glyph_data ::
* The function to release glyph data. Must not be null.
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does
* not provide overriding glyph metrics.
*/
typedef struct FT_Incremental_FuncsRec_
{
FT_Incremental_GetGlyphDataFunc get_glyph_data;
FT_Incremental_FreeGlyphDataFunc free_glyph_data;
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
} FT_Incremental_FuncsRec;
/***************************************************************************
*
* @struct:
* FT_Incremental_InterfaceRec
*
* @description:
* A structure to be used with @FT_Open_Face to indicate that the user
* wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example:
*
* {
* FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter;
* FT_Open_Args open_args;
*
*
* // set up incremental descriptor
* inc_int.funcs = my_funcs;
* inc_int.object = my_object;
*
* // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int;
*
* // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument
*
* // open the font
* error = FT_Open_Face( library, &open_args, index, &face );
* ...
* }
*/
typedef struct FT_Incremental_InterfaceRec_
{
const FT_Incremental_FuncsRec* funcs;
FT_Incremental object;
} FT_Incremental_InterfaceRec;
/***************************************************************************
*
* @type:
* FT_Incremental_Interface
*
* @description:
* A pointer to an @FT_Incremental_InterfaceRec structure.
*
*/
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType.
*
*/
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/* */
FT_END_HEADER
#endif /* __FTINCREM_H__ */
/* END */

View File

@@ -0,0 +1,166 @@
/***************************************************************************/
/* */
/* ftlcdfil.h */
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
/* Copyright 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FT_LCD_FILTER_H__
#define __FT_LCD_FILTER_H__
#include <ft2build.h>
#include FT_FREETYPE_H
FT_BEGIN_HEADER
/***************************************************************************
*
* @section:
* lcd_filtering
*
* @title:
* LCD Filtering
*
* @abstract:
* Reduce color fringes of LCD-optimized bitmaps.
*
* @description:
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass
* filter which is then applied to LCD-optimized bitmaps generated
* through @FT_Render_Glyph. This is useful to reduce color fringes
* which would occur with unfiltered rendering.
*
* Note that no filter is active by default, and that this function is
* *not* implemented in default builds of the library. You need to
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
* in order to activate it.
*/
/****************************************************************************
*
* @func:
* FT_LcdFilter
*
* @description:
* A list of values to identify various types of LCD filters.
*
* @values:
* FT_LCD_FILTER_NONE ::
* Do not perform filtering. When used with subpixel rendering, this
* results in sometimes severe color fringes.
*
* FT_LCD_FILTER_DEFAULT ::
* The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output.
*
* FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that produces less blurriness at the
* cost of slightly more color fringes than the default one. It might
* be better, depending on taste, your monitor, or your personal vision.
*
* FT_LCD_FILTER_LEGACY ::
* This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid.
* In other words, it only works well if the TrueType bytecode
* interpreter is enabled *and* high-quality hinted fonts are used.
*
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
* @since:
* 2.3.0
*/
typedef enum
{
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */
} FT_LcdFilter;
/**************************************************************************
*
* @func:
* FT_Library_SetLcdFilter
*
* @description:
* This function is used to apply color filtering to LCD decimated
* bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
*
* @input:
* library ::
* A handle to the target library instance.
*
* filter ::
* The filter type.
*
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work
* well on most LCD screens.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This feature is always disabled by default. Clients must make an
* explicit call to this function with a `filter' value other than
* @FT_LCD_FILTER_NONE in order to enable it.
*
* Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
*
* It does _not_ affect the output of @FT_Outline_Render and
* @FT_Outline_Get_Bitmap.
*
* If this feature is activated, the dimensions of LCD glyph bitmaps are
* either larger or taller than the dimensions of the corresponding
* outline with regards to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and
* up to 3 pixels to the right.
*
* The bitmap offset values are adjusted correctly, so clients shouldn't
* need to modify their layout and glyph positioning code when enabling
* the filter.
*
* @since:
* 2.3.0
*/
FT_EXPORT( FT_Error )
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter );
/* */
FT_END_HEADER
#endif /* __FT_LCD_FILTER_H__ */
/* END */

View File

@@ -1,276 +1,273 @@
/***************************************************************************/
/* */
/* ftlist.h */
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */
/* */
/*************************************************************************/
#ifndef FTLIST_H_
#define FTLIST_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/* <Title> */
/* List Processing */
/* */
/* <Abstract> */
/* Simple management of lists. */
/* */
/* <Description> */
/* This section contains various definitions related to list */
/* processing using doubly-linked nodes. */
/* */
/* <Order> */
/* FT_List */
/* FT_ListNode */
/* FT_ListRec */
/* FT_ListNodeRec */
/* */
/* FT_List_Add */
/* FT_List_Insert */
/* FT_List_Find */
/* FT_List_Remove */
/* FT_List_Up */
/* FT_List_Iterate */
/* FT_List_Iterator */
/* FT_List_Finalize */
/* FT_List_Destructor */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Find */
/* */
/* <Description> */
/* Find the list node for a given listed object. */
/* */
/* <Input> */
/* list :: A pointer to the parent list. */
/* data :: The address of the listed object. */
/* */
/* <Return> */
/* List node. NULL if it wasn't found. */
/* */
FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list,
void* data );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Add */
/* */
/* <Description> */
/* Append an element to the end of a list. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to append. */
/* */
FT_EXPORT( void )
FT_List_Add( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Insert */
/* */
/* <Description> */
/* Insert an element at the head of a list. */
/* */
/* <InOut> */
/* list :: A pointer to parent list. */
/* node :: The node to insert. */
/* */
FT_EXPORT( void )
FT_List_Insert( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Remove */
/* */
/* <Description> */
/* Remove a node from a list. This function doesn't check whether */
/* the node is in the list! */
/* */
/* <Input> */
/* node :: The node to remove. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* */
FT_EXPORT( void )
FT_List_Remove( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Up */
/* */
/* <Description> */
/* Move a node to the head/top of a list. Used to maintain LRU */
/* lists. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to move. */
/* */
FT_EXPORT( void )
FT_List_Up( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Iterator */
/* */
/* <Description> */
/* An FT_List iterator function that is called during a list parse */
/* by @FT_List_Iterate. */
/* */
/* <Input> */
/* node :: The current iteration list node. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. */
/* Can be used to point to the iteration's state. */
/* */
typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Iterate */
/* */
/* <Description> */
/* Parse a list and calls a given iterator function on each element. */
/* Note that parsing is stopped as soon as one of the iterator calls */
/* returns a non-zero value. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field that is passed as the second */
/* argument to the iterator. */
/* */
/* <Return> */
/* The result (a FreeType error code) of the last iterator call. */
/* */
FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Destructor */
/* */
/* <Description> */
/* An @FT_List iterator function that is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */
/* */
/* <Input> */
/* system :: The current system object. */
/* */
/* data :: The current object to destroy. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
/* be used to point to the iteration's state. */
/* */
typedef void
(*FT_List_Destructor)( FT_Memory memory,
void* data,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Finalize */
/* */
/* <Description> */
/* Destroy all elements in the list as well as the list itself. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* */
/* destroy :: A list destructor that will be applied to each element */
/* of the list. Set this to NULL if not needed. */
/* */
/* memory :: The current memory object that handles deallocation. */
/* */
/* user :: A user-supplied field that is passed as the last */
/* argument to the destructor. */
/* */
/* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */
/* */
FT_EXPORT( void )
FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
FT_Memory memory,
void* user );
/* */
FT_END_HEADER
#endif /* FTLIST_H_ */
/* END */
/***************************************************************************/
/* */
/* ftlist.h */
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2001, 2003, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */
/* */
/*************************************************************************/
#ifndef __FTLIST_H__
#define __FTLIST_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* list_processing */
/* */
/* <Title> */
/* List Processing */
/* */
/* <Abstract> */
/* Simple management of lists. */
/* */
/* <Description> */
/* This section contains various definitions related to list */
/* processing using doubly-linked nodes. */
/* */
/* <Order> */
/* FT_List */
/* FT_ListNode */
/* FT_ListRec */
/* FT_ListNodeRec */
/* */
/* FT_List_Add */
/* FT_List_Insert */
/* FT_List_Find */
/* FT_List_Remove */
/* FT_List_Up */
/* FT_List_Iterate */
/* FT_List_Iterator */
/* FT_List_Finalize */
/* FT_List_Destructor */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Find */
/* */
/* <Description> */
/* Finds the list node for a given listed object. */
/* */
/* <Input> */
/* list :: A pointer to the parent list. */
/* data :: The address of the listed object. */
/* */
/* <Return> */
/* List node. NULL if it wasn't found. */
/* */
FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list,
void* data );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Add */
/* */
/* <Description> */
/* Appends an element to the end of a list. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to append. */
/* */
FT_EXPORT( void )
FT_List_Add( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Insert */
/* */
/* <Description> */
/* Inserts an element at the head of a list. */
/* */
/* <InOut> */
/* list :: A pointer to parent list. */
/* node :: The node to insert. */
/* */
FT_EXPORT( void )
FT_List_Insert( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Remove */
/* */
/* <Description> */
/* Removes a node from a list. This function doesn't check whether */
/* the node is in the list! */
/* */
/* <Input> */
/* node :: The node to remove. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* */
FT_EXPORT( void )
FT_List_Remove( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Up */
/* */
/* <Description> */
/* Moves a node to the head/top of a list. Used to maintain LRU */
/* lists. */
/* */
/* <InOut> */
/* list :: A pointer to the parent list. */
/* node :: The node to move. */
/* */
FT_EXPORT( void )
FT_List_Up( FT_List list,
FT_ListNode node );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Iterator */
/* */
/* <Description> */
/* An FT_List iterator function which is called during a list parse */
/* by @FT_List_Iterate. */
/* */
/* <Input> */
/* node :: The current iteration list node. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. */
/* Can be used to point to the iteration's state. */
/* */
typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Iterate */
/* */
/* <Description> */
/* Parses a list and calls a given iterator function on each element. */
/* Note that parsing is stopped as soon as one of the iterator calls */
/* returns a non-zero value. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field which is passed as the second */
/* argument to the iterator. */
/* */
/* <Return> */
/* The result (a FreeType error code) of the last iterator call. */
/* */
FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user );
/*************************************************************************/
/* */
/* <FuncType> */
/* FT_List_Destructor */
/* */
/* <Description> */
/* An @FT_List iterator function which is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */
/* */
/* <Input> */
/* system :: The current system object. */
/* */
/* data :: The current object to destroy. */
/* */
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */
/* be used to point to the iteration's state. */
/* */
typedef void
(*FT_List_Destructor)( FT_Memory memory,
void* data,
void* user );
/*************************************************************************/
/* */
/* <Function> */
/* FT_List_Finalize */
/* */
/* <Description> */
/* Destroys all elements in the list as well as the list itself. */
/* */
/* <Input> */
/* list :: A handle to the list. */
/* */
/* destroy :: A list destructor that will be applied to each element */
/* of the list. */
/* */
/* memory :: The current memory object which handles deallocation. */
/* */
/* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */
/* */
FT_EXPORT( void )
FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
FT_Memory memory,
void* user );
/* */
FT_END_HEADER
#endif /* __FTLIST_H__ */
/* END */

View File

@@ -1,99 +1,99 @@
/***************************************************************************/
/* */
/* ftlzw.h */
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTLZW_H_
#define FTLZW_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* lzw */
/* */
/* <Title> */
/* LZW Streams */
/* */
/* <Abstract> */
/* Using LZW-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of LZW-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is
* mainly used to support the compressed `*.pcf.Z' fonts that come
* with XFree86.
*
* @input:
* stream :: The target embedding stream.
*
* source :: The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with LZW support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* FTLZW_H_ */
/* END */
/***************************************************************************/
/* */
/* ftlzw.h */
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTLZW_H__
#define __FTLZW_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* lzw */
/* */
/* <Title> */
/* LZW Streams */
/* */
/* <Abstract> */
/* Using LZW-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of LZW-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenLZW
*
* @description:
* Open a new stream to parse LZW-compressed font files. This is
* mainly used to support the compressed `*.pcf.Z' fonts that come
* with XFree86.
*
* @input:
* stream :: The target embedding stream.
*
* source :: The source stream.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream
*
* In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it
* and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with LZW support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* __FTLZW_H__ */
/* END */

View File

@@ -1,274 +1,272 @@
/***************************************************************************/
/* */
/* ftmac.h */
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2016 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* NOTE: Include this file after FT_FREETYPE_H and after any */
/* Mac-specific headers (because this header uses Mac types such as */
/* Handle, FSSpec, FSRef, etc.) */
/* */
/***************************************************************************/
#ifndef FTMAC_H_
#define FTMAC_H_
#include <ft2build.h>
FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
#endif
/*************************************************************************/
/* */
/* <Section> */
/* mac_specific */
/* */
/* <Title> */
/* Mac Specific Interface */
/* */
/* <Abstract> */
/* Only available on the Macintosh. */
/* */
/* <Description> */
/* The following definitions are only available if FreeType is */
/* compiled on a Macintosh. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FOND */
/* */
/* <Description> */
/* Create a new face object from a FOND resource. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* fond :: A FOND resource. */
/* */
/* face_index :: Only supported for the -1 `sanity check' special */
/* case. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Notes> */
/* This function can be used to create @FT_Face objects from fonts */
/* that are installed in the system as follows. */
/* */
/* { */
/* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library,
Handle fond,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
/* Bold). */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFilePath_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return a pathname of the disk file and face index for given font */
/* name that is handled by ATS framework. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* path :: Buffer to store pathname of the file. For passing */
/* to @FT_New_Face. The client must allocate this */
/* buffer before calling this function. */
/* */
/* maxPathSize :: Lengths of the buffer `path' that client allocated. */
/* */
/* face_index :: Index of the face. For passing to @FT_New_Face. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path,
UInt32 maxPathSize,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSSpec */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSSpec to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSSpec to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
/* it accepts an FSSpec instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSRef */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSRef to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSRef to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index~0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
/* it accepts an FSRef instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
/* */
FT_END_HEADER
#endif /* FTMAC_H_ */
/* END */
/***************************************************************************/
/* */
/* ftmac.h */
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2001, 2004, 2006, 2007 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* NOTE: Include this file after <freetype/freetype.h> and after the */
/* Mac-specific <Types.h> header (or any other Mac header that */
/* includes <Types.h>); we use Handle type. */
/* */
/***************************************************************************/
#ifndef __FTMAC_H__
#define __FTMAC_H__
#include <ft2build.h>
FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
#endif
/*************************************************************************/
/* */
/* <Section> */
/* mac_specific */
/* */
/* <Title> */
/* Mac Specific Interface */
/* */
/* <Abstract> */
/* Only available on the Macintosh. */
/* */
/* <Description> */
/* The following definitions are only available if FreeType is */
/* compiled on a Macintosh. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FOND */
/* */
/* <Description> */
/* Create a new face object from a FOND resource. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* fond :: A FOND resource. */
/* */
/* face_index :: Only supported for the -1 `sanity check' special */
/* case. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Notes> */
/* This function can be used to create @FT_Face objects from fonts */
/* that are installed in the system as follows. */
/* */
/* { */
/* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* } */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library,
Handle fond,
FT_Long face_index,
FT_Face *aface );
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font (e.g., Times New Roman */
/* Bold). */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFile_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return an FSSpec for the disk file containing the named font. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec,
FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_GetFilePath_From_Mac_ATS_Name */
/* */
/* <Description> */
/* Return a pathname of the disk file and face index for given font */
/* name which is handled by ATS framework. */
/* */
/* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */
/* */
/* <Output> */
/* path :: Buffer to store pathname of the file. For passing */
/* to @FT_New_Face. The client must allocate this */
/* buffer before calling this function. */
/* */
/* maxPathSize :: Lengths of the buffer `path' that client allocated. */
/* */
/* face_index :: Index of the face. For passing to @FT_New_Face. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path,
UInt32 maxPathSize,
FT_Long* face_index );
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSSpec */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSSpec to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSSpec to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index 0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
/* it accepts an FSSpec instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Face_From_FSRef */
/* */
/* <Description> */
/* Create a new face object from a given resource and typeface index */
/* using an FSRef to the font file. */
/* */
/* <InOut> */
/* library :: A handle to the library resource. */
/* */
/* <Input> */
/* spec :: FSRef to the font file. */
/* */
/* face_index :: The index of the face within the resource. The */
/* first face has index 0. */
/* <Output> */
/* aface :: A handle to a new face object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
/* it accepts an FSRef instead of a path. */
/* */
FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref,
FT_Long face_index,
FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE;
/* */
FT_END_HEADER
#endif /* __FTMAC_H__ */
/* END */

View File

@@ -1,388 +1,378 @@
/***************************************************************************/
/* */
/* ftmm.h */
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTMM_H_
#define FTMM_H_
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* multiple_masters */
/* */
/* <Title> */
/* Multiple Masters */
/* */
/* <Abstract> */
/* How to manage Multiple Masters fonts. */
/* */
/* <Description> */
/* The following types and functions are used to manage Multiple */
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
/* George Williams has extended this interface to make it work with */
/* both Type~1 Multiple Masters fonts and GX distortable (var) */
/* fonts. Some of these routines only work with MM fonts, others */
/* will work with both types. They are similar enough that a */
/* consistent interface makes sense. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
typedef struct FT_MM_Axis_
{
FT_String* name;
FT_Long minimum;
FT_Long maximum;
} FT_MM_Axis;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
/* */
/* num_designs :: Number of designs; should be normally 2^num_axis */
/* even though the Type~1 specification strangely */
/* allows for intermediate designs to be present. */
/* This number cannot exceed~16. */
/* */
/* axis :: A table of axis descriptors. */
/* */
typedef struct FT_Multi_Master_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_MM_Axis axis[T1_MAX_MM_AXIS];
} FT_Multi_Master;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* Not always meaningful for GX. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
/* FreeType computes meaningful default values for MM; it */
/* is then an integer value, not in 16.16 format. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
/* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */
/* */
/* strid :: The entry in `name' table (another GX version of */
/* `name'). */
/* Not meaningful for MM. */
/* */
typedef struct FT_Var_Axis_
{
FT_String* name;
FT_Fixed minimum;
FT_Fixed def;
FT_Fixed maximum;
FT_ULong tag;
FT_UInt strid;
} FT_Var_Axis;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Named_Style */
/* */
/* <Description> */
/* A simple structure used to model a named style in a GX var font. */
/* */
/* This structure can't be used for MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
/* This is an array with one entry for each axis. */
/* */
/* strid :: The entry in `name' table identifying this style. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
} FT_Var_Named_Style;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Var */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */
/* */
/* Some fields are specific to one format and not to the other. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
/* MM; no limit in GX. */
/* */
/* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */
/* (where every glyph could have a different */
/* number of designs). */
/* */
/* num_namedstyles :: The number of named styles; a `named style' is */
/* a tuple of design coordinates that has a string */
/* ID (in the `name' table) associated with it. */
/* The font can tell the user that, for example, */
/* [Weight=1.5,Width=1.1] is `Bold'. */
/* */
/* For Type 1 Multiple Masters fonts, this value */
/* is always zero because the format does not */
/* support named styles. */
/* */
/* axis :: An axis descriptor table. */
/* GX fonts contain slightly more data than MM. */
/* Memory management of this pointer is done */
/* internally by FreeType. */
/* */
/* namedstyle :: A named style table. */
/* Only meaningful with GX. */
/* Memory management of this pointer is done */
/* internally by FreeType. */
/* */
typedef struct FT_MM_Var_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_UInt num_namedstyles;
FT_Var_Axis* axis;
FT_Var_Named_Style* namedstyle;
} FT_MM_Var;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieve the Multiple Master descriptor of a given font. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_MM_Var */
/* */
/* <Description> */
/* Retrieve the Multiple Master/GX var descriptor of a given font. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must */
/* deallocate with `free' after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_MM_Var( FT_Face face,
FT_MM_Var* *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of available design coordinates. If it */
/* is larger than the number of axes, ignore the excess */
/* values. If it is smaller than the number of axes, */
/* use default values for the remaining axes. */
/* */
/* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Blend_Coordinates */
/* */
/* <Description> */
/* This is another name of @FT_Set_MM_Blend_Coordinates. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/* */
FT_END_HEADER
#endif /* FTMM_H_ */
/* END */
/***************************************************************************/
/* */
/* ftmm.h */
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTMM_H__
#define __FTMM_H__
#include <ft2build.h>
#include FT_TYPE1_TABLES_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* multiple_masters */
/* */
/* <Title> */
/* Multiple Masters */
/* */
/* <Abstract> */
/* How to manage Multiple Masters fonts. */
/* */
/* <Description> */
/* The following types and functions are used to manage Multiple */
/* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */
/* */
/* George Williams has extended this interface to make it work with */
/* both Type 1 Multiple Masters fonts and GX distortable (var) */
/* fonts. Some of these routines only work with MM fonts, others */
/* will work with both types. They are similar enough that a */
/* consistent interface makes sense. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
typedef struct FT_MM_Axis_
{
FT_String* name;
FT_Long minimum;
FT_Long maximum;
} FT_MM_Axis;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* This structure can't be used for GX var fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed 4. */
/* */
/* num_designs :: Number of designs; should be normally 2^num_axis */
/* even though the Type 1 specification strangely */
/* allows for intermediate designs to be present. This */
/* number cannot exceed 16. */
/* */
/* axis :: A table of axis descriptors. */
/* */
typedef struct FT_Multi_Master_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_MM_Axis axis[T1_MAX_MM_AXIS];
} FT_Multi_Master;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* Not always meaningful for GX. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* def :: The axis's default design coordinate. */
/* FreeType computes meaningful default values for MM; it */
/* is then an integer value, not in 16.16 format. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
/* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */
/* */
/* strid :: The entry in `name' table (another GX version of */
/* `name'). */
/* Not meaningful for MM. */
/* */
typedef struct FT_Var_Axis_
{
FT_String* name;
FT_Fixed minimum;
FT_Fixed def;
FT_Fixed maximum;
FT_ULong tag;
FT_UInt strid;
} FT_Var_Axis;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Var_Named_Style */
/* */
/* <Description> */
/* A simple structure used to model a named style in a GX var font. */
/* */
/* This structure can't be used for MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
/* This is an array with one entry for each axis. */
/* */
/* strid :: The entry in `name' table identifying this style. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
} FT_Var_Named_Style;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Var */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */
/* */
/* Some fields are specific to one format and not to the other. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is 4 for */
/* MM; no limit in GX. */
/* */
/* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */
/* (where every glyph could have a different */
/* number of designs). */
/* */
/* num_namedstyles :: The number of named styles; only meaningful for */
/* GX which allows certain design coordinates to */
/* have a string ID (in the `name' table) */
/* associated with them. The font can tell the */
/* user that, for example, Weight=1.5 is `Bold'. */
/* */
/* axis :: A table of axis descriptors. */
/* GX fonts contain slightly more data than MM. */
/* */
/* namedstyles :: A table of named styles. */
/* Only meaningful with GX. */
/* */
typedef struct FT_MM_Var_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_UInt num_namedstyles;
FT_Var_Axis* axis;
FT_Var_Named_Style* namedstyle;
} FT_MM_Var;
/* */
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieves the Multiple Master descriptor of a given font. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_MM_Var */
/* */
/* <Description> */
/* Retrieves the Multiple Master/GX var descriptor of a given font. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters descriptor. */
/* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Get_MM_Var( FT_Face face,
FT_MM_Var* *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* */
/* This function can't be used with GX fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: An array of design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
/* */
/* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Var_Blend_Coordinates */
/* */
/* <Description> */
/* This is another name of @FT_Set_MM_Blend_Coordinates. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/* */
FT_END_HEADER
#endif /* __FTMM_H__ */
/* END */

View File

@@ -0,0 +1,406 @@
/***************************************************************************/
/* */
/* ftmodapi.h */
/* */
/* FreeType modules public interface (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTMODAPI_H__
#define __FTMODAPI_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/* <Title> */
/* Module Management */
/* */
/* <Abstract> */
/* How to add, upgrade, and remove modules from FreeType. */
/* */
/* <Description> */
/* The definitions below are used to manage modules within FreeType. */
/* Modules can be added, upgraded, and removed at runtime. */
/* */
/*************************************************************************/
/* module bit flags */
#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
#define FT_MODULE_RENDERER 2 /* this module is a renderer */
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */
/* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
typedef FT_Pointer FT_Module_Interface;
typedef FT_Error
(*FT_Module_Constructor)( FT_Module module );
typedef void
(*FT_Module_Destructor)( FT_Module module );
typedef FT_Module_Interface
(*FT_Module_Requester)( FT_Module module,
const char* name );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Module_Class */
/* */
/* <Description> */
/* The module class descriptor. */
/* */
/* <Fields> */
/* module_flags :: Bit flags describing the module. */
/* */
/* module_size :: The size of one module object/instance in */
/* bytes. */
/* */
/* module_name :: The name of the module. */
/* */
/* module_version :: The version, as a 16.16 fixed number */
/* (major.minor). */
/* */
/* module_requires :: The version of FreeType this module requires, */
/* as a 16.16 fixed number (major.minor). Starts */
/* at version 2.0, i.e., 0x20000. */
/* */
/* module_init :: A function used to initialize (not create) a */
/* new module object. */
/* */
/* module_done :: A function used to finalize (not destroy) a */
/* given module object */
/* */
/* get_interface :: Queries a given module for a specific */
/* interface by name. */
/* */
typedef struct FT_Module_Class_
{
FT_ULong module_flags;
FT_Long module_size;
const FT_String* module_name;
FT_Fixed module_version;
FT_Fixed module_requires;
const void* module_interface;
FT_Module_Constructor module_init;
FT_Module_Destructor module_done;
FT_Module_Requester get_interface;
} FT_Module_Class;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Add_Module */
/* */
/* <Description> */
/* Adds a new module to a given library instance. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* clazz :: A pointer to class descriptor for the module. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
FT_EXPORT( FT_Error )
FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Module */
/* */
/* <Description> */
/* Finds a module by its name. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* module_name :: The module's name (as an ASCII string). */
/* */
/* <Return> */
/* A module handle. 0 if none was found. */
/* */
/* <Note> */
/* FreeType's internal modules aren't documented very well, and you */
/* should look up the source code for details. */
/* */
FT_EXPORT( FT_Module )
FT_Get_Module( FT_Library library,
const char* module_name );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Remove_Module */
/* */
/* <Description> */
/* Removes a given module from a library instance. */
/* */
/* <InOut> */
/* library :: A handle to a library object. */
/* */
/* <Input> */
/* module :: A handle to a module object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The module object is destroyed by the function in case of success. */
/* */
FT_EXPORT( FT_Error )
FT_Remove_Module( FT_Library library,
FT_Module module );
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Library */
/* */
/* <Description> */
/* This function is used to create a new FreeType library instance */
/* from a given memory object. It is thus possible to use libraries */
/* with distinct memory allocators within the same program. */
/* */
/* <Input> */
/* memory :: A handle to the original memory object. */
/* */
/* <Output> */
/* alibrary :: A pointer to handle of a new library object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_New_Library( FT_Memory memory,
FT_Library *alibrary );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Library */
/* */
/* <Description> */
/* Discards a given library object. This closes all drivers and */
/* discards all resource objects. */
/* */
/* <Input> */
/* library :: A handle to the target library. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Library( FT_Library library );
/* */
typedef void
(*FT_DebugHook_Func)( void* arg );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Debug_Hook */
/* */
/* <Description> */
/* Sets a debug hook function for debugging the interpreter of a font */
/* format. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* hook_index :: The index of the debug hook. You should use the */
/* values defined in `ftobjs.h', e.g., */
/* `FT_DEBUG_HOOK_TRUETYPE'. */
/* */
/* debug_hook :: The function used to debug the interpreter. */
/* */
/* <Note> */
/* Currently, four debug hook slots are available, but only two (for */
/* the TrueType and the Type 1 interpreter) are defined. */
/* */
/* Since the internal headers of FreeType are no longer installed, */
/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
/* This is a bug and will be fixed in a forthcoming release. */
/* */
FT_EXPORT( void )
FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index,
FT_DebugHook_Func debug_hook );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Add_Default_Modules */
/* */
/* <Description> */
/* Adds the set of default drivers to a given library object. */
/* This is only useful when you create a library object with */
/* @FT_New_Library (usually to plug a custom memory manager). */
/* */
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
FT_EXPORT( void )
FT_Add_Default_Modules( FT_Library library );
/**************************************************************************
*
* @section:
* truetype_engine
*
* @title:
* The TrueType Engine
*
* @abstract:
* TrueType bytecode support.
*
* @description:
* This section contains a function used to query the level of TrueType
* bytecode support compiled in this version of the library.
*
*/
/**************************************************************************
*
* @enum:
* FT_TrueTypeEngineType
*
* @description:
* A list of values describing which kind of TrueType bytecode
* engine is implemented in a given FT_Library instance. It is used
* by the @FT_Get_TrueType_Engine_Type function.
*
* @values:
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
* The library doesn't implement any kind of bytecode interpreter.
*
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
* The library implements a bytecode interpreter that doesn't
* support the patented operations of the TrueType virtual machine.
*
* Its main use is to load certain Asian fonts which position and
* scale glyph components with bytecode instructions. It produces
* bad output for most other fonts.
*
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers
* the full instruction set of the TrueType virtual machine.
* See the file `docs/PATENTS' for legal aspects.
*
* @since:
* 2.2
*
*/
typedef enum
{
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
FT_TRUETYPE_ENGINE_TYPE_PATENTED
} FT_TrueTypeEngineType;
/**************************************************************************
*
* @func:
* FT_Get_TrueType_Engine_Type
*
* @description:
* Return a @FT_TrueTypeEngineType value to indicate which level of
* the TrueType virtual machine a given library instance supports.
*
* @input:
* library ::
* A library instance.
*
* @return:
* A value indicating which level is supported.
*
* @since:
* 2.2
*
*/
FT_EXPORT( FT_TrueTypeEngineType )
FT_Get_TrueType_Engine_Type( FT_Library library );
/* */
FT_END_HEADER
#endif /* __FTMODAPI_H__ */
/* END */

View File

@@ -0,0 +1,155 @@
/***************************************************************************/
/* */
/* ftmoderr.h */
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to define the FreeType module error offsets. */
/* */
/* The lower byte gives the error code, the higher byte gives the */
/* module. The base module has error offset 0. For example, the error */
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */
/* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
/* */
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
/* to make the higher byte always zero (disabling the module error */
/* mechanism). */
/* */
/* It can also be used to create a module error message table easily */
/* with something like */
/* */
/* { */
/* #undef __FTMODERR_H__ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int mod_err_offset; */
/* const char* mod_err_msg */
/* } ft_mod_errors[] = */
/* */
/* #include FT_MODULE_ERRORS_H */
/* } */
/* */
/* To use such a table, all errors must be ANDed with 0xFF00 to remove */
/* the error code. */
/* */
/*************************************************************************/
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** SETUP MACROS *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
#undef FT_NEED_EXTERN_C
#ifndef FT_MODERRDEF
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
#else
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
#endif
#define FT_MODERR_START_LIST enum {
#define FT_MODERR_END_LIST FT_Mod_Err_Max };
#ifdef __cplusplus
#define FT_NEED_EXTERN_C
extern "C" {
#endif
#endif /* !FT_MODERRDEF */
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** LIST MODULE ERROR BASES *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
#ifdef FT_MODERR_START_LIST
FT_MODERR_START_LIST
#endif
FT_MODERRDEF( Base, 0x000, "base module" )
FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" )
FT_MODERRDEF( Cache, 0x300, "cache module" )
FT_MODERRDEF( CFF, 0x400, "CFF module" )
FT_MODERRDEF( CID, 0x500, "CID module" )
FT_MODERRDEF( Gzip, 0x600, "Gzip module" )
FT_MODERRDEF( LZW, 0x700, "LZW module" )
FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" )
FT_MODERRDEF( PCF, 0x900, "PCF module" )
FT_MODERRDEF( PFR, 0xA00, "PFR module" )
FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" )
FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" )
FT_MODERRDEF( PSnames, 0xD00, "PS names module" )
FT_MODERRDEF( Raster, 0xE00, "raster module" )
FT_MODERRDEF( SFNT, 0xF00, "SFNT module" )
FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" )
FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
FT_MODERRDEF( Type1, 0x1200, "Type 1 module" )
FT_MODERRDEF( Type42, 0x1300, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
#ifdef FT_MODERR_END_LIST
FT_MODERR_END_LIST
#endif
/*******************************************************************/
/*******************************************************************/
/***** *****/
/***** CLEANUP *****/
/***** *****/
/*******************************************************************/
/*******************************************************************/
#ifdef FT_NEED_EXTERN_C
}
#endif
#undef FT_MODERR_START_LIST
#undef FT_MODERR_END_LIST
#undef FT_MODERRDEF
#undef FT_NEED_EXTERN_C
#endif /* __FTMODERR_H__ */
/* END */

View File

@@ -1,204 +1,198 @@
/***************************************************************************/
/* */
/* ftotval.h */
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* */
/* Warning: This module might be moved to a different library in the */
/* future to avoid a tight dependency between FreeType and the */
/* OpenType specification. */
/* */
/* */
/***************************************************************************/
#ifndef FTOTVAL_H_
#define FTOTVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* ot_validation */
/* */
/* <Title> */
/* OpenType Validation */
/* */
/* <Abstract> */
/* An API to validate OpenType tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
/* */
/* <Order> */
/* FT_OpenType_Validate */
/* FT_OpenType_Free */
/* */
/* FT_VALIDATE_OTXXX */
/* */
/*************************************************************************/
/**********************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_MATH ::
* Validate MATH table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
*
*/
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
#define FT_VALIDATE_GSUB 0x0800
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**********************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library that
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field that specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *BASE_table,
FT_Bytes *GDEF_table,
FT_Bytes *GPOS_table,
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
/**********************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
FT_EXPORT( void )
FT_OpenType_Free( FT_Face face,
FT_Bytes table );
/* */
FT_END_HEADER
#endif /* FTOTVAL_H_ */
/* END */
/***************************************************************************/
/* */
/* ftotval.h */
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/***************************************************************************/
/* */
/* */
/* Warning: This module might be moved to a different library in the */
/* future to avoid a tight dependency between FreeType and the */
/* OpenType specification. */
/* */
/* */
/***************************************************************************/
#ifndef __FTOTVAL_H__
#define __FTOTVAL_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* ot_validation */
/* */
/* <Title> */
/* OpenType Validation */
/* */
/* <Abstract> */
/* An API to validate OpenType tables. */
/* */
/* <Description> */
/* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF). */
/* */
/*************************************************************************/
/**********************************************************************
*
* @enum:
* FT_VALIDATE_OTXXX
*
* @description:
* A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated.
*
* @values:
* FT_VALIDATE_BASE ::
* Validate BASE table.
*
* FT_VALIDATE_GDEF ::
* Validate GDEF table.
*
* FT_VALIDATE_GPOS ::
* Validate GPOS table.
*
* FT_VALIDATE_GSUB ::
* Validate GSUB table.
*
* FT_VALIDATE_JSTF ::
* Validate JSTF table.
*
* FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).
*
*/
#define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400
#define FT_VALIDATE_GSUB 0x0800
#define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF
/* */
/**********************************************************************
*
* @function:
* FT_OpenType_Validate
*
* @description:
* Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without
* error checking (which can be quite time consuming).
*
* @input:
* face ::
* A handle to the input face.
*
* validation_flags ::
* A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values.
*
* @output:
* BASE_table ::
* A pointer to the BASE table.
*
* GDEF_table ::
* A pointer to the GDEF table.
*
* GPOS_table ::
* A pointer to the GPOS table.
*
* GSUB_table ::
* A pointer to the GSUB table.
*
* JSTF_table ::
* A pointer to the JSTF table.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with OpenType fonts, returning an error
* otherwise.
*
* After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for
* validation.
*/
FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags,
FT_Bytes *BASE_table,
FT_Bytes *GDEF_table,
FT_Bytes *GPOS_table,
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
/* */
/**********************************************************************
*
* @function:
* FT_OpenType_Free
*
* @description:
* Free the buffer allocated by OpenType validator.
*
* @input:
* face ::
* A handle to the input face.
*
* table ::
* The pointer to the buffer that is allocated by
* @FT_OpenType_Validate.
*
* @note:
* This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only.
*/
FT_EXPORT( void )
FT_OpenType_Free( FT_Face face,
FT_Bytes table );
/* */
FT_END_HEADER
#endif /* __FTOTVAL_H__ */
/* END */

View File

@@ -1,172 +1,172 @@
/***************************************************************************/
/* */
/* ftpfr.h */
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTPFR_H_
#define FTPFR_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* pfr_fonts */
/* */
/* <Title> */
/* PFR Fonts */
/* */
/* <Abstract> */
/* PFR/TrueDoc specific API. */
/* */
/* <Description> */
/* This section contains the declaration of PFR-specific functions. */
/* */
/*************************************************************************/
/**********************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face :: Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL).
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution,
FT_UInt *ametrics_resolution,
FT_Fixed *ametrics_x_scale,
FT_Fixed *ametrics_y_scale );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face :: A handle to the input face.
*
* left :: Index of the left glyph.
*
* right :: Index of the right glyph.
*
* @output:
* avector :: A kerning vector.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function always return distances in original PFR metrics
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left,
FT_UInt right,
FT_Vector *avector );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face :: A handle to the input face.
*
* gindex :: The glyph index.
*
* @output:
* aadvance :: The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex,
FT_Pos *aadvance );
/* */
FT_END_HEADER
#endif /* FTPFR_H_ */
/* END */
/***************************************************************************/
/* */
/* ftpfr.h */
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTPFR_H__
#define __FTPFR_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* pfr_fonts */
/* */
/* <Title> */
/* PFR Fonts */
/* */
/* <Abstract> */
/* PFR/TrueDoc specific API. */
/* */
/* <Description> */
/* This section contains the declaration of PFR-specific functions. */
/* */
/*************************************************************************/
/**********************************************************************
*
* @function:
* FT_Get_PFR_Metrics
*
* @description:
* Return the outline and metrics resolutions of a given PFR face.
*
* @input:
* face :: Handle to the input face. It can be a non-PFR face.
*
* @output:
* aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM'.
* Optional (parameter can be NULL).
*
* ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution'
* for non-PFR fonts. Optional (parameter can be NULL).
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL)
*
* ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL)
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution,
FT_UInt *ametrics_resolution,
FT_Fixed *ametrics_x_scale,
FT_Fixed *ametrics_y_scale );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Kerning
*
* @description:
* Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning.
*
* @input:
* face :: A handle to the input face.
*
* left :: Index of the left glyph.
*
* right :: Index of the right glyph.
*
* @output:
* avector :: A kerning vector.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function always return distances in original PFR metrics
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left,
FT_UInt right,
FT_Vector *avector );
/**********************************************************************
*
* @function:
* FT_Get_PFR_Advance
*
* @description:
* Return a given glyph advance, expressed in original metrics units,
* from a PFR font.
*
* @input:
* face :: A handle to the input face.
*
* gindex :: The glyph index.
*
* @output:
* aadvance :: The glyph advance in metrics units.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex,
FT_Pos *aadvance );
/* */
FT_END_HEADER
#endif /* __FTPFR_H__ */
/* END */

View File

@@ -1,232 +1,229 @@
/***************************************************************************/
/* */
/* ftrender.h */
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTRENDER_H_
#define FTRENDER_H_
#include <ft2build.h>
#include FT_MODULE_H
#include FT_GLYPH_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/*************************************************************************/
/* create a new glyph object */
typedef FT_Error
(*FT_Glyph_InitFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
/* destroys a given glyph object */
typedef void
(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
typedef void
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
const FT_Matrix* matrix,
const FT_Vector* delta );
typedef void
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
FT_BBox* abbox );
typedef FT_Error
(*FT_Glyph_CopyFunc)( FT_Glyph source,
FT_Glyph target );
typedef FT_Error
(*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
/* deprecated */
#define FT_Glyph_Init_Func FT_Glyph_InitFunc
#define FT_Glyph_Done_Func FT_Glyph_DoneFunc
#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
struct FT_Glyph_Class_
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
FT_Glyph_TransformFunc glyph_transform;
FT_Glyph_GetBBoxFunc glyph_bbox;
FT_Glyph_PrepareFunc glyph_prepare;
};
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_UInt mode,
const FT_Vector* origin );
typedef FT_Error
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
const FT_Matrix* matrix,
const FT_Vector* delta );
typedef void
(*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_BBox* cbox );
typedef FT_Error
(*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
FT_ULong mode_tag,
FT_Pointer mode_ptr );
/* deprecated identifiers */
#define FTRenderer_render FT_Renderer_RenderFunc
#define FTRenderer_transform FT_Renderer_TransformFunc
#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
#define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Renderer_Class */
/* */
/* <Description> */
/* The renderer module class descriptor. */
/* */
/* <Fields> */
/* root :: The root @FT_Module_Class fields. */
/* */
/* glyph_format :: The glyph image format this renderer handles. */
/* */
/* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */
/* */
/* transform_glyph :: A method used to transform the image that is in */
/* a given glyph slot. */
/* */
/* get_glyph_cbox :: A method used to access the glyph's cbox. */
/* */
/* set_mode :: A method used to pass additional parameters. */
/* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */
/* */
typedef struct FT_Renderer_Class_
{
FT_Module_Class root;
FT_Glyph_Format glyph_format;
FT_Renderer_RenderFunc render_glyph;
FT_Renderer_TransformFunc transform_glyph;
FT_Renderer_GetCBoxFunc get_glyph_cbox;
FT_Renderer_SetModeFunc set_mode;
FT_Raster_Funcs* raster_class;
} FT_Renderer_Class;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Renderer */
/* */
/* <Description> */
/* Retrieve the current renderer for a given glyph format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* format :: The glyph format. */
/* */
/* <Return> */
/* A renderer handle. 0~if none found. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */
/* */
FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Renderer */
/* */
/* <Description> */
/* Set the current renderer to use, and set additional mode. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* renderer :: A handle to the renderer object. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* parameters :: Additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */
/* */
/* This doesn't change the current renderer for other formats. */
/* */
/* Currently, no FreeType renderer module uses `parameters'; you */
/* should thus always pass NULL as the value. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
FT_UInt num_params,
FT_Parameter* parameters );
/* */
FT_END_HEADER
#endif /* FTRENDER_H_ */
/* END */
/***************************************************************************/
/* */
/* ftrender.h */
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2001, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTRENDER_H__
#define __FTRENDER_H__
#include <ft2build.h>
#include FT_MODULE_H
#include FT_GLYPH_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* module_management */
/* */
/*************************************************************************/
/* create a new glyph object */
typedef FT_Error
(*FT_Glyph_InitFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
/* destroys a given glyph object */
typedef void
(*FT_Glyph_DoneFunc)( FT_Glyph glyph );
typedef void
(*FT_Glyph_TransformFunc)( FT_Glyph glyph,
const FT_Matrix* matrix,
const FT_Vector* delta );
typedef void
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
FT_BBox* abbox );
typedef FT_Error
(*FT_Glyph_CopyFunc)( FT_Glyph source,
FT_Glyph target );
typedef FT_Error
(*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
FT_GlyphSlot slot );
/* deprecated */
#define FT_Glyph_Init_Func FT_Glyph_InitFunc
#define FT_Glyph_Done_Func FT_Glyph_DoneFunc
#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
struct FT_Glyph_Class_
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
FT_Glyph_TransformFunc glyph_transform;
FT_Glyph_GetBBoxFunc glyph_bbox;
FT_Glyph_PrepareFunc glyph_prepare;
};
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_UInt mode,
const FT_Vector* origin );
typedef FT_Error
(*FT_Renderer_TransformFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
const FT_Matrix* matrix,
const FT_Vector* delta );
typedef void
(*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_BBox* cbox );
typedef FT_Error
(*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
FT_ULong mode_tag,
FT_Pointer mode_ptr );
/* deprecated identifiers */
#define FTRenderer_render FT_Renderer_RenderFunc
#define FTRenderer_transform FT_Renderer_TransformFunc
#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
#define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Renderer_Class */
/* */
/* <Description> */
/* The renderer module class descriptor. */
/* */
/* <Fields> */
/* root :: The root @FT_Module_Class fields. */
/* */
/* glyph_format :: The glyph image format this renderer handles. */
/* */
/* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */
/* */
/* set_mode :: A method used to pass additional parameters. */
/* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
/* is a pointer to its raster's class. */
/* */
/* raster :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. This */
/* is a pointer to the corresponding raster object, */
/* if any. */
/* */
typedef struct FT_Renderer_Class_
{
FT_Module_Class root;
FT_Glyph_Format glyph_format;
FT_Renderer_RenderFunc render_glyph;
FT_Renderer_TransformFunc transform_glyph;
FT_Renderer_GetCBoxFunc get_glyph_cbox;
FT_Renderer_SetModeFunc set_mode;
FT_Raster_Funcs* raster_class;
} FT_Renderer_Class;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Renderer */
/* */
/* <Description> */
/* Retrieves the current renderer for a given glyph format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* format :: The glyph format. */
/* */
/* <Return> */
/* A renderer handle. 0 if none found. */
/* */
/* <Note> */
/* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */
/* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */
/* */
FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Renderer */
/* */
/* <Description> */
/* Sets the current renderer to use, and set additional mode. */
/* */
/* <InOut> */
/* library :: A handle to the library object. */
/* */
/* <Input> */
/* renderer :: A handle to the renderer object. */
/* */
/* num_params :: The number of additional parameters. */
/* */
/* parameters :: Additional parameters. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */
/* */
/* This doesn't change the current renderer for other formats. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
FT_UInt num_params,
FT_Parameter* parameters );
/* */
FT_END_HEADER
#endif /* __FTRENDER_H__ */
/* END */

View File

@@ -1,159 +1,159 @@
/***************************************************************************/
/* */
/* ftsizes.h */
/* */
/* FreeType size objects management (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* Typical application would normally not need to use these functions. */
/* However, they have been placed in a public API for the rare cases */
/* where they are needed. */
/* */
/*************************************************************************/
#ifndef FTSIZES_H_
#define FTSIZES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sizes_management */
/* */
/* <Title> */
/* Size Management */
/* */
/* <Abstract> */
/* Managing multiple sizes per face. */
/* */
/* <Description> */
/* When creating a new face object (e.g., with @FT_New_Face), an */
/* @FT_Size object is automatically created and used to store all */
/* pixel-size dependent information, available in the `face->size' */
/* field. */
/* */
/* It is however possible to create more sizes for a given face, */
/* mostly in order to manage several character pixel sizes of the */
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
/* */
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
/* modify the contents of the current `active' size; you thus need */
/* to use @FT_Activate_Size to change it. */
/* */
/* 99% of applications won't need the functions provided here, */
/* especially if they use the caching sub-system, so be cautious */
/* when using these. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Size */
/* */
/* <Description> */
/* Create a new size object from a given face object. */
/* */
/* <Input> */
/* face :: A handle to a parent face object. */
/* */
/* <Output> */
/* asize :: A handle to a new size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* You need to call @FT_Activate_Size in order to select the new size */
/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
/* @FT_Load_Glyph, @FT_Load_Char, etc. */
/* */
FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face,
FT_Size* size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Size */
/* */
/* <Description> */
/* Discard a given size object. Note that @FT_Done_Face */
/* automatically discards all size objects allocated with */
/* @FT_New_Size. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Activate_Size */
/* */
/* <Description> */
/* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */
/* activated last to determine the `current character pixel size'. */
/* */
/* This function can be used to `activate' a previously created size */
/* object. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If `face' is the size's parent face object, this function changes */
/* the value of `face->size' to the input size handle. */
/* */
FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size );
/* */
FT_END_HEADER
#endif /* FTSIZES_H_ */
/* END */
/***************************************************************************/
/* */
/* ftsizes.h */
/* */
/* FreeType size objects management (specification). */
/* */
/* Copyright 1996-2001, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* Typical application would normally not need to use these functions. */
/* However, they have been placed in a public API for the rare cases */
/* where they are needed. */
/* */
/*************************************************************************/
#ifndef __FTSIZES_H__
#define __FTSIZES_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sizes_management */
/* */
/* <Title> */
/* Size Management */
/* */
/* <Abstract> */
/* Managing multiple sizes per face. */
/* */
/* <Description> */
/* When creating a new face object (e.g., with @FT_New_Face), an */
/* @FT_Size object is automatically created and used to store all */
/* pixel-size dependent information, available in the `face->size' */
/* field. */
/* */
/* It is however possible to create more sizes for a given face, */
/* mostly in order to manage several character pixel sizes of the */
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */
/* */
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
/* modify the contents of the current `active' size; you thus need */
/* to use @FT_Activate_Size to change it. */
/* */
/* 99% of applications won't need the functions provided here, */
/* especially if they use the caching sub-system, so be cautious */
/* when using these. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_New_Size */
/* */
/* <Description> */
/* Create a new size object from a given face object. */
/* */
/* <Input> */
/* face :: A handle to a parent face object. */
/* */
/* <Output> */
/* asize :: A handle to a new size object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* You need to call @FT_Activate_Size in order to select the new size */
/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
/* @FT_Load_Glyph, @FT_Load_Char, etc. */
/* */
FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face,
FT_Size* size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Size */
/* */
/* <Description> */
/* Discard a given size object. Note that @FT_Done_Face */
/* automatically discards all size objects allocated with */
/* @FT_New_Size. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Activate_Size */
/* */
/* <Description> */
/* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */
/* determine the `current character pixel size'. */
/* */
/* This function can be used to `activate' a previously created size */
/* object. */
/* */
/* <Input> */
/* size :: A handle to a target size object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* If `face' is the size's parent face object, this function changes */
/* the value of `face->size' to the input size handle. */
/* */
FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size );
/* */
FT_END_HEADER
#endif /* __FTSIZES_H__ */
/* END */

View File

@@ -1,200 +1,170 @@
/***************************************************************************/
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT name tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTSNAMES_H_
#define FTSNAMES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sfnt_names */
/* */
/* <Title> */
/* SFNT Names */
/* */
/* <Abstract> */
/* Access the names embedded in TrueType and OpenType files. */
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
/* a special `names table' in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
/* The definitions below are used to access them if available. */
/* */
/* Note that this has nothing to do with glyph names! */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntName */
/* */
/* <Description> */
/* A structure used to model an SFNT `name' table entry. */
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* */
/* language_id :: The language ID for `string'. */
/* */
/* name_id :: An identifier for `string'. */
/* */
/* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair. It can */
/* be a Pascal String, a UTF-16 one, etc. */
/* */
/* Generally speaking, the string is not */
/* zero-terminated. Please refer to the TrueType */
/* specification for details. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
/* Possible values for `platform_id', `encoding_id', `language_id', */
/* and `name_id' are given in the file `ttnameid.h'. For details */
/* please refer to the TrueType or OpenType specification. */
/* */
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
/* */
typedef struct FT_SfntName_
{
FT_UShort platform_id;
FT_UShort encoding_id;
FT_UShort language_id;
FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
} FT_SfntName;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name_Count */
/* */
/* <Description> */
/* Retrieve the number of name strings in the SFNT `name' table. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Return> */
/* The number of strings in the `name' table. */
/* */
FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name */
/* */
/* <Description> */
/* Retrieve a string of the SFNT `name' table for a given index. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* idx :: The index of the `name' string. */
/* */
/* <Output> */
/* aname :: The indexed @FT_SfntName structure. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
/* null-terminated. The application should deallocate it if it is no */
/* longer in use. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with
* legacy systems that have a 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
*
* @description:
* A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred subfamily names in `name' table since
* OpenType version 1.4. For backwards compatibility with legacy
* systems that have a 4-face-per-family restriction.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* */
FT_END_HEADER
#endif /* FTSNAMES_H_ */
/* END */
/***************************************************************************/
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT name tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2001, 2002, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FT_SFNT_NAMES_H__
#define __FT_SFNT_NAMES_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* sfnt_names */
/* */
/* <Title> */
/* SFNT Names */
/* */
/* <Abstract> */
/* Access the names embedded in TrueType and OpenType files. */
/* */
/* <Description> */
/* The TrueType and OpenType specification allow the inclusion of */
/* a special `names table' in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
/* The definitions below are used to access them if available. */
/* */
/* Note that this has nothing to do with glyph names! */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntName */
/* */
/* <Description> */
/* A structure used to model an SFNT `name' table entry. */
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* */
/* language_id :: The language ID for `string'. */
/* */
/* name_id :: An identifier for `string'. */
/* */
/* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair. It can */
/* be a Pascal String, a UTF-16 one, etc. */
/* */
/* Generally speaking, the string is not */
/* zero-terminated. Please refer to the TrueType */
/* specification for details. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <Note> */
/* Possible values for `platform_id', `encoding_id', `language_id', */
/* and `name_id' are given in the file `ttnameid.h'. For details */
/* please refer to the TrueType or OpenType specification. */
/* */
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
/* */
typedef struct FT_SfntName_
{
FT_UShort platform_id;
FT_UShort encoding_id;
FT_UShort language_id;
FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
} FT_SfntName;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name_Count */
/* */
/* <Description> */
/* Retrieves the number of name strings in the SFNT `name' table. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Return> */
/* The number of strings in the `name' table. */
/* */
FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_Name */
/* */
/* <Description> */
/* Retrieves a string of the SFNT `name' table for a given index. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* idx :: The index of the `name' string. */
/* */
/* <Output> */
/* aname :: The indexed @FT_SfntName structure. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The `string' array returned in the `aname' structure is not */
/* null-terminated. */
/* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
/* */
FT_END_HEADER
#endif /* __FT_SFNT_NAMES_H__ */
/* END */

View File

@@ -0,0 +1,73 @@
/***************************************************************************/
/* */
/* ftsynth.h */
/* */
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2001, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/********* *********/
/********* WARNING, THIS IS ALPHA CODE, THIS API *********/
/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
/********* FREETYPE DEVELOPMENT TEAM *********/
/********* *********/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/* Make sure slot owns slot->bitmap. */
FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/* Do not use this function directly! Copy the code to */
/* your application and modify it to suit your need. */
FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
/* */
FT_END_HEADER
#endif /* __FTSYNTH_H__ */
/* END */

View File

@@ -1,355 +1,346 @@
/***************************************************************************/
/* */
/* ftsystem.h */
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTSYSTEM_H_
#define FTSYSTEM_H_
#include <ft2build.h>
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* system_interface */
/* */
/* <Title> */
/* System Interface */
/* */
/* <Abstract> */
/* How FreeType manages memory and i/o. */
/* */
/* <Description> */
/* This section contains various definitions related to memory */
/* management and i/o access. You need to understand this */
/* information if you want to use a custom memory manager or you own */
/* i/o streams. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Memory
*
* @description:
* A handle to a given memory manager object, defined with an
* @FT_MemoryRec structure.
*
*/
typedef struct FT_MemoryRec_* FT_Memory;
/*************************************************************************
*
* @functype:
* FT_Alloc_Func
*
* @description:
* A function used to allocate `size' bytes from `memory'.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* size ::
* The size in bytes to allocate.
*
* @return:
* Address of new memory block. 0~in case of failure.
*
*/
typedef void*
(*FT_Alloc_Func)( FT_Memory memory,
long size );
/*************************************************************************
*
* @functype:
* FT_Free_Func
*
* @description:
* A function used to release a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* block ::
* The address of the target memory block.
*
*/
typedef void
(*FT_Free_Func)( FT_Memory memory,
void* block );
/*************************************************************************
*
* @functype:
* FT_Realloc_Func
*
* @description:
* A function used to re-allocate a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* cur_size ::
* The block's current size in bytes.
*
* new_size ::
* The block's requested new size.
*
* block ::
* The block's current address.
*
* @return:
* New block address. 0~in case of memory shortage.
*
* @note:
* In case of error, the old block must still be available.
*
*/
typedef void*
(*FT_Realloc_Func)( FT_Memory memory,
long cur_size,
long new_size,
void* block );
/*************************************************************************
*
* @struct:
* FT_MemoryRec
*
* @description:
* A structure used to describe a given memory manager to FreeType~2.
*
* @fields:
* user ::
* A generic typeless pointer for user data.
*
* alloc ::
* A pointer type to an allocation function.
*
* free ::
* A pointer type to an memory freeing function.
*
* realloc ::
* A pointer type to a reallocation function.
*
*/
struct FT_MemoryRec_
{
void* user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
};
/*************************************************************************/
/* */
/* I / O M A N A G E M E N T */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Stream
*
* @description:
* A handle to an input stream.
*
* @also:
* See @FT_StreamRec for the publicly accessible fields of a given
* stream object.
*
*/
typedef struct FT_StreamRec_* FT_Stream;
/*************************************************************************
*
* @struct:
* FT_StreamDesc
*
* @description:
* A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream.
*
*/
typedef union FT_StreamDesc_
{
long value;
void* pointer;
} FT_StreamDesc;
/*************************************************************************
*
* @functype:
* FT_Stream_IoFunc
*
* @description:
* A function used to seek and read data from a given input stream.
*
* @input:
* stream ::
* A handle to the source stream.
*
* offset ::
* The offset of read in stream (always from start).
*
* buffer ::
* The address of the read buffer.
*
* count ::
* The number of bytes to read from the stream.
*
* @return:
* The number of bytes effectively read by the stream.
*
* @note:
* This function might be called to perform a seek or skip operation
* with a `count' of~0. A non-zero return value then indicates an
* error.
*
*/
typedef unsigned long
(*FT_Stream_IoFunc)( FT_Stream stream,
unsigned long offset,
unsigned char* buffer,
unsigned long count );
/*************************************************************************
*
* @functype:
* FT_Stream_CloseFunc
*
* @description:
* A function used to close a given input stream.
*
* @input:
* stream ::
* A handle to the target stream.
*
*/
typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream );
/*************************************************************************
*
* @struct:
* FT_StreamRec
*
* @description:
* A structure used to describe an input stream.
*
* @input:
* base ::
* For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for
* disk-based streams.
*
* size ::
* The stream size in bytes.
*
* In case of compressed streams where the size is unknown before
* actually doing the decompression, the value is set to 0x7FFFFFFF.
* (Note that this size value can occur for normal streams also; it is
* thus just a hint.)
*
* pos ::
* The current position within the stream.
*
* descriptor ::
* This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*'
* pointers.
*
* pathname ::
* This field is completely ignored by FreeType. However, it is often
* useful during debugging to use it to store the stream's filename
* (where available).
*
* read ::
* The stream's input function.
*
* close ::
* The stream's close function.
*
* memory ::
* The memory manager to use to preload frames. This is set
* internally by FreeType and shouldn't be touched by stream
* implementations.
*
* cursor ::
* This field is set and used internally by FreeType when parsing
* frames.
*
* limit ::
* This field is set and used internally by FreeType when parsing
* frames.
*
*/
typedef struct FT_StreamRec_
{
unsigned char* base;
unsigned long size;
unsigned long pos;
FT_StreamDesc descriptor;
FT_StreamDesc pathname;
FT_Stream_IoFunc read;
FT_Stream_CloseFunc close;
FT_Memory memory;
unsigned char* cursor;
unsigned char* limit;
} FT_StreamRec;
/* */
FT_END_HEADER
#endif /* FTSYSTEM_H_ */
/* END */
/***************************************************************************/
/* */
/* ftsystem.h */
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2001, 2002, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTSYSTEM_H__
#define __FTSYSTEM_H__
#include <ft2build.h>
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* system_interface */
/* */
/* <Title> */
/* System Interface */
/* */
/* <Abstract> */
/* How FreeType manages memory and i/o. */
/* */
/* <Description> */
/* This section contains various definitions related to memory */
/* management and i/o access. You need to understand this */
/* information if you want to use a custom memory manager or you own */
/* i/o streams. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Memory
*
* @description:
* A handle to a given memory manager object, defined with an
* @FT_MemoryRec structure.
*
*/
typedef struct FT_MemoryRec_* FT_Memory;
/*************************************************************************
*
* @functype:
* FT_Alloc_Func
*
* @description:
* A function used to allocate `size' bytes from `memory'.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* size ::
* The size in bytes to allocate.
*
* @return:
* Address of new memory block. 0 in case of failure.
*
*/
typedef void*
(*FT_Alloc_Func)( FT_Memory memory,
long size );
/*************************************************************************
*
* @functype:
* FT_Free_Func
*
* @description:
* A function used to release a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* block ::
* The address of the target memory block.
*
*/
typedef void
(*FT_Free_Func)( FT_Memory memory,
void* block );
/*************************************************************************
*
* @functype:
* FT_Realloc_Func
*
* @description:
* A function used to re-allocate a given block of memory.
*
* @input:
* memory ::
* A handle to the source memory manager.
*
* cur_size ::
* The block's current size in bytes.
*
* new_size ::
* The block's requested new size.
*
* block ::
* The block's current address.
*
* @return:
* New block address. 0 in case of memory shortage.
*
* @note:
* In case of error, the old block must still be available.
*
*/
typedef void*
(*FT_Realloc_Func)( FT_Memory memory,
long cur_size,
long new_size,
void* block );
/*************************************************************************
*
* @struct:
* FT_MemoryRec
*
* @description:
* A structure used to describe a given memory manager to FreeType 2.
*
* @fields:
* user ::
* A generic typeless pointer for user data.
*
* alloc ::
* A pointer type to an allocation function.
*
* free ::
* A pointer type to an memory freeing function.
*
* realloc ::
* A pointer type to a reallocation function.
*
*/
struct FT_MemoryRec_
{
void* user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
};
/*************************************************************************/
/* */
/* I / O M A N A G E M E N T */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Stream
*
* @description:
* A handle to an input stream.
*
*/
typedef struct FT_StreamRec_* FT_Stream;
/*************************************************************************
*
* @struct:
* FT_StreamDesc
*
* @description:
* A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream.
*
*/
typedef union FT_StreamDesc_
{
long value;
void* pointer;
} FT_StreamDesc;
/*************************************************************************
*
* @functype:
* FT_Stream_IoFunc
*
* @description:
* A function used to seek and read data from a given input stream.
*
* @input:
* stream ::
* A handle to the source stream.
*
* offset ::
* The offset of read in stream (always from start).
*
* buffer ::
* The address of the read buffer.
*
* count ::
* The number of bytes to read from the stream.
*
* @return:
* The number of bytes effectively read by the stream.
*
* @note:
* This function might be called to perform a seek or skip operation
* with a `count' of 0.
*
*/
typedef unsigned long
(*FT_Stream_IoFunc)( FT_Stream stream,
unsigned long offset,
unsigned char* buffer,
unsigned long count );
/*************************************************************************
*
* @functype:
* FT_Stream_CloseFunc
*
* @description:
* A function used to close a given input stream.
*
* @input:
* stream ::
* A handle to the target stream.
*
*/
typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream );
/*************************************************************************
*
* @struct:
* FT_StreamRec
*
* @description:
* A structure used to describe an input stream.
*
* @input:
* base ::
* For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for
* disk-based streams.
*
* size ::
* The stream size in bytes.
*
* pos ::
* The current position within the stream.
*
* descriptor ::
* This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*'
* pointers.
*
* pathname ::
* This field is completely ignored by FreeType. However, it is often
* useful during debugging to use it to store the stream's filename
* (where available).
*
* read ::
* The stream's input function.
*
* close ::
* The stream;s close function.
*
* memory ::
* The memory manager to use to preload frames. This is set
* internally by FreeType and shouldn't be touched by stream
* implementations.
*
* cursor ::
* This field is set and used internally by FreeType when parsing
* frames.
*
* limit ::
* This field is set and used internally by FreeType when parsing
* frames.
*
*/
typedef struct FT_StreamRec_
{
unsigned char* base;
unsigned long size;
unsigned long pos;
FT_StreamDesc descriptor;
FT_StreamDesc pathname;
FT_Stream_IoFunc read;
FT_Stream_CloseFunc close;
FT_Memory memory;
unsigned char* cursor;
unsigned char* limit;
} FT_StreamRec;
/* */
FT_END_HEADER
#endif /* __FTSYSTEM_H__ */
/* END */

View File

@@ -1,350 +1,350 @@
/***************************************************************************/
/* */
/* fttrigon.h */
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTTRIGON_H_
#define FTTRIGON_H_
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Angle
*
* @description:
* This type is used to model angle values in FreeType. Note that the
* angle is a 16.16 fixed-point value expressed in degrees.
*
*/
typedef FT_Fixed FT_Angle;
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI
*
* @description:
* The angle pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI ( 180L << 16 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_2PI
*
* @description:
* The angle 2*pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI2
*
* @description:
* The angle pi/2 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI4
*
* @description:
* The angle pi/4 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/*************************************************************************
*
* @function:
* FT_Sin
*
* @description:
* Return the sinus of a given angle in fixed-point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The sinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Sin( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Cos
*
* @description:
* Return the cosinus of a given angle in fixed-point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The cosinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Cos( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Tan
*
* @description:
* Return the tangent of a given angle in fixed-point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The tangent value.
*
*/
FT_EXPORT( FT_Fixed )
FT_Tan( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Atan2
*
* @description:
* Return the arc-tangent corresponding to a given vector (x,y) in
* the 2d plane.
*
* @input:
* x ::
* The horizontal vector coordinate.
*
* y ::
* The vertical vector coordinate.
*
* @return:
* The arc-tangent value (i.e. angle).
*
*/
FT_EXPORT( FT_Angle )
FT_Atan2( FT_Fixed x,
FT_Fixed y );
/*************************************************************************
*
* @function:
* FT_Angle_Diff
*
* @description:
* Return the difference between two angles. The result is always
* constrained to the ]-PI..PI] interval.
*
* @input:
* angle1 ::
* First angle.
*
* angle2 ::
* Second angle.
*
* @return:
* Constrained value of `value2-value1'.
*
*/
FT_EXPORT( FT_Angle )
FT_Angle_Diff( FT_Angle angle1,
FT_Angle angle2 );
/*************************************************************************
*
* @function:
* FT_Vector_Unit
*
* @description:
* Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `cos(angle)', and the value of
* `vec.y' will be `sin(angle)'.
*
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
*
* @output:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The input angle.
*
*/
FT_EXPORT( void )
FT_Vector_Unit( FT_Vector* vec,
FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Vector_Rotate
*
* @description:
* Rotate a vector by a given angle.
*
* @inout:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The input angle.
*
*/
FT_EXPORT( void )
FT_Vector_Rotate( FT_Vector* vec,
FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Vector_Length
*
* @description:
* Return the length of a given vector.
*
* @input:
* vec ::
* The address of target vector.
*
* @return:
* The vector length, expressed in the same units that the original
* vector coordinates.
*
*/
FT_EXPORT( FT_Fixed )
FT_Vector_Length( FT_Vector* vec );
/*************************************************************************
*
* @function:
* FT_Vector_Polarize
*
* @description:
* Compute both the length and angle of a given vector.
*
* @input:
* vec ::
* The address of source vector.
*
* @output:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_Polarize( FT_Vector* vec,
FT_Fixed *length,
FT_Angle *angle );
/*************************************************************************
*
* @function:
* FT_Vector_From_Polar
*
* @description:
* Compute vector coordinates from a length and angle.
*
* @output:
* vec ::
* The address of source vector.
*
* @input:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_From_Polar( FT_Vector* vec,
FT_Fixed length,
FT_Angle angle );
/* */
FT_END_HEADER
#endif /* FTTRIGON_H_ */
/* END */
/***************************************************************************/
/* */
/* fttrigon.h */
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001, 2003, 2005, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTTRIGON_H__
#define __FTTRIGON_H__
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* computations */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
* FT_Angle
*
* @description:
* This type is used to model angle values in FreeType. Note that the
* angle is a 16.16 fixed float value expressed in degrees.
*
*/
typedef FT_Fixed FT_Angle;
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI
*
* @description:
* The angle pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI ( 180L << 16 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_2PI
*
* @description:
* The angle 2*pi expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI2
*
* @description:
* The angle pi/2 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/*************************************************************************
*
* @macro:
* FT_ANGLE_PI4
*
* @description:
* The angle pi/4 expressed in @FT_Angle units.
*
*/
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/*************************************************************************
*
* @function:
* FT_Sin
*
* @description:
* Return the sinus of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The sinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Sin( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Cos
*
* @description:
* Return the cosinus of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The cosinus value.
*
* @note:
* If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit.
*
*/
FT_EXPORT( FT_Fixed )
FT_Cos( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Tan
*
* @description:
* Return the tangent of a given angle in fixed point format.
*
* @input:
* angle ::
* The input angle.
*
* @return:
* The tangent value.
*
*/
FT_EXPORT( FT_Fixed )
FT_Tan( FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Atan2
*
* @description:
* Return the arc-tangent corresponding to a given vector (x,y) in
* the 2d plane.
*
* @input:
* x ::
* The horizontal vector coordinate.
*
* y ::
* The vertical vector coordinate.
*
* @return:
* The arc-tangent value (i.e. angle).
*
*/
FT_EXPORT( FT_Angle )
FT_Atan2( FT_Fixed x,
FT_Fixed y );
/*************************************************************************
*
* @function:
* FT_Angle_Diff
*
* @description:
* Return the difference between two angles. The result is always
* constrained to the ]-PI..PI] interval.
*
* @input:
* angle1 ::
* First angle.
*
* angle2 ::
* Second angle.
*
* @return:
* Constrained value of `value2-value1'.
*
*/
FT_EXPORT( FT_Angle )
FT_Angle_Diff( FT_Angle angle1,
FT_Angle angle2 );
/*************************************************************************
*
* @function:
* FT_Vector_Unit
*
* @description:
* Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `sin(angle)', and the value of
* `vec.y' will be `cos(angle)'.
*
* This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly.
*
* @output:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The address of angle.
*
*/
FT_EXPORT( void )
FT_Vector_Unit( FT_Vector* vec,
FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Vector_Rotate
*
* @description:
* Rotate a vector by a given angle.
*
* @inout:
* vec ::
* The address of target vector.
*
* @input:
* angle ::
* The address of angle.
*
*/
FT_EXPORT( void )
FT_Vector_Rotate( FT_Vector* vec,
FT_Angle angle );
/*************************************************************************
*
* @function:
* FT_Vector_Length
*
* @description:
* Return the length of a given vector.
*
* @input:
* vec ::
* The address of target vector.
*
* @return:
* The vector length, expressed in the same units that the original
* vector coordinates.
*
*/
FT_EXPORT( FT_Fixed )
FT_Vector_Length( FT_Vector* vec );
/*************************************************************************
*
* @function:
* FT_Vector_Polarize
*
* @description:
* Compute both the length and angle of a given vector.
*
* @input:
* vec ::
* The address of source vector.
*
* @output:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_Polarize( FT_Vector* vec,
FT_Fixed *length,
FT_Angle *angle );
/*************************************************************************
*
* @function:
* FT_Vector_From_Polar
*
* @description:
* Compute vector coordinates from a length and angle.
*
* @output:
* vec ::
* The address of source vector.
*
* @input:
* length ::
* The vector length.
*
* angle ::
* The vector angle.
*
*/
FT_EXPORT( void )
FT_Vector_From_Polar( FT_Vector* vec,
FT_Fixed length,
FT_Angle angle );
/* */
FT_END_HEADER
#endif /* __FTTRIGON_H__ */
/* END */

View File

@@ -1,275 +1,263 @@
/***************************************************************************/
/* */
/* ftwinfnt.h */
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003-2016 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTWINFNT_H_
#define FTWINFNT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* winfnt_fonts */
/* */
/* <Title> */
/* Window FNT Files */
/* */
/* <Abstract> */
/* Windows FNT specific API. */
/* */
/* <Description> */
/* This section contains the declaration of Windows FNT specific */
/* functions. */
/* */
/*************************************************************************/
/*************************************************************************
*
* @enum:
* FT_WinFNT_ID_XXX
*
* @description:
* A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at
* ftp://ftp.unicode.org/Public in the MAPPINGS/VENDORS/MICSFT/WINDOWS
* subdirectory. cp1361 is roughly a superset of
* MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
*
* @values:
* FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a
* `don't care' value. Valid font files don't contain this value.
* When querying for information about the character set of the font
* that is currently selected into a specified device context, this
* return value (of the related Windows API) simply denotes failure.
*
* FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available.
*
* FT_WinFNT_ID_MAC ::
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
* `roman.fon', and `script.fon' on Windows.
*
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
* specifies a character set that is operating-system dependent.
*
* The `IFIMETRICS' documentation from the `Windows Driver
* Development Kit' says: This font supports an OEM-specific
* character set. The OEM character set is system dependent.
*
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
* second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from
*
* https://msdn.microsoft.com/en-us/goglobal/bb964655,
*
* and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage
* 1252 and OEM codepage 850.
*
* FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11.
*
* FT_WinFNT_ID_CP932 ::
* A superset of Japanese Shift-JIS (with minor deviations).
*
* FT_WinFNT_ID_CP936 ::
* A superset of simplified Chinese GB 2312-1980 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS~C 5601-1987 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP1250 ::
* A superset of East European ISO 8859-2 (with slightly different
* ordering).
*
* FT_WinFNT_ID_CP1251 ::
* A superset of Russian ISO 8859-5 (with different ordering).
*
* FT_WinFNT_ID_CP1252 ::
* ANSI encoding. A superset of ISO 8859-1.
*
* FT_WinFNT_ID_CP1253 ::
* A superset of Greek ISO 8859-7 (with minor modifications).
*
* FT_WinFNT_ID_CP1254 ::
* A superset of Turkish ISO 8859-9.
*
* FT_WinFNT_ID_CP1255 ::
* A superset of Hebrew ISO 8859-8 (with some modifications).
*
* FT_WinFNT_ID_CP1256 ::
* A superset of Arabic ISO 8859-6 (with different ordering).
*
* FT_WinFNT_ID_CP1257 ::
* A superset of Baltic ISO 8859-13 (with some deviations).
*
* FT_WinFNT_ID_CP1258 ::
* For Vietnamese. This encoding doesn't cover all necessary
* characters.
*
* FT_WinFNT_ID_CP1361 ::
* Korean (Johab).
*/
#define FT_WinFNT_ID_CP1252 0
#define FT_WinFNT_ID_DEFAULT 1
#define FT_WinFNT_ID_SYMBOL 2
#define FT_WinFNT_ID_MAC 77
#define FT_WinFNT_ID_CP932 128
#define FT_WinFNT_ID_CP949 129
#define FT_WinFNT_ID_CP1361 130
#define FT_WinFNT_ID_CP936 134
#define FT_WinFNT_ID_CP950 136
#define FT_WinFNT_ID_CP1253 161
#define FT_WinFNT_ID_CP1254 162
#define FT_WinFNT_ID_CP1258 163
#define FT_WinFNT_ID_CP1255 177
#define FT_WinFNT_ID_CP1256 178
#define FT_WinFNT_ID_CP1257 186
#define FT_WinFNT_ID_CP1251 204
#define FT_WinFNT_ID_CP874 222
#define FT_WinFNT_ID_CP1250 238
#define FT_WinFNT_ID_OEM 255
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_HeaderRec */
/* */
/* <Description> */
/* Windows FNT Header info. */
/* */
typedef struct FT_WinFNT_HeaderRec_
{
FT_UShort version;
FT_ULong file_size;
FT_Byte copyright[60];
FT_UShort file_type;
FT_UShort nominal_point_size;
FT_UShort vertical_resolution;
FT_UShort horizontal_resolution;
FT_UShort ascent;
FT_UShort internal_leading;
FT_UShort external_leading;
FT_Byte italic;
FT_Byte underline;
FT_Byte strike_out;
FT_UShort weight;
FT_Byte charset;
FT_UShort pixel_width;
FT_UShort pixel_height;
FT_Byte pitch_and_family;
FT_UShort avg_width;
FT_UShort max_width;
FT_Byte first_char;
FT_Byte last_char;
FT_Byte default_char;
FT_Byte break_char;
FT_UShort bytes_per_row;
FT_ULong device_offset;
FT_ULong face_name_offset;
FT_ULong bits_pointer;
FT_ULong bits_offset;
FT_Byte reserved;
FT_ULong flags;
FT_UShort A_space;
FT_UShort B_space;
FT_UShort C_space;
FT_UShort color_table_offset;
FT_ULong reserved1[4];
} FT_WinFNT_HeaderRec;
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_Header */
/* */
/* <Description> */
/* A handle to an @FT_WinFNT_HeaderRec structure. */
/* */
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
/**********************************************************************
*
* @function:
* FT_Get_WinFNT_Header
*
* @description:
* Retrieve a Windows FNT font info header.
*
* @input:
* face :: A handle to the input face.
*
* @output:
* aheader :: The WinFNT header.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* This function only works with Windows FNT faces, returning an error
* otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader );
/* */
FT_END_HEADER
#endif /* FTWINFNT_H_ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */
/***************************************************************************/
/* */
/* ftwinfnt.h */
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTWINFNT_H__
#define __FTWINFNT_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* winfnt_fonts */
/* */
/* <Title> */
/* Window FNT Files */
/* */
/* <Abstract> */
/* Windows FNT specific API. */
/* */
/* <Description> */
/* This section contains the declaration of Windows FNT specific */
/* functions. */
/* */
/*************************************************************************/
/*************************************************************************
*
* @enum:
* FT_WinFNT_ID_XXX
*
* @description:
* A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
*
* @values:
* FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a
* `don't care' value. Valid font files don't contain this value.
* When querying for information about the character set of the font
* that is currently selected into a specified device context, this
* return value (of the related Windows API) simply denotes failure.
*
* FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available.
*
* FT_WinFNT_ID_MAC ::
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
* `roman.fon', and `script.fon' on Windows.
*
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
* specifies a character set that is operating-system dependent.
*
* The `IFIMETRICS' documentation from the `Windows Driver
* Development Kit' says: This font supports an OEM-specific
* character set. The OEM character set is system dependent.
*
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
* second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from
*
* http://www.microsoft.com/globaldev/reference/cphome.mspx,
*
* and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage
* 1252 and OEM codepage 850.
*
* FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11.
*
* FT_WinFNT_ID_CP932 ::
* A superset of Japanese Shift-JIS (with minor deviations).
*
* FT_WinFNT_ID_CP936 ::
* A superset of simplified Chinese GB 2312-1980 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS C 5601-1987 (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big 5 ETen (with different
* ordering and minor deviations).
*
* FT_WinFNT_ID_CP1250 ::
* A superset of East European ISO 8859-2 (with slightly different
* ordering).
*
* FT_WinFNT_ID_CP1251 ::
* A superset of Russian ISO 8859-5 (with different ordering).
*
* FT_WinFNT_ID_CP1252 ::
* ANSI encoding. A superset of ISO 8859-1.
*
* FT_WinFNT_ID_CP1253 ::
* A superset of Greek ISO 8859-7 (with minor modifications).
*
* FT_WinFNT_ID_CP1254 ::
* A superset of Turkish ISO 8859-9.
*
* FT_WinFNT_ID_CP1255 ::
* A superset of Hebrew ISO 8859-8 (with some modifications).
*
* FT_WinFNT_ID_CP1256 ::
* A superset of Arabic ISO 8859-6 (with different ordering).
*
* FT_WinFNT_ID_CP1257 ::
* A superset of Baltic ISO 8859-13 (with some deviations).
*
* FT_WinFNT_ID_CP1258 ::
* For Vietnamese. This encoding doesn't cover all necessary
* characters.
*
* FT_WinFNT_ID_CP1361 ::
* Korean (Johab).
*/
#define FT_WinFNT_ID_CP1252 0
#define FT_WinFNT_ID_DEFAULT 1
#define FT_WinFNT_ID_SYMBOL 2
#define FT_WinFNT_ID_MAC 77
#define FT_WinFNT_ID_CP932 128
#define FT_WinFNT_ID_CP949 129
#define FT_WinFNT_ID_CP1361 130
#define FT_WinFNT_ID_CP936 134
#define FT_WinFNT_ID_CP950 136
#define FT_WinFNT_ID_CP1253 161
#define FT_WinFNT_ID_CP1254 162
#define FT_WinFNT_ID_CP1258 163
#define FT_WinFNT_ID_CP1255 177
#define FT_WinFNT_ID_CP1256 178
#define FT_WinFNT_ID_CP1257 186
#define FT_WinFNT_ID_CP1251 204
#define FT_WinFNT_ID_CP874 222
#define FT_WinFNT_ID_CP1250 238
#define FT_WinFNT_ID_OEM 255
/*************************************************************************/
/* */
/* <Struct> */
/* FT_WinFNT_HeaderRec */
/* */
/* <Description> */
/* Windows FNT Header info. */
/* */
typedef struct FT_WinFNT_HeaderRec_
{
FT_UShort version;
FT_ULong file_size;
FT_Byte copyright[60];
FT_UShort file_type;
FT_UShort nominal_point_size;
FT_UShort vertical_resolution;
FT_UShort horizontal_resolution;
FT_UShort ascent;
FT_UShort internal_leading;
FT_UShort external_leading;
FT_Byte italic;
FT_Byte underline;
FT_Byte strike_out;
FT_UShort weight;
FT_Byte charset;
FT_UShort pixel_width;
FT_UShort pixel_height;
FT_Byte pitch_and_family;
FT_UShort avg_width;
FT_UShort max_width;
FT_Byte first_char;
FT_Byte last_char;
FT_Byte default_char;
FT_Byte break_char;
FT_UShort bytes_per_row;
FT_ULong device_offset;
FT_ULong face_name_offset;
FT_ULong bits_pointer;
FT_ULong bits_offset;
FT_Byte reserved;
FT_ULong flags;
FT_UShort A_space;
FT_UShort B_space;
FT_UShort C_space;
FT_UShort color_table_offset;
FT_ULong reserved1[4];
} FT_WinFNT_HeaderRec, *FT_WinFNT_Header;
/**********************************************************************
*
* @function:
* FT_Get_WinFNT_Header
*
* @description:
* Retrieve a Windows FNT font info header.
*
* @input:
* face :: A handle to the input face.
*
* @output:
* aheader :: The WinFNT header.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function only works with Windows FNT faces, returning an error
* otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader );
/* */
FT_END_HEADER
#endif /* __FTWINFNT_H__ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */

Some files were not shown because too many files have changed in this diff Show More